@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,5 +1,5 @@
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
  **/
@@ -531,8 +531,10 @@ function rerender(id, newRender) {
531
531
  instance.hmrRerender();
532
532
  } else {
533
533
  const i = instance;
534
- i.renderCache = [];
535
- i.effect.run();
534
+ if (!(i.effect.flags & 1024)) {
535
+ i.renderCache = [];
536
+ i.effect.run();
537
+ }
536
538
  }
537
539
  nextTick(() => {
538
540
  isHmrUpdating = false;
@@ -574,7 +576,10 @@ function reload(id, newComp) {
574
576
  if (parent.vapor) {
575
577
  parent.hmrRerender();
576
578
  } else {
577
- parent.effect.run();
579
+ if (!(parent.effect.flags & 1024)) {
580
+ parent.renderCache = [];
581
+ parent.effect.run();
582
+ }
578
583
  }
579
584
  nextTick(() => {
580
585
  isHmrUpdating = false;
@@ -684,7 +689,6 @@ const devtoolsComponentRemoved = (component) => {
684
689
  _devtoolsComponentRemoved(component);
685
690
  }
686
691
  };
687
- /*! #__NO_SIDE_EFFECTS__ */
688
692
  // @__NO_SIDE_EFFECTS__
689
693
  function createDevtoolsComponentHook(hook) {
690
694
  return (component) => {
@@ -870,9 +874,6 @@ const TeleportImpl = {
870
874
  insert(mainAnchor, container, anchor);
871
875
  const mount = (container2, anchor2) => {
872
876
  if (shapeFlag & 16) {
873
- if (parentComponent && parentComponent.isCE) {
874
- parentComponent.ce._teleportTarget = container2;
875
- }
876
877
  mountChildren(
877
878
  children,
878
879
  container2,
@@ -894,6 +895,9 @@ const TeleportImpl = {
894
895
  } else if (namespace !== "mathml" && isTargetMathML(target)) {
895
896
  namespace = "mathml";
896
897
  }
898
+ if (parentComponent && parentComponent.isCE) {
899
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
900
+ }
897
901
  if (!disabled) {
898
902
  mount(target, targetAnchor);
899
903
  updateCssVars(n2, false);
@@ -1094,26 +1098,34 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
1094
1098
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
1095
1099
  o: { nextSibling, parentNode, querySelector, insert, createText }
1096
1100
  }, hydrateChildren) {
1101
+ function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
1102
+ vnode2.anchor = hydrateChildren(
1103
+ nextSibling(node2),
1104
+ vnode2,
1105
+ parentNode(node2),
1106
+ parentComponent,
1107
+ parentSuspense,
1108
+ slotScopeIds,
1109
+ optimized
1110
+ );
1111
+ vnode2.targetStart = targetStart;
1112
+ vnode2.targetAnchor = targetAnchor;
1113
+ }
1097
1114
  const target = vnode.target = resolveTarget(
1098
1115
  vnode.props,
1099
1116
  querySelector
1100
1117
  );
1118
+ const disabled = isTeleportDisabled(vnode.props);
1101
1119
  if (target) {
1102
- const disabled = isTeleportDisabled(vnode.props);
1103
1120
  const targetNode = target._lpa || target.firstChild;
1104
1121
  if (vnode.shapeFlag & 16) {
1105
1122
  if (disabled) {
1106
- vnode.anchor = hydrateChildren(
1107
- nextSibling(node),
1123
+ hydrateDisabledTeleport(
1124
+ node,
1108
1125
  vnode,
1109
- parentNode(node),
1110
- parentComponent,
1111
- parentSuspense,
1112
- slotScopeIds,
1113
- optimized
1126
+ targetNode,
1127
+ targetNode && nextSibling(targetNode)
1114
1128
  );
1115
- vnode.targetStart = targetNode;
1116
- vnode.targetAnchor = targetNode && nextSibling(targetNode);
1117
1129
  } else {
1118
1130
  vnode.anchor = nextSibling(node);
1119
1131
  let targetAnchor = targetNode;
@@ -1144,6 +1156,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
1144
1156
  }
1145
1157
  }
1146
1158
  updateCssVars(vnode, disabled);
1159
+ } else if (disabled) {
1160
+ if (vnode.shapeFlag & 16) {
1161
+ hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
1162
+ }
1147
1163
  }
1148
1164
  return vnode.anchor && nextSibling(vnode.anchor);
1149
1165
  }
@@ -1184,7 +1200,7 @@ function useTransitionState() {
1184
1200
  isMounted: false,
1185
1201
  isLeaving: false,
1186
1202
  isUnmounting: false,
1187
- leavingVNodes: /* @__PURE__ */ new Map()
1203
+ leavingNodes: /* @__PURE__ */ new Map()
1188
1204
  };
1189
1205
  onMounted(() => {
1190
1206
  state.isMounted = true;
@@ -1216,7 +1232,7 @@ const BaseTransitionPropsValidators = {
1216
1232
  onAppearCancelled: TransitionHookValidator
1217
1233
  };
1218
1234
  const recursiveGetSubtree = (instance) => {
1219
- const subTree = instance.subTree;
1235
+ const subTree = instance.type.__vapor ? instance.block : instance.subTree;
1220
1236
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
1221
1237
  };
1222
1238
  const BaseTransitionImpl = {
@@ -1233,9 +1249,7 @@ const BaseTransitionImpl = {
1233
1249
  const child = findNonCommentChild(children);
1234
1250
  const rawProps = reactivity.toRaw(props);
1235
1251
  const { mode } = rawProps;
1236
- if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
1237
- warn$1(`invalid <transition> mode: ${mode}`);
1238
- }
1252
+ checkTransitionMode(mode);
1239
1253
  if (state.isLeaving) {
1240
1254
  return emptyPlaceholder(child);
1241
1255
  }
@@ -1255,7 +1269,7 @@ const BaseTransitionImpl = {
1255
1269
  setTransitionHooks(innerChild, enterHooks);
1256
1270
  }
1257
1271
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
1258
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
1272
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
1259
1273
  let leavingHooks = resolveTransitionHooks(
1260
1274
  oldInnerChild,
1261
1275
  rawProps,
@@ -1324,15 +1338,53 @@ function findNonCommentChild(children) {
1324
1338
  }
1325
1339
  const BaseTransition = BaseTransitionImpl;
1326
1340
  function getLeavingNodesForType(state, vnode) {
1327
- const { leavingVNodes } = state;
1328
- let leavingVNodesCache = leavingVNodes.get(vnode.type);
1341
+ const { leavingNodes } = state;
1342
+ let leavingVNodesCache = leavingNodes.get(vnode.type);
1329
1343
  if (!leavingVNodesCache) {
1330
1344
  leavingVNodesCache = /* @__PURE__ */ Object.create(null);
1331
- leavingVNodes.set(vnode.type, leavingVNodesCache);
1345
+ leavingNodes.set(vnode.type, leavingVNodesCache);
1332
1346
  }
1333
1347
  return leavingVNodesCache;
1334
1348
  }
1335
1349
  function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1350
+ const key = String(vnode.key);
1351
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
1352
+ const context = {
1353
+ setLeavingNodeCache: () => {
1354
+ leavingVNodesCache[key] = vnode;
1355
+ },
1356
+ unsetLeavingNodeCache: () => {
1357
+ if (leavingVNodesCache[key] === vnode) {
1358
+ delete leavingVNodesCache[key];
1359
+ }
1360
+ },
1361
+ earlyRemove: () => {
1362
+ const leavingVNode = leavingVNodesCache[key];
1363
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
1364
+ leavingVNode.el[leaveCbKey]();
1365
+ }
1366
+ },
1367
+ cloneHooks: (vnode2) => {
1368
+ const hooks = resolveTransitionHooks(
1369
+ vnode2,
1370
+ props,
1371
+ state,
1372
+ instance,
1373
+ postClone
1374
+ );
1375
+ if (postClone) postClone(hooks);
1376
+ return hooks;
1377
+ }
1378
+ };
1379
+ return baseResolveTransitionHooks(context, props, state, instance);
1380
+ }
1381
+ function baseResolveTransitionHooks(context, props, state, instance) {
1382
+ const {
1383
+ setLeavingNodeCache,
1384
+ unsetLeavingNodeCache,
1385
+ earlyRemove,
1386
+ cloneHooks
1387
+ } = context;
1336
1388
  const {
1337
1389
  appear,
1338
1390
  mode,
@@ -1350,8 +1402,6 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1350
1402
  onAfterAppear,
1351
1403
  onAppearCancelled
1352
1404
  } = props;
1353
- const key = String(vnode.key);
1354
- const leavingVNodesCache = getLeavingNodesForType(state, vnode);
1355
1405
  const callHook = (hook, args) => {
1356
1406
  hook && callWithAsyncErrorHandling(
1357
1407
  hook,
@@ -1387,10 +1437,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1387
1437
  /* cancelled */
1388
1438
  );
1389
1439
  }
1390
- const leavingVNode = leavingVNodesCache[key];
1391
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
1392
- leavingVNode.el[leaveCbKey]();
1393
- }
1440
+ earlyRemove();
1394
1441
  callHook(hook, [el]);
1395
1442
  },
1396
1443
  enter(el) {
@@ -1427,7 +1474,6 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1427
1474
  }
1428
1475
  },
1429
1476
  leave(el, remove) {
1430
- const key2 = String(vnode.key);
1431
1477
  if (el[enterCbKey]) {
1432
1478
  el[enterCbKey](
1433
1479
  true
@@ -1449,27 +1495,17 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1449
1495
  callHook(onAfterLeave, [el]);
1450
1496
  }
1451
1497
  el[leaveCbKey] = void 0;
1452
- if (leavingVNodesCache[key2] === vnode) {
1453
- delete leavingVNodesCache[key2];
1454
- }
1498
+ unsetLeavingNodeCache(el);
1455
1499
  };
1456
- leavingVNodesCache[key2] = vnode;
1500
+ setLeavingNodeCache(el);
1457
1501
  if (onLeave) {
1458
1502
  callAsyncHook(onLeave, [el, done]);
1459
1503
  } else {
1460
1504
  done();
1461
1505
  }
1462
1506
  },
1463
- clone(vnode2) {
1464
- const hooks2 = resolveTransitionHooks(
1465
- vnode2,
1466
- props,
1467
- state,
1468
- instance,
1469
- postClone
1470
- );
1471
- if (postClone) postClone(hooks2);
1472
- return hooks2;
1507
+ clone(node) {
1508
+ return cloneHooks(node);
1473
1509
  }
1474
1510
  };
1475
1511
  return hooks;
@@ -1503,8 +1539,15 @@ function getInnerChild$1(vnode) {
1503
1539
  }
1504
1540
  function setTransitionHooks(vnode, hooks) {
1505
1541
  if (vnode.shapeFlag & 6 && vnode.component) {
1506
- vnode.transition = hooks;
1507
- setTransitionHooks(vnode.component.subTree, hooks);
1542
+ if (vnode.type.__vapor) {
1543
+ getVaporInterface(vnode.component, vnode).setTransitionHooks(
1544
+ vnode.component,
1545
+ hooks
1546
+ );
1547
+ } else {
1548
+ vnode.transition = hooks;
1549
+ setTransitionHooks(vnode.component.subTree, hooks);
1550
+ }
1508
1551
  } else if (vnode.shapeFlag & 128) {
1509
1552
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
1510
1553
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -1534,8 +1577,12 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
1534
1577
  }
1535
1578
  return ret;
1536
1579
  }
1580
+ function checkTransitionMode(mode) {
1581
+ if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
1582
+ warn$1(`invalid <transition> mode: ${mode}`);
1583
+ }
1584
+ }
1537
1585
 
1538
- /*! #__NO_SIDE_EFFECTS__ */
1539
1586
  // @__NO_SIDE_EFFECTS__
1540
1587
  function defineComponent(options, extraOptions) {
1541
1588
  return shared.isFunction(options) ? (
@@ -1588,6 +1635,7 @@ function useTemplateRef(key) {
1588
1635
  return ret;
1589
1636
  }
1590
1637
 
1638
+ const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
1591
1639
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1592
1640
  if (shared.isArray(rawRef)) {
1593
1641
  rawRef.forEach(
@@ -1619,28 +1667,23 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1619
1667
  const oldRef = oldRawRef && oldRawRef.r;
1620
1668
  const refs = owner.refs === shared.EMPTY_OBJ ? owner.refs = {} : owner.refs;
1621
1669
  const setupState = owner.setupState;
1622
- const rawSetupState = reactivity.toRaw(setupState);
1623
- const canSetSetupRef = setupState === shared.EMPTY_OBJ ? () => false : (key) => {
1624
- {
1625
- if (shared.hasOwn(rawSetupState, key) && !reactivity.isRef(rawSetupState[key])) {
1626
- warn$1(
1627
- `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
1628
- );
1629
- }
1630
- if (knownTemplateRefs.has(rawSetupState[key])) {
1631
- return false;
1632
- }
1633
- }
1634
- return shared.hasOwn(rawSetupState, key);
1670
+ const canSetSetupRef = createCanSetSetupRefChecker(setupState);
1671
+ const canSetRef = (ref2) => {
1672
+ return !knownTemplateRefs.has(ref2);
1635
1673
  };
1636
1674
  if (oldRef != null && oldRef !== ref) {
1675
+ invalidatePendingSetRef(oldRawRef);
1637
1676
  if (shared.isString(oldRef)) {
1638
1677
  refs[oldRef] = null;
1639
1678
  if (canSetSetupRef(oldRef)) {
1640
1679
  setupState[oldRef] = null;
1641
1680
  }
1642
1681
  } else if (reactivity.isRef(oldRef)) {
1643
- oldRef.value = null;
1682
+ if (canSetRef(oldRef)) {
1683
+ oldRef.value = null;
1684
+ }
1685
+ const oldRawRefAtom = oldRawRef;
1686
+ if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
1644
1687
  }
1645
1688
  }
1646
1689
  if (shared.isFunction(ref)) {
@@ -1651,7 +1694,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1651
1694
  if (_isString || _isRef) {
1652
1695
  const doSet = () => {
1653
1696
  if (rawRef.f) {
1654
- const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
1697
+ const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
1655
1698
  if (isUnmount) {
1656
1699
  shared.isArray(existing) && shared.remove(existing, refValue);
1657
1700
  } else {
@@ -1662,8 +1705,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1662
1705
  setupState[ref] = refs[ref];
1663
1706
  }
1664
1707
  } else {
1665
- ref.value = [refValue];
1666
- if (rawRef.k) refs[rawRef.k] = ref.value;
1708
+ const newVal = [refValue];
1709
+ if (canSetRef(ref)) {
1710
+ ref.value = newVal;
1711
+ }
1712
+ if (rawRef.k) refs[rawRef.k] = newVal;
1667
1713
  }
1668
1714
  } else if (!existing.includes(refValue)) {
1669
1715
  existing.push(refValue);
@@ -1675,15 +1721,23 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1675
1721
  setupState[ref] = value;
1676
1722
  }
1677
1723
  } else if (_isRef) {
1678
- ref.value = value;
1724
+ if (canSetRef(ref)) {
1725
+ ref.value = value;
1726
+ }
1679
1727
  if (rawRef.k) refs[rawRef.k] = value;
1680
1728
  } else {
1681
1729
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
1682
1730
  }
1683
1731
  };
1684
1732
  if (value) {
1685
- queuePostRenderEffect(doSet, -1, parentSuspense);
1733
+ const job = () => {
1734
+ doSet();
1735
+ pendingSetRefMap.delete(rawRef);
1736
+ };
1737
+ pendingSetRefMap.set(rawRef, job);
1738
+ queuePostRenderEffect(job, -1, parentSuspense);
1686
1739
  } else {
1740
+ invalidatePendingSetRef(rawRef);
1687
1741
  doSet();
1688
1742
  }
1689
1743
  } else {
@@ -1691,6 +1745,29 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1691
1745
  }
1692
1746
  }
1693
1747
  }
1748
+ function createCanSetSetupRefChecker(setupState) {
1749
+ const rawSetupState = reactivity.toRaw(setupState);
1750
+ return setupState === void 0 || setupState === shared.EMPTY_OBJ ? shared.NO : (key) => {
1751
+ {
1752
+ if (shared.hasOwn(rawSetupState, key) && !reactivity.isRef(rawSetupState[key])) {
1753
+ warn$1(
1754
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
1755
+ );
1756
+ }
1757
+ if (knownTemplateRefs.has(rawSetupState[key])) {
1758
+ return false;
1759
+ }
1760
+ }
1761
+ return shared.hasOwn(rawSetupState, key);
1762
+ };
1763
+ }
1764
+ function invalidatePendingSetRef(rawRef) {
1765
+ const pendingSetRef = pendingSetRefMap.get(rawRef);
1766
+ if (pendingSetRef) {
1767
+ pendingSetRef.flags |= 4;
1768
+ pendingSetRefMap.delete(rawRef);
1769
+ }
1770
+ }
1694
1771
 
1695
1772
  let hasLoggedMismatchError = false;
1696
1773
  const logMismatchError = () => {
@@ -1835,6 +1912,12 @@ function createHydrationFunctions(rendererInternals) {
1835
1912
  );
1836
1913
  }
1837
1914
  break;
1915
+ case VaporSlot:
1916
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(
1917
+ vnode,
1918
+ node
1919
+ );
1920
+ break;
1838
1921
  default:
1839
1922
  if (shapeFlag & 1) {
1840
1923
  if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
@@ -1850,9 +1933,6 @@ function createHydrationFunctions(rendererInternals) {
1850
1933
  );
1851
1934
  }
1852
1935
  } else if (shapeFlag & 6) {
1853
- if (vnode.type.__vapor) {
1854
- throw new Error("Vapor component hydration is not supported yet.");
1855
- }
1856
1936
  vnode.slotScopeIds = slotScopeIds;
1857
1937
  const container = parentNode(node);
1858
1938
  if (isFragmentStart) {
@@ -1862,15 +1942,25 @@ function createHydrationFunctions(rendererInternals) {
1862
1942
  } else {
1863
1943
  nextNode = nextSibling(node);
1864
1944
  }
1865
- mountComponent(
1866
- vnode,
1867
- container,
1868
- null,
1869
- parentComponent,
1870
- parentSuspense,
1871
- getContainerType(container),
1872
- optimized
1873
- );
1945
+ if (vnode.type.__vapor) {
1946
+ getVaporInterface(parentComponent, vnode).hydrate(
1947
+ vnode,
1948
+ node,
1949
+ container,
1950
+ null,
1951
+ parentComponent
1952
+ );
1953
+ } else {
1954
+ mountComponent(
1955
+ vnode,
1956
+ container,
1957
+ null,
1958
+ parentComponent,
1959
+ parentSuspense,
1960
+ getContainerType(container),
1961
+ optimized
1962
+ );
1963
+ }
1874
1964
  if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
1875
1965
  let subTree;
1876
1966
  if (isFragmentStart) {
@@ -1955,7 +2045,7 @@ function createHydrationFunctions(rendererInternals) {
1955
2045
  );
1956
2046
  let hasWarned = false;
1957
2047
  while (next) {
1958
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
2048
+ if (!isMismatchAllowed(el, 1)) {
1959
2049
  if (!hasWarned) {
1960
2050
  warn$1(
1961
2051
  `Hydration children mismatch on`,
@@ -1976,14 +2066,16 @@ Server rendered element contains more child nodes than client vdom.`
1976
2066
  if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
1977
2067
  clientText = clientText.slice(1);
1978
2068
  }
1979
- if (el.textContent !== clientText) {
1980
- if (!isMismatchAllowed(el, 0 /* TEXT */)) {
2069
+ const { textContent } = el;
2070
+ if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
2071
+ textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
2072
+ if (!isMismatchAllowed(el, 0)) {
1981
2073
  warn$1(
1982
2074
  `Hydration text content mismatch on`,
1983
2075
  el,
1984
2076
  `
1985
- - rendered on server: ${el.textContent}
1986
- - expected on client: ${vnode.children}`
2077
+ - rendered on server: ${textContent}
2078
+ - expected on client: ${clientText}`
1987
2079
  );
1988
2080
  logMismatchError();
1989
2081
  }
@@ -2059,7 +2151,7 @@ Server rendered element contains more child nodes than client vdom.`
2059
2151
  } else if (isText && !vnode.children) {
2060
2152
  insert(vnode.el = createText(""), container);
2061
2153
  } else {
2062
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
2154
+ if (!isMismatchAllowed(container, 1)) {
2063
2155
  if (!hasWarned) {
2064
2156
  warn$1(
2065
2157
  `Hydration children mismatch on`,
@@ -2109,7 +2201,7 @@ Server rendered element contains fewer child nodes than client vdom.`
2109
2201
  }
2110
2202
  };
2111
2203
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
2112
- if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
2204
+ if (!isMismatchAllowed(node.parentElement, 1)) {
2113
2205
  warn$1(
2114
2206
  `Hydration node mismatch:
2115
2207
  - rendered on server:`,
@@ -2182,11 +2274,11 @@ Server rendered element contains fewer child nodes than client vdom.`
2182
2274
  parent = parent.parent;
2183
2275
  }
2184
2276
  };
2185
- const isTemplateNode = (node) => {
2186
- return node.nodeType === 1 && node.tagName === "TEMPLATE";
2187
- };
2188
2277
  return [hydrate, hydrateNode];
2189
2278
  }
2279
+ const isTemplateNode = (node) => {
2280
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
2281
+ };
2190
2282
  function propHasMismatch(el, key, clientValue, vnode, instance) {
2191
2283
  let mismatchType;
2192
2284
  let mismatchKey;
@@ -2201,7 +2293,7 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
2201
2293
  }
2202
2294
  expected = shared.normalizeClass(clientValue);
2203
2295
  if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
2204
- mismatchType = 2 /* CLASS */;
2296
+ mismatchType = 2;
2205
2297
  mismatchKey = `class`;
2206
2298
  }
2207
2299
  } else if (key === "style") {
@@ -2220,31 +2312,43 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
2220
2312
  resolveCssVars(instance, vnode, expectedMap);
2221
2313
  }
2222
2314
  if (!isMapEqual(actualMap, expectedMap)) {
2223
- mismatchType = 3 /* STYLE */;
2315
+ mismatchType = 3;
2224
2316
  mismatchKey = "style";
2225
2317
  }
2226
- } else if (el instanceof SVGElement && shared.isKnownSvgAttr(key) || el instanceof HTMLElement && (shared.isBooleanAttr(key) || shared.isKnownHtmlAttr(key))) {
2227
- if (shared.isBooleanAttr(key)) {
2228
- actual = el.hasAttribute(key);
2229
- expected = shared.includeBooleanAttr(clientValue);
2230
- } else if (clientValue == null) {
2231
- actual = el.hasAttribute(key);
2232
- expected = false;
2233
- } else {
2234
- if (el.hasAttribute(key)) {
2235
- actual = el.getAttribute(key);
2236
- } else if (key === "value" && el.tagName === "TEXTAREA") {
2237
- actual = el.value;
2238
- } else {
2239
- actual = false;
2240
- }
2241
- expected = shared.isRenderableAttrValue(clientValue) ? String(clientValue) : false;
2242
- }
2318
+ } else if (isValidHtmlOrSvgAttribute(el, key)) {
2319
+ ({ actual, expected } = getAttributeMismatch(el, key, clientValue));
2243
2320
  if (actual !== expected) {
2244
- mismatchType = 4 /* ATTRIBUTE */;
2321
+ mismatchType = 4;
2245
2322
  mismatchKey = key;
2246
2323
  }
2247
2324
  }
2325
+ return warnPropMismatch(el, mismatchKey, mismatchType, actual, expected);
2326
+ }
2327
+ function getAttributeMismatch(el, key, clientValue) {
2328
+ let actual;
2329
+ let expected;
2330
+ if (shared.isBooleanAttr(key)) {
2331
+ actual = el.hasAttribute(key);
2332
+ expected = shared.includeBooleanAttr(clientValue);
2333
+ } else if (clientValue == null) {
2334
+ actual = el.hasAttribute(key);
2335
+ expected = false;
2336
+ } else {
2337
+ if (el.hasAttribute(key)) {
2338
+ actual = el.getAttribute(key);
2339
+ } else if (key === "value" && el.tagName === "TEXTAREA") {
2340
+ actual = el.value;
2341
+ } else {
2342
+ actual = false;
2343
+ }
2344
+ expected = shared.isRenderableAttrValue(clientValue) ? String(clientValue) : false;
2345
+ }
2346
+ return { actual, expected };
2347
+ }
2348
+ function isValidHtmlOrSvgAttribute(el, key) {
2349
+ return el instanceof SVGElement && shared.isKnownSvgAttr(key) || el instanceof HTMLElement && (shared.isBooleanAttr(key) || shared.isKnownHtmlAttr(key));
2350
+ }
2351
+ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
2248
2352
  if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
2249
2353
  const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
2250
2354
  const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
@@ -2316,14 +2420,14 @@ function resolveCssVars(instance, vnode, expectedMap) {
2316
2420
  }
2317
2421
  const allowMismatchAttr = "data-allow-mismatch";
2318
2422
  const MismatchTypeString = {
2319
- [0 /* TEXT */]: "text",
2320
- [1 /* CHILDREN */]: "children",
2321
- [2 /* CLASS */]: "class",
2322
- [3 /* STYLE */]: "style",
2323
- [4 /* ATTRIBUTE */]: "attribute"
2423
+ [0]: "text",
2424
+ [1]: "children",
2425
+ [2]: "class",
2426
+ [3]: "style",
2427
+ [4]: "attribute"
2324
2428
  };
2325
2429
  function isMismatchAllowed(el, allowedType) {
2326
- if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
2430
+ if (allowedType === 0 || allowedType === 1) {
2327
2431
  while (el && !el.hasAttribute(allowMismatchAttr)) {
2328
2432
  el = el.parentElement;
2329
2433
  }
@@ -2335,7 +2439,7 @@ function isMismatchAllowed(el, allowedType) {
2335
2439
  return true;
2336
2440
  } else {
2337
2441
  const list = allowedAttr.split(",");
2338
- if (allowedType === 0 /* TEXT */ && list.includes("children")) {
2442
+ if (allowedType === 0 && list.includes("children")) {
2339
2443
  return true;
2340
2444
  }
2341
2445
  return list.includes(MismatchTypeString[allowedType]);
@@ -2392,7 +2496,9 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
2392
2496
  hasHydrated = true;
2393
2497
  teardown();
2394
2498
  hydrate();
2395
- e.target.dispatchEvent(new e.constructor(e.type, e));
2499
+ if (!(`$evt${e.type}` in e.target)) {
2500
+ e.target.dispatchEvent(new e.constructor(e.type, e));
2501
+ }
2396
2502
  }
2397
2503
  };
2398
2504
  const teardown = () => {
@@ -2434,104 +2540,46 @@ function forEachElement(node, cb) {
2434
2540
  }
2435
2541
 
2436
2542
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
2437
- /*! #__NO_SIDE_EFFECTS__ */
2438
2543
  // @__NO_SIDE_EFFECTS__
2439
2544
  function defineAsyncComponent(source) {
2440
- if (shared.isFunction(source)) {
2441
- source = { loader: source };
2442
- }
2443
2545
  const {
2444
- loader,
2445
- loadingComponent,
2446
- errorComponent,
2447
- delay = 200,
2448
- hydrate: hydrateStrategy,
2449
- timeout,
2450
- // undefined = never times out
2451
- suspensible = true,
2452
- onError: userOnError
2453
- } = source;
2454
- let pendingRequest = null;
2455
- let resolvedComp;
2456
- let retries = 0;
2457
- const retry = () => {
2458
- retries++;
2459
- pendingRequest = null;
2460
- return load();
2461
- };
2462
- const load = () => {
2463
- let thisRequest;
2464
- return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
2465
- err = err instanceof Error ? err : new Error(String(err));
2466
- if (userOnError) {
2467
- return new Promise((resolve, reject) => {
2468
- const userRetry = () => resolve(retry());
2469
- const userFail = () => reject(err);
2470
- userOnError(err, userRetry, userFail, retries + 1);
2471
- });
2472
- } else {
2473
- throw err;
2474
- }
2475
- }).then((comp) => {
2476
- if (thisRequest !== pendingRequest && pendingRequest) {
2477
- return pendingRequest;
2478
- }
2479
- if (!comp) {
2480
- warn$1(
2481
- `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
2482
- );
2483
- }
2484
- if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
2485
- comp = comp.default;
2486
- }
2487
- if (comp && !shared.isObject(comp) && !shared.isFunction(comp)) {
2488
- throw new Error(`Invalid async component load result: ${comp}`);
2489
- }
2490
- resolvedComp = comp;
2491
- return comp;
2492
- }));
2493
- };
2546
+ load,
2547
+ getResolvedComp,
2548
+ setPendingRequest,
2549
+ source: {
2550
+ loadingComponent,
2551
+ errorComponent,
2552
+ delay,
2553
+ hydrate: hydrateStrategy,
2554
+ timeout,
2555
+ suspensible = true
2556
+ }
2557
+ } = createAsyncComponentContext(source);
2494
2558
  return defineComponent({
2495
2559
  name: "AsyncComponentWrapper",
2496
2560
  __asyncLoader: load,
2497
2561
  __asyncHydrate(el, instance, hydrate) {
2498
- let patched = false;
2499
- const doHydrate = hydrateStrategy ? () => {
2500
- const performHydrate = () => {
2501
- if (patched) {
2502
- warn$1(
2503
- `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.`
2504
- );
2505
- return;
2506
- }
2507
- hydrate();
2508
- };
2509
- const teardown = hydrateStrategy(
2510
- performHydrate,
2511
- (cb) => forEachElement(el, cb)
2512
- );
2513
- if (teardown) {
2514
- (instance.bum || (instance.bum = [])).push(teardown);
2515
- }
2516
- (instance.u || (instance.u = [])).push(() => patched = true);
2517
- } : hydrate;
2518
- if (resolvedComp) {
2519
- doHydrate();
2520
- } else {
2521
- load().then(() => !instance.isUnmounted && doHydrate());
2522
- }
2562
+ performAsyncHydrate(
2563
+ el,
2564
+ instance,
2565
+ hydrate,
2566
+ getResolvedComp,
2567
+ load,
2568
+ hydrateStrategy
2569
+ );
2523
2570
  },
2524
2571
  get __asyncResolved() {
2525
- return resolvedComp;
2572
+ return getResolvedComp();
2526
2573
  },
2527
2574
  setup() {
2528
2575
  const instance = currentInstance;
2529
2576
  markAsyncBoundary(instance);
2577
+ let resolvedComp = getResolvedComp();
2530
2578
  if (resolvedComp) {
2531
2579
  return () => createInnerComp(resolvedComp, instance);
2532
2580
  }
2533
2581
  const onError = (err) => {
2534
- pendingRequest = null;
2582
+ setPendingRequest(null);
2535
2583
  handleError(
2536
2584
  err,
2537
2585
  instance,
@@ -2549,25 +2597,11 @@ function defineAsyncComponent(source) {
2549
2597
  }) : null;
2550
2598
  });
2551
2599
  }
2552
- const loaded = reactivity.ref(false);
2553
- const error = reactivity.ref();
2554
- const delayed = reactivity.ref(!!delay);
2555
- if (delay) {
2556
- setTimeout(() => {
2557
- delayed.value = false;
2558
- }, delay);
2559
- }
2560
- if (timeout != null) {
2561
- setTimeout(() => {
2562
- if (!loaded.value && !error.value) {
2563
- const err = new Error(
2564
- `Async component timed out after ${timeout}ms.`
2565
- );
2566
- onError(err);
2567
- error.value = err;
2568
- }
2569
- }, timeout);
2570
- }
2600
+ const { loaded, error, delayed } = useAsyncComponentState(
2601
+ delay,
2602
+ timeout,
2603
+ onError
2604
+ );
2571
2605
  load().then(() => {
2572
2606
  loaded.value = true;
2573
2607
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
@@ -2578,6 +2612,7 @@ function defineAsyncComponent(source) {
2578
2612
  error.value = err;
2579
2613
  });
2580
2614
  return () => {
2615
+ resolvedComp = getResolvedComp();
2581
2616
  if (loaded.value && resolvedComp) {
2582
2617
  return createInnerComp(resolvedComp, instance);
2583
2618
  } else if (error.value && errorComponent) {
@@ -2585,7 +2620,10 @@ function defineAsyncComponent(source) {
2585
2620
  error: error.value
2586
2621
  });
2587
2622
  } else if (loadingComponent && !delayed.value) {
2588
- return createVNode(loadingComponent);
2623
+ return createInnerComp(
2624
+ loadingComponent,
2625
+ instance
2626
+ );
2589
2627
  }
2590
2628
  };
2591
2629
  }
@@ -2599,6 +2637,108 @@ function createInnerComp(comp, parent) {
2599
2637
  delete parent.vnode.ce;
2600
2638
  return vnode;
2601
2639
  }
2640
+ function createAsyncComponentContext(source) {
2641
+ if (shared.isFunction(source)) {
2642
+ source = { loader: source };
2643
+ }
2644
+ const { loader, onError: userOnError } = source;
2645
+ let pendingRequest = null;
2646
+ let resolvedComp;
2647
+ let retries = 0;
2648
+ const retry = () => {
2649
+ retries++;
2650
+ pendingRequest = null;
2651
+ return load();
2652
+ };
2653
+ const load = () => {
2654
+ let thisRequest;
2655
+ return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
2656
+ err = err instanceof Error ? err : new Error(String(err));
2657
+ if (userOnError) {
2658
+ return new Promise((resolve, reject) => {
2659
+ const userRetry = () => resolve(retry());
2660
+ const userFail = () => reject(err);
2661
+ userOnError(err, userRetry, userFail, retries + 1);
2662
+ });
2663
+ } else {
2664
+ throw err;
2665
+ }
2666
+ }).then((comp) => {
2667
+ if (thisRequest !== pendingRequest && pendingRequest) {
2668
+ return pendingRequest;
2669
+ }
2670
+ if (!comp) {
2671
+ warn$1(
2672
+ `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
2673
+ );
2674
+ }
2675
+ if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
2676
+ comp = comp.default;
2677
+ }
2678
+ if (comp && !shared.isObject(comp) && !shared.isFunction(comp)) {
2679
+ throw new Error(`Invalid async component load result: ${comp}`);
2680
+ }
2681
+ resolvedComp = comp;
2682
+ return comp;
2683
+ }));
2684
+ };
2685
+ return {
2686
+ load,
2687
+ source,
2688
+ getResolvedComp: () => resolvedComp,
2689
+ setPendingRequest: (request) => pendingRequest = request
2690
+ };
2691
+ }
2692
+ const useAsyncComponentState = (delay, timeout, onError) => {
2693
+ const loaded = reactivity.ref(false);
2694
+ const error = reactivity.ref();
2695
+ const delayed = reactivity.ref(!!delay);
2696
+ if (delay) {
2697
+ setTimeout(() => {
2698
+ delayed.value = false;
2699
+ }, delay);
2700
+ }
2701
+ if (timeout != null) {
2702
+ setTimeout(() => {
2703
+ if (!loaded.value && !error.value) {
2704
+ const err = new Error(`Async component timed out after ${timeout}ms.`);
2705
+ onError(err);
2706
+ error.value = err;
2707
+ }
2708
+ }, timeout);
2709
+ }
2710
+ return { loaded, error, delayed };
2711
+ };
2712
+ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
2713
+ let patched = false;
2714
+ (instance.bu || (instance.bu = [])).push(() => patched = true);
2715
+ const performHydrate = () => {
2716
+ if (patched) {
2717
+ {
2718
+ const resolvedComp = getResolvedComp();
2719
+ warn$1(
2720
+ `Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
2721
+ );
2722
+ }
2723
+ return;
2724
+ }
2725
+ hydrate();
2726
+ };
2727
+ const doHydrate = hydrateStrategy ? () => {
2728
+ const teardown = hydrateStrategy(
2729
+ performHydrate,
2730
+ (cb) => forEachElement(el, cb)
2731
+ );
2732
+ if (teardown) {
2733
+ (instance.bum || (instance.bum = [])).push(teardown);
2734
+ }
2735
+ } : performHydrate;
2736
+ if (getResolvedComp()) {
2737
+ doHydrate();
2738
+ } else {
2739
+ load().then(() => !instance.isUnmounted && doHydrate());
2740
+ }
2741
+ }
2602
2742
 
2603
2743
  const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
2604
2744
  const KeepAliveImpl = {
@@ -2628,83 +2768,37 @@ const KeepAliveImpl = {
2628
2768
  keepAliveInstance.__v_cache = cache;
2629
2769
  }
2630
2770
  const parentSuspense = keepAliveInstance.suspense;
2771
+ const { renderer } = sharedContext;
2631
2772
  const {
2632
- renderer: {
2633
- p: patch,
2634
- m: move,
2635
- um: _unmount,
2636
- o: { createElement }
2637
- }
2638
- } = sharedContext;
2773
+ um: _unmount,
2774
+ o: { createElement }
2775
+ } = renderer;
2639
2776
  const storageContainer = createElement("div");
2777
+ sharedContext.getStorageContainer = () => storageContainer;
2778
+ sharedContext.getCachedComponent = (vnode) => {
2779
+ const key = vnode.key == null ? vnode.type : vnode.key;
2780
+ return cache.get(key);
2781
+ };
2640
2782
  sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
2641
- const instance = vnode.component;
2642
- move(
2783
+ activate(
2643
2784
  vnode,
2644
2785
  container,
2645
2786
  anchor,
2646
- 0,
2787
+ renderer,
2647
2788
  keepAliveInstance,
2648
- parentSuspense
2649
- );
2650
- patch(
2651
- instance.vnode,
2652
- vnode,
2653
- container,
2654
- anchor,
2655
- instance,
2656
2789
  parentSuspense,
2657
2790
  namespace,
2658
- vnode.slotScopeIds,
2659
2791
  optimized
2660
2792
  );
2661
- queuePostRenderEffect(
2662
- () => {
2663
- instance.isDeactivated = false;
2664
- if (instance.a) {
2665
- shared.invokeArrayFns(instance.a);
2666
- }
2667
- const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
2668
- if (vnodeHook) {
2669
- invokeVNodeHook(vnodeHook, instance.parent, vnode);
2670
- }
2671
- },
2672
- void 0,
2673
- parentSuspense
2674
- );
2675
- {
2676
- devtoolsComponentAdded(instance);
2677
- }
2678
2793
  };
2679
2794
  sharedContext.deactivate = (vnode) => {
2680
- const instance = vnode.component;
2681
- invalidateMount(instance.m);
2682
- invalidateMount(instance.a);
2683
- move(
2795
+ deactivate(
2684
2796
  vnode,
2685
2797
  storageContainer,
2686
- null,
2687
- 1,
2798
+ renderer,
2688
2799
  keepAliveInstance,
2689
2800
  parentSuspense
2690
2801
  );
2691
- queuePostRenderEffect(
2692
- () => {
2693
- if (instance.da) {
2694
- shared.invokeArrayFns(instance.da);
2695
- }
2696
- const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
2697
- if (vnodeHook) {
2698
- invokeVNodeHook(vnodeHook, instance.parent, vnode);
2699
- }
2700
- instance.isDeactivated = true;
2701
- },
2702
- void 0,
2703
- parentSuspense
2704
- );
2705
- {
2706
- devtoolsComponentAdded(instance);
2707
- }
2708
2802
  };
2709
2803
  function unmount(vnode) {
2710
2804
  resetShapeFlag(vnode);
@@ -2851,7 +2945,7 @@ function onActivated(hook, target) {
2851
2945
  function onDeactivated(hook, target) {
2852
2946
  registerKeepAliveHook(hook, "da", target);
2853
2947
  }
2854
- function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
2948
+ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance()) {
2855
2949
  const wrappedHook = hook.__wdc || (hook.__wdc = () => {
2856
2950
  let current = target;
2857
2951
  while (current) {
@@ -2865,8 +2959,9 @@ function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
2865
2959
  injectHook(type, wrappedHook, target);
2866
2960
  if (target) {
2867
2961
  let current = target.parent;
2868
- while (current && current.parent && current.parent.vnode) {
2869
- if (isKeepAlive(current.parent.vnode)) {
2962
+ while (current && current.parent) {
2963
+ let parent = current.parent;
2964
+ if (isKeepAlive(parent.vapor ? parent : parent.vnode)) {
2870
2965
  injectToKeepAliveRoot(wrappedHook, type, target, current);
2871
2966
  }
2872
2967
  current = current.parent;
@@ -2892,6 +2987,68 @@ function resetShapeFlag(vnode) {
2892
2987
  function getInnerChild(vnode) {
2893
2988
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
2894
2989
  }
2990
+ function activate(vnode, container, anchor, { p: patch, m: move }, parentComponent, parentSuspense, namespace, optimized) {
2991
+ const instance = vnode.component;
2992
+ move(
2993
+ vnode,
2994
+ container,
2995
+ anchor,
2996
+ 0,
2997
+ parentComponent,
2998
+ parentSuspense
2999
+ );
3000
+ patch(
3001
+ instance.vnode,
3002
+ vnode,
3003
+ container,
3004
+ anchor,
3005
+ instance,
3006
+ parentSuspense,
3007
+ namespace,
3008
+ vnode.slotScopeIds,
3009
+ optimized
3010
+ );
3011
+ queuePostRenderEffect(
3012
+ () => {
3013
+ instance.isDeactivated = false;
3014
+ if (instance.a) {
3015
+ shared.invokeArrayFns(instance.a);
3016
+ }
3017
+ const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
3018
+ if (vnodeHook) {
3019
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
3020
+ }
3021
+ },
3022
+ void 0,
3023
+ parentSuspense
3024
+ );
3025
+ {
3026
+ devtoolsComponentAdded(instance);
3027
+ }
3028
+ }
3029
+ function deactivate(vnode, container, { m: move }, parentComponent, parentSuspense) {
3030
+ const instance = vnode.component;
3031
+ invalidateMount(instance.m);
3032
+ invalidateMount(instance.a);
3033
+ move(vnode, container, null, 1, parentComponent, parentSuspense);
3034
+ queuePostRenderEffect(
3035
+ () => {
3036
+ if (instance.da) {
3037
+ shared.invokeArrayFns(instance.da);
3038
+ }
3039
+ const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
3040
+ if (vnodeHook) {
3041
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
3042
+ }
3043
+ instance.isDeactivated = true;
3044
+ },
3045
+ void 0,
3046
+ parentSuspense
3047
+ );
3048
+ {
3049
+ devtoolsComponentAdded(instance);
3050
+ }
3051
+ }
2895
3052
 
2896
3053
  function injectHook(type, hook, target = currentInstance, prepend = false) {
2897
3054
  if (target) {
@@ -3080,12 +3237,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
3080
3237
  return ret;
3081
3238
  }
3082
3239
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
3240
+ const hasProps = Object.keys(props).length > 0;
3083
3241
  if (name !== "default") props.name = name;
3084
3242
  return openBlock(), createBlock(
3085
3243
  Fragment,
3086
3244
  null,
3087
3245
  [createVNode("slot", props, fallback && fallback())],
3088
- 64
3246
+ hasProps ? -2 : 64
3089
3247
  );
3090
3248
  }
3091
3249
  if (slot && slot.length > 1) {
@@ -3099,6 +3257,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
3099
3257
  }
3100
3258
  openBlock();
3101
3259
  const validSlotContent = slot && ensureValidVNode(slot(props));
3260
+ ensureVaporSlotFallback(validSlotContent, fallback);
3102
3261
  const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
3103
3262
  // key attached in the `createSlots` helper, respect that
3104
3263
  validSlotContent && validSlotContent.key;
@@ -3128,6 +3287,14 @@ function ensureValidVNode(vnodes) {
3128
3287
  return true;
3129
3288
  }) ? vnodes : null;
3130
3289
  }
3290
+ function ensureVaporSlotFallback(vnodes, fallback) {
3291
+ let vaporSlot;
3292
+ if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
3293
+ if (!vaporSlot.fallback && fallback) {
3294
+ vaporSlot.fallback = fallback;
3295
+ }
3296
+ }
3297
+ }
3131
3298
 
3132
3299
  function toHandlers(obj, preserveCaseIfNecessary) {
3133
3300
  const ret = {};
@@ -3290,10 +3457,10 @@ const PublicInstanceProxyHandlers = {
3290
3457
  return true;
3291
3458
  },
3292
3459
  has({
3293
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
3460
+ _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
3294
3461
  }, key) {
3295
- let normalizedProps;
3296
- return !!accessCache[key] || data !== shared.EMPTY_OBJ && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && shared.hasOwn(normalizedProps, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key);
3462
+ let normalizedProps, cssModules;
3463
+ return !!(accessCache[key] || data !== shared.EMPTY_OBJ && key[0] !== "$" && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && shared.hasOwn(normalizedProps, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
3297
3464
  },
3298
3465
  defineProperty(target, key, descriptor) {
3299
3466
  if (descriptor.get != null) {
@@ -3431,15 +3598,15 @@ function withDefaults(props, defaults) {
3431
3598
  return null;
3432
3599
  }
3433
3600
  function useSlots() {
3434
- return getContext().slots;
3601
+ return getContext("useSlots").slots;
3435
3602
  }
3436
3603
  function useAttrs() {
3437
- return getContext().attrs;
3604
+ return getContext("useAttrs").attrs;
3438
3605
  }
3439
- function getContext() {
3606
+ function getContext(calledFunctionName) {
3440
3607
  const i = getCurrentGenericInstance();
3441
3608
  if (!i) {
3442
- warn$1(`useContext() called without active instance.`);
3609
+ warn$1(`${calledFunctionName}() called without active instance.`);
3443
3610
  }
3444
3611
  if (i.vapor) {
3445
3612
  return i;
@@ -3695,7 +3862,8 @@ function applyOptions(instance) {
3695
3862
  expose.forEach((key) => {
3696
3863
  Object.defineProperty(exposed, key, {
3697
3864
  get: () => publicThis[key],
3698
- set: (val) => publicThis[key] = val
3865
+ set: (val) => publicThis[key] = val,
3866
+ enumerable: true
3699
3867
  });
3700
3868
  });
3701
3869
  } else if (!instance.exposed) {
@@ -4568,7 +4736,7 @@ function isBoolean(...args) {
4568
4736
  return args.some((elem) => elem.toLowerCase() === "boolean");
4569
4737
  }
4570
4738
 
4571
- const isInternalKey = (key) => key[0] === "_" || key === "$stable";
4739
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
4572
4740
  const normalizeSlotValue = (value) => shared.isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
4573
4741
  const normalizeSlot = (key, rawSlot, ctx) => {
4574
4742
  if (rawSlot._n) {
@@ -4622,8 +4790,6 @@ const assignSlots = (slots, children, optimized) => {
4622
4790
  const initSlots = (instance, children, optimized) => {
4623
4791
  const slots = instance.slots = createInternalObject();
4624
4792
  if (instance.vnode.shapeFlag & 32) {
4625
- const cacheIndexes = children.__;
4626
- if (cacheIndexes) shared.def(slots, "__", cacheIndexes, true);
4627
4793
  const type = children._;
4628
4794
  if (type) {
4629
4795
  assignSlots(slots, children, optimized);
@@ -4687,12 +4853,10 @@ function endMeasure(instance, type) {
4687
4853
  if (instance.appContext.config.performance && isSupported()) {
4688
4854
  const startTag = `vue-${type}-${instance.uid}`;
4689
4855
  const endTag = startTag + `:end`;
4856
+ const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
4690
4857
  perf.mark(endTag);
4691
- perf.measure(
4692
- `<${formatComponentName(instance, instance.type)}> ${type}`,
4693
- startTag,
4694
- endTag
4695
- );
4858
+ perf.measure(measureName, startTag, endTag);
4859
+ perf.clearMeasures(measureName);
4696
4860
  perf.clearMarks(startTag);
4697
4861
  perf.clearMarks(endTag);
4698
4862
  }
@@ -4931,15 +5095,25 @@ function baseCreateRenderer(options, createHydrationFns) {
4931
5095
  optimized
4932
5096
  );
4933
5097
  } else {
4934
- patchElement(
4935
- n1,
4936
- n2,
4937
- parentComponent,
4938
- parentSuspense,
4939
- namespace,
4940
- slotScopeIds,
4941
- optimized
4942
- );
5098
+ const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
5099
+ try {
5100
+ if (customElement) {
5101
+ customElement._beginPatch();
5102
+ }
5103
+ patchElement(
5104
+ n1,
5105
+ n2,
5106
+ parentComponent,
5107
+ parentSuspense,
5108
+ namespace,
5109
+ slotScopeIds,
5110
+ optimized
5111
+ );
5112
+ } finally {
5113
+ if (customElement) {
5114
+ customElement._endPatch();
5115
+ }
5116
+ }
4943
5117
  }
4944
5118
  };
4945
5119
  const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
@@ -4990,16 +5164,20 @@ function baseCreateRenderer(options, createHydrationFns) {
4990
5164
  if (dirs) {
4991
5165
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
4992
5166
  }
4993
- const needCallTransitionHooks = needTransition(parentSuspense, transition);
4994
- if (needCallTransitionHooks) {
4995
- transition.beforeEnter(el);
5167
+ if (transition) {
5168
+ performTransitionEnter(
5169
+ el,
5170
+ transition,
5171
+ () => hostInsert(el, container, anchor),
5172
+ parentSuspense
5173
+ );
5174
+ } else {
5175
+ hostInsert(el, container, anchor);
4996
5176
  }
4997
- hostInsert(el, container, anchor);
4998
- if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
5177
+ if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
4999
5178
  queuePostRenderEffect(
5000
5179
  () => {
5001
5180
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
5002
- needCallTransitionHooks && transition.enter(el);
5003
5181
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
5004
5182
  },
5005
5183
  void 0,
@@ -5016,21 +5194,9 @@ function baseCreateRenderer(options, createHydrationFns) {
5016
5194
  hostSetScopeId(el, slotScopeIds[i]);
5017
5195
  }
5018
5196
  }
5019
- let subTree = parentComponent && parentComponent.subTree;
5020
- if (subTree) {
5021
- if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
5022
- subTree = filterSingleRoot(subTree.children) || subTree;
5023
- }
5024
- if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
5025
- const parentVNode = parentComponent.vnode;
5026
- setScopeId(
5027
- el,
5028
- parentVNode,
5029
- parentVNode.scopeId,
5030
- parentVNode.slotScopeIds,
5031
- parentComponent.parent
5032
- );
5033
- }
5197
+ const inheritedScopeIds = getInheritedScopeIds(vnode, parentComponent);
5198
+ for (let i = 0; i < inheritedScopeIds.length; i++) {
5199
+ hostSetScopeId(el, inheritedScopeIds[i]);
5034
5200
  }
5035
5201
  };
5036
5202
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
@@ -5271,12 +5437,21 @@ function baseCreateRenderer(options, createHydrationFns) {
5271
5437
  n2.slotScopeIds = slotScopeIds;
5272
5438
  if (n2.type.__vapor) {
5273
5439
  if (n1 == null) {
5274
- getVaporInterface(parentComponent, n2).mount(
5275
- n2,
5276
- container,
5277
- anchor,
5278
- parentComponent
5279
- );
5440
+ if (n2.shapeFlag & 512) {
5441
+ getVaporInterface(parentComponent, n2).activate(
5442
+ n2,
5443
+ container,
5444
+ anchor,
5445
+ parentComponent
5446
+ );
5447
+ } else {
5448
+ getVaporInterface(parentComponent, n2).mount(
5449
+ n2,
5450
+ container,
5451
+ anchor,
5452
+ parentComponent
5453
+ );
5454
+ }
5280
5455
  } else {
5281
5456
  getVaporInterface(parentComponent, n2).update(
5282
5457
  n1,
@@ -5339,6 +5514,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5339
5514
  if (!initialVNode.el) {
5340
5515
  const placeholder = instance.subTree = createVNode(Comment);
5341
5516
  processCommentNode(null, placeholder, container, anchor);
5517
+ initialVNode.placeholder = placeholder.el;
5342
5518
  }
5343
5519
  } else {
5344
5520
  setupRenderEffect(
@@ -5879,7 +6055,11 @@ function baseCreateRenderer(options, createHydrationFns) {
5879
6055
  for (i = toBePatched - 1; i >= 0; i--) {
5880
6056
  const nextIndex = s2 + i;
5881
6057
  const nextChild = c2[nextIndex];
5882
- const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
6058
+ const anchorVNode = c2[nextIndex + 1];
6059
+ const anchor = nextIndex + 1 < l2 ? (
6060
+ // #13559, fallback to el placeholder for unresolved async component
6061
+ anchorVNode.el || anchorVNode.placeholder
6062
+ ) : parentAnchor;
5883
6063
  if (newIndexToOldIndexMap[i] === 0) {
5884
6064
  patch(
5885
6065
  null,
@@ -5959,12 +6139,12 @@ function baseCreateRenderer(options, createHydrationFns) {
5959
6139
  const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
5960
6140
  if (needTransition2) {
5961
6141
  if (moveType === 0) {
5962
- transition.beforeEnter(el);
5963
- hostInsert(el, container, anchor);
5964
- queuePostRenderEffect(
5965
- () => transition.enter(el),
5966
- void 0,
5967
- parentSuspense
6142
+ performTransitionEnter(
6143
+ el,
6144
+ transition,
6145
+ () => hostInsert(el, container, anchor),
6146
+ parentSuspense,
6147
+ true
5968
6148
  );
5969
6149
  } else {
5970
6150
  const { leave, delayLeave, afterLeave } = transition;
@@ -5976,6 +6156,12 @@ function baseCreateRenderer(options, createHydrationFns) {
5976
6156
  }
5977
6157
  };
5978
6158
  const performLeave = () => {
6159
+ if (el._isLeaving) {
6160
+ el[leaveCbKey](
6161
+ true
6162
+ /* cancelled */
6163
+ );
6164
+ }
5979
6165
  leave(el, () => {
5980
6166
  remove2();
5981
6167
  afterLeave && afterLeave();
@@ -6015,7 +6201,14 @@ function baseCreateRenderer(options, createHydrationFns) {
6015
6201
  parentComponent.renderCache[cacheIndex] = void 0;
6016
6202
  }
6017
6203
  if (shapeFlag & 256) {
6018
- parentComponent.ctx.deactivate(vnode);
6204
+ if (vnode.type.__vapor) {
6205
+ getVaporInterface(parentComponent, vnode).deactivate(
6206
+ vnode,
6207
+ parentComponent.ctx.getStorageContainer()
6208
+ );
6209
+ } else {
6210
+ parentComponent.ctx.deactivate(vnode);
6211
+ }
6019
6212
  return;
6020
6213
  }
6021
6214
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -6103,22 +6296,15 @@ function baseCreateRenderer(options, createHydrationFns) {
6103
6296
  removeStaticNode(vnode);
6104
6297
  return;
6105
6298
  }
6106
- const performRemove = () => {
6107
- hostRemove(el);
6108
- if (transition && !transition.persisted && transition.afterLeave) {
6109
- transition.afterLeave();
6110
- }
6111
- };
6112
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
6113
- const { leave, delayLeave } = transition;
6114
- const performLeave = () => leave(el, performRemove);
6115
- if (delayLeave) {
6116
- delayLeave(vnode.el, performRemove, performLeave);
6117
- } else {
6118
- performLeave();
6119
- }
6299
+ if (transition) {
6300
+ performTransitionLeave(
6301
+ el,
6302
+ transition,
6303
+ () => hostRemove(el),
6304
+ !!(vnode.shapeFlag & 1)
6305
+ );
6120
6306
  } else {
6121
- performRemove();
6307
+ hostRemove(el);
6122
6308
  }
6123
6309
  };
6124
6310
  const removeFragment = (cur, end) => {
@@ -6134,27 +6320,12 @@ function baseCreateRenderer(options, createHydrationFns) {
6134
6320
  if (instance.type.__hmrId) {
6135
6321
  unregisterHMR(instance);
6136
6322
  }
6137
- const {
6138
- bum,
6139
- scope,
6140
- effect,
6141
- subTree,
6142
- um,
6143
- m,
6144
- a,
6145
- parent,
6146
- slots: { __: slotCacheKeys }
6147
- } = instance;
6323
+ const { bum, scope, effect, subTree, um, m, a } = instance;
6148
6324
  invalidateMount(m);
6149
6325
  invalidateMount(a);
6150
6326
  if (bum) {
6151
6327
  shared.invokeArrayFns(bum);
6152
6328
  }
6153
- if (parent && shared.isArray(slotCacheKeys)) {
6154
- slotCacheKeys.forEach((v) => {
6155
- parent.renderCache[v] = void 0;
6156
- });
6157
- }
6158
6329
  scope.stop();
6159
6330
  if (effect) {
6160
6331
  effect.stop();
@@ -6168,12 +6339,6 @@ function baseCreateRenderer(options, createHydrationFns) {
6168
6339
  void 0,
6169
6340
  parentSuspense
6170
6341
  );
6171
- if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
6172
- parentSuspense.deps--;
6173
- if (parentSuspense.deps === 0) {
6174
- parentSuspense.resolve();
6175
- }
6176
- }
6177
6342
  {
6178
6343
  devtoolsComponentRemoved(instance);
6179
6344
  }
@@ -6186,7 +6351,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6186
6351
  const getNextHostNode = (vnode) => {
6187
6352
  if (vnode.shapeFlag & 6) {
6188
6353
  if (vnode.type.__vapor) {
6189
- return hostNextSibling(vnode.component.block);
6354
+ return hostNextSibling(vnode.anchor);
6190
6355
  }
6191
6356
  return getNextHostNode(vnode.component.subTree);
6192
6357
  }
@@ -6264,6 +6429,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6264
6429
  return {
6265
6430
  render,
6266
6431
  hydrate,
6432
+ hydrateNode,
6267
6433
  internals,
6268
6434
  createApp: createAppAPI(
6269
6435
  mountApp,
@@ -6303,7 +6469,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
6303
6469
  if (!shallow && c2.patchFlag !== -2)
6304
6470
  traverseStaticChildren(c1, c2);
6305
6471
  }
6306
- if (c2.type === Text) {
6472
+ if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
6473
+ c2.patchFlag !== -1) {
6307
6474
  c2.el = c1.el;
6308
6475
  }
6309
6476
  if (c2.type === Comment && !c2.el) {
@@ -6316,7 +6483,7 @@ function traverseStaticChildren(n1, n2, shallow = false) {
6316
6483
  }
6317
6484
  }
6318
6485
  function locateNonHydratedAsyncRoot(instance) {
6319
- const subComponent = instance.vapor ? null : instance.subTree.component;
6486
+ const subComponent = instance.subTree && instance.subTree.component;
6320
6487
  if (subComponent) {
6321
6488
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
6322
6489
  return subComponent;
@@ -6331,6 +6498,34 @@ function invalidateMount(hooks) {
6331
6498
  hooks[i].flags |= 4;
6332
6499
  }
6333
6500
  }
6501
+ function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
6502
+ if (force || needTransition(parentSuspense, transition)) {
6503
+ transition.beforeEnter(el);
6504
+ insert();
6505
+ queuePostRenderEffect(() => transition.enter(el), void 0, parentSuspense);
6506
+ } else {
6507
+ insert();
6508
+ }
6509
+ }
6510
+ function performTransitionLeave(el, transition, remove, isElement = true) {
6511
+ const performRemove = () => {
6512
+ remove();
6513
+ if (transition && !transition.persisted && transition.afterLeave) {
6514
+ transition.afterLeave();
6515
+ }
6516
+ };
6517
+ if (isElement && transition && !transition.persisted) {
6518
+ const { leave, delayLeave } = transition;
6519
+ const performLeave = () => leave(el, performRemove);
6520
+ if (delayLeave) {
6521
+ delayLeave(el, performRemove, performLeave);
6522
+ } else {
6523
+ performLeave();
6524
+ }
6525
+ } else {
6526
+ performRemove();
6527
+ }
6528
+ }
6334
6529
  function getVaporInterface(instance, vnode) {
6335
6530
  const ctx = instance ? instance.appContext : vnode.appContext;
6336
6531
  const res = ctx && ctx.vapor;
@@ -6345,6 +6540,32 @@ app.use(vaporInteropPlugin)
6345
6540
  }
6346
6541
  return res;
6347
6542
  }
6543
+ function getInheritedScopeIds(vnode, parentComponent) {
6544
+ const inheritedScopeIds = [];
6545
+ let currentParent = parentComponent;
6546
+ let currentVNode = vnode;
6547
+ while (currentParent) {
6548
+ let subTree = currentParent.subTree;
6549
+ if (!subTree) break;
6550
+ if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
6551
+ subTree = filterSingleRoot(subTree.children) || subTree;
6552
+ }
6553
+ if (currentVNode === subTree || isSuspense(subTree.type) && (subTree.ssContent === currentVNode || subTree.ssFallback === currentVNode)) {
6554
+ const parentVNode = currentParent.vnode;
6555
+ if (parentVNode.scopeId) {
6556
+ inheritedScopeIds.push(parentVNode.scopeId);
6557
+ }
6558
+ if (parentVNode.slotScopeIds) {
6559
+ inheritedScopeIds.push(...parentVNode.slotScopeIds);
6560
+ }
6561
+ currentVNode = parentVNode;
6562
+ currentParent = currentParent.parent;
6563
+ } else {
6564
+ break;
6565
+ }
6566
+ }
6567
+ return inheritedScopeIds;
6568
+ }
6348
6569
 
6349
6570
  const ssrContextKey = Symbol.for("v-scx");
6350
6571
  const useSSRContext = () => {
@@ -6684,8 +6905,9 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
6684
6905
  function defaultPropGetter(props, key) {
6685
6906
  return props[key];
6686
6907
  }
6908
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
6687
6909
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
6688
- const cache = appContext.emitsCache;
6910
+ const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
6689
6911
  const cached = cache.get(comp);
6690
6912
  if (cached !== void 0) {
6691
6913
  return cached;
@@ -7133,7 +7355,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7133
7355
  const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
7134
7356
  if (pendingBranch) {
7135
7357
  suspense.pendingBranch = newBranch;
7136
- if (isSameVNodeType(newBranch, pendingBranch)) {
7358
+ if (isSameVNodeType(pendingBranch, newBranch)) {
7137
7359
  patch(
7138
7360
  pendingBranch,
7139
7361
  newBranch,
@@ -7204,7 +7426,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7204
7426
  );
7205
7427
  setActiveBranch(suspense, newFallback);
7206
7428
  }
7207
- } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
7429
+ } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
7208
7430
  patch(
7209
7431
  activeBranch,
7210
7432
  newBranch,
@@ -7235,7 +7457,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
7235
7457
  }
7236
7458
  }
7237
7459
  } else {
7238
- if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
7460
+ if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
7239
7461
  patch(
7240
7462
  activeBranch,
7241
7463
  newBranch,
@@ -7348,7 +7570,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7348
7570
  pendingId,
7349
7571
  effects,
7350
7572
  parentComponent: parentComponent2,
7351
- container: container2
7573
+ container: container2,
7574
+ isInFallback
7352
7575
  } = suspense;
7353
7576
  let delayEnter = false;
7354
7577
  if (suspense.isHydrating) {
@@ -7366,6 +7589,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7366
7589
  parentComponent2
7367
7590
  );
7368
7591
  queuePostFlushCb(effects);
7592
+ if (isInFallback && vnode2.ssFallback) {
7593
+ vnode2.ssFallback.el = null;
7594
+ }
7369
7595
  }
7370
7596
  };
7371
7597
  }
@@ -7374,6 +7600,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7374
7600
  anchor = next(activeBranch);
7375
7601
  }
7376
7602
  unmount(activeBranch, parentComponent2, suspense, true);
7603
+ if (!delayEnter && isInFallback && vnode2.ssFallback) {
7604
+ vnode2.ssFallback.el = null;
7605
+ }
7377
7606
  }
7378
7607
  if (!delayEnter) {
7379
7608
  move(
@@ -7498,6 +7727,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7498
7727
  optimized2
7499
7728
  );
7500
7729
  if (placeholder) {
7730
+ vnode2.placeholder = null;
7501
7731
  remove(placeholder);
7502
7732
  }
7503
7733
  updateHOCHostEl(instance, vnode2.el);
@@ -7703,15 +7933,11 @@ const createVNodeWithArgsTransform = (...args) => {
7703
7933
  );
7704
7934
  };
7705
7935
  const normalizeKey = ({ key }) => key != null ? key : null;
7706
- const normalizeRef = ({
7707
- ref,
7708
- ref_key,
7709
- ref_for
7710
- }) => {
7936
+ const normalizeRef = ({ ref, ref_key, ref_for }, i = currentRenderingInstance) => {
7711
7937
  if (typeof ref === "number") {
7712
7938
  ref = "" + ref;
7713
7939
  }
7714
- return ref != null ? shared.isString(ref) || reactivity.isRef(ref) || shared.isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
7940
+ return ref != null ? shared.isString(ref) || reactivity.isRef(ref) || shared.isFunction(ref) ? { i, r: ref, k: ref_key, f: !!ref_for } : ref : null;
7715
7941
  };
7716
7942
  function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
7717
7943
  const vnode = {
@@ -7877,6 +8103,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
7877
8103
  suspense: vnode.suspense,
7878
8104
  ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
7879
8105
  ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
8106
+ placeholder: vnode.placeholder,
7880
8107
  el: vnode.el,
7881
8108
  anchor: vnode.anchor,
7882
8109
  ctx: vnode.ctx,
@@ -8403,7 +8630,7 @@ function getComponentPublicInstance(instance) {
8403
8630
  return instance.proxy;
8404
8631
  }
8405
8632
  }
8406
- const classifyRE = /(?:^|[-_])(\w)/g;
8633
+ const classifyRE = /(?:^|[-_])\w/g;
8407
8634
  const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
8408
8635
  function getComponentName(Component, includeInferred = true) {
8409
8636
  return shared.isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
@@ -8439,23 +8666,28 @@ const computed = (getterOrOptions, debugOptions) => {
8439
8666
  };
8440
8667
 
8441
8668
  function h(type, propsOrChildren, children) {
8442
- const l = arguments.length;
8443
- if (l === 2) {
8444
- if (shared.isObject(propsOrChildren) && !shared.isArray(propsOrChildren)) {
8445
- if (isVNode(propsOrChildren)) {
8446
- return createVNode(type, null, [propsOrChildren]);
8669
+ try {
8670
+ setBlockTracking(-1);
8671
+ const l = arguments.length;
8672
+ if (l === 2) {
8673
+ if (shared.isObject(propsOrChildren) && !shared.isArray(propsOrChildren)) {
8674
+ if (isVNode(propsOrChildren)) {
8675
+ return createVNode(type, null, [propsOrChildren]);
8676
+ }
8677
+ return createVNode(type, propsOrChildren);
8678
+ } else {
8679
+ return createVNode(type, null, propsOrChildren);
8447
8680
  }
8448
- return createVNode(type, propsOrChildren);
8449
8681
  } else {
8450
- return createVNode(type, null, propsOrChildren);
8451
- }
8452
- } else {
8453
- if (l > 3) {
8454
- children = Array.prototype.slice.call(arguments, 2);
8455
- } else if (l === 3 && isVNode(children)) {
8456
- children = [children];
8682
+ if (l > 3) {
8683
+ children = Array.prototype.slice.call(arguments, 2);
8684
+ } else if (l === 3 && isVNode(children)) {
8685
+ children = [children];
8686
+ }
8687
+ return createVNode(type, propsOrChildren, children);
8457
8688
  }
8458
- return createVNode(type, propsOrChildren, children);
8689
+ } finally {
8690
+ setBlockTracking(1);
8459
8691
  }
8460
8692
  }
8461
8693
 
@@ -8665,7 +8897,7 @@ function isMemoSame(cached, memo) {
8665
8897
  return true;
8666
8898
  }
8667
8899
 
8668
- const version = "3.6.0-alpha.2";
8900
+ const version = "3.6.0-alpha.3";
8669
8901
  const warn = warn$1 ;
8670
8902
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8671
8903
  const devtools = devtools$1 ;