@fictjs/runtime 0.8.0 → 0.10.0

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.
Files changed (86) hide show
  1. package/README.md +46 -0
  2. package/dist/advanced.cjs +9 -9
  3. package/dist/advanced.d.cts +5 -5
  4. package/dist/advanced.d.ts +5 -5
  5. package/dist/advanced.js +4 -4
  6. package/dist/{effect-DAzpH7Mm.d.ts → binding-DUEukRxl.d.cts} +35 -24
  7. package/dist/{effect-DAzpH7Mm.d.cts → binding-DqxS9ZQf.d.ts} +35 -24
  8. package/dist/{chunk-WRU3IZOA.js → chunk-2JRPPCG7.js} +3 -3
  9. package/dist/{chunk-TLDT76RV.js → chunk-DKA2I6ET.js} +3 -3
  10. package/dist/{chunk-FSCBL7RI.cjs → chunk-EQ5E4WOV.cjs} +702 -534
  11. package/dist/chunk-EQ5E4WOV.cjs.map +1 -0
  12. package/dist/{chunk-7YQK3XKY.js → chunk-F4RVNXOL.js} +687 -519
  13. package/dist/chunk-F4RVNXOL.js.map +1 -0
  14. package/dist/{chunk-PRF4QG73.cjs → chunk-I4GKKAAY.cjs} +469 -248
  15. package/dist/chunk-I4GKKAAY.cjs.map +1 -0
  16. package/dist/{chunk-HHDHQGJY.cjs → chunk-K3DH5SD5.cjs} +17 -17
  17. package/dist/{chunk-HHDHQGJY.cjs.map → chunk-K3DH5SD5.cjs.map} +1 -1
  18. package/dist/chunk-P4TZLFV6.js +768 -0
  19. package/dist/chunk-P4TZLFV6.js.map +1 -0
  20. package/dist/{chunk-4LCHQ7U4.js → chunk-R6FINS25.js} +318 -97
  21. package/dist/chunk-R6FINS25.js.map +1 -0
  22. package/dist/chunk-SZLJCQFZ.cjs +768 -0
  23. package/dist/chunk-SZLJCQFZ.cjs.map +1 -0
  24. package/dist/{chunk-CEV6TO5U.cjs → chunk-V7BC64W2.cjs} +8 -8
  25. package/dist/{chunk-CEV6TO5U.cjs.map → chunk-V7BC64W2.cjs.map} +1 -1
  26. package/dist/{context-BFbHf9nC.d.cts → devtools-C4Hgfa-S.d.ts} +47 -35
  27. package/dist/{context-C4vBQbb4.d.ts → devtools-CMxlJUTx.d.cts} +47 -35
  28. package/dist/index.cjs +42 -42
  29. package/dist/index.d.cts +5 -5
  30. package/dist/index.d.ts +5 -5
  31. package/dist/index.dev.js +233 -28
  32. package/dist/index.dev.js.map +1 -1
  33. package/dist/index.js +3 -3
  34. package/dist/internal-list.cjs +12 -0
  35. package/dist/internal-list.cjs.map +1 -0
  36. package/dist/internal-list.d.cts +2 -0
  37. package/dist/internal-list.d.ts +2 -0
  38. package/dist/internal-list.js +12 -0
  39. package/dist/internal-list.js.map +1 -0
  40. package/dist/internal.cjs +6 -746
  41. package/dist/internal.cjs.map +1 -1
  42. package/dist/internal.d.cts +7 -75
  43. package/dist/internal.d.ts +7 -75
  44. package/dist/internal.js +12 -752
  45. package/dist/internal.js.map +1 -1
  46. package/dist/jsx-dev-runtime.d.cts +671 -0
  47. package/dist/jsx-dev-runtime.d.ts +671 -0
  48. package/dist/jsx-runtime.d.cts +671 -0
  49. package/dist/jsx-runtime.d.ts +671 -0
  50. package/dist/list-BBzsJhrm.d.ts +71 -0
  51. package/dist/list-_NJCcjl1.d.cts +71 -0
  52. package/dist/loader.cjs +99 -16
  53. package/dist/loader.cjs.map +1 -1
  54. package/dist/loader.d.cts +17 -3
  55. package/dist/loader.d.ts +17 -3
  56. package/dist/loader.js +92 -9
  57. package/dist/loader.js.map +1 -1
  58. package/dist/{props-84UJeWO8.d.cts → props--zJ4ebbT.d.cts} +3 -3
  59. package/dist/{props-BRhFK50f.d.ts → props-BAGR7j-j.d.ts} +3 -3
  60. package/dist/{resume-i-A3EFox.d.cts → resume-C5IKAIdh.d.ts} +5 -3
  61. package/dist/{resume-CqeQ3v_q.d.ts → resume-DPZxmA95.d.cts} +5 -3
  62. package/dist/{scope-D3DpsfoG.d.ts → scope-CuImnvh1.d.ts} +1 -1
  63. package/dist/{scope-DlCBL1Ft.d.cts → scope-Dq5hOu7c.d.cts} +1 -1
  64. package/dist/{signal-C4ISF17w.d.cts → signal-Z4KkDk9h.d.cts} +12 -1
  65. package/dist/{signal-C4ISF17w.d.ts → signal-Z4KkDk9h.d.ts} +12 -1
  66. package/package.json +9 -2
  67. package/src/binding.ts +113 -36
  68. package/src/cycle-guard.ts +3 -3
  69. package/src/devtools.ts +19 -2
  70. package/src/dom.ts +58 -4
  71. package/src/effect.ts +5 -5
  72. package/src/hooks.ts +13 -5
  73. package/src/internal/list.ts +7 -0
  74. package/src/internal.ts +1 -0
  75. package/src/lifecycle.ts +41 -3
  76. package/src/list-helpers.ts +1 -1
  77. package/src/loader.ts +128 -12
  78. package/src/resume.ts +6 -3
  79. package/src/signal.ts +200 -20
  80. package/src/transition.ts +9 -3
  81. package/dist/chunk-4LCHQ7U4.js.map +0 -1
  82. package/dist/chunk-7YQK3XKY.js.map +0 -1
  83. package/dist/chunk-FSCBL7RI.cjs.map +0 -1
  84. package/dist/chunk-PRF4QG73.cjs.map +0 -1
  85. /package/dist/{chunk-WRU3IZOA.js.map → chunk-2JRPPCG7.js.map} +0 -0
  86. /package/dist/{chunk-TLDT76RV.js.map → chunk-DKA2I6ET.js.map} +0 -0
@@ -40,7 +40,90 @@
40
40
 
41
41
 
42
42
 
43
- var _chunkFSCBL7RIcjs = require('./chunk-FSCBL7RI.cjs');
43
+ var _chunkEQ5E4WOVcjs = require('./chunk-EQ5E4WOV.cjs');
44
+
45
+ // src/transition.ts
46
+ function startTransition(fn) {
47
+ const prev = _chunkEQ5E4WOVcjs.setTransitionContext.call(void 0, true);
48
+ try {
49
+ fn();
50
+ } finally {
51
+ _chunkEQ5E4WOVcjs.setTransitionContext.call(void 0, prev);
52
+ _chunkEQ5E4WOVcjs.scheduleFlush.call(void 0, );
53
+ }
54
+ }
55
+ function useTransition() {
56
+ const pending = _chunkEQ5E4WOVcjs.signal.call(void 0, false);
57
+ let pendingCount = 0;
58
+ const beginPending = () => {
59
+ pendingCount += 1;
60
+ if (pendingCount === 1) {
61
+ pending(true);
62
+ }
63
+ };
64
+ const endPending = () => {
65
+ if (pendingCount === 0) return;
66
+ pendingCount -= 1;
67
+ if (pendingCount === 0) {
68
+ pending(false);
69
+ }
70
+ };
71
+ const start = (fn) => {
72
+ beginPending();
73
+ let result;
74
+ let thrown;
75
+ let didThrow = false;
76
+ startTransition(() => {
77
+ try {
78
+ result = fn();
79
+ } catch (err) {
80
+ thrown = err;
81
+ didThrow = true;
82
+ }
83
+ });
84
+ if (didThrow) {
85
+ endPending();
86
+ throw thrown;
87
+ }
88
+ if (result && typeof result.then === "function") {
89
+ void Promise.resolve(result).catch((error) => {
90
+ if (typeof console !== "undefined" && typeof console.error === "function") {
91
+ console.error("[fict/transition] Async transition failed.", error);
92
+ }
93
+ }).finally(() => {
94
+ endPending();
95
+ });
96
+ return;
97
+ }
98
+ if (typeof queueMicrotask === "function") {
99
+ queueMicrotask(endPending);
100
+ } else {
101
+ Promise.resolve().then(endPending);
102
+ }
103
+ };
104
+ return [() => pending(), start];
105
+ }
106
+ function useDeferredValue(getValue) {
107
+ const deferredValue = _chunkEQ5E4WOVcjs.signal.call(void 0, getValue());
108
+ _chunkEQ5E4WOVcjs.createEffect.call(void 0, () => {
109
+ const newValue = getValue();
110
+ const currentDeferred = _chunkEQ5E4WOVcjs.untrack.call(void 0, () => deferredValue());
111
+ if (currentDeferred !== newValue) {
112
+ startTransition(() => {
113
+ deferredValue(newValue);
114
+ });
115
+ }
116
+ });
117
+ return () => deferredValue();
118
+ }
119
+
120
+ // src/scheduler.ts
121
+ function batch2(fn) {
122
+ return _chunkEQ5E4WOVcjs.batch.call(void 0, fn);
123
+ }
124
+ function untrack2(fn) {
125
+ return _chunkEQ5E4WOVcjs.untrack.call(void 0, fn);
126
+ }
44
127
 
45
128
  // src/jsx.ts
46
129
  var Fragment = Symbol("Fragment");
@@ -247,85 +330,6 @@ function resolvePath(root, path) {
247
330
  return current;
248
331
  }
249
332
 
