function makeMap(str, expectsLowerCase) { var map = /* @__PURE__ */Object.create(null); var list = str.split(","); for (var i = 0; i < list.length; i++) { map[list[i]] = true; } return expectsLowerCase ? val => !!map[val.toLowerCase()] : val => !!map[val]; } var EMPTY_OBJ = {}; var EMPTY_ARR = []; var NOOP = () => {}; var NO = () => false; var isOn = key => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && ( // uppercase letter key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); var isModelListener = key => key.startsWith("onUpdate:"); var extend$1 = Object.assign; var remove = (arr, el) => { var i = arr.indexOf(el); if (i > -1) { arr.splice(i, 1); } }; var hasOwnProperty$1 = Object.prototype.hasOwnProperty; var hasOwn = (val, key) => hasOwnProperty$1.call(val, key); var isArray = Array.isArray; var isMap = val => toTypeString(val) === "[object Map]"; var isSet = val => toTypeString(val) === "[object Set]"; var isRegExp = val => toTypeString(val) === "[object RegExp]"; var isFunction = val => typeof val === "function"; var isString = val => typeof val === "string"; var isSymbol = val => typeof val === "symbol"; var isObject = val => val !== null && typeof val === "object"; var isPromise = val => { return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); }; var objectToString = Object.prototype.toString; var toTypeString = value => objectToString.call(value); var toRawType = value => { return toTypeString(value).slice(8, -1); }; var isPlainObject = val => toTypeString(val) === "[object Object]"; var isIntegerKey = key => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; var 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"); var cacheStringFunction = fn => { var cache = /* @__PURE__ */Object.create(null); return str => { var hit = cache[str]; return hit || (cache[str] = fn(str)); }; }; var camelizeRE = /-(\w)/g; var camelize = cacheStringFunction(str => { return str.replace(camelizeRE, (_, c) => c ? c.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 => { var s = str ? "on".concat(capitalize(str)) : ""; return s; }); var hasChanged = (value, oldValue) => !Object.is(value, oldValue); var invokeArrayFns = (fns, arg) => { for (var i = 0; i < fns.length; i++) { fns[i](arg); } }; var def = (obj, key, value) => { Object.defineProperty(obj, key, { configurable: true, enumerable: false, value }); }; var looseToNumber = val => { var n = parseFloat(val); return isNaN(n) ? val : n; }; var toNumber = val => { var n = isString(val) ? Number(val) : NaN; return isNaN(n) ? val : n; }; var _globalThis; var getGlobalThis = () => { return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); }; var GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console"; var isGloballyAllowed = /* @__PURE__ */makeMap(GLOBALS_ALLOWED); var isGloballyWhitelisted = isGloballyAllowed; function normalizeStyle(value) { if (isArray(value)) { var res = {}; for (var i = 0; i < value.length; i++) { var item = value[i]; var normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); if (normalized) { for (var key in normalized) { res[key] = normalized[key]; } } } return res; } else if (isString(value) || isObject(value)) { return value; } } var listDelimiterRE = /;(?![^(]*\))/g; var propertyDelimiterRE = /:([^]+)/; var styleCommentRE = /\/\*[^]*?\*\//g; function parseStringStyle(cssText) { var ret = {}; cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach(item => { if (item) { var tmp = item.split(propertyDelimiterRE); tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); } }); return ret; } function normalizeClass(value) { var res = ""; if (isString(value)) { res = value; } else if (isArray(value)) { for (var i = 0; i < value.length; i++) { var normalized = normalizeClass(value[i]); if (normalized) { res += normalized + " "; } } } else if (isObject(value)) { for (var name in value) { if (value[name]) { res += name + " "; } } } return res.trim(); } function normalizeProps(props) { if (!props) return null; var { class: klass, style } = props; if (klass && !isString(klass)) { props.class = normalizeClass(klass); } if (style) { props.style = normalizeStyle(style); } return props; } var toDisplayString = val => { return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val); }; var replacer = (_key, val) => { if (val && val.__v_isRef) { return replacer(_key, val.value); } else if (isMap(val)) { return { ["Map(".concat(val.size, ")")]: [...val.entries()].reduce((entries, _ref, i) => { var [key, val2] = _ref; entries[stringifySymbol(key, i) + " =>"] = val2; return entries; }, {}) }; } else if (isSet(val)) { return { ["Set(".concat(val.size, ")")]: [...val.values()].map(v => stringifySymbol(v)) }; } else if (isSymbol(val)) { return stringifySymbol(val); } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { return String(val); } return val; }; var stringifySymbol = function (v) { var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; var _a; return isSymbol(v) ? "Symbol(".concat((_a = v.description) != null ? _a : i, ")") : v; }; var activeEffectScope; class EffectScope { constructor() { var detached = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; this.detached = detached; /** * @internal */ this._active = true; /** * @internal */ this.effects = []; /** * @internal */ this.cleanups = []; this.parent = activeEffectScope; if (!detached && activeEffectScope) { this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1; } } get active() { return this._active; } run(fn) { if (this._active) { var currentEffectScope = activeEffectScope; try { activeEffectScope = this; return fn(); } finally { activeEffectScope = currentEffectScope; } } } /** * This should only be called on non-detached scopes * @internal */ on() { activeEffectScope = this; } /** * This should only be called on non-detached scopes * @internal */ off() { activeEffectScope = this.parent; } stop(fromParent) { if (this._active) { var i, l; for (i = 0, l = this.effects.length; i < l; i++) { this.effects[i].stop(); } for (i = 0, l = this.cleanups.length; i < l; i++) { this.cleanups[i](); } if (this.scopes) { for (i = 0, l = this.scopes.length; i < l; i++) { this.scopes[i].stop(true); } } if (!this.detached && this.parent && !fromParent) { var last = this.parent.scopes.pop(); if (last && last !== this) { this.parent.scopes[this.index] = last; last.index = this.index; } } this.parent = void 0; this._active = false; } } } function effectScope(detached) { return new EffectScope(detached); } function recordEffectScope(effect) { var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : activeEffectScope; if (scope && scope.active) { scope.effects.push(effect); } } function getCurrentScope() { return activeEffectScope; } function onScopeDispose(fn) { if (activeEffectScope) { activeEffectScope.cleanups.push(fn); } } var createDep = effects => { var dep = new Set(effects); dep.w = 0; dep.n = 0; return dep; }; var wasTracked = dep => (dep.w & trackOpBit) > 0; var newTracked = dep => (dep.n & trackOpBit) > 0; var initDepMarkers = _ref2 => { var { deps } = _ref2; if (deps.length) { for (var i = 0; i < deps.length; i++) { deps[i].w |= trackOpBit; } } }; var finalizeDepMarkers = effect => { var { deps } = effect; if (deps.length) { var ptr = 0; for (var i = 0; i < deps.length; i++) { var dep = deps[i]; if (wasTracked(dep) && !newTracked(dep)) { dep.delete(effect); } else { deps[ptr++] = dep; } dep.w &= ~trackOpBit; dep.n &= ~trackOpBit; } deps.length = ptr; } }; var targetMap = /* @__PURE__ */new WeakMap(); var effectTrackDepth = 0; var trackOpBit = 1; var maxMarkerBits = 30; var activeEffect; var ITERATE_KEY = Symbol(""); var MAP_KEY_ITERATE_KEY = Symbol(""); class ReactiveEffect { constructor(fn) { var scheduler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var scope = arguments.length > 2 ? arguments[2] : undefined; this.fn = fn; this.scheduler = scheduler; this.active = true; this.deps = []; this.parent = void 0; recordEffectScope(this, scope); } run() { if (!this.active) { return this.fn(); } var parent = activeEffect; var lastShouldTrack = shouldTrack; while (parent) { if (parent === this) { return; } parent = parent.parent; } try { this.parent = activeEffect; activeEffect = this; shouldTrack = true; trackOpBit = 1 << ++effectTrackDepth; if (effectTrackDepth <= maxMarkerBits) { initDepMarkers(this); } else { cleanupEffect(this); } return this.fn(); } finally { if (effectTrackDepth <= maxMarkerBits) { finalizeDepMarkers(this); } trackOpBit = 1 << --effectTrackDepth; activeEffect = this.parent; shouldTrack = lastShouldTrack; this.parent = void 0; if (this.deferStop) { this.stop(); } } } stop() { if (activeEffect === this) { this.deferStop = true; } else if (this.active) { cleanupEffect(this); if (this.onStop) { this.onStop(); } this.active = false; } } } function cleanupEffect(effect2) { var { deps } = effect2; if (deps.length) { for (var i = 0; i < deps.length; i++) { deps[i].delete(effect2); } deps.length = 0; } } function effect(fn, options) { if (fn.effect instanceof ReactiveEffect) { fn = fn.effect.fn; } var _effect = new ReactiveEffect(fn); if (options) { extend$1(_effect, options); if (options.scope) recordEffectScope(_effect, options.scope); } if (!options || !options.lazy) { _effect.run(); } var runner = _effect.run.bind(_effect); runner.effect = _effect; return runner; } function stop(runner) { runner.effect.stop(); } var shouldTrack = true; var trackStack = []; function pauseTracking() { trackStack.push(shouldTrack); shouldTrack = false; } function resetTracking() { var last = trackStack.pop(); shouldTrack = last === void 0 ? true : last; } function track(target, type, key) { if (shouldTrack && activeEffect) { var depsMap = targetMap.get(target); if (!depsMap) { targetMap.set(target, depsMap = /* @__PURE__ */new Map()); } var dep = depsMap.get(key); if (!dep) { depsMap.set(key, dep = createDep()); } trackEffects(dep); } } function trackEffects(dep, debuggerEventExtraInfo) { var shouldTrack2 = false; if (effectTrackDepth <= maxMarkerBits) { if (!newTracked(dep)) { dep.n |= trackOpBit; shouldTrack2 = !wasTracked(dep); } } else { shouldTrack2 = !dep.has(activeEffect); } if (shouldTrack2) { dep.add(activeEffect); activeEffect.deps.push(dep); } } function trigger(target, type, key, newValue, oldValue, oldTarget) { var depsMap = targetMap.get(target); if (!depsMap) { return; } var deps = []; if (type === "clear") { deps = [...depsMap.values()]; } else if (key === "length" && isArray(target)) { var newLength = Number(newValue); depsMap.forEach((dep, key2) => { if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) { deps.push(dep); } }); } else { if (key !== void 0) { deps.push(depsMap.get(key)); } switch (type) { case "add": if (!isArray(target)) { deps.push(depsMap.get(ITERATE_KEY)); if (isMap(target)) { deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); } } else if (isIntegerKey(key)) { deps.push(depsMap.get("length")); } break; case "delete": if (!isArray(target)) { deps.push(depsMap.get(ITERATE_KEY)); if (isMap(target)) { deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); } } break; case "set": if (isMap(target)) { deps.push(depsMap.get(ITERATE_KEY)); } break; } } if (deps.length === 1) { if (deps[0]) { { triggerEffects(deps[0]); } } } else { var effects = []; for (var dep of deps) { if (dep) { effects.push(...dep); } } { triggerEffects(createDep(effects)); } } } function triggerEffects(dep, debuggerEventExtraInfo) { var effects = isArray(dep) ? dep : [...dep]; for (var effect2 of effects) { if (effect2.computed) { triggerEffect(effect2); } } for (var _effect2 of effects) { if (!_effect2.computed) { triggerEffect(_effect2); } } } function triggerEffect(effect2, debuggerEventExtraInfo) { if (effect2 !== activeEffect || effect2.allowRecurse) { if (effect2.scheduler) { effect2.scheduler(); } else { effect2.run(); } } } function getDepFromReactive(object, key) { var _a; return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key); } 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)); var arrayInstrumentations = /* @__PURE__ */createArrayInstrumentations(); function createArrayInstrumentations() { var instrumentations = {}; ["includes", "indexOf", "lastIndexOf"].forEach(key => { instrumentations[key] = function () { var arr = toRaw(this); for (var i = 0, l = this.length; i < l; i++) { track(arr, "get", i + ""); } for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) { args[_key2] = arguments[_key2]; } var res = arr[key](...args); if (res === -1 || res === false) { return arr[key](...args.map(toRaw)); } else { return res; } }; }); ["push", "pop", "shift", "unshift", "splice"].forEach(key => { instrumentations[key] = function () { pauseTracking(); for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) { args[_key3] = arguments[_key3]; } var res = toRaw(this)[key].apply(this, args); resetTracking(); return res; }; }); return instrumentations; } function hasOwnProperty(key) { var obj = toRaw(this); track(obj, "has", key); return obj.hasOwnProperty(key); } class BaseReactiveHandler { constructor() { var _isReadonly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var _shallow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; this._isReadonly = _isReadonly; this._shallow = _shallow; } get(target, key, receiver) { var isReadonly2 = this._isReadonly, shallow = this._shallow; if (key === "__v_isReactive") { return !isReadonly2; } else if (key === "__v_isReadonly") { return isReadonly2; } else if (key === "__v_isShallow") { return shallow; } else if (key === "__v_raw") { if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype // this means the reciever is a user proxy of the reactive proxy Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { return target; } return; } var targetIsArray = isArray(target); if (!isReadonly2) { if (targetIsArray && hasOwn(arrayInstrumentations, key)) { return Reflect.get(arrayInstrumentations, key, receiver); } if (key === "hasOwnProperty") { return hasOwnProperty; } } var res = Reflect.get(target, key, receiver); if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { return res; } if (!isReadonly2) { track(target, "get", key); } if (shallow) { return res; } if (isRef(res)) { return targetIsArray && isIntegerKey(key) ? res : res.value; } if (isObject(res)) { return isReadonly2 ? readonly(res) : reactive(res); } return res; } } class MutableReactiveHandler extends BaseReactiveHandler { constructor() { var shallow = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; super(false, shallow); } set(target, key, value, receiver) { var oldValue = target[key]; if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) { return false; } if (!this._shallow) { if (!isShallow(value) && !isReadonly(value)) { oldValue = toRaw(oldValue); value = toRaw(value); } if (!isArray(target) && isRef(oldValue) && !isRef(value)) { oldValue.value = value; return true; } } var hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key); var result = Reflect.set(target, key, value, 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) { var hadKey = hasOwn(target, key); target[key]; var result = Reflect.deleteProperty(target, key); if (result && hadKey) { trigger(target, "delete", key, void 0); } return result; } has(target, key) { var result = Reflect.has(target, key); if (!isSymbol(key) || !builtInSymbols.has(key)) { track(target, "has", key); } return result; } ownKeys(target) { track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY); return Reflect.ownKeys(target); } } class ReadonlyReactiveHandler extends BaseReactiveHandler { constructor() { var shallow = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; super(true, shallow); } set(target, key) { return true; } deleteProperty(target, key) { return true; } } var mutableHandlers = /* @__PURE__ */new MutableReactiveHandler(); var readonlyHandlers = /* @__PURE__ */new ReadonlyReactiveHandler(); var shallowReactiveHandlers = /* @__PURE__ */new MutableReactiveHandler(true); var shallowReadonlyHandlers = /* @__PURE__ */new ReadonlyReactiveHandler(true); var toShallow = value => value; var getProto = v => Reflect.getPrototypeOf(v); function get(target, key) { var isReadonly = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var isShallow = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; target = target["__v_raw"]; var rawTarget = toRaw(target); var rawKey = toRaw(key); if (!isReadonly) { if (hasChanged(key, rawKey)) { track(rawTarget, "get", key); } track(rawTarget, "get", rawKey); } var { has: has2 } = getProto(rawTarget); var wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; if (has2.call(rawTarget, key)) { return wrap(target.get(key)); } else if (has2.call(rawTarget, rawKey)) { return wrap(target.get(rawKey)); } else if (target !== rawTarget) { target.get(key); } } function has(key) { var isReadonly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var target = this["__v_raw"]; var rawTarget = toRaw(target); var rawKey = toRaw(key); if (!isReadonly) { if (hasChanged(key, rawKey)) { track(rawTarget, "has", key); } track(rawTarget, "has", rawKey); } return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); } function size(target) { var isReadonly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; target = target["__v_raw"]; !isReadonly && track(toRaw(target), "iterate", ITERATE_KEY); return Reflect.get(target, "size", target); } function add(value) { value = toRaw(value); var target = toRaw(this); var proto = getProto(target); var hadKey = proto.has.call(target, value); if (!hadKey) { target.add(value); trigger(target, "add", value, value); } return this; } function set(key, value) { value = toRaw(value); var target = toRaw(this); var { has: has2, get: get2 } = getProto(target); var hadKey = has2.call(target, key); if (!hadKey) { key = toRaw(key); hadKey = has2.call(target, key); } var oldValue = get2.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; } function deleteEntry(key) { var target = toRaw(this); var { has: has2, get: get2 } = getProto(target); var hadKey = has2.call(target, key); if (!hadKey) { key = toRaw(key); hadKey = has2.call(target, key); } get2 ? get2.call(target, key) : void 0; var result = target.delete(key); if (hadKey) { trigger(target, "delete", key, void 0); } return result; } function clear() { var target = toRaw(this); var hadItems = target.size !== 0; var result = target.clear(); if (hadItems) { trigger(target, "clear", void 0, void 0); } return result; } function createForEach(isReadonly, isShallow) { return function forEach(callback, thisArg) { var observed = this; var target = observed["__v_raw"]; var rawTarget = toRaw(target); var wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; !isReadonly && track(rawTarget, "iterate", ITERATE_KEY); return target.forEach((value, key) => { return callback.call(thisArg, wrap(value), wrap(key), observed); }); }; } function createIterableMethod(method, isReadonly, isShallow) { return function () { var target = this["__v_raw"]; var rawTarget = toRaw(target); var targetIsMap = isMap(rawTarget); var isPair = method === "entries" || method === Symbol.iterator && targetIsMap; var isKeyOnly = method === "keys" && targetIsMap; var innerIterator = target[method](...arguments); var wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; !isReadonly && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY); return { // iterator protocol next() { var { 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 () { return type === "delete" ? false : type === "clear" ? void 0 : this; }; } function createInstrumentations() { var mutableInstrumentations2 = { get(key) { return get(this, key); }, get size() { return size(this); }, has, add, set, delete: deleteEntry, clear, forEach: createForEach(false, false) }; var shallowInstrumentations2 = { get(key) { return get(this, key, false, true); }, get size() { return size(this); }, has, add, set, delete: deleteEntry, clear, forEach: createForEach(false, true) }; var readonlyInstrumentations2 = { get(key) { return get(this, key, true); }, get size() { return size(this, true); }, has(key) { return has.call(this, key, true); }, add: createReadonlyMethod("add"), set: createReadonlyMethod("set"), delete: createReadonlyMethod("delete"), clear: createReadonlyMethod("clear"), forEach: createForEach(true, false) }; var shallowReadonlyInstrumentations2 = { get(key) { return get(this, key, true, true); }, get size() { return size(this, true); }, has(key) { return has.call(this, key, true); }, add: createReadonlyMethod("add"), set: createReadonlyMethod("set"), delete: createReadonlyMethod("delete"), clear: createReadonlyMethod("clear"), forEach: createForEach(true, true) }; var iteratorMethods = ["keys", "values", "entries", Symbol.iterator]; iteratorMethods.forEach(method => { mutableInstrumentations2[method] = createIterableMethod(method, false, false); readonlyInstrumentations2[method] = createIterableMethod(method, true, false); shallowInstrumentations2[method] = createIterableMethod(method, false, true); shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true); }); return [mutableInstrumentations2, readonlyInstrumentations2, shallowInstrumentations2, shallowReadonlyInstrumentations2]; } var [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */createInstrumentations(); function createInstrumentationGetter(isReadonly, shallow) { var instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations; return (target, key, receiver) => { if (key === "__v_isReactive") { return !isReadonly; } else if (key === "__v_isReadonly") { return isReadonly; } else if (key === "__v_raw") { return target; } return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver); }; } var mutableCollectionHandlers = { get: /* @__PURE__ */createInstrumentationGetter(false, false) }; var shallowCollectionHandlers = { get: /* @__PURE__ */createInstrumentationGetter(false, true) }; var readonlyCollectionHandlers = { get: /* @__PURE__ */createInstrumentationGetter(true, false) }; var shallowReadonlyCollectionHandlers = { get: /* @__PURE__ */createInstrumentationGetter(true, true) }; var reactiveMap = /* @__PURE__ */new WeakMap(); var shallowReactiveMap = /* @__PURE__ */new WeakMap(); var readonlyMap = /* @__PURE__ */new WeakMap(); var shallowReadonlyMap = /* @__PURE__ */new WeakMap(); function targetTypeMap(rawType) { switch (rawType) { case "Object": case "Array": return 1 /* COMMON */; case "Map": case "Set": case "WeakMap": case "WeakSet": return 2 /* COLLECTION */; default: return 0 /* INVALID */; } } function getTargetType(value) { return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : 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(target)) { return target; } if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { return target; } var existingProxy = proxyMap.get(target); if (existingProxy) { return existingProxy; } var targetType = getTargetType(target); if (targetType === 0 /* INVALID */) { return target; } var proxy = new Proxy(target, targetType === 2 /* COLLECTION */ ? 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 isReactive(value) || isReadonly(value); } function toRaw(observed) { var raw = observed && observed["__v_raw"]; return raw ? toRaw(raw) : observed; } function markRaw(value) { def(value, "__v_skip", true); return value; } var toReactive = value => isObject(value) ? reactive(value) : value; var toReadonly = value => isObject(value) ? readonly(value) : value; function trackRefValue(ref2) { if (shouldTrack && activeEffect) { ref2 = toRaw(ref2); { trackEffects(ref2.dep || (ref2.dep = createDep())); } } } function triggerRefValue(ref2, newVal) { ref2 = toRaw(ref2); var dep = ref2.dep; if (dep) { { triggerEffects(dep); } } } function isRef(r) { return !!(r && r.__v_isRef === true); } 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, __v_isShallow) { this.__v_isShallow = __v_isShallow; this.dep = void 0; this.__v_isRef = true; this._rawValue = __v_isShallow ? value : toRaw(value); this._value = __v_isShallow ? value : toReactive(value); } get value() { trackRefValue(this); return this._value; } set value(newVal) { var useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal); newVal = useDirectValue ? newVal : toRaw(newVal); if (hasChanged(newVal, this._rawValue)) { this._rawValue = newVal; this._value = useDirectValue ? newVal : toReactive(newVal); triggerRefValue(this); } } } function triggerRef(ref2) { triggerRefValue(ref2); } function unref(ref2) { return isRef(ref2) ? ref2.value : ref2; } var shallowUnwrapHandlers = { get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)), set: (target, key, value, receiver) => { var 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 CustomRefImpl { constructor(factory) { this.dep = void 0; this.__v_isRef = true; var { get, set } = factory(() => trackRefValue(this), () => triggerRefValue(this)); this._get = get; this._set = set; } get value() { return this._get(); } set value(newVal) { this._set(newVal); } } function customRef(factory) { return new CustomRefImpl(factory); } function toRefs(object) { var ret = isArray(object) ? new Array(object.length) : {}; for (var key in object) { ret[key] = propertyToRef(object, key); } return ret; } class ObjectRefImpl { constructor(_object, _key, _defaultValue) { this._object = _object; this._key = _key; this._defaultValue = _defaultValue; this.__v_isRef = true; } get value() { var val = this._object[this._key]; return val === void 0 ? this._defaultValue : val; } set value(newVal) { this._object[this._key] = newVal; } get dep() { return getDepFromReactive(toRaw(this._object), this._key); } } class GetterRefImpl { constructor(_getter) { this._getter = _getter; this.__v_isRef = true; this.__v_isReadonly = true; } get value() { return this._getter(); } } function toRef(source, key, defaultValue) { if (isRef(source)) { return source; } else if (isFunction(source)) { return new GetterRefImpl(source); } else if (isObject(source) && arguments.length > 1) { return propertyToRef(source, key, defaultValue); } else { return ref(source); } } function propertyToRef(source, key, defaultValue) { var val = source[key]; return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue); } class ComputedRefImpl { constructor(getter, _setter, isReadonly, isSSR) { this._setter = _setter; this.dep = void 0; this.__v_isRef = true; this["__v_isReadonly"] = false; this._dirty = true; this.effect = new ReactiveEffect(getter, () => { if (!this._dirty) { this._dirty = true; triggerRefValue(this); } }); this.effect.computed = this; this.effect.active = this._cacheable = !isSSR; this["__v_isReadonly"] = isReadonly; } get value() { var self = toRaw(this); trackRefValue(self); if (self._dirty || !self._cacheable) { self._dirty = false; self._value = self.effect.run(); } return self._value; } set value(newValue) { this._setter(newValue); } } function computed$1(getterOrOptions, debugOptions) { var isSSR = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var getter; var setter; var onlyGetter = isFunction(getterOrOptions); if (onlyGetter) { getter = getterOrOptions; setter = NOOP; } else { getter = getterOrOptions.get; setter = getterOrOptions.set; } var cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR); return cRef; } // lifecycle // App and Page var ON_SHOW = 'onShow'; var ON_HIDE = 'onHide'; //Page var ON_LOAD = 'onLoad'; var ON_UNLOAD = 'onUnload'; // 百度特有 var ON_INIT = 'onInit'; // 微信特有 var ON_SAVE_EXIT_STATE = 'onSaveExitState'; var ON_BACK_PRESS = 'onBackPress'; var ON_PAGE_SCROLL = 'onPageScroll'; var ON_TAB_ITEM_TAP = 'onTabItemTap'; var ON_REACH_BOTTOM = 'onReachBottom'; var ON_PULL_DOWN_REFRESH = 'onPullDownRefresh'; var ON_SHARE_TIMELINE = 'onShareTimeline'; var ON_ADD_TO_FAVORITES = 'onAddToFavorites'; var ON_SHARE_APP_MESSAGE = 'onShareAppMessage'; // navigationBar var ON_NAVIGATION_BAR_BUTTON_TAP = 'onNavigationBarButtonTap'; var ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = 'onNavigationBarSearchInputClicked'; var ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = 'onNavigationBarSearchInputChanged'; var ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = 'onNavigationBarSearchInputConfirmed'; var ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = 'onNavigationBarSearchInputFocusChanged'; var PAGE_HOOKS = [ON_INIT, ON_LOAD, ON_SHOW, ON_HIDE, ON_UNLOAD, ON_BACK_PRESS, ON_PAGE_SCROLL, ON_TAB_ITEM_TAP, ON_REACH_BOTTOM, ON_PULL_DOWN_REFRESH, ON_SHARE_TIMELINE, ON_SHARE_APP_MESSAGE, ON_ADD_TO_FAVORITES, ON_SAVE_EXIT_STATE, ON_NAVIGATION_BAR_BUTTON_TAP, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED]; var PAGE_SYNC_HOOKS = [ON_LOAD, ON_SHOW]; function isRootImmediateHook(name) { return PAGE_SYNC_HOOKS.indexOf(name) > -1; } function isRootHook(name) { return PAGE_HOOKS.indexOf(name) > -1; } function warn(msg) { return; } /** * @internal */ function assertNumber(val, type) { return; } function callWithErrorHandling(fn, instance, type, args) { var res; try { res = args ? fn(...args) : fn(); } catch (err) { handleError(err, instance, type); } return res; } function callWithAsyncErrorHandling(fn, instance, type, args) { if (isFunction(fn)) { var res = callWithErrorHandling(fn, instance, type, args); if (res && isPromise(res)) { res.catch(err => { handleError(err, instance, type); }); } return res; } var values = []; for (var i = 0; i < fn.length; i++) { values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); } return values; } function handleError(err, instance, type) { var throwInDev = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; var contextVNode = instance ? instance.vnode : null; if (instance) { var cur = instance.parent; // the exposed instance is the render proxy to keep it consistent with 2.x var exposedInstance = instance.proxy; // in production the hook receives only the error code // fixed by xxxxxx var errorInfo = type; while (cur) { var errorCapturedHooks = cur.ec; if (errorCapturedHooks) { for (var i = 0; i < errorCapturedHooks.length; i++) { if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { return; } } } cur = cur.parent; } // app-level handling var appErrorHandler = instance.appContext.config.errorHandler; if (appErrorHandler) { callWithErrorHandling(appErrorHandler, null, 10 /* ErrorCodes.APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]); return; } } logError(err, type, contextVNode, throwInDev); } function logError(err, type, contextVNode) { var throwInDev = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; { // recover in prod to reduce the impact on end-user console.error(err); } } var isFlushing = false; var isFlushPending = false; var queue = []; var flushIndex = 0; var pendingPostFlushCbs = []; var activePostFlushCbs = null; var postFlushIndex = 0; var resolvedPromise = /*#__PURE__*/Promise.resolve(); var currentFlushPromise = null; function nextTick(fn) { var instance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentInstance(); var promise = currentFlushPromise || resolvedPromise; var current = currentFlushPromise === null || instance === null ? promise : promise.then(() => { return new Promise(resolve => { if (instance === null) { resolve(); } else { instance.$waitNativeRender(() => { resolve(); }); } }); }); return fn ? current.then(this ? fn.bind(this) : fn) : current; } // #2768 // Use binary-search to find a suitable position in the queue, // so that the queue maintains the increasing order of job's id, // which can prevent the job from being skipped and also can avoid repeated patching. function findInsertionIndex(id) { // the start index should be `flushIndex + 1` var start = flushIndex + 1; var end = queue.length; while (start < end) { var middle = start + end >>> 1; var middleJobId = getId(queue[middle]); middleJobId < id ? start = middle + 1 : end = middle; } return start; } function queueJob(job) { // the dedupe search uses the startIndex argument of Array.includes() // by default the search index includes the current job that is being run // so it cannot recursively trigger itself again. // if the job is a watch() callback, the search will start with a +1 index to // allow it recursively trigger itself - it is the user's responsibility to // ensure it doesn't end up in an infinite loop. if (!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) { if (job.id == null) { queue.push(job); } else { queue.splice(findInsertionIndex(job.id), 0, job); } queueFlush(); } } function queueFlush() { if (!isFlushing && !isFlushPending) { isFlushPending = true; currentFlushPromise = resolvedPromise.then(flushJobs); } } function invalidateJob(job) { var i = queue.indexOf(job); if (i > flushIndex) { queue.splice(i, 1); } } function queuePostFlushCb(cb) { if (!isArray(cb)) { if (!activePostFlushCbs || !activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) { pendingPostFlushCbs.push(cb); } } else { // if cb is an array, it is a component lifecycle hook which can only be // triggered by a job, which is already deduped in the main queue, so // we can skip duplicate check here to improve perf pendingPostFlushCbs.push(...cb); } queueFlush(); } function flushPreFlushCbs(seen) { var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isFlushing ? flushIndex + 1 : 0; for (; i < queue.length; i++) { var cb = queue[i]; if (cb && cb.pre) { queue.splice(i, 1); i--; cb(); } } } function flushPostFlushCbs(seen) { if (pendingPostFlushCbs.length) { var deduped = [...new Set(pendingPostFlushCbs)]; pendingPostFlushCbs.length = 0; // #1947 already has active queue, nested flushPostFlushCbs call if (activePostFlushCbs) { activePostFlushCbs.push(...deduped); return; } activePostFlushCbs = deduped; activePostFlushCbs.sort((a, b) => getId(a) - getId(b)); for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { activePostFlushCbs[postFlushIndex](); } activePostFlushCbs = null; postFlushIndex = 0; } } var getId = job => job.id == null ? Infinity : job.id; var comparator = (a, b) => { var diff = getId(a) - getId(b); if (diff === 0) { if (a.pre && !b.pre) return -1; if (b.pre && !a.pre) return 1; } return diff; }; function flushJobs(seen) { isFlushPending = false; isFlushing = true; // Sort queue before flush. // This ensures that: // 1. Components are updated from parent to child. (because parent is always // created before the child so its render effect will have smaller // priority number) // 2. If a component is unmounted during a parent component's update, // its update can be skipped. queue.sort(comparator); // conditional usage of checkRecursiveUpdate must be determined out of // try ... catch block since Rollup by default de-optimizes treeshaking // inside try-catch. This can leave all warning code unshaked. Although // they would get eventually shaken by a minifier like terser, some minifiers // would fail to do that (e.g. https://github.com/evanw/esbuild/issues/1610) var check = NOOP; try { for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { var job = queue[flushIndex]; if (job && job.active !== false) { if ("production" !== 'production' && check(job)) ; // console.log(`running:`, job.id) callWithErrorHandling(job, null, 14 /* ErrorCodes.SCHEDULER */); } } } finally { flushIndex = 0; queue.length = 0; flushPostFlushCbs(); isFlushing = false; currentFlushPromise = null; // some postFlushCb queued jobs! // keep flushing until it drains. if (queue.length || pendingPostFlushCbs.length) { flushJobs(); } } } var devtools; var buffer = []; function setDevtoolsHook(hook, target) { var _a, _b; devtools = hook; if (devtools) { devtools.enabled = true; buffer.forEach(_ref3 => { var { event, args } = _ref3; return devtools.emit(event, ...args); }); buffer = []; } else if ( // handle late devtools injection - only do this if we are in an actual // browser environment to avoid the timer handle stalling test runner exit // (#4815) typeof window !== 'undefined' && // some envs mock window but not fully window.HTMLElement && // also exclude jsdom !((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) { var replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; replay.push(newHook => { setDevtoolsHook(newHook, target); }); // clear buffer after 3s - the user probably doesn't have devtools installed // at all, and keeping the buffer will cause memory leaks (#4738) setTimeout(() => { if (!devtools) { target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; buffer = []; } }, 3000); } else { buffer = []; } } function emit(instance, event) { if (instance.isUnmounted) return; var props = instance.vnode.props || EMPTY_OBJ; for (var _len3 = arguments.length, rawArgs = new Array(_len3 > 2 ? _len3 - 2 : 0), _key4 = 2; _key4 < _len3; _key4++) { rawArgs[_key4 - 2] = arguments[_key4]; } var args = rawArgs; var isModelListener = event.startsWith('update:'); // for v-model update:xxx events, apply modifiers on args var modelArg = isModelListener && event.slice(7); if (modelArg && modelArg in props) { var modifiersKey = "".concat(modelArg === 'modelValue' ? 'model' : modelArg, "Modifiers"); var { number, trim } = props[modifiersKey] || EMPTY_OBJ; if (trim) { args = rawArgs.map(a => isString(a) ? a.trim() : a); } if (number) { args = rawArgs.map(looseToNumber); } } var handlerName; var handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249) props[handlerName = toHandlerKey(camelize(event))]; // for v-model update:xxx events, also trigger kebab-case equivalent // for props passed via kebab-case if (!handler && isModelListener) { handler = props[handlerName = toHandlerKey(hyphenate(event))]; } if (handler) { callWithAsyncErrorHandling(handler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args); } var 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 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args); } } function normalizeEmitsOptions(comp, appContext) { var asMixin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var cache = appContext.emitsCache; var cached = cache.get(comp); if (cached !== undefined) { return cached; } var raw = comp.emits; var normalized = {}; // apply mixin/extends props var hasExtends = false; if (!isFunction(comp)) { var extendEmits = raw => { var normalizedFromExtend = normalizeEmitsOptions(raw, 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(comp)) { cache.set(comp, null); } return null; } if (isArray(raw)) { raw.forEach(key => normalized[key] = null); } else { extend$1(normalized, raw); } if (isObject(comp)) { cache.set(comp, normalized); } return normalized; } // Check if an incoming prop key is a declared emit event listener. // e.g. With `emits: { click: null }`, props named `onClick` and `onclick` are // both considered matched listeners. 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); } /** * mark the current rendering instance for asset resolution (e.g. * resolveComponent, resolveDirective) during render */ var currentRenderingInstance = null; var currentScopeId = null; /** * Note: rendering calls maybe nested. The function returns the parent rendering * instance if present, which should be restored after the render is done: * * ```js * const prev = setCurrentRenderingInstance(i) * // ...render * setCurrentRenderingInstance(prev) * ``` */ function setCurrentRenderingInstance(instance) { var prev = currentRenderingInstance; currentRenderingInstance = instance; currentScopeId = instance && instance.type.__scopeId || null; return prev; } /** * Set scope id when creating hoisted vnodes. * @private compiler helper */ function pushScopeId(id) { currentScopeId = id; } /** * Technically we no longer need this after 3.0.8 but we need to keep the same * API for backwards compat w/ code generated by compilers. * @private */ function popScopeId() { currentScopeId = null; } /** * Only for backwards compat * @private */ var withScopeId = _id => withCtx; /** * Wrap a slot function to memoize current rendering instance * @private compiler helper */ function withCtx(fn) { var ctx = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : currentRenderingInstance; var isNonScopedSlot // false only = arguments.length > 2 ? arguments[2] : undefined; if (!ctx) return fn; // already normalized if (fn._n) { return fn; } var renderFnWithContext = function () { // If a user calls a compiled slot inside a template expression (#1745), it // can mess up block tracking, so by default we disable block tracking and // force bail out when invoking a compiled slot (indicated by the ._d flag). // This isn't necessary if rendering a compiled ``, so we flip the // ._d flag off when invoking the wrapped fn inside `renderSlot`. if (renderFnWithContext._d) { setBlockTracking(-1); } var prevInstance = setCurrentRenderingInstance(ctx); var res; try { res = fn(...arguments); } finally { setCurrentRenderingInstance(prevInstance); if (renderFnWithContext._d) { setBlockTracking(1); } } return res; }; // mark normalized to avoid duplicated wrapping renderFnWithContext._n = true; // mark this as compiled by default // this is used in vnode.ts -> normalizeChildren() to set the slot // rendering flag. renderFnWithContext._c = true; // disable block tracking by default renderFnWithContext._d = true; return renderFnWithContext; } function markAttrsAccessed() {} function renderComponentRoot(instance) { var { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx, inheritAttrs } = instance; var result; var fallthroughAttrs; var prev = setCurrentRenderingInstance(instance); try { if (vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) { // withProxy is a proxy with a different `has` trap only for // runtime-compiled render functions using `with` block. var proxyToUse = withProxy || proxy; result = normalizeVNode(render.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx)); fallthroughAttrs = attrs; } else { // functional var _render = Component; // in dev, mark attrs accessed if optional props (attrs === props) if ("production" !== 'production' && attrs === props) ; result = normalizeVNode(_render.length > 1 ? _render(props, "production" !== 'production' ? { get attrs() { markAttrsAccessed(); return attrs; }, slots, emit } : { attrs, slots, emit }) : _render(props, null /* we know it doesn't need it */)); fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); } } catch (err) { blockStack.length = 0; handleError(err, instance, 1 /* ErrorCodes.RENDER_FUNCTION */); result = createVNode(Comment); } // attr merging // in dev mode, comments are preserved, and it's possible for a template // to have comments along side the root element which makes it a fragment var root = result; if (fallthroughAttrs && inheritAttrs !== false) { var keys = Object.keys(fallthroughAttrs); var { shapeFlag } = root; if (keys.length) { if (shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) { if (propsOptions && keys.some(isModelListener)) { // If a v-model listener (onUpdate:xxx) has a corresponding declared // prop, it indicates this component expects to handle v-model and // it should not fallthrough. // related: #1543, #1643, #1989 fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions); } root = cloneVNode(root, fallthroughAttrs); } } } // inherit directives if (vnode.dirs) { // clone before mutating since the root may be a hoisted vnode root = cloneVNode(root); root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; } // inherit transition data if (vnode.transition) { root.transition = vnode.transition; } { result = root; } setCurrentRenderingInstance(prev); return result; } function filterSingleRoot(children) { var singleRoot; for (var i = 0; i < children.length; i++) { var child = children[i]; if (isVNode(child)) { // ignore user comment if (child.type !== Comment || child.children === 'v-if') { if (singleRoot) { // has more than 1 non-comment child, return now return; } else { singleRoot = child; } } } else { return; } } return singleRoot; } var getFunctionalFallthrough = attrs => { var res; for (var key in attrs) { if (key === 'class' || key === 'style' || isOn(key)) { (res || (res = {}))[key] = attrs[key]; } } return res; }; var filterModelListeners = (attrs, props) => { var res = {}; for (var key in attrs) { if (!isModelListener(key) || !(key.slice(9) in props)) { res[key] = attrs[key]; } } return res; }; function shouldUpdateComponent(prevVNode, nextVNode, optimized) { var { props: prevProps, children: prevChildren, component } = prevVNode; var { props: nextProps, children: nextChildren, patchFlag } = nextVNode; var emits = component.emitsOptions; // force child update for runtime directive or transition on component vnode. if (nextVNode.dirs || nextVNode.transition) { return true; } if (optimized && patchFlag >= 0) { if (patchFlag & 1024 /* PatchFlags.DYNAMIC_SLOTS */) { // slot content that references values that might have changed, // e.g. in a v-for return true; } if (patchFlag & 16 /* PatchFlags.FULL_PROPS */) { if (!prevProps) { return !!nextProps; } // presence of this flag indicates props are always non-null return hasPropsChanged(prevProps, nextProps, emits); } else if (patchFlag & 8 /* PatchFlags.PROPS */) { var dynamicProps = nextVNode.dynamicProps; for (var i = 0; i < dynamicProps.length; i++) { var key = dynamicProps[i]; if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { return true; } } } } else { // this path is only taken by manually written render functions // so presence of any children leads to a forced update 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) { var nextKeys = Object.keys(nextProps); if (nextKeys.length !== Object.keys(prevProps).length) { return true; } for (var i = 0; i < nextKeys.length; i++) { var key = nextKeys[i]; if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { return true; } } return false; } function updateHOCHostEl(_ref4, el // HostNode ) { var { vnode, parent } = _ref4; while (parent && parent.subTree === vnode) { (vnode = parent.vnode).el = el; parent = parent.parent; } } var isSuspense = type => type.__isSuspense; // Suspense exposes a component-like API, and is treated like a component // in the compiler, but internally it's a special built-in type that hooks // directly into the renderer. var SuspenseImpl = { name: 'Suspense', // In order to make Suspense tree-shakable, we need to avoid importing it // directly in the renderer. The renderer checks for the __isSuspense flag // on a vnode's type and calls the `process` method, passing in renderer // internals. __isSuspense: true, process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, // platform-specific impl passed from renderer rendererInternals) { if (n1 == null) { mountSuspense(n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals); } else { patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, rendererInternals); } }, hydrate: hydrateSuspense, create: createSuspenseBoundary, normalize: normalizeSuspenseChildren }; // Force-casted public typing for h and TSX props inference var Suspense = SuspenseImpl; function triggerEvent(vnode, name) { var eventListener = vnode.props && vnode.props[name]; if (isFunction(eventListener)) { eventListener(); } } function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) { var { p: patch, o: { createElement } } = rendererInternals; // @ts-expect-error fixed by xxxxxx var hiddenContainer = createElement('div'); var suspense = vnode.suspense = createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals); // start mounting the content subtree in an off-dom container patch(null, suspense.pendingBranch = vnode.ssContent, hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds); // now check if we have encountered any async deps if (suspense.deps > 0) { // has async // invoke @fallback event triggerEvent(vnode, 'onPending'); triggerEvent(vnode, 'onFallback'); // mount the fallback tree patch(null, vnode.ssFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context isSVG, slotScopeIds); setActiveBranch(suspense, vnode.ssFallback); } else { // Suspense has no async deps. Just resolve. suspense.resolve(); } } function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, _ref5) { var { p: patch, um: unmount, o: { createElement } } = _ref5; var suspense = n2.suspense = n1.suspense; suspense.vnode = n2; n2.el = n1.el; var newBranch = n2.ssContent; var newFallback = n2.ssFallback; var { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense; if (pendingBranch) { suspense.pendingBranch = newBranch; if (isSameVNodeType(newBranch, pendingBranch)) { // same root type but content may have changed. patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized); if (suspense.deps <= 0) { suspense.resolve(); } else if (isInFallback) { patch(activeBranch, newFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context isSVG, slotScopeIds, optimized); setActiveBranch(suspense, newFallback); } } else { // toggled before pending tree is resolved suspense.pendingId++; if (isHydrating) { // if toggled before hydration is finished, the current DOM tree is // no longer valid. set it as the active branch so it will be unmounted // when resolved suspense.isHydrating = false; suspense.activeBranch = pendingBranch; } else { unmount(pendingBranch, parentComponent, suspense); } // increment pending ID. this is used to invalidate async callbacks // reset suspense state suspense.deps = 0; // discard effects from pending branch suspense.effects.length = 0; // discard previous container // @ts-expect-error fixed by xxxxxx suspense.hiddenContainer = createElement('div'); if (isInFallback) { // already in fallback state patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized); if (suspense.deps <= 0) { suspense.resolve(); } else { patch(activeBranch, newFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context isSVG, slotScopeIds, optimized); setActiveBranch(suspense, newFallback); } } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { // toggled "back" to current active branch patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, isSVG, slotScopeIds, optimized); // force resolve suspense.resolve(true); } else { // switched to a 3rd branch patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized); if (suspense.deps <= 0) { suspense.resolve(); } } } } else { if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { // root did not change, just normal patch patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, isSVG, slotScopeIds, optimized); setActiveBranch(suspense, newBranch); } else { // root node toggled // invoke @pending event triggerEvent(n2, 'onPending'); // mount pending branch in off-dom container suspense.pendingBranch = newBranch; suspense.pendingId++; patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized); if (suspense.deps <= 0) { // incoming branch has no async deps, resolve now. suspense.resolve(); } else { var { timeout, pendingId } = suspense; if (timeout > 0) { setTimeout(() => { if (suspense.pendingId === pendingId) { suspense.fallback(newFallback); } }, timeout); } else if (timeout === 0) { suspense.fallback(newFallback); } } } } } function createSuspenseBoundary(vnode, parent, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals) { var isHydrating = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : false; var { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals; var timeout = vnode.props ? toNumber(vnode.props.timeout) : undefined; var suspense = { vnode, parent, parentComponent, isSVG, container, hiddenContainer, anchor, deps: 0, pendingId: 0, timeout: typeof timeout === 'number' ? timeout : -1, activeBranch: null, pendingBranch: null, isInFallback: true, isHydrating, isUnmounted: false, effects: [], resolve() { var resume = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var { vnode, activeBranch, pendingBranch, pendingId, effects, parentComponent, container } = suspense; if (suspense.isHydrating) { suspense.isHydrating = false; } else if (!resume) { var delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === 'out-in'; if (delayEnter) { activeBranch.transition.afterLeave = () => { if (pendingId === suspense.pendingId) { move(pendingBranch, container, _anchor, 0 /* MoveType.ENTER */); } }; } // this is initial anchor on mount var { anchor: _anchor } = suspense; // unmount current active tree if (activeBranch) { // if the fallback tree was mounted, it may have been moved // as part of a parent suspense. get the latest anchor for insertion _anchor = next(activeBranch); unmount(activeBranch, parentComponent, suspense, true); } if (!delayEnter) { // move content from off-dom container to actual container move(pendingBranch, container, _anchor, 0 /* MoveType.ENTER */); } } setActiveBranch(suspense, pendingBranch); suspense.pendingBranch = null; suspense.isInFallback = false; // flush buffered effects // check if there is a pending parent suspense var parent = suspense.parent; var hasUnresolvedAncestor = false; while (parent) { if (parent.pendingBranch) { // found a pending parent suspense, merge buffered post jobs // into that parent parent.effects.push(...effects); hasUnresolvedAncestor = true; break; } parent = parent.parent; } // no pending parent suspense, flush all jobs if (!hasUnresolvedAncestor) { queuePostFlushCb(effects); } suspense.effects = []; // invoke @resolve event triggerEvent(vnode, 'onResolve'); }, fallback(fallbackVNode) { if (!suspense.pendingBranch) { return; } var { vnode, activeBranch, parentComponent, container, isSVG } = suspense; // invoke @fallback event triggerEvent(vnode, 'onFallback'); var anchor = next(activeBranch); var mountFallback = () => { if (!suspense.isInFallback) { return; } // mount the fallback tree patch(null, fallbackVNode, container, anchor, parentComponent, null, // fallback tree will not have suspense context isSVG, slotScopeIds, optimized); setActiveBranch(suspense, fallbackVNode); }; var delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === 'out-in'; if (delayEnter) { activeBranch.transition.afterLeave = mountFallback; } suspense.isInFallback = true; // unmount current active branch unmount(activeBranch, parentComponent, null, // no suspense so unmount hooks fire now true // shouldRemove ); if (!delayEnter) { mountFallback(); } }, move(container, anchor, type) { suspense.activeBranch && move(suspense.activeBranch, container, anchor, type); suspense.container = container; }, next() { return suspense.activeBranch && next(suspense.activeBranch); }, registerDep(instance, setupRenderEffect) { var isInPendingSuspense = !!suspense.pendingBranch; if (isInPendingSuspense) { suspense.deps++; } var hydratedEl = instance.vnode.el; instance.asyncDep.catch(err => { handleError(err, instance, 0 /* ErrorCodes.SETUP_FUNCTION */); }).then(asyncSetupResult => { // retry when the setup() promise resolves. // component may have been unmounted before resolve. if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) { return; } // retry from this component instance.asyncResolved = true; var { vnode } = instance; handleSetupResult(instance, asyncSetupResult, false); if (hydratedEl) { // vnode may have been replaced if an update happened before the // async dep is resolved. vnode.el = hydratedEl; } var placeholder = !hydratedEl && instance.subTree.el; setupRenderEffect(instance, vnode, // component may have been moved before resolve. // if this is not a hydration, instance.subTree will be the comment // placeholder. parentNode(hydratedEl || instance.subTree.el), // anchor will not be used if this is hydration, so only need to // consider the comment placeholder case. hydratedEl ? null : next(instance.subTree), suspense, isSVG, optimized); if (placeholder) { remove(placeholder); } updateHOCHostEl(instance, vnode.el); // only decrease deps count if suspense is not already resolved if (isInPendingSuspense && --suspense.deps === 0) { suspense.resolve(); } }); }, unmount(parentSuspense, doRemove) { suspense.isUnmounted = true; if (suspense.activeBranch) { unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove); } if (suspense.pendingBranch) { unmount(suspense.pendingBranch, parentComponent, parentSuspense, doRemove); } } }; return suspense; } function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) { /* eslint-disable no-restricted-globals */ var suspense = vnode.suspense = createSuspenseBoundary(vnode, parentSuspense, parentComponent, node.parentNode, document.createElement('div'), null, isSVG, slotScopeIds, optimized, rendererInternals, true /* hydrating */); // there are two possible scenarios for server-rendered suspense: // - success: ssr content should be fully resolved // - failure: ssr content should be the fallback branch. // however, on the client we don't really know if it has failed or not // attempt to hydrate the DOM assuming it has succeeded, but we still // need to construct a suspense boundary first var result = hydrateNode(node, suspense.pendingBranch = vnode.ssContent, parentComponent, suspense, slotScopeIds, optimized); if (suspense.deps === 0) { suspense.resolve(); } return result; /* eslint-enable no-restricted-globals */ } function normalizeSuspenseChildren(vnode) { var { shapeFlag, children } = vnode; var isSlotChildren = shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */; vnode.ssContent = normalizeSuspenseSlot(isSlotChildren ? children.default : children); vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment); } function normalizeSuspenseSlot(s) { var block; if (isFunction(s)) { var trackBlock = isBlockTreeEnabled && s._c; if (trackBlock) { // disableTracking: false // allow block tracking for compiled slots // (see ./componentRenderContext.ts) s._d = false; openBlock(); } s = s(); if (trackBlock) { s._d = true; block = currentBlock; closeBlock(); } } if (isArray(s)) { var singleChild = filterSingleRoot(s); s = singleChild; } s = normalizeVNode(s); if (block && !s.dynamicChildren) { s.dynamicChildren = block.filter(c => c !== s); } return s; } function queueEffectWithSuspense(fn, suspense) { if (suspense && suspense.pendingBranch) { if (isArray(fn)) { suspense.effects.push(...fn); } else { suspense.effects.push(fn); } } else { queuePostFlushCb(fn); } } function setActiveBranch(suspense, branch) { suspense.activeBranch = branch; var { vnode, parentComponent } = suspense; var el = vnode.el = branch.el; // in case suspense is the root node of a component, // recursively update the HOC el if (parentComponent && parentComponent.subTree === vnode) { parentComponent.vnode.el = el; updateHOCHostEl(parentComponent, el); } } function provide(key, value) { if (!currentInstance) ;else { var provides = currentInstance.provides; // by default an instance inherits its parent's provides object // but when it needs to provide values of its own, it creates its // own provides object using parent provides object as prototype. // this way in `inject` we can simply look up injections from direct // parent and let the prototype chain do the work. var parentProvides = currentInstance.parent && currentInstance.parent.provides; if (parentProvides === provides) { provides = currentInstance.provides = Object.create(parentProvides); } // TS doesn't allow symbol as index type provides[key] = value; // 当实例为 App 时,同步到全局 provide if (currentInstance.type.mpType === 'app') { currentInstance.appContext.app.provide(key, value); } } } function inject(key, defaultValue) { var treatDefaultAsFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; // fallback to `currentRenderingInstance` so that this can be called in // a functional component var instance = currentInstance || currentRenderingInstance; if (instance) { // #2400 // to support `app.use` plugins, // fallback to appContext's `provides` if the instance is at root var provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides; if (provides && key in provides) { // TS doesn't allow symbol as index type return provides[key]; } else if (arguments.length > 1) { return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance.proxy) : defaultValue; } else ; } } // Simple effect. function watchEffect(effect, options) { return doWatch(effect, null, options); } function watchPostEffect(effect, options) { return doWatch(effect, null, { flush: 'post' }); } function watchSyncEffect(effect, options) { return doWatch(effect, null, { flush: 'sync' }); } // initial value for watchers to trigger on undefined initial values var INITIAL_WATCHER_VALUE = {}; // implementation function watch(source, cb, options) { return doWatch(source, cb, options); } function doWatch(source, cb) { var { immediate, deep, flush, onTrack, onTrigger } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJ; var instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null; // const instance = currentInstance var getter; var forceTrigger = false; var isMultiSource = false; if (isRef(source)) { getter = () => source.value; forceTrigger = isShallow(source); } else if (isReactive(source)) { getter = () => source; deep = true; } else if (isArray(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 traverse(s); } else if (isFunction(s)) { return callWithErrorHandling(s, instance, 2 /* ErrorCodes.WATCH_GETTER */); } else ; }); } else if (isFunction(source)) { if (cb) { // getter with cb getter = () => callWithErrorHandling(source, instance, 2 /* ErrorCodes.WATCH_GETTER */); } else { // no cb -> simple effect getter = () => { if (instance && instance.isUnmounted) { return; } if (cleanup) { cleanup(); } return callWithAsyncErrorHandling(source, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [onCleanup]); }; } } else { getter = NOOP; } if (cb && deep) { var baseGetter = getter; getter = () => traverse(baseGetter()); } var cleanup; var onCleanup = fn => { cleanup = effect.onStop = () => { callWithErrorHandling(fn, instance, 4 /* ErrorCodes.WATCH_CLEANUP */); }; }; var oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; var job = () => { if (!effect.active) { return; } if (cb) { // watch(source, cb) var newValue = effect.run(); if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) { // cleanup before running cb again if (cleanup) { cleanup(); } callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [newValue, // pass undefined as the old value when it's changed for the first time oldValue === INITIAL_WATCHER_VALUE ? undefined : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, onCleanup]); oldValue = newValue; } } else { // watchEffect effect.run(); } }; // important: mark the job as a watcher callback so that scheduler knows // it is allowed to self-trigger (#1727) job.allowRecurse = !!cb; var scheduler; if (flush === 'sync') { scheduler = job; // the scheduler function gets called directly } else if (flush === 'post') { scheduler = () => queuePostRenderEffect(job, instance && instance.suspense); } else { // default: 'pre' job.pre = true; if (instance) job.id = instance.uid; scheduler = () => queueJob(job); } var effect = new ReactiveEffect(getter, scheduler); // initial run if (cb) { if (immediate) { job(); } else { oldValue = effect.run(); } } else if (flush === 'post') { queuePostRenderEffect(effect.run.bind(effect), instance && instance.suspense); } else { effect.run(); } var unwatch = () => { effect.stop(); if (instance && instance.scope) { remove(instance.scope.effects, effect); } }; return unwatch; } // this.$watch function instanceWatch(source, value, options) { var publicThis = this.proxy; var getter = isString(source) ? source.includes('.') ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); var cb; if (isFunction(value)) { cb = value; } else { cb = value.handler; options = value; } var cur = currentInstance; setCurrentInstance(this); var res = doWatch(getter, cb.bind(publicThis), options); if (cur) { setCurrentInstance(cur); } else { unsetCurrentInstance(); } return res; } function createPathGetter(ctx, path) { var segments = path.split('.'); return () => { var cur = ctx; for (var i = 0; i < segments.length && cur; i++) { cur = cur[segments[i]]; } return cur; }; } function traverse(value, seen) { if (!isObject(value) || value["__v_skip" /* ReactiveFlags.SKIP */]) { return value; } seen = seen || new Set(); if (seen.has(value)) { return value; } seen.add(value); if (isRef(value)) { traverse(value.value, seen); } else if (isArray(value)) { for (var i = 0; i < value.length; i++) { traverse(value[i], seen); } } else if (isSet(value) || isMap(value)) { value.forEach(v => { traverse(v, seen); }); } else if (isPlainObject(value)) { for (var key in value) { traverse(value[key], seen); } } return value; } function useTransitionState() { var state = { isMounted: false, isLeaving: false, isUnmounting: false, leavingVNodes: new Map() }; onMounted(() => { state.isMounted = true; }); onBeforeUnmount(() => { state.isUnmounting = true; }); return state; } var TransitionHookValidator = [Function, Array]; var BaseTransitionPropsValidators = { mode: String, appear: Boolean, persisted: Boolean, // enter onBeforeEnter: TransitionHookValidator, onEnter: TransitionHookValidator, onAfterEnter: TransitionHookValidator, onEnterCancelled: TransitionHookValidator, // leave onBeforeLeave: TransitionHookValidator, onLeave: TransitionHookValidator, onAfterLeave: TransitionHookValidator, onLeaveCancelled: TransitionHookValidator, // appear onBeforeAppear: TransitionHookValidator, onAppear: TransitionHookValidator, onAfterAppear: TransitionHookValidator, onAppearCancelled: TransitionHookValidator }; var BaseTransitionImpl = { name: "BaseTransition", props: BaseTransitionPropsValidators, setup(props, _ref6) { var { slots } = _ref6; var instance = getCurrentInstance(); var state = useTransitionState(); var prevTransitionKey; return () => { var children = slots.default && getTransitionRawChildren(slots.default(), true); if (!children || !children.length) { return; } var child = children[0]; if (children.length > 1) { // locate first non-comment child for (var c of children) { if (c.type !== Comment) { child = c; break; } } } // there's no need to track reactivity for these props so use the raw // props for a bit better perf var rawProps = toRaw(props); var { mode } = rawProps; if (state.isLeaving) { return emptyPlaceholder(child); } // in the case of , we need to // compare the type of the kept-alive children. var innerChild = getKeepAliveChild(child); if (!innerChild) { return emptyPlaceholder(child); } var enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance); setTransitionHooks(innerChild, enterHooks); var oldChild = instance.subTree; var oldInnerChild = oldChild && getKeepAliveChild(oldChild); var transitionKeyChanged = false; var { getTransitionKey } = innerChild.type; if (getTransitionKey) { var key = getTransitionKey(); if (prevTransitionKey === undefined) { prevTransitionKey = key; } else if (key !== prevTransitionKey) { prevTransitionKey = key; transitionKeyChanged = true; } } // handle mode if (oldInnerChild && oldInnerChild.type !== Comment && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) { var leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance); // update old tree's hooks in case of dynamic transition setTransitionHooks(oldInnerChild, leavingHooks); // switching between different views if (mode === 'out-in') { state.isLeaving = true; // return placeholder node and queue update when leave finishes leavingHooks.afterLeave = () => { state.isLeaving = false; // #6835 // it also needs to be updated when active is undefined if (instance.update.active !== false) { instance.update(); } }; return emptyPlaceholder(child); } else if (mode === 'in-out' && innerChild.type !== Comment) { leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { var leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild); leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; // early removal callback el._leaveCb = () => { earlyRemove(); el._leaveCb = undefined; delete enterHooks.delayedLeave; }; enterHooks.delayedLeave = delayedLeave; }; } } return child; }; } }; // export the public type for h/tsx inference // also to avoid inline import() in generated d.ts files var BaseTransition = BaseTransitionImpl; function getLeavingNodesForType(state, vnode) { var { leavingVNodes } = state; var leavingVNodesCache = leavingVNodes.get(vnode.type); if (!leavingVNodesCache) { leavingVNodesCache = Object.create(null); leavingVNodes.set(vnode.type, leavingVNodesCache); } return leavingVNodesCache; } // The transition hooks are attached to the vnode as vnode.transition // and will be called at appropriate timing in the renderer. function resolveTransitionHooks(vnode, props, state, instance) { var { appear, mode, persisted = false, onBeforeEnter, onEnter, onAfterEnter, onEnterCancelled, onBeforeLeave, onLeave, onAfterLeave, onLeaveCancelled, onBeforeAppear, onAppear, onAfterAppear, onAppearCancelled } = props; var key = String(vnode.key); var leavingVNodesCache = getLeavingNodesForType(state, vnode); var callHook = (hook, args) => { hook && callWithAsyncErrorHandling(hook, instance, 9 /* ErrorCodes.TRANSITION_HOOK */, args); }; var callAsyncHook = (hook, args) => { var done = args[1]; callHook(hook, args); if (isArray(hook)) { if (hook.every(hook => hook.length <= 1)) done(); } else if (hook.length <= 1) { done(); } }; var hooks = { mode, persisted, beforeEnter(el) { var hook = onBeforeEnter; if (!state.isMounted) { if (appear) { hook = onBeforeAppear || onBeforeEnter; } else { return; } } // for same element (v-show) if (el._leaveCb) { el._leaveCb(true /* cancelled */); } // for toggled element with same key (v-if) var leavingVNode = leavingVNodesCache[key]; if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el._leaveCb) { // force early removal (not cancelled) leavingVNode.el._leaveCb(); } callHook(hook, [el]); }, enter(el) { var hook = onEnter; var afterHook = onAfterEnter; var cancelHook = onEnterCancelled; if (!state.isMounted) { if (appear) { hook = onAppear || onEnter; afterHook = onAfterAppear || onAfterEnter; cancelHook = onAppearCancelled || onEnterCancelled; } else { return; } } var called = false; var done = el._enterCb = cancelled => { if (called) return; called = true; if (cancelled) { callHook(cancelHook, [el]); } else { callHook(afterHook, [el]); } if (hooks.delayedLeave) { hooks.delayedLeave(); } el._enterCb = undefined; }; if (hook) { callAsyncHook(hook, [el, done]); } else { done(); } }, leave(el, remove) { var key = String(vnode.key); if (el._enterCb) { el._enterCb(true /* cancelled */); } if (state.isUnmounting) { return remove(); } callHook(onBeforeLeave, [el]); var called = false; var done = el._leaveCb = cancelled => { if (called) return; called = true; remove(); if (cancelled) { callHook(onLeaveCancelled, [el]); } else { callHook(onAfterLeave, [el]); } el._leaveCb = undefined; if (leavingVNodesCache[key] === vnode) { delete leavingVNodesCache[key]; } }; leavingVNodesCache[key] = vnode; if (onLeave) { callAsyncHook(onLeave, [el, done]); } else { done(); } }, clone(vnode) { return resolveTransitionHooks(vnode, props, state, instance); } }; return hooks; } // the placeholder really only handles one special case: KeepAlive // in the case of a KeepAlive in a leave phase we need to return a KeepAlive // placeholder with empty content to avoid the KeepAlive instance from being // unmounted. function emptyPlaceholder(vnode) { if (isKeepAlive(vnode)) { vnode = cloneVNode(vnode); vnode.children = null; return vnode; } } function getKeepAliveChild(vnode) { return isKeepAlive(vnode) ? vnode.children ? vnode.children[0] : undefined : vnode; } function setTransitionHooks(vnode, hooks) { if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */ && vnode.component) { setTransitionHooks(vnode.component.subTree, hooks); } else if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) { vnode.ssContent.transition = hooks.clone(vnode.ssContent); vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); } else { vnode.transition = hooks; } } function getTransitionRawChildren(children) { var keepComment = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var parentKey = arguments.length > 2 ? arguments[2] : undefined; var ret = []; var keyedFragmentCount = 0; for (var i = 0; i < children.length; i++) { var child = children[i]; // #5360 inherit parent key in case of