@vue/runtime-core 3.6.0-alpha.2 → 3.6.0-alpha.3

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,11 +1,11 @@
1
1
  /**
2
- * @vue/runtime-core v3.6.0-alpha.2
2
+ * @vue/runtime-core v3.6.0-alpha.3
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
6
  import { setActiveSub, isRef, toRaw, traverse, shallowRef, readonly, isReactive, ref, isShallow, isReadonly, shallowReadArray, toReadonly, toReactive, shallowReadonly, track, reactive, shallowReactive, trigger, ReactiveEffect, setCurrentScope, WatcherEffect, customRef, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1 } from '@vue/reactivity';
7
7
  export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
8
- import { isString, isFunction, EMPTY_OBJ, isPromise, isArray, getGlobalThis, extend, isBuiltInDirective, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, normalizeCssVarValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, camelize, capitalize, isSymbol, NOOP, isGloballyAllowed, NO, hyphenate, EMPTY_ARR, makeMap, toRawType, getSequence, hasChanged, looseToNumber, isModelListener, toNumber, isBuiltInTag } from '@vue/shared';
8
+ import { isString, isFunction, EMPTY_OBJ, isPromise, isArray, getGlobalThis, extend, isBuiltInDirective, NO, hasOwn, remove, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, normalizeCssVarValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, camelize, capitalize, isSymbol, NOOP, isGloballyAllowed, hyphenate, EMPTY_ARR, makeMap, toRawType, getSequence, hasChanged, looseToNumber, isModelListener, toNumber, isBuiltInTag } from '@vue/shared';
9
9
  export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
10
10
 
11
11
  const stack = [];
@@ -534,8 +534,10 @@ function rerender(id, newRender) {
534
534
  instance.hmrRerender();
535
535
  } else {
536
536
  const i = instance;
537
- i.renderCache = [];
538
- i.effect.run();
537
+ if (!(i.effect.flags & 1024)) {
538
+ i.renderCache = [];
539
+ i.effect.run();
540
+ }
539
541
  }
540
542
  nextTick(() => {
541
543
  isHmrUpdating = false;
@@ -577,7 +579,10 @@ function reload(id, newComp) {
577
579
  if (parent.vapor) {
578
580
  parent.hmrRerender();
579
581
  } else {
580
- parent.effect.run();
582
+ if (!(parent.effect.flags & 1024)) {
583
+ parent.renderCache = [];
584
+ parent.effect.run();
585
+ }
581
586
  }
582
587
  nextTick(() => {
583
588
  isHmrUpdating = false;
@@ -687,7 +692,6 @@ const devtoolsComponentRemoved = (component) => {
687
692
  _devtoolsComponentRemoved(component);
688
693
  }
689
694
  };
690
- /*! #__NO_SIDE_EFFECTS__ */
691
695
  // @__NO_SIDE_EFFECTS__
