marko 6.3.30 → 6.3.32

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 (58) hide show
  1. package/cheatsheet.md +36 -18
  2. package/dist/common/helpers.d.ts +2 -0
  3. package/dist/debug/dom/catch.feat.js +38 -0
  4. package/dist/debug/dom/catch.feat.mjs +37 -0
  5. package/dist/debug/dom/controllable-input.feat.js +7 -0
  6. package/dist/debug/dom/controllable-input.feat.mjs +6 -0
  7. package/dist/debug/dom/controllable-open.feat.js +5 -0
  8. package/dist/debug/dom/controllable-open.feat.mjs +4 -0
  9. package/dist/debug/dom/controllable-select.feat.js +5 -0
  10. package/dist/debug/dom/controllable-select.feat.mjs +4 -0
  11. package/dist/debug/dom/controllable-textarea.feat.js +5 -0
  12. package/dist/debug/dom/controllable-textarea.feat.mjs +4 -0
  13. package/dist/debug/dom/controllable.feat.js +11 -0
  14. package/dist/debug/dom/controllable.feat.mjs +10 -0
  15. package/dist/debug/dom-BJ93mcSe.mjs +2016 -0
  16. package/dist/debug/dom-CiFITSPN.js +2814 -0
  17. package/dist/debug/dom.js +156 -2245
  18. package/dist/debug/dom.mjs +6 -2089
  19. package/dist/dom/catch.feat.d.ts +1 -0
  20. package/dist/dom/catch.feat.js +25 -0
  21. package/dist/dom/catch.feat.mjs +26 -0
  22. package/dist/dom/control-flow.d.ts +3 -3
  23. package/dist/dom/controllable-input.feat.d.ts +1 -0
  24. package/dist/dom/controllable-input.feat.js +3 -0
  25. package/dist/dom/controllable-input.feat.mjs +3 -0
  26. package/dist/dom/controllable-open.feat.d.ts +1 -0
  27. package/dist/dom/controllable-open.feat.js +4 -0
  28. package/dist/dom/controllable-open.feat.mjs +4 -0
  29. package/dist/dom/controllable-select.feat.d.ts +1 -0
  30. package/dist/dom/controllable-select.feat.js +4 -0
  31. package/dist/dom/controllable-select.feat.mjs +4 -0
  32. package/dist/dom/controllable-textarea.feat.d.ts +1 -0
  33. package/dist/dom/controllable-textarea.feat.js +4 -0
  34. package/dist/dom/controllable-textarea.feat.mjs +4 -0
  35. package/dist/dom/controllable.d.ts +3 -8
  36. package/dist/dom/controllable.feat.d.ts +3 -0
  37. package/dist/dom/controllable.feat.js +3 -0
  38. package/dist/dom/controllable.feat.mjs +6 -0
  39. package/dist/dom/queue.d.ts +2 -2
  40. package/dist/dom/resume.d.ts +0 -1
  41. package/dist/dom/walker.d.ts +0 -1
  42. package/dist/dom-CI-06TZb.js +1721 -0
  43. package/dist/dom-Cj4HQ7T_.mjs +1137 -0
  44. package/dist/dom.d.ts +2 -2
  45. package/dist/dom.js +36 -1221
  46. package/dist/dom.mjs +4 -1188
  47. package/dist/translator/index.js +628 -534
  48. package/dist/translator/util/constants/structure-kind.d.ts +7 -0
  49. package/dist/translator/util/get-tag-name.d.ts +2 -1
  50. package/dist/translator/util/import-reference.d.ts +3 -0
  51. package/dist/translator/util/runtime.d.ts +2 -0
  52. package/dist/translator/util/sections.d.ts +28 -1
  53. package/dist/translator/util/{walks.d.ts → structure.d.ts} +20 -9
  54. package/dist/translator/util/writer.d.ts +0 -8
  55. package/dist/translator/visitors/placeholder.d.ts +4 -3
  56. package/dist/translator/visitors/tag/native-tag.d.ts +9 -6
  57. package/dist/translator/visitors/text.d.ts +3 -7
  58. package/package.json +3 -3