250
- // src/transition.ts
251
- function startTransition(fn) {
252
- const prev = _chunkFSCBL7RIcjs.setTransitionContext.call(void 0, true);
253
- try {
254
- fn();
255
- } finally {
256
- _chunkFSCBL7RIcjs.setTransitionContext.call(void 0, prev);
257
- _chunkFSCBL7RIcjs.scheduleFlush.call(void 0, );
258
- }
259
- }
260
- function useTransition() {
261
- const pending = _chunkFSCBL7RIcjs.signal.call(void 0, false);
262
- let pendingCount = 0;
263
- const beginPending = () => {
264
- pendingCount += 1;
265
- if (pendingCount === 1) {
266
- pending(true);
267
- }
268
- };
269
- const endPending = () => {
270
- if (pendingCount === 0) return;
271
- pendingCount -= 1;
272
- if (pendingCount === 0) {
273
- pending(false);
274
- }
275
- };
276
- const start = (fn) => {
277
- beginPending();
278
- let result;
279
- let thrown;
280
- let didThrow = false;
281
- startTransition(() => {
282
- try {
283
- result = fn();
284
- } catch (err) {
285
- thrown = err;
286
- didThrow = true;
287
- }
288
- });
289
- if (didThrow) {
290
- endPending();
291
- throw thrown;
292
- }
293
- if (result && typeof result.then === "function") {
294
- Promise.resolve(result).finally(() => {
295
- endPending();
296
- });
297
- return;
298
- }
299
- if (typeof queueMicrotask === "function") {
300
- queueMicrotask(endPending);
301
- } else {
302
- Promise.resolve().then(endPending);
303
- }
304
- };
305
- return [() => pending(), start];
306
- }
307
- function useDeferredValue(getValue) {
308
- const deferredValue = _chunkFSCBL7RIcjs.signal.call(void 0, getValue());
309
- _chunkFSCBL7RIcjs.createEffect.call(void 0, () => {
310
- const newValue = getValue();
311
- const currentDeferred = _chunkFSCBL7RIcjs.untrack.call(void 0, () => deferredValue());
312
- if (currentDeferred !== newValue) {
313
- startTransition(() => {
314
- deferredValue(newValue);
315
- });
316
- }
317
- });
318
- return () => deferredValue();
319
- }
320
-
321
- // src/scheduler.ts
322
- function batch2(fn) {
323
- return _chunkFSCBL7RIcjs.batch.call(void 0, fn);
324
- }
325
- function untrack2(fn) {
326
- return _chunkFSCBL7RIcjs.untrack.call(void 0, fn);
327
- }
328
-
329
333
  // src/hydration.ts
330
334
  var hydrationStack = [];
331
335
  function withHydration(root, fn) {
@@ -421,14 +425,14 @@ function isExplicitReactiveFn(value) {
421
425
  function isReactive(value) {
422
426
  if (typeof value !== "function") return false;
423
427
  if (isNonReactiveFn(value)) return false;
424
- if (_chunkFSCBL7RIcjs.isSignal.call(void 0, value) || _chunkFSCBL7RIcjs.isComputed.call(void 0, value)) return true;
428
+ if (_chunkEQ5E4WOVcjs.isSignal.call(void 0, value) || _chunkEQ5E4WOVcjs.isComputed.call(void 0, value)) return true;
425
429
  if (isExplicitReactiveFn(value)) return true;
426
- if (_chunkFSCBL7RIcjs.isEffect.call(void 0, value) || _chunkFSCBL7RIcjs.isEffectScope.call(void 0, value)) return false;
430
+ if (_chunkEQ5E4WOVcjs.isEffect.call(void 0, value) || _chunkEQ5E4WOVcjs.isEffectScope.call(void 0, value)) return false;
427
431
  return value.length === 0;
428
432
  }
429
433
  function isStrictlyReactive(value) {
430
434
  if (typeof value !== "function") return false;
431
- return _chunkFSCBL7RIcjs.isSignal.call(void 0, value) || _chunkFSCBL7RIcjs.isComputed.call(void 0, value) || isPropGetterFn(value) || isExplicitReactiveFn(value);
435
+ return _chunkEQ5E4WOVcjs.isSignal.call(void 0, value) || _chunkEQ5E4WOVcjs.isComputed.call(void 0, value) || isPropGetterFn(value) || isExplicitReactiveFn(value);
432
436
  }
433
437
  var PROP_GETTER_MARKER = Symbol.for("fict:prop-getter");
434
438
  function isPropGetterFn(value) {
@@ -491,7 +495,7 @@ function callEventHandler(handler, event, node, data) {
491
495
  function createTextBinding(value) {
492
496
  const text = document.createTextNode("");
493
497
  if (isReactive(value)) {
494
- _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
498
+ _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => {
495
499
  setText(text, value());
496
500
  });
497
501
  } else {
@@ -500,7 +504,7 @@ function createTextBinding(value) {
500
504
  return text;
501
505
  }
502
506
  function bindText(textNode, getValue) {
503
- return _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => setText(textNode, getValue()));
507
+ return _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => setText(textNode, getValue()));
504
508
  }
505
509
  function setText(textNode, value) {
506
510
  const next = formatTextValue(value);
@@ -520,7 +524,7 @@ function formatTextValue(value) {
520
524
  }
521
525
  function createAttributeBinding(el, key, value, setter) {
522
526
  if (isReactive(value)) {
523
- _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
527
+ _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => {
524
528
  setter(el, key, value());
525
529
  });
526
530
  } else {
@@ -528,7 +532,7 @@ function createAttributeBinding(el, key, value, setter) {
528
532
  }
529
533
  }
530
534
  function bindAttribute(el, key, getValue) {
531
- return _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => setAttr(el, key, getValue()));
535
+ return _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => setAttr(el, key, getValue()));
532
536
  }
533
537
  function setAttr(el, key, value) {
534
538
  const cacheTarget = el;
@@ -544,7 +548,7 @@ function setAttr(el, key, value) {
544
548
  }
545
549
  }
546
550
  function bindProperty(el, key, getValue) {
547
- return _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => setProp(el, key, getValue()));
551
+ return _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => setProp(el, key, getValue()));
548
552
  }
549
553
  function setProp(el, key, value) {
550
554
  const cacheTarget = el;
@@ -561,7 +565,7 @@ function setProp(el, key, value) {
561
565
  }
562
566
  function createStyleBinding(el, value) {
563
567
  if (isReactive(value)) {
564
- _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
568
+ _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => {
565
569
  setStyle(el, value());
566
570
  });
567
571
  } else {
@@ -569,7 +573,7 @@ function createStyleBinding(el, value) {
569
573
  }
570
574
  }
571
575
  function bindStyle(el, getValue) {
572
- return _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => setStyle(el, getValue()));
576
+ return _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => setStyle(el, getValue()));
573
577
  }
574
578
  function setStyle(el, value) {
575
579
  const target = el;
@@ -624,7 +628,7 @@ function applyStyle(el, value, prev) {
624
628
  }
625
629
  }
626
630
  }
627
- var isUnitlessStyleProperty = isDev ? (prop2) => _chunkFSCBL7RIcjs.UnitlessStyles.has(prop2) : (prop2) => prop2 === "opacity" || prop2 === "zIndex";
631
+ var isUnitlessStyleProperty = isDev ? (prop2) => _chunkEQ5E4WOVcjs.UnitlessStyles.has(prop2) : (prop2) => prop2 === "opacity" || prop2 === "zIndex";
628
632
  function normalizeStyleProperty(prop2) {
629
633
  const cached = STYLE_PROP_CACHE.get(prop2);
630
634
  if (cached) return cached;
@@ -634,7 +638,7 @@ function normalizeStyleProperty(prop2) {
634
638
  }
635
639
  function createClassBinding(el, value) {
636
640
  if (isReactive(value)) {
637
- _chunkFSCBL7RIcjs.createRenderEffect.call(void 0,
641
+ _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0,
638
642
  () => setClass(el, value())
639
643
  );
640
644
  } else {
@@ -642,7 +646,7 @@ function createClassBinding(el, value) {
642
646
  }
643
647
  }
644
648
  function bindClass(el, getValue) {
645
- return _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => setClass(el, getValue()));
649
+ return _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => setClass(el, getValue()));
646
650
  }
647
651
  function setClass(el, value) {
648
652
  const cache = el;
@@ -703,7 +707,7 @@ function classList(node, value, prev = {}) {
703
707
  return applyClass(node, value, prev);
704
708
  }
705
709
  function insert(parent, getValue, markerOrCreateElement, createElementFn) {
706
- const hostRoot = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
710
+ const hostRoot = _chunkEQ5E4WOVcjs.getCurrentRoot.call(void 0, );
707
711
  let marker;
708
712
  let ownsMarker = false;
709
713
  let createFn = createElementFn;
@@ -742,13 +746,13 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
742
746
  insertNodesBefore(parentNode, [currentText], marker);
743
747
  currentNodes = [currentText];
744
748
  };
745
- const dispose = _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
749
+ const dispose = _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => {
746
750
  const value = getValue();
747
751
  const parentNode = marker.parentNode;
748
752
  const isPrimitive = value == null || value === false || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
749
753
  if (isPrimitive) {
750
754
  if (currentRoot) {
751
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
755
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, currentRoot);
752
756
  currentRoot = null;
753
757
  }
754
758
  if (!parentNode) {
@@ -761,12 +765,12 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
761
765
  return;
762
766
  }
763
767
  if (currentRoot) {
764
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
768
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, currentRoot);
765
769
  currentRoot = null;
766
770
  }
767
771
  clearCurrentNodes();
768
- const root = _chunkFSCBL7RIcjs.createRootContext.call(void 0, hostRoot);
769
- const prev = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root);
772
+ const root = _chunkEQ5E4WOVcjs.createRootContext.call(void 0, hostRoot);
773
+ const prev = _chunkEQ5E4WOVcjs.pushRoot.call(void 0, root);
770
774
  let nodes = [];
771
775
  let handledError = false;
772
776
  try {
@@ -793,28 +797,28 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
793
797
  nodes = toNodeArray(newNode);
794
798
  if (root.suspended) {
795
799
  handledError = true;
796
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
800
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root);
797
801
  return;
798
802
  }
799
803
  if (parentNode) {
800
804
  insertNodesBefore(parentNode, nodes, marker);
801
805
  }
