marko 6.4.16 → 6.5.1

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 (97) hide show
  1. package/cheatsheet.md +12 -1
  2. package/dist/debug/dom/catch.feat.js +2 -2
  3. package/dist/debug/dom/catch.feat.mjs +2 -2
  4. package/dist/debug/dom/compat.feat.js +1 -1
  5. package/dist/debug/dom/compat.feat.mjs +1 -1
  6. package/dist/debug/dom/controllable-input.feat.js +1 -1
  7. package/dist/debug/dom/controllable-input.feat.mjs +1 -1
  8. package/dist/debug/dom/controllable-open.feat.js +1 -1
  9. package/dist/debug/dom/controllable-open.feat.mjs +1 -1
  10. package/dist/debug/dom/controllable-select.feat.js +1 -1
  11. package/dist/debug/dom/controllable-select.feat.mjs +1 -1
  12. package/dist/debug/dom/controllable-textarea.feat.js +1 -1
  13. package/dist/debug/dom/controllable-textarea.feat.mjs +1 -1
  14. package/dist/debug/dom/controllable.feat.js +1 -1
  15. package/dist/debug/dom/controllable.feat.mjs +1 -1
  16. package/dist/debug/dom/dynamic-tag-script.feat.js +1 -1
  17. package/dist/debug/dom/dynamic-tag-script.feat.mjs +1 -1
  18. package/dist/debug/dom/dynamic-tag-var.feat.js +1 -1
  19. package/dist/debug/dom/dynamic-tag-var.feat.mjs +1 -1
  20. package/dist/debug/dom/lazy.feat.js +1 -1
  21. package/dist/debug/dom/lazy.feat.mjs +1 -1
  22. package/dist/debug/dom/placeholder.feat.js +1 -1
  23. package/dist/debug/dom/placeholder.feat.mjs +1 -1
  24. package/dist/debug/{dom-DlBA4dCe.mjs → dom-4AzxJQHb.mjs} +16 -16
  25. package/dist/debug/{dom-BLoTKI2r.js → dom-Uu_OCdvg.js} +21 -21
  26. package/dist/debug/dom.js +1 -1
  27. package/dist/debug/dom.mjs +1 -1
  28. package/dist/debug/html/compat.feat.js +1 -1
  29. package/dist/debug/html/compat.feat.mjs +1 -1
  30. package/dist/debug/{html-DM7X2D_b.mjs → html-Bfl3MJP9.mjs} +27 -24
  31. package/dist/debug/{html-Du0z056z.js → html-shBfuhlc.js} +27 -24
  32. package/dist/debug/html.js +1 -1
  33. package/dist/debug/html.mjs +1 -1
  34. package/dist/dom/catch.feat.js +3 -3
  35. package/dist/dom/catch.feat.mjs +2 -2
  36. package/dist/dom/compat.feat.js +1 -1
  37. package/dist/dom/compat.feat.mjs +1 -1
  38. package/dist/dom/control-flow.d.ts +8 -8
  39. package/dist/dom/controllable-input.feat.js +1 -1
  40. package/dist/dom/controllable-input.feat.mjs +1 -1
  41. package/dist/dom/controllable-open.feat.js +1 -1
  42. package/dist/dom/controllable-open.feat.mjs +1 -1
  43. package/dist/dom/controllable-select.feat.js +1 -1
  44. package/dist/dom/controllable-select.feat.mjs +1 -1
  45. package/dist/dom/controllable-textarea.feat.js +1 -1
  46. package/dist/dom/controllable-textarea.feat.mjs +1 -1
  47. package/dist/dom/controllable.feat.js +1 -1
  48. package/dist/dom/controllable.feat.mjs +1 -1
  49. package/dist/dom/dynamic-tag-script.feat.js +1 -1
  50. package/dist/dom/dynamic-tag-script.feat.mjs +1 -1
  51. package/dist/dom/dynamic-tag-var.feat.js +1 -1
  52. package/dist/dom/dynamic-tag-var.feat.mjs +1 -1
  53. package/dist/dom/lazy.feat.js +1 -1
  54. package/dist/dom/lazy.feat.mjs +1 -1
  55. package/dist/dom/placeholder.feat.js +1 -1
  56. package/dist/dom/placeholder.feat.mjs +1 -1
  57. package/dist/{dom-BRtFOIF-.js → dom-BdJeggv5.js} +14 -14
  58. package/dist/{dom-Cqajrs_w.mjs → dom-DJrZXgdr.mjs} +13 -13
  59. package/dist/dom.js +2 -2
  60. package/dist/dom.mjs +1 -1
  61. package/dist/html/compat.feat.js +1 -1
  62. package/dist/html/compat.feat.mjs +1 -1
  63. package/dist/html/writer.d.ts +0 -1
  64. package/dist/{html-C3dQGQ2x.mjs → html-BD-y50wS.mjs} +25 -22
  65. package/dist/{html-4A3vJpIT.js → html-aFBpTKdf.js} +25 -22
  66. package/dist/html.js +1 -1
  67. package/dist/html.mjs +1 -1
  68. package/dist/translator/core/define.d.ts +6 -0
  69. package/dist/translator/core/if.d.ts +1 -1
  70. package/dist/translator/core/show.d.ts +3 -4
  71. package/dist/translator/index.js +3880 -3971
  72. package/dist/translator/util/assert.d.ts +0 -8
  73. package/dist/translator/util/bindings.d.ts +15 -8
  74. package/dist/translator/util/branch-tag.d.ts +1 -1
  75. package/dist/translator/util/cyclic-memo.d.ts +0 -1
  76. package/dist/translator/util/entry-builder.d.ts +2 -3
  77. package/dist/translator/util/finalize-references.d.ts +0 -1
  78. package/dist/translator/util/for-selector.d.ts +0 -1
  79. package/dist/translator/util/get-root.d.ts +3 -1
  80. package/dist/translator/util/module-registrations.d.ts +1 -0
  81. package/dist/translator/util/nested-attribute-tags.d.ts +4 -5
  82. package/dist/translator/util/optional.d.ts +7 -6
  83. package/dist/translator/util/params-tree.d.ts +1 -1
  84. package/dist/translator/util/reasons.d.ts +1 -2
  85. package/dist/translator/util/references.d.ts +6 -5
  86. package/dist/translator/util/sections.d.ts +8 -2
  87. package/dist/translator/util/signals.d.ts +1 -1
  88. package/dist/translator/util/slots.d.ts +1 -2
  89. package/dist/translator/util/solve-reasons.d.ts +2 -2
  90. package/dist/translator/util/state.d.ts +2 -2
  91. package/dist/translator/util/structure.d.ts +1 -0
  92. package/dist/translator/util/to-property-name.d.ts +0 -2
  93. package/dist/translator/util/visitors.d.ts +2 -2
  94. package/dist/translator/util/writer.d.ts +2 -2
  95. package/dist/translator/visitors/tag/native-tag.d.ts +2 -0
  96. package/index.d.ts +11 -0
  97. package/package.json +4 -4
package/cheatsheet.md CHANGED
@@ -94,12 +94,18 @@ Don't fetch while rendering: start data loads early, pass the promise through th
94
94
 
95
95
  ## Components
96
96
 
97
- - File `src/tags/product-card.marko` is auto-discovered as `<product-card>` from any template (no import needed). Attributes arrive as `input`: `${input.title}`.
97
+ - File `src/tags/product-card.marko` is auto-discovered as `<product-card>` from any template (no import needed). Attributes arrive as `input` (`${input.title}`), typed by the template's `export interface Input` (see TypeScript).
98
98
  - Body content renders where the child places `<${input.content}/>`, and the child can hand it values: `<${input.content}(x, y)/>` in the child, `<my-tag|count, total|>${count}</my-tag>` in the parent. Placement is the child's: put it inside a `<for>` and the body appears once per item, each with its own values (`<for|...args| to=input.to><${input.content}(...args)/></>`). Those values exist only inside that body.
99
99
  - `<return=value>` publishes one value into the parent's scope, named by a tag variable; from there it is an ordinary value in that template. A native tag variable's value is itself a function returning the element, so `<div/el>` is read as `el()`. So: body parameters when the value belongs to the nested markup, including one set per item where the child loops; a tag variable when the parent needs one value outside the body. A tag var on a child that never returns is `undefined`.
100
100
 
101
101
  ```marko
102
102
  /* src/tags/toggle-section.marko */
103
+ export interface Input {
104
+ title: string;
105
+ startExpanded?: boolean;
106
+ content: Marko.Body;
107
+ }
108
+
103
109
  <let/open=input.startExpanded ?? false>
104
110
  <button onClick() { open = !open }>${input.title}</button>
105
111
  <if=open><div><${input.content}/></div></if>
@@ -121,6 +127,11 @@ Don't fetch while rendering: start data loads early, pass the promise through th
121
127
  </my-card>
122
128
 
123
129
  /* src/tags/my-card.marko */
130
+ export interface Input {
131
+ header: Marko.AttrTag<{ content: Marko.Body }>;
132
+ content: Marko.Body;
133
+ }
134
+
124
135
  <div class="card">
125
136
  <header><${input.header.content}/></header>
126
137
  <${input.content}/>
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BLoTKI2r.js");
2
+ const require_control_flow = require("../dom-Uu_OCdvg.js");
3
3
  // src/dom/catch.feat.ts
4
4
  const deferToPendingTry = (fn, scope, branch) => {
5
5
  while (branch) {
6
- if (branch["#AwaitCounter"]?.i) return (scope[require_control_flow.PendingEffects] ||= ((branch[require_control_flow.PendingEffectScopes] ||= (branch["#AwaitCounter"].m && ((complete) => branch["#AwaitCounter"].c = (_) => complete() || require_control_flow.queueAsyncRender(branch, require_control_flow.queueEffect, require_control_flow.runPendingEffects))(branch["#AwaitCounter"].c), [])).push(scope), /* @__PURE__ */ new Set())).add(fn);
6
+ if (branch["#AwaitCounter"]?.i) return (scope[require_control_flow.PendingEffects] ||= ((branch[require_control_flow.PendingEffectScopes] ||= (branch["#AwaitCounter"].m && ((complete) => branch["#AwaitCounter"].c = (_) => complete() || require_control_flow.queueAsyncRender(branch, require_control_flow.queuePendingEffects))(branch["#AwaitCounter"].c), [])).push(scope), /* @__PURE__ */ new Set())).add(fn);
7
7
  branch = branch[require_control_flow.ParentBranch];
8
8
  }
9
9
  };
@@ -1,8 +1,8 @@
1
- import { Bn as ParentBranch, Fn as ClosestBranch, Hn as PendingEffects, Mn as Scope, Un as PendingRenders, Vn as PendingEffectScopes, _ as renderCatch, an as installCatch, cn as queueEffect, jn as Pending, sn as queueAsyncRender, v as runPendingEffects } from "../dom-DlBA4dCe.mjs";
1
+ import { Bn as ParentBranch, Fn as ClosestBranch, Hn as PendingEffects, Mn as Scope, Un as PendingRenders, Vn as PendingEffectScopes, _ as queuePendingEffects, an as installCatch, jn as Pending, sn as queueAsyncRender, v as renderCatch } from "../dom-4AzxJQHb.mjs";
2
2
  // src/dom/catch.feat.ts
3
3
  const deferToPendingTry = (fn, scope, branch) => {
4
4
  while (branch) {
5
- if (branch["#AwaitCounter"]?.i) return (scope[PendingEffects] ||= ((branch[PendingEffectScopes] ||= (branch["#AwaitCounter"].m && ((complete) => branch["#AwaitCounter"].c = (_) => complete() || queueAsyncRender(branch, queueEffect, runPendingEffects))(branch["#AwaitCounter"].c), [])).push(scope), /* @__PURE__ */ new Set())).add(fn);
5
+ if (branch["#AwaitCounter"]?.i) return (scope[PendingEffects] ||= ((branch[PendingEffectScopes] ||= (branch["#AwaitCounter"].m && ((complete) => branch["#AwaitCounter"].c = (_) => complete() || queueAsyncRender(branch, queuePendingEffects))(branch["#AwaitCounter"].c), [])).push(scope), /* @__PURE__ */ new Set())).add(fn);
6
6
  branch = branch[ParentBranch];
7
7
  }
8
8
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_control_flow = require("../dom-BLoTKI2r.js");
3
+ const require_control_flow = require("../dom-Uu_OCdvg.js");
4
4
  // src/common/compat-meta.ts
5
5
  const SET_SCOPE_REGISTER_ID = "$compat_setScope";
6
6
  const RENDER_BODY_ID = "$compat_renderBody";
@@ -1,4 +1,4 @@
1
- import { An as Setup, Dn as Owner, En as LocalClosures, Gn as StartNode, In as EndNode, On as Params, Rn as Global, Sn as setClassAPIRenderer, St as init, cn as queueEffect, dt as _content, fn as runEffects, gt as setupBranch, ht as createBranch, ln as queueRender, on as prepareEffects, qt as destroyBranch, un as rendering, wn as Clone, xt as getRegisteredWithScope, yt as _resumed } from "../dom-DlBA4dCe.mjs";
1
+ import { An as Setup, Dn as Owner, En as LocalClosures, Gn as StartNode, In as EndNode, On as Params, Rn as Global, Sn as setClassAPIRenderer, St as init, cn as queueEffect, dt as _content, fn as runEffects, gt as setupBranch, ht as createBranch, ln as queueRender, on as prepareEffects, qt as destroyBranch, un as rendering, wn as Clone, xt as getRegisteredWithScope, yt as _resumed } from "../dom-4AzxJQHb.mjs";
2
2
  // src/common/compat-meta.ts
3
3
  const SET_SCOPE_REGISTER_ID = "$compat_setScope";
4
4
  const RENDER_BODY_ID = "$compat_renderBody";
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BLoTKI2r.js");
2
+ const require_control_flow = require("../dom-Uu_OCdvg.js");
3
3
  // src/dom/controllable-input.feat.ts
4
4
  require_control_flow.controllableScripts[0] = require_control_flow._attr_input_checked_script;
5
5
  require_control_flow.controllableScripts[1] = require_control_flow._attr_input_checkedValue_script;
@@ -1,4 +1,4 @@
1
- import { E as _attr_input_checkedValue_script, N as _attr_input_value_script, O as _attr_input_checked_script, V as controllableScripts } from "../dom-DlBA4dCe.mjs";
1
+ import { E as _attr_input_checkedValue_script, N as _attr_input_value_script, O as _attr_input_checked_script, V as controllableScripts } from "../dom-4AzxJQHb.mjs";
2
2
  // src/dom/controllable-input.feat.ts
3
3
  controllableScripts[0] = _attr_input_checked_script;
4
4
  controllableScripts[1] = _attr_input_checkedValue_script;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BLoTKI2r.js");
2
+ const require_control_flow = require("../dom-Uu_OCdvg.js");
3
3
  // src/dom/controllable-open.feat.ts
4
4
  require_control_flow.controllableScripts[4] = require_control_flow._attr_details_or_dialog_open_script;
@@ -1,3 +1,3 @@
1
- import { S as _attr_details_or_dialog_open_script, V as controllableScripts } from "../dom-DlBA4dCe.mjs";
1
+ import { S as _attr_details_or_dialog_open_script, V as controllableScripts } from "../dom-4AzxJQHb.mjs";
2
2
  // src/dom/controllable-open.feat.ts
3
3
  controllableScripts[4] = _attr_details_or_dialog_open_script;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BLoTKI2r.js");
2
+ const require_control_flow = require("../dom-Uu_OCdvg.js");
3
3
  // src/dom/controllable-select.feat.ts
4
4
  require_control_flow.controllableScripts[3] = require_control_flow._attr_select_value_script;
@@ -1,3 +1,3 @@
1
- import { I as _attr_select_value_script, V as controllableScripts } from "../dom-DlBA4dCe.mjs";
1
+ import { I as _attr_select_value_script, V as controllableScripts } from "../dom-4AzxJQHb.mjs";
2
2
  // src/dom/controllable-select.feat.ts
3
3
  controllableScripts[3] = _attr_select_value_script;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BLoTKI2r.js");
2
+ const require_control_flow = require("../dom-Uu_OCdvg.js");
3
3
  // src/dom/controllable-textarea.feat.ts
4
4
  require_control_flow.controllableScripts[2] = require_control_flow._attr_input_value_script;
@@ -1,3 +1,3 @@
1
- import { N as _attr_input_value_script, V as controllableScripts } from "../dom-DlBA4dCe.mjs";
1
+ import { N as _attr_input_value_script, V as controllableScripts } from "../dom-4AzxJQHb.mjs";
2
2
  // src/dom/controllable-textarea.feat.ts
3
3
  controllableScripts[2] = _attr_input_value_script;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BLoTKI2r.js");
2
+ const require_control_flow = require("../dom-Uu_OCdvg.js");
3
3
  require("./controllable-input.feat.js");
4
4
  require("./controllable-open.feat.js");
5
5
  require("./controllable-select.feat.js");
@@ -1,4 +1,4 @@
1
- import { B as _controllable_textarea, H as controllableSpreadHelpers, L as _controllable_input, R as _controllable_open, z as _controllable_select } from "../dom-DlBA4dCe.mjs";
1
+ import { B as _controllable_textarea, H as controllableSpreadHelpers, L as _controllable_input, R as _controllable_open, z as _controllable_select } from "../dom-4AzxJQHb.mjs";
2
2
  import "./controllable-input.feat.mjs";
3
3
  import "./controllable-open.feat.mjs";
4
4
  import "./controllable-select.feat.mjs";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BLoTKI2r.js");
2
+ const require_control_flow = require("../dom-Uu_OCdvg.js");
3
3
  // src/dom/dynamic-tag-script.feat.ts
4
4
  require_control_flow._resumed[require_control_flow.DYNAMIC_TAG_SCRIPT_REGISTER_ID] = require_control_flow.withBranches(require_control_flow.dynamicTagScript);
@@ -1,3 +1,3 @@
1
- import { Cn as withBranches, Zt as DYNAMIC_TAG_SCRIPT_REGISTER_ID, h as dynamicTagScript, yt as _resumed } from "../dom-DlBA4dCe.mjs";
1
+ import { Cn as withBranches, Zt as DYNAMIC_TAG_SCRIPT_REGISTER_ID, h as dynamicTagScript, yt as _resumed } from "../dom-4AzxJQHb.mjs";
2
2
  // src/dom/dynamic-tag-script.feat.ts
3
3
  _resumed[DYNAMIC_TAG_SCRIPT_REGISTER_ID] = withBranches(dynamicTagScript);
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BLoTKI2r.js");
2
+ const require_control_flow = require("../dom-Uu_OCdvg.js");
3
3
  // src/dom/dynamic-tag-var.feat.ts
4
4
  require_control_flow.installBranchRenders();
5
5
  require_control_flow.installDynamicTagVar((scope, branch, scopeKey, renderer) => {
@@ -1,4 +1,4 @@
1
- import { At as _el_read, Gn as StartNode, Kn as TagVariable, Pn as BranchRenders, g as installDynamicTagVar, in as installBranchRenders, rn as createBranchRenders } from "../dom-DlBA4dCe.mjs";
1
+ import { At as _el_read, Gn as StartNode, Kn as TagVariable, Pn as BranchRenders, g as installDynamicTagVar, in as installBranchRenders, rn as createBranchRenders } from "../dom-4AzxJQHb.mjs";
2
2
  // src/dom/dynamic-tag-var.feat.ts
3
3
  installBranchRenders();
4
4
  installDynamicTagVar((scope, branch, scopeKey, renderer) => {
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  // src/dom/lazy.feat.ts
3
- require("../dom-BLoTKI2r.js").withLazy();
3
+ require("../dom-Uu_OCdvg.js").withLazy();
@@ -1,3 +1,3 @@
1
- import { Et as withLazy } from "../dom-DlBA4dCe.mjs";
1
+ import { Et as withLazy } from "../dom-4AzxJQHb.mjs";
2
2
  // src/dom/lazy.feat.ts
3
3
  withLazy();
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const require_control_flow = require("../dom-BLoTKI2r.js");
2
+ const require_control_flow = require("../dom-Uu_OCdvg.js");
3
3
  // src/dom/placeholder.feat.ts
4
4
  require_control_flow._resumed[require_control_flow.PLACEHOLDER_DISMISS_REGISTER_ID] = (tryBranch) => {
5
5
  if (tryBranch["#PlaceholderBranch"]) {
@@ -1,4 +1,4 @@
1
- import { Qt as PLACEHOLDER_DISMISS_REGISTER_ID, Wn as PlaceholderBranch, qt as destroyBranch, yt as _resumed } from "../dom-DlBA4dCe.mjs";
1
+ import { Qt as PLACEHOLDER_DISMISS_REGISTER_ID, Wn as PlaceholderBranch, qt as destroyBranch, yt as _resumed } from "../dom-4AzxJQHb.mjs";
2
2
  // src/dom/placeholder.feat.ts
3
3
  _resumed[PLACEHOLDER_DISMISS_REGISTER_ID] = (tryBranch) => {
4
4
  if (tryBranch["#PlaceholderBranch"]) {
@@ -1776,7 +1776,7 @@ function _await_promise(nodeAccessor, params) {
1776
1776
  insertBranchBefore(awaitBranch, scope[nodeAccessor].parentNode, scope[nodeAccessor]);
1777
1777
  referenceNode.remove();
1778
1778
  }
1779
- params?.(awaitBranch, [value]);
1779
+ params?.(awaitBranch, value);
1780
1780
  return awaitBranch;
1781
1781
  };
1782
1782
  const awaitPromise = (scope, promise) => {
@@ -1904,13 +1904,13 @@ function createAwaitCounter(tryBranch, done) {
1904
1904
  if (awaitCounter.i < 1) throw new Error("An await counter completed more counts than it took.");
1905
1905
  if (--awaitCounter.i) return 1;
1906
1906
  done();
1907
- queueEffect(tryBranch, runPendingEffects);
1907
+ queuePendingEffects(tryBranch);
1908
1908
  }
1909
1909
  };
1910
1910
  return awaitCounter;
1911
1911
  }
1912
- function runPendingEffects(tryBranch) {
1913
- tryBranch[PendingEffectScopes]?.forEach((scope) => scope[PendingEffects].forEach((fn) => runEffects([fn, scope]), scope[PendingEffects] = null), tryBranch[PendingEffectScopes] = null);
1912
+ function queuePendingEffects(tryBranch) {
1913
+ tryBranch[PendingEffectScopes]?.forEach((scope) => scope[PendingEffects].forEach((fn) => queueEffect(scope, fn), scope[PendingEffects] = null), tryBranch[PendingEffectScopes] = null);
1914
1914
  }
1915
1915
  function dismissPlaceholder(tryBranch) {
1916
1916
  const placeholderBranch = tryBranch[PlaceholderBranch];
@@ -1947,7 +1947,7 @@ function renderCatch(scope, error) {
1947
1947
  setBranch(owner, tryWithCatch[BranchAccessor], catchContent, createBranch);
1948
1948
  queueRender(owner[BranchScopes$1 + tryWithCatch[BranchAccessor]], (branch) => {
1949
1949
  setupBranch(catchContent, branch);
1950
- catchContent[Params]?.(branch, [error]);
1950
+ catchContent[Params]?.(branch, error);
1951
1951
  }, -1);
1952
1952
  }
1953
1953
  }
@@ -2099,7 +2099,7 @@ const loop = /*@__PURE__*/ withBranches((forEach, reorder) => (nodeAccessor, tem
2099
2099
  let hasPotentialMoves;
2100
2100
  let start = 0;
2101
2101
  var seenKeys = /* @__PURE__ */ new Set();
2102
- forEach(value, (key, args) => {
2102
+ forEach(value, (key, a, b) => {
2103
2103
  assertValidLoopKey(key, seenKeys);
2104
2104
  const i = newScopes.length;
2105
2105
  const oldScope = oldScopes[i];
@@ -2113,7 +2113,7 @@ const loop = /*@__PURE__*/ withBranches((forEach, reorder) => (nodeAccessor, tem
2113
2113
  setupBranch(renderer, branch);
2114
2114
  }
2115
2115
  newScopes.push(branch);
2116
- params?.(branch, args);
2116
+ params?.(branch, a, b);
2117
2117
  });
2118
2118
  scope[scopesAccessor] = newScopes;
2119
2119
  const newLen = newScopes.length;
@@ -2154,24 +2154,24 @@ const loop = /*@__PURE__*/ withBranches((forEach, reorder) => (nodeAccessor, tem
2154
2154
  });
2155
2155
  const _for_of = /*@__PURE__*/ loop(([all, by], cb) => {
2156
2156
  by ||= bySecondArg;
2157
- if (typeof by === "string") forOf(all, (item, i) => cb(item[by], [item, i]));
2158
- else forOf(all, (item, i) => cb(by(item, i), [item, i]));
2157
+ if (typeof by === "string") forOf(all, (item, i) => cb(item[by], item, i));
2158
+ else forOf(all, (item, i) => cb(by(item, i), item, i));
2159
2159
  }, reorderKeyed);
2160
2160
  const _for_in = /*@__PURE__*/ loop(([obj, by], cb) => {
2161
2161
  by ||= byFirstArg;
2162
- forIn(obj, (key, value) => cb(by(key, value), [key, value]));
2162
+ forIn(obj, (key, value) => cb(by(key, value), key, value));
2163
2163
  }, reorderKeyed);
2164
2164
  const _for_to = /*@__PURE__*/ loop(([to, from, step, by], cb) => {
2165
2165
  by ||= byFirstArg;
2166
- forTo(to, from, step, (v) => cb(by(v), [v]));
2166
+ forTo(to, from, step, (v) => cb(by(v), v));
2167
2167
  }, reorderKeyed);
2168
2168
  const _for_until = /*@__PURE__*/ loop(([until, from, step, by], cb) => {
2169
2169
  by ||= byFirstArg;
2170
- forUntil(until, from, step, (v) => cb(by(v), [v]));
2170
+ forUntil(until, from, step, (v) => cb(by(v), v));
2171
2171
  }, reorderKeyed);
2172
- const _for_of_unkeyed = /*@__PURE__*/ loop(([all], cb) => forOf(all, (item, i) => cb(i, [item, i])));
2173
- const _for_to_unkeyed = /*@__PURE__*/ loop(([to, from, step], cb) => forTo(to, from, step, (v) => cb(v, [v])));
2174
- const _for_until_unkeyed = /*@__PURE__*/ loop(([until, from, step], cb) => forUntil(until, from, step, (v) => cb(v, [v])));
2172
+ const _for_of_unkeyed = /*@__PURE__*/ loop(([all], cb) => forOf(all, (item, i) => cb(i, item, i)));
2173
+ const _for_to_unkeyed = /*@__PURE__*/ loop(([to, from, step], cb) => forTo(to, from, step, (v) => cb(v, v)));
2174
+ const _for_until_unkeyed = /*@__PURE__*/ loop(([until, from, step], cb) => forUntil(until, from, step, (v) => cb(v, v)));
2175
2175
  function reorderKeyed(newScopes, start, newEnd, parentNode, afterReference) {
2176
2176
  const diffLen = newEnd - start + 1;
2177
2177
  const sources = new Array(diffLen);
@@ -2221,4 +2221,4 @@ function bySecondArg(_item, index) {
2221
2221
  function byFirstArg(name) {
2222
2222
  return name;
2223
2223
  }
2224
- export { _attrs as $, _on as $t, _attr_input_value_attribute_default as A, Setup as An, _el_read as At, _controllable_textarea as B, ParentBranch as Bn, _or as Bt, _attr_input_checked as C, withBranches as Cn, initEmbedded as Ct, _attr_input_checked_default as D, Owner as Dn, _closure as Dt, _attr_input_checkedValue_script as E, LocalClosures as En, withLazy as Et, _attr_select_value_default as F, ClosestBranch as Fn, _hoist_resume as Ft, _attr_class_item as G, StartNode as Gn, _var_change as Gt, controllableSpreadHelpers as H, PendingEffects as Hn, _return_change as Ht, _attr_select_value_script as I, EndNode as In, _id as It, _attr_content as J, attrTags as Jn, insertBranchBefore as Jt, _attr_class_items as K, TagVariable as Kn, _assert_init as Kt, _controllable_input as L, Gen$1 as Ln, _if_closure as Lt, _attr_input_value_dynamic_default as M, Scope as Mn, _for_selector as Mt, _attr_input_value_script as N, AwaitCounter as Nn, _global_read as Nt, _attr_input_checked_script as O, Params as On, _closure_get as Ot, _attr_select_value as P, BranchRenders as Pn, _hoist as Pt, _attr_style_items as Q, PLACEHOLDER_DISMISS_REGISTER_ID as Qt, _controllable_open as R, Global as Rn, _let as Rt, _attr_details_or_dialog_open_script as S, setClassAPIRenderer as Sn, init as St, _attr_input_checkedValue_default as T, Lazy as Tn, readyFailed as Tt, _attr as U, PendingRenders as Un, _script as Ut, controllableScripts as V, PendingEffectScopes as Vn, _return as Vt, _attr_class as W, PlaceholderBranch as Wn, _var as Wt, _attr_style as X, syncGen as Xt, _attr_nonce as Y, removeAndDestroyBranch as Yt, _attr_style_item as Z, DYNAMIC_TAG_SCRIPT_REGISTER_ID as Zt, renderCatch as _, forUntil as _n, _dynamic_tag_var_resume as _t, _for_in as a, installCatch as an, _lifecycle as at, _attr_details_or_dialog_open as b, _hoist_read_error as bn, _var_resume as bt, _for_to as c, queueEffect as cn, _text as ct, _for_until_unkeyed as d, run as dn, _content as dt, $signal as en, _attrs_content as et, _if as f, runEffects as fn, _content_closures as ft, installDynamicTagVar as g, forTo as gn, setupBranch as gt, dynamicTagScript as h, forOf as hn, createBranch as ht, _dynamic_tag_content as i, installBranchRenders as in, _html as it, _attr_input_value_default as j, Pending as jn, _for_closure as jt, _attr_input_value as k, Returns as kn, _const as kt, _for_to_unkeyed as l, queueRender as ln, _text_content as lt, _try as m, forIn as mn, _return_setup as mt, _await_promise as n, onAbort as nn, _attrs_partial_content as nt, _for_of as o, prepareEffects as on, _style_rule_item as ot, _show as p, runId as pn, _content_closures_resume as pt, _attr_class_names as q, attrTag as qn, destroyBranch as qt, _dynamic_tag as r, createBranchRenders as rn, _attrs_script as rt, _for_of_unkeyed as s, queueAsyncRender as sn, _style_shell as st, _await_content as t, $signalReset as tn, _attrs_partial as tt, _for_until as u, rendering as un, _to_text as ut, runPendingEffects as v, _assert_class_toggles as vn, _el as vt, _attr_input_checkedValue as w, Clone as wn, ready as wt, _attr_details_or_dialog_open_default as x, _call as xn, getRegisteredWithScope as xt, startAwait as y, _assert_hoist as yn, _resumed as yt, _controllable_select as z, Load as zn, _let_change as zt };
2224
+ export { _attrs as $, _on as $t, _attr_input_value_attribute_default as A, Setup as An, _el_read as At, _controllable_textarea as B, ParentBranch as Bn, _or as Bt, _attr_input_checked as C, withBranches as Cn, initEmbedded as Ct, _attr_input_checked_default as D, Owner as Dn, _closure as Dt, _attr_input_checkedValue_script as E, LocalClosures as En, withLazy as Et, _attr_select_value_default as F, ClosestBranch as Fn, _hoist_resume as Ft, _attr_class_item as G, StartNode as Gn, _var_change as Gt, controllableSpreadHelpers as H, PendingEffects as Hn, _return_change as Ht, _attr_select_value_script as I, EndNode as In, _id as It, _attr_content as J, attrTags as Jn, insertBranchBefore as Jt, _attr_class_items as K, TagVariable as Kn, _assert_init as Kt, _controllable_input as L, Gen$1 as Ln, _if_closure as Lt, _attr_input_value_dynamic_default as M, Scope as Mn, _for_selector as Mt, _attr_input_value_script as N, AwaitCounter as Nn, _global_read as Nt, _attr_input_checked_script as O, Params as On, _closure_get as Ot, _attr_select_value as P, BranchRenders as Pn, _hoist as Pt, _attr_style_items as Q, PLACEHOLDER_DISMISS_REGISTER_ID as Qt, _controllable_open as R, Global as Rn, _let as Rt, _attr_details_or_dialog_open_script as S, setClassAPIRenderer as Sn, init as St, _attr_input_checkedValue_default as T, Lazy as Tn, readyFailed as Tt, _attr as U, PendingRenders as Un, _script as Ut, controllableScripts as V, PendingEffectScopes as Vn, _return as Vt, _attr_class as W, PlaceholderBranch as Wn, _var as Wt, _attr_style as X, syncGen as Xt, _attr_nonce as Y, removeAndDestroyBranch as Yt, _attr_style_item as Z, DYNAMIC_TAG_SCRIPT_REGISTER_ID as Zt, queuePendingEffects as _, forUntil as _n, _dynamic_tag_var_resume as _t, _for_in as a, installCatch as an, _lifecycle as at, _attr_details_or_dialog_open as b, _hoist_read_error as bn, _var_resume as bt, _for_to as c, queueEffect as cn, _text as ct, _for_until_unkeyed as d, run as dn, _content as dt, $signal as en, _attrs_content as et, _if as f, runEffects as fn, _content_closures as ft, installDynamicTagVar as g, forTo as gn, setupBranch as gt, dynamicTagScript as h, forOf as hn, createBranch as ht, _dynamic_tag_content as i, installBranchRenders as in, _html as it, _attr_input_value_default as j, Pending as jn, _for_closure as jt, _attr_input_value as k, Returns as kn, _const as kt, _for_to_unkeyed as l, queueRender as ln, _text_content as lt, _try as m, forIn as mn, _return_setup as mt, _await_promise as n, onAbort as nn, _attrs_partial_content as nt, _for_of as o, prepareEffects as on, _style_rule_item as ot, _show as p, runId as pn, _content_closures_resume as pt, _attr_class_names as q, attrTag as qn, destroyBranch as qt, _dynamic_tag as r, createBranchRenders as rn, _attrs_script as rt, _for_of_unkeyed as s, queueAsyncRender as sn, _style_shell as st, _await_content as t, $signalReset as tn, _attrs_partial as tt, _for_until as u, rendering as un, _to_text as ut, renderCatch as v, _assert_class_toggles as vn, _el as vt, _attr_input_checkedValue as w, Clone as wn, ready as wt, _attr_details_or_dialog_open_default as x, _call as xn, getRegisteredWithScope as xt, startAwait as y, _assert_hoist as yn, _resumed as yt, _controllable_select as z, Load as zn, _let_change as zt };
@@ -1777,7 +1777,7 @@ function _await_promise(nodeAccessor, params) {
1777
1777
  insertBranchBefore(awaitBranch, scope[nodeAccessor].parentNode, scope[nodeAccessor]);
1778
1778
  referenceNode.remove();
1779
1779
  }
1780
- params?.(awaitBranch, [value]);
1780
+ params?.(awaitBranch, value);
1781
1781
  return awaitBranch;
1782
1782
  };
1783
1783
  const awaitPromise = (scope, promise) => {
@@ -1905,13 +1905,13 @@ function createAwaitCounter(tryBranch, done) {
1905
1905
  if (awaitCounter.i < 1) throw new Error("An await counter completed more counts than it took.");
1906
1906
  if (--awaitCounter.i) return 1;
1907
1907
  done();
1908
- queueEffect(tryBranch, runPendingEffects);
1908
+ queuePendingEffects(tryBranch);
1909
1909
  }
1910
1910
  };
1911
1911
  return awaitCounter;
1912
1912
  }
1913
- function runPendingEffects(tryBranch) {
1914
- tryBranch[PendingEffectScopes]?.forEach((scope) => scope[PendingEffects].forEach((fn) => runEffects([fn, scope]), scope[PendingEffects] = null), tryBranch[PendingEffectScopes] = null);
1913
+ function queuePendingEffects(tryBranch) {
1914
+ tryBranch[PendingEffectScopes]?.forEach((scope) => scope[PendingEffects].forEach((fn) => queueEffect(scope, fn), scope[PendingEffects] = null), tryBranch[PendingEffectScopes] = null);
1915
1915
  }
1916
1916
  function dismissPlaceholder(tryBranch) {
1917
1917
  const placeholderBranch = tryBranch[PlaceholderBranch];
@@ -1948,7 +1948,7 @@ function renderCatch(scope, error) {
1948
1948
  setBranch(owner, tryWithCatch[BranchAccessor], catchContent, createBranch);
1949
1949
  queueRender(owner[BranchScopes$1 + tryWithCatch[BranchAccessor]], (branch) => {
1950
1950
  setupBranch(catchContent, branch);
1951
- catchContent[Params]?.(branch, [error]);
1951
+ catchContent[Params]?.(branch, error);
1952
1952
  }, -1);
1953
1953
  }
1954
1954
  }
@@ -2100,7 +2100,7 @@ const loop = /*@__PURE__*/ withBranches((forEach, reorder) => (nodeAccessor, tem
2100
2100
  let hasPotentialMoves;
2101
2101
  let start = 0;
2102
2102
  var seenKeys = /* @__PURE__ */ new Set();
2103
- forEach(value, (key, args) => {
2103
+ forEach(value, (key, a, b) => {
2104
2104
  assertValidLoopKey(key, seenKeys);
2105
2105
  const i = newScopes.length;
2106
2106
  const oldScope = oldScopes[i];
@@ -2114,7 +2114,7 @@ const loop = /*@__PURE__*/ withBranches((forEach, reorder) => (nodeAccessor, tem
2114
2114
  setupBranch(renderer, branch);
2115
2115
  }
2116
2116
  newScopes.push(branch);
2117
- params?.(branch, args);
2117
+ params?.(branch, a, b);
2118
2118
  });
2119
2119
  scope[scopesAccessor] = newScopes;
2120
2120
  const newLen = newScopes.length;
@@ -2155,24 +2155,24 @@ const loop = /*@__PURE__*/ withBranches((forEach, reorder) => (nodeAccessor, tem
2155
2155
  });
2156
2156
  const _for_of = /*@__PURE__*/ loop(([all, by], cb) => {
2157
2157
  by ||= bySecondArg;
2158
- if (typeof by === "string") forOf(all, (item, i) => cb(item[by], [item, i]));
2159
- else forOf(all, (item, i) => cb(by(item, i), [item, i]));
2158
+ if (typeof by === "string") forOf(all, (item, i) => cb(item[by], item, i));
2159
+ else forOf(all, (item, i) => cb(by(item, i), item, i));
2160
2160
  }, reorderKeyed);
2161
2161
  const _for_in = /*@__PURE__*/ loop(([obj, by], cb) => {
2162
2162
  by ||= byFirstArg;
2163
- forIn(obj, (key, value) => cb(by(key, value), [key, value]));
2163
+ forIn(obj, (key, value) => cb(by(key, value), key, value));
2164
2164
  }, reorderKeyed);
2165
2165
  const _for_to = /*@__PURE__*/ loop(([to, from, step, by], cb) => {
2166
2166
  by ||= byFirstArg;
2167
- forTo(to, from, step, (v) => cb(by(v), [v]));
2167
+ forTo(to, from, step, (v) => cb(by(v), v));
2168
2168
  }, reorderKeyed);
2169
2169
  const _for_until = /*@__PURE__*/ loop(([until, from, step, by], cb) => {
2170
2170
  by ||= byFirstArg;
2171
- forUntil(until, from, step, (v) => cb(by(v), [v]));
2171
+ forUntil(until, from, step, (v) => cb(by(v), v));
2172
2172
  }, reorderKeyed);
2173
- const _for_of_unkeyed = /*@__PURE__*/ loop(([all], cb) => forOf(all, (item, i) => cb(i, [item, i])));
2174
- const _for_to_unkeyed = /*@__PURE__*/ loop(([to, from, step], cb) => forTo(to, from, step, (v) => cb(v, [v])));
2175
- const _for_until_unkeyed = /*@__PURE__*/ loop(([until, from, step], cb) => forUntil(until, from, step, (v) => cb(v, [v])));
2173
+ const _for_of_unkeyed = /*@__PURE__*/ loop(([all], cb) => forOf(all, (item, i) => cb(i, item, i)));
2174
+ const _for_to_unkeyed = /*@__PURE__*/ loop(([to, from, step], cb) => forTo(to, from, step, (v) => cb(v, v)));
2175
+ const _for_until_unkeyed = /*@__PURE__*/ loop(([until, from, step], cb) => forUntil(until, from, step, (v) => cb(v, v)));
2176
2176
  function reorderKeyed(newScopes, start, newEnd, parentNode, afterReference) {
2177
2177
  const diffLen = newEnd - start + 1;
2178
2178
  const sources = new Array(diffLen);
@@ -3062,6 +3062,12 @@ Object.defineProperty(exports, "queueEffect", {
3062
3062
  return queueEffect;
3063
3063
  }
3064
3064
  });
3065
+ Object.defineProperty(exports, "queuePendingEffects", {
3066
+ enumerable: true,
3067
+ get: function() {
3068
+ return queuePendingEffects;
3069
+ }
3070
+ });
3065
3071
  Object.defineProperty(exports, "queueRender", {
3066
3072
  enumerable: true,
3067
3073
  get: function() {
@@ -3116,12 +3122,6 @@ Object.defineProperty(exports, "runId", {
3116
3122
  return runId;
3117
3123
  }
3118
3124
  });
3119
- Object.defineProperty(exports, "runPendingEffects", {
3120
- enumerable: true,
3121
- get: function() {
3122
- return runPendingEffects;
3123
- }
3124
- });
3125
3125
  Object.defineProperty(exports, "setClassAPIRenderer", {
3126
3126
  enumerable: true,
3127
3127
  get: function() {
package/dist/debug/dom.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_control_flow = require("./dom-BLoTKI2r.js");
3
+ const require_control_flow = require("./dom-Uu_OCdvg.js");
4
4
  // src/dom/template.ts
5
5
  const _template = (id, template, walks, setup, inputSignal) => {
6
6
  const renderer = require_control_flow._content(id, template, walks, setup, inputSignal)();
@@ -1,4 +1,4 @@
1
- import { $ as _attrs, $t as _on, A as _attr_input_value_attribute_default, An as Setup, At as _el_read, B as _controllable_textarea, Bt as _or, C as _attr_input_checked, Ct as initEmbedded, D as _attr_input_checked_default, Dt as _closure, E as _attr_input_checkedValue_script, F as _attr_select_value_default, Ft as _hoist_resume, G as _attr_class_item, Gn as StartNode, Gt as _var_change, Ht as _return_change, I as _attr_select_value_script, It as _id, J as _attr_content, Jn as attrTags, Jt as insertBranchBefore, K as _attr_class_items, Kn as TagVariable, Kt as _assert_init, L as _controllable_input, Lt as _if_closure, M as _attr_input_value_dynamic_default, Mt as _for_selector, N as _attr_input_value_script, Nt as _global_read, O as _attr_input_checked_script, On as Params, Ot as _closure_get, P as _attr_select_value, Pt as _hoist, Q as _attr_style_items, R as _controllable_open, Rt as _let, S as _attr_details_or_dialog_open_script, St as init, T as _attr_input_checkedValue_default, Tn as Lazy, Tt as readyFailed, U as _attr, Ut as _script, Vt as _return, W as _attr_class, Wt as _var, X as _attr_style, Xt as syncGen, Y as _attr_nonce, Yt as removeAndDestroyBranch, Z as _attr_style_item, _ as renderCatch, _n as forUntil, _t as _dynamic_tag_var_resume, a as _for_in, at as _lifecycle, b as _attr_details_or_dialog_open, bn as _hoist_read_error, bt as _var_resume, c as _for_to, ct as _text, d as _for_until_unkeyed, dn as run, dt as _content, en as $signal, et as _attrs_content, f as _if, fn as runEffects, ft as _content_closures, gn as forTo, gt as setupBranch, hn as forOf, ht as createBranch, i as _dynamic_tag_content, it as _html, j as _attr_input_value_default, jt as _for_closure, k as _attr_input_value, kt as _const, l as _for_to_unkeyed, ln as queueRender, lt as _text_content, m as _try, mn as forIn, mt as _return_setup, n as _await_promise, nn as onAbort, nt as _attrs_partial_content, o as _for_of, on as prepareEffects, ot as _style_rule_item, p as _show, pn as runId, pt as _content_closures_resume, q as _attr_class_names, qn as attrTag, r as _dynamic_tag, rt as _attrs_script, s as _for_of_unkeyed, sn as queueAsyncRender, st as _style_shell, t as _await_content, tn as $signalReset, tt as _attrs_partial, u as _for_until, ut as _to_text, vn as _assert_class_toggles, vt as _el, w as _attr_input_checkedValue, wn as Clone, wt as ready, x as _attr_details_or_dialog_open_default, xn as _call, y as startAwait, yn as _assert_hoist, yt as _resumed, z as _controllable_select, zn as Load, zt as _let_change } from "./dom-DlBA4dCe.mjs";
1
+ import { $ as _attrs, $t as _on, A as _attr_input_value_attribute_default, An as Setup, At as _el_read, B as _controllable_textarea, Bt as _or, C as _attr_input_checked, Ct as initEmbedded, D as _attr_input_checked_default, Dt as _closure, E as _attr_input_checkedValue_script, F as _attr_select_value_default, Ft as _hoist_resume, G as _attr_class_item, Gn as StartNode, Gt as _var_change, Ht as _return_change, I as _attr_select_value_script, It as _id, J as _attr_content, Jn as attrTags, Jt as insertBranchBefore, K as _attr_class_items, Kn as TagVariable, Kt as _assert_init, L as _controllable_input, Lt as _if_closure, M as _attr_input_value_dynamic_default, Mt as _for_selector, N as _attr_input_value_script, Nt as _global_read, O as _attr_input_checked_script, On as Params, Ot as _closure_get, P as _attr_select_value, Pt as _hoist, Q as _attr_style_items, R as _controllable_open, Rt as _let, S as _attr_details_or_dialog_open_script, St as init, T as _attr_input_checkedValue_default, Tn as Lazy, Tt as readyFailed, U as _attr, Ut as _script, Vt as _return, W as _attr_class, Wt as _var, X as _attr_style, Xt as syncGen, Y as _attr_nonce, Yt as removeAndDestroyBranch, Z as _attr_style_item, _n as forUntil, _t as _dynamic_tag_var_resume, a as _for_in, at as _lifecycle, b as _attr_details_or_dialog_open, bn as _hoist_read_error, bt as _var_resume, c as _for_to, ct as _text, d as _for_until_unkeyed, dn as run, dt as _content, en as $signal, et as _attrs_content, f as _if, fn as runEffects, ft as _content_closures, gn as forTo, gt as setupBranch, hn as forOf, ht as createBranch, i as _dynamic_tag_content, it as _html, j as _attr_input_value_default, jt as _for_closure, k as _attr_input_value, kt as _const, l as _for_to_unkeyed, ln as queueRender, lt as _text_content, m as _try, mn as forIn, mt as _return_setup, n as _await_promise, nn as onAbort, nt as _attrs_partial_content, o as _for_of, on as prepareEffects, ot as _style_rule_item, p as _show, pn as runId, pt as _content_closures_resume, q as _attr_class_names, qn as attrTag, r as _dynamic_tag, rt as _attrs_script, s as _for_of_unkeyed, sn as queueAsyncRender, st as _style_shell, t as _await_content, tn as $signalReset, tt as _attrs_partial, u as _for_until, ut as _to_text, v as renderCatch, vn as _assert_class_toggles, vt as _el, w as _attr_input_checkedValue, wn as Clone, wt as ready, x as _attr_details_or_dialog_open_default, xn as _call, y as startAwait, yn as _assert_hoist, yt as _resumed, z as _controllable_select, zn as Load, zt as _let_change } from "./dom-4AzxJQHb.mjs";
2
2
  // src/dom/template.ts
3
3
  const _template = (id, template, walks, setup, inputSignal) => {
4
4
  const renderer = _content(id, template, walks, setup, inputSignal)();
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_control_flow = require("../html-Du0z056z.js");
3
+ const require_control_flow = require("../html-shBfuhlc.js");
4
4
  // src/common/compat-meta.ts
5
5
  const SET_SCOPE_REGISTER_ID = "$compat_setScope";
6
6
  const RENDER_BODY_ID = "$compat_renderBody";
@@ -1,4 +1,4 @@
1
- import { A as $global, F as State, Ft as register, J as _scope_id, M as Boundary, N as Chunk, P as NOOP, Pt as REGISTRY, Q as _set_scope_reason, V as _html, Vt as setClassAPIRenderer, W as _peek_scope_id, Z as _script, _ as writeLoadAsset, at as getChunk, ct as joinHeldEffects, dt as writeScript, j as ALL_GROUPS, k as $chunk, lt as withChunk, ot as getScopeId, st as isInResumedBranch, t as _await, ut as writeScope } from "../html-DM7X2D_b.mjs";
1
+ import { A as $global, F as State, Ft as register, J as _scope_id, M as Boundary, N as Chunk, P as NOOP, Pt as REGISTRY, Q as _set_scope_reason, V as _html, Vt as setClassAPIRenderer, W as _peek_scope_id, Z as _script, _ as writeLoadAsset, at as getChunk, ct as joinHeldEffects, dt as writeScript, j as ALL_GROUPS, k as $chunk, lt as withChunk, ot as getScopeId, st as isInResumedBranch, t as _await, ut as writeScope } from "../html-Bfl3MJP9.mjs";
2
2
  // src/common/compat-meta.ts
3
3
  const SET_SCOPE_REGISTER_ID = "$compat_setScope";
4
4
  const RENDER_BODY_ID = "$compat_renderBody";
@@ -314,14 +314,12 @@ function concat(opt, other) {
314
314
  }
315
315
  // src/html/serializer.ts
316
316
  const K_SCOPE_ID = Symbol("Scope ID");
317
- const kTouchedIterator = /* @__PURE__ */ Symbol.for("marko.touchedIterator");
318
317
  const { hasOwnProperty } = {};
319
318
  const objectProto = Object.prototype;
320
319
  const arrayProto = Array.prototype;
321
320
  const Generator = (/* @__PURE__ */ (function* () {})()).constructor;
322
321
  const AsyncGenerator = (/* @__PURE__ */ (async function* () {})()).constructor;
323
- patchIteratorNext(Generator.prototype);
324
- patchIteratorNext(AsyncGenerator.prototype);
322
+ const kTouchedIterator = /* @__PURE__ */ patchIteratorsNext();
325
323
  const REGISTRY = /* @__PURE__ */ new WeakMap();
326
324
  const KNOWN_SYMBOLS = /* @__PURE__ */ (() => {
327
325
  const KNOWN_SYMBOLS = /* @__PURE__ */ new Map();
@@ -1836,14 +1834,20 @@ function hasOnlyZeros(typedArray) {
1836
1834
  for (let i = 0; i < typedArray.length; i++) if (typedArray[i] !== zero) return false;
1837
1835
  return true;
1838
1836
  }
1839
- function patchIteratorNext(proto) {
1840
- if (proto.next[kTouchedIterator]) return;
1837
+ function patchIteratorsNext() {
1838
+ const key = Symbol.for("marko.touchedIterator");
1839
+ patchIteratorNext(Generator.prototype, key);
1840
+ patchIteratorNext(AsyncGenerator.prototype, key);
1841
+ return key;
1842
+ }
1843
+ function patchIteratorNext(proto, key) {
1844
+ if (proto.next[key]) return;
1841
1845
  const { next } = proto;
1842
1846
  proto.next = function(value) {
1843
- this[kTouchedIterator] = 1;
1847
+ this[key] = 1;
1844
1848
  return next.call(this, value);
1845
1849
  };
1846
- proto.next[kTouchedIterator] = true;
1850
+ proto.next[key] = true;
1847
1851
  }
1848
1852
  // src/html/attrs.ts
1849
1853
  function _attr_class(value) {
@@ -2511,21 +2515,6 @@ var State = class {
2511
2515
  serializeFlush(boundary) {
2512
2516
  flushSerializer(boundary, this);
2513
2517
  }
2514
- getSerializedGlobals() {
2515
- const { $global } = this;
2516
- const serializedGlobals = $global.serializedGlobals;
2517
- if (!serializedGlobals) return 0;
2518
- let filtered = 0;
2519
- if (Array.isArray(serializedGlobals)) for (const key of serializedGlobals) {
2520
- const value = $global[key];
2521
- if (value !== void 0) (filtered ||= {})[key] = value;
2522
- }
2523
- else for (const key in serializedGlobals) if (serializedGlobals[key]) {
2524
- const value = $global[key];
2525
- if (value !== void 0) (filtered ||= {})[key] = value;
2526
- }
2527
- return filtered;
2528
- }
2529
2518
  runtimeScript() {
2530
2519
  return WALKER_RUNTIME_CODE + "(\"" + this.$global.runtimeId + "\")(\"" + this.$global.renderId + "\")";
2531
2520
  }
@@ -3035,7 +3024,7 @@ function flushSerializer(boundary, channel) {
3035
3024
  }
3036
3025
  if (!channel.readyId && !state.hasWrittenGlobals) {
3037
3026
  state.hasWrittenGlobals = true;
3038
- const globals = state.getSerializedGlobals();
3027
+ const globals = getFilteredGlobals(state.$global);
3039
3028
  if (globals) flushes.push([
3040
3029
  0,
3041
3030
  globals,
@@ -3064,7 +3053,7 @@ function flushSerializerGlobals(boundary) {
3064
3053
  const { state } = boundary;
3065
3054
  if (state.hasWrittenGlobals) return;
3066
3055
  state.hasWrittenGlobals = true;
3067
- const globals = state.getSerializedGlobals();
3056
+ const globals = getFilteredGlobals(state.$global);
3068
3057
  if (globals) {
3069
3058
  state.needsWalkerRuntime = true;
3070
3059
  state.resumes = concatSequence(state.resumes, stringifyScopes(state.serializer, [[
@@ -3090,6 +3079,20 @@ function readyBatch(state, channel, deps, resumes) {
3090
3079
  if (resumes) own[readyId]++;
3091
3080
  return concatSequence(wait && wait + "}", resumes);
3092
3081
  }
3082
+ function getFilteredGlobals($global) {
3083
+ const serializedGlobals = $global.serializedGlobals;
3084
+ let filtered = $global.cspNonce ? { cspNonce: $global.cspNonce } : 0;
3085
+ if (!serializedGlobals) return filtered;
3086
+ if (Array.isArray(serializedGlobals)) for (const key of serializedGlobals) {
3087
+ const value = $global[key];
3088
+ if (value !== void 0) (filtered ||= {})[key] = value;
3089
+ }
3090
+ else for (const key in serializedGlobals) if (serializedGlobals[key]) {
3091
+ const value = $global[key];
3092
+ if (value !== void 0) (filtered ||= {})[key] = value;
3093
+ }
3094
+ return filtered;
3095
+ }
3093
3096
  function concatEffects(a, b) {
3094
3097
  return a ? b ? a + " " + b : a : b;
3095
3098
  }