marko 6.4.10 → 6.4.12

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 (112) hide show
  1. package/dist/common/accessor.d.ts +0 -3
  2. package/dist/common/accessor.debug.d.ts +0 -3
  3. package/dist/common/attr-tag.d.ts +1 -0
  4. package/dist/common/errors.d.ts +2 -0
  5. package/dist/common/helpers.d.ts +3 -1
  6. package/dist/common/types.d.ts +4 -3
  7. package/dist/debug/dom/catch.feat.js +1 -1
  8. package/dist/debug/dom/catch.feat.mjs +1 -1
  9. package/dist/debug/dom/compat.feat.js +143 -0
  10. package/dist/debug/dom/compat.feat.mjs +141 -0
  11. package/dist/debug/dom/controllable-input.feat.js +1 -1
  12. package/dist/debug/dom/controllable-input.feat.mjs +1 -1
  13. package/dist/debug/dom/controllable-open.feat.js +1 -1
  14. package/dist/debug/dom/controllable-open.feat.mjs +1 -1
  15. package/dist/debug/dom/controllable-select.feat.js +1 -1
  16. package/dist/debug/dom/controllable-select.feat.mjs +1 -1
  17. package/dist/debug/dom/controllable-textarea.feat.js +1 -1
  18. package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
  19. package/dist/debug/dom/controllable.feat.js +1 -1
  20. package/dist/debug/dom/controllable.feat.mjs +1 -1
  21. package/dist/debug/dom/dynamic-tag-script.feat.js +1 -1
  22. package/dist/debug/dom/dynamic-tag-script.feat.mjs +1 -1
  23. package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
  24. package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
  25. package/dist/debug/dom/lazy.feat.js +1 -1
  26. package/dist/debug/dom/lazy.feat.mjs +1 -1
  27. package/dist/debug/dom/placeholder.feat.js +1 -1
  28. package/dist/debug/dom/placeholder.feat.mjs +1 -1
  29. package/dist/debug/{dom-DNB5yq3U.js → dom-CtXOr4Nm.js} +257 -230
  30. package/dist/debug/{dom-C1V5vpFs.mjs → dom-DaHYZpf2.mjs} +238 -229
  31. package/dist/debug/dom.js +8 -134
  32. package/dist/debug/dom.mjs +5 -126
  33. package/dist/debug/html/compat.feat.js +222 -0
  34. package/dist/debug/html/compat.feat.mjs +220 -0
  35. package/dist/debug/html-DMo6pc_h.mjs +3931 -0
  36. package/dist/debug/html-DfZjMkhx.js +4513 -0
  37. package/dist/debug/html.js +83 -4239
  38. package/dist/debug/html.mjs +1 -4152
  39. package/dist/dom/abort-signal.d.ts +1 -1
  40. package/dist/dom/catch.feat.js +3 -3
  41. package/dist/dom/catch.feat.mjs +1 -1
  42. package/dist/dom/{compat.d.ts → compat.feat.d.ts} +18 -9
  43. package/dist/dom/compat.feat.js +101 -0
  44. package/dist/dom/compat.feat.mjs +100 -0
  45. package/dist/dom/control-flow.d.ts +4 -5
  46. package/dist/dom/controllable-input.feat.js +2 -2
  47. package/dist/dom/controllable-input.feat.mjs +1 -1
  48. package/dist/dom/controllable-open.feat.js +2 -2
  49. package/dist/dom/controllable-open.feat.mjs +1 -1
  50. package/dist/dom/controllable-select.feat.js +2 -2
  51. package/dist/dom/controllable-select.feat.mjs +1 -1
  52. package/dist/dom/controllable-textarea.feat.js +2 -2
  53. package/dist/dom/controllable-textarea.feat.mjs +1 -1
  54. package/dist/dom/controllable.feat.js +2 -2
  55. package/dist/dom/controllable.feat.mjs +1 -1
  56. package/dist/dom/dom.d.ts +2 -1
  57. package/dist/dom/dynamic-tag-script.feat.js +2 -2
  58. package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
  59. package/dist/dom/dynamic-tag-var.feat.js +1 -1
  60. package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
  61. package/dist/dom/lazy.feat.js +1 -1
  62. package/dist/dom/lazy.feat.mjs +1 -1
  63. package/dist/dom/load.d.ts +3 -4
  64. package/dist/dom/placeholder.feat.js +3 -3
  65. package/dist/dom/placeholder.feat.mjs +1 -1
  66. package/dist/dom/queue.d.ts +1 -2
  67. package/dist/dom/resume.d.ts +3 -1
  68. package/dist/dom/signals.d.ts +5 -7
  69. package/dist/{dom-C2-Flitp.js → dom-BB-Te-3z.js} +222 -239
  70. package/dist/{dom-DsHYWMCR.mjs → dom-BO-0hzLZ.mjs} +124 -146
  71. package/dist/dom.d.ts +1 -2
  72. package/dist/dom.js +17 -95
  73. package/dist/dom.mjs +6 -79
  74. package/dist/html/assets.d.ts +3 -4
  75. package/dist/html/{compat.d.ts → compat.feat.d.ts} +5 -4
  76. package/dist/html/compat.feat.js +165 -0
  77. package/dist/html/compat.feat.mjs +164 -0
  78. package/dist/html/dynamic-tag.d.ts +1 -2
  79. package/dist/html/for.d.ts +0 -1
  80. package/dist/html/writer.d.ts +4 -3
  81. package/dist/html-DMDc0zKs.mjs +2404 -0
  82. package/dist/html-DrHsybFm.js +2880 -0
  83. package/dist/html.d.ts +1 -2
  84. package/dist/html.js +2 -2578
  85. package/dist/html.mjs +3 -2573
  86. package/dist/translator/index.d.ts +0 -1
  87. package/dist/translator/index.js +4889 -4733
  88. package/dist/translator/interop/out-global.d.ts +5 -0
  89. package/dist/translator/util/assert.d.ts +6 -0
  90. package/dist/translator/util/branch-tag.d.ts +1 -1
  91. package/dist/translator/util/entry-builder.d.ts +1 -1
  92. package/dist/translator/util/finalize-references.d.ts +2 -1
  93. package/dist/translator/util/for-selector.d.ts +1 -1
  94. package/dist/translator/util/known-tag.d.ts +10 -1
  95. package/dist/translator/util/optional.d.ts +0 -1
  96. package/dist/translator/util/reasons.d.ts +0 -1
  97. package/dist/translator/util/references.d.ts +12 -5
  98. package/dist/translator/util/runtime.d.ts +1 -0
  99. package/dist/translator/util/sections.d.ts +11 -2
  100. package/dist/translator/util/signals.d.ts +2 -1
  101. package/dist/translator/util/style-interpolation.d.ts +1 -1
  102. package/dist/translator/util/tag-facts.d.ts +2 -0
  103. package/dist/translator/util/tag-name-type.d.ts +1 -0
  104. package/dist/translator/util/translate-attrs.d.ts +1 -4
  105. package/dist/translator/util/visitors.d.ts +1 -1
  106. package/dist/translator/util/write-guard.d.ts +2 -0
  107. package/dist/translator/visitors/program/index.d.ts +2 -6
  108. package/dist/translator/visitors/referenced-identifier.d.ts +3 -1
  109. package/index.d.ts +2 -7
  110. package/package.json +4 -4
  111. package/dist/common/constants/keyed-scopes-prop.d.ts +0 -4
  112. package/dist/common/constants/keyed-scopes-prop.debug.d.ts +0 -4
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ // src/common/attr-tag.ts
3
+ const empty = [];
4
+ const rest = Symbol("Attribute Tag");
5
+ function attrTag(attrs) {
6
+ attrs[Symbol.iterator] = attrTagIterator;
7
+ attrs[rest] = empty;
8
+ return attrs;
9
+ }
10
+ function attrTags(first, attrs) {
11
+ if (first) {
12
+ if (first[rest] === empty) first[rest] = [attrs];
13
+ else first[rest].push(attrs);
14
+ return first;
15
+ }
16
+ return attrTag(attrs);
17
+ }
18
+ function isAttrTag(value) {
19
+ return !!value?.[rest];
20
+ }
21
+ function* attrTagIterator() {
22
+ yield this;
23
+ yield* this[rest];
24
+ }
2
25
  // src/common/constants/accessor-prefix.debug.ts