802
806
  } catch (err) {
803
- if (_chunkFSCBL7RIcjs.handleSuspend.call(void 0, err, root)) {
807
+ if (_chunkEQ5E4WOVcjs.handleSuspend.call(void 0, err, root)) {
804
808
  handledError = true;
805
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
809
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root);
806
810
  return;
807
811
  }
808
- if (_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
812
+ if (_chunkEQ5E4WOVcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
809
813
  handledError = true;
810
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
814
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root);
811
815
  return;
812
816
  }
813
817
  throw err;
814
818
  } finally {
815
- _chunkFSCBL7RIcjs.popRoot.call(void 0, prev);
819
+ _chunkEQ5E4WOVcjs.popRoot.call(void 0, prev);
816
820
  if (!handledError) {
817
- _chunkFSCBL7RIcjs.flushOnMount.call(void 0, root);
821
+ _chunkEQ5E4WOVcjs.flushOnMount.call(void 0, root);
818
822
  }
819
823
  }
820
824
  currentRoot = root;
@@ -823,7 +827,7 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
823
827
  return () => {
824
828
  dispose();
825
829
  if (currentRoot) {
826
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
830
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, currentRoot);
827
831
  currentRoot = null;
828
832
  }
829
833
  clearCurrentNodes();
@@ -833,11 +837,11 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
833
837
  };
834
838
  }
835
839
  function insertBetween(start, end, getValue, createElementFn) {
836
- const hostRoot = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
840
+ const hostRoot = _chunkEQ5E4WOVcjs.getCurrentRoot.call(void 0, );
837
841
  let currentNodes = [];
838
842
  let currentText = null;
839
843
  let currentRoot = null;
840
- let initialHydrating = _chunkFSCBL7RIcjs.__fictIsHydrating.call(void 0, );
844
+ let initialHydrating = _chunkEQ5E4WOVcjs.__fictIsHydrating.call(void 0, );
841
845
  const collectBetween = () => {
842
846
  const nodes = [];
843
847
  let cursor = start.nextSibling;
@@ -873,7 +877,7 @@ function insertBetween(start, end, getValue, createElementFn) {
873
877
  currentNodes = [currentText];
874
878
  }
875
879
  };
876
- const dispose = _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
880
+ const dispose = _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => {
877
881
  const value = getValue();
878
882
  const parentNode = start.parentNode;
879
883
  const isPrimitive = value == null || value === false || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
@@ -887,7 +891,7 @@ function insertBetween(start, end, getValue, createElementFn) {
887
891
  }
888
892
  }
889
893
  if (currentRoot) {
890
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
894
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, currentRoot);
891
895
  currentRoot = null;
892
896
  }
893
897
  if (!parentNode) {
@@ -901,12 +905,12 @@ function insertBetween(start, end, getValue, createElementFn) {
901
905
  return;
902
906
  }
903
907
  if (currentRoot) {
904
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
908
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, currentRoot);
905
909
  currentRoot = null;
906
910
  }
907
911
  clearCurrentNodes();
908
- const root = _chunkFSCBL7RIcjs.createRootContext.call(void 0, hostRoot);
909
- const prev = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root);
912
+ const root = _chunkEQ5E4WOVcjs.createRootContext.call(void 0, hostRoot);
913
+ const prev = _chunkEQ5E4WOVcjs.pushRoot.call(void 0, root);
910
914
  let nodes = [];
911
915
  let handledError = false;
912
916
  try {
@@ -940,28 +944,28 @@ function insertBetween(start, end, getValue, createElementFn) {
940
944
  nodes = toNodeArray(newNode);
941
945
  if (root.suspended) {
942
946
  handledError = true;
943
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
947
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root);
944
948
  return;
945
949
  }
946
950
  if (parentNode && !initialHydrating) {
947
951
  insertNodesBefore(parentNode, nodes, end);
948
952
  }
949
953
  } catch (err) {
950
- if (_chunkFSCBL7RIcjs.handleSuspend.call(void 0, err, root)) {
954
+ if (_chunkEQ5E4WOVcjs.handleSuspend.call(void 0, err, root)) {
951
955
  handledError = true;
952
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
956
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root);
953
957
  return;
954
958
  }
955
- if (_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
959
+ if (_chunkEQ5E4WOVcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
956
960
  handledError = true;
957
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
961
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root);
958
962
  return;
959
963
  }
960
964
  throw err;
961
965
  } finally {
962
- _chunkFSCBL7RIcjs.popRoot.call(void 0, prev);
966
+ _chunkEQ5E4WOVcjs.popRoot.call(void 0, prev);
963
967
  if (!handledError) {
964
- _chunkFSCBL7RIcjs.flushOnMount.call(void 0, root);
968
+ _chunkEQ5E4WOVcjs.flushOnMount.call(void 0, root);
965
969
  }
966
970
  }
967
971
  currentRoot = root;
@@ -971,7 +975,7 @@ function insertBetween(start, end, getValue, createElementFn) {
971
975
  return () => {
972
976
  dispose();
973
977
  if (currentRoot) {
974
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
978
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, currentRoot);
975
979
  currentRoot = null;
976
980
  }
977
981
  clearCurrentNodes();
@@ -980,10 +984,10 @@ function insertBetween(start, end, getValue, createElementFn) {
980
984
  function createChildBinding(parent, getValue, createElementFn) {
981
985
  const marker = document.createComment("fict:child");
982
986
  parent.appendChild(marker);
983
- const hostRoot = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
984
- const dispose = _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
985
- const root = _chunkFSCBL7RIcjs.createRootContext.call(void 0, hostRoot);
986
- const prev = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root);
987
+ const hostRoot = _chunkEQ5E4WOVcjs.getCurrentRoot.call(void 0, );
988
+ const dispose = _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => {
989
+ const root = _chunkEQ5E4WOVcjs.createRootContext.call(void 0, hostRoot);
990
+ const prev = _chunkEQ5E4WOVcjs.pushRoot.call(void 0, root);
987
991
  let nodes = [];
988
992
  let handledError = false;
989
993
  try {
@@ -998,25 +1002,25 @@ function createChildBinding(parent, getValue, createElementFn) {
998
1002
  insertNodesBefore(parentNode, nodes, marker);
999
1003
  }
1000
1004
  return () => {
1001
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
1005
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root);
1002
1006
  removeNodes(nodes);
1003
1007
  };
1004
1008
  } catch (err) {
1005
- if (_chunkFSCBL7RIcjs.handleSuspend.call(void 0, err, root)) {
1009
+ if (_chunkEQ5E4WOVcjs.handleSuspend.call(void 0, err, root)) {
1006
1010
  handledError = true;
1007
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
1011
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root);
1008
1012
  return;
1009
1013
  }
1010
- if (_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
1014
+ if (_chunkEQ5E4WOVcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
1011
1015
  handledError = true;
1012
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
1016
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root);
1013
1017
  return;
1014
1018
  }
1015
1019
  throw err;
1016
1020
  } finally {
1017
- _chunkFSCBL7RIcjs.popRoot.call(void 0, prev);
1021
+ _chunkEQ5E4WOVcjs.popRoot.call(void 0, prev);
1018
1022
  if (!handledError) {
1019
- _chunkFSCBL7RIcjs.flushOnMount.call(void 0, root);
1023
+ _chunkEQ5E4WOVcjs.flushOnMount.call(void 0, root);
1020
1024
  }
1021
1025
  }
1022
1026
  });
@@ -1029,7 +1033,7 @@ function createChildBinding(parent, getValue, createElementFn) {
1029
1033
  };
1030
1034
  }
1031
1035
  function delegateEvents(eventNames, doc = window.document) {
1032
- const e = doc[_chunkFSCBL7RIcjs.$$EVENTS] || (doc[_chunkFSCBL7RIcjs.$$EVENTS] = /* @__PURE__ */ new Set());
1036
+ const e = doc[_chunkEQ5E4WOVcjs.$$EVENTS] || (doc[_chunkEQ5E4WOVcjs.$$EVENTS] = /* @__PURE__ */ new Set());
1033
1037
  for (let i = 0, l = eventNames.length; i < l; i++) {
1034
1038
  const name = eventNames[i];
1035
1039
  if (!e.has(name)) {
@@ -1039,12 +1043,12 @@ function delegateEvents(eventNames, doc = window.document) {
1039
1043
  }
1040
1044
  }
1041
1045
  function clearDelegatedEvents(doc = window.document) {
1042
- const e = doc[_chunkFSCBL7RIcjs.$$EVENTS];
1046
+ const e = doc[_chunkEQ5E4WOVcjs.$$EVENTS];
1043
1047
  if (e) {
1044
1048
  for (const name of e.keys()) {
1045
1049
  doc.removeEventListener(name, globalEventHandler);
1046
1050
  }
1047
- delete doc[_chunkFSCBL7RIcjs.$$EVENTS];
1051
+ delete doc[_chunkEQ5E4WOVcjs.$$EVENTS];
1048
1052
  }
1049
1053
  }
1050
1054
  function globalEventHandler(e) {
@@ -1157,8 +1161,8 @@ function addEventListener(node, name, handler, delegate) {
1157
1161
  function bindEvent(el, eventName, handler, options) {
1158
1162
  if (handler == null) return () => {
1159
1163
  };
1160
- const rootRef = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
1161
- const shouldDelegate = options == null && _chunkFSCBL7RIcjs.DelegatedEvents.has(eventName);
1164
+ const rootRef = _chunkEQ5E4WOVcjs.getCurrentRoot.call(void 0, );
1165
+ const shouldDelegate = options == null && _chunkEQ5E4WOVcjs.DelegatedEvents.has(eventName);
1162
1166
  if (shouldDelegate) {
1163
1167
  const key = `$$${eventName}`;
1164
1168
  delegateEvents([eventName]);
@@ -1168,7 +1172,7 @@ function bindEvent(el, eventName, handler, options) {
1168
1172
  const fn = resolveHandler();
1169
1173
  callEventHandler(fn, args[0], el);
1170
1174
  } catch (err) {
1171
- if (!_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "event", eventName }, rootRef)) {
1175
+ if (!_chunkEQ5E4WOVcjs.handleError.call(void 0, err, { source: "event", eventName }, rootRef)) {
1172
1176
  throw err;
1173
1177
  }
1174
1178
  }
@@ -1183,7 +1187,7 @@ function bindEvent(el, eventName, handler, options) {
1183
1187
  const resolved = getHandler();
1184
1188
  callEventHandler(resolved, event, el);
1185
1189
  } catch (err) {
1186
- if (_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "event", eventName }, rootRef)) {
1190
+ if (_chunkEQ5E4WOVcjs.handleError.call(void 0, err, { source: "event", eventName }, rootRef)) {
1187
1191
  return;
1188
1192
  }
1189
1193
  throw err;
@@ -1191,7 +1195,7 @@ function bindEvent(el, eventName, handler, options) {
1191
1195
  };
1192
1196
  el.addEventListener(eventName, wrapped, options);
1193
1197
  const cleanup = () => el.removeEventListener(eventName, wrapped, options);
1194
- _chunkFSCBL7RIcjs.registerRootCleanup.call(void 0, cleanup);
1198
+ _chunkEQ5E4WOVcjs.registerRootCleanup.call(void 0, cleanup);
1195
1199
  return cleanup;
1196
1200
  }
1197
1201
  function bindRef(el, ref) {
@@ -1211,11 +1215,11 @@ function bindRef(el, ref) {
1211
1215
  const initialRef = getRef();
1212
1216
  applyRef2(initialRef);
1213
1217
  if (isReactive(ref)) {
1214
- const cleanup2 = _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
1218
+ const cleanup2 = _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => {
1215
1219
  const currentRef = getRef();
1216
1220
  applyRef2(currentRef);
1217
1221
  });
1218
- _chunkFSCBL7RIcjs.registerRootCleanup.call(void 0, cleanup2);
1222
+ _chunkEQ5E4WOVcjs.registerRootCleanup.call(void 0, cleanup2);
1219
1223
  const nullifyCleanup = () => {
1220
1224
  const currentRef = getRef();
1221
1225
  if (currentRef && typeof currentRef === "object" && "current" in currentRef) {
@@ -1223,7 +1227,7 @@ function bindRef(el, ref) {
1223
1227
  currentRef.current = null;
1224
1228
  }
1225
1229
  };
1226
- _chunkFSCBL7RIcjs.registerRootCleanup.call(void 0, nullifyCleanup);
1230
+ _chunkEQ5E4WOVcjs.registerRootCleanup.call(void 0, nullifyCleanup);
1227
1231
  return () => {
1228
1232
  cleanup2();
1229
1233
  nullifyCleanup();
@@ -1236,23 +1240,23 @@ function bindRef(el, ref) {
1236
1240
  refValue.current = null;
1237
1241
  }
1238
1242
  };
1239
- _chunkFSCBL7RIcjs.registerRootCleanup.call(void 0, cleanup);
1243
+ _chunkEQ5E4WOVcjs.registerRootCleanup.call(void 0, cleanup);
1240
1244
  return cleanup;
1241
1245
  }
1242
1246
  function spread(node, props = {}, isSVG = false, skipChildren = false) {
1243
1247
  const prevProps = {};
1244
1248
  if (!skipChildren && "children" in props) {
1245
- _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
1249
+ _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => {
1246
1250
  prevProps.children = props.children;
1247
1251
  });
1248
1252
  }
1249
- _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
1253
+ _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => {
1250
1254
  if (typeof props.ref === "function") {
1251
1255
  ;
1252
1256
  props.ref(node);
1253
1257
  }
1254
1258
  });
1255
- _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
1259
+ _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => {
1256
1260
  assign(node, props, isSVG, true, prevProps, true);
1257
1261
  });
1258
1262
  return prevProps;
@@ -1310,7 +1314,7 @@ function assignProp(node, prop2, value, prev, isSVG, skipRef, props) {
1310
1314
  }
1311
1315
  if (prop2.slice(0, 2) === "on") {
1312
1316
  const eventName = prop2.slice(2).toLowerCase();
1313
- const shouldDelegate = _chunkFSCBL7RIcjs.DelegatedEvents.has(eventName);
1317
+ const shouldDelegate = _chunkEQ5E4WOVcjs.DelegatedEvents.has(eventName);
1314
1318
  if (!shouldDelegate && prev) {
1315
1319
  const handler = Array.isArray(prev) ? prev[0] : prev;
1316
1320
  node.removeEventListener(eventName, handler);
@@ -1343,9 +1347,9 @@ function assignProp(node, prop2, value, prev, isSVG, skipRef, props) {
1343
1347
  }
1344
1348
  const isCE = node.nodeName.includes("-") || "is" in props;
1345
1349
  if (!isSVG) {
1346
- const propAlias = isDev ? _chunkFSCBL7RIcjs.getPropAlias.call(void 0, prop2, node.tagName) : void 0;
1347
- const isProperty = isDev ? _chunkFSCBL7RIcjs.Properties.has(prop2) : prop2 in node;
1348
- const isChildProp = isDev ? _chunkFSCBL7RIcjs.ChildProperties.has(prop2) : prop2 === "innerHTML" || prop2 === "textContent" || prop2 === "innerText" || prop2 === "children";
1350
+ const propAlias = isDev ? _chunkEQ5E4WOVcjs.getPropAlias.call(void 0, prop2, node.tagName) : void 0;
1351
+ const isProperty = isDev ? _chunkEQ5E4WOVcjs.Properties.has(prop2) : prop2 in node;
1352
+ const isChildProp = isDev ? _chunkEQ5E4WOVcjs.ChildProperties.has(prop2) : prop2 === "innerHTML" || prop2 === "textContent" || prop2 === "innerText" || prop2 === "children";
1349
1353
  if (propAlias || isProperty || isChildProp || isCE) {
1350
1354
  const propName = propAlias || prop2;
1351
1355
  if (isCE && !isProperty && !isChildProp && !propAlias) {
@@ -1360,7 +1364,7 @@ function assignProp(node, prop2, value, prev, isSVG, skipRef, props) {
1360
1364
  }
1361
1365
  if (isSVG && prop2.indexOf(":") > -1) {
1362
1366
  const [prefix, name] = prop2.split(":");
1363
- const ns = _chunkFSCBL7RIcjs.SVGNamespace[prefix];
1367
+ const ns = _chunkEQ5E4WOVcjs.SVGNamespace[prefix];
1364
1368
  if (ns) {
1365
1369
  if (value == null) node.removeAttributeNS(ns, name);
1366
1370
  else node.setAttributeNS(ns, name, String(value));
@@ -1375,7 +1379,8 @@ function assignProp(node, prop2, value, prev, isSVG, skipRef, props) {
1375
1379
  function toPropertyName(name) {
1376
1380
  return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());
1377
1381
  }
1378
- function createConditional(condition, renderTrue, createElementFn, renderFalse, startOverride, endOverride) {
1382
+ function createConditional(condition, renderTrue, createElementFn, renderFalse, startOverride, endOverride, options) {
1383
+ const trackBranchReads = _optionalChain([options, 'optionalAccess', _13 => _13.trackBranchReads]) === true;
1379
1384
  const useProvided = !!(startOverride && endOverride);
1380
1385
  const startMarker = useProvided ? startOverride : document.createComment("fict:cond:start");
1381
1386
  const endMarker = useProvided ? endOverride : document.createComment("fict:cond:end");
@@ -1384,12 +1389,12 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1384
1389
  ;
1385
1390
  fragment.append(startMarker, endMarker);
1386
1391
  }
1387
- const hostRoot = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
1392
+ const hostRoot = _chunkEQ5E4WOVcjs.getCurrentRoot.call(void 0, );
1388
1393
  let currentNodes = [];
1389
1394
  let currentRoot = null;
1390
1395
  let lastCondition = void 0;
1391
1396
  let pendingRender = false;
1392
- let initialHydrating = _chunkFSCBL7RIcjs.__fictIsHydrating.call(void 0, );
1397
+ let initialHydrating = _chunkEQ5E4WOVcjs.__fictIsHydrating.call(void 0, );
1393
1398
  const collectBetween = () => {
1394
1399
  const nodes = [];
1395
1400
  let cursor = startMarker.nextSibling;
@@ -1399,7 +1404,7 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1399
1404
  }
1400
1405
  return nodes;
1401
1406
  };
1402
- const conditionMemo = _chunkFSCBL7RIcjs.computed.call(void 0, condition);
1407
+ const conditionMemo = _chunkEQ5E4WOVcjs.computed.call(void 0, condition);
1403
1408
  const runConditional = () => {
1404
1409
  const cond = conditionMemo();
1405
1410
  const parent = startMarker.parentNode;
@@ -1416,8 +1421,8 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1416
1421
  currentNodes = collectBetween();
1417
1422
  return;
1418
1423
  }
1419
- const root2 = _chunkFSCBL7RIcjs.createRootContext.call(void 0, hostRoot);
1420
- const prev2 = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root2);
1424
+ const root2 = _chunkEQ5E4WOVcjs.createRootContext.call(void 0, hostRoot);
1425
+ const prev2 = _chunkEQ5E4WOVcjs.pushRoot.call(void 0, root2);
1421
1426
  let handledError2 = false;
1422
1427
  try {
1423
1428
  withHydrationRange(
@@ -1425,7 +1430,7 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1425
1430
  endMarker,
1426
1431
  _nullishCoalesce(parent.ownerDocument, () => ( document)),
1427
1432
  () => {
1428
- const output = _chunkFSCBL7RIcjs.untrack.call(void 0, render3);
1433
+ const output = trackBranchReads ? render3() : _chunkEQ5E4WOVcjs.untrack.call(void 0, render3);
1429
1434
  if (output == null || output === false) {
1430
1435
  return;
1431
1436
  }
@@ -1434,21 +1439,21 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1434
1439
  );
1435
1440
  currentNodes = collectBetween();
1436
1441
  } catch (err) {
1437
- if (_chunkFSCBL7RIcjs.handleSuspend.call(void 0, err, root2)) {
1442
+ if (_chunkEQ5E4WOVcjs.handleSuspend.call(void 0, err, root2)) {
1438
1443
  handledError2 = true;
1439
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root2);
1444
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root2);
1440
1445
  return;
1441
1446
  }
1442
- if (_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "renderChild" }, root2)) {
1447
+ if (_chunkEQ5E4WOVcjs.handleError.call(void 0, err, { source: "renderChild" }, root2)) {
1443
1448
  handledError2 = true;
1444
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root2);
1449
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root2);
1445
1450
  return;
1446
1451
  }
1447
1452
  throw err;
1448
1453
  } finally {
1449
- _chunkFSCBL7RIcjs.popRoot.call(void 0, prev2);
1454
+ _chunkEQ5E4WOVcjs.popRoot.call(void 0, prev2);
1450
1455
  if (!handledError2) {
1451
- _chunkFSCBL7RIcjs.flushOnMount.call(void 0, root2);
1456
+ _chunkEQ5E4WOVcjs.flushOnMount.call(void 0, root2);
1452
1457
  currentRoot = root2;
1453
1458
  } else {
1454
1459
  currentRoot = null;
@@ -1456,15 +1461,101 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1456
1461
  }
1457
1462
  return;
1458
1463
  }
1459
- if (lastCondition === cond && currentNodes.length > 0) {
1460
- return;
1461
- }
1462
- if (lastCondition === cond && lastCondition === false && renderFalse === void 0) {
1464
+ if (!trackBranchReads) {
1465
+ if (lastCondition === cond && currentNodes.length > 0) {
1466
+ return;
1467
+ }
1468
+ if (lastCondition === cond && lastCondition === false && renderFalse === void 0) {
1469
+ return;
1470
+ }
1471
+ } else if (lastCondition === cond) {
1472
+ const render3 = cond ? renderTrue : renderFalse;
1473
+ if (!render3) {
1474
+ return;
1475
+ }
1476
+ let patched = false;
1477
+ const scratchRoot = _chunkEQ5E4WOVcjs.createRootContext.call(void 0, hostRoot);
1478
+ const prevScratch = _chunkEQ5E4WOVcjs.pushRoot.call(void 0, scratchRoot);
1479
+ let handledPatchError = false;
1480
+ let scratchOutput = null;
1481
+ try {
1482
+ const output = render3();
1483
+ scratchOutput = output;
1484
+ if (output != null && output !== false) {
1485
+ if (currentNodes.length === 1) {
1486
+ patched = patchNode(_nullishCoalesce(currentNodes[0], () => ( null)), output);
1487
+ }
1488
+ if (!patched && Array.isArray(output)) {
1489
+ patched = _patchFragmentChildren(currentNodes, output);
1490
+ }
1491
+ if (!patched && _isFragmentVNode(output)) {
1492
+ patched = _patchFragmentChildren(currentNodes, _optionalChain([output, 'access', _14 => _14.props, 'optionalAccess', _15 => _15.children]));
1493
+ }
1494
+ }
1495
+ } catch (err) {
1496
+ if (_chunkEQ5E4WOVcjs.handleSuspend.call(void 0, err, scratchRoot)) {
1497
+ handledPatchError = true;
1498
+ return;
1499
+ }
1500
+ if (_chunkEQ5E4WOVcjs.handleError.call(void 0, err, { source: "renderChild" }, scratchRoot)) {
1501
+ handledPatchError = true;
1502
+ return;
1503
+ }
1504
+ throw err;
1505
+ } finally {
1506
+ _chunkEQ5E4WOVcjs.popRoot.call(void 0, prevScratch);
1507
+ }
1508
+ if (handledPatchError) {
1509
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, scratchRoot);
1510
+ return;
1511
+ }
1512
+ if (patched) {
1513
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, scratchRoot);
1514
+ return;
1515
+ }
1516
+ lastCondition = cond;
1517
+ if (currentRoot) {
1518
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, currentRoot);
1519
+ currentRoot = null;
1520
+ }
1521
+ removeNodes(currentNodes);
1522
+ currentNodes = [];
1523
+ const prev2 = _chunkEQ5E4WOVcjs.pushRoot.call(void 0, scratchRoot);
1524
+ let handledError2 = false;
1525
+ try {
1526
+ if (scratchOutput == null || scratchOutput === false) {
1527
+ return;
1528
+ }
1529
+ const el = createElementFn(scratchOutput);
1530
+ const nodes = toNodeArray(el);
1531
+ insertNodesBefore(parent, nodes, endMarker);
1532
+ currentNodes = nodes;
1533
+ } catch (err) {
1534
+ if (_chunkEQ5E4WOVcjs.handleSuspend.call(void 0, err, scratchRoot)) {
1535
+ handledError2 = true;
1536
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, scratchRoot);
1537
+ return;
1538
+ }
1539
+ if (_chunkEQ5E4WOVcjs.handleError.call(void 0, err, { source: "renderChild" }, scratchRoot)) {
1540
+ handledError2 = true;
1541
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, scratchRoot);
1542
+ return;
1543
+ }
1544
+ throw err;
1545
+ } finally {
1546
+ _chunkEQ5E4WOVcjs.popRoot.call(void 0, prev2);
1547
+ if (!handledError2) {
1548
+ _chunkEQ5E4WOVcjs.flushOnMount.call(void 0, scratchRoot);
1549
+ currentRoot = scratchRoot;
1550
+ } else {
1551
+ currentRoot = null;
1552
+ }
1553
+ }
1463
1554
  return;
1464
1555
  }
1465
1556
  lastCondition = cond;
1466
1557
  if (currentRoot) {
1467
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
1558
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, currentRoot);
1468
1559
  currentRoot = null;
1469
1560
  }
1470
1561
  removeNodes(currentNodes);
@@ -1473,11 +1564,11 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1473
1564
  if (!render2) {
1474
1565
  return;
1475
1566
  }
1476
- const root = _chunkFSCBL7RIcjs.createRootContext.call(void 0, hostRoot);
1477
- const prev = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root);
1567
+ const root = _chunkEQ5E4WOVcjs.createRootContext.call(void 0, hostRoot);
1568
+ const prev = _chunkEQ5E4WOVcjs.pushRoot.call(void 0, root);
1478
1569
  let handledError = false;
1479
1570
  try {
1480
- const output = _chunkFSCBL7RIcjs.untrack.call(void 0, render2);
1571
+ const output = trackBranchReads ? render2() : _chunkEQ5E4WOVcjs.untrack.call(void 0, render2);
1481
1572
  if (output == null || output === false) {
1482
1573
  return;
1483
1574
  }
@@ -1486,28 +1577,28 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1486
1577
  insertNodesBefore(parent, nodes, endMarker);
1487
1578
  currentNodes = nodes;
1488
1579
  } catch (err) {
1489
- if (_chunkFSCBL7RIcjs.handleSuspend.call(void 0, err, root)) {
1580
+ if (_chunkEQ5E4WOVcjs.handleSuspend.call(void 0, err, root)) {
1490
1581
  handledError = true;
1491
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
1582
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root);
1492
1583
  return;
1493
1584
  }
1494
- if (_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
1585
+ if (_chunkEQ5E4WOVcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
1495
1586
  handledError = true;
1496
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
1587
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root);
1497
1588
  return;
1498
1589
  }
1499
1590
  throw err;
1500
1591
  } finally {
1501
- _chunkFSCBL7RIcjs.popRoot.call(void 0, prev);
1592
+ _chunkEQ5E4WOVcjs.popRoot.call(void 0, prev);
1502
1593
  if (!handledError) {
1503
- _chunkFSCBL7RIcjs.flushOnMount.call(void 0, root);
1594
+ _chunkEQ5E4WOVcjs.flushOnMount.call(void 0, root);
1504
1595
  currentRoot = root;
1505
1596
  } else {
1506
1597
  currentRoot = null;
1507
1598
  }
1508
1599
  }
1509
1600
  };