692
696
  function createDevtoolsComponentHook(hook) {
693
697
  return (component) => {
@@ -873,9 +877,6 @@ const TeleportImpl = {
873
877
  insert(mainAnchor, container, anchor);
874
878
  const mount = (container2, anchor2) => {
875
879
  if (shapeFlag & 16) {
876
- if (parentComponent && parentComponent.isCE) {
877
- parentComponent.ce._teleportTarget = container2;
878
- }
879
880
  mountChildren(
880
881
  children,
881
882
  container2,
@@ -897,6 +898,9 @@ const TeleportImpl = {
897
898
  } else if (namespace !== "mathml" && isTargetMathML(target)) {
898
899
  namespace = "mathml";
899
900
  }
901
+ if (parentComponent && parentComponent.isCE) {
902
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
903
+ }
900
904
  if (!disabled) {
901
905
  mount(target, targetAnchor);
902
906
  updateCssVars(n2, false);
@@ -1097,26 +1101,34 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
1097
1101
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
1098
1102
  o: { nextSibling, parentNode, querySelector, insert, createText }
1099
1103
  }, hydrateChildren) {
1104
+ function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
1105
+ vnode2.anchor = hydrateChildren(
1106
+ nextSibling(node2),
1107
+ vnode2,
1108
+ parentNode(node2),
1109
+ parentComponent,
1110
+ parentSuspense,
1111
+ slotScopeIds,
1112
+ optimized
1113
+ );
1114
+ vnode2.targetStart = targetStart;
1115
+ vnode2.targetAnchor = targetAnchor;
1116
+ }
1100
1117
  const target = vnode.target = resolveTarget(
1101
1118
  vnode.props,
1102
1119
  querySelector
1103
1120
  );
1121
+ const disabled = isTeleportDisabled(vnode.props);
1104
1122
  if (target) {
1105
- const disabled = isTeleportDisabled(vnode.props);
1106
1123
  const targetNode = target._lpa || target.firstChild;
1107
1124
  if (vnode.shapeFlag & 16) {
1108
1125
  if (disabled) {
1109
- vnode.anchor = hydrateChildren(
1110
- nextSibling(node),
1126
+ hydrateDisabledTeleport(
1127
+ node,
1111
1128
  vnode,
1112
- parentNode(node),
1113
- parentComponent,
1114
- parentSuspense,
1115
- slotScopeIds,
1116
- optimized
1129
+ targetNode,
1130
+ targetNode && nextSibling(targetNode)
1117
1131
  );
1118
- vnode.targetStart = targetNode;
1119
- vnode.targetAnchor = targetNode && nextSibling(targetNode);
1120
1132
  } else {
1121
1133
  vnode.anchor = nextSibling(node);
1122
1134
  let targetAnchor = targetNode;
@@ -1147,6 +1159,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
1147
1159
  }
1148
1160
  }
1149
1161
  updateCssVars(vnode, disabled);
1162
+ } else if (disabled) {
1163
+ if (vnode.shapeFlag & 16) {
1164
+ hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
1165
+ }
1150
1166
  }
1151
1167
  return vnode.anchor && nextSibling(vnode.anchor);
1152
1168
  }
@@ -1187,7 +1203,7 @@ function useTransitionState() {
1187
1203
  isMounted: false,
1188
1204
  isLeaving: false,
1189
1205
  isUnmounting: false,
1190
- leavingVNodes: /* @__PURE__ */ new Map()
1206
+ leavingNodes: /* @__PURE__ */ new Map()
1191
1207
  };
1192
1208
  onMounted(() => {
1193
1209
  state.isMounted = true;
@@ -1219,7 +1235,7 @@ const BaseTransitionPropsValidators = {
1219
1235
  onAppearCancelled: TransitionHookValidator
1220
1236
  };
1221
1237
  const recursiveGetSubtree = (instance) => {
1222
- const subTree = instance.subTree;
1238
+ const subTree = instance.type.__vapor ? instance.block : instance.subTree;
1223
1239
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
1224
1240
  };
1225
1241
  const BaseTransitionImpl = {
@@ -1236,9 +1252,7 @@ const BaseTransitionImpl = {
1236
1252
  const child = findNonCommentChild(children);
1237
1253
  const rawProps = toRaw(props);
1238
1254
  const { mode } = rawProps;
1239
- if (!!(process.env.NODE_ENV !== "production") && mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
1240
- warn$1(`invalid <transition> mode: ${mode}`);
1241
- }
1255
+ checkTransitionMode(mode);
1242
1256
  if (state.isLeaving) {
1243
1257
  return emptyPlaceholder(child);
1244
1258
  }
@@ -1258,7 +1272,7 @@ const BaseTransitionImpl = {
1258
1272
  setTransitionHooks(innerChild, enterHooks);
1259
1273
  }
1260
1274
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
1261
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
1275
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
1262
1276
  let leavingHooks = resolveTransitionHooks(
1263
1277
  oldInnerChild,
1264
1278
  rawProps,
@@ -1328,15 +1342,53 @@ function findNonCommentChild(children) {
1328
1342
  }
1329
1343
  const BaseTransition = BaseTransitionImpl;
1330
1344
  function getLeavingNodesForType(state, vnode) {
1331
- const { leavingVNodes } = state;
1332
- let leavingVNodesCache = leavingVNodes.get(vnode.type);
1345
+ const { leavingNodes } = state;
1346
+ let leavingVNodesCache = leavingNodes.get(vnode.type);
1333
1347
  if (!leavingVNodesCache) {
1334
1348
  leavingVNodesCache = /* @__PURE__ */ Object.create(null);
1335
- leavingVNodes.set(vnode.type, leavingVNodesCache);
1349
+ leavingNodes.set(vnode.type, leavingVNodesCache);
1336
1350
  }
1337
1351
  return leavingVNodesCache;
1338
1352
  }
1339
1353
  function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1354
+ const key = String(vnode.key);
1355
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
1356
+ const context = {
1357
+ setLeavingNodeCache: () => {
1358
+ leavingVNodesCache[key] = vnode;
1359
+ },
1360
+ unsetLeavingNodeCache: () => {
1361
+ if (leavingVNodesCache[key] === vnode) {
1362
+ delete leavingVNodesCache[key];
1363
+ }
1364
+ },
1365
+ earlyRemove: () => {
1366
+ const leavingVNode = leavingVNodesCache[key];
1367
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
1368
+ leavingVNode.el[leaveCbKey]();
1369
+ }
1370
+ },
1371
+ cloneHooks: (vnode2) => {
1372
+ const hooks = resolveTransitionHooks(
1373
+ vnode2,
1374
+ props,
1375
+ state,
1376
+ instance,
1377
+ postClone
1378
+ );
1379
+ if (postClone) postClone(hooks);
1380
+ return hooks;
1381
+ }
1382
+ };
1383
+ return baseResolveTransitionHooks(context, props, state, instance);
1384
+ }
1385
+ function baseResolveTransitionHooks(context, props, state, instance) {
1386
+ const {
1387
+ setLeavingNodeCache,
1388
+ unsetLeavingNodeCache,
1389
+ earlyRemove,
1390
+ cloneHooks
1391
+ } = context;
1340
1392
  const {
1341
1393
  appear,
1342
1394
  mode,
@@ -1354,8 +1406,6 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1354
1406
  onAfterAppear,
1355
1407
  onAppearCancelled
1356
1408
  } = props;
1357
- const key = String(vnode.key);
1358
- const leavingVNodesCache = getLeavingNodesForType(state, vnode);
1359
1409
  const callHook = (hook, args) => {
1360
1410
  hook && callWithAsyncErrorHandling(
1361
1411
  hook,
@@ -1391,10 +1441,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1391
1441
  /* cancelled */
1392
1442
  );
1393
1443
  }
1394
- const leavingVNode = leavingVNodesCache[key];
1395
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
1396
- leavingVNode.el[leaveCbKey]();
1397
- }
1444
+ earlyRemove();
1398
1445
  callHook(hook, [el]);
1399
1446
  },
1400
1447
  enter(el) {
@@ -1431,7 +1478,6 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1431
1478
  }
1432
1479
  },
1433
1480
  leave(el, remove) {
1434
- const key2 = String(vnode.key);
1435
1481
  if (el[enterCbKey]) {
1436
1482
  el[enterCbKey](
1437
1483
  true
@@ -1453,27 +1499,17 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1453
1499
  callHook(onAfterLeave, [el]);
1454
1500
  }
1455
1501
  el[leaveCbKey] = void 0;
1456
- if (leavingVNodesCache[key2] === vnode) {
1457
- delete leavingVNodesCache[key2];
1458
- }
1502
+ unsetLeavingNodeCache(el);
1459
1503
  };
1460
- leavingVNodesCache[key2] = vnode;
1504
+ setLeavingNodeCache(el);
1461
1505
  if (onLeave) {
1462
1506
  callAsyncHook(onLeave, [el, done]);
1463
1507
  } else {
1464
1508
  done();
1465
1509
  }
1466
1510
  },
1467
- clone(vnode2) {
1468
- const hooks2 = resolveTransitionHooks(
1469
- vnode2,
1470
- props,
1471
- state,
1472
- instance,
1473
- postClone
1474
- );
1475
- if (postClone) postClone(hooks2);
1476
- return hooks2;
1511
+ clone(node) {
1512
+ return cloneHooks(node);
1477
1513
  }
1478
1514
  };
1479
1515
  return hooks;
@@ -1507,8 +1543,15 @@ function getInnerChild$1(vnode) {
1507
1543
  }
1508
1544
  function setTransitionHooks(vnode, hooks) {
1509
1545
  if (vnode.shapeFlag & 6 && vnode.component) {
1510
- vnode.transition = hooks;
1511
- setTransitionHooks(vnode.component.subTree, hooks);
1546
+ if (vnode.type.__vapor) {
1547
+ getVaporInterface(vnode.component, vnode).setTransitionHooks(
1548
+ vnode.component,
1549
+ hooks
1550
+ );
1551
+ } else {
1552
+ vnode.transition = hooks;
1553
+ setTransitionHooks(vnode.component.subTree, hooks);
1554
+ }
1512
1555
  } else if (vnode.shapeFlag & 128) {
1513
1556
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1514
1557
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -1538,8 +1581,12 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
1538
1581
  }
1539
1582
  return ret;
1540
1583
  }
1584
+ function checkTransitionMode(mode) {
1585
+ if (!!(process.env.NODE_ENV !== "production") && mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
1586
+ warn$1(`invalid <transition> mode: ${mode}`);
1587
+ }
1588
+ }
1541
1589
 
1542
- /*! #__NO_SIDE_EFFECTS__ */
1543
1590
  // @__NO_SIDE_EFFECTS__
1544
1591
  function defineComponent(options, extraOptions) {
1545
1592
  return isFunction(options) ? (
@@ -1592,6 +1639,7 @@ function useTemplateRef(key) {
1592
1639
  return ret;
1593
1640
  }
1594
1641
 
1642
+ const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
1595
1643
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1596
1644
  if (isArray(rawRef)) {
1597
1645
  rawRef.forEach(
@@ -1623,28 +1671,23 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1623
1671
  const oldRef = oldRawRef && oldRawRef.r;
1624
1672
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
1625
1673
  const setupState = owner.setupState;
1626
- const rawSetupState = toRaw(setupState);
1627
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
1628
- if (!!(process.env.NODE_ENV !== "production")) {
1629
- if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
1630
- warn$1(
1631
- `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
1632
- );
1633
- }
1634
- if (knownTemplateRefs.has(rawSetupState[key])) {
1635
- return false;
1636
- }
1637
- }
1638
- return hasOwn(rawSetupState, key);
1674
+ const canSetSetupRef = createCanSetSetupRefChecker(setupState);
1675
+ const canSetRef = (ref2) => {
1676
+ return !!!(process.env.NODE_ENV !== "production") || !knownTemplateRefs.has(ref2);
1639
1677
  };
1640
1678
  if (oldRef != null && oldRef !== ref) {
1679
+ invalidatePendingSetRef(oldRawRef);
1641
1680
  if (isString(oldRef)) {
1642
1681
  refs[oldRef] = null;
1643
1682
  if (canSetSetupRef(oldRef)) {
1644
1683
  setupState[oldRef] = null;
1645
1684
  }
1646
1685
  } else if (isRef(oldRef)) {
1647
- oldRef.value = null;
1686
+ if (canSetRef(oldRef)) {
1687
+ oldRef.value = null;
1688
+ }
1689
+ const oldRawRefAtom = oldRawRef;
1690
+ if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
1648
1691
  }
1649
1692
  }
1650
1693
  if (isFunction(ref)) {
@@ -1655,7 +1698,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1655
1698
  if (_isString || _isRef) {
1656
1699
  const doSet = () => {
1657
1700
  if (rawRef.f) {
1658
- const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
1701
+ const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
1659
1702
  if (isUnmount) {
1660
1703
  isArray(existing) && remove(existing, refValue);
1661
1704
  } else {
@@ -1666,8 +1709,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1666
1709
  setupState[ref] = refs[ref];
1667
1710
  }
1668
1711
  } else {
1669
- ref.value = [refValue];
1670
- if (rawRef.k) refs[rawRef.k] = ref.value;
1712
+ const newVal = [refValue];
1713
+ if (canSetRef(ref)) {
1714
+ ref.value = newVal;
1715
+ }
1716
+ if (rawRef.k) refs[rawRef.k] = newVal;
1671
1717
  }
1672
1718
  } else if (!existing.includes(refValue)) {
1673
1719
  existing.push(refValue);
@@ -1679,15 +1725,23 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1679
1725
  setupState[ref] = value;
1680
1726
  }
1681
1727
  } else if (_isRef) {
1682
- ref.value = value;
1728
+ if (canSetRef(ref)) {
1729
+ ref.value = value;
1730
+ }
1683
1731
  if (rawRef.k) refs[rawRef.k] = value;
1684
1732
  } else if (!!(process.env.NODE_ENV !== "production")) {
1685
1733
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
1686
1734
  }
1687
1735
  };
1688
1736
  if (value) {
1689
- queuePostRenderEffect(doSet, -1, parentSuspense);
1737
+ const job = () => {
1738
+ doSet();
1739
+ pendingSetRefMap.delete(rawRef);
1740
+ };
1741
+ pendingSetRefMap.set(rawRef, job);
1742
+ queuePostRenderEffect(job, -1, parentSuspense);
1690
1743
  } else {
1744
+ invalidatePendingSetRef(rawRef);
1691
1745
  doSet();
1692
1746
  }
1693
1747
  } else if (!!(process.env.NODE_ENV !== "production")) {
@@ -1695,6 +1749,29 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1695
1749
  }
1696
1750
  }
1697
1751
  }
1752
+ function createCanSetSetupRefChecker(setupState) {
1753
+ const rawSetupState = toRaw(setupState);
1754
+ return setupState === void 0 || setupState === EMPTY_OBJ ? NO : (key) => {
1755
+ if (!!(process.env.NODE_ENV !== "production")) {
1756
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
1757
+ warn$1(
1758
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
1759
+ );
1760
+ }
1761
+ if (knownTemplateRefs.has(rawSetupState[key])) {
1762
+ return false;
1763
+ }
1764
+ }
1765
+ return hasOwn(rawSetupState, key);
1766
+ };
1767
+ }
1768
+ function invalidatePendingSetRef(rawRef) {
1769
+ const pendingSetRef = pendingSetRefMap.get(rawRef);
1770
+ if (pendingSetRef) {
1771
+ pendingSetRef.flags |= 4;
1772
+ pendingSetRefMap.delete(rawRef);
1773
+ }
1774
+ }
1698
1775
 
1699
1776
  let hasLoggedMismatchError = false;
1700
1777
  const logMismatchError = () => {
@@ -1839,6 +1916,12 @@ function createHydrationFunctions(rendererInternals) {
1839
1916
  );
1840
1917
  }
1841
1918
  break;
1919
+ case VaporSlot:
1920
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(
1921
+ vnode,
1922
+ node
1923
+ );
1924
+ break;
1842
1925
  default:
1843
1926
  if (shapeFlag & 1) {
1844
1927
  if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
@@ -1854,9 +1937,6 @@ function createHydrationFunctions(rendererInternals) {
1854
1937
  );
1855
1938
  }
1856
1939
  } else if (shapeFlag & 6) {
1857
- if (vnode.type.__vapor) {
1858
- throw new Error("Vapor component hydration is not supported yet.");
1859
- }
1860
1940
  vnode.slotScopeIds = slotScopeIds;
1861
1941
  const container = parentNode(node);
1862
1942
  if (isFragmentStart) {
@@ -1866,15 +1946,25 @@ function createHydrationFunctions(rendererInternals) {
1866
1946
  } else {
1867
1947
  nextNode = nextSibling(node);
1868
1948
  }
1869
- mountComponent(
1870
- vnode,
1871
- container,
1872
- null,
1873
- parentComponent,
1874
- parentSuspense,
1875
- getContainerType(container),
1876
- optimized
1877
- );
1949
+ if (vnode.type.__vapor) {
1950
+ getVaporInterface(parentComponent, vnode).hydrate(
1951
+ vnode,
1952
+ node,
1953
+ container,
1954
+ null,
1955
+ parentComponent
1956
+ );
1957
+ } else {
1958
+ mountComponent(
1959
+ vnode,
1960
+ container,
1961
+ null,
1962
+ parentComponent,
1963
+ parentSuspense,
1964
+ getContainerType(container),
1965
+ optimized
1966
+ );
1967
+ }
1878
1968
  if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
1879
1969
  let subTree;
1880
1970
  if (isFragmentStart) {
@@ -1959,7 +2049,7 @@ function createHydrationFunctions(rendererInternals) {
1959
2049
  );
1960
2050
  let hasWarned = false;
1961
2051
  while (next) {
1962
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
2052
+ if (!isMismatchAllowed(el, 1)) {
1963
2053
  if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
1964
2054
  warn$1(
1965
2055
  `Hydration children mismatch on`,
@@ -1980,14 +2070,16 @@ Server rendered element contains more child nodes than client vdom.`
1980
2070
  if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
1981
2071
  clientText = clientText.slice(1);
1982
2072
  }
1983
- if (el.textContent !== clientText) {
1984
- if (!isMismatchAllowed(el, 0 /* TEXT */)) {
2073
+ const { textContent } = el;
2074
+ if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
2075
+ textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
2076
+ if (!isMismatchAllowed(el, 0)) {
1985
2077
  (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
1986
2078
  `Hydration text content mismatch on`,
1987
2079
  el,
1988
2080
  `
1989
- - rendered on server: ${el.textContent}
1990
- - expected on client: ${vnode.children}`
2081
+ - rendered on server: ${textContent}
2082
+ - expected on client: ${clientText}`
1991
2083
  );
1992
2084
  logMismatchError();
1993
2085
  }
@@ -2074,7 +2166,7 @@ Server rendered element contains more child nodes than client vdom.`
2074
2166
  } else if (isText && !vnode.children) {
2075
2167
  insert(vnode.el = createText(""), container);
2076
2168
  } else {
2077
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
2169
+ if (!isMismatchAllowed(container, 1)) {
2078
2170
  if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
2079
2171
  warn$1(
2080
2172
  `Hydration children mismatch on`,
@@ -2124,7 +2216,7 @@ Server rendered element contains fewer child nodes than client vdom.`
2124
2216
  }
2125
2217
  };
2126
2218
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
2127
- if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
2219
+ if (!isMismatchAllowed(node.parentElement, 1)) {
2128
2220
  (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
2129
2221
  `Hydration node mismatch:
2130
2222
  - rendered on server:`,
@@ -2197,11 +2289,11 @@ Server rendered element contains fewer child nodes than client vdom.`
2197
2289
  parent = parent.parent;
2198
2290
  }
2199
2291
  };
2200
- const isTemplateNode = (node) => {
2201
- return node.nodeType === 1 && node.tagName === "TEMPLATE";
2202
- };
2203
2292
  return [hydrate, hydrateNode];
2204
2293
  }
2294
+ const isTemplateNode = (node) => {
2295
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
2296
+ };
2205
2297
  function propHasMismatch(el, key, clientValue, vnode, instance) {
2206
2298
  let mismatchType;
2207
2299
  let mismatchKey;
@@ -2216,7 +2308,7 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
2216
2308
  }
2217
2309
  expected = normalizeClass(clientValue);
2218
2310
  if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
2219
- mismatchType = 2 /* CLASS */;
2311
+ mismatchType = 2;
2220
2312
  mismatchKey = `class`;
2221
2313
  }
2222
2314
  } else if (key === "style") {
@@ -2235,31 +2327,43 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
2235
2327
  resolveCssVars(instance, vnode, expectedMap);
2236
2328
  }
2237
2329
  if (!isMapEqual(actualMap, expectedMap)) {
2238
- mismatchType = 3 /* STYLE */;
2330
+ mismatchType = 3;
2239
2331
  mismatchKey = "style";
2240
2332
  }
2241
- } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
2242
- if (isBooleanAttr(key)) {
2243
- actual = el.hasAttribute(key);
2244
- expected = includeBooleanAttr(clientValue);
2245
- } else if (clientValue == null) {
2246
- actual = el.hasAttribute(key);
2247
- expected = false;
2248
- } else {
2249
- if (el.hasAttribute(key)) {
2250
- actual = el.getAttribute(key);
2251
- } else if (key === "value" && el.tagName === "TEXTAREA") {
2252
- actual = el.value;
2253
- } else {
2254
- actual = false;
2255
- }
2256
- expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
2257
- }
2333
+ } else if (isValidHtmlOrSvgAttribute(el, key)) {
2334
+ ({ actual, expected } = getAttributeMismatch(el, key, clientValue));
2258
2335
  if (actual !== expected) {
2259
- mismatchType = 4 /* ATTRIBUTE */;
2336
+ mismatchType = 4;
2260
2337
  mismatchKey = key;
2261
2338
  }
2262
2339
  }
2340
+ return warnPropMismatch(el, mismatchKey, mismatchType, actual, expected);
2341
+ }
2342
+ function getAttributeMismatch(el, key, clientValue) {
2343
+ let actual;
2344
+ let expected;
2345
+ if (isBooleanAttr(key)) {
2346
+ actual = el.hasAttribute(key);
2347
+ expected = includeBooleanAttr(clientValue);
2348
+ } else if (clientValue == null) {
2349
+ actual = el.hasAttribute(key);
2350
+ expected = false;
2351
+ } else {
2352
+ if (el.hasAttribute(key)) {
2353
+ actual = el.getAttribute(key);
2354
+ } else if (key === "value" && el.tagName === "TEXTAREA") {
2355
+ actual = el.value;
2356
+ } else {
2357
+ actual = false;
2358
+ }
2359
+ expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
2360
+ }
2361
+ return { actual, expected };
2362
+ }
2363
+ function isValidHtmlOrSvgAttribute(el, key) {
2364
+ return el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key));
2365
+ }
2366
+ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
2263
2367
  if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
2264
2368
  const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
2265
2369
  const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
@@ -2330,15 +2434,27 @@ function resolveCssVars(instance, vnode, expectedMap) {
2330
2434
  }
2331
2435
  }
2332
2436
  const allowMismatchAttr = "data-allow-mismatch";
2437
+ const MismatchTypes = {
2438
+ "TEXT": 0,
2439
+ "0": "TEXT",
2440
+ "CHILDREN": 1,
2441
+ "1": "CHILDREN",
2442
+ "CLASS": 2,
2443
+ "2": "CLASS",
2444
+ "STYLE": 3,
2445
+ "3": "STYLE",
2446
+ "ATTRIBUTE": 4,
2447
+ "4": "ATTRIBUTE"
2448
+ };
2333
2449
  const MismatchTypeString = {
2334
- [0 /* TEXT */]: "text",
2335
- [1 /* CHILDREN */]: "children",
2336
- [2 /* CLASS */]: "class",
2337
- [3 /* STYLE */]: "style",
2338
- [4 /* ATTRIBUTE */]: "attribute"
2450
+ [0]: "text",
2451
+ [1]: "children",
2452
+ [2]: "class",
2453
+ [3]: "style",
2454
+ [4]: "attribute"
2339
2455
  };
2340
2456
  function isMismatchAllowed(el, allowedType) {
2341
- if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
2457
+ if (allowedType === 0 || allowedType === 1) {
2342
2458
  while (el && !el.hasAttribute(allowMismatchAttr)) {
2343
2459
  el = el.parentElement;
2344
2460
  }
@@ -2350,7 +2466,7 @@ function isMismatchAllowed(el, allowedType) {
2350
2466
  return true;
2351
2467
  } else {
2352
2468
  const list = allowedAttr.split(",");
2353
- if (allowedType === 0 /* TEXT */ && list.includes("children")) {
2469
+ if (allowedType === 0 && list.includes("children")) {
2354
2470
  return true;
2355
2471
  }
2356
2472
  return list.includes(MismatchTypeString[allowedType]);
@@ -2407,7 +2523,9 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
2407
2523
  hasHydrated = true;
2408
2524
  teardown();
2409
2525
  hydrate();
2410
- e.target.dispatchEvent(new e.constructor(e.type, e));
2526
+ if (!(`$evt${e.type}` in e.target)) {
2527
+ e.target.dispatchEvent(new e.constructor(e.type, e));
2528
+ }
2411
2529
  }
2412
2530
  };
2413
2531
  const teardown = () => {
@@ -2449,104 +2567,46 @@ function forEachElement(node, cb) {
2449
2567
  }
2450
2568
 
2451
2569
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
2452
- /*! #__NO_SIDE_EFFECTS__ */
2453
2570
  // @__NO_SIDE_EFFECTS__
2454
2571
  function defineAsyncComponent(source) {
2455
- if (isFunction(source)) {
2456
- source = { loader: source };
2457
- }
2458
2572
  const {
2459
- loader,
2460
- loadingComponent,
2461
- errorComponent,
2462
- delay = 200,
2463
- hydrate: hydrateStrategy,
2464
- timeout,
2465
- // undefined = never times out
2466
- suspensible = true,
2467
- onError: userOnError
2468
- } = source;
2469
- let pendingRequest = null;
2470
- let resolvedComp;
2471
- let retries = 0;
2472
- const retry = () => {
2473
- retries++;
2474
- pendingRequest = null;
2475
- return load();
2476
- };
2477
- const load = () => {
2478
- let thisRequest;
2479
- return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
2480
- err = err instanceof Error ? err : new Error(String(err));
2481
- if (userOnError) {
2482
- return new Promise((resolve, reject) => {
2483
- const userRetry = () => resolve(retry());
2484
- const userFail = () => reject(err);
2485
- userOnError(err, userRetry, userFail, retries + 1);
2486
- });
2487
- } else {
2488
- throw err;
2489
- }
2490
- }).then((comp) => {
2491
- if (thisRequest !== pendingRequest && pendingRequest) {
2492
- return pendingRequest;
2493
- }
2494
- if (!!(process.env.NODE_ENV !== "production") && !comp) {
2495
- warn$1(
2496
- `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
2497
- );
2498
- }
2499
- if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
2500
- comp = comp.default;
2501
- }
2502
- if (!!(process.env.NODE_ENV !== "production") && comp && !isObject(comp) && !isFunction(comp)) {
2503
- throw new Error(`Invalid async component load result: ${comp}`);
2504
- }
2505
- resolvedComp = comp;
2506
- return comp;
2507
- }));
2508
- };
2573
+ load,
2574
+ getResolvedComp,
2575
+ setPendingRequest,
2576
+ source: {
2577
+ loadingComponent,
2578
+ errorComponent,
2579
+ delay,
2580
+ hydrate: hydrateStrategy,
2581
+ timeout,
2582
+ suspensible = true
2583
+ }
2584
+ } = createAsyncComponentContext(source);
2509
2585
  return defineComponent({
2510
2586
  name: "AsyncComponentWrapper",
2511
2587
  __asyncLoader: load,
2512
2588
  __asyncHydrate(el, instance, hydrate) {
2513
- let patched = false;
2514
- const doHydrate = hydrateStrategy ? () => {
2515
- const performHydrate = () => {
2516
- if (!!(process.env.NODE_ENV !== "production") && patched) {
2517
- warn$1(
2518
- `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.`
2519
- );
2520
- return;
2521
- }
2522
- hydrate();
2523
- };
2524
- const teardown = hydrateStrategy(
2525
- performHydrate,
2526
- (cb) => forEachElement(el, cb)
2527
- );
2528
- if (teardown) {
2529
- (instance.bum || (instance.bum = [])).push(teardown);
2530
- }
2531
- (instance.u || (instance.u = [])).push(() => patched = true);
2532
- } : hydrate;
2533
- if (resolvedComp) {
2534
- doHydrate();
2535
- } else {
2536
- load().then(() => !instance.isUnmounted && doHydrate());
2537
- }
2589
+ performAsyncHydrate(
2590
+ el,
2591
+ instance,
2592
+ hydrate,
2593
+ getResolvedComp,
2594
+ load,
2595
+ hydrateStrategy
2596
+ );
2538
2597
  },
2539
2598
  get __asyncResolved() {
2540
- return resolvedComp;
2599
+ return getResolvedComp();
2541
2600
  },
2542
2601
  setup() {
2543
2602
  const instance = currentInstance;
2544
2603
  markAsyncBoundary(instance);
2604
+ let resolvedComp = getResolvedComp();
2545
2605
  if (resolvedComp) {
2546
2606
  return () => createInnerComp(resolvedComp, instance);
2547
2607
  }
2548
2608
  const onError = (err) => {
2549
- pendingRequest = null;
2609
+ setPendingRequest(null);
2550
2610
  handleError(
2551
2611
  err,
2552
2612
  instance,
@@ -2564,25 +2624,11 @@ function defineAsyncComponent(source) {
2564
2624
  }) : null;
2565
2625
  });
2566
2626
  }
2567
- const loaded = ref(false);
2568
- const error = ref();
2569
- const delayed = ref(!!delay);
2570
- if (delay) {
2571
- setTimeout(() => {
2572
- delayed.value = false;
2573
- }, delay);
2574
- }
2575
- if (timeout != null) {
2576
- setTimeout(() => {
2577
- if (!loaded.value && !error.value) {
2578
- const err = new Error(
2579
- `Async component timed out after ${timeout}ms.`
2580
- );
2581
- onError(err);
2582
- error.value = err;
2583
- }
2584
- }, timeout);
2585
- }
2627
+ const { loaded, error, delayed } = useAsyncComponentState(
2628
+ delay,
2629
+ timeout,
2630
+ onError
2631
+ );
2586
2632
  load().then(() => {
2587
2633
  loaded.value = true;
2588
2634
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
@@ -2593,6 +2639,7 @@ function defineAsyncComponent(source) {
2593
2639
  error.value = err;
2594
2640
  });
2595
2641
  return () => {
2642
+ resolvedComp = getResolvedComp();
2596
2643
  if (loaded.value && resolvedComp) {
2597
2644
  return createInnerComp(resolvedComp, instance);
2598
2645
  } else if (error.value && errorComponent) {
@@ -2600,7 +2647,10 @@ function defineAsyncComponent(source) {
2600
2647
  error: error.value
2601
2648
  });
2602
2649
  } else if (loadingComponent && !delayed.value) {
2603
- return createVNode(loadingComponent);
2650
+ return createInnerComp(
2651
+ loadingComponent,
2652
+ instance
2653
+ );
2604
2654
  }
2605
2655
  };
2606
2656
  }
@@ -2614,6 +2664,108 @@ function createInnerComp(comp, parent) {
2614
2664
  delete parent.vnode.ce;
2615
2665
  return vnode;
2616
2666
  }
2667
+ function createAsyncComponentContext(source) {
2668
+ if (isFunction(source)) {
2669
+ source = { loader: source };
2670
+ }
2671
+ const { loader, onError: userOnError } = source;
2672
+ let pendingRequest = null;
2673
+ let resolvedComp;
2674
+ let retries = 0;
2675
+ const retry = () => {
2676
+ retries++;
2677
+ pendingRequest = null;
2678
+ return load();
2679
+ };
2680
+ const load = () => {
2681
+ let thisRequest;
2682
+ return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
2683
+ err = err instanceof Error ? err : new Error(String(err));
2684
+ if (userOnError) {
2685
+ return new Promise((resolve, reject) => {
2686
+ const userRetry = () => resolve(retry());
2687
+ const userFail = () => reject(err);
2688
+ userOnError(err, userRetry, userFail, retries + 1);
2689
+ });
2690
+ } else {
2691
+ throw err;
2692
+ }
2693
+ }).then((comp) => {
2694
+ if (thisRequest !== pendingRequest && pendingRequest) {
2695
+ return pendingRequest;
2696
+ }
2697
+ if (!!(process.env.NODE_ENV !== "production") && !comp) {
2698
+ warn$1(
2699
+ `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
2700
+ );
2701
+ }
2702
+ if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
2703
+ comp = comp.default;
2704
+ }
2705
+ if (!!(process.env.NODE_ENV !== "production") && comp && !isObject(comp) && !isFunction(comp)) {
2706
+ throw new Error(`Invalid async component load result: ${comp}`);
2707
+ }
2708
+ resolvedComp = comp;
2709
+ return comp;
2710
+ }));
2711
+ };
2712
+ return {
2713
+ load,
2714
+ source,
2715
+ getResolvedComp: () => resolvedComp,
2716
+ setPendingRequest: (request) => pendingRequest = request
2717
+ };
2718
+ }
2719
+ const useAsyncComponentState = (delay, timeout, onError) => {
2720
+ const loaded = ref(false);
2721
+ const error = ref();
2722
+ const delayed = ref(!!delay);
2723
+ if (delay) {
2724
+ setTimeout(() => {
2725
+ delayed.value = false;
2726
+ }, delay);
2727
+ }
2728
+ if (timeout != null) {
2729
+ setTimeout(() => {
2730
+ if (!loaded.value && !error.value) {
2731
+ const err = new Error(`Async component timed out after ${timeout}ms.`);
2732
+ onError(err);
2733
+ error.value = err;
2734
+ }
2735
+ }, timeout);
2736
+ }
2737
+ return { loaded, error, delayed };
2738
+ };
2739
+ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
2740
+ let patched = false;
2741
+ (instance.bu || (instance.bu = [])).push(() => patched = true);
2742
+ const performHydrate = () => {
2743
+ if (patched) {
2744
+ if (!!(process.env.NODE_ENV !== "production")) {
2745
+ const resolvedComp = getResolvedComp();
2746
+ warn$1(
2747
+ `Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
2748
+ );
2749
+ }
2750
+ return;
2751
+ }
2752
+ hydrate();
2753
+ };
2754
+ const doHydrate = hydrateStrategy ? () => {
2755
+ const teardown = hydrateStrategy(
2756
+ performHydrate,
2757
+ (cb) => forEachElement(el, cb)
2758
+ );
2759
+ if (teardown) {
2760
+ (instance.bum || (instance.bum = [])).push(teardown);
2761
+ }
2762
+ } : performHydrate;
2763
+ if (getResolvedComp()) {
2764
+ doHydrate();
2765
+ } else {
2766
+ load().then(() => !instance.isUnmounted && doHydrate());
2767
+ }
2768
+ }
2617
2769
 
2618
2770
  const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
2619
2771
  const KeepAliveImpl = {
@@ -2643,86 +2795,37 @@ const KeepAliveImpl = {
2643
2795
  keepAliveInstance.__v_cache = cache;
2644
2796
  }
2645
2797
  const parentSuspense = keepAliveInstance.suspense;
2798
+ const { renderer } = sharedContext;
2646
2799
  const {
2647
- renderer: {
2648
- p: patch,
2649
- m: move,
2650
- um: _unmount,
2651
- o: { createElement }
2652
- }
2653
- } = sharedContext;
2800
+ um: _unmount,
2801
+ o: { createElement }
2802
+ } = renderer;
2654
2803
  const storageContainer = createElement("div");
2804
+ sharedContext.getStorageContainer = () => storageContainer;
2805
+ sharedContext.getCachedComponent = (vnode) => {
2806
+ const key = vnode.key == null ? vnode.type : vnode.key;
2807
+ return cache.get(key);
2808
+ };
2655
2809
  sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
2656
- const instance = vnode.component;
2657
- move(
2810
+ activate(
2658
2811
  vnode,
2659
2812
  container,
2660
2813
  anchor,
2661
- 0,
2814
+ renderer,
2662
2815
  keepAliveInstance,
2663
- parentSuspense
2664
- );
2665
- patch(
2666
- instance.vnode,
2667
- vnode,
2668
- container,
2669
- anchor,
2670
- instance,
2671
2816
  parentSuspense,
2672
2817
  namespace,
2673
- vnode.slotScopeIds,
2674
2818
  optimized
2675
2819
  );
2676
- queuePostRenderEffect(
2677
- () => {
2678
- instance.isDeactivated = false;
2679
- if (instance.a) {
2680
- invokeArrayFns(instance.a);
2681
- }
2682
- const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
2683
- if (vnodeHook) {
2684
- invokeVNodeHook(vnodeHook, instance.parent, vnode);
2685
- }
2686
- },
2687
- void 0,
2688
- parentSuspense
2689
- );
2690
- if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
2691
- devtoolsComponentAdded(instance);
2692
- }
2693
2820
  };
2694
2821
  sharedContext.deactivate = (vnode) => {
2695
- const instance = vnode.component;
2696
- invalidateMount(instance.m);
2697
- invalidateMount(instance.a);
2698
- move(
2822
+ deactivate(
2699
2823
  vnode,
2700
2824
  storageContainer,
2701
- null,
2702
- 1,
2825
+ renderer,
2703
2826
  keepAliveInstance,
2704
2827
  parentSuspense
2705
2828
  );
2706
- queuePostRenderEffect(
2707
- () => {
2708
- if (instance.da) {
2709
- invokeArrayFns(instance.da);
2710
- }
2711
- const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
2712
- if (vnodeHook) {
2713
- invokeVNodeHook(vnodeHook, instance.parent, vnode);
2714
- }
2715
- instance.isDeactivated = true;
2716
- },
2717
- void 0,
2718
- parentSuspense
2719
- );
2720
- if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
2721
- devtoolsComponentAdded(instance);
2722
- }
2723
- if (!!(process.env.NODE_ENV !== "production") && true) {
2724
- instance.__keepAliveStorageContainer = storageContainer;
2725
- }
2726
2829
  };
2727
2830
  function unmount(vnode) {
2728
2831
  resetShapeFlag(vnode);
@@ -2869,7 +2972,7 @@ function onActivated(hook, target) {
2869
2972
  function onDeactivated(hook, target) {
2870
2973
  registerKeepAliveHook(hook, "da", target);
2871
2974
  }
2872
- function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
2975
+ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance()) {
2873
2976
  const wrappedHook = hook.__wdc || (hook.__wdc = () => {
2874
2977
  let current = target;
2875
2978
  while (current) {
@@ -2883,8 +2986,9 @@ function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
2883
2986
  injectHook(type, wrappedHook, target);
2884
2987
  if (target) {
2885
2988
  let current = target.parent;
2886
- while (current && current.parent && current.parent.vnode) {
2887
- if (isKeepAlive(current.parent.vnode)) {
2989
+ while (current && current.parent) {
2990
+ let parent = current.parent;
2991
+ if (isKeepAlive(parent.vapor ? parent : parent.vnode)) {
2888
2992
  injectToKeepAliveRoot(wrappedHook, type, target, current);
2889
2993
  }
2890
2994
  current = current.parent;
@@ -2910,6 +3014,71 @@ function resetShapeFlag(vnode) {
2910
3014
  function getInnerChild(vnode) {
2911
3015
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
2912
3016
  }
3017
+ function activate(vnode, container, anchor, { p: patch, m: move }, parentComponent, parentSuspense, namespace, optimized) {
3018
+ const instance = vnode.component;
3019
+ move(
3020
+ vnode,
3021
+ container,
3022
+ anchor,
3023
+ 0,
3024
+ parentComponent,
3025
+ parentSuspense
3026
+ );
3027
+ patch(
3028
+ instance.vnode,
3029
+ vnode,
3030
+ container,
3031
+ anchor,
3032
+ instance,
3033
+ parentSuspense,
3034
+ namespace,
3035
+ vnode.slotScopeIds,
3036
+ optimized
3037
+ );
3038
+ queuePostRenderEffect(
3039
+ () => {
3040
+ instance.isDeactivated = false;
3041
+ if (instance.a) {
3042
+ invokeArrayFns(instance.a);
3043
+ }
3044
+ const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
3045
+ if (vnodeHook) {
3046
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
3047
+ }
3048
+ },
3049
+ void 0,
3050
+ parentSuspense
3051
+ );
3052
+ if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
3053
+ devtoolsComponentAdded(instance);
3054
+ }
3055
+ }
3056
+ function deactivate(vnode, container, { m: move }, parentComponent, parentSuspense) {
3057
+ const instance = vnode.component;
3058
+ invalidateMount(instance.m);
3059
+ invalidateMount(instance.a);
3060
+ move(vnode, container, null, 1, parentComponent, parentSuspense);
3061
+ queuePostRenderEffect(
3062
+ () => {
3063
+ if (instance.da) {
3064
+ invokeArrayFns(instance.da);
3065
+ }
3066
+ const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
3067
+ if (vnodeHook) {
3068
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
3069
+ }
3070
+ instance.isDeactivated = true;
3071
+ },
3072
+ void 0,
3073
+ parentSuspense
3074
+ );
3075
+ if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
3076
+ devtoolsComponentAdded(instance);
3077
+ }
3078
+ if (!!(process.env.NODE_ENV !== "production") && true) {
3079
+ instance.__keepAliveStorageContainer = container;
3080
+ }
3081
+ }
2913
3082
 
2914
3083
  function injectHook(type, hook, target = currentInstance, prepend = false) {
2915
3084
  if (target) {
@@ -3098,12 +3267,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
3098
3267
  return ret;
3099
3268
  }
3100
3269
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
3270
+ const hasProps = Object.keys(props).length > 0;
3101
3271
  if (name !== "default") props.name = name;
3102
3272
  return openBlock(), createBlock(
3103
3273
  Fragment,
3104
3274
  null,
3105
3275
  [createVNode("slot", props, fallback && fallback())],
3106
- 64
3276
+ hasProps ? -2 : 64
3107
3277
  );
3108
3278
  }
3109
3279
  if (!!(process.env.NODE_ENV !== "production") && slot && slot.length > 1) {
@@ -3117,6 +3287,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
3117
3287
  }
3118
3288
  openBlock();
3119
3289
  const validSlotContent = slot && ensureValidVNode(slot(props));
3290
+ ensureVaporSlotFallback(validSlotContent, fallback);
3120
3291
  const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
3121
3292
  // key attached in the `createSlots` helper, respect that
3122
3293
  validSlotContent && validSlotContent.key;
@@ -3146,6 +3317,14 @@ function ensureValidVNode(vnodes) {
3146
3317
  return true;
3147
3318
  }) ? vnodes : null;
3148
3319
  }
3320
+ function ensureVaporSlotFallback(vnodes, fallback) {
3321
+ let vaporSlot;
3322
+ if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
3323
+ if (!vaporSlot.fallback && fallback) {
3324
+ vaporSlot.fallback = fallback;
3325
+ }
3326
+ }
3327
+ }
3149
3328
 
3150
3329
  function toHandlers(obj, preserveCaseIfNecessary) {
3151
3330
  const ret = {};
@@ -3216,7 +3395,7 @@ const PublicInstanceProxyHandlers = {
3216
3395
  } else if (hasSetupBinding(setupState, key)) {
3217
3396
  accessCache[key] = 1 /* SETUP */;
3218
3397
  return setupState[key];
3219
- } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
3398
+ } else if (__VUE_OPTIONS_API__ && data !== EMPTY_OBJ && hasOwn(data, key)) {
3220
3399
  accessCache[key] = 2 /* DATA */;
3221
3400
  return data[key];
3222
3401
  } else if (
@@ -3282,7 +3461,7 @@ const PublicInstanceProxyHandlers = {
3282
3461
  } else if (!!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup && hasOwn(setupState, key)) {
3283
3462
  warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
3284
3463
  return false;
3285
- } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
3464
+ } else if (__VUE_OPTIONS_API__ && data !== EMPTY_OBJ && hasOwn(data, key)) {
3286
3465
  data[key] = value;
3287
3466
  return true;
3288
3467
  } else if (hasOwn(instance.props, key)) {
@@ -3308,10 +3487,10 @@ const PublicInstanceProxyHandlers = {
3308
3487
  return true;
3309
3488
  },
3310
3489
  has({
3311
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
3490
+ _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
3312
3491
  }, key) {
3313
- let normalizedProps;
3314
- return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
3492
+ let normalizedProps, cssModules;
3493
+ return !!(accessCache[key] || __VUE_OPTIONS_API__ && data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
3315
3494
  },
3316
3495
  defineProperty(target, key, descriptor) {
3317
3496
  if (descriptor.get != null) {
@@ -3449,15 +3628,15 @@ function withDefaults(props, defaults) {
3449
3628
  return null;
3450
3629
  }
3451
3630
  function useSlots() {
3452
- return getContext().slots;
3631
+ return getContext("useSlots").slots;
3453
3632
  }
3454
3633
  function useAttrs() {
3455
- return getContext().attrs;
3634
+ return getContext("useAttrs").attrs;
3456
3635
  }
3457
- function getContext() {
3636
+ function getContext(calledFunctionName) {
3458
3637
  const i = getCurrentGenericInstance();
3459
3638
  if (!!(process.env.NODE_ENV !== "production") && !i) {
3460
- warn$1(`useContext() called without active instance.`);
3639
+ warn$1(`${calledFunctionName}() called without active instance.`);
3461
3640
  }
3462
3641
  if (i.vapor) {
3463
3642
  return i;
@@ -3715,7 +3894,8 @@ function applyOptions(instance) {
3715
3894
  expose.forEach((key) => {
3716
3895
  Object.defineProperty(exposed, key, {
3717
3896
  get: () => publicThis[key],
3718
- set: (val) => publicThis[key] = val
3897
+ set: (val) => publicThis[key] = val,
3898
+ enumerable: true
3719
3899
  });
3720
3900
  });
3721
3901
  } else if (!instance.exposed) {
@@ -4590,7 +4770,7 @@ function isBoolean(...args) {
4590
4770
  return args.some((elem) => elem.toLowerCase() === "boolean");
4591
4771
  }
4592
4772
 
4593
- const isInternalKey = (key) => key[0] === "_" || key === "$stable";
4773
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
4594
4774
  const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
4595
4775
  const normalizeSlot = (key, rawSlot, ctx) => {
4596
4776
  if (rawSlot._n) {
@@ -4644,8 +4824,6 @@ const assignSlots = (slots, children, optimized) => {
4644
4824
  const initSlots = (instance, children, optimized) => {
4645
4825
  const slots = instance.slots = createInternalObject();
4646
4826
  if (instance.vnode.shapeFlag & 32) {
4647
- const cacheIndexes = children.__;
4648
- if (cacheIndexes) def(slots, "__", cacheIndexes, true);
4649
4827
  const type = children._;
4650
4828
  if (type) {
4651
4829
  assignSlots(slots, children, optimized);
@@ -4709,12 +4887,10 @@ function endMeasure(instance, type) {
4709
4887
  if (instance.appContext.config.performance && isSupported()) {
4710
4888
  const startTag = `vue-${type}-${instance.uid}`;
4711
4889
  const endTag = startTag + `:end`;
4890
+ const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
4712
4891
  perf.mark(endTag);
4713
- perf.measure(
4714
- `<${formatComponentName(instance, instance.type)}> ${type}`,
4715
- startTag,
4716
- endTag
4717
- );
4892
+ perf.measure(measureName, startTag, endTag);
4893
+ perf.clearMeasures(measureName);
4718
4894
  perf.clearMarks(startTag);
4719
4895
  perf.clearMarks(endTag);
4720
4896
  }
@@ -4991,15 +5167,25 @@ function baseCreateRenderer(options, createHydrationFns) {
4991
5167
  optimized
4992
5168
  );
4993
5169
  } else {
4994
- patchElement(
4995
- n1,
4996
- n2,
4997
- parentComponent,
4998
- parentSuspense,
4999
- namespace,
5000
- slotScopeIds,
5001
- optimized
5002
- );
5170
+ const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
5171
+ try {
5172
+ if (customElement) {
5173
+ customElement._beginPatch();
5174
+ }
5175
+ patchElement(
5176
+ n1,
5177
+ n2,
5178
+ parentComponent,
5179
+ parentSuspense,
5180
+ namespace,
5181
+ slotScopeIds,
5182
+ optimized
5183
+ );
5184
+ } finally {
5185
+ if (customElement) {
5186
+ customElement._endPatch();
5187
+ }
5188
+ }
5003
5189
  }
5004
5190
  };
5005
5191
  const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
@@ -5050,16 +5236,20 @@ function baseCreateRenderer(options, createHydrationFns) {
5050
5236
  if (dirs) {
5051
5237
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
5052
5238
  }
5053
- const needCallTransitionHooks = needTransition(parentSuspense, transition);
5054
- if (needCallTransitionHooks) {
5055
- transition.beforeEnter(el);
5239
+ if (transition) {
5240
+ performTransitionEnter(
5241
+ el,
5242
+ transition,
5243
+ () => hostInsert(el, container, anchor),
5244
+ parentSuspense
5245
+ );
5246
+ } else {
5247
+ hostInsert(el, container, anchor);
5056
5248
  }
5057
- hostInsert(el, container, anchor);
5058
- if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
5249
+ if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
5059
5250
  queuePostRenderEffect(
5060
5251
  () => {
5061
5252
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
5062
- needCallTransitionHooks && transition.enter(el);
5063
5253
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
5064
5254
  },
5065
5255
  void 0,
@@ -5076,21 +5266,9 @@ function baseCreateRenderer(options, createHydrationFns) {
5076
5266
  hostSetScopeId(el, slotScopeIds[i]);
5077
5267
  }
5078
5268
  }
5079
- let subTree = parentComponent && parentComponent.subTree;
5080
- if (subTree) {
5081
- if (!!(process.env.NODE_ENV !== "production") && subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
5082
- subTree = filterSingleRoot(subTree.children) || subTree;
5083
- }
5084
- if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
5085
- const parentVNode = parentComponent.vnode;
5086
- setScopeId(
5087
- el,
5088
- parentVNode,
5089
- parentVNode.scopeId,
5090
- parentVNode.slotScopeIds,
5091
- parentComponent.parent
5092
- );
5093
- }
5269
+ const inheritedScopeIds = getInheritedScopeIds(vnode, parentComponent);
5270
+ for (let i = 0; i < inheritedScopeIds.length; i++) {
5271
+ hostSetScopeId(el, inheritedScopeIds[i]);
5094
5272
  }
5095
5273
  };
5096
5274
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
@@ -5342,12 +5520,21 @@ function baseCreateRenderer(options, createHydrationFns) {
5342
5520
  n2.slotScopeIds = slotScopeIds;
5343
5521
  if (n2.type.__vapor) {
5344
5522
  if (n1 == null) {
5345
- getVaporInterface(parentComponent, n2).mount(
5346
- n2,
5347
- container,
5348
- anchor,
5349
- parentComponent
5350
- );
5523
+ if (n2.shapeFlag & 512) {
5524
+ getVaporInterface(parentComponent, n2).activate(
5525
+ n2,
5526
+ container,
5527
+ anchor,
5528
+ parentComponent
5529
+ );
5530
+ } else {
5531
+ getVaporInterface(parentComponent, n2).mount(
5532
+ n2,
5533
+ container,
5534
+ anchor,
5535
+ parentComponent
5536
+ );
5537
+ }
5351
5538
  } else {
5352
5539
  getVaporInterface(parentComponent, n2).update(
5353
5540
  n1,
@@ -5410,6 +5597,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5410
5597
  if (!initialVNode.el) {
5411
5598
  const placeholder = instance.subTree = createVNode(Comment);
5412
5599
  processCommentNode(null, placeholder, container, anchor);
5600
+ initialVNode.placeholder = placeholder.el;
5413
5601
  }
5414
5602
  } else {
5415
5603
  setupRenderEffect(
@@ -5950,7 +6138,11 @@ function baseCreateRenderer(options, createHydrationFns) {
5950
6138
  for (i = toBePatched - 1; i >= 0; i--) {
5951
6139
  const nextIndex = s2 + i;
5952
6140
  const nextChild = c2[nextIndex];
5953
- const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
6141
+ const anchorVNode = c2[nextIndex + 1];
6142
+ const anchor = nextIndex + 1 < l2 ? (
6143
+ // #13559, fallback to el placeholder for unresolved async component
6144
+ anchorVNode.el || anchorVNode.placeholder
6145
+ ) : parentAnchor;
5954
6146
  if (newIndexToOldIndexMap[i] === 0) {
5955
6147
  patch(
5956
6148
  null,
@@ -6030,12 +6222,12 @@ function baseCreateRenderer(options, createHydrationFns) {
6030
6222
  const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
6031
6223
  if (needTransition2) {
6032
6224
  if (moveType === 0) {
6033
- transition.beforeEnter(el);
6034
- hostInsert(el, container, anchor);
6035
- queuePostRenderEffect(
6036
- () => transition.enter(el),
6037
- void 0,
6038
- parentSuspense
6225
+ performTransitionEnter(
6226
+ el,
6227
+ transition,
6228
+ () => hostInsert(el, container, anchor),
6229
+ parentSuspense,
6230
+ true
6039
6231
  );
6040
6232
  } else {
6041
6233
  const { leave, delayLeave, afterLeave } = transition;
@@ -6047,6 +6239,12 @@ function baseCreateRenderer(options, createHydrationFns) {
6047
6239
  }
6048
6240
  };
6049
6241
  const performLeave = () => {
6242
+ if (el._isLeaving) {
6243
+ el[leaveCbKey](
6244
+ true
6245
+ /* cancelled */
6246
+ );
6247
+ }
6050
6248
  leave(el, () => {
6051
6249
  remove2();
6052
6250
  afterLeave && afterLeave();
@@ -6086,7 +6284,14 @@ function baseCreateRenderer(options, createHydrationFns) {
6086
6284
  parentComponent.renderCache[cacheIndex] = void 0;
6087
6285
  }
6088
6286
  if (shapeFlag & 256) {
6089
- parentComponent.ctx.deactivate(vnode);
6287
+ if (vnode.type.__vapor) {
6288
+ getVaporInterface(parentComponent, vnode).deactivate(
6289
+ vnode,
6290
+ parentComponent.ctx.getStorageContainer()
6291
+ );
6292
+ } else {
6293
+ parentComponent.ctx.deactivate(vnode);
6294
+ }
6090
6295
  return;
6091
6296
  }
6092
6297
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -6174,22 +6379,15 @@ function baseCreateRenderer(options, createHydrationFns) {
6174
6379
  removeStaticNode(vnode);
6175
6380
  return;
6176
6381
  }
6177
- const performRemove = () => {
6178
- hostRemove(el);
6179
- if (transition && !transition.persisted && transition.afterLeave) {
6180
- transition.afterLeave();
6181
- }
6182
- };
6183
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
6184
- const { leave, delayLeave } = transition;
6185
- const performLeave = () => leave(el, performRemove);
6186
- if (delayLeave) {
6187
- delayLeave(vnode.el, performRemove, performLeave);
6188
- } else {
6189
- performLeave();
6190
- }
6382
+ if (transition) {
6383
+ performTransitionLeave(
6384
+ el,
6385
+ transition,
6386
+ () => hostRemove(el),
6387
+ !!(vnode.shapeFlag & 1)
6388
+ );
6191
6389
  } else {
6192
- performRemove();
6390
+ hostRemove(el);
6193
6391
  }
6194
6392
  };
6195
6393
  const removeFragment = (cur, end) => {
@@ -6205,27 +6403,12 @@ function baseCreateRenderer(options, createHydrationFns) {
6205
6403
  if (!!(process.env.NODE_ENV !== "production") && instance.type.__hmrId) {
6206
6404
  unregisterHMR(instance);
6207
6405
  }
6208
- const {
6209
- bum,
6210
- scope,
6211
- effect,
6212
- subTree,
6213
- um,
6214
- m,
6215
- a,
6216
- parent,
6217
- slots: { __: slotCacheKeys }
6218
- } = instance;
6406
+ const { bum, scope, effect, subTree, um, m, a } = instance;
6219
6407
  invalidateMount(m);
6220
6408
  invalidateMount(a);
6221
6409
  if (bum) {
6222
6410
  invokeArrayFns(bum);
6223
6411
  }
6224
- if (parent && isArray(slotCacheKeys)) {
6225
- slotCacheKeys.forEach((v) => {
6226
- parent.renderCache[v] = void 0;
6227
- });
6228
- }
6229
6412
  scope.stop();
6230
6413
  if (effect) {
6231
6414
  effect.stop();
@@ -6239,12 +6422,6 @@ function baseCreateRenderer(options, createHydrationFns) {
6239
6422
  void 0,
6240
6423
  parentSuspense
6241
6424
  );
6242
- if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
6243
- parentSuspense.deps--;
6244
- if (parentSuspense.deps === 0) {
6245
- parentSuspense.resolve();
6246
- }
6247
- }
6248
6425
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
6249
6426
  devtoolsComponentRemoved(instance);
6250
6427
  }
@@ -6257,7 +6434,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6257
6434
  const getNextHostNode = (vnode) => {
6258
6435
  if (vnode.shapeFlag & 6) {
6259
6436
  if (vnode.type.__vapor) {
6260
- return hostNextSibling(vnode.component.block);
6437
+ return hostNextSibling(vnode.anchor);
6261
6438
  }
6262
6439
  return getNextHostNode(vnode.component.subTree);
6263
6440
  }
@@ -6335,6 +6512,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6335
6512
  return {
6336
6513
  render,
6337
6514
  hydrate,
6515
+ hydrateNode,
6338
6516
  internals,
6339
6517
  createApp: createAppAPI(
6340
6518
  mountApp,
@@ -6374,7 +6552,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
6374
6552
  if (!shallow && c2.patchFlag !== -2)
6375
6553
  traverseStaticChildren(c1, c2);
6376
6554
  }
6377
- if (c2.type === Text) {
6555
+ if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
6556
+ c2.patchFlag !== -1) {
6378
6557
  c2.el = c1.el;
6379
6558
  }
6380
6559
  if (c2.type === Comment && !c2.el) {
@@ -6387,7 +6566,7 @@ function traverseStaticChildren(n1, n2, shallow = false) {
6387
6566
  }
6388
6567
  }
6389
6568
  function locateNonHydratedAsyncRoot(instance) {
6390
- const subComponent = instance.vapor ? null : instance.subTree.component;
6569
+ const subComponent = instance.subTree && instance.subTree.component;
6391
6570
  if (subComponent) {
6392
6571
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
6393
6572
  return subComponent;
@@ -6402,6 +6581,34 @@ function invalidateMount(hooks) {
6402
6581
  hooks[i].flags |= 4;
6403
6582
  }
6404
6583
  }
6584
+ function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
6585
+ if (force || needTransition(parentSuspense, transition)) {
6586
+ transition.beforeEnter(el);
6587
+ insert();
6588
+ queuePostRenderEffect(() => transition.enter(el), void 0, parentSuspense);
6589
+ } else {
6590
+ insert();
6591
+ }
6592
+ }
6593
+ function performTransitionLeave(el, transition, remove, isElement = true) {
6594
+ const performRemove = () => {
6595
+ remove();
6596
+ if (transition && !transition.persisted && transition.afterLeave) {
6597
+ transition.afterLeave();
6598
+ }
6599
+ };
6600
+ if (isElement && transition && !transition.persisted) {
6601
+ const { leave, delayLeave } = transition;
6602
+ const performLeave = () => leave(el, performRemove);
6603
+ if (delayLeave) {
6604
+ delayLeave(el, performRemove, performLeave);
6605
+ } else {
6606
+ performLeave();
6607
+ }
6608
+ } else {
6609
+ performRemove();
6610
+ }
6611
+ }
6405
6612
  function getVaporInterface(instance, vnode) {
6406
6613
  const ctx = instance ? instance.appContext : vnode.appContext;
6407
6614
  const res = ctx && ctx.vapor;
@@ -6416,6 +6623,32 @@ app.use(vaporInteropPlugin)
6416
6623
  }
6417
6624
  return res;
6418
6625
  }
6626
+ function getInheritedScopeIds(vnode, parentComponent) {
6627
+ const inheritedScopeIds = [];
6628
+ let currentParent = parentComponent;
6629
+ let currentVNode = vnode;
6630
+ while (currentParent) {
6631
+ let subTree = currentParent.subTree;
6632
+ if (!subTree) break;
6633
+ if (!!(process.env.NODE_ENV !== "production") && subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
6634
+ subTree = filterSingleRoot(subTree.children) || subTree;
6635
+ }
6636
+ if (currentVNode === subTree || isSuspense(subTree.type) && (subTree.ssContent === currentVNode || subTree.ssFallback === currentVNode)) {
6637
+ const parentVNode = currentParent.vnode;
6638
+ if (parentVNode.scopeId) {
6639
+ inheritedScopeIds.push(parentVNode.scopeId);
6640
+ }
6641
+ if (parentVNode.slotScopeIds) {
6642
+ inheritedScopeIds.push(...parentVNode.slotScopeIds);
6643
+ }
6644
+ currentVNode = parentVNode;
6645
+ currentParent = currentParent.parent;
6646
+ } else {
6647
+ break;
6648
+ }
6649
+ }
6650
+ return inheritedScopeIds;
6651
+ }
6419
6652
 
6420
6653
  const ssrContextKey = Symbol.for("v-scx");
6421
6654
  const useSSRContext = () => {
@@ -6755,8 +6988,9 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
6755
6988
  function defaultPropGetter(props, key) {
6756
6989
  return props[key];
6757
6990
  }
6991
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
6758
6992
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
6759
- const cache = appContext.emitsCache;
6993
+ const cache = __VUE_OPTIONS_API__ && asMixin ? mixinEmitsCache : appContext.emitsCache;
6760
6994
  const cached = cache.get(comp);
6761
6995
  if (cached !== void 0) {
6762
6996
  return cached;
@@ -7204,7 +7438,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7204
7438
  const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
7205
7439
  if (pendingBranch) {
7206
7440
  suspense.pendingBranch = newBranch;
7207
- if (isSameVNodeType(newBranch, pendingBranch)) {
7441
+ if (isSameVNodeType(pendingBranch, newBranch)) {
7208
7442
  patch(
7209
7443
  pendingBranch,
7210
7444
  newBranch,
@@ -7275,7 +7509,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7275
7509
  );
7276
7510
  setActiveBranch(suspense, newFallback);
7277
7511
  }
7278
- } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
7512
+ } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
7279
7513
  patch(
7280
7514
  activeBranch,
7281
7515
  newBranch,
@@ -7306,7 +7540,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7306
7540
  }
7307
7541
  }
7308
7542
  } else {
7309
- if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
7543
+ if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
7310
7544
  patch(
7311
7545
  activeBranch,
7312
7546
  newBranch,
@@ -7419,7 +7653,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7419
7653
  pendingId,
7420
7654
  effects,
7421
7655
  parentComponent: parentComponent2,
7422
- container: container2
7656
+ container: container2,
7657
+ isInFallback
7423
7658
  } = suspense;
7424
7659
  let delayEnter = false;
7425
7660
  if (suspense.isHydrating) {
@@ -7437,6 +7672,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7437
7672
  parentComponent2
7438
7673
  );
7439
7674
  queuePostFlushCb(effects);
7675
+ if (isInFallback && vnode2.ssFallback) {
7676
+ vnode2.ssFallback.el = null;
7677
+ }
7440
7678
  }
7441
7679
  };
7442
7680
  }
@@ -7445,6 +7683,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7445
7683
  anchor = next(activeBranch);
7446
7684
  }
7447
7685
  unmount(activeBranch, parentComponent2, suspense, true);
7686
+ if (!delayEnter && isInFallback && vnode2.ssFallback) {
7687
+ vnode2.ssFallback.el = null;
7688
+ }
7448
7689
  }
7449
7690
  if (!delayEnter) {
7450
7691
  move(
@@ -7569,6 +7810,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7569
7810
  optimized2
7570
7811
  );
7571
7812
  if (placeholder) {
7813
+ vnode2.placeholder = null;
7572
7814
  remove(placeholder);
7573
7815
  }
7574
7816
  updateHOCHostEl(instance, vnode2.el);
@@ -7774,15 +8016,11 @@ const createVNodeWithArgsTransform = (...args) => {
7774
8016
  );
7775
8017
  };
7776
8018
  const normalizeKey = ({ key }) => key != null ? key : null;
7777
- const normalizeRef = ({
7778
- ref,
7779
- ref_key,
7780
- ref_for
7781
- }) => {
8019
+ const normalizeRef = ({ ref, ref_key, ref_for }, i = currentRenderingInstance) => {
7782
8020
  if (typeof ref === "number") {
7783
8021
  ref = "" + ref;
7784
8022
  }
7785
- return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
8023
+ return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i, r: ref, k: ref_key, f: !!ref_for } : ref : null;
7786
8024
  };
7787
8025
  function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
7788
8026
  const vnode = {
@@ -7948,6 +8186,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
7948
8186
  suspense: vnode.suspense,
7949
8187
  ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
7950
8188
  ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
8189
+ placeholder: vnode.placeholder,
7951
8190
  el: vnode.el,
7952
8191
  anchor: vnode.anchor,
7953
8192
  ctx: vnode.ctx,
@@ -8491,7 +8730,7 @@ function getComponentPublicInstance(instance) {
8491
8730
  return instance.proxy;
8492
8731
  }
8493
8732
  }
8494
- const classifyRE = /(?:^|[-_])(\w)/g;
8733
+ const classifyRE = /(?:^|[-_])\w/g;
8495
8734
  const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
8496
8735
  function getComponentName(Component, includeInferred = true) {
8497
8736
  return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
@@ -8527,23 +8766,28 @@ const computed = (getterOrOptions, debugOptions) => {
8527
8766
  };
8528
8767
 
8529
8768
  function h(type, propsOrChildren, children) {
8530
- const l = arguments.length;
8531
- if (l === 2) {
8532
- if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
8533
- if (isVNode(propsOrChildren)) {
8534
- return createVNode(type, null, [propsOrChildren]);
8769
+ try {
8770
+ setBlockTracking(-1);
8771
+ const l = arguments.length;
8772
+ if (l === 2) {
8773
+ if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
8774
+ if (isVNode(propsOrChildren)) {
8775
+ return createVNode(type, null, [propsOrChildren]);
8776
+ }
8777
+ return createVNode(type, propsOrChildren);
8778
+ } else {
8779
+ return createVNode(type, null, propsOrChildren);
8535
8780
  }
8536
- return createVNode(type, propsOrChildren);
8537
8781
  } else {
8538
- return createVNode(type, null, propsOrChildren);
8539
- }
8540
- } else {
8541
- if (l > 3) {
8542
- children = Array.prototype.slice.call(arguments, 2);
8543
- } else if (l === 3 && isVNode(children)) {
8544
- children = [children];
8782
+ if (l > 3) {
8783
+ children = Array.prototype.slice.call(arguments, 2);
8784
+ } else if (l === 3 && isVNode(children)) {
8785
+ children = [children];
8786
+ }
8787
+ return createVNode(type, propsOrChildren, children);
8545
8788
  }
8546
- return createVNode(type, propsOrChildren, children);
8789
+ } finally {
8790
+ setBlockTracking(1);
8547
8791
  }
8548
8792
  }
8549
8793
 
@@ -8753,7 +8997,7 @@ function isMemoSame(cached, memo) {
8753
8997
  return true;
8754
8998
  }
8755
8999
 
8756
- const version = "3.6.0-alpha.2";
9000
+ const version = "3.6.0-alpha.3";
8757
9001
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
8758
9002
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8759
9003
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -8775,4 +9019,4 @@ const resolveFilter = null;
8775
9019
  const compatUtils = null;
8776
9020
  const DeprecationTypes = null;
8777
9021
 
8778
- export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MoveType, Static, Suspense, Teleport, Text, assertNumber, baseEmit, baseNormalizePropsOptions, callWithAsyncErrorHandling, callWithErrorHandling, cloneVNode, compatUtils, computed, createAppAPI, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, endMeasure, expose, flushOnAppMount, getCurrentInstance, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, isEmitListener, isMemoSame, isRuntimeOnly, isVNode, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, popWarningContext, provide, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTransitionHooks, setBlockTracking, setCurrentInstance, setDevtoolsHook, setTransitionHooks, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, toHandlers, transformVNodeArgs, unregisterHMR, useAttrs, useId, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
9022
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, Static, Suspense, Teleport, Text, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, deactivate, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, endMeasure, ensureVaporSlotFallback, expose, flushOnAppMount, getAttributeMismatch, getComponentName, getCurrentInstance, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, isAsyncWrapper, isEmitListener, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isRuntimeOnly, isSetEqual, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isVNode, isValidHtmlOrSvgAttribute, leaveCbKey, markAsyncBoundary, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeRef, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, provide, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, setBlockTracking, setCurrentInstance, setDevtoolsHook, setRef, setTransitionHooks, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, toClassSet, toHandlers, toStyleMap, transformVNodeArgs, unregisterHMR, useAsyncComponentState, useAttrs, useId, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };