diff --git a/web/.npmrc b/web/.npmrc index 1a7f3efcd..1223b5c7d 100644 --- a/web/.npmrc +++ b/web/.npmrc @@ -1,3 +1,2 @@ -optional=false fund=false -audit=false \ No newline at end of file +audit=false diff --git a/web/dist/assets/index.BSGySfUQ.js b/web/dist/assets/index.BSGySfUQ.js new file mode 100644 index 000000000..0593afc82 --- /dev/null +++ b/web/dist/assets/index.BSGySfUQ.js @@ -0,0 +1,10754 @@ +//#region \0rolldown/runtime.js +var __defProp = Object.defineProperty; +var __exportAll = (all, no_symbols) => { + let target = {}; + for (var name in all) __defProp(target, name, { + get: all[name], + enumerable: true + }); + if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" }); + return target; +}; +//#endregion +//#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/@vue/shared/dist/shared.esm-bundler.js +/** +* @vue/shared v3.5.32 +* (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$1 = Object.assign; +var remove = (arr, el) => { + const i = arr.indexOf(el); + if (i > -1) arr.splice(i, 1); +}; +var hasOwnProperty$2 = Object.prototype.hasOwnProperty; +var hasOwn = (val, key) => hasOwnProperty$2.call(val, key); +var isArray$2 = Array.isArray; +var isMap = (val) => toTypeString(val) === "[object Map]"; +var isSet = (val) => toTypeString(val) === "[object Set]"; +var isDate$1 = (val) => toTypeString(val) === "[object Date]"; +var isFunction$2 = (val) => typeof val === "function"; +var isString$1 = (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$2(val)) && isFunction$2(val.then) && isFunction$2(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$1(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 = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return ((str) => { + return cache[str] || (cache[str] = fn(str)); + }); +}; +var camelizeRE = /-\w/g; +var camelize = cacheStringFunction((str) => { + return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase()); +}); +var hyphenateRE = /\B([A-Z])/g; +var hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase()); +var capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); +}); +var toHandlerKey = cacheStringFunction((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 _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$2(value)) { + const res = {}; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + const normalized = isString$1(item) ? parseStringStyle(item) : normalizeStyle(item); + if (normalized) for (const key in normalized) res[key] = normalized[key]; + } + return res; + } else if (isString$1(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$1(value)) res = value; + else if (isArray$2(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(); +} +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$1(a); + let bValidType = isDate$1(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$2(a); + bValidType = isArray$2(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); +} +var isRef$1 = (val) => { + return !!(val && val["__v_isRef"] === true); +}; +var toDisplayString = (val) => { + return isString$1(val) ? val : val == null ? "" : isArray$2(val) || isObject$1(val) && (val.toString === objectToString || !isFunction$2(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$2(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/@vue/reactivity/dist/reactivity.esm-bundler.js +/** +* @vue/reactivity v3.5.32 +* (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.__v_skip = true; + this.parent = activeEffectScope; + if (!detached && activeEffectScope) this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1; + } + 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) { + activeEffectScope = this.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 getCurrentScope() { + return activeEffectScope; +} +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 && activeEffectScope.active) activeEffectScope.effects.push(this); + } + 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$2(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 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$1(this, Symbol.iterator, (item) => toWrapped(this, item)); + }, + concat(...args) { + return reactiveReadArray(this).concat(...args.map((x) => isArray$2(x) ? reactiveReadArray(x) : x)); + }, + entries() { + return iterator$1(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$1(this, "values", (item) => toWrapped(this, item)); + } +}; +function iterator$1(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$1(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$2(target); + if (!isReadonly2) { + let fn; + if (targetIsArray && (fn = arrayInstrumentations[key])) return fn; + if (key === "hasOwnProperty") return hasOwnProperty$1; + } + 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$2(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$2(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 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$1(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$1(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 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; + } +} +function getTargetType(value) { + return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value)); +} +/* @__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); +} +function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!isObject$1(target)) return target; + if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) return target; + const targetType = getTargetType(target); + if (targetType === 0) return target; + const existingProxy = proxyMap.get(target); + if (existingProxy) return existingProxy; + 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; +} +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 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$2(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$2(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$2(s)) return call ? call(s, 2) : s(); + }); + } else if (isFunction$2(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$2(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/@vue/runtime-core/dist/runtime-core.esm-bundler.js +/** +* @vue/runtime-core v3.5.32 +* (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$2(fn)) { + const res = callWithErrorHandling(fn, instance, type, args); + if (res && isPromise(res)) res.catch((err) => { + handleError(err, instance, type); + }); + return res; + } + if (isArray$2(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$2(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 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$2(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$2(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; + } +} +var ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx"); +var useSSRContext = () => { + { + const ctx = inject(ssrContextKey); + if (!ctx) {} + return ctx; + } +}; +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$1({}, 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$1(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); + let cb; + if (isFunction$2(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 TeleportEndKey = /* @__PURE__ */ Symbol("_vte"); +var isTeleport = (type) => type.__isTeleport; +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$2(options) ? extend$1({ name: options.name }, extraOptions, { setup: options }) : options; +} +function markAsyncBoundary(instance) { + instance.ids = [ + instance.ids[0] + instance.ids[2]++ + "-", + 0, + 0 + ]; +} +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$2(rawRef)) { + rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray$2(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$1(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$2(ref)) callWithErrorHandling(ref, owner, 12, [value, refs]); + else { + const _isString = isString$1(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$2(existing) && remove(existing, refValue); + else if (!isArray$2(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; +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 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 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(name) || selfName === capitalize(camelize(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(name)] || registry[capitalize(camelize(name))]); +} +function renderList(source, renderItem, cache, index) { + let ret; + const cached = cache && cache[index]; + const sourceIsArray = isArray$2(source); + if (sourceIsArray || isString$1(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; +} +var getPublicInstance = (i) => { + if (!i) return null; + if (isStatefulComponent(i)) return getComponentPublicInstance(i); + return getPublicInstance(i.parent); +}; +var publicPropertiesMap = /* @__PURE__ */ extend$1(/* @__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 normalizePropsOrEmits(props) { + return isArray$2(props) ? props.reduce((normalized, p) => (normalized[p] = null, normalized), {}) : props; +} +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$2(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$2(opt) ? opt.bind(publicThis, publicThis) : isFunction$2(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP, + set: !isFunction$2(opt) && isFunction$2(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$2(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$2(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$2(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$2(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$2(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$1(raw)) { + const handler = ctx[raw]; + if (isFunction$2(handler)) watch(getter, handler); + } else if (isFunction$2(raw)) watch(getter, raw.bind(publicThis)); + else if (isObject$1(raw)) if (isArray$2(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); + else { + const handler = isFunction$2(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; + if (isFunction$2(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$1(isFunction$2(to) ? to.call(this, this) : to, isFunction$2(from) ? from.call(this, this) : from); + }; +} +function mergeInject(to, from) { + return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); +} +function normalizeInject(raw) { + if (isArray$2(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$1(/* @__PURE__ */ Object.create(null), to, from) : from; +} +function mergeEmitsOrPropsOptions(to, from) { + if (to) { + if (isArray$2(to) && isArray$2(from)) return [.../* @__PURE__ */ new Set([...to, ...from])]; + return extend$1(/* @__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$1(/* @__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$2(rootComponent)) rootComponent = extend$1({}, 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$2(plugin.install)) { + installedPlugins.add(plugin); + plugin.install(app, ...options); + } else if (isFunction$2(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(modelName)}Modifiers`] || props[`${hyphenate(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$1(a) ? a.trim() : a); + if (modifiers.number) args = rawArgs.map(looseToNumber); + } + let handlerName; + let handler = props[handlerName = toHandlerKey(event)] || props[handlerName = toHandlerKey(camelize(event))]; + if (!handler && isModelListener) handler = props[handlerName = toHandlerKey(hyphenate(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$2(comp)) { + const extendEmits = (raw2) => { + const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); + if (normalizedFromExtend) { + hasExtends = true; + extend$1(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$2(raw)) raw.forEach((key) => normalized[key] = null); + else extend$1(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(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; +} +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(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(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(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$2(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(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$2(comp)) { + const extendProps = (raw2) => { + hasExtends = true; + const [props, keys] = normalizePropsOptions(raw2, appContext, true); + extend$1(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$2(raw)) for (let i = 0; i < raw.length; i++) { + const normalizedKey = camelize(raw[i]); + if (validatePropName(normalizedKey)) normalized[normalizedKey] = EMPTY_OBJ; + } + else if (raw) for (const key in raw) { + const normalizedKey = camelize(key); + if (validatePropName(normalizedKey)) { + const opt = raw[key]; + const prop = normalized[normalizedKey] = isArray$2(opt) || isFunction$2(opt) ? { type: opt } : extend$1({}, opt); + const propType = prop.type; + let shouldCast = false; + let shouldCastTrue = true; + if (isArray$2(propType)) for (let index = 0; index < propType.length; ++index) { + const type = propType[index]; + const typeName = isFunction$2(type) && type.name; + if (typeName === "Boolean") { + shouldCast = true; + break; + } else if (typeName === "String") shouldCastTrue = false; + } + else shouldCast = isFunction$2(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$2(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$2(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]; + } +}; +function initFeatureFlags() {} +var queuePostRenderEffect = queueEffectWithSuspense; +function createRenderer(options) { + return baseCreateRenderer(options); +} +function baseCreateRenderer(options, createHydrationFns) { + initFeatureFlags(); + 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) { + 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 = () => { + if (el._isLeaving) el[leaveCbKey](true); + 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$2(ch1) && isArray$2(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; +function queueEffectWithSuspense(fn, suspense) { + if (suspense && suspense.pendingBranch) if (isArray$2(fn)) suspense.effects.push(...fn); + else suspense.effects.push(fn); + else queuePostFlushCb(fn); +} +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$1(ref) || /* @__PURE__ */ isRef(ref) || isFunction$2(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$1(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$1(klass)) props.class = normalizeClass(klass); + if (isObject$1(style)) { + if (/* @__PURE__ */ isProxy(style) && !isArray$2(style)) style = extend$1({}, style); + props.style = normalizeStyle(style); + } + } + const shapeFlag = isString$1(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject$1(type) ? 4 : isFunction$2(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$1({}, 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$2(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 createStaticVNode(content, numberOfNodes) { + const vnode = createVNode(Static, null, content); + vnode.staticCount = numberOfNodes; + return vnode; +} +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$2(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$2(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$2(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$2(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$2(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$1(extend$1({ + 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$2(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; +} +function isClassComponent(value) { + return isFunction$2(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$2(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.32"; +//#endregion +//#region node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +/** +* @vue/runtime-dom v3.5.32 +* (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" ? `${content}` : namespace === "mathml" ? `${content}` : 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 CSS_VAR_TEXT = /* @__PURE__ */ Symbol(""); +var displayRE = /(?:^|;)\s*display\s*:/; +function patchStyle(el, prev, next) { + const style = el.style; + const isCssString = isString$1(next); + let hasControlledDisplay = false; + if (next && !isCssString) { + if (prev) if (!isString$1(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; + setStyle(style, key, next[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$2(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(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(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; +} +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(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; + callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]); + }; + invoker.value = initialValue; + invoker.attached = getNow(); + return invoker; +} +function patchStopImmediatePropagation(e, value) { + if (isArray$2(value)) { + const originalStop = e.stopImmediatePropagation; + e.stopImmediatePropagation = () => { + originalStop.call(e); + e._stopped = true; + }; + return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2)); + } else return value; +} +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$1(nextValue)))) patchDOMProp(el, camelize(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$2(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$1(value)) return false; + return key in el; +} +function shouldSetAsPropForVueCE(el, key) { + const props = el._def.props; + if (!props) return false; + const camelKey = camelize(key); + return Array.isArray(props) ? props.some((prop) => camelize(prop) === camelKey) : Object.keys(props).some((prop) => camelize(prop) === camelKey); +} +var getModelAssigner = (vnode) => { + const fn = vnode.props["onUpdate:modelValue"] || false; + return isArray$2(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 systemModifiers = [ + "ctrl", + "shift", + "alt", + "meta" +]; +var modifierGuards = { + stop: (e) => e.stopPropagation(), + prevent: (e) => e.preventDefault(), + self: (e) => e.target !== e.currentTarget, + ctrl: (e) => !e.ctrlKey, + shift: (e) => !e.shiftKey, + alt: (e) => !e.altKey, + meta: (e) => !e.metaKey, + left: (e) => "button" in e && e.button !== 0, + middle: (e) => "button" in e && e.button !== 1, + right: (e) => "button" in e && e.button !== 2, + exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m)) +}; +var withModifiers = (fn, modifiers) => { + if (!fn) return fn; + const cache = fn._withMods || (fn._withMods = {}); + const cacheKey = modifiers.join("."); + return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => { + for (let i = 0; i < modifiers.length; i++) { + const guard = modifierGuards[modifiers[i]]; + if (guard && guard(event, modifiers)) return; + } + return fn(event, ...args); + })); +}; +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(event.key); + if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) return fn(event); + })); +}; +var rendererOptions = /* @__PURE__ */ extend$1({ 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$2(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$1(container)) return document.querySelector(container); + return container; +} +//#endregion +//#region node_modules/vue-router/dist/useApi-C8XBqGtv.js +/*! +* vue-router v5.0.4 +* (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$1(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$1 = Array.isArray; +function mergeOptions(defaults, partialOptions) { + const options = {}; + for (const key in defaults) options[key] = key in partialOptions ? partialOptions[key] : defaults[key]; + return options; +} +/** +* Flags so we can combine them when checking for multiple errors. This is the internal version of +* {@link NavigationFailureType}. +* +* @internal +*/ +var ErrorTypes = /* @__PURE__ */ function(ErrorTypes) { + ErrorTypes[ErrorTypes["MATCHER_NOT_FOUND"] = 1] = "MATCHER_NOT_FOUND"; + ErrorTypes[ErrorTypes["NAVIGATION_GUARD_REDIRECT"] = 2] = "NAVIGATION_GUARD_REDIRECT"; + ErrorTypes[ErrorTypes["NAVIGATION_ABORTED"] = 4] = "NAVIGATION_ABORTED"; + ErrorTypes[ErrorTypes["NAVIGATION_CANCELLED"] = 8] = "NAVIGATION_CANCELLED"; + ErrorTypes[ErrorTypes["NAVIGATION_DUPLICATED"] = 16] = "NAVIGATION_DUPLICATED"; + return ErrorTypes; +}({}); +var NavigationFailureSymbol = Symbol(""); +ErrorTypes.MATCHER_NOT_FOUND, ErrorTypes.NAVIGATION_GUARD_REDIRECT, ErrorTypes.NAVIGATION_ABORTED, ErrorTypes.NAVIGATION_CANCELLED, ErrorTypes.NAVIGATION_DUPLICATED; +/** +* 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 current route location. Equivalent to using `$route` inside +* templates. +*/ +function useRoute(_name) { + return inject(routeLocationKey); +} +//#endregion +//#region \0@oxc-project+runtime@0.123.0/helpers/typeof.js +function _typeof(o) { + "@babel/helpers - typeof"; + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { + return typeof o; + } : function(o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, _typeof(o); +} +//#endregion +//#region \0@oxc-project+runtime@0.123.0/helpers/toPrimitive.js +function toPrimitive(t, r) { + if ("object" != _typeof(t) || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != _typeof(i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +//#endregion +//#region \0@oxc-project+runtime@0.123.0/helpers/toPropertyKey.js +function toPropertyKey(t) { + var i = toPrimitive(t, "string"); + return "symbol" == _typeof(i) ? i : i + ""; +} +//#endregion +//#region \0@oxc-project+runtime@0.123.0/helpers/defineProperty.js +function _defineProperty(e, r, t) { + return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { + value: t, + enumerable: !0, + configurable: !0, + writable: !0 + }) : e[r] = t, e; +} +//#endregion +//#region \0@oxc-project+runtime@0.123.0/helpers/objectSpread2.js +function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r) { + return Object.getOwnPropertyDescriptor(e, r).enumerable; + })), t.push.apply(t, o); + } + return t; +} +function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), !0).forEach(function(r) { + _defineProperty(e, r, t[r]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) { + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); + }); + } + return e; +} +//#endregion +//#region \0@oxc-project+runtime@0.123.0/helpers/asyncToGenerator.js +function asyncGeneratorStep(n, t, e, r, o, a, c) { + try { + var i = n[a](c), u = i.value; + } catch (n) { + e(n); + return; + } + i.done ? t(u) : Promise.resolve(u).then(r, o); +} +function _asyncToGenerator(n) { + return function() { + var t = this, e = arguments; + return new Promise(function(r, o) { + var a = n.apply(t, e); + function _next(n) { + asyncGeneratorStep(a, r, o, _next, _throw, "next", n); + } + function _throw(n) { + asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); + } + _next(void 0); + }); + }; +} +//#endregion +//#region node_modules/vue-router/dist/devtools-DUDsFuj9.js +/*! +* vue-router v5.0.4 +* (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 (err) {} + 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$1(a) ? isEquivalentArray(a, b) : isArray$1(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$1(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 +}; +var NavigationType = /* @__PURE__ */ function(NavigationType) { + NavigationType["pop"] = "pop"; + NavigationType["push"] = "push"; + return NavigationType; +}({}); +var NavigationDirection = /* @__PURE__ */ function(NavigationDirection) { + NavigationDirection["back"] = "back"; + NavigationDirection["forward"] = "forward"; + NavigationDirection["unknown"] = ""; + return NavigationDirection; +}({}); +/** +* 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$1(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$1(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$1(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(ErrorTypes.NAVIGATION_ABORTED, { + from, + to + })); + else if (valid instanceof Error) reject(valid); + else if (isRouteLocation(valid)) reject(createRouterError(ErrorTypes.NAVIGATION_GUARD_REDIRECT, { + 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/vue-router/dist/vue-router.js +/*! +* vue-router v5.0.4 +* (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: NavigationType.pop, + direction: delta ? delta > 0 ? NavigationDirection.forward : NavigationDirection.back : NavigationDirection.unknown + }); + }); + }; + 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; +} +var TokenType = /* @__PURE__ */ function(TokenType) { + TokenType[TokenType["Static"] = 0] = "Static"; + TokenType[TokenType["Param"] = 1] = "Param"; + TokenType[TokenType["Group"] = 2] = "Group"; + return TokenType; +}({}); +var TokenizerState = /* @__PURE__ */ function(TokenizerState) { + TokenizerState[TokenizerState["Static"] = 0] = "Static"; + TokenizerState[TokenizerState["Param"] = 1] = "Param"; + TokenizerState[TokenizerState["ParamRegExp"] = 2] = "ParamRegExp"; + TokenizerState[TokenizerState["ParamRegExpEnd"] = 3] = "ParamRegExpEnd"; + TokenizerState[TokenizerState["EscapeNext"] = 4] = "EscapeNext"; + return TokenizerState; +}(TokenizerState || {}); +var ROOT_TOKEN = { + type: TokenType.Static, + 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 = TokenizerState.Static; + 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 === TokenizerState.Static) segment.push({ + type: TokenType.Static, + value: buffer + }); + else if (state === TokenizerState.Param || state === TokenizerState.ParamRegExp || state === TokenizerState.ParamRegExpEnd) { + if (segment.length > 1 && (char === "*" || char === "+")) crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`); + segment.push({ + type: TokenType.Param, + 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++]; + if (char === "\\" && state !== TokenizerState.ParamRegExp) { + previousState = state; + state = TokenizerState.EscapeNext; + continue; + } + switch (state) { + case TokenizerState.Static: + if (char === "/") { + if (buffer) consumeBuffer(); + finalizeSegment(); + } else if (char === ":") { + consumeBuffer(); + state = TokenizerState.Param; + } else addCharToBuffer(); + break; + case TokenizerState.EscapeNext: + addCharToBuffer(); + state = previousState; + break; + case TokenizerState.Param: + if (char === "(") state = TokenizerState.ParamRegExp; + else if (VALID_PARAM_RE.test(char)) addCharToBuffer(); + else { + consumeBuffer(); + state = TokenizerState.Static; + if (char !== "*" && char !== "?" && char !== "+") i--; + } + break; + case TokenizerState.ParamRegExp: + if (char === ")") if (customRe[customRe.length - 1] == "\\") customRe = customRe.slice(0, -1) + char; + else state = TokenizerState.ParamRegExpEnd; + else customRe += char; + break; + case TokenizerState.ParamRegExpEnd: + consumeBuffer(); + state = TokenizerState.Static; + if (char !== "*" && char !== "?" && char !== "+") i--; + customRe = ""; + break; + default: + crash("Unknown state"); + break; + } + } + if (state === TokenizerState.ParamRegExp) 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 PathScore = /* @__PURE__ */ function(PathScore) { + PathScore[PathScore["_multiplier"] = 10] = "_multiplier"; + PathScore[PathScore["Root"] = 90] = "Root"; + PathScore[PathScore["Segment"] = 40] = "Segment"; + PathScore[PathScore["SubSegment"] = 30] = "SubSegment"; + PathScore[PathScore["Static"] = 40] = "Static"; + PathScore[PathScore["Dynamic"] = 20] = "Dynamic"; + PathScore[PathScore["BonusCustomRegExp"] = 10] = "BonusCustomRegExp"; + PathScore[PathScore["BonusWildcard"] = -50] = "BonusWildcard"; + PathScore[PathScore["BonusRepeatable"] = -20] = "BonusRepeatable"; + PathScore[PathScore["BonusOptional"] = -8] = "BonusOptional"; + PathScore[PathScore["BonusStrict"] = .7000000000000001] = "BonusStrict"; + PathScore[PathScore["BonusCaseSensitive"] = .25] = "BonusCaseSensitive"; + return PathScore; +}(PathScore || {}); +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 ? [] : [PathScore.Root]; + if (options.strict && !segment.length) pattern += "/"; + for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) { + const token = segment[tokenIndex]; + let subSegmentScore = PathScore.Segment + (options.sensitive ? PathScore.BonusCaseSensitive : 0); + if (token.type === TokenType.Static) { + if (!tokenIndex) pattern += "/"; + pattern += token.value.replace(REGEX_CHARS_RE, "\\$&"); + subSegmentScore += PathScore.Static; + } else if (token.type === TokenType.Param) { + 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 += PathScore.BonusCustomRegExp; + 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 += PathScore.Dynamic; + if (optional) subSegmentScore += PathScore.BonusOptional; + if (repeatable) subSegmentScore += PathScore.BonusRepeatable; + if (re === ".*") subSegmentScore += PathScore.BonusWildcard; + } + segmentScores.push(subSegmentScore); + } + score.push(segmentScores); + } + if (options.strict && options.end) { + const i = score.length - 1; + score[i][score[i].length - 1] += PathScore.BonusStrict; + } + 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 === TokenType.Static) path += token.value; + else if (token.type === TokenType.Param) { + const { value, repeatable, optional } = token; + const param = value in params ? params[value] : ""; + if (isArray$1(param) && !repeatable) throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`); + const text = isArray$1(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] === PathScore.Static + PathScore.Segment ? -1 : 1; + else if (a.length > b.length) return b.length === 1 && b[0] === PathScore.Static + PathScore.Segment ? 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(ErrorTypes.MATCHER_NOT_FOUND, { 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; + } + } else { + matcher = currentLocation.name ? matcherMap.get(currentLocation.name) : matchers.find((m) => m.re.test(currentLocation.path)); + if (!matcher) throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND, { + 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$1(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), + hash: decode(locationNormalized.hash), + 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(ErrorTypes.NAVIGATION_CANCELLED, { + 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(ErrorTypes.NAVIGATION_DUPLICATED, { + to: toLocation, + from + }); + handleScroll(from, from, true, false); + } + return (failure ? Promise.resolve(failure) : navigate(toLocation, from)).catch((error) => isNavigationFailure(error) ? isNavigationFailure(error, ErrorTypes.NAVIGATION_GUARD_REDIRECT) ? error : markAsReady(error) : triggerError(error, toLocation, from)).then((failure) => { + if (failure) { + if (isNavigationFailure(failure, ErrorTypes.NAVIGATION_GUARD_REDIRECT)) 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$1(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, ErrorTypes.NAVIGATION_CANCELLED) ? 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, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_CANCELLED)) return error; + if (isNavigationFailure(error, ErrorTypes.NAVIGATION_GUARD_REDIRECT)) { + pushWithRedirect(assign(locationAsObject(error.to), { force: true }), toLocation).then((failure) => { + if (isNavigationFailure(failure, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED) && !info.delta && info.type === NavigationType.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, ErrorTypes.NAVIGATION_CANCELLED)) routerHistory.go(-info.delta, false); + else if (info.type === NavigationType.pop && isNavigationFailure(failure, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED)) 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 node_modules/axios/lib/helpers/bind.js +/** +* Create a bound version of a function with a specified `this` context +* +* @param {Function} fn - The function to bind +* @param {*} thisArg - The value to be passed as the `this` parameter +* @returns {Function} A new function that will call the original function with the specified `this` context +*/ +function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} +//#endregion +//#region node_modules/axios/lib/utils.js +var { toString } = Object.prototype; +var { getPrototypeOf } = Object; +var { iterator, toStringTag } = Symbol; +var kindOf = ((cache) => (thing) => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); +var kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type; +}; +var typeOfTest = (type) => (thing) => typeof thing === type; +/** +* Determine if a value is a non-null object +* +* @param {Object} val The value to test +* +* @returns {boolean} True if value is an Array, otherwise false +*/ +var { isArray } = Array; +/** +* Determine if a value is undefined +* +* @param {*} val The value to test +* +* @returns {boolean} True if the value is undefined, otherwise false +*/ +var isUndefined = typeOfTest("undefined"); +/** +* Determine if a value is a Buffer +* +* @param {*} val The value to test +* +* @returns {boolean} True if value is a Buffer, otherwise false +*/ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} +/** +* Determine if a value is an ArrayBuffer +* +* @param {*} val The value to test +* +* @returns {boolean} True if value is an ArrayBuffer, otherwise false +*/ +var isArrayBuffer = kindOfTest("ArrayBuffer"); +/** +* Determine if a value is a view on an ArrayBuffer +* +* @param {*} val The value to test +* +* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false +*/ +function isArrayBufferView(val) { + let result; + if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) result = ArrayBuffer.isView(val); + else result = val && val.buffer && isArrayBuffer(val.buffer); + return result; +} +/** +* Determine if a value is a String +* +* @param {*} val The value to test +* +* @returns {boolean} True if value is a String, otherwise false +*/ +var isString = typeOfTest("string"); +/** +* Determine if a value is a Function +* +* @param {*} val The value to test +* @returns {boolean} True if value is a Function, otherwise false +*/ +var isFunction$1 = typeOfTest("function"); +/** +* Determine if a value is a Number +* +* @param {*} val The value to test +* +* @returns {boolean} True if value is a Number, otherwise false +*/ +var isNumber = typeOfTest("number"); +/** +* Determine if a value is an Object +* +* @param {*} thing The value to test +* +* @returns {boolean} True if value is an Object, otherwise false +*/ +var isObject = (thing) => thing !== null && typeof thing === "object"; +/** +* Determine if a value is a Boolean +* +* @param {*} thing The value to test +* @returns {boolean} True if value is a Boolean, otherwise false +*/ +var isBoolean = (thing) => thing === true || thing === false; +/** +* Determine if a value is a plain Object +* +* @param {*} val The value to test +* +* @returns {boolean} True if value is a plain Object, otherwise false +*/ +var isPlainObject = (val) => { + if (kindOf(val) !== "object") return false; + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val); +}; +/** +* Determine if a value is an empty object (safely handles Buffers) +* +* @param {*} val The value to test +* +* @returns {boolean} True if value is an empty object, otherwise false +*/ +var isEmptyObject = (val) => { + if (!isObject(val) || isBuffer(val)) return false; + try { + return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; + } catch (e) { + return false; + } +}; +/** +* Determine if a value is a Date +* +* @param {*} val The value to test +* +* @returns {boolean} True if value is a Date, otherwise false +*/ +var isDate = kindOfTest("Date"); +/** +* Determine if a value is a File +* +* @param {*} val The value to test +* +* @returns {boolean} True if value is a File, otherwise false +*/ +var isFile = kindOfTest("File"); +/** +* Determine if a value is a React Native Blob +* React Native "blob": an object with a `uri` attribute. Optionally, it can +* also have a `name` and `type` attribute to specify filename and content type +* +* @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71 +* +* @param {*} value The value to test +* +* @returns {boolean} True if value is a React Native Blob, otherwise false +*/ +var isReactNativeBlob = (value) => { + return !!(value && typeof value.uri !== "undefined"); +}; +/** +* Determine if environment is React Native +* ReactNative `FormData` has a non-standard `getParts()` method +* +* @param {*} formData The formData to test +* +* @returns {boolean} True if environment is React Native, otherwise false +*/ +var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined"; +/** +* Determine if a value is a Blob +* +* @param {*} val The value to test +* +* @returns {boolean} True if value is a Blob, otherwise false +*/ +var isBlob = kindOfTest("Blob"); +/** +* Determine if a value is a FileList +* +* @param {*} val The value to test +* +* @returns {boolean} True if value is a File, otherwise false +*/ +var isFileList = kindOfTest("FileList"); +/** +* Determine if a value is a Stream +* +* @param {*} val The value to test +* +* @returns {boolean} True if value is a Stream, otherwise false +*/ +var isStream = (val) => isObject(val) && isFunction$1(val.pipe); +/** +* Determine if a value is a FormData +* +* @param {*} thing The value to test +* +* @returns {boolean} True if value is an FormData, otherwise false +*/ +function getGlobal() { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + return {}; +} +var G = getGlobal(); +var FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0; +var isFormData = (thing) => { + let kind; + return thing && (FormDataCtor && thing instanceof FormDataCtor || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]")); +}; +/** +* Determine if a value is a URLSearchParams object +* +* @param {*} val The value to test +* +* @returns {boolean} True if value is a URLSearchParams object, otherwise false +*/ +var isURLSearchParams = kindOfTest("URLSearchParams"); +var [isReadableStream, isRequest, isResponse, isHeaders] = [ + "ReadableStream", + "Request", + "Response", + "Headers" +].map(kindOfTest); +/** +* Trim excess whitespace off the beginning and end of a string +* +* @param {String} str The String to trim +* +* @returns {String} The String freed of excess whitespace +*/ +var trim = (str) => { + return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); +}; +/** +* Iterate over an Array or an Object invoking a function for each item. +* +* If `obj` is an Array callback will be called passing +* the value, index, and complete array for each item. +* +* If 'obj' is an Object callback will be called passing +* the value, key, and complete object for each property. +* +* @param {Object|Array} obj The object to iterate +* @param {Function} fn The callback to invoke for each item +* +* @param {Object} [options] +* @param {Boolean} [options.allOwnKeys = false] +* @returns {any} +*/ +function forEach(obj, fn, { allOwnKeys = false } = {}) { + if (obj === null || typeof obj === "undefined") return; + let i; + let l; + if (typeof obj !== "object") obj = [obj]; + if (isArray(obj)) for (i = 0, l = obj.length; i < l; i++) fn.call(null, obj[i], i, obj); + else { + if (isBuffer(obj)) return; + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} +/** +* Finds a key in an object, case-insensitive, returning the actual key name. +* Returns null if the object is a Buffer or if no match is found. +* +* @param {Object} obj - The object to search. +* @param {string} key - The key to find (case-insensitive). +* @returns {?string} The actual key name if found, otherwise null. +*/ +function findKey(obj, key) { + if (isBuffer(obj)) return null; + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) return _key; + } + return null; +} +var _global = (() => { + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global; +})(); +var isContextDefined = (context) => !isUndefined(context) && context !== _global; +/** +* Accepts varargs expecting each argument to be an object, then +* immutably merges the properties of each object and returns result. +* +* When multiple objects contain the same key the later object in +* the arguments list will take precedence. +* +* Example: +* +* ```js +* const result = merge({foo: 123}, {foo: 456}); +* console.log(result.foo); // outputs 456 +* ``` +* +* @param {Object} obj1 Object to merge +* +* @returns {Object} Result of all merge properties +*/ +function merge() { + const { caseless, skipUndefined } = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + if (key === "__proto__" || key === "constructor" || key === "prototype") return; + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) result[targetKey] = merge(result[targetKey], val); + else if (isPlainObject(val)) result[targetKey] = merge({}, val); + else if (isArray(val)) result[targetKey] = val.slice(); + else if (!skipUndefined || !isUndefined(val)) result[targetKey] = val; + }; + for (let i = 0, l = arguments.length; i < l; i++) arguments[i] && forEach(arguments[i], assignValue); + return result; +} +/** +* Extends object a by mutably adding to it the properties of object b. +* +* @param {Object} a The object to be extended +* @param {Object} b The object to copy properties from +* @param {Object} thisArg The object to bind function to +* +* @param {Object} [options] +* @param {Boolean} [options.allOwnKeys] +* @returns {Object} The resulting value of object a +*/ +var extend = (a, b, thisArg, { allOwnKeys } = {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction$1(val)) Object.defineProperty(a, key, { + value: bind(val, thisArg), + writable: true, + enumerable: true, + configurable: true + }); + else Object.defineProperty(a, key, { + value: val, + writable: true, + enumerable: true, + configurable: true + }); + }, { allOwnKeys }); + return a; +}; +/** +* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) +* +* @param {string} content with BOM +* +* @returns {string} content value without BOM +*/ +var stripBOM = (content) => { + if (content.charCodeAt(0) === 65279) content = content.slice(1); + return content; +}; +/** +* Inherit the prototype methods from one constructor into another +* @param {function} constructor +* @param {function} superConstructor +* @param {object} [props] +* @param {object} [descriptors] +* +* @returns {void} +*/ +var inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + Object.defineProperty(constructor.prototype, "constructor", { + value: constructor, + writable: true, + enumerable: false, + configurable: true + }); + Object.defineProperty(constructor, "super", { value: superConstructor.prototype }); + props && Object.assign(constructor.prototype, props); +}; +/** +* Resolve object with deep prototype chain to a flat object +* @param {Object} sourceObj source object +* @param {Object} [destObj] +* @param {Function|Boolean} [filter] +* @param {Function} [propFilter] +* +* @returns {Object} +*/ +var toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + destObj = destObj || {}; + if (sourceObj == null) return destObj; + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + return destObj; +}; +/** +* Determines whether a string ends with the characters of a specified string +* +* @param {String} str +* @param {String} searchString +* @param {Number} [position= 0] +* +* @returns {boolean} +*/ +var endsWith = (str, searchString, position) => { + str = String(str); + if (position === void 0 || position > str.length) position = str.length; + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +}; +/** +* Returns new array from array like object or null if failed +* +* @param {*} [thing] +* +* @returns {?Array} +*/ +var toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) arr[i] = thing[i]; + return arr; +}; +/** +* Checking if the Uint8Array exists and if it does, it returns a function that checks if the +* thing passed in is an instance of Uint8Array +* +* @param {TypedArray} +* +* @returns {Array} +*/ +var isTypedArray = ((TypedArray) => { + return (thing) => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array)); +/** +* For each entry in the object, call the function with the key and value. +* +* @param {Object} obj - The object to iterate over. +* @param {Function} fn - The function to call for each entry. +* +* @returns {void} +*/ +var forEachEntry = (obj, fn) => { + const _iterator = (obj && obj[iterator]).call(obj); + let result; + while ((result = _iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +}; +/** +* It takes a regular expression and a string, and returns an array of all the matches +* +* @param {string} regExp - The regular expression to match against. +* @param {string} str - The string to search. +* +* @returns {Array} +*/ +var matchAll = (regExp, str) => { + let matches; + const arr = []; + while ((matches = regExp.exec(str)) !== null) arr.push(matches); + return arr; +}; +var isHTMLForm = kindOfTest("HTMLFormElement"); +var toCamelCase = (str) => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + }); +}; +var hasOwnProperty = (({ hasOwnProperty }) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); +/** +* Determine if a value is a RegExp object +* +* @param {*} val The value to test +* +* @returns {boolean} True if value is a RegExp object, otherwise false +*/ +var isRegExp = kindOfTest("RegExp"); +var reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + forEach(descriptors, (descriptor, name) => { + let ret; + if ((ret = reducer(descriptor, name, obj)) !== false) reducedDescriptors[name] = ret || descriptor; + }); + Object.defineProperties(obj, reducedDescriptors); +}; +/** +* Makes all methods read-only +* @param {Object} obj +*/ +var freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + if (isFunction$1(obj) && [ + "arguments", + "caller", + "callee" + ].indexOf(name) !== -1) return false; + const value = obj[name]; + if (!isFunction$1(value)) return; + descriptor.enumerable = false; + if ("writable" in descriptor) { + descriptor.writable = false; + return; + } + if (!descriptor.set) descriptor.set = () => { + throw Error("Can not rewrite read-only method '" + name + "'"); + }; + }); +}; +/** +* Converts an array or a delimited string into an object set with values as keys and true as values. +* Useful for fast membership checks. +* +* @param {Array|string} arrayOrString - The array or string to convert. +* @param {string} delimiter - The delimiter to use if input is a string. +* @returns {Object} An object with keys from the array or string, values set to true. +*/ +var toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + const define = (arr) => { + arr.forEach((value) => { + obj[value] = true; + }); + }; + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + return obj; +}; +var noop = () => {}; +var toFiniteNumber = (value, defaultValue) => { + return value != null && Number.isFinite(value = +value) ? value : defaultValue; +}; +/** +* If the thing is a FormData object, return true, otherwise return false. +* +* @param {unknown} thing - The thing to check. +* +* @returns {boolean} +*/ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]); +} +/** +* Recursively converts an object to a JSON-compatible object, handling circular references and Buffers. +* +* @param {Object} obj - The object to convert. +* @returns {Object} The JSON-compatible object. +*/ +var toJSONObject = (obj) => { + const stack = new Array(10); + const visit = (source, i) => { + if (isObject(source)) { + if (stack.indexOf(source) >= 0) return; + if (isBuffer(source)) return source; + if (!("toJSON" in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + stack[i] = void 0; + return target; + } + } + return source; + }; + return visit(obj, 0); +}; +/** +* Determines if a value is an async function. +* +* @param {*} thing - The value to test. +* @returns {boolean} True if value is an async function, otherwise false. +*/ +var isAsyncFn = kindOfTest("AsyncFunction"); +/** +* Determines if a value is thenable (has then and catch methods). +* +* @param {*} thing - The value to test. +* @returns {boolean} True if value is thenable, otherwise false. +*/ +var isThenable = (thing) => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch); +/** +* Provides a cross-platform setImmediate implementation. +* Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout. +* +* @param {boolean} setImmediateSupported - Whether setImmediate is supported. +* @param {boolean} postMessageSupported - Whether postMessage is supported. +* @returns {Function} A function to schedule a callback asynchronously. +*/ +var _setImmediate = ((setImmediateSupported, postMessageSupported) => { + if (setImmediateSupported) return setImmediate; + return postMessageSupported ? ((token, callbacks) => { + _global.addEventListener("message", ({ source, data }) => { + if (source === _global && data === token) callbacks.length && callbacks.shift()(); + }, false); + return (cb) => { + callbacks.push(cb); + _global.postMessage(token, "*"); + }; + })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); +})(typeof setImmediate === "function", isFunction$1(_global.postMessage)); +/** +* Schedules a microtask or asynchronous callback as soon as possible. +* Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate. +* +* @type {Function} +*/ +var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; +var isIterable = (thing) => thing != null && isFunction$1(thing[iterator]); +var utils_default = { + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isEmptyObject, + isReadableStream, + isRequest, + isResponse, + isHeaders, + isUndefined, + isDate, + isFile, + isReactNativeBlob, + isReactNative, + isBlob, + isRegExp, + isFunction: isFunction$1, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + isSpecCompliantForm, + toJSONObject, + isAsyncFn, + isThenable, + setImmediate: _setImmediate, + asap, + isIterable +}; +//#endregion +//#region node_modules/axios/lib/core/AxiosError.js +var AxiosError = class AxiosError extends Error { + static from(error, code, config, request, response, customProps) { + const axiosError = new AxiosError(error.message, code || error.code, config, request, response); + axiosError.cause = error; + axiosError.name = error.name; + if (error.status != null && axiosError.status == null) axiosError.status = error.status; + customProps && Object.assign(axiosError, customProps); + return axiosError; + } + /** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ + constructor(message, code, config, request, response) { + super(message); + Object.defineProperty(this, "message", { + value: message, + enumerable: true, + writable: true, + configurable: true + }); + this.name = "AxiosError"; + this.isAxiosError = true; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + if (response) { + this.response = response; + this.status = response.status; + } + } + toJSON() { + return { + message: this.message, + name: this.name, + description: this.description, + number: this.number, + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + config: utils_default.toJSONObject(this.config), + code: this.code, + status: this.status + }; + } +}; +AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE"; +AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION"; +AxiosError.ECONNABORTED = "ECONNABORTED"; +AxiosError.ETIMEDOUT = "ETIMEDOUT"; +AxiosError.ERR_NETWORK = "ERR_NETWORK"; +AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS"; +AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED"; +AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE"; +AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST"; +AxiosError.ERR_CANCELED = "ERR_CANCELED"; +AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT"; +AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL"; +//#endregion +//#region node_modules/axios/lib/helpers/toFormData.js +/** +* Determines if the given thing is a array or js object. +* +* @param {string} thing - The object or array to be visited. +* +* @returns {boolean} +*/ +function isVisitable(thing) { + return utils_default.isPlainObject(thing) || utils_default.isArray(thing); +} +/** +* It removes the brackets from the end of a string +* +* @param {string} key - The key of the parameter. +* +* @returns {string} the key without the brackets. +*/ +function removeBrackets(key) { + return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key; +} +/** +* It takes a path, a key, and a boolean, and returns a string +* +* @param {string} path - The path to the current key. +* @param {string} key - The key of the current object being iterated over. +* @param {string} dots - If true, the key will be rendered with dots instead of brackets. +* +* @returns {string} The path to the current key. +*/ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + token = removeBrackets(token); + return !dots && i ? "[" + token + "]" : token; + }).join(dots ? "." : ""); +} +/** +* If the array is an array and none of its elements are visitable, then it's a flat array. +* +* @param {Array} arr - The array to check +* +* @returns {boolean} +*/ +function isFlatArray(arr) { + return utils_default.isArray(arr) && !arr.some(isVisitable); +} +var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); +/** +* Convert a data object to FormData +* +* @param {Object} obj +* @param {?Object} [formData] +* @param {?Object} [options] +* @param {Function} [options.visitor] +* @param {Boolean} [options.metaTokens = true] +* @param {Boolean} [options.dots = false] +* @param {?Boolean} [options.indexes = false] +* +* @returns {Object} +**/ +/** +* It converts an object into a FormData object +* +* @param {Object} obj - The object to convert to form data. +* @param {string} formData - The FormData object to append to. +* @param {Object} options +* +* @returns +*/ +function toFormData(obj, formData, options) { + if (!utils_default.isObject(obj)) throw new TypeError("target must be an object"); + formData = formData || new FormData(); + options = utils_default.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + return !utils_default.isUndefined(source[option]); + }); + const metaTokens = options.metaTokens; + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const useBlob = (options.Blob || typeof Blob !== "undefined" && Blob) && utils_default.isSpecCompliantForm(formData); + if (!utils_default.isFunction(visitor)) throw new TypeError("visitor must be a function"); + function convertValue(value) { + if (value === null) return ""; + if (utils_default.isDate(value)) return value.toISOString(); + if (utils_default.isBoolean(value)) return value.toString(); + if (!useBlob && utils_default.isBlob(value)) throw new AxiosError("Blob is not supported. Use a Buffer instead."); + if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value); + return value; + } + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + if (utils_default.isReactNative(formData) && utils_default.isReactNativeBlob(value)) { + formData.append(renderKey(path, key, dots), convertValue(value)); + return false; + } + if (value && !path && typeof value === "object") { + if (utils_default.endsWith(key, "{}")) { + key = metaTokens ? key : key.slice(0, -2); + value = JSON.stringify(value); + } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) { + key = removeBrackets(key); + arr.forEach(function each(el, index) { + !(utils_default.isUndefined(el) || el === null) && formData.append(indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]", convertValue(el)); + }); + return false; + } + } + if (isVisitable(value)) return true; + formData.append(renderKey(path, key, dots), convertValue(value)); + return false; + } + const stack = []; + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + function build(value, path) { + if (utils_default.isUndefined(value)) return; + if (stack.indexOf(value) !== -1) throw Error("Circular reference detected in " + path.join(".")); + stack.push(value); + utils_default.forEach(value, function each(el, key) { + if ((!(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key, path, exposedHelpers)) === true) build(el, path ? path.concat(key) : [key]); + }); + stack.pop(); + } + if (!utils_default.isObject(obj)) throw new TypeError("data must be an object"); + build(obj); + return formData; +} +//#endregion +//#region node_modules/axios/lib/helpers/AxiosURLSearchParams.js +/** +* It encodes a string by replacing all characters that are not in the unreserved set with +* their percent-encoded equivalents +* +* @param {string} str - The string to encode. +* +* @returns {string} The encoded string. +*/ +function encode$1(str) { + const charMap = { + "!": "%21", + "'": "%27", + "(": "%28", + ")": "%29", + "~": "%7E", + "%20": "+", + "%00": "\0" + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} +/** +* It takes a params object and converts it to a FormData object +* +* @param {Object} params - The parameters to be converted to a FormData object. +* @param {Object} options - The options object passed to the Axios constructor. +* +* @returns {void} +*/ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + params && toFormData(params, this, options); +} +var prototype = AxiosURLSearchParams.prototype; +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode$1); + } : encode$1; + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + "=" + _encode(pair[1]); + }, "").join("&"); +}; +//#endregion +//#region node_modules/axios/lib/helpers/buildURL.js +/** +* It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with +* their plain counterparts (`:`, `$`, `,`, `+`). +* +* @param {string} val The value to be encoded. +* +* @returns {string} The encoded value. +*/ +function encode(val) { + return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+"); +} +/** +* Build a URL by appending params to the end +* +* @param {string} url The base of the url (e.g., http://www.google.com) +* @param {object} [params] The params to be appended +* @param {?(object|Function)} options +* +* @returns {string} The formatted url +*/ +function buildURL(url, params, options) { + if (!params) return url; + const _encode = options && options.encode || encode; + const _options = utils_default.isFunction(options) ? { serialize: options } : options; + const serializeFn = _options && _options.serialize; + let serializedParams; + if (serializeFn) serializedParams = serializeFn(params, _options); + else serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode); + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + if (hashmarkIndex !== -1) url = url.slice(0, hashmarkIndex); + url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams; + } + return url; +} +//#endregion +//#region node_modules/axios/lib/core/InterceptorManager.js +var InterceptorManager = class { + constructor() { + this.handlers = []; + } + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * @param {Object} options The options for the interceptor, synchronous and runWhen + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {void} + */ + eject(id) { + if (this.handlers[id]) this.handlers[id] = null; + } + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) this.handlers = []; + } + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + utils_default.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) fn(h); + }); + } +}; +//#endregion +//#region node_modules/axios/lib/defaults/transitional.js +var transitional_default = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false, + legacyInterceptorReqResOrdering: true +}; +//#endregion +//#region node_modules/axios/lib/platform/browser/index.js +var browser_default = { + isBrowser: true, + classes: { + URLSearchParams: typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams, + FormData: typeof FormData !== "undefined" ? FormData : null, + Blob: typeof Blob !== "undefined" ? Blob : null + }, + protocols: [ + "http", + "https", + "file", + "blob", + "url", + "data" + ] +}; +//#endregion +//#region node_modules/axios/lib/platform/common/utils.js +var utils_exports = /* @__PURE__ */ __exportAll({ + hasBrowserEnv: () => hasBrowserEnv, + hasStandardBrowserEnv: () => hasStandardBrowserEnv, + hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv, + navigator: () => _navigator, + origin: () => origin +}); +var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; +var _navigator = typeof navigator === "object" && navigator || void 0; +/** +* Determine if we're running in a standard browser environment +* +* This allows axios to run in a web worker, and react-native. +* Both environments support XMLHttpRequest, but not fully standard globals. +* +* web workers: +* typeof window -> undefined +* typeof document -> undefined +* +* react-native: +* navigator.product -> 'ReactNative' +* nativescript +* navigator.product -> 'NativeScript' or 'NS' +* +* @returns {boolean} +*/ +var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || [ + "ReactNative", + "NativeScript", + "NS" +].indexOf(_navigator.product) < 0); +/** +* Determine if we're running in a standard browser webWorker environment +* +* Although the `isStandardBrowserEnv` method indicates that +* `allows axios to run in a web worker`, the WebWorker will still be +* filtered out due to its judgment standard +* `typeof window !== 'undefined' && typeof document !== 'undefined'`. +* This leads to a problem when axios post `FormData` in webWorker +*/ +var hasStandardBrowserWebWorkerEnv = typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; +var origin = hasBrowserEnv && window.location.href || "http://localhost"; +//#endregion +//#region node_modules/axios/lib/platform/index.js +var platform_default = _objectSpread2(_objectSpread2({}, utils_exports), browser_default); +//#endregion +//#region node_modules/axios/lib/helpers/toURLEncodedForm.js +function toURLEncodedForm(data, options) { + return toFormData(data, new platform_default.classes.URLSearchParams(), _objectSpread2({ visitor: function(value, key, path, helpers) { + if (platform_default.isNode && utils_default.isBuffer(value)) { + this.append(key, value.toString("base64")); + return false; + } + return helpers.defaultVisitor.apply(this, arguments); + } }, options)); +} +//#endregion +//#region node_modules/axios/lib/helpers/formDataToJSON.js +/** +* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] +* +* @param {string} name - The name of the property to get. +* +* @returns An array of strings. +*/ +function parsePropPath(name) { + return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => { + return match[0] === "[]" ? "" : match[1] || match[0]; + }); +} +/** +* Convert an array to an object. +* +* @param {Array} arr - The array to convert to an object. +* +* @returns An object with the same keys and values as the array. +*/ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} +/** +* It takes a FormData object and returns a JavaScript object +* +* @param {string} formData The FormData object to convert to JSON. +* +* @returns {Object | null} The converted object. +*/ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + if (name === "__proto__") return true; + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && utils_default.isArray(target) ? target.length : name; + if (isLast) { + if (utils_default.hasOwnProp(target, name)) target[name] = [target[name], value]; + else target[name] = value; + return !isNumericKey; + } + if (!target[name] || !utils_default.isObject(target[name])) target[name] = []; + if (buildPath(path, value, target[name], index) && utils_default.isArray(target[name])) target[name] = arrayToObject(target[name]); + return !isNumericKey; + } + if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) { + const obj = {}; + utils_default.forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + return obj; + } + return null; +} +//#endregion +//#region node_modules/axios/lib/defaults/index.js +/** +* It takes a string, tries to parse it, and if it fails, it returns the stringified version +* of the input +* +* @param {any} rawValue - The value to be stringified. +* @param {Function} parser - A function that parses a string into a JavaScript object. +* @param {Function} encoder - A function that takes a value and returns a string. +* +* @returns {string} A stringified version of the rawValue. +*/ +function stringifySafely(rawValue, parser, encoder) { + if (utils_default.isString(rawValue)) try { + (parser || JSON.parse)(rawValue); + return utils_default.trim(rawValue); + } catch (e) { + if (e.name !== "SyntaxError") throw e; + } + return (encoder || JSON.stringify)(rawValue); +} +var defaults = { + transitional: transitional_default, + adapter: [ + "xhr", + "http", + "fetch" + ], + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ""; + const hasJSONContentType = contentType.indexOf("application/json") > -1; + const isObjectPayload = utils_default.isObject(data); + if (isObjectPayload && utils_default.isHTMLForm(data)) data = new FormData(data); + if (utils_default.isFormData(data)) return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; + if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) return data; + if (utils_default.isArrayBufferView(data)) return data.buffer; + if (utils_default.isURLSearchParams(data)) { + headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false); + return data.toString(); + } + let isFileList; + if (isObjectPayload) { + if (contentType.indexOf("application/x-www-form-urlencoded") > -1) return toURLEncodedForm(data, this.formSerializer).toString(); + if ((isFileList = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { + const _FormData = this.env && this.env.FormData; + return toFormData(isFileList ? { "files[]": data } : data, _FormData && new _FormData(), this.formSerializer); + } + } + if (isObjectPayload || hasJSONContentType) { + headers.setContentType("application/json", false); + return stringifySafely(data); + } + return data; + }], + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === "json"; + if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) return data; + if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { + const strictJSONParsing = !(transitional && transitional.silentJSONParsing) && JSONRequested; + try { + return JSON.parse(data, this.parseReviver); + } catch (e) { + if (strictJSONParsing) { + if (e.name === "SyntaxError") throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + throw e; + } + } + } + return data; + }], + timeout: 0, + xsrfCookieName: "XSRF-TOKEN", + xsrfHeaderName: "X-XSRF-TOKEN", + maxContentLength: -1, + maxBodyLength: -1, + env: { + FormData: platform_default.classes.FormData, + Blob: platform_default.classes.Blob + }, + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + headers: { common: { + Accept: "application/json, text/plain, */*", + "Content-Type": void 0 + } } +}; +utils_default.forEach([ + "delete", + "get", + "head", + "post", + "put", + "patch" +], (method) => { + defaults.headers[method] = {}; +}); +//#endregion +//#region node_modules/axios/lib/helpers/parseHeaders.js +var ignoreDuplicateOf = utils_default.toObjectSet([ + "age", + "authorization", + "content-length", + "content-type", + "etag", + "expires", + "from", + "host", + "if-modified-since", + "if-unmodified-since", + "last-modified", + "location", + "max-forwards", + "proxy-authorization", + "referer", + "retry-after", + "user-agent" +]); +/** +* Parse headers into an object +* +* ``` +* Date: Wed, 27 Aug 2014 08:58:49 GMT +* Content-Type: application/json +* Connection: keep-alive +* Transfer-Encoding: chunked +* ``` +* +* @param {String} rawHeaders Headers needing to be parsed +* +* @returns {Object} Headers parsed into an object +*/ +var parseHeaders_default = (rawHeaders) => { + const parsed = {}; + let key; + let val; + let i; + rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { + i = line.indexOf(":"); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + if (!key || parsed[key] && ignoreDuplicateOf[key]) return; + if (key === "set-cookie") if (parsed[key]) parsed[key].push(val); + else parsed[key] = [val]; + else parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; + }); + return parsed; +}; +//#endregion +//#region node_modules/axios/lib/core/AxiosHeaders.js +var $internals = Symbol("internals"); +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} +function normalizeValue(value) { + if (value === false || value == null) return value; + return utils_default.isArray(value) ? value.map(normalizeValue) : String(value).replace(/[\r\n]+$/, ""); +} +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + while (match = tokensRE.exec(str)) tokens[match[1]] = match[2]; + return tokens; +} +var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils_default.isFunction(filter)) return filter.call(this, value, header); + if (isHeaderNameFilter) value = header; + if (!utils_default.isString(value)) return; + if (utils_default.isString(filter)) return value.indexOf(filter) !== -1; + if (utils_default.isRegExp(filter)) return filter.test(value); +} +function formatHeader(header) { + return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} +function buildAccessors(obj, header) { + const accessorName = utils_default.toCamelCase(" " + header); + [ + "get", + "set", + "has" + ].forEach((methodName) => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} +var AxiosHeaders = class { + constructor(headers) { + headers && this.set(headers); + } + set(header, valueOrRewrite, rewrite) { + const self = this; + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + if (!lHeader) throw new Error("header name must be a non-empty string"); + const key = utils_default.findKey(self, lHeader); + if (!key || self[key] === void 0 || _rewrite === true || _rewrite === void 0 && self[key] !== false) self[key || _header] = normalizeValue(_value); + } + const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + if (utils_default.isPlainObject(header) || header instanceof this.constructor) setHeaders(header, valueOrRewrite); + else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) setHeaders(parseHeaders_default(header), valueOrRewrite); + else if (utils_default.isObject(header) && utils_default.isIterable(header)) { + let obj = {}, dest, key; + for (const entry of header) { + if (!utils_default.isArray(entry)) throw TypeError("Object iterator must return a key-value pair"); + obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1]; + } + setHeaders(obj, valueOrRewrite); + } else header != null && setHeader(valueOrRewrite, header, rewrite); + return this; + } + get(header, parser) { + header = normalizeHeader(header); + if (header) { + const key = utils_default.findKey(this, header); + if (key) { + const value = this[key]; + if (!parser) return value; + if (parser === true) return parseTokens(value); + if (utils_default.isFunction(parser)) return parser.call(this, value, key); + if (utils_default.isRegExp(parser)) return parser.exec(value); + throw new TypeError("parser must be boolean|regexp|function"); + } + } + } + has(header, matcher) { + header = normalizeHeader(header); + if (header) { + const key = utils_default.findKey(this, header); + return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + return false; + } + delete(header, matcher) { + const self = this; + let deleted = false; + function deleteHeader(_header) { + _header = normalizeHeader(_header); + if (_header) { + const key = utils_default.findKey(self, _header); + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + deleted = true; + } + } + } + if (utils_default.isArray(header)) header.forEach(deleteHeader); + else deleteHeader(header); + return deleted; + } + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + while (i--) { + const key = keys[i]; + if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + return deleted; + } + normalize(format) { + const self = this; + const headers = {}; + utils_default.forEach(this, (value, header) => { + const key = utils_default.findKey(headers, header); + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + const normalized = format ? formatHeader(header) : String(header).trim(); + if (normalized !== header) delete self[header]; + self[normalized] = normalizeValue(value); + headers[normalized] = true; + }); + return this; + } + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + toJSON(asStrings) { + const obj = Object.create(null); + utils_default.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value); + }); + return obj; + } + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); + } + getSetCookie() { + return this.get("set-cookie") || []; + } + get [Symbol.toStringTag]() { + return "AxiosHeaders"; + } + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + static concat(first, ...targets) { + const computed = new this(first); + targets.forEach((target) => computed.set(target)); + return computed; + } + static accessor(header) { + const accessors = (this[$internals] = this[$internals] = { accessors: {} }).accessors; + const prototype = this.prototype; + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + return this; + } +}; +AxiosHeaders.accessor([ + "Content-Type", + "Content-Length", + "Accept", + "Accept-Encoding", + "User-Agent", + "Authorization" +]); +utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => { + let mapped = key[0].toUpperCase() + key.slice(1); + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; + } + }; +}); +utils_default.freezeMethods(AxiosHeaders); +//#endregion +//#region node_modules/axios/lib/core/transformData.js +/** +* Transform the data for a request or a response +* +* @param {Array|Function} fns A single function or Array of functions +* @param {?Object} response The response object +* +* @returns {*} The resulting transformed data +*/ +function transformData(fns, response) { + const config = this || defaults; + const context = response || config; + const headers = AxiosHeaders.from(context.headers); + let data = context.data; + utils_default.forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : void 0); + }); + headers.normalize(); + return data; +} +//#endregion +//#region node_modules/axios/lib/cancel/isCancel.js +function isCancel(value) { + return !!(value && value.__CANCEL__); +} +//#endregion +//#region node_modules/axios/lib/cancel/CanceledError.js +var CanceledError = class extends AxiosError { + /** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ + constructor(message, config, request) { + super(message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config, request); + this.name = "CanceledError"; + this.__CANCEL__ = true; + } +}; +//#endregion +//#region node_modules/axios/lib/core/settle.js +/** +* Resolve or reject a Promise based on response status. +* +* @param {Function} resolve A function that resolves the promise. +* @param {Function} reject A function that rejects the promise. +* @param {object} response The response. +* +* @returns {object} The response. +*/ +function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) resolve(response); + else reject(new AxiosError("Request failed with status code " + response.status, [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response)); +} +//#endregion +//#region node_modules/axios/lib/helpers/parseProtocol.js +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ""; +} +//#endregion +//#region node_modules/axios/lib/helpers/speedometer.js +/** +* Calculate data maxRate +* @param {Number} [samplesCount= 10] +* @param {Number} [min= 1000] +* @returns {Function} +*/ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + min = min !== void 0 ? min : 1e3; + return function push(chunkLength) { + const now = Date.now(); + const startedAt = timestamps[tail]; + if (!firstSampleTS) firstSampleTS = now; + bytes[head] = chunkLength; + timestamps[head] = now; + let i = tail; + let bytesCount = 0; + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + head = (head + 1) % samplesCount; + if (head === tail) tail = (tail + 1) % samplesCount; + if (now - firstSampleTS < min) return; + const passed = startedAt && now - startedAt; + return passed ? Math.round(bytesCount * 1e3 / passed) : void 0; + }; +} +//#endregion +//#region node_modules/axios/lib/helpers/throttle.js +/** +* Throttle decorator +* @param {Function} fn +* @param {Number} freq +* @return {Function} +*/ +function throttle(fn, freq) { + let timestamp = 0; + let threshold = 1e3 / freq; + let lastArgs; + let timer; + const invoke = (args, now = Date.now()) => { + timestamp = now; + lastArgs = null; + if (timer) { + clearTimeout(timer); + timer = null; + } + fn(...args); + }; + const throttled = (...args) => { + const now = Date.now(); + const passed = now - timestamp; + if (passed >= threshold) invoke(args, now); + else { + lastArgs = args; + if (!timer) timer = setTimeout(() => { + timer = null; + invoke(lastArgs); + }, threshold - passed); + } + }; + const flush = () => lastArgs && invoke(lastArgs); + return [throttled, flush]; +} +//#endregion +//#region node_modules/axios/lib/helpers/progressEventReducer.js +var progressEventReducer = (listener, isDownloadStream, freq = 3) => { + let bytesNotified = 0; + const _speedometer = speedometer(50, 250); + return throttle((e) => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : void 0; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + bytesNotified = loaded; + listener({ + loaded, + total, + progress: total ? loaded / total : void 0, + bytes: progressBytes, + rate: rate ? rate : void 0, + estimated: rate && total && inRange ? (total - loaded) / rate : void 0, + event: e, + lengthComputable: total != null, + [isDownloadStream ? "download" : "upload"]: true + }); + }, freq); +}; +var progressEventDecorator = (total, throttled) => { + const lengthComputable = total != null; + return [(loaded) => throttled[0]({ + lengthComputable, + total, + loaded + }), throttled[1]]; +}; +var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args)); +//#endregion +//#region node_modules/axios/lib/helpers/isURLSameOrigin.js +var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => { + url = new URL(url, platform_default.origin); + return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port); +})(new URL(platform_default.origin), platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)) : () => true; +//#endregion +//#region node_modules/axios/lib/helpers/cookies.js +var cookies_default = platform_default.hasStandardBrowserEnv ? { + write(name, value, expires, path, domain, secure, sameSite) { + if (typeof document === "undefined") return; + const cookie = [`${name}=${encodeURIComponent(value)}`]; + if (utils_default.isNumber(expires)) cookie.push(`expires=${new Date(expires).toUTCString()}`); + if (utils_default.isString(path)) cookie.push(`path=${path}`); + if (utils_default.isString(domain)) cookie.push(`domain=${domain}`); + if (secure === true) cookie.push("secure"); + if (utils_default.isString(sameSite)) cookie.push(`SameSite=${sameSite}`); + document.cookie = cookie.join("; "); + }, + read(name) { + if (typeof document === "undefined") return null; + const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)")); + return match ? decodeURIComponent(match[1]) : null; + }, + remove(name) { + this.write(name, "", Date.now() - 864e5, "/"); + } +} : { + write() {}, + read() { + return null; + }, + remove() {} +}; +//#endregion +//#region node_modules/axios/lib/helpers/isAbsoluteURL.js +/** +* Determines whether the specified URL is absolute +* +* @param {string} url The URL to test +* +* @returns {boolean} True if the specified URL is absolute, otherwise false +*/ +function isAbsoluteURL(url) { + if (typeof url !== "string") return false; + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} +//#endregion +//#region node_modules/axios/lib/helpers/combineURLs.js +/** +* Creates a new URL by combining the specified URLs +* +* @param {string} baseURL The base URL +* @param {string} relativeURL The relative URL +* +* @returns {string} The combined URL +*/ +function combineURLs(baseURL, relativeURL) { + return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; +} +//#endregion +//#region node_modules/axios/lib/core/buildFullPath.js +/** +* Creates a new URL by combining the baseURL with the requestedURL, +* only when the requestedURL is not already an absolute URL. +* If the requestURL is absolute, this function returns the requestedURL untouched. +* +* @param {string} baseURL The base URL +* @param {string} requestedURL Absolute or relative URL to combine +* +* @returns {string} The combined full path +*/ +function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { + let isRelativeUrl = !isAbsoluteURL(requestedURL); + if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) return combineURLs(baseURL, requestedURL); + return requestedURL; +} +//#endregion +//#region node_modules/axios/lib/core/mergeConfig.js +var headersToObject = (thing) => thing instanceof AxiosHeaders ? _objectSpread2({}, thing) : thing; +/** +* Config-specific merge-function which creates a new config-object +* by merging two configuration objects together. +* +* @param {Object} config1 +* @param {Object} config2 +* +* @returns {Object} New object resulting from merging config2 to config1 +*/ +function mergeConfig(config1, config2) { + config2 = config2 || {}; + const config = {}; + function getMergedValue(target, source, prop, caseless) { + if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) return utils_default.merge.call({ caseless }, target, source); + else if (utils_default.isPlainObject(source)) return utils_default.merge({}, source); + else if (utils_default.isArray(source)) return source.slice(); + return source; + } + function mergeDeepProperties(a, b, prop, caseless) { + if (!utils_default.isUndefined(b)) return getMergedValue(a, b, prop, caseless); + else if (!utils_default.isUndefined(a)) return getMergedValue(void 0, a, prop, caseless); + } + function valueFromConfig2(a, b) { + if (!utils_default.isUndefined(b)) return getMergedValue(void 0, b); + } + function defaultToConfig2(a, b) { + if (!utils_default.isUndefined(b)) return getMergedValue(void 0, b); + else if (!utils_default.isUndefined(a)) return getMergedValue(void 0, a); + } + function mergeDirectKeys(a, b, prop) { + if (prop in config2) return getMergedValue(a, b); + else if (prop in config1) return getMergedValue(void 0, a); + } + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) + }; + utils_default.forEach(Object.keys(_objectSpread2(_objectSpread2({}, config1), config2)), function computeConfigValue(prop) { + if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return; + const merge = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + utils_default.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue); + }); + return config; +} +//#endregion +//#region node_modules/axios/lib/helpers/resolveConfig.js +var resolveConfig_default = (config) => { + const newConfig = mergeConfig({}, config); + let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; + newConfig.headers = headers = AxiosHeaders.from(headers); + newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); + if (auth) headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))); + if (utils_default.isFormData(data)) { + if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) headers.setContentType(void 0); + else if (utils_default.isFunction(data.getHeaders)) { + const formHeaders = data.getHeaders(); + const allowedHeaders = ["content-type", "content-length"]; + Object.entries(formHeaders).forEach(([key, val]) => { + if (allowedHeaders.includes(key.toLowerCase())) headers.set(key, val); + }); + } + } + if (platform_default.hasStandardBrowserEnv) { + withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); + if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) { + const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName); + if (xsrfValue) headers.set(xsrfHeaderName, xsrfValue); + } + } + return newConfig; +}; +var xhr_default = typeof XMLHttpRequest !== "undefined" && function(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + const _config = resolveConfig_default(config); + let requestData = _config.data; + const requestHeaders = AxiosHeaders.from(_config.headers).normalize(); + let { responseType, onUploadProgress, onDownloadProgress } = _config; + let onCanceled; + let uploadThrottled, downloadThrottled; + let flushUpload, flushDownload; + function done() { + flushUpload && flushUpload(); + flushDownload && flushDownload(); + _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); + _config.signal && _config.signal.removeEventListener("abort", onCanceled); + } + let request = new XMLHttpRequest(); + request.open(_config.method.toUpperCase(), _config.url, true); + request.timeout = _config.timeout; + function onloadend() { + if (!request) return; + const responseHeaders = AxiosHeaders.from("getAllResponseHeaders" in request && request.getAllResponseHeaders()); + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, { + data: !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }); + request = null; + } + if ("onloadend" in request) request.onloadend = onloadend; + else request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) return; + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) return; + setTimeout(onloadend); + }; + request.onabort = function handleAbort() { + if (!request) return; + reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request)); + request = null; + }; + request.onerror = function handleError(event) { + const err = new AxiosError(event && event.message ? event.message : "Network Error", AxiosError.ERR_NETWORK, config, request); + err.event = event || null; + reject(err); + request = null; + }; + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded"; + const transitional = _config.transitional || transitional_default; + if (_config.timeoutErrorMessage) timeoutErrorMessage = _config.timeoutErrorMessage; + reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request)); + request = null; + }; + requestData === void 0 && requestHeaders.setContentType(null); + if ("setRequestHeader" in request) utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + if (!utils_default.isUndefined(_config.withCredentials)) request.withCredentials = !!_config.withCredentials; + if (responseType && responseType !== "json") request.responseType = _config.responseType; + if (onDownloadProgress) { + [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); + request.addEventListener("progress", downloadThrottled); + } + if (onUploadProgress && request.upload) { + [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); + request.upload.addEventListener("progress", uploadThrottled); + request.upload.addEventListener("loadend", flushUpload); + } + if (_config.cancelToken || _config.signal) { + onCanceled = (cancel) => { + if (!request) return; + reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); + request.abort(); + request = null; + }; + _config.cancelToken && _config.cancelToken.subscribe(onCanceled); + if (_config.signal) _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); + } + const protocol = parseProtocol(_config.url); + if (protocol && platform_default.protocols.indexOf(protocol) === -1) { + reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config)); + return; + } + request.send(requestData || null); + }); +}; +//#endregion +//#region node_modules/axios/lib/helpers/composeSignals.js +var composeSignals = (signals, timeout) => { + const { length } = signals = signals ? signals.filter(Boolean) : []; + if (timeout || length) { + let controller = new AbortController(); + let aborted; + const onabort = function(reason) { + if (!aborted) { + aborted = true; + unsubscribe(); + const err = reason instanceof Error ? reason : this.reason; + controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); + } + }; + let timer = timeout && setTimeout(() => { + timer = null; + onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT)); + }, timeout); + const unsubscribe = () => { + if (signals) { + timer && clearTimeout(timer); + timer = null; + signals.forEach((signal) => { + signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener("abort", onabort); + }); + signals = null; + } + }; + signals.forEach((signal) => signal.addEventListener("abort", onabort)); + const { signal } = controller; + signal.unsubscribe = () => utils_default.asap(unsubscribe); + return signal; + } +}; +//#endregion +//#region \0@oxc-project+runtime@0.123.0/helpers/asyncIterator.js +function _asyncIterator(r) { + var n, t, o, e = 2; + for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { + if (t && null != (n = r[t])) return n.call(r); + if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); + t = "@@asyncIterator", o = "@@iterator"; + } + throw new TypeError("Object is not async iterable"); +} +function AsyncFromSyncIterator(r) { + function AsyncFromSyncIteratorContinuation(r) { + if (Object(r) !== r) return Promise.reject(/* @__PURE__ */ new TypeError(r + " is not an object.")); + var n = r.done; + return Promise.resolve(r.value).then(function(r) { + return { + value: r, + done: n + }; + }); + } + return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { + this.s = r, this.n = r.next; + }, AsyncFromSyncIterator.prototype = { + s: null, + n: null, + next: function next() { + return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); + }, + "return": function _return(r) { + var n = this.s["return"]; + return void 0 === n ? Promise.resolve({ + value: r, + done: !0 + }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); + }, + "throw": function _throw(r) { + var n = this.s["return"]; + return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); + } + }, new AsyncFromSyncIterator(r); +} +//#endregion +//#region \0@oxc-project+runtime@0.123.0/helpers/OverloadYield.js +function _OverloadYield(e, d) { + this.v = e, this.k = d; +} +//#endregion +//#region \0@oxc-project+runtime@0.123.0/helpers/awaitAsyncGenerator.js +function _awaitAsyncGenerator(e) { + return new _OverloadYield(e, 0); +} +//#endregion +//#region \0@oxc-project+runtime@0.123.0/helpers/asyncGeneratorDelegate.js +function _asyncGeneratorDelegate(t) { + var e = {}, n = !1; + function pump(e, r) { + return n = !0, r = new Promise(function(n) { + n(t[e](r)); + }), { + done: !1, + value: new _OverloadYield(r, 1) + }; + } + return e["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function() { + return this; + }, e.next = function(t) { + return n ? (n = !1, t) : pump("next", t); + }, "function" == typeof t["throw"] && (e["throw"] = function(t) { + if (n) throw n = !1, t; + return pump("throw", t); + }), "function" == typeof t["return"] && (e["return"] = function(t) { + return n ? (n = !1, t) : pump("return", t); + }), e; +} +//#endregion +//#region \0@oxc-project+runtime@0.123.0/helpers/wrapAsyncGenerator.js +function _wrapAsyncGenerator(e) { + return function() { + return new AsyncGenerator(e.apply(this, arguments)); + }; +} +function AsyncGenerator(e) { + var r, t; + function resume(r, t) { + try { + var n = e[r](t), o = n.value, u = o instanceof _OverloadYield; + Promise.resolve(u ? o.v : o).then(function(t) { + if (u) { + var i = "return" === r ? "return" : "next"; + if (!o.k || t.done) return resume(i, t); + t = e[i](t).value; + } + settle(n.done ? "return" : "normal", t); + }, function(e) { + resume("throw", e); + }); + } catch (e) { + settle("throw", e); + } + } + function settle(e, n) { + switch (e) { + case "return": + r.resolve({ + value: n, + done: !0 + }); + break; + case "throw": + r.reject(n); + break; + default: r.resolve({ + value: n, + done: !1 + }); + } + (r = r.next) ? resume(r.key, r.arg) : t = null; + } + this._invoke = function(e, n) { + return new Promise(function(o, u) { + var i = { + key: e, + arg: n, + resolve: o, + reject: u, + next: null + }; + t ? t = t.next = i : (r = t = i, resume(e, n)); + }); + }, "function" != typeof e["return"] && (this["return"] = void 0); +} +AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function() { + return this; +}, AsyncGenerator.prototype.next = function(e) { + return this._invoke("next", e); +}, AsyncGenerator.prototype["throw"] = function(e) { + return this._invoke("throw", e); +}, AsyncGenerator.prototype["return"] = function(e) { + return this._invoke("return", e); +}; +//#endregion +//#region node_modules/axios/lib/helpers/trackStream.js +var streamChunk = function* (chunk, chunkSize) { + let len = chunk.byteLength; + if (!chunkSize || len < chunkSize) { + yield chunk; + return; + } + let pos = 0; + let end; + while (pos < len) { + end = pos + chunkSize; + yield chunk.slice(pos, end); + pos = end; + } +}; +var readBytes = /* @__PURE__ */ function() { + var _ref = _wrapAsyncGenerator(function* (iterable, chunkSize) { + var _iteratorAbruptCompletion = false; + var _didIteratorError = false; + var _iteratorError; + try { + for (var _iterator = _asyncIterator(readStream(iterable)), _step; _iteratorAbruptCompletion = !(_step = yield _awaitAsyncGenerator(_iterator.next())).done; _iteratorAbruptCompletion = false) { + const chunk = _step.value; + yield* _asyncGeneratorDelegate(_asyncIterator(streamChunk(chunk, chunkSize))); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (_iteratorAbruptCompletion && _iterator.return != null) yield _awaitAsyncGenerator(_iterator.return()); + } finally { + if (_didIteratorError) throw _iteratorError; + } + } + }); + return function readBytes(_x, _x2) { + return _ref.apply(this, arguments); + }; +}(); +var readStream = /* @__PURE__ */ function() { + var _ref2 = _wrapAsyncGenerator(function* (stream) { + if (stream[Symbol.asyncIterator]) { + yield* _asyncGeneratorDelegate(_asyncIterator(stream)); + return; + } + const reader = stream.getReader(); + try { + for (;;) { + const { done, value } = yield _awaitAsyncGenerator(reader.read()); + if (done) break; + yield value; + } + } finally { + yield _awaitAsyncGenerator(reader.cancel()); + } + }); + return function readStream(_x3) { + return _ref2.apply(this, arguments); + }; +}(); +var trackStream = (stream, chunkSize, onProgress, onFinish) => { + const iterator = readBytes(stream, chunkSize); + let bytes = 0; + let done; + let _onFinish = (e) => { + if (!done) { + done = true; + onFinish && onFinish(e); + } + }; + return new ReadableStream({ + pull(controller) { + return _asyncToGenerator(function* () { + try { + const { done, value } = yield iterator.next(); + if (done) { + _onFinish(); + controller.close(); + return; + } + let len = value.byteLength; + if (onProgress) onProgress(bytes += len); + controller.enqueue(new Uint8Array(value)); + } catch (err) { + _onFinish(err); + throw err; + } + })(); + }, + cancel(reason) { + _onFinish(reason); + return iterator.return(); + } + }, { highWaterMark: 2 }); +}; +//#endregion +//#region node_modules/axios/lib/adapters/fetch.js +var DEFAULT_CHUNK_SIZE = 64 * 1024; +var { isFunction } = utils_default; +var globalFetchAPI = (({ Request, Response }) => ({ + Request, + Response +}))(utils_default.global); +var { ReadableStream: ReadableStream$1, TextEncoder } = utils_default.global; +var test = (fn, ...args) => { + try { + return !!fn(...args); + } catch (e) { + return false; + } +}; +var factory = (env) => { + env = utils_default.merge.call({ skipUndefined: true }, globalFetchAPI, env); + const { fetch: envFetch, Request, Response } = env; + const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function"; + const isRequestSupported = isFunction(Request); + const isResponseSupported = isFunction(Response); + if (!isFetchSupported) return false; + const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1); + const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : function() { + var _ref = _asyncToGenerator(function* (str) { + return new Uint8Array(yield new Request(str).arrayBuffer()); + }); + return function(_x) { + return _ref.apply(this, arguments); + }; + }()); + const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { + let duplexAccessed = false; + const body = new ReadableStream$1(); + const hasContentType = new Request(platform_default.origin, { + body, + method: "POST", + get duplex() { + duplexAccessed = true; + return "half"; + } + }).headers.has("Content-Type"); + body.cancel(); + return duplexAccessed && !hasContentType; + }); + const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body)); + const resolvers = { stream: supportsResponseStream && ((res) => res.body) }; + isFetchSupported && [ + "text", + "arrayBuffer", + "blob", + "formData", + "stream" + ].forEach((type) => { + !resolvers[type] && (resolvers[type] = (res, config) => { + let method = res && res[type]; + if (method) return method.call(res); + throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config); + }); + }); + const getBodyLength = function() { + var _ref2 = _asyncToGenerator(function* (body) { + if (body == null) return 0; + if (utils_default.isBlob(body)) return body.size; + if (utils_default.isSpecCompliantForm(body)) return (yield new Request(platform_default.origin, { + method: "POST", + body + }).arrayBuffer()).byteLength; + if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) return body.byteLength; + if (utils_default.isURLSearchParams(body)) body = body + ""; + if (utils_default.isString(body)) return (yield encodeText(body)).byteLength; + }); + return function getBodyLength(_x2) { + return _ref2.apply(this, arguments); + }; + }(); + const resolveBodyLength = function() { + var _ref3 = _asyncToGenerator(function* (headers, body) { + const length = utils_default.toFiniteNumber(headers.getContentLength()); + return length == null ? getBodyLength(body) : length; + }); + return function resolveBodyLength(_x3, _x4) { + return _ref3.apply(this, arguments); + }; + }(); + return function() { + var _ref4 = _asyncToGenerator(function* (config) { + let { url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, withCredentials = "same-origin", fetchOptions } = resolveConfig_default(config); + let _fetch = envFetch || fetch; + responseType = responseType ? (responseType + "").toLowerCase() : "text"; + let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout); + let request = null; + const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { + composedSignal.unsubscribe(); + }); + let requestContentLength; + try { + if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = yield resolveBodyLength(headers, data)) !== 0) { + let _request = new Request(url, { + method: "POST", + body: data, + duplex: "half" + }); + let contentTypeHeader; + if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) headers.setContentType(contentTypeHeader); + if (_request.body) { + const [onProgress, flush] = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))); + data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); + } + } + if (!utils_default.isString(withCredentials)) withCredentials = withCredentials ? "include" : "omit"; + const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; + const resolvedOptions = _objectSpread2(_objectSpread2({}, fetchOptions), {}, { + signal: composedSignal, + method: method.toUpperCase(), + headers: headers.normalize().toJSON(), + body: data, + duplex: "half", + credentials: isCredentialsSupported ? withCredentials : void 0 + }); + request = isRequestSupported && new Request(url, resolvedOptions); + let response = yield isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions); + const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); + if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) { + const options = {}; + [ + "status", + "statusText", + "headers" + ].forEach((prop) => { + options[prop] = response[prop]; + }); + const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length")); + const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || []; + response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { + flush && flush(); + unsubscribe && unsubscribe(); + }), options); + } + responseType = responseType || "text"; + let responseData = yield resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config); + !isStreamResponse && unsubscribe && unsubscribe(); + return yield new Promise((resolve, reject) => { + settle(resolve, reject, { + data: responseData, + headers: AxiosHeaders.from(response.headers), + status: response.status, + statusText: response.statusText, + config, + request + }); + }); + } catch (err) { + unsubscribe && unsubscribe(); + if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) throw Object.assign(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request, err && err.response), { cause: err.cause || err }); + throw AxiosError.from(err, err && err.code, config, request, err && err.response); + } + }); + return function(_x5) { + return _ref4.apply(this, arguments); + }; + }(); +}; +var seedCache = /* @__PURE__ */ new Map(); +var getFetch = (config) => { + let env = config && config.env || {}; + const { fetch, Request, Response } = env; + const seeds = [ + Request, + Response, + fetch + ]; + let i = seeds.length, seed, target, map = seedCache; + while (i--) { + seed = seeds[i]; + target = map.get(seed); + target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env)); + map = target; + } + return target; +}; +getFetch(); +//#endregion +//#region node_modules/axios/lib/adapters/adapters.js +/** +* Known adapters mapping. +* Provides environment-specific adapters for Axios: +* - `http` for Node.js +* - `xhr` for browsers +* - `fetch` for fetch API-based requests +* +* @type {Object} +*/ +var knownAdapters = { + http: null, + xhr: xhr_default, + fetch: { get: getFetch } +}; +utils_default.forEach(knownAdapters, (fn, value) => { + if (fn) { + try { + Object.defineProperty(fn, "name", { value }); + } catch (e) {} + Object.defineProperty(fn, "adapterName", { value }); + } +}); +/** +* Render a rejection reason string for unknown or unsupported adapters +* +* @param {string} reason +* @returns {string} +*/ +var renderReason = (reason) => `- ${reason}`; +/** +* Check if the adapter is resolved (function, null, or false) +* +* @param {Function|null|false} adapter +* @returns {boolean} +*/ +var isResolvedHandle = (adapter) => utils_default.isFunction(adapter) || adapter === null || adapter === false; +/** +* Get the first suitable adapter from the provided list. +* Tries each adapter in order until a supported one is found. +* Throws an AxiosError if no adapter is suitable. +* +* @param {Array|string|Function} adapters - Adapter(s) by name or function. +* @param {Object} config - Axios request configuration +* @throws {AxiosError} If no suitable adapter is available +* @returns {Function} The resolved adapter function +*/ +function getAdapter(adapters, config) { + adapters = utils_default.isArray(adapters) ? adapters : [adapters]; + const { length } = adapters; + let nameOrAdapter; + let adapter; + const rejectedReasons = {}; + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + let id; + adapter = nameOrAdapter; + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + if (adapter === void 0) throw new AxiosError(`Unknown adapter '${id}'`); + } + if (adapter && (utils_default.isFunction(adapter) || (adapter = adapter.get(config)))) break; + rejectedReasons[id || "#" + i] = adapter; + } + if (!adapter) { + const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")); + throw new AxiosError(`There is no suitable adapter to dispatch the request ` + (length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"), "ERR_NOT_SUPPORT"); + } + return adapter; +} +/** +* Exports Axios adapters and utility to resolve an adapter +*/ +var adapters_default = { + getAdapter, + adapters: knownAdapters +}; +//#endregion +//#region node_modules/axios/lib/core/dispatchRequest.js +/** +* Throws a `CanceledError` if cancellation has been requested. +* +* @param {Object} config The config that is to be used for the request +* +* @returns {void} +*/ +function throwIfCancellationRequested(config) { + if (config.cancelToken) config.cancelToken.throwIfRequested(); + if (config.signal && config.signal.aborted) throw new CanceledError(null, config); +} +/** +* Dispatch a request to the server using the configured adapter. +* +* @param {object} config The config that is to be used for the request +* +* @returns {Promise} The Promise to be fulfilled +*/ +function dispatchRequest(config) { + throwIfCancellationRequested(config); + config.headers = AxiosHeaders.from(config.headers); + config.data = transformData.call(config, config.transformRequest); + if ([ + "post", + "put", + "patch" + ].indexOf(config.method) !== -1) config.headers.setContentType("application/x-www-form-urlencoded", false); + return adapters_default.getAdapter(config.adapter || defaults.adapter, config)(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + response.data = transformData.call(config, config.transformResponse, response); + response.headers = AxiosHeaders.from(response.headers); + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + if (reason && reason.response) { + reason.response.data = transformData.call(config, config.transformResponse, reason.response); + reason.response.headers = AxiosHeaders.from(reason.response.headers); + } + } + return Promise.reject(reason); + }); +} +//#endregion +//#region node_modules/axios/lib/env/data.js +var VERSION = "1.14.0"; +//#endregion +//#region node_modules/axios/lib/helpers/validator.js +var validators$1 = {}; +[ + "object", + "boolean", + "number", + "function", + "string", + "symbol" +].forEach((type, i) => { + validators$1[type] = function validator(thing) { + return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type; + }; +}); +var deprecatedWarnings = {}; +/** +* Transitional option validator +* +* @param {function|boolean?} validator - set to false if the transitional option has been removed +* @param {string?} version - deprecated version / removed since version +* @param {string?} message - some message with additional info +* +* @returns {function} +*/ +validators$1.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : ""); + } + return (value, opt, opts) => { + if (validator === false) throw new AxiosError(formatMessage(opt, " has been removed" + (version ? " in " + version : "")), AxiosError.ERR_DEPRECATED); + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + console.warn(formatMessage(opt, " has been deprecated since v" + version + " and will be removed in the near future")); + } + return validator ? validator(value, opt, opts) : true; + }; +}; +validators$1.spelling = function spelling(correctSpelling) { + return (value, opt) => { + console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); + return true; + }; +}; +/** +* Assert object's properties type +* +* @param {object} options +* @param {object} schema +* @param {boolean?} allowUnknown +* +* @returns {object} +*/ +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== "object") throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE); + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === void 0 || validator(value, opt, options); + if (result !== true) throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE); + continue; + } + if (allowUnknown !== true) throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION); + } +} +var validator_default = { + assertOptions, + validators: validators$1 +}; +//#endregion +//#region node_modules/axios/lib/core/Axios.js +var validators = validator_default.validators; +/** +* Create a new instance of Axios +* +* @param {Object} instanceConfig The default config for the instance +* +* @return {Axios} A new instance of Axios +*/ +var Axios = class { + constructor(instanceConfig) { + this.defaults = instanceConfig || {}; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; + } + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + request(configOrUrl, config) { + var _this = this; + return _asyncToGenerator(function* () { + try { + return yield _this._request(configOrUrl, config); + } catch (err) { + if (err instanceof Error) { + let dummy = {}; + Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = /* @__PURE__ */ new Error(); + const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; + try { + if (!err.stack) err.stack = stack; + else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) err.stack += "\n" + stack; + } catch (e) {} + } + throw err; + } + })(); + } + _request(configOrUrl, config) { + if (typeof configOrUrl === "string") { + config = config || {}; + config.url = configOrUrl; + } else config = configOrUrl || {}; + config = mergeConfig(this.defaults, config); + const { transitional, paramsSerializer, headers } = config; + if (transitional !== void 0) validator_default.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean), + legacyInterceptorReqResOrdering: validators.transitional(validators.boolean) + }, false); + if (paramsSerializer != null) if (utils_default.isFunction(paramsSerializer)) config.paramsSerializer = { serialize: paramsSerializer }; + else validator_default.assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + if (config.allowAbsoluteUrls !== void 0) {} else if (this.defaults.allowAbsoluteUrls !== void 0) config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; + else config.allowAbsoluteUrls = true; + validator_default.assertOptions(config, { + baseUrl: validators.spelling("baseURL"), + withXsrfToken: validators.spelling("withXSRFToken") + }, true); + config.method = (config.method || this.defaults.method || "get").toLowerCase(); + let contextHeaders = headers && utils_default.merge(headers.common, headers[config.method]); + headers && utils_default.forEach([ + "delete", + "get", + "head", + "post", + "put", + "patch", + "common" + ], (method) => { + delete headers[method]; + }); + config.headers = AxiosHeaders.concat(contextHeaders, headers); + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) return; + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + const transitional = config.transitional || transitional_default; + if (transitional && transitional.legacyInterceptorReqResOrdering) requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + else requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + let promise; + let i = 0; + let len; + if (!synchronousRequestInterceptors) { + const chain = [dispatchRequest.bind(this), void 0]; + chain.unshift(...requestInterceptorChain); + chain.push(...responseInterceptorChain); + len = chain.length; + promise = Promise.resolve(config); + while (i < len) promise = promise.then(chain[i++], chain[i++]); + return promise; + } + len = requestInterceptorChain.length; + let newConfig = config; + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + i = 0; + len = responseInterceptorChain.length; + while (i < len) promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + return promise; + } + getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls), config.params, config.paramsSerializer); + } +}; +utils_default.forEach([ + "delete", + "get", + "head", + "options" +], function forEachMethodNoData(method) { + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); +utils_default.forEach([ + "post", + "put", + "patch" +], function forEachMethodWithData(method) { + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig(config || {}, { + method, + headers: isForm ? { "Content-Type": "multipart/form-data" } : {}, + url, + data + })); + }; + } + Axios.prototype[method] = generateHTTPMethod(); + Axios.prototype[method + "Form"] = generateHTTPMethod(true); +}); +//#endregion +//#region node_modules/axios/lib/cancel/CancelToken.js +/** +* A `CancelToken` is an object that can be used to request cancellation of an operation. +* +* @param {Function} executor The executor function. +* +* @returns {CancelToken} +*/ +var CancelToken = class CancelToken { + constructor(executor) { + if (typeof executor !== "function") throw new TypeError("executor must be a function."); + let resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + const token = this; + this.promise.then((cancel) => { + if (!token._listeners) return; + let i = token._listeners.length; + while (i-- > 0) token._listeners[i](cancel); + token._listeners = null; + }); + this.promise.then = (onfulfilled) => { + let _resolve; + const promise = new Promise((resolve) => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + return promise; + }; + executor(function cancel(message, config, request) { + if (token.reason) return; + token.reason = new CanceledError(message, config, request); + resolvePromise(token.reason); + }); + } + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) throw this.reason; + } + /** + * Subscribe to the cancel signal + */ + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + if (this._listeners) this._listeners.push(listener); + else this._listeners = [listener]; + } + /** + * Unsubscribe from the cancel signal + */ + unsubscribe(listener) { + if (!this._listeners) return; + const index = this._listeners.indexOf(listener); + if (index !== -1) this._listeners.splice(index, 1); + } + toAbortSignal() { + const controller = new AbortController(); + const abort = (err) => { + controller.abort(err); + }; + this.subscribe(abort); + controller.signal.unsubscribe = () => this.unsubscribe(abort); + return controller.signal; + } + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + return { + token: new CancelToken(function executor(c) { + cancel = c; + }), + cancel + }; + } +}; +//#endregion +//#region node_modules/axios/lib/helpers/spread.js +/** +* Syntactic sugar for invoking a function and expanding an array for arguments. +* +* Common use case would be to use `Function.prototype.apply`. +* +* ```js +* function f(x, y, z) {} +* const args = [1, 2, 3]; +* f.apply(null, args); +* ``` +* +* With `spread` this example can be re-written. +* +* ```js +* spread(function(x, y, z) {})([1, 2, 3]); +* ``` +* +* @param {Function} callback +* +* @returns {Function} +*/ +function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} +//#endregion +//#region node_modules/axios/lib/helpers/isAxiosError.js +/** +* Determines whether the payload is an error thrown by Axios +* +* @param {*} payload The value to test +* +* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false +*/ +function isAxiosError(payload) { + return utils_default.isObject(payload) && payload.isAxiosError === true; +} +//#endregion +//#region node_modules/axios/lib/helpers/HttpStatusCode.js +var HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, + WebServerIsDown: 521, + ConnectionTimedOut: 522, + OriginIsUnreachable: 523, + TimeoutOccurred: 524, + SslHandshakeFailed: 525, + InvalidSslCertificate: 526 +}; +Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; +}); +//#endregion +//#region node_modules/axios/lib/axios.js +/** +* Create an instance of Axios +* +* @param {Object} defaultConfig The default config for the instance +* +* @returns {Axios} A new instance of Axios +*/ +function createInstance(defaultConfig) { + const context = new Axios(defaultConfig); + const instance = bind(Axios.prototype.request, context); + utils_default.extend(instance, Axios.prototype, context, { allOwnKeys: true }); + utils_default.extend(instance, context, null, { allOwnKeys: true }); + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + return instance; +} +var axios = createInstance(defaults); +axios.Axios = Axios; +axios.CanceledError = CanceledError; +axios.CancelToken = CancelToken; +axios.isCancel = isCancel; +axios.VERSION = VERSION; +axios.toFormData = toFormData; +axios.AxiosError = AxiosError; +axios.Cancel = axios.CanceledError; +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = spread; +axios.isAxiosError = isAxiosError; +axios.mergeConfig = mergeConfig; +axios.AxiosHeaders = AxiosHeaders; +axios.formToJSON = (thing) => formDataToJSON(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing); +axios.getAdapter = adapters_default.getAdapter; +axios.HttpStatusCode = HttpStatusCode; +axios.default = axios; +//#endregion +//#region src/types/binding.ts +var ErrorCodes = { + AUTHENTICATION_FAILED: "AUTHENTICATION_FAILED", + AUTHORIZATION_FAILED: "AUTHORIZATION_FAILED", + RESOURCE_NOT_FOUND: "RESOURCE_NOT_FOUND", + INTERNAL_ERROR: "INTERNAL_ERROR", + BAD_REQUEST: "BAD_REQUEST", + CLUSTER_CONNECTION_FAILED: "CLUSTER_CONNECTION_FAILED" +}; +function isKubeBindError(error) { + return error && typeof error === "object" && error.kind === "Error" && error.apiVersion && error.message && error.code; +} +//#endregion +//#region src/services/http.ts +var StructuredError = class extends Error { + constructor(kubeBindError, httpStatus) { + super(kubeBindError.message); + _defineProperty(this, "kubeBindError", void 0); + _defineProperty(this, "httpStatus", void 0); + this.kubeBindError = kubeBindError; + this.httpStatus = httpStatus; + this.name = "StructuredError"; + } +}; +var HttpClient = class { + constructor() { + _defineProperty(this, "client", void 0); + this.client = axios.create({ + baseURL: "/api", + timeout: 3e4, + withCredentials: true, + headers: { "Content-Type": "application/json" } + }); + this.setupInterceptors(); + } + setupInterceptors() { + this.client.interceptors.request.use((config) => { + return config; + }, (error) => { + return Promise.reject(error); + }); + this.client.interceptors.response.use((response) => response, (error) => { + var _error$response, _error$response2; + const status = (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status; + const responseData = (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.data; + if (responseData && isKubeBindError(responseData)) { + if (responseData.code === ErrorCodes.AUTHENTICATION_FAILED) { + console.warn("Authentication expired, need to re-authenticate"); + window.dispatchEvent(new CustomEvent("auth-expired")); + } + return Promise.reject(new StructuredError(responseData, status)); + } + return Promise.reject(error); + }); + } + get(url, config) { + var _this = this; + return _asyncToGenerator(function* () { + return _this.client.get(url, config); + })(); + } + post(url, data, config) { + var _this2 = this; + return _asyncToGenerator(function* () { + return _this2.client.post(url, data, config); + })(); + } + put(url, data, config) { + var _this3 = this; + return _asyncToGenerator(function* () { + return _this3.client.put(url, data, config); + })(); + } + delete(url, config) { + var _this4 = this; + return _asyncToGenerator(function* () { + return _this4.client.delete(url, config); + })(); + } + getPublic(url, config) { + return _asyncToGenerator(function* () { + return axios.get(`/api${url}`, config); + })(); + } +}; +var httpClient = new HttpClient(); +//#endregion +//#region src/services/auth.ts +var PRESERVED_PARAMS_STORAGE_KEY = "kube-bind-preserved-params"; +var AuthService = class { + isAuthenticated() { + var _this = this; + return _asyncToGenerator(function* () { + return (yield _this.checkAuthentication()).isAuthenticated; + })(); + } + checkAuthentication() { + return _asyncToGenerator(function* () { + try { + const clusterId = new URLSearchParams(window.location.search).get("cluster_id") || ""; + const authCheckUrl = clusterId ? `/ping?cluster_id=${clusterId}` : "/ping"; + const response = yield httpClient.get(authCheckUrl); + const isAuth = response.status === 200; + console.log("Auth check:", { + clusterId, + status: response.status, + isAuth + }); + return { isAuthenticated: isAuth }; + } catch (error) { + var _error$response, _error$response2; + if (error instanceof StructuredError) { + const kubeError = error.kubeBindError; + if (kubeError.code === ErrorCodes.AUTHENTICATION_FAILED || kubeError.code === ErrorCodes.AUTHORIZATION_FAILED) return { + isAuthenticated: false, + error: kubeError.message + }; + } + if ((error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 401 || (error === null || error === void 0 || (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.status) === 403) { + console.log("Auth check failed with authentication error but no structured response"); + return { + isAuthenticated: false, + error: "Authentication required" + }; + } + console.error("Auth check error:", error); + return { + isAuthenticated: false, + error: "Authentication check failed" + }; + } + })(); + } + initiateAuth(sessionId, clusterId, consumerId) { + return _asyncToGenerator(function* () { + const authUrl = `/api/authorize`; + const redirect_url = window.location.origin + window.location.pathname; + const currentParams = new URLSearchParams(window.location.search); + const paramsToPreserve = {}; + if (currentParams.has("consumer_id")) paramsToPreserve.consumer_id = currentParams.get("consumer_id"); + if (currentParams.has("session_id")) paramsToPreserve.session_id = currentParams.get("session_id"); + if (currentParams.has("redirect_url")) paramsToPreserve.redirect_url = currentParams.get("redirect_url"); + if (currentParams.has("cluster_id")) paramsToPreserve.cluster_id = currentParams.get("cluster_id"); + sessionStorage.setItem(PRESERVED_PARAMS_STORAGE_KEY, JSON.stringify(paramsToPreserve)); + const params = new URLSearchParams({ + session_id: sessionId, + redirect_url, + cluster_id: clusterId, + client_type: "ui" + }); + if (consumerId) params.set("consumer_id", consumerId); + window.location.href = `${authUrl}?${params}`; + })(); + } + logout() { + return _asyncToGenerator(function* () { + try { + const clusterId = new URLSearchParams(window.location.search).get("cluster_id") || ""; + const logoutUrl = clusterId ? `/api/logout?cluster_id=${encodeURIComponent(clusterId)}` : "/api/logout"; + const response = yield httpClient.post(logoutUrl); + console.log("Logout response:", { + status: response.status, + clusterId + }); + window.location.href = window.location.origin + window.location.pathname; + } catch (error) { + console.error("Logout error:", error); + window.location.reload(); + } + })(); + } + getSessionCookieName() { + const clusterId = new URLSearchParams(window.location.search).get("cluster_id") || ""; + return clusterId ? `kube-bind-${clusterId}` : "kube-bind"; + } + isCliFlow() { + if (new URLSearchParams(window.location.search).has("redirect_url")) return true; + const preservedParams = sessionStorage.getItem(PRESERVED_PARAMS_STORAGE_KEY); + if (preservedParams) try { + return !!JSON.parse(preservedParams).redirect_url; + } catch (e) { + return false; + } + return false; + } + redirectToCliCallback(bindingResponseData) { + const urlParams = new URLSearchParams(window.location.search); + let redirectUrl = urlParams.get("redirect_url"); + let sessionId = urlParams.get("session_id"); + let consumerId = urlParams.get("consumer_id"); + if (!redirectUrl) { + const preservedParams = sessionStorage.getItem(PRESERVED_PARAMS_STORAGE_KEY); + if (preservedParams) try { + const params = JSON.parse(preservedParams); + redirectUrl = params.redirect_url || null; + sessionId = sessionId || params.session_id || null; + consumerId = consumerId || params.consumer_id || null; + } catch (e) { + console.error("Failed to parse preserved params:", e); + } + } + if (redirectUrl) { + const callbackUrl = new URL(redirectUrl); + if (sessionId) callbackUrl.searchParams.append("session_id", sessionId); + if (consumerId) callbackUrl.searchParams.append("consumer_id", consumerId); + const base64Response = btoa(JSON.stringify(bindingResponseData)); + callbackUrl.searchParams.append("binding_response", base64Response); + window.location.href = callbackUrl.toString(); + } else console.error("No redirect URL found for CLI callback"); + } + restorePreservedParams() { + const preservedParamsJson = sessionStorage.getItem(PRESERVED_PARAMS_STORAGE_KEY); + if (!preservedParamsJson) return false; + try { + const preservedParams = JSON.parse(preservedParamsJson); + const currentParams = new URLSearchParams(window.location.search); + let needsUpdate = false; + for (const [key, value] of Object.entries(preservedParams)) if (!currentParams.has(key)) { + currentParams.set(key, value); + needsUpdate = true; + } + if (needsUpdate) { + sessionStorage.removeItem(PRESERVED_PARAMS_STORAGE_KEY); + const newUrl = `${window.location.pathname}?${currentParams.toString()}`; + window.location.replace(newUrl); + return true; + } else { + sessionStorage.removeItem(PRESERVED_PARAMS_STORAGE_KEY); + return false; + } + } catch (error) { + console.error("Failed to restore preserved params:", error); + sessionStorage.removeItem(PRESERVED_PARAMS_STORAGE_KEY); + return false; + } + } +}; +var authService = new AuthService(); +//#endregion +//#region src/App.vue?vue&type=script&setup=true&lang.ts +var _hoisted_1$4 = { id: "app" }; +var _hoisted_2$4 = { class: "header" }; +var _hoisted_3$4 = { class: "header-content" }; +var _hoisted_4$4 = { + key: 0, + class: "user-section" +}; +var _hoisted_5$4 = { class: "main" }; +var _hoisted_6$4 = { + key: 0, + class: "auth-placeholder" +}; +var _hoisted_7$4 = { + key: 0, + class: "auth-error" +}; +var _hoisted_8$3 = { class: "error-content" }; +var _hoisted_9$3 = { key: 1 }; +var _hoisted_10$3 = ["disabled"]; +var _hoisted_11$3 = { key: 0 }; +var _hoisted_12$3 = { key: 1 }; +var App_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({ + __name: "App", + setup(__props) { + const route = useRoute(); + const authStatus = /* @__PURE__ */ ref({ + isAuthenticated: false, + loading: true, + error: null + }); + const hasAttemptedAuth = /* @__PURE__ */ ref(false); + const checkAuthStatus = function() { + var _ref = _asyncToGenerator(function* () { + try { + const result = yield authService.checkAuthentication(); + authStatus.value.isAuthenticated = result.isAuthenticated; + authStatus.value.error = result.error || null; + } catch (error) { + console.error("Auth check failed:", error); + authStatus.value.error = "Authentication check failed"; + } finally { + authStatus.value.loading = false; + } + }); + return function checkAuthStatus() { + return _ref.apply(this, arguments); + }; + }(); + const authenticate = function() { + var _ref2 = _asyncToGenerator(function* () { + try { + hasAttemptedAuth.value = true; + const cluster = route.query.cluster_id || ""; + const sessionId = route.query.session_id || generateSessionId(); + const consumerId = route.query.consumer_id || ""; + yield authService.initiateAuth(sessionId, cluster, consumerId); + } catch (error) { + console.error("Authentication failed:", error); + authStatus.value.error = "Authentication failed"; + } + }); + return function authenticate() { + return _ref2.apply(this, arguments); + }; + }(); + const logout = function() { + var _ref3 = _asyncToGenerator(function* () { + try { + yield authService.logout(); + authStatus.value.isAuthenticated = false; + } catch (error) { + console.error("Logout failed:", error); + } + }); + return function logout() { + return _ref3.apply(this, arguments); + }; + }(); + const generateSessionId = () => { + return Math.random().toString(36).substring(2) + Date.now().toString(36); + }; + onMounted(() => { + if (authService.restorePreservedParams()) return; + checkAuthStatus(); + window.addEventListener("auth-expired", () => { + console.log("Received auth-expired event, updating authentication status"); + authStatus.value.isAuthenticated = false; + authStatus.value.error = "Session expired. Please re-authenticate."; + const hasRequiredParams = route.query.cluster_id || route.query.session_id; + if (hasRequiredParams && !hasAttemptedAuth.value) { + console.log("Auto-redirecting to authentication due to auth-expired event"); + authenticate(); + } else if (!hasRequiredParams) console.log("No cluster_id or session_id parameters found, requiring manual authentication"); + else console.log("Authentication already attempted, preventing hot loop"); + }); + }); + return (_ctx, _cache) => { + const _component_router_view = resolveComponent("router-view"); + return openBlock(), createElementBlock("div", _hoisted_1$4, [createBaseVNode("header", _hoisted_2$4, [createBaseVNode("div", _hoisted_3$4, [_cache[2] || (_cache[2] = createStaticVNode("

Kube Bind

", 1)), authStatus.value.isAuthenticated ? (openBlock(), createElementBlock("div", _hoisted_4$4, [_cache[1] || (_cache[1] = createBaseVNode("div", { class: "user-info" }, [createBaseVNode("div", { class: "status-indicator" }), createBaseVNode("span", { class: "welcome-text" }, "Connected")], -1)), createBaseVNode("button", { + onClick: logout, + class: "logout-btn" + }, [..._cache[0] || (_cache[0] = [createBaseVNode("svg", { + width: "16", + height: "16", + viewBox: "0 0 24 24", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, [ + createBaseVNode("path", { + d: "M9 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H9", + stroke: "currentColor", + "stroke-width": "2", + "stroke-linecap": "round", + "stroke-linejoin": "round" + }), + createBaseVNode("path", { + d: "M16 17L21 12L16 7", + stroke: "currentColor", + "stroke-width": "2", + "stroke-linecap": "round", + "stroke-linejoin": "round" + }), + createBaseVNode("path", { + d: "M21 12H9", + stroke: "currentColor", + "stroke-width": "2", + "stroke-linecap": "round", + "stroke-linejoin": "round" + }) + ], -1), createTextVNode(" Sign out ", -1)])])])) : createCommentVNode("", true)])]), createBaseVNode("main", _hoisted_5$4, [!authStatus.value.isAuthenticated ? (openBlock(), createElementBlock("div", _hoisted_6$4, [ + _cache[5] || (_cache[5] = createBaseVNode("h2", null, "Authentication Required", -1)), + authStatus.value.error ? (openBlock(), createElementBlock("div", _hoisted_7$4, [_cache[4] || (_cache[4] = createBaseVNode("div", { class: "error-icon" }, "⚠️", -1)), createBaseVNode("div", _hoisted_8$3, [_cache[3] || (_cache[3] = createBaseVNode("h3", null, "Authentication Error", -1)), createBaseVNode("p", null, toDisplayString(authStatus.value.error), 1)])])) : (openBlock(), createElementBlock("p", _hoisted_9$3, "Please authenticate to access resources.")), + createBaseVNode("button", { + onClick: authenticate, + class: "auth-btn", + disabled: authStatus.value.loading + }, [authStatus.value.loading ? (openBlock(), createElementBlock("span", _hoisted_11$3, "Authenticating...")) : (openBlock(), createElementBlock("span", _hoisted_12$3, toDisplayString(authStatus.value.error ? "Try Again" : "Authenticate"), 1))], 8, _hoisted_10$3) + ])) : (openBlock(), createBlock(_component_router_view, { + key: 1, + "auth-status": authStatus.value + }, null, 8, ["auth-status"]))])]); + }; + } +}); +//#endregion +//#region \0plugin-vue:export-helper +var _plugin_vue_export_helper_default = (sfc, props) => { + const target = sfc.__vccOpts || sfc; + for (const [key, val] of props) target[key] = val; + return target; +}; +//#endregion +//#region src/App.vue +var App_default = /* @__PURE__ */ _plugin_vue_export_helper_default(App_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-0b535f4a"]]); +//#endregion +//#region src/components/BindingResult.vue?vue&type=script&setup=true&lang.ts +var _hoisted_1$3 = { class: "binding-content" }; +var _hoisted_2$3 = { class: "binding-info" }; +var _hoisted_3$3 = { class: "instructions-section" }; +var _hoisted_4$3 = { class: "command-group" }; +var _hoisted_5$3 = { class: "command-block" }; +var _hoisted_6$3 = { class: "command-group" }; +var _hoisted_7$3 = { class: "command-block" }; +var _hoisted_8$2 = { class: "command-group" }; +var _hoisted_9$2 = { class: "command-block" }; +var _hoisted_10$2 = { class: "alternative-section" }; +var _hoisted_11$2 = { class: "manual-setup" }; +var _hoisted_12$2 = { class: "command-group" }; +var _hoisted_13$2 = { class: "command-block" }; +//#endregion +//#region src/components/BindingResult.vue +var BindingResult_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({ + __name: "BindingResult", + props: { + show: { type: Boolean }, + templateName: {}, + bindingResponse: {} + }, + emits: ["close"], + setup(__props, { emit: __emit }) { + const props = __props; + const emit = __emit; + const kubeconfigSecretName = computed(() => { + return `kubeconfig-${props.templateName.toLowerCase().replace(/[^a-z0-9]/g, "")}-${Date.now().toString(36)}`; + }); + const bindingName = computed(() => { + var _props$bindingRespons; + return ((_props$bindingRespons = props.bindingResponse.authentication) === null || _props$bindingRespons === void 0 || (_props$bindingRespons = _props$bindingRespons.oauth2CodeGrant) === null || _props$bindingRespons === void 0 ? void 0 : _props$bindingRespons.sessionID) || props.templateName; + }); + const createSecretCommand = computed(() => { + return `kubectl create secret generic ${kubeconfigSecretName.value} --from-file=kubeconfig=./kubeconfig.yaml -n kube-bind`; + }); + const bindCommand = computed(() => { + return `kubectl bind apiservice --remote-kubeconfig-namespace kube-bind --remote-kubeconfig-name ${kubeconfigSecretName.value} -f apiservice-export.yaml`; + }); + const closeModal = () => { + emit("close"); + }; + const copyCommand = function() { + var _ref = _asyncToGenerator(function* (command) { + try { + yield navigator.clipboard.writeText(command); + } catch (err) { + console.error("Failed to copy command:", err); + const textarea = document.createElement("textarea"); + textarea.value = command; + document.body.appendChild(textarea); + textarea.select(); + document.execCommand("copy"); + document.body.removeChild(textarea); + } + }); + return function copyCommand(_x) { + return _ref.apply(this, arguments); + }; + }(); + const downloadKubeconfig = () => { + try { + const decodedKubeconfig = atob(props.bindingResponse.kubeconfig); + const blob = new Blob([decodedKubeconfig], { type: "text/yaml" }); + const url = URL.createObjectURL(blob); + const a = document.createElement("a"); + a.href = url; + a.download = "kubeconfig.yaml"; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); + } catch (error) { + console.error("Failed to decode kubeconfig:", error); + const blob = new Blob([props.bindingResponse.kubeconfig], { type: "text/yaml" }); + const url = URL.createObjectURL(blob); + const a = document.createElement("a"); + a.href = url; + a.download = "kubeconfig.yaml"; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); + } + }; + const downloadAPIRequests = () => { + try { + const apiRequestsYaml = props.bindingResponse.requests.map((req) => { + if (typeof req === "string") return req.trim(); + else return formatObjectAsYaml(req); + }).join("\n---\n"); + const blob = new Blob([apiRequestsYaml], { type: "text/yaml" }); + const url = URL.createObjectURL(blob); + const a = document.createElement("a"); + a.href = url; + a.download = "apiservice-export.yaml"; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); + } catch (error) { + console.error("Failed to format API requests as YAML:", error); + const apiRequestsJson = JSON.stringify(props.bindingResponse.requests, null, 2); + const blob = new Blob([apiRequestsJson], { type: "application/json" }); + const url = URL.createObjectURL(blob); + const a = document.createElement("a"); + a.href = url; + a.download = "apiservice-export.json"; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); + } + }; + const formatObjectAsYaml = (obj, indent = 0) => { + const spaces = " ".repeat(indent); + if (obj === null || obj === void 0) return ""; + if (typeof obj === "string") { + if (obj.includes("\n")) return `|\n${spaces} ${obj.replace(/\n/g, `\n${spaces} `)}`; + if (obj.match(/^(true|false|null|\d+)$/i) || obj.includes(":") || obj.includes("#")) return `"${obj}"`; + return obj; + } + if (typeof obj === "number" || typeof obj === "boolean") return String(obj); + if (Array.isArray(obj)) { + if (obj.length === 0) return "[]"; + return obj.map((item) => { + if (typeof item === "object" && item !== null && !Array.isArray(item)) return `${spaces}- ${formatObjectAsYaml(item, indent + 2).replace(/^\s*/, "")}`; + else return `${spaces}- ${item}`; + }).join("\n"); + } + if (typeof obj === "object") return Object.entries(obj).map(([key, value]) => { + if (value === null || value === void 0) return `${spaces}${key}:`; + if (Array.isArray(value)) { + if (value.length === 0) return `${spaces}${key}: []`; + return `${spaces}${key}:\n${formatObjectAsYaml(value, indent + 2)}`; + } + if (typeof value === "object") { + const formattedObject = formatObjectAsYaml(value, indent + 2); + if (formattedObject.trim() === "") return `${spaces}${key}:`; + return `${spaces}${key}:\n${formattedObject}`; + } + return `${spaces}${key}: ${formatObjectAsYaml(value, 0)}`; + }).join("\n"); + return String(obj); + }; + return (_ctx, _cache) => { + return __props.show ? (openBlock(), createElementBlock("div", { + key: 0, + class: "binding-modal-overlay", + onClick: closeModal + }, [createBaseVNode("div", { + class: "binding-modal", + onClick: _cache[4] || (_cache[4] = withModifiers(() => {}, ["stop"])) + }, [ + createBaseVNode("div", { class: "binding-header" }, [_cache[5] || (_cache[5] = createBaseVNode("h3", null, "Template Binding Successful", -1)), createBaseVNode("button", { + onClick: closeModal, + class: "close-btn" + }, "×")]), + createBaseVNode("div", _hoisted_1$3, [ + createBaseVNode("div", _hoisted_2$3, [ + _cache[9] || (_cache[9] = createBaseVNode("h4", null, "Binding Information", -1)), + createBaseVNode("p", null, [_cache[6] || (_cache[6] = createBaseVNode("strong", null, "Template:", -1)), createTextVNode(" " + toDisplayString(__props.templateName), 1)]), + createBaseVNode("p", null, [_cache[7] || (_cache[7] = createBaseVNode("strong", null, "Binding Name:", -1)), createTextVNode(" " + toDisplayString(bindingName.value), 1)]), + createBaseVNode("p", null, [_cache[8] || (_cache[8] = createBaseVNode("strong", null, "Kubeconfig Secret:", -1)), createTextVNode(" " + toDisplayString(kubeconfigSecretName.value), 1)]) + ]), + createBaseVNode("div", _hoisted_3$3, [ + _cache[16] || (_cache[16] = createBaseVNode("h4", null, "Setup Instructions", -1)), + _cache[17] || (_cache[17] = createBaseVNode("p", { class: "instructions-text" }, " To complete the binding setup, first download the required files below, then execute the following commands in your local kubectl environment: ", -1)), + createBaseVNode("div", { class: "download-files-section" }, [_cache[11] || (_cache[11] = createBaseVNode("h5", null, "1. Download required files", -1)), createBaseVNode("div", { class: "download-block" }, [_cache[10] || (_cache[10] = createBaseVNode("p", { class: "download-text" }, "Download and save both files in your current directory:", -1)), createBaseVNode("div", { class: "download-actions" }, [createBaseVNode("button", { + onClick: downloadKubeconfig, + class: "download-btn" + }, "Download kubeconfig.yaml"), createBaseVNode("button", { + onClick: downloadAPIRequests, + class: "download-btn" + }, "Download apiservice-export.yaml")])])]), + createBaseVNode("div", _hoisted_4$3, [_cache[13] || (_cache[13] = createBaseVNode("h5", null, "2. Create kube-bind namespace (if it doesn't exist)", -1)), createBaseVNode("div", _hoisted_5$3, [_cache[12] || (_cache[12] = createBaseVNode("code", null, "kubectl create namespace kube-bind --dry-run=client -o yaml | kubectl apply -f -", -1)), createBaseVNode("button", { + onClick: _cache[0] || (_cache[0] = ($event) => copyCommand("kubectl create namespace kube-bind --dry-run=client -o yaml | kubectl apply -f -")), + class: "copy-cmd-btn" + }, "Copy")])]), + createBaseVNode("div", _hoisted_6$3, [_cache[14] || (_cache[14] = createBaseVNode("h5", null, "3. Create kubeconfig secret", -1)), createBaseVNode("div", _hoisted_7$3, [createBaseVNode("code", null, toDisplayString(createSecretCommand.value), 1), createBaseVNode("button", { + onClick: _cache[1] || (_cache[1] = ($event) => copyCommand(createSecretCommand.value)), + class: "copy-cmd-btn" + }, "Copy")])]), + createBaseVNode("div", _hoisted_8$2, [_cache[15] || (_cache[15] = createBaseVNode("h5", null, "4. Bind the API service", -1)), createBaseVNode("div", _hoisted_9$2, [createBaseVNode("code", null, toDisplayString(bindCommand.value), 1), createBaseVNode("button", { + onClick: _cache[2] || (_cache[2] = ($event) => copyCommand(bindCommand.value)), + class: "copy-cmd-btn" + }, "Copy")])]) + ]), + createBaseVNode("div", _hoisted_10$2, [createBaseVNode("details", null, [_cache[19] || (_cache[19] = createBaseVNode("summary", null, "Alternative: Use stdin piping", -1)), createBaseVNode("div", _hoisted_11$2, [_cache[18] || (_cache[18] = createBaseVNode("h5", null, "For advanced users who prefer piping:", -1)), createBaseVNode("div", _hoisted_12$2, [createBaseVNode("div", _hoisted_13$2, [createBaseVNode("code", null, "cat apiservice-export.yaml | kubectl bind apiservice --remote-kubeconfig-namespace kube-bind --remote-kubeconfig-name " + toDisplayString(kubeconfigSecretName.value) + " -f -", 1), createBaseVNode("button", { + onClick: _cache[3] || (_cache[3] = ($event) => copyCommand(`cat apiservice-export.yaml | kubectl bind apiservice --remote-kubeconfig-namespace kube-bind --remote-kubeconfig-name ${kubeconfigSecretName.value} -f -`)), + class: "copy-cmd-btn" + }, "Copy")])])])])]) + ]), + createBaseVNode("div", { class: "binding-footer" }, [createBaseVNode("button", { + onClick: closeModal, + class: "ok-btn" + }, "Close")]) + ])])) : createCommentVNode("", true); + }; + } +}), [["__scopeId", "data-v-e150bd4a"]]); +//#endregion +//#region src/components/TemplateBindingModal.vue?vue&type=script&setup=true&lang.ts +var _hoisted_1$2 = { class: "modal-header" }; +var _hoisted_2$2 = { class: "modal-content" }; +var _hoisted_3$2 = { class: "binding-name-section" }; +var _hoisted_4$2 = { + key: 0, + class: "form-help" +}; +var _hoisted_5$2 = { + key: 1, + class: "form-error" +}; +var _hoisted_6$2 = { class: "template-details" }; +var _hoisted_7$2 = { + key: 0, + class: "detail-section" +}; +var _hoisted_8$1 = { class: "description" }; +var _hoisted_9$1 = { + key: 1, + class: "detail-section" +}; +var _hoisted_10$1 = { class: "resource-list" }; +var _hoisted_11$1 = { class: "resource-name" }; +var _hoisted_12$1 = { class: "resource-group" }; +var _hoisted_13$1 = { + key: 0, + class: "resource-versions" +}; +var _hoisted_14$1 = { + key: 2, + class: "detail-section" +}; +var _hoisted_15$1 = { class: "permission-list" }; +var _hoisted_16$1 = { class: "permission-name" }; +var _hoisted_17$1 = { class: "permission-group" }; +var _hoisted_18$1 = { + key: 0, + class: "permission-selector" +}; +var _hoisted_19$1 = { + key: 0, + class: "selector-section" +}; +var _hoisted_20$1 = { class: "selector-content" }; +var _hoisted_21$1 = { class: "label-key" }; +var _hoisted_22$1 = { class: "label-value" }; +var _hoisted_23$1 = { + key: 1, + class: "selector-section" +}; +var _hoisted_24$1 = { class: "selector-content" }; +var _hoisted_25$1 = { class: "resource-name" }; +var _hoisted_26$1 = { + key: 0, + class: "resource-namespace" +}; +var _hoisted_27$1 = { + key: 2, + class: "selector-section" +}; +var _hoisted_28$1 = { class: "selector-content" }; +var _hoisted_29$1 = { class: "reference-header" }; +var _hoisted_30$1 = { class: "reference-resource" }; +var _hoisted_31$1 = { class: "reference-group" }; +var _hoisted_32$1 = { + key: 0, + class: "reference-paths" +}; +var _hoisted_33$1 = { + key: 0, + class: "json-path" +}; +var _hoisted_34$1 = { class: "path-value" }; +var _hoisted_35$1 = { + key: 1, + class: "json-path" +}; +var _hoisted_36$1 = { class: "path-value" }; +var _hoisted_37 = { + key: 3, + class: "detail-section" +}; +var _hoisted_38 = { class: "namespace-list" }; +var _hoisted_39 = { class: "namespace-name" }; +var _hoisted_40 = { + key: 0, + class: "namespace-desc" +}; +var _hoisted_41 = { class: "modal-footer" }; +var _hoisted_42 = ["disabled"]; +var _hoisted_43 = { key: 0 }; +var _hoisted_44 = { key: 1 }; +//#endregion +//#region src/components/TemplateBindingModal.vue +var TemplateBindingModal_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({ + __name: "TemplateBindingModal", + props: { + show: { type: Boolean }, + template: {}, + isCliFlow: { type: Boolean } + }, + emits: ["close", "bind"], + setup(__props, { emit: __emit }) { + const props = __props; + const emit = __emit; + const binding = /* @__PURE__ */ ref(false); + const bindingName = /* @__PURE__ */ ref(""); + const isValidBindingName = computed(() => { + const name = bindingName.value.trim(); + if (!name) return false; + return /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/.test(name); + }); + watch(() => props.template, (newTemplate) => { + var _newTemplate$metadata; + if (newTemplate === null || newTemplate === void 0 || (_newTemplate$metadata = newTemplate.metadata) === null || _newTemplate$metadata === void 0 ? void 0 : _newTemplate$metadata.name) bindingName.value = newTemplate.metadata.name.toLowerCase().replace(/[^a-z0-9-]/g, "-"); + }, { immediate: true }); + const closeModal = () => { + if (!binding.value) emit("close"); + }; + const handleBind = function() { + var _ref = _asyncToGenerator(function* () { + const name = bindingName.value.trim(); + if (!name || binding.value || !isValidBindingName.value) return; + binding.value = true; + try { + emit("bind", props.template.metadata.name, name); + } finally { + binding.value = false; + } + }); + return function handleBind() { + return _ref.apply(this, arguments); + }; + }(); + const getLabelSelectorLabels = (selector) => { + if (!selector) return {}; + if (selector.matchLabels) return selector.matchLabels; + return {}; + }; + const getNamedResourceKey = (resource) => { + if (typeof resource === "string") return resource; + if (typeof resource === "object" && resource.name) return resource.namespace ? `${resource.namespace}/${resource.name}` : resource.name; + return JSON.stringify(resource); + }; + const getNamedResourceName = (resource) => { + if (typeof resource === "string") return resource; + if (typeof resource === "object" && resource.name) return resource.name; + return JSON.stringify(resource); + }; + const getNamedResourceNamespace = (resource) => { + if (typeof resource === "object" && resource.namespace) return resource.namespace; + return ""; + }; + const getReferenceKey = (ref) => { + if (typeof ref === "object") return `${ref.group || "core"}/${ref.resource || "unknown"}`; + return JSON.stringify(ref); + }; + return (_ctx, _cache) => { + return __props.show ? (openBlock(), createElementBlock("div", { + key: 0, + class: "modal-overlay", + onClick: closeModal + }, [createBaseVNode("div", { + class: "modal", + onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"])) + }, [ + createBaseVNode("div", _hoisted_1$2, [createBaseVNode("h3", null, "Bind Template: " + toDisplayString(__props.template.metadata.name), 1), createBaseVNode("button", { + onClick: closeModal, + class: "close-btn" + }, "×")]), + createBaseVNode("div", _hoisted_2$2, [createBaseVNode("div", _hoisted_3$2, [ + _cache[2] || (_cache[2] = createBaseVNode("label", { + for: "bindingName", + class: "form-label" + }, "Binding Name", -1)), + withDirectives(createBaseVNode("input", { + id: "bindingName", + "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => bindingName.value = $event), + type: "text", + class: normalizeClass(["form-input", { "invalid": !isValidBindingName.value }]), + placeholder: "Enter a unique name for this binding", + onKeyup: withKeys(handleBind, ["enter"]) + }, null, 34), [[vModelText, bindingName.value]]), + isValidBindingName.value ? (openBlock(), createElementBlock("p", _hoisted_4$2, "This name will be used to identify your binding in the CLI.")) : (openBlock(), createElementBlock("p", _hoisted_5$2, "Name must be lowercase letters, numbers, and hyphens only. Must start and end with alphanumeric characters.")) + ]), createBaseVNode("div", _hoisted_6$2, [ + _cache[10] || (_cache[10] = createBaseVNode("h4", null, "Template Details", -1)), + __props.template.spec.description ? (openBlock(), createElementBlock("div", _hoisted_7$2, [_cache[3] || (_cache[3] = createBaseVNode("h5", null, "Description", -1)), createBaseVNode("p", _hoisted_8$1, toDisplayString(__props.template.spec.description), 1)])) : createCommentVNode("", true), + __props.template.spec.resources && __props.template.spec.resources.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_9$1, [createBaseVNode("h5", null, "Resources (" + toDisplayString(__props.template.spec.resources.length) + ")", 1), createBaseVNode("div", _hoisted_10$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.template.spec.resources, (resource) => { + return openBlock(), createElementBlock("div", { + key: `${resource.group}/${resource.resource}`, + class: "resource-item" + }, [ + createBaseVNode("span", _hoisted_11$1, toDisplayString(resource.resource), 1), + createBaseVNode("span", _hoisted_12$1, toDisplayString(resource.group || "core"), 1), + resource.versions ? (openBlock(), createElementBlock("span", _hoisted_13$1, toDisplayString(resource.versions.join(", v")), 1)) : createCommentVNode("", true) + ]); + }), 128))])])) : createCommentVNode("", true), + __props.template.spec.permissionClaims && __props.template.spec.permissionClaims.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_14$1, [createBaseVNode("h5", null, "Permission Claims (" + toDisplayString(__props.template.spec.permissionClaims.length) + ")", 1), createBaseVNode("div", _hoisted_15$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.template.spec.permissionClaims, (claim) => { + return openBlock(), createElementBlock("div", { + key: `${claim.group}/${claim.resource}`, + class: "permission-item" + }, [ + createBaseVNode("span", _hoisted_16$1, toDisplayString(claim.resource), 1), + createBaseVNode("span", _hoisted_17$1, toDisplayString(claim.group || "core"), 1), + claim.selector ? (openBlock(), createElementBlock("div", _hoisted_18$1, [ + claim.selector.labelSelector ? (openBlock(), createElementBlock("div", _hoisted_19$1, [_cache[5] || (_cache[5] = createBaseVNode("strong", { class: "selector-title" }, "Label Selector:", -1)), createBaseVNode("div", _hoisted_20$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(getLabelSelectorLabels(claim.selector.labelSelector), (value, key) => { + return openBlock(), createElementBlock("div", { + key, + class: "label-item" + }, [ + createBaseVNode("span", _hoisted_21$1, toDisplayString(key), 1), + _cache[4] || (_cache[4] = createBaseVNode("span", { class: "label-separator" }, "=", -1)), + createBaseVNode("span", _hoisted_22$1, toDisplayString(value), 1) + ]); + }), 128))])])) : createCommentVNode("", true), + claim.selector.namedResources && claim.selector.namedResources.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_23$1, [_cache[6] || (_cache[6] = createBaseVNode("strong", { class: "selector-title" }, "Named Resources:", -1)), createBaseVNode("div", _hoisted_24$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(claim.selector.namedResources, (resource) => { + return openBlock(), createElementBlock("div", { + key: getNamedResourceKey(resource), + class: "named-resource-item" + }, [createBaseVNode("span", _hoisted_25$1, toDisplayString(getNamedResourceName(resource)), 1), getNamedResourceNamespace(resource) ? (openBlock(), createElementBlock("span", _hoisted_26$1, " in " + toDisplayString(getNamedResourceNamespace(resource)), 1)) : createCommentVNode("", true)]); + }), 128))])])) : createCommentVNode("", true), + claim.selector.references && claim.selector.references.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_27$1, [_cache[9] || (_cache[9] = createBaseVNode("strong", { class: "selector-title" }, "References:", -1)), createBaseVNode("div", _hoisted_28$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(claim.selector.references, (ref) => { + return openBlock(), createElementBlock("div", { + key: getReferenceKey(ref), + class: "reference-item" + }, [createBaseVNode("div", _hoisted_29$1, [createBaseVNode("span", _hoisted_30$1, toDisplayString(ref.resource), 1), createBaseVNode("span", _hoisted_31$1, "(" + toDisplayString(ref.group || "core") + ")", 1)]), ref.jsonPath ? (openBlock(), createElementBlock("div", _hoisted_32$1, [ref.jsonPath.name ? (openBlock(), createElementBlock("div", _hoisted_33$1, [_cache[7] || (_cache[7] = createBaseVNode("span", { class: "path-label" }, "Name:", -1)), createBaseVNode("code", _hoisted_34$1, toDisplayString(ref.jsonPath.name), 1)])) : createCommentVNode("", true), ref.jsonPath.namespace ? (openBlock(), createElementBlock("div", _hoisted_35$1, [_cache[8] || (_cache[8] = createBaseVNode("span", { class: "path-label" }, "Namespace:", -1)), createBaseVNode("code", _hoisted_36$1, toDisplayString(ref.jsonPath.namespace), 1)])) : createCommentVNode("", true)])) : createCommentVNode("", true)]); + }), 128))])])) : createCommentVNode("", true) + ])) : createCommentVNode("", true) + ]); + }), 128))])])) : createCommentVNode("", true), + __props.template.spec.namespaces && __props.template.spec.namespaces.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_37, [createBaseVNode("h5", null, "Namespaces (" + toDisplayString(__props.template.spec.namespaces.length) + ")", 1), createBaseVNode("div", _hoisted_38, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.template.spec.namespaces, (ns) => { + return openBlock(), createElementBlock("div", { + key: ns.name, + class: "namespace-item" + }, [createBaseVNode("span", _hoisted_39, toDisplayString(ns.name), 1), ns.description ? (openBlock(), createElementBlock("span", _hoisted_40, toDisplayString(ns.description), 1)) : createCommentVNode("", true)]); + }), 128))])])) : createCommentVNode("", true) + ])]), + createBaseVNode("div", _hoisted_41, [createBaseVNode("button", { + onClick: closeModal, + class: "cancel-btn" + }, "Cancel"), createBaseVNode("button", { + onClick: handleBind, + disabled: !bindingName.value.trim() || binding.value || !isValidBindingName.value, + class: "bind-btn" + }, [binding.value ? (openBlock(), createElementBlock("span", _hoisted_43, "Binding...")) : (openBlock(), createElementBlock("span", _hoisted_44, toDisplayString(__props.isCliFlow ? "Bind for CLI" : "Bind Template"), 1))], 8, _hoisted_42)]) + ])])) : createCommentVNode("", true); + }; + } +}), [["__scopeId", "data-v-4218c1a0"]]); +//#endregion +//#region src/components/AlertModal.vue?vue&type=script&setup=true&lang.ts +var _hoisted_1$1 = { class: "modal-content" }; +var _hoisted_2$1 = { class: "message-content" }; +var _hoisted_3$1 = { class: "icon" }; +var _hoisted_4$1 = { class: "message-text" }; +var _hoisted_5$1 = { key: 0 }; +var _hoisted_6$1 = { key: 1 }; +var _hoisted_7$1 = { class: "modal-footer" }; +//#endregion +//#region src/components/AlertModal.vue +var AlertModal_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({ + __name: "AlertModal", + props: { + show: { type: Boolean }, + title: { default: "Alert" }, + message: {}, + type: { default: "error" }, + preserveWhitespace: { + type: Boolean, + default: false + } + }, + emits: ["close"], + setup(__props, { emit: __emit }) { + const props = __props; + const emit = __emit; + const headerClass = computed(() => { + switch (props.type) { + case "error": return "header-error"; + case "warning": return "header-warning"; + case "info": return "header-info"; + case "success": return "header-success"; + default: return "header-error"; + } + }); + const iconClass = computed(() => { + switch (props.type) { + case "error": return "icon-error"; + case "warning": return "icon-warning"; + case "info": return "icon-info"; + case "success": return "icon-success"; + default: return "icon-error"; + } + }); + const buttonClass = computed(() => { + switch (props.type) { + case "error": return "btn-error"; + case "warning": return "btn-warning"; + case "info": return "btn-info"; + case "success": return "btn-success"; + default: return "btn-error"; + } + }); + const icon = computed(() => { + switch (props.type) { + case "error": return "⚠️"; + case "warning": return "⚠️"; + case "info": return "ℹ️"; + case "success": return "✅"; + default: return "⚠️"; + } + }); + const closeModal = () => { + emit("close"); + }; + return (_ctx, _cache) => { + return __props.show ? (openBlock(), createElementBlock("div", { + key: 0, + class: "modal-overlay", + onClick: closeModal + }, [createBaseVNode("div", { + class: "modal", + onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"])) + }, [ + createBaseVNode("div", { class: normalizeClass(["modal-header", headerClass.value]) }, [createBaseVNode("h3", null, toDisplayString(__props.title), 1), createBaseVNode("button", { + onClick: closeModal, + class: "close-btn" + }, "×")], 2), + createBaseVNode("div", _hoisted_1$1, [createBaseVNode("div", _hoisted_2$1, [icon.value ? (openBlock(), createElementBlock("div", { + key: 0, + class: normalizeClass(["icon-container", iconClass.value]) + }, [createBaseVNode("span", _hoisted_3$1, toDisplayString(icon.value), 1)], 2)) : createCommentVNode("", true), createBaseVNode("div", _hoisted_4$1, [__props.preserveWhitespace ? (openBlock(), createElementBlock("pre", _hoisted_5$1, toDisplayString(__props.message), 1)) : (openBlock(), createElementBlock("p", _hoisted_6$1, toDisplayString(__props.message), 1))])])]), + createBaseVNode("div", _hoisted_7$1, [createBaseVNode("button", { + onClick: closeModal, + class: normalizeClass(["ok-btn", buttonClass.value]) + }, " OK ", 2)]) + ])])) : createCommentVNode("", true); + }; + } +}), [["__scopeId", "data-v-5efb8bd4"]]); +//#endregion +//#region src/views/Resources.vue?vue&type=script&setup=true&lang.ts +var _hoisted_1 = { class: "resources" }; +var _hoisted_2 = { class: "header-section" }; +var _hoisted_3 = { + key: 0, + class: "cli-indicator" +}; +var _hoisted_4 = { + key: 0, + class: "loading" +}; +var _hoisted_5 = { + key: 1, + class: "error" +}; +var _hoisted_6 = { + key: 2, + class: "resources-container" +}; +var _hoisted_7 = { class: "templates-section" }; +var _hoisted_8 = { class: "section-header" }; +var _hoisted_9 = { class: "item-count" }; +var _hoisted_10 = { + key: 0, + class: "no-resources" +}; +var _hoisted_11 = { + key: 1, + class: "resource-grid" +}; +var _hoisted_12 = { class: "card-header" }; +var _hoisted_13 = { class: "card-title" }; +var _hoisted_14 = { class: "card-badges" }; +var _hoisted_15 = { + key: 0, + class: "badge resources-badge" +}; +var _hoisted_16 = { + key: 1, + class: "badge permissions-badge" +}; +var _hoisted_17 = { + key: 2, + class: "badge namespaces-badge" +}; +var _hoisted_18 = { class: "card-content" }; +var _hoisted_19 = { + key: 0, + class: "card-description" +}; +var _hoisted_20 = { + key: 1, + class: "card-preview" +}; +var _hoisted_21 = { class: "resource-preview" }; +var _hoisted_22 = { + key: 0, + class: "more-indicator" +}; +var _hoisted_23 = { class: "card-actions" }; +var _hoisted_24 = ["onClick"]; +var _hoisted_25 = ["onClick"]; +var _hoisted_26 = { + key: 0, + class: "collections-section" +}; +var _hoisted_27 = { class: "section-header" }; +var _hoisted_28 = { class: "item-count" }; +var _hoisted_29 = { class: "resource-grid" }; +var _hoisted_30 = { class: "card-header" }; +var _hoisted_31 = { class: "card-title" }; +var _hoisted_32 = { class: "card-content" }; +var _hoisted_33 = { + key: 0, + class: "card-description" +}; +var _hoisted_34 = { + key: 1, + class: "collection-templates" +}; +var _hoisted_35 = { class: "template-list" }; +var _hoisted_36 = { + key: 0, + class: "more-indicator" +}; +//#endregion +//#region src/views/Resources.vue +var Resources_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({ + __name: "Resources", + setup(__props) { + const route = useRoute(); + const loading = /* @__PURE__ */ ref(true); + const error = /* @__PURE__ */ ref(null); + const templates = /* @__PURE__ */ ref([]); + const collections = /* @__PURE__ */ ref([]); + const showBindingResult = /* @__PURE__ */ ref(false); + const selectedTemplateName = /* @__PURE__ */ ref(""); + const bindingResponse = /* @__PURE__ */ ref(null); + const showAlert = /* @__PURE__ */ ref(false); + const alertTitle = /* @__PURE__ */ ref("Alert"); + const alertMessage = /* @__PURE__ */ ref(""); + const alertType = /* @__PURE__ */ ref("error"); + const alertPreserveWhitespace = /* @__PURE__ */ ref(false); + const isCliFlow = computed(() => authService.isCliFlow()); + const showBindingModal = /* @__PURE__ */ ref(false); + const selectedTemplate = /* @__PURE__ */ ref(null); + const cluster = computed(() => route.query.cluster_id || ""); + const consumerId = computed(() => route.query.consumer_id || ""); + const buildApiUrl = (endpoint) => { + const params = new URLSearchParams(); + if (cluster.value) params.set("cluster_id", cluster.value); + if (consumerId.value) params.set("consumer_id", consumerId.value); + return params.toString() ? `${endpoint}?${params.toString()}` : endpoint; + }; + const loadResources = function() { + var _ref = _asyncToGenerator(function* () { + loading.value = true; + error.value = null; + try { + const templatesUrl = buildApiUrl("/templates"); + const collectionsUrl = buildApiUrl("/collections"); + const [templatesResponse, collectionsResponse] = yield Promise.all([httpClient.get(templatesUrl), httpClient.get(collectionsUrl)]); + templates.value = templatesResponse.data.items || []; + collections.value = collectionsResponse.data.items || []; + } catch (err) { + console.error("Failed to load resources:", err); + if (err instanceof StructuredError) { + const kubeError = err.kubeBindError; + if (kubeError.code === "AUTHENTICATION_FAILED") return; + switch (kubeError.code) { + case "AUTHORIZATION_FAILED": + error.value = `Authorization failed: ${kubeError.details || kubeError.message}`; + break; + case "CLUSTER_CONNECTION_FAILED": + error.value = `Could not connect to cluster: ${kubeError.details || kubeError.message}`; + break; + case "RESOURCE_NOT_FOUND": + error.value = `Resources not found: ${kubeError.details || kubeError.message}`; + break; + default: error.value = `Error: ${kubeError.message}`; + } + } else { + var _err$response; + if (((_err$response = err.response) === null || _err$response === void 0 ? void 0 : _err$response.status) === 401) return; + error.value = "Failed to load resources. Please try again."; + } + } finally { + loading.value = false; + } + }); + return function loadResources() { + return _ref.apply(this, arguments); + }; + }(); + const openBindingModal = (template) => { + selectedTemplate.value = template; + showBindingModal.value = true; + }; + const closeBindingModal = () => { + showBindingModal.value = false; + selectedTemplate.value = null; + }; + const showTemplateDetails = (template) => { + openBindingModal(template); + }; + const handleBind = function() { + var _ref2 = _asyncToGenerator(function* (templateName, bindingName) { + try { + const bindUrl = buildApiUrl("/bind"); + const clusterIdentity = consumerId.value || "ui-identity"; + const bindingRequest = { + metadata: { name: bindingName }, + spec: { + templateRef: { name: templateName }, + clusterIdentity: { identity: clusterIdentity }, + author: "web-ui" + } + }; + const response = yield httpClient.post(bindUrl, bindingRequest); + if (response.status === 200) { + closeBindingModal(); + if (authService.isCliFlow()) { + console.log(response.data); + authService.redirectToCliCallback(response.data); + } else { + bindingResponse.value = response.data; + selectedTemplateName.value = templateName; + showBindingResult.value = true; + } + } else showAlertModal(`Failed to bind template: ${templateName}`, "Binding Failed", "error"); + } catch (err) { + console.error("Failed to bind template:", err); + if (err instanceof StructuredError) { + const kubeError = err.kubeBindError; + if (kubeError.code === "AUTHENTICATION_FAILED") return; + let errorMessage; + switch (kubeError.code) { + case "AUTHORIZATION_FAILED": + errorMessage = `Authorization failed: You don't have permission to bind resources in this cluster.\n\nDetails: ${kubeError.details || kubeError.message}`; + break; + case "CLUSTER_CONNECTION_FAILED": + errorMessage = `Cluster connection failed: Unable to connect to the target cluster.\n\nDetails: ${kubeError.details || kubeError.message}`; + break; + case "RESOURCE_NOT_FOUND": + errorMessage = `Template not found: The requested template could not be found.\n\nDetails: ${kubeError.details || kubeError.message}`; + break; + default: errorMessage = `Failed to bind template: ${kubeError.message}\n\nDetails: ${kubeError.details || "No additional details available"}`; + } + showAlertModal(errorMessage, "Binding Failed", "error", true); + } else { + var _err$response2; + if (((_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : _err$response2.status) === 401) return; + showAlertModal(`Failed to bind template: ${templateName}. Check console for details.`, "Binding Failed", "error"); + } + } + }); + return function handleBind(_x, _x2) { + return _ref2.apply(this, arguments); + }; + }(); + const closeBindingResult = () => { + showBindingResult.value = false; + bindingResponse.value = null; + selectedTemplateName.value = ""; + }; + const showAlertModal = (message, title = "Error", type = "error", preserveWhitespace = false) => { + alertMessage.value = message; + alertTitle.value = title; + alertType.value = type; + alertPreserveWhitespace.value = preserveWhitespace; + showAlert.value = true; + }; + const closeAlert = () => { + showAlert.value = false; + }; + onMounted(() => { + loadResources(); + }); + return (_ctx, _cache) => { + return openBlock(), createElementBlock("div", _hoisted_1, [ + createBaseVNode("div", _hoisted_2, [_cache[0] || (_cache[0] = createBaseVNode("h2", null, "Available Resources", -1)), isCliFlow.value ? (openBlock(), createElementBlock("div", _hoisted_3, " CLI Mode: Select a template to bind for CLI ")) : createCommentVNode("", true)]), + loading.value ? (openBlock(), createElementBlock("div", _hoisted_4, " Loading resources... ")) : error.value ? (openBlock(), createElementBlock("div", _hoisted_5, [ + _cache[1] || (_cache[1] = createBaseVNode("h3", null, "Error Loading Resources", -1)), + createBaseVNode("p", null, toDisplayString(error.value), 1), + createBaseVNode("button", { + onClick: loadResources, + class: "retry-btn" + }, "Retry") + ])) : (openBlock(), createElementBlock("div", _hoisted_6, [createBaseVNode("div", _hoisted_7, [createBaseVNode("div", _hoisted_8, [_cache[2] || (_cache[2] = createBaseVNode("h3", null, "Templates", -1)), createBaseVNode("span", _hoisted_9, toDisplayString(templates.value.length) + " available", 1)]), templates.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_10, [..._cache[3] || (_cache[3] = [ + createBaseVNode("div", { class: "no-resources-icon" }, [createBaseVNode("svg", { + width: "48", + height: "48", + fill: "none", + stroke: "currentColor", + viewBox: "0 0 24 24" + }, [createBaseVNode("path", { + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-width": "1.5", + d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" + })])], -1), + createBaseVNode("h4", null, "No templates available", -1), + createBaseVNode("p", null, "There are no API service export templates available in this cluster.", -1) + ])])) : (openBlock(), createElementBlock("div", _hoisted_11, [(openBlock(true), createElementBlock(Fragment, null, renderList(templates.value, (template) => { + var _template$spec$resour, _template$spec$permis, _template$spec$namesp, _template$spec$resour2; + return openBlock(), createElementBlock("div", { + key: template.metadata.name, + class: "template-card" + }, [ + createBaseVNode("div", _hoisted_12, [createBaseVNode("h4", _hoisted_13, toDisplayString(template.metadata.name), 1), createBaseVNode("div", _hoisted_14, [ + ((_template$spec$resour = template.spec.resources) === null || _template$spec$resour === void 0 ? void 0 : _template$spec$resour.length) ? (openBlock(), createElementBlock("span", _hoisted_15, toDisplayString(template.spec.resources.length) + " resources ", 1)) : createCommentVNode("", true), + ((_template$spec$permis = template.spec.permissionClaims) === null || _template$spec$permis === void 0 ? void 0 : _template$spec$permis.length) ? (openBlock(), createElementBlock("span", _hoisted_16, toDisplayString(template.spec.permissionClaims.length) + " permissions ", 1)) : createCommentVNode("", true), + ((_template$spec$namesp = template.spec.namespaces) === null || _template$spec$namesp === void 0 ? void 0 : _template$spec$namesp.length) ? (openBlock(), createElementBlock("span", _hoisted_17, toDisplayString(template.spec.namespaces.length) + " namespaces ", 1)) : createCommentVNode("", true) + ])]), + createBaseVNode("div", _hoisted_18, [template.spec.description ? (openBlock(), createElementBlock("p", _hoisted_19, toDisplayString(template.spec.description), 1)) : createCommentVNode("", true), ((_template$spec$resour2 = template.spec.resources) === null || _template$spec$resour2 === void 0 ? void 0 : _template$spec$resour2.length) ? (openBlock(), createElementBlock("div", _hoisted_20, [_cache[4] || (_cache[4] = createBaseVNode("strong", null, "Key Resources:", -1)), createBaseVNode("div", _hoisted_21, [(openBlock(true), createElementBlock(Fragment, null, renderList(template.spec.resources.slice(0, 3), (resource) => { + return openBlock(), createElementBlock("span", { + key: resource.resource, + class: "resource-tag" + }, toDisplayString(resource.resource), 1); + }), 128)), template.spec.resources.length > 3 ? (openBlock(), createElementBlock("span", _hoisted_22, " +" + toDisplayString(template.spec.resources.length - 3) + " more ", 1)) : createCommentVNode("", true)])])) : createCommentVNode("", true)]), + createBaseVNode("div", _hoisted_23, [createBaseVNode("button", { + onClick: ($event) => showTemplateDetails(template), + class: "details-btn" + }, " View Details ", 8, _hoisted_24), createBaseVNode("button", { + onClick: ($event) => openBindingModal(template), + class: "bind-btn" + }, toDisplayString(isCliFlow.value ? "Bind for CLI" : "Bind"), 9, _hoisted_25)]) + ]); + }), 128))]))]), collections.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_26, [createBaseVNode("div", _hoisted_27, [_cache[5] || (_cache[5] = createBaseVNode("h3", null, "Collections", -1)), createBaseVNode("span", _hoisted_28, toDisplayString(collections.value.length) + " available", 1)]), createBaseVNode("div", _hoisted_29, [(openBlock(true), createElementBlock(Fragment, null, renderList(collections.value, (collection) => { + var _collection$spec$temp; + return openBlock(), createElementBlock("div", { + key: collection.metadata.name, + class: "collection-card" + }, [createBaseVNode("div", _hoisted_30, [createBaseVNode("h4", _hoisted_31, toDisplayString(collection.metadata.name), 1)]), createBaseVNode("div", _hoisted_32, [collection.spec.description ? (openBlock(), createElementBlock("p", _hoisted_33, toDisplayString(collection.spec.description), 1)) : createCommentVNode("", true), ((_collection$spec$temp = collection.spec.templates) === null || _collection$spec$temp === void 0 ? void 0 : _collection$spec$temp.length) ? (openBlock(), createElementBlock("div", _hoisted_34, [_cache[6] || (_cache[6] = createBaseVNode("strong", null, "Templates in this collection:", -1)), createBaseVNode("div", _hoisted_35, [(openBlock(true), createElementBlock(Fragment, null, renderList(collection.spec.templates.slice(0, 4), (templateName) => { + return openBlock(), createElementBlock("span", { + key: templateName, + class: "template-tag" + }, toDisplayString(templateName), 1); + }), 128)), collection.spec.templates.length > 4 ? (openBlock(), createElementBlock("span", _hoisted_36, " +" + toDisplayString(collection.spec.templates.length - 4) + " more ", 1)) : createCommentVNode("", true)])])) : createCommentVNode("", true)])]); + }), 128))])])) : createCommentVNode("", true)])), + selectedTemplate.value ? (openBlock(), createBlock(TemplateBindingModal_default, { + key: 3, + show: showBindingModal.value, + template: selectedTemplate.value, + "is-cli-flow": isCliFlow.value, + onClose: closeBindingModal, + onBind: handleBind + }, null, 8, [ + "show", + "template", + "is-cli-flow" + ])) : createCommentVNode("", true), + bindingResponse.value ? (openBlock(), createBlock(BindingResult_default, { + key: 4, + show: showBindingResult.value, + "template-name": selectedTemplateName.value, + "binding-response": bindingResponse.value, + onClose: closeBindingResult + }, null, 8, [ + "show", + "template-name", + "binding-response" + ])) : createCommentVNode("", true), + createVNode(AlertModal_default, { + show: showAlert.value, + title: alertTitle.value, + message: alertMessage.value, + type: alertType.value, + "preserve-whitespace": alertPreserveWhitespace.value, + onClose: closeAlert + }, null, 8, [ + "show", + "title", + "message", + "type", + "preserve-whitespace" + ]) + ]); + }; + } +}), [["__scopeId", "data-v-2bef16ba"]]); +//#endregion +//#region src/main.ts +var routes = [{ + path: "/", + component: Resources_default +}, { + path: "/resources", + component: Resources_default +}]; +var router = createRouter({ + history: createWebHistory(), + routes +}); +createApp(App_default).use(router).mount("#app"); +//#endregion diff --git a/web/dist/assets/index.acf75b09.css b/web/dist/assets/index.CxJLQV_T.css similarity index 93% rename from web/dist/assets/index.acf75b09.css rename to web/dist/assets/index.CxJLQV_T.css index efa15bfd5..e14563765 100644 --- a/web/dist/assets/index.acf75b09.css +++ b/web/dist/assets/index.CxJLQV_T.css @@ -915,30 +915,30 @@ to { transform: translateY(0) scale(1); opacity: 1; transform: translateY(-1px); } -.resources[data-v-adbc8337] { +.resources[data-v-2bef16ba] { max-width: 1200px; margin: 0 auto; padding: 2rem; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif; } -.header-section[data-v-adbc8337] { +.header-section[data-v-2bef16ba] { margin-bottom: 2rem; } -.resources h2[data-v-adbc8337] { +.resources h2[data-v-2bef16ba] { color: #1e293b; margin-bottom: 1rem; font-size: 1.875rem; font-weight: 600; font-family: inherit; } -.resources h3[data-v-adbc8337] { +.resources h3[data-v-2bef16ba] { color: #334155; font-size: 1.25rem; font-weight: 600; font-family: inherit; margin: 0; } -.cli-indicator[data-v-adbc8337] { +.cli-indicator[data-v-2bef16ba] { background-color: #dbeafe; border: 1px solid #3b82f6; border-radius: 8px; @@ -950,17 +950,17 @@ to { transform: translateY(0) scale(1); opacity: 1; align-items: center; gap: 0.5rem; } -.loading[data-v-adbc8337] { +.loading[data-v-2bef16ba] { text-align: center; padding: 2rem; color: #666; } -.error[data-v-adbc8337] { +.error[data-v-2bef16ba] { text-align: center; padding: 2rem; color: #dc3545; } -.retry-btn[data-v-adbc8337] { +.retry-btn[data-v-2bef16ba] { padding: 0.5rem 1rem; background-color: #007bff; color: white; @@ -969,32 +969,32 @@ to { transform: translateY(0) scale(1); opacity: 1; cursor: pointer; margin-top: 1rem; } -.retry-btn[data-v-adbc8337]:hover { +.retry-btn[data-v-2bef16ba]:hover { background-color: #0056b3; } -.resources-container[data-v-adbc8337] { +.resources-container[data-v-2bef16ba] { display: grid; gap: 3rem; } -.templates-section[data-v-adbc8337], -.collections-section[data-v-adbc8337] { +.templates-section[data-v-2bef16ba], +.collections-section[data-v-2bef16ba] { background: #f8fafc; padding: 1.5rem; border-radius: 12px; border: 1px solid #e2e8f0; } -.no-resources[data-v-adbc8337] { +.no-resources[data-v-2bef16ba] { text-align: center; color: #666; padding: 1rem; } -.section-header[data-v-adbc8337] { +.section-header[data-v-2bef16ba] { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; } -.item-count[data-v-adbc8337] { +.item-count[data-v-2bef16ba] { font-size: 0.9rem; color: #666; background: #e9ecef; @@ -1002,7 +1002,7 @@ to { transform: translateY(0) scale(1); opacity: 1; border-radius: 12px; font-weight: 500; } -.no-resources[data-v-adbc8337] { +.no-resources[data-v-2bef16ba] { text-align: center; padding: 3rem 2rem; color: #6b7280; @@ -1010,26 +1010,26 @@ to { transform: translateY(0) scale(1); opacity: 1; border-radius: 12px; border: 2px dashed #d1d5db; } -.no-resources-icon[data-v-adbc8337] { +.no-resources-icon[data-v-2bef16ba] { margin-bottom: 1rem; opacity: 0.4; color: #9ca3af; } -.no-resources h4[data-v-adbc8337] { +.no-resources h4[data-v-2bef16ba] { margin: 0 0 0.5rem 0; color: #374151; font-weight: 600; } -.no-resources p[data-v-adbc8337] { +.no-resources p[data-v-2bef16ba] { margin: 0; font-size: 0.9rem; } -.resource-grid[data-v-adbc8337] { +.resource-grid[data-v-2bef16ba] { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 1.5rem; } -.template-card[data-v-adbc8337], .collection-card[data-v-adbc8337] { +.template-card[data-v-2bef16ba], .collection-card[data-v-2bef16ba] { background: white; border: 1px solid #e2e8f0; border-radius: 12px; @@ -1038,27 +1038,27 @@ to { transform: translateY(0) scale(1); opacity: 1; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); } -.template-card[data-v-adbc8337]:hover, .collection-card[data-v-adbc8337]:hover { +.template-card[data-v-2bef16ba]:hover, .collection-card[data-v-2bef16ba]:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); transform: translateY(-2px); border-color: #cbd5e1; } -.card-header[data-v-adbc8337] { +.card-header[data-v-2bef16ba] { padding: 1.5rem 1.5rem 1rem 1.5rem; border-bottom: 1px solid #f1f5f9; } -.card-title[data-v-adbc8337] { +.card-title[data-v-2bef16ba] { margin: 0 0 0.75rem 0; color: #1e293b; font-size: 1.125rem; font-weight: 600; } -.card-badges[data-v-adbc8337] { +.card-badges[data-v-2bef16ba] { display: flex; flex-wrap: wrap; gap: 0.5rem; } -.badge[data-v-adbc8337] { +.badge[data-v-2bef16ba] { font-size: 0.75rem; padding: 0.25rem 0.75rem; border-radius: 12px; @@ -1066,42 +1066,42 @@ to { transform: translateY(0) scale(1); opacity: 1; display: inline-flex; align-items: center; } -.resources-badge[data-v-adbc8337] { +.resources-badge[data-v-2bef16ba] { background: #dbeafe; color: #1d4ed8; } -.permissions-badge[data-v-adbc8337] { +.permissions-badge[data-v-2bef16ba] { background: #fef3c7; color: #d97706; } -.namespaces-badge[data-v-adbc8337] { +.namespaces-badge[data-v-2bef16ba] { background: #d1fae5; color: #047857; } -.card-content[data-v-adbc8337] { +.card-content[data-v-2bef16ba] { padding: 1rem 1.5rem; } -.card-description[data-v-adbc8337] { +.card-description[data-v-2bef16ba] { color: #64748b; margin: 0 0 1rem 0; line-height: 1.5; font-size: 0.9rem; } -.card-preview[data-v-adbc8337], .collection-templates[data-v-adbc8337] { +.card-preview[data-v-2bef16ba], .collection-templates[data-v-2bef16ba] { margin-top: 1rem; } -.card-preview strong[data-v-adbc8337], .collection-templates strong[data-v-adbc8337] { +.card-preview strong[data-v-2bef16ba], .collection-templates strong[data-v-2bef16ba] { color: #374151; font-size: 0.875rem; display: block; margin-bottom: 0.5rem; } -.resource-preview[data-v-adbc8337], .template-list[data-v-adbc8337] { +.resource-preview[data-v-2bef16ba], .template-list[data-v-2bef16ba] { display: flex; flex-wrap: wrap; gap: 0.5rem; } -.resource-tag[data-v-adbc8337], .template-tag[data-v-adbc8337] { +.resource-tag[data-v-2bef16ba], .template-tag[data-v-2bef16ba] { font-size: 0.75rem; background: #f1f5f9; color: #475569; @@ -1109,12 +1109,12 @@ to { transform: translateY(0) scale(1); opacity: 1; border-radius: 6px; border: 1px solid #e2e8f0; } -.more-indicator[data-v-adbc8337] { +.more-indicator[data-v-2bef16ba] { font-size: 0.75rem; color: #6b7280; font-style: italic; } -.card-actions[data-v-adbc8337] { +.card-actions[data-v-2bef16ba] { padding: 1rem 1.5rem; background: #fafbfc; border-top: 1px solid #f1f5f9; @@ -1122,7 +1122,7 @@ to { transform: translateY(0) scale(1); opacity: 1; gap: 0.75rem; justify-content: flex-end; } -.details-btn[data-v-adbc8337], .bind-btn[data-v-adbc8337] { +.details-btn[data-v-2bef16ba], .bind-btn[data-v-2bef16ba] { padding: 0.5rem 1rem; border: none; border-radius: 6px; @@ -1131,21 +1131,21 @@ to { transform: translateY(0) scale(1); opacity: 1; font-size: 0.875rem; transition: all 0.2s ease; } -.details-btn[data-v-adbc8337] { +.details-btn[data-v-2bef16ba] { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; } -.details-btn[data-v-adbc8337]:hover { +.details-btn[data-v-2bef16ba]:hover { background: #f1f5f9; border-color: #cbd5e1; } -.bind-btn[data-v-adbc8337] { +.bind-btn[data-v-2bef16ba] { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; border: 1px solid transparent; } -.bind-btn[data-v-adbc8337]:hover { +.bind-btn[data-v-2bef16ba]:hover { background: linear-gradient(135deg, #059669 0%, #047857 100%); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2); diff --git a/web/dist/assets/index.b95c154b.js b/web/dist/assets/index.b95c154b.js deleted file mode 100644 index 8ff308ecd..000000000 --- a/web/dist/assets/index.b95c154b.js +++ /dev/null @@ -1,12712 +0,0 @@ -var __defProp = Object.defineProperty; -var __defProps = Object.defineProperties; -var __getOwnPropDescs = Object.getOwnPropertyDescriptors; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getOwnPropSymbols = Object.getOwnPropertySymbols; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __propIsEnum = Object.prototype.propertyIsEnumerable; -var __knownSymbol = (name, symbol) => { - if (symbol = Symbol[name]) - return symbol; - throw Error("Symbol." + name + " is not defined"); -}; -var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var __spreadValues = (a, b) => { - for (var prop in b || (b = {})) - if (__hasOwnProp.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - if (__getOwnPropSymbols) - for (var prop of __getOwnPropSymbols(b)) { - if (__propIsEnum.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - } - return a; -}; -var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __async = (__this, __arguments, generator) => { - return new Promise((resolve, reject) => { - var fulfilled = (value) => { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - }; - var rejected = (value) => { - try { - step(generator.throw(value)); - } catch (e) { - reject(e); - } - }; - var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); - step((generator = generator.apply(__this, __arguments)).next()); - }); -}; -var __await = function(promise, isYieldStar) { - this[0] = promise; - this[1] = isYieldStar; -}; -var __asyncGenerator = (__this, __arguments, generator) => { - var resume = (k, v, yes, no) => { - try { - var x = generator[k](v), isAwait = (v = x.value) instanceof __await, done = x.done; - Promise.resolve(isAwait ? v[0] : v).then((y) => isAwait ? resume(k === "return" ? k : "next", v[1] ? { done: y.done, value: y.value } : y, yes, no) : yes({ value: y, done })).catch((e) => resume("throw", e, yes, no)); - } catch (e) { - no(e); - } - }; - var method = (k) => it[k] = (x) => new Promise((yes, no) => resume(k, x, yes, no)); - var it = {}; - return generator = generator.apply(__this, __arguments), it[Symbol.asyncIterator] = () => it, method("next"), method("throw"), method("return"), it; -}; -var __yieldStar = (value) => { - var obj = value[__knownSymbol("asyncIterator")]; - var isAwait = false; - var method; - var it = {}; - if (obj == null) { - obj = value[__knownSymbol("iterator")](); - method = (k) => it[k] = (x) => obj[k](x); - } else { - obj = obj.call(value); - method = (k) => it[k] = (v) => { - if (isAwait) { - isAwait = false; - if (k === "throw") - throw v; - return v; - } - isAwait = true; - return { - done: false, - value: new __await(new Promise((resolve) => { - var x = obj[k](v); - if (!(x instanceof Object)) - throw TypeError("Object expected"); - resolve(x); - }), 1) - }; - }; - } - return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x) => { - throw x; - }, "return" in obj && method("return"), it; -}; -var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it); -var require_index_001 = __commonJS({ - "assets/index.b95c154b.js"(exports) { - (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); - } - })(); - /** - * @vue/shared v3.5.21 - * (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; - } - const EMPTY_OBJ = {}; - const EMPTY_ARR = []; - const NOOP = () => { - }; - const NO = () => false; - const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter - (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); - const isModelListener = (key) => key.startsWith("onUpdate:"); - const extend$1 = Object.assign; - const remove = (arr, el) => { - const i = arr.indexOf(el); - if (i > -1) { - arr.splice(i, 1); - } - }; - const hasOwnProperty$2 = Object.prototype.hasOwnProperty; - const hasOwn = (val, key) => hasOwnProperty$2.call(val, key); - const isArray$2 = Array.isArray; - const isMap = (val) => toTypeString(val) === "[object Map]"; - const isSet = (val) => toTypeString(val) === "[object Set]"; - const isFunction$2 = (val) => typeof val === "function"; - const isString$1 = (val) => typeof val === "string"; - const isSymbol = (val) => typeof val === "symbol"; - const isObject$1 = (val) => val !== null && typeof val === "object"; - const isPromise = (val) => { - return (isObject$1(val) || isFunction$2(val)) && isFunction$2(val.then) && isFunction$2(val.catch); - }; - const objectToString = Object.prototype.toString; - const toTypeString = (value) => objectToString.call(value); - const toRawType = (value) => { - return toTypeString(value).slice(8, -1); - }; - const isPlainObject$1 = (val) => toTypeString(val) === "[object Object]"; - const isIntegerKey = (key) => isString$1(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; - const isReservedProp = /* @__PURE__ */ makeMap( - // the leading comma is intentional so empty string "" is also included - ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" - ); - const cacheStringFunction = (fn) => { - const cache = /* @__PURE__ */ Object.create(null); - return (str) => { - const hit = cache[str]; - return hit || (cache[str] = fn(str)); - }; - }; - const camelizeRE = /-\w/g; - const camelize = cacheStringFunction( - (str) => { - return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase()); - } - ); - const hyphenateRE = /\B([A-Z])/g; - const hyphenate = cacheStringFunction( - (str) => str.replace(hyphenateRE, "-$1").toLowerCase() - ); - const capitalize = cacheStringFunction((str) => { - return str.charAt(0).toUpperCase() + str.slice(1); - }); - const toHandlerKey = cacheStringFunction( - (str) => { - const s = str ? `on${capitalize(str)}` : ``; - return s; - } - ); - const hasChanged = (value, oldValue) => !Object.is(value, oldValue); - const invokeArrayFns = (fns, ...arg) => { - for (let i = 0; i < fns.length; i++) { - fns[i](...arg); - } - }; - const def = (obj, key, value, writable = false) => { - Object.defineProperty(obj, key, { - configurable: true, - enumerable: false, - writable, - value - }); - }; - const looseToNumber = (val) => { - const n = parseFloat(val); - return isNaN(n) ? val : n; - }; - let _globalThis; - const 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$2(value)) { - const res = {}; - for (let i = 0; i < value.length; i++) { - const item = value[i]; - const normalized = isString$1(item) ? parseStringStyle(item) : normalizeStyle(item); - if (normalized) { - for (const key in normalized) { - res[key] = normalized[key]; - } - } - } - return res; - } else if (isString$1(value) || isObject$1(value)) { - return value; - } - } - const listDelimiterRE = /;(?![^(]*\))/g; - const propertyDelimiterRE = /:([^]+)/; - const 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$1(value)) { - res = value; - } else if (isArray$2(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(); - } - const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; - const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); - function includeBooleanAttr(value) { - return !!value || value === ""; - } - const isRef$1 = (val) => { - return !!(val && val["__v_isRef"] === true); - }; - const toDisplayString = (val) => { - return isString$1(val) ? val : val == null ? "" : isArray$2(val) || isObject$1(val) && (val.toString === objectToString || !isFunction$2(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val); - }; - const 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$2(val) && !isPlainObject$1(val)) { - return String(val); - } - return val; - }; - const stringifySymbol = (v, i = "") => { - var _a; - return ( - // Symbol.description in es2019+ so we need to cast here to pass - // the lib: es2016 check - isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v - ); - }; - /** - * @vue/reactivity v3.5.21 - * (c) 2018-present Yuxi (Evan) You and Vue contributors - * @license MIT - **/ - let activeEffectScope; - class EffectScope { - constructor(detached = false) { - this.detached = detached; - this._active = true; - this._on = 0; - this.effects = []; - this.cleanups = []; - this._isPaused = false; - this.parent = activeEffectScope; - if (!detached && activeEffectScope) { - this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( - this - ) - 1; - } - } - 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) { - activeEffectScope = this.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 getCurrentScope() { - return activeEffectScope; - } - let activeSub; - const pausedQueueEffects = /* @__PURE__ */ new WeakSet(); - class ReactiveEffect { - constructor(fn) { - this.fn = fn; - this.deps = void 0; - this.depsTail = void 0; - this.flags = 1 | 4; - this.next = void 0; - this.cleanup = void 0; - this.scheduler = void 0; - if (activeEffectScope && activeEffectScope.active) { - activeEffectScope.effects.push(this); - } - } - 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); - } - } - let batchDepth = 0; - let batchedSub; - let 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(computed2) { - if (computed2.flags & 4 && !(computed2.flags & 16)) { - return; - } - computed2.flags &= -17; - if (computed2.globalVersion === globalVersion) { - return; - } - computed2.globalVersion = globalVersion; - if (!computed2.isSSR && computed2.flags & 128 && (!computed2.deps && !computed2._dirty || !isDirty(computed2))) { - return; - } - computed2.flags |= 2; - const dep = computed2.dep; - const prevSub = activeSub; - const prevShouldTrack = shouldTrack; - activeSub = computed2; - shouldTrack = true; - try { - prepareDeps(computed2); - const value = computed2.fn(computed2._value); - if (dep.version === 0 || hasChanged(value, computed2._value)) { - computed2.flags |= 128; - computed2._value = value; - dep.version++; - } - } catch (err) { - dep.version++; - throw err; - } finally { - activeSub = prevSub; - shouldTrack = prevShouldTrack; - cleanupDeps(computed2); - computed2.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; - } - } - let shouldTrack = true; - const 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; - } - } - } - let globalVersion = 0; - class Link { - 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; - } - } - class Dep { - // TODO isolatedDeclarations "__v_skip" - constructor(computed2) { - this.computed = computed2; - this.version = 0; - this.activeLink = void 0; - this.subs = void 0; - this.map = void 0; - this.key = void 0; - this.sc = 0; - 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 { - if (false) - ; - 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 computed2 = link.dep.computed; - if (computed2 && !link.dep.subs) { - computed2.flags |= 4 | 16; - for (let l = computed2.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; - } - } - const targetMap = /* @__PURE__ */ new WeakMap(); - const ITERATE_KEY = Symbol( - "" - ); - const MAP_KEY_ITERATE_KEY = Symbol( - "" - ); - const ARRAY_ITERATE_KEY = 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$2(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 reactiveReadArray(array) { - const raw = toRaw(array); - if (raw === array) - return raw; - track(raw, "iterate", ARRAY_ITERATE_KEY); - return isShallow(array) ? raw : raw.map(toReactive); - } - function shallowReadArray(arr) { - track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); - return arr; - } - const arrayInstrumentations = { - __proto__: null, - [Symbol.iterator]() { - return iterator$1(this, Symbol.iterator, toReactive); - }, - concat(...args) { - return reactiveReadArray(this).concat( - ...args.map((x) => isArray$2(x) ? reactiveReadArray(x) : x) - ); - }, - entries() { - return iterator$1(this, "entries", (value) => { - value[1] = toReactive(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(toReactive), arguments); - }, - find(fn, thisArg) { - return apply(this, "find", fn, thisArg, toReactive, arguments); - }, - findIndex(fn, thisArg) { - return apply(this, "findIndex", fn, thisArg, void 0, arguments); - }, - findLast(fn, thisArg) { - return apply(this, "findLast", fn, thisArg, toReactive, arguments); - }, - findLastIndex(fn, thisArg) { - return apply(this, "findLastIndex", fn, thisArg, void 0, arguments); - }, - // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement - 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); - }, - // keys() iterator only reads `length`, no optimization required - 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"); - }, - // slice could use ARRAY_ITERATE but also seems to beg for range tracking - 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$1(this, "values", toReactive); - } - }; - function iterator$1(self2, method, wrapValue) { - const arr = shallowReadArray(self2); - const iter = arr[method](); - if (arr !== self2 && !isShallow(self2)) { - iter._next = iter.next; - iter.next = () => { - const result = iter._next(); - if (result.value) { - result.value = wrapValue(result.value); - } - return result; - }; - } - return iter; - } - const arrayProto = Array.prototype; - function apply(self2, method, fn, thisArg, wrappedRetFn, args) { - const arr = shallowReadArray(self2); - const needsWrap = arr !== self2 && !isShallow(self2); - const methodFn = arr[method]; - if (methodFn !== arrayProto[method]) { - const result2 = methodFn.apply(self2, args); - return needsWrap ? toReactive(result2) : result2; - } - let wrappedFn = fn; - if (arr !== self2) { - if (needsWrap) { - wrappedFn = function(item, index) { - return fn.call(this, toReactive(item), index, self2); - }; - } else if (fn.length > 2) { - wrappedFn = function(item, index) { - return fn.call(this, item, index, self2); - }; - } - } - const result = methodFn.call(arr, wrappedFn, thisArg); - return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; - } - function reduce(self2, method, fn, args) { - const arr = shallowReadArray(self2); - let wrappedFn = fn; - if (arr !== self2) { - if (!isShallow(self2)) { - wrappedFn = function(acc, item, index) { - return fn.call(this, acc, toReactive(item), index, self2); - }; - } else if (fn.length > 3) { - wrappedFn = function(acc, item, index) { - return fn.call(this, acc, item, index, self2); - }; - } - } - return arr[method](wrappedFn, ...args); - } - function searchProxy(self2, method, args) { - const arr = toRaw(self2); - track(arr, "iterate", ARRAY_ITERATE_KEY); - const res = arr[method](...args); - if ((res === -1 || res === false) && isProxy(args[0])) { - args[0] = toRaw(args[0]); - return arr[method](...args); - } - return res; - } - function noTracking(self2, method, args = []) { - pauseTracking(); - startBatch(); - const res = toRaw(self2)[method].apply(self2, args); - endBatch(); - resetTracking(); - return res; - } - const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); - const builtInSymbols = new Set( - /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) - ); - function hasOwnProperty$1(key) { - if (!isSymbol(key)) - key = String(key); - const obj = toRaw(this); - track(obj, "has", key); - return obj.hasOwnProperty(key); - } - class BaseReactiveHandler { - 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) || // receiver is not the reactive proxy, but has the same prototype - // this means the receiver is a user proxy of the reactive proxy - Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { - return target; - } - return; - } - const targetIsArray = isArray$2(target); - if (!isReadonly2) { - let fn; - if (targetIsArray && (fn = arrayInstrumentations[key])) { - return fn; - } - if (key === "hasOwnProperty") { - return hasOwnProperty$1; - } - } - const res = Reflect.get( - target, - key, - // if this is a proxy wrapping a ref, return methods using the raw ref - // as receiver so that we don't have to call `toRaw` on the ref in all - // its class methods - 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 (isRef(res)) { - return targetIsArray && isIntegerKey(key) ? res : res.value; - } - if (isObject$1(res)) { - return isReadonly2 ? readonly(res) : reactive(res); - } - return res; - } - } - class MutableReactiveHandler extends BaseReactiveHandler { - constructor(isShallow2 = false) { - super(false, isShallow2); - } - set(target, key, value, receiver) { - let oldValue = target[key]; - if (!this._isShallow) { - const isOldValueReadonly = isReadonly(oldValue); - if (!isShallow(value) && !isReadonly(value)) { - oldValue = toRaw(oldValue); - value = toRaw(value); - } - if (!isArray$2(target) && isRef(oldValue) && !isRef(value)) { - if (isOldValueReadonly) { - return true; - } else { - oldValue.value = value; - return true; - } - } - } - const hadKey = isArray$2(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key); - const result = Reflect.set( - target, - key, - value, - isRef(target) ? target : receiver - ); - if (target === toRaw(receiver)) { - if (!hadKey) { - trigger(target, "add", key, value); - } else if (hasChanged(value, oldValue)) { - trigger(target, "set", key, value); - } - } - return result; - } - deleteProperty(target, key) { - const hadKey = hasOwn(target, key); - target[key]; - const result = Reflect.deleteProperty(target, key); - if (result && hadKey) { - trigger(target, "delete", key, void 0); - } - 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$2(target) ? "length" : ITERATE_KEY - ); - return Reflect.ownKeys(target); - } - } - class ReadonlyReactiveHandler extends BaseReactiveHandler { - constructor(isShallow2 = false) { - super(true, isShallow2); - } - set(target, key) { - return true; - } - deleteProperty(target, key) { - return true; - } - } - const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); - const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); - const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true); - const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); - const toShallow = (value) => value; - const getProto = (v) => Reflect.getPrototypeOf(v); - function createIterableMethod(method, isReadonly2, isShallow2) { - return function(...args) { - const target = this["__v_raw"]; - const rawTarget = 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 { - // iterator protocol - next() { - const { value, done } = innerIterator.next(); - return done ? { value, done } : { - value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), - done - }; - }, - // iterable protocol - [Symbol.iterator]() { - return this; - } - }; - }; - } - function createReadonlyMethod(type) { - return function(...args) { - return type === "delete" ? false : type === "clear" ? void 0 : this; - }; - } - function createInstrumentations(readonly2, shallow) { - const instrumentations = { - get(key) { - const target = this["__v_raw"]; - const rawTarget = toRaw(target); - const rawKey = toRaw(key); - if (!readonly2) { - if (hasChanged(key, rawKey)) { - track(rawTarget, "get", key); - } - track(rawTarget, "get", rawKey); - } - const { has } = getProto(rawTarget); - const wrap = shallow ? toShallow : readonly2 ? 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"]; - !readonly2 && track(toRaw(target), "iterate", ITERATE_KEY); - return target.size; - }, - has(key) { - const target = this["__v_raw"]; - const rawTarget = toRaw(target); - const rawKey = toRaw(key); - if (!readonly2) { - 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 = toRaw(target); - const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive; - !readonly2 && track(rawTarget, "iterate", ITERATE_KEY); - return target.forEach((value, key) => { - return callback.call(thisArg, wrap(value), wrap(key), observed); - }); - } - }; - extend$1( - instrumentations, - readonly2 ? { - add: createReadonlyMethod("add"), - set: createReadonlyMethod("set"), - delete: createReadonlyMethod("delete"), - clear: createReadonlyMethod("clear") - } : { - add(value) { - if (!shallow && !isShallow(value) && !isReadonly(value)) { - value = toRaw(value); - } - const target = toRaw(this); - const proto = getProto(target); - const hadKey = proto.has.call(target, value); - if (!hadKey) { - target.add(value); - trigger(target, "add", value, value); - } - return this; - }, - set(key, value) { - if (!shallow && !isShallow(value) && !isReadonly(value)) { - value = toRaw(value); - } - const target = toRaw(this); - const { has, get } = getProto(target); - let hadKey = has.call(target, key); - if (!hadKey) { - key = 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); - } - return this; - }, - delete(key) { - const target = toRaw(this); - const { has, get } = getProto(target); - let hadKey = has.call(target, key); - if (!hadKey) { - key = toRaw(key); - hadKey = has.call(target, key); - } - get ? get.call(target, key) : void 0; - const result = target.delete(key); - if (hadKey) { - trigger(target, "delete", key, void 0); - } - return result; - }, - clear() { - const target = toRaw(this); - const hadItems = target.size !== 0; - const result = target.clear(); - if (hadItems) { - trigger( - target, - "clear", - void 0, - void 0 - ); - } - return result; - } - } - ); - const iteratorMethods = [ - "keys", - "values", - "entries", - Symbol.iterator - ]; - iteratorMethods.forEach((method) => { - instrumentations[method] = createIterableMethod(method, readonly2, 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 - ); - }; - } - const mutableCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(false, false) - }; - const shallowCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(false, true) - }; - const readonlyCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(true, false) - }; - const shallowReadonlyCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(true, true) - }; - const reactiveMap = /* @__PURE__ */ new WeakMap(); - const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); - const readonlyMap = /* @__PURE__ */ new WeakMap(); - const 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; - } - } - function getTargetType(value) { - return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value)); - } - function reactive(target) { - if (isReadonly(target)) { - return target; - } - return createReactiveObject( - target, - false, - mutableHandlers, - mutableCollectionHandlers, - reactiveMap - ); - } - function shallowReactive(target) { - return createReactiveObject( - target, - false, - shallowReactiveHandlers, - shallowCollectionHandlers, - shallowReactiveMap - ); - } - function readonly(target) { - return createReactiveObject( - target, - true, - readonlyHandlers, - readonlyCollectionHandlers, - readonlyMap - ); - } - 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; - } - const targetType = getTargetType(target); - if (targetType === 0) { - return target; - } - const existingProxy = proxyMap.get(target); - if (existingProxy) { - return existingProxy; - } - const proxy = new Proxy( - target, - targetType === 2 ? collectionHandlers : baseHandlers - ); - proxyMap.set(target, proxy); - return proxy; - } - function isReactive(value) { - if (isReadonly(value)) { - return isReactive(value["__v_raw"]); - } - return !!(value && value["__v_isReactive"]); - } - function isReadonly(value) { - return !!(value && value["__v_isReadonly"]); - } - function isShallow(value) { - return !!(value && value["__v_isShallow"]); - } - function isProxy(value) { - return value ? !!value["__v_raw"] : false; - } - function toRaw(observed) { - const raw = observed && observed["__v_raw"]; - return raw ? toRaw(raw) : observed; - } - function markRaw(value) { - if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) { - def(value, "__v_skip", true); - } - return value; - } - const toReactive = (value) => isObject$1(value) ? reactive(value) : value; - const toReadonly = (value) => isObject$1(value) ? readonly(value) : value; - function isRef(r) { - return r ? r["__v_isRef"] === true : false; - } - function ref(value) { - return createRef(value, false); - } - function shallowRef(value) { - return createRef(value, true); - } - function createRef(rawValue, shallow) { - if (isRef(rawValue)) { - return rawValue; - } - return new RefImpl(rawValue, shallow); - } - class RefImpl { - constructor(value, isShallow2) { - this.dep = new Dep(); - this["__v_isRef"] = true; - this["__v_isShallow"] = false; - this._rawValue = isShallow2 ? value : 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"] || isShallow(newValue) || isReadonly(newValue); - newValue = useDirectValue ? newValue : toRaw(newValue); - if (hasChanged(newValue, oldValue)) { - this._rawValue = newValue; - this._value = useDirectValue ? newValue : toReactive(newValue); - { - this.dep.trigger(); - } - } - } - } - function unref(ref2) { - return isRef(ref2) ? ref2.value : ref2; - } - const 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 (isRef(oldValue) && !isRef(value)) { - oldValue.value = value; - return true; - } else { - return Reflect.set(target, key, value, receiver); - } - } - }; - function proxyRefs(objectWithRefs) { - return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); - } - class ComputedRefImpl { - constructor(fn, setter, isSSR) { - this.fn = fn; - this.setter = setter; - this._value = void 0; - this.dep = new Dep(this); - this.__v_isRef = true; - this.deps = void 0; - this.depsTail = void 0; - this.flags = 16; - this.globalVersion = globalVersion - 1; - this.next = void 0; - this.effect = this; - this["__v_isReadonly"] = !setter; - this.isSSR = isSSR; - } - /** - * @internal - */ - notify() { - this.flags |= 16; - if (!(this.flags & 8) && // avoid infinite self recursion - 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); - } - } - } - function computed$1(getterOrOptions, debugOptions, isSSR = false) { - let getter; - let setter; - if (isFunction$2(getterOrOptions)) { - getter = getterOrOptions; - } else { - getter = getterOrOptions.get; - setter = getterOrOptions.set; - } - const cRef = new ComputedRefImpl(getter, setter, isSSR); - return cRef; - } - const INITIAL_WATCHER_VALUE = {}; - const cleanupMap = /* @__PURE__ */ new WeakMap(); - let 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 (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 (isRef(source)) { - getter = () => source.value; - forceTrigger = isShallow(source); - } else if (isReactive(source)) { - getter = () => reactiveGetter(source); - forceTrigger = true; - } else if (isArray$2(source)) { - isMultiSource = true; - forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); - getter = () => source.map((s) => { - if (isRef(s)) { - return s.value; - } else if (isReactive(s)) { - return reactiveGetter(s); - } else if (isFunction$2(s)) { - return call ? call(s, 2) : s(); - } else - ; - }); - } else if (isFunction$2(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, - // pass undefined as the old value when it's changed for the first time - oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, - boundCleanup - ]; - oldValue = newValue; - call ? call(cb, 3, args) : ( - // @ts-expect-error - 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 (isRef(value)) { - traverse(value.value, depth, seen); - } else if (isArray$2(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; - } - /** - * @vue/runtime-core v3.5.21 - * (c) 2018-present Yuxi (Evan) You and Vue contributors - * @license MIT - **/ - const stack = []; - let isWarning = false; - function warn$1(msg, ...args) { - if (isWarning) - return; - isWarning = true; - pauseTracking(); - const instance = stack.length ? stack[stack.length - 1].component : null; - const appWarnHandler = instance && instance.appContext.config.warnHandler; - const trace = getComponentTrace(); - if (appWarnHandler) { - callWithErrorHandling( - appWarnHandler, - instance, - 11, - [ - // eslint-disable-next-line no-restricted-syntax - msg + args.map((a) => { - var _a, _b; - return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a); - }).join(""), - instance && instance.proxy, - trace.map( - ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` - ).join("\n"), - trace - ] - ); - } else { - const warnArgs = [`[Vue warn]: ${msg}`, ...args]; - if (trace.length && // avoid spamming console during tests - true) { - warnArgs.push(` -`, ...formatTrace(trace)); - } - console.warn(...warnArgs); - } - resetTracking(); - isWarning = false; - } - function getComponentTrace() { - let currentVNode = stack[stack.length - 1]; - if (!currentVNode) { - return []; - } - const normalizedStack = []; - while (currentVNode) { - const last = normalizedStack[0]; - if (last && last.vnode === currentVNode) { - last.recurseCount++; - } else { - normalizedStack.push({ - vnode: currentVNode, - recurseCount: 0 - }); - } - const parentInstance = currentVNode.component && currentVNode.component.parent; - currentVNode = parentInstance && parentInstance.vnode; - } - return normalizedStack; - } - function formatTrace(trace) { - const logs = []; - trace.forEach((entry, i) => { - logs.push(...i === 0 ? [] : [` -`], ...formatTraceEntry(entry)); - }); - return logs; - } - function formatTraceEntry({ vnode, recurseCount }) { - const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; - const isRoot = vnode.component ? vnode.component.parent == null : false; - const open = ` at <${formatComponentName( - vnode.component, - vnode.type, - isRoot - )}`; - const close = `>` + postfix; - return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; - } - function formatProps(props) { - const res = []; - const keys = Object.keys(props); - keys.slice(0, 3).forEach((key) => { - res.push(...formatProp(key, props[key])); - }); - if (keys.length > 3) { - res.push(` ...`); - } - return res; - } - function formatProp(key, value, raw) { - if (isString$1(value)) { - value = JSON.stringify(value); - return raw ? value : [`${key}=${value}`]; - } else if (typeof value === "number" || typeof value === "boolean" || value == null) { - return raw ? value : [`${key}=${value}`]; - } else if (isRef(value)) { - value = formatProp(key, toRaw(value.value), true); - return raw ? value : [`${key}=Ref<`, value, `>`]; - } else if (isFunction$2(value)) { - return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; - } else { - value = toRaw(value); - return raw ? value : [`${key}=`, value]; - } - } - 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$2(fn)) { - const res = callWithErrorHandling(fn, instance, type, args); - if (res && isPromise(res)) { - res.catch((err) => { - handleError(err, instance, type); - }); - } - return res; - } - if (isArray$2(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); - } - } - const queue = []; - let flushIndex = -1; - const pendingPostFlushCbs = []; - let activePostFlushCbs = null; - let postFlushIndex = 0; - const resolvedPromise = /* @__PURE__ */ Promise.resolve(); - let currentFlushPromise = null; - function nextTick(fn) { - const p2 = currentFlushPromise || resolvedPromise; - return fn ? p2.then(this ? fn.bind(this) : fn) : p2; - } - 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 || // fast path when the job id is larger than the tail - !(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$2(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; - } - } - const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id; - function flushJobs(seen) { - const check = NOOP; - try { - for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { - const job = queue[flushIndex]; - if (job && !(job.flags & 8)) { - if (false) - ; - if (job.flags & 4) { - job.flags &= ~1; - } - callWithErrorHandling( - job, - job.i, - job.i ? 15 : 14 - ); - if (!(job.flags & 4)) { - job.flags &= ~1; - } - } - } - } finally { - for (; flushIndex < queue.length; flushIndex++) { - const job = queue[flushIndex]; - if (job) { - job.flags &= -2; - } - } - flushIndex = -1; - queue.length = 0; - flushPostFlushCbs(); - currentFlushPromise = null; - if (queue.length || pendingPostFlushCbs.length) { - flushJobs(); - } - } - } - let currentRenderingInstance = null; - let currentScopeId = null; - function setCurrentRenderingInstance(instance) { - const prev = currentRenderingInstance; - currentRenderingInstance = instance; - currentScopeId = instance && instance.type.__scopeId || null; - return prev; - } - 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$2(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(); - } - } - } - const TeleportEndKey = Symbol("_vte"); - const isTeleport = (type) => type.__isTeleport; - const leaveCbKey = 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$2(options) ? ( - // #8236: extend call and options.name access are considered side-effects - // by Rollup, so we have to wrap it in a pure-annotated IIFE. - /* @__PURE__ */ (() => extend$1({ name: options.name }, extraOptions, { setup: options }))() - ) : options; - } - function markAsyncBoundary(instance) { - instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0]; - } - const pendingSetRefMap = /* @__PURE__ */ new WeakMap(); - function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { - if (isArray$2(rawRef)) { - rawRef.forEach( - (r, i) => setRef( - r, - oldRawRef && (isArray$2(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: ref2 } = rawRef; - const oldRef = oldRawRef && oldRawRef.r; - const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; - const setupState = owner.setupState; - const rawSetupState = toRaw(setupState); - const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => { - return hasOwn(rawSetupState, key); - }; - if (oldRef != null && oldRef !== ref2) { - invalidatePendingSetRef(oldRawRef); - if (isString$1(oldRef)) { - refs[oldRef] = null; - if (canSetSetupRef(oldRef)) { - setupState[oldRef] = null; - } - } else if (isRef(oldRef)) { - { - oldRef.value = null; - } - const oldRawRefAtom = oldRawRef; - if (oldRawRefAtom.k) - refs[oldRawRefAtom.k] = null; - } - } - if (isFunction$2(ref2)) { - callWithErrorHandling(ref2, owner, 12, [value, refs]); - } else { - const _isString = isString$1(ref2); - const _isRef = isRef(ref2); - if (_isString || _isRef) { - const doSet = () => { - if (rawRef.f) { - const existing = _isString ? canSetSetupRef(ref2) ? setupState[ref2] : refs[ref2] : ref2.value; - if (isUnmount) { - isArray$2(existing) && remove(existing, refValue); - } else { - if (!isArray$2(existing)) { - if (_isString) { - refs[ref2] = [refValue]; - if (canSetSetupRef(ref2)) { - setupState[ref2] = refs[ref2]; - } - } else { - const newVal = [refValue]; - { - ref2.value = newVal; - } - if (rawRef.k) - refs[rawRef.k] = newVal; - } - } else if (!existing.includes(refValue)) { - existing.push(refValue); - } - } - } else if (_isString) { - refs[ref2] = value; - if (canSetSetupRef(ref2)) { - setupState[ref2] = value; - } - } else if (_isRef) { - { - ref2.value = value; - } - if (rawRef.k) - refs[rawRef.k] = value; - } else - ; - }; - 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 || ((cb) => setTimeout(cb, 1)); - getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id)); - const isAsyncWrapper = (i) => !!i.type.__asyncLoader; - const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; - 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 - /* prepend */ - ); - onUnmounted(() => { - remove(keepAliveRoot[type], injected); - }, target); - } - 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; - } - } - const createHook = (lifecycle) => (hook, target = currentInstance) => { - if (!isInSSRComponentSetup || lifecycle === "sp") { - injectHook(lifecycle, (...args) => hook(...args), target); - } - }; - const onBeforeMount = createHook("bm"); - const onMounted = createHook("m"); - const onBeforeUpdate = createHook( - "bu" - ); - const onUpdated = createHook("u"); - const onBeforeUnmount = createHook( - "bum" - ); - const onUnmounted = createHook("um"); - const onServerPrefetch = createHook( - "sp" - ); - const onRenderTriggered = createHook("rtg"); - const onRenderTracked = createHook("rtc"); - function onErrorCaptured(hook, target = currentInstance) { - injectHook("ec", hook, target); - } - const COMPONENTS = "components"; - function resolveComponent(name, maybeSelfReference) { - return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; - } - const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); - 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(name) || selfName === capitalize(camelize(name)))) { - return Component; - } - } - const res = ( - // local registration - // check instance[type] first which is resolved for options API - resolve(instance[type] || Component[type], name) || // global registration - resolve(instance.appContext[type], name) - ); - if (!res && maybeSelfReference) { - return Component; - } - return res; - } - } - function resolve(registry, name) { - return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]); - } - function renderList(source, renderItem, cache, index) { - let ret; - const cached = cache && cache[index]; - const sourceIsArray = isArray$2(source); - if (sourceIsArray || isString$1(source)) { - const sourceIsReactiveArray = sourceIsArray && isReactive(source); - let needsWrap = false; - let isReadonlySource = false; - if (sourceIsReactiveArray) { - needsWrap = !isShallow(source); - isReadonlySource = 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; - } - const getPublicInstance = (i) => { - if (!i) - return null; - if (isStatefulComponent(i)) - return getComponentPublicInstance(i); - return getPublicInstance(i.parent); - }; - const publicPropertiesMap = ( - // Move PURE marker to new line to workaround compiler discarding it - // due to type annotation - /* @__PURE__ */ extend$1(/* @__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) - }) - ); - const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key); - const PublicInstanceProxyHandlers = { - get({ _: instance }, key) { - if (key === "__v_skip") { - return true; - } - const { ctx, setupState, data, props, accessCache, type, appContext } = instance; - let normalizedProps; - 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 ( - // only cache other properties when instance has declared (thus stable) - // props - (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, 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 ( - // css module (injected by vue-loader) - (cssModule = type.__cssModules) && (cssModule = cssModule[key]) - ) { - return cssModule; - } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { - accessCache[key] = 4; - return ctx[key]; - } else if ( - // global properties - globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key) - ) { - { - return globalProperties[key]; - } - } else - ; - }, - 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, propsOptions, type } - }, key) { - let normalizedProps, cssModules; - return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, 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 normalizePropsOrEmits(props) { - return isArray$2(props) ? props.reduce( - (normalized, p2) => (normalized[p2] = null, normalized), - {} - ) : props; - } - let 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 { - // state - data: dataOptions, - computed: computedOptions, - methods, - watch: watchOptions, - provide: provideOptions, - inject: injectOptions, - // lifecycle - created, - beforeMount, - mounted, - beforeUpdate, - updated, - activated, - deactivated, - beforeDestroy, - beforeUnmount, - destroyed, - unmounted, - render, - renderTracked, - renderTriggered, - errorCaptured, - serverPrefetch, - // public API - expose, - inheritAttrs, - // assets - 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$2(methodHandler)) { - { - ctx[key] = methodHandler.bind(publicThis); - } - } - } - } - if (dataOptions) { - const data = dataOptions.call(publicThis, publicThis); - if (!isObject$1(data)) - ; - else { - instance.data = reactive(data); - } - } - shouldCacheAccess = true; - if (computedOptions) { - for (const key in computedOptions) { - const opt = computedOptions[key]; - const get = isFunction$2(opt) ? opt.bind(publicThis, publicThis) : isFunction$2(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP; - const set = !isFunction$2(opt) && isFunction$2(opt.set) ? opt.set.bind(publicThis) : NOOP; - const c = computed({ - get, - set - }); - 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$2(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$2(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$2(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$2(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 (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$2(hook) ? hook.map((h2) => h2.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$1(raw)) { - const handler = ctx[raw]; - if (isFunction$2(handler)) { - { - watch(getter, handler); - } - } - } else if (isFunction$2(raw)) { - { - watch(getter, raw.bind(publicThis)); - } - } else if (isObject$1(raw)) { - if (isArray$2(raw)) { - raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); - } else { - const handler = isFunction$2(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; - if (isFunction$2(handler)) { - watch(getter, handler, raw); - } - } - } else - ; - } - 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; - } - const internalOptionMergeStrats = { - data: mergeDataFn, - props: mergeEmitsOrPropsOptions, - emits: mergeEmitsOrPropsOptions, - // objects - methods: mergeObjectOptions, - computed: mergeObjectOptions, - // lifecycle - 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, - // assets - components: mergeObjectOptions, - directives: mergeObjectOptions, - // watch - watch: mergeWatchOptions, - // provide / inject - provide: mergeDataFn, - inject: mergeInject - }; - function mergeDataFn(to, from) { - if (!from) { - return to; - } - if (!to) { - return from; - } - return function mergedDataFn() { - return extend$1( - isFunction$2(to) ? to.call(this, this) : to, - isFunction$2(from) ? from.call(this, this) : from - ); - }; - } - function mergeInject(to, from) { - return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); - } - function normalizeInject(raw) { - if (isArray$2(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$1(/* @__PURE__ */ Object.create(null), to, from) : from; - } - function mergeEmitsOrPropsOptions(to, from) { - if (to) { - if (isArray$2(to) && isArray$2(from)) { - return [.../* @__PURE__ */ new Set([...to, ...from])]; - } - return extend$1( - /* @__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$1(/* @__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() - }; - } - let uid$1 = 0; - function createAppAPI(render, hydrate) { - return function createApp2(rootComponent, rootProps = null) { - if (!isFunction$2(rootComponent)) { - rootComponent = extend$1({}, 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$2(plugin.install)) { - installedPlugins.add(plugin); - plugin.install(app, ...options); - } else if (isFunction$2(plugin)) { - installedPlugins.add(plugin); - plugin(app, ...options); - } else - ; - 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; - }; - } - let currentApp = null; - function provide(key, value) { - if (!currentInstance) - ; - else { - 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$2(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; - } else - ; - } - } - const internalObjectProto = {}; - const createInternalObject = () => Object.create(internalObjectProto); - const 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 : 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 = toRaw(props); - const [options] = instance.propsOptions; - let hasAttrsChanged = false; - if ( - // always force full diff in dev - // - #1942 if hmr is enabled with sfc component - // - vite#872 non-sfc component used by sfc component - (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(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 || // for camelCase - !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case - // and converted to camelCase (#955) - ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) { - if (options) { - if (rawPrevProps && // for camelCase - (rawPrevProps[key] !== void 0 || // for kebab-case - 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(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 = 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$2(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 - /* shouldCast */ - ]) { - if (isAbsent && !hasDefault) { - value = false; - } else if (opt[ - 1 - /* shouldCastTrue */ - ] && (value === "" || value === hyphenate(key))) { - value = true; - } - } - } - return value; - } - const 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$2(comp)) { - const extendProps = (raw2) => { - hasExtends = true; - const [props, keys] = normalizePropsOptions(raw2, appContext, true); - extend$1(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$2(raw)) { - for (let i = 0; i < raw.length; i++) { - const normalizedKey = camelize(raw[i]); - if (validatePropName(normalizedKey)) { - normalized[normalizedKey] = EMPTY_OBJ; - } - } - } else if (raw) { - for (const key in raw) { - const normalizedKey = camelize(key); - if (validatePropName(normalizedKey)) { - const opt = raw[key]; - const prop = normalized[normalizedKey] = isArray$2(opt) || isFunction$2(opt) ? { type: opt } : extend$1({}, opt); - const propType = prop.type; - let shouldCast = false; - let shouldCastTrue = true; - if (isArray$2(propType)) { - for (let index = 0; index < propType.length; ++index) { - const type = propType[index]; - const typeName = isFunction$2(type) && type.name; - if (typeName === "Boolean") { - shouldCast = true; - break; - } else if (typeName === "String") { - shouldCastTrue = false; - } - } - } else { - shouldCast = isFunction$2(propType) && propType.name === "Boolean"; - } - prop[ - 0 - /* shouldCast */ - ] = shouldCast; - prop[ - 1 - /* shouldCastTrue */ - ] = 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; - } - const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable"; - const normalizeSlotValue = (value) => isArray$2(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; - const normalizeSlot$1 = (key, rawSlot, ctx) => { - if (rawSlot._n) { - return rawSlot; - } - const normalized = withCtx((...args) => { - if (false) - ; - return normalizeSlotValue(rawSlot(...args)); - }, ctx); - normalized._c = false; - return normalized; - }; - const normalizeObjectSlots = (rawSlots, slots, instance) => { - const ctx = rawSlots._ctx; - for (const key in rawSlots) { - if (isInternalKey(key)) - continue; - const value = rawSlots[key]; - if (isFunction$2(value)) { - slots[key] = normalizeSlot$1(key, value, ctx); - } else if (value != null) { - const normalized = normalizeSlotValue(value); - slots[key] = () => normalized; - } - } - }; - const normalizeVNodeSlots = (instance, children) => { - const normalized = normalizeSlotValue(children); - instance.slots.default = () => normalized; - }; - const assignSlots = (slots, children, optimized) => { - for (const key in children) { - if (optimized || !isInternalKey(key)) { - slots[key] = children[key]; - } - } - }; - const 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); - } - }; - const 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]; - } - } - } - }; - const 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: ref2, 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 - ); - } else - ; - } - if (ref2 != null && parentComponent) { - setRef(ref2, n1 && n1.ref, parentSuspense, n2 || n1, !n2); - } else if (ref2 == 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 { - patchElement( - n1, - n2, - parentComponent, - parentSuspense, - namespace, - slotScopeIds, - optimized - ); - } - }; - 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(() => { - vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); - needCallTransitionHooks && transition.enter(el); - dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); - }, 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++) { - const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]); - patch( - null, - child, - 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]; - const container = ( - // oldVNode may be an errored async setup() component inside Suspense - // which will not have a mounted element - oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent - // of the Fragment itself so it can move its children. - (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement - // which also requires the correct parent container - !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. - oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : ( - // In other cases, the parent container is not actually used so we - // just pass the block element here to avoid a DOM parentNode call. - fallbackContainer - ) - ); - patch( - oldVNode, - newVNode, - container, - 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( - // #10007 - // such fragment like `<>` will be compiled into - // a fragment which doesn't have a children. - // In this case fallback to an empty array - n2.children || [], - container, - fragmentEndAnchor, - parentComponent, - parentSuspense, - namespace, - slotScopeIds, - optimized - ); - } else { - if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result - // of renderSlot() with no valid children - n1.dynamicChildren) { - patchBlockChildren( - n1.dynamicChildren, - dynamicChildren, - container, - parentComponent, - parentSuspense, - namespace, - slotScopeIds - ); - if ( - // #2080 if the stable fragment has a key, it's a