1510
- const dispose = _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, runConditional);
1601
+ const dispose = _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, runConditional);
1511
1602
  return {
1512
1603
  marker: fragment,
1513
1604
  flush: () => {
@@ -1518,38 +1609,38 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1518
1609
  dispose: () => {
1519
1610
  dispose();
1520
1611
  if (currentRoot) {
1521
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
1612
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, currentRoot);
1522
1613
  }
1523
1614
  removeNodes(currentNodes);
1524
1615
  currentNodes = [];
1525
- _optionalChain([startMarker, 'access', _13 => _13.parentNode, 'optionalAccess', _14 => _14.removeChild, 'call', _15 => _15(startMarker)]);
1526
- _optionalChain([endMarker, 'access', _16 => _16.parentNode, 'optionalAccess', _17 => _17.removeChild, 'call', _18 => _18(endMarker)]);
1616
+ _optionalChain([startMarker, 'access', _16 => _16.parentNode, 'optionalAccess', _17 => _17.removeChild, 'call', _18 => _18(startMarker)]);
1617
+ _optionalChain([endMarker, 'access', _19 => _19.parentNode, 'optionalAccess', _20 => _20.removeChild, 'call', _21 => _21(endMarker)]);
1527
1618
  }
1528
1619
  };
1529
1620
  }
1530
1621
  function createShow(el, condition, displayValue) {
1531
1622
  const originalDisplay = _nullishCoalesce(displayValue, () => ( el.style.display));
1532
- _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
1623
+ _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => {
1533
1624
  el.style.display = condition() ? originalDisplay : "none";
1534
1625
  });
1535
1626
  }
