@vue/compat 3.6.0-beta.9 → 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.9
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
  **/
@@ -521,6 +521,13 @@ function warn$2(msg, ...args) {
521
521
  const notifyBuffer = [];
522
522
  let batchDepth = 0;
523
523
  let activeSub = void 0;
524
+ let runDepth = 0;
525
+ function incRunDepth() {
526
+ ++runDepth;
527
+ }
528
+ function decRunDepth() {
529
+ --runDepth;
530
+ }
524
531
  let globalVersion = 0;
525
532
  let notifyIndex = 0;
526
533
  let notifyBufferLength = 0;
@@ -594,8 +601,10 @@ function propagate(link) {
594
601
  const sub = link.sub;
595
602
  let flags = sub.flags;
596
603
  if (flags & 3) {
597
- if (!(flags & 60)) sub.flags = flags | 32;
598
- else if (!(flags & 12)) flags = 0;
604
+ if (!(flags & 60)) {
605
+ sub.flags = flags | 32;
606
+ if (runDepth) sub.flags |= 8;
607
+ } else if (!(flags & 12)) flags = 0;
599
608
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
600
609
  else if (!(flags & 48) && isValidLink(link, sub)) {
601
610
  sub.flags = flags | 40;
@@ -664,13 +673,13 @@ function checkDirty(link, sub) {
664
673
  let dirty = false;
665
674
  if (sub.flags & 16) dirty = true;
666
675
  else if ((depFlags & 17) === 17) {
676
+ const subs = dep.subs;
667
677
  if (dep.update()) {
668
- const subs = dep.subs;
669
678
  if (subs.nextSub !== void 0) shallowPropagate(subs);
670
679
  dirty = true;
671
680
  }
672
681
  } else if ((depFlags & 33) === 33) {
673
- if (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {
682
+ stack = {
674
683
  value: link,
675
684
  prev: stack
676
685
  };
@@ -685,15 +694,12 @@ function checkDirty(link, sub) {
685
694
  }
686
695
  while (checkDepth) {
687
696
  --checkDepth;
688
- const firstSub = sub.subs;
689
- const hasMultipleSubs = firstSub.nextSub !== void 0;
690
- if (hasMultipleSubs) {
691
- link = stack.value;
692
- stack = stack.prev;
693
- } else link = firstSub;
697
+ link = stack.value;
698
+ stack = stack.prev;
694
699
  if (dirty) {
700
+ const subs = sub.subs;
695
701
  if (sub.update()) {
696
- if (hasMultipleSubs) shallowPropagate(firstSub);
702
+ if (subs.nextSub !== void 0) shallowPropagate(subs);
697
703
  sub = link.sub;
698
704
  continue;
699
705
  }
@@ -705,7 +711,7 @@ function checkDirty(link, sub) {
705
711
  }
706
712
  dirty = false;
707
713
  }
708
- return dirty;
714
+ return dirty && !!sub.flags;
709
715
  } while (true);
710
716
  }
711
717
  function shallowPropagate(link) {
@@ -1088,7 +1094,7 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
1088
1094
  }
1089
1095
  const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
1090
1096
  const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
1091
- if (target === /* @__PURE__ */ toRaw(receiver)) {
1097
+ if (target === /* @__PURE__ */ toRaw(receiver) && result) {
1092
1098
  if (!hadKey) trigger(target, "add", key, value);
1093
1099
  else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
1094
1100
  }
@@ -1306,9 +1312,6 @@ function targetTypeMap(rawType) {
1306
1312
  default: return 0;
1307
1313
  }
1308
1314
  }
1309
- function getTargetType(value) {
1310
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
1311
- }
1312
1315
  /* @__NO_SIDE_EFFECTS__ */
1313
1316
  function reactive(target) {
1314
1317
  if (/* @__PURE__ */ isReadonly(target)) return target;
@@ -1421,10 +1424,11 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
1421
1424
  return target;
1422
1425
  }
1423
1426
  if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
1424
- const targetType = getTargetType(target);
1425
- if (targetType === 0) return target;
1427
+ if (target["__v_skip"] || !Object.isExtensible(target)) return target;
1426
1428
  const existingProxy = proxyMap.get(target);
1427
1429
  if (existingProxy) return existingProxy;
1430
+ const targetType = targetTypeMap(toRawType(target));
1431
+ if (targetType === 0) return target;
1428
1432
  const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
1429
1433
  proxyMap.set(target, proxy);
1430
1434
  return proxy;
@@ -1857,9 +1861,11 @@ var ReactiveEffect = class {
1857
1861
  if (!this.active) return this.fn();
1858
1862
  cleanup(this);
1859
1863
  const prevSub = startTracking(this);
1864
+ incRunDepth();
1860
1865
  try {
1861
1866
  return this.fn();
1862
1867
  } finally {
1868
+ decRunDepth();
1863
1869
  endTracking(this, prevSub);
1864
1870
  const flags = this.flags;
1865
1871
  if ((flags & 136) === 136) {
@@ -2240,8 +2246,9 @@ var WatcherEffect = class extends ReactiveEffect {
2240
2246
  if (once && cb) {
2241
2247
  const _cb = cb;
2242
2248
  cb = (...args) => {
2243
- _cb(...args);
2249
+ const res = _cb(...args);
2244
2250
  this.stop();
2251
+ return res;
2245
2252
  };
2246
2253
  }
2247
2254
  this.cb = cb;
@@ -2255,7 +2262,7 @@ var WatcherEffect = class extends ReactiveEffect {
2255
2262
  if (!this.cb) return;
2256
2263
  const { immediate, deep, call } = this.options;
2257
2264
  if (initialRun && !immediate) return;
2258
- if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2265
+ if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2259
2266
  cleanup(this);
2260
2267
  const currentWatcher = activeWatcher;
2261
2268
  activeWatcher = this;
@@ -2562,8 +2569,8 @@ function findInsertionIndex(order, queue, start, end) {
2562
2569
  /**
2563
2570
  * @internal for runtime-vapor only
2564
2571
  */
2565
- function queueJob(job, id, isPre = false) {
2566
- if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
2572
+ function queueJob(job, id, isPre = false, order = 0) {
2573
+ 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)) {
2567
2574
  jobsLength++;
2568
2575
  queueFlush();
2569
2576
  }
@@ -2672,6 +2679,7 @@ function flushJobs(seen) {
2672
2679
  }
2673
2680
  flushIndex = 0;
2674
2681
  jobsLength = 0;
2682
+ jobs.length = 0;
2675
2683
  flushPostFlushCbs(seen);
2676
2684
  currentFlushPromise = null;
2677
2685
  if (jobsLength || postJobs.length) flushJobs(seen);
@@ -2729,6 +2737,14 @@ function createRecord(id, initialDef) {
2729
2737
  function normalizeClassComponent(component) {
2730
2738
  return isClassComponent(component) ? component.__vccOpts : component;
2731
2739
  }
2740
+ function hasDirtyAncestor(instance, dirtyInstances) {
2741
+ let parent = instance.parent;
2742
+ while (parent) {
2743
+ if (dirtyInstances.has(parent)) return true;
2744
+ parent = parent.parent;
2745
+ }
2746
+ return false;
2747
+ }
2732
2748
  function rerender(id, newRender) {
2733
2749
  const record = map.get(id);
2734
2750
  if (!record) return;
@@ -2760,42 +2776,69 @@ function reload(id, newComp) {
2760
2776
  const isVapor = record.initialDef.__vapor;
2761
2777
  updateComponentDef(record.initialDef, newComp);
2762
2778
  const instances = [...record.instances];
2763
- if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
2779
+ if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
2764
2780
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
2765
- for (const instance of instances) instance.hmrReload(newComp);
2766
- } else for (const instance of instances) {
2767
- const oldComp = normalizeClassComponent(instance.type);
2768
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
2769
- if (!dirtyInstances) {
2770
- if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2771
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2772
- }
2773
- dirtyInstances.add(instance);
2774
- hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2775
- instance.appContext.propsCache.delete(instance.type);
2776
- instance.appContext.emitsCache.delete(instance.type);
2777
- instance.appContext.optionsCache.delete(instance.type);
2778
- if (instance.ceReload) {
2779
- dirtyInstances.add(instance);
2780
- instance.ceReload(newComp.styles);
2781
- dirtyInstances.delete(instance);
2782
- } else if (instance.parent) queueJob(() => {
2783
- isHmrUpdating = true;
2781
+ const dirtyInstances = new Set(instances);
2782
+ const rerenderedParents = /* @__PURE__ */ new Set();
2783
+ for (const instance of instances) {
2784
2784
  const parent = instance.parent;
2785
- if (parent.vapor) parent.hmrRerender();
2786
- else if (!(parent.effect.flags & 1024)) {
2787
- parent.renderCache = [];
2788
- parent.effect.run();
2785
+ if (parent) {
2786
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
2787
+ rerenderedParents.add(parent);
2788
+ parent.hmrRerender();
2789
+ }
2790
+ } else instance.hmrReload(newComp);
2791
+ }
2792
+ } else {
2793
+ const parentUpdates = /* @__PURE__ */ new Map();
2794
+ const dirtyInstanceSet = new Set(instances);
2795
+ for (const instance of instances) {
2796
+ const oldComp = normalizeClassComponent(instance.type);
2797
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
2798
+ if (!dirtyInstances) {
2799
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2800
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2789
2801
  }
2790
- nextTick(() => {
2791
- isHmrUpdating = false;
2802
+ dirtyInstances.add(instance);
2803
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2804
+ instance.appContext.propsCache.delete(instance.type);
2805
+ instance.appContext.emitsCache.delete(instance.type);
2806
+ instance.appContext.optionsCache.delete(instance.type);
2807
+ if (instance.ceReload) {
2808
+ dirtyInstances.add(instance);
2809
+ instance.ceReload(newComp.styles);
2810
+ dirtyInstances.delete(instance);
2811
+ } else if (instance.parent) {
2812
+ const parent = instance.parent;
2813
+ if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
2814
+ let updates = parentUpdates.get(parent);
2815
+ if (!updates) parentUpdates.set(parent, updates = []);
2816
+ updates.push([instance, dirtyInstances]);
2817
+ }
2818
+ } else if (instance.appContext.reload) instance.appContext.reload();
2819
+ else if (typeof window !== "undefined") window.location.reload();
2820
+ else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2821
+ if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2822
+ }
2823
+ parentUpdates.forEach((updates, parent) => {
2824
+ queueJob(() => {
2825
+ isHmrUpdating = true;
2826
+ if (parent.vapor) parent.hmrRerender();
2827
+ else {
2828
+ const i = parent;
2829
+ if (!(i.effect.flags & 1024)) {
2830
+ i.renderCache = [];
2831
+ i.effect.run();
2832
+ }
2833
+ }
2834
+ nextTick(() => {
2835
+ isHmrUpdating = false;
2836
+ });
2837
+ updates.forEach(([instance, dirtyInstances]) => {
2838
+ dirtyInstances.delete(instance);
2839
+ });
2792
2840
  });
2793
- dirtyInstances.delete(instance);
2794
2841
  });
2795
- else if (instance.appContext.reload) instance.appContext.reload();
2796
- else if (typeof window !== "undefined") window.location.reload();
2797
- else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2798
- if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2799
2842
  }
2800
2843
  queuePostFlushCb(() => {
2801
2844
  hmrDirtyComponents.clear();
@@ -3262,10 +3305,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
3262
3305
  const renderFnWithContext = (...args) => {
3263
3306
  if (renderFnWithContext._d) setBlockTracking(-1);
3264
3307
  const prevInstance = setCurrentRenderingInstance(ctx);
3308
+ const prevStackSize = blockStack.length;
3265
3309
  let res;
3266
3310
  try {
3267
3311
  res = fn(...args);
3268
3312
  } finally {
3313
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
3269
3314
  setCurrentRenderingInstance(prevInstance);
3270
3315
  if (renderFnWithContext._d) setBlockTracking(1);
3271
3316
  }
@@ -3480,6 +3525,7 @@ function createPathGetter(ctx, path) {
3480
3525
  }
3481
3526
  //#endregion
3482
3527
  //#region packages/runtime-core/src/components/Teleport.ts
3528
+ const pendingMounts = /* @__PURE__ */ new WeakMap();
3483
3529
  const TeleportEndKey = Symbol("_vte");
3484
3530
  const isTeleport = (type) => type.__isTeleport;
3485
3531
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
@@ -3505,58 +3551,70 @@ const TeleportImpl = {
3505
3551
  name: "Teleport",
3506
3552
  __isTeleport: true,
3507
3553
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
3508
- const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
3554
+ const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
3509
3555
  const disabled = isTeleportDisabled(n2.props);
3510
- let { shapeFlag, children, dynamicChildren } = n2;
3556
+ let { dynamicChildren } = n2;
3511
3557
  if (isHmrUpdating) {
3512
3558
  optimized = false;
3513
3559
  dynamicChildren = null;
3514
3560
  }
3561
+ const mount = (vnode, container, anchor) => {
3562
+ if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3563
+ };
3564
+ const mountToTarget = (vnode = n2) => {
3565
+ const disabled = isTeleportDisabled(vnode.props);
3566
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
3567
+ const targetAnchor = prepareAnchor(target, vnode, createText, insert);
3568
+ if (target) {
3569
+ if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
3570
+ else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
3571
+ if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3572
+ if (!disabled) {
3573
+ mount(vnode, target, targetAnchor);
3574
+ updateCssVars(vnode, false);
3575
+ }
3576
+ } else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3577
+ };
3578
+ const queuePendingMount = (vnode) => {
3579
+ const mountJob = () => {
3580
+ if (pendingMounts.get(vnode) !== mountJob) return;
3581
+ pendingMounts.delete(vnode);
3582
+ if (isTeleportDisabled(vnode.props)) {
3583
+ mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
3584
+ updateCssVars(vnode, true);
3585
+ }
3586
+ mountToTarget(vnode);
3587
+ };
3588
+ pendingMounts.set(vnode, mountJob);
3589
+ queuePostRenderEffect(mountJob, void 0, parentSuspense);
3590
+ };
3515
3591
  if (n1 == null) {
3516
3592
  const placeholder = n2.el = createComment("teleport start");
3517
3593
  const mainAnchor = n2.anchor = createComment("teleport end");
3518
3594
  insert(placeholder, container, anchor);
3519
3595
  insert(mainAnchor, container, anchor);
3520
- const mount = (container, anchor) => {
3521
- if (shapeFlag & 16) mountChildren(children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3522
- };
3523
- const mountToTarget = () => {
3524
- const target = n2.target = resolveTarget(n2.props, querySelector);
3525
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
3526
- if (target) {
3527
- if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
3528
- else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
3529
- if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3530
- if (!disabled) {
3531
- mount(target, targetAnchor);
3532
- updateCssVars(n2, false);
3533
- }
3534
- } else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3535
- };
3596
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3597
+ queuePendingMount(n2);
3598
+ return;
3599
+ }
3536
3600
  if (disabled) {
3537
- mount(container, mainAnchor);
3601
+ mount(n2, container, mainAnchor);
3538
3602
  updateCssVars(n2, true);
3539
3603
  }
3540
- if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3541
- n2.el.__isMounted = false;
3542
- queuePostRenderEffect(() => {
3543
- if (n2.el.__isMounted !== false) return;
3544
- mountToTarget();
3545
- delete n2.el.__isMounted;
3546
- }, void 0, parentSuspense);
3547
- } else mountToTarget();
3604
+ mountToTarget();
3548
3605
  } else {
3549
3606
  n2.el = n1.el;
3550
- n2.targetStart = n1.targetStart;
3551
3607
  const mainAnchor = n2.anchor = n1.anchor;
3552
- const target = n2.target = n1.target;
3553
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3554
- if (n1.el.__isMounted === false) {
3555
- queuePostRenderEffect(() => {
3556
- TeleportImpl.process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals);
3557
- }, void 0, parentSuspense);
3608
+ const pendingMount = pendingMounts.get(n1);
3609
+ if (pendingMount) {
3610
+ pendingMount.flags |= 4;
3611
+ pendingMounts.delete(n1);
3612
+ queuePendingMount(n2);
3558
3613
  return;
3559
3614
  }
3615
+ n2.targetStart = n1.targetStart;
3616
+ const target = n2.target = n1.target;
3617
+ const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3560
3618
  const wasDisabled = isTeleportDisabled(n1.props);
3561
3619
  const currentContainer = wasDisabled ? container : target;
3562
3620
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
@@ -3570,24 +3628,30 @@ const TeleportImpl = {
3570
3628
  if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
3571
3629
  else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
3572
3630
  } else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
3573
- const nextTarget = n2.target = resolveTarget(n2.props, querySelector);
3574
- if (nextTarget) moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
3575
- else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
3631
+ const nextTarget = resolveTarget(n2.props, querySelector);
3632
+ if (nextTarget) {
3633
+ n2.target = nextTarget;
3634
+ moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
3635
+ } else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
3576
3636
  } else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
3577
3637
  updateCssVars(n2, disabled);
3578
3638
  }
3579
3639
  },
3580
3640
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
3581
- const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
3641
+ const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
3642
+ const disabled = isTeleportDisabled(props);
3643
+ const shouldRemove = doRemove || !disabled;
3644
+ const pendingMount = pendingMounts.get(vnode);
3645
+ if (pendingMount) {
3646
+ pendingMount.flags |= 4;
3647
+ pendingMounts.delete(vnode);
3648
+ }
3582
3649
  if (targetStart) hostRemove(targetStart);
3583
3650
  if (targetAnchor) hostRemove(targetAnchor);
3584
3651
  doRemove && hostRemove(anchor);
3585
- if (shapeFlag & 16) {
3586
- const shouldRemove = doRemove || !isTeleportDisabled(props);
3587
- for (let i = 0; i < children.length; i++) {
3588
- const child = children[i];
3589
- unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3590
- }
3652
+ if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3653
+ const child = children[i];
3654
+ unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3591
3655
  }
3592
3656
  },
3593
3657
  move: moveTeleport,
@@ -3598,7 +3662,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3598
3662
  const { el, anchor, shapeFlag, children, props } = vnode;
3599
3663
  const isReorder = moveType === 2;
3600
3664
  if (isReorder) insert(el, container, parentAnchor);
3601
- if (!isReorder || isTeleportDisabled(props)) {
3665
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3602
3666
  if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
3603
3667
  }
3604
3668
  if (isReorder) insert(anchor, container, parentAnchor);
@@ -3723,8 +3787,8 @@ const BaseTransitionImpl = {
3723
3787
  const state = useTransitionState();
3724
3788
  return () => {
3725
3789
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
3726
- if (!children || !children.length) return;
3727
- const child = findNonCommentChild(children);
3790
+ const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
3791
+ if (!child) return;
3728
3792
  const rawProps = /* @__PURE__ */ toRaw(props);
3729
3793
  const { mode } = rawProps;
3730
3794
  checkTransitionMode(mode);
@@ -4177,7 +4241,7 @@ function createHydrationFunctions(rendererInternals) {
4177
4241
  else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
4178
4242
  break;
4179
4243
  case VaporSlot:
4180
- nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
4244
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
4181
4245
  break;
4182
4246
  default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) nextNode = onMismatch();
4183
4247
  else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
@@ -4187,16 +4251,31 @@ function createHydrationFunctions(rendererInternals) {
4187
4251
  if (isFragmentStart) nextNode = locateClosingAnchor(node);
4188
4252
  else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
4189
4253
  else nextNode = nextSibling(node);
4190
- if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, null, parentComponent, parentSuspense);
4191
- else mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
4192
- if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4193
- let subTree;
4194
- if (isFragmentStart) {
4195
- subTree = createVNode(Fragment);
4196
- subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4197
- } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
4198
- subTree.el = node;
4199
- vnode.component.subTree = subTree;
4254
+ if (vnode.type.__vapor) {
4255
+ const vnodeBeforeMountHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeBeforeMount;
4256
+ getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
4257
+ if (vnode.dirs) {
4258
+ invokeDirectiveHook(vnode, null, parentComponent, "created");
4259
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
4260
+ }
4261
+ }, () => {
4262
+ if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
4263
+ });
4264
+ if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
4265
+ const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
4266
+ if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
4267
+ } else {
4268
+ mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
4269
+ const component = vnode.component;
4270
+ if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved || component.asyncDep && !component.asyncResolved) {
4271
+ let subTree;
4272
+ if (isFragmentStart) {
4273
+ subTree = createVNode(Fragment);
4274
+ subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4275
+ } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
4276
+ subTree.el = node;
4277
+ component.subTree = subTree;
4278
+ }
4200
4279
  }
4201
4280
  } else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
4202
4281
  else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
@@ -4208,7 +4287,7 @@ function createHydrationFunctions(rendererInternals) {
4208
4287
  };
4209
4288
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
4210
4289
  optimized = optimized || !!vnode.dynamicChildren;
4211
- const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
4290
+ const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
4212
4291
  const forcePatch = type === "input" || type === "option";
4213
4292
  {
4214
4293
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
@@ -4226,15 +4305,11 @@ function createHydrationFunctions(rendererInternals) {
4226
4305
  }
4227
4306
  if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
4228
4307
  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
4229
- let hasWarned = false;
4308
+ if (next && !isMismatchAllowed(el, 1)) {
4309
+ warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
4310
+ logMismatchError();
4311
+ }
4230
4312
  while (next) {
4231
- if (!isMismatchAllowed(el, 1)) {
4232
- if (!hasWarned) {
4233
- warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
4234
- hasWarned = true;
4235
- }
4236
- logMismatchError();
4237
- }
4238
4313
  const cur = next;
4239
4314
  next = next.nextSibling;
4240
4315
  remove(cur);
@@ -4253,9 +4328,10 @@ function createHydrationFunctions(rendererInternals) {
4253
4328
  }
4254
4329
  if (props) {
4255
4330
  const isCustomElement = el.tagName.includes("-");
4331
+ const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
4256
4332
  for (const key in props) {
4257
4333
  if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
4258
- 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);
4334
+ 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);
4259
4335
  }
4260
4336
  }
4261
4337
  let vnodeHooks;
@@ -4273,7 +4349,7 @@ function createHydrationFunctions(rendererInternals) {
4273
4349
  optimized = optimized || !!parentVNode.dynamicChildren;
4274
4350
  const children = parentVNode.children;
4275
4351
  const l = children.length;
4276
- let hasWarned = false;
4352
+ let hasCheckedMismatch = false;
4277
4353
  for (let i = 0; i < l; i++) {
4278
4354
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
4279
4355
  const isText = vnode.type === Text;
@@ -4287,12 +4363,12 @@ function createHydrationFunctions(rendererInternals) {
4287
4363
  node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
4288
4364
  } else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
4289
4365
  else {
4290
- if (!isMismatchAllowed(container, 1)) {
4291
- if (!hasWarned) {
4366
+ if (!hasCheckedMismatch) {
4367
+ hasCheckedMismatch = true;
4368
+ if (!isMismatchAllowed(container, 1)) {
4292
4369
  warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
4293
- hasWarned = true;
4370
+ logMismatchError();
4294
4371
  }
4295
- logMismatchError();
4296
4372
  }
4297
4373
  patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
4298
4374
  }
@@ -4312,7 +4388,7 @@ function createHydrationFunctions(rendererInternals) {
4312
4388
  }
4313
4389
  };
4314
4390
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
4315
- if (!isMismatchAllowed(node.parentElement, 1)) {
4391
+ if (!isNodeMismatchAllowed(node, vnode)) {
4316
4392
  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);
4317
4393
  logMismatchError();
4318
4394
  }
@@ -4476,7 +4552,9 @@ const MismatchTypeString = {
4476
4552
  };
4477
4553
  function isMismatchAllowed(el, allowedType) {
4478
4554
  if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
4479
- const allowedAttr = el && el.getAttribute(allowMismatchAttr);
4555
+ return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
4556
+ }
4557
+ function isMismatchAllowedByAttr(allowedAttr, allowedType) {
4480
4558
  if (allowedAttr == null) return false;
4481
4559
  else if (allowedAttr === "") return true;
4482
4560
  else {
@@ -4485,6 +4563,16 @@ function isMismatchAllowed(el, allowedType) {
4485
4563
  return list.includes(MismatchTypeString[allowedType]);
4486
4564
  }
4487
4565
  }
4566
+ function isNodeMismatchAllowed(node, vnode) {
4567
+ return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
4568
+ }
4569
+ function isMismatchAllowedByNode(node) {
4570
+ return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
4571
+ }
4572
+ function isMismatchAllowedByVNode({ props }) {
4573
+ const allowedAttr = props && props[allowMismatchAttr];
4574
+ return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
4575
+ }
4488
4576
  //#endregion
4489
4577
  //#region packages/runtime-core/src/hydrationStrategies.ts
4490
4578
  let requestIdleCallback;
@@ -4603,11 +4691,16 @@ function defineAsyncComponent(source) {
4603
4691
  onError(err);
4604
4692
  return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
4605
4693
  });
4606
- const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
4694
+ const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
4607
4695
  load().then(() => {
4696
+ if (instance.isUnmounted) return;
4608
4697
  loaded.value = true;
4609
4698
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
4610
4699
  }).catch((err) => {
4700
+ if (instance.isUnmounted) {
4701
+ setPendingRequest(null);
4702
+ return;
4703
+ }
4611
4704
  onError(err);
4612
4705
  error.value = err;
4613
4706
  });
@@ -4665,14 +4758,22 @@ function createAsyncComponentContext(source) {
4665
4758
  setPendingRequest: (request) => pendingRequest = request
4666
4759
  };
4667
4760
  }
4668
- const useAsyncComponentState = (delay, timeout, onError) => {
4761
+ const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
4669
4762
  const loaded = /* @__PURE__ */ ref(false);
4670
4763
  const error = /* @__PURE__ */ ref();
4671
4764
  const delayed = /* @__PURE__ */ ref(!!delay);
4672
- if (delay) setTimeout(() => {
4765
+ let timeoutTimer;
4766
+ let delayTimer;
4767
+ if (instance) onUnmounted(() => {
4768
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
4769
+ if (delayTimer != null) clearTimeout(delayTimer);
4770
+ }, instance);
4771
+ if (delay) delayTimer = setTimeout(() => {
4772
+ if (instance && instance.isUnmounted) return;
4673
4773
  delayed.value = false;
4674
4774
  }, delay);
4675
- if (timeout != null) setTimeout(() => {
4775
+ if (timeout != null) timeoutTimer = setTimeout(() => {
4776
+ if (instance && instance.isUnmounted) return;
4676
4777
  if (!loaded.value && !error.value) {
4677
4778
  const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
4678
4779
  onError(err);
@@ -4690,6 +4791,7 @@ const useAsyncComponentState = (delay, timeout, onError) => {
4690
4791
  * @internal
4691
4792
  */
4692
4793
  function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
4794
+ const wasConnected = el.isConnected;
4693
4795
  let patched = false;
4694
4796
  (instance.bu || (instance.bu = [])).push(() => patched = true);
4695
4797
  const performHydrate = () => {
@@ -4700,6 +4802,7 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
4700
4802
  }
4701
4803
  return;
4702
4804
  }
4805
+ if (!el.parentNode || wasConnected && !el.isConnected) return;
4703
4806
  hydrate();
4704
4807
  };
4705
4808
  const doHydrate = hydrateStrategy ? () => {
@@ -5280,8 +5383,9 @@ function createSlots(slots, dynamicSlots) {
5280
5383
  * Compiler runtime helper for rendering `<slot/>`
5281
5384
  * @private
5282
5385
  */
5283
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5386
+ function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
5284
5387
  let slot = slots[name];
5388
+ if (fallback) fallback.__vdom = true;
5285
5389
  const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
5286
5390
  if (vaporSlot) {
5287
5391
  const ret = (openBlock(), createBlock(VaporSlot, props));
@@ -5289,25 +5393,35 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5289
5393
  slot: vaporSlot,
5290
5394
  fallback
5291
5395
  };
5396
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
5292
5397
  return ret;
5293
5398
  }
5294
5399
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
5295
- const hasProps = Object.keys(props).length > 0;
5296
- if (name !== "default") props.name = name;
5297
- return openBlock(), createBlock(Fragment, null, [createVNode("slot", props, fallback && fallback())], hasProps ? -2 : 64);
5400
+ const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
5401
+ const hasProps = Object.keys(slotProps).length > 0;
5402
+ if (name !== "default") slotProps.name = name;
5403
+ return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
5298
5404
  }
5299
5405
  if (slot && slot.length > 1) {
5300
5406
  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.");
5301
5407
  slot = () => [];
5302
5408
  }
5303
5409
  if (slot && slot._c) slot._d = false;
5410
+ const prevStackSize = blockStack.length;
5304
5411
  openBlock();
5305
- const validSlotContent = slot && ensureValidVNode(slot(props));
5306
- ensureVaporSlotFallback(validSlotContent, fallback);
5307
- const slotKey = props.key || validSlotContent && validSlotContent.key;
5308
- const rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
5412
+ let rendered;
5413
+ try {
5414
+ const validSlotContent = slot && ensureValidVNode(slot(props));
5415
+ ensureVaporSlotFallback(validSlotContent, fallback);
5416
+ const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
5417
+ rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
5418
+ } catch (err) {
5419
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
5420
+ throw err;
5421
+ } finally {
5422
+ if (slot && slot._c) slot._d = true;
5423
+ }
5309
5424
  if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
5310
- if (slot && slot._c) slot._d = true;
5311
5425
  return rendered;
5312
5426
  }
5313
5427
  function ensureValidVNode(vnodes) {
@@ -5320,9 +5434,7 @@ function ensureValidVNode(vnodes) {
5320
5434
  }
5321
5435
  function ensureVaporSlotFallback(vnodes, fallback) {
5322
5436
  let vaporSlot;
5323
- if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
5324
- if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
5325
- }
5437
+ if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
5326
5438
  }
5327
5439
  //#endregion
5328
5440
  //#region packages/runtime-core/src/helpers/toHandlers.ts
@@ -5877,26 +5989,39 @@ function createPropsRestProxy(props, excludedKeys) {
5877
5989
  function withAsyncContext(getAwaitable) {
5878
5990
  const ctx = getCurrentGenericInstance();
5879
5991
  const inSSRSetup = isInSSRComponentSetup;
5992
+ const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
5880
5993
  if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
5881
5994
  let awaitable = getAwaitable();
5882
5995
  setCurrentInstance(null, void 0);
5883
5996
  if (inSSRSetup) setInSSRSetupState(false);
5884
5997
  const restore = () => {
5998
+ const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
5885
5999
  setCurrentInstance(ctx);
5886
6000
  if (inSSRSetup) setInSSRSetupState(true);
6001
+ const reset = restoreAsyncContext && restoreAsyncContext();
6002
+ return () => {
6003
+ if (reset) reset();
6004
+ if (resetStoppedScope) resetStoppedScope.reset();
6005
+ };
5887
6006
  };
5888
6007
  const cleanup = () => {
5889
6008
  setCurrentInstance(null, void 0);
5890
6009
  if (inSSRSetup) setInSSRSetupState(false);
5891
6010
  };
5892
6011
  if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
5893
- restore();
5894
- Promise.resolve().then(() => Promise.resolve().then(cleanup));
6012
+ const reset = restore();
6013
+ Promise.resolve().then(() => Promise.resolve().then(() => {
6014
+ if (reset) reset();
6015
+ cleanup();
6016
+ }));
5895
6017
  throw e;
5896
6018
  });
5897
6019
  return [awaitable, () => {
5898
- restore();
5899
- Promise.resolve().then(cleanup);
6020
+ const reset = restore();
6021
+ Promise.resolve().then(() => {
6022
+ if (reset) reset();
6023
+ cleanup();
6024
+ });
5900
6025
  }];
5901
6026
  }
5902
6027
  //#endregion
@@ -6214,7 +6339,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6214
6339
  if (options.el) return vm.$mount(options.el);
6215
6340
  else return vm;
6216
6341
  }
6217
- Vue.version = `2.6.14-compat:3.6.0-beta.9`;
6342
+ Vue.version = `2.6.14-compat:3.6.0-rc.1`;
6218
6343
  Vue.config = singletonApp.config;
6219
6344
  Vue.use = (plugin, ...options) => {
6220
6345
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -6469,7 +6594,9 @@ function defineReactive(obj, key, val) {
6469
6594
  else Object.keys(val).forEach((key) => {
6470
6595
  try {
6471
6596
  defineReactiveSimple(val, key, val[key]);
6472
- } catch (e) {}
6597
+ } catch (e) {
6598
+ warn$1(`Failed making property "${key}" reactive:`, e);
6599
+ }
6473
6600
  });
6474
6601
  }
6475
6602
  const i = obj.$;
@@ -6714,12 +6841,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
6714
6841
  for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
6715
6842
  else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
6716
6843
  }
6717
- if (!parentPassedModelValue || !parentPassedModelUpdater) {
6844
+ const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
6845
+ if (!hasVModel) {
6718
6846
  localValue = value;
6719
6847
  trigger();
6720
6848
  }
6721
6849
  i.emit(`update:${name}`, emittedValue);
6722
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) trigger();
6850
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
6723
6851
  prevSetValue = value;
6724
6852
  prevEmittedValue = emittedValue;
6725
6853
  }
@@ -6832,7 +6960,8 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
6832
6960
  function isEmitListener(options, key) {
6833
6961
  if (!options || !isOn(key)) return false;
6834
6962
  if (key.startsWith(compatModelEventPrefix)) return true;
6835
- key = key.slice(2).replace(/Once$/, "");
6963
+ key = key.slice(2);
6964
+ key = key === "Once" ? key : key.replace(/Once$/, "");
6836
6965
  return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
6837
6966
  }
6838
6967
  //#endregion
@@ -7350,7 +7479,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
7350
7479
  const receivedType = toRawType(value);
7351
7480
  const expectedValue = styleValue(value, expectedType);
7352
7481
  const receivedValue = styleValue(value, receivedType);
7353
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) message += ` with value ${expectedValue}`;
7482
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
7354
7483
  message += `, got ${receivedType} `;
7355
7484
  if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
7356
7485
  return message;
@@ -7359,7 +7488,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
7359
7488
  * dev only
7360
7489
  */
7361
7490
  function styleValue(value, type) {
7362
- if (type === "String") return `"${value}"`;
7491
+ if (isSymbol(value)) return value.toString();
7492
+ else if (type === "String") return `"${value}"`;
7363
7493
  else if (type === "Number") return `${Number(value)}`;
7364
7494
  else return `${value}`;
7365
7495
  }
@@ -7376,8 +7506,11 @@ function isExplicable(type) {
7376
7506
  /**
7377
7507
  * dev only
7378
7508
  */
7379
- function isBoolean(...args) {
7380
- return args.some((elem) => elem.toLowerCase() === "boolean");
7509
+ function isCoercible(...args) {
7510
+ return args.every((elem) => {
7511
+ const value = elem.toLowerCase();
7512
+ return value !== "boolean" && value !== "symbol";
7513
+ });
7381
7514
  }
7382
7515
  //#endregion
7383
7516
  //#region packages/runtime-core/src/componentSlots.ts
@@ -7682,7 +7815,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7682
7815
  if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
7683
7816
  if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
7684
7817
  parentComponent && toggleRecurse(parentComponent, true);
7685
- if (isHmrUpdating) {
7818
+ if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
7686
7819
  patchFlag = 0;
7687
7820
  optimized = false;
7688
7821
  dynamicChildren = null;
@@ -7762,19 +7895,35 @@ function baseCreateRenderer(options, createHydrationFns) {
7762
7895
  n2.slotScopeIds = slotScopeIds;
7763
7896
  if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
7764
7897
  else {
7898
+ const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
7765
7899
  getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
7766
7900
  if (n2.dirs) {
7767
7901
  invokeDirectiveHook(n2, null, parentComponent, "created");
7768
7902
  invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
7769
7903
  }
7904
+ }, () => {
7905
+ if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
7770
7906
  });
7771
7907
  if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
7908
+ const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
7909
+ if (vnodeMountedHook) {
7910
+ const scopedVNode = n2;
7911
+ queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
7912
+ }
7772
7913
  }
7773
7914
  else {
7774
- getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized), () => {
7915
+ const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
7916
+ getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
7775
7917
  if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
7918
+ }, () => {
7919
+ const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
7920
+ if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
7776
7921
  });
7777
- if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, n1, parentComponent, "updated"), void 0, parentSuspense);
7922
+ const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
7923
+ if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
7924
+ n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
7925
+ vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
7926
+ }, void 0, parentSuspense);
7778
7927
  }
7779
7928
  else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
7780
7929
  else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
@@ -8130,8 +8279,10 @@ function baseCreateRenderer(options, createHydrationFns) {
8130
8279
  else hostInsert(el, container, anchor);
8131
8280
  };
8132
8281
  const performLeave = () => {
8282
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
8133
8283
  if (el._isLeaving) el[leaveCbKey](true);
8134
- leave(el, () => {
8284
+ if (transition.persisted && !wasLeaving) remove();
8285
+ else leave(el, () => {
8135
8286
  remove();
8136
8287
  afterLeave && afterLeave();
8137
8288
  });
@@ -8162,7 +8313,10 @@ function baseCreateRenderer(options, createHydrationFns) {
8162
8313
  if (shapeFlag & 6) if (isVaporComponent(type)) {
8163
8314
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
8164
8315
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
8165
- if (dirs) queuePostRenderEffect(() => invokeDirectiveHook(vnode, null, parentComponent, "unmounted"), void 0, parentSuspense);
8316
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
8317
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
8318
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
8319
+ }, void 0, parentSuspense);
8166
8320
  return;
8167
8321
  } else unmountComponent(vnode.component, parentSuspense, doRemove);
8168
8322
  else {
@@ -8224,7 +8378,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8224
8378
  if (effect) {
8225
8379
  effect.stop();
8226
8380
  unmount(subTree, instance, parentSuspense, doRemove);
8227
- }
8381
+ } else if (doRemove && subTree && instance.vnode.el) remove(subTree);
8228
8382
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
8229
8383
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
8230
8384
  queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
@@ -8351,6 +8505,10 @@ function invalidateMount(hooks) {
8351
8505
  if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
8352
8506
  }
8353
8507
  function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
8508
+ if (force && transition.persisted && !el[leaveCbKey]) {
8509
+ insert();
8510
+ return;
8511
+ }
8354
8512
  if (force || needTransition(parentSuspense, transition)) {
8355
8513
  transition.beforeEnter(el);
8356
8514
  insert();
@@ -8553,15 +8711,19 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
8553
8711
  if (suspense.isHydrating) suspense.isHydrating = false;
8554
8712
  else if (!resume) {
8555
8713
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
8714
+ let hasUpdatedAnchor = false;
8556
8715
  if (delayEnter) activeBranch.transition.afterLeave = () => {
8557
8716
  if (pendingId === suspense.pendingId) {
8558
- move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
8717
+ move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
8559
8718
  queuePostFlushCb(effects);
8560
8719
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
8561
8720
  }
8562
8721
  };
8563
8722
  if (activeBranch && !suspense.isFallbackMountPending) {
8564
- if (parentNode(activeBranch.el) === container) anchor = next(activeBranch);
8723
+ if (parentNode(activeBranch.el) === container) {
8724
+ anchor = next(activeBranch);
8725
+ hasUpdatedAnchor = true;
8726
+ }
8565
8727
  unmount(activeBranch, parentComponent, suspense, true);
8566
8728
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
8567
8729
  }
@@ -8625,6 +8787,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
8625
8787
  handleError(err, instance, 0);
8626
8788
  }).then((asyncSetupResult) => {
8627
8789
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
8790
+ setCurrentInstance(null, void 0);
8628
8791
  instance.asyncResolved = true;
8629
8792
  onResolve(asyncSetupResult);
8630
8793
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
@@ -8957,12 +9120,30 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
8957
9120
  el: vnode.el,
8958
9121
  anchor: vnode.anchor,
8959
9122
  ctx: vnode.ctx,
8960
- ce: vnode.ce
9123
+ ce: vnode.ce,
9124
+ vi: vnode.vi,
9125
+ vs: cloneVaporSlotMeta(vnode),
9126
+ vb: vnode.vb
8961
9127
  };
8962
9128
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
8963
9129
  defineLegacyVNodeProperties(cloned);
8964
9130
  return cloned;
8965
9131
  }
9132
+ function cloneVaporSlotMeta(vnode) {
9133
+ const vaporSlot = vnode.vs;
9134
+ if (!vaporSlot) return vaporSlot;
9135
+ const cloned = {
9136
+ slot: vaporSlot.slot,
9137
+ fallback: vaporSlot.fallback,
9138
+ outletFallback: vaporSlot.outletFallback
9139
+ };
9140
+ if (vnode.el) {
9141
+ cloned.state = vaporSlot.state;
9142
+ cloned.ref = vaporSlot.ref;
9143
+ cloned.scope = vaporSlot.scope;
9144
+ }
9145
+ return cloned;
9146
+ }
8966
9147
  /**
8967
9148
  * Dev only, for HMR of hoisted vnodes reused in v-for
8968
9149
  * https://github.com/vitejs/vite/issues/2022
@@ -9025,6 +9206,10 @@ function normalizeChildren(vnode, children) {
9025
9206
  }
9026
9207
  }
9027
9208
  else if (isFunction(children)) {
9209
+ if (shapeFlag & 65) {
9210
+ normalizeChildren(vnode, { default: children });
9211
+ return;
9212
+ }
9028
9213
  children = {
9029
9214
  default: children,
9030
9215
  _ctx: currentRenderingInstance
@@ -9622,7 +9807,7 @@ function isMemoSame(cached, memo) {
9622
9807
  }
9623
9808
  //#endregion
9624
9809
  //#region packages/runtime-core/src/index.ts
9625
- const version = "3.6.0-beta.9";
9810
+ const version = "3.6.0-rc.1";
9626
9811
  const warn = warn$1;
9627
9812
  /**
9628
9813
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -10110,7 +10295,10 @@ function patchStyle(el, prev, next) {
10110
10295
  }
10111
10296
  for (const key in next) {
10112
10297
  if (key === "display") hasControlledDisplay = true;
10113
- setStyle(style, key, next[key]);
10298
+ const value = next[key];
10299
+ if (value != null) {
10300
+ if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
10301
+ } else setStyle(style, key, "");
10114
10302
  }
10115
10303
  } else if (isCssString) {
10116
10304
  if (prev !== next) {
@@ -10158,6 +10346,14 @@ function autoPrefix(style, rawName) {
10158
10346
  }
10159
10347
  return rawName;
10160
10348
  }
10349
+ /**
10350
+ * Browsers update textarea width/height directly during native resize.
10351
+ * Only special-case this common textarea path for now; other resize scenarios
10352
+ * still follow normal vnode style patching.
10353
+ */
10354
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
10355
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
10356
+ }
10161
10357
  //#endregion
10162
10358
  //#region packages/runtime-dom/src/modules/attrs.ts
10163
10359
  const xlinkNS = "http://www.w3.org/1999/xlink";
@@ -10241,7 +10437,7 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
10241
10437
  const existingInvoker = invokers[rawName];
10242
10438
  if (nextValue && existingInvoker) existingInvoker.value = sanitizeEventValue(nextValue, rawName);
10243
10439
  else {
10244
- const [name, options] = parseName(rawName);
10440
+ const [name, options] = parseEventName(rawName);
10245
10441
  if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(sanitizeEventValue(nextValue, rawName), instance), options);
10246
10442
  else if (existingInvoker) {
10247
10443
  removeEventListener(el, name, existingInvoker, options);
@@ -10249,16 +10445,15 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
10249
10445
  }
10250
10446
  }
10251
10447
  }
10252
- const optionsModifierRE = /(?:Once|Passive|Capture)$/;
10253
- function parseName(name) {
10448
+ const optionsModifierRE = /(Once|Passive|Capture)$/;
10449
+ const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
10450
+ function parseEventName(name) {
10254
10451
  let options;
10255
- if (optionsModifierRE.test(name)) {
10256
- options = {};
10257
- let m;
10258
- while (m = name.match(optionsModifierRE)) {
10259
- name = name.slice(0, name.length - m[0].length);
10260
- options[m[0].toLowerCase()] = true;
10261
- }
10452
+ let m;
10453
+ while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
10454
+ if (!options) options = {};
10455
+ name = name.slice(0, name.length - m[1].length);
10456
+ options[m[1].toLowerCase()] = true;
10262
10457
  }
10263
10458
  return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
10264
10459
  }
@@ -10269,7 +10464,21 @@ function createInvoker(initialValue, instance) {
10269
10464
  const invoker = (e) => {
10270
10465
  if (!e._vts) e._vts = Date.now();
10271
10466
  else if (e._vts <= invoker.attached) return;
10272
- callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
10467
+ const value = invoker.value;
10468
+ if (isArray(value)) {
10469
+ const originalStop = e.stopImmediatePropagation;
10470
+ e.stopImmediatePropagation = () => {
10471
+ originalStop.call(e);
10472
+ e._stopped = true;
10473
+ };
10474
+ const handlers = value.slice();
10475
+ const args = [e];
10476
+ for (let i = 0; i < handlers.length; i++) {
10477
+ if (e._stopped) break;
10478
+ const handler = handlers[i];
10479
+ if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
10480
+ }
10481
+ } else callWithAsyncErrorHandling(value, instance, 5, [e]);
10273
10482
  };
10274
10483
  invoker.value = initialValue;
10275
10484
  invoker.attached = getNow();
@@ -10280,16 +10489,6 @@ function sanitizeEventValue(value, propName) {
10280
10489
  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}.`);
10281
10490
  return NOOP;
10282
10491
  }
10283
- function patchStopImmediatePropagation(e, value) {
10284
- if (isArray(value)) {
10285
- const originalStop = e.stopImmediatePropagation;
10286
- e.stopImmediatePropagation = () => {
10287
- originalStop.call(e);
10288
- e._stopped = true;
10289
- };
10290
- return value.map((fn) => (e) => !e._stopped && fn && fn(e));
10291
- } else return value;
10292
- }
10293
10492
  //#endregion
10294
10493
  //#region packages/runtime-dom/src/patchProp.ts
10295
10494
  const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
@@ -10617,7 +10816,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
10617
10816
  replacementNodes.push(child);
10618
10817
  }
10619
10818
  parent.removeChild(o);
10620
- slotReplacements.set(o, replacementNodes);
10819
+ slotReplacements.set(o, {
10820
+ nodes: replacementNodes,
10821
+ usedFallback: !content
10822
+ });
10621
10823
  }
10622
10824
  this._updateSlotNodes(slotReplacements);
10623
10825
  }
@@ -10807,7 +11009,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
10807
11009
  prevChildren = [];
10808
11010
  if (children) for (let i = 0; i < children.length; i++) {
10809
11011
  const child = children[i];
10810
- if (child.el && child.el instanceof Element) {
11012
+ if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
10811
11013
  prevChildren.push(child);
10812
11014
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
10813
11015
  positionMap.set(child, getPosition(child.el));
@@ -11031,7 +11233,8 @@ const vModelSelect = {
11031
11233
  mounted(el, { value }) {
11032
11234
  vModelSetSelected(el, value);
11033
11235
  },
11034
- beforeUpdate(el, _binding, vnode) {
11236
+ beforeUpdate(el, { value }, vnode) {
11237
+ el._modelValue = value;
11035
11238
  el[assignKey] = getModelAssigner(vnode);
11036
11239
  },
11037
11240
  updated(el, { value }) {
@@ -11042,10 +11245,10 @@ const vModelSelect = {
11042
11245
  * @internal
11043
11246
  */
11044
11247
  const vModelSelectInit = (el, value, number, set) => {
11045
- const isSetModel = isSet(value);
11248
+ el._modelValue = value;
11046
11249
  addEventListener(el, "change", () => {
11047
11250
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
11048
- (set || el[assignKey])(el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]);
11251
+ (set || el[assignKey])(el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
11049
11252
  el._assigning = true;
11050
11253
  nextTick(() => {
11051
11254
  el._assigning = false;
@@ -11056,6 +11259,7 @@ const vModelSelectInit = (el, value, number, set) => {
11056
11259
  * @internal
11057
11260
  */
11058
11261
  const vModelSetSelected = (el, value) => {
11262
+ el._modelValue = value;
11059
11263
  if (el._assigning) return;
11060
11264
  const isMultiple = el.multiple;
11061
11265
  const isArrayValue = isArray(value);
@@ -12721,6 +12925,7 @@ function getUnnormalizedProps(props, callPath = []) {
12721
12925
  return [props, callPath];
12722
12926
  }
12723
12927
  function injectProp(node, prop, context) {
12928
+ if (node.type !== 13 && injectSlotKey(node, prop)) return;
12724
12929
  let propsWithInjection;
12725
12930
  /**
12726
12931
  * 1. mergeProps(...)
@@ -12759,6 +12964,20 @@ function injectProp(node, prop, context) {
12759
12964
  else if (parentCall) parentCall.arguments[0] = propsWithInjection;
12760
12965
  else node.arguments[2] = propsWithInjection;
12761
12966
  }
12967
+ function injectSlotKey(node, prop) {
12968
+ var _node$arguments, _node$arguments2, _node$arguments3;
12969
+ if (prop.key.type !== 4 || prop.key.content !== "key") return false;
12970
+ const props = node.arguments[2];
12971
+ if (props && !isString(props)) {
12972
+ const [unnormalizedProps] = getUnnormalizedProps(props);
12973
+ if (unnormalizedProps && !isString(unnormalizedProps) && unnormalizedProps.type === 15 && hasProp(prop, unnormalizedProps)) return true;
12974
+ }
12975
+ (_node$arguments = node.arguments)[2] || (_node$arguments[2] = "{}");
12976
+ (_node$arguments2 = node.arguments)[3] || (_node$arguments2[3] = "undefined");
12977
+ (_node$arguments3 = node.arguments)[4] || (_node$arguments3[4] = "undefined");
12978
+ node.arguments[5] = prop.value;
12979
+ return true;
12980
+ }
12762
12981
  function hasProp(prop, props) {
12763
12982
  let result = false;
12764
12983
  if (prop.key.type === 4) {
@@ -13028,7 +13247,7 @@ const tokenizer = new Tokenizer(stack, {
13028
13247
  }
13029
13248
  },
13030
13249
  oncdata(start, end) {
13031
- if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
13250
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
13032
13251
  else emitError(1, start - 9);
13033
13252
  },
13034
13253
  onprocessinginstruction(start) {
@@ -13520,7 +13739,7 @@ function getSelfName(filename) {
13520
13739
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
13521
13740
  return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
13522
13741
  }
13523
- 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 }) {
13742
+ 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 }) {
13524
13743
  const context = {
13525
13744
  filename,
13526
13745
  selfName: getSelfName(filename),
@@ -13542,6 +13761,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
13542
13761
  bindingMetadata,
13543
13762
  inline,
13544
13763
  isTS,
13764
+ eventDelegation,
13545
13765
  onError,
13546
13766
  onWarn,
13547
13767
  compatConfig,
@@ -13553,8 +13773,10 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
13553
13773
  imports: [],
13554
13774
  cached: [],
13555
13775
  constantCache: /* @__PURE__ */ new WeakMap(),
13776
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
13556
13777
  temps: 0,
13557
13778
  identifiers: Object.create(null),
13779
+ identifierScopes: Object.create(null),
13558
13780
  scopes: {
13559
13781
  vFor: 0,
13560
13782
  vSlot: 0,
@@ -13605,8 +13827,12 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
13605
13827
  context.parent.children.splice(removalIndex, 1);
13606
13828
  },
13607
13829
  onNodeRemoved: NOOP,
13608
- addIdentifiers(exp) {},
13830
+ addIdentifiers(exp, type = "local") {},
13609
13831
  removeIdentifiers(exp) {},
13832
+ isSlotScopeIdentifier(name) {
13833
+ const scopes = context.identifierScopes[name];
13834
+ return scopes ? scopes[scopes.length - 1] === "slot" : false;
13835
+ },
13610
13836
  hoist(exp) {
13611
13837
  if (isString(exp)) exp = createSimpleExpression(exp);
13612
13838
  context.hoists.push(exp);
@@ -13960,6 +14186,7 @@ function genNode(node, context) {
13960
14186
  case 24: break;
13961
14187
  case 25: break;
13962
14188
  case 26: break;
14189
+ /* v8 ignore start */
13963
14190
  case 10: break;
13964
14191
  default:
13965
14192
  assert(false, `unhandled codegen node type: ${node.type}`);
@@ -14177,7 +14404,7 @@ const transformExpression = (node, context) => {
14177
14404
  if (dir.type === 7 && dir.name !== "for") {
14178
14405
  const exp = dir.exp;
14179
14406
  const arg = dir.arg;
14180
- 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");
14407
+ 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");
14181
14408
  if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
14182
14409
  }
14183
14410
  }
@@ -14318,10 +14545,9 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
14318
14545
  const isTemplate = isTemplateNode(node);
14319
14546
  const memo = findDir(node, "memo");
14320
14547
  const keyProp = findProp(node, `key`, false, true);
14321
- const isDirKey = keyProp && keyProp.type === 7;
14548
+ keyProp && keyProp.type;
14322
14549
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
14323
- if (memo && keyExp && isDirKey) {}
14324
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
14550
+ const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
14325
14551
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
14326
14552
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
14327
14553
  forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);
@@ -15098,7 +15324,7 @@ function rewriteFilter(node, context) {
15098
15324
  const child = node.children[i];
15099
15325
  if (typeof child !== "object") continue;
15100
15326
  if (child.type === 4) parseFilter(child, context);
15101
- else if (child.type === 8) rewriteFilter(node, context);
15327
+ else if (child.type === 8) rewriteFilter(child, context);
15102
15328
  else if (child.type === 5) rewriteFilter(child.content, context);
15103
15329
  }
15104
15330
  }
@@ -15533,7 +15759,7 @@ function postTransformTransition(node, onError, hasMultipleChildren = defaultHas
15533
15759
  source: ""
15534
15760
  }));
15535
15761
  const child = node.children[0];
15536
- if (child.type === 1) {
15762
+ if (child.type === 1 && !findDir(child, "if")) {
15537
15763
  for (const p of child.props) if (p.type === 7 && p.name === "show") node.props.push({
15538
15764
  type: 6,
15539
15765
  name: "persisted",