package/dist/dom.js CHANGED
@@ -1,69 +1,16 @@
1
- let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeStyleAttr = (c) => c === ";" ? "\\3B " : "\\\\", toDelimitedString = function toDelimitedString(val, delimiter, stringify) {
2
- let str = "", sep = "", part;
3
- if (val) if (typeof val != "object") str += val;
4
- else if (Array.isArray(val)) for (let v of val) part = toDelimitedString(v, delimiter, stringify), part && (str += sep + part, sep = delimiter);
5
- else for (let name in val) part = stringify(name, val[name]), part && (str += sep + part, sep = delimiter);
6
- return str;
7
- }, decodeAccessor = (num) => (num + (num < 26 ? 10 : num < 962 ? 334 : 11998)).toString(36), delegate = (type, handler) => handler[type] ||= (document.addEventListener(type, handler, !0), 1), parsers = {}, nextScopeId = 1e6, collectingScopes, destroyNestedScopes = function destroyNestedScopes(scope) {
8
- scope.H = 0, scope.D?.forEach(destroyNestedScopes), scope.B?.forEach(cleanupScope);
9
- }, isScheduled, channel, _return = (scope, value) => scope.T?.(value), _var_change = (scope, value) => scope.U?.(value), tagIdsByGlobal = /* @__PURE__ */ new WeakMap(), walker = /* @__PURE__ */ document.createTreeWalker(document), walkInternal = function walkInternal(currentWalkIndex, walkCodes, scope) {
10
- let value, currentMultiplier, storedMultiplier = 0, currentScopeIndex = 0;
11
- for (; currentWalkIndex < walkCodes.length;) if (value = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value === 32) {
12
- let node = walker.currentNode;
13
- scope[decodeAccessor(currentScopeIndex++)] = node;
14
- } else if (value === 37 || value === 49) walker.currentNode.replaceWith(walker.currentNode = scope[decodeAccessor(currentScopeIndex++)] = new Text()), value === 49 && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
15
- else if (value === 38) return currentWalkIndex;
16
- else if (value === 47 || value === 48) currentWalkIndex = walkInternal(currentWalkIndex, walkCodes, scope[decodeAccessor(currentScopeIndex++)] = createScope(scope.$, scope.F)), value === 48 && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
17
- else if (value < 92) for (value = 25 * currentMultiplier + value - 67; value--;) walker.nextNode();
18
- else if (value < 107) for (value = 10 * currentMultiplier + value - 97; value--;) walker.nextSibling();
19
- else if (value < 117) {
20
- for (value = 10 * currentMultiplier + value - 107; value--;) walker.parentNode();
21
- walker.nextSibling();
22
- } else storedMultiplier = currentMultiplier * 10 + value - 117;
23
- }, registeredValues = {}, curRenders, branchesEnabled, embedRenders, readyIds, isResuming, cloneCache = {}, R = /[^\p{L}\p{N}]/gu, inputType = "", controllableScripts = {}, controllableRenders = {}, _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
24
- nodeAccessor = decodeAccessor(nodeAccessor);
25
- let childScopeAccessor = "A" + nodeAccessor, rendererAccessor = "D" + nodeAccessor;
26
- return enableBranches(), (scope, newRenderer, getInput) => {
27
- let normalizedRenderer = normalizeDynamicRenderer(newRenderer);
28
- if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.a || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor])) if (setConditionalRenderer(scope, nodeAccessor, normalizedRenderer || (getContent ? getContent(scope) : void 0), createBranchWithTagNameOrRenderer), getTagVar && (scope[childScopeAccessor].T = (value) => getTagVar()(scope, value)), typeof normalizedRenderer == "string") {
29
- if (getContent) {
30
- let content = getContent(scope);
31
- setConditionalRenderer(scope[childScopeAccessor], "a", content, createAndSetupBranch), content.f && subscribeToScopeSet(content.e, content.f, scope[childScopeAccessor].Aa);
32
- }
33
- } else normalizedRenderer?.f && subscribeToScopeSet(normalizedRenderer.e, normalizedRenderer.f, scope[childScopeAccessor]);
34
- if (normalizedRenderer) {
35
- let childScope = scope[childScopeAccessor], args = getInput?.();
36
- if (typeof normalizedRenderer == "string") (getContent ? _attrs : _attrs_content)(childScope, "a", (inputIsArgs ? args[0] : args) || {}, controllableRenders[childScope.a.tagName]), (childScope.Ia || childScope.Ea) && queueEffect(childScope, dynamicTagScript);
37
- else {
38
- for (let accessor in normalizedRenderer.g) normalizedRenderer.g[accessor](childScope, normalizedRenderer.h[accessor]);
39
- if (normalizedRenderer.d) if (inputIsArgs) normalizedRenderer.d(childScope, normalizedRenderer._ ? args[0] : args);
40
- else {
41
- let inputWithContent = getContent ? {
42
- ...args,
43
- content: getContent(scope)
44
- } : args || {};
45
- normalizedRenderer.d(childScope, normalizedRenderer._ ? inputWithContent : [inputWithContent]);
46
- }
47
- }
48
- }
49
- };
50
- }, _for_of = /* @__PURE__ */ loop(([all, by = bySecondArg], cb) => {
51
- typeof by == "string" ? forOf(all, (item, i) => cb(item[by], [item, i])) : forOf(all, (item, i) => cb(by(item, i), [item, i]));
52
- }), _for_in = /* @__PURE__ */ loop(([obj, by = byFirstArg], cb) => forIn(obj, (key, value) => cb(by(key, value), [key, value]))), _for_to = /* @__PURE__ */ loop(([to, from, step, by = byFirstArg], cb) => forTo(to, from, step, (v) => cb(by(v), [v]))), _for_until = /* @__PURE__ */ loop(([until, from, step, by = byFirstArg], cb) => forUntil(until, from, step, (v) => cb(by(v), [v]))), rendering, runId = 2, caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingRenders = [], runEffects = ((effects) => {
53
- for (let i = 0; i < effects.length;) effects[i++](effects[i++]);
54
- }), runRender = (render) => render.c(render.b, render.d), catchEnabled, classIdToBranch = /* @__PURE__ */ new Map(), classEventResolver, scopesByRender = /* @__PURE__ */ new WeakMap(), getRenderScopes = ($global) => {
1
+ let require_control_flow = require("./dom-CI-06TZb.js"), empty = [], rest = Symbol(), classIdToBranch = /* @__PURE__ */ new Map(), classEventResolver, scopesByRender = /* @__PURE__ */ new WeakMap(), getRenderScopes = ($global) => {
55
2
  let render = self[$global.runtimeId]?.[$global.renderId], scopes = render && scopesByRender.get(render);
56
3
  return render && !scopes && scopesByRender.set(render, scopes = {}), scopes;
57
4
  }, compat = {
58
- patchDynamicTag,
59
- queueEffect,
5
+ patchDynamicTag: require_control_flow.m,
6
+ queueEffect: require_control_flow.$t,
60
7
  init(warp10Noop) {
61
- _resume("$C_s", (scope) => {
8
+ require_control_flow.ht("$C_s", (scope) => {
62
9
  if (getRenderScopes(scope.$)[scope.L] = scope, scope.m5c && classIdToBranch.set(scope.m5c, scope), classEventResolver) for (let key in scope) {
63
10
  let resolved = classEventResolver(scope[key], scope);
64
11
  resolved !== scope[key] && (scope[key] = resolved);
65
12
  }
66
- }), _resume("$C_b", warp10Noop);
13
+ }), require_control_flow.ht("$C_b", warp10Noop);
67
14
  },
68
15
  setClassEventResolver(fn) {
69
16
  classEventResolver = fn;
@@ -87,16 +34,16 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
87
34
  branch.S = startNode, branch.K = endNode;
88
35
  },
89
36
  runComponentEffects() {
90
- this.effects && runEffects(this.effects);
37
+ this.effects && require_control_flow.tn(this.effects);
91
38
  },
92
39
  runComponentDestroy() {
93
- this.scope && destroyBranch(this.scope);
40
+ this.scope && require_control_flow.Vt(this.scope);
94
41
  },
95
42
  resolveRegistered(value, $global) {
96
- return Array.isArray(value) && typeof value[0] == "string" ? getRegisteredWithScope(value[0], getRenderScopes($global)?.[value[1]]) : value;
43
+ return Array.isArray(value) && typeof value[0] == "string" ? require_control_flow._t(value[0], getRenderScopes($global)?.[value[1]]) : value;
97
44
  },
98
45
  createRenderer(params, clone) {
99
- let renderer = _content("", 0, 0, 0, params)();
46
+ let renderer = require_control_flow.ct("", 0, 0, 0, params)();
100
47
  return renderer.b = (branch) => {
101
48
  let cloned = clone();
102
49
  branch.S = cloned.startNode, branch.K = cloned.endNode;
@@ -108,13 +55,13 @@ let empty = [], rest = Symbol(), unsafeStyleAttrReg = /[\\;]/g, replaceUnsafeSty
108
55
  let input = args[0], normalizedInput = args[0] = {};
109
56
  for (let key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
110
57
  }
111
- if (component.effects = prepareEffects(() => {
112
- branch ||= (created = 1, component.scope = createAndSetupBranch(out.global, renderer, renderer.e, document.body)), renderer.d?.(branch, renderer._ ? args[0] : args);
113
- }), created) return toInsertNode(branch.S, branch.K);
58
+ if (component.effects = require_control_flow.Zt(() => {
59
+ branch ||= (created = 1, component.scope = require_control_flow.dt(out.global, renderer, renderer.e, document.body)), renderer.d?.(branch, renderer._ ? args[0] : args);
60
+ }), created) return require_control_flow.st(branch.S, branch.K);
114
61
  }
115
62
  }, _template = (id, template, walks, setup, inputSignal) => {
116
- let renderer = _content(id, template, walks, setup, inputSignal)();
117
- return renderer.mount = mount, renderer._ = renderer, _resume(id, renderer);
63
+ let renderer = require_control_flow.ct(id, template, walks, setup, inputSignal)();
64
+ return renderer.mount = mount, renderer._ = renderer, require_control_flow.ht(id, renderer);
118
65
  };
119
66
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
120
67
  //#region src/common/attr-tag.ts
@@ -128,1137 +75,6 @@ function* attrTagIterator() {
128
75
  yield this, yield* this[rest];
129
76
  }
130
77
  //#endregion
131
- //#region src/common/helpers.ts
132
- function _call(fn, v) {
133
- return fn(v), v;
134
- }
135
- function stringifyClassObject(name, value) {
136
- return value ? name : "";
137
- }
138
- function stringifyStyleObject(name, value) {
139
- return value || value === 0 ? escapeStyleAttr(name) + ":" + escapeStyleAttr(value + "") : "";
140
- }
141
- function escapeStyleAttr(str) {
142
- return unsafeStyleAttrReg.test(str) ? str.replace(unsafeStyleAttrReg, replaceUnsafeStyleAttr) : str;
143
- }
144
- function escapeStyleValue(str) {
145
- let closers = "", result = str.replace(/[\\"'{};<>]|\/(?=\*)/g, (c) => c === "<" ? "\\3C " : c === ";" ? "\\3B " : c === "{" ? "\\7B " : "\\" + c);
146
- for (let c of result) c === "(" ? closers = ")" + closers : c === "[" ? closers = "]" + closers : c === closers[0] && (closers = closers.slice(1));
147
- return result + closers;
148
- }
149
- function isEventHandler(name) {
150
- return /^on[A-Z-]/.test(name);
151
- }
152
- function getEventHandlerName(name) {
153
- return name[2] === "-" ? name.slice(3) : name.slice(2).toLowerCase();
154
- }
155
- function isNotVoid(value) {
156
- return value != null && value !== !1;
157
- }
158
- function isPromise(value) {
159
- return value != null && typeof value.then == "function";
160
- }
161
- function normalizeDynamicRenderer(value) {
162
- if (value) {
163
- if (typeof value == "string") return value;
164
- let normalized = value.content || value.default || value;
165
- if ("a" in normalized) return normalized;
166
- }
167
- }
168
- function _assert_hoist(value) {}
169
- //#endregion
170
- //#region src/common/for.ts
171
- function forIn(obj, cb) {
172
- for (let key in obj) cb(key, obj[key]);
173
- }
174
- function forOf(list, cb) {
175
- if (list) {
176
- let i = 0;
177
- for (let item of list) cb(item, i++);
178
- }
179
- }
180
- function forTo(to, from, step, cb) {
181
- let start = from || 0, delta = step || 1;
182
- for (let steps = (to - start) / delta, i = 0; i <= steps; i++) cb(start + i * delta);
183
- }
184
- function forUntil(until, from, step, cb) {
185
- let start = from || 0, delta = step || 1;
186
- for (let steps = (until - start) / delta, i = 0; i < steps; i++) cb(start + i * delta);
187
- }
188
- //#endregion
189
- //#region src/common/opt.ts
190
- function toArray(opt) {
191
- return opt ? Array.isArray(opt) ? opt : [opt] : [];
192
- }
193
- function forEach(opt, cb) {
194
- if (opt) if (Array.isArray(opt)) for (let item of opt) cb(item);
195
- else cb(opt);
196
- }
197
- function push(opt, item) {
198
- return opt ? Array.isArray(opt) ? (opt.push(item), opt) : [opt, item] : item;
199
- }
200
- //#endregion
201
- //#region src/dom/event.ts
202
- function _on(element, type, handler) {
203
- element["$" + type] === void 0 && delegate(type, handleDelegated), element["$" + type] = handler || null;
204
- }
205
- function handleDelegated(ev) {
206
- let target = !rendering && ev.target;
207
- for (; target;) target["$" + ev.type]?.(ev, target), target = ev.bubbles && !ev.cancelBubble && target.parentNode;
208
- }
209
- //#endregion
210
- //#region src/dom/parse-html.ts
211
- function parseHTML(html, ns) {
212
- let parser = parsers[ns] ||= document.createElementNS(ns, "template");
213
- return parser.innerHTML = html, parser.content || parser;
214
- }
215
- //#endregion
216
- //#region src/dom/scope.ts
217
- function createScope($global, closestBranch) {
218
- let scope = {
219
- L: nextScopeId++,
220
- H: runId,
221
- F: closestBranch,
222
- $: $global
223
- };
224
- return collectingScopes?.push(scope), scope;
225
- }
226
- function syncGen(scope) {
227
- scope.H = runId;
228
- }
229
- function _assert_init(scope, accessor) {
230
- return scope[accessor];
231
- }
232
- function collectScopes(fn) {
233
- let prev = collectingScopes;
234
- collectingScopes = [];
235
- try {
236
- return fn(), collectingScopes;
237
- } finally {
238
- collectingScopes = prev;
239
- }
240
- }
241
- function skipScope() {
242
- return nextScopeId++;
243
- }
244
- function findBranchWithKey(scope, key) {
245
- let branch = scope.F;
246
- for (; branch && branch[key] == null;) branch = branch.N;
247
- return branch;
248
- }
249
- function destroyBranch(branch) {
250
- branch.N?.D?.delete(branch), destroyNestedScopes(branch);
251
- }
252
- function destroyScope(scope) {
253
- scope.H && (destroyNestedScopes(scope), cleanupScope(scope));
254
- }
255
- function cleanupScope(scope) {
256
- scope.Z?.forEach(unsubscribe, scope);
257
- for (let id in scope.A) $signalReset(scope, id);
258
- }
259
- function unsubscribe(subscribers) {
260
- subscribers.delete(this);
261
- }
262
- function removeAndDestroyBranch(branch) {
263
- destroyBranch(branch), removeChildNodes(branch.S, branch.K);
264
- }
265
- function insertBranchBefore(branch, parentNode, nextSibling) {
266
- insertChildNodes(parentNode, nextSibling, branch.S, branch.K);
267
- }
268
- function tempDetachBranch(branch) {
269
- let fragment = new DocumentFragment();
270
- fragment.namespaceURI = branch.S.parentNode.namespaceURI, insertChildNodes(fragment, null, branch.S, branch.K);
271
- }
272
- //#endregion
273
- //#region src/dom/schedule.ts
274
- function schedule() {
275
- isScheduled || (isScheduled = 1, queueMicrotask(flushAndWaitFrame));
276
- }
277
- function flushAndWaitFrame() {
278
- requestAnimationFrame(triggerMacroTask), run();
279
- }
280
- function triggerMacroTask() {
281
- channel || (channel = new MessageChannel(), channel.port1.onmessage = () => {
282
- isScheduled = 0, run();
283
- }), channel.port2.postMessage(0);
284
- }
285
- //#endregion
286
- //#region src/dom/signals.ts
287
- function _let(id, fn) {
288
- let valueAccessor = decodeAccessor(id);
289
- return (scope, value) => (rendering ? scope.H === runId && (scope[valueAccessor] = value, fn?.(scope)) : (scope[valueAccessor] !== value || !(valueAccessor in scope)) && (scope[valueAccessor] = value, fn) && (schedule(), queueRender(scope, fn, id)), value);
290
- }
291
- function _let_change(id, fn) {
292
- let valueAccessor = decodeAccessor(id), valueChangeAccessor = decodeAccessor(id + 1), base = _let(id, fn);
293
- return (scope, value, valueChange) => (rendering ? (scope[valueChangeAccessor] = valueChange) && (scope[valueAccessor] !== value || !(valueAccessor in scope)) ? (scope[valueAccessor] = value, fn?.(scope)) : base(scope, value) : scope[valueChangeAccessor] ? scope[valueChangeAccessor](value) : base(scope, value), value);
294
- }
295
- function _const(valueAccessor, fn) {
296
- return valueAccessor = decodeAccessor(valueAccessor), ((scope, value) => {
297
- (scope[valueAccessor] !== value || !(valueAccessor in scope)) && (scope[valueAccessor] = value, fn?.(scope));
298
- });
299
- }
300
- function _or(id, fn, defaultPending = 1, scopeIdAccessor = "L") {
301
- return scopeIdAccessor !== "L" && (scopeIdAccessor = decodeAccessor(scopeIdAccessor)), (scope) => {
302
- scope.H === runId ? ~id in scope ? --scope[~id] || fn(scope) : scope[~id] = defaultPending : queueRender(scope, fn, id, 0, scope[scopeIdAccessor]);
303
- };
304
- }
305
- function _for_closure(ownerLoopNodeAccessor, fn) {
306
- ownerLoopNodeAccessor = decodeAccessor(ownerLoopNodeAccessor);
307
- let scopeAccessor = "A" + ownerLoopNodeAccessor, ownerSignal = (ownerScope) => {
308
- let scopes = toArray(ownerScope[scopeAccessor]);
309
- scopes.length && queueRender(ownerScope, () => {
310
- for (let scope of scopes) scope.H > 0 && scope.H < runId && fn(scope);
311
- }, -1, 0, scopes[0].L);
312
- };
313
- return ownerSignal._ = fn, ownerSignal;
314
- }
315
- function _for_selector(ownerLoopNodeAccessor, ownerValueAccessor, keyValueAccessor, fn) {
316
- ownerLoopNodeAccessor = decodeAccessor(ownerLoopNodeAccessor), ownerValueAccessor = decodeAccessor(ownerValueAccessor), keyValueAccessor !== "M" && (keyValueAccessor = decodeAccessor(keyValueAccessor));
317
- let scopeAccessor = "A" + ownerLoopNodeAccessor, mapAccessor = "O" + ownerLoopNodeAccessor, prevKeyProp = `_${ownerValueAccessor}`, ownerSignal = (ownerScope) => {
318
- let scopes = toArray(ownerScope[scopeAccessor]);
319
- if (ownerScope.H < runId && scopes.length) {
320
- let nextKey = ownerScope[ownerValueAccessor];
321
- queueRender(ownerScope, () => {
322
- let map = keyedScopes(ownerScope, scopeAccessor, mapAccessor, keyValueAccessor);
323
- if (map && prevKeyProp in map) {
324
- let prevScope = map.get(map[prevKeyProp]), nextScope = map.get(nextKey);
325
- prevScope !== nextScope && (runLiveBranch(prevScope, fn), runLiveBranch(nextScope, fn));
326
- } else for (let scope of toArray(ownerScope[scopeAccessor])) runLiveBranch(scope, fn);
327
- map && (map[prevKeyProp] = nextKey);
328
- }, -1, 0, scopes[0].L);
329
- }
330
- };
331
- return ownerSignal._ = fn, ownerSignal;
332
- }
333
- function keyedScopes(ownerScope, scopeAccessor, mapAccessor, keyValueAccessor) {
334
- let map = ownerScope[mapAccessor] ||= /* @__PURE__ */ new Map();
335
- if (!map.size) for (let scope of toArray(ownerScope[scopeAccessor])) {
336
- let key = scope.M ?? scope[keyValueAccessor];
337
- if (key === void 0) return ownerScope[mapAccessor] = null;
338
- scope.M = key, map.set(key, scope);
339
- }
340
- return map;
341
- }
342
- function runLiveBranch(scope, fn) {
343
- scope && scope.H > 0 && scope.H < runId && fn(scope);
344
- }
345
- function _if_closure(ownerConditionalNodeAccessor, branch, fn) {
346
- ownerConditionalNodeAccessor = decodeAccessor(ownerConditionalNodeAccessor);
347
- let scopeAccessor = "A" + ownerConditionalNodeAccessor, branchAccessor = "D" + ownerConditionalNodeAccessor, ownerSignal = (scope) => {
348
- let ifScope = scope[scopeAccessor];
349
- ifScope && ifScope.H > 0 && ifScope.H < runId && (scope[branchAccessor] || 0) === branch && queueRender(ifScope, fn, -1);
350
- };
351
- return ownerSignal._ = fn, ownerSignal;
352
- }
353
- function subscribeToScopeSet(ownerScope, accessor, scope) {
354
- let subscribers = ownerScope[accessor] ||= /* @__PURE__ */ new Set(), { size } = subscribers;
355
- subscribers.add(scope).size !== size && trackCleanup(scope, subscribers);
356
- }
357
- function _closure(...closureSignals) {
358
- let [firstSignal] = closureSignals, scopeInstances = firstSignal.a, signalIndex = firstSignal.b;
359
- for (let i = closureSignals.length; i--;) closureSignals[i].c = i;
360
- return (scope) => {
361
- if (scope[scopeInstances]) for (let childScope of scope[scopeInstances]) childScope.H > 0 && childScope.H < runId && queueRender(childScope, closureSignals[childScope[signalIndex] || 0], -1);
362
- };
363
- }
364
- function _closure_get(valueAccessor, fn, getOwnerScope, resumeId) {
365
- valueAccessor = decodeAccessor(valueAccessor);
366
- let closureSignal = ((scope) => {
367
- scope[closureSignal.b] = closureSignal.c, fn(scope), subscribeToScopeSet(getOwnerScope ? getOwnerScope(scope) : scope._, closureSignal.a, scope);
368
- });
369
- return closureSignal.a = valueAccessor, closureSignal.b = "C" + valueAccessor, resumeId && _resume(resumeId, closureSignal), closureSignal;
370
- }
371
- function _child_setup(setup) {
372
- return setup._ = (scope, owner) => {
373
- scope._ = owner, queueRender(scope, setup, -1);
374
- }, setup;
375
- }
376
- function _var(scope, childAccessor, signal) {
377
- scope[decodeAccessor(childAccessor)].T = (value) => signal(scope, value);
378
- }
379
- function _return_change(scope, changeHandler) {
380
- changeHandler && (scope.U = changeHandler);
381
- }
382
- function _id({ $: $global }) {
383
- let id = tagIdsByGlobal.get($global) || 0;
384
- return tagIdsByGlobal.set($global, id + 1), "c" + $global.runtimeId + $global.renderId + id.toString(36);
385
- }
386
- function _script(id, fn) {
387
- return _resume(id, fn), (scope) => {
388
- queueEffect(scope, fn);
389
- };
390
- }
391
- function _el_read(value) {
392
- return value;
393
- }
394
- function* traverse(scope, path, i = path.length - 1) {
395
- if (scope) if (Symbol.iterator in scope) for (let childScope of scope.values()) yield* traverse(childScope, path, i);
396
- else {
397
- let item = scope[path[i]];
398
- i ? yield* traverse(item, path, i - 1) : yield typeof item == "function" ? item() : item;
399
- }
400
- }
401
- function _hoist(...path) {
402
- return path = path.map((p) => typeof p == "string" ? p : decodeAccessor(p)), (scope) => {
403
- let fn = () => traverse(scope, path).next().value;
404
- return fn[Symbol.iterator] = () => traverse(scope, path), fn;
405
- };
406
- }
407
- function _hoist_resume(id, ...path) {
408
- return _resume(id, _hoist(...path));
409
- }
410
- //#endregion
411
- //#region src/dom/walker.ts
412
- function walk(startNode, walkCodes, branch) {
413
- walker.currentNode = startNode, walkInternal(0, walkCodes, branch);
414
- }
415
- //#endregion
416
- //#region src/dom/resume.ts
417
- function enableBranches() {
418
- branchesEnabled || (branchesEnabled = 1, skipDestroyedRenders());
419
- }
420
- function ready(readyId) {
421
- (readyIds ||= /* @__PURE__ */ new Set()).add(readyId);
422
- for (let renderId in curRenders) runResumeEffects(curRenders[renderId]);
423
- }
424
- function initEmbedded(readyId, runtimeId) {
425
- embedRenders || (embedRenders = /* @__PURE__ */ new Map(), new MutationObserver(() => {
426
- for (let [anchor, [renderId, scopes]] of embedRenders) if (!anchor.isConnected) {
427
- embedRenders.delete(anchor), delete curRenders[renderId];
428
- for (let id in scopes) destroyScope(scopes[id]);
429
- }
430
- }).observe(document, {
431
- childList: !0,
432
- subtree: !0
433
- })), ready(readyId), init(runtimeId);
434
- }
435
- function init(runtimeId = "M") {
436
- if (curRenders) return;
437
- let renders = self[runtimeId], defineRuntime = (desc) => Object.defineProperty(self, runtimeId, desc), initRuntime = (renders) => {
438
- defineRuntime({ value: curRenders = ((renderId) => {
439
- let render = curRenders[renderId] = renders[renderId] || renders(renderId), walk = render.w, scopeLookup = {}, getScope = (id) => scopeLookup[id] || (+id ? initScope(scopeLookup[id] = { L: +id }) : initGlobal()), initGlobal = () => scopeLookup[0] ||= {
440
- runtimeId,
441
- renderId
442
- }, initScope = (scope) => (scope.H = 1, scope.$ = initGlobal(), branchesEnabled && scope.G && (scope.F = getScope(scope.G)), scope), applyScopes = (partials) => {
443
- let scopeId = partials[0];
444
- for (let i = 1; i < partials.length; i++) {
445
- let partial = partials[i];
446
- typeof partial == "number" ? scopeId += partial : (scopeId ? initScope(Object.assign(scopeLookup[scopeId] ||= (partial.L = scopeId, partial), partial)) : Object.assign(initGlobal(), partial), scopeId++);
447
- }
448
- }, serializeContext = ((data, registryId) => typeof data == "number" ? registryId ? registeredValues[registryId](getScope(data)) : getScope(data) : applyScopes(data)), createVisitBranches = (branchScopesStack = [], branchStarts = [], orphanBranches = [], deferredOwners = [], curBranchScopes) => (branchId, branch, endedBranches, accessor, singleNode, parent = visit.parentNode, startVisit = visit, i = orphanBranches.length, j = deferredOwners.length) => {
449
- for (visitType !== "[" && (visitScope[nextToken()] = visitType === ")" || visitType === "}" ? parent : visit, accessor = "A" + lastToken, singleNode = visitType !== "]" && visitType !== ")", nextToken()); branchId = +lastToken;) {
450
- if ((endedBranches ||= []).push(branch = getScope(branchId)), setParentBranch(branch, branch.F), (branch.O = render.p?.[branchId]) && (branch.O.m = render.m), singleNode) {
451
- for (; startVisit.previousSibling && ~visits.indexOf(startVisit = startVisit.previousSibling););
452
- branch._ ??= visitScope, branch.K = branch.S = startVisit, visitType === "'" && (branch.a = startVisit);
453
- } else curBranchScopes = push(curBranchScopes, branch), accessor && (visitScope[accessor] = curBranchScopes, forEach(curBranchScopes, (scope) => scope._ ??= visitScope), curBranchScopes = branchScopesStack.pop()), startVisit = branchStarts.pop(), parent !== startVisit.parentNode && parent.prepend(startVisit), branch.S = startVisit, branch.K = visit.previousSibling === startVisit ? startVisit : parent.insertBefore(new Text(), visit);
454
- for (; i && orphanBranches[i - 1].L > branchId;) i--, setParentBranch(orphanBranches.pop(), branch);
455
- for (; j && deferredOwners[j - 1].L > branchId;) {
456
- j--;
457
- let owner = deferredOwners.pop();
458
- owner.F !== owner && (owner.F = branch);
459
- }
460
- nextToken();
461
- }
462
- if (endedBranches) {
463
- for (let ended of endedBranches) orphanBranches.push(ended);
464
- singleNode && (visitScope[accessor] = endedBranches.length > 1 ? endedBranches.reverse() : endedBranches[0]);
465
- }
466
- visitType === "[" ? (endedBranches || (branchScopesStack.push(curBranchScopes), curBranchScopes = void 0), branchStarts.push(visit)) : deferredOwners.push(visitScope);
467
- }, nextToken = () => lastToken = visitText.slice(lastTokenIndex, (lastTokenIndex = visitText.indexOf(" ", lastTokenIndex) + 1 || visitText.length + 1) - 1), processResumes = (resumes = [], effects) => {
468
- let i = 0;
469
- for (; i < resumes.length; i++) {
470
- let serialized = resumes[i];
471
- if (typeof serialized == "string") for (lastTokenIndex = 0, visitText = serialized; nextToken();) /\D/.test(lastToken) ? lastEffect = registeredValues[lastToken] : effects.push(lastEffect, getScope(lastToken));
472
- else if (Array.isArray(serialized)) {
473
- if (!(readyIds && serialized.every((dep) => readyIds.has(dep) && !render.b[dep].length))) break;
474
- } else if (readyIds && typeof serialized == "number") break;
475
- else {
476
- let scopes = serialized(serializeContext);
477
- Array.isArray(scopes) && applyScopes(scopes);
478
- }
479
- }
480
- return resumes.splice(0, i), i;
481
- }, lastEffect, visits, visit, visitText, visitType, visitScope, lastToken, lastTokenIndex, visitBranches, embedAnchor;
482
- return serializeContext._ = registeredValues, render.m = (effects) => {
483
- if (processResumes(render.r, effects), readyIds && render.b) for (let progress = 1; progress;) {
484
- progress = 0;
485
- for (let readyId of readyIds) {
486
- let resumes = render.b[readyId];
487
- resumes && processResumes(resumes, effects) && (progress = 1);
488
- }
489
- }
490
- let retained = 0;
491
- for (visit of visits = render.v) if (lastTokenIndex = render.i.length, visitText = visit.data, visitType = visitText[lastTokenIndex++], visitScope = getScope(nextToken()), visitType === "*") {
492
- let prev = visit.previousSibling;
493
- visitScope[nextToken()] = prev && (prev.nodeType < 8 || prev.data) ? prev : visit.parentNode.insertBefore(new Text(), visit);
494
- } else branchesEnabled ? (visitBranches ||= createVisitBranches())() : render.b && (visits[retained++] = visit);
495
- return embedRenders && !embedAnchor && visit && embedRenders.set(embedAnchor = visit.parentNode.insertBefore(new Text(), visit.nextSibling), [renderId, scopeLookup]), visits.length = retained, effects;
496
- }, render.w = () => {
497
- walk(), runResumeEffects(render);
498
- }, render;
499
- }) });
500
- };
501
- if (renders) {
502
- initRuntime(renders);
503
- for (let renderId in renders) runResumeEffects(curRenders(renderId));
504
- } else defineRuntime({
505
- configurable: !0,
506
- set: initRuntime
507
- });
508
- }
509
- function runResumeEffects(render) {
510
- try {
511
- isResuming = 1, runEffects(render.m([]), 1);
512
- } finally {
513
- isResuming = 0;
514
- }
515
- }
516
- function getRegisteredWithScope(id, scope) {
517
- let val = registeredValues[id];
518
- return scope ? val(scope) : val;
519
- }
520
- function _resume(id, obj) {
521
- return registeredValues[id] = obj;
522
- }
523
- function _var_resume(id, signal) {
524
- return _resume(id, (scope) => (value) => signal(scope, value)), signal;
525
- }
526
- function _el(id, accessor) {
527
- return accessor = decodeAccessor(accessor), _resume(id, (scope) => () => scope[accessor]);
528
- }
529
- //#endregion
530
- //#region src/dom/renderer.ts
531
- function createBranch($global, renderer, parentScope, parentNode) {
532
- let branch = createScope($global);
533
- return branch._ = renderer.e || parentScope, setParentBranch(branch, parentScope?.F), renderer.b?.(branch, parentNode.namespaceURI), branch;
534
- }
535
- function setParentBranch(branch, parentBranch) {
536
- parentBranch && (branch.N = parentBranch, (parentBranch.D ||= /* @__PURE__ */ new Set()).add(branch)), branch.F = branch;
537
- }
538
- function createAndSetupBranch($global, renderer, parentScope, parentNode) {
539
- return setupBranch(renderer, createBranch($global, renderer, parentScope, parentNode));
540
- }
541
- function setupBranch(renderer, branch) {
542
- return renderer.c && queueRender(branch, renderer.c, -1), branch;
543
- }
544
- function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
545
- walks = walks ? walks.replace(/[^\0-1]+$/, "") : "", setup = setup ? setup._ || setup : void 0, params ||= void 0;
546
- let clone = template ? (branch, ns) => {
547
- ((cloneCache[ns] ||= {})[template] ||= createCloneableHTML(template, ns))(branch, walks);
548
- } : (branch) => {
549
- walk(branch.S = branch.K = new Text(), walks, branch);
550
- };
551
- return (owner) => ({
552
- a: id,
553
- b: clone,
554
- e: owner,
555
- c: setup,
556
- d: params,
557
- f: dynamicScopesAccessor
558
- });
559
- }
560
- function _content_resume(id, template, walks, setup, params, dynamicScopesAccessor) {
561
- return _resume(id, _content(id, template, walks, setup, params, dynamicScopesAccessor));
562
- }
563
- function _content_closures(renderer, closureFns) {
564
- let closureSignals = {};
565
- for (let key in closureFns) closureSignals[key] = _const(+key, closureFns[key]);
566
- return (owner, closureValues) => {
567
- let instance = renderer(owner);
568
- return instance.g = closureSignals, instance.h = closureValues, instance;
569
- };
570
- }
571
- function createCloneableHTML(html, ns) {
572
- let { firstChild, lastChild } = parseHTML(html, ns), parent = document.createElementNS(ns, "t");
573
- return insertChildNodes(parent, null, firstChild, lastChild), firstChild === lastChild && firstChild.nodeType < 8 ? (branch, walks) => {
574
- walk(branch.S = branch.K = firstChild.cloneNode(!0), walks, branch);
575
- } : (branch, walks) => {
576
- let clone = parent.cloneNode(!0);
577
- walk(clone.firstChild, walks, branch), branch.S = clone.firstChild, branch.K = clone.lastChild;
578
- };
579
- }
580
- //#endregion
581
- //#region src/dom/dom.ts
582
- function _to_text(value) {
583
- return value || value === 0 ? value + "" : "";
584
- }
585
- function _attr(element, name, value) {
586
- setAttribute(element, name, normalizeAttrValue(value));
587
- }
588
- function setAttribute(element, name, value) {
589
- element.getAttribute(name) != value && (value === void 0 ? element.removeAttribute(name) : element.setAttribute(name, value));
590
- }
591
- function _attr_class(element, value) {
592
- setAttribute(element, "class", toDelimitedString(value, " ", stringifyClassObject) || void 0);
593
- }
594
- function _attr_class_items(element, items) {
595
- for (let key in items) _attr_class_item(element, key, items[key]);
596
- }
597
- function _attr_class_item(element, name, value) {
598
- element.classList.toggle(name, !!value);
599
- }
600
- function _attr_style(element, value) {
601
- setAttribute(element, "style", toDelimitedString(value, ";", stringifyStyleObject) || void 0);
602
- }
603
- function _attr_style_items(element, items) {
604
- for (let key in items) _attr_style_item(element, key, items[key]);
605
- }
606
- function _attr_style_item(element, name, value) {
607
- element.style.setProperty(name, _to_text(value));
608
- }
609
- function _style_shell(scope, nodeAccessor) {
610
- let element = scope[nodeAccessor], id = _id(scope);
611
- _attr_nonce(scope, nodeAccessor), element.className = id, _text_content(element, "." + id + "~*{}");
612
- }
613
- function _style_rule_item(element, name, value) {
614
- let text = element.textContent, decl = name + ":" + escapeStyleValue(_to_text(value)) + ";", start = text.indexOf("{" + name + ":");
615
- ~start || (start = text.indexOf(";" + name + ":")), _text_content(element, ~start ? text.slice(0, ++start) + decl + text.slice(text.indexOf(";", start) + 1) : text.slice(0, -1) + decl + "}");
616
- }
617
- function _attr_nonce(scope, nodeAccessor) {
618
- _attr(scope[nodeAccessor], "nonce", scope.$.cspNonce);
619
- }
620
- function _text(node, value) {
621
- let normalizedValue = _to_text(value);
622
- node.data !== normalizedValue && (node.data = normalizedValue);
623
- }
624
- function _text_content(node, value) {
625
- let normalizedValue = _to_text(value);
626
- node.textContent !== normalizedValue && (node.textContent = normalizedValue);
627
- }
628
- function _attrs(scope, nodeAccessor, nextAttrs, controllable) {
629
- let el = scope[nodeAccessor];
630
- for (let i = el.attributes.length; i--;) {
631
- let { name } = el.attributes.item(i);
632
- nextAttrs && (name in nextAttrs || hasAttrAlias(el, name, nextAttrs)) || el.removeAttribute(name);
633
- }
634
- attrsInternal(scope, nodeAccessor, nextAttrs, controllable);
635
- }
636
- function _attrs_content(scope, nodeAccessor, nextAttrs, controllable) {
637
- _attrs(scope, nodeAccessor, nextAttrs, controllable), _attr_content(scope, nodeAccessor, nextAttrs?.content);
638
- }
639
- function hasAttrAlias(element, attr, nextAttrs) {
640
- return attr === "checked" && element.tagName === "INPUT" && "checkedValue" in nextAttrs;
641
- }
642
- function _attrs_partial(scope, nodeAccessor, nextAttrs, skip, controllable) {
643
- let el = scope[nodeAccessor], partial = {};
644
- for (let i = el.attributes.length; i--;) {
645
- let { name } = el.attributes.item(i);
646
- !skip[name] && !(nextAttrs && name in nextAttrs) && el.removeAttribute(name);
647
- }
648
- for (let name in nextAttrs) {
649
- let key = isEventHandler(name) ? `on-${getEventHandlerName(name)}` : name;
650
- skip[key] || (partial[key] = nextAttrs[name]);
651
- }
652
- attrsInternal(scope, nodeAccessor, partial, controllable);
653
- }
654
- function _attrs_partial_content(scope, nodeAccessor, nextAttrs, skip, controllable) {
655
- _attrs_partial(scope, nodeAccessor, nextAttrs, skip, controllable), _attr_content(scope, nodeAccessor, nextAttrs?.content);
656
- }
657
- function attrsInternal(scope, nodeAccessor, nextAttrs, controllable) {
658
- let el = scope[nodeAccessor], events = scope["I" + nodeAccessor], skip;
659
- for (let name in events) events[name] = 0;
660
- controllable && (scope["F" + nodeAccessor] = 5, scope["E" + nodeAccessor] = 0, nextAttrs && (skip = controllable(scope, nodeAccessor, nextAttrs)));
661
- for (let name in nextAttrs) {
662
- let value = nextAttrs[name];
663
- switch (name) {
664
- case "class":
665
- _attr_class(el, value);
666
- break;
667
- case "style":
668
- _attr_style(el, value);
669
- break;
670
- default:
671
- isEventHandler(name) ? (events ||= scope["I" + nodeAccessor] = {})[getEventHandlerName(name)] = value : skip?.test(name) || name === "content" && el.tagName !== "META" || _attr(el, name, value);
672
- break;
673
- }
674
- }
675
- }
676
- function _attr_content(scope, nodeAccessor, value) {
677
- let content = normalizeClientRender(value);
678
- scope["D" + nodeAccessor] !== (scope["D" + nodeAccessor] = content?.a) && (setConditionalRenderer(scope, nodeAccessor, content, createAndSetupBranch), content?.f && subscribeToScopeSet(content.e, content.f, scope["A" + nodeAccessor]));
679
- for (let accessor in content?.g) content.g[accessor](scope["A" + nodeAccessor], content.h[accessor]);
680
- }
681
- function _attrs_script(scope, nodeAccessor) {
682
- let el = scope[nodeAccessor], events = scope["I" + nodeAccessor];
683
- controllableScripts[scope["F" + nodeAccessor]]?.(scope, nodeAccessor);
684
- for (let name in events) _on(el, name, events[name]);
685
- }
686
- function _html(scope, value, accessor) {
687
- let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope["H" + accessor] || firstChild, newContent = parseHTML(_to_text(value), parentNode.namespaceURI);
688
- insertChildNodes(parentNode, firstChild, scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()), scope["H" + accessor] = newContent.lastChild), removeChildNodes(firstChild, lastChild);
689
- }
690
- function normalizeClientRender(value) {
691
- let renderer = normalizeDynamicRenderer(value);
692
- if (renderer && renderer.a) return renderer;
693
- }
694
- function normalizeAttrValue(value) {
695
- if (isNotVoid(value)) return value === !0 ? "" : value + "";
696
- }
697
- function _lifecycle(scope, thisObj, index = 0) {
698
- let accessor = "K" + index, instance = scope[accessor];
699
- instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[accessor] = thisObj, Object.assign(thisObj, thisObj.onMount?.()), $signal(scope, accessor).onabort = () => thisObj.onDestroy?.());
700
- }
701
- function removeChildNodes(startNode, endNode) {
702
- let stop = endNode.nextSibling;
703
- for (; startNode !== stop;) {
704
- let next = startNode.nextSibling;
705
- startNode.remove(), startNode = next;
706
- }
707
- }
708
- function insertChildNodes(parentNode, referenceNode, startNode, endNode) {
709
- if (parentNode.isConnected) parentNode.insertBefore(toInsertNode(startNode, endNode), referenceNode);
710
- else {
711
- let stop = endNode.nextSibling;
712
- for (; startNode !== stop;) {
713
- let next = startNode.nextSibling;
714
- parentNode.insertBefore(startNode, referenceNode), startNode = next;
715
- }
716
- }
717
- return parentNode;
718
- }
719
- function toInsertNode(startNode, endNode) {
720
- return startNode === endNode ? startNode : insertChildNodes(new DocumentFragment(), null, startNode, endNode);
721
- }
722
- //#endregion
723
- //#region src/dom/resolve-cursor-position.ts
724
- function resolveCursorPosition(inputType, initialPosition, initialValue, updatedValue) {
725
- if ((initialPosition || initialPosition === 0) && (initialPosition !== initialValue.length || /kw/.test(inputType))) {
726
- let before = initialValue.slice(0, initialPosition), after = initialValue.slice(initialPosition);
727
- if (updatedValue.startsWith(before)) return initialPosition;
728
- if (updatedValue.endsWith(after)) return updatedValue.length - after.length;
729
- let count = before.replace(R, "").length, pos = 0;
730
- for (; count && updatedValue[pos];) updatedValue[pos++].replace(R, "") && count--;
731
- return pos;
732
- }
733
- return -1;
734
- }
735
- //#endregion
736
- //#region src/dom/controllable.ts
737
- function _attr_input_checked_default(scope, nodeAccessor, checked) {
738
- let el = scope[nodeAccessor], normalizedChecked = isNotVoid(checked);
739
- if (el.defaultChecked !== normalizedChecked) {
740
- let restoreValue = scope.H < runId ? el.checked : normalizedChecked;
741
- el.defaultChecked = normalizedChecked, restoreValue !== normalizedChecked && (el.checked = restoreValue);
742
- }
743
- }
744
- /** Filled by the latches a compiled page emits, so a page carries only the
745
- * control kinds its tags can be (`_attrs_script` resolves the kind at run time). */
746
- /** The render pass equivalent, for a tag whose name is only known at run time;
747
- * a statically named tag passes its claim to `_attrs` instead. */
748
- function _enable_controllable_input() {
749
- controllableScripts[0] = _attr_input_checked_script, controllableScripts[1] = _attr_input_checkedValue_script, controllableScripts[2] = _attr_input_value_script;
750
- }
751
- function _enable_controllable_textarea() {
752
- controllableScripts[2] = _attr_input_value_script;
753
- }
754
- function _enable_controllable_select() {
755
- controllableScripts[3] = _attr_select_value_script;
756
- }
757
- function _enable_controllable_open() {
758
- controllableScripts[4] = _attr_details_or_dialog_open_script;
759
- }
760
- /** A run-time tag name can be any controllable, so its page enables them all. */
761
- function _enable_controllable() {
762
- _enable_controllable_input(), _enable_controllable_select(), _enable_controllable_open(), controllableRenders.INPUT = _controllable_input, controllableRenders.TEXTAREA = _controllable_textarea, controllableRenders.SELECT = _controllable_select, controllableRenders.DETAILS = controllableRenders.DIALOG = _controllable_open;
763
- }
764
- function _attr_input_checked(scope, nodeAccessor, checked, checkedChange) {
765
- let el = scope[nodeAccessor], normalizedChecked = isNotVoid(checked);
766
- scope["E" + nodeAccessor] = checkedChange, scope["F" + nodeAccessor] = checkedChange ? 0 : 5, checkedChange && scope.H < runId ? el.checked = normalizedChecked : _attr_input_checked_default(scope, nodeAccessor, normalizedChecked);
767
- }
768
- function _attr_input_checked_script(scope, nodeAccessor) {
769
- let el = scope[nodeAccessor];
770
- syncControllableFormInput(el, hasCheckboxChanged, () => {
771
- let checkedChange = scope["E" + nodeAccessor];
772
- if (checkedChange) {
773
- let newValue = el.checked;
774
- el.checked = !newValue, checkedChange(newValue), run();
775
- }
776
- });
777
- }
778
- function _attr_input_checkedValue_default(scope, nodeAccessor, checkedValue, value) {
779
- let multiple = Array.isArray(checkedValue), normalizedValue = normalizeStrProp(value), normalizedCheckedValue = multiple ? checkedValue.map(normalizeStrProp) : normalizeStrProp(checkedValue);
780
- _attr(scope[nodeAccessor], "value", value), _attr_input_checked_default(scope, nodeAccessor, multiple ? normalizedCheckedValue.includes(normalizedValue) : normalizedValue === normalizedCheckedValue);
781
- }
782
- function _attr_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValueChange, value) {
783
- let el = scope[nodeAccessor], multiple = Array.isArray(checkedValue), normalizedCheckedValue = scope["G" + nodeAccessor] = multiple ? checkedValue.map(normalizeStrProp) : normalizeStrProp(checkedValue);
784
- scope["E" + nodeAccessor] = checkedValueChange, scope["F" + nodeAccessor] = checkedValueChange ? 1 : 5, checkedValueChange && scope.H < runId ? (el.checked = multiple ? normalizedCheckedValue.includes(normalizeStrProp(value)) : normalizeStrProp(value) === normalizedCheckedValue, _attr(el, "value", value)) : _attr_input_checkedValue_default(scope, nodeAccessor, checkedValue, value);
785
- }
786
- function _attr_input_checkedValue_script(scope, nodeAccessor) {
787
- let el = scope[nodeAccessor];
788
- isResuming && el.defaultChecked && (scope["G" + nodeAccessor] ? scope["G" + nodeAccessor].push(el.value) : scope["G" + nodeAccessor] = el.value), syncControllableFormInput(el, hasCheckboxChanged, () => {
789
- let checkedValueChange = scope["E" + nodeAccessor];
790
- if (checkedValueChange) {
791
- let controlledValueKey = "G" + nodeAccessor, oldValue = scope[controlledValueKey], newValue = Array.isArray(oldValue) ? updateList(oldValue, el.value, el.checked) : el.checked ? el.value : void 0;
792
- if (el.name && el.type[0] === "r") for (let radio of document.querySelectorAll(`[type=radio][name=${CSS.escape(el.name)}]`)) radio.form === el.form && (newValue === void 0 && radio.defaultChecked && (newValue = radio.value), radio.checked = Array.isArray(oldValue) ? oldValue.includes(radio.value) : controlledValueKey in scope ? oldValue === radio.value : radio.defaultChecked);
793
- else el.checked = !el.checked;
794
- checkedValueChange(newValue), run();
795
- }
796
- });
797
- }
798
- function _attr_input_value_default(scope, nodeAccessor, value) {
799
- let el = scope[nodeAccessor], normalizedValue = normalizeAttrValue(value) || "";
800
- if (el.defaultValue !== normalizedValue) {
801
- let restoreValue = scope.H < runId ? el.value : normalizedValue;
802
- el.defaultValue = normalizedValue, setInputValue(el, restoreValue);
803
- }
804
- }
805
- function _attr_input_value_dynamic_default(scope, nodeAccessor, value) {
806
- let el = scope[nodeAccessor];
807
- /i[ot]|e[cns]|^[bi]/.test(el.type) ? _attr(el, "value", value) : _attr_input_value_default(scope, nodeAccessor, value);
808
- }
809
- function _attr_input_value(scope, nodeAccessor, value, valueChange, setDefault = _attr_input_value_default) {
810
- let el = scope[nodeAccessor], normalizedValue = normalizeAttrValue(value) || "";
811
- scope["E" + nodeAccessor] = valueChange, scope["G" + nodeAccessor] = normalizedValue, scope["F" + nodeAccessor] = valueChange ? 2 : 5, valueChange && scope.H < runId ? setInputValue(el, normalizedValue) : setDefault(scope, nodeAccessor, normalizedValue);
812
- }
813
- function _attr_input_value_attribute_default(scope, nodeAccessor, value) {
814
- _attr(scope[nodeAccessor], "value", value);
815
- }
816
- function _attr_input_value_script(scope, nodeAccessor) {
817
- let el = scope[nodeAccessor];
818
- isResuming && (scope["G" + nodeAccessor] = el.defaultValue), syncControllableFormInput(el, hasValueChanged, (ev) => {
819
- let valueChange = scope["E" + nodeAccessor];
820
- valueChange && (inputType = ev?.inputType, valueChange(el.value), run(), setInputValue(el, scope["G" + nodeAccessor]), inputType = "");
821
- });
822
- }
823
- function setInputValue(el, value) {
824
- if (el.value !== value) {
825
- let updatedPosition = resolveCursorPosition(inputType, document.activeElement === el && el.selectionStart, el.value, el.value = value);
826
- ~updatedPosition && el.setSelectionRange(updatedPosition, updatedPosition);
827
- }
828
- }
829
- function _attr_select_value_default(scope, nodeAccessor, value) {
830
- let restoreValue, el = scope[nodeAccessor], live = scope.H < runId, multiple = Array.isArray(value), normalizedValue = multiple ? value.map(normalizeStrProp) : normalizeStrProp(value);
831
- pendingEffects.unshift(() => {
832
- for (let opt of el.options) {
833
- let selected = multiple ? normalizedValue.includes(opt.value) : opt.value === normalizedValue;
834
- opt.defaultSelected !== selected && (live && (restoreValue ??= getSelectValue(el, multiple)), opt.defaultSelected = selected);
835
- }
836
- restoreValue !== void 0 && setSelectValue(el, restoreValue, multiple);
837
- }, scope);
838
- }
839
- function _attr_select_value(scope, nodeAccessor, value, valueChange) {
840
- let el = scope[nodeAccessor], existing = scope.H < runId, multiple = Array.isArray(value), normalizedValue = scope["G" + nodeAccessor] = multiple ? value.map(normalizeStrProp) : normalizeStrProp(value);
841
- scope["E" + nodeAccessor] = valueChange, scope["F" + nodeAccessor] = valueChange ? 3 : 5, valueChange && existing ? pendingEffects.unshift(() => setSelectValue(el, normalizedValue, multiple), scope) : _attr_select_value_default(scope, nodeAccessor, normalizedValue);
842
- }
843
- function _attr_select_value_script(scope, nodeAccessor) {
844
- let el = scope[nodeAccessor], onChange = () => {
845
- let valueChange = scope["E" + nodeAccessor];
846
- if (valueChange) {
847
- let oldValue = scope["G" + nodeAccessor], multiple = Array.isArray(oldValue), newValue = getSelectValue(el, multiple);
848
- setSelectValue(el, oldValue, multiple), valueChange(newValue), run();
849
- }
850
- };
851
- if (isResuming) if (el.multiple) {
852
- scope["G" + nodeAccessor] = [];
853
- for (let opt of el.options) opt.defaultSelected && scope["G" + nodeAccessor].push(opt.value);
854
- } else {
855
- scope["G" + nodeAccessor] = "";
856
- for (let opt of el.options) if (opt.defaultSelected) {
857
- scope["G" + nodeAccessor] = opt.value;
858
- break;
859
- }
860
- }
861
- syncControllableFormInput(el, hasSelectChanged, onChange), observeOnce(scope, nodeAccessor, {
862
- childList: !0,
863
- subtree: !0
864
- }, () => {
865
- let value = scope["G" + nodeAccessor];
866
- (Array.isArray(value) ? value.length !== el.selectedOptions.length || value.some((_, i) => !value.includes(el.selectedOptions[i].value)) : el.value !== value) && onChange();
867
- });
868
- }
869
- function setSelectValue(el, value, multiple) {
870
- if (multiple) for (let opt of el.options) opt.selected = value.includes(opt.value);
871
- else el.value = value;
872
- }
873
- function getSelectValue(el, multiple) {
874
- return multiple ? Array.from(el.selectedOptions, (opt) => opt.value) : el.value;
875
- }
876
- function _attr_details_or_dialog_open_default(scope, nodeAccessor, open) {
877
- scope.H === runId && (scope[nodeAccessor].open = isNotVoid(open));
878
- }
879
- function _attr_details_or_dialog_open(scope, nodeAccessor, open, openChange) {
880
- let normalizedOpen = scope["G" + nodeAccessor] = isNotVoid(open);
881
- scope["E" + nodeAccessor] = openChange, scope["F" + nodeAccessor] = openChange ? 4 : 5, openChange && scope.H < runId ? scope[nodeAccessor].open = normalizedOpen : _attr_details_or_dialog_open_default(scope, nodeAccessor, normalizedOpen);
882
- }
883
- function _attr_details_or_dialog_open_script(scope, nodeAccessor) {
884
- let el = scope[nodeAccessor];
885
- observeOnce(scope, nodeAccessor, {
886
- attributes: !0,
887
- attributeFilter: ["open"]
888
- }, () => {
889
- let openChange = scope["E" + nodeAccessor];
890
- if (openChange && el.open === !scope["G" + nodeAccessor]) {
891
- let newValue = el.open;
892
- el.open = !newValue, openChange(newValue), run();
893
- }
894
- });
895
- }
896
- function observeOnce(scope, nodeAccessor, init, callback) {
897
- (scope["N" + nodeAccessor] ||= new MutationObserver(callback)).observe(scope[nodeAccessor], init);
898
- }
899
- function syncControllableFormInput(el, hasChanged, onChange) {
900
- el._ = onChange, delegate("input", handleChange), el.form && delegate("reset", handleFormReset), isResuming && hasChanged(el) && queueMicrotask(onChange);
901
- }
902
- function handleChange(ev) {
903
- ev.target._?.(ev);
904
- }
905
- function handleFormReset(ev) {
906
- let handlers = [];
907
- for (let el of ev.target.elements) el._ && hasFormElementChanged(el) && handlers.push(el._);
908
- requestAnimationFrame(() => {
909
- if (!ev.defaultPrevented) for (let change of handlers) change();
910
- });
911
- }
912
- function hasValueChanged(el) {
913
- return el.value !== el.defaultValue;
914
- }
915
- function hasCheckboxChanged(el) {
916
- return el.checked !== el.defaultChecked;
917
- }
918
- function hasSelectChanged(el) {
919
- for (let opt of el.options) if (opt.selected !== opt.defaultSelected) return !0;
920
- }
921
- function hasFormElementChanged(el) {
922
- return el.options ? hasSelectChanged(el) : hasValueChanged(el) || hasCheckboxChanged(el);
923
- }
924
- function normalizeStrProp(value) {
925
- return normalizeAttrValue(value) || "";
926
- }
927
- function updateList(arr, val, push) {
928
- let index = arr.indexOf(val);
929
- return (push ? !~index && [...arr, val] : ~index && arr.slice(0, index).concat(arr.slice(index + 1))) || arr;
930
- }
931
- function _controllable_input(scope, nodeAccessor, nextAttrs) {
932
- return "checked" in nextAttrs || "checkedChange" in nextAttrs ? (_attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange), /^checked(?:Value)?(?:Change)?$/) : "checkedValue" in nextAttrs || "checkedValueChange" in nextAttrs ? (_attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value), /^(?:value|checked(?:Value)?)(?:Change)?$/) : _controllable_textarea(scope, nodeAccessor, nextAttrs, _attr_input_value_dynamic_default);
933
- }
934
- function _controllable_textarea(scope, nodeAccessor, nextAttrs, dynamicDefault) {
935
- if ("value" in nextAttrs || "valueChange" in nextAttrs) return _attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange, dynamicDefault), /^value(?:Change)?$/;
936
- }
937
- function _controllable_select(scope, nodeAccessor, nextAttrs) {
938
- if ("value" in nextAttrs || "valueChange" in nextAttrs) return _attr_select_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange), /^value(?:Change)?$/;
939
- }
940
- function _controllable_open(scope, nodeAccessor, nextAttrs) {
941
- if ("open" in nextAttrs || "openChange" in nextAttrs) return _attr_details_or_dialog_open(scope, nodeAccessor, nextAttrs.open, nextAttrs.openChange), /^open(?:Change)?$/;
942
- }
943
- //#endregion
944
- //#region src/dom/control-flow.ts
945
- function _await_promise(nodeAccessor, params) {
946
- nodeAccessor = decodeAccessor(nodeAccessor);
947
- let promiseAccessor = "L" + nodeAccessor, branchAccessor = "A" + nodeAccessor;
948
- _enable_catch();
949
- let resolveAwait = (scope, referenceNode, value) => {
950
- let awaitBranch = scope[branchAccessor];
951
- return awaitBranch.V && (awaitBranch.Y = awaitBranch.Y?.forEach(syncGen), setupBranch(awaitBranch.V, awaitBranch), awaitBranch.V = 0, insertBranchBefore(awaitBranch, scope[nodeAccessor].parentNode, scope[nodeAccessor]), referenceNode.remove()), params?.(awaitBranch, [value]), awaitBranch;
952
- }, awaitPromise = (scope, promise) => {
953
- !isPromise(promise) && scope[promiseAccessor] && (promise = Promise.resolve(promise));
954
- let awaitBranch = scope[branchAccessor], tryPlaceholder = findBranchWithKey(scope, "Q"), tryBranch = tryPlaceholder || awaitBranch;
955
- if (!(isPromise(promise) ? tryBranch : awaitBranch)) {
956
- scope[promiseAccessor] = () => awaitPromise(scope, promise);
957
- return;
958
- }
959
- if (!isPromise(promise)) {
960
- resolveAwait(scope, scope[nodeAccessor], promise);
961
- return;
962
- }
963
- let awaitCounter = tryBranch.O;
964
- placeholderShown.add(pendingEffects), !tryPlaceholder && !awaitCounter?.i && (awaitCounter = createAwaitCounter(tryBranch, () => {
965
- if (tryBranch === scope[branchAccessor]) {
966
- let anchor = scope[nodeAccessor];
967
- if (anchor.parentNode) {
968
- let detachedParent = scope[branchAccessor].S.parentNode;
969
- detachedParent === anchor.parentNode ? anchor.remove() : anchor.replaceWith(detachedParent);
970
- }
971
- } else dismissPlaceholder(tryBranch);
972
- })), scope[promiseAccessor] || (awaitBranch && (awaitBranch.W ||= []), tryPlaceholder ? awaitCounter = addAwaitCounter(scope, tryPlaceholder) : awaitCounter.i++ || requestAnimationFrame(() => awaitCounter.i && runEffects(prepareEffects(() => queueRender(scope, () => {
973
- awaitBranch.V || (awaitBranch.S.parentNode.insertBefore(scope[nodeAccessor], awaitBranch.S), tempDetachBranch(tryBranch));
974
- }, -1)))));
975
- let thisPromise = scope[promiseAccessor] = promise.then((data) => {
976
- if (thisPromise === scope[promiseAccessor]) {
977
- let referenceNode = scope[nodeAccessor];
978
- if (scope[promiseAccessor] = 0, scope.F?.H === 0) {
979
- awaitCounter.c(), run();
980
- return;
981
- }
982
- queueAsyncRender(scope, () => {
983
- awaitBranch = resolveAwait(scope, referenceNode, data);
984
- let pendingRenders = awaitBranch.W;
985
- if (awaitBranch.W = 0, pendingRenders?.forEach(queuePendingRender), placeholderShown.add(pendingEffects), awaitCounter.c(), awaitCounter.m) {
986
- let fnScopes = /* @__PURE__ */ new Map(), effects = awaitCounter.m([]);
987
- for (let i = 0; i < pendingEffects.length;) {
988
- let fn = pendingEffects[i++], scopes = fnScopes.get(fn);
989
- scopes || fnScopes.set(fn, scopes = /* @__PURE__ */ new Set()), scopes.add(pendingEffects[i++]);
990
- }
991
- for (let i = 0; i < effects.length;) {
992
- let fn = effects[i++], scope = effects[i++];
993
- fnScopes.get(fn)?.has(scope) || queueEffect(scope, fn);
994
- }
995
- }
996
- });
997
- }
998
- }, (error) => {
999
- thisPromise === scope[promiseAccessor] && (scope[promiseAccessor] = 0, tryPlaceholder && !awaitCounter.m ? awaitCounter.c() : awaitCounter.i = 0, queueAsyncRender(scope, renderCatch, error));
1000
- });
1001
- };
1002
- return awaitPromise;
1003
- }
1004
- function _await_content(nodeAccessor, template, walks, setup) {
1005
- nodeAccessor = decodeAccessor(nodeAccessor);
1006
- let branchAccessor = "A" + nodeAccessor, promiseAccessor = "L" + nodeAccessor, renderer = _content("", template, walks, setup)();
1007
- return (scope) => {
1008
- let pendingScopes = collectScopes(() => (scope[branchAccessor] = createBranch(scope.$, renderer, scope, scope[nodeAccessor].parentNode)).V = renderer);
1009
- scope[branchAccessor].Y = pendingScopes;
1010
- let resolveSync = scope[promiseAccessor];
1011
- typeof resolveSync == "function" && (scope[promiseAccessor] = 0, resolveSync());
1012
- };
1013
- }
1014
- function addAwaitCounter(scope, tryBranch = findBranchWithKey(scope, "Q")) {
1015
- if (!tryBranch) return;
1016
- let awaitCounter = tryBranch.O;
1017
- return awaitCounter?.i || (awaitCounter = createAwaitCounter(tryBranch, () => dismissPlaceholder(tryBranch))), placeholderShown.add(pendingEffects), awaitCounter.i++ || requestAnimationFrame(() => awaitCounter.i && runEffects(prepareEffects(() => queueRender(tryBranch, () => {
1018
- insertBranchBefore(tryBranch.P = createAndSetupBranch(tryBranch.$, tryBranch.Q, tryBranch._, tryBranch.S.parentNode), tryBranch.S.parentNode, tryBranch.S), tempDetachBranch(tryBranch);
1019
- }, -1)))), awaitCounter;
1020
- }
1021
- function createAwaitCounter(tryBranch, done) {
1022
- let awaitCounter = tryBranch.O = {
1023
- i: 0,
1024
- c() {
1025
- if (--awaitCounter.i) return 1;
1026
- done(), queueEffect(tryBranch, runPendingEffects);
1027
- }
1028
- };
1029
- return awaitCounter;
1030
- }
1031
- function runPendingEffects(scope) {
1032
- let effects = scope.J;
1033
- effects && (scope.J = [], runEffects(effects, 1));
1034
- }
1035
- function dismissPlaceholder(tryBranch) {
1036
- let placeholderBranch = tryBranch.P;
1037
- placeholderBranch && (tryBranch.P = 0, placeholderBranch.S.parentNode.insertBefore(tryBranch.S.parentNode, placeholderBranch.S), removeAndDestroyBranch(placeholderBranch));
1038
- }
1039
- function _try(nodeAccessor, template, walks, setup) {
1040
- nodeAccessor = decodeAccessor(nodeAccessor);
1041
- let branchAccessor = "A" + nodeAccessor, renderer = _content("", template, walks, setup)();
1042
- return (scope, input) => {
1043
- scope[branchAccessor] || setConditionalRenderer(scope, nodeAccessor, renderer, createAndSetupBranch);
1044
- let branch = scope[branchAccessor];
1045
- branch && (branch.C = nodeAccessor, branch.E = input.catch && (normalizeDynamicRenderer(input.catch) || 0), branch.Q = normalizeDynamicRenderer(input.placeholder));
1046
- };
1047
- }
1048
- function renderCatch(scope, error) {
1049
- let tryWithCatch = findBranchWithKey(scope, "E");
1050
- if (tryWithCatch) {
1051
- let owner = tryWithCatch._, placeholderBranch = tryWithCatch.P;
1052
- placeholderBranch && (tryWithCatch.O && (tryWithCatch.O.i = 0), owner["A" + tryWithCatch.C] = placeholderBranch, destroyBranch(tryWithCatch)), caughtError.add(pendingEffects), setConditionalRenderer(owner, tryWithCatch.C, tryWithCatch.E, createAndSetupBranch), tryWithCatch.E?.d?.(owner["A" + tryWithCatch.C], [error]);
1053
- } else throw error;
1054
- }
1055
- function _if(nodeAccessor, ...branchesArgs) {
1056
- nodeAccessor = decodeAccessor(nodeAccessor);
1057
- let branchAccessor = "D" + nodeAccessor, branches = [], i = 0;
1058
- for (; i < branchesArgs.length;) branches.push(_content("", branchesArgs[i++], branchesArgs[i++], branchesArgs[i++])());
1059
- return enableBranches(), (scope, newBranch) => {
1060
- newBranch !== (scope[branchAccessor] ?? (scope["A" + nodeAccessor] && 0)) && setConditionalRenderer(scope, nodeAccessor, branches[scope[branchAccessor] = newBranch], createAndSetupBranch);
1061
- };
1062
- }
1063
- function _show(nodeAccessor, startNodeAccessor, endNodeAccessor) {
1064
- nodeAccessor = decodeAccessor(nodeAccessor), startNodeAccessor !== void 0 && (startNodeAccessor = decodeAccessor(startNodeAccessor)), endNodeAccessor !== void 0 && (endNodeAccessor = decodeAccessor(endNodeAccessor));
1065
- let rangeAccessor = "A" + nodeAccessor;
1066
- return enableBranches(), (scope, display) => {
1067
- let referenceNode = scope[nodeAccessor], onlyChild = referenceNode.nodeType === 1, parentNode = onlyChild ? referenceNode : referenceNode.parentNode, range = scope[rangeAccessor];
1068
- range || (range = scope[rangeAccessor] = {}, range.S = onlyChild ? parentNode.firstChild : scope[startNodeAccessor], range.K = onlyChild ? parentNode.lastChild : endNodeAccessor === void 0 ? referenceNode.previousSibling : scope[endNodeAccessor]);
1069
- let startNode = range.S;
1070
- if (range.L && startNode === range.K && startNode.tagName === "T") {
1071
- let wrapper = startNode;
1072
- wrapper.firstChild || wrapper.appendChild(new Text()), range = scope[rangeAccessor] = {}, range.S = startNode = wrapper.firstChild, range.K = wrapper.lastChild, wrapper.replaceWith(...wrapper.childNodes);
1073
- }
1074
- let inDom = onlyChild ? !!parentNode.firstChild : startNode.parentNode === parentNode;
1075
- display ? inDom || insertBranchBefore(range, parentNode, onlyChild ? null : referenceNode) : inDom && (onlyChild && (range.S = parentNode.firstChild, range.K = parentNode.lastChild), tempDetachBranch(range));
1076
- };
1077
- }
1078
- function patchDynamicTag(fn) {
1079
- _dynamic_tag = fn(_dynamic_tag);
1080
- }
1081
- function _dynamic_tag_content(nodeAccessor) {
1082
- nodeAccessor = decodeAccessor(nodeAccessor);
1083
- let childScopeAccessor = "A" + nodeAccessor, rendererAccessor = "D" + nodeAccessor;
1084
- return enableBranches(), (scope, renderer) => {
1085
- if (scope[rendererAccessor] !== (scope[rendererAccessor] = renderer?.a || renderer) && (setConditionalRenderer(scope, nodeAccessor, renderer, createAndSetupBranch), renderer?.f && subscribeToScopeSet(renderer.e, renderer.f, scope[childScopeAccessor])), renderer) for (let accessor in renderer.g) renderer.g[accessor](scope[childScopeAccessor], renderer.h[accessor]);
1086
- };
1087
- }
1088
- function _resume_dynamic_tag() {
1089
- _resume("d", dynamicTagScript);
1090
- }
1091
- function dynamicTagScript(branch) {
1092
- _attrs_script(branch, "a");
1093
- }
1094
- function setConditionalRenderer(scope, nodeAccessor, newRenderer, createBranch) {
1095
- let referenceNode = scope[nodeAccessor], prevBranch = scope["A" + nodeAccessor], parentNode = referenceNode.nodeType > 1 ? (prevBranch?.S || referenceNode).parentNode : referenceNode, newBranch = scope["A" + nodeAccessor] = newRenderer && createBranch(scope.$, newRenderer, scope, parentNode);
1096
- referenceNode === parentNode ? (prevBranch && (destroyBranch(prevBranch), referenceNode.textContent = ""), newBranch && insertBranchBefore(newBranch, parentNode, null)) : prevBranch ? (newBranch ? insertBranchBefore(newBranch, parentNode, prevBranch.S) : parentNode.insertBefore(referenceNode, prevBranch.S), removeAndDestroyBranch(prevBranch)) : newBranch && (insertBranchBefore(newBranch, parentNode, referenceNode), referenceNode.remove());
1097
- }
1098
- /* @__NO_SIDE_EFFECTS__ */
1099
- function loop(forEach) {
1100
- return (nodeAccessor, template, walks, setup, params) => {
1101
- nodeAccessor = decodeAccessor(nodeAccessor);
1102
- let scopesAccessor = "A" + nodeAccessor, keyedScopesAccessor = "O" + nodeAccessor, renderer = _content("", template, walks, setup)();
1103
- return enableBranches(), (scope, value) => {
1104
- let referenceNode = scope[nodeAccessor], oldScopes = toArray(scope[scopesAccessor]), newScopes = scope[scopesAccessor] = [];
1105
- scope[keyedScopesAccessor] = null;
1106
- let oldLen = oldScopes.length, parentNode = referenceNode.nodeType > 1 ? referenceNode.parentNode || oldScopes[0]?.S.parentNode : referenceNode, oldScopesByKey, hasPotentialMoves, start = 0;
1107
- forEach(value, (key, args) => {
1108
- let i = newScopes.length, oldScope = oldScopes[i], branch = oldLen && (oldScopesByKey || key !== (oldScope?.M ?? i) ? (oldScopesByKey ||= oldScopes.reduce((map, scope, j) => j < i ? map : (scope.I = j, map.set(scope.M ?? j, scope)), /* @__PURE__ */ new Map())).get(key) : oldScope && (start++, oldScope));
1109
- branch ? (hasPotentialMoves = !0, oldScopesByKey?.delete(key)) : branch = createAndSetupBranch(scope.$, renderer, scope, parentNode), branch.M = key, newScopes.push(branch), params?.(branch, args);
1110
- });
1111
- let newLen = newScopes.length, hasSiblings = referenceNode !== parentNode, afterReference = null, oldEnd = oldLen - 1, newEnd = newLen - 1;
1112
- if (hasSiblings && (oldLen ? (afterReference = oldScopes[oldEnd].K.nextSibling, newLen || parentNode.insertBefore(referenceNode, afterReference)) : newLen && (afterReference = referenceNode.nextSibling, referenceNode.remove())), !hasPotentialMoves) {
1113
- oldLen && (oldScopes.forEach(hasSiblings ? removeAndDestroyBranch : destroyBranch), hasSiblings || (parentNode.textContent = ""));
1114
- for (let newScope of newScopes) insertBranchBefore(newScope, parentNode, afterReference);
1115
- return;
1116
- }
1117
- if (oldScopesByKey) oldScopesByKey.forEach(removeAndDestroyBranch);
1118
- else for (let i = newLen; i < oldLen; i++) removeAndDestroyBranch(oldScopes[i]);
1119
- for (; oldEnd >= start && newEnd >= start && oldScopes[oldEnd] === newScopes[newEnd];) oldEnd--, newEnd--;
1120
- if (oldEnd + 1 < oldLen && (afterReference = oldScopes[oldEnd + 1].S), start > oldEnd || start > newEnd) {
1121
- for (let i = start; i <= newEnd; i++) insertBranchBefore(newScopes[i], parentNode, afterReference);
1122
- return;
1123
- }
1124
- let diffLen = newEnd - start + 1, sources = Array(diffLen), pred = Array(diffLen), tails = [], tail = -1, lo, hi, mid;
1125
- for (let i = diffLen; i--;) sources[i] = newScopes[start + i].I ?? -1;
1126
- for (let i = 0; i < diffLen; i++) if (~sources[i]) if (tail < 0 || sources[tails[tail]] < sources[i]) ~tail && (pred[i] = tails[tail]), tails[++tail] = i;
1127
- else {
1128
- for (lo = 0, hi = tail; lo < hi;) mid = (lo + hi) / 2 | 0, sources[tails[mid]] < sources[i] ? lo = mid + 1 : hi = mid;
1129
- sources[i] < sources[tails[lo]] && (lo > 0 && (pred[i] = tails[lo - 1]), tails[lo] = i);
1130
- }
1131
- for (hi = tails[tail], lo = tail + 1; lo-- > 0;) tails[lo] = hi, hi = pred[hi];
1132
- for (let i = diffLen; i--;) ~tail && i === tails[tail] ? tail-- : insertBranchBefore(newScopes[start + i], parentNode, afterReference), afterReference = newScopes[start + i].S;
1133
- };
1134
- };
1135
- }
1136
- function createBranchWithTagNameOrRenderer($global, tagNameOrRenderer, parentScope, parentNode) {
1137
- let branch = createBranch($global, tagNameOrRenderer, parentScope, parentNode);
1138
- return typeof tagNameOrRenderer == "string" ? branch.a = branch.S = branch.K = document.createElementNS(tagNameOrRenderer === "svg" ? "http://www.w3.org/2000/svg" : tagNameOrRenderer === "math" ? "http://www.w3.org/1998/Math/MathML" : parentNode.namespaceURI, tagNameOrRenderer) : setupBranch(tagNameOrRenderer, branch), branch;
1139
- }
1140
- function bySecondArg(_item, index) {
1141
- return index;
1142
- }
1143
- function byFirstArg(name) {
1144
- return name;
1145
- }
1146
- //#endregion
1147
- //#region src/dom/queue.ts
1148
- function queueRender(scope, signal, signalKey, value, scopeKey = scope.L) {
1149
- let render;
1150
- if (signalKey >= 0 && (render = scope[signalKey])) {
1151
- if (render.d = value, render.e === runId || catchEnabled && render.f) return;
1152
- render.e = runId;
1153
- } else render = {
1154
- a: scopeKey * 1e6 + signalKey,
1155
- b: scope,
1156
- c: signal,
1157
- d: value,
1158
- e: runId
1159
- }, signalKey >= 0 && (scope[signalKey] = render);
1160
- queuePendingRender(render);
1161
- }
1162
- function queuePendingRender(render) {
1163
- let i = pendingRenders.push(render) - 1;
1164
- for (; i;) {
1165
- let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
1166
- if (render.a - parent.a >= 0) break;
1167
- pendingRenders[i] = parent, i = parentIndex;
1168
- }
1169
- pendingRenders[i] = render;
1170
- }
1171
- function queueEffect(scope, fn) {
1172
- pendingEffects.push(fn, scope);
1173
- }
1174
- function run() {
1175
- let effects = pendingEffects;
1176
- try {
1177
- rendering = 1, runRenders();
1178
- } finally {
1179
- runId++, rendering = 0, pendingRenders = [], pendingEffects = [];
1180
- }
1181
- runEffects(effects);
1182
- }
1183
- function queueAsyncRender(scope, signal, value) {
1184
- queueRender(scope, signal, -1, value), queueMicrotask(run);
1185
- }
1186
- function prepareEffects(fn) {
1187
- let prevRenders = pendingRenders, prevEffects = pendingEffects, preparedEffects = pendingEffects = [];
1188
- pendingRenders = [];
1189
- try {
1190
- rendering = 1, fn(), runRenders();
1191
- } finally {
1192
- runId++, rendering = 0, pendingRenders = prevRenders, pendingEffects = prevEffects;
1193
- }
1194
- return preparedEffects;
1195
- }
1196
- function runRenders() {
1197
- for (; pendingRenders.length;) {
1198
- let render = pendingRenders[0], item = pendingRenders.pop();
1199
- if (render !== item) {
1200
- let i = 0, mid = pendingRenders.length >> 1, key = (pendingRenders[0] = item).a;
1201
- for (; i < mid;) {
1202
- let bestChild = (i << 1) + 1, right = bestChild + 1;
1203
- if (right < pendingRenders.length && pendingRenders[right].a - pendingRenders[bestChild].a < 0 && (bestChild = right), pendingRenders[bestChild].a - key >= 0) break;
1204
- pendingRenders[i] = pendingRenders[bestChild], i = bestChild;
1205
- }
1206
- pendingRenders[i] = item;
1207
- }
1208
- runRender(render);
1209
- }
1210
- }
1211
- function skipDestroyedRenders() {
1212
- runRender = ((runRender) => (render) => {
1213
- render.b.F?.H !== 0 && runRender(render);
1214
- })(runRender);
1215
- }
1216
- function _enable_catch() {
1217
- if (!catchEnabled) {
1218
- catchEnabled = 1, enableBranches();
1219
- let handlePendingTry = (fn, scope, branch) => {
1220
- for (; branch;) {
1221
- if (branch.O?.i) return (branch.J ||= []).push(fn, scope);
1222
- branch = branch.N;
1223
- }
1224
- };
1225
- runEffects = ((runEffects) => (effects, checkPending = placeholderShown.has(effects)) => {
1226
- if (checkPending || caughtError.has(effects)) {
1227
- let i = 0, fn, scope, branch;
1228
- for (; i < effects.length;) fn = effects[i++], scope = effects[i++], (branch = scope.F)?.H !== 0 && !(checkPending && handlePendingTry(fn, scope, branch)) && fn(scope);
1229
- } else runEffects(effects);
1230
- })(runEffects), runRender = ((runRender) => (render) => {
1231
- try {
1232
- let branch = render.b.F;
1233
- for (; branch;) {
1234
- if (branch.W) return render.f = 1, branch.W.push(render);
1235
- branch = branch.N;
1236
- }
1237
- render.f = 0, runRender(render);
1238
- } catch (error) {
1239
- renderCatch(render.b, error);
1240
- }
1241
- })(runRender);
1242
- }
1243
- }
1244
- //#endregion
1245
- //#region src/dom/abort-signal.ts
1246
- function $signalReset(scope, id) {
1247
- let ctrl = scope.A?.[id];
1248
- ctrl && (scope.A[id] = void 0, rendering ? queueEffect(ctrl, abort) : abort(ctrl));
1249
- }
1250
- function $signal(scope, id) {
1251
- return trackCleanup(scope), ((scope.A ||= {})[id] ||= new AbortController()).signal;
1252
- }
1253
- /** Enrols `scope` with its branch so destroying the branch cleans it up. */
1254
- function trackCleanup(scope, subscribers) {
1255
- let branch = scope.F;
1256
- branch && (branch.B ||= /* @__PURE__ */ new Set()).add(scope), subscribers && (scope.Z ||= []).push(subscribers);
1257
- }
1258
- function abort(ctrl) {
1259
- ctrl.abort();
1260
- }
1261
- //#endregion
1262
78
  //#region src/common/compat-meta.ts
