octane 0.2.6 → 0.2.8

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.
@@ -188,6 +188,7 @@ __export(runtime_exports, {
188
188
  queueRefAttach: () => queueRefAttach,
189
189
  queueRefDetach: () => queueRefDetach,
190
190
  readContextFromScope: () => readContextFromScope,
191
+ registerWarmPlan: () => registerWarmPlan,
191
192
  renderBlock: () => renderBlock,
192
193
  renderClientContextProvider: () => renderClientContextProvider,
193
194
  replaceRef: () => replaceRef,
@@ -243,6 +244,8 @@ __export(runtime_exports, {
243
244
  textHoleUpdate: () => textHoleUpdate,
244
245
  textSlot: () => textSlot,
245
246
  tryBlock: () => tryBlock,
247
+ updateFreshClassAttr: () => updateFreshClassAttr,
248
+ updateFreshClassName: () => updateFreshClassName,
246
249
  use: () => use,
247
250
  useActionState: () => useActionState,
248
251
  useBatch: () => useBatch,
@@ -1057,7 +1060,9 @@ function beginTransitionAttempt(block) {
1057
1060
  TRANSITION_JOURNAL ??= [];
1058
1061
  TRANSITION_JOURNAL_BAGS ??= /* @__PURE__ */ new Map();
1059
1062
  TRANSITION_JOURNAL_WINDOWS.push(TRANSITION_JOURNAL_CHECKPOINT);
1063
+ TRANSITION_JOURNAL_BAG_WINDOWS.push(TRANSITION_JOURNAL_BAG_WINDOW);
1060
1064
  TRANSITION_JOURNAL_CHECKPOINT = TRANSITION_JOURNAL.length;
1065
+ TRANSITION_JOURNAL_BAG_WINDOW = ++NEXT_TRANSITION_JOURNAL_BAG_WINDOW;
1061
1066
  TRANSITION_JOURNAL_DEPTH++;
1062
1067
  const capture = WIP_CAPTURE;
1063
1068
  const effects = capture?.effects ?? effectQueues;
@@ -1133,6 +1138,7 @@ function endTransitionAttempt(attempt) {
1133
1138
  if (!continuing) scheduleRender(attempt.origin);
1134
1139
  }
1135
1140
  TRANSITION_JOURNAL_CHECKPOINT = TRANSITION_JOURNAL_WINDOWS.pop();
1141
+ TRANSITION_JOURNAL_BAG_WINDOW = TRANSITION_JOURNAL_BAG_WINDOWS.pop();
1136
1142
  if (--TRANSITION_JOURNAL_DEPTH === 0) {
1137
1143
  TRANSITION_JOURNAL = null;
1138
1144
  TRANSITION_JOURNAL_BAGS = null;
@@ -1228,7 +1234,7 @@ function keepsRootTransition(owner, includePromoted = false) {
1228
1234
  }
1229
1235
  function holdRootTransition(owner, transaction, attempt) {
1230
1236
  const previous = owner.transition;
1231
- if (attempt === null || !attempt.origin.mounted || attempt.origin.disposed || transaction.created?.has(attempt.origin) || attempt.heldSlots !== null && attempt.heldSlots.size !== 0) {
1237
+ if (attempt === null || !attempt.origin.mounted || attempt.origin.disposed || isCreatedInRootRender(transaction, attempt.origin) || attempt.heldSlots !== null && attempt.heldSlots.size !== 0) {
1232
1238
  if (previous !== void 0 && !rootTransitionCellsIntact(previous))
1233
1239
  discardRootTransition(owner);
1234
1240
  return false;
@@ -1330,16 +1336,21 @@ const JOURNAL_TEXT = 0;
1330
1336
  const JOURNAL_ATTR = 1;
1331
1337
  const JOURNAL_BAG = 2;
1332
1338
  const JOURNAL_PROP = 3;
1339
+ const JOURNAL_CREATED = 4;
1333
1340
  const JOURNAL_RENDER = 5;
1334
1341
  const JOURNAL_UNDO = 6;
1335
1342
  let TRANSITION_JOURNAL = null;
1336
1343
  let TRANSITION_JOURNAL_BAGS = null;
1337
1344
  let TRANSITION_JOURNAL_CHECKPOINT = 0;
1338
1345
  const TRANSITION_JOURNAL_WINDOWS = [];
1346
+ let TRANSITION_JOURNAL_BAG_WINDOW = 0;
1347
+ let NEXT_TRANSITION_JOURNAL_BAG_WINDOW = 0;
1348
+ const TRANSITION_JOURNAL_BAG_WINDOWS = [];
1339
1349
  let TRANSITION_JOURNAL_DEPTH = 0;
1340
1350
  let ROOT_RENDER_TRANSACTION = null;
1341
1351
  let ROOT_RENDER_TRANSACTIONS = [];
1342
1352
  let ROOT_RENDER_ROLLBACK = false;
1353
+ let NEXT_ROOT_RENDER_CREATED_STAMP = 0;
1343
1354
  function getRootRenderRetryKey(scope, retryOnly = false) {
1344
1355
  const owner = scope.block.idState.renderOwner;
1345
1356
  if (owner === void 0 || owner.disposed || retryOnly && !owner.transaction?.rootRequest)
@@ -1360,6 +1371,8 @@ function beginRootRender(owner) {
1360
1371
  bags: /* @__PURE__ */ new Map(),
1361
1372
  capture,
1362
1373
  created: null,
1374
+ createdStamp: ++NEXT_ROOT_RENDER_CREATED_STAMP,
1375
+ bagWindow: ++NEXT_TRANSITION_JOURNAL_BAG_WINDOW,
1363
1376
  retainedCreated: null,
1364
1377
  retired: null,
1365
1378
  structures: null,
@@ -1377,6 +1390,7 @@ function beginRootRender(owner) {
1377
1390
  log: TRANSITION_JOURNAL,
1378
1391
  bags: TRANSITION_JOURNAL_BAGS,
1379
1392
  checkpoint: TRANSITION_JOURNAL_CHECKPOINT,
1393
+ bagWindow: TRANSITION_JOURNAL_BAG_WINDOW,
1380
1394
  depth: TRANSITION_JOURNAL_DEPTH,
1381
1395
  parked: PARKED_ITEMS,
1382
1396
  capture: WIP_CAPTURE
@@ -1385,6 +1399,7 @@ function beginRootRender(owner) {
1385
1399
  TRANSITION_JOURNAL = transaction.log;
1386
1400
  TRANSITION_JOURNAL_BAGS = transaction.bags;
1387
1401
  TRANSITION_JOURNAL_CHECKPOINT = 0;
1402
+ TRANSITION_JOURNAL_BAG_WINDOW = transaction.bagWindow;
1388
1403
  TRANSITION_JOURNAL_DEPTH = 1;
1389
1404
  PARKED_ITEMS = transaction.parked;
1390
1405
  WIP_CAPTURE = transaction.capture;
@@ -1397,6 +1412,7 @@ function endRootRender(frame) {
1397
1412
  TRANSITION_JOURNAL = frame.log;
1398
1413
  TRANSITION_JOURNAL_BAGS = frame.bags;
1399
1414
  TRANSITION_JOURNAL_CHECKPOINT = frame.checkpoint;
1415
+ TRANSITION_JOURNAL_BAG_WINDOW = frame.bagWindow;
1400
1416
  TRANSITION_JOURNAL_DEPTH = frame.depth;
1401
1417
  PARKED_ITEMS = frame.parked;
1402
1418
  WIP_CAPTURE = frame.capture;
@@ -1404,9 +1420,9 @@ function endRootRender(frame) {
1404
1420
  function journalUndo(undo) {
1405
1421
  TRANSITION_JOURNAL.push(JOURNAL_UNDO, undo, null, null);
1406
1422
  }
1407
- function journalRootProperty(target, key) {
1423
+ function journalRootProperty(target, key, oldValue) {
1408
1424
  if (ROOT_RENDER_TRANSACTION === null || ROOT_RENDER_ROLLBACK) return;
1409
- TRANSITION_JOURNAL.push(JOURNAL_PROP, target, key, target[key]);
1425
+ TRANSITION_JOURNAL.push(JOURNAL_PROP, target, key, oldValue);
1410
1426
  }
1411
1427
  function journalRootSlot(state, parent, before, after) {
1412
1428
  const transaction = ROOT_RENDER_TRANSACTION;
@@ -1474,7 +1490,7 @@ function retireRootBlock(block) {
1474
1490
  });
1475
1491
  }
1476
1492
  if (block.pending) {
1477
- journalRootProperty(block, "pending");
1493
+ journalRootProperty(block, "pending", block.pending);
1478
1494
  block.pending = false;
1479
1495
  }
1480
1496
  }
@@ -1511,7 +1527,7 @@ function deferRootRange(parent, first, last, cleanup, finalize) {
1511
1527
  }
1512
1528
  function deferRootUnmount(block, detachDom) {
1513
1529
  const transaction = ROOT_RENDER_TRANSACTION;
1514
- if (transaction === null || transaction.aborted || ROOT_RENDER_ROLLBACK || block.idState.renderOwner !== transaction.owner || !block.mounted || transaction.created?.has(block))
1530
+ if (transaction === null || transaction.aborted || ROOT_RENDER_ROLLBACK || block.idState.renderOwner !== transaction.owner || !block.mounted || isCreatedInRootRender(transaction, block))
1515
1531
  return false;
1516
1532
  retireRootBlock(block);
1517
1533
  const start = block.startMarker;
@@ -1558,18 +1574,24 @@ function deferRootUnmount(block, detachDom) {
1558
1574
  if (detachDom && parent !== null) for (const node of nodes) parent.removeChild(node);
1559
1575
  return true;
1560
1576
  }
1577
+ function isCreatedInRootRender(transaction, block) {
1578
+ return block.createdStamp === transaction.createdStamp;
1579
+ }
1580
+ function undoCreatedInRootRender(block, transaction) {
1581
+ const refCheckpoint = refDetachQueue.length;
1582
+ unmountBlock(
1583
+ block,
1584
+ (!transaction.hydrating || block.kind === "portal") && !transaction.retainedCreated?.has(block)
1585
+ );
1586
+ refDetachQueue.length = refCheckpoint;
1587
+ }
1561
1588
  function createdInRootRender(block) {
1562
1589
  const transaction = ROOT_RENDER_TRANSACTION;
1563
- if (transaction === null || ROOT_RENDER_ROLLBACK || transaction.created?.has(block)) return;
1564
- (transaction.created ??= /* @__PURE__ */ new Set()).add(block);
1565
- journalUndo(() => {
1566
- const checkpoint = refDetachQueue.length;
1567
- unmountBlock(
1568
- block,
1569
- (!transaction.hydrating || block.kind === "portal") && !transaction.retainedCreated?.has(block)
1570
- );
1571
- refDetachQueue.length = checkpoint;
1572
- });
1590
+ if (transaction === null || ROOT_RENDER_ROLLBACK || isCreatedInRootRender(transaction, block))
1591
+ return;
1592
+ block.createdStamp = transaction.createdStamp;
1593
+ (transaction.created ??= []).push(block);
1594
+ TRANSITION_JOURNAL.push(JOURNAL_CREATED, block, transaction, null);
1573
1595
  }
1574
1596
  function preserveRootCreatedDom(block) {
1575
1597
  if (ROOT_RENDER_TRANSACTION !== null)
@@ -1587,6 +1609,8 @@ function rollbackRootRender(transaction) {
1587
1609
  else {
1588
1610
  for (let i = transaction.log.length - 4; i >= 0; i -= 4) {
1589
1611
  if (transaction.log[i] === JOURNAL_UNDO) transaction.log[i + 1]();
1612
+ else if (transaction.log[i] === JOURNAL_CREATED)
1613
+ undoCreatedInRootRender(transaction.log[i + 1], transaction.log[i + 2]);
1590
1614
  }
1591
1615
  transaction.log.length = 0;
1592
1616
  }
@@ -1663,7 +1687,7 @@ function suspendRootRender(block, wakeable, attempt) {
1663
1687
  if (TRANSITION_SWAP_DRIVER === null || !TRANSITION_SWAP_DRIVER.holdRoot(owner, transaction, attempt)) {
1664
1688
  if (WARM_EVER && transaction.created !== null) {
1665
1689
  for (const created of transaction.created) {
1666
- if (created.parentBlock === null || !transaction.created.has(created.parentBlock))
1690
+ if (created.parentBlock === null || !isCreatedInRootRender(transaction, created.parentBlock))
1667
1691
  retainDiscardedWarmMemos(created);
1668
1692
  }
1669
1693
  }
@@ -1685,11 +1709,116 @@ function suspendRootRender(block, wakeable, attempt) {
1685
1709
  wakeable.then(ping, ping);
1686
1710
  return true;
1687
1711
  }
1712
+ const BINDING_BAG_ARITY = /* @__PURE__ */ Symbol();
1713
+ function cloneBag0(bag) {
1714
+ return { ...bag };
1715
+ }
1716
+ function cloneBag1(bag) {
1717
+ return { ...bag };
1718
+ }
1719
+ function cloneBag2(bag) {
1720
+ return { ...bag };
1721
+ }
1722
+ function cloneBag3(bag) {
1723
+ return { ...bag };
1724
+ }
1725
+ function cloneBag4(bag) {
1726
+ return { ...bag };
1727
+ }
1728
+ function cloneBag5(bag) {
1729
+ return { ...bag };
1730
+ }
1731
+ function cloneBag6(bag) {
1732
+ return { ...bag };
1733
+ }
1734
+ function cloneBag7(bag) {
1735
+ return { ...bag };
1736
+ }
1737
+ function cloneBag8(bag) {
1738
+ return { ...bag };
1739
+ }
1740
+ function cloneBag9(bag) {
1741
+ return { ...bag };
1742
+ }
1743
+ function cloneBag10(bag) {
1744
+ return { ...bag };
1745
+ }
1746
+ function cloneBag11(bag) {
1747
+ return { ...bag };
1748
+ }
1749
+ function cloneBag12(bag) {
1750
+ return { ...bag };
1751
+ }
1752
+ function cloneBag13(bag) {
1753
+ return { ...bag };
1754
+ }
1755
+ function cloneBag14(bag) {
1756
+ return { ...bag };
1757
+ }
1758
+ function cloneBag15(bag) {
1759
+ return { ...bag };
1760
+ }
1761
+ function cloneBag16(bag) {
1762
+ return { ...bag };
1763
+ }
1764
+ function cloneBindingBag(bag, arity) {
1765
+ switch (arity) {
1766
+ case 0:
1767
+ return cloneBag0(bag);
1768
+ case 1:
1769
+ return cloneBag1(bag);
1770
+ case 2:
1771
+ return cloneBag2(bag);
1772
+ case 3:
1773
+ return cloneBag3(bag);
1774
+ case 4:
1775
+ return cloneBag4(bag);
1776
+ case 5:
1777
+ return cloneBag5(bag);
1778
+ case 6:
1779
+ return cloneBag6(bag);
1780
+ case 7:
1781
+ return cloneBag7(bag);
1782
+ case 8:
1783
+ return cloneBag8(bag);
1784
+ case 9:
1785
+ return cloneBag9(bag);
1786
+ case 10:
1787
+ return cloneBag10(bag);
1788
+ case 11:
1789
+ return cloneBag11(bag);
1790
+ case 12:
1791
+ return cloneBag12(bag);
1792
+ case 13:
1793
+ return cloneBag13(bag);
1794
+ case 14:
1795
+ return cloneBag14(bag);
1796
+ case 15:
1797
+ return cloneBag15(bag);
1798
+ case 16:
1799
+ return cloneBag16(bag);
1800
+ default:
1801
+ return { ...bag };
1802
+ }
1803
+ }
1688
1804
  function journalBag() {
1689
1805
  const scope = CURRENT_SCOPE;
1690
1806
  if (scope === null) return;
1807
+ const transaction = ROOT_RENDER_TRANSACTION;
1808
+ if (transaction !== null && !transaction.hydrating && transaction.retainedCreated === null && TRANSITION_JOURNAL_DEPTH === 1 && scope.block.createdStamp === transaction.createdStamp)
1809
+ return;
1691
1810
  const bag = scope.slots[0];
1692
- if (bag === null || typeof bag !== "object" || bag.__kind !== void 0) return;
1811
+ if (bag === null || typeof bag !== "object") return;
1812
+ const arity = bag[BINDING_BAG_ARITY];
1813
+ if (arity !== void 0) {
1814
+ const window2 = TRANSITION_JOURNAL_BAG_WINDOW;
1815
+ if (bag.__journalWindow === window2) return;
1816
+ const snapshot = cloneBindingBag(bag, arity);
1817
+ TRANSITION_JOURNAL.push(JOURNAL_BAG, bag, snapshot, null);
1818
+ bag.__journalWindow = window2;
1819
+ return;
1820
+ }
1821
+ if (bag.__kind !== void 0) return;
1693
1822
  journalObjectOnce(bag);
1694
1823
  }
1695
1824
  function journalObjectOnce(obj) {
@@ -1750,10 +1879,31 @@ function journalControlledOption(option, withDefault) {
1750
1879
  TRANSITION_JOURNAL.push(JOURNAL_PROP, option, "defaultSelected", option.defaultSelected);
1751
1880
  }
1752
1881
  let PARKED_ITEMS = null;
1753
- function parkItemForHold(block) {
1754
- const nodes = [];
1882
+ function retainedForSlotNodes(state, retained) {
1883
+ const parked = PARKED_ITEMS;
1884
+ if (parked !== null) {
1885
+ for (const item of parked) {
1886
+ const previous = item.block;
1887
+ if (previous.forSlot !== state && !(previous.exclusiveMarkers && previous.startMarker === state.start && previous.endMarker === state.end))
1888
+ continue;
1889
+ for (const node of item.nodes) (retained ??= /* @__PURE__ */ new Set()).add(node);
1890
+ }
1891
+ }
1892
+ const retired = ROOT_RENDER_TRANSACTION.retired;
1893
+ if (retired !== null) {
1894
+ for (const row of retired) {
1895
+ if (row.forSlot !== state) continue;
1896
+ const start = row.startMarker;
1897
+ if (start !== null && start === row.endMarker) (retained ??= /* @__PURE__ */ new Set()).add(start);
1898
+ }
1899
+ }
1900
+ return retained;
1901
+ }
1902
+ function parkItemForHold(block, owningList) {
1755
1903
  const retainConnected = ROOT_RENDER_TRANSACTION !== null && !ROOT_RENDER_ROLLBACK;
1756
1904
  if (retainConnected) retireRootBlock(block);
1905
+ const excluded = owningList !== void 0 && retainConnected ? retainedForSlotNodes(owningList, null) : null;
1906
+ const nodes = [];
1757
1907
  const start = block.startMarker;
1758
1908
  const end = block.endMarker;
1759
1909
  if (start && end) {
@@ -1762,11 +1912,22 @@ function parkItemForHold(block) {
1762
1912
  const exclusive = block.exclusiveMarkers;
1763
1913
  let n = exclusive ? start.nextSibling : start;
1764
1914
  const stop = exclusive ? end : end.nextSibling;
1765
- while (n !== null && n !== stop) {
1766
- const next = getNextSibling(n);
1767
- if (!retainConnected) parent.removeChild(n);
1768
- nodes.push(n);
1769
- n = next;
1915
+ if (excluded === null) {
1916
+ while (n !== null && n !== stop) {
1917
+ const next = getNextSibling(n);
1918
+ if (!retainConnected) parent.removeChild(n);
1919
+ nodes.push(n);
1920
+ n = next;
1921
+ }
1922
+ } else {
1923
+ while (n !== null && n !== stop) {
1924
+ const next = getNextSibling(n);
1925
+ if (!excluded.has(n)) {
1926
+ if (!retainConnected) parent.removeChild(n);
1927
+ nodes.push(n);
1928
+ }
1929
+ n = next;
1930
+ }
1770
1931
  }
1771
1932
  }
1772
1933
  }
@@ -1791,14 +1952,19 @@ function journalForSlot(state) {
1791
1952
  }
1792
1953
  const chain = [];
1793
1954
  for (let b = state.head; b !== null; b = b.nextSibling) {
1794
- chain.push([b, b.nextSibling, b.prevSibling]);
1955
+ chain.push(b);
1795
1956
  }
1957
+ let mapOrder = null;
1958
+ let index = 0;
1959
+ for (const block of state.items.values()) {
1960
+ if (mapOrder === null && chain[index] !== block) mapOrder = chain.slice(0, index);
1961
+ mapOrder?.push(block);
1962
+ index++;
1963
+ }
1964
+ if (mapOrder === null && index !== chain.length) mapOrder = chain.slice(0, index);
1796
1965
  const snapshot = {
1797
- head: state.head,
1798
- tail: state.tail,
1799
- size: state.size,
1800
1966
  empty: state.emptyBlock,
1801
- entries: [...state.items]
1967
+ mapOrder
1802
1968
  };
1803
1969
  journalUndo(() => {
1804
1970
  restoreForSlot(state, snapshot, chain);
@@ -1824,31 +1990,36 @@ function journalForOwnedListClear(state) {
1824
1990
  }
1825
1991
  function restoreForSlot(state, snapshot, chain) {
1826
1992
  const preservedMap = chain === null ? snapshot.entries : null;
1827
- const kept = chain === null ? null : /* @__PURE__ */ new Set();
1828
- if (chain !== null) for (let i = 0; i < chain.length; i++) kept.add(chain[i][0]);
1993
+ const kept = chain === null ? null : new Set(chain);
1829
1994
  for (let b = state.head; b !== null; b = b.nextSibling) {
1830
1995
  if (preservedMap !== null || !kept.has(b)) unmountBlock(b, false);
1831
1996
  }
1832
1997
  if (state.end.parentNode === null) return;
1833
- state.head = snapshot.head;
1834
- state.tail = snapshot.tail;
1835
- state.size = snapshot.size;
1998
+ state.head = chain === null ? snapshot.head : chain[0] ?? null;
1999
+ state.tail = chain === null ? snapshot.tail : chain[chain.length - 1] ?? null;
2000
+ state.size = chain === null ? snapshot.size : chain.length;
1836
2001
  if (preservedMap !== null) state.items = preservedMap;
1837
2002
  else {
1838
2003
  const originalChain = chain;
1839
2004
  state.items.clear();
1840
- for (let i = 0; i < snapshot.entries.length; i++) {
1841
- state.items.set(snapshot.entries[i][0], snapshot.entries[i][1]);
1842
- }
1843
2005
  for (let i = 0; i < originalChain.length; i++) {
1844
- originalChain[i][0].nextSibling = originalChain[i][1];
1845
- originalChain[i][0].prevSibling = originalChain[i][2];
2006
+ const block = originalChain[i];
2007
+ block.nextSibling = originalChain[i + 1] ?? null;
2008
+ block.prevSibling = originalChain[i - 1] ?? null;
2009
+ }
2010
+ const keyOrder = snapshot.mapOrder ?? originalChain;
2011
+ for (let i = 0; i < keyOrder.length; i++) {
2012
+ const block = keyOrder[i];
2013
+ state.items.set(block.key, block);
1846
2014
  }
1847
2015
  }
1848
2016
  const nodes = [];
1849
2017
  for (let b = state.head; b !== null; b = b.nextSibling) {
1850
- const range = takeParkedItem(b) ?? collectBlockRange(b);
1851
- for (const node of range) nodes.push(node);
2018
+ const parked = takeParkedItem(b);
2019
+ if (parked !== null) for (const node of parked) nodes.push(node);
2020
+ else if (b.startMarker !== null && b.startMarker === b.endMarker) {
2021
+ nodes.push(b.startMarker);
2022
+ } else for (const node of collectBlockRange(b)) nodes.push(node);
1852
2023
  }
1853
2024
  if (state.emptyBlock !== snapshot.empty) {
1854
2025
  if (state.emptyBlock !== null) unmountBlock(state.emptyBlock, false);
@@ -1861,6 +2032,7 @@ function restoreForSlot(state, snapshot, chain) {
1861
2032
  }
1862
2033
  const parent = state.end.parentNode;
1863
2034
  const keptNodes = new Set(nodes);
2035
+ if (ROOT_RENDER_TRANSACTION !== null) retainedForSlotNodes(state, keptNodes);
1864
2036
  let current = state.start.nextSibling;
1865
2037
  while (current !== null && current !== state.end) {
1866
2038
  const next = current.nextSibling;
@@ -1917,13 +2089,16 @@ function armTransitionJournal(state) {
1917
2089
  TRANSITION_JOURNAL ??= [];
1918
2090
  TRANSITION_JOURNAL_BAGS ??= /* @__PURE__ */ new Map();
1919
2091
  TRANSITION_JOURNAL_WINDOWS.push(TRANSITION_JOURNAL_CHECKPOINT);
2092
+ TRANSITION_JOURNAL_BAG_WINDOWS.push(TRANSITION_JOURNAL_BAG_WINDOW);
1920
2093
  TRANSITION_JOURNAL_CHECKPOINT = TRANSITION_JOURNAL.length;
2094
+ TRANSITION_JOURNAL_BAG_WINDOW = ++NEXT_TRANSITION_JOURNAL_BAG_WINDOW;
1921
2095
  TRANSITION_JOURNAL_DEPTH++;
1922
2096
  return TRANSITION_JOURNAL.length;
1923
2097
  }
1924
2098
  function disarmTransitionJournal(checkpoint) {
1925
2099
  if (checkpoint < 0) return;
1926
2100
  TRANSITION_JOURNAL_CHECKPOINT = TRANSITION_JOURNAL_WINDOWS.pop();
2101
+ TRANSITION_JOURNAL_BAG_WINDOW = TRANSITION_JOURNAL_BAG_WINDOWS.pop();
1927
2102
  if (--TRANSITION_JOURNAL_DEPTH === 0) {
1928
2103
  TRANSITION_JOURNAL = null;
1929
2104
  TRANSITION_JOURNAL_BAGS = null;
@@ -1962,6 +2137,9 @@ function rollbackTransitionJournal(checkpoint, owner) {
1962
2137
  case JOURNAL_PROP:
1963
2138
  target[a] = b;
1964
2139
  break;
2140
+ case JOURNAL_CREATED:
2141
+ undoCreatedInRootRender(target, a);
2142
+ break;
1965
2143
  case JOURNAL_RENDER:
1966
2144
  if (!target.disposed && (target === owner || blockIsAncestorOf(owner, target))) {
1967
2145
  invalidateRender(target, owner);
@@ -3225,7 +3403,7 @@ function replaceRef(scope, previous, next, target) {
3225
3403
  if (TRANSITION_JOURNAL !== null) {
3226
3404
  journalBag();
3227
3405
  if (Object.prototype.hasOwnProperty.call(target, "_currentRef"))
3228
- journalRootProperty(target, "_currentRef");
3406
+ journalRootProperty(target, "_currentRef", target._currentRef);
3229
3407
  }
3230
3408
  if (previous != null) queueRefDetach(previous, target);
3231
3409
  if (next != null) queueRefAttach(scope, next, target);
@@ -3545,8 +3723,17 @@ function blockIsAncestorOf(anc, node) {
3545
3723
  }
3546
3724
  function comparePostOrder(aBlock, aSeq, bBlock, bSeq) {
3547
3725
  if (aBlock !== bBlock && aBlock !== null && bBlock !== null) {
3548
- if (blockIsAncestorOf(aBlock, bBlock)) return 1;
3549
- if (blockIsAncestorOf(bBlock, aBlock)) return -1;
3726
+ const aParent = aBlock.parentBlock;
3727
+ const bParent = bBlock.parentBlock;
3728
+ if (aParent === bBlock) return -1;
3729
+ if (bParent === aBlock) return 1;
3730
+ if (aParent === bParent) return aSeq - bSeq;
3731
+ for (let b = bParent; b !== null; b = b.parentBlock) {
3732
+ if (b === aBlock) return 1;
3733
+ }
3734
+ for (let a = aParent; a !== null; a = a.parentBlock) {
3735
+ if (a === bBlock) return -1;
3736
+ }
3550
3737
  }
3551
3738
  return aSeq - bSeq;
3552
3739
  }
@@ -3613,7 +3800,7 @@ function runEffectBody(e) {
3613
3800
  CURRENT_EFFECT_PHASE = e.phase;
3614
3801
  EFFECT_BODY_DEPTH++;
3615
3802
  try {
3616
- cleanup = e.fn.apply(null, e.args ?? []);
3803
+ cleanup = e.fn.apply(null, e.args);
3617
3804
  } finally {
3618
3805
  EFFECT_BODY_DEPTH--;
3619
3806
  CURRENT_EFFECT_PHASE = previousPhase;
@@ -3636,6 +3823,7 @@ function runEffectBody(e) {
3636
3823
  }
3637
3824
  function nativeEffectPublicationCurrent(entry, slot) {
3638
3825
  if (NATIVE_READ_DRIVER?.publicationCurrent(entry) !== false) return true;
3826
+ if (ROOT_RENDER_TRANSACTION !== null) journalObjectOnce(slot);
3639
3827
  slot.deps = void 0;
3640
3828
  slot.active = slot.connectedFn !== null;
3641
3829
  invalidateRender(entry.scope.block, entry.scope.block);
@@ -3802,86 +3990,6 @@ function schedulePostPaint(cb) {
3802
3990
  }
3803
3991
  }
3804
3992
  class BlockImpl {
3805
- // Hot fields first (touched by every renderBlock / reconcile iteration).
3806
- body;
3807
- props;
3808
- extra;
3809
- outputHandler;
3810
- memoInChain;
3811
- parentNode;
3812
- parentBlock;
3813
- idState;
3814
- startMarker;
3815
- endMarker;
3816
- exclusiveMarkers;
3817
- itemIndex;
3818
- // Scheduler / lifecycle.
3819
- pending;
3820
- disposed;
3821
- mounted;
3822
- renderStatus;
3823
- pendingMode;
3824
- currentRenderMode;
3825
- pendingDeferred;
3826
- currentRenderDeferred;
3827
- inactive;
3828
- // Hooks + cleanups (per-block state).
3829
- hooks;
3830
- cleanups;
3831
- effectSlots;
3832
- children;
3833
- _slots;
3834
- refFields;
3835
- $$ctxValues;
3836
- // Contexts whose value this block's subtree consumes — stamped on this block
3837
- // AND its memo ancestors by useContextInternal. The TRANSITIVE signal: a
3838
- // changed version here means "a consumer somewhere at/below me needs the new
3839
- // value", so the memo bailout descends rather than skipping.
3840
- $$ctxReads;
3841
- // Contexts this block's OWN render directly read (its own body, or an inline
3842
- // lite descendant that shares this block). The DIRECT signal: a changed
3843
- // version here means THIS block must re-run; if only $$ctxReads changed, the
3844
- // block can bail its body and refresh just its consuming child blocks.
3845
- $$ctxDirect;
3846
- // Resolved-provider cache for `use(ctx)` — see Scope.$$ctxCache.
3847
- $$ctxCache;
3848
- // Armed for React's IMPLICIT same-element bailout (beginWork's
3849
- // oldProps === newProps skip). Set at value-position component mounts
3850
- // (childSlot) — the only sites that can receive a cached descriptor back.
3851
- // Arming makes the block a stamping target (like __memo) so the bail's lazy
3852
- // consumer refresh has the context deps it needs.
3853
- $$implicitBail;
3854
- // __thenableIdx is reset every renderBlock so pre-init costs nothing.
3855
- __thenableIdx;
3856
- // Render-loop guard bookkeeping (see the Block interface).
3857
- drainStamp;
3858
- drainRenders;
3859
- crossRenderUpdate;
3860
- nestedUpdateChain;
3861
- nestedUpdateCount;
3862
- nestedUpdateError;
3863
- effectEventRenderVersion;
3864
- effectEventCompletedVersion;
3865
- // De-opt host node managed by this Block (deoptItemBody / hostElementBody), reused
3866
- // across renders. Null for all other blocks; declared so the shape stays monomorphic.
3867
- deoptNode;
3868
- // A de-opt descriptor with a `ref` was stamped in this subtree (see Block).
3869
- deoptRefs;
3870
- // Per-scope dense slot array (binding bag + control-flow/component/child slots),
3871
- // indexed by compile-time slot index. Keeps the scope shape monomorphic.
3872
- slots;
3873
- // For-block item bookkeeping.
3874
- forSlot;
3875
- prevSibling;
3876
- nextSibling;
3877
- key;
3878
- // ViewTransition boundary props (null on every other block — see Block).
3879
- vt;
3880
- // Scope contract: a Block is its own scope.
3881
- parent;
3882
- block;
3883
- // Metadata.
3884
- kind;
3885
3993
  constructor(kind, parentBlock, parentNode, startMarker, endMarker, body, props, extra, outputHandler) {
3886
3994
  this.body = body;
3887
3995
  this.props = props;
@@ -3914,6 +4022,7 @@ class BlockImpl {
3914
4022
  this.$$ctxReads = null;
3915
4023
  this.$$ctxDirect = null;
3916
4024
  this.$$ctxCache = null;
4025
+ this.$$ctxCacheOwner = null;
3917
4026
  this.$$implicitBail = false;
3918
4027
  this.__thenableIdx = 0;
3919
4028
  this.drainStamp = 0;
@@ -3935,24 +4044,19 @@ class BlockImpl {
3935
4044
  this.parent = null;
3936
4045
  this.block = this;
3937
4046
  this.kind = kind;
4047
+ this.createdStamp = 0;
4048
+ this.__warmEpisode = void 0;
4049
+ this.__thenableDone = void 0;
4050
+ this.__thenables = void 0;
4051
+ this.$$tryHandler = void 0;
4052
+ this.__suspenseHandler = void 0;
4053
+ this.__trySlot = void 0;
4054
+ this.__activitySlot = void 0;
4055
+ this.__warmCache = void 0;
4056
+ this.__warmCacheEpisode = void 0;
3938
4057
  }
3939
4058
  }
3940
4059
  class ScopeImpl {
3941
- block;
3942
- parent;
3943
- hooks;
3944
- cleanups;
3945
- effectSlots;
3946
- children;
3947
- _slots;
3948
- refFields;
3949
- $$ctxValues;
3950
- $$ctxReads;
3951
- $$ctxCache;
3952
- mounted;
3953
- // Per-scope dense slot array (binding bag + control-flow/component/child slots),
3954
- // indexed by compile-time slot index. Keeps the scope shape monomorphic.
3955
- slots;
3956
4060
  constructor(parent, block) {
3957
4061
  this.block = block;
3958
4062
  this.parent = parent;
@@ -3962,11 +4066,12 @@ class ScopeImpl {
3962
4066
  this.children = null;
3963
4067
  this._slots = null;
3964
4068
  this.refFields = null;
3965
- this.slots = [];
3966
4069
  this.$$ctxValues = null;
3967
4070
  this.$$ctxReads = null;
3968
4071
  this.$$ctxCache = null;
4072
+ this.$$ctxCacheOwner = null;
3969
4073
  this.mounted = false;
4074
+ this.slots = [];
3970
4075
  }
3971
4076
  }
3972
4077
  function createBlock(kind, parentBlock, parentNode, startMarker, endMarker, body, props, extra, outputHandler = null) {
@@ -4371,7 +4476,7 @@ function disposeReturnSlot(block, state) {
4371
4476
  if (state.forSlot.emptyBlock !== null) retireRootBlock(state.forSlot.emptyBlock);
4372
4477
  }
4373
4478
  deferRootRange(parent, first, last, () => unmountSlot(state, false));
4374
- journalRootProperty(block.slots, "0");
4479
+ journalRootProperty(block.slots, 0, block.slots[0]);
4375
4480
  const registry = block._slots;
4376
4481
  if (registry !== null) {
4377
4482
  const index = registry.indexOf(state);
@@ -4414,11 +4519,6 @@ function disposeReturnSlot(block, state) {
4414
4519
  block.slots[0] = void 0;
4415
4520
  }
4416
4521
  class LiteBlockImpl {
4417
- parentNode;
4418
- endMarker;
4419
- parentBlock;
4420
- $$ctxValues;
4421
- idState;
4422
4522
  constructor(parentNode, endMarker, parentBlock) {
4423
4523
  this.parentNode = parentNode;
4424
4524
  this.endMarker = endMarker;
@@ -4563,7 +4663,7 @@ function unmountBlockInner(block, detachDom) {
4563
4663
  function registerSlot(scope, slot) {
4564
4664
  const slots = scope._slots;
4565
4665
  const transaction = ROOT_RENDER_TRANSACTION;
4566
- if (transaction !== null && scope.mounted && !transaction.created?.has(scope.block)) {
4666
+ if (transaction !== null && scope.mounted && !isCreatedInRootRender(transaction, scope.block)) {
4567
4667
  journalUndo(() => {
4568
4668
  unmountSlot(slot, true);
4569
4669
  const index = scope.slots.indexOf(slot);
@@ -5274,9 +5374,9 @@ function finishEffectRender(scope) {
5274
5374
  for (let i = 0; i < effects.length; i++) {
5275
5375
  const effect = effects[i];
5276
5376
  if (effect.renderVersion === CURRENT_EFFECT_RENDER_VERSION) continue;
5277
- if (ROOT_RENDER_TRANSACTION !== null) journalObjectOnce(effect);
5278
5377
  if (effect.phase === INSERTION) invalidateInsertionReplay(effect);
5279
5378
  if (!effect.active) continue;
5379
+ if (ROOT_RENDER_TRANSACTION !== null) journalObjectOnce(effect);
5280
5380
  effect.deps = void 0;
5281
5381
  effect.active = false;
5282
5382
  const revision = ++effect.revision;
@@ -6971,7 +7071,8 @@ function bindRendererRegionOwner(props) {
6971
7071
  const binding = { bridge, release };
6972
7072
  RENDERER_REGION_DOM_BINDINGS.set(root, binding);
6973
7073
  RENDERER_REGION_DOM_OWNERS.set(root, bridge);
6974
- root.$$ctxCache?.clear();
7074
+ root.$$ctxCache = null;
7075
+ root.$$ctxCacheOwner = null;
6975
7076
  if (previous === void 0) {
6976
7077
  (root.cleanups ??= []).push(() => {
6977
7078
  const current = RENDERER_REGION_DOM_BINDINGS.get(root);
@@ -7086,11 +7187,31 @@ function createNativeScopedResolver(read) {
7086
7187
  }
7087
7188
  };
7088
7189
  }
7190
+ function cacheContextOwner(reader, context, owner) {
7191
+ if (reader === null) return;
7192
+ const cache = reader.$$ctxCache;
7193
+ if (cache === null) {
7194
+ reader.$$ctxCache = context;
7195
+ reader.$$ctxCacheOwner = owner;
7196
+ return;
7197
+ }
7198
+ const inlineOwner = reader.$$ctxCacheOwner;
7199
+ if (inlineOwner !== null) {
7200
+ const spill = /* @__PURE__ */ new Map();
7201
+ spill.set(cache, inlineOwner);
7202
+ spill.set(context, owner);
7203
+ reader.$$ctxCache = spill;
7204
+ reader.$$ctxCacheOwner = null;
7205
+ } else {
7206
+ cache.set(context, owner);
7207
+ }
7208
+ }
7089
7209
  function readContextFrom(reader, block, context) {
7090
7210
  if (SCOPED_READ_TRACKING) (SCOPED_READS ??= /* @__PURE__ */ new Map()).set(context, context.$$version);
7091
- if (reader !== null && reader.$$ctxCache !== null) {
7092
- const hit = reader.$$ctxCache.get(context);
7093
- if (hit !== void 0) {
7211
+ if (reader !== null) {
7212
+ const cache = reader.$$ctxCache;
7213
+ const hit = cache === context ? reader.$$ctxCacheOwner : cache !== null && reader.$$ctxCacheOwner === null ? cache.get(context) : void 0;
7214
+ if (hit !== null && hit !== void 0) {
7094
7215
  if (hit === DEFAULT_CTX) {
7095
7216
  const bridge2 = rendererRegionOwnerForBlock(block);
7096
7217
  return bridge2 === null ? context.defaultValue : bridge2.readContext(context);
@@ -7102,7 +7223,7 @@ function readContextFrom(reader, block, context) {
7102
7223
  while (scope !== null) {
7103
7224
  const values = scope.$$ctxValues;
7104
7225
  if (values !== null && values.has(context)) {
7105
- if (reader !== null) (reader.$$ctxCache ??= /* @__PURE__ */ new Map()).set(context, scope);
7226
+ cacheContextOwner(reader, context, scope);
7106
7227
  return values.get(context);
7107
7228
  }
7108
7229
  scope = scope.parent;
@@ -7111,14 +7232,14 @@ function readContextFrom(reader, block, context) {
7111
7232
  while (current !== null) {
7112
7233
  const values = current.$$ctxValues;
7113
7234
  if (values !== null && values.has(context)) {
7114
- if (reader !== null) (reader.$$ctxCache ??= /* @__PURE__ */ new Map()).set(context, current);
7235
+ cacheContextOwner(reader, context, current);
7115
7236
  return values.get(context);
7116
7237
  }
7117
7238
  current = current.parentBlock;
7118
7239
  }
7119
7240
  const bridge = rendererRegionOwnerForBlock(block);
7120
7241
  if (bridge !== null) return bridge.readContext(context);
7121
- if (reader !== null) (reader.$$ctxCache ??= /* @__PURE__ */ new Map()).set(context, DEFAULT_CTX);
7242
+ cacheContextOwner(reader, context, DEFAULT_CTX);
7122
7243
  return context.defaultValue;
7123
7244
  }
7124
7245
  function readContextFromScope(scope, context) {
@@ -7334,7 +7455,7 @@ function warnUseWaterfall(block, idx) {
7334
7455
  }
7335
7456
  function useBatch(items, warm) {
7336
7457
  if (items.length === 0) {
7337
- if (warm !== void 0) ACTIVE_WARM_PLANS.push({ block: CURRENT_BLOCK, fn: warm });
7458
+ if (warm !== void 0) ACTIVE_WARM_PLANS.push(CURRENT_BLOCK, warm, void 0);
7338
7459
  return;
7339
7460
  }
7340
7461
  const hydration = activeHydration();
@@ -7361,9 +7482,13 @@ function useBatch(items, warm) {
7361
7482
  });
7362
7483
  throw new SuspenseException(combined);
7363
7484
  }
7485
+ function registerWarmPlan(fn, props) {
7486
+ ACTIVE_WARM_PLANS.push(CURRENT_BLOCK, fn, props);
7487
+ }
7364
7488
  let CURRENT_WARM = null;
7365
7489
  let CURRENT_WARM_CLAIMS = null;
7366
7490
  let WARM_EVER = false;
7491
+ let LATEST_WARM_CACHE_EPISODE = 0;
7367
7492
  let WARM_DEPTH = 0;
7368
7493
  const WARM_DEPTH_CAP = 64;
7369
7494
  const WARM_MISS = /* @__PURE__ */ Symbol("octane.warm.miss");
@@ -7388,16 +7513,18 @@ function warmCacheForOwner(owner) {
7388
7513
  }
7389
7514
  owner.__warmCache = cache;
7390
7515
  owner.__warmCacheEpisode = CURRENT_WARM_EPISODE;
7516
+ if (CURRENT_WARM_EPISODE > LATEST_WARM_CACHE_EPISODE)
7517
+ LATEST_WARM_CACHE_EPISODE = CURRENT_WARM_EPISODE;
7391
7518
  return cache;
7392
7519
  }
7393
7520
  function recordRealWarmMemo(slot, deps, source) {
7394
7521
  const block = CURRENT_BLOCK;
7395
7522
  if (block === null) return false;
7396
7523
  let owner = null;
7397
- for (let i = 0; i < ACTIVE_WARM_PLANS.length; i++) {
7398
- const plan = ACTIVE_WARM_PLANS[i];
7399
- if (!blockIsAncestor(plan.block, block)) continue;
7400
- owner = plan.block;
7524
+ for (let i = 0; i < ACTIVE_WARM_PLANS.length; i += 3) {
7525
+ const planBlock = ACTIVE_WARM_PLANS[i];
7526
+ if (!blockIsAncestor(planBlock, block)) continue;
7527
+ owner = planBlock;
7401
7528
  break;
7402
7529
  }
7403
7530
  if (owner === null) return false;
@@ -7460,11 +7587,11 @@ function runActiveWarmPlans(local) {
7460
7587
  const block = CURRENT_BLOCK;
7461
7588
  let plans = null;
7462
7589
  let owner = block;
7463
- for (let i = 0; i < ACTIVE_WARM_PLANS.length; i++) {
7464
- const plan = ACTIVE_WARM_PLANS[i];
7465
- if (!blockIsAncestor(plan.block, block)) continue;
7466
- (plans ??= []).push(plan);
7467
- if (plans.length === 1) owner = plan.block;
7590
+ for (let i = 0; i < ACTIVE_WARM_PLANS.length; i += 3) {
7591
+ const planBlock = ACTIVE_WARM_PLANS[i];
7592
+ if (!blockIsAncestor(planBlock, block)) continue;
7593
+ (plans ??= []).push(i);
7594
+ if (plans.length === 1) owner = planBlock;
7468
7595
  }
7469
7596
  if (plans === null && local === void 0) return;
7470
7597
  runWarm(() => {
@@ -7472,7 +7599,8 @@ function runActiveWarmPlans(local) {
7472
7599
  for (let i = 0; i < plans.length; i++) {
7473
7600
  CURRENT_WARM_CLAIMS = /* @__PURE__ */ new Set();
7474
7601
  try {
7475
- plans[i].fn();
7602
+ const index = plans[i];
7603
+ ACTIVE_WARM_PLANS[index + 1](ACTIVE_WARM_PLANS[index + 2]);
7476
7604
  } catch {
7477
7605
  }
7478
7606
  }
@@ -7605,7 +7733,7 @@ function markWarm(component, plan) {
7605
7733
  return component;
7606
7734
  }
7607
7735
  function adoptWarmEntry(slot, deps, accept) {
7608
- let b = CURRENT_BLOCK;
7736
+ let b = CURRENT_WARM_EPISODE <= LATEST_WARM_CACHE_EPISODE ? CURRENT_BLOCK : null;
7609
7737
  while (b !== null) {
7610
7738
  const cache = b.__warmCache;
7611
7739
  if (b.__warmCacheEpisode === CURRENT_WARM_EPISODE && cache !== void 0) {
@@ -8024,8 +8152,10 @@ function getFirstChild(node) {
8024
8152
  function getNextSibling(node) {
8025
8153
  return nextSiblingGetter === void 0 ? node.nextSibling : nextSiblingGetter.call(node);
8026
8154
  }
8027
- function seedExpando(proto, key) {
8028
- if (!(key in proto)) proto[key] = void 0;
8155
+ function seedExpando(proto, key, enumerable = true) {
8156
+ if (key in proto) return;
8157
+ if (enumerable) proto[key] = void 0;
8158
+ else Object.defineProperty(proto, key, { value: void 0, writable: true, configurable: true });
8029
8159
  }
8030
8160
  let domOperationsReady = false;
8031
8161
  function initDomOperations() {
@@ -8043,6 +8173,11 @@ function initDomOperations() {
8043
8173
  seedExpando(elementProto, "__oct_suppress");
8044
8174
  seedExpando(elementProto, "__oct_frag");
8045
8175
  seedExpando(elementProto, "__oct_vfrag");
8176
+ seedExpando(elementProto, DANGER_HTML_ACTIVE, false);
8177
+ seedExpando(elementProto, DANGER_HTML_STATIC_CHILD, false);
8178
+ seedExpando(elementProto, DANGER_HTML_SPREAD_CHILD, false);
8179
+ seedExpando(elementProto, DEOPT_DESC, false);
8180
+ seedExpando(elementProto, DEFAULT_VALUE_BASELINE, false);
8046
8181
  if (process.env.NODE_ENV !== "production") {
8047
8182
  seedExpando(elementProto, "__oct_loc");
8048
8183
  }
@@ -8050,6 +8185,7 @@ function initDomOperations() {
8050
8185
  if (typeof CharacterData !== "undefined" && Object.isExtensible(CharacterData.prototype)) {
8051
8186
  seedExpando(CharacterData.prototype, "$$portalEnd");
8052
8187
  seedExpando(CharacterData.prototype, "$$deoptKey");
8188
+ seedExpando(CharacterData.prototype, DEOPT_DESC, false);
8053
8189
  }
8054
8190
  }
8055
8191
  const LAZY_TEMPLATE = /* @__PURE__ */ Symbol("octane.lazy-template");
@@ -8741,55 +8877,55 @@ function commitBag(scope, root, bag) {
8741
8877
  return bag;
8742
8878
  }
8743
8879
  function bag0(s, r) {
8744
- return commitBag(s, r, {});
8880
+ return commitBag(s, r, { __journalWindow: 0, [BINDING_BAG_ARITY]: 0 });
8745
8881
  }
8746
8882
  function bag1(s, r, a) {
8747
- return commitBag(s, r, { a });
8883
+ return commitBag(s, r, { a, __journalWindow: 0, [BINDING_BAG_ARITY]: 1 });
8748
8884
  }
8749
8885
  function bag2(s, r, a, b) {
8750
- return commitBag(s, r, { a, b });
8886
+ return commitBag(s, r, { a, b, __journalWindow: 0, [BINDING_BAG_ARITY]: 2 });
8751
8887
  }
8752
8888
  function bag3(s, r, a, b, c) {
8753
- return commitBag(s, r, { a, b, c });
8889
+ return commitBag(s, r, { a, b, c, __journalWindow: 0, [BINDING_BAG_ARITY]: 3 });
8754
8890
  }
8755
8891
  function bag4(s, r, a, b, c, d) {
8756
- return commitBag(s, r, { a, b, c, d });
8892
+ return commitBag(s, r, { a, b, c, d, __journalWindow: 0, [BINDING_BAG_ARITY]: 4 });
8757
8893
  }
8758
8894
  function bag5(s, r, a, b, c, d, e) {
8759
- return commitBag(s, r, { a, b, c, d, e });
8895
+ return commitBag(s, r, { a, b, c, d, e, __journalWindow: 0, [BINDING_BAG_ARITY]: 5 });
8760
8896
  }
8761
8897
  function bag6(s, r, a, b, c, d, e, f) {
8762
- return commitBag(s, r, { a, b, c, d, e, f });
8898
+ return commitBag(s, r, { a, b, c, d, e, f, __journalWindow: 0, [BINDING_BAG_ARITY]: 6 });
8763
8899
  }
8764
8900
  function bag7(s, r, a, b, c, d, e, f, g) {
8765
- return commitBag(s, r, { a, b, c, d, e, f, g });
8901
+ return commitBag(s, r, { a, b, c, d, e, f, g, __journalWindow: 0, [BINDING_BAG_ARITY]: 7 });
8766
8902
  }
8767
8903
  function bag8(s, r, a, b, c, d, e, f, g, h) {
8768
- return commitBag(s, r, { a, b, c, d, e, f, g, h });
8904
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, __journalWindow: 0, [BINDING_BAG_ARITY]: 8 });
8769
8905
  }
8770
8906
  function bag9(s, r, a, b, c, d, e, f, g, h, i) {
8771
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i });
8907
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, __journalWindow: 0, [BINDING_BAG_ARITY]: 9 });
8772
8908
  }
8773
8909
  function bag10(s, r, a, b, c, d, e, f, g, h, i, j) {
8774
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j });
8910
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, __journalWindow: 0, [BINDING_BAG_ARITY]: 10 });
8775
8911
  }
8776
8912
  function bag11(s, r, a, b, c, d, e, f, g, h, i, j, k) {
8777
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k });
8913
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, __journalWindow: 0, [BINDING_BAG_ARITY]: 11 });
8778
8914
  }
8779
8915
  function bag12(s, r, a, b, c, d, e, f, g, h, i, j, k, l) {
8780
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l });
8916
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, __journalWindow: 0, [BINDING_BAG_ARITY]: 12 });
8781
8917
  }
8782
8918
  function bag13(s, r, a, b, c, d, e, f, g, h, i, j, k, l, m) {
8783
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m });
8919
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, __journalWindow: 0, [BINDING_BAG_ARITY]: 13 });
8784
8920
  }
8785
8921
  function bag14(s, r, a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
8786
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, n });
8922
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, n, __journalWindow: 0, [BINDING_BAG_ARITY]: 14 });
8787
8923
  }
8788
8924
  function bag15(s, r, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) {
8789
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o });
8925
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, __journalWindow: 0, [BINDING_BAG_ARITY]: 15 });
8790
8926
  }
8791
8927
  function bag16(s, r, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
8792
- return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p });
8928
+ return commitBag(s, r, { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, __journalWindow: 0, [BINDING_BAG_ARITY]: 16 });
8793
8929
  }
8794
8930
  function bagOf(s, r, bag) {
8795
8931
  return commitBag(s, r, bag);
@@ -8948,6 +9084,16 @@ function setClassAttrIfChanged(value, previous, el) {
8948
9084
  setClassAttr(el, value);
8949
9085
  return value;
8950
9086
  }
9087
+ function updateFreshClassName(value, previous, el) {
9088
+ const next = (0, import_css.normalizeClass)(value);
9089
+ if (previous !== next) setClassName(el, next);
9090
+ return next;
9091
+ }
9092
+ function updateFreshClassAttr(value, previous, el) {
9093
+ const next = (0, import_css.normalizeClass)(value);
9094
+ if (previous !== next) setClassAttr(el, next);
9095
+ return next;
9096
+ }
8951
9097
  function setScriptText(el, value) {
8952
9098
  const text = value == null ? "" : String(value);
8953
9099
  const first = el.firstChild;
@@ -9023,7 +9169,7 @@ function validateDangerouslySetInnerHTMLValue(value) {
9023
9169
  }
9024
9170
  function setDangerouslySetInnerHTML(el, value) {
9025
9171
  validateDangerouslySetInnerHTMLValue(value);
9026
- journalRootProperty(el, DANGER_HTML_ACTIVE);
9172
+ journalRootProperty(el, DANGER_HTML_ACTIVE, el[DANGER_HTML_ACTIVE]);
9027
9173
  const wasActive = el[DANGER_HTML_ACTIVE] === true;
9028
9174
  if (value == null) {
9029
9175
  el[DANGER_HTML_ACTIVE] = false;
@@ -9082,9 +9228,9 @@ function setDangerouslySetInnerHTMLSources(el, sources, ignoreSourceChildren = f
9082
9228
  if (import_has_own.hasOwnProp.call(el, DANGER_HTML_RESOLVED_VALUE) && Object.is(el[DANGER_HTML_RESOLVED_VALUE], resolved) && Object.is(el[DANGER_HTML_RESOLVED_CHILD], resolvedChild)) {
9083
9229
  return;
9084
9230
  }
9085
- journalRootProperty(el, DANGER_HTML_SPREAD_CHILD);
9086
- journalRootProperty(el, DANGER_HTML_RESOLVED_VALUE);
9087
- journalRootProperty(el, DANGER_HTML_RESOLVED_CHILD);
9231
+ journalRootProperty(el, DANGER_HTML_SPREAD_CHILD, el[DANGER_HTML_SPREAD_CHILD]);
9232
+ journalRootProperty(el, DANGER_HTML_RESOLVED_VALUE, el[DANGER_HTML_RESOLVED_VALUE]);
9233
+ journalRootProperty(el, DANGER_HTML_RESOLVED_CHILD, el[DANGER_HTML_RESOLVED_CHILD]);
9088
9234
  el[DANGER_HTML_SPREAD_CHILD] = resolvedChild;
9089
9235
  setDangerouslySetInnerHTML(el, resolved);
9090
9236
  el[DANGER_HTML_RESOLVED_VALUE] = resolved;
@@ -10402,15 +10548,42 @@ function setSpread(el, value, prev, mountScope, skipDangerouslySetInnerHTML = fa
10402
10548
  if (process.env.NODE_ENV !== "production") queueDevFormDiagnostic(el, mountScope);
10403
10549
  }
10404
10550
  const _injectedStyles = /* @__PURE__ */ new Set();
10405
- function removeHeadEventListeners(state, attrs) {
10551
+ function journalHeadEventListeners(state) {
10552
+ const before = state.handlers === void 0 ? null : new Map(state.handlers);
10553
+ journalUndo(() => {
10554
+ const handlers = state.handlers;
10555
+ if (handlers !== void 0) {
10556
+ for (const [name, listener] of handlers) {
10557
+ const event = eventSlot(name);
10558
+ state.el.removeEventListener(event.type, listener, event.capture);
10559
+ }
10560
+ handlers.clear();
10561
+ }
10562
+ if (before !== null) {
10563
+ const restored = handlers ?? (state.handlers = /* @__PURE__ */ new Map());
10564
+ for (const [name, listener] of before) {
10565
+ const event = eventSlot(name);
10566
+ state.el.addEventListener(event.type, listener, event.capture);
10567
+ restored.set(name, listener);
10568
+ }
10569
+ }
10570
+ });
10571
+ }
10572
+ function removeHeadEventListeners(state, attrs, journalChanges = false) {
10406
10573
  const handlers = state.handlers;
10407
- if (handlers === void 0) return;
10574
+ if (handlers === void 0) return false;
10575
+ let journaled = false;
10408
10576
  for (const [name, listener] of handlers) {
10409
10577
  if (attrs !== null && name in attrs) continue;
10578
+ if (journalChanges && !journaled) {
10579
+ journalHeadEventListeners(state);
10580
+ journaled = true;
10581
+ }
10410
10582
  const event = eventSlot(name);
10411
10583
  state.el.removeEventListener(event.type, listener, event.capture);
10412
10584
  handlers.delete(name);
10413
10585
  }
10586
+ return journaled;
10414
10587
  }
10415
10588
  function adoptServerHeadEl(head, key, tag) {
10416
10589
  const closeKey = "/" + key;
@@ -10472,7 +10645,7 @@ function headBlock(scope, slot, key, tag, attrs, text) {
10472
10645
  journalObjectOnce(state);
10473
10646
  journalBag();
10474
10647
  }
10475
- if (state.handlers !== void 0) removeHeadEventListeners(state, attrs);
10648
+ let journaledHandlers = state.handlers !== void 0 && removeHeadEventListeners(state, attrs, TRANSITION_JOURNAL !== null);
10476
10649
  const previousNames = state.attrNames;
10477
10650
  if (previousNames !== void 0) {
10478
10651
  for (let i = 0; i < previousNames.length; i++) {
@@ -10490,13 +10663,15 @@ function headBlock(scope, slot, key, tag, attrs, text) {
10490
10663
  const hs = state.handlers;
10491
10664
  const prevH = hs?.get(k);
10492
10665
  if (prevH === listener) continue;
10666
+ const nextH = typeof listener === "function" ? listener : void 0;
10667
+ if (TRANSITION_JOURNAL !== null && !journaledHandlers && (prevH !== void 0 || nextH !== void 0)) {
10668
+ journalHeadEventListeners(state);
10669
+ journaledHandlers = true;
10670
+ }
10493
10671
  if (prevH !== void 0) el.removeEventListener(ev.type, prevH, ev.capture);
10494
- if (typeof listener === "function") {
10495
- el.addEventListener(ev.type, listener, ev.capture);
10496
- (hs ?? (state.handlers = /* @__PURE__ */ new Map())).set(
10497
- k,
10498
- listener
10499
- );
10672
+ if (nextH !== void 0) {
10673
+ el.addEventListener(ev.type, nextH, ev.capture);
10674
+ (hs ?? (state.handlers = /* @__PURE__ */ new Map())).set(k, nextH);
10500
10675
  } else {
10501
10676
  hs?.delete(k);
10502
10677
  }
@@ -10609,7 +10784,7 @@ function setEventHandler(el, key, handler) {
10609
10784
  el[key] = handler;
10610
10785
  }
10611
10786
  function evt0(el, key, fn) {
10612
- const d = { [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND, fn, args: EMPTY_ARGS };
10787
+ const d = { fn, args: EMPTY_ARGS, [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND };
10613
10788
  setEventHandler(el, key, d);
10614
10789
  return d;
10615
10790
  }
@@ -10619,37 +10794,30 @@ function evt0u(d, fn) {
10619
10794
  d.fn = fn;
10620
10795
  }
10621
10796
  function evt1(el, key, fn, a0) {
10622
- const d = { [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND, fn, args: [a0] };
10797
+ const d = { fn, args: 1, a0, [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND };
10623
10798
  setEventHandler(el, key, d);
10624
10799
  return d;
10625
10800
  }
10626
10801
  function evt1u(d, fn, a0) {
10627
10802
  if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
10628
- if (TRANSITION_JOURNAL !== null) {
10629
- journalObjectOnce(d);
10630
- journalObjectOnce(d.args);
10631
- }
10803
+ if (TRANSITION_JOURNAL !== null) journalObjectOnce(d);
10632
10804
  d.fn = fn;
10633
- d.args[0] = a0;
10805
+ d.a0 = a0;
10634
10806
  }
10635
10807
  function evt2(el, key, fn, a0, a1) {
10636
- const d = { [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND, fn, args: [a0, a1] };
10808
+ const d = { fn, args: 2, a0, a1, [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND };
10637
10809
  setEventHandler(el, key, d);
10638
10810
  return d;
10639
10811
  }
10640
10812
  function evt2u(d, fn, a0, a1) {
10641
10813
  if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
10642
- if (TRANSITION_JOURNAL !== null) {
10643
- journalObjectOnce(d);
10644
- journalObjectOnce(d.args);
10645
- }
10814
+ if (TRANSITION_JOURNAL !== null) journalObjectOnce(d);
10646
10815
  d.fn = fn;
10647
- const a = d.args;
10648
- a[0] = a0;
10649
- a[1] = a1;
10816
+ d.a0 = a0;
10817
+ d.a1 = a1;
10650
10818
  }
10651
10819
  function evtN(el, key, fn, args) {
10652
- const d = { [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND, fn, args };
10820
+ const d = { fn, args, [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND };
10653
10821
  setEventHandler(el, key, d);
10654
10822
  return d;
10655
10823
  }
@@ -10687,6 +10855,10 @@ function isEventRoot(node, epoch) {
10687
10855
  return membership !== void 0 && membership.count > 0;
10688
10856
  }
10689
10857
  function prepareDelegatedEvent(event, listener) {
10858
+ if (_delegationTargets.size === 1 && portalEventTargetCount === 0) {
10859
+ event[EVENT_ROOT_EPOCH] = eventRootEpoch;
10860
+ return;
10861
+ }
10690
10862
  const path = event.composedPath();
10691
10863
  if (_delegationTargets.size === 1) {
10692
10864
  event[EVENT_ROOT_EPOCH] = eventRootEpoch;
@@ -11009,11 +11181,17 @@ function preserveDispatchedBundle(bundle) {
11009
11181
  let snapshot;
11010
11182
  for (let index = 0; index < CAPTURE_SLOTS.length; index++) {
11011
11183
  if (CAPTURE_SLOTS[index] === bundle) {
11012
- CAPTURE_SLOTS[index] = snapshot ??= {
11013
- [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND,
11014
- fn: bundle.fn,
11015
- args: bundle.args.slice()
11016
- };
11184
+ if (snapshot === void 0) {
11185
+ const args = bundle.args;
11186
+ snapshot = typeof args !== "number" ? { fn: bundle.fn, args: args.slice(), [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND } : args === 1 ? { fn: bundle.fn, args: 1, a0: bundle.a0, [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND } : {
11187
+ fn: bundle.fn,
11188
+ args: 2,
11189
+ a0: bundle.a0,
11190
+ a1: bundle.a1,
11191
+ [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND
11192
+ };
11193
+ }
11194
+ CAPTURE_SLOTS[index] = snapshot;
11017
11195
  }
11018
11196
  }
11019
11197
  }
@@ -11043,8 +11221,8 @@ function resolvePortalEventOwner(node) {
11043
11221
  }
11044
11222
  if (owner === void 0) return;
11045
11223
  if (ROOT_RENDER_TRANSACTION !== null) {
11046
- journalRootProperty(node, "$$portalParent");
11047
- journalRootProperty(node, "$$portalContainer");
11224
+ journalRootProperty(node, "$$portalParent", node.$$portalParent);
11225
+ journalRootProperty(node, "$$portalContainer", node.$$portalContainer);
11048
11226
  }
11049
11227
  node.$$portalParent = owner.host;
11050
11228
  node.$$portalContainer = target;
@@ -11157,18 +11335,24 @@ function fireEventSlot(slot, event) {
11157
11335
  if (isHandlerBundle(slot)) {
11158
11336
  const bundle = slot;
11159
11337
  const a = bundle.args;
11160
- switch (a.length) {
11161
- case 0:
11162
- bundle.fn();
11163
- break;
11164
- case 1:
11165
- bundle.fn(a[0]);
11166
- break;
11167
- case 2:
11168
- bundle.fn(a[0], a[1]);
11169
- break;
11170
- default:
11171
- bundle.fn.apply(null, a);
11338
+ if (typeof a !== "number") {
11339
+ switch (a.length) {
11340
+ case 0:
11341
+ bundle.fn();
11342
+ break;
11343
+ case 1:
11344
+ bundle.fn(a[0]);
11345
+ break;
11346
+ case 2:
11347
+ bundle.fn(a[0], a[1]);
11348
+ break;
11349
+ default:
11350
+ bundle.fn.apply(null, a);
11351
+ }
11352
+ } else if (a === 1) {
11353
+ bundle.fn(bundle.a0);
11354
+ } else {
11355
+ bundle.fn(bundle.a0, bundle.a1);
11172
11356
  }
11173
11357
  return;
11174
11358
  }
@@ -11222,6 +11406,11 @@ function finishCaptureDispatch(event) {
11222
11406
  return;
11223
11407
  }
11224
11408
  if (!DISCRETE_EVENTS.has(type)) return;
11409
+ if (pendingRestores.length === 0) {
11410
+ if (!RESTORE_EVENTS.has(type)) return;
11411
+ const tag = event.target?.localName;
11412
+ if (tag !== "input" && tag !== "textarea" && tag !== "select") return;
11413
+ }
11225
11414
  const bubbleVersion = event[DELEGATED_BUBBLE_VERSION];
11226
11415
  const fallback = () => {
11227
11416
  if (event[DELEGATED_BUBBLE_VERSION] === bubbleVersion) {
@@ -11233,7 +11422,8 @@ function finishCaptureDispatch(event) {
11233
11422
  else queueMicrotask(fallback);
11234
11423
  }
11235
11424
  function dispatchDelegated(event) {
11236
- if (delegatedCapture(event.type)) prepareDelegatedEvent(event, this);
11425
+ const nativeCapture = delegatedCapture(event.type);
11426
+ let path = nativeCapture ? prepareDelegatedEvent(event, this) : void 0;
11237
11427
  event[DELEGATED_BUBBLE_VERSION] = (event[DELEGATED_BUBBLE_VERSION] || 0) + 1;
11238
11428
  maybeEnqueueRestore(event);
11239
11429
  const key = "$$" + event.type;
@@ -11248,12 +11438,14 @@ function dispatchDelegated(event) {
11248
11438
  let stop;
11249
11439
  let propagationStarted = false;
11250
11440
  try {
11251
- if (delegatedCapture(event.type) && _delegatedCapture.has(event.type) && dispatchDelegatedCapture.call(this, event))
11252
- return;
11441
+ if (nativeCapture && _delegatedCapture.has(event.type)) {
11442
+ path ??= event.composedPath();
11443
+ if (dispatchDelegatedCapture.call(this, event, path)) return;
11444
+ }
11253
11445
  if (!_delegated.has(event.type)) return;
11254
11446
  if (node?.nodeType === 1 && isHtmlCustomElement(node) && (event.type === "invalid" || EMULATED_BUBBLING_EVENTS.includes(event.type)))
11255
11447
  return;
11256
- buildDelegatedPath(event, this);
11448
+ buildDelegatedPath(event, this, path);
11257
11449
  snapshotDelegatedSlots(pathBase, key, event);
11258
11450
  stop = Object.getOwnPropertyDescriptor(event, "stopPropagation");
11259
11451
  propagationStarted = true;
@@ -11290,9 +11482,10 @@ function dispatchDelegated(event) {
11290
11482
  maybeFlushDiscrete(event.type);
11291
11483
  }
11292
11484
  }
11293
- function dispatchDelegatedCapture(event) {
11294
- const path = prepareDelegatedEvent(event, this);
11485
+ function dispatchDelegatedCapture(event, path) {
11486
+ path ??= prepareDelegatedEvent(event, this);
11295
11487
  if (!_delegatedCapture.has(event.type)) return false;
11488
+ path ??= event.composedPath();
11296
11489
  if (!event.bubbles || !_delegated.has(event.type)) maybeEnqueueRestore(event);
11297
11490
  const key = CAPTURE_PREFIX + event.type;
11298
11491
  const pathBase = CAPTURE_PATH.length;
@@ -12402,7 +12595,7 @@ function portal(parentScope, slotKey, target, body, props, host, env, fragmentOw
12402
12595
  key
12403
12596
  );
12404
12597
  if (prev !== state) {
12405
- journalRootProperty(parentScope.slots, String(slotKey));
12598
+ journalRootProperty(parentScope.slots, slotKey, parentScope.slots[slotKey]);
12406
12599
  parentScope.slots[slotKey] = state;
12407
12600
  registerSlot(parentScope, state);
12408
12601
  }
@@ -12603,11 +12796,13 @@ function renderPortalState(prev, parentBlock, target, rawBody, rawProps, host, e
12603
12796
  }
12604
12797
  renderBlock(block);
12605
12798
  } else {
12606
- if (state.host !== host) journalRootProperty(state, "host");
12799
+ if (state.host !== host) journalRootProperty(state, "host", state.host);
12607
12800
  state.host = host;
12608
- if (state.block.body !== norm.body) journalRootProperty(state.block, "body");
12609
- if (state.block.props !== norm.props) journalRootProperty(state.block, "props");
12610
- if (state.block.extra !== env) journalRootProperty(state.block, "extra");
12801
+ if (state.block.body !== norm.body)
12802
+ journalRootProperty(state.block, "body", state.block.body);
12803
+ if (state.block.props !== norm.props)
12804
+ journalRootProperty(state.block, "props", state.block.props);
12805
+ if (state.block.extra !== env) journalRootProperty(state.block, "extra", state.block.extra);
12611
12806
  state.block.body = norm.body;
12612
12807
  state.block.props = norm.props;
12613
12808
  state.block.extra = env;
@@ -12639,7 +12834,7 @@ function renderPortalState(prev, parentBlock, target, rawBody, rawProps, host, e
12639
12834
  }
12640
12835
  function teardownPortalState(state) {
12641
12836
  const transaction = ROOT_RENDER_TRANSACTION;
12642
- if (transaction !== null && !transaction.aborted && !ROOT_RENDER_ROLLBACK && state.block?.mounted && !transaction.created?.has(state.block) && state.target !== null) {
12837
+ if (transaction !== null && !transaction.aborted && !ROOT_RENDER_ROLLBACK && state.block?.mounted && !isCreatedInRootRender(transaction, state.block) && state.target !== null) {
12643
12838
  deferRootRange(state.target, state.start, state.end, () => teardownPortalState(state));
12644
12839
  return;
12645
12840
  }
@@ -12687,6 +12882,14 @@ function elementKeyWasProvided(descriptor) {
12687
12882
  }
12688
12883
  const ELEMENTS_MISSING_LIST_KEY = /* @__PURE__ */ new WeakSet();
12689
12884
  const SCOPED_ELEMENT_PROPS = /* @__PURE__ */ new WeakSet();
12885
+ const SCOPED_CHILDREN_RESOLVER = /* @__PURE__ */ Symbol("octane.scopedChildren");
12886
+ const SCOPED_CHILDREN_PROPERTY = {
12887
+ configurable: true,
12888
+ enumerable: true,
12889
+ get: function() {
12890
+ return this[SCOPED_CHILDREN_RESOLVER]();
12891
+ }
12892
+ };
12690
12893
  function hasElementConfigKey(config) {
12691
12894
  if (config == null || typeof config !== "object" && typeof config !== "function") return false;
12692
12895
  if (process.env.NODE_ENV !== "production" && import_has_own.hasOwnProp.call(config, "key")) {
@@ -12703,6 +12906,83 @@ function copyElementConfig(config) {
12703
12906
  }
12704
12907
  return props;
12705
12908
  }
12909
+ function restoreWritableScopedChildren(props, name, value) {
12910
+ const inherited = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(props), name);
12911
+ if (inherited?.get === void 0 && inherited?.set === void 0) return false;
12912
+ Object.defineProperty(props, "children", {
12913
+ configurable: true,
12914
+ enumerable: true,
12915
+ writable: true,
12916
+ value
12917
+ });
12918
+ return true;
12919
+ }
12920
+ function copyScopedElementConfig(type, config, resolve) {
12921
+ if (config != null && import_has_own.hasOwnProp.call(config, "__proto__") || import_has_own.hasOwnProp.call(Object.prototype, "children")) {
12922
+ const props2 = copyElementConfig(config);
12923
+ (0, import_shared_value_helpers.applyElementDefaultProps)(type, props2);
12924
+ Object.defineProperty(props2, SCOPED_CHILDREN_RESOLVER, { value: resolve });
12925
+ Object.defineProperty(props2, "children", SCOPED_CHILDREN_PROPERTY);
12926
+ SCOPED_ELEMENT_PROPS.add(props2);
12927
+ return props2;
12928
+ }
12929
+ const props = {};
12930
+ Object.defineProperty(props, SCOPED_CHILDREN_RESOLVER, { value: resolve });
12931
+ let copiedChildren;
12932
+ let hasCopiedChildren = false;
12933
+ let childrenAreWritable = false;
12934
+ if (config != null) {
12935
+ for (const name in config) {
12936
+ if (name === "key" || !import_has_own.hasOwnProp.call(config, name)) continue;
12937
+ if (name === "children") {
12938
+ copiedChildren = config[name];
12939
+ Object.defineProperty(props, "children", SCOPED_CHILDREN_PROPERTY);
12940
+ hasCopiedChildren = true;
12941
+ } else {
12942
+ const value = config[name];
12943
+ if (hasCopiedChildren && !childrenAreWritable && !import_has_own.hasOwnProp.call(props, name) && restoreWritableScopedChildren(props, name, copiedChildren)) {
12944
+ childrenAreWritable = true;
12945
+ }
12946
+ props[name] = value;
12947
+ }
12948
+ }
12949
+ }
12950
+ const defaults = type?.defaultProps;
12951
+ if (defaults != null) {
12952
+ for (const name in defaults) {
12953
+ if (name === "children") {
12954
+ if ((childrenAreWritable ? props.children : hasCopiedChildren ? copiedChildren : props.children) === void 0) {
12955
+ copiedChildren = defaults[name];
12956
+ if (childrenAreWritable) {
12957
+ props.children = copiedChildren;
12958
+ } else if (!hasCopiedChildren) {
12959
+ if ("children" in props) {
12960
+ props.children = copiedChildren;
12961
+ } else {
12962
+ Object.defineProperty(props, "children", SCOPED_CHILDREN_PROPERTY);
12963
+ hasCopiedChildren = true;
12964
+ }
12965
+ }
12966
+ }
12967
+ } else {
12968
+ if (hasCopiedChildren && !childrenAreWritable && !import_has_own.hasOwnProp.call(props, name) && restoreWritableScopedChildren(props, name, copiedChildren)) {
12969
+ childrenAreWritable = true;
12970
+ }
12971
+ if (props[name] === void 0) props[name] = defaults[name];
12972
+ }
12973
+ }
12974
+ }
12975
+ if (childrenAreWritable || !hasCopiedChildren)
12976
+ Object.defineProperty(props, "children", SCOPED_CHILDREN_PROPERTY);
12977
+ SCOPED_ELEMENT_PROPS.add(props);
12978
+ return props;
12979
+ }
12980
+ function scopedElementRecord(type, props, key, ref, resolve) {
12981
+ const descriptor = { $$kind: ELEMENT_TAG, type, props, key, ref };
12982
+ Object.defineProperty(descriptor, SCOPED_CHILDREN_RESOLVER, { value: resolve });
12983
+ Object.defineProperty(descriptor, "children", SCOPED_CHILDREN_PROPERTY);
12984
+ return descriptor;
12985
+ }
12706
12986
  function finalizeElementDescriptor(descriptor) {
12707
12987
  if (process.env.NODE_ENV !== "production") {
12708
12988
  Object.freeze(descriptor.props);
@@ -12711,6 +12991,33 @@ function finalizeElementDescriptor(descriptor) {
12711
12991
  return descriptor;
12712
12992
  }
12713
12993
  const SCOPED_VALUE_RECORD = /* @__PURE__ */ Symbol("octane.scopedValue");
12994
+ function scopedValueType() {
12995
+ return this[SCOPED_VALUE_RECORD]().type;
12996
+ }
12997
+ function scopedValueProps() {
12998
+ return this[SCOPED_VALUE_RECORD]().props;
12999
+ }
13000
+ function scopedValueKey() {
13001
+ const next = this[SCOPED_VALUE_RECORD]();
13002
+ const key = next.key;
13003
+ if (key === null && KEYED_ELEMENT_DESCRIPTORS.has(next)) {
13004
+ KEYED_ELEMENT_DESCRIPTORS.add(this);
13005
+ }
13006
+ return key;
13007
+ }
13008
+ function scopedValueRef() {
13009
+ return this[SCOPED_VALUE_RECORD]().ref;
13010
+ }
13011
+ function scopedValueChildren() {
13012
+ return this[SCOPED_VALUE_RECORD]().children;
13013
+ }
13014
+ const SCOPED_VALUE_PROPERTIES = {
13015
+ type: { configurable: true, enumerable: true, get: scopedValueType },
13016
+ props: { configurable: true, enumerable: true, get: scopedValueProps },
13017
+ key: { configurable: true, enumerable: true, get: scopedValueKey },
13018
+ ref: { configurable: true, enumerable: true, get: scopedValueRef },
13019
+ children: { configurable: true, enumerable: true, get: scopedValueChildren }
13020
+ };
12714
13021
  function createScopedValue(readElement) {
12715
13022
  return scopedValueDescriptor(createScopedResolver(readElement));
12716
13023
  }
@@ -12718,30 +13025,13 @@ function nativeCreateScopedValue(readElement) {
12718
13025
  return scopedValueDescriptor(createNativeScopedResolver(readElement));
12719
13026
  }
12720
13027
  function scopedValueDescriptor(resolve) {
12721
- const descriptor = {
12722
- $$kind: ELEMENT_TAG,
12723
- get type() {
12724
- return resolve().type;
12725
- },
12726
- get props() {
12727
- return resolve().props;
12728
- },
12729
- get key() {
12730
- const next = resolve();
12731
- const key = next.key;
12732
- if (key === null && KEYED_ELEMENT_DESCRIPTORS.has(next)) {
12733
- KEYED_ELEMENT_DESCRIPTORS.add(descriptor);
12734
- }
12735
- return key;
12736
- },
12737
- get ref() {
12738
- return resolve().ref;
12739
- },
12740
- get children() {
12741
- return resolve().children;
12742
- }
12743
- };
13028
+ const descriptor = { $$kind: ELEMENT_TAG };
12744
13029
  Object.defineProperty(descriptor, SCOPED_VALUE_RECORD, { value: resolve });
13030
+ Object.defineProperty(descriptor, "type", SCOPED_VALUE_PROPERTIES.type);
13031
+ Object.defineProperty(descriptor, "props", SCOPED_VALUE_PROPERTIES.props);
13032
+ Object.defineProperty(descriptor, "key", SCOPED_VALUE_PROPERTIES.key);
13033
+ Object.defineProperty(descriptor, "ref", SCOPED_VALUE_PROPERTIES.ref);
13034
+ Object.defineProperty(descriptor, "children", SCOPED_VALUE_PROPERTIES.children);
12745
13035
  if (process.env.NODE_ENV !== "production") Object.freeze(descriptor);
12746
13036
  return descriptor;
12747
13037
  }
@@ -12755,20 +13045,14 @@ function scopedElementDescriptor(type, props, children) {
12755
13045
  const src = props ?? null;
12756
13046
  const hasKey = hasElementConfigKey(src);
12757
13047
  const key = hasKey ? "" + src.key : null;
12758
- const copiedProps = copyElementConfig(src);
12759
- (0, import_shared_value_helpers.applyElementDefaultProps)(type, copiedProps);
12760
- const childProperty = { configurable: true, enumerable: true, get: children };
12761
- Object.defineProperty(copiedProps, "children", childProperty);
12762
- SCOPED_ELEMENT_PROPS.add(copiedProps);
12763
- const descriptor = {
12764
- $$kind: ELEMENT_TAG,
13048
+ const copiedProps = copyScopedElementConfig(type, src, children);
13049
+ const descriptor = scopedElementRecord(
12765
13050
  type,
12766
- props: copiedProps,
13051
+ copiedProps,
12767
13052
  key,
12768
- ref: copiedProps.ref !== void 0 ? copiedProps.ref : null,
12769
- children: null
12770
- };
12771
- Object.defineProperty(descriptor, "children", childProperty);
13053
+ copiedProps.ref !== void 0 ? copiedProps.ref : null,
13054
+ children
13055
+ );
12772
13056
  if (key === null && src != null && (typeof src === "object" || typeof src === "function") && "key" in src) {
12773
13057
  KEYED_ELEMENT_DESCRIPTORS.add(descriptor);
12774
13058
  }
@@ -12818,9 +13102,15 @@ function cloneElement(element, config, ...children) {
12818
13102
  throw new Error((0, import_error_codes_client_generated.formatClientError)(4));
12819
13103
  }
12820
13104
  let scopedChildren;
13105
+ let copiedGetter;
12821
13106
  let props;
12822
13107
  if (SCOPED_ELEMENT_PROPS.has(element.props)) {
12823
- scopedChildren = Object.getOwnPropertyDescriptor(element, "children").get;
13108
+ const get = Object.getOwnPropertyDescriptor(element, "children").get;
13109
+ if (get === SCOPED_CHILDREN_PROPERTY.get) {
13110
+ scopedChildren = element[SCOPED_CHILDREN_RESOLVER];
13111
+ } else {
13112
+ copiedGetter = get === SCOPED_VALUE_PROPERTIES.children.get ? () => get.call(element) : get;
13113
+ }
12824
13114
  props = {};
12825
13115
  for (const name in element.props) {
12826
13116
  if (name !== "key" && name !== "children" && import_has_own.hasOwnProp.call(element.props, name)) {
@@ -12847,30 +13137,49 @@ function cloneElement(element, config, ...children) {
12847
13137
  }
12848
13138
  const n = children.length;
12849
13139
  let kids;
12850
- let childProperty;
13140
+ let keepsScopedChildren = false;
12851
13141
  if (n === 1) {
12852
13142
  kids = children[0];
12853
13143
  } else if (n > 1) {
12854
13144
  POSITIONAL_CHILDREN.add(children);
12855
13145
  kids = children;
12856
- } else if (scopedChildren !== void 0 && !replacedChildren) {
12857
- childProperty = { configurable: true, enumerable: true, get: scopedChildren };
12858
- Object.defineProperty(props, "children", childProperty);
13146
+ } else if ((scopedChildren !== void 0 || copiedGetter !== void 0) && !replacedChildren) {
13147
+ if (copiedGetter === void 0) {
13148
+ Object.defineProperty(props, SCOPED_CHILDREN_RESOLVER, { value: scopedChildren });
13149
+ }
13150
+ Object.defineProperty(
13151
+ props,
13152
+ "children",
13153
+ copiedGetter === void 0 ? SCOPED_CHILDREN_PROPERTY : { configurable: true, enumerable: true, get: copiedGetter }
13154
+ );
12859
13155
  SCOPED_ELEMENT_PROPS.add(props);
13156
+ keepsScopedChildren = true;
12860
13157
  kids = null;
12861
13158
  } else {
12862
13159
  kids = "children" in props ? props.children : element.children;
12863
13160
  }
12864
13161
  if (n > 0) props.children = kids;
12865
- const descriptor = {
12866
- $$kind: ELEMENT_TAG,
12867
- type: element.type,
12868
- props,
12869
- key,
12870
- ref: props.ref !== void 0 ? props.ref : null,
12871
- children: kids ?? null
12872
- };
12873
- if (childProperty !== void 0) Object.defineProperty(descriptor, "children", childProperty);
13162
+ const ref = props.ref !== void 0 ? props.ref : null;
13163
+ let descriptor;
13164
+ if (keepsScopedChildren && copiedGetter === void 0) {
13165
+ descriptor = scopedElementRecord(element.type, props, key, ref, scopedChildren);
13166
+ } else {
13167
+ descriptor = {
13168
+ $$kind: ELEMENT_TAG,
13169
+ type: element.type,
13170
+ props,
13171
+ key,
13172
+ ref,
13173
+ children: kids ?? null
13174
+ };
13175
+ if (keepsScopedChildren) {
13176
+ Object.defineProperty(descriptor, "children", {
13177
+ configurable: true,
13178
+ enumerable: true,
13179
+ get: copiedGetter
13180
+ });
13181
+ }
13182
+ }
12874
13183
  if (key === null && (elementKeyWasProvided(element) || config != null && import_has_own.hasOwnProp.call(config, "key"))) {
12875
13184
  KEYED_ELEMENT_DESCRIPTORS.add(descriptor);
12876
13185
  }
@@ -12881,20 +13190,42 @@ function cloneElement(element, config, ...children) {
12881
13190
  }
12882
13191
  function cloneAndReplaceElementKey(element, key) {
12883
13192
  const scoped = SCOPED_ELEMENT_PROPS.has(element.props);
12884
- const descriptor = {
12885
- $$kind: ELEMENT_TAG,
12886
- type: element.type,
12887
- props: element.props,
12888
- key,
12889
- ref: element.ref,
12890
- children: scoped ? null : element.children
12891
- };
13193
+ let descriptor;
12892
13194
  if (scoped) {
12893
- Object.defineProperty(descriptor, "children", {
12894
- configurable: true,
12895
- enumerable: true,
12896
- get: Object.getOwnPropertyDescriptor(element, "children").get
12897
- });
13195
+ const get = Object.getOwnPropertyDescriptor(element, "children").get;
13196
+ if (get === SCOPED_CHILDREN_PROPERTY.get) {
13197
+ descriptor = scopedElementRecord(
13198
+ element.type,
13199
+ element.props,
13200
+ key,
13201
+ element.ref,
13202
+ element[SCOPED_CHILDREN_RESOLVER]
13203
+ );
13204
+ } else {
13205
+ const copiedGetter = get === SCOPED_VALUE_PROPERTIES.children.get ? () => get.call(element) : get;
13206
+ descriptor = {
13207
+ $$kind: ELEMENT_TAG,
13208
+ type: element.type,
13209
+ props: element.props,
13210
+ key,
13211
+ ref: element.ref,
13212
+ children: null
13213
+ };
13214
+ Object.defineProperty(descriptor, "children", {
13215
+ configurable: true,
13216
+ enumerable: true,
13217
+ get: copiedGetter
13218
+ });
13219
+ }
13220
+ } else {
13221
+ descriptor = {
13222
+ $$kind: ELEMENT_TAG,
13223
+ type: element.type,
13224
+ props: element.props,
13225
+ key,
13226
+ ref: element.ref,
13227
+ children: element.children
13228
+ };
12898
13229
  }
12899
13230
  if (ELEMENTS_MISSING_LIST_KEY.has(element)) ELEMENTS_MISSING_LIST_KEY.add(descriptor);
12900
13231
  return finalizeElementDescriptor(descriptor);
@@ -13231,13 +13562,14 @@ function componentSlotImpl(outputHandler, parentScope, slotKey, domParent, body,
13231
13562
  }
13232
13563
  }
13233
13564
  if ((hasKey === true || key !== void 0) && !state.keyed) {
13234
- if (!journaledSlot) journalRootProperty(state, "keyed");
13565
+ if (!journaledSlot) journalRootProperty(state, "keyed", state.keyed);
13235
13566
  state.keyed = true;
13236
13567
  }
13237
13568
  if (keyChanged) {
13238
13569
  state.currentComp = null;
13239
13570
  }
13240
- if (!journaledSlot && !Object.is(state.prevKey, nextKey)) journalRootProperty(state, "prevKey");
13571
+ if (!journaledSlot && !Object.is(state.prevKey, nextKey))
13572
+ journalRootProperty(state, "prevKey", state.prevKey);
13241
13573
  state.prevKey = nextKey;
13242
13574
  if (replacing) {
13243
13575
  const swapDriver = TRANSITION_SWAP_DRIVER;
@@ -13248,7 +13580,7 @@ function componentSlotImpl(outputHandler, parentScope, slotKey, domParent, body,
13248
13580
  const suspenseSwap = canSwapOffscreen && !transitionMode && committedSuspense;
13249
13581
  const probeOnly = suspenseSwap && !transitionMode;
13250
13582
  const rootTransaction = ROOT_RENDER_TRANSACTION;
13251
- if (rootTransaction !== null && !committedSuspense && hydration === null && state.block !== null && state.block.mounted && !rootTransaction.created?.has(state.block)) {
13583
+ if (rootTransaction !== null && !committedSuspense && hydration === null && state.block !== null && state.block.mounted && !isCreatedInRootRender(rootTransaction, state.block)) {
13252
13584
  const oldBlock = state.block;
13253
13585
  const oldStart = oldBlock.startMarker;
13254
13586
  const oldEnd = oldBlock.endMarker;
@@ -13402,7 +13734,8 @@ function componentSlotImpl(outputHandler, parentScope, slotKey, domParent, body,
13402
13734
  }
13403
13735
  } else if (state.block) {
13404
13736
  if (tryMemoBail(state.block, identity, props)) return;
13405
- if (state.block.props !== renderProps) journalRootProperty(state.block, "props");
13737
+ if (state.block.props !== renderProps)
13738
+ journalRootProperty(state.block, "props", state.block.props);
13406
13739
  state.block.props = renderProps;
13407
13740
  renderBlock(state.block);
13408
13741
  }
@@ -13813,7 +14146,7 @@ function hostComponent(scope, slot, tag, props, childrenBody, anchor) {
13813
14146
  if (typeof childrenBody === "function") {
13814
14147
  state.latest = childrenBody;
13815
14148
  if (state.body === void 0) {
13816
- state.body = ((...args) => state.latest(...args));
14149
+ state.body = (props2, scope2, extra) => state.latest(props2, scope2, extra);
13817
14150
  }
13818
14151
  childSlot(state.childScope, 0, el, state.body, null, false, el);
13819
14152
  } else if (childrenBody != null || state.childScope.slots[0] !== void 0) {
@@ -13965,7 +14298,7 @@ function renderFragmentRefDescriptor(descriptor, scope) {
13965
14298
  block.slots[1] = instance;
13966
14299
  block.refFields = ["f", "a", ""];
13967
14300
  } else if (instance._currentRef !== descriptor.ref) {
13968
- journalRootProperty(instance, "_currentRef");
14301
+ journalRootProperty(instance, "_currentRef", instance._currentRef);
13969
14302
  if (instance._currentRef != null) queueRefDetach(instance._currentRef, instance);
13970
14303
  if (descriptor.ref != null) queueRefAttach(scope, descriptor.ref, instance);
13971
14304
  instance._currentRef = descriptor.ref;
@@ -13977,20 +14310,48 @@ function renderFragmentRefDescriptor(descriptor, scope) {
13977
14310
  function deoptWrapperKind(value) {
13978
14311
  return POSITIONAL_CHILDREN.has(value) ? "fragment" : "array";
13979
14312
  }
13980
- function scopedDeoptKey(path, item, index, key) {
14313
+ const DEOPT_KEY_STRINGIFY = JSON.stringify;
14314
+ function nestedImplicitKeyPrefix(path) {
14315
+ if (JSON.stringify !== DEOPT_KEY_STRINGIFY || "toJSON" in path) return null;
14316
+ for (let i = 0; i < path.length; i++) {
14317
+ const type = typeof path[i];
14318
+ if (type !== "string" && type !== "number") return null;
14319
+ }
14320
+ return "[" + JSON.stringify(path) + ',"index",';
14321
+ }
14322
+ function appendScopedDeoptKey(outKeys, path, item, index, key, implicitPrefix) {
13981
14323
  const explicit = (isElementDescriptor(item) || item?.$$kind === PORTAL_TAG) && item.key != null;
13982
- if (path.length === 0) return explicit ? "k" + String(key) : "i" + index;
13983
- return JSON.stringify([path, explicit ? "key" : "index", explicit ? String(key) : index]);
14324
+ if (path.length === 0) {
14325
+ outKeys.push(explicit ? "k" + String(key) : index);
14326
+ return implicitPrefix;
14327
+ }
14328
+ if (!explicit) {
14329
+ if (implicitPrefix === void 0) implicitPrefix = nestedImplicitKeyPrefix(path);
14330
+ if (implicitPrefix !== null && JSON.stringify === DEOPT_KEY_STRINGIFY && !("toJSON" in path)) {
14331
+ outKeys.push(implicitPrefix + index + "]");
14332
+ return implicitPrefix;
14333
+ }
14334
+ }
14335
+ outKeys.push(JSON.stringify([path, explicit ? "key" : "index", explicit ? String(key) : index]));
14336
+ return implicitPrefix;
13984
14337
  }
13985
14338
  function flattenReactChildContainer(outItems, outKeys, children, kind, path) {
13986
14339
  const keyFn = kind === "fragment" ? deoptKeyPositional : deoptKey;
13987
14340
  const count = children.length;
14341
+ let implicitPrefix = count > 1 ? void 0 : null;
13988
14342
  for (let i = 0; i < count; i++) {
13989
14343
  const item = children[i];
13990
14344
  if (isFragmentDescriptor(item)) {
13991
14345
  if (item.ref != null || import_has_own.hasOwnProp.call(item.props, "ref")) {
13992
14346
  outItems.push(fragmentRefDescriptor(item));
13993
- outKeys.push(scopedDeoptKey(path, item, i, keyFn(item, i)));
14347
+ implicitPrefix = appendScopedDeoptKey(
14348
+ outKeys,
14349
+ path,
14350
+ item,
14351
+ i,
14352
+ keyFn(item, i),
14353
+ implicitPrefix
14354
+ );
13994
14355
  continue;
13995
14356
  }
13996
14357
  const nested = fragmentDescriptorChildren(item);
@@ -14013,15 +14374,18 @@ function flattenReactChildContainer(outItems, outKeys, children, kind, path) {
14013
14374
  continue;
14014
14375
  }
14015
14376
  outItems.push(item);
14016
- outKeys.push(scopedDeoptKey(path, item, i, keyFn(item, i)));
14377
+ implicitPrefix = appendScopedDeoptKey(outKeys, path, item, i, keyFn(item, i), implicitPrefix);
14017
14378
  }
14018
14379
  }
14380
+ function singleDeoptKey(item, key) {
14381
+ return (isElementDescriptor(item) || item?.$$kind === PORTAL_TAG) && item.key != null ? "k" + String(key) : 0;
14382
+ }
14019
14383
  function prepareDeoptList(value, forceSingle = false, includeKeyedSingle = true) {
14020
14384
  if (isFragmentDescriptor(value)) {
14021
14385
  if (value.ref != null || import_has_own.hasOwnProp.call(value.props, "ref")) {
14022
14386
  return {
14023
14387
  items: [fragmentRefDescriptor(value)],
14024
- keys: [scopedDeoptKey([], value, 0, value.key ?? 0)]
14388
+ keys: [singleDeoptKey(value, value.key ?? 0)]
14025
14389
  };
14026
14390
  }
14027
14391
  const items = [];
@@ -14037,10 +14401,10 @@ function prepareDeoptList(value, forceSingle = false, includeKeyedSingle = true)
14037
14401
  return { items, keys };
14038
14402
  }
14039
14403
  if (includeKeyedSingle && isElementDescriptor(value) && value.key != null) {
14040
- return { items: [value], keys: [scopedDeoptKey([], value, 0, value.key)] };
14404
+ return { items: [value], keys: [singleDeoptKey(value, value.key)] };
14041
14405
  }
14042
14406
  if (forceSingle) {
14043
- return { items: [value], keys: [scopedDeoptKey([], value, 0, deoptKeyPositional(value, 0))] };
14407
+ return { items: [value], keys: [singleDeoptKey(value, deoptKeyPositional(value, 0))] };
14044
14408
  }
14045
14409
  return null;
14046
14410
  }
@@ -14271,8 +14635,8 @@ function deoptItemBody(item, scope) {
14271
14635
  const p = sm.parentNode;
14272
14636
  if (ROOT_RENDER_TRANSACTION !== null) {
14273
14637
  journalRootRange(p, sm.previousSibling, sm.nextSibling);
14274
- journalRootProperty(block, "startMarker");
14275
- journalRootProperty(block, "endMarker");
14638
+ journalRootProperty(block, "startMarker", block.startMarker);
14639
+ journalRootProperty(block, "endMarker", block.endMarker);
14276
14640
  }
14277
14641
  const s = document.createComment("it");
14278
14642
  const e = document.createComment("/it");
@@ -14285,7 +14649,7 @@ function deoptItemBody(item, scope) {
14285
14649
  const stale = block.deoptNode;
14286
14650
  let transfer = null;
14287
14651
  if (stale != null) {
14288
- journalRootProperty(block, "deoptNode");
14652
+ journalRootProperty(block, "deoptNode", block.deoptNode);
14289
14653
  if (scope.slots[0] === void 0 && stale.nodeType === 1 && isHostDescriptor(item) && stale.localName === item.type && stale.parentNode === block.parentNode) {
14290
14654
  transfer = stale;
14291
14655
  } else if (stale.parentNode === block.parentNode) {
@@ -14367,7 +14731,7 @@ function deoptItemBody(item, scope) {
14367
14731
  }
14368
14732
  const node = reconcileDeoptNode(prev, item, block, deoptChildNamespace(block.parentNode));
14369
14733
  if (node !== prev) {
14370
- journalRootProperty(block, "deoptNode");
14734
+ journalRootProperty(block, "deoptNode", block.deoptNode);
14371
14735
  if (prev != null && prev !== node && prev.parentNode === block.parentNode) {
14372
14736
  if (ROOT_RENDER_TRANSACTION !== null)
14373
14737
  journalRootRange(block.parentNode, prev.previousSibling, prev.nextSibling);
@@ -14395,8 +14759,8 @@ function deoptItemBody(item, scope) {
14395
14759
  block.parentNode.insertBefore(node, endM);
14396
14760
  }
14397
14761
  if (prev !== null && block.startMarker === prev) {
14398
- journalRootProperty(block, "startMarker");
14399
- journalRootProperty(block, "endMarker");
14762
+ journalRootProperty(block, "startMarker", block.startMarker);
14763
+ journalRootProperty(block, "endMarker", block.endMarker);
14400
14764
  block.startMarker = node;
14401
14765
  block.endMarker = node;
14402
14766
  }
@@ -14509,7 +14873,7 @@ function hostElementBody(d, block) {
14509
14873
  const retired = el;
14510
14874
  if (ROOT_RENDER_TRANSACTION !== null) {
14511
14875
  journalRootRange(block.parentNode, retired.previousSibling, retired.nextSibling);
14512
- journalRootProperty(block, "deoptNode");
14876
+ journalRootProperty(block, "deoptNode", block.deoptNode);
14513
14877
  }
14514
14878
  const childState = block.slots[0];
14515
14879
  if (childState !== void 0) {
@@ -15131,7 +15495,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
15131
15495
  }
15132
15496
  if (state === void 0) {
15133
15497
  const transaction = ROOT_RENDER_TRANSACTION;
15134
- if (transaction !== null && !transaction.aborted && !ROOT_RENDER_ROLLBACK && parentScope.mounted && !transaction.created?.has(parentBlock)) {
15498
+ if (transaction !== null && !transaction.aborted && !ROOT_RENDER_ROLLBACK && parentScope.mounted && !isCreatedInRootRender(transaction, parentBlock)) {
15135
15499
  journalBag();
15136
15500
  const after = ownsHost === void 0 ? anchor ?? null : null;
15137
15501
  const before = ownsHost === void 0 ? after === null ? domParent.lastChild : after.previousSibling : null;
@@ -15363,8 +15727,8 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
15363
15727
  }
15364
15728
  if (wasImplicitlyArmed && taggedChildren && comp === state.currentComp && tryImplicitBail(state.block))
15365
15729
  return;
15366
- if (state.block.body !== comp) journalRootProperty(state.block, "body");
15367
- if (state.currentComp !== comp) journalRootProperty(state, "currentComp");
15730
+ if (state.block.body !== comp) journalRootProperty(state.block, "body", state.block.body);
15731
+ if (state.currentComp !== comp) journalRootProperty(state, "currentComp", state.currentComp);
15368
15732
  state.block.body = comp;
15369
15733
  renderBlock(state.block);
15370
15734
  state.currentComp = comp;
@@ -15373,7 +15737,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
15373
15737
  if (state.block !== null && comp === state.currentComp) {
15374
15738
  if (tryMemoBail(state.block, comp, props)) return;
15375
15739
  if (props === state.block.props && tryImplicitBail(state.block)) return;
15376
- if (state.block.props !== props) journalRootProperty(state.block, "props");
15740
+ if (state.block.props !== props) journalRootProperty(state.block, "props", state.block.props);
15377
15741
  state.block.props = props;
15378
15742
  renderBlock(state.block);
15379
15743
  return;
@@ -15494,7 +15858,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
15494
15858
  const oldEnd = state.end;
15495
15859
  state.start = r.wip.start;
15496
15860
  state.end = r.wip.end;
15497
- journalRootProperty(r.wip.block, "exclusiveMarkers");
15861
+ journalRootProperty(r.wip.block, "exclusiveMarkers", r.wip.block.exclusiveMarkers);
15498
15862
  r.wip.block.exclusiveMarkers = true;
15499
15863
  replaceSharedBlockBoundary(parentBlock, oldStart, oldEnd, state.start, state.end);
15500
15864
  deferRootRange(domParent, oldStart, oldStart);
@@ -15635,7 +15999,7 @@ function childTextHole(parentScope, slotKey, domParent, value, cachedNode) {
15635
15999
  if (ROOT_RENDER_TRANSACTION !== null && state === void 0 && parentScope.mounted) {
15636
16000
  journalBag();
15637
16001
  journalRootRange(domParent, null, null);
15638
- journalRootProperty(parentScope.slots, String(slotKey));
16002
+ journalRootProperty(parentScope.slots, slotKey, parentScope.slots[slotKey]);
15639
16003
  }
15640
16004
  if (state === void 0 && vt !== "object" && vt !== "function") {
15641
16005
  const str = value == null || value === false || value === true ? "" : vt === "string" ? value : String(value);
@@ -15869,29 +16233,36 @@ function shallowEqualPropsExact(a, b) {
15869
16233
  }
15870
16234
  return true;
15871
16235
  }
16236
+ const MEMO_OWNER = /* @__PURE__ */ Symbol("memoOwner");
16237
+ const MEMO_MARKER_DESCRIPTOR = {
16238
+ get() {
16239
+ return this === this[MEMO_OWNER];
16240
+ }
16241
+ };
16242
+ const MEMO_DEFAULT_PROPS_DESCRIPTOR = {
16243
+ configurable: true,
16244
+ // Static hoisters must copy `type` along with this accessor.
16245
+ get() {
16246
+ return this.type.defaultProps;
16247
+ },
16248
+ set(value) {
16249
+ this.type.defaultProps = value;
16250
+ }
16251
+ };
15872
16252
  // @__NO_SIDE_EFFECTS__
15873
16253
  function memo(component, arePropsEqual) {
15874
16254
  function memoWrapper(props, scope, extra) {
15875
16255
  return component(props, scope, extra);
15876
16256
  }
16257
+ Object.defineProperty(memoWrapper, MEMO_OWNER, { value: memoWrapper });
15877
16258
  Object.defineProperty(memoWrapper, "type", { value: component });
15878
16259
  Object.defineProperty(memoWrapper, "displayName", {
15879
16260
  configurable: true,
15880
16261
  writable: true,
15881
16262
  value: component.displayName || component.name || "Memo"
15882
16263
  });
15883
- Object.defineProperty(memoWrapper, "__memo", {
15884
- get() {
15885
- return this === memoWrapper;
15886
- }
15887
- });
15888
- Object.defineProperty(memoWrapper, "defaultProps", {
15889
- configurable: true,
15890
- get: () => component.defaultProps,
15891
- set: (value) => {
15892
- component.defaultProps = value;
15893
- }
15894
- });
16264
+ Object.defineProperty(memoWrapper, "__memo", MEMO_MARKER_DESCRIPTOR);
16265
+ Object.defineProperty(memoWrapper, "defaultProps", MEMO_DEFAULT_PROPS_DESCRIPTOR);
15895
16266
  if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__)
15896
16267
  (0, import_profiling.__profileComponentSource)(memoWrapper, component);
15897
16268
  if (arePropsEqual) Object.defineProperty(memoWrapper, "__compare", { value: arePropsEqual });
@@ -16727,7 +17098,7 @@ function renderVisibleTry(state, source) {
16727
17098
  const journalCheckpoint = armTransitionJournal(state);
16728
17099
  const previousCapture = WIP_CAPTURE;
16729
17100
  const capture = journalCheckpoint < 0 ? null : createOffscreenCapture();
16730
- const effectDeps = capture === null ? null : snapshotSubtreeEffectDeps(block);
17101
+ const effectDeps = capture !== null && (ROOT_RENDER_TRANSACTION === null || state.propagateSuspense || (block.pendingMode ?? CURRENT_BLOCK?.currentRenderMode) !== "transition" || block.pending && block.pendingMode === "transition" && CURRENT_BLOCK !== null && CURRENT_BLOCK.currentRenderMode === "urgent" && blockIsAncestor(CURRENT_BLOCK, block) && TRANSITION_SWAP_DRIVER !== null) ? snapshotSubtreeEffectDeps(block) : null;
16731
17102
  const refDetachCheckpoint = refDetachQueue.length;
16732
17103
  let didThrow = false;
16733
17104
  let renderError;
@@ -16744,7 +17115,7 @@ function renderVisibleTry(state, source) {
16744
17115
  if (didThrow) {
16745
17116
  if (capture !== null) {
16746
17117
  refDetachQueue.splice(refDetachCheckpoint);
16747
- restoreSubtreeEffectDeps(block, effectDeps);
17118
+ if (effectDeps !== null) restoreSubtreeEffectDeps(block, effectDeps);
16748
17119
  discardOffscreenCapture(capture);
16749
17120
  }
16750
17121
  if (isHostContextRequest(renderError) || renderError instanceof import_read_protocol.NativeAdoptionMiss)
@@ -17264,6 +17635,7 @@ function invalidatePendingSuspenseEffects(owner) {
17264
17635
  if (block.disposed || block !== owner && !blockIsAncestorOf(owner, block)) continue;
17265
17636
  const effect = pending.scope.hooks?.get(pending.slot);
17266
17637
  if (effect === void 0 || effect.revision !== pending.revision) continue;
17638
+ if (ROOT_RENDER_TRANSACTION !== null) journalObjectOnce(effect);
17267
17639
  effect.revision++;
17268
17640
  effect.active = effect.connectedFn !== null;
17269
17641
  effect.deps = effect.connectedFn === null ? void 0 : effect.connectedArgs;
@@ -17305,7 +17677,7 @@ function hideTryContentAndMountPendingInner(state, resumeThenable) {
17305
17677
  const persistent = state.tryBlock;
17306
17678
  const uncommittedRefs = discardSubtreeRefAttaches(persistent);
17307
17679
  invalidatePendingSuspenseEffects(persistent);
17308
- journalRootProperty(persistent, "inactive");
17680
+ journalRootProperty(persistent, "inactive", persistent.inactive);
17309
17681
  persistent.inactive = true;
17310
17682
  const action = () => deactivateSuspensePrimary(state, persistent, uncommittedRefs);
17311
17683
  if (WIP_CAPTURE === null) effectEventCommitActions.push(action);
@@ -17676,6 +18048,7 @@ function reconnectBailedEffects(block) {
17676
18048
  const queue = context.queues[effect.phase];
17677
18049
  if (replay !== null) {
17678
18050
  const last = replay[replay.length - 1];
18051
+ if (ROOT_RENDER_TRANSACTION !== null) journalObjectOnce(effect);
17679
18052
  effect.active = last.fn !== null;
17680
18053
  effect.deps = last.fn === null ? void 0 : last.args;
17681
18054
  const revision = ++effect.revision;
@@ -18624,8 +18997,8 @@ function replaceSharedBlockBoundary(parent, oldStart, oldEnd, newStart, newEnd)
18624
18997
  if (oldStart === null || oldEnd === null) return;
18625
18998
  let block = parent;
18626
18999
  while (block !== null && block.startMarker === oldStart && block.endMarker === oldEnd) {
18627
- journalRootProperty(block, "startMarker");
18628
- journalRootProperty(block, "endMarker");
19000
+ journalRootProperty(block, "startMarker", block.startMarker);
19001
+ journalRootProperty(block, "endMarker", block.endMarker);
18629
19002
  block.startMarker = newStart;
18630
19003
  block.endMarker = newEnd;
18631
19004
  block = block.parentBlock;
@@ -18691,7 +19064,7 @@ function renderBranchSlot(parentScope, slotKey, state, domParent, next, body, ma
18691
19064
  }
18692
19065
  const liveEnd = provisionalAfter === null && state.start === null && state.block !== null && state.block.endMarker !== null ? state.block.endMarker : state.end;
18693
19066
  const rootTransaction = ROOT_RENDER_TRANSACTION;
18694
- if (rootTransaction !== null && !committedSuspense && hydration === null && state.block !== null && state.block.mounted && !rootTransaction.created?.has(state.block)) {
19067
+ if (rootTransaction !== null && !committedSuspense && hydration === null && state.block !== null && state.block.mounted && !isCreatedInRootRender(rootTransaction, state.block)) {
18695
19068
  const oldBlock2 = state.block;
18696
19069
  const oldStart = oldBlock2.startMarker;
18697
19070
  const oldEnd = oldBlock2.endMarker;
@@ -18752,7 +19125,7 @@ function renderBranchSlot(parentScope, slotKey, state, domParent, next, body, ma
18752
19125
  if (!borrowed) {
18753
19126
  replaceSharedBlockBoundary(parentBlock, oldStart, oldEnd, r.wip.start, r.wip.end);
18754
19127
  }
18755
- journalRootProperty(r.wip.block, "exclusiveMarkers");
19128
+ journalRootProperty(r.wip.block, "exclusiveMarkers", r.wip.block.exclusiveMarkers);
18756
19129
  r.wip.block.exclusiveMarkers = true;
18757
19130
  spliceWipCapture(r.wip);
18758
19131
  deferRootReplacement(oldBlock2, domParent, first, last);
@@ -18932,8 +19305,8 @@ function renderBranchSlot(parentScope, slotKey, state, domParent, next, body, ma
18932
19305
  replaceSharedBlockBoundary(parentBlock, oldBlockStart, oldBlockEnd, s, e);
18933
19306
  }
18934
19307
  } else if (state.block) {
18935
- if (state.block.body !== body) journalRootProperty(state.block, "body");
18936
- if (state.block.extra !== env) journalRootProperty(state.block, "extra");
19308
+ if (state.block.body !== body) journalRootProperty(state.block, "body", state.block.body);
19309
+ if (state.block.extra !== env) journalRootProperty(state.block, "extra", state.block.extra);
18937
19310
  state.block.body = body;
18938
19311
  state.block.extra = env;
18939
19312
  renderBlock(state.block);
@@ -19639,7 +20012,8 @@ function forBlock(parentScope, slotKey, domParent, inputItems, getKey, itemBody,
19639
20012
  registerSlot(parentScope, state);
19640
20013
  }
19641
20014
  const serverMarkerState = hydration?.markerState(state.start) ?? -1;
19642
- if (state.env !== deps) journalRootProperty(state, "env");
20015
+ if (ROOT_RENDER_TRANSACTION !== null && state.env !== deps)
20016
+ journalRootProperty(state, "env", state.env);
19643
20017
  state.env = deps;
19644
20018
  const isEmpty = items.length === 0;
19645
20019
  if (isEmpty && emptyBody) {
@@ -19647,8 +20021,10 @@ function forBlock(parentScope, slotKey, domParent, inputItems, getKey, itemBody,
19647
20021
  reconcileKeyed(parentBlock, state, items, getKey, itemBody, false, false);
19648
20022
  }
19649
20023
  if (state.emptyBlock) {
19650
- if (state.emptyBlock.body !== emptyBody) journalRootProperty(state.emptyBlock, "body");
19651
- if (state.emptyBlock.extra !== state.env) journalRootProperty(state.emptyBlock, "extra");
20024
+ if (state.emptyBlock.body !== emptyBody)
20025
+ journalRootProperty(state.emptyBlock, "body", state.emptyBlock.body);
20026
+ if (state.emptyBlock.extra !== state.env)
20027
+ journalRootProperty(state.emptyBlock, "extra", state.emptyBlock.extra);
19652
20028
  state.emptyBlock.body = emptyBody;
19653
20029
  state.emptyBlock.extra = state.env;
19654
20030
  renderBlock(state.emptyBlock);
@@ -19687,7 +20063,7 @@ function forBlock(parentScope, slotKey, domParent, inputItems, getKey, itemBody,
19687
20063
  if (state.emptyBlock) {
19688
20064
  if (itemRemovalDefers()) {
19689
20065
  journalForSlot(state);
19690
- parkItemForHold(state.emptyBlock);
20066
+ parkItemForHold(state.emptyBlock, state);
19691
20067
  } else unmountBlock(state.emptyBlock);
19692
20068
  state.emptyBlock = null;
19693
20069
  }
@@ -19713,7 +20089,8 @@ function forBlock(parentScope, slotKey, domParent, inputItems, getKey, itemBody,
19713
20089
  } else {
19714
20090
  lite = !requiresScope;
19715
20091
  }
19716
- if (state.cachedDeps !== deps) journalRootProperty(state, "cachedDeps");
20092
+ if (ROOT_RENDER_TRANSACTION !== null && state.cachedDeps !== deps)
20093
+ journalRootProperty(state, "cachedDeps", state.cachedDeps);
19717
20094
  state.cachedDeps = deps;
19718
20095
  }
19719
20096
  }
@@ -19781,7 +20158,8 @@ function keyedForBlock(parentScope, slotKey, domParent, items, getKey, itemBody,
19781
20158
  );
19782
20159
  if (TRANSITION_JOURNAL === null || ROOT_RENDER_TRANSACTION !== null) {
19783
20160
  const rendered = parentScope.slots[slotKey];
19784
- if (rendered.selectionItems !== items) journalRootProperty(rendered, "selectionItems");
20161
+ if (rendered.selectionItems !== items)
20162
+ journalRootProperty(rendered, "selectionItems", rendered.selectionItems);
19785
20163
  rendered.selectionItems = items;
19786
20164
  }
19787
20165
  }
@@ -19801,14 +20179,16 @@ function mountFastHostItems(parentScope, state, parentNode, items, getKey, itemB
19801
20179
  let previous = null;
19802
20180
  let current = null;
19803
20181
  if (TRANSITION_JOURNAL !== null) journalForSlot(state);
19804
- if (state.env !== deps) journalRootProperty(state, "env");
20182
+ if (ROOT_RENDER_TRANSACTION !== null && state.env !== deps)
20183
+ journalRootProperty(state, "env", state.env);
19805
20184
  state.env = deps;
19806
20185
  if (((flags || 0) & 4) !== 0 && deps !== void 0) {
19807
- if (state.cachedDeps !== deps) journalRootProperty(state, "cachedDeps");
20186
+ if (ROOT_RENDER_TRANSACTION !== null && state.cachedDeps !== deps)
20187
+ journalRootProperty(state, "cachedDeps", state.cachedDeps);
19808
20188
  state.cachedDeps = deps;
19809
20189
  }
19810
20190
  if (mapped) {
19811
- if (state.mappedNative !== true) journalRootProperty(state, "mappedNative");
20191
+ if (state.mappedNative !== true) journalRootProperty(state, "mappedNative", state.mappedNative);
19812
20192
  state.mappedNative = true;
19813
20193
  }
19814
20194
  try {
@@ -19918,7 +20298,8 @@ function fastKeyedForBlock(parentScope, slotKey, domParent, items, getKey, itemB
19918
20298
  return;
19919
20299
  }
19920
20300
  mountFastHostItems(parentScope, state, parent, items, getKey, itemBody, flags, deps, false);
19921
- if (state.selectionItems !== items) journalRootProperty(state, "selectionItems");
20301
+ if (state.selectionItems !== items)
20302
+ journalRootProperty(state, "selectionItems", state.selectionItems);
19922
20303
  state.selectionItems = items;
19923
20304
  }
19924
20305
  function fastMapSlot(scopeOrItems, slotOrMethod, domParent, items, method, native, callback, getKey, itemBody, flags, deps, anchor, ownEnd) {
@@ -19995,8 +20376,10 @@ function tryUpdateKeyedSelection(state, items, itemBody, previousDeps, deps, sel
19995
20376
  }
19996
20377
  const previous = previousDeps[selectionIndex];
19997
20378
  const next = deps[selectionIndex];
19998
- if (state.cachedDeps !== deps) journalRootProperty(state, "cachedDeps");
19999
- if (state.env !== deps) journalRootProperty(state, "env");
20379
+ if (ROOT_RENDER_TRANSACTION !== null && state.cachedDeps !== deps)
20380
+ journalRootProperty(state, "cachedDeps", state.cachedDeps);
20381
+ if (ROOT_RENDER_TRANSACTION !== null && state.env !== deps)
20382
+ journalRootProperty(state, "env", state.env);
20000
20383
  state.cachedDeps = deps;
20001
20384
  state.env = deps;
20002
20385
  if (Object.is(previous, next)) return true;
@@ -20009,8 +20392,8 @@ function tryUpdateKeyedSelection(state, items, itemBody, previousDeps, deps, sel
20009
20392
  second = swap;
20010
20393
  }
20011
20394
  if (first !== void 0) {
20012
- if (first.body !== itemBody) journalRootProperty(first, "body");
20013
- if (first.extra !== deps) journalRootProperty(first, "extra");
20395
+ if (first.body !== itemBody) journalRootProperty(first, "body", first.body);
20396
+ if (first.extra !== deps) journalRootProperty(first, "extra", first.extra);
20014
20397
  first.body = itemBody;
20015
20398
  first.extra = deps;
20016
20399
  if (selectionBody !== void 0 && first._slots === null) {
@@ -20020,8 +20403,8 @@ function tryUpdateKeyedSelection(state, items, itemBody, previousDeps, deps, sel
20020
20403
  }
20021
20404
  }
20022
20405
  if (second !== void 0) {
20023
- if (second.body !== itemBody) journalRootProperty(second, "body");
20024
- if (second.extra !== deps) journalRootProperty(second, "extra");
20406
+ if (second.body !== itemBody) journalRootProperty(second, "body", second.body);
20407
+ if (second.extra !== deps) journalRootProperty(second, "extra", second.extra);
20025
20408
  second.body = itemBody;
20026
20409
  second.extra = deps;
20027
20410
  if (selectionBody !== void 0 && second._slots === null) {
@@ -20053,14 +20436,16 @@ const MAX_KEYED_REORDER_SCRATCH = 16384;
20053
20436
  let keyedReorderSources = null;
20054
20437
  let keyedLisPredecessors = null;
20055
20438
  function updateSurvivor(block, newItem, newIdx, itemBody, pure, lite, indexIndependent, env) {
20056
- if (block.itemIndex !== newIdx) journalRootProperty(block, "itemIndex");
20057
- if (block.body !== itemBody) journalRootProperty(block, "body");
20439
+ const journal = ROOT_RENDER_TRANSACTION !== null && !ROOT_RENDER_ROLLBACK;
20440
+ if (journal && block.itemIndex !== newIdx)
20441
+ journalRootProperty(block, "itemIndex", block.itemIndex);
20442
+ if (journal && block.body !== itemBody) journalRootProperty(block, "body", block.body);
20058
20443
  if (pure && block.props === newItem && (indexIndependent || block.itemIndex === newIdx)) {
20059
20444
  block.itemIndex = newIdx;
20060
20445
  block.body = itemBody;
20061
20446
  } else {
20062
- if (block.props !== newItem) journalRootProperty(block, "props");
20063
- if (block.extra !== env) journalRootProperty(block, "extra");
20447
+ if (journal && block.props !== newItem) journalRootProperty(block, "props", block.props);
20448
+ if (journal && block.extra !== env) journalRootProperty(block, "extra", block.extra);
20064
20449
  block.props = newItem;
20065
20450
  block.body = itemBody;
20066
20451
  block.itemIndex = newIdx;
@@ -20101,7 +20486,6 @@ function mountItemsLinear(parentBlock, state, items, getKey, itemBody, singleRoo
20101
20486
  const adopt = state.adopt;
20102
20487
  let adoptIndex = 0;
20103
20488
  let prev = null;
20104
- const mounted = [];
20105
20489
  try {
20106
20490
  for (let i = 0; i < newLen; i++) {
20107
20491
  const item = items[i];
@@ -20129,7 +20513,6 @@ function mountItemsLinear(parentBlock, state, items, getKey, itemBody, singleRoo
20129
20513
  ssrMarkerless,
20130
20514
  adoptNode
20131
20515
  );
20132
- mounted.push(block);
20133
20516
  oldItems.set(key, block);
20134
20517
  block.key = key;
20135
20518
  block.prevSibling = prev;
@@ -20141,8 +20524,9 @@ function mountItemsLinear(parentBlock, state, items, getKey, itemBody, singleRoo
20141
20524
  state.tail = prev;
20142
20525
  state.size = newLen;
20143
20526
  } catch (error) {
20144
- for (let i = mounted.length - 1; i >= 0; i--) {
20145
- const block = mounted[i];
20527
+ while (prev !== null) {
20528
+ const block = prev;
20529
+ prev = block.prevSibling;
20146
20530
  oldItems.delete(block.key);
20147
20531
  if (isSuspenseException(error)) retainDiscardedWarmMemos(block);
20148
20532
  unmountBlock(block, !ROOT_RENDER_TRANSACTION?.retainedCreated?.has(block));
@@ -20524,7 +20908,7 @@ function deferRootOwnedListClear(state, certified = false) {
20524
20908
  newlyRetired.push(block);
20525
20909
  }
20526
20910
  if (block.pending) {
20527
- journalRootProperty(block, "pending");
20911
+ journalRootProperty(block, "pending", block.pending);
20528
20912
  block.pending = false;
20529
20913
  }
20530
20914
  }
@@ -21443,7 +21827,8 @@ function makeRoot(container, rootBlock, currentBody, currentKey, idState, output
21443
21827
  const block = rootBlock;
21444
21828
  renderOwner.request = (renderMode) => {
21445
21829
  renderOwner.transaction.rootRequest = true;
21446
- if (block.props !== props) journalRootProperty(block, "props");
21830
+ const previousProps = block.props;
21831
+ if (previousProps !== props) journalRootProperty(block, "props", previousProps);
21447
21832
  block.props = props;
21448
21833
  block.pendingMode = renderMode;
21449
21834
  renderBlock(block);
@@ -21463,7 +21848,7 @@ function makeRoot(container, rootBlock, currentBody, currentKey, idState, output
21463
21848
  const previousRoot = rootBlock;
21464
21849
  const previousBody = currentBody;
21465
21850
  const previousKey = currentKey;
21466
- const staged = container.nodeType !== 9 && previousRoot !== null && previousRoot.mounted && !previousRoot.disposed && !renderOwner.transaction.created?.has(previousRoot);
21851
+ const staged = container.nodeType !== 9 && previousRoot !== null && previousRoot.mounted && !previousRoot.disposed && !isCreatedInRootRender(renderOwner.transaction, previousRoot);
21467
21852
  const oldFirst = staged ? container.firstChild : null;
21468
21853
  const oldLast = staged ? container.lastChild : null;
21469
21854
  journalUndo(() => {
@@ -21807,7 +22192,7 @@ function hydrateRoot(container, bodyOrElement, propsOrOptions, rootOptions) {
21807
22192
  owner.transaction.rootRequest = true;
21808
22193
  owner.transaction.hydrating = true;
21809
22194
  createdInRootRender(rootBlock);
21810
- journalRootProperty(idState, "next");
22195
+ journalRootProperty(idState, "next", idState.next);
21811
22196
  idState.next = 0;
21812
22197
  let firstNode = container.firstChild;
21813
22198
  while (firstNode !== null && (firstNode.nodeType === 10 || isRendererHydrationStyle(firstNode)))
@@ -22398,6 +22783,7 @@ function scriptResource(attrs) {
22398
22783
  queueRefAttach,
22399
22784
  queueRefDetach,
22400
22785
  readContextFromScope,
22786
+ registerWarmPlan,
22401
22787
  renderBlock,
22402
22788
  renderClientContextProvider,
22403
22789
  replaceRef,
@@ -22453,6 +22839,8 @@ function scriptResource(attrs) {
22453
22839
  textHoleUpdate,
22454
22840
  textSlot,
22455
22841
  tryBlock,
22842
+ updateFreshClassAttr,
22843
+ updateFreshClassName,
22456
22844
  use,
22457
22845
  useActionState,
22458
22846
  useBatch,