3
26
  const BranchScopes$1 = "BranchScopes:";
4
27
  const ClosureScopes = "ClosureScopes:";
@@ -52,8 +75,6 @@ const Changed = "Changed";
52
75
  const ScopesAccessor = "scopesAccessor";
53
76
  const SignalIndexAccessor = "signalIndexAccessor";
54
77
  const Index = "index";
55
- // src/common/constants/keyed-scopes-prop.debug.ts
56
- const PreviousKey = "PreviousKey:";
57
78
  const Scope = "scope";
58
79
  const Signal = "signal";
59
80
  const Value = "value";
@@ -134,7 +155,7 @@ function escapeStyleValue(str) {
134
155
  else if (c === closers[0]) closers = closers.slice(1);
135
156
  return result + closers;
136
157
  }
137
- const toDelimitedString = function toDelimitedString(val, delimiter, stringify) {
158
+ function toDelimitedString(val, delimiter, stringify) {
138
159
  let str = "";
139
160
  let sep = "";
140
161
  let part;
@@ -156,7 +177,7 @@ const toDelimitedString = function toDelimitedString(val, delimiter, stringify)
156
177
  }
157
178
  }
158
179
  return str;
159
- };
180
+ }
160
181
  function isEventHandler(name) {
161
182
  return /^on[A-Z-]/.test(name);
162
183
  }
@@ -169,15 +190,20 @@ function isNotNullishOrFalse(value) {
169
190
  function isPromise(value) {
170
191
  return value != null && typeof value.then === "function";
171
192
  }
193
+ let classAPIRenderer;
194
+ function setClassAPIRenderer(render) {
195
+ classAPIRenderer = render;
196
+ }
172
197
  function normalizeDynamicRenderer(value) {
173
198
  if (value) {
174
199
  if (typeof value === "string") return value;
175
200
  const normalized = value.content || value.default || value;
176
- if (!((typeof normalized === "object" || typeof normalized === "function") && "id" in normalized)) {
177
- if (value.content) throw new Error(`A dynamic tag must be a string tag name (like \`"div"\`) or a Marko template/component, but received an object whose \`content\` is not a template/component.`);
178
- if (typeof value !== "object" && typeof value !== "function") throw new Error(`A dynamic tag must be a string tag name (like \`"div"\`) or a Marko template/component, but received a ${typeof value}.`);
179
- }
180
- if ("id" in normalized) return normalized;
201
+ if (typeof normalized !== "object" && typeof normalized !== "function") throw new Error(`A dynamic tag must be a string tag name (like \`"div"\`) or a Marko template/component, but received ${normalized === value ? `a ${typeof value}` : `an object whose \`content\` or \`default\` is a ${typeof normalized}`}.`);
202
+ if (classAPIRenderer) {
203
+ const renderer = classAPIRenderer(normalized);
204
+ if (renderer || false) return renderer;
205
+ } else if ("id" in normalized) return normalized;
206
+ if (value.content) throw new Error(`A dynamic tag must be a string tag name (like \`"div"\`) or a Marko template/component, but received an object whose \`content\` is not a template/component.`);
181
207
  }
182
208
  }
183
209
  let branchesEnabled;
@@ -288,6 +314,12 @@ function assertNoValueBindingOnCheckable(type, valueChange) {
288
314
  function assertHandlerIsFunction(name, value) {
289
315
  if (value && typeof value !== "function") throw new Error(`The \`${name}\` handler must be a function or a falsey value (\`null\`, \`undefined\`, \`false\`, \`0\`, …), but received type "${typeof value}".`);
290
316
  }
317
+ function assertNoNativeAttrTags(tagName, input) {
318
+ for (const name in input) if (name !== "content" && isAttrTag(input[name])) throw new Error(`A dynamic tag passed the native \`<${tagName}>\` tag an [attribute tag](https://markojs.com/docs/reference/language#attribute-tags) as \`${name}\`, but [native tags](https://markojs.com/docs/reference/native-tag) do not support attribute tags.`);
319
+ }
320
+ function assertValidContent(value, renderer) {
321
+ if (value && !renderer?.["id"]) throw new Error(`The \`content\` attribute on a [native tag](https://markojs.com/docs/reference/native-tag#content) must be body content, a \`<define>\` tag variable or attribute tag holding it, or a falsey value (\`null\`, \`undefined\`, \`false\`, \`0\`, …), but received type "${typeof value}".`);
322
+ }
291
323
  function assertValidTagName(tagName) {
292
324
  if (!/^[a-z][a-z0-9._-]*$/i.test(tagName)) throw new Error(`Invalid tag name: "${tagName}". Tag names must start with a letter and contain only letters, numbers, periods, hyphens, and underscores.`);
293
325
  }
@@ -435,9 +467,9 @@ function prepareEffects(fn) {
435
467
  }
436
468
  return preparedEffects;
437
469
  }
438
- let runEffects = ((effects) => {
470
+ let runEffects = (effects) => {
439
471
  for (let i = 0; i < effects.length;) effects[i++](effects[i++]);
440
- });
472
+ };
441
473
  let runRender = (render) => {
442
474
  if (!branchesEnabled || render["scope"]["#ClosestBranch"]?.["#Gen"] !== 0) render[Signal](render[Scope], render[Value]);
443
475
  };
@@ -487,7 +519,7 @@ function $signal(scope, id) {
487
519
  return ((scope[AbortControllers] ||= {})[id] ||= new AbortController()).signal;
488
520
  }
489
521
  /** Runs `abort` as a destroyed scope's `$signal` would fire, without creating one. */
490
- function trackAbort(scope, id, abort) {
522
+ function onAbort(scope, id, abort) {
491
523
  abortsEnabled = 1;
492
524
  trackCleanup(scope);
493
525
  (scope[AbortControllers] ||= {})[id] = { abort };
@@ -586,7 +618,7 @@ function skipScope() {
586
618
  return nextScopeId++;
587
619
  }
588
620
  function destroyBranch(branch) {
589
- branch[ParentBranch]?.[BranchScopes]?.delete(branch);
621
+ branch[ParentBranch]?.[BranchScopes].delete(branch);
590
622
  destroyNestedScopes(branch);
591
623
  }
592
624
  function destroyScope(scope) {
@@ -595,11 +627,11 @@ function destroyScope(scope) {
595
627
  cleanupScope(scope);
596
628
  }
597
629
  }
598
- const destroyNestedScopes = function destroyNestedScopes(scope) {
630
+ function destroyNestedScopes(scope) {
599
631
  scope[Gen$1] = 0;
600
632
  scope[BranchScopes]?.forEach(destroyNestedScopes);
601
633
  scope[AbortScopes]?.forEach(cleanupScope);
602
- };
634
+ }
603
635
  function cleanupScope(scope) {
604
636
  if (subscriptionsEnabled) scope[Subscriptions]?.forEach(unsubscribe, scope);
605
637
  if (abortsEnabled) for (const id in scope[AbortControllers]) $signalReset(scope, id);
@@ -691,7 +723,8 @@ function _const(valueAccessor, fn) {
691
723
  }
692
724
  });
693
725
  }
694
- function _or(id, fn, defaultPending = 1, scopeIdAccessor = "#Id") {
726
+ function _or(id, fn, defaultPending = 1, scopeIdAccessor) {
727
+ scopeIdAccessor = scopeIdAccessor ? scopeIdAccessor : "#Id";
695
728
  return (scope) => {
696
729
  if (scope["#Gen"] === runId) {
697
730
  if (~id in scope) {
@@ -700,36 +733,33 @@ function _or(id, fn, defaultPending = 1, scopeIdAccessor = "#Id") {
700
733
  } else queueRender(scope, fn, id, 0, scope[scopeIdAccessor]);
701
734
  };
702
735
  }
703
- function _for_closure(ownerLoopNodeAccessor, fn) {
736
+ function _for_closure(ownerLoopNodeAccessor, fn, id, scopeIdAccessor) {
737
+ scopeIdAccessor = scopeIdAccessor ? scopeIdAccessor : "#Id";
704
738
  const scopeAccessor = BranchScopes$1 + ownerLoopNodeAccessor;
705
- const ownerSignal = (ownerScope) => {
706
- const scopes = toArray(ownerScope[scopeAccessor]);
707
- queueRender(ownerScope, (_) => {
708
- for (const scope of scopes) if (scope["#Gen"] > 0 && scope["#Gen"] < runId) fn(scope);
709
- }, -1);
739
+ const render = (ownerScope) => {
740
+ for (const scope of toArray(ownerScope[scopeAccessor])) if (scope["#Gen"] < runId) fn(scope);
710
741
  };
742
+ const ownerSignal = (ownerScope) => queueRender(ownerScope, render, id, 0, ownerScope[scopeIdAccessor]);
711
743
  ownerSignal._ = (scope) => queueRender(scope, fn, -1);
712
744
  return ownerSignal;
713
745
  }
714
- function _for_selector(ownerLoopNodeAccessor, ownerValueAccessor, fn) {
746
+ function _for_selector(ownerLoopNodeAccessor, ownerValueAccessor, fn, getValueScope) {
715
747
  const scopeAccessor = BranchScopes$1 + ownerLoopNodeAccessor;
716
748
  const mapAccessor = KeyedScopes + ownerLoopNodeAccessor;
717
- const prevKeyProp = `${PreviousKey}${ownerValueAccessor}`;
749
+ const prevKey = Symbol(ownerValueAccessor);
718
750
  const ownerSignal = (ownerScope) => {
719
751
  if (ownerScope["#Gen"] < runId) {
720
- const nextKey = ownerScope[ownerValueAccessor];
721
- queueRender(ownerScope, (_) => {
722
- const map = keyedScopes(ownerScope, scopeAccessor, mapAccessor);
723
- if (map && prevKeyProp in map) {
724
- const prevScope = map.get(map[prevKeyProp]);
725
- const nextScope = map.get(nextKey);
726
- if (prevScope !== nextScope) {
727
- runLiveBranch(prevScope, fn);
728
- runLiveBranch(nextScope, fn);
729
- }
730
- } else for (const scope of toArray(ownerScope[scopeAccessor])) runLiveBranch(scope, fn);
731
- if (map) map[prevKeyProp] = nextKey;
732
- }, -1);
752
+ const nextKey = (getValueScope ? getValueScope(ownerScope) : ownerScope)[ownerValueAccessor];
753
+ const map = keyedScopes(ownerScope, scopeAccessor, mapAccessor);
754
+ if (map && prevKey in ownerScope) {
755
+ const prevScope = map.get(ownerScope[prevKey]);
756
+ const nextScope = map.get(nextKey);
757
+ if (prevScope !== nextScope) {
758
+ queueLiveBranch(prevScope, fn);
759
+ queueLiveBranch(nextScope, fn);
760
+ }
761
+ } else for (const scope of toArray(ownerScope[scopeAccessor])) queueLiveBranch(scope, fn);
762
+ ownerScope[prevKey] = nextKey;
733
763
  }
734
764
  };
735
765
  ownerSignal._ = (scope) => queueRender(scope, fn, -1);
@@ -744,8 +774,8 @@ function keyedScopes(ownerScope, scopeAccessor, mapAccessor) {
744
774
  }
745
775
  return map;
746
776
  }
747
- function runLiveBranch(scope, fn) {
748
- if (scope && scope["#Gen"] > 0 && scope["#Gen"] < runId) fn(scope);
777
+ function queueLiveBranch(scope, fn) {
778
+ if (scope?.["#Gen"] < runId) queueRender(scope, fn, -1);
749
779
  }
750
780
  function _if_closure(ownerConditionalNodeAccessor, branch, fn) {
751
781
  const scopeAccessor = BranchScopes$1 + ownerConditionalNodeAccessor;
@@ -814,9 +844,7 @@ function _id(scope, accessor) {
814
844
  }
815
845
  function _script(id, fn) {
816
846
  _resumed[id] = fn;
817
- return (scope) => {
818
- queueEffect(scope, fn);
819
- };
847
+ return (scope) => queueEffect(scope, fn);
820
848
  }
821
849
  function _global_read($global, key) {
822
850
  if (!(key in $global)) console.error(`\`$global.${key}\` is not serialized to the client, so this read is \`undefined\`. Serialized globals are embedded in the page: add \`${key}\` to \`serializedGlobals\` at the render call only if it holds no secrets; otherwise copy the field the client needs into its own \`$global\` key and serialize that.`);
@@ -856,7 +884,7 @@ function walk(startNode, walkCodes, branch) {
856
884
  currentNode = startNode;
857
885
  walkInternal(0, walkCodes, branch);
858
886
  }
859
- const walkInternal = function walkInternal(currentWalkIndex, walkCodes, scope) {
887
+ function walkInternal(currentWalkIndex, walkCodes, scope) {
860
888
  let value;
861
889
  let currentMultiplier;
862
890
  let storedMultiplier = 0;
@@ -892,7 +920,7 @@ const walkInternal = function walkInternal(currentWalkIndex, walkCodes, scope) {
892
920
  storedMultiplier = currentMultiplier * 10 + value - 117;
893
921
  }
894
922
  }
895
- };
923
+ }
896
924
  function getDebugKey(index, node) {
897
925
  if (typeof node === "string") return `${node}/${index}`;
898
926
  else if (node.nodeType === 3) return `#text/${index}`;
@@ -944,168 +972,166 @@ function init(runtimeId = "M") {
944
972
  }
945
973
  const renders = self[runtimeId];
946
974
  const defineRuntime = (desc) => Object.defineProperty(self, runtimeId, desc);
947
- const initRuntime = (renders) => {
948
- defineRuntime({ value: curRenders = ((renderId) => {
949
- const render = curRenders[renderId] = renders[renderId] || renders(renderId);
950
- const walk = render.w;
951
- const scopeLookup = {};
952
- const pending = [];
953
- const getScope = (id) => scopeLookup[id] || (+id ? initScope(scopeLookup[id] = { ["#Id"]: +id }) : initGlobal());
954
- const initGlobal = (_) => scopeLookup[0] ||= {
955
- runtimeId,
956
- renderId
957
- };
958
- const initScope = (scope) => {
959
- scope[Gen$1] ??= 1;
960
- scope[Global] = initGlobal();
961
- if (branchesEnabled && scope["#ClosestBranchId"]) scope[ClosestBranch] = getScope(scope[ClosestBranchId]);
962
- return scope;
963
- };
964
- const applyScopes = (partials) => {
965
- let scopeId = partials[0];
966
- for (let i = 1; i < partials.length; i++) {
967
- const partial = partials[i];
968
- if (typeof partial === "number") scopeId += partial;
969
- else {
970
- if (scopeId) initScope(Object.assign(scopeLookup[scopeId] ||= (partial["#Id"] = scopeId, partial), partial));
971
- else Object.assign(initGlobal(), partial);
972
- scopeId++;
973
- }
975
+ const initRuntime = (renders) => defineRuntime({ value: curRenders = ((renderId) => {
976
+ const render = curRenders[renderId] = renders[renderId] || renders(renderId);
977
+ const walk = render.w;
978
+ const scopeLookup = {};
979
+ const pending = [];
980
+ const getScope = (id) => scopeLookup[id] || (+id ? initScope(scopeLookup[id] = { ["#Id"]: +id }) : initGlobal());
981
+ const initGlobal = (_) => scopeLookup[0] ||= {
982
+ runtimeId,
983
+ renderId
984
+ };
985
+ const initScope = (scope) => {
986
+ scope[Gen$1] ??= 1;
987
+ scope[Global] = initGlobal();
988
+ if (branchesEnabled && scope["#ClosestBranchId"]) scope[ClosestBranch] = getScope(scope[ClosestBranchId]);
989
+ return scope;
990
+ };
991
+ const applyScopes = (partials) => {
992
+ let scopeId = partials[0];
993
+ for (let i = 1; i < partials.length; i++) {
994
+ const partial = partials[i];
995
+ if (typeof partial === "number") scopeId += partial;
996
+ else {
997
+ if (scopeId) initScope(Object.assign(scopeLookup[scopeId] ||= (partial["#Id"] = scopeId, partial), partial));
998
+ else Object.assign(initGlobal(), partial);
999
+ scopeId++;
974
1000
  }
975
- };
976
- const serializeContext = ((data, registryId) => typeof data === "number" ? registryId ? _resumed[registryId](getScope(data)) : getScope(data) : applyScopes(data));
977
- const createVisitBranches = (branchScopesStack = [], branchStarts = [], curBranchScopes, reorderBranch, reorderDepth = 0, adopt = (scope, branch) => scope["#ClosestBranch"] === scope ? scope !== branch && setParentBranch(scope, branch) : scope[ClosestBranch] = branch) => {
978
- return (branchId, branch, endedBranches, accessor, nodeAccessor, singleNode, parent = visit.parentNode, startVisit = visit) => {
979
- if (visitType === "*") {
980
- while (reorderBranch && pending.length >= reorderDepth) adopt(pending.pop(), reorderBranch);
981
- if (reorderBranch = +lastToken && visitScope) reorderDepth = pending.push(reorderBranch);
982
- return;
983
- }
984
- if (visitType !== "[") {
985
- visitScope[nextToken()] = visitType === ")" || visitType === "}" ? parent : visit;
986
- accessor = BranchScopes$1 + (nodeAccessor = lastToken);
987
- singleNode = visitType !== "]" && visitType !== ")";
988
- nextToken();
989
- }
990
- while (branchId = +lastToken) {
991
- (endedBranches ||= []).push(branch = getScope(branchId));
992
- setParentBranch(branch, branch[ClosestBranch]);
993
- if (branch["#AwaitCounter"] = render.p?.[branchId]) branch[AwaitCounter].m = render.m;
994
- if (singleNode) {
995
- while (startVisit.previousSibling && (startVisit = startVisit.previousSibling).nodeType > 1);
996
- branch["_"] ??= visitScope;
997
- branch[EndNode] = branch[StartNode] = startVisit;
998
- if (visitType === "(") branch[getDebugKey(0, startVisit)] = startVisit;
999
- } else {
1000
- branch[BranchAccessor] = nodeAccessor;
1001
- curBranchScopes = push(curBranchScopes, branch);
1002
- if (accessor) {
1003
- visitScope[accessor] = curBranchScopes;
1004
- forEach(curBranchScopes, (scope) => scope["_"] ??= visitScope);
1005
- curBranchScopes = branchScopesStack.pop();
1006
- }
1007
- startVisit = branchStarts.pop();
1008
- if (parent !== startVisit.parentNode) parent.prepend(startVisit);
1009
- branch[StartNode] = startVisit;
1010
- branch[EndNode] = visit.previousSibling === startVisit ? startVisit : parent.insertBefore(new Text(), visit);
1001
+ }
1002
+ };
1003
+ const serializeContext = ((data, registryId) => typeof data === "number" ? registryId ? _resumed[registryId](getScope(data)) : getScope(data) : applyScopes(data));
1004
+ const createVisitBranches = (branchScopesStack = [], branchStarts = [], curBranchScopes, reorderBranch, reorderDepth = 0, adopt = (scope, branch) => scope["#ClosestBranch"] === scope ? scope !== branch && setParentBranch(scope, branch) : scope[ClosestBranch] = branch) => {
1005
+ return (branchId, branch, endedBranches, accessor, nodeAccessor, singleNode, parent = visit.parentNode, startVisit = visit) => {
1006
+ if (visitType === "*") {
1007
+ while (reorderBranch && pending.length >= reorderDepth) adopt(pending.pop(), reorderBranch);
1008
+ if (reorderBranch = +lastToken && visitScope) reorderDepth = pending.push(reorderBranch);
1009
+ return;
1010
+ }
1011
+ if (visitType !== "[") {
1012
+ visitScope[nextToken()] = visitType === ")" || visitType === "}" ? parent : visit;
1013
+ accessor = BranchScopes$1 + (nodeAccessor = lastToken);
1014
+ singleNode = visitType !== "]" && visitType !== ")";
1015
+ nextToken();
1016
+ }
1017
+ while (branchId = +lastToken) {
1018
+ (endedBranches ||= []).push(branch = getScope(branchId));
1019
+ setParentBranch(branch, branch[ClosestBranch]);
1020
+ if (branch["#AwaitCounter"] = render.p?.[branchId]) branch[AwaitCounter].m = render.m;
1021
+ if (singleNode) {
1022
+ while (startVisit.previousSibling && (startVisit = startVisit.previousSibling).nodeType > 1);
1023
+ branch["_"] ??= visitScope;
1024
+ branch[EndNode] = branch[StartNode] = startVisit;
1025
+ if (visitType === "(") branch[getDebugKey(0, startVisit)] = startVisit;
1026
+ } else {
1027
+ branch[BranchAccessor] = nodeAccessor;
1028
+ curBranchScopes = push(curBranchScopes, branch);
1029
+ if (accessor) {
1030
+ visitScope[accessor] = curBranchScopes;
1031
+ forEach(curBranchScopes, (scope) => scope["_"] ??= visitScope);
1032
+ curBranchScopes = branchScopesStack.pop();
1011
1033
  }
1012
- while (pending.at(-1)?.["#Id"] >= branchId) adopt(pending.pop(), branch);
1013
- nextToken();
1034
+ startVisit = branchStarts.pop();
1035
+ if (parent !== startVisit.parentNode) parent.prepend(startVisit);
1036
+ branch[StartNode] = startVisit;
1037
+ branch[EndNode] = visit.previousSibling === startVisit ? startVisit : parent.insertBefore(new Text(), visit);
1014
1038
  }
1015
- if (endedBranches) {
1016
- for (const ended of endedBranches) pending.push(ended);
1017
- if (singleNode) visitScope[accessor] = endedBranches.length > 1 ? endedBranches.reverse() : endedBranches[0];
1039
+ while (pending.at(-1)?.["#Id"] >= branchId) adopt(pending.pop(), branch);
1040
+ nextToken();
1041
+ }
1042
+ if (endedBranches) {
1043
+ for (const ended of endedBranches) pending.push(ended);
1044
+ if (singleNode) visitScope[accessor] = endedBranches.length > 1 ? endedBranches.reverse() : endedBranches[0];
1045
+ }
1046
+ if (visitType === "[") {
1047
+ if (!endedBranches) {
1048
+ branchScopesStack.push(curBranchScopes);
1049
+ curBranchScopes = void 0;
1018
1050
  }
1019
- if (visitType === "[") {
1020
- if (!endedBranches) {
1021
- branchScopesStack.push(curBranchScopes);
1022
- curBranchScopes = void 0;
1023
- }
1024
- branchStarts.push(visit);
1025
- } else pending.push(visitScope);
1026
- };
1051
+ branchStarts.push(visit);
1052
+ } else pending.push(visitScope);
1027
1053
  };
1028
- const nextToken = (_) => lastToken = visitText.slice(lastTokenIndex, (lastTokenIndex = visitText.indexOf(" ", lastTokenIndex) + 1 || visitText.length + 1) - 1);
1029
- const processResumes = (resumes = [], effects) => {
1030
- let i = 0;
1031
- for (; i < resumes.length; i++) {
1032
- const serialized = resumes[i];
1033
- if (typeof serialized === "string") {
1034
- lastTokenIndex = 0;
1035
- visitText = serialized;
1036
- while (nextToken()) if (/\D/.test(lastToken)) lastEffect = _resumed[lastToken];
1037
- else effects.push(lastEffect, getScope(lastToken));
1038
- } else if (Array.isArray(serialized)) {
1039
- if (!(readyIds && serialized.every((dep) => readyIds.has(dep) && !render.b[dep].length))) break;
1040
- } else if (readyIds && typeof serialized === "number") break;
1041
- else {
1042
- const scopes = serialized(serializeContext);
1043
- if (Array.isArray(scopes)) applyScopes(scopes);
1044
- }
1054
+ };
1055
+ const nextToken = (_) => lastToken = visitText.slice(lastTokenIndex, (lastTokenIndex = visitText.indexOf(" ", lastTokenIndex) + 1 || visitText.length + 1) - 1);
1056
+ const processResumes = (resumes = [], effects) => {
1057
+ let i = 0;
1058
+ for (; i < resumes.length; i++) {
1059
+ const serialized = resumes[i];
1060
+ if (typeof serialized === "string") {
1061
+ lastTokenIndex = 0;
1062
+ visitText = serialized;
1063
+ while (nextToken()) if (/\D/.test(lastToken)) lastEffect = _resumed[lastToken];
1064
+ else effects.push(lastEffect, getScope(lastToken));
1065
+ } else if (readyIds && typeof serialized !== "function") {
1066
+ if (typeof serialized === "number" || !Object.keys(serialized).every((dep) => readyIds.has(dep) && (render.b[dep]?.n || 0) >= serialized[dep])) break;
1067
+ } else {
1068
+ if (readyIds) resumes.n = (resumes.n || 0) + 1;
1069
+ const scopes = serialized(serializeContext);
1070
+ if (Array.isArray(scopes)) applyScopes(scopes);
1045
1071
  }
1046
- resumes.splice(0, i);
1047
- return i;
1048
- };
1049
- let lastEffect;
1050
- let visits;
1051
- let visit;
1052
- let visitText;
1053
- let visitType;
1054
- let visitScope;
1055
- let lastToken;
1056
- let lastTokenIndex;
1057
- let visitBranches;
1058
- let htmlStart;
1059
- let embedAnchor;
1060
- serializeContext._ = _resumed;
1061
- if (render.m) throw new Error(`Marko rendered multiple times with $global.runtimeId as ${JSON.stringify(runtimeId)} and $global.renderId as ${JSON.stringify(renderId)}. Ensure each render into a page has a unique $global.renderId.`);
1062
- for (const otherId in curRenders) if (otherId !== renderId && (otherId.startsWith(renderId) || renderId.startsWith(otherId))) console.error(`Marko rendered with $global.runtimeId as ${JSON.stringify(runtimeId)} and $global.renderId as both ${JSON.stringify(otherId)} and ${JSON.stringify(renderId)}, so one render claims the other's resume comments. Ensure no $global.renderId in a page starts another.`);
1063
- render.m = (effects) => {
1064
- processResumes(render.r, effects);
1065
- if (readyIds && render.b) for (let progress = 1; progress;) {
1066
- progress = 0;
1067
- for (const readyId of readyIds) {
1068
- const resumes = render.b[readyId];
1069
- if (resumes && processResumes(resumes, effects)) progress = 1;
1070
- }
1072
+ }
1073
+ resumes.splice(0, i);
1074
+ return i;
1075
+ };
1076
+ let lastEffect;
1077
+ let visits;
1078
+ let visit;
1079
+ let visitText;
1080
+ let visitType;
1081
+ let visitScope;
1082
+ let lastToken;
1083
+ let lastTokenIndex;
1084
+ let visitBranches;
1085
+ let htmlStart;
1086
+ let embedAnchor;
1087
+ serializeContext._ = _resumed;
1088
+ if (render.m) throw new Error(`Marko rendered multiple times with $global.runtimeId as ${JSON.stringify(runtimeId)} and $global.renderId as ${JSON.stringify(renderId)}. Ensure each render into a page has a unique $global.renderId.`);
1089
+ for (const otherId in curRenders) if (otherId !== renderId && (otherId.startsWith(renderId) || renderId.startsWith(otherId))) console.error(`Marko rendered with $global.runtimeId as ${JSON.stringify(runtimeId)} and $global.renderId as both ${JSON.stringify(otherId)} and ${JSON.stringify(renderId)}, so one render claims the other's resume comments. Ensure no $global.renderId in a page starts another.`);
1090
+ render.m = (effects) => {
1091
+ processResumes(render.r, effects);
1092
+ if (readyIds && render.b) for (let progress = 1; progress;) {
1093
+ progress = 0;
1094
+ for (const readyId of readyIds) {
1095
+ const resumes = render.b[readyId];
1096
+ if (resumes && processResumes(resumes, effects)) progress = 1;
1071
1097
  }
1072
- let retained = 0;
1073
- for (visit of visits = render.v) {
1074
- lastTokenIndex = render.i.length;
1075
- visitText = visit.data;
1076
- visitType = visitText[lastTokenIndex++];
1077
- visitScope = getScope(nextToken());
1078
- if (dynamicHtmlEnabled && visitType > "%" && visitType <= "'") {
1079
- if (visitType === "&") htmlStart = visit;
1080
- else {
1081
- if (visit.parentNode !== htmlStart.parentNode) console.error("An unescaped placeholder (`$!{}`) rendered HTML that does not parse as a balanced fragment where it is placed (an unclosed, stray or misnested tag), so updating it removes the wrong nodes.");
1082
- visitScope[nextToken()] = htmlStart;
1083
- visitScope[DynamicHTMLLastChild + lastToken] = visit;
1084
- if ((branchesEnabled || lazyEnabled) && pending[pending.length - 1] !== visitScope) pending.push(visitScope);
1085
- }
1086
- } else if (branchesEnabled && visitType > "'") (visitBranches ||= createVisitBranches())();
1087
- else if (lazyEnabled && render.b && visitType > "%") visits[retained++] = visit;
1098
+ }
1099
+ let retained = 0;
1100
+ for (visit of visits = render.v) {
1101
+ lastTokenIndex = render.i.length;
1102
+ visitText = visit.data;
1103
+ visitType = visitText[lastTokenIndex++];
1104
+ visitScope = getScope(nextToken());
1105
+ if (dynamicHtmlEnabled && visitType > "%" && visitType <= "'") {
1106
+ if (visitType === "&") htmlStart = visit;
1088
1107
  else {
1089
- visitScope[nextToken()] = visitType === "%" ? visit.parentNode.insertBefore(new Text(), visit) : visit.previousSibling;
1108
+ if (visit.parentNode !== htmlStart.parentNode) console.error("An unescaped placeholder (`$!{}`) rendered HTML that does not parse as a balanced fragment where it is placed (an unclosed, stray or misnested tag), so updating it removes the wrong nodes.");
1109
+ visitScope[nextToken()] = htmlStart;
1110
+ visitScope[DynamicHTMLLastChild + lastToken] = visit;
1090
1111
  if ((branchesEnabled || lazyEnabled) && pending[pending.length - 1] !== visitScope) pending.push(visitScope);
1091
1112
  }
1092
- if (embedRenders && !embedAnchor && visit.parentNode) embedRenders.set(embedAnchor = visit.parentNode.insertBefore(new Text(), visit), [renderId, scopeLookup]);
1093
- }
1094
- if (branchesEnabled && visitBranches) {
1095
- visitType = "*";
1096
- lastToken = "";
1097
- visitBranches();
1113
+ } else if (branchesEnabled && visitType > "'") (visitBranches ||= createVisitBranches())();
1114
+ else if (lazyEnabled && render.b && visitType > "%") visits[retained++] = visit;
1115
+ else {
1116
+ visitScope[nextToken()] = visitType === "%" ? visit.parentNode.insertBefore(new Text(), visit) : visit.previousSibling;
1117
+ if ((branchesEnabled || lazyEnabled) && pending[pending.length - 1] !== visitScope) pending.push(visitScope);
1098
1118
  }
1099
- visits.length = retained;
1100
- return effects;
1101
- };
1102
- render.w = (_) => {
1103
- walk();
1104
- runResumeEffects(render);
1105
- };
1106
- return render;
1107
- }) });
1108
- };
1119
+ if (embedRenders && !embedAnchor && visit.parentNode) embedRenders.set(embedAnchor = visit.parentNode.insertBefore(new Text(), visit), [renderId, scopeLookup]);
1120
+ }
1121
+ if (branchesEnabled && visitBranches) {
1122
+ visitType = "*";
1123
+ lastToken = "";
1124
+ visitBranches();
1125
+ }
1126
+ visits.length = retained;
1127
+ return effects;
1128
+ };
1129
+ render.w = (_) => {
1130
+ walk();
1131
+ runResumeEffects(render);
1132
+ };
1133
+ return render;
1134
+ }) });
1109
1135
  if (renders) {
1110
1136
  initRuntime(renders);
1111
1137
  for (const renderId in renders) runResumeEffects(curRenders(renderId));
@@ -1136,7 +1162,7 @@ function _el(id, accessor) {
1136
1162
  function _dynamic_tag_var_resume(accessor) {
1137
1163
  _resumed[DYNAMIC_TAG_VAR_REGISTER_ID + accessor] = (scope) => (_) => {
1138
1164
  const node = scope[accessor];
1139
- return _el_read(node.nodeType === 8 ? node.previousSibling : node);
1165
+ return _el_read(node.nodeType > 1 ? node.previousSibling : node);
1140
1166
  };
1141
1167
  }
1142
1168
  // src/dom/renderer.ts
@@ -1170,11 +1196,8 @@ function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
1170
1196
  walks = walks ? walks.replace(/[^\0-1]+$/, "") : "";
1171
1197
  setup = setup ? setup._ || setup : void 0;
1172
1198
  params ||= void 0;
1173
- const clone = template ? (branch, ns) => {
1174
- ((cloneCache[ns] ||= {})[1 + template] ||= createCloneableHTML(template, ns))(branch, walks);
1175
- } : (branch) => {
1176
- walk(branch[StartNode] = branch[EndNode] = new Text(), walks, branch);
1177
- };
1199
+ const cloneables = {};
1200
+ const clone = template ? (branch, ns) => (cloneables[ns] ||= createCloneableHTML(template, walks, ns))(branch) : (branch) => walk(branch[StartNode] = branch[EndNode] = new Text(), walks, branch);
1178
1201
  return _resumed[id] = (owner) => {
1179
1202
  return {
1180
1203
  ["id"]: id,
@@ -1214,14 +1237,11 @@ function _content_closures(renderer, closureFns) {
1214
1237
  return instance;
1215
1238
  };
1216
1239
  }
1217
- const cloneCache = {};
1218
- function createCloneableHTML(html, ns) {
1240
+ function createCloneableHTML(html, walks, ns) {
1219
1241
  const { firstChild, lastChild } = parseHTML(html, ns);
1220
1242
  const parent = new DocumentFragment();
1221
1243
  insertChildNodes(parent, null, firstChild, lastChild);
1222
- return firstChild === lastChild && firstChild.nodeType < 8 ? (branch, walks) => {
1223
- walk(branch[StartNode] = branch[EndNode] = firstChild.cloneNode(true), walks, branch);
1224
- } : (branch, walks) => {
1244
+ return firstChild === lastChild && firstChild.nodeType < 8 ? (branch) => walk(branch[StartNode] = branch[EndNode] = firstChild.cloneNode(true), walks, branch) : (branch) => {
1225
1245
  const clone = parent.cloneNode(true);
1226
1246
  clone.namespaceURI = ns;
1227
1247
  walk(clone.firstChild, walks, branch);
@@ -1358,8 +1378,11 @@ function attrsInternal(scope, nodeAccessor, nextAttrs, controllable) {
1358
1378
  }
1359
1379
  }
1360
1380
  }
1361
- function _attr_content(scope, nodeAccessor, value) {
1362
- const content = normalizeClientRender(value);
1381
+ function _attr_content(scope, nodeAccessor, content) {
1382
+ var value = content;
1383
+ content = content?.content || content;
1384
+ if (classAPIRenderer && content) content = classAPIRenderer(content);
1385
+ assertValidContent(value, content);
1363
1386
  if (scope["ConditionalRenderer:" + nodeAccessor] !== (scope["ConditionalRenderer:" + nodeAccessor] = rendererKey(content))) {
1364
1387
  setBranch(scope, nodeAccessor, content, createAndSetupBranch);
1365
1388
  if (content?.["accessor"]) subscribeToScopeSet(content[Owner], content[Accessor], scope[BranchScopes$1 + nodeAccessor]);
@@ -1394,13 +1417,6 @@ const _html = /*@__PURE__*/ withDynamicHtml(function _html(scope, value, accesso
1394
1417
  removeChildNodes(firstChild, lastChild);
1395
1418
  }
1396
1419
  });
1397
- function normalizeClientRender(value) {
1398
- const renderer = normalizeDynamicRenderer(value);
1399
- if (renderer) {
1400
- if (renderer["id"]) return renderer;
1401
- else throw new Error(`Invalid \`content\` attribute. Received ${typeof value}`);
1402
- }
1403
- }
1404
1420
  function normalizeAttrValue(value) {
1405
1421
  if (isNotNullishOrFalse(value)) return value === true ? "" : value + "";
1406
1422
  }
@@ -1417,7 +1433,7 @@ function _lifecycle(scope, thisObj, index = 0) {
1417
1433
  Object.assign(thisObj, thisObj.onMount?.());
1418
1434
  for (const prop in snapshot) if (!Object.is(snapshot[prop], thisObj[prop])) throw new Error(`Tried to overwrite existing property "${prop}" in <lifecycle> onMount.`);
1419
1435
  }
1420
- trackAbort(scope, accessor, (_) => thisObj.onDestroy?.());
1436
+ onAbort(scope, accessor, (_) => thisObj.onDestroy?.());
1421
1437
  }
1422
1438
  }
1423
1439
  function removeChildNodes(startNode, endNode) {
@@ -1779,7 +1795,7 @@ function _await_promise(nodeAccessor, params) {
1779
1795
  let awaitCounter = tryBranch[AwaitCounter];
1780
1796
  if (!scope[tryAccessor]) {
1781
1797
  scope[tryAccessor] = tryBranch;
1782
- trackAbort(scope, promiseAccessor, (_) => {
1798
+ onAbort(scope, promiseAccessor, (_) => {
1783
1799
  scope[promiseAccessor] = 0;
1784
1800
  if (scope[tryAccessor]) queueAsyncRender(scope[tryAccessor], completeAwaitCounter, awaitCounter);
1785
1801
  });
@@ -1957,7 +1973,7 @@ const _show = /*@__PURE__*/ withBranches((nodeAccessor, startNodeAccessor) => {
1957
1973
  const rangeAccessor = BranchScopes$1 + nodeAccessor;
1958
1974
  return (scope, display) => {
1959
1975
  const referenceNode = scope[nodeAccessor];
1960
- const onlyChild = referenceNode.nodeType === 1;
1976
+ const onlyChild = referenceNode.nodeType < 3;
1961
1977
  const parentNode = onlyChild ? referenceNode : referenceNode.parentNode;
1962
1978
  let range = scope[rangeAccessor];
1963
1979
  if (!range) {
@@ -1978,9 +1994,6 @@ const _show = /*@__PURE__*/ withBranches((nodeAccessor, startNodeAccessor) => {
1978
1994
  function rendererKey(renderer) {
1979
1995
  return renderer?.["owner"] ? renderer["id"] + " " + renderer[Owner]["#Id"] : renderer?.["id"] || renderer;
1980
1996
  }
1981
- function patchDynamicTag(fn) {
1982
- _dynamic_tag = fn(_dynamic_tag);
1983
- }
1984
1997
  let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagVar, inputIsArgs) => {
1985
1998
  const scopeOffsetAccessor = getTagVar && getDebugKey(+nodeAccessor.slice(nodeAccessor.lastIndexOf("/") + 1) + 1, "#scopeOffset");
1986
1999
  const childScopeAccessor = BranchScopes$1 + nodeAccessor;
@@ -1994,12 +2007,7 @@ let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagV
1994
2007
  bindTagVar(scope, branch, scope[scopeOffsetAccessor], tagNameOrRenderer);
1995
2008
  }
1996
2009
  if (typeof tagNameOrRenderer !== "string") setupBranch(tagNameOrRenderer, branch);
1997
- else if (getContent) {
1998
- const content = getContent(scope);
1999
- const elementAccessor = `#${tagNameOrRenderer.toLowerCase()}/0`;
2000
- setBranch(branch, elementAccessor, content, createAndSetupBranch);
2001
- if (content["accessor"]) subscribeToScopeSet(content[Owner], content[Accessor], branch[BranchScopes$1 + elementAccessor]);
2002
- }
2010
+ else if (getContent) _attr_content(branch, `#${tagNameOrRenderer.toLowerCase()}/0`, getContent(scope));
2003
2011
  return branch;
2004
2012
  };
2005
2013
  return (scope, newRenderer, getInput) => {
@@ -2018,6 +2026,7 @@ let _dynamic_tag = /*@__PURE__*/ withBranches((nodeAccessor, getContent, getTagV
2018
2026
  const args = getInput?.();
2019
2027
  if (typeof normalizedRenderer === "string") {
2020
2028
  const nodeAccessor = `#${normalizedRenderer.toLowerCase()}/0`;
2029
+ assertNoNativeAttrTags(normalizedRenderer, inputIsArgs ? args[0] : args);
2021
2030
  (getContent ? _attrs : _attrs_content)(childScope, nodeAccessor, (inputIsArgs ? args[0] : args) || {}, controllableSpreadHelpers[childScope[nodeAccessor].tagName]);
2022
2031
  if (childScope["EventAttributes:" + nodeAccessor] || childScope["ControlledHandler:" + nodeAccessor]) queueEffect(childScope, dynamicTagScript);
2023
2032
  } else {
@@ -2095,7 +2104,7 @@ const loop = /*@__PURE__*/ withBranches((forEach, reorder) => (nodeAccessor, tem
2095
2104
  const oldScope = oldScopes[i];
2096
2105
  let branch = oldLen && (oldScopesByKey || key !== (oldScope?.["#LoopKey"] ?? i) ? (oldScopesByKey ||= oldScopes.reduce((map, scope, j) => j < i ? map : (scope["#LoopIndex"] = j, map.set(scope["#LoopKey"] ?? j, scope)), /* @__PURE__ */ new Map())).get(key) : oldScope && (start++, oldScope));
2097
2106
  if (branch) {
2098
- hasPotentialMoves = true;
2107
+ hasPotentialMoves = 1;
2099
2108
  oldScopesByKey?.delete(key);
2100
2109
  branch[LoopKey] = key;
2101
2110
  } else {
@@ -2913,6 +2922,18 @@ Object.defineProperty(exports, "_var_resume", {
2913
2922
  return _var_resume;
2914
2923
  }
2915
2924
  });
2925
+ Object.defineProperty(exports, "attrTag", {
2926
+ enumerable: true,
2927
+ get: function() {
2928
+ return attrTag;
2929
+ }
2930
+ });
2931
+ Object.defineProperty(exports, "attrTags", {
2932
+ enumerable: true,
2933
+ get: function() {
2934
+ return attrTags;
2935
+ }
2936
+ });
2916
2937
  Object.defineProperty(exports, "controllableScripts", {
2917
2938
  enumerable: true,
2918
2939
  get: function() {
@@ -3021,10 +3042,10 @@ Object.defineProperty(exports, "installDynamicTagVar", {
3021
3042
  return installDynamicTagVar;
3022
3043
  }
3023
3044
  });
3024
- Object.defineProperty(exports, "patchDynamicTag", {
3045
+ Object.defineProperty(exports, "onAbort", {
3025
3046
  enumerable: true,
3026
3047
  get: function() {
3027
- return patchDynamicTag;
3048
+ return onAbort;
3028
3049
  }
3029
3050
  });
3030
3051
  Object.defineProperty(exports, "prepareEffects", {
@@ -3105,6 +3126,12 @@ Object.defineProperty(exports, "runPendingEffects", {
3105
3126
  return runPendingEffects;
3106
3127
  }
3107
3128
  });
3129
+ Object.defineProperty(exports, "setClassAPIRenderer", {
3130
+ enumerable: true,
3131
+ get: function() {
3132
+ return setClassAPIRenderer;
3133
+ }
3134
+ });
3108
3135
  Object.defineProperty(exports, "setupBranch", {
3109
3136
  enumerable: true,
3110
3137
  get: function() {