1536
1627
  function createPortal(container, render2, createElementFn) {
1537
- const parentRoot = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
1628
+ const parentRoot = _chunkEQ5E4WOVcjs.getCurrentRoot.call(void 0, );
1538
1629
  const marker = document.createComment("fict:portal");
1539
1630
  container.appendChild(marker);
1540
1631
  let currentNodes = [];
1541
1632
  let currentRoot = null;
1542
- const dispose = _chunkFSCBL7RIcjs.createRenderEffect.call(void 0, () => {
1633
+ const dispose = _chunkEQ5E4WOVcjs.createRenderEffect.call(void 0, () => {
1543
1634
  if (currentRoot) {
1544
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
1635
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, currentRoot);
1545
1636
  currentRoot = null;
1546
1637
  }
1547
1638
  if (currentNodes.length > 0) {
1548
1639
  removeNodes(currentNodes);
1549
1640
  currentNodes = [];
1550
1641
  }
1551
- const root = _chunkFSCBL7RIcjs.createRootContext.call(void 0, parentRoot);
1552
- const prev = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root);
1642
+ const root = _chunkEQ5E4WOVcjs.createRootContext.call(void 0, parentRoot);
1643
+ const prev = _chunkEQ5E4WOVcjs.pushRoot.call(void 0, root);
1553
1644
  let handledError = false;
1554
1645
  try {
1555
1646
  const output = render2();
@@ -1562,23 +1653,23 @@ function createPortal(container, render2, createElementFn) {
1562
1653
  currentNodes = nodes;
1563
1654
  }
1564
1655
  } catch (err) {
1565
- if (_chunkFSCBL7RIcjs.handleSuspend.call(void 0, err, root)) {
1656
+ if (_chunkEQ5E4WOVcjs.handleSuspend.call(void 0, err, root)) {
1566
1657
  handledError = true;
1567
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
1658
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root);
1568
1659
  currentNodes = [];
1569
1660
  return;
1570
1661
  }
1571
- if (_chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
1662
+ if (_chunkEQ5E4WOVcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
1572
1663
  handledError = true;
1573
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
1664
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root);
1574
1665
  currentNodes = [];
1575
1666
  return;
1576
1667
  }
1577
1668
  throw err;
1578
1669
  } finally {
1579
- _chunkFSCBL7RIcjs.popRoot.call(void 0, prev);
1670
+ _chunkEQ5E4WOVcjs.popRoot.call(void 0, prev);
1580
1671
  if (!handledError) {
1581
- _chunkFSCBL7RIcjs.flushOnMount.call(void 0, root);
1672
+ _chunkEQ5E4WOVcjs.flushOnMount.call(void 0, root);
1582
1673
  currentRoot = root;
1583
1674
  } else {
1584
1675
  currentRoot = null;
@@ -1588,12 +1679,12 @@ function createPortal(container, render2, createElementFn) {
1588
1679
  const portalDispose = () => {
1589
1680
  dispose();
1590
1681
  if (currentRoot) {
1591
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, currentRoot);
1682
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, currentRoot);
1592
1683
  }
1593
1684
  if (currentNodes.length > 0) {
1594
1685
  removeNodes(currentNodes);
1595
1686
  }
1596
- _optionalChain([marker, 'access', _19 => _19.parentNode, 'optionalAccess', _20 => _20.removeChild, 'call', _21 => _21(marker)]);
1687
+ _optionalChain([marker, 'access', _22 => _22.parentNode, 'optionalAccess', _23 => _23.removeChild, 'call', _24 => _24(marker)]);
1597
1688
  };
1598
1689
  if (parentRoot) {
1599
1690
  parentRoot.destroyCallbacks.push(portalDispose);
@@ -1603,6 +1694,96 @@ function createPortal(container, render2, createElementFn) {
1603
1694
  dispose: portalDispose
1604
1695
  };
1605
1696
  }
1697
+ function patchElement(el, output) {
1698
+ if (output && typeof output === "object" && !(output instanceof Node)) {
1699
+ const vnode = output;
1700
+ if (typeof vnode.type === "string" && vnode.type.toLowerCase() === el.tagName.toLowerCase()) {
1701
+ const children = _optionalChain([vnode, 'access', _25 => _25.props, 'optionalAccess', _26 => _26.children]);
1702
+ const props = _nullishCoalesce(vnode.props, () => ( {}));
1703
+ for (const [key, value] of Object.entries(props)) {
1704
+ if (key === "children" || key === "key") continue;
1705
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === null || value === void 0) {
1706
+ if (key === "class" || key === "className") {
1707
+ el.setAttribute("class", value === false || value === null ? "" : String(value));
1708
+ } else if (key === "style" && typeof value === "string") {
1709
+ ;
1710
+ el.style.cssText = value;
1711
+ } else if (value === false || value === null || value === void 0) {
1712
+ el.removeAttribute(key);
1713
+ } else if (value === true) {
1714
+ el.setAttribute(key, "");
1715
+ } else {
1716
+ el.setAttribute(key, String(value));
1717
+ }
1718
+ }
1719
+ }
1720
+ if (typeof children === "string" || typeof children === "number" || children === null || children === void 0 || children === false) {
1721
+ el.textContent = children === null || children === void 0 || children === false ? "" : String(children);
1722
+ return true;
1723
+ }
1724
+ if (children && typeof children === "object" && !Array.isArray(children) && !(children instanceof Node)) {
1725
+ const childVNode = children;
1726
+ if (typeof childVNode.type === "string") {
1727
+ const childEl = el.querySelector(childVNode.type);
1728
+ if (childEl && patchElement(childEl, children)) {
1729
+ return true;
1730
+ }
1731
+ }
1732
+ }
1733
+ return false;
1734
+ }
1735
+ }
1736
+ return false;
1737
+ }
1738
+ function patchNode(currentNode, nextOutput) {
1739
+ if (!currentNode) return false;
1740
+ if (currentNode instanceof Text && (nextOutput === null || nextOutput === void 0 || nextOutput === false || typeof nextOutput === "string" || typeof nextOutput === "number" || nextOutput instanceof Text)) {
1741
+ const nextText = nextOutput instanceof Text ? nextOutput.data : nextOutput === null || nextOutput === void 0 || nextOutput === false ? "" : String(nextOutput);
1742
+ currentNode.data = nextText;
1743
+ return true;
1744
+ }
1745
+ if (currentNode instanceof Element && patchElement(currentNode, nextOutput)) {
1746
+ return true;
1747
+ }
1748
+ if (nextOutput instanceof Node && currentNode === nextOutput) {
1749
+ return true;
1750
+ }
1751
+ return false;
1752
+ }
1753
+ function _isFragmentVNode(value) {
1754
+ return value != null && typeof value === "object" && !(value instanceof Node) && value.type === Fragment;
1755
+ }
1756
+ function normalizeChildren(children, result = []) {
1757
+ if (children === void 0) {
1758
+ return result;
1759
+ }
1760
+ if (Array.isArray(children)) {
1761
+ for (const child of children) {
1762
+ normalizeChildren(child, result);
1763
+ }
1764
+ return result;
1765
+ }
1766
+ if (children === null || children === false) {
1767
+ return result;
1768
+ }
1769
+ if (_isFragmentVNode(children)) {
1770
+ return normalizeChildren(_optionalChain([children, 'access', _27 => _27.props, 'optionalAccess', _28 => _28.children]), result);
1771
+ }
1772
+ result.push(children);
1773
+ return result;
1774
+ }
1775
+ function _patchFragmentChildren(nodes, children) {
1776
+ const normalized = normalizeChildren(children);
1777
+ if (normalized.length !== nodes.length) {
1778
+ return false;
1779
+ }
1780
+ for (let i = 0; i < normalized.length; i++) {
1781
+ if (!patchNode(nodes[i], normalized[i])) {
1782
+ return false;
1783
+ }
1784
+ }
1785
+ return true;
1786
+ }
1606
1787
 
1607
1788
  // src/props.ts
1608
1789
  var PROP_GETTER_MARKER2 = Symbol.for("fict:prop-getter");
@@ -1662,10 +1843,10 @@ function isExplicitReactiveFn2(value) {
1662
1843
  function normalizePropsFunction(value) {
1663
1844
  if (typeof value !== "function") return value;
1664
1845
  if (value.length !== 0) return value;
1665
- if (isPropGetter(value) || _chunkFSCBL7RIcjs.isSignal.call(void 0, value) || _chunkFSCBL7RIcjs.isComputed.call(void 0, value) || isExplicitReactiveFn2(value)) {
1846
+ if (isPropGetter(value) || _chunkEQ5E4WOVcjs.isSignal.call(void 0, value) || _chunkEQ5E4WOVcjs.isComputed.call(void 0, value) || isExplicitReactiveFn2(value)) {
1666
1847
  return value;
1667
1848
  }
1668
- if (_chunkFSCBL7RIcjs.isEffect.call(void 0, value) || _chunkFSCBL7RIcjs.isEffectScope.call(void 0, value) || isNonReactiveFn2(value)) return value;
1849
+ if (_chunkEQ5E4WOVcjs.isEffect.call(void 0, value) || _chunkEQ5E4WOVcjs.isEffectScope.call(void 0, value) || isNonReactiveFn2(value)) return value;
1669
1850
  return markNonReactiveFn(value);
1670
1851
  }
1671
1852
  function createPropsProxy(props) {
@@ -1802,9 +1983,9 @@ function prop(getter, options) {
1802
1983
  return getter;
1803
1984
  }
1804
1985
  const fn = getter;
1805
- const unwrap2 = _optionalChain([options, 'optionalAccess', _22 => _22.unwrap]) !== false;
1986
+ const unwrap2 = _optionalChain([options, 'optionalAccess', _29 => _29.unwrap]) !== false;
1806
1987
  return __fictProp(
1807
- _chunkFSCBL7RIcjs.createMemo.call(void 0, () => {
1988
+ _chunkEQ5E4WOVcjs.createMemo.call(void 0, () => {
1808
1989
  const value = fn();
1809
1990
  if (unwrap2 && isPropGetter(value)) {
1810
1991
  return value();
@@ -1817,15 +1998,41 @@ function prop(getter, options) {
1817
1998
  // src/dom.ts
1818
1999
  var SVG_NS = "http://www.w3.org/2000/svg";
1819
2000
  var MATHML_NS = "http://www.w3.org/1998/Math/MathML";
1820
- var isDev2 = typeof __DEV__ !== "undefined" ? __DEV__ : typeof process !== "undefined" && _optionalChain([process, 'access', _23 => _23.env, 'optionalAccess', _24 => _24.NODE_ENV]) !== "production";
2001
+ var isDev2 = typeof __DEV__ !== "undefined" ? __DEV__ : typeof process !== "undefined" && _optionalChain([process, 'access', _30 => _30.env, 'optionalAccess', _31 => _31.NODE_ENV]) !== "production";
1821
2002
  var nextComponentId = 1;
2003
+ function collectComponentMountElements(node) {
2004
+ if (node instanceof DocumentFragment) {
2005
+ return Array.from(node.childNodes).filter(
2006
+ (child) => child instanceof HTMLElement
2007
+ );
2008
+ }
2009
+ if (node instanceof HTMLElement) {
2010
+ if (node.hasAttribute("data-fict-host")) {
2011
+ const children = Array.from(node.children).filter(
2012
+ (child) => child instanceof HTMLElement
2013
+ );
2014
+ if (children.length > 0) return children;
2015
+ }
2016
+ return [node];
2017
+ }
2018
+ return [];
2019
+ }
2020
+ function annotateComponentElements(elements, componentId, componentName) {
2021
+ for (const element of elements) {
2022
+ element.setAttribute("data-fict-component", componentName);
2023
+ element.setAttribute("data-fict-component-id", String(componentId));
2024
+ const annotated = element;
2025
+ annotated.__fict_component_id__ = componentId;
2026
+ annotated.__fict_component_name__ = componentName;
2027
+ }
2028
+ }
1822
2029
  function render(view, container) {
1823
- const root = _chunkFSCBL7RIcjs.createRootContext.call(void 0, );
1824
- const prev = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root);
2030
+ const root = _chunkEQ5E4WOVcjs.createRootContext.call(void 0, );
2031
+ const prev = _chunkEQ5E4WOVcjs.pushRoot.call(void 0, root);
1825
2032
  let dom = void 0;
1826
2033
  try {
1827
2034
  const output = view();
1828
- if (_chunkFSCBL7RIcjs.__fictIsHydrating.call(void 0, )) {
2035
+ if (_chunkEQ5E4WOVcjs.__fictIsHydrating.call(void 0, )) {
1829
2036
  withHydration(container, () => {
1830
2037
  dom = createElement(output);
1831
2038
  });
@@ -1833,35 +2040,35 @@ function render(view, container) {
1833
2040
  dom = createElement(output);
1834
2041
  }
1835
2042
  } finally {
1836
- _chunkFSCBL7RIcjs.popRoot.call(void 0, prev);
2043
+ _chunkEQ5E4WOVcjs.popRoot.call(void 0, prev);
1837
2044
  }
1838
- if (!_chunkFSCBL7RIcjs.__fictIsHydrating.call(void 0, )) {
2045
+ if (!_chunkEQ5E4WOVcjs.__fictIsHydrating.call(void 0, )) {
1839
2046
  container.replaceChildren(dom);
1840
2047
  }
1841
2048
  container.setAttribute("data-fict-fine-grained", "1");
1842
- _chunkFSCBL7RIcjs.flushOnMount.call(void 0, root);
2049
+ _chunkEQ5E4WOVcjs.flushOnMount.call(void 0, root);
1843
2050
  const teardown = () => {
1844
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
2051
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root);
1845
2052
  container.innerHTML = "";
1846
2053
  };
1847
2054
  return teardown;
1848
2055
  }
1849
2056
  function hydrateComponent(view, container) {
1850
- const root = _chunkFSCBL7RIcjs.createRootContext.call(void 0, );
1851
- const prev = _chunkFSCBL7RIcjs.pushRoot.call(void 0, root);
1852
- _chunkFSCBL7RIcjs.__fictEnterHydration.call(void 0, );
2057
+ const root = _chunkEQ5E4WOVcjs.createRootContext.call(void 0, );
2058
+ const prev = _chunkEQ5E4WOVcjs.pushRoot.call(void 0, root);
2059
+ _chunkEQ5E4WOVcjs.__fictEnterHydration.call(void 0, );
1853
2060
  try {
1854
2061
  withHydration(container, () => {
1855
2062
  view();
1856
2063
  });
1857
2064
  } finally {
1858
- _chunkFSCBL7RIcjs.__fictExitHydration.call(void 0, );
1859
- _chunkFSCBL7RIcjs.popRoot.call(void 0, prev);
2065
+ _chunkEQ5E4WOVcjs.__fictExitHydration.call(void 0, );
2066
+ _chunkEQ5E4WOVcjs.popRoot.call(void 0, prev);
1860
2067
  }
1861
2068
  container.setAttribute("data-fict-fine-grained", "1");
1862
- _chunkFSCBL7RIcjs.flushOnMount.call(void 0, root);
2069
+ _chunkEQ5E4WOVcjs.flushOnMount.call(void 0, root);
1863
2070
  const teardown = () => {
1864
- _chunkFSCBL7RIcjs.destroyRoot.call(void 0, root);
2071
+ _chunkEQ5E4WOVcjs.destroyRoot.call(void 0, root);
1865
2072
  };
1866
2073
  return teardown;
1867
2074
  }
@@ -1873,7 +2080,7 @@ function resolveNamespace(tagName, namespace) {
1873
2080
  if (tagName === "math") return "mathml";
1874
2081
  if (namespace === "mathml") return "mathml";
1875
2082
  if (namespace === "svg") return "svg";
1876
- if (isDev2 && _chunkFSCBL7RIcjs.SVGElements.has(tagName)) return "svg";
2083
+ if (isDev2 && _chunkEQ5E4WOVcjs.SVGElements.has(tagName)) return "svg";
1877
2084
  return null;
1878
2085
  }
1879
2086
  function createElementWithContext(node, namespace) {
@@ -1897,7 +2104,7 @@ function createElementWithContext(node, namespace) {
1897
2104
  if ("marker" in node) {
1898
2105
  const handle = node;
1899
2106
  if (typeof handle.dispose === "function") {
1900
- _chunkFSCBL7RIcjs.registerRootCleanup.call(void 0, handle.dispose);
2107
+ _chunkEQ5E4WOVcjs.registerRootCleanup.call(void 0, handle.dispose);
1901
2108
  }
1902
2109
  if (typeof handle.flush === "function") {
1903
2110
  const runFlush = () => handle.flush && handle.flush();
@@ -1948,13 +2155,14 @@ function createElementWithContext(node, namespace) {
1948
2155
  }
1949
2156
  });
1950
2157
  const props = createPropsProxy(baseProps);
1951
- const hook = isDev2 ? _chunkFSCBL7RIcjs.getDevtoolsHook.call(void 0, ) : void 0;
1952
- const parentId = hook ? _chunkFSCBL7RIcjs.__fictGetCurrentComponentId.call(void 0, ) : void 0;
2158
+ const hook = isDev2 ? _chunkEQ5E4WOVcjs.getDevtoolsHook.call(void 0, ) : void 0;
2159
+ const componentName = vnode.type.name || "Anonymous";
2160
+ const parentId = hook ? _chunkEQ5E4WOVcjs.__fictGetCurrentComponentId.call(void 0, ) : void 0;
1953
2161
  const componentId = hook ? nextComponentId++ : void 0;
1954
- if (_optionalChain([hook, 'optionalAccess', _25 => _25.registerComponent]) && componentId !== void 0) {
1955
- hook.registerComponent(componentId, vnode.type.name || "Anonymous", parentId);
2162
+ if (_optionalChain([hook, 'optionalAccess', _32 => _32.registerComponent]) && componentId !== void 0) {
2163
+ hook.registerComponent(componentId, componentName, parentId);
1956
2164
  }
1957
- const ctx = _chunkFSCBL7RIcjs.__fictPushContext.call(void 0, );
2165
+ const ctx = _chunkEQ5E4WOVcjs.__fictPushContext.call(void 0, );
1958
2166
  if (componentId !== void 0) {
1959
2167
  ctx.componentId = componentId;
1960
2168
  if (parentId !== void 0) {
@@ -1963,13 +2171,17 @@ function createElementWithContext(node, namespace) {
1963
2171
  }
1964
2172
  try {
1965
2173
  const rendered = vnode.type(props);
2174
+ let mountElements;
2175
+ if (hook && componentId !== void 0) {
2176
+ _optionalChain([hook, 'access', _33 => _33.componentRender, 'optionalCall', _34 => _34(componentId)]);
2177
+ }
1966
2178
  if (hook && componentId !== void 0) {
1967
- _chunkFSCBL7RIcjs.onMount.call(void 0, () => {
1968
- _optionalChain([hook, 'access', _26 => _26.componentMount, 'optionalCall', _27 => _27(componentId)]);
2179
+ _chunkEQ5E4WOVcjs.onMount.call(void 0, () => {
2180
+ _optionalChain([hook, 'access', _35 => _35.componentMount, 'optionalCall', _36 => _36(componentId, mountElements)]);
1969
2181
  });
1970
- _chunkFSCBL7RIcjs.onCleanup.call(void 0, () => _optionalChain([hook, 'access', _28 => _28.componentUnmount, 'optionalCall', _29 => _29(componentId)]));
2182
+ _chunkEQ5E4WOVcjs.onCleanup.call(void 0, () => _optionalChain([hook, 'access', _37 => _37.componentUnmount, 'optionalCall', _38 => _38(componentId)]));
1971
2183
  }
1972
- if (_chunkFSCBL7RIcjs.__fictIsResumable.call(void 0, ) && !_chunkFSCBL7RIcjs.__fictIsHydrating.call(void 0, )) {
2184
+ if (_chunkEQ5E4WOVcjs.__fictIsResumable.call(void 0, ) && !_chunkEQ5E4WOVcjs.__fictIsHydrating.call(void 0, )) {
1973
2185
  const content = createElementWithContext(rendered, namespace);
1974
2186
  const host = namespace === "svg" ? document.createElementNS(SVG_NS, "fict-host") : namespace === "mathml" ? document.createElementNS(MATHML_NS, "fict-host") : document.createElement("fict-host");
1975
2187
  host.setAttribute("data-fict-host", "");
@@ -1978,9 +2190,9 @@ function createElementWithContext(node, namespace) {
1978
2190
  host.style.display = "contents";
1979
2191
  }
1980
2192
  const meta = vnode.type.__fictMeta;
1981
- const typeKey = (_nullishCoalesce(_optionalChain([meta, 'optionalAccess', _30 => _30.id]), () => ( vnode.type.name))) || "Anonymous";
1982
- _chunkFSCBL7RIcjs.__fictRegisterScope.call(void 0, ctx, host, typeKey, rawProps);
1983
- if (_optionalChain([meta, 'optionalAccess', _31 => _31.resume])) {
2193
+ const typeKey = (_nullishCoalesce(_optionalChain([meta, 'optionalAccess', _39 => _39.id]), () => ( vnode.type.name))) || "Anonymous";
2194
+ _chunkEQ5E4WOVcjs.__fictRegisterScope.call(void 0, ctx, host, typeKey, rawProps);
2195
+ if (_optionalChain([meta, 'optionalAccess', _40 => _40.resume])) {
1984
2196
  host.setAttribute("data-fict-h", meta.resume);
1985
2197
  }
1986
2198
  if (content instanceof DocumentFragment) {
@@ -1988,22 +2200,31 @@ function createElementWithContext(node, namespace) {
1988
2200
  } else {
1989
2201
  host.appendChild(content);
1990
2202
  }
2203
+ if (hook && componentId !== void 0) {
2204
+ mountElements = collectComponentMountElements(host);
2205
+ annotateComponentElements(mountElements, componentId, componentName);
2206
+ }
1991
2207
  return host;
1992
2208
  }
1993
- return createElementWithContext(rendered, namespace);
2209
+ const componentRoot = createElementWithContext(rendered, namespace);
2210
+ if (hook && componentId !== void 0) {
2211
+ mountElements = collectComponentMountElements(componentRoot);
2212
+ annotateComponentElements(mountElements, componentId, componentName);
2213
+ }
2214
+ return componentRoot;
1994
2215
  } catch (err) {
1995
- if (_chunkFSCBL7RIcjs.handleSuspend.call(void 0, err)) {
2216
+ if (_chunkEQ5E4WOVcjs.handleSuspend.call(void 0, err)) {
1996
2217
  return document.createComment("fict:suspend");
1997
2218
  }
1998
- _chunkFSCBL7RIcjs.handleError.call(void 0, err, { source: "render", componentName: vnode.type.name });
2219
+ _chunkEQ5E4WOVcjs.handleError.call(void 0, err, { source: "render", componentName: vnode.type.name });
1999
2220
  throw err;
2000
2221
  } finally {
2001
- _chunkFSCBL7RIcjs.__fictPopContext.call(void 0, );
2222
+ _chunkEQ5E4WOVcjs.__fictPopContext.call(void 0, );
2002
2223
  }
2003
2224
  }
2004
2225
  if (vnode.type === Fragment) {
2005
2226
  const frag = document.createDocumentFragment();
2006
- const children = _optionalChain([vnode, 'access', _32 => _32.props, 'optionalAccess', _33 => _33.children]);
2227
+ const children = _optionalChain([vnode, 'access', _41 => _41.props, 'optionalAccess', _42 => _42.children]);
2007
2228
  appendChildren(frag, children, namespace);
2008
2229
  return frag;
2009
2230
  }
@@ -2013,7 +2234,7 @@ function createElementWithContext(node, namespace) {
2013
2234
  applyProps(el, _nullishCoalesce(vnode.props, () => ( {})), resolvedNamespace === "svg");
2014
2235
  appendChildren(
2015
2236
  el,
2016
- _optionalChain([vnode, 'access', _34 => _34.props, 'optionalAccess', _35 => _35.children]),
2237
+ _optionalChain([vnode, 'access', _43 => _43.props, 'optionalAccess', _44 => _44.children]),
2017
2238
  tagName === "foreignObject" ? null : resolvedNamespace
2018
2239
  );
2019
2240
  return el;
@@ -2083,7 +2304,7 @@ function appendChildNode(parent, child, namespace) {
2083
2304
  }
2084
2305
  if (isBindingHandle(child)) {
2085
2306
  appendChildNode(parent, child.marker, namespace);
2086
- _optionalChain([child, 'access', _36 => _36.flush, 'optionalCall', _37 => _37()]);
2307
+ _optionalChain([child, 'access', _45 => _45.flush, 'optionalCall', _46 => _46()]);
2087
2308
  return;
2088
2309
  }
2089
2310
  if (typeof child === "function") {
@@ -2141,9 +2362,9 @@ function applyRef(el, value) {
2141
2362
  if (typeof value === "function") {
2142
2363
  const refFn = value;
2143
2364
  refFn(el);
2144
- const root = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
2365
+ const root = _chunkEQ5E4WOVcjs.getCurrentRoot.call(void 0, );
2145
2366
  if (root) {
2146
- _chunkFSCBL7RIcjs.registerRootCleanup.call(void 0, () => {
2367
+ _chunkEQ5E4WOVcjs.registerRootCleanup.call(void 0, () => {
2147
2368
  refFn(null);
2148
2369
  });
2149
2370
  } else if (isDev2) {
@@ -2154,9 +2375,9 @@ function applyRef(el, value) {
2154
2375
  } else if (value && typeof value === "object" && "current" in value) {
2155
2376
  const refObj = value;
2156
2377
  refObj.current = el;
2157
- const root = _chunkFSCBL7RIcjs.getCurrentRoot.call(void 0, );
2378
+ const root = _chunkEQ5E4WOVcjs.getCurrentRoot.call(void 0, );
2158
2379
  if (root) {
2159
- _chunkFSCBL7RIcjs.registerRootCleanup.call(void 0, () => {
2380
+ _chunkEQ5E4WOVcjs.registerRootCleanup.call(void 0, () => {
2160
2381
  refObj.current = null;
2161
2382
  });
2162
2383
  } else if (isDev2) {
@@ -2230,7 +2451,7 @@ function applyProps(el, props, isSVG = false) {
2230
2451
  }
2231
2452
  continue;
2232
2453
  }
2233
- if (isDev2 && _chunkFSCBL7RIcjs.ChildProperties.has(key) || key === "innerHTML" || key === "textContent" || key === "innerText" || key === "children") {
2454
+ if (isDev2 && _chunkEQ5E4WOVcjs.ChildProperties.has(key) || key === "innerHTML" || key === "textContent" || key === "innerText" || key === "children") {
2234
2455
  createAttributeBinding(el, key, value, setProperty);
2235
2456
  continue;
2236
2457
  }
@@ -2246,8 +2467,8 @@ function applyProps(el, props, isSVG = false) {
2246
2467
  createAttributeBinding(el, key.slice(5), value, setProperty);
2247
2468
  continue;
2248
2469
  }
2249
- const propAlias = !isSVG && isDev2 ? _chunkFSCBL7RIcjs.getPropAlias.call(void 0, key, tagName) : void 0;
2250
- const isProperty = !isSVG ? isDev2 ? _chunkFSCBL7RIcjs.Properties.has(key) : key in el : false;
2470
+ const propAlias = !isSVG && isDev2 ? _chunkEQ5E4WOVcjs.getPropAlias.call(void 0, key, tagName) : void 0;
2471
+ const isProperty = !isSVG ? isDev2 ? _chunkEQ5E4WOVcjs.Properties.has(key) : key in el : false;
2251
2472
  if (propAlias || isProperty || isCE && !isSVG) {
2252
2473
  const propName = propAlias || key;
2253
2474
  if (isCE && !isProperty && !propAlias) {
@@ -2264,7 +2485,7 @@ function applyProps(el, props, isSVG = false) {
2264
2485
  }
2265
2486
  if (isSVG && key.indexOf(":") > -1) {
2266
2487
  const [prefix, name] = key.split(":");
2267
- const ns = _chunkFSCBL7RIcjs.SVGNamespace[prefix];
2488
+ const ns = _chunkEQ5E4WOVcjs.SVGNamespace[prefix];
2268
2489
  if (ns) {
2269
2490
  createAttributeBinding(
2270
2491
  el,
@@ -2406,5 +2627,5 @@ function eventNameFromProp(key) {
2406
2627
 
2407
2628
 
2408
2629
 
2409
- exports.withHydrationRange = withHydrationRange; exports.isHydratingActive = isHydratingActive; exports.Fragment = Fragment; exports.toNodeArray = toNodeArray; exports.insertNodesBefore = insertNodesBefore; exports.removeNodes = removeNodes; exports.getSlotEnd = getSlotEnd; exports.resolvePath = resolvePath; exports.startTransition = startTransition; exports.useTransition = useTransition; exports.useDeferredValue = useDeferredValue; exports.batch = batch2; exports.untrack = untrack2; exports.isReactive = isReactive; exports.nonReactive = nonReactive; exports.reactive = reactive; exports.unwrap = unwrap; exports.callEventHandler = callEventHandler; exports.createTextBinding = createTextBinding; exports.bindText = bindText; exports.setText = setText; exports.createAttributeBinding = createAttributeBinding; exports.bindAttribute = bindAttribute; exports.setAttr = setAttr; exports.bindProperty = bindProperty; exports.setProp = setProp; exports.createStyleBinding = createStyleBinding; exports.bindStyle = bindStyle; exports.setStyle = setStyle; exports.createClassBinding = createClassBinding; exports.bindClass = bindClass; exports.setClass = setClass; exports.classList = classList; exports.insert = insert; exports.insertBetween = insertBetween; exports.createChildBinding = createChildBinding; exports.delegateEvents = delegateEvents; exports.clearDelegatedEvents = clearDelegatedEvents; exports.addEventListener = addEventListener; exports.bindEvent = bindEvent; exports.bindRef = bindRef; exports.spread = spread; exports.assign = assign; exports.createConditional = createConditional; exports.createShow = createShow; exports.createPortal = createPortal; exports.__fictProp = __fictProp; exports.createPropsProxy = createPropsProxy; exports.__fictPropsRest = __fictPropsRest; exports.mergeProps = mergeProps; exports.keyed = keyed; exports.prop = prop; exports.render = render; exports.hydrateComponent = hydrateComponent; exports.createElement = createElement; exports.template = template;
2410
- //# sourceMappingURL=chunk-PRF4QG73.cjs.map
2630
+ exports.startTransition = startTransition; exports.useTransition = useTransition; exports.useDeferredValue = useDeferredValue; exports.batch = batch2; exports.untrack = untrack2; exports.Fragment = Fragment; exports.withHydrationRange = withHydrationRange; exports.isHydratingActive = isHydratingActive; exports.toNodeArray = toNodeArray; exports.insertNodesBefore = insertNodesBefore; exports.removeNodes = removeNodes; exports.getSlotEnd = getSlotEnd; exports.resolvePath = resolvePath; exports.isReactive = isReactive; exports.nonReactive = nonReactive; exports.reactive = reactive; exports.unwrap = unwrap; exports.callEventHandler = callEventHandler; exports.createTextBinding = createTextBinding; exports.bindText = bindText; exports.setText = setText; exports.createAttributeBinding = createAttributeBinding; exports.bindAttribute = bindAttribute; exports.setAttr = setAttr; exports.bindProperty = bindProperty; exports.setProp = setProp; exports.createStyleBinding = createStyleBinding; exports.bindStyle = bindStyle; exports.setStyle = setStyle; exports.createClassBinding = createClassBinding; exports.bindClass = bindClass; exports.setClass = setClass; exports.classList = classList; exports.insert = insert; exports.insertBetween = insertBetween; exports.createChildBinding = createChildBinding; exports.delegateEvents = delegateEvents; exports.clearDelegatedEvents = clearDelegatedEvents; exports.addEventListener = addEventListener; exports.bindEvent = bindEvent; exports.bindRef = bindRef; exports.spread = spread; exports.assign = assign; exports.createConditional = createConditional; exports.createShow = createShow; exports.createPortal = createPortal; exports.__fictProp = __fictProp; exports.createPropsProxy = createPropsProxy; exports.__fictPropsRest = __fictPropsRest; exports.mergeProps = mergeProps; exports.keyed = keyed; exports.prop = prop; exports.render = render; exports.hydrateComponent = hydrateComponent; exports.createElement = createElement; exports.template = template;
2631
+ //# sourceMappingURL=chunk-I4GKKAAY.cjs.map