1function makeMap(str, expectsLowerCase) { 2 const map = /* @__PURE__ */ Object.create(null); 3 const list = str.split(","); 4 for (let i = 0; i < list.length; i++) { 5 map[list[i]] = true; 6 } 7 return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val]; 8} 9const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; 10const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); 11function includeBooleanAttr(value) { 12 return !!value || value === ""; 13} 14function normalizeStyle(value) { 15 if (isArray(value)) { 16 const res = {}; 17 for (let i = 0; i < value.length; i++) { 18 const item = value[i]; 19 const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); 20 if (normalized) { 21 for (const key in normalized) { 22 res[key] = normalized[key]; 23 } 24 } 25 } 26 return res; 27 } else if (isString(value)) { 28 return value; 29 } else if (isObject(value)) { 30 return value; 31 } 32} 33const listDelimiterRE = /;(?![^(]*\))/g; 34const propertyDelimiterRE = /:(.+)/; 35function parseStringStyle(cssText) { 36 const ret = {}; 37 cssText.split(listDelimiterRE).forEach((item) => { 38 if (item) { 39 const tmp = item.split(propertyDelimiterRE); 40 tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); 41 } 42 }); 43 return ret; 44} 45function normalizeClass(value) { 46 let res = ""; 47 if (isString(value)) { 48 res = value; 49 } else if (isArray(value)) { 50 for (let i = 0; i < value.length; i++) { 51 const normalized = normalizeClass(value[i]); 52 if (normalized) { 53 res += normalized + " "; 54 } 55 } 56 } else if (isObject(value)) { 57 for (const name in value) { 58 if (value[name]) { 59 res += name + " "; 60 } 61 } 62 } 63 return res.trim(); 64} 65const toDisplayString = (val) => { 66 return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val); 67}; 68const replacer = (_key, val) => { 69 if (val && val.__v_isRef) { 70 return replacer(_key, val.value); 71 } else if (isMap(val)) { 72 return { 73 [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => { 74 entries[`${key} =>`] = val2; 75 return entries; 76 }, {}) 77 }; 78 } else if (isSet(val)) { 79 return { 80 [`Set(${val.size})`]: [...val.values()] 81 }; 82 } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { 83 return String(val); 84 } 85 return val; 86}; 87const EMPTY_OBJ = {}; 88const EMPTY_ARR = []; 89const NOOP = () => { 90}; 91const NO = () => false; 92const onRE = /^on[^a-z]/; 93const isOn = (key) => onRE.test(key); 94const isModelListener = (key) => key.startsWith("onUpdate:"); 95const extend = Object.assign; 96const remove = (arr, el) => { 97 const i = arr.indexOf(el); 98 if (i > -1) { 99 arr.splice(i, 1); 100 } 101}; 102const hasOwnProperty = Object.prototype.hasOwnProperty; 103const hasOwn = (val, key) => hasOwnProperty.call(val, key); 104const isArray = Array.isArray; 105const isMap = (val) => toTypeString(val) === "[object Map]"; 106const isSet = (val) => toTypeString(val) === "[object Set]"; 107const isFunction = (val) => typeof val === "function"; 108const isString = (val) => typeof val === "string"; 109const isSymbol = (val) => typeof val === "symbol"; 110const isObject = (val) => val !== null && typeof val === "object"; 111const isPromise = (val) => { 112 return isObject(val) && isFunction(val.then) && isFunction(val.catch); 113}; 114const objectToString = Object.prototype.toString; 115const toTypeString = (value) => objectToString.call(value); 116const toRawType = (value) => { 117 return toTypeString(value).slice(8, -1); 118}; 119const isPlainObject = (val) => toTypeString(val) === "[object Object]"; 120const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; 121const isReservedProp = /* @__PURE__ */ makeMap( 122 ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" 123); 124const cacheStringFunction = (fn) => { 125 const cache = /* @__PURE__ */ Object.create(null); 126 return (str) => { 127 const hit = cache[str]; 128 return hit || (cache[str] = fn(str)); 129 }; 130}; 131const camelizeRE = /-(\w)/g; 132const camelize = cacheStringFunction((str) => { 133 return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); 134}); 135const hyphenateRE = /\B([A-Z])/g; 136const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase()); 137const capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1)); 138const toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``); 139const hasChanged = (value, oldValue) => !Object.is(value, oldValue); 140const invokeArrayFns = (fns, arg) => { 141 for (let i = 0; i < fns.length; i++) { 142 fns[i](arg); 143 } 144}; 145const def = (obj, key, value) => { 146 Object.defineProperty(obj, key, { 147 configurable: true, 148 enumerable: false, 149 value 150 }); 151}; 152const toNumber = (val) => { 153 const n = parseFloat(val); 154 return isNaN(n) ? val : n; 155}; 156let _globalThis; 157const getGlobalThis = () => { 158 return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); 159}; 160let activeEffectScope; 161class EffectScope { 162 constructor(detached = false) { 163 this.detached = detached; 164 this.active = true; 165 this.effects = []; 166 this.cleanups = []; 167 this.parent = activeEffectScope; 168 if (!detached && activeEffectScope) { 169 this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1; 170 } 171 } 172 run(fn) { 173 if (this.active) { 174 const currentEffectScope = activeEffectScope;
175 try { 176 activeEffectScope = this; 177 return fn(); 178 } finally { 179 activeEffectScope = currentEffectScope; 180 } 181 } 182 } 183 on() { 184 activeEffectScope = this; 185 } 186 off() { 187 activeEffectScope = this.parent; 188 } 189 stop(fromParent) { 190 if (this.active) { 191 let i, l; 192 for (i = 0, l = this.effects.length; i < l; i++) { 193 this.effects[i].stop(); 194 } 195 for (i = 0, l = this.cleanups.length; i < l; i++) { 196 this.cleanups[i](); 197 } 198 if (this.scopes) { 199 for (i = 0, l = this.scopes.length; i < l; i++) { 200 this.scopes[i].stop(true); 201 } 202 } 203 if (!this.detached && this.parent && !fromParent) { 204 const last = this.parent.scopes.pop(); 205 if (last && last !== this) { 206 this.parent.scopes[this.index] = last; 207 last.index = this.index; 208 } 209 } 210 this.parent = void 0; 211 this.active = false; 212 } 213 } 214} 215function recordEffectScope(effect, scope = activeEffectScope) { 216 if (scope && scope.active) { 217 scope.effects.push(effect); 218 } 219} 220const createDep = (effects) => { 221 const dep = new Set(effects); 222 dep.w = 0; 223 dep.n = 0; 224 return dep; 225}; 226const wasTracked = (dep) => (dep.w & trackOpBit) > 0; 227const newTracked = (dep) => (dep.n & trackOpBit) > 0; 228const initDepMarkers = ({ deps }) => { 229 if (deps.length) { 230 for (let i = 0; i < deps.length; i++) { 231 deps[i].w |= trackOpBit; 232 } 233 } 234}; 235const finalizeDepMarkers = (effect) => { 236 const { deps } = effect; 237 if (deps.length) { 238 let ptr = 0; 239 for (let i = 0; i < deps.length; i++) { 240 const dep = deps[i]; 241 if (wasTracked(dep) && !newTracked(dep)) { 242 dep.delete(effect); 243 } else { 244 deps[ptr++] = dep; 245 } 246 dep.w &= ~trackOpBit; 247 dep.n &= ~trackOpBit; 248 } 249 deps.length = ptr; 250 } 251}; 252const targetMap = /* @__PURE__ */ new WeakMap(); 253let effectTrackDepth = 0; 254let trackOpBit = 1; 255const maxMarkerBits = 30; 256let activeEffect; 257const ITERATE_KEY = Symbol(""); 258const MAP_KEY_ITERATE_KEY = Symbol(""); 259class ReactiveEffect { 260 constructor(fn, scheduler = null, scope) { 261 this.fn = fn; 262 this.scheduler = scheduler; 263 this.active = true; 264 this.deps = []; 265 this.parent = void 0; 266 recordEffectScope(this, scope); 267 } 268 run() { 269 if (!this.active) { 270 return this.fn(); 271 } 272 let parent = activeEffect; 273 let lastShouldTrack = shouldTrack; 274 while (parent) { 275 if (parent === this) { 276 return; 277 } 278 parent = parent.parent; 279 } 280 try { 281 this.parent = activeEffect; 282 activeEffect = this; 283 shouldTrack = true; 284 trackOpBit = 1 << ++effectTrackDepth; 285 if (effectTrackDepth <= maxMarkerBits) { 286 initDepMarkers(this); 287 } else { 288 cleanupEffect(this); 289 } 290 return this.fn(); 291 } finally { 292 if (effectTrackDepth <= maxMarkerBits) { 293 finalizeDepMarkers(this); 294 } 295 trackOpBit = 1 << --effectTrackDepth; 296 activeEffect = this.parent; 297 shouldTrack = lastShouldTrack; 298 this.parent = void 0; 299 if (this.deferStop) { 300 this.stop(); 301 } 302 } 303 } 304 stop() { 305 if (activeEffect === this) { 306 this.deferStop = true; 307 } else if (this.active) { 308 cleanupEffect(this); 309 if (this.onStop) { 310 this.onStop(); 311 } 312 this.active = false; 313 } 314 } 315} 316function cleanupEffect(effect) { 317 const { deps } = effect; 318 if (deps.length) { 319 for (let i = 0; i < deps.length; i++) { 320 deps[i].delete(effect); 321 } 322 deps.length = 0; 323 } 324} 325let shouldTrack = true; 326const trackStack = []; 327function pauseTracking() { 328 trackStack.push(shouldTrack); 329 shouldTrack = false; 330} 331function resetTracking() { 332 const last = trackStack.pop(); 333 shouldTrack = last === void 0 ? true : last; 334} 335function track(target, type, key) { 336 if (shouldTrack && activeEffect) { 337 let depsMap = targetMap.get(target); 338 if (!depsMap) { 339 targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); 340 } 341 let dep = depsMap.get(key); 342 if (!dep) { 343 depsMap.set(key, dep = createDep()); 344 } 345 trackEffects(dep); 346 } 347} 348function trackEffects(dep, debuggerEventExtraInfo) { 349 let shouldTrack2 = false;
350 if (effectTrackDepth <= maxMarkerBits) { 351 if (!newTracked(dep)) { 352 dep.n |= trackOpBit; 353 shouldTrack2 = !wasTracked(dep); 354 } 355 } else { 356 shouldTrack2 = !dep.has(activeEffect); 357 } 358 if (shouldTrack2) { 359 dep.add(activeEffect); 360 activeEffect.deps.push(dep); 361 } 362} 363function trigger(target, type, key, newValue, oldValue, oldTarget) { 364 const depsMap = targetMap.get(target); 365 if (!depsMap) { 366 return; 367 } 368 let deps = []; 369 if (type === "clear") { 370 deps = [...depsMap.values()]; 371 } else if (key === "length" && isArray(target)) { 372 depsMap.forEach((dep, key2) => { 373 if (key2 === "length" || key2 >= newValue) { 374 deps.push(dep); 375 } 376 }); 377 } else { 378 if (key !== void 0) { 379 deps.push(depsMap.get(key)); 380 } 381 switch (type) { 382 case "add": 383 if (!isArray(target)) { 384 deps.push(depsMap.get(ITERATE_KEY)); 385 if (isMap(target)) { 386 deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); 387 } 388 } else if (isIntegerKey(key)) { 389 deps.push(depsMap.get("length")); 390 } 391 break; 392 case "delete": 393 if (!isArray(target)) { 394 deps.push(depsMap.get(ITERATE_KEY)); 395 if (isMap(target)) { 396 deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); 397 } 398 } 399 break; 400 case "set": 401 if (isMap(target)) { 402 deps.push(depsMap.get(ITERATE_KEY)); 403 } 404 break; 405 } 406 } 407 if (deps.length === 1) { 408 if (deps[0]) { 409 { 410 triggerEffects(deps[0]); 411 } 412 } 413 } else { 414 const effects = []; 415 for (const dep of deps) { 416 if (dep) { 417 effects.push(...dep); 418 } 419 } 420 { 421 triggerEffects(createDep(effects)); 422 } 423 } 424} 425function triggerEffects(dep, debuggerEventExtraInfo) { 426 const effects = isArray(dep) ? dep : [...dep]; 427 for (const effect of effects) { 428 if (effect.computed) { 429 triggerEffect(effect); 430 } 431 } 432 for (const effect of effects) { 433 if (!effect.computed) { 434 triggerEffect(effect); 435 } 436 } 437} 438function triggerEffect(effect, debuggerEventExtraInfo) { 439 if (effect !== activeEffect || effect.allowRecurse) { 440 if (effect.scheduler) { 441 effect.scheduler(); 442 } else { 443 effect.run(); 444 } 445 } 446} 447const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); 448const builtInSymbols = new Set( 449 /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) 450); 451const get = /* @__PURE__ */ createGetter(); 452const shallowGet = /* @__PURE__ */ createGetter(false, true); 453const readonlyGet = /* @__PURE__ */ createGetter(true); 454const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations(); 455function createArrayInstrumentations() { 456 const instrumentations = {}; 457 ["includes", "indexOf", "lastIndexOf"].forEach((key) => { 458 instrumentations[key] = function(...args) { 459 const arr = toRaw(this); 460 for (let i = 0, l = this.length; i < l; i++) { 461 track(arr, "get", i + ""); 462 } 463 const res = arr[key](...args); 464 if (res === -1 || res === false) { 465 return arr[key](...args.map(toRaw)); 466 } else { 467 return res; 468 } 469 }; 470 }); 471 ["push", "pop", "shift", "unshift", "splice"].forEach((key) => { 472 instrumentations[key] = function(...args) { 473 pauseTracking(); 474 const res = toRaw(this)[key].apply(this, args); 475 resetTracking(); 476 return res; 477 }; 478 }); 479 return instrumentations; 480} 481function createGetter(isReadonly2 = false, shallow = false) { 482 return function get2(target, key, receiver) { 483 if (key === "__v_isReactive") { 484 return !isReadonly2; 485 } else if (key === "__v_isReadonly") { 486 return isReadonly2; 487 } else if (key === "__v_isShallow") { 488 return shallow; 489 } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) { 490 return target; 491 } 492 const targetIsArray = isArray(target); 493 if (!isReadonly2 && targetIsArray && hasOwn(arrayInstrumentations, key)) { 494 return Reflect.get(arrayInstrumentations, key, receiver); 495 } 496 const res = Reflect.get(target, key, receiver);
497 if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { 498 return res; 499 } 500 if (!isReadonly2) { 501 track(target, "get", key); 502 } 503 if (shallow) { 504 return res; 505 } 506 if (isRef(res)) { 507 return targetIsArray && isIntegerKey(key) ? res : res.value; 508 } 509 if (isObject(res)) { 510 return isReadonly2 ? readonly(res) : reactive(res); 511 } 512 return res; 513 }; 514} 515const set = /* @__PURE__ */ createSetter(); 516const shallowSet = /* @__PURE__ */ createSetter(true); 517function createSetter(shallow = false) { 518 return function set2(target, key, value, receiver) { 519 let oldValue = target[key]; 520 if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) { 521 return false; 522 } 523 if (!shallow) { 524 if (!isShallow(value) && !isReadonly(value)) { 525 oldValue = toRaw(oldValue); 526 value = toRaw(value); 527 } 528 if (!isArray(target) && isRef(oldValue) && !isRef(value)) { 529 oldValue.value = value; 530 return true; 531 } 532 } 533 const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key); 534 const result = Reflect.set(target, key, value, receiver); 535 if (target === toRaw(receiver)) { 536 if (!hadKey) { 537 trigger(target, "add", key, value); 538 } else if (hasChanged(value, oldValue)) { 539 trigger(target, "set", key, value); 540 } 541 } 542 return result; 543 }; 544} 545function deleteProperty(target, key) { 546 const hadKey = hasOwn(target, key); 547 target[key]; 548 const result = Reflect.deleteProperty(target, key); 549 if (result && hadKey) { 550 trigger(target, "delete", key, void 0); 551 } 552 return result; 553} 554function has(target, key) { 555 const result = Reflect.has(target, key); 556 if (!isSymbol(key) || !builtInSymbols.has(key)) { 557 track(target, "has", key); 558 } 559 return result; 560} 561function ownKeys(target) { 562 track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY); 563 return Reflect.ownKeys(target); 564} 565const mutableHandlers = { 566 get, 567 set, 568 deleteProperty, 569 has, 570 ownKeys 571}; 572const readonlyHandlers = { 573 get: readonlyGet, 574 set(target, key) { 575 return true; 576 }, 577 deleteProperty(target, key) { 578 return true; 579 } 580}; 581const shallowReactiveHandlers = /* @__PURE__ */ extend({}, mutableHandlers, { 582 get: shallowGet, 583 set: shallowSet 584}); 585const toShallow = (value) => value; 586const getProto = (v) => Reflect.getPrototypeOf(v); 587function get$1(target, key, isReadonly2 = false, isShallow2 = false) { 588 target = target["__v_raw"]; 589 const rawTarget = toRaw(target); 590 const rawKey = toRaw(key); 591 if (!isReadonly2) { 592 if (key !== rawKey) { 593 track(rawTarget, "get", key); 594 } 595 track(rawTarget, "get", rawKey); 596 } 597 const { has: has2 } = getProto(rawTarget); 598 const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; 599 if (has2.call(rawTarget, key)) { 600 return wrap(target.get(key)); 601 } else if (has2.call(rawTarget, rawKey)) { 602 return wrap(target.get(rawKey)); 603 } else if (target !== rawTarget) { 604 target.get(key); 605 } 606} 607function has$1(key, isReadonly2 = false) { 608 const target = this["__v_raw"]; 609 const rawTarget = toRaw(target); 610 const rawKey = toRaw(key); 611 if (!isReadonly2) { 612 if (key !== rawKey) { 613 track(rawTarget, "has", key); 614 } 615 track(rawTarget, "has", rawKey); 616 } 617 return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); 618} 619function size(target, isReadonly2 = false) { 620 target = target["__v_raw"]; 621 !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY); 622 return Reflect.get(target, "size", target); 623} 624function add(value) { 625 value = toRaw(value); 626 const target = toRaw(this); 627 const proto = getProto(target); 628 const hadKey = proto.has.call(target, value); 629 if (!hadKey) { 630 target.add(value); 631 trigger(target, "add", value, value); 632 } 633 return this; 634} 635function set$1(key, value) { 636 value = toRaw(value); 637 const target = toRaw(this); 638 const { has: has2, get: get2 } = getProto(target); 639 let hadKey = has2.call(target, key); 640 if (!hadKey) { 641 key = toRaw(key); 642 hadKey = has2.call(target, key); 643 } 644 const oldValue = get2.call(target, key); 645 target.set(key, value); 646 if (!hadKey) { 647 trigger(target, "add", key, value); 648 } else if (hasChanged(value, oldValue)) { 649 trigger(target, "set", key, value); 650 } 651 return this; 652} 653function deleteEntry(key) { 654 const target = toRaw(this); 655 const { has: has2, get: get2 } = getProto(target); 656 let hadKey = has2.call(target, key); 657 if (!hadKey) { 658 key = toRaw(key); 659 hadKey = has2.call(target, key); 660 } 661 get2 ? get2.call(target, key) : void 0; 662 const result = target.delete(key); 663 if (hadKey) { 664 trigger(target, "delete", key, void 0); 665 } 666 return result; 667} 668function clear() { 669 const target = toRaw(this); 670 const hadItems = target.size !== 0; 671 const result = target.clear(); 672 if (hadItems) { 673 trigger(target, "clear", void 0, void 0); 674 } 675 return result; 676} 677function createForEach(isReadonly2, isShallow2) { 678 return function forEach(callback, thisArg) { 679 const observed = this; 680 const target = observed["__v_raw"]; 681 const rawTarget = toRaw(target); 682 const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; 683 !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY); 684 return target.forEach((value, key) => { 685 return callback.call(thisArg, wrap(value), wrap(key), observed); 686 }); 687 }; 688} 689function createIterableMethod(method, isReadonly2, isShallow2) { 690 return function(...args) { 691 const target = this["__v_raw"]; 692 const rawTarget = toRaw(target); 693 const targetIsMap = isMap(rawTarget); 694 const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; 695 const isKeyOnly = method === "keys" && targetIsMap; 696 const innerIterator = target[method](...args); 697 const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; 698 !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY); 699 return { 700 next() { 701 const { value, done } = innerIterator.next(); 702 return done ? { value, done } : { 703 value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
704 done 705 }; 706 }, 707 [Symbol.iterator]() { 708 return this; 709 } 710 }; 711 }; 712} 713function createReadonlyMethod(type) { 714 return function(...args) { 715 return type === "delete" ? false : this; 716 }; 717} 718function createInstrumentations() { 719 const mutableInstrumentations2 = { 720 get(key) { 721 return get$1(this, key); 722 }, 723 get size() { 724 return size(this); 725 }, 726 has: has$1, 727 add, 728 set: set$1, 729 delete: deleteEntry, 730 clear, 731 forEach: createForEach(false, false) 732 }; 733 const shallowInstrumentations2 = { 734 get(key) { 735 return get$1(this, key, false, true); 736 }, 737 get size() { 738 return size(this); 739 }, 740 has: has$1, 741 add, 742 set: set$1, 743 delete: deleteEntry, 744 clear, 745 forEach: createForEach(false, true) 746 }; 747 const readonlyInstrumentations2 = { 748 get(key) { 749 return get$1(this, key, true); 750 }, 751 get size() { 752 return size(this, true); 753 }, 754 has(key) { 755 return has$1.call(this, key, true); 756 }, 757 add: createReadonlyMethod("add"), 758 set: createReadonlyMethod("set"), 759 delete: createReadonlyMethod("delete"), 760 clear: createReadonlyMethod("clear"), 761 forEach: createForEach(true, false) 762 }; 763 const shallowReadonlyInstrumentations2 = { 764 get(key) { 765 return get$1(this, key, true, true); 766 }, 767 get size() { 768 return size(this, true); 769 }, 770 has(key) { 771 return has$1.call(this, key, true); 772 }, 773 add: createReadonlyMethod("add"), 774 set: createReadonlyMethod("set"), 775 delete: createReadonlyMethod("delete"), 776 clear: createReadonlyMethod("clear"), 777 forEach: createForEach(true, true) 778 }; 779 const iteratorMethods = ["keys", "values", "entries", Symbol.iterator]; 780 iteratorMethods.forEach((method) => { 781 mutableInstrumentations2[method] = createIterableMethod(method, false, false); 782 readonlyInstrumentations2[method] = createIterableMethod(method, true, false); 783 shallowInstrumentations2[method] = createIterableMethod(method, false, true); 784 shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true); 785 }); 786 return [ 787 mutableInstrumentations2, 788 readonlyInstrumentations2, 789 shallowInstrumentations2, 790 shallowReadonlyInstrumentations2 791 ]; 792} 793const [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations(); 794function createInstrumentationGetter(isReadonly2, shallow) { 795 const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations; 796 return (target, key, receiver) => { 797 if (key === "__v_isReactive") { 798 return !isReadonly2; 799 } else if (key === "__v_isReadonly") { 800 return isReadonly2; 801 } else if (key === "__v_raw") { 802 return target; 803 } 804 return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver); 805 }; 806} 807const mutableCollectionHandlers = { 808 get: /* @__PURE__ */ createInstrumentationGetter(false, false) 809}; 810const shallowCollectionHandlers = { 811 get: /* @__PURE__ */ createInstrumentationGetter(false, true) 812}; 813const readonlyCollectionHandlers = { 814 get: /* @__PURE__ */ createInstrumentationGetter(true, false) 815}; 816const reactiveMap = /* @__PURE__ */ new WeakMap(); 817const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); 818const readonlyMap = /* @__PURE__ */ new WeakMap(); 819const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); 820function targetTypeMap(rawType) { 821 switch (rawType) { 822 case "Object": 823 case "Array": 824 return 1; 825 case "Map": 826 case "Set": 827 case "WeakMap": 828 case "WeakSet": 829 return 2; 830 default: 831 return 0; 832 } 833} 834function getTargetType(value) { 835 return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value)); 836} 837function reactive(target) { 838 if (isReadonly(target)) { 839 return target; 840 } 841 return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap); 842} 843function shallowReactive(target) { 844 return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap); 845} 846function readonly(target) { 847 return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap); 848} 849function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { 850 if (!isObject(target)) { 851 return target; 852 } 853 if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { 854 return target; 855 } 856 const existingProxy = proxyMap.get(target); 857 if (existingProxy) { 858 return existingProxy; 859 } 860 const targetType = getTargetType(target); 861 if (targetType === 0) { 862 return target; 863 } 864 const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers); 865 proxyMap.set(target, proxy); 866 return proxy; 867} 868function isReactive(value) { 869 if (isReadonly(value)) { 870 return isReactive(value["__v_raw"]); 871 } 872 return !!(value && value["__v_isReactive"]); 873} 874function isReadonly(value) { 875 return !!(value && value["__v_isReadonly"]); 876} 877function isShallow(value) { 878 return !!(value && value["__v_isShallow"]); 879} 880function isProxy(value) { 881 return isReactive(value) || isReadonly(value); 882} 883function toRaw(observed) { 884 const raw = observed && observed["__v_raw"]; 885 return raw ? toRaw(raw) : observed; 886} 887function markRaw(value) { 888 def(value, "__v_skip", true); 889 return value; 890} 891const toReactive = (value) => isObject(value) ? reactive(value) : value; 892const toReadonly = (value) => isObject(value) ? readonly(value) : value; 893function trackRefValue(ref2) { 894 if (shouldTrack && activeEffect) { 895 ref2 = toRaw(ref2); 896 { 897 trackEffects(ref2.dep || (ref2.dep = createDep())); 898 } 899 } 900} 901function triggerRefValue(ref2, newVal) { 902 ref2 = toRaw(ref2); 903 if (ref2.dep) { 904 { 905 triggerEffects(ref2.dep); 906 } 907 } 908} 909function isRef(r) { 910 return !!(r && r.__v_isRef === true); 911} 912function ref(value) { 913 return createRef(value, false); 914} 915function createRef(rawValue, shallow) { 916 if (isRef(rawValue)) { 917 return rawValue; 918 } 919 return new RefImpl(rawValue, shallow); 920} 921class RefImpl {
922 constructor(value, __v_isShallow) { 923 this.__v_isShallow = __v_isShallow; 924 this.dep = void 0; 925 this.__v_isRef = true; 926 this._rawValue = __v_isShallow ? value : toRaw(value); 927 this._value = __v_isShallow ? value : toReactive(value); 928 } 929 get value() { 930 trackRefValue(this); 931 return this._value; 932 } 933 set value(newVal) { 934 const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal); 935 newVal = useDirectValue ? newVal : toRaw(newVal); 936 if (hasChanged(newVal, this._rawValue)) { 937 this._rawValue = newVal; 938 this._value = useDirectValue ? newVal : toReactive(newVal); 939 triggerRefValue(this); 940 } 941 } 942} 943function unref(ref2) { 944 return isRef(ref2) ? ref2.value : ref2; 945} 946const shallowUnwrapHandlers = { 947 get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)), 948 set: (target, key, value, receiver) => { 949 const oldValue = target[key]; 950 if (isRef(oldValue) && !isRef(value)) { 951 oldValue.value = value; 952 return true; 953 } else { 954 return Reflect.set(target, key, value, receiver); 955 } 956 } 957}; 958function proxyRefs(objectWithRefs) { 959 return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); 960} 961var _a; 962class ComputedRefImpl { 963 constructor(getter, _setter, isReadonly2, isSSR) { 964 this._setter = _setter; 965 this.dep = void 0; 966 this.__v_isRef = true; 967 this[_a] = false; 968 this._dirty = true; 969 this.effect = new ReactiveEffect(getter, () => { 970 if (!this._dirty) { 971 this._dirty = true; 972 triggerRefValue(this); 973 } 974 }); 975 this.effect.computed = this; 976 this.effect.active = this._cacheable = !isSSR; 977 this["__v_isReadonly"] = isReadonly2; 978 } 979 get value() { 980 const self2 = toRaw(this); 981 trackRefValue(self2); 982 if (self2._dirty || !self2._cacheable) { 983 self2._dirty = false; 984 self2._value = self2.effect.run(); 985 } 986 return self2._value; 987 } 988 set value(newValue) { 989 this._setter(newValue); 990 } 991} 992_a = "__v_isReadonly"; 993function computed$1(getterOrOptions, debugOptions, isSSR = false) { 994 let getter; 995 let setter; 996 const onlyGetter = isFunction(getterOrOptions); 997 if (onlyGetter) { 998 getter = getterOrOptions; 999 setter = NOOP; 1000 } else { 1001 getter = getterOrOptions.get; 1002 setter = getterOrOptions.set; 1003 } 1004 const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR); 1005 return cRef; 1006} 1007const stack = []; 1008function warn(msg, ...args) { 1009 pauseTracking(); 1010 const instance = stack.length ? stack[stack.length - 1].component : null; 1011 const appWarnHandler = instance && instance.appContext.config.warnHandler; 1012 const trace = getComponentTrace(); 1013 if (appWarnHandler) { 1014 callWithErrorHandling(appWarnHandler, instance, 11, [ 1015 msg + args.join(""), 1016 instance && instance.proxy, 1017 trace.map(({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`).join("\n"), 1018 trace 1019 ]); 1020 } else { 1021 const warnArgs = [`[Vue warn]: ${msg}`, ...args]; 1022 if (trace.length && true) { 1023 warnArgs.push(` 1024`, ...formatTrace(trace)); 1025 } 1026 console.warn(...warnArgs); 1027 } 1028 resetTracking(); 1029} 1030function getComponentTrace() { 1031 let currentVNode = stack[stack.length - 1]; 1032 if (!currentVNode) { 1033 return []; 1034 } 1035 const normalizedStack = []; 1036 while (currentVNode) { 1037 const last = normalizedStack[0]; 1038 if (last && last.vnode === currentVNode) { 1039 last.recurseCount++; 1040 } else { 1041 normalizedStack.push({ 1042 vnode: currentVNode, 1043 recurseCount: 0 1044 }); 1045 } 1046 const parentInstance = currentVNode.component && currentVNode.component.parent; 1047 currentVNode = parentInstance && parentInstance.vnode; 1048 } 1049 return normalizedStack; 1050} 1051function formatTrace(trace) { 1052 const logs = []; 1053 trace.forEach((entry, i) => { 1054 logs.push(...i === 0 ? [] : [` 1055`], ...formatTraceEntry(entry)); 1056 }); 1057 return logs; 1058} 1059function formatTraceEntry({ vnode, recurseCount }) { 1060 const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; 1061 const isRoot = vnode.component ? vnode.component.parent == null : false;
1062 const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`; 1063 const close = `>` + postfix; 1064 return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; 1065} 1066function formatProps(props) { 1067 const res = []; 1068 const keys = Object.keys(props); 1069 keys.slice(0, 3).forEach((key) => { 1070 res.push(...formatProp(key, props[key])); 1071 }); 1072 if (keys.length > 3) { 1073 res.push(` ...`); 1074 } 1075 return res; 1076} 1077function formatProp(key, value, raw) { 1078 if (isString(value)) { 1079 value = JSON.stringify(value); 1080 return raw ? value : [`${key}=${value}`]; 1081 } else if (typeof value === "number" || typeof value === "boolean" || value == null) { 1082 return raw ? value : [`${key}=${value}`]; 1083 } else if (isRef(value)) { 1084 value = formatProp(key, toRaw(value.value), true); 1085 return raw ? value : [`${key}=Ref<`, value, `>`]; 1086 } else if (isFunction(value)) { 1087 return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; 1088 } else { 1089 value = toRaw(value); 1090 return raw ? value : [`${key}=`, value]; 1091 } 1092} 1093function callWithErrorHandling(fn, instance, type, args) { 1094 let res; 1095 try { 1096 res = args ? fn(...args) : fn(); 1097 } catch (err) { 1098 handleError(err, instance, type); 1099 } 1100 return res; 1101} 1102function callWithAsyncErrorHandling(fn, instance, type, args) { 1103 if (isFunction(fn)) { 1104 const res = callWithErrorHandling(fn, instance, type, args); 1105 if (res && isPromise(res)) { 1106 res.catch((err) => { 1107 handleError(err, instance, type); 1108 }); 1109 } 1110 return res; 1111 } 1112 const values = []; 1113 for (let i = 0; i < fn.length; i++) { 1114 values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); 1115 } 1116 return values; 1117} 1118function handleError(err, instance, type, throwInDev = true) { 1119 const contextVNode = instance ? instance.vnode : null; 1120 if (instance) { 1121 let cur = instance.parent; 1122 const exposedInstance = instance.proxy; 1123 const errorInfo = type; 1124 while (cur) {
1125 const errorCapturedHooks = cur.ec; 1126 if (errorCapturedHooks) { 1127 for (let i = 0; i < errorCapturedHooks.length; i++) { 1128 if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { 1129 return; 1130 } 1131 } 1132 } 1133 cur = cur.parent; 1134 } 1135 const appErrorHandler = instance.appContext.config.errorHandler; 1136 if (appErrorHandler) { 1137 callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]); 1138 return; 1139 } 1140 } 1141 logError(err, type, contextVNode, throwInDev); 1142} 1143function logError(err, type, contextVNode, throwInDev = true) { 1144 { 1145 console.error(err); 1146 } 1147} 1148let isFlushing = false; 1149let isFlushPending = false; 1150const queue = []; 1151let flushIndex = 0; 1152const pendingPostFlushCbs = []; 1153let activePostFlushCbs = null; 1154let postFlushIndex = 0; 1155const resolvedPromise = /* @__PURE__ */ Promise.resolve(); 1156let currentFlushPromise = null; 1157function nextTick(fn) { 1158 const p = currentFlushPromise || resolvedPromise; 1159 return fn ? p.then(this ? fn.bind(this) : fn) : p; 1160} 1161function findInsertionIndex(id) { 1162 let start = flushIndex + 1; 1163 let end = queue.length; 1164 while (start < end) { 1165 const middle = start + end >>> 1; 1166 const middleJobId = getId(queue[middle]); 1167 middleJobId < id ? start = middle + 1 : end = middle; 1168 } 1169 return start; 1170} 1171function queueJob(job) { 1172 if (!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) { 1173 if (job.id == null) { 1174 queue.push(job); 1175 } else { 1176 queue.splice(findInsertionIndex(job.id), 0, job); 1177 } 1178 queueFlush(); 1179 } 1180} 1181function queueFlush() { 1182 if (!isFlushing && !isFlushPending) { 1183 isFlushPending = true; 1184 currentFlushPromise = resolvedPromise.then(flushJobs); 1185 } 1186}
1187function invalidateJob(job) { 1188 const i = queue.indexOf(job); 1189 if (i > flushIndex) { 1190 queue.splice(i, 1); 1191 } 1192} 1193function queuePostFlushCb(cb) { 1194 if (!isArray(cb)) { 1195 if (!activePostFlushCbs || !activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) { 1196 pendingPostFlushCbs.push(cb); 1197 } 1198 } else { 1199 pendingPostFlushCbs.push(...cb); 1200 } 1201 queueFlush(); 1202} 1203function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) { 1204 for (; i < queue.length; i++) { 1205 const cb = queue[i]; 1206 if (cb && cb.pre) { 1207 queue.splice(i, 1); 1208 i--; 1209 cb(); 1210 } 1211 } 1212} 1213function flushPostFlushCbs(seen) { 1214 if (pendingPostFlushCbs.length) { 1215 const deduped = [...new Set(pendingPostFlushCbs)]; 1216 pendingPostFlushCbs.length = 0; 1217 if (activePostFlushCbs) { 1218 activePostFlushCbs.push(...deduped); 1219 return; 1220 } 1221 activePostFlushCbs = deduped; 1222 activePostFlushCbs.sort((a, b) => getId(a) - getId(b)); 1223 for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { 1224 activePostFlushCbs[postFlushIndex](); 1225 } 1226 activePostFlushCbs = null; 1227 postFlushIndex = 0; 1228 } 1229} 1230const getId = (job) => job.id == null ? Infinity : job.id; 1231const comparator = (a, b) => { 1232 const diff = getId(a) - getId(b); 1233 if (diff === 0) { 1234 if (a.pre && !b.pre) 1235 return -1; 1236 if (b.pre && !a.pre) 1237 return 1; 1238 } 1239 return diff; 1240}; 1241function flushJobs(seen) { 1242 isFlushPending = false; 1243 isFlushing = true; 1244 queue.sort(comparator); 1245 const check = NOOP; 1246 try { 1247 for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { 1248 const job = queue[flushIndex]; 1249 if (job && job.active !== false) { 1250 if (false) 1251 ; 1252 callWithErrorHandling(job, null, 14); 1253 } 1254 } 1255 } finally { 1256 flushIndex = 0; 1257 queue.length = 0; 1258 flushPostFlushCbs(); 1259 isFlushing = false; 1260 currentFlushPromise = null; 1261 if (queue.length || pendingPostFlushCbs.length) { 1262 flushJobs(); 1263 } 1264 } 1265} 1266function emit$1(instance, event, ...rawArgs) { 1267 if (instance.isUnmounted) 1268 return; 1269 const props = instance.vnode.props || EMPTY_OBJ; 1270 let args = rawArgs; 1271 const isModelListener2 = event.startsWith("update:"); 1272 const modelArg = isModelListener2 && event.slice(7); 1273 if (modelArg && modelArg in props) { 1274 const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`; 1275 const { number, trim } = props[modifiersKey] || EMPTY_OBJ; 1276 if (trim) { 1277 args = rawArgs.map((a) => a.trim()); 1278 } 1279 if (number) { 1280 args = rawArgs.map(toNumber); 1281 } 1282 } 1283 let handlerName; 1284 let handler = props[handlerName = toHandlerKey(event)] || props[handlerName = toHandlerKey(camelize(event))]; 1285 if (!handler && isModelListener2) { 1286 handler = props[handlerName = toHandlerKey(hyphenate(event))]; 1287 } 1288 if (handler) { 1289 callWithAsyncErrorHandling(handler, instance, 6, args); 1290 } 1291 const onceHandler = props[handlerName + `Once`]; 1292 if (onceHandler) { 1293 if (!instance.emitted) { 1294 instance.emitted = {}; 1295 } else if (instance.emitted[handlerName]) { 1296 return; 1297 } 1298 instance.emitted[handlerName] = true; 1299 callWithAsyncErrorHandling(onceHandler, instance, 6, args); 1300 } 1301} 1302function normalizeEmitsOptions(comp, appContext, asMixin = false) { 1303 const cache = appContext.emitsCache; 1304 const cached = cache.get(comp); 1305 if (cached !== void 0) { 1306 return cached; 1307 } 1308 const raw = comp.emits; 1309 let normalized = {}; 1310 let hasExtends = false; 1311 if (!isFunction(comp)) { 1312 const extendEmits = (raw2) => { 1313 const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); 1314 if (normalizedFromExtend) { 1315 hasExtends = true; 1316 extend(normalized, normalizedFromExtend); 1317 } 1318 }; 1319 if (!asMixin && appContext.mixins.length) { 1320 appContext.mixins.forEach(extendEmits); 1321 } 1322 if (comp.extends) { 1323 extendEmits(comp.extends); 1324 } 1325 if (comp.mixins) { 1326 comp.mixins.forEach(extendEmits); 1327 } 1328 } 1329 if (!raw && !hasExtends) { 1330 if (isObject(comp)) { 1331 cache.set(comp, null); 1332 } 1333 return null; 1334 } 1335 if (isArray(raw)) { 1336 raw.forEach((key) => normalized[key] = null); 1337 } else { 1338 extend(normalized, raw); 1339 } 1340 if (isObject(comp)) { 1341 cache.set(comp, normalized); 1342 } 1343 return normalized; 1344} 1345function isEmitListener(options, key) { 1346 if (!options || !isOn(key)) { 1347 return false;
vendor: 4,140 bytes, lines 1348-1486
1348 } 1349 key = key.slice(2).replace(/Once$/, ""); 1350 return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key); 1351} 1352let currentRenderingInstance = null; 1353let currentScopeId = null; 1354function setCurrentRenderingInstance(instance) { 1355 const prev = currentRenderingInstance; 1356 currentRenderingInstance = instance; 1357 currentScopeId = instance && instance.type.__scopeId || null; 1358 return prev; 1359} 1360function pushScopeId(id) { 1361 currentScopeId = id; 1362} 1363function popScopeId() { 1364 currentScopeId = null; 1365} 1366function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { 1367 if (!ctx) 1368 return fn; 1369 if (fn._n) { 1370 return fn; 1371 } 1372 const renderFnWithContext = (...args) => { 1373 if (renderFnWithContext._d) { 1374 setBlockTracking(-1); 1375 } 1376 const prevInstance = setCurrentRenderingInstance(ctx); 1377 let res; 1378 try { 1379 res = fn(...args); 1380 } finally { 1381 setCurrentRenderingInstance(prevInstance); 1382 if (renderFnWithContext._d) { 1383 setBlockTracking(1); 1384 } 1385 } 1386 return res; 1387 }; 1388 renderFnWithContext._n = true; 1389 renderFnWithContext._c = true; 1390 renderFnWithContext._d = true; 1391 return renderFnWithContext; 1392} 1393function markAttrsAccessed() { 1394} 1395function renderComponentRoot(instance) { 1396 const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx, inheritAttrs } = instance; 1397 let result; 1398 let fallthroughAttrs; 1399 const prev = setCurrentRenderingInstance(instance); 1400 try { 1401 if (vnode.shapeFlag & 4) { 1402 const proxyToUse = withProxy || proxy; 1403 result = normalizeVNode(render.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx)); 1404 fallthroughAttrs = attrs; 1405 } else { 1406 const render2 = Component; 1407 if (false) 1408 ; 1409 result = normalizeVNode(render2.length > 1 ? render2(props, false ? { 1410 get attrs() { 1411 markAttrsAccessed(); 1412 return attrs; 1413 }, 1414 slots, 1415 emit 1416 } : { attrs, slots, emit }) : render2(props, null)); 1417 fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); 1418 } 1419 } catch (err) { 1420 blockStack.length = 0; 1421 handleError(err, instance, 1); 1422 result = createVNode(Comment); 1423 } 1424 let root = result; 1425 if (fallthroughAttrs && inheritAttrs !== false) { 1426 const keys = Object.keys(fallthroughAttrs); 1427 const { shapeFlag } = root; 1428 if (keys.length) { 1429 if (shapeFlag & (1 | 6)) { 1430 if (propsOptions && keys.some(isModelListener)) { 1431 fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions); 1432 } 1433 root = cloneVNode(root, fallthroughAttrs); 1434 } 1435 } 1436 } 1437 if (vnode.dirs) { 1438 root = cloneVNode(root); 1439 root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; 1440 } 1441 if (vnode.transition) { 1442 root.transition = vnode.transition; 1443 } 1444 { 1445 result = root; 1446 } 1447 setCurrentRenderingInstance(prev); 1448 return result; 1449} 1450const getFunctionalFallthrough = (attrs) => { 1451 let res; 1452 for (const key in attrs) { 1453 if (key === "class" || key === "style" || isOn(key)) { 1454 (res || (res = {}))[key] = attrs[key]; 1455 } 1456 } 1457 return res; 1458}; 1459const filterModelListeners = (attrs, props) => { 1460 const res = {}; 1461 for (const key in attrs) { 1462 if (!isModelListener(key) || !(key.slice(9) in props)) { 1463 res[key] = attrs[key]; 1464 } 1465 } 1466 return res; 1467}; 1468function shouldUpdateComponent(prevVNode, nextVNode, optimized) { 1469 const { props: prevProps, children: prevChildren, component } = prevVNode; 1470 const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; 1471 const emits = component.emitsOptions; 1472 if (nextVNode.dirs || nextVNode.transition) { 1473 return true; 1474 } 1475 if (optimized && patchFlag >= 0) { 1476 if (patchFlag & 1024) { 1477 return true; 1478 } 1479 if (patchFlag & 16) { 1480 if (!prevProps) { 1481 return !!nextProps; 1482 } 1483 return hasPropsChanged(prevProps, nextProps, emits); 1484 } else if (patchFlag & 8) { 1485 const dynamicProps = nextVNode.dynamicProps; 1486 for (let i = 0; i < dynamicProps.length; i++) {
1487 const key = dynamicProps[i]; 1488 if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { 1489 return true; 1490 } 1491 } 1492 } 1493 } else { 1494 if (prevChildren || nextChildren) { 1495 if (!nextChildren || !nextChildren.$stable) { 1496 return true; 1497 } 1498 } 1499 if (prevProps === nextProps) { 1500 return false; 1501 } 1502 if (!prevProps) { 1503 return !!nextProps; 1504 } 1505 if (!nextProps) { 1506 return true; 1507 } 1508 return hasPropsChanged(prevProps, nextProps, emits); 1509 } 1510 return false; 1511} 1512function hasPropsChanged(prevProps, nextProps, emitsOptions) { 1513 const nextKeys = Object.keys(nextProps); 1514 if (nextKeys.length !== Object.keys(prevProps).length) { 1515 return true; 1516 } 1517 for (let i = 0; i < nextKeys.length; i++) { 1518 const key = nextKeys[i]; 1519 if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { 1520 return true; 1521 } 1522 } 1523 return false; 1524} 1525function updateHOCHostEl({ vnode, parent }, el) { 1526 while (parent && parent.subTree === vnode) { 1527 (vnode = parent.vnode).el = el; 1528 parent = parent.parent; 1529 } 1530} 1531const isSuspense = (type) => type.__isSuspense; 1532function queueEffectWithSuspense(fn, suspense) { 1533 if (suspense && suspense.pendingBranch) { 1534 if (isArray(fn)) { 1535 suspense.effects.push(...fn); 1536 } else { 1537 suspense.effects.push(fn); 1538 } 1539 } else { 1540 queuePostFlushCb(fn); 1541 } 1542} 1543function provide(key, value) { 1544 if (!currentInstance) 1545 ; 1546 else { 1547 let provides = currentInstance.provides; 1548 const parentProvides = currentInstance.parent && currentInstance.parent.provides; 1549 if (parentProvides === provides) { 1550 provides = currentInstance.provides = Object.create(parentProvides); 1551 } 1552 provides[key] = value; 1553 } 1554} 1555function inject(key, defaultValue, treatDefaultAsFactory = false) { 1556 const instance = currentInstance || currentRenderingInstance; 1557 if (instance) { 1558 const provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides; 1559 if (provides && key in provides) { 1560 return provides[key]; 1561 } else if (arguments.length > 1) { 1562 return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance.proxy) : defaultValue; 1563 } else 1564 ; 1565 } 1566} 1567function watchPostEffect(effect, options) { 1568 return doWatch(effect, null, { flush: "post" }); 1569} 1570const INITIAL_WATCHER_VALUE = {}; 1571function watch(source, cb, options) { 1572 return doWatch(source, cb, options); 1573} 1574function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) { 1575 const instance = currentInstance; 1576 let getter; 1577 let forceTrigger = false; 1578 let isMultiSource = false;
1579 if (isRef(source)) { 1580 getter = () => source.value; 1581 forceTrigger = isShallow(source); 1582 } else if (isReactive(source)) { 1583 getter = () => source; 1584 deep = true; 1585 } else if (isArray(source)) { 1586 isMultiSource = true; 1587 forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); 1588 getter = () => source.map((s) => { 1589 if (isRef(s)) { 1590 return s.value; 1591 } else if (isReactive(s)) { 1592 return traverse(s); 1593 } else if (isFunction(s)) { 1594 return callWithErrorHandling(s, instance, 2); 1595 } else 1596 ; 1597 }); 1598 } else if (isFunction(source)) { 1599 if (cb) { 1600 getter = () => callWithErrorHandling(source, instance, 2); 1601 } else { 1602 getter = () => { 1603 if (instance && instance.isUnmounted) { 1604 return; 1605 } 1606 if (cleanup) { 1607 cleanup(); 1608 } 1609 return callWithAsyncErrorHandling(source, instance, 3, [onCleanup]); 1610 }; 1611 } 1612 } else { 1613 getter = NOOP; 1614 } 1615 if (cb && deep) { 1616 const baseGetter = getter; 1617 getter = () => traverse(baseGetter()); 1618 } 1619 let cleanup; 1620 let onCleanup = (fn) => { 1621 cleanup = effect.onStop = () => { 1622 callWithErrorHandling(fn, instance, 4); 1623 }; 1624 }; 1625 if (isInSSRComponentSetup) { 1626 onCleanup = NOOP; 1627 if (!cb) { 1628 getter(); 1629 } else if (immediate) { 1630 callWithAsyncErrorHandling(cb, instance, 3, [ 1631 getter(), 1632 isMultiSource ? [] : void 0, 1633 onCleanup 1634 ]); 1635 } 1636 return NOOP; 1637 } 1638 let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE; 1639 const job = () => { 1640 if (!effect.active) { 1641 return; 1642 } 1643 if (cb) { 1644 const newValue = effect.run(); 1645 if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) { 1646 if (cleanup) { 1647 cleanup(); 1648 } 1649 callWithAsyncErrorHandling(cb, instance, 3, [ 1650 newValue, 1651 oldValue === INITIAL_WATCHER_VALUE ? void 0 : oldValue, 1652 onCleanup 1653 ]); 1654 oldValue = newValue; 1655 } 1656 } else { 1657 effect.run(); 1658 } 1659 }; 1660 job.allowRecurse = !!cb; 1661 let scheduler; 1662 if (flush === "sync") { 1663 scheduler = job; 1664 } else if (flush === "post") { 1665 scheduler = () => queuePostRenderEffect(job, instance && instance.suspense); 1666 } else { 1667 job.pre = true; 1668 if (instance) 1669 job.id = instance.uid; 1670 scheduler = () => queueJob(job); 1671 } 1672 const effect = new ReactiveEffect(getter, scheduler); 1673 if (cb) { 1674 if (immediate) { 1675 job(); 1676 } else { 1677 oldValue = effect.run(); 1678 } 1679 } else if (flush === "post") { 1680 queuePostRenderEffect(effect.run.bind(effect), instance && instance.suspense); 1681 } else { 1682 effect.run(); 1683 } 1684 return () => { 1685 effect.stop(); 1686 if (instance && instance.scope) { 1687 remove(instance.scope.effects, effect); 1688 } 1689 }; 1690} 1691function instanceWatch(source, value, options) { 1692 const publicThis = this.proxy; 1693 const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); 1694 let cb; 1695 if (isFunction(value)) { 1696 cb = value; 1697 } else { 1698 cb = value.handler; 1699 options = value; 1700 } 1701 const cur = currentInstance; 1702 setCurrentInstance(this); 1703 const res = doWatch(getter, cb.bind(publicThis), options); 1704 if (cur) { 1705 setCurrentInstance(cur); 1706 } else { 1707 unsetCurrentInstance(); 1708 } 1709 return res; 1710} 1711function createPathGetter(ctx, path) { 1712 const segments = path.split("."); 1713 return () => {
1714 let cur = ctx; 1715 for (let i = 0; i < segments.length && cur; i++) { 1716 cur = cur[segments[i]]; 1717 } 1718 return cur; 1719 }; 1720} 1721function traverse(value, seen) { 1722 if (!isObject(value) || value["__v_skip"]) { 1723 return value; 1724 } 1725 seen = seen || /* @__PURE__ */ new Set(); 1726 if (seen.has(value)) { 1727 return value; 1728 } 1729 seen.add(value); 1730 if (isRef(value)) { 1731 traverse(value.value, seen); 1732 } else if (isArray(value)) { 1733 for (let i = 0; i < value.length; i++) { 1734 traverse(value[i], seen); 1735 } 1736 } else if (isSet(value) || isMap(value)) { 1737 value.forEach((v) => { 1738 traverse(v, seen); 1739 }); 1740 } else if (isPlainObject(value)) { 1741 for (const key in value) { 1742 traverse(value[key], seen); 1743 } 1744 } 1745 return value; 1746} 1747function defineComponent(options) { 1748 return isFunction(options) ? { setup: options, name: options.name } : options; 1749} 1750const isAsyncWrapper = (i) => !!i.type.__asyncLoader; 1751const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; 1752function onActivated(hook, target) { 1753 registerKeepAliveHook(hook, "a", target); 1754} 1755function onDeactivated(hook, target) { 1756 registerKeepAliveHook(hook, "da", target); 1757} 1758function registerKeepAliveHook(hook, type, target = currentInstance) { 1759 const wrappedHook = hook.__wdc || (hook.__wdc = () => {
vendor: 24,561 bytes, lines 1760-2559
1760 let current = target; 1761 while (current) { 1762 if (current.isDeactivated) { 1763 return; 1764 } 1765 current = current.parent; 1766 } 1767 return hook(); 1768 }); 1769 injectHook(type, wrappedHook, target); 1770 if (target) { 1771 let current = target.parent; 1772 while (current && current.parent) { 1773 if (isKeepAlive(current.parent.vnode)) { 1774 injectToKeepAliveRoot(wrappedHook, type, target, current); 1775 } 1776 current = current.parent; 1777 } 1778 } 1779} 1780function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { 1781 const injected = injectHook(type, hook, keepAliveRoot, true); 1782 onUnmounted(() => { 1783 remove(keepAliveRoot[type], injected); 1784 }, target); 1785} 1786function injectHook(type, hook, target = currentInstance, prepend = false) { 1787 if (target) { 1788 const hooks = target[type] || (target[type] = []); 1789 const wrappedHook = hook.__weh || (hook.__weh = (...args) => { 1790 if (target.isUnmounted) { 1791 return; 1792 } 1793 pauseTracking(); 1794 setCurrentInstance(target); 1795 const res = callWithAsyncErrorHandling(hook, target, type, args); 1796 unsetCurrentInstance(); 1797 resetTracking(); 1798 return res; 1799 }); 1800 if (prepend) { 1801 hooks.unshift(wrappedHook); 1802 } else { 1803 hooks.push(wrappedHook); 1804 } 1805 return wrappedHook; 1806 } 1807} 1808const createHook = (lifecycle) => (hook, target = currentInstance) => (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target); 1809const onBeforeMount = createHook("bm"); 1810const onMounted = createHook("m"); 1811const onBeforeUpdate = createHook("bu"); 1812const onUpdated = createHook("u"); 1813const onBeforeUnmount = createHook("bum"); 1814const onUnmounted = createHook("um"); 1815const onServerPrefetch = createHook("sp"); 1816const onRenderTriggered = createHook("rtg"); 1817const onRenderTracked = createHook("rtc"); 1818function onErrorCaptured(hook, target = currentInstance) { 1819 injectHook("ec", hook, target); 1820} 1821function invokeDirectiveHook(vnode, prevVNode, instance, name) { 1822 const bindings = vnode.dirs; 1823 const oldBindings = prevVNode && prevVNode.dirs; 1824 for (let i = 0; i < bindings.length; i++) { 1825 const binding = bindings[i]; 1826 if (oldBindings) { 1827 binding.oldValue = oldBindings[i].value; 1828 } 1829 let hook = binding.dir[name]; 1830 if (hook) { 1831 pauseTracking(); 1832 callWithAsyncErrorHandling(hook, instance, 8, [ 1833 vnode.el, 1834 binding, 1835 vnode, 1836 prevVNode 1837 ]); 1838 resetTracking(); 1839 } 1840 } 1841} 1842const NULL_DYNAMIC_COMPONENT = Symbol(); 1843function renderList(source, renderItem, cache, index) { 1844 let ret; 1845 const cached = cache && cache[index]; 1846 if (isArray(source) || isString(source)) { 1847 ret = new Array(source.length); 1848 for (let i = 0, l = source.length; i < l; i++) { 1849 ret[i] = renderItem(source[i], i, void 0, cached && cached[i]); 1850 } 1851 } else if (typeof source === "number") { 1852 ret = new Array(source); 1853 for (let i = 0; i < source; i++) { 1854 ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]); 1855 } 1856 } else if (isObject(source)) { 1857 if (source[Symbol.iterator]) { 1858 ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i])); 1859 } else { 1860 const keys = Object.keys(source); 1861 ret = new Array(keys.length); 1862 for (let i = 0, l = keys.length; i < l; i++) { 1863 const key = keys[i]; 1864 ret[i] = renderItem(source[key], key, i, cached && cached[i]); 1865 } 1866 } 1867 } else { 1868 ret = []; 1869 } 1870 if (cache) { 1871 cache[index] = ret; 1872 } 1873 return ret; 1874} 1875function renderSlot(slots, name, props = {}, fallback, noSlotted) { 1876 if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) { 1877 return createVNode("slot", name === "default" ? null : { name }, fallback && fallback()); 1878 } 1879 let slot = slots[name]; 1880 if (slot && slot._c) { 1881 slot._d = false; 1882 } 1883 openBlock(); 1884 const validSlotContent = slot && ensureValidVNode(slot(props)); 1885 const rendered = createBlock(Fragment, { 1886 key: props.key || validSlotContent && validSlotContent.key || `_${name}` 1887 }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2); 1888 if (!noSlotted && rendered.scopeId) { 1889 rendered.slotScopeIds = [rendered.scopeId + "-s"]; 1890 } 1891 if (slot && slot._c) { 1892 slot._d = true; 1893 } 1894 return rendered; 1895} 1896function ensureValidVNode(vnodes) { 1897 return vnodes.some((child) => { 1898 if (!isVNode(child)) 1899 return true; 1900 if (child.type === Comment) 1901 return false; 1902 if (child.type === Fragment && !ensureValidVNode(child.children)) 1903 return false; 1904 return true; 1905 }) ? vnodes : null; 1906} 1907const getPublicInstance = (i) => { 1908 if (!i) 1909 return null; 1910 if (isStatefulComponent(i)) 1911 return getExposeProxy(i) || i.proxy; 1912 return getPublicInstance(i.parent); 1913}; 1914const publicPropertiesMap = /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), { 1915 $: (i) => i, 1916 $el: (i) => i.vnode.el, 1917 $data: (i) => i.data, 1918 $props: (i) => i.props, 1919 $attrs: (i) => i.attrs, 1920 $slots: (i) => i.slots, 1921 $refs: (i) => i.refs, 1922 $parent: (i) => getPublicInstance(i.parent), 1923 $root: (i) => getPublicInstance(i.root), 1924 $emit: (i) => i.emit, 1925 $options: (i) => resolveMergedOptions(i), 1926 $forceUpdate: (i) => i.f || (i.f = () => queueJob(i.update)), 1927 $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), 1928 $watch: (i) => instanceWatch.bind(i) 1929}); 1930const PublicInstanceProxyHandlers = { 1931 get({ _: instance }, key) { 1932 const { ctx, setupState, data, props, accessCache, type, appContext } = instance; 1933 let normalizedProps; 1934 if (key[0] !== "$") { 1935 const n = accessCache[key]; 1936 if (n !== void 0) { 1937 switch (n) { 1938 case 1: 1939 return setupState[key]; 1940 case 2: 1941 return data[key]; 1942 case 4: 1943 return ctx[key]; 1944 case 3: 1945 return props[key]; 1946 } 1947 } else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) { 1948 accessCache[key] = 1; 1949 return setupState[key]; 1950 } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { 1951 accessCache[key] = 2; 1952 return data[key]; 1953 } else if ((normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)) { 1954 accessCache[key] = 3; 1955 return props[key]; 1956 } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { 1957 accessCache[key] = 4; 1958 return ctx[key]; 1959 } else if (shouldCacheAccess) { 1960 accessCache[key] = 0; 1961 } 1962 } 1963 const publicGetter = publicPropertiesMap[key]; 1964 let cssModule, globalProperties; 1965 if (publicGetter) { 1966 if (key === "$attrs") { 1967 track(instance, "get", key); 1968 } 1969 return publicGetter(instance); 1970 } else if ((cssModule = type.__cssModules) && (cssModule = cssModule[key])) { 1971 return cssModule; 1972 } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { 1973 accessCache[key] = 4; 1974 return ctx[key]; 1975 } else if (globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)) { 1976 { 1977 return globalProperties[key]; 1978 } 1979 } else 1980 ; 1981 }, 1982 set({ _: instance }, key, value) { 1983 const { data, setupState, ctx } = instance; 1984 if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) { 1985 setupState[key] = value; 1986 return true; 1987 } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { 1988 data[key] = value; 1989 return true; 1990 } else if (hasOwn(instance.props, key)) { 1991 return false; 1992 } 1993 if (key[0] === "$" && key.slice(1) in instance) { 1994 return false; 1995 } else { 1996 { 1997 ctx[key] = value; 1998 } 1999 } 2000 return true; 2001 }, 2002 has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) { 2003 let normalizedProps; 2004 return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || setupState !== EMPTY_OBJ && hasOwn(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key); 2005 }, 2006 defineProperty(target, key, descriptor) { 2007 if (descriptor.get != null) { 2008 target._.accessCache[key] = 0; 2009 } else if (hasOwn(descriptor, "value")) { 2010 this.set(target, key, descriptor.value, null); 2011 } 2012 return Reflect.defineProperty(target, key, descriptor); 2013 } 2014}; 2015let shouldCacheAccess = true; 2016function applyOptions(instance) { 2017 const options = resolveMergedOptions(instance); 2018 const publicThis = instance.proxy; 2019 const ctx = instance.ctx; 2020 shouldCacheAccess = false; 2021 if (options.beforeCreate) { 2022 callHook(options.beforeCreate, instance, "bc"); 2023 } 2024 const { 2025 data: dataOptions, 2026 computed: computedOptions, 2027 methods, 2028 watch: watchOptions, 2029 provide: provideOptions, 2030 inject: injectOptions, 2031 created, 2032 beforeMount, 2033 mounted, 2034 beforeUpdate, 2035 updated, 2036 activated, 2037 deactivated, 2038 beforeDestroy, 2039 beforeUnmount, 2040 destroyed, 2041 unmounted, 2042 render, 2043 renderTracked, 2044 renderTriggered, 2045 errorCaptured, 2046 serverPrefetch, 2047 expose, 2048 inheritAttrs, 2049 components, 2050 directives, 2051 filters 2052 } = options; 2053 const checkDuplicateProperties = null; 2054 if (injectOptions) { 2055 resolveInjections(injectOptions, ctx, checkDuplicateProperties, instance.appContext.config.unwrapInjectedRef); 2056 } 2057 if (methods) { 2058 for (const key in methods) { 2059 const methodHandler = methods[key]; 2060 if (isFunction(methodHandler)) { 2061 { 2062 ctx[key] = methodHandler.bind(publicThis); 2063 } 2064 } 2065 } 2066 } 2067 if (dataOptions) { 2068 const data = dataOptions.call(publicThis, publicThis); 2069 if (!isObject(data)) 2070 ; 2071 else { 2072 instance.data = reactive(data); 2073 } 2074 } 2075 shouldCacheAccess = true; 2076 if (computedOptions) { 2077 for (const key in computedOptions) { 2078 const opt = computedOptions[key]; 2079 const get2 = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP; 2080 const set2 = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : NOOP; 2081 const c = computed({ 2082 get: get2, 2083 set: set2 2084 }); 2085 Object.defineProperty(ctx, key, { 2086 enumerable: true, 2087 configurable: true, 2088 get: () => c.value, 2089 set: (v) => c.value = v 2090 }); 2091 } 2092 } 2093 if (watchOptions) { 2094 for (const key in watchOptions) { 2095 createWatcher(watchOptions[key], ctx, publicThis, key); 2096 } 2097 } 2098 if (provideOptions) { 2099 const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions; 2100 Reflect.ownKeys(provides).forEach((key) => { 2101 provide(key, provides[key]); 2102 }); 2103 } 2104 if (created) { 2105 callHook(created, instance, "c"); 2106 } 2107 function registerLifecycleHook(register, hook) { 2108 if (isArray(hook)) { 2109 hook.forEach((_hook) => register(_hook.bind(publicThis))); 2110 } else if (hook) { 2111 register(hook.bind(publicThis)); 2112 } 2113 } 2114 registerLifecycleHook(onBeforeMount, beforeMount); 2115 registerLifecycleHook(onMounted, mounted); 2116 registerLifecycleHook(onBeforeUpdate, beforeUpdate); 2117 registerLifecycleHook(onUpdated, updated); 2118 registerLifecycleHook(onActivated, activated); 2119 registerLifecycleHook(onDeactivated, deactivated); 2120 registerLifecycleHook(onErrorCaptured, errorCaptured); 2121 registerLifecycleHook(onRenderTracked, renderTracked); 2122 registerLifecycleHook(onRenderTriggered, renderTriggered); 2123 registerLifecycleHook(onBeforeUnmount, beforeUnmount); 2124 registerLifecycleHook(onUnmounted, unmounted); 2125 registerLifecycleHook(onServerPrefetch, serverPrefetch); 2126 if (isArray(expose)) { 2127 if (expose.length) { 2128 const exposed = instance.exposed || (instance.exposed = {}); 2129 expose.forEach((key) => { 2130 Object.defineProperty(exposed, key, { 2131 get: () => publicThis[key], 2132 set: (val) => publicThis[key] = val 2133 }); 2134 }); 2135 } else if (!instance.exposed) { 2136 instance.exposed = {}; 2137 } 2138 } 2139 if (render && instance.render === NOOP) { 2140 instance.render = render; 2141 } 2142 if (inheritAttrs != null) { 2143 instance.inheritAttrs = inheritAttrs; 2144 } 2145 if (components) 2146 instance.components = components; 2147 if (directives) 2148 instance.directives = directives; 2149} 2150function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP, unwrapRef = false) { 2151 if (isArray(injectOptions)) { 2152 injectOptions = normalizeInject(injectOptions); 2153 } 2154 for (const key in injectOptions) { 2155 const opt = injectOptions[key]; 2156 let injected; 2157 if (isObject(opt)) { 2158 if ("default" in opt) { 2159 injected = inject(opt.from || key, opt.default, true); 2160 } else { 2161 injected = inject(opt.from || key); 2162 } 2163 } else { 2164 injected = inject(opt); 2165 } 2166 if (isRef(injected)) { 2167 if (unwrapRef) { 2168 Object.defineProperty(ctx, key, { 2169 enumerable: true, 2170 configurable: true, 2171 get: () => injected.value, 2172 set: (v) => injected.value = v 2173 }); 2174 } else { 2175 ctx[key] = injected; 2176 } 2177 } else { 2178 ctx[key] = injected; 2179 } 2180 } 2181} 2182function callHook(hook, instance, type) { 2183 callWithAsyncErrorHandling(isArray(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy), instance, type); 2184} 2185function createWatcher(raw, ctx, publicThis, key) { 2186 const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; 2187 if (isString(raw)) { 2188 const handler = ctx[raw]; 2189 if (isFunction(handler)) { 2190 watch(getter, handler); 2191 } 2192 } else if (isFunction(raw)) { 2193 watch(getter, raw.bind(publicThis)); 2194 } else if (isObject(raw)) { 2195 if (isArray(raw)) { 2196 raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); 2197 } else { 2198 const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; 2199 if (isFunction(handler)) { 2200 watch(getter, handler, raw); 2201 } 2202 } 2203 } else 2204 ; 2205} 2206function resolveMergedOptions(instance) { 2207 const base = instance.type; 2208 const { mixins, extends: extendsOptions } = base; 2209 const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext; 2210 const cached = cache.get(base); 2211 let resolved; 2212 if (cached) { 2213 resolved = cached; 2214 } else if (!globalMixins.length && !mixins && !extendsOptions) { 2215 { 2216 resolved = base; 2217 } 2218 } else { 2219 resolved = {}; 2220 if (globalMixins.length) { 2221 globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true)); 2222 } 2223 mergeOptions(resolved, base, optionMergeStrategies); 2224 } 2225 if (isObject(base)) { 2226 cache.set(base, resolved); 2227 } 2228 return resolved; 2229} 2230function mergeOptions(to, from, strats, asMixin = false) { 2231 const { mixins, extends: extendsOptions } = from; 2232 if (extendsOptions) { 2233 mergeOptions(to, extendsOptions, strats, true); 2234 } 2235 if (mixins) { 2236 mixins.forEach((m) => mergeOptions(to, m, strats, true)); 2237 } 2238 for (const key in from) { 2239 if (asMixin && key === "expose") 2240 ; 2241 else { 2242 const strat = internalOptionMergeStrats[key] || strats && strats[key]; 2243 to[key] = strat ? strat(to[key], from[key]) : from[key]; 2244 } 2245 } 2246 return to; 2247} 2248const internalOptionMergeStrats = { 2249 data: mergeDataFn, 2250 props: mergeObjectOptions, 2251 emits: mergeObjectOptions, 2252 methods: mergeObjectOptions, 2253 computed: mergeObjectOptions, 2254 beforeCreate: mergeAsArray, 2255 created: mergeAsArray, 2256 beforeMount: mergeAsArray, 2257 mounted: mergeAsArray, 2258 beforeUpdate: mergeAsArray, 2259 updated: mergeAsArray, 2260 beforeDestroy: mergeAsArray, 2261 beforeUnmount: mergeAsArray, 2262 destroyed: mergeAsArray, 2263 unmounted: mergeAsArray, 2264 activated: mergeAsArray, 2265 deactivated: mergeAsArray, 2266 errorCaptured: mergeAsArray, 2267 serverPrefetch: mergeAsArray, 2268 components: mergeObjectOptions, 2269 directives: mergeObjectOptions, 2270 watch: mergeWatchOptions, 2271 provide: mergeDataFn, 2272 inject: mergeInject 2273}; 2274function mergeDataFn(to, from) { 2275 if (!from) { 2276 return to; 2277 } 2278 if (!to) { 2279 return from; 2280 } 2281 return function mergedDataFn() { 2282 return extend(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from); 2283 }; 2284} 2285function mergeInject(to, from) { 2286 return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); 2287} 2288function normalizeInject(raw) { 2289 if (isArray(raw)) { 2290 const res = {}; 2291 for (let i = 0; i < raw.length; i++) { 2292 res[raw[i]] = raw[i]; 2293 } 2294 return res; 2295 } 2296 return raw; 2297} 2298function mergeAsArray(to, from) { 2299 return to ? [...new Set([].concat(to, from))] : from; 2300} 2301function mergeObjectOptions(to, from) { 2302 return to ? extend(extend(/* @__PURE__ */ Object.create(null), to), from) : from; 2303} 2304function mergeWatchOptions(to, from) { 2305 if (!to) 2306 return from; 2307 if (!from) 2308 return to; 2309 const merged = extend(/* @__PURE__ */ Object.create(null), to); 2310 for (const key in from) { 2311 merged[key] = mergeAsArray(to[key], from[key]); 2312 } 2313 return merged; 2314} 2315function initProps(instance, rawProps, isStateful, isSSR = false) { 2316 const props = {}; 2317 const attrs = {}; 2318 def(attrs, InternalObjectKey, 1); 2319 instance.propsDefaults = /* @__PURE__ */ Object.create(null); 2320 setFullProps(instance, rawProps, props, attrs); 2321 for (const key in instance.propsOptions[0]) { 2322 if (!(key in props)) { 2323 props[key] = void 0; 2324 } 2325 } 2326 if (isStateful) { 2327 instance.props = isSSR ? props : shallowReactive(props); 2328 } else { 2329 if (!instance.type.props) { 2330 instance.props = attrs; 2331 } else { 2332 instance.props = props; 2333 } 2334 } 2335 instance.attrs = attrs; 2336} 2337function updateProps(instance, rawProps, rawPrevProps, optimized) { 2338 const { props, attrs, vnode: { patchFlag } } = instance; 2339 const rawCurrentProps = toRaw(props); 2340 const [options] = instance.propsOptions; 2341 let hasAttrsChanged = false; 2342 if ((optimized || patchFlag > 0) && !(patchFlag & 16)) { 2343 if (patchFlag & 8) { 2344 const propsToUpdate = instance.vnode.dynamicProps; 2345 for (let i = 0; i < propsToUpdate.length; i++) { 2346 let key = propsToUpdate[i]; 2347 if (isEmitListener(instance.emitsOptions, key)) { 2348 continue; 2349 } 2350 const value = rawProps[key]; 2351 if (options) { 2352 if (hasOwn(attrs, key)) { 2353 if (value !== attrs[key]) { 2354 attrs[key] = value; 2355 hasAttrsChanged = true; 2356 } 2357 } else { 2358 const camelizedKey = camelize(key); 2359 props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance, false); 2360 } 2361 } else { 2362 if (value !== attrs[key]) { 2363 attrs[key] = value; 2364 hasAttrsChanged = true; 2365 } 2366 } 2367 } 2368 } 2369 } else { 2370 if (setFullProps(instance, rawProps, props, attrs)) { 2371 hasAttrsChanged = true; 2372 } 2373 let kebabKey; 2374 for (const key in rawCurrentProps) { 2375 if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) { 2376 if (options) { 2377 if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) { 2378 props[key] = resolvePropValue(options, rawCurrentProps, key, void 0, instance, true); 2379 } 2380 } else { 2381 delete props[key]; 2382 } 2383 } 2384 } 2385 if (attrs !== rawCurrentProps) { 2386 for (const key in attrs) { 2387 if (!rawProps || !hasOwn(rawProps, key) && true) { 2388 delete attrs[key]; 2389 hasAttrsChanged = true; 2390 } 2391 } 2392 } 2393 } 2394 if (hasAttrsChanged) { 2395 trigger(instance, "set", "$attrs"); 2396 } 2397} 2398function setFullProps(instance, rawProps, props, attrs) { 2399 const [options, needCastKeys] = instance.propsOptions; 2400 let hasAttrsChanged = false; 2401 let rawCastValues; 2402 if (rawProps) { 2403 for (let key in rawProps) { 2404 if (isReservedProp(key)) { 2405 continue; 2406 } 2407 const value = rawProps[key]; 2408 let camelKey; 2409 if (options && hasOwn(options, camelKey = camelize(key))) { 2410 if (!needCastKeys || !needCastKeys.includes(camelKey)) { 2411 props[camelKey] = value; 2412 } else { 2413 (rawCastValues || (rawCastValues = {}))[camelKey] = value; 2414 } 2415 } else if (!isEmitListener(instance.emitsOptions, key)) { 2416 if (!(key in attrs) || value !== attrs[key]) { 2417 attrs[key] = value; 2418 hasAttrsChanged = true; 2419 } 2420 } 2421 } 2422 } 2423 if (needCastKeys) { 2424 const rawCurrentProps = toRaw(props); 2425 const castValues = rawCastValues || EMPTY_OBJ; 2426 for (let i = 0; i < needCastKeys.length; i++) { 2427 const key = needCastKeys[i]; 2428 props[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !hasOwn(castValues, key)); 2429 } 2430 } 2431 return hasAttrsChanged; 2432} 2433function resolvePropValue(options, props, key, value, instance, isAbsent) { 2434 const opt = options[key]; 2435 if (opt != null) { 2436 const hasDefault = hasOwn(opt, "default"); 2437 if (hasDefault && value === void 0) { 2438 const defaultValue = opt.default; 2439 if (opt.type !== Function && isFunction(defaultValue)) { 2440 const { propsDefaults } = instance; 2441 if (key in propsDefaults) { 2442 value = propsDefaults[key]; 2443 } else { 2444 setCurrentInstance(instance); 2445 value = propsDefaults[key] = defaultValue.call(null, props); 2446 unsetCurrentInstance(); 2447 } 2448 } else { 2449 value = defaultValue; 2450 } 2451 } 2452 if (opt[0]) { 2453 if (isAbsent && !hasDefault) { 2454 value = false; 2455 } else if (opt[1] && (value === "" || value === hyphenate(key))) { 2456 value = true; 2457 } 2458 } 2459 } 2460 return value; 2461} 2462function normalizePropsOptions(comp, appContext, asMixin = false) { 2463 const cache = appContext.propsCache; 2464 const cached = cache.get(comp); 2465 if (cached) { 2466 return cached; 2467 } 2468 const raw = comp.props; 2469 const normalized = {}; 2470 const needCastKeys = []; 2471 let hasExtends = false; 2472 if (!isFunction(comp)) { 2473 const extendProps = (raw2) => { 2474 hasExtends = true; 2475 const [props, keys] = normalizePropsOptions(raw2, appContext, true); 2476 extend(normalized, props); 2477 if (keys) 2478 needCastKeys.push(...keys); 2479 }; 2480 if (!asMixin && appContext.mixins.length) { 2481 appContext.mixins.forEach(extendProps); 2482 } 2483 if (comp.extends) { 2484 extendProps(comp.extends); 2485 } 2486 if (comp.mixins) { 2487 comp.mixins.forEach(extendProps); 2488 } 2489 } 2490 if (!raw && !hasExtends) { 2491 if (isObject(comp)) { 2492 cache.set(comp, EMPTY_ARR); 2493 } 2494 return EMPTY_ARR; 2495 } 2496 if (isArray(raw)) { 2497 for (let i = 0; i < raw.length; i++) { 2498 const normalizedKey = camelize(raw[i]); 2499 if (validatePropName(normalizedKey)) { 2500 normalized[normalizedKey] = EMPTY_OBJ; 2501 } 2502 } 2503 } else if (raw) { 2504 for (const key in raw) { 2505 const normalizedKey = camelize(key); 2506 if (validatePropName(normalizedKey)) { 2507 const opt = raw[key]; 2508 const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : opt; 2509 if (prop) { 2510 const booleanIndex = getTypeIndex(Boolean, prop.type); 2511 const stringIndex = getTypeIndex(String, prop.type); 2512 prop[0] = booleanIndex > -1; 2513 prop[1] = stringIndex < 0 || booleanIndex < stringIndex; 2514 if (booleanIndex > -1 || hasOwn(prop, "default")) { 2515 needCastKeys.push(normalizedKey); 2516 } 2517 } 2518 } 2519 } 2520 } 2521 const res = [normalized, needCastKeys]; 2522 if (isObject(comp)) { 2523 cache.set(comp, res); 2524 } 2525 return res; 2526} 2527function validatePropName(key) { 2528 if (key[0] !== "$") { 2529 return true; 2530 } 2531 return false; 2532} 2533function getType(ctor) { 2534 const match = ctor && ctor.toString().match(/^\s*function (\w+)/); 2535 return match ? match[1] : ctor === null ? "null" : ""; 2536} 2537function isSameType(a, b) { 2538 return getType(a) === getType(b); 2539} 2540function getTypeIndex(type, expectedTypes) { 2541 if (isArray(expectedTypes)) { 2542 return expectedTypes.findIndex((t) => isSameType(t, type)); 2543 } else if (isFunction(expectedTypes)) { 2544 return isSameType(expectedTypes, type) ? 0 : -1; 2545 } 2546 return -1; 2547} 2548const isInternalKey = (key) => key[0] === "_" || key === "$stable"; 2549const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; 2550const normalizeSlot = (key, rawSlot, ctx) => { 2551 if (rawSlot._n) { 2552 return rawSlot; 2553 } 2554 const normalized = withCtx((...args) => { 2555 if (false) 2556 ; 2557 return normalizeSlotValue(rawSlot(...args)); 2558 }, ctx); 2559 normalized._c = false;
2560 return normalized; 2561}; 2562const normalizeObjectSlots = (rawSlots, slots, instance) => { 2563 const ctx = rawSlots._ctx; 2564 for (const key in rawSlots) { 2565 if (isInternalKey(key)) 2566 continue; 2567 const value = rawSlots[key]; 2568 if (isFunction(value)) { 2569 slots[key] = normalizeSlot(key, value, ctx); 2570 } else if (value != null) { 2571 const normalized = normalizeSlotValue(value); 2572 slots[key] = () => normalized; 2573 } 2574 } 2575}; 2576const normalizeVNodeSlots = (instance, children) => { 2577 const normalized = normalizeSlotValue(children); 2578 instance.slots.default = () => normalized; 2579}; 2580const initSlots = (instance, children) => { 2581 if (instance.vnode.shapeFlag & 32) { 2582 const type = children._; 2583 if (type) { 2584 instance.slots = toRaw(children); 2585 def(children, "_", type); 2586 } else { 2587 normalizeObjectSlots(children, instance.slots = {}); 2588 } 2589 } else { 2590 instance.slots = {}; 2591 if (children) { 2592 normalizeVNodeSlots(instance, children); 2593 } 2594 } 2595 def(instance.slots, InternalObjectKey, 1); 2596}; 2597const updateSlots = (instance, children, optimized) => { 2598 const { vnode, slots } = instance; 2599 let needDeletionCheck = true; 2600 let deletionComparisonTarget = EMPTY_OBJ; 2601 if (vnode.shapeFlag & 32) { 2602 const type = children._; 2603 if (type) { 2604 if (optimized && type === 1) { 2605 needDeletionCheck = false; 2606 } else { 2607 extend(slots, children); 2608 if (!optimized && type === 1) { 2609 delete slots._; 2610 } 2611 } 2612 } else { 2613 needDeletionCheck = !children.$stable; 2614 normalizeObjectSlots(children, slots); 2615 } 2616 deletionComparisonTarget = children; 2617 } else if (children) { 2618 normalizeVNodeSlots(instance, children); 2619 deletionComparisonTarget = { default: 1 }; 2620 } 2621 if (needDeletionCheck) { 2622 for (const key in slots) { 2623 if (!isInternalKey(key) && !(key in deletionComparisonTarget)) { 2624 delete slots[key]; 2625 } 2626 } 2627 } 2628}; 2629function createAppContext() { 2630 return { 2631 app: null, 2632 config: { 2633 isNativeTag: NO, 2634 performance: false, 2635 globalProperties: {}, 2636 optionMergeStrategies: {}, 2637 errorHandler: void 0, 2638 warnHandler: void 0, 2639 compilerOptions: {} 2640 }, 2641 mixins: [], 2642 components: {}, 2643 directives: {}, 2644 provides: /* @__PURE__ */ Object.create(null), 2645 optionsCache: /* @__PURE__ */ new WeakMap(), 2646 propsCache: /* @__PURE__ */ new WeakMap(), 2647 emitsCache: /* @__PURE__ */ new WeakMap() 2648 }; 2649} 2650let uid = 0; 2651function createAppAPI(render, hydrate) { 2652 return function createApp(rootComponent, rootProps = null) { 2653 if (!isFunction(rootComponent)) { 2654 rootComponent = Object.assign({}, rootComponent); 2655 } 2656 if (rootProps != null && !isObject(rootProps)) { 2657 rootProps = null; 2658 } 2659 const context = createAppContext(); 2660 const installedPlugins = /* @__PURE__ */ new Set(); 2661 let isMounted = false; 2662 const app = context.app = { 2663 _uid: uid++, 2664 _component: rootComponent, 2665 _props: rootProps, 2666 _container: null, 2667 _context: context, 2668 _instance: null, 2669 version, 2670 get config() { 2671 return context.config; 2672 }, 2673 set config(v) { 2674 }, 2675 use(plugin, ...options) { 2676 if (installedPlugins.has(plugin)) 2677 ; 2678 else if (plugin && isFunction(plugin.install)) { 2679 installedPlugins.add(plugin); 2680 plugin.install(app, ...options); 2681 } else if (isFunction(plugin)) { 2682 installedPlugins.add(plugin); 2683 plugin(app, ...options); 2684 } else 2685 ; 2686 return app; 2687 }, 2688 mixin(mixin) { 2689 { 2690 if (!context.mixins.includes(mixin)) { 2691 context.mixins.push(mixin); 2692 } 2693 } 2694 return app; 2695 }, 2696 component(name, component) { 2697 if (!component) { 2698 return context.components[name]; 2699 } 2700 context.components[name] = component; 2701 return app; 2702 }, 2703 directive(name, directive) { 2704 if (!directive) { 2705 return context.directives[name]; 2706 } 2707 context.directives[name] = directive; 2708 return app; 2709 }, 2710 mount(rootContainer, isHydrate, isSVG) { 2711 if (!isMounted) { 2712 const vnode = createVNode(rootComponent, rootProps); 2713 vnode.appContext = context; 2714 if (isHydrate && hydrate) { 2715 hydrate(vnode, rootContainer); 2716 } else { 2717 render(vnode, rootContainer, isSVG); 2718 } 2719 isMounted = true; 2720 app._container = rootContainer; 2721 rootContainer.__vue_app__ = app; 2722 return getExposeProxy(vnode.component) || vnode.component.proxy; 2723 } 2724 }, 2725 unmount() { 2726 if (isMounted) { 2727 render(null, app._container); 2728 delete app._container.__vue_app__; 2729 } 2730 }, 2731 provide(key, value) { 2732 context.provides[key] = value; 2733 return app; 2734 } 2735 }; 2736 return app; 2737 }; 2738} 2739function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { 2740 if (isArray(rawRef)) { 2741 rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount)); 2742 return; 2743 } 2744 if (isAsyncWrapper(vnode) && !isUnmount) { 2745 return; 2746 } 2747 const refValue = vnode.shapeFlag & 4 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el; 2748 const value = isUnmount ? null : refValue; 2749 const { i: owner, r: ref2 } = rawRef; 2750 const oldRef = oldRawRef && oldRawRef.r; 2751 const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; 2752 const setupState = owner.setupState;
2753 if (oldRef != null && oldRef !== ref2) { 2754 if (isString(oldRef)) { 2755 refs[oldRef] = null; 2756 if (hasOwn(setupState, oldRef)) { 2757 setupState[oldRef] = null; 2758 } 2759 } else if (isRef(oldRef)) { 2760 oldRef.value = null; 2761 } 2762 } 2763 if (isFunction(ref2)) { 2764 callWithErrorHandling(ref2, owner, 12, [value, refs]); 2765 } else { 2766 const _isString = isString(ref2); 2767 const _isRef = isRef(ref2); 2768 if (_isString || _isRef) { 2769 const doSet = () => { 2770 if (rawRef.f) { 2771 const existing = _isString ? hasOwn(setupState, ref2) ? setupState[ref2] : refs[ref2] : ref2.value; 2772 if (isUnmount) { 2773 isArray(existing) && remove(existing, refValue); 2774 } else { 2775 if (!isArray(existing)) { 2776 if (_isString) { 2777 refs[ref2] = [refValue]; 2778 if (hasOwn(setupState, ref2)) { 2779 setupState[ref2] = refs[ref2]; 2780 } 2781 } else { 2782 ref2.value = [refValue]; 2783 if (rawRef.k) 2784 refs[rawRef.k] = ref2.value; 2785 } 2786 } else if (!existing.includes(refValue)) { 2787 existing.push(refValue); 2788 } 2789 } 2790 } else if (_isString) { 2791 refs[ref2] = value; 2792 if (hasOwn(setupState, ref2)) { 2793 setupState[ref2] = value; 2794 } 2795 } else if (_isRef) { 2796 ref2.value = value; 2797 if (rawRef.k) 2798 refs[rawRef.k] = value; 2799 } else 2800 ; 2801 }; 2802 if (value) { 2803 doSet.id = -1; 2804 queuePostRenderEffect(doSet, parentSuspense); 2805 } else { 2806 doSet(); 2807 } 2808 } 2809 } 2810} 2811let hasMismatch = false; 2812const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== "foreignObject"; 2813const isComment = (node) => node.nodeType === 8; 2814function createHydrationFunctions(rendererInternals) { 2815 const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove: remove2, insert, createComment } } = rendererInternals; 2816 const hydrate = (vnode, container) => { 2817 if (!container.hasChildNodes()) { 2818 patch(null, vnode, container); 2819 flushPostFlushCbs(); 2820 container._vnode = vnode; 2821 return; 2822 } 2823 hasMismatch = false; 2824 hydrateNode(container.firstChild, vnode, null, null, null); 2825 flushPostFlushCbs(); 2826 container._vnode = vnode; 2827 if (hasMismatch && true) { 2828 console.error(`Hydration completed but contains mismatches.`); 2829 } 2830 }; 2831 const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { 2832 const isFragmentStart = isComment(node) && node.data === "["; 2833 const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart); 2834 const { type, ref: ref2, shapeFlag, patchFlag } = vnode; 2835 let domType = node.nodeType; 2836 vnode.el = node; 2837 if (patchFlag === -2) { 2838 optimized = false; 2839 vnode.dynamicChildren = null; 2840 } 2841 let nextNode = null; 2842 switch (type) { 2843 case Text: 2844 if (domType !== 3) { 2845 if (vnode.children === "") { 2846 insert(vnode.el = createText(""), parentNode(node), node); 2847 nextNode = node; 2848 } else { 2849 nextNode = onMismatch(); 2850 } 2851 } else { 2852 if (node.data !== vnode.children) { 2853 hasMismatch = true; 2854 node.data = vnode.children; 2855 } 2856 nextNode = nextSibling(node); 2857 } 2858 break; 2859 case Comment: 2860 if (domType !== 8 || isFragmentStart) { 2861 nextNode = onMismatch(); 2862 } else { 2863 nextNode = nextSibling(node); 2864 } 2865 break; 2866 case Static: 2867 if (isFragmentStart) { 2868 node = nextSibling(node); 2869 domType = node.nodeType; 2870 } 2871 if (domType === 1 || domType === 3) { 2872 nextNode = node; 2873 const needToAdoptContent = !vnode.children.length; 2874 for (let i = 0; i < vnode.staticCount; i++) { 2875 if (needToAdoptContent) 2876 vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data; 2877 if (i === vnode.staticCount - 1) { 2878 vnode.anchor = nextNode; 2879 } 2880 nextNode = nextSibling(nextNode); 2881 } 2882 return isFragmentStart ? nextSibling(nextNode) : nextNode; 2883 } else { 2884 onMismatch(); 2885 } 2886 break; 2887 case Fragment: 2888 if (!isFragmentStart) { 2889 nextNode = onMismatch(); 2890 } else { 2891 nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized); 2892 } 2893 break; 2894 default: 2895 if (shapeFlag & 1) { 2896 if (domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) { 2897 nextNode = onMismatch(); 2898 } else { 2899 nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized); 2900 } 2901 } else if (shapeFlag & 6) { 2902 vnode.slotScopeIds = slotScopeIds; 2903 const container = parentNode(node); 2904 mountComponent(vnode, container, null, parentComponent, parentSuspense, isSVGContainer(container), optimized); 2905 nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node); 2906 if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") { 2907 nextNode = nextSibling(nextNode); 2908 } 2909 if (isAsyncWrapper(vnode)) { 2910 let subTree; 2911 if (isFragmentStart) { 2912 subTree = createVNode(Fragment); 2913 subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; 2914 } else { 2915 subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div"); 2916 } 2917 subTree.el = node; 2918 vnode.component.subTree = subTree; 2919 } 2920 } else if (shapeFlag & 64) { 2921 if (domType !== 8) { 2922 nextNode = onMismatch(); 2923 } else { 2924 nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren); 2925 } 2926 } else if (shapeFlag & 128) { 2927 nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode); 2928 } else 2929 ; 2930 } 2931 if (ref2 != null) { 2932 setRef(ref2, null, parentSuspense, vnode); 2933 } 2934 return nextNode; 2935 }; 2936 const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { 2937 optimized = optimized || !!vnode.dynamicChildren; 2938 const { type, props, patchFlag, shapeFlag, dirs } = vnode; 2939 const forcePatchValue = type === "input" && dirs || type === "option"; 2940 if (forcePatchValue || patchFlag !== -1) { 2941 if (dirs) { 2942 invokeDirectiveHook(vnode, null, parentComponent, "created"); 2943 } 2944 if (props) { 2945 if (forcePatchValue || !optimized || patchFlag & (16 | 32)) { 2946 for (const key in props) { 2947 if (forcePatchValue && key.endsWith("value") || isOn(key) && !isReservedProp(key)) { 2948 patchProp(el, key, null, props[key], false, void 0, parentComponent); 2949 } 2950 } 2951 } else if (props.onClick) { 2952 patchProp(el, "onClick", null, props.onClick, false, void 0, parentComponent); 2953 } 2954 } 2955 let vnodeHooks;
2956 if (vnodeHooks = props && props.onVnodeBeforeMount) { 2957 invokeVNodeHook(vnodeHooks, parentComponent, vnode); 2958 } 2959 if (dirs) { 2960 invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); 2961 } 2962 if ((vnodeHooks = props && props.onVnodeMounted) || dirs) { 2963 queueEffectWithSuspense(() => { 2964 vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); 2965 dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); 2966 }, parentSuspense); 2967 } 2968 if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) { 2969 let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized); 2970 while (next) { 2971 hasMismatch = true; 2972 const cur = next; 2973 next = next.nextSibling; 2974 remove2(cur); 2975 } 2976 } else if (shapeFlag & 8) { 2977 if (el.textContent !== vnode.children) { 2978 hasMismatch = true; 2979 el.textContent = vnode.children; 2980 } 2981 } 2982 } 2983 return el.nextSibling; 2984 }; 2985 const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { 2986 optimized = optimized || !!parentVNode.dynamicChildren; 2987 const children = parentVNode.children; 2988 const l = children.length; 2989 for (let i = 0; i < l; i++) { 2990 const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]); 2991 if (node) { 2992 node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized); 2993 } else if (vnode.type === Text && !vnode.children) { 2994 continue; 2995 } else { 2996 hasMismatch = true; 2997 patch(null, vnode, container, null, parentComponent, parentSuspense, isSVGContainer(container), slotScopeIds); 2998 } 2999 } 3000 return node; 3001 }; 3002 const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { 3003 const { slotScopeIds: fragmentSlotScopeIds } = vnode; 3004 if (fragmentSlotScopeIds) { 3005 slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; 3006 } 3007 const container = parentNode(node); 3008 const next = hydrateChildren(nextSibling(node), vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized); 3009 if (next && isComment(next) && next.data === "]") { 3010 return nextSibling(vnode.anchor = next); 3011 } else { 3012 hasMismatch = true; 3013 insert(vnode.anchor = createComment(`]`), container, next); 3014 return next; 3015 } 3016 }; 3017 const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => { 3018 hasMismatch = true; 3019 vnode.el = null; 3020 if (isFragment) { 3021 const end = locateClosingAsyncAnchor(node); 3022 while (true) { 3023 const next2 = nextSibling(node); 3024 if (next2 && next2 !== end) { 3025 remove2(next2); 3026 } else { 3027 break; 3028 } 3029 } 3030 } 3031 const next = nextSibling(node); 3032 const container = parentNode(node); 3033 remove2(node); 3034 patch(null, vnode, container, next, parentComponent, parentSuspense, isSVGContainer(container), slotScopeIds); 3035 return next; 3036 }; 3037 const locateClosingAsyncAnchor = (node) => { 3038 let match = 0; 3039 while (node) { 3040 node = nextSibling(node); 3041 if (node && isComment(node)) { 3042 if (node.data === "[") 3043 match++; 3044 if (node.data === "]") { 3045 if (match === 0) { 3046 return nextSibling(node); 3047 } else { 3048 match--; 3049 } 3050 } 3051 } 3052 } 3053 return node; 3054 }; 3055 return [hydrate, hydrateNode]; 3056} 3057const queuePostRenderEffect = queueEffectWithSuspense; 3058function createHydrationRenderer(options) { 3059 return baseCreateRenderer(options, createHydrationFunctions); 3060} 3061function baseCreateRenderer(options, createHydrationFns) { 3062 const target = getGlobalThis(); 3063 target.__VUE__ = true; 3064 const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId =
vendor: 31,959 bytes, lines 3064-3936
3064NOOP, insertStaticContent: hostInsertStaticContent } = options; 3065 const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = !!n2.dynamicChildren) => { 3066 if (n1 === n2) { 3067 return; 3068 } 3069 if (n1 && !isSameVNodeType(n1, n2)) { 3070 anchor = getNextHostNode(n1); 3071 unmount(n1, parentComponent, parentSuspense, true); 3072 n1 = null; 3073 } 3074 if (n2.patchFlag === -2) { 3075 optimized = false; 3076 n2.dynamicChildren = null; 3077 } 3078 const { type, ref: ref2, shapeFlag } = n2; 3079 switch (type) { 3080 case Text: 3081 processText(n1, n2, container, anchor); 3082 break; 3083 case Comment: 3084 processCommentNode(n1, n2, container, anchor); 3085 break; 3086 case Static: 3087 if (n1 == null) { 3088 mountStaticNode(n2, container, anchor, isSVG); 3089 } 3090 break; 3091 case Fragment: 3092 processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3093 break; 3094 default: 3095 if (shapeFlag & 1) { 3096 processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3097 } else if (shapeFlag & 6) { 3098 processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3099 } else if (shapeFlag & 64) { 3100 type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals); 3101 } else if (shapeFlag & 128) { 3102 type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals); 3103 } else 3104 ; 3105 } 3106 if (ref2 != null && parentComponent) { 3107 setRef(ref2, n1 && n1.ref, parentSuspense, n2 || n1, !n2); 3108 } 3109 }; 3110 const processText = (n1, n2, container, anchor) => { 3111 if (n1 == null) { 3112 hostInsert(n2.el = hostCreateText(n2.children), container, anchor); 3113 } else { 3114 const el = n2.el = n1.el; 3115 if (n2.children !== n1.children) { 3116 hostSetText(el, n2.children); 3117 } 3118 } 3119 }; 3120 const processCommentNode = (n1, n2, container, anchor) => { 3121 if (n1 == null) { 3122 hostInsert(n2.el = hostCreateComment(n2.children || ""), container, anchor); 3123 } else { 3124 n2.el = n1.el; 3125 } 3126 }; 3127 const mountStaticNode = (n2, container, anchor, isSVG) => { 3128 [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG, n2.el, n2.anchor); 3129 }; 3130 const moveStaticNode = ({ el, anchor }, container, nextSibling) => { 3131 let next; 3132 while (el && el !== anchor) { 3133 next = hostNextSibling(el); 3134 hostInsert(el, container, nextSibling); 3135 el = next; 3136 } 3137 hostInsert(anchor, container, nextSibling); 3138 }; 3139 const removeStaticNode = ({ el, anchor }) => { 3140 let next; 3141 while (el && el !== anchor) { 3142 next = hostNextSibling(el); 3143 hostRemove(el); 3144 el = next; 3145 } 3146 hostRemove(anchor); 3147 }; 3148 const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { 3149 isSVG = isSVG || n2.type === "svg"; 3150 if (n1 == null) { 3151 mountElement(n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3152 } else { 3153 patchElement(n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3154 } 3155 }; 3156 const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { 3157 let el; 3158 let vnodeHook; 3159 const { type, props, shapeFlag, transition, dirs } = vnode; 3160 el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props); 3161 if (shapeFlag & 8) { 3162 hostSetElementText(el, vnode.children); 3163 } else if (shapeFlag & 16) { 3164 mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== "foreignObject", slotScopeIds, optimized); 3165 } 3166 if (dirs) { 3167 invokeDirectiveHook(vnode, null, parentComponent, "created"); 3168 } 3169 if (props) { 3170 for (const key in props) { 3171 if (key !== "value" && !isReservedProp(key)) { 3172 hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren); 3173 } 3174 } 3175 if ("value" in props) { 3176 hostPatchProp(el, "value", null, props.value); 3177 } 3178 if (vnodeHook = props.onVnodeBeforeMount) { 3179 invokeVNodeHook(vnodeHook, parentComponent, vnode); 3180 } 3181 } 3182 setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); 3183 if (dirs) { 3184 invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); 3185 } 3186 const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; 3187 if (needCallTransitionHooks) { 3188 transition.beforeEnter(el); 3189 } 3190 hostInsert(el, container, anchor); 3191 if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { 3192 queuePostRenderEffect(() => { 3193 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); 3194 needCallTransitionHooks && transition.enter(el); 3195 dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); 3196 }, parentSuspense); 3197 } 3198 }; 3199 const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { 3200 if (scopeId) { 3201 hostSetScopeId(el, scopeId); 3202 } 3203 if (slotScopeIds) { 3204 for (let i = 0; i < slotScopeIds.length; i++) { 3205 hostSetScopeId(el, slotScopeIds[i]); 3206 } 3207 } 3208 if (parentComponent) { 3209 let subTree = parentComponent.subTree; 3210 if (vnode === subTree) { 3211 const parentVNode = parentComponent.vnode; 3212 setScopeId(el, parentVNode, parentVNode.scopeId, parentVNode.slotScopeIds, parentComponent.parent); 3213 } 3214 } 3215 }; 3216 const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => { 3217 for (let i = start; i < children.length; i++) { 3218 const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]); 3219 patch(null, child, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3220 } 3221 }; 3222 const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { 3223 const el = n2.el = n1.el; 3224 let { patchFlag, dynamicChildren, dirs } = n2; 3225 patchFlag |= n1.patchFlag & 16; 3226 const oldProps = n1.props || EMPTY_OBJ; 3227 const newProps = n2.props || EMPTY_OBJ; 3228 let vnodeHook; 3229 parentComponent && toggleRecurse(parentComponent, false); 3230 if (vnodeHook = newProps.onVnodeBeforeUpdate) { 3231 invokeVNodeHook(vnodeHook, parentComponent, n2, n1); 3232 } 3233 if (dirs) { 3234 invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); 3235 } 3236 parentComponent && toggleRecurse(parentComponent, true); 3237 const areChildrenSVG = isSVG && n2.type !== "foreignObject"; 3238 if (dynamicChildren) { 3239 patchBlockChildren(n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds); 3240 } else if (!optimized) { 3241 patchChildren(n1, n2, el, null, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds, false); 3242 } 3243 if (patchFlag > 0) { 3244 if (patchFlag & 16) { 3245 patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG); 3246 } else { 3247 if (patchFlag & 2) { 3248 if (oldProps.class !== newProps.class) { 3249 hostPatchProp(el, "class", null, newProps.class, isSVG); 3250 } 3251 } 3252 if (patchFlag & 4) { 3253 hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG); 3254 } 3255 if (patchFlag & 8) { 3256 const propsToUpdate = n2.dynamicProps; 3257 for (let i = 0; i < propsToUpdate.length; i++) { 3258 const key = propsToUpdate[i]; 3259 const prev = oldProps[key]; 3260 const next = newProps[key]; 3261 if (next !== prev || key === "value") { 3262 hostPatchProp(el, key, prev, next, isSVG, n1.children, parentComponent, parentSuspense, unmountChildren); 3263 } 3264 } 3265 } 3266 } 3267 if (patchFlag & 1) { 3268 if (n1.children !== n2.children) { 3269 hostSetElementText(el, n2.children); 3270 } 3271 } 3272 } else if (!optimized && dynamicChildren == null) { 3273 patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG); 3274 } 3275 if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { 3276 queuePostRenderEffect(() => { 3277 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); 3278 dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); 3279 }, parentSuspense); 3280 } 3281 }; 3282 const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => { 3283 for (let i = 0; i < newChildren.length; i++) { 3284 const oldVNode = oldChildren[i]; 3285 const newVNode = newChildren[i]; 3286 const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : fallbackContainer; 3287 patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, true); 3288 } 3289 }; 3290 const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => { 3291 if (oldProps !== newProps) { 3292 if (oldProps !== EMPTY_OBJ) { 3293 for (const key in oldProps) { 3294 if (!isReservedProp(key) && !(key in newProps)) { 3295 hostPatchProp(el, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren); 3296 } 3297 } 3298 } 3299 for (const key in newProps) { 3300 if (isReservedProp(key)) 3301 continue; 3302 const next = newProps[key]; 3303 const prev = oldProps[key]; 3304 if (next !== prev && key !== "value") { 3305 hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren); 3306 } 3307 } 3308 if ("value" in newProps) { 3309 hostPatchProp(el, "value", oldProps.value, newProps.value); 3310 } 3311 } 3312 }; 3313 const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { 3314 const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); 3315 const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); 3316 let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; 3317 if (fragmentSlotScopeIds) { 3318 slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; 3319 } 3320 if (n1 == null) { 3321 hostInsert(fragmentStartAnchor, container, anchor); 3322 hostInsert(fragmentEndAnchor, container, anchor); 3323 mountChildren(n2.children, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3324 } else { 3325 if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && n1.dynamicChildren) { 3326 patchBlockChildren(n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, isSVG, slotScopeIds); 3327 if (n2.key != null || parentComponent && n2 === parentComponent.subTree) { 3328 traverseStaticChildren(n1, n2, true); 3329 } 3330 } else { 3331 patchChildren(n1, n2, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3332 } 3333 } 3334 }; 3335 const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { 3336 n2.slotScopeIds = slotScopeIds; 3337 if (n1 == null) { 3338 if (n2.shapeFlag & 512) { 3339 parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized); 3340 } else { 3341 mountComponent(n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized); 3342 } 3343 } else { 3344 updateComponent(n1, n2, optimized); 3345 } 3346 }; 3347 const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => { 3348 const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense); 3349 if (isKeepAlive(initialVNode)) { 3350 instance.ctx.renderer = internals; 3351 } 3352 { 3353 setupComponent(instance); 3354 } 3355 if (instance.asyncDep) { 3356 parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect); 3357 if (!initialVNode.el) { 3358 const placeholder = instance.subTree = createVNode(Comment); 3359 processCommentNode(null, placeholder, container, anchor); 3360 } 3361 return; 3362 } 3363 setupRenderEffect(instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized); 3364 }; 3365 const updateComponent = (n1, n2, optimized) => { 3366 const instance = n2.component = n1.component; 3367 if (shouldUpdateComponent(n1, n2, optimized)) { 3368 if (instance.asyncDep && !instance.asyncResolved) { 3369 updateComponentPreRender(instance, n2, optimized); 3370 return; 3371 } else { 3372 instance.next = n2; 3373 invalidateJob(instance.update); 3374 instance.update(); 3375 } 3376 } else { 3377 n2.el = n1.el; 3378 instance.vnode = n2; 3379 } 3380 }; 3381 const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => { 3382 const componentUpdateFn = () => { 3383 if (!instance.isMounted) { 3384 let vnodeHook; 3385 const { el, props } = initialVNode; 3386 const { bm, m, parent } = instance; 3387 const isAsyncWrapperVNode = isAsyncWrapper(initialVNode); 3388 toggleRecurse(instance, false); 3389 if (bm) { 3390 invokeArrayFns(bm); 3391 } 3392 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) { 3393 invokeVNodeHook(vnodeHook, parent, initialVNode); 3394 } 3395 toggleRecurse(instance, true); 3396 if (el && hydrateNode) { 3397 const hydrateSubTree = () => { 3398 instance.subTree = renderComponentRoot(instance); 3399 hydrateNode(el, instance.subTree, instance, parentSuspense, null); 3400 }; 3401 if (isAsyncWrapperVNode) { 3402 initialVNode.type.__asyncLoader().then( 3403 () => !instance.isUnmounted && hydrateSubTree() 3404 ); 3405 } else { 3406 hydrateSubTree(); 3407 } 3408 } else { 3409 const subTree = instance.subTree = renderComponentRoot(instance); 3410 patch(null, subTree, container, anchor, instance, parentSuspense, isSVG); 3411 initialVNode.el = subTree.el; 3412 } 3413 if (m) { 3414 queuePostRenderEffect(m, parentSuspense); 3415 } 3416 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) { 3417 const scopedInitialVNode = initialVNode; 3418 queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense); 3419 } 3420 if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) { 3421 instance.a && queuePostRenderEffect(instance.a, parentSuspense); 3422 } 3423 instance.isMounted = true; 3424 initialVNode = container = anchor = null; 3425 } else { 3426 let { next, bu, u, parent, vnode } = instance; 3427 let originNext = next; 3428 let vnodeHook; 3429 toggleRecurse(instance, false); 3430 if (next) { 3431 next.el = vnode.el; 3432 updateComponentPreRender(instance, next, optimized); 3433 } else { 3434 next = vnode; 3435 } 3436 if (bu) { 3437 invokeArrayFns(bu); 3438 } 3439 if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) { 3440 invokeVNodeHook(vnodeHook, parent, next, vnode); 3441 } 3442 toggleRecurse(instance, true); 3443 const nextTree = renderComponentRoot(instance); 3444 const prevTree = instance.subTree; 3445 instance.subTree = nextTree; 3446 patch( 3447 prevTree, 3448 nextTree, 3449 hostParentNode(prevTree.el), 3450 getNextHostNode(prevTree), 3451 instance, 3452 parentSuspense, 3453 isSVG 3454 ); 3455 next.el = nextTree.el; 3456 if (originNext === null) { 3457 updateHOCHostEl(instance, nextTree.el); 3458 } 3459 if (u) { 3460 queuePostRenderEffect(u, parentSuspense); 3461 } 3462 if (vnodeHook = next.props && next.props.onVnodeUpdated) { 3463 queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense); 3464 } 3465 } 3466 }; 3467 const effect = instance.effect = new ReactiveEffect( 3468 componentUpdateFn, 3469 () => queueJob(update), 3470 instance.scope 3471 ); 3472 const update = instance.update = () => effect.run(); 3473 update.id = instance.uid; 3474 toggleRecurse(instance, true); 3475 update(); 3476 }; 3477 const updateComponentPreRender = (instance, nextVNode, optimized) => { 3478 nextVNode.component = instance; 3479 const prevProps = instance.vnode.props; 3480 instance.vnode = nextVNode; 3481 instance.next = null; 3482 updateProps(instance, nextVNode.props, prevProps, optimized); 3483 updateSlots(instance, nextVNode.children, optimized); 3484 pauseTracking(); 3485 flushPreFlushCbs(); 3486 resetTracking(); 3487 }; 3488 const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => { 3489 const c1 = n1 && n1.children; 3490 const prevShapeFlag = n1 ? n1.shapeFlag : 0; 3491 const c2 = n2.children; 3492 const { patchFlag, shapeFlag } = n2; 3493 if (patchFlag > 0) { 3494 if (patchFlag & 128) { 3495 patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3496 return; 3497 } else if (patchFlag & 256) { 3498 patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3499 return; 3500 } 3501 } 3502 if (shapeFlag & 8) { 3503 if (prevShapeFlag & 16) { 3504 unmountChildren(c1, parentComponent, parentSuspense); 3505 } 3506 if (c2 !== c1) { 3507 hostSetElementText(container, c2); 3508 } 3509 } else { 3510 if (prevShapeFlag & 16) { 3511 if (shapeFlag & 16) { 3512 patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3513 } else { 3514 unmountChildren(c1, parentComponent, parentSuspense, true); 3515 } 3516 } else { 3517 if (prevShapeFlag & 8) { 3518 hostSetElementText(container, ""); 3519 } 3520 if (shapeFlag & 16) { 3521 mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3522 } 3523 } 3524 } 3525 }; 3526 const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { 3527 c1 = c1 || EMPTY_ARR; 3528 c2 = c2 || EMPTY_ARR; 3529 const oldLength = c1.length; 3530 const newLength = c2.length; 3531 const commonLength = Math.min(oldLength, newLength); 3532 let i; 3533 for (i = 0; i < commonLength; i++) { 3534 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 3535 patch(c1[i], nextChild, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3536 } 3537 if (oldLength > newLength) { 3538 unmountChildren(c1, parentComponent, parentSuspense, true, false, commonLength); 3539 } else { 3540 mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, commonLength); 3541 } 3542 }; 3543 const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { 3544 let i = 0; 3545 const l2 = c2.length; 3546 let e1 = c1.length - 1; 3547 let e2 = l2 - 1; 3548 while (i <= e1 && i <= e2) { 3549 const n1 = c1[i]; 3550 const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 3551 if (isSameVNodeType(n1, n2)) { 3552 patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3553 } else { 3554 break; 3555 } 3556 i++; 3557 } 3558 while (i <= e1 && i <= e2) { 3559 const n1 = c1[e1]; 3560 const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]); 3561 if (isSameVNodeType(n1, n2)) { 3562 patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3563 } else { 3564 break; 3565 } 3566 e1--; 3567 e2--; 3568 } 3569 if (i > e1) { 3570 if (i <= e2) { 3571 const nextPos = e2 + 1; 3572 const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; 3573 while (i <= e2) { 3574 patch(null, c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3575 i++; 3576 } 3577 } 3578 } else if (i > e2) { 3579 while (i <= e1) { 3580 unmount(c1[i], parentComponent, parentSuspense, true); 3581 i++; 3582 } 3583 } else { 3584 const s1 = i; 3585 const s2 = i; 3586 const keyToNewIndexMap = /* @__PURE__ */ new Map(); 3587 for (i = s2; i <= e2; i++) { 3588 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 3589 if (nextChild.key != null) { 3590 keyToNewIndexMap.set(nextChild.key, i); 3591 } 3592 } 3593 let j; 3594 let patched = 0; 3595 const toBePatched = e2 - s2 + 1; 3596 let moved = false; 3597 let maxNewIndexSoFar = 0; 3598 const newIndexToOldIndexMap = new Array(toBePatched); 3599 for (i = 0; i < toBePatched; i++) 3600 newIndexToOldIndexMap[i] = 0; 3601 for (i = s1; i <= e1; i++) { 3602 const prevChild = c1[i]; 3603 if (patched >= toBePatched) { 3604 unmount(prevChild, parentComponent, parentSuspense, true); 3605 continue; 3606 } 3607 let newIndex; 3608 if (prevChild.key != null) { 3609 newIndex = keyToNewIndexMap.get(prevChild.key); 3610 } else { 3611 for (j = s2; j <= e2; j++) { 3612 if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) { 3613 newIndex = j; 3614 break; 3615 } 3616 } 3617 } 3618 if (newIndex === void 0) { 3619 unmount(prevChild, parentComponent, parentSuspense, true); 3620 } else { 3621 newIndexToOldIndexMap[newIndex - s2] = i + 1; 3622 if (newIndex >= maxNewIndexSoFar) { 3623 maxNewIndexSoFar = newIndex; 3624 } else { 3625 moved = true; 3626 } 3627 patch(prevChild, c2[newIndex], container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3628 patched++; 3629 } 3630 } 3631 const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR; 3632 j = increasingNewIndexSequence.length - 1; 3633 for (i = toBePatched - 1; i >= 0; i--) { 3634 const nextIndex = s2 + i; 3635 const nextChild = c2[nextIndex]; 3636 const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor; 3637 if (newIndexToOldIndexMap[i] === 0) { 3638 patch(null, nextChild, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); 3639 } else if (moved) { 3640 if (j < 0 || i !== increasingNewIndexSequence[j]) { 3641 move(nextChild, container, anchor, 2); 3642 } else { 3643 j--; 3644 } 3645 } 3646 } 3647 } 3648 }; 3649 const move = (vnode, container, anchor, moveType, parentSuspense = null) => { 3650 const { el, type, transition, children, shapeFlag } = vnode; 3651 if (shapeFlag & 6) { 3652 move(vnode.component.subTree, container, anchor, moveType); 3653 return; 3654 } 3655 if (shapeFlag & 128) { 3656 vnode.suspense.move(container, anchor, moveType); 3657 return; 3658 } 3659 if (shapeFlag & 64) { 3660 type.move(vnode, container, anchor, internals); 3661 return; 3662 } 3663 if (type === Fragment) { 3664 hostInsert(el, container, anchor); 3665 for (let i = 0; i < children.length; i++) { 3666 move(children[i], container, anchor, moveType); 3667 } 3668 hostInsert(vnode.anchor, container, anchor); 3669 return; 3670 } 3671 if (type === Static) { 3672 moveStaticNode(vnode, container, anchor); 3673 return; 3674 } 3675 const needTransition = moveType !== 2 && shapeFlag & 1 && transition; 3676 if (needTransition) { 3677 if (moveType === 0) { 3678 transition.beforeEnter(el); 3679 hostInsert(el, container, anchor); 3680 queuePostRenderEffect(() => transition.enter(el), parentSuspense); 3681 } else { 3682 const { leave, delayLeave, afterLeave } = transition; 3683 const remove3 = () => hostInsert(el, container, anchor); 3684 const performLeave = () => { 3685 leave(el, () => { 3686 remove3(); 3687 afterLeave && afterLeave(); 3688 }); 3689 }; 3690 if (delayLeave) { 3691 delayLeave(el, remove3, performLeave); 3692 } else { 3693 performLeave(); 3694 } 3695 } 3696 } else { 3697 hostInsert(el, container, anchor); 3698 } 3699 }; 3700 const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => { 3701 const { type, props, ref: ref2, children, dynamicChildren, shapeFlag, patchFlag, dirs } = vnode; 3702 if (ref2 != null) { 3703 setRef(ref2, null, parentSuspense, vnode, true); 3704 } 3705 if (shapeFlag & 256) { 3706 parentComponent.ctx.deactivate(vnode); 3707 return; 3708 } 3709 const shouldInvokeDirs = shapeFlag & 1 && dirs; 3710 const shouldInvokeVnodeHook = !isAsyncWrapper(vnode); 3711 let vnodeHook; 3712 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) { 3713 invokeVNodeHook(vnodeHook, parentComponent, vnode); 3714 } 3715 if (shapeFlag & 6) { 3716 unmountComponent(vnode.component, parentSuspense, doRemove); 3717 } else { 3718 if (shapeFlag & 128) { 3719 vnode.suspense.unmount(parentSuspense, doRemove); 3720 return; 3721 } 3722 if (shouldInvokeDirs) { 3723 invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount"); 3724 } 3725 if (shapeFlag & 64) { 3726 vnode.type.remove(vnode, parentComponent, parentSuspense, optimized, internals, doRemove); 3727 } else if (dynamicChildren && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) { 3728 unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true); 3729 } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) { 3730 unmountChildren(children, parentComponent, parentSuspense); 3731 } 3732 if (doRemove) { 3733 remove2(vnode); 3734 } 3735 } 3736 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) { 3737 queuePostRenderEffect(() => { 3738 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); 3739 shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted"); 3740 }, parentSuspense); 3741 } 3742 }; 3743 const remove2 = (vnode) => { 3744 const { type, el, anchor, transition } = vnode; 3745 if (type === Fragment) { 3746 { 3747 removeFragment(el, anchor); 3748 } 3749 return; 3750 } 3751 if (type === Static) { 3752 removeStaticNode(vnode); 3753 return; 3754 } 3755 const performRemove = () => { 3756 hostRemove(el); 3757 if (transition && !transition.persisted && transition.afterLeave) { 3758 transition.afterLeave(); 3759 } 3760 }; 3761 if (vnode.shapeFlag & 1 && transition && !transition.persisted) { 3762 const { leave, delayLeave } = transition; 3763 const performLeave = () => leave(el, performRemove); 3764 if (delayLeave) { 3765 delayLeave(vnode.el, performRemove, performLeave); 3766 } else { 3767 performLeave(); 3768 } 3769 } else { 3770 performRemove(); 3771 } 3772 }; 3773 const removeFragment = (cur, end) => { 3774 let next; 3775 while (cur !== end) { 3776 next = hostNextSibling(cur); 3777 hostRemove(cur); 3778 cur = next; 3779 } 3780 hostRemove(end); 3781 }; 3782 const unmountComponent = (instance, parentSuspense, doRemove) => { 3783 const { bum, scope, update, subTree, um } = instance; 3784 if (bum) { 3785 invokeArrayFns(bum); 3786 } 3787 scope.stop(); 3788 if (update) { 3789 update.active = false; 3790 unmount(subTree, instance, parentSuspense, doRemove); 3791 } 3792 if (um) { 3793 queuePostRenderEffect(um, parentSuspense); 3794 } 3795 queuePostRenderEffect(() => { 3796 instance.isUnmounted = true; 3797 }, parentSuspense); 3798 if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) { 3799 parentSuspense.deps--; 3800 if (parentSuspense.deps === 0) { 3801 parentSuspense.resolve(); 3802 } 3803 } 3804 }; 3805 const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => { 3806 for (let i = start; i < children.length; i++) { 3807 unmount(children[i], parentComponent, parentSuspense, doRemove, optimized); 3808 } 3809 }; 3810 const getNextHostNode = (vnode) => { 3811 if (vnode.shapeFlag & 6) { 3812 return getNextHostNode(vnode.component.subTree); 3813 } 3814 if (vnode.shapeFlag & 128) { 3815 return vnode.suspense.next(); 3816 } 3817 return hostNextSibling(vnode.anchor || vnode.el); 3818 }; 3819 const render = (vnode, container, isSVG) => { 3820 if (vnode == null) { 3821 if (container._vnode) { 3822 unmount(container._vnode, null, null, true); 3823 } 3824 } else { 3825 patch(container._vnode || null, vnode, container, null, null, null, isSVG); 3826 } 3827 flushPreFlushCbs(); 3828 flushPostFlushCbs(); 3829 container._vnode = vnode; 3830 }; 3831 const internals = { 3832 p: patch, 3833 um: unmount, 3834 m: move, 3835 r: remove2, 3836 mt: mountComponent, 3837 mc: mountChildren, 3838 pc: patchChildren, 3839 pbc: patchBlockChildren, 3840 n: getNextHostNode, 3841 o: options 3842 }; 3843 let hydrate; 3844 let hydrateNode; 3845 if (createHydrationFns) { 3846 [hydrate, hydrateNode] = createHydrationFns(internals); 3847 } 3848 return { 3849 render, 3850 hydrate, 3851 createApp: createAppAPI(render, hydrate) 3852 }; 3853} 3854function toggleRecurse({ effect, update }, allowed) { 3855 effect.allowRecurse = update.allowRecurse = allowed; 3856} 3857function traverseStaticChildren(n1, n2, shallow = false) { 3858 const ch1 = n1.children; 3859 const ch2 = n2.children; 3860 if (isArray(ch1) && isArray(ch2)) { 3861 for (let i = 0; i < ch1.length; i++) { 3862 const c1 = ch1[i]; 3863 let c2 = ch2[i]; 3864 if (c2.shapeFlag & 1 && !c2.dynamicChildren) { 3865 if (c2.patchFlag <= 0 || c2.patchFlag === 32) { 3866 c2 = ch2[i] = cloneIfMounted(ch2[i]); 3867 c2.el = c1.el; 3868 } 3869 if (!shallow) 3870 traverseStaticChildren(c1, c2); 3871 } 3872 } 3873 } 3874} 3875function getSequence(arr) { 3876 const p = arr.slice(); 3877 const result = [0]; 3878 let i, j, u, v, c; 3879 const len = arr.length; 3880 for (i = 0; i < len; i++) { 3881 const arrI = arr[i]; 3882 if (arrI !== 0) { 3883 j = result[result.length - 1]; 3884 if (arr[j] < arrI) { 3885 p[i] = j; 3886 result.push(i); 3887 continue; 3888 } 3889 u = 0; 3890 v = result.length - 1; 3891 while (u < v) { 3892 c = u + v >> 1; 3893 if (arr[result[c]] < arrI) { 3894 u = c + 1; 3895 } else { 3896 v = c; 3897 } 3898 } 3899 if (arrI < arr[result[u]]) { 3900 if (u > 0) { 3901 p[i] = result[u - 1]; 3902 } 3903 result[u] = i; 3904 } 3905 } 3906 } 3907 u = result.length; 3908 v = result[u - 1]; 3909 while (u-- > 0) { 3910 result[u] = v; 3911 v = p[v]; 3912 } 3913 return result; 3914} 3915const isTeleport = (type) => type.__isTeleport; 3916const Fragment = Symbol(void 0); 3917const Text = Symbol(void 0); 3918const Comment = Symbol(void 0); 3919const Static = Symbol(void 0); 3920const blockStack = []; 3921let currentBlock = null; 3922function openBlock(disableTracking = false) { 3923 blockStack.push(currentBlock = disableTracking ? null : []); 3924} 3925function closeBlock() { 3926 blockStack.pop(); 3927 currentBlock = blockStack[blockStack.length - 1] || null; 3928} 3929let isBlockTreeEnabled = 1; 3930function setBlockTracking(value) { 3931 isBlockTreeEnabled += value; 3932} 3933function setupBlock(vnode) { 3934 vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null; 3935 closeBlock(); 3936 if (isBlockTreeEnabled > 0 && currentBlock) {
3937 currentBlock.push(vnode); 3938 } 3939 return vnode; 3940} 3941function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) { 3942 return setupBlock(createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, true)); 3943} 3944function createBlock(type, props, children, patchFlag, dynamicProps) { 3945 return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true)); 3946} 3947function isVNode(value) { 3948 return value ? value.__v_isVNode === true : false; 3949} 3950function isSameVNodeType(n1, n2) { 3951 return n1.type === n2.type && n1.key === n2.key; 3952} 3953const InternalObjectKey = `__vInternal`; 3954const normalizeKey = ({ key }) => key != null ? key : null; 3955const normalizeRef = ({ ref: ref2, ref_key, ref_for }) => { 3956 return ref2 != null ? isString(ref2) || isRef(ref2) || isFunction(ref2) ? { i: currentRenderingInstance, r: ref2, k: ref_key, f: !!ref_for } : ref2 : null; 3957}; 3958function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) { 3959 const vnode = { 3960 __v_isVNode: true, 3961 __v_skip: true, 3962 type, 3963 props, 3964 key: props && normalizeKey(props), 3965 ref: props && normalizeRef(props), 3966 scopeId: currentScopeId, 3967 slotScopeIds: null, 3968 children, 3969 component: null, 3970 suspense: null, 3971 ssContent: null, 3972 ssFallback: null, 3973 dirs: null, 3974 transition: null, 3975 el: null, 3976 anchor: null, 3977 target: null, 3978 targetAnchor: null, 3979 staticCount: 0, 3980 shapeFlag, 3981 patchFlag, 3982 dynamicProps, 3983 dynamicChildren: null, 3984 appContext: null 3985 }; 3986 if (needFullChildrenNormalization) { 3987 normalizeChildren(vnode, children); 3988 if (shapeFlag & 128) { 3989 type.normalize(vnode); 3990 } 3991 } else if (children) { 3992 vnode.shapeFlag |= isString(children) ? 8 : 16; 3993 } 3994 if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) { 3995 currentBlock.push(vnode); 3996 } 3997 return vnode; 3998} 3999const createVNode = _createVNode; 4000function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { 4001 if (!type || type === NULL_DYNAMIC_COMPONENT) { 4002 type = Comment; 4003 } 4004 if (isVNode(type)) { 4005 const cloned = cloneVNode(type, props, true); 4006 if (children) { 4007 normalizeChildren(cloned, children); 4008 } 4009 if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) { 4010 if (cloned.shapeFlag & 6) { 4011 currentBlock[currentBlock.indexOf(type)] = cloned; 4012 } else { 4013 currentBlock.push(cloned); 4014 } 4015 } 4016 cloned.patchFlag |= -2; 4017 return cloned; 4018 } 4019 if (isClassComponent(type)) { 4020 type = type.__vccOpts; 4021 } 4022 if (props) { 4023 props = guardReactiveProps(props); 4024 let { class: klass, style } = props; 4025 if (klass && !isString(klass)) { 4026 props.class = normalizeClass(klass); 4027 } 4028 if (isObject(style)) { 4029 if (isProxy(style) && !isArray(style)) { 4030 style = extend({}, style); 4031 } 4032 props.style = normalizeStyle(style); 4033 } 4034 } 4035 const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0; 4036 return createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, isBlockNode, true); 4037} 4038function guardReactiveProps(props) { 4039 if (!props) 4040 return null; 4041 return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props; 4042} 4043function cloneVNode(vnode, extraProps, mergeRef = false) { 4044 const { props, ref: ref2, patchFlag, children } = vnode; 4045 const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; 4046 const cloned = { 4047 __v_isVNode: true, 4048 __v_skip: true, 4049 type: vnode.type, 4050 props: mergedProps, 4051 key: mergedProps && normalizeKey(mergedProps), 4052 ref: extraProps && extraProps.ref ? mergeRef && ref2 ? isArray(ref2) ? ref2.concat(normalizeRef(extraProps)) : [ref2, normalizeRef(extraProps)] : normalizeRef(extraProps) : ref2, 4053 scopeId: vnode.scopeId, 4054 slotScopeIds: vnode.slotScopeIds, 4055 children, 4056 target: vnode.target, 4057 targetAnchor: vnode.targetAnchor, 4058 staticCount: vnode.staticCount, 4059 shapeFlag: vnode.shapeFlag, 4060 patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16
vendor: 5,692 bytes, lines 4060-4265
4060: patchFlag | 16 : patchFlag, 4061 dynamicProps: vnode.dynamicProps, 4062 dynamicChildren: vnode.dynamicChildren, 4063 appContext: vnode.appContext, 4064 dirs: vnode.dirs, 4065 transition: vnode.transition, 4066 component: vnode.component, 4067 suspense: vnode.suspense, 4068 ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), 4069 ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), 4070 el: vnode.el, 4071 anchor: vnode.anchor 4072 }; 4073 return cloned; 4074} 4075function createTextVNode(text = " ", flag = 0) { 4076 return createVNode(Text, null, text, flag); 4077} 4078function createStaticVNode(content, numberOfNodes) { 4079 const vnode = createVNode(Static, null, content); 4080 vnode.staticCount = numberOfNodes; 4081 return vnode; 4082} 4083function createCommentVNode(text = "", asBlock = false) { 4084 return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text); 4085} 4086function normalizeVNode(child) { 4087 if (child == null || typeof child === "boolean") { 4088 return createVNode(Comment); 4089 } else if (isArray(child)) { 4090 return createVNode( 4091 Fragment, 4092 null, 4093 child.slice() 4094 ); 4095 } else if (typeof child === "object") { 4096 return cloneIfMounted(child); 4097 } else { 4098 return createVNode(Text, null, String(child)); 4099 } 4100} 4101function cloneIfMounted(child) { 4102 return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child); 4103} 4104function normalizeChildren(vnode, children) { 4105 let type = 0; 4106 const { shapeFlag } = vnode; 4107 if (children == null) { 4108 children = null; 4109 } else if (isArray(children)) { 4110 type = 16; 4111 } else if (typeof children === "object") { 4112 if (shapeFlag & (1 | 64)) { 4113 const slot = children.default; 4114 if (slot) { 4115 slot._c && (slot._d = false); 4116 normalizeChildren(vnode, slot()); 4117 slot._c && (slot._d = true); 4118 } 4119 return; 4120 } else { 4121 type = 32; 4122 const slotFlag = children._; 4123 if (!slotFlag && !(InternalObjectKey in children)) { 4124 children._ctx = currentRenderingInstance; 4125 } else if (slotFlag === 3 && currentRenderingInstance) { 4126 if (currentRenderingInstance.slots._ === 1) { 4127 children._ = 1; 4128 } else { 4129 children._ = 2; 4130 vnode.patchFlag |= 1024; 4131 } 4132 } 4133 } 4134 } else if (isFunction(children)) { 4135 children = { default: children, _ctx: currentRenderingInstance }; 4136 type = 32; 4137 } else { 4138 children = String(children); 4139 if (shapeFlag & 64) { 4140 type = 16; 4141 children = [createTextVNode(children)]; 4142 } else { 4143 type = 8; 4144 } 4145 } 4146 vnode.children = children; 4147 vnode.shapeFlag |= type; 4148} 4149function mergeProps(...args) { 4150 const ret = {}; 4151 for (let i = 0; i < args.length; i++) { 4152 const toMerge = args[i]; 4153 for (const key in toMerge) { 4154 if (key === "class") { 4155 if (ret.class !== toMerge.class) { 4156 ret.class = normalizeClass([ret.class, toMerge.class]); 4157 } 4158 } else if (key === "style") { 4159 ret.style = normalizeStyle([ret.style, toMerge.style]); 4160 } else if (isOn(key)) { 4161 const existing = ret[key]; 4162 const incoming = toMerge[key]; 4163 if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) { 4164 ret[key] = existing ? [].concat(existing, incoming) : incoming; 4165 } 4166 } else if (key !== "") { 4167 ret[key] = toMerge[key]; 4168 } 4169 } 4170 } 4171 return ret; 4172} 4173function invokeVNodeHook(hook, instance, vnode, prevVNode = null) { 4174 callWithAsyncErrorHandling(hook, instance, 7, [ 4175 vnode, 4176 prevVNode 4177 ]); 4178} 4179const emptyAppContext = createAppContext(); 4180let uid$1 = 0; 4181function createComponentInstance(vnode, parent, suspense) { 4182 const type = vnode.type; 4183 const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext; 4184 const instance = { 4185 uid: uid$1++, 4186 vnode, 4187 type, 4188 parent, 4189 appContext, 4190 root: null, 4191 next: null, 4192 subTree: null, 4193 effect: null, 4194 update: null, 4195 scope: new EffectScope(true), 4196 render: null, 4197 proxy: null, 4198 exposed: null, 4199 exposeProxy: null, 4200 withProxy: null, 4201 provides: parent ? parent.provides : Object.create(appContext.provides), 4202 accessCache: null, 4203 renderCache: [], 4204 components: null, 4205 directives: null, 4206 propsOptions: normalizePropsOptions(type, appContext), 4207 emitsOptions: normalizeEmitsOptions(type, appContext), 4208 emit: null, 4209 emitted: null, 4210 propsDefaults: EMPTY_OBJ, 4211 inheritAttrs: type.inheritAttrs, 4212 ctx: EMPTY_OBJ, 4213 data: EMPTY_OBJ, 4214 props: EMPTY_OBJ, 4215 attrs: EMPTY_OBJ, 4216 slots: EMPTY_OBJ, 4217 refs: EMPTY_OBJ, 4218 setupState: EMPTY_OBJ, 4219 setupContext: null, 4220 suspense, 4221 suspenseId: suspense ? suspense.pendingId : 0, 4222 asyncDep: null, 4223 asyncResolved: false, 4224 isMounted: false, 4225 isUnmounted: false, 4226 isDeactivated: false, 4227 bc: null, 4228 c: null, 4229 bm: null, 4230 m: null, 4231 bu: null, 4232 u: null, 4233 um: null, 4234 bum: null, 4235 da: null, 4236 a: null, 4237 rtg: null, 4238 rtc: null, 4239 ec: null, 4240 sp: null 4241 }; 4242 { 4243 instance.ctx = { _: instance }; 4244 } 4245 instance.root = parent ? parent.root : instance; 4246 instance.emit = emit$1.bind(null, instance); 4247 if (vnode.ce) { 4248 vnode.ce(instance); 4249 } 4250 return instance; 4251} 4252let currentInstance = null; 4253const getCurrentInstance = () => currentInstance || currentRenderingInstance; 4254const setCurrentInstance = (instance) => { 4255 currentInstance = instance; 4256 instance.scope.on(); 4257}; 4258const unsetCurrentInstance = () => { 4259 currentInstance && currentInstance.scope.off(); 4260 currentInstance = null; 4261}; 4262function isStatefulComponent(instance) { 4263 return instance.vnode.shapeFlag & 4; 4264} 4265let isInSSRComponentSetup = false;
4266function setupComponent(instance, isSSR = false) { 4267 isInSSRComponentSetup = isSSR; 4268 const { props, children } = instance.vnode; 4269 const isStateful = isStatefulComponent(instance); 4270 initProps(instance, props, isStateful, isSSR); 4271 initSlots(instance, children); 4272 const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; 4273 isInSSRComponentSetup = false; 4274 return setupResult; 4275} 4276function setupStatefulComponent(instance, isSSR) { 4277 const Component = instance.type; 4278 instance.accessCache = /* @__PURE__ */ Object.create(null); 4279 instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers)); 4280 const { setup } = Component; 4281 if (setup) { 4282 const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; 4283 setCurrentInstance(instance); 4284 pauseTracking(); 4285 const setupResult = callWithErrorHandling(setup, instance, 0, [instance.props, setupContext]); 4286 resetTracking(); 4287 unsetCurrentInstance(); 4288 if (isPromise(setupResult)) { 4289 setupResult.then(unsetCurrentInstance, unsetCurrentInstance); 4290 if (isSSR) { 4291 return setupResult.then((resolvedResult) => { 4292 handleSetupResult(instance, resolvedResult, isSSR); 4293 }).catch((e) => { 4294 handleError(e, instance, 0); 4295 }); 4296 } else { 4297 instance.asyncDep = setupResult; 4298 } 4299 } else { 4300 handleSetupResult(instance, setupResult, isSSR); 4301 } 4302 } else { 4303 finishComponentSetup(instance, isSSR); 4304 } 4305} 4306function handleSetupResult(instance, setupResult, isSSR) { 4307 if (isFunction(setupResult)) { 4308 if (instance.type.__ssrInlineRender) { 4309 instance.ssrRender = setupResult; 4310 } else { 4311 instance.render = setupResult; 4312 } 4313 } else if (isObject(setupResult)) { 4314 instance.setupState = proxyRefs(setupResult); 4315 } else 4316 ; 4317 finishComponentSetup(instance, isSSR); 4318} 4319let compile; 4320function finishComponentSetup(instance, isSSR, skipOptions) { 4321 const Component = instance.type; 4322 if (!instance.render) { 4323 if (!isSSR && compile && !Component.render) { 4324 const template = Component.template || resolveMergedOptions(instance).template; 4325 if (template) { 4326 const { isCustomElement, compilerOptions } = instance.appContext.config; 4327 const { delimiters, compilerOptions: componentCompilerOptions } = Component; 4328 const finalCompilerOptions = extend(extend({ 4329 isCustomElement, 4330 delimiters 4331 }, compilerOptions), componentCompilerOptions); 4332 Component.render = compile(template, finalCompilerOptions); 4333 } 4334 } 4335 instance.render = Component.render || NOOP; 4336 } 4337 { 4338 setCurrentInstance(instance); 4339 pauseTracking(); 4340 applyOptions(instance); 4341 resetTracking(); 4342 unsetCurrentInstance(); 4343 } 4344} 4345function createAttrsProxy(instance) { 4346 return new Proxy(instance.attrs, { 4347 get(target, key) { 4348 track(instance, "get", "$attrs"); 4349 return target[key]; 4350 } 4351 }); 4352} 4353function createSetupContext(instance) { 4354 const expose = (exposed) => { 4355 instance.exposed = exposed || {}; 4356 }; 4357 let attrs; 4358 { 4359 return { 4360 get attrs() { 4361 return attrs || (attrs = createAttrsProxy(instance)); 4362 }, 4363 slots: instance.slots, 4364 emit: instance.emit, 4365 expose 4366 }; 4367 } 4368} 4369function getExposeProxy(instance) { 4370 if (instance.exposed) { 4371 return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), { 4372 get(target, key) { 4373 if (key in target) { 4374 return target[key]; 4375 } else if (key in publicPropertiesMap) { 4376 return publicPropertiesMap[key](instance); 4377 } 4378 } 4379 })); 4380 } 4381} 4382const classifyRE = /(?:^|[-_])(\w)/g; 4383const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""); 4384function getComponentName(Component, includeInferred = true) { 4385 return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; 4386} 4387function formatComponentName(instance, Component, isRoot = false) { 4388 let name = getComponentName(Component); 4389 if (!name && Component.__file) { 4390 const match = Component.__file.match(/([^/\\]+)\.\w+$/); 4391 if (match) { 4392 name = match[1]; 4393 } 4394 } 4395 if (!name && instance && instance.parent) { 4396 const inferFromRegistry = (registry) => { 4397 for (const key in registry) { 4398 if (registry[key] === Component) { 4399 return key; 4400 } 4401 } 4402 }; 4403 name = inferFromRegistry(instance.components || instance.parent.type.components) || inferFromRegistry(instance.appContext.components); 4404 } 4405 return name ? classify(name) : isRoot ? `App` : `Anonymous`; 4406} 4407function isClassComponent(value) { 4408 return isFunction(value) && "__vccOpts" in value; 4409} 4410const computed = (getterOrOptions, debugOptions) => { 4411 return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup); 4412}; 4413function h(type, propsOrChildren, children) { 4414 const l = arguments.length; 4415 if (l === 2) { 4416 if (isObject(propsOrChildren) && !isArray(propsOrChildren)) { 4417 if (isVNode(propsOrChildren)) { 4418 return createVNode(type, null, [propsOrChildren]); 4419 } 4420 return createVNode(type, propsOrChildren); 4421 } else { 4422 return createVNode(type, null, propsOrChildren); 4423 } 4424 } else { 4425 if (l > 3) { 4426 children = Array.prototype.slice.call(arguments, 2); 4427 } else if (l === 3 && isVNode(children)) { 4428 children = [children]; 4429 } 4430 return createVNode(type, propsOrChildren, children); 4431 } 4432} 4433const version = "3.2.41"; 4434export { 4435 createStaticVNode as A, 4436 unref as B, 4437 pushScopeId as C, 4438 popScopeId as D, 4439 createCommentVNode as E, 4440 Fragment as F,
4441 renderSlot as G, 4442 normalizeClass as H, 4443 createTextVNode as I, 4444 createVNode as J, 4445 withCtx as K, 4446 renderList as L, 4447 createBlock as M, 4448 Static as S, 4449 hyphenate as a, 4450 onUnmounted as b, 4451 createHydrationRenderer as c, 4452 defineComponent as d, 4453 extend as e, 4454 isOn as f, 4455 getCurrentInstance as g, 4456 h, 4457 isString as i, 4458 isModelListener as j, 4459 isFunction as k, 4460 isArray as l, 4461 camelize as m, 4462 capitalize as n, 4463 onMounted as o, 4464 isSpecialBooleanAttr as p, 4465 includeBooleanAttr as q, 4466 callWithAsyncErrorHandling as r, 4467 inject as s, 4468 createElementBlock as t, 4469 openBlock as u, 4470 createBaseVNode as v, 4471 watchPostEffect as w, 4472 ref as x, 4473 computed as y, 4474 toDisplayString as z 4475};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.