@vue/runtime-dom 3.6.0-rc.14 → 3.6.0-rc.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-rc.14
2
+ * @vue/runtime-dom v3.6.0-rc.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -58,10 +58,18 @@ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" &
58
58
  const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
59
59
  const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
60
60
  const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
61
+ const STRING_CACHE_MAX_SIZE = 1e4;
61
62
  const cacheStringFunction = (fn) => {
62
- const cache = Object.create(null);
63
+ let cache = Object.create(null);
64
+ let size = 0;
63
65
  return ((str) => {
64
- return cache[str] || (cache[str] = fn(str));
66
+ const hit = cache[str];
67
+ if (hit !== void 0) return hit;
68
+ if (++size > STRING_CACHE_MAX_SIZE) {
69
+ cache = Object.create(null);
70
+ size = 1;
71
+ }
72
+ return cache[str] = fn(str);
65
73
  });
66
74
  };
67
75
  const camelizeRE = /-(\w)/g;
@@ -69,22 +77,22 @@ const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
69
77
  /**
70
78
  * @private
71
79
  */
72
- const camelize = cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
80
+ const camelize = /*@__PURE__*/ cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
73
81
  const hyphenateRE = /\B([A-Z])/g;
74
82
  /**
75
83
  * @private
76
84
  */
77
- const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
85
+ const hyphenate = /*@__PURE__*/ cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
78
86
  /**
79
87
  * @private
80
88
  */
81
- const capitalize = cacheStringFunction((str) => {
89
+ const capitalize = /*@__PURE__*/ cacheStringFunction((str) => {
82
90
  return str.charAt(0).toUpperCase() + str.slice(1);
83
91
  });
84
92
  /**
85
93
  * @private
86
94
  */
87
- const toHandlerKey = cacheStringFunction((str) => {
95
+ const toHandlerKey = /*@__PURE__*/ cacheStringFunction((str) => {
88
96
  return str ? `on${capitalize(str)}` : ``;
89
97
  });
90
98
  /**
@@ -210,26 +218,11 @@ const isSVGTag = /*@__PURE__*/ makeMap(SVG_TAGS);
210
218
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
211
219
  */
212
220
  const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
213
- //#endregion
214
- //#region packages/shared/src/domAttrConfig.ts
215
- /**
216
- * On the client we only need to offer special cases for boolean attributes that
217
- * have different names from their corresponding dom properties:
218
- * - itemscope -> N/A
219
- * - allowfullscreen -> allowFullscreen
220
- * - formnovalidate -> formNoValidate
221
- * - ismap -> isMap
222
- * - nomodule -> noModule
223
- * - novalidate -> noValidate
224
- * - playsinline -> playsInline
225
- * - readonly -> readOnly
226
- */
227
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
228
- const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
221
+ const isSpecialBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly");
229
222
  /**
230
223
  * The full list is needed during SSR to produce the correct initial markup.
231
224
  */
232
- const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
225
+ const isBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
233
226
  /**
234
227
  * Boolean attributes should be included if the value is truthy or ''.
235
228
  * e.g. `<select multiple>` compiles to `{ multiple: '' }`
@@ -440,40 +433,16 @@ function isVaporBranchStart(data) {
440
433
  }
441
434
  return true;
442
435
  }
443
- //#endregion
444
- //#region packages/reactivity/src/debug.ts
445
- const triggerEventInfos = [];
446
- function onTrack(sub, debugInfo) {
447
- if (sub.onTrack) sub.onTrack(extend({ effect: sub }, debugInfo));
448
- }
449
- function onTrigger(sub) {
450
- if (sub.onTrigger) {
451
- const debugInfo = triggerEventInfos[triggerEventInfos.length - 1];
452
- sub.onTrigger(extend({ effect: sub }, debugInfo));
453
- }
436
+ /**
437
+ * The data of a comment opening a range only a vapor server render emits:
438
+ * `<!--{-->` around the render of a component, or a v-if branch's.
439
+ */
440
+ function isVaporRangeStart(data) {
441
+ return data === "{" || isVaporBranchStart(data);
454
442
  }
455
- function setupOnTrigger(target) {
456
- Object.defineProperty(target.prototype, "onTrigger", {
457
- get() {
458
- return this._onTrigger;
459
- },
460
- set(val) {
461
- if (val && !this._onTrigger) setupFlagsHandler(this);
462
- this._onTrigger = val;
463
- }
464
- });
465
- }
466
- function setupFlagsHandler(target) {
467
- target._flags = target.flags;
468
- Object.defineProperty(target, "flags", {
469
- get() {
470
- return target._flags;
471
- },
472
- set(value) {
473
- if (!(target._flags & 48) && !!(value & 48)) onTrigger(this);
474
- target._flags = value;
475
- }
476
- });
443
+ /** The data of the comment closing the range `open` opens. */
444
+ function rangeCloseOf(open) {
445
+ return open === "(" ? ")" : open === "{" ? "}" : "]";
477
446
  }
478
447
  //#endregion
479
448
  //#region packages/reactivity/src/warning.ts
@@ -485,13 +454,7 @@ function warn$2(msg, ...args) {
485
454
  const notifyBuffer = [];
486
455
  let batchDepth = 0;
487
456
  let activeSub = void 0;
488
- let runDepth = 0;
489
- function incRunDepth() {
490
- ++runDepth;
491
- }
492
- function decRunDepth() {
493
- --runDepth;
494
- }
457
+ const CHECKING = 512;
495
458
  let globalVersion = 0;
496
459
  let notifyIndex = 0;
497
460
  let notifyBufferLength = 0;
@@ -540,6 +503,7 @@ function unlink(link, sub = link.sub) {
540
503
  const nextDep = link.nextDep;
541
504
  const nextSub = link.nextSub;
542
505
  const prevSub = link.prevSub;
506
+ link.prevDep = link.nextDep = link.prevSub = link.nextSub = void 0;
543
507
  if (nextDep !== void 0) nextDep.prevDep = prevDep;
544
508
  else sub.depsTail = prevDep;
545
509
  if (prevDep !== void 0) prevDep.nextDep = nextDep;
@@ -547,7 +511,7 @@ function unlink(link, sub = link.sub) {
547
511
  if (nextSub !== void 0) nextSub.prevSub = prevSub;
548
512
  else dep.subsTail = prevSub;
549
513
  if (prevSub !== void 0) prevSub.nextSub = nextSub;
550
- else if ((dep.subs = nextSub) === void 0) {
514
+ else if ((dep.subs = nextSub) === void 0 && dep.flags & 1) {
551
515
  let toRemove = dep.deps;
552
516
  if (toRemove !== void 0) {
553
517
  do
@@ -565,14 +529,12 @@ function propagate(link) {
565
529
  const sub = link.sub;
566
530
  let flags = sub.flags;
567
531
  if (flags & 3) {
568
- if (!(flags & 60)) {
569
- sub.flags = flags | 32;
570
- if (runDepth) sub.flags |= 8;
571
- } else if (!(flags & 12)) flags = 0;
532
+ if (!(flags & 44)) sub.flags = flags | 32;
533
+ else if (!(flags & 12)) flags = 0;
572
534
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
573
535
  else if (!(flags & 48) && isValidLink(link, sub)) {
574
536
  sub.flags = flags | 40;
575
- flags &= 1;
537
+ flags = sub === activeSub || activeSub === void 0 ? 0 : flags & 1;
576
538
  } else flags = 0;
577
539
  if (flags & 2) notifyBuffer[notifyBufferLength++] = sub;
578
540
  if (flags & 1) {
@@ -608,7 +570,7 @@ function propagate(link) {
608
570
  function startTracking(sub) {
609
571
  ++globalVersion;
610
572
  sub.depsTail = void 0;
611
- sub.flags = sub.flags & -57 | 4;
573
+ sub.flags = sub.flags & -569 | 4;
612
574
  return setActiveSub(sub);
613
575
  }
614
576
  function endTracking(sub, prevSub) {
@@ -616,8 +578,11 @@ function endTracking(sub, prevSub) {
616
578
  activeSub = prevSub;
617
579
  const depsTail = sub.depsTail;
618
580
  let toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
619
- while (toRemove !== void 0) toRemove = unlink(toRemove, sub);
620
- sub.flags &= -5;
581
+ while (toRemove !== void 0) {
582
+ unlink(toRemove, sub);
583
+ toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
584
+ }
585
+ if ((sub.flags &= -5) & 8) markRecursed(sub);
621
586
  }
622
587
  function flush() {
623
588
  let hasError = false;
@@ -639,45 +604,67 @@ function flush() {
639
604
  if (hasError) throw error;
640
605
  }
641
606
  function checkDirty(link, sub) {
607
+ try {
608
+ return walkDirty(link, sub);
609
+ } catch (err) {
610
+ markStale(sub);
611
+ throw err;
612
+ }
613
+ }
614
+ function walkDirty(link, sub) {
615
+ const root = sub;
642
616
  let stack;
643
617
  let checkDepth = 0;
618
+ let staleDepth = 0;
619
+ let staleFloor = 0;
644
620
  top: do {
645
621
  const dep = link.dep;
646
622
  const depFlags = dep.flags;
647
623
  let dirty = false;
648
624
  if (sub.flags & 16) dirty = true;
649
625
  else if ((depFlags & 17) === 17) {
650
- const subs = dep.subs;
651
626
  if (dep.update()) {
652
- if (subs.nextSub !== void 0) shallowPropagate(subs);
627
+ const subs = dep.subs;
628
+ if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
653
629
  dirty = true;
654
630
  }
655
631
  } else if ((depFlags & 33) === 33) {
656
- stack = {
657
- value: link,
658
- prev: stack
659
- };
660
- link = dep.deps;
661
- sub = dep;
662
- ++checkDepth;
663
- continue;
632
+ const depth = dep === root ? 0 : depFlags & CHECKING ? checkingDepth(dep, stack, checkDepth) : -1;
633
+ if (depth < 0) {
634
+ if (link.nextSub !== void 0 || link.prevSub !== void 0) dep.flags = depFlags | CHECKING;
635
+ stack = {
636
+ value: link,
637
+ prev: stack
638
+ };
639
+ link = dep.deps;
640
+ sub = dep;
641
+ ++checkDepth;
642
+ continue;
643
+ }
644
+ if (depth < checkDepth) {
645
+ staleFloor = staleDepth && staleFloor < depth ? staleFloor : depth;
646
+ staleDepth = checkDepth;
647
+ }
664
648
  }
665
649
  if (!dirty && link.nextDep !== void 0) {
666
650
  link = link.nextDep;
667
651
  continue;
668
652
  }
669
653
  while (checkDepth) {
654
+ const stale = checkDepth === staleDepth;
655
+ if (stale && --staleDepth === staleFloor) staleDepth = 0;
670
656
  --checkDepth;
671
657
  link = stack.value;
672
658
  stack = stack.prev;
673
659
  if (dirty) {
674
- const subs = sub.subs;
675
660
  if (sub.update()) {
676
- if (subs.nextSub !== void 0) shallowPropagate(subs);
661
+ const subs = sub.subs;
662
+ if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
677
663
  sub = link.sub;
678
664
  continue;
679
665
  }
680
- } else sub.flags &= -33;
666
+ } else if (stale) sub.flags = sub.flags & -545 | 16;
667
+ else sub.flags &= -545;
681
668
  sub = link.sub;
682
669
  if (link.nextDep !== void 0) {
683
670
  link = link.nextDep;
@@ -685,9 +672,21 @@ function checkDirty(link, sub) {
685
672
  }
686
673
  dirty = false;
687
674
  }
688
- return dirty && !!sub.flags;
675
+ return (dirty || !!(sub.flags & 16)) && !!sub.flags;
689
676
  } while (true);
690
677
  }
678
+ function checkingDepth(dep, stack, depth) {
679
+ for (; stack !== void 0; stack = stack.prev, --depth) if (stack.value.dep === dep) return depth;
680
+ return -1;
681
+ }
682
+ function markStale(sub) {
683
+ const nodes = [sub];
684
+ do {
685
+ sub = nodes.pop();
686
+ sub.flags = sub.flags & -33 | 16;
687
+ for (let link = sub.deps; link !== void 0; link = link.nextDep) if (link.dep.flags & 32) nodes.push(link.dep);
688
+ } while (nodes.length);
689
+ }
691
690
  function shallowPropagate(link) {
692
691
  do {
693
692
  const sub = link.sub;
@@ -705,6 +704,71 @@ function isValidLink(checkLink, sub) {
705
704
  }
706
705
  return false;
707
706
  }
707
+ function markRecursed(sub) {
708
+ const nodes = [sub];
709
+ do {
710
+ sub = nodes.pop();
711
+ for (let link = sub.deps; link !== void 0; link = link.nextDep) {
712
+ const dep = link.dep;
713
+ if ((dep.flags & 40) === 32) {
714
+ dep.flags |= 8;
715
+ nodes.push(dep);
716
+ }
717
+ }
718
+ } while (nodes.length);
719
+ }
720
+ //#endregion
721
+ //#region packages/reactivity/src/debug.ts
722
+ const triggered = [];
723
+ function onTrack(sub, debugInfo) {
724
+ if (sub.onTrack) sub.onTrack(extend({ effect: sub }, debugInfo));
725
+ }
726
+ function onTrigger(sub, debugInfo) {
727
+ if (sub.onTrigger) sub.onTrigger(extend({ effect: sub }, debugInfo));
728
+ }
729
+ function startTrigger() {
730
+ triggered.push([]);
731
+ }
732
+ function endTrigger(debugInfo) {
733
+ const subs = triggered.pop();
734
+ if (subs.length) {
735
+ startBatch();
736
+ try {
737
+ for (let i = 0; i < subs.length; i++) {
738
+ const sub = subs[i];
739
+ if (sub.flags & 3) onTrigger(sub, debugInfo);
740
+ }
741
+ } finally {
742
+ endBatch();
743
+ }
744
+ }
745
+ }
746
+ function setupOnTrigger(target) {
747
+ Object.defineProperty(target.prototype, "onTrigger", {
748
+ get() {
749
+ return this._onTrigger;
750
+ },
751
+ set(val) {
752
+ if (val && !this._onTrigger) setupFlagsHandler(this);
753
+ this._onTrigger = val;
754
+ }
755
+ });
756
+ }
757
+ function setupFlagsHandler(target) {
758
+ target._flags = target.flags;
759
+ Object.defineProperty(target, "flags", {
760
+ get() {
761
+ return target._flags;
762
+ },
763
+ set(value) {
764
+ if (!(target._flags & 48) && !!(value & 48)) {
765
+ if (triggered.length) triggered[triggered.length - 1].push(this);
766
+ else onTrigger(this);
767
+ }
768
+ target._flags = value;
769
+ }
770
+ });
771
+ }
708
772
  //#endregion
709
773
  //#region packages/reactivity/src/dep.ts
710
774
  var Dep = class {
@@ -764,20 +828,12 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
764
828
  if (!depsMap) return;
765
829
  const run = (dep) => {
766
830
  if (dep !== void 0 && dep.subs !== void 0) {
767
- triggerEventInfos.push({
768
- target,
769
- type,
770
- key,
771
- newValue,
772
- oldValue,
773
- oldTarget
774
- });
775
831
  propagate(dep.subs);
776
832
  shallowPropagate(dep.subs);
777
- triggerEventInfos.pop();
778
833
  }
779
834
  };
780
835
  startBatch();
836
+ startTrigger();
781
837
  if (type === "clear") depsMap.forEach(run);
782
838
  else {
783
839
  const targetIsArray = isArray(target);
@@ -807,6 +863,14 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
807
863
  }
808
864
  }
809
865
  }
866
+ endTrigger({
867
+ target,
868
+ type,
869
+ key,
870
+ newValue,
871
+ oldValue,
872
+ oldTarget
873
+ });
810
874
  endBatch();
811
875
  }
812
876
  function getDepFromReactive(object, key) {
@@ -1021,7 +1085,7 @@ function noTracking(self, method, args = []) {
1021
1085
  //#endregion
1022
1086
  //#region packages/reactivity/src/baseHandlers.ts
1023
1087
  const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
1024
- const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
1088
+ const builtInSymbols = /*@__PURE__*/ new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
1025
1089
  function hasOwnProperty(key) {
1026
1090
  if (!isSymbol(key)) key = String(key);
1027
1091
  const obj = /* @__PURE__ */ toRaw(this);
@@ -1605,16 +1669,16 @@ var RefImpl = class {
1605
1669
  this._value = !useDirectValue && this._wrap ? this._wrap(newValue) : newValue;
1606
1670
  const subs = this.subs;
1607
1671
  if (subs !== void 0) {
1608
- triggerEventInfos.push({
1672
+ startTrigger();
1673
+ propagate(subs);
1674
+ endTrigger({
1609
1675
  target: this,
1610
1676
  type: "set",
1611
1677
  key: "value",
1612
1678
  newValue,
1613
1679
  oldValue
1614
1680
  });
1615
- propagate(subs);
1616
1681
  if (!batchDepth) flush();
1617
- triggerEventInfos.pop();
1618
1682
  }
1619
1683
  }
1620
1684
  }
@@ -1651,8 +1715,10 @@ var RefImpl = class {
1651
1715
  function triggerRef(ref) {
1652
1716
  const dep = ref.dep;
1653
1717
  if (dep !== void 0 && dep.subs !== void 0) {
1718
+ startTrigger();
1654
1719
  propagate(dep.subs);
1655
1720
  shallowPropagate(dep.subs);
1721
+ endTrigger();
1656
1722
  if (!batchDepth) flush();
1657
1723
  }
1658
1724
  }
@@ -1843,6 +1909,10 @@ var ReactiveEffect = class {
1843
1909
  get active() {
1844
1910
  return !(this.flags & 1024);
1845
1911
  }
1912
+ /** @internal */
1913
+ get running() {
1914
+ return !!(this.flags & 4);
1915
+ }
1846
1916
  pause() {
1847
1917
  this.flags |= 256;
1848
1918
  }
@@ -1856,11 +1926,9 @@ var ReactiveEffect = class {
1856
1926
  if (!this.active) return this.fn();
1857
1927
  cleanup(this);
1858
1928
  const prevSub = startTracking(this);
1859
- incRunDepth();
1860
1929
  try {
1861
1930
  return this.fn();
1862
1931
  } finally {
1863
- decRunDepth();
1864
1932
  endTracking(this, prevSub);
1865
1933
  const flags = this.flags;
1866
1934
  if ((flags & 136) === 136) {
@@ -1883,9 +1951,9 @@ var ReactiveEffect = class {
1883
1951
  if (flags & 16) return true;
1884
1952
  if (flags & 32) {
1885
1953
  if (checkDirty(this.deps, this)) {
1886
- this.flags = flags | 16;
1954
+ if (this.active) this.flags |= 16;
1887
1955
  return true;
1888
- } else this.flags = flags & -33;
1956
+ } else this.flags &= -33;
1889
1957
  }
1890
1958
  return false;
1891
1959
  }
@@ -1897,20 +1965,17 @@ function effect(fn, options) {
1897
1965
  if (options) {
1898
1966
  const { onStop, scheduler } = options;
1899
1967
  if (onStop) {
1900
- options.onStop = void 0;
1901
1968
  const stop = e.stop.bind(e);
1902
1969
  e.stop = () => {
1903
1970
  stop();
1904
1971
  onStop();
1905
1972
  };
1906
1973
  }
1907
- if (scheduler) {
1908
- options.scheduler = void 0;
1909
- e.notify = () => {
1910
- if (!(e.flags & 256)) scheduler();
1911
- };
1912
- }
1913
- extend(e, options);
1974
+ if (scheduler) e.notify = () => {
1975
+ if (!(e.flags & 1280)) scheduler();
1976
+ };
1977
+ e.onTrack = options.onTrack;
1978
+ e.onTrigger = options.onTrigger;
1914
1979
  }
1915
1980
  try {
1916
1981
  e.run();
@@ -1970,8 +2035,10 @@ var EffectScope = class {
1970
2035
  const flags = this.flags;
1971
2036
  if (flags & 256) {
1972
2037
  this.flags = flags & -257;
1973
- for (let link = this.deps; link !== void 0; link = link.nextDep) {
1974
- const dep = link.dep;
2038
+ const deps = [];
2039
+ for (let link = this.deps; link !== void 0; link = link.nextDep) deps.push(link.dep);
2040
+ for (let i = 0; i < deps.length; i++) {
2041
+ const dep = deps[i];
1975
2042
  if ("resume" in dep) dep.resume();
1976
2043
  }
1977
2044
  }
@@ -2000,8 +2067,10 @@ var EffectScope = class {
2000
2067
  while (dep !== void 0) {
2001
2068
  const node = dep.dep;
2002
2069
  if ("stop" in node) {
2003
- dep = dep.nextDep;
2070
+ const prev = dep.prevDep;
2004
2071
  node.stop();
2072
+ const next = prev !== void 0 ? prev.nextDep : this.deps;
2073
+ dep = next === dep ? dep.nextDep : next;
2005
2074
  } else dep = unlink(dep, this);
2006
2075
  }
2007
2076
  cleanup(this);
@@ -2042,11 +2111,14 @@ function setCurrentScope(scope) {
2042
2111
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#onscopedispose}
2043
2112
  */
2044
2113
  function onScopeDispose(fn, failSilently = false) {
2045
- if (activeEffectScope !== void 0) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
2046
- else if (!failSilently) warn$2("onScopeDispose() is called when there is no active effect scope to be associated with.");
2114
+ if (activeEffectScope !== void 0) {
2115
+ if (activeEffectScope.active) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
2116
+ else fn();
2117
+ } else if (!failSilently) warn$2("onScopeDispose() is called when there is no active effect scope to be associated with.");
2047
2118
  }
2048
2119
  //#endregion
2049
2120
  //#region packages/reactivity/src/computed.ts
2121
+ const FAILED = 64;
2050
2122
  /**
2051
2123
  * @private exported by @vue/reactivity for Vue core use, but not exported from
2052
2124
  * the main vue package
@@ -2095,12 +2167,24 @@ var ComputedRefImpl = class {
2095
2167
  }
2096
2168
  get value() {
2097
2169
  const flags = this.flags;
2098
- if (flags & 16 || flags & 32 && checkDirty(this.deps, this)) {
2099
- if (this.update()) {
2100
- const subs = this.subs;
2101
- if (subs !== void 0) shallowPropagate(subs);
2102
- }
2103
- } else if (flags & 32) this.flags = flags & -33;
2170
+ try {
2171
+ if (flags & 16 || flags & 32 && checkDirty(this.deps, this)) {
2172
+ if (this.update()) {
2173
+ const subs = this.subs;
2174
+ if (subs !== void 0) shallowPropagate(subs);
2175
+ }
2176
+ } else if (flags & 32) this.flags = flags & -33;
2177
+ } catch (err) {
2178
+ if (activeSub !== void 0) {
2179
+ onTrack(activeSub, {
2180
+ target: this,
2181
+ type: "get",
2182
+ key: "value"
2183
+ });
2184
+ link(this, activeSub);
2185
+ } else if (activeEffectScope !== void 0) link(this, activeEffectScope);
2186
+ throw err;
2187
+ }
2104
2188
  if (activeSub !== void 0) {
2105
2189
  onTrack(activeSub, {
2106
2190
  target: this,
@@ -2108,7 +2192,18 @@ var ComputedRefImpl = class {
2108
2192
  key: "value"
2109
2193
  });
2110
2194
  link(this, activeSub);
2111
- } else if (activeEffectScope !== void 0) link(this, activeEffectScope);
2195
+ } else if (activeEffectScope !== void 0) {
2196
+ if (activeEffectScope.active) link(this, activeEffectScope);
2197
+ else if (this.subs === void 0) {
2198
+ let dep = this.deps;
2199
+ if (dep !== void 0) {
2200
+ do
2201
+ dep = unlink(dep, this);
2202
+ while (dep !== void 0);
2203
+ this.flags |= 16;
2204
+ }
2205
+ }
2206
+ }
2112
2207
  return this._value;
2113
2208
  }
2114
2209
  set value(newValue) {
@@ -2120,11 +2215,15 @@ var ComputedRefImpl = class {
2120
2215
  try {
2121
2216
  const oldValue = this._value;
2122
2217
  const newValue = this.fn(oldValue);
2123
- if (hasChanged(oldValue, newValue)) {
2218
+ if (hasChanged(oldValue, newValue) || this.flags & FAILED) {
2124
2219
  this._value = newValue;
2220
+ this.flags &= -65;
2125
2221
  return true;
2126
2222
  }
2127
2223
  return false;
2224
+ } catch (err) {
2225
+ this.flags |= FAILED;
2226
+ throw err;
2128
2227
  } finally {
2129
2228
  endTracking(this, prevSub);
2130
2229
  }
@@ -2145,6 +2244,7 @@ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
2145
2244
  cRef.onTrack = debugOptions.onTrack;
2146
2245
  cRef.onTrigger = debugOptions.onTrigger;
2147
2246
  }
2247
+ if (isSSR && activeEffectScope !== void 0) link(cRef, activeEffectScope);
2148
2248
  return cRef;
2149
2249
  }
2150
2250
  //#endregion
@@ -2515,7 +2615,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2515
2615
  if (isFunction(fn)) {
2516
2616
  const res = callWithErrorHandling(fn, instance, type, args);
2517
2617
  if (res && isPromise(res)) res.catch((err) => {
2518
- handleError(err, instance, type);
2618
+ handleError(err, instance, type, void 0, true);
2519
2619
  });
2520
2620
  return res;
2521
2621
  }
@@ -2525,7 +2625,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2525
2625
  return values;
2526
2626
  } else warn$1(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`);
2527
2627
  }
2528
- function handleError(err, instance, type, throwInDev = true) {
2628
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
2529
2629
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2530
2630
  if (instance) {
2531
2631
  let cur = instance.parent;
@@ -2533,7 +2633,7 @@ function handleError(err, instance, type, throwInDev = true) {
2533
2633
  const errorInfo = ErrorTypeStrings$1[type];
2534
2634
  while (cur) {
2535
2635
  const errorCapturedHooks = cur.ec;
2536
- if (errorCapturedHooks) {
2636
+ if (errorCapturedHooks && !cur.isUnmounted && (!isAsyncError || cur.scope.active)) {
2537
2637
  for (let i = 0; i < errorCapturedHooks.length; i++) if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) return;
2538
2638
  }
2539
2639
  cur = cur.parent;
@@ -2838,7 +2938,11 @@ function reload(id, newComp) {
2838
2938
  updateComponentDef(record.initialDef, newComp);
2839
2939
  const instances = [...record.instances];
2840
2940
  if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
2841
- for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
2941
+ for (const instance of instances) {
2942
+ if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
2943
+ const oldComp = normalizeClassComponent(instance.type);
2944
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2945
+ }
2842
2946
  const dirtyInstances = new Set(instances);
2843
2947
  const rerenderedParents = /* @__PURE__ */ new Set();
2844
2948
  runWithHmrUpdating(() => {
@@ -2879,7 +2983,25 @@ function reload(id, newComp) {
2879
2983
  if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2880
2984
  }
2881
2985
  parents.forEach((parent) => {
2882
- queueJob(() => {
2986
+ const children = instances.filter((instance) => instance.parent === parent);
2987
+ const update = () => {
2988
+ if (!parent.scope.active) return;
2989
+ const activeChildren = children.filter((instance) => instance.scope.active);
2990
+ if (!activeChildren.length) return;
2991
+ const pending = activeChildren.find((instance) => instance.asyncDep && !instance.asyncResolved) || locateUnresolvedAsyncRoot(parent);
2992
+ if (pending) {
2993
+ pending.asyncDep.catch(NOOP).then(() => {
2994
+ if (parent.scope.active && (pending.asyncResolved || !pending.scope.active)) queueJob(update);
2995
+ });
2996
+ return;
2997
+ }
2998
+ for (const instance of activeChildren) {
2999
+ const oldComp = normalizeClassComponent(instance.type);
3000
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
3001
+ if (!dirtyInstances) hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
3002
+ dirtyInstances.add(instance);
3003
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
3004
+ }
2883
3005
  runWithHmrUpdating(() => {
2884
3006
  if (parent.vapor) parent.hmrRerender();
2885
3007
  else {
@@ -2890,7 +3012,12 @@ function reload(id, newComp) {
2890
3012
  }
2891
3013
  }
2892
3014
  });
2893
- });
3015
+ queuePostFlushCb(() => {
3016
+ hmrDirtyComponents.clear();
3017
+ hmrDirtyComponentsMode.clear();
3018
+ });
3019
+ };
3020
+ queueJob(update);
2894
3021
  });
2895
3022
  }
2896
3023
  queuePostFlushCb(() => {
@@ -3087,18 +3214,35 @@ function withDirectives(vnode, directives) {
3087
3214
  return vnode;
3088
3215
  }
3089
3216
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3090
- const bindings = vnode.dirs;
3217
+ let hookVNode = vnode;
3218
+ if (name === "beforeMount") vnode._mount = vnode;
3219
+ else if (name === "beforeUpdate") {
3220
+ const mount = prevVNode && prevVNode._mount;
3221
+ if (mount) {
3222
+ mount._latest = vnode;
3223
+ vnode._mount = mount;
3224
+ }
3225
+ } else if (name === "mounted") {
3226
+ const latest = vnode._latest;
3227
+ vnode._mount = vnode._latest = void 0;
3228
+ if (latest) {
3229
+ hookVNode = latest;
3230
+ latest._mount = void 0;
3231
+ }
3232
+ }
3233
+ const bindings = hookVNode.dirs;
3091
3234
  const oldBindings = prevVNode && prevVNode.dirs;
3092
3235
  for (let i = 0; i < bindings.length; i++) {
3093
- const binding = bindings[i];
3236
+ let binding = bindings[i];
3094
3237
  if (oldBindings) binding.oldValue = oldBindings[i].value;
3238
+ else if (name === "mounted" && binding.oldValue !== void 0) binding = extend({}, binding, { oldValue: void 0 });
3095
3239
  let hook = binding.dir[name];
3096
3240
  if (hook) {
3097
3241
  const prevSub = setActiveSub();
3098
3242
  callWithAsyncErrorHandling(hook, instance, 8, [
3099
3243
  vnode.el,
3100
3244
  binding,
3101
- vnode,
3245
+ hookVNode,
3102
3246
  prevVNode
3103
3247
  ]);
3104
3248
  setActiveSub(prevSub);
@@ -3523,7 +3667,15 @@ const BaseTransitionImpl = {
3523
3667
  const { mode } = rawProps;
3524
3668
  checkTransitionMode(mode);
3525
3669
  return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
3526
- if (!(instance.effect.flags & 1024)) instance.update();
3670
+ if (!(instance.effect.flags & 1024)) {
3671
+ if (instance.effect.running) {
3672
+ const job = () => {
3673
+ if (!(instance.effect.flags & 1024)) instance.update();
3674
+ };
3675
+ job.i = instance;
3676
+ queueJob(job);
3677
+ } else instance.update();
3678
+ }
3527
3679
  }) : NOOP);
3528
3680
  };
3529
3681
  }
@@ -3553,7 +3705,7 @@ function getLeavingNodesForType(state, vnode) {
3553
3705
  }
3554
3706
  return leavingVNodesCache;
3555
3707
  }
3556
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3708
+ function resolveTransitionHooks(vnode, props, state, instance) {
3557
3709
  const key = String(vnode.key);
3558
3710
  const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3559
3711
  const hooks = baseResolveTransitionHooks({
@@ -3576,9 +3728,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3576
3728
  }
3577
3729
  },
3578
3730
  cloneHooks: (vnode) => {
3579
- const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
3580
- if (postClone) postClone(hooks);
3581
- return hooks;
3731
+ return resolveTransitionHooks(vnode, props, state, instance);
3582
3732
  }
3583
3733
  }, props, state, instance);
3584
3734
  if (isVaporInteropEnabled && vnode.type === VaporSlot) extend(hooks, {
@@ -3616,7 +3766,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
3616
3766
  callHook(hook, [el]);
3617
3767
  },
3618
3768
  enter(el) {
3619
- if (!isHmrUpdating && isLeaving()) return;
3769
+ if (!isHmrUpdating && isLeaving(el)) return;
3620
3770
  let hook = onEnter;
3621
3771
  let afterHook = onAfterEnter;
3622
3772
  let cancelHook = onEnterCancelled;
@@ -3660,7 +3810,19 @@ function baseResolveTransitionHooks(context, props, state, instance) {
3660
3810
  else done();
3661
3811
  },
3662
3812
  clone(node) {
3663
- return cloneHooks ? cloneHooks(node) : hooks;
3813
+ if (!cloneHooks) return hooks;
3814
+ const cloned = cloneHooks(node);
3815
+ cloned.afterLeave = () => {
3816
+ if (hooks.afterLeave) hooks.afterLeave();
3817
+ };
3818
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
3819
+ if (hooks.delayLeave) hooks.delayLeave(el, earlyRemove, delayedLeave);
3820
+ else delayedLeave();
3821
+ };
3822
+ cloned.delayedLeave = () => {
3823
+ if (hooks.delayedLeave) hooks.delayedLeave();
3824
+ };
3825
+ return cloned;
3664
3826
  }
3665
3827
  };
3666
3828
  return hooks;
@@ -3695,10 +3857,7 @@ function prepareTransitionSwitch(previous, next, props, state, instance, resumeA
3695
3857
  if (state.isLeaving) return emptyPlaceholder(next);
3696
3858
  const nextInner = getInnerChild$1(next);
3697
3859
  if (!nextInner) return emptyPlaceholder(next);
3698
- let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
3699
- if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
3700
- enterHooks = hooks;
3701
- });
3860
+ const enterHooks = resolveTransitionHooks(nextInner, props, state, instance);
3702
3861
  if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
3703
3862
  if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
3704
3863
  const mode = props.mode;
@@ -3764,9 +3923,14 @@ function setTransitionHooks(vnode, hooks) {
3764
3923
  return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
3765
3924
  }
3766
3925
  } else if (vnode.shapeFlag & 128) {
3767
- const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3768
- const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3769
- return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
3926
+ const suspense = vnode.suspense;
3927
+ if (suspense) {
3928
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
3929
+ if (branch) return setTransitionHooks(branch, hooks.clone(branch));
3930
+ } else {
3931
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3932
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3933
+ }
3770
3934
  } else {
3771
3935
  vnode.transition = hooks;
3772
3936
  if (vnode.type === Fragment && isArray(vnode.children)) {
@@ -3985,7 +4149,7 @@ const getContainerType = (container) => {
3985
4149
  };
3986
4150
  const isComment = (node) => node.nodeType === 8;
3987
4151
  /** The data of a comment opening a range a hydration steps over as one. */
3988
- const isRangeStart = (data) => data === "[" || data === "(" || isVaporBranchStart(data);
4152
+ const isRangeStart = (data) => data === "[" || data === "(" || isVaporRangeStart(data);
3989
4153
  function createHydrationFunctions(rendererInternals) {
3990
4154
  const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
3991
4155
  const hydrate = (vnode, container) => {
@@ -4003,7 +4167,7 @@ function createHydrationFunctions(rendererInternals) {
4003
4167
  };
4004
4168
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
4005
4169
  optimized = optimized || !!vnode.dynamicChildren;
4006
- const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporBranchStart(node.data));
4170
+ const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporRangeStart(node.data));
4007
4171
  const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
4008
4172
  const { type, ref, shapeFlag, patchFlag } = vnode;
4009
4173
  let domType = node.nodeType;
@@ -4192,10 +4356,11 @@ function createHydrationFunctions(rendererInternals) {
4192
4356
  const container = parentNode(node);
4193
4357
  const first = nextSibling(node);
4194
4358
  const next = isVaporInteropEnabled && vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
4195
- if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
4359
+ const close = isVaporInteropEnabled ? rangeCloseOf(node.data) : node.data === "(" ? ")" : "]";
4360
+ if (next && isComment(next) && next.data === close) return nextSibling(vnode.anchor = next);
4196
4361
  else {
4197
4362
  logMismatchError();
4198
- insert(vnode.anchor = createComment(`]`), container, next);
4363
+ insert(vnode.anchor = createComment(close), container, next);
4199
4364
  return next;
4200
4365
  }
4201
4366
  };
@@ -4217,13 +4382,13 @@ function createHydrationFunctions(rendererInternals) {
4217
4382
  const container = parentNode(node);
4218
4383
  remove(node);
4219
4384
  patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
4220
- if (parentComponent && parentComponent.vnode) {
4385
+ if (parentComponent && parentComponent.vnode && parentComponent.vnode.el === node) {
4221
4386
  parentComponent.vnode.el = vnode.el;
4222
4387
  updateHOCHostEl(parentComponent, vnode.el);
4223
4388
  }
4224
4389
  return next;
4225
4390
  };
4226
- const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
4391
+ const locateClosingAnchor = (node, open = node && isComment(node) && (node.data === "(" || isVaporInteropEnabled && node.data === "{") ? node.data : "[", close = isVaporInteropEnabled ? rangeCloseOf(open) : open === "(" ? ")" : "]") => {
4227
4392
  let match = 0;
4228
4393
  while (node) {
4229
4394
  node = nextSibling(node);
@@ -4486,7 +4651,7 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
4486
4651
  function forEachElement(node, cb) {
4487
4652
  if (isComment(node) && isRangeStart(node.data)) {
4488
4653
  const open = node.data;
4489
- const close = open === "(" ? ")" : "]";
4654
+ const close = rangeCloseOf(open);
4490
4655
  let depth = 1;
4491
4656
  let next = node.nextSibling;
4492
4657
  while (next) {
@@ -4523,7 +4688,7 @@ function defineAsyncComponent(source) {
4523
4688
  if (resolvedComp) return () => createInnerComp(resolvedComp, instance);
4524
4689
  const onError = (err) => {
4525
4690
  setPendingRequest(null);
4526
- handleError(err, instance, 13, !errorComponent);
4691
+ handleError(err, instance, 13, !errorComponent, true);
4527
4692
  };
4528
4693
  if (suspensible && instance.suspense || false) return load().then((comp) => {
4529
4694
  return () => createInnerComp(comp, instance);
@@ -4604,10 +4769,12 @@ const useAsyncComponentState = (delay = 200, timeout, onError, instance = curren
4604
4769
  const delayed = /* @__PURE__ */ ref(!!delay);
4605
4770
  let timeoutTimer;
4606
4771
  let delayTimer;
4607
- if (instance) onUnmounted(() => {
4608
- if (timeoutTimer != null) clearTimeout(timeoutTimer);
4609
- if (delayTimer != null) clearTimeout(delayTimer);
4610
- }, instance);
4772
+ if (instance) instance.scope.run(() => {
4773
+ onScopeDispose(() => {
4774
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
4775
+ if (delayTimer != null) clearTimeout(delayTimer);
4776
+ });
4777
+ });
4611
4778
  if (delay) delayTimer = setTimeout(() => {
4612
4779
  if (instance && instance.isUnmounted) return;
4613
4780
  delayed.value = false;
@@ -4642,7 +4809,12 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
4642
4809
  }
4643
4810
  return;
4644
4811
  }
4645
- if (!el.parentNode || wasConnected && !el.isConnected) return;
4812
+ if (!el.parentNode) return;
4813
+ if (wasConnected && !el.isConnected) {
4814
+ let current = instance;
4815
+ while (current && !current.isDeactivated) current = current.parent;
4816
+ if (!current) return;
4817
+ }
4646
4818
  hydrate();
4647
4819
  };
4648
4820
  const doHydrate = hydrateStrategy ? () => {
@@ -4696,7 +4868,11 @@ const KeepAlive = /*@__PURE__*/ withKeepAliveEnabled({
4696
4868
  activate(vnode, container, anchor, renderer, keepAliveInstance, parentSuspense, namespace, optimized);
4697
4869
  };
4698
4870
  sharedContext.deactivate = (vnode) => {
4699
- deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
4871
+ const cached = sharedContext.getCachedComponent(vnode);
4872
+ if (!cached || cached.component !== vnode.component) return false;
4873
+ if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(keepAliveInstance, vnode).deactivate(vnode, storageContainer, parentSuspense);
4874
+ else deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
4875
+ return true;
4700
4876
  };
4701
4877
  function unmount(vnode) {
4702
4878
  resetShapeFlag(vnode);
@@ -4728,11 +4904,15 @@ const KeepAlive = /*@__PURE__*/ withKeepAliveEnabled({
4728
4904
  let pendingCacheKey = null;
4729
4905
  const cacheSubtree = () => {
4730
4906
  if (pendingCacheKey != null) {
4731
- if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
4732
- const vnode = getInnerChild(keepAliveInstance.subTree);
4733
- if (vnode.component) cache.set(pendingCacheKey, vnode);
4734
- }, void 0, keepAliveInstance.subTree.suspense);
4735
- else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
4907
+ if (isSuspense(keepAliveInstance.subTree.type)) {
4908
+ const cacheInnerChild = () => {
4909
+ const vnode = getInnerChild(keepAliveInstance.subTree);
4910
+ if (vnode.component) cache.set(pendingCacheKey, vnode);
4911
+ };
4912
+ const suspense = keepAliveInstance.subTree.suspense;
4913
+ if (suspense.pendingBranch) queuePostRenderEffect(cacheInnerChild, void 0, suspense);
4914
+ else cacheInnerChild();
4915
+ } else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
4736
4916
  }
4737
4917
  };
4738
4918
  onMounted(cacheSubtree);
@@ -4837,9 +5017,8 @@ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance())
4837
5017
  }
4838
5018
  function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
4839
5019
  const injected = injectHook(type, hook, keepAliveRoot, true);
4840
- onUnmounted(() => {
4841
- remove(keepAliveRoot[type], injected);
4842
- }, target);
5020
+ const removal = injectHook("um", () => remove(keepAliveRoot[type], injected), target);
5021
+ removal.flags = 8;
4843
5022
  }
4844
5023
  function resetShapeFlag(vnode) {
4845
5024
  vnode.shapeFlag &= -257;
@@ -5047,6 +5226,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
5047
5226
  ret.props = extend({}, ret.props, { key: branchKey });
5048
5227
  ret.key = branchKey;
5049
5228
  }
5229
+ if (isBlockTreeEnabled <= 0) {
5230
+ if (!ret.vs.props) ret.vs.props = ret.props;
5231
+ ret.props = ret.key != null ? { key: ret.key } : null;
5232
+ ret.vs.attrs = EMPTY_OBJ;
5233
+ }
5050
5234
  if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
5051
5235
  return ret;
5052
5236
  }
@@ -6847,8 +7031,10 @@ function baseCreateRenderer(options, createHydrationFns) {
6847
7031
  def(el, "__vnode", vnode, true);
6848
7032
  def(el, "__vueParentComponent", parentComponent, true);
6849
7033
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6850
- if (transition) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
6851
- else hostInsert(el, container, anchor);
7034
+ if (transition) {
7035
+ if (!needTransition(parentSuspense, transition) && !transition.persisted) el[deferredEnterKey] = true;
7036
+ performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
7037
+ } else hostInsert(el, container, anchor);
6852
7038
  if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
6853
7039
  const isHmr = isHmrUpdating;
6854
7040
  queuePostRenderEffect(() => {
@@ -7105,16 +7291,20 @@ function baseCreateRenderer(options, createHydrationFns) {
7105
7291
  } else {
7106
7292
  let { next, bu, u, parent, vnode } = instance;
7107
7293
  {
7108
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
7109
- if (nonHydratedAsyncRoot) {
7294
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
7295
+ if (unresolvedAsyncRoot) {
7110
7296
  if (next) {
7111
7297
  next.el = vnode.el;
7112
7298
  updateComponentPreRender(instance, next, optimized);
7113
7299
  }
7114
- nonHydratedAsyncRoot.asyncDep.then(() => {
7115
- queuePostRenderEffect(() => {
7116
- if (!instance.isUnmounted) instance.update();
7117
- }, void 0, parentSuspense);
7300
+ unresolvedAsyncRoot.asyncDep.then(() => {
7301
+ const retry = () => {
7302
+ if (instance.effect.flags & 1024) return;
7303
+ if (parentSuspense && parentSuspense.pendingBranch) queuePostRenderEffect(retry, void 0, parentSuspense);
7304
+ else instance.update();
7305
+ };
7306
+ retry.flags = 24;
7307
+ queuePostRenderEffect(retry, void 0, parentSuspense);
7118
7308
  });
7119
7309
  return;
7120
7310
  }
@@ -7137,7 +7327,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7137
7327
  const prevTree = instance.subTree;
7138
7328
  instance.subTree = nextTree;
7139
7329
  startMeasure(instance, `patch`);
7140
- patch(prevTree, nextTree, hostParentNode(prevTree.el), getNextHostNode(prevTree), instance, parentSuspense, namespace);
7330
+ patch(prevTree, nextTree, hostParentNode(prevTree.el || resolveAsyncComponentPlaceholder(prevTree)), getNextHostNode(prevTree), instance, parentSuspense, namespace);
7141
7331
  endMeasure(instance, `patch`);
7142
7332
  next.el = nextTree.el;
7143
7333
  if (originNext === null) updateHOCHostEl(instance, nextTree.el);
@@ -7340,9 +7530,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7340
7530
  }
7341
7531
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
7342
7532
  if (shapeFlag & 256) {
7343
- if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
7344
- else parentComponent.ctx.deactivate(vnode);
7345
- return;
7533
+ if (parentComponent.ctx.deactivate(vnode)) return;
7346
7534
  }
7347
7535
  if (isVaporInteropEnabled && shapeFlag & 6 && isVaporComponent(type)) {
7348
7536
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
@@ -7422,12 +7610,14 @@ function baseCreateRenderer(options, createHydrationFns) {
7422
7610
  if (effect) {
7423
7611
  effect.stop();
7424
7612
  unmount(subTree, instance, parentSuspense, doRemove);
7425
- } else if (instance.vnode.el && subTree) {
7613
+ } else if (subTree) {
7426
7614
  subTree.transition = instance.vnode.transition;
7427
7615
  unmount(subTree, instance, parentSuspense, doRemove);
7428
7616
  }
7429
7617
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
7430
- queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
7618
+ const markUnmounted = () => instance.isUnmounted = true;
7619
+ markUnmounted.flags = 8;
7620
+ queuePostRenderEffect(markUnmounted, void 0, parentSuspense);
7431
7621
  devtoolsComponentRemoved(instance);
7432
7622
  };
7433
7623
  const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
@@ -7541,11 +7731,11 @@ function traverseStaticChildren(n1, n2, shallow = false) {
7541
7731
  c2.el && (c2.el.__vnode = c2);
7542
7732
  }
7543
7733
  }
7544
- function locateNonHydratedAsyncRoot(instance) {
7734
+ function locateUnresolvedAsyncRoot(instance) {
7545
7735
  const subComponent = instance.subTree && instance.subTree.component;
7546
7736
  if (subComponent) {
7547
7737
  if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
7548
- else return locateNonHydratedAsyncRoot(subComponent);
7738
+ else return locateUnresolvedAsyncRoot(subComponent);
7549
7739
  }
7550
7740
  }
7551
7741
  function invalidateMount(hooks) {
@@ -7615,7 +7805,9 @@ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true
7615
7805
  function resolveAsyncComponentPlaceholder(anchorVnode) {
7616
7806
  if (anchorVnode.placeholder) return anchorVnode.placeholder;
7617
7807
  const instance = anchorVnode.component;
7618
- if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
7808
+ if (instance && instance.subTree) return resolveAsyncComponentPlaceholder(instance.subTree);
7809
+ const suspense = anchorVnode.suspense;
7810
+ if (suspense && suspense.activeBranch) return resolveAsyncComponentPlaceholder(suspense.activeBranch);
7619
7811
  return null;
7620
7812
  }
7621
7813
  //#endregion
@@ -7627,17 +7819,22 @@ function withSuspenseEnabled(value) {
7627
7819
  return value;
7628
7820
  }
7629
7821
  let suspenseId = 0;
7822
+ const deferredEnterKey = Symbol("_deferredEnter");
7630
7823
  const Suspense = /*@__PURE__*/ withSuspenseEnabled({
7631
7824
  name: "Suspense",
7632
7825
  __isSuspense: true,
7633
7826
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
7634
7827
  if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
7635
7828
  else {
7636
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
7637
- n2.suspense = n1.suspense;
7638
- n2.suspense.vnode = n2;
7639
- n2.el = n1.el;
7640
- return;
7829
+ const suspense = n1.suspense;
7830
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
7831
+ const owner = suspense.parentComponent;
7832
+ if (!!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId ? parentSuspense.pendingBranch && !isSameVNodeType(n2.ssContent, suspense.pendingBranch || suspense.activeBranch) : !suspense.isInFallback) {
7833
+ n2.suspense = suspense;
7834
+ suspense.vnode = n2;
7835
+ n2.el = n1.el;
7836
+ return;
7837
+ }
7641
7838
  }
7642
7839
  patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, rendererInternals);
7643
7840
  }
@@ -7649,6 +7846,36 @@ function triggerEvent(vnode, name) {
7649
7846
  const eventListener = vnode.props && vnode.props[name];
7650
7847
  if (isFunction(eventListener)) eventListener();
7651
7848
  }
7849
+ function enterDeferred(suspense, branch) {
7850
+ const enters = [];
7851
+ collectDeferredEnters(branch, enters, true);
7852
+ if (isVaporInteropEnabled) {
7853
+ const { parentComponent } = suspense;
7854
+ const vapor = parentComponent && parentComponent.appContext.vapor;
7855
+ if (vapor) vapor.enterDeferred(suspense, enters);
7856
+ }
7857
+ if (enters.length) queuePostFlushCb(enters);
7858
+ }
7859
+ function collectDeferredEnters(vnode, enters, isRoot) {
7860
+ const { el, transition, children, shapeFlag } = vnode;
7861
+ if (shapeFlag & 6) {
7862
+ const subTree = vnode.component.subTree;
7863
+ if (subTree) collectDeferredEnters(subTree, enters, isRoot);
7864
+ return;
7865
+ }
7866
+ if (shapeFlag & 192) return;
7867
+ if (shapeFlag & 1) {
7868
+ if (!isRoot && el && el[deferredEnterKey]) {
7869
+ el[deferredEnterKey] = void 0;
7870
+ if (transition && !transition.persisted) {
7871
+ transition.beforeEnter(el);
7872
+ enters.push(() => transition.enter(el));
7873
+ }
7874
+ }
7875
+ isRoot = false;
7876
+ }
7877
+ if (shapeFlag & 16) for (let i = 0; i < children.length; i++) collectDeferredEnters(children[i], enters, isRoot);
7878
+ }
7652
7879
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
7653
7880
  const { p: patch, o: { createElement } } = rendererInternals;
7654
7881
  const hiddenContainer = createElement("div");
@@ -7688,11 +7915,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7688
7915
  suspense.activeBranch = pendingBranch;
7689
7916
  } else unmount(pendingBranch, parentComponent, suspense);
7690
7917
  suspense.deps = 0;
7691
- for (let i = 0; i < suspense.effects.length; i++) {
7692
- const effect = suspense.effects[i];
7693
- if (effect.flags & 8) queuePostFlushCb(effect);
7694
- }
7695
- suspense.effects.length = 0;
7918
+ discardEffects(suspense);
7696
7919
  suspense.hiddenContainer = createElement("div");
7697
7920
  if (isInFallback) {
7698
7921
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
@@ -7715,14 +7938,14 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7715
7938
  } else {
7716
7939
  triggerEvent(n2, "onPending");
7717
7940
  suspense.pendingBranch = newBranch;
7718
- if (newBranch.shapeFlag & 512) suspense.pendingId = newBranch.component.suspenseId;
7719
- else suspense.pendingId = suspenseId++;
7941
+ suspense.pendingId = suspenseId++;
7720
7942
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
7721
7943
  if (suspense.deps <= 0) suspense.resolve();
7722
7944
  else {
7723
- const { timeout, pendingId } = suspense;
7724
- if (timeout > 0) setTimeout(() => {
7725
- if (suspense.pendingId === pendingId) suspense.fallback(newFallback);
7945
+ const { timeout } = suspense;
7946
+ if (timeout > 0) suspense.timeoutTimer = setTimeout(() => {
7947
+ suspense.timeoutTimer = void 0;
7948
+ suspense.fallback(suspense.vnode.ssFallback);
7726
7949
  }, timeout);
7727
7950
  else if (timeout === 0) suspense.fallback(newFallback);
7728
7951
  }
@@ -7758,6 +7981,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7758
7981
  deps: 0,
7759
7982
  pendingId: suspenseId++,
7760
7983
  timeout: typeof timeout === "number" ? timeout : -1,
7984
+ timeoutTimer: void 0,
7761
7985
  activeBranch: null,
7762
7986
  isFallbackMountPending: false,
7763
7987
  pendingBranch: null,
@@ -7775,26 +7999,39 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7775
7999
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
7776
8000
  let hasUpdatedAnchor = false;
7777
8001
  if (delayEnter) activeBranch.transition.afterLeave = () => {
7778
- if (pendingId === suspense.pendingId) {
8002
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
8003
+ enterDeferred(suspense, pendingBranch);
7779
8004
  move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
7780
8005
  queuePostFlushCb(effects);
7781
8006
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
7782
8007
  }
7783
8008
  };
7784
8009
  if (activeBranch && !suspense.isFallbackMountPending) {
7785
- if (parentNode(activeBranch.el) === container) {
8010
+ if (parentNode(activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)) === container) {
7786
8011
  anchor = next(activeBranch);
7787
8012
  hasUpdatedAnchor = true;
7788
8013
  }
7789
8014
  unmount(activeBranch, parentComponent, suspense, true);
7790
8015
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
7791
8016
  }
7792
- if (!delayEnter) move(pendingBranch, container, anchor, 0, parentComponent);
8017
+ if (!delayEnter) {
8018
+ enterDeferred(suspense, pendingBranch);
8019
+ move(pendingBranch, container, anchor, 0, parentComponent);
8020
+ }
7793
8021
  }
8022
+ clearTimeout(suspense.timeoutTimer);
8023
+ suspense.timeoutTimer = void 0;
7794
8024
  suspense.isFallbackMountPending = false;
7795
8025
  setActiveBranch(suspense, pendingBranch);
7796
8026
  suspense.pendingBranch = null;
7797
8027
  suspense.isInFallback = false;
8028
+ let kept = 0;
8029
+ for (let i = 0; i < effects.length; i++) {
8030
+ const effect = effects[i];
8031
+ if (effect.flags & 16) queuePostFlushCb(effect);
8032
+ else effects[kept++] = effect;
8033
+ }
8034
+ effects.length = kept;
7798
8035
  let parent = suspense.parent;
7799
8036
  let hasUnresolvedAncestor = false;
7800
8037
  while (parent) {
@@ -7817,13 +8054,13 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7817
8054
  triggerEvent(vnode, "onResolve");
7818
8055
  },
7819
8056
  fallback(fallbackVNode) {
7820
- if (!suspense.pendingBranch) return;
8057
+ if (suspense.isUnmounted || !suspense.pendingBranch) return;
7821
8058
  const { vnode, activeBranch, parentComponent, container, namespace } = suspense;
7822
8059
  triggerEvent(vnode, "onFallback");
7823
8060
  const anchor = next(activeBranch);
7824
8061
  const mountFallback = () => {
7825
8062
  suspense.isFallbackMountPending = false;
7826
- if (!suspense.isInFallback) return;
8063
+ if (suspense.isUnmounted || !suspense.isInFallback) return;
7827
8064
  const latestFallback = suspense.vnode.ssFallback;
7828
8065
  patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
7829
8066
  setActiveBranch(suspense, latestFallback);
@@ -7847,24 +8084,52 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7847
8084
  registerDep(instance, onResolve) {
7848
8085
  const isInPendingSuspense = !!suspense.pendingBranch;
7849
8086
  if (isInPendingSuspense) suspense.deps++;
8087
+ const render = (setupResult) => {
8088
+ instance.asyncResolved = true;
8089
+ onResolve(setupResult);
8090
+ };
7850
8091
  instance.asyncDep.catch((err) => {
7851
- handleError(err, instance, 0);
8092
+ handleError(err, instance, 0, false, true);
8093
+ return () => null;
7852
8094
  }).then((asyncSetupResult) => {
7853
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
8095
+ if (instance.isUnmounted || suspense.isUnmounted) return;
8096
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
7854
8097
  setCurrentInstance(null, void 0);
7855
8098
  if (!instance.scope.active) {
7856
- if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
8099
+ if (isPendingDep && --suspense.deps === 0) suspense.resolve();
7857
8100
  return;
7858
8101
  }
7859
- instance.asyncResolved = true;
7860
- onResolve(asyncSetupResult);
7861
- if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
8102
+ if (!isPendingDep && suspense.pendingBranch) {
8103
+ const job = () => {
8104
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) return;
8105
+ if (suspense.pendingBranch) queueEffectWithSuspense(job, void 0, suspense);
8106
+ else render(asyncSetupResult);
8107
+ };
8108
+ job.flags = 24;
8109
+ queueEffectWithSuspense(job, void 0, suspense);
8110
+ return;
8111
+ }
8112
+ render(asyncSetupResult);
8113
+ if (isPendingDep && --suspense.deps === 0) suspense.resolve();
7862
8114
  });
7863
8115
  },
7864
8116
  unmount(parentSuspense, doRemove) {
7865
8117
  suspense.isUnmounted = true;
8118
+ clearTimeout(suspense.timeoutTimer);
8119
+ suspense.timeoutTimer = void 0;
8120
+ if (parentSuspenseId !== void 0) {
8121
+ const parent = suspense.parent;
8122
+ const pendingId = parentSuspenseId;
8123
+ parentSuspenseId = void 0;
8124
+ queuePostFlushCb(() => {
8125
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) parent.resolve();
8126
+ });
8127
+ }
7866
8128
  if (suspense.activeBranch) unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove);
7867
- if (suspense.pendingBranch) unmount(suspense.pendingBranch, parentComponent, parentSuspense, doRemove);
8129
+ if (suspense.pendingBranch) {
8130
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
8131
+ discardEffects(suspense);
8132
+ }
7868
8133
  }
7869
8134
  };
7870
8135
  return suspense;
@@ -7905,6 +8170,14 @@ function normalizeSuspenseSlot(s) {
7905
8170
  if (block && !s.dynamicChildren) s.dynamicChildren = block.filter((c) => c !== s);
7906
8171
  return s;
7907
8172
  }
8173
+ function discardEffects(suspense) {
8174
+ const { effects } = suspense;
8175
+ for (let i = 0; i < effects.length; i++) {
8176
+ const effect = effects[i];
8177
+ if (effect.flags & 8) queuePostFlushCb(effect);
8178
+ }
8179
+ effects.length = 0;
8180
+ }
7908
8181
  function queueEffectWithSuspense(fn, id, suspense) {
7909
8182
  if (suspense && suspense.pendingBranch) {
7910
8183
  if (isArray(fn)) suspense.effects.push(...fn);
@@ -8129,7 +8402,8 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
8129
8402
  }
8130
8403
  function guardReactiveProps(props) {
8131
8404
  if (!props) return null;
8132
- return /* @__PURE__ */ isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
8405
+ if (/* @__PURE__ */ isProxy(props)) return extend({}, props);
8406
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
8133
8407
  }
8134
8408
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
8135
8409
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -8515,7 +8789,8 @@ function setupStatefulComponent(instance, isSSR) {
8515
8789
  setInSSRSetupState(false);
8516
8790
  }
8517
8791
  }).catch((e) => {
8518
- handleError(e, instance, 0);
8792
+ handleError(e, instance, 0, void 0, true);
8793
+ instance.ssrRender = (_, push) => push("<!---->");
8519
8794
  });
8520
8795
  else {
8521
8796
  instance.asyncDep = setupResult;
@@ -8584,11 +8859,16 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8584
8859
  else warn$1(`Component is missing template or render function: `, Component);
8585
8860
  }
8586
8861
  }
8862
+ /**
8863
+ * Read through the setup context `attrs` proxy to get the raw attrs object.
8864
+ * @internal
8865
+ */
8866
+ const rawAttrsKey = Symbol();
8587
8867
  const attrsProxyHandlers = {
8588
8868
  get(target, key) {
8589
8869
  markAttrsAccessed();
8590
8870
  track(target, "get", "");
8591
- return target[key];
8871
+ return key === rawAttrsKey ? target : target[key];
8592
8872
  },
8593
8873
  set() {
8594
8874
  warn$1(`setupContext.attrs is readonly.`);
@@ -8886,7 +9166,7 @@ function isMemoSame(cached, memo) {
8886
9166
  }
8887
9167
  //#endregion
8888
9168
  //#region packages/runtime-core/src/index.ts
8889
- const version = "3.6.0-rc.14";
9169
+ const version = "3.6.0-rc.15";
8890
9170
  const warn = warn$1;
8891
9171
  /**
8892
9172
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -9707,7 +9987,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
9707
9987
  }
9708
9988
  this._styleAnchors.delete(this._def);
9709
9989
  this._applyStyles(newStyles);
9710
- if (!this._instance.vapor) this._instance = null;
9990
+ this._instance = null;
9711
9991
  this._update();
9712
9992
  };
9713
9993
  const dispatch = (event, args) => {
@@ -10320,15 +10600,15 @@ const vModelSelect = {
10320
10600
  vModelSelectInit(el, value, number);
10321
10601
  el[assignKey] = getModelAssigner(vnode);
10322
10602
  },
10323
- mounted(el, { value }) {
10324
- vModelSetSelected(el, value);
10603
+ mounted(el, { value, modifiers: { number } }) {
10604
+ vModelSetSelected(el, value, number);
10325
10605
  },
10326
10606
  beforeUpdate(el, { value }, vnode) {
10327
10607
  el._modelValue = value;
10328
10608
  el[assignKey] = getModelAssigner(vnode);
10329
10609
  },
10330
- updated(el, { value }) {
10331
- vModelSetSelected(el, value);
10610
+ updated(el, { value, modifiers: { number } }) {
10611
+ vModelSetSelected(el, value, number);
10332
10612
  }
10333
10613
  };
10334
10614
  /**
@@ -10363,14 +10643,14 @@ function isSameSelectValue(value, assignedValue, multiple) {
10363
10643
  /**
10364
10644
  * @internal
10365
10645
  */
10366
- const vModelSetSelected = (el, value) => {
10646
+ const vModelSetSelected = (el, value, number = false) => {
10367
10647
  el._modelValue = value;
10368
10648
  const pending = el._pendingValue;
10369
10649
  el._pendingValue = void 0;
10370
10650
  if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
10371
- setSelected(el, value);
10651
+ setSelected(el, value, number);
10372
10652
  };
10373
- function setSelected(el, value) {
10653
+ function setSelected(el, value, number) {
10374
10654
  const isMultiple = el.multiple;
10375
10655
  const isArrayValue = isArray(value);
10376
10656
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -10385,7 +10665,7 @@ function setSelected(el, value) {
10385
10665
  const optionType = typeof optionValue;
10386
10666
  if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
10387
10667
  else option.selected = looseIndexOf(value, optionValue) > -1;
10388
- } else option.selected = value.has(optionValue);
10668
+ } else option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
10389
10669
  } else if (looseEqual(getValue(option), value)) {
10390
10670
  if (el.selectedIndex !== i) el.selectedIndex = i;
10391
10671
  return;