1263
79
  //#endregion
1264
80
  //#region src/dom/compat.ts
@@ -1284,76 +100,75 @@ function mount(input = {}, reference, position) {
1284
100
  parentNode = reference.parentNode, nextSibling = reference.nextSibling;
1285
101
  break;
1286
102
  }
1287
- let curValue, args = this.d, effects = prepareEffects(() => {
1288
- branch = createBranch($global, this, void 0, parentNode), branch.T = (newValue) => {
103
+ let curValue, args = this.d, effects = require_control_flow.Zt(() => {
104
+ branch = require_control_flow.ft($global, this, void 0, parentNode), branch.T = (newValue) => {
1289
105
  curValue = newValue;
1290
106
  }, this.c?.(branch), args?.(branch, input);
1291
107
  });
1292
- return insertChildNodes(parentNode, nextSibling, branch.S, branch.K), runEffects(effects), {
108
+ return require_control_flow.ot(parentNode, nextSibling, branch.S, branch.K), require_control_flow.tn(effects), {
1293
109
  get value() {
1294
110
  return curValue;
1295
111
  },
1296
112
  set value(newValue) {
1297
- _var_change(branch, newValue);
113
+ require_control_flow.zt(branch, newValue);
1298
114
  },
1299
115
  update(newInput = {}) {
1300
- args && (newInput.$global && ({$global, ...newInput} = newInput), runEffects(prepareEffects(() => {
116
+ args && (newInput.$global && ({$global, ...newInput} = newInput), require_control_flow.tn(require_control_flow.Zt(() => {
1301
117
  args(branch, newInput);
1302
118
  })));
1303
119
  },
1304
120
  destroy() {
1305
- removeAndDestroyBranch(branch);
121
+ require_control_flow.Ut(branch);
1306
122
  }
1307
123
  };
1308
124
  }
1309
125
  //#endregion
1310
126
  //#region src/dom/load.ts
1311
127
  function _load_template(id, load) {
1312
- _enable_catch();
1313
128
  let pending, lazyTemplate = _template(id, 0, 0, (branch) => {
1314
- let awaitCounter = addAwaitCounter(branch);
129
+ let awaitCounter = require_control_flow.p(branch);
1315
130
  branch.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((renderer) => {
1316
- Object.assign(lazyTemplate, renderer), queueAsyncRender(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
131
+ Object.assign(lazyTemplate, renderer), require_control_flow.Qt(branch, (branch) => insertLoaded(renderer, branch, branch.S, awaitCounter));
1317
132
  }, loadFailed(branch, awaitCounter));
1318
133
  }, _load_signal(() => (pending ||= load()).then((r) => ({ _: r.d }))));
1319
134
  return lazyTemplate;
1320
135
  }
1321
136
  function _load_setup(nodeAccessor, childScopeAccessor, load) {
1322
- nodeAccessor = decodeAccessor(nodeAccessor), childScopeAccessor = decodeAccessor(childScopeAccessor);
137
+ nodeAccessor = require_control_flow.ln(nodeAccessor), childScopeAccessor = require_control_flow.ln(childScopeAccessor);
1323
138
  let pending, renderer;
1324
- return _enable_catch(), (owner) => {
139
+ return (owner) => {
1325
140
  let child = owner[childScopeAccessor];
1326
141
  if (renderer) insertLoaded(renderer, child, owner[nodeAccessor]);
1327
142
  else {
1328
- let awaitCounter = addAwaitCounter(owner);
143
+ let awaitCounter = require_control_flow.p(owner);
1329
144
  child.X ||= /* @__PURE__ */ new Map(), (pending ||= load()).then((mod) => {
1330
- renderer = _content("", ...mod._)(), queueAsyncRender(child, (child) => insertLoaded(renderer, child, owner[nodeAccessor], awaitCounter));
145
+ renderer = require_control_flow.ct("", ...mod._)(), require_control_flow.Qt(child, (child) => insertLoaded(renderer, child, owner[nodeAccessor], awaitCounter));
1331
146
  }, loadFailed(child, awaitCounter));
1332
147
  }
1333
148
  };
1334
149
  }
1335
150
  function insertLoaded(renderer, branch, marker, awaitCounter) {
1336
151
  let parent = marker.parentNode, values = branch.X, insert = () => {
1337
- insertBranchBefore(branch, parent, marker), marker.remove(), awaitCounter?.c();
152
+ require_control_flow.Ht(branch, parent, marker), marker.remove(), awaitCounter?.c();
1338
153
  }, remaining;
1339
- if (syncGen(branch), renderer.b(branch, parent.namespaceURI), branch.X = 0, remaining = values?.size) {
154
+ if (require_control_flow.Wt(branch), renderer.b(branch, parent.namespaceURI), branch.X = 0, remaining = values?.size) {
1340
155
  let fail = loadFailed(branch, awaitCounter);
1341
156
  for (let [promise, entry] of values) promise.then((signal) => {
1342
- entry.b = signal, --remaining || queueAsyncRender(branch, (branch) => {
1343
- syncGen(branch), renderer.c?.(branch), values.forEach((e) => e.b._(branch, e.a)), insert();
157
+ entry.b = signal, --remaining || require_control_flow.Qt(branch, (branch) => {
158
+ require_control_flow.Wt(branch), renderer.c?.(branch), values.forEach((e) => e.b._(branch, e.a)), insert();
1344
159
  });
1345
160
  }, (error) => remaining > 0 && (remaining = 0, fail(error)));
1346
- } else setupBranch(renderer, branch), insert();
161
+ } else require_control_flow.pt(renderer, branch), insert();
1347
162
  }
1348
163
  function loadFailed(scope, awaitCounter) {
1349
164
  return (error) => {
1350
- awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.c()), queueAsyncRender(scope, renderCatch, error);
165
+ awaitCounter && (awaitCounter.m ? awaitCounter.i = 0 : awaitCounter.c()), require_control_flow.Qt(scope, require_control_flow.h, error);
1351
166
  };
1352
167
  }
1353
168
  function _load_signal(load) {
1354
169
  let pending, signal;
1355
170
  return (scope, value) => {
1356
- pending ||= load(), scope.X || !("X" in scope) && scope.H === runId ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, { a: value }) : signal ? signal(scope, value) : pending.then((mod) => queueAsyncRender(scope, signal = mod._, value), () => 0);
171
+ pending ||= load(), scope.X || !("X" in scope) && scope.H === require_control_flow.nn ? (scope.X ||= /* @__PURE__ */ new Map()).set(pending, { a: value }) : signal ? signal(scope, value) : pending.then((mod) => require_control_flow.Qt(scope, signal = mod._, value), () => 0);
1357
172
  };
1358
173
  }
1359
174
  function _load_visible_trigger(selector, options) {
@@ -1379,9 +194,9 @@ function _load_race_trigger(...triggers) {
1379
194
  function getSelectorOrResolve(selector, resolve) {
1380
195
  return document.querySelector(selector) || resolve();
1381
196
  }
1382
- exports.$signal = $signal, exports.$signalReset = $signalReset, exports._assert_hoist = _assert_hoist, exports._assert_init = _assert_init, exports._attr = _attr, exports._attr_class = _attr_class, exports._attr_class_item = _attr_class_item, exports._attr_class_items = _attr_class_items, exports._attr_content = _attr_content, exports._attr_details_open = _attr_details_or_dialog_open, exports._attr_dialog_open = _attr_details_or_dialog_open, exports._attr_details_open_default = _attr_details_or_dialog_open_default, exports._attr_dialog_open_default = _attr_details_or_dialog_open_default, exports._attr_details_open_script = _attr_details_or_dialog_open_script, exports._attr_dialog_open_script = _attr_details_or_dialog_open_script, exports._attr_input_checked = _attr_input_checked, exports._attr_input_checkedValue = _attr_input_checkedValue, exports._attr_input_checkedValue_default = _attr_input_checkedValue_default, exports._attr_input_checkedValue_script = _attr_input_checkedValue_script, exports._attr_input_checked_default = _attr_input_checked_default, exports._attr_input_checked_script = _attr_input_checked_script, exports._attr_input_value = _attr_input_value, exports._attr_textarea_value = _attr_input_value, exports._attr_input_value_attribute_default = _attr_input_value_attribute_default, exports._attr_input_value_default = _attr_input_value_default, exports._attr_textarea_value_default = _attr_input_value_default, exports._attr_input_value_dynamic_default = _attr_input_value_dynamic_default, exports._attr_input_value_script = _attr_input_value_script, exports._attr_textarea_value_script = _attr_input_value_script, exports._attr_nonce = _attr_nonce, exports._attr_select_value = _attr_select_value, exports._attr_select_value_default = _attr_select_value_default, exports._attr_select_value_script = _attr_select_value_script, exports._attr_style = _attr_style, exports._attr_style_item = _attr_style_item, exports._attr_style_items = _attr_style_items, exports._attrs = _attrs, exports._attrs_content = _attrs_content, exports._attrs_partial = _attrs_partial, exports._attrs_partial_content = _attrs_partial_content, exports._attrs_script = _attrs_script, exports._await_content = _await_content, exports._await_promise = _await_promise, exports._call = _call, exports._child_setup = _child_setup, exports._closure = _closure, exports._closure_get = _closure_get, exports._const = _const, exports._content = _content, exports._content_closures = _content_closures, exports._content_resume = _content_resume, exports._controllable_input = _controllable_input, exports._controllable_open = _controllable_open, exports._controllable_select = _controllable_select, exports._controllable_textarea = _controllable_textarea, Object.defineProperty(exports, "_dynamic_tag", {
197
+ exports.$signal = require_control_flow.Kt, exports.$signalReset = require_control_flow.qt, exports._assert_hoist = require_control_flow.sn, exports._assert_init = require_control_flow.Bt, exports._attr = require_control_flow.z, exports._attr_class = require_control_flow.B, exports._attr_class_item = require_control_flow.V, exports._attr_class_items = require_control_flow.H, exports._attr_content = require_control_flow.U, exports._attr_details_open = require_control_flow.g, exports._attr_dialog_open = require_control_flow.g, exports._attr_details_open_default = require_control_flow._, exports._attr_dialog_open_default = require_control_flow._, exports._attr_details_open_script = require_control_flow.v, exports._attr_dialog_open_script = require_control_flow.v, exports._attr_input_checked = require_control_flow.y, exports._attr_input_checkedValue = require_control_flow.b, exports._attr_input_checkedValue_default = require_control_flow.x, exports._attr_input_checkedValue_script = require_control_flow.S, exports._attr_input_checked_default = require_control_flow.C, exports._attr_input_checked_script = require_control_flow.w, exports._attr_input_value = require_control_flow.T, exports._attr_textarea_value = require_control_flow.T, exports._attr_input_value_attribute_default = require_control_flow.E, exports._attr_input_value_default = require_control_flow.D, exports._attr_textarea_value_default = require_control_flow.D, exports._attr_input_value_dynamic_default = require_control_flow.O, exports._attr_input_value_script = require_control_flow.k, exports._attr_textarea_value_script = require_control_flow.k, exports._attr_nonce = require_control_flow.W, exports._attr_select_value = require_control_flow.A, exports._attr_select_value_default = require_control_flow.j, exports._attr_select_value_script = require_control_flow.M, exports._attr_style = require_control_flow.G, exports._attr_style_item = require_control_flow.K, exports._attr_style_items = require_control_flow.q, exports._attrs = require_control_flow.J, exports._attrs_content = require_control_flow.Y, exports._attrs_partial = require_control_flow.X, exports._attrs_partial_content = require_control_flow.Z, exports._attrs_script = require_control_flow.Q, exports._await_content = require_control_flow.t, exports._await_promise = require_control_flow.n, exports._call = require_control_flow.cn, exports._child_setup = require_control_flow.xt, exports._closure = require_control_flow.St, exports._closure_get = require_control_flow.Ct, exports._const = require_control_flow.wt, exports._content = require_control_flow.ct, exports._content_closures = require_control_flow.lt, exports._content_resume = require_control_flow.ut, exports._controllable_input = require_control_flow.N, exports._controllable_open = require_control_flow.P, exports._controllable_select = require_control_flow.F, exports._controllable_textarea = require_control_flow.I, Object.defineProperty(exports, "_dynamic_tag", {
1383
198
  enumerable: !0,
1384
199
  get: function() {
1385
- return _dynamic_tag;
200
+ return require_control_flow.r;
1386
201
  }
1387
- }), exports._dynamic_tag_content = _dynamic_tag_content, exports._el = _el, exports._el_read = _el_read, exports._enable_catch = _enable_catch, exports._enable_controllable = _enable_controllable, exports._enable_controllable_input = _enable_controllable_input, exports._enable_controllable_open = _enable_controllable_open, exports._enable_controllable_select = _enable_controllable_select, exports._enable_controllable_textarea = _enable_controllable_textarea, exports._for_closure = _for_closure, exports._for_in = _for_in, exports._for_of = _for_of, exports._for_selector = _for_selector, exports._for_to = _for_to, exports._for_until = _for_until, exports._hoist = _hoist, exports._hoist_resume = _hoist_resume, exports._html = _html, exports._id = _id, exports._if = _if, exports._if_closure = _if_closure, exports._let = _let, exports._let_change = _let_change, exports._lifecycle = _lifecycle, exports._load_event_trigger = _load_event_trigger, exports._load_idle_trigger = _load_idle_trigger, exports._load_media_trigger = _load_media_trigger, exports._load_race_trigger = _load_race_trigger, exports._load_setup = _load_setup, exports._load_signal = _load_signal, exports._load_template = _load_template, exports._load_visible_trigger = _load_visible_trigger, exports._on = _on, exports._or = _or, exports._resume = _resume, exports._resume_dynamic_tag = _resume_dynamic_tag, exports._return = _return, exports._return_change = _return_change, exports._script = _script, exports._show = _show, exports._style_rule_item = _style_rule_item, exports._style_shell = _style_shell, exports._template = _template, exports._text = _text, exports._text_content = _text_content, exports._to_text = _to_text, exports._try = _try, exports._var = _var, exports._var_change = _var_change, exports._var_resume = _var_resume, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = forIn, exports.forOf = forOf, exports.forTo = forTo, exports.forUntil = forUntil, exports.init = init, exports.initEmbedded = initEmbedded, exports.ready = ready, exports.run = run;
202
+ }), exports._dynamic_tag_content = require_control_flow.i, exports._el = require_control_flow.mt, exports._el_read = require_control_flow.Tt, exports._for_closure = require_control_flow.Et, exports._for_in = require_control_flow.a, exports._for_of = require_control_flow.o, exports._for_selector = require_control_flow.Dt, exports._for_to = require_control_flow.s, exports._for_until = require_control_flow.c, exports._hoist = require_control_flow.Ot, exports._hoist_resume = require_control_flow.kt, exports._html = require_control_flow.$, exports._id = require_control_flow.At, exports._if = require_control_flow.l, exports._if_closure = require_control_flow.jt, exports._let = require_control_flow.Mt, exports._let_change = require_control_flow.Nt, exports._lifecycle = require_control_flow.et, exports._load_event_trigger = _load_event_trigger, exports._load_idle_trigger = _load_idle_trigger, exports._load_media_trigger = _load_media_trigger, exports._load_race_trigger = _load_race_trigger, exports._load_setup = _load_setup, exports._load_signal = _load_signal, exports._load_template = _load_template, exports._load_visible_trigger = _load_visible_trigger, exports._on = require_control_flow.Gt, exports._or = require_control_flow.Pt, exports._resume = require_control_flow.ht, exports._resume_dynamic_tag = require_control_flow.u, exports._return = require_control_flow.Ft, exports._return_change = require_control_flow.It, exports._script = require_control_flow.Lt, exports._show = require_control_flow.d, exports._style_rule_item = require_control_flow.tt, exports._style_shell = require_control_flow.nt, exports._template = _template, exports._text = require_control_flow.rt, exports._text_content = require_control_flow.it, exports._to_text = require_control_flow.at, exports._try = require_control_flow.f, exports._var = require_control_flow.Rt, exports._var_change = require_control_flow.zt, exports._var_resume = require_control_flow.gt, exports.attrTag = attrTag, exports.attrTags = attrTags, exports.compat = compat, exports.forIn = require_control_flow.rn, exports.forOf = require_control_flow.in, exports.forTo = require_control_flow.an, exports.forUntil = require_control_flow.on, exports.init = require_control_flow.vt, exports.initEmbedded = require_control_flow.yt, exports.ready = require_control_flow.bt, exports.run = require_control_flow.en;