@vue/compat 3.6.0-beta.8 → 3.6.0-rc.1

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/compat v3.6.0-beta.8
2
+ * @vue/compat v3.6.0-rc.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -522,6 +522,13 @@ var Vue = (function() {
522
522
  const notifyBuffer = [];
523
523
  let batchDepth = 0;
524
524
  let activeSub = void 0;
525
+ let runDepth = 0;
526
+ function incRunDepth() {
527
+ ++runDepth;
528
+ }
529
+ function decRunDepth() {
530
+ --runDepth;
531
+ }
525
532
  let globalVersion = 0;
526
533
  let notifyIndex = 0;
527
534
  let notifyBufferLength = 0;
@@ -595,8 +602,10 @@ var Vue = (function() {
595
602
  const sub = link.sub;
596
603
  let flags = sub.flags;
597
604
  if (flags & 3) {
598
- if (!(flags & 60)) sub.flags = flags | 32;
599
- else if (!(flags & 12)) flags = 0;
605
+ if (!(flags & 60)) {
606
+ sub.flags = flags | 32;
607
+ if (runDepth) sub.flags |= 8;
608
+ } else if (!(flags & 12)) flags = 0;
600
609
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
601
610
  else if (!(flags & 48) && isValidLink(link, sub)) {
602
611
  sub.flags = flags | 40;
@@ -665,13 +674,13 @@ var Vue = (function() {
665
674
  let dirty = false;
666
675
  if (sub.flags & 16) dirty = true;
667
676
  else if ((depFlags & 17) === 17) {
677
+ const subs = dep.subs;
668
678
  if (dep.update()) {
669
- const subs = dep.subs;
670
679
  if (subs.nextSub !== void 0) shallowPropagate(subs);
671
680
  dirty = true;
672
681
  }
673
682
  } else if ((depFlags & 33) === 33) {
674
- if (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {
683
+ stack = {
675
684
  value: link,
676
685
  prev: stack
677
686
  };
@@ -686,15 +695,12 @@ var Vue = (function() {
686
695
  }
687
696
  while (checkDepth) {
688
697
  --checkDepth;
689
- const firstSub = sub.subs;
690
- const hasMultipleSubs = firstSub.nextSub !== void 0;
691
- if (hasMultipleSubs) {
692
- link = stack.value;
693
- stack = stack.prev;
694
- } else link = firstSub;
698
+ link = stack.value;
699
+ stack = stack.prev;
695
700
  if (dirty) {
701
+ const subs = sub.subs;
696
702
  if (sub.update()) {
697
- if (hasMultipleSubs) shallowPropagate(firstSub);
703
+ if (subs.nextSub !== void 0) shallowPropagate(subs);
698
704
  sub = link.sub;
699
705
  continue;
700
706
  }
@@ -706,7 +712,7 @@ var Vue = (function() {
706
712
  }
707
713
  dirty = false;
708
714
  }
709
- return dirty;
715
+ return dirty && !!sub.flags;
710
716
  } while (true);
711
717
  }
712
718
  function shallowPropagate(link) {
@@ -1089,7 +1095,7 @@ var Vue = (function() {
1089
1095
  }
1090
1096
  const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
1091
1097
  const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
1092
- if (target === /* @__PURE__ */ toRaw(receiver)) {
1098
+ if (target === /* @__PURE__ */ toRaw(receiver) && result) {
1093
1099
  if (!hadKey) trigger(target, "add", key, value);
1094
1100
  else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
1095
1101
  }
@@ -1307,9 +1313,6 @@ var Vue = (function() {
1307
1313
  default: return 0;
1308
1314
  }
1309
1315
  }
1310
- function getTargetType(value) {
1311
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
1312
- }
1313
1316
  /* @__NO_SIDE_EFFECTS__ */
1314
1317
  function reactive(target) {
1315
1318
  if (/* @__PURE__ */ isReadonly(target)) return target;
@@ -1422,10 +1425,11 @@ var Vue = (function() {
1422
1425
  return target;
1423
1426
  }
1424
1427
  if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
1425
- const targetType = getTargetType(target);
1426
- if (targetType === 0) return target;
1428
+ if (target["__v_skip"] || !Object.isExtensible(target)) return target;
1427
1429
  const existingProxy = proxyMap.get(target);
1428
1430
  if (existingProxy) return existingProxy;
1431
+ const targetType = targetTypeMap(toRawType(target));
1432
+ if (targetType === 0) return target;
1429
1433
  const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
1430
1434
  proxyMap.set(target, proxy);
1431
1435
  return proxy;
@@ -1773,16 +1777,16 @@ var Vue = (function() {
1773
1777
  return ret;
1774
1778
  }
1775
1779
  var ObjectRefImpl = class {
1776
- constructor(_object, _key, _defaultValue) {
1780
+ constructor(_object, key, _defaultValue) {
1777
1781
  this._object = _object;
1778
- this._key = _key;
1779
1782
  this._defaultValue = _defaultValue;
1780
1783
  this["__v_isRef"] = true;
1781
1784
  this._value = void 0;
1785
+ this._key = isSymbol(key) ? key : String(key);
1782
1786
  this._raw = /* @__PURE__ */ toRaw(_object);
1783
1787
  let shallow = true;
1784
1788
  let obj = _object;
1785
- if (!isArray(_object) || !isIntegerKey(String(_key))) do
1789
+ if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) do
1786
1790
  shallow = !/* @__PURE__ */ isProxy(obj) || /* @__PURE__ */ isShallow(obj);
1787
1791
  while (shallow && (obj = obj["__v_raw"]));
1788
1792
  this._shallow = shallow;
@@ -1858,9 +1862,11 @@ var Vue = (function() {
1858
1862
  if (!this.active) return this.fn();
1859
1863
  cleanup(this);
1860
1864
  const prevSub = startTracking(this);
1865
+ incRunDepth();
1861
1866
  try {
1862
1867
  return this.fn();
1863
1868
  } finally {
1869
+ decRunDepth();
1864
1870
  endTracking(this, prevSub);
1865
1871
  const flags = this.flags;
1866
1872
  if ((flags & 136) === 136) {
@@ -2241,8 +2247,9 @@ var Vue = (function() {
2241
2247
  if (once && cb) {
2242
2248
  const _cb = cb;
2243
2249
  cb = (...args) => {
2244
- _cb(...args);
2250
+ const res = _cb(...args);
2245
2251
  this.stop();
2252
+ return res;
2246
2253
  };
2247
2254
  }
2248
2255
  this.cb = cb;
@@ -2256,7 +2263,7 @@ var Vue = (function() {
2256
2263
  if (!this.cb) return;
2257
2264
  const { immediate, deep, call } = this.options;
2258
2265
  if (initialRun && !immediate) return;
2259
- if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2266
+ if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2260
2267
  cleanup(this);
2261
2268
  const currentWatcher = activeWatcher;
2262
2269
  activeWatcher = this;
@@ -2563,8 +2570,8 @@ var Vue = (function() {
2563
2570
  /**
2564
2571
  * @internal for runtime-vapor only
2565
2572
  */
2566
- function queueJob(job, id, isPre = false) {
2567
- if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
2573
+ function queueJob(job, id, isPre = false, order = 0) {
2574
+ if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : order ? id * 2 + 1 + order / (order + 1) : id * 2 + 1, jobs, jobsLength, flushIndex)) {
2568
2575
  jobsLength++;
2569
2576
  queueFlush();
2570
2577
  }
@@ -2673,6 +2680,7 @@ var Vue = (function() {
2673
2680
  }
2674
2681
  flushIndex = 0;
2675
2682
  jobsLength = 0;
2683
+ jobs.length = 0;
2676
2684
  flushPostFlushCbs(seen);
2677
2685
  currentFlushPromise = null;
2678
2686
  if (jobsLength || postJobs.length) flushJobs(seen);
@@ -2692,6 +2700,13 @@ var Vue = (function() {
2692
2700
  //#endregion
2693
2701
  //#region packages/runtime-core/src/hmr.ts
2694
2702
  let isHmrUpdating = false;
2703
+ const setHmrUpdating = (v) => {
2704
+ try {
2705
+ return isHmrUpdating;
2706
+ } finally {
2707
+ isHmrUpdating = v;
2708
+ }
2709
+ };
2695
2710
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2696
2711
  const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
2697
2712
  getGlobalThis().__VUE_HMR_RUNTIME__ = {
@@ -2723,6 +2738,14 @@ var Vue = (function() {
2723
2738
  function normalizeClassComponent(component) {
2724
2739
  return isClassComponent(component) ? component.__vccOpts : component;
2725
2740
  }
2741
+ function hasDirtyAncestor(instance, dirtyInstances) {
2742
+ let parent = instance.parent;
2743
+ while (parent) {
2744
+ if (dirtyInstances.has(parent)) return true;
2745
+ parent = parent.parent;
2746
+ }
2747
+ return false;
2748
+ }
2726
2749
  function rerender(id, newRender) {
2727
2750
  const record = map.get(id);
2728
2751
  if (!record) return;
@@ -2754,42 +2777,69 @@ var Vue = (function() {
2754
2777
  const isVapor = record.initialDef.__vapor;
2755
2778
  updateComponentDef(record.initialDef, newComp);
2756
2779
  const instances = [...record.instances];
2757
- if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
2780
+ if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
2758
2781
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
2759
- for (const instance of instances) instance.hmrReload(newComp);
2760
- } else for (const instance of instances) {
2761
- const oldComp = normalizeClassComponent(instance.type);
2762
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
2763
- if (!dirtyInstances) {
2764
- if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2765
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2766
- }
2767
- dirtyInstances.add(instance);
2768
- hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2769
- instance.appContext.propsCache.delete(instance.type);
2770
- instance.appContext.emitsCache.delete(instance.type);
2771
- instance.appContext.optionsCache.delete(instance.type);
2772
- if (instance.ceReload) {
2773
- dirtyInstances.add(instance);
2774
- instance.ceReload(newComp.styles);
2775
- dirtyInstances.delete(instance);
2776
- } else if (instance.parent) queueJob(() => {
2777
- isHmrUpdating = true;
2782
+ const dirtyInstances = new Set(instances);
2783
+ const rerenderedParents = /* @__PURE__ */ new Set();
2784
+ for (const instance of instances) {
2778
2785
  const parent = instance.parent;
2779
- if (parent.vapor) parent.hmrRerender();
2780
- else if (!(parent.effect.flags & 1024)) {
2781
- parent.renderCache = [];
2782
- parent.effect.run();
2786
+ if (parent) {
2787
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
2788
+ rerenderedParents.add(parent);
2789
+ parent.hmrRerender();
2790
+ }
2791
+ } else instance.hmrReload(newComp);
2792
+ }
2793
+ } else {
2794
+ const parentUpdates = /* @__PURE__ */ new Map();
2795
+ const dirtyInstanceSet = new Set(instances);
2796
+ for (const instance of instances) {
2797
+ const oldComp = normalizeClassComponent(instance.type);
2798
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
2799
+ if (!dirtyInstances) {
2800
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2801
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2783
2802
  }
2784
- nextTick(() => {
2785
- isHmrUpdating = false;
2803
+ dirtyInstances.add(instance);
2804
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2805
+ instance.appContext.propsCache.delete(instance.type);
2806
+ instance.appContext.emitsCache.delete(instance.type);
2807
+ instance.appContext.optionsCache.delete(instance.type);
2808
+ if (instance.ceReload) {
2809
+ dirtyInstances.add(instance);
2810
+ instance.ceReload(newComp.styles);
2811
+ dirtyInstances.delete(instance);
2812
+ } else if (instance.parent) {
2813
+ const parent = instance.parent;
2814
+ if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
2815
+ let updates = parentUpdates.get(parent);
2816
+ if (!updates) parentUpdates.set(parent, updates = []);
2817
+ updates.push([instance, dirtyInstances]);
2818
+ }
2819
+ } else if (instance.appContext.reload) instance.appContext.reload();
2820
+ else if (typeof window !== "undefined") window.location.reload();
2821
+ else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2822
+ if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2823
+ }
2824
+ parentUpdates.forEach((updates, parent) => {
2825
+ queueJob(() => {
2826
+ isHmrUpdating = true;
2827
+ if (parent.vapor) parent.hmrRerender();
2828
+ else {
2829
+ const i = parent;
2830
+ if (!(i.effect.flags & 1024)) {
2831
+ i.renderCache = [];
2832
+ i.effect.run();
2833
+ }
2834
+ }
2835
+ nextTick(() => {
2836
+ isHmrUpdating = false;
2837
+ });
2838
+ updates.forEach(([instance, dirtyInstances]) => {
2839
+ dirtyInstances.delete(instance);
2840
+ });
2786
2841
  });
2787
- dirtyInstances.delete(instance);
2788
2842
  });
2789
- else if (instance.appContext.reload) instance.appContext.reload();
2790
- else if (typeof window !== "undefined") window.location.reload();
2791
- else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2792
- if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2793
2843
  }
2794
2844
  queuePostFlushCb(() => {
2795
2845
  hmrDirtyComponents.clear();
@@ -3256,10 +3306,12 @@ var Vue = (function() {
3256
3306
  const renderFnWithContext = (...args) => {
3257
3307
  if (renderFnWithContext._d) setBlockTracking(-1);
3258
3308
  const prevInstance = setCurrentRenderingInstance(ctx);
3309
+ const prevStackSize = blockStack.length;
3259
3310
  let res;
3260
3311
  try {
3261
3312
  res = fn(...args);
3262
3313
  } finally {
3314
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
3263
3315
  setCurrentRenderingInstance(prevInstance);
3264
3316
  if (renderFnWithContext._d) setBlockTracking(1);
3265
3317
  }
@@ -3470,6 +3522,7 @@ var Vue = (function() {
3470
3522
  }
3471
3523
  //#endregion
3472
3524
  //#region packages/runtime-core/src/components/Teleport.ts
3525
+ const pendingMounts = /* @__PURE__ */ new WeakMap();
3473
3526
  const TeleportEndKey = Symbol("_vte");
3474
3527
  const isTeleport = (type) => type.__isTeleport;
3475
3528
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
@@ -3495,55 +3548,68 @@ var Vue = (function() {
3495
3548
  name: "Teleport",
3496
3549
  __isTeleport: true,
3497
3550
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
3498
- const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
3551
+ const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
3499
3552
  const disabled = isTeleportDisabled(n2.props);
3500
- let { shapeFlag, children, dynamicChildren } = n2;
3553
+ let { dynamicChildren } = n2;
3501
3554
  if (isHmrUpdating) {
3502
3555
  optimized = false;
3503
3556
  dynamicChildren = null;
3504
3557
  }
3558
+ const mount = (vnode, container, anchor) => {
3559
+ if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3560
+ };
3561
+ const mountToTarget = (vnode = n2) => {
3562
+ const disabled = isTeleportDisabled(vnode.props);
3563
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
3564
+ const targetAnchor = prepareAnchor(target, vnode, createText, insert);
3565
+ if (target) {
3566
+ if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
3567
+ else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
3568
+ if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3569
+ if (!disabled) {
3570
+ mount(vnode, target, targetAnchor);
3571
+ updateCssVars(vnode, false);
3572
+ }
3573
+ } else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3574
+ };
3575
+ const queuePendingMount = (vnode) => {
3576
+ const mountJob = () => {
3577
+ if (pendingMounts.get(vnode) !== mountJob) return;
3578
+ pendingMounts.delete(vnode);
3579
+ if (isTeleportDisabled(vnode.props)) {
3580
+ mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
3581
+ updateCssVars(vnode, true);
3582
+ }
3583
+ mountToTarget(vnode);
3584
+ };
3585
+ pendingMounts.set(vnode, mountJob);
3586
+ queuePostRenderEffect(mountJob, void 0, parentSuspense);
3587
+ };
3505
3588
  if (n1 == null) {
3506
3589
  const placeholder = n2.el = createComment("teleport start");
3507
3590
  const mainAnchor = n2.anchor = createComment("teleport end");
3508
3591
  insert(placeholder, container, anchor);
3509
3592
  insert(mainAnchor, container, anchor);
3510
- const mount = (container, anchor) => {
3511
- if (shapeFlag & 16) mountChildren(children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3512
- };
3513
- const mountToTarget = () => {
3514
- const target = n2.target = resolveTarget(n2.props, querySelector);
3515
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
3516
- if (target) {
3517
- if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
3518
- else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
3519
- if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3520
- if (!disabled) {
3521
- mount(target, targetAnchor);
3522
- updateCssVars(n2, false);
3523
- }
3524
- } else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3525
- };
3593
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3594
+ queuePendingMount(n2);
3595
+ return;
3596
+ }
3526
3597
  if (disabled) {
3527
- mount(container, mainAnchor);
3598
+ mount(n2, container, mainAnchor);
3528
3599
  updateCssVars(n2, true);
3529
3600
  }
3530
- if (isTeleportDeferred(n2.props)) {
3531
- n2.el.__isMounted = false;
3532
- queuePostRenderEffect(() => {
3533
- mountToTarget();
3534
- delete n2.el.__isMounted;
3535
- }, void 0, parentSuspense);
3536
- } else mountToTarget();
3601
+ mountToTarget();
3537
3602
  } else {
3538
- if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
3539
- queuePostRenderEffect(() => {
3540
- TeleportImpl.process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals);
3541
- }, void 0, parentSuspense);
3603
+ n2.el = n1.el;
3604
+ const mainAnchor = n2.anchor = n1.anchor;
3605
+ const pendingMount = pendingMounts.get(n1);
3606
+ if (pendingMount) {
3607
+ pendingMount.flags |= 4;
3608
+ pendingMounts.delete(n1);
3609
+ queuePendingMount(n2);
3542
3610
  return;
3543
3611
  }
3544
- n2.el = n1.el;
3545
3612
  n2.targetStart = n1.targetStart;
3546
- const mainAnchor = n2.anchor = n1.anchor;
3547
3613
  const target = n2.target = n1.target;
3548
3614
  const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3549
3615
  const wasDisabled = isTeleportDisabled(n1.props);
@@ -3559,26 +3625,30 @@ var Vue = (function() {
3559
3625
  if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
3560
3626
  else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
3561
3627
  } else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
3562
- const nextTarget = n2.target = resolveTarget(n2.props, querySelector);
3563
- if (nextTarget) moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
3564
- else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
3628
+ const nextTarget = resolveTarget(n2.props, querySelector);
3629
+ if (nextTarget) {
3630
+ n2.target = nextTarget;
3631
+ moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
3632
+ } else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
3565
3633
  } else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
3566
3634
  updateCssVars(n2, disabled);
3567
3635
  }
3568
3636
  },
3569
3637
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
3570
3638
  const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
3571
- if (target) {
3572
- hostRemove(targetStart);
3573
- hostRemove(targetAnchor);
3574
- }
3639
+ const disabled = isTeleportDisabled(props);
3640
+ const shouldRemove = doRemove || !disabled;
3641
+ const pendingMount = pendingMounts.get(vnode);
3642
+ if (pendingMount) {
3643
+ pendingMount.flags |= 4;
3644
+ pendingMounts.delete(vnode);
3645
+ }
3646
+ if (targetStart) hostRemove(targetStart);
3647
+ if (targetAnchor) hostRemove(targetAnchor);
3575
3648
  doRemove && hostRemove(anchor);
3576
- if (shapeFlag & 16) {
3577
- const shouldRemove = doRemove || !isTeleportDisabled(props);
3578
- for (let i = 0; i < children.length; i++) {
3579
- const child = children[i];
3580
- unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3581
- }
3649
+ if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3650
+ const child = children[i];
3651
+ unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3582
3652
  }
3583
3653
  },
3584
3654
  move: moveTeleport,
@@ -3589,7 +3659,7 @@ var Vue = (function() {
3589
3659
  const { el, anchor, shapeFlag, children, props } = vnode;
3590
3660
  const isReorder = moveType === 2;
3591
3661
  if (isReorder) insert(el, container, parentAnchor);
3592
- if (!isReorder || isTeleportDisabled(props)) {
3662
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3593
3663
  if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
3594
3664
  }
3595
3665
  if (isReorder) insert(anchor, container, parentAnchor);
@@ -3714,8 +3784,8 @@ var Vue = (function() {
3714
3784
  const state = useTransitionState();
3715
3785
  return () => {
3716
3786
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
3717
- if (!children || !children.length) return;
3718
- const child = findNonCommentChild(children);
3787
+ const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
3788
+ if (!child) return;
3719
3789
  const rawProps = /* @__PURE__ */ toRaw(props);
3720
3790
  const { mode } = rawProps;
3721
3791
  checkTransitionMode(mode);
@@ -3831,7 +3901,7 @@ var Vue = (function() {
3831
3901
  callHook(hook, [el]);
3832
3902
  },
3833
3903
  enter(el) {
3834
- if (isLeaving()) return;
3904
+ if (!isHmrUpdating && isLeaving()) return;
3835
3905
  let hook = onEnter;
3836
3906
  let afterHook = onAfterEnter;
3837
3907
  let cancelHook = onEnterCancelled;
@@ -4168,7 +4238,7 @@ var Vue = (function() {
4168
4238
  else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
4169
4239
  break;
4170
4240
  case VaporSlot:
4171
- nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
4241
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
4172
4242
  break;
4173
4243
  default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) nextNode = onMismatch();
4174
4244
  else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
@@ -4178,16 +4248,31 @@ var Vue = (function() {
4178
4248
  if (isFragmentStart) nextNode = locateClosingAnchor(node);
4179
4249
  else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
4180
4250
  else nextNode = nextSibling(node);
4181
- if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, null, parentComponent, parentSuspense);
4182
- else mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
4183
- if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4184
- let subTree;
4185
- if (isFragmentStart) {
4186
- subTree = createVNode(Fragment);
4187
- subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4188
- } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
4189
- subTree.el = node;
4190
- vnode.component.subTree = subTree;
4251
+ if (vnode.type.__vapor) {
4252
+ const vnodeBeforeMountHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeBeforeMount;
4253
+ getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
4254
+ if (vnode.dirs) {
4255
+ invokeDirectiveHook(vnode, null, parentComponent, "created");
4256
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
4257
+ }
4258
+ }, () => {
4259
+ if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
4260
+ });
4261
+ if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
4262
+ const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
4263
+ if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
4264
+ } else {
4265
+ mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
4266
+ const component = vnode.component;
4267
+ if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved || component.asyncDep && !component.asyncResolved) {
4268
+ let subTree;
4269
+ if (isFragmentStart) {
4270
+ subTree = createVNode(Fragment);
4271
+ subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4272
+ } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
4273
+ subTree.el = node;
4274
+ component.subTree = subTree;
4275
+ }
4191
4276
  }
4192
4277
  } else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
4193
4278
  else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
@@ -4199,7 +4284,7 @@ var Vue = (function() {
4199
4284
  };
4200
4285
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
4201
4286
  optimized = optimized || !!vnode.dynamicChildren;
4202
- const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
4287
+ const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
4203
4288
  const forcePatch = type === "input" || type === "option";
4204
4289
  {
4205
4290
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
@@ -4217,15 +4302,11 @@ var Vue = (function() {
4217
4302
  }
4218
4303
  if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
4219
4304
  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
4220
- let hasWarned = false;
4305
+ if (next && !isMismatchAllowed(el, 1)) {
4306
+ warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
4307
+ logMismatchError();
4308
+ }
4221
4309
  while (next) {
4222
- if (!isMismatchAllowed(el, 1)) {
4223
- if (!hasWarned) {
4224
- warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
4225
- hasWarned = true;
4226
- }
4227
- logMismatchError();
4228
- }
4229
4310
  const cur = next;
4230
4311
  next = next.nextSibling;
4231
4312
  remove(cur);
@@ -4244,9 +4325,10 @@ var Vue = (function() {
4244
4325
  }
4245
4326
  if (props) {
4246
4327
  const isCustomElement = el.tagName.includes("-");
4328
+ const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
4247
4329
  for (const key in props) {
4248
4330
  if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
4249
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key)) patchProp(el, key, null, props[key], void 0, parentComponent);
4331
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) patchProp(el, key, null, props[key], namespace, parentComponent);
4250
4332
  }
4251
4333
  }
4252
4334
  let vnodeHooks;
@@ -4264,7 +4346,7 @@ var Vue = (function() {
4264
4346
  optimized = optimized || !!parentVNode.dynamicChildren;
4265
4347
  const children = parentVNode.children;
4266
4348
  const l = children.length;
4267
- let hasWarned = false;
4349
+ let hasCheckedMismatch = false;
4268
4350
  for (let i = 0; i < l; i++) {
4269
4351
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
4270
4352
  const isText = vnode.type === Text;
@@ -4278,12 +4360,12 @@ var Vue = (function() {
4278
4360
  node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
4279
4361
  } else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
4280
4362
  else {
4281
- if (!isMismatchAllowed(container, 1)) {
4282
- if (!hasWarned) {
4363
+ if (!hasCheckedMismatch) {
4364
+ hasCheckedMismatch = true;
4365
+ if (!isMismatchAllowed(container, 1)) {
4283
4366
  warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
4284
- hasWarned = true;
4367
+ logMismatchError();
4285
4368
  }
4286
- logMismatchError();
4287
4369
  }
4288
4370
  patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
4289
4371
  }
@@ -4303,7 +4385,7 @@ var Vue = (function() {
4303
4385
  }
4304
4386
  };
4305
4387
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
4306
- if (!isMismatchAllowed(node.parentElement, 1)) {
4388
+ if (!isNodeMismatchAllowed(node, vnode)) {
4307
4389
  warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
4308
4390
  logMismatchError();
4309
4391
  }
@@ -4467,7 +4549,9 @@ var Vue = (function() {
4467
4549
  };
4468
4550
  function isMismatchAllowed(el, allowedType) {
4469
4551
  if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
4470
- const allowedAttr = el && el.getAttribute(allowMismatchAttr);
4552
+ return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
4553
+ }
4554
+ function isMismatchAllowedByAttr(allowedAttr, allowedType) {
4471
4555
  if (allowedAttr == null) return false;
4472
4556
  else if (allowedAttr === "") return true;
4473
4557
  else {
@@ -4476,6 +4560,16 @@ var Vue = (function() {
4476
4560
  return list.includes(MismatchTypeString[allowedType]);
4477
4561
  }
4478
4562
  }
4563
+ function isNodeMismatchAllowed(node, vnode) {
4564
+ return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
4565
+ }
4566
+ function isMismatchAllowedByNode(node) {
4567
+ return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
4568
+ }
4569
+ function isMismatchAllowedByVNode({ props }) {
4570
+ const allowedAttr = props && props[allowMismatchAttr];
4571
+ return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
4572
+ }
4479
4573
  //#endregion
4480
4574
  //#region packages/runtime-core/src/hydrationStrategies.ts
4481
4575
  let requestIdleCallback;
@@ -4594,11 +4688,16 @@ var Vue = (function() {
4594
4688
  onError(err);
4595
4689
  return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
4596
4690
  });
4597
- const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
4691
+ const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
4598
4692
  load().then(() => {
4693
+ if (instance.isUnmounted) return;
4599
4694
  loaded.value = true;
4600
4695
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
4601
4696
  }).catch((err) => {
4697
+ if (instance.isUnmounted) {
4698
+ setPendingRequest(null);
4699
+ return;
4700
+ }
4602
4701
  onError(err);
4603
4702
  error.value = err;
4604
4703
  });
@@ -4656,14 +4755,22 @@ var Vue = (function() {
4656
4755
  setPendingRequest: (request) => pendingRequest = request
4657
4756
  };
4658
4757
  }
4659
- const useAsyncComponentState = (delay, timeout, onError) => {
4758
+ const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
4660
4759
  const loaded = /* @__PURE__ */ ref(false);
4661
4760
  const error = /* @__PURE__ */ ref();
4662
4761
  const delayed = /* @__PURE__ */ ref(!!delay);
4663
- if (delay) setTimeout(() => {
4762
+ let timeoutTimer;
4763
+ let delayTimer;
4764
+ if (instance) onUnmounted(() => {
4765
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
4766
+ if (delayTimer != null) clearTimeout(delayTimer);
4767
+ }, instance);
4768
+ if (delay) delayTimer = setTimeout(() => {
4769
+ if (instance && instance.isUnmounted) return;
4664
4770
  delayed.value = false;
4665
4771
  }, delay);
4666
- if (timeout != null) setTimeout(() => {
4772
+ if (timeout != null) timeoutTimer = setTimeout(() => {
4773
+ if (instance && instance.isUnmounted) return;
4667
4774
  if (!loaded.value && !error.value) {
4668
4775
  const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
4669
4776
  onError(err);
@@ -4681,6 +4788,7 @@ var Vue = (function() {
4681
4788
  * @internal
4682
4789
  */
4683
4790
  function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
4791
+ const wasConnected = el.isConnected;
4684
4792
  let patched = false;
4685
4793
  (instance.bu || (instance.bu = [])).push(() => patched = true);
4686
4794
  const performHydrate = () => {
@@ -4691,6 +4799,7 @@ var Vue = (function() {
4691
4799
  }
4692
4800
  return;
4693
4801
  }
4802
+ if (!el.parentNode || wasConnected && !el.isConnected) return;
4694
4803
  hydrate();
4695
4804
  };
4696
4805
  const doHydrate = hydrateStrategy ? () => {
@@ -5271,8 +5380,9 @@ var Vue = (function() {
5271
5380
  * Compiler runtime helper for rendering `<slot/>`
5272
5381
  * @private
5273
5382
  */
5274
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5383
+ function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
5275
5384
  let slot = slots[name];
5385
+ if (fallback) fallback.__vdom = true;
5276
5386
  const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
5277
5387
  if (vaporSlot) {
5278
5388
  const ret = (openBlock(), createBlock(VaporSlot, props));
@@ -5280,25 +5390,35 @@ var Vue = (function() {
5280
5390
  slot: vaporSlot,
5281
5391
  fallback
5282
5392
  };
5393
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
5283
5394
  return ret;
5284
5395
  }
5285
5396
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
5286
- const hasProps = Object.keys(props).length > 0;
5287
- if (name !== "default") props.name = name;
5288
- return openBlock(), createBlock(Fragment, null, [createVNode("slot", props, fallback && fallback())], hasProps ? -2 : 64);
5397
+ const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
5398
+ const hasProps = Object.keys(slotProps).length > 0;
5399
+ if (name !== "default") slotProps.name = name;
5400
+ return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
5289
5401
  }
5290
5402
  if (slot && slot.length > 1) {
5291
5403
  warn$1("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.");
5292
5404
  slot = () => [];
5293
5405
  }
5294
5406
  if (slot && slot._c) slot._d = false;
5407
+ const prevStackSize = blockStack.length;
5295
5408
  openBlock();
5296
- const validSlotContent = slot && ensureValidVNode(slot(props));
5297
- ensureVaporSlotFallback(validSlotContent, fallback);
5298
- const slotKey = props.key || validSlotContent && validSlotContent.key;
5299
- const rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
5409
+ let rendered;
5410
+ try {
5411
+ const validSlotContent = slot && ensureValidVNode(slot(props));
5412
+ ensureVaporSlotFallback(validSlotContent, fallback);
5413
+ const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
5414
+ rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
5415
+ } catch (err) {
5416
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
5417
+ throw err;
5418
+ } finally {
5419
+ if (slot && slot._c) slot._d = true;
5420
+ }
5300
5421
  if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
5301
- if (slot && slot._c) slot._d = true;
5302
5422
  return rendered;
5303
5423
  }
5304
5424
  function ensureValidVNode(vnodes) {
@@ -5311,9 +5431,7 @@ var Vue = (function() {
5311
5431
  }
5312
5432
  function ensureVaporSlotFallback(vnodes, fallback) {
5313
5433
  let vaporSlot;
5314
- if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
5315
- if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
5316
- }
5434
+ if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
5317
5435
  }
5318
5436
  //#endregion
5319
5437
  //#region packages/runtime-core/src/helpers/toHandlers.ts
@@ -5868,26 +5986,39 @@ var Vue = (function() {
5868
5986
  function withAsyncContext(getAwaitable) {
5869
5987
  const ctx = getCurrentGenericInstance();
5870
5988
  const inSSRSetup = isInSSRComponentSetup;
5989
+ const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
5871
5990
  if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
5872
5991
  let awaitable = getAwaitable();
5873
5992
  setCurrentInstance(null, void 0);
5874
5993
  if (inSSRSetup) setInSSRSetupState(false);
5875
5994
  const restore = () => {
5995
+ const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
5876
5996
  setCurrentInstance(ctx);
5877
5997
  if (inSSRSetup) setInSSRSetupState(true);
5998
+ const reset = restoreAsyncContext && restoreAsyncContext();
5999
+ return () => {
6000
+ if (reset) reset();
6001
+ if (resetStoppedScope) resetStoppedScope.reset();
6002
+ };
5878
6003
  };
5879
6004
  const cleanup = () => {
5880
6005
  setCurrentInstance(null, void 0);
5881
6006
  if (inSSRSetup) setInSSRSetupState(false);
5882
6007
  };
5883
6008
  if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
5884
- restore();
5885
- Promise.resolve().then(() => Promise.resolve().then(cleanup));
6009
+ const reset = restore();
6010
+ Promise.resolve().then(() => Promise.resolve().then(() => {
6011
+ if (reset) reset();
6012
+ cleanup();
6013
+ }));
5886
6014
  throw e;
5887
6015
  });
5888
6016
  return [awaitable, () => {
5889
- restore();
5890
- Promise.resolve().then(cleanup);
6017
+ const reset = restore();
6018
+ Promise.resolve().then(() => {
6019
+ if (reset) reset();
6020
+ cleanup();
6021
+ });
5891
6022
  }];
5892
6023
  }
5893
6024
  //#endregion
@@ -6205,7 +6336,7 @@ var Vue = (function() {
6205
6336
  if (options.el) return vm.$mount(options.el);
6206
6337
  else return vm;
6207
6338
  }
6208
- Vue.version = `2.6.14-compat:3.6.0-beta.8`;
6339
+ Vue.version = `2.6.14-compat:3.6.0-rc.1`;
6209
6340
  Vue.config = singletonApp.config;
6210
6341
  Vue.use = (plugin, ...options) => {
6211
6342
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -6460,7 +6591,9 @@ var Vue = (function() {
6460
6591
  else Object.keys(val).forEach((key) => {
6461
6592
  try {
6462
6593
  defineReactiveSimple(val, key, val[key]);
6463
- } catch (e) {}
6594
+ } catch (e) {
6595
+ warn$1(`Failed making property "${key}" reactive:`, e);
6596
+ }
6464
6597
  });
6465
6598
  }
6466
6599
  const i = obj.$;
@@ -6705,12 +6838,13 @@ var Vue = (function() {
6705
6838
  for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
6706
6839
  else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
6707
6840
  }
6708
- if (!parentPassedModelValue || !parentPassedModelUpdater) {
6841
+ const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
6842
+ if (!hasVModel) {
6709
6843
  localValue = value;
6710
6844
  trigger();
6711
6845
  }
6712
6846
  i.emit(`update:${name}`, emittedValue);
6713
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) trigger();
6847
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
6714
6848
  prevSetValue = value;
6715
6849
  prevEmittedValue = emittedValue;
6716
6850
  }
@@ -6823,7 +6957,8 @@ var Vue = (function() {
6823
6957
  function isEmitListener(options, key) {
6824
6958
  if (!options || !isOn(key)) return false;
6825
6959
  if (key.startsWith(compatModelEventPrefix)) return true;
6826
- key = key.slice(2).replace(/Once$/, "");
6960
+ key = key.slice(2);
6961
+ key = key === "Once" ? key : key.replace(/Once$/, "");
6827
6962
  return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
6828
6963
  }
6829
6964
  //#endregion
@@ -7017,15 +7152,19 @@ var Vue = (function() {
7017
7152
  if (key === "style" && isObject(nextProp) && isObject(prevProp)) return !looseEqual(nextProp, prevProp);
7018
7153
  return nextProp !== prevProp;
7019
7154
  }
7020
- function updateHOCHostEl({ vnode, parent }, el) {
7155
+ function updateHOCHostEl({ vnode, parent, suspense }, el) {
7021
7156
  while (parent && !parent.vapor) {
7022
7157
  const root = parent.subTree;
7023
- if (root.suspense && root.suspense.activeBranch === vnode) root.el = vnode.el;
7158
+ if (root.suspense && root.suspense.activeBranch === vnode) {
7159
+ root.suspense.vnode.el = root.el = el;
7160
+ vnode = root;
7161
+ }
7024
7162
  if (root === vnode) {
7025
7163
  (vnode = parent.vnode).el = el;
7026
7164
  parent = parent.parent;
7027
7165
  } else break;
7028
7166
  }
7167
+ if (suspense && suspense.activeBranch === vnode) suspense.vnode.el = el;
7029
7168
  }
7030
7169
  //#endregion
7031
7170
  //#region packages/runtime-core/src/compat/props.ts
@@ -7337,7 +7476,7 @@ var Vue = (function() {
7337
7476
  const receivedType = toRawType(value);
7338
7477
  const expectedValue = styleValue(value, expectedType);
7339
7478
  const receivedValue = styleValue(value, receivedType);
7340
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) message += ` with value ${expectedValue}`;
7479
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
7341
7480
  message += `, got ${receivedType} `;
7342
7481
  if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
7343
7482
  return message;
@@ -7346,7 +7485,8 @@ var Vue = (function() {
7346
7485
  * dev only
7347
7486
  */
7348
7487
  function styleValue(value, type) {
7349
- if (type === "String") return `"${value}"`;
7488
+ if (isSymbol(value)) return value.toString();
7489
+ else if (type === "String") return `"${value}"`;
7350
7490
  else if (type === "Number") return `${Number(value)}`;
7351
7491
  else return `${value}`;
7352
7492
  }
@@ -7363,8 +7503,11 @@ var Vue = (function() {
7363
7503
  /**
7364
7504
  * dev only
7365
7505
  */
7366
- function isBoolean(...args) {
7367
- return args.some((elem) => elem.toLowerCase() === "boolean");
7506
+ function isCoercible(...args) {
7507
+ return args.every((elem) => {
7508
+ const value = elem.toLowerCase();
7509
+ return value !== "boolean" && value !== "symbol";
7510
+ });
7368
7511
  }
7369
7512
  //#endregion
7370
7513
  //#region packages/runtime-core/src/componentSlots.ts
@@ -7634,10 +7777,19 @@ var Vue = (function() {
7634
7777
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7635
7778
  if (transition) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
7636
7779
  else hostInsert(el, container, anchor);
7637
- if ((vnodeHook = props && props.onVnodeMounted) || dirs) queuePostRenderEffect(() => {
7638
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7639
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7640
- }, void 0, parentSuspense);
7780
+ if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
7781
+ const isHmr = isHmrUpdating;
7782
+ queuePostRenderEffect(() => {
7783
+ let prev;
7784
+ prev = setHmrUpdating(isHmr);
7785
+ try {
7786
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7787
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7788
+ } finally {
7789
+ setHmrUpdating(prev);
7790
+ }
7791
+ }, void 0, parentSuspense);
7792
+ }
7641
7793
  };
7642
7794
  const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
7643
7795
  if (scopeId) hostSetScopeId(el, scopeId);
@@ -7660,7 +7812,7 @@ var Vue = (function() {
7660
7812
  if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
7661
7813
  if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
7662
7814
  parentComponent && toggleRecurse(parentComponent, true);
7663
- if (isHmrUpdating) {
7815
+ if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
7664
7816
  patchFlag = 0;
7665
7817
  optimized = false;
7666
7818
  dynamicChildren = null;
@@ -7740,19 +7892,35 @@ var Vue = (function() {
7740
7892
  n2.slotScopeIds = slotScopeIds;
7741
7893
  if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
7742
7894
  else {
7895
+ const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
7743
7896
  getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
7744
7897
  if (n2.dirs) {
7745
7898
  invokeDirectiveHook(n2, null, parentComponent, "created");
7746
7899
  invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
7747
7900
  }
7901
+ }, () => {
7902
+ if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
7748
7903
  });
7749
7904
  if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
7905
+ const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
7906
+ if (vnodeMountedHook) {
7907
+ const scopedVNode = n2;
7908
+ queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
7909
+ }
7750
7910
  }
7751
7911
  else {
7752
- getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized), () => {
7912
+ const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
7913
+ getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
7753
7914
  if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
7915
+ }, () => {
7916
+ const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
7917
+ if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
7754
7918
  });
7755
- if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, n1, parentComponent, "updated"), void 0, parentSuspense);
7919
+ const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
7920
+ if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
7921
+ n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
7922
+ vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
7923
+ }, void 0, parentSuspense);
7756
7924
  }
7757
7925
  else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
7758
7926
  else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
@@ -8108,8 +8276,10 @@ var Vue = (function() {
8108
8276
  else hostInsert(el, container, anchor);
8109
8277
  };
8110
8278
  const performLeave = () => {
8279
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
8111
8280
  if (el._isLeaving) el[leaveCbKey](true);
8112
- leave(el, () => {
8281
+ if (transition.persisted && !wasLeaving) remove();
8282
+ else leave(el, () => {
8113
8283
  remove();
8114
8284
  afterLeave && afterLeave();
8115
8285
  });
@@ -8120,7 +8290,7 @@ var Vue = (function() {
8120
8290
  else hostInsert(el, container, anchor);
8121
8291
  };
8122
8292
  const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
8123
- const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex } = vnode;
8293
+ const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
8124
8294
  if (patchFlag === -2) optimized = false;
8125
8295
  if (ref != null) {
8126
8296
  const prevSub = setActiveSub();
@@ -8140,7 +8310,10 @@ var Vue = (function() {
8140
8310
  if (shapeFlag & 6) if (isVaporComponent(type)) {
8141
8311
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
8142
8312
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
8143
- if (dirs) queuePostRenderEffect(() => invokeDirectiveHook(vnode, null, parentComponent, "unmounted"), void 0, parentSuspense);
8313
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
8314
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
8315
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
8316
+ }, void 0, parentSuspense);
8144
8317
  return;
8145
8318
  } else unmountComponent(vnode.component, parentSuspense, doRemove);
8146
8319
  else {
@@ -8158,9 +8331,11 @@ var Vue = (function() {
8158
8331
  }
8159
8332
  if (doRemove) remove(vnode);
8160
8333
  }
8161
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) queuePostRenderEffect(() => {
8334
+ const shouldInvalidateMemo = memo != null && cacheIndex == null;
8335
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) queuePostRenderEffect(() => {
8162
8336
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
8163
8337
  shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
8338
+ if (shouldInvalidateMemo) vnode.el = null;
8164
8339
  }, void 0, parentSuspense);
8165
8340
  };
8166
8341
  const remove = (vnode) => {
@@ -8200,7 +8375,7 @@ var Vue = (function() {
8200
8375
  if (effect) {
8201
8376
  effect.stop();
8202
8377
  unmount(subTree, instance, parentSuspense, doRemove);
8203
- }
8378
+ } else if (doRemove && subTree && instance.vnode.el) remove(subTree);
8204
8379
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
8205
8380
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
8206
8381
  queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
@@ -8327,6 +8502,10 @@ var Vue = (function() {
8327
8502
  if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
8328
8503
  }
8329
8504
  function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
8505
+ if (force && transition.persisted && !el[leaveCbKey]) {
8506
+ insert();
8507
+ return;
8508
+ }
8330
8509
  if (force || needTransition(parentSuspense, transition)) {
8331
8510
  transition.beforeEnter(el);
8332
8511
  insert();
@@ -8515,6 +8694,7 @@ var Vue = (function() {
8515
8694
  pendingId: suspenseId++,
8516
8695
  timeout: typeof timeout === "number" ? timeout : -1,
8517
8696
  activeBranch: null,
8697
+ isFallbackMountPending: false,
8518
8698
  pendingBranch: null,
8519
8699
  isInFallback: !isHydrating,
8520
8700
  isHydrating,
@@ -8528,20 +8708,25 @@ var Vue = (function() {
8528
8708
  if (suspense.isHydrating) suspense.isHydrating = false;
8529
8709
  else if (!resume) {
8530
8710
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
8711
+ let hasUpdatedAnchor = false;
8531
8712
  if (delayEnter) activeBranch.transition.afterLeave = () => {
8532
8713
  if (pendingId === suspense.pendingId) {
8533
- move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
8714
+ move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
8534
8715
  queuePostFlushCb(effects);
8535
8716
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
8536
8717
  }
8537
8718
  };
8538
- if (activeBranch) {
8539
- if (parentNode(activeBranch.el) === container) anchor = next(activeBranch);
8719
+ if (activeBranch && !suspense.isFallbackMountPending) {
8720
+ if (parentNode(activeBranch.el) === container) {
8721
+ anchor = next(activeBranch);
8722
+ hasUpdatedAnchor = true;
8723
+ }
8540
8724
  unmount(activeBranch, parentComponent, suspense, true);
8541
8725
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
8542
8726
  }
8543
8727
  if (!delayEnter) move(pendingBranch, container, anchor, 0, parentComponent);
8544
8728
  }
8729
+ suspense.isFallbackMountPending = false;
8545
8730
  setActiveBranch(suspense, pendingBranch);
8546
8731
  suspense.pendingBranch = null;
8547
8732
  suspense.isInFallback = false;
@@ -8571,12 +8756,16 @@ var Vue = (function() {
8571
8756
  triggerEvent(vnode, "onFallback");
8572
8757
  const anchor = next(activeBranch);
8573
8758
  const mountFallback = () => {
8759
+ suspense.isFallbackMountPending = false;
8574
8760
  if (!suspense.isInFallback) return;
8575
8761
  patch(null, fallbackVNode, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
8576
8762
  setActiveBranch(suspense, fallbackVNode);
8577
8763
  };
8578
8764
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
8579
- if (delayEnter) activeBranch.transition.afterLeave = mountFallback;
8765
+ if (delayEnter) {
8766
+ suspense.isFallbackMountPending = true;
8767
+ activeBranch.transition.afterLeave = mountFallback;
8768
+ }
8580
8769
  suspense.isInFallback = true;
8581
8770
  unmount(activeBranch, parentComponent, null, true);
8582
8771
  if (!delayEnter) mountFallback();
@@ -8595,6 +8784,7 @@ var Vue = (function() {
8595
8784
  handleError(err, instance, 0);
8596
8785
  }).then((asyncSetupResult) => {
8597
8786
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
8787
+ setCurrentInstance(null, void 0);
8598
8788
  instance.asyncResolved = true;
8599
8789
  onResolve(asyncSetupResult);
8600
8790
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
@@ -8927,12 +9117,30 @@ var Vue = (function() {
8927
9117
  el: vnode.el,
8928
9118
  anchor: vnode.anchor,
8929
9119
  ctx: vnode.ctx,
8930
- ce: vnode.ce
9120
+ ce: vnode.ce,
9121
+ vi: vnode.vi,
9122
+ vs: cloneVaporSlotMeta(vnode),
9123
+ vb: vnode.vb
8931
9124
  };
8932
9125
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
8933
9126
  defineLegacyVNodeProperties(cloned);
8934
9127
  return cloned;
8935
9128
  }
9129
+ function cloneVaporSlotMeta(vnode) {
9130
+ const vaporSlot = vnode.vs;
9131
+ if (!vaporSlot) return vaporSlot;
9132
+ const cloned = {
9133
+ slot: vaporSlot.slot,
9134
+ fallback: vaporSlot.fallback,
9135
+ outletFallback: vaporSlot.outletFallback
9136
+ };
9137
+ if (vnode.el) {
9138
+ cloned.state = vaporSlot.state;
9139
+ cloned.ref = vaporSlot.ref;
9140
+ cloned.scope = vaporSlot.scope;
9141
+ }
9142
+ return cloned;
9143
+ }
8936
9144
  /**
8937
9145
  * Dev only, for HMR of hoisted vnodes reused in v-for
8938
9146
  * https://github.com/vitejs/vite/issues/2022
@@ -8995,6 +9203,10 @@ var Vue = (function() {
8995
9203
  }
8996
9204
  }
8997
9205
  else if (isFunction(children)) {
9206
+ if (shapeFlag & 65) {
9207
+ normalizeChildren(vnode, { default: children });
9208
+ return;
9209
+ }
8998
9210
  children = {
8999
9211
  default: children,
9000
9212
  _ctx: currentRenderingInstance
@@ -9021,6 +9233,7 @@ var Vue = (function() {
9021
9233
  const existing = ret[key];
9022
9234
  const incoming = toMerge[key];
9023
9235
  if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) ret[key] = existing ? [].concat(existing, incoming) : incoming;
9236
+ else if (incoming == null && existing == null && !isModelListener(key)) ret[key] = incoming;
9024
9237
  } else if (key !== "") ret[key] = toMerge[key];
9025
9238
  }
9026
9239
  return ret;
@@ -9591,7 +9804,7 @@ var Vue = (function() {
9591
9804
  }
9592
9805
  //#endregion
9593
9806
  //#region packages/runtime-core/src/index.ts
9594
- const version = "3.6.0-beta.8";
9807
+ const version = "3.6.0-rc.1";
9595
9808
  const warn = warn$1;
9596
9809
  /**
9597
9810
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -10074,7 +10287,10 @@ var Vue = (function() {
10074
10287
  }
10075
10288
  for (const key in next) {
10076
10289
  if (key === "display") hasControlledDisplay = true;
10077
- setStyle(style, key, next[key]);
10290
+ const value = next[key];
10291
+ if (value != null) {
10292
+ if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
10293
+ } else setStyle(style, key, "");
10078
10294
  }
10079
10295
  } else if (isCssString) {
10080
10296
  if (prev !== next) {
@@ -10122,6 +10338,14 @@ var Vue = (function() {
10122
10338
  }
10123
10339
  return rawName;
10124
10340
  }
10341
+ /**
10342
+ * Browsers update textarea width/height directly during native resize.
10343
+ * Only special-case this common textarea path for now; other resize scenarios
10344
+ * still follow normal vnode style patching.
10345
+ */
10346
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
10347
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
10348
+ }
10125
10349
  //#endregion
10126
10350
  //#region packages/runtime-dom/src/modules/attrs.ts
10127
10351
  const xlinkNS = "http://www.w3.org/1999/xlink";
@@ -10205,7 +10429,7 @@ var Vue = (function() {
10205
10429
  const existingInvoker = invokers[rawName];
10206
10430
  if (nextValue && existingInvoker) existingInvoker.value = sanitizeEventValue(nextValue, rawName);
10207
10431
  else {
10208
- const [name, options] = parseName(rawName);
10432
+ const [name, options] = parseEventName(rawName);
10209
10433
  if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(sanitizeEventValue(nextValue, rawName), instance), options);
10210
10434
  else if (existingInvoker) {
10211
10435
  removeEventListener(el, name, existingInvoker, options);
@@ -10213,16 +10437,15 @@ var Vue = (function() {
10213
10437
  }
10214
10438
  }
10215
10439
  }
10216
- const optionsModifierRE = /(?:Once|Passive|Capture)$/;
10217
- function parseName(name) {
10440
+ const optionsModifierRE = /(Once|Passive|Capture)$/;
10441
+ const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
10442
+ function parseEventName(name) {
10218
10443
  let options;
10219
- if (optionsModifierRE.test(name)) {
10220
- options = {};
10221
- let m;
10222
- while (m = name.match(optionsModifierRE)) {
10223
- name = name.slice(0, name.length - m[0].length);
10224
- options[m[0].toLowerCase()] = true;
10225
- }
10444
+ let m;
10445
+ while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
10446
+ if (!options) options = {};
10447
+ name = name.slice(0, name.length - m[1].length);
10448
+ options[m[1].toLowerCase()] = true;
10226
10449
  }
10227
10450
  return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
10228
10451
  }
@@ -10233,7 +10456,21 @@ var Vue = (function() {
10233
10456
  const invoker = (e) => {
10234
10457
  if (!e._vts) e._vts = Date.now();
10235
10458
  else if (e._vts <= invoker.attached) return;
10236
- callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
10459
+ const value = invoker.value;
10460
+ if (isArray(value)) {
10461
+ const originalStop = e.stopImmediatePropagation;
10462
+ e.stopImmediatePropagation = () => {
10463
+ originalStop.call(e);
10464
+ e._stopped = true;
10465
+ };
10466
+ const handlers = value.slice();
10467
+ const args = [e];
10468
+ for (let i = 0; i < handlers.length; i++) {
10469
+ if (e._stopped) break;
10470
+ const handler = handlers[i];
10471
+ if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
10472
+ }
10473
+ } else callWithAsyncErrorHandling(value, instance, 5, [e]);
10237
10474
  };
10238
10475
  invoker.value = initialValue;
10239
10476
  invoker.attached = getNow();
@@ -10244,16 +10481,6 @@ var Vue = (function() {
10244
10481
  warn(`Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?\nExpected function or array of functions, received type ${typeof value}.`);
10245
10482
  return NOOP;
10246
10483
  }
10247
- function patchStopImmediatePropagation(e, value) {
10248
- if (isArray(value)) {
10249
- const originalStop = e.stopImmediatePropagation;
10250
- e.stopImmediatePropagation = () => {
10251
- originalStop.call(e);
10252
- e._stopped = true;
10253
- };
10254
- return value.map((fn) => (e) => !e._stopped && fn && fn(e));
10255
- } else return value;
10256
- }
10257
10484
  //#endregion
10258
10485
  //#region packages/runtime-dom/src/patchProp.ts
10259
10486
  const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
@@ -10581,7 +10808,10 @@ var Vue = (function() {
10581
10808
  replacementNodes.push(child);
10582
10809
  }
10583
10810
  parent.removeChild(o);
10584
- slotReplacements.set(o, replacementNodes);
10811
+ slotReplacements.set(o, {
10812
+ nodes: replacementNodes,
10813
+ usedFallback: !content
10814
+ });
10585
10815
  }
10586
10816
  this._updateSlotNodes(slotReplacements);
10587
10817
  }
@@ -10755,7 +10985,7 @@ var Vue = (function() {
10755
10985
  prevChildren = [];
10756
10986
  if (children) for (let i = 0; i < children.length; i++) {
10757
10987
  const child = children[i];
10758
- if (child.el && child.el instanceof Element) {
10988
+ if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
10759
10989
  prevChildren.push(child);
10760
10990
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
10761
10991
  positionMap.set(child, getPosition(child.el));
@@ -10896,7 +11126,8 @@ var Vue = (function() {
10896
11126
  const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
10897
11127
  const newValue = value == null ? "" : value;
10898
11128
  if (elValue === newValue) return;
10899
- if (document.activeElement === el && el.type !== "range") {
11129
+ const rootNode = el.getRootNode();
11130
+ if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
10900
11131
  if (lazy && value === oldValue) return;
10901
11132
  if (trim && el.value.trim() === newValue) return;
10902
11133
  }
@@ -10978,7 +11209,8 @@ var Vue = (function() {
10978
11209
  mounted(el, { value }) {
10979
11210
  vModelSetSelected(el, value);
10980
11211
  },
10981
- beforeUpdate(el, _binding, vnode) {
11212
+ beforeUpdate(el, { value }, vnode) {
11213
+ el._modelValue = value;
10982
11214
  el[assignKey] = getModelAssigner(vnode);
10983
11215
  },
10984
11216
  updated(el, { value }) {
@@ -10989,10 +11221,10 @@ var Vue = (function() {
10989
11221
  * @internal
10990
11222
  */
10991
11223
  const vModelSelectInit = (el, value, number, set) => {
10992
- const isSetModel = isSet(value);
11224
+ el._modelValue = value;
10993
11225
  addEventListener(el, "change", () => {
10994
11226
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
10995
- (set || el[assignKey])(el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]);
11227
+ (set || el[assignKey])(el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
10996
11228
  el._assigning = true;
10997
11229
  nextTick(() => {
10998
11230
  el._assigning = false;
@@ -11003,6 +11235,7 @@ var Vue = (function() {
11003
11235
  * @internal
11004
11236
  */
11005
11237
  const vModelSetSelected = (el, value) => {
11238
+ el._modelValue = value;
11006
11239
  if (el._assigning) return;
11007
11240
  const isMultiple = el.multiple;
11008
11241
  const isArrayValue = isArray(value);
@@ -12668,6 +12901,7 @@ var Vue = (function() {
12668
12901
  return [props, callPath];
12669
12902
  }
12670
12903
  function injectProp(node, prop, context) {
12904
+ if (node.type !== 13 && injectSlotKey(node, prop)) return;
12671
12905
  let propsWithInjection;
12672
12906
  /**
12673
12907
  * 1. mergeProps(...)
@@ -12706,6 +12940,20 @@ var Vue = (function() {
12706
12940
  else if (parentCall) parentCall.arguments[0] = propsWithInjection;
12707
12941
  else node.arguments[2] = propsWithInjection;
12708
12942
  }
12943
+ function injectSlotKey(node, prop) {
12944
+ var _node$arguments, _node$arguments2, _node$arguments3;
12945
+ if (prop.key.type !== 4 || prop.key.content !== "key") return false;
12946
+ const props = node.arguments[2];
12947
+ if (props && !isString(props)) {
12948
+ const [unnormalizedProps] = getUnnormalizedProps(props);
12949
+ if (unnormalizedProps && !isString(unnormalizedProps) && unnormalizedProps.type === 15 && hasProp(prop, unnormalizedProps)) return true;
12950
+ }
12951
+ (_node$arguments = node.arguments)[2] || (_node$arguments[2] = "{}");
12952
+ (_node$arguments2 = node.arguments)[3] || (_node$arguments2[3] = "undefined");
12953
+ (_node$arguments3 = node.arguments)[4] || (_node$arguments3[4] = "undefined");
12954
+ node.arguments[5] = prop.value;
12955
+ return true;
12956
+ }
12709
12957
  function hasProp(prop, props) {
12710
12958
  let result = false;
12711
12959
  if (prop.key.type === 4) {
@@ -12975,7 +13223,7 @@ var Vue = (function() {
12975
13223
  }
12976
13224
  },
12977
13225
  oncdata(start, end) {
12978
- if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
13226
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
12979
13227
  else emitError(1, start - 9);
12980
13228
  },
12981
13229
  onprocessinginstruction(start) {
@@ -13467,7 +13715,7 @@ var Vue = (function() {
13467
13715
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
13468
13716
  return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
13469
13717
  }
13470
- function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
13718
+ function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, eventDelegation = true, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
13471
13719
  const context = {
13472
13720
  filename,
13473
13721
  selfName: getSelfName(filename),
@@ -13489,6 +13737,7 @@ var Vue = (function() {
13489
13737
  bindingMetadata,
13490
13738
  inline,
13491
13739
  isTS,
13740
+ eventDelegation,
13492
13741
  onError,
13493
13742
  onWarn,
13494
13743
  compatConfig,
@@ -13500,8 +13749,10 @@ var Vue = (function() {
13500
13749
  imports: [],
13501
13750
  cached: [],
13502
13751
  constantCache: /* @__PURE__ */ new WeakMap(),
13752
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
13503
13753
  temps: 0,
13504
13754
  identifiers: Object.create(null),
13755
+ identifierScopes: Object.create(null),
13505
13756
  scopes: {
13506
13757
  vFor: 0,
13507
13758
  vSlot: 0,
@@ -13552,8 +13803,12 @@ var Vue = (function() {
13552
13803
  context.parent.children.splice(removalIndex, 1);
13553
13804
  },
13554
13805
  onNodeRemoved: NOOP,
13555
- addIdentifiers(exp) {},
13806
+ addIdentifiers(exp, type = "local") {},
13556
13807
  removeIdentifiers(exp) {},
13808
+ isSlotScopeIdentifier(name) {
13809
+ const scopes = context.identifierScopes[name];
13810
+ return scopes ? scopes[scopes.length - 1] === "slot" : false;
13811
+ },
13557
13812
  hoist(exp) {
13558
13813
  if (isString(exp)) exp = createSimpleExpression(exp);
13559
13814
  context.hoists.push(exp);
@@ -13907,6 +14162,7 @@ var Vue = (function() {
13907
14162
  case 24: break;
13908
14163
  case 25: break;
13909
14164
  case 26: break;
14165
+ /* v8 ignore start */
13910
14166
  case 10: break;
13911
14167
  default:
13912
14168
  assert(false, `unhandled codegen node type: ${node.type}`);
@@ -14124,7 +14380,7 @@ var Vue = (function() {
14124
14380
  if (dir.type === 7 && dir.name !== "for") {
14125
14381
  const exp = dir.exp;
14126
14382
  const arg = dir.arg;
14127
- if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
14383
+ if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
14128
14384
  if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
14129
14385
  }
14130
14386
  }
@@ -14265,10 +14521,9 @@ var Vue = (function() {
14265
14521
  const isTemplate = isTemplateNode(node);
14266
14522
  const memo = findDir(node, "memo");
14267
14523
  const keyProp = findProp(node, `key`, false, true);
14268
- const isDirKey = keyProp && keyProp.type === 7;
14524
+ keyProp && keyProp.type;
14269
14525
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
14270
- if (memo && keyExp && isDirKey) {}
14271
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
14526
+ const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
14272
14527
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
14273
14528
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
14274
14529
  forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);
@@ -14312,7 +14567,7 @@ var Vue = (function() {
14312
14567
  `)`
14313
14568
  ]),
14314
14569
  createCompoundExpression([
14315
- `if (_cached`,
14570
+ `if (_cached && _cached.el`,
14316
14571
  ...keyExp ? [` && _cached.key === `, keyExp] : [],
14317
14572
  ` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`
14318
14573
  ]),
@@ -15045,7 +15300,7 @@ var Vue = (function() {
15045
15300
  const child = node.children[i];
15046
15301
  if (typeof child !== "object") continue;
15047
15302
  if (child.type === 4) parseFilter(child, context);
15048
- else if (child.type === 8) rewriteFilter(node, context);
15303
+ else if (child.type === 8) rewriteFilter(child, context);
15049
15304
  else if (child.type === 5) rewriteFilter(child.content, context);
15050
15305
  }
15051
15306
  }
@@ -15480,7 +15735,7 @@ var Vue = (function() {
15480
15735
  source: ""
15481
15736
  }));
15482
15737
  const child = node.children[0];
15483
- if (child.type === 1) {
15738
+ if (child.type === 1 && !findDir(child, "if")) {
15484
15739
  for (const p of child.props) if (p.type === 7 && p.name === "show") node.props.push({
15485
15740
  type: 6,
15486
15741
  name: "persisted",