marko 6.0.164 → 6.0.166
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.
- package/dist/common/accessor.d.ts +22 -0
- package/dist/common/accessor.debug.d.ts +22 -0
- package/dist/common/helpers.d.ts +3 -2
- package/dist/common/types.d.ts +1 -1
- package/dist/debug/dom.js +1613 -2426
- package/dist/debug/dom.mjs +1517 -2404
- package/dist/debug/html.js +2437 -3356
- package/dist/debug/html.mjs +2360 -3264
- package/dist/dom/compat.d.ts +2 -1
- package/dist/dom/queue.d.ts +6 -6
- package/dist/dom/renderer.d.ts +9 -9
- package/dist/dom/signals.d.ts +5 -9
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +844 -1413
- package/dist/dom.mjs +840 -1394
- package/dist/html/template.d.ts +3 -3
- package/dist/html.js +1447 -2112
- package/dist/html.mjs +1443 -2022
- package/dist/translator/index.js +8046 -13063
- package/dist/translator/util/normalize-string-expression.d.ts +1 -1
- package/package.json +2 -2
package/dist/dom.js
CHANGED
|
@@ -1,1683 +1,1114 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
let empty = [], rest = Symbol(), 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), defaultDelegator = /* @__PURE__ */ createDelegator(), R = /[^\p{L}\p{N}]/gu, parsers = {}, nextScopeId = 1e6, destroyNestedScopes = function destroyNestedScopes(scope) {
|
|
8
|
+
scope.I = 1, scope.D?.forEach(destroyNestedScopes), scope.B?.forEach(resetControllers);
|
|
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 = 20 * 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
|
+
}, cloneCache = {}, registeredValues = {}, curRuntimeId, readyLookup, branchesEnabled, embedEnabled, ready = /* @__PURE__ */ ((_) => (id) => {
|
|
24
|
+
readyLookup[id]?.(), readyLookup[id] = 1;
|
|
25
|
+
})(readyLookup = {}), isResuming, inputType = "", controllableDelegate = /* @__PURE__ */ createDelegator(), _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
26
|
+
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
27
|
+
let childScopeAccessor = "A" + nodeAccessor, rendererAccessor = "D" + nodeAccessor;
|
|
28
|
+
return enableBranches(), (scope, newRenderer, getInput) => {
|
|
29
|
+
let normalizedRenderer = normalizeDynamicRenderer(newRenderer);
|
|
30
|
+
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") {
|
|
31
|
+
if (getContent) {
|
|
32
|
+
let content = getContent(scope);
|
|
33
|
+
setConditionalRenderer(scope[childScopeAccessor], "a", content, createAndSetupBranch), content.f && subscribeToScopeSet(content.e, content.f, scope[childScopeAccessor].Aa);
|
|
34
|
+
}
|
|
35
|
+
} else normalizedRenderer?.f && subscribeToScopeSet(normalizedRenderer.e, normalizedRenderer.f, scope[childScopeAccessor]);
|
|
36
|
+
if (normalizedRenderer) {
|
|
37
|
+
let childScope = scope[childScopeAccessor], args = getInput?.();
|
|
38
|
+
if (typeof normalizedRenderer == "string") (getContent ? _attrs : _attrs_content)(childScope, "a", (inputIsArgs ? args[0] : args) || {}), (childScope.Ia || childScope.Ea) && queueEffect(childScope, dynamicTagScript);
|
|
39
|
+
else {
|
|
40
|
+
for (let accessor in normalizedRenderer.g) normalizedRenderer.g[accessor](childScope, normalizedRenderer.h[accessor]);
|
|
41
|
+
if (normalizedRenderer.d) if (inputIsArgs) normalizedRenderer.d(childScope, normalizedRenderer._ ? args[0] : args);
|
|
42
|
+
else {
|
|
43
|
+
let inputWithContent = getContent ? {
|
|
44
|
+
...args,
|
|
45
|
+
content: getContent(scope)
|
|
46
|
+
} : args || {};
|
|
47
|
+
normalizedRenderer.d(childScope, normalizedRenderer._ ? inputWithContent : [inputWithContent]);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}, _for_of = /* @__PURE__ */ loop(([all, by = bySecondArg], cb) => {
|
|
53
|
+
typeof by == "string" ? forOf(all, (item, i) => cb(item[by], [item, i])) : forOf(all, (item, i) => cb(by(item, i), [item, i]));
|
|
54
|
+
}), _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]))), pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), asyncRendersLookup, caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingScopes = [], rendering, runEffects = ((effects) => {
|
|
55
|
+
for (let i = 0; i < effects.length;) effects[i++](effects[i++]);
|
|
56
|
+
}), runRender = (render) => render.c(render.b, render.d), catchEnabled, classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
57
|
+
patchDynamicTag,
|
|
58
|
+
queueEffect,
|
|
59
|
+
init(warp10Noop) {
|
|
60
|
+
_resume("$C_s", (branch) => {
|
|
61
|
+
classIdToBranch.set(branch.m5c, branch);
|
|
62
|
+
}), _resume("$C_b", warp10Noop);
|
|
63
|
+
},
|
|
64
|
+
registerRenderer(fn) {
|
|
65
|
+
_resume("$C_r", fn);
|
|
66
|
+
},
|
|
67
|
+
isRenderer(renderer) {
|
|
68
|
+
return renderer.b;
|
|
69
|
+
},
|
|
70
|
+
getStartNode(branch) {
|
|
71
|
+
return branch.S;
|
|
72
|
+
},
|
|
73
|
+
setScopeNodes(branch, startNode, endNode) {
|
|
74
|
+
branch.S = startNode, branch.K = endNode;
|
|
75
|
+
},
|
|
76
|
+
runComponentEffects() {
|
|
77
|
+
this.effects && runEffects(this.effects);
|
|
78
|
+
},
|
|
79
|
+
runComponentDestroy() {
|
|
80
|
+
this.scope && destroyBranch(this.scope);
|
|
81
|
+
},
|
|
82
|
+
resolveRegistered(value, $global) {
|
|
83
|
+
return Array.isArray(value) && typeof value[0] == "string" ? getRegisteredWithScope(value[0], value.length === 2 && self[$global.runtimeId]?.[$global.renderId]?.s[value[1]]) : value;
|
|
84
|
+
},
|
|
85
|
+
createRenderer(params, clone) {
|
|
86
|
+
let renderer = _content("", 0, 0, 0, params)();
|
|
87
|
+
return renderer.b = (branch) => {
|
|
88
|
+
let cloned = clone();
|
|
89
|
+
branch.S = cloned.startNode, branch.K = cloned.endNode;
|
|
90
|
+
}, renderer;
|
|
91
|
+
},
|
|
92
|
+
render(out, component, renderer, args) {
|
|
93
|
+
let branch = component.scope, created = 0;
|
|
94
|
+
if (!branch && (branch = classIdToBranch.get(component.id)) && (component.scope = branch, classIdToBranch.delete(component.id)), typeof args[0] == "object" && "renderBody" in args[0]) {
|
|
95
|
+
let input = args[0], normalizedInput = args[0] = {};
|
|
96
|
+
for (let key in input) normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
|
97
|
+
}
|
|
98
|
+
if (component.effects = prepareEffects(() => {
|
|
99
|
+
branch ||= (created = 1, component.scope = createAndSetupBranch(out.global, renderer, renderer.e, document.body)), renderer.d?.(branch, renderer._ ? args[0] : args);
|
|
100
|
+
}), created) return toInsertNode(branch.S, branch.K);
|
|
101
|
+
}
|
|
102
|
+
}, _template = (id, template, walks, setup, inputSignal) => {
|
|
103
|
+
let renderer = _content(id, template, walks, setup, inputSignal)();
|
|
104
|
+
return renderer.mount = mount, renderer._ = renderer, _resume(id, renderer);
|
|
14
105
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// src/dom.ts
|
|
18
|
-
var dom_exports = {};
|
|
19
|
-
__export(dom_exports, {
|
|
20
|
-
$signal: () => $signal,
|
|
21
|
-
$signalReset: () => $signalReset,
|
|
22
|
-
_assert_hoist: () => _assert_hoist,
|
|
23
|
-
_assert_init: () => _assert_init,
|
|
24
|
-
_attr: () => _attr,
|
|
25
|
-
_attr_class: () => _attr_class,
|
|
26
|
-
_attr_class_item: () => _attr_class_item,
|
|
27
|
-
_attr_class_items: () => _attr_class_items,
|
|
28
|
-
_attr_content: () => _attr_content,
|
|
29
|
-
_attr_details_open: () => _attr_details_or_dialog_open,
|
|
30
|
-
_attr_details_open_default: () => _attr_details_or_dialog_open_default,
|
|
31
|
-
_attr_details_open_script: () => _attr_details_or_dialog_open_script,
|
|
32
|
-
_attr_dialog_open: () => _attr_details_or_dialog_open,
|
|
33
|
-
_attr_dialog_open_default: () => _attr_details_or_dialog_open_default,
|
|
34
|
-
_attr_dialog_open_script: () => _attr_details_or_dialog_open_script,
|
|
35
|
-
_attr_input_checked: () => _attr_input_checked,
|
|
36
|
-
_attr_input_checkedValue: () => _attr_input_checkedValue,
|
|
37
|
-
_attr_input_checkedValue_default: () => _attr_input_checkedValue_default,
|
|
38
|
-
_attr_input_checkedValue_script: () => _attr_input_checkedValue_script,
|
|
39
|
-
_attr_input_checked_default: () => _attr_input_checked_default,
|
|
40
|
-
_attr_input_checked_script: () => _attr_input_checked_script,
|
|
41
|
-
_attr_input_value: () => _attr_input_value,
|
|
42
|
-
_attr_input_value_default: () => _attr_input_value_default,
|
|
43
|
-
_attr_input_value_script: () => _attr_input_value_script,
|
|
44
|
-
_attr_nonce: () => _attr_nonce,
|
|
45
|
-
_attr_select_value: () => _attr_select_value,
|
|
46
|
-
_attr_select_value_default: () => _attr_select_value_default,
|
|
47
|
-
_attr_select_value_script: () => _attr_select_value_script,
|
|
48
|
-
_attr_style: () => _attr_style,
|
|
49
|
-
_attr_style_item: () => _attr_style_item,
|
|
50
|
-
_attr_style_items: () => _attr_style_items,
|
|
51
|
-
_attr_textarea_value: () => _attr_input_value,
|
|
52
|
-
_attr_textarea_value_default: () => _attr_input_value_default,
|
|
53
|
-
_attr_textarea_value_script: () => _attr_input_value_script,
|
|
54
|
-
_attrs: () => _attrs,
|
|
55
|
-
_attrs_content: () => _attrs_content,
|
|
56
|
-
_attrs_partial: () => _attrs_partial,
|
|
57
|
-
_attrs_partial_content: () => _attrs_partial_content,
|
|
58
|
-
_attrs_script: () => _attrs_script,
|
|
59
|
-
_await_content: () => _await_content,
|
|
60
|
-
_await_promise: () => _await_promise,
|
|
61
|
-
_call: () => _call,
|
|
62
|
-
_child_setup: () => _child_setup,
|
|
63
|
-
_closure: () => _closure,
|
|
64
|
-
_closure_get: () => _closure_get,
|
|
65
|
-
_const: () => _const,
|
|
66
|
-
_content: () => _content,
|
|
67
|
-
_content_closures: () => _content_closures,
|
|
68
|
-
_content_resume: () => _content_resume,
|
|
69
|
-
_dynamic_tag: () => _dynamic_tag,
|
|
70
|
-
_el: () => _el,
|
|
71
|
-
_el_read: () => _el_read,
|
|
72
|
-
_enable_catch: () => _enable_catch,
|
|
73
|
-
_for_closure: () => _for_closure,
|
|
74
|
-
_for_in: () => _for_in,
|
|
75
|
-
_for_of: () => _for_of,
|
|
76
|
-
_for_to: () => _for_to,
|
|
77
|
-
_for_until: () => _for_until,
|
|
78
|
-
_hoist: () => _hoist,
|
|
79
|
-
_hoist_resume: () => _hoist_resume,
|
|
80
|
-
_html: () => _html,
|
|
81
|
-
_id: () => _id,
|
|
82
|
-
_if: () => _if,
|
|
83
|
-
_if_closure: () => _if_closure,
|
|
84
|
-
_let: () => _let,
|
|
85
|
-
_lifecycle: () => _lifecycle,
|
|
86
|
-
_on: () => _on,
|
|
87
|
-
_or: () => _or,
|
|
88
|
-
_resume: () => _resume,
|
|
89
|
-
_resume_dynamic_tag: () => _resume_dynamic_tag,
|
|
90
|
-
_return: () => _return,
|
|
91
|
-
_return_change: () => _return_change,
|
|
92
|
-
_script: () => _script,
|
|
93
|
-
_template: () => _template,
|
|
94
|
-
_text: () => _text,
|
|
95
|
-
_text_content: () => _text_content,
|
|
96
|
-
_to_text: () => _to_text,
|
|
97
|
-
_try: () => _try,
|
|
98
|
-
_var: () => _var,
|
|
99
|
-
_var_change: () => _var_change,
|
|
100
|
-
_var_resume: () => _var_resume,
|
|
101
|
-
attrTag: () => attrTag,
|
|
102
|
-
attrTags: () => attrTags,
|
|
103
|
-
compat: () => compat,
|
|
104
|
-
forIn: () => forIn,
|
|
105
|
-
forOf: () => forOf,
|
|
106
|
-
forTo: () => forTo,
|
|
107
|
-
forUntil: () => forUntil,
|
|
108
|
-
init: () => init,
|
|
109
|
-
initEmbedded: () => initEmbedded,
|
|
110
|
-
run: () => run
|
|
111
|
-
});
|
|
112
|
-
module.exports = __toCommonJS(dom_exports);
|
|
113
|
-
|
|
114
|
-
// src/common/attr-tag.ts
|
|
115
|
-
var empty = [], rest = /* @__PURE__ */ Symbol();
|
|
106
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
107
|
+
//#region src/common/attr-tag.ts
|
|
116
108
|
function attrTag(attrs) {
|
|
117
|
-
|
|
109
|
+
return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
|
|
118
110
|
}
|
|
119
111
|
function attrTags(first, attrs) {
|
|
120
|
-
|
|
112
|
+
return first ? (first[rest] === empty ? first[rest] = [attrs] : first[rest].push(attrs), first) : attrTag(attrs);
|
|
121
113
|
}
|
|
122
114
|
function* attrTagIterator() {
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// src/common/errors.ts
|
|
127
|
-
function _assert_hoist(value) {
|
|
115
|
+
yield this, yield* this[rest];
|
|
128
116
|
}
|
|
117
|
+
function _assert_hoist(value) {}
|
|
129
118
|
function _assert_init(scope, accessor) {
|
|
130
|
-
|
|
119
|
+
return scope[accessor];
|
|
131
120
|
}
|
|
132
|
-
|
|
133
|
-
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/common/for.ts
|
|
134
123
|
function forIn(obj, cb) {
|
|
135
|
-
|
|
136
|
-
cb(key, obj[key]);
|
|
124
|
+
for (let key in obj) cb(key, obj[key]);
|
|
137
125
|
}
|
|
138
126
|
function forOf(list, cb) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
127
|
+
if (list) {
|
|
128
|
+
let i = 0;
|
|
129
|
+
for (let item of list) cb(item, i++);
|
|
130
|
+
}
|
|
144
131
|
}
|
|
145
132
|
function forTo(to, from, step, cb) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
cb(start + i * delta);
|
|
133
|
+
let start = from || 0, delta = step || 1;
|
|
134
|
+
for (let steps = (to - start) / delta, i = 0; i <= steps; i++) cb(start + i * delta);
|
|
149
135
|
}
|
|
150
136
|
function forUntil(until, from, step, cb) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
cb(start + i * delta);
|
|
137
|
+
let start = from || 0, delta = step || 1;
|
|
138
|
+
for (let steps = (until - start) / delta, i = 0; i < steps; i++) cb(start + i * delta);
|
|
154
139
|
}
|
|
155
|
-
|
|
156
|
-
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/common/helpers.ts
|
|
157
142
|
function _call(fn, v) {
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
function classValue(classValue2) {
|
|
161
|
-
return toDelimitedString(classValue2, " ", stringifyClassObject);
|
|
143
|
+
return fn(v), v;
|
|
162
144
|
}
|
|
163
145
|
function stringifyClassObject(name, value) {
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
function styleValue(styleValue2) {
|
|
167
|
-
return toDelimitedString(styleValue2, ";", stringifyStyleObject);
|
|
146
|
+
return value ? name : "";
|
|
168
147
|
}
|
|
169
148
|
function stringifyStyleObject(name, value) {
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
function toDelimitedString(val, delimiter, stringify) {
|
|
173
|
-
let str = "", sep = "", part;
|
|
174
|
-
if (val)
|
|
175
|
-
if (typeof val != "object")
|
|
176
|
-
str += val;
|
|
177
|
-
else if (Array.isArray(val))
|
|
178
|
-
for (let v of val)
|
|
179
|
-
part = toDelimitedString(v, delimiter, stringify), part && (str += sep + part, sep = delimiter);
|
|
180
|
-
else
|
|
181
|
-
for (let name in val)
|
|
182
|
-
part = stringify(name, val[name]), part && (str += sep + part, sep = delimiter);
|
|
183
|
-
return str;
|
|
149
|
+
return value || value === 0 ? name + ":" + value : "";
|
|
184
150
|
}
|
|
185
151
|
function isEventHandler(name) {
|
|
186
|
-
|
|
152
|
+
return /^on[A-Z-]/.test(name);
|
|
187
153
|
}
|
|
188
154
|
function getEventHandlerName(name) {
|
|
189
|
-
|
|
155
|
+
return name[2] === "-" ? name.slice(3) : name.slice(2).toLowerCase();
|
|
190
156
|
}
|
|
191
157
|
function normalizeDynamicRenderer(value) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
// src/common/opt.ts
|
|
158
|
+
if (value) {
|
|
159
|
+
if (typeof value == "string") return value;
|
|
160
|
+
let normalized = value.content || value.default || value;
|
|
161
|
+
if ("a" in normalized) return normalized;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/common/opt.ts
|
|
202
166
|
function toArray(opt) {
|
|
203
|
-
|
|
167
|
+
return opt ? Array.isArray(opt) ? opt : [opt] : [];
|
|
204
168
|
}
|
|
205
169
|
function push(opt, item) {
|
|
206
|
-
|
|
170
|
+
return opt ? Array.isArray(opt) ? (opt.push(item), opt) : [opt, item] : item;
|
|
207
171
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
var defaultDelegator = createDelegator();
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/dom/event.ts
|
|
211
174
|
function _on(element, type, handler) {
|
|
212
|
-
|
|
175
|
+
element["$" + type] === void 0 && defaultDelegator(element, type, handleDelegated), element["$" + type] = handler || null;
|
|
213
176
|
}
|
|
177
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
214
178
|
function createDelegator() {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
179
|
+
let kEvents = Symbol();
|
|
180
|
+
return function(node, type, handler) {
|
|
181
|
+
((node = node.getRootNode())[kEvents] ||= {})[type] ||= (node.addEventListener(type, handler, !0), 1);
|
|
182
|
+
};
|
|
219
183
|
}
|
|
220
184
|
function handleDelegated(ev) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
let count = before.replace(R, "").length, pos = 0;
|
|
240
|
-
for (; count && updatedValue[pos]; )
|
|
241
|
-
updatedValue[pos++].replace(R, "") && count--;
|
|
242
|
-
return pos;
|
|
243
|
-
}
|
|
244
|
-
return -1;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
// src/dom/parse-html.ts
|
|
248
|
-
var parsers = {};
|
|
185
|
+
let target = !rendering && ev.target;
|
|
186
|
+
for (; target;) target["$" + ev.type]?.(ev, target), target = ev.bubbles && !ev.cancelBubble && target.parentNode;
|
|
187
|
+
}
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/dom/resolve-cursor-position.ts
|
|
190
|
+
function resolveCursorPosition(inputType, initialPosition, initialValue, updatedValue) {
|
|
191
|
+
if ((initialPosition || initialPosition === 0) && (initialPosition !== initialValue.length || /kw/.test(inputType))) {
|
|
192
|
+
let before = initialValue.slice(0, initialPosition), after = initialValue.slice(initialPosition);
|
|
193
|
+
if (updatedValue.startsWith(before)) return initialPosition;
|
|
194
|
+
if (updatedValue.endsWith(after)) return updatedValue.length - after.length;
|
|
195
|
+
let count = before.replace(R, "").length, pos = 0;
|
|
196
|
+
for (; count && updatedValue[pos];) updatedValue[pos++].replace(R, "") && count--;
|
|
197
|
+
return pos;
|
|
198
|
+
}
|
|
199
|
+
return -1;
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/dom/parse-html.ts
|
|
249
203
|
function parseHTML(html, ns) {
|
|
250
|
-
|
|
251
|
-
|
|
204
|
+
let parser = parsers[ns] ||= document.createElementNS(ns, "template");
|
|
205
|
+
return parser.innerHTML = html, parser.content || parser;
|
|
252
206
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
var nextScopeId = 1e6;
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region src/dom/scope.ts
|
|
256
209
|
function createScope($global, closestBranch) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
210
|
+
let scope = {
|
|
211
|
+
L: nextScopeId++,
|
|
212
|
+
H: 1,
|
|
213
|
+
F: closestBranch,
|
|
214
|
+
$: $global
|
|
215
|
+
};
|
|
216
|
+
return pendingScopes.push(scope), scope;
|
|
264
217
|
}
|
|
265
218
|
function skipScope() {
|
|
266
|
-
|
|
219
|
+
return nextScopeId++;
|
|
267
220
|
}
|
|
268
221
|
function findBranchWithKey(scope, key) {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
return branch;
|
|
222
|
+
let branch = scope.F;
|
|
223
|
+
for (; branch && branch[key] == null;) branch = branch.N;
|
|
224
|
+
return branch;
|
|
273
225
|
}
|
|
274
226
|
function destroyBranch(branch) {
|
|
275
|
-
|
|
276
|
-
branch
|
|
277
|
-
), destroyNestedScopes(branch);
|
|
227
|
+
branch.N?.D?.delete(branch), destroyNestedScopes(branch);
|
|
278
228
|
}
|
|
279
229
|
function destroyScope(scope) {
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
function destroyNestedScopes(scope) {
|
|
283
|
-
scope.I = 1, scope.D?.forEach(destroyNestedScopes), scope.B?.forEach(resetControllers);
|
|
230
|
+
scope.I || (destroyNestedScopes(scope), resetControllers(scope));
|
|
284
231
|
}
|
|
285
232
|
function resetControllers(scope) {
|
|
286
|
-
|
|
287
|
-
$signalReset(scope, id);
|
|
233
|
+
for (let id in scope.A) $signalReset(scope, id);
|
|
288
234
|
}
|
|
289
235
|
function removeAndDestroyBranch(branch) {
|
|
290
|
-
|
|
291
|
-
branch.S,
|
|
292
|
-
branch.K
|
|
293
|
-
);
|
|
236
|
+
destroyBranch(branch), removeChildNodes(branch.S, branch.K);
|
|
294
237
|
}
|
|
295
238
|
function insertBranchBefore(branch, parentNode, nextSibling) {
|
|
296
|
-
|
|
297
|
-
parentNode,
|
|
298
|
-
nextSibling,
|
|
299
|
-
branch.S,
|
|
300
|
-
branch.K
|
|
301
|
-
);
|
|
239
|
+
insertChildNodes(parentNode, nextSibling, branch.S, branch.K);
|
|
302
240
|
}
|
|
303
241
|
function tempDetachBranch(branch) {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
branch.K
|
|
310
|
-
);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
// src/dom/schedule.ts
|
|
314
|
-
var isScheduled, channel;
|
|
242
|
+
let fragment = new DocumentFragment();
|
|
243
|
+
fragment.namespaceURI = branch.S.parentNode.namespaceURI, insertChildNodes(fragment, null, branch.S, branch.K);
|
|
244
|
+
}
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region src/dom/schedule.ts
|
|
315
247
|
function schedule() {
|
|
316
|
-
|
|
248
|
+
isScheduled || (isScheduled = 1, queueMicrotask(flushAndWaitFrame));
|
|
317
249
|
}
|
|
318
250
|
function flushAndWaitFrame() {
|
|
319
|
-
|
|
251
|
+
run(), requestAnimationFrame(triggerMacroTask);
|
|
320
252
|
}
|
|
321
253
|
function triggerMacroTask() {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
254
|
+
channel || (channel = new MessageChannel(), channel.port1.onmessage = () => {
|
|
255
|
+
isScheduled = 0, run();
|
|
256
|
+
}), channel.port2.postMessage(0);
|
|
325
257
|
}
|
|
326
|
-
|
|
327
|
-
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region src/dom/signals.ts
|
|
328
260
|
function _let(id, fn) {
|
|
329
|
-
|
|
330
|
-
|
|
261
|
+
let valueAccessor = decodeAccessor(id), valueChangeAccessor = "M" + valueAccessor;
|
|
262
|
+
return (scope, value, valueChange) => (rendering ? ((scope[valueChangeAccessor] = valueChange) && scope[valueAccessor] !== value || scope.H) && (scope[valueAccessor] = value, fn?.(scope)) : scope[valueChangeAccessor] ? scope[valueChangeAccessor](value) : scope[valueAccessor] !== (scope[valueAccessor] = value) && fn && (schedule(), queueRender(scope, fn, id)), value);
|
|
331
263
|
}
|
|
332
264
|
function _const(valueAccessor, fn) {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
265
|
+
return valueAccessor = decodeAccessor(valueAccessor), (scope, value) => {
|
|
266
|
+
(!(valueAccessor in scope) || scope[valueAccessor] !== value) && (scope[valueAccessor] = value, fn?.(scope));
|
|
267
|
+
};
|
|
336
268
|
}
|
|
337
|
-
function _or(id, fn, defaultPending = 1, scopeIdAccessor = "L"
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
269
|
+
function _or(id, fn, defaultPending = 1, scopeIdAccessor = "L") {
|
|
270
|
+
return scopeIdAccessor !== "L" && (scopeIdAccessor = decodeAccessor(scopeIdAccessor)), (scope) => {
|
|
271
|
+
scope.H ? id in scope ? --scope[id] || fn(scope) : scope[id] = defaultPending : queueRender(scope, fn, id, 0, scope[scopeIdAccessor]);
|
|
272
|
+
};
|
|
341
273
|
}
|
|
342
274
|
function _for_closure(ownerLoopNodeAccessor, fn) {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
},
|
|
352
|
-
-1,
|
|
353
|
-
0,
|
|
354
|
-
scopes[0].L
|
|
355
|
-
);
|
|
356
|
-
};
|
|
357
|
-
return ownerSignal._ = fn, ownerSignal;
|
|
275
|
+
ownerLoopNodeAccessor = decodeAccessor(ownerLoopNodeAccessor);
|
|
276
|
+
let scopeAccessor = "A" + ownerLoopNodeAccessor, ownerSignal = (ownerScope) => {
|
|
277
|
+
let scopes = toArray(ownerScope[scopeAccessor]);
|
|
278
|
+
scopes.length && queueRender(ownerScope, () => {
|
|
279
|
+
for (let scope of scopes) !scope.H && !scope.I && fn(scope);
|
|
280
|
+
}, -1, 0, scopes[0].L);
|
|
281
|
+
};
|
|
282
|
+
return ownerSignal._ = fn, ownerSignal;
|
|
358
283
|
}
|
|
359
284
|
function _if_closure(ownerConditionalNodeAccessor, branch, fn) {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
};
|
|
367
|
-
return ownerSignal._ = fn, ownerSignal;
|
|
285
|
+
ownerConditionalNodeAccessor = decodeAccessor(ownerConditionalNodeAccessor);
|
|
286
|
+
let scopeAccessor = "A" + ownerConditionalNodeAccessor, branchAccessor = "D" + ownerConditionalNodeAccessor, ownerSignal = (scope) => {
|
|
287
|
+
let ifScope = scope[scopeAccessor];
|
|
288
|
+
ifScope && !ifScope.H && (scope[branchAccessor] || 0) === branch && queueRender(ifScope, fn, -1);
|
|
289
|
+
};
|
|
290
|
+
return ownerSignal._ = fn, ownerSignal;
|
|
368
291
|
}
|
|
369
292
|
function subscribeToScopeSet(ownerScope, accessor, scope) {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
"abort",
|
|
373
|
-
() => ownerScope[accessor].delete(scope)
|
|
374
|
-
));
|
|
293
|
+
let subscribers = ownerScope[accessor] ||= /* @__PURE__ */ new Set();
|
|
294
|
+
subscribers.has(scope) || (subscribers.add(scope), $signal(scope, -1).addEventListener("abort", () => ownerScope[accessor].delete(scope)));
|
|
375
295
|
}
|
|
376
296
|
function _closure(...closureSignals) {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
for (let childScope of scope[___scopeInstancesAccessor])
|
|
383
|
-
childScope.H || queueRender(
|
|
384
|
-
childScope,
|
|
385
|
-
closureSignals[childScope[___signalIndexAccessor] || 0],
|
|
386
|
-
-1
|
|
387
|
-
);
|
|
388
|
-
};
|
|
297
|
+
let [firstSignal] = closureSignals, scopeInstances = firstSignal.a, signalIndex = firstSignal.b;
|
|
298
|
+
for (let i = closureSignals.length; i--;) closureSignals[i].c = i;
|
|
299
|
+
return (scope) => {
|
|
300
|
+
if (scope[scopeInstances]) for (let childScope of scope[scopeInstances]) childScope.H || queueRender(childScope, closureSignals[childScope[signalIndex] || 0], -1);
|
|
301
|
+
};
|
|
389
302
|
}
|
|
390
303
|
function _closure_get(valueAccessor, fn, getOwnerScope, resumeId) {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
scope
|
|
397
|
-
);
|
|
398
|
-
});
|
|
399
|
-
return closureSignal.o = "B" /* ClosureScopes */ + valueAccessor, closureSignal.q = "C" /* ClosureSignalIndex */ + valueAccessor, resumeId && _resume(resumeId, closureSignal), closureSignal;
|
|
304
|
+
valueAccessor = decodeAccessor(valueAccessor);
|
|
305
|
+
let closureSignal = ((scope) => {
|
|
306
|
+
scope[closureSignal.b] = closureSignal.c, fn(scope), subscribeToScopeSet(getOwnerScope ? getOwnerScope(scope) : scope._, closureSignal.a, scope);
|
|
307
|
+
});
|
|
308
|
+
return closureSignal.a = "B" + valueAccessor, closureSignal.b = "C" + valueAccessor, resumeId && _resume(resumeId, closureSignal), closureSignal;
|
|
400
309
|
}
|
|
401
310
|
function _child_setup(setup) {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
311
|
+
return setup._ = (scope, owner) => {
|
|
312
|
+
scope._ = owner, queueRender(scope, setup, -1);
|
|
313
|
+
}, setup;
|
|
405
314
|
}
|
|
406
315
|
function _var(scope, childAccessor, signal) {
|
|
407
|
-
|
|
316
|
+
scope[decodeAccessor(childAccessor)].T = (value) => signal(scope, value);
|
|
408
317
|
}
|
|
409
|
-
var _return = (scope, value) => scope.T?.(value);
|
|
410
318
|
function _return_change(scope, changeHandler) {
|
|
411
|
-
|
|
319
|
+
changeHandler && (scope.U = changeHandler);
|
|
412
320
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
return tagIdsByGlobal.set($global, id + 1), "c" + $global.runtimeId + $global.renderId + id.toString(36);
|
|
321
|
+
function _id({ $: $global }) {
|
|
322
|
+
let id = tagIdsByGlobal.get($global) || 0;
|
|
323
|
+
return tagIdsByGlobal.set($global, id + 1), "c" + $global.runtimeId + $global.renderId + id.toString(36);
|
|
417
324
|
}
|
|
418
325
|
function _script(id, fn) {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
326
|
+
return _resume(id, fn), (scope) => {
|
|
327
|
+
queueEffect(scope, fn);
|
|
328
|
+
};
|
|
422
329
|
}
|
|
423
330
|
function _el_read(value) {
|
|
424
|
-
|
|
331
|
+
return value;
|
|
425
332
|
}
|
|
426
333
|
function* traverse(scope, path, i = path.length - 1) {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
let item = scope[path[i]];
|
|
433
|
-
i ? yield* traverse(item, path, i - 1) : yield typeof item == "function" ? item() : item;
|
|
434
|
-
}
|
|
334
|
+
if (scope) if (Symbol.iterator in scope) for (let childScope of scope.values()) yield* traverse(childScope, path, i);
|
|
335
|
+
else {
|
|
336
|
+
let item = scope[path[i]];
|
|
337
|
+
i ? yield* traverse(item, path, i - 1) : yield typeof item == "function" ? item() : item;
|
|
338
|
+
}
|
|
435
339
|
}
|
|
436
340
|
function _hoist(...path) {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
341
|
+
return path = path.map((p) => typeof p == "string" ? p : decodeAccessor(p)), (scope) => {
|
|
342
|
+
let fn = () => traverse(scope, path).next().value;
|
|
343
|
+
return fn[Symbol.iterator] = () => traverse(scope, path), fn;
|
|
344
|
+
};
|
|
441
345
|
}
|
|
442
346
|
function _hoist_resume(id, ...path) {
|
|
443
|
-
|
|
347
|
+
return _resume(id, _hoist(...path));
|
|
444
348
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
var walker = /* @__PURE__ */ document.createTreeWalker(document);
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region src/dom/walker.ts
|
|
448
351
|
function walk(startNode, walkCodes, branch) {
|
|
449
|
-
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
for (; currentWalkIndex < walkCodes.length; )
|
|
454
|
-
if (value = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value === 32 /* Get */) {
|
|
455
|
-
let node = walker.currentNode;
|
|
456
|
-
scope[decodeAccessor(currentScopeIndex++)] = node;
|
|
457
|
-
} else if (value === 37 /* Replace */ || value === 49 /* DynamicTagWithVar */)
|
|
458
|
-
walker.currentNode.replaceWith(
|
|
459
|
-
walker.currentNode = scope[decodeAccessor(currentScopeIndex++)] = new Text()
|
|
460
|
-
), value === 49 /* DynamicTagWithVar */ && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
|
|
461
|
-
else {
|
|
462
|
-
if (value === 38 /* EndChild */)
|
|
463
|
-
return currentWalkIndex;
|
|
464
|
-
if (value === 47 /* BeginChild */ || value === 48 /* BeginChildWithVar */)
|
|
465
|
-
currentWalkIndex = walkInternal(
|
|
466
|
-
currentWalkIndex,
|
|
467
|
-
walkCodes,
|
|
468
|
-
scope[decodeAccessor(currentScopeIndex++)] = createScope(
|
|
469
|
-
scope.$,
|
|
470
|
-
scope.F
|
|
471
|
-
)
|
|
472
|
-
), value === 48 /* BeginChildWithVar */ && (scope[decodeAccessor(currentScopeIndex++)] = skipScope());
|
|
473
|
-
else if (value < 92)
|
|
474
|
-
for (value = 20 /* Next */ * currentMultiplier + value - 67 /* Next */; value--; )
|
|
475
|
-
walker.nextNode();
|
|
476
|
-
else if (value < 107)
|
|
477
|
-
for (value = 10 /* Over */ * currentMultiplier + value - 97 /* Over */; value--; )
|
|
478
|
-
walker.nextSibling();
|
|
479
|
-
else if (value < 117) {
|
|
480
|
-
for (value = 10 /* Out */ * currentMultiplier + value - 107 /* Out */; value--; )
|
|
481
|
-
walker.parentNode();
|
|
482
|
-
walker.nextSibling();
|
|
483
|
-
} else
|
|
484
|
-
storedMultiplier = currentMultiplier * 10 /* Multiplier */ + value - 117 /* Multiplier */;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
// src/dom/renderer.ts
|
|
352
|
+
walker.currentNode = startNode, walkInternal(0, walkCodes, branch);
|
|
353
|
+
}
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/dom/renderer.ts
|
|
489
356
|
function createBranch($global, renderer, parentScope, parentNode) {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
branch,
|
|
493
|
-
parentNode.namespaceURI
|
|
494
|
-
), branch;
|
|
357
|
+
let branch = createScope($global);
|
|
358
|
+
return branch._ = renderer.e || parentScope, setParentBranch(branch, parentScope?.F), renderer.b?.(branch, parentNode.namespaceURI), branch;
|
|
495
359
|
}
|
|
496
360
|
function setParentBranch(branch, parentBranch) {
|
|
497
|
-
|
|
361
|
+
parentBranch && (branch.N = parentBranch, (parentBranch.D ||= /* @__PURE__ */ new Set()).add(branch)), branch.F = branch;
|
|
498
362
|
}
|
|
499
363
|
function createAndSetupBranch($global, renderer, parentScope, parentNode) {
|
|
500
|
-
|
|
501
|
-
renderer,
|
|
502
|
-
createBranch($global, renderer, parentScope, parentNode)
|
|
503
|
-
);
|
|
364
|
+
return setupBranch(renderer, createBranch($global, renderer, parentScope, parentNode));
|
|
504
365
|
}
|
|
505
366
|
function setupBranch(renderer, branch) {
|
|
506
|
-
|
|
367
|
+
return renderer.c && queueRender(branch, renderer.c, -1), branch;
|
|
507
368
|
}
|
|
508
369
|
function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
g: id,
|
|
524
|
-
k: clone,
|
|
525
|
-
f: owner,
|
|
526
|
-
l: setup,
|
|
527
|
-
d: params,
|
|
528
|
-
e: dynamicScopesAccessor
|
|
529
|
-
});
|
|
370
|
+
walks = walks ? walks.replace(/[^\0-1]+$/, "") : "", setup = setup ? setup._ || setup : void 0, params ||= void 0;
|
|
371
|
+
let clone = template ? (branch, ns) => {
|
|
372
|
+
((cloneCache[ns] ||= {})[template] ||= createCloneableHTML(template, ns))(branch, walks);
|
|
373
|
+
} : (branch) => {
|
|
374
|
+
walk(branch.S = branch.K = new Text(), walks, branch);
|
|
375
|
+
};
|
|
376
|
+
return (owner) => ({
|
|
377
|
+
a: id,
|
|
378
|
+
b: clone,
|
|
379
|
+
e: owner,
|
|
380
|
+
c: setup,
|
|
381
|
+
d: params,
|
|
382
|
+
f: dynamicScopesAccessor
|
|
383
|
+
});
|
|
530
384
|
}
|
|
531
385
|
function _content_resume(id, template, walks, setup, params, dynamicScopesAccessor) {
|
|
532
|
-
|
|
533
|
-
id,
|
|
534
|
-
_content(id, template, walks, setup, params, dynamicScopesAccessor)
|
|
535
|
-
);
|
|
386
|
+
return _resume(id, _content(id, template, walks, setup, params, dynamicScopesAccessor));
|
|
536
387
|
}
|
|
537
388
|
function _content_closures(renderer, closureFns) {
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
}
|
|
546
|
-
var cloneCache = {};
|
|
389
|
+
let closureSignals = {};
|
|
390
|
+
for (let key in closureFns) closureSignals[key] = _const(+key, closureFns[key]);
|
|
391
|
+
return (owner, closureValues) => {
|
|
392
|
+
let instance = renderer(owner);
|
|
393
|
+
return instance.g = closureSignals, instance.h = closureValues, instance;
|
|
394
|
+
};
|
|
395
|
+
}
|
|
547
396
|
function createCloneableHTML(html, ns) {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
// src/dom/resume.ts
|
|
562
|
-
var registeredValues = {}, curRuntimeId, readyLookup, branchesEnabled, embedEnabled;
|
|
397
|
+
let { firstChild, lastChild } = parseHTML(html, ns), parent = document.createElementNS(ns, "t");
|
|
398
|
+
return insertChildNodes(parent, null, firstChild, lastChild), firstChild === lastChild && firstChild.nodeType < 8 ? (branch, walks) => {
|
|
399
|
+
walk(branch.S = branch.K = firstChild.cloneNode(!0), walks, branch);
|
|
400
|
+
} : (branch, walks) => {
|
|
401
|
+
let clone = parent.cloneNode(!0);
|
|
402
|
+
walk(clone.firstChild, walks, branch), branch.S = clone.firstChild, branch.K = clone.lastChild;
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region src/dom/resume.ts
|
|
563
407
|
function enableBranches() {
|
|
564
|
-
|
|
408
|
+
branchesEnabled = 1;
|
|
565
409
|
}
|
|
566
|
-
var ready = /* @__PURE__ */ ((_) => (id) => {
|
|
567
|
-
readyLookup[id]?.(), readyLookup[id] = 1;
|
|
568
|
-
})(readyLookup = {});
|
|
569
410
|
function initEmbedded(readyId, runtimeId) {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
411
|
+
embedEnabled = 1, ready(readyId), init(runtimeId), new MutationObserver(() => {
|
|
412
|
+
let renders = self[curRuntimeId];
|
|
413
|
+
for (let renderId in renders) {
|
|
414
|
+
let { s, n } = renders[renderId];
|
|
415
|
+
if (n && !n.isConnected) {
|
|
416
|
+
delete renders[renderId];
|
|
417
|
+
for (let id in s) destroyScope(s[id]);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}).observe(document.body, {
|
|
421
|
+
childList: !0,
|
|
422
|
+
subtree: !0
|
|
423
|
+
});
|
|
581
424
|
}
|
|
582
425
|
function init(runtimeId = "M") {
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
}
|
|
626
|
-
for (let serialized of resumes = render.r || [])
|
|
627
|
-
if (typeof serialized == "string")
|
|
628
|
-
for (lastTokenIndex = 0, visitText = serialized; nextToken(); )
|
|
629
|
-
/\D/.test(lastToken) ? lastEffect = registeredValues[lastToken] : effects.push(lastEffect, getScope(lastToken));
|
|
630
|
-
else
|
|
631
|
-
for (let scope of serialized(serializeContext))
|
|
632
|
-
$global ? typeof scope == "number" ? lastScopeId += scope : (scopeLookup[scope.L = ++lastScopeId] = scope, scope.$ = $global, branchesEnabled && (scope.F = getScope(
|
|
633
|
-
scope.G
|
|
634
|
-
))) : ($global = scope || {}, $global.runtimeId = runtimeId, $global.renderId = renderId);
|
|
635
|
-
for (visit of visits = render.v)
|
|
636
|
-
if (lastTokenIndex = render.i.length, visitText = visit.data, visitType = visitText[lastTokenIndex++], visitScope = getScope(nextToken(
|
|
637
|
-
/* read scope id */
|
|
638
|
-
)), visitType === "*" /* Node */) {
|
|
639
|
-
let prev = visit.previousSibling;
|
|
640
|
-
visitScope[nextToken(
|
|
641
|
-
/* read accessor */
|
|
642
|
-
)] = prev && (prev.nodeType < 8 || prev.data) ? prev : visit.parentNode.insertBefore(new Text(), visit);
|
|
643
|
-
} else branchesEnabled && visitBranches();
|
|
644
|
-
return embedEnabled && (render.n ||= visit?.parentNode.insertBefore(
|
|
645
|
-
new Text(),
|
|
646
|
-
visit.nextSibling
|
|
647
|
-
)), visits.length = resumes.length = 0, effects;
|
|
648
|
-
}, render.w = () => {
|
|
649
|
-
walk2(), runResumeEffects(render);
|
|
650
|
-
}, render;
|
|
651
|
-
})
|
|
652
|
-
});
|
|
653
|
-
};
|
|
654
|
-
if (renders) {
|
|
655
|
-
initRuntime(renders);
|
|
656
|
-
for (let renderId in renders)
|
|
657
|
-
runResumeEffects(resumeRender(renderId));
|
|
658
|
-
} else
|
|
659
|
-
defineRuntime({
|
|
660
|
-
configurable: !0,
|
|
661
|
-
set: initRuntime
|
|
662
|
-
});
|
|
663
|
-
}
|
|
664
|
-
var isResuming;
|
|
426
|
+
if (curRuntimeId) return;
|
|
427
|
+
curRuntimeId = runtimeId;
|
|
428
|
+
let resumeRender, renders = self[runtimeId], defineRuntime = (desc) => Object.defineProperty(self, runtimeId, desc), initRuntime = (renders) => {
|
|
429
|
+
defineRuntime({ value: resumeRender = ((renderId) => {
|
|
430
|
+
let render = resumeRender[renderId] = renders[renderId] || renders(renderId), walk = render.w, scopeLookup = render.s = {}, getScope = (id) => scopeLookup[id] ||= { L: +id }, serializeContext = { _: registeredValues }, visitBranches = branchesEnabled && ((branchScopesStack = [], branchStarts = [], orphanBranches = [], curBranchScopes) => (branchId, branch, endedBranches, accessor, singleNode, parent = visit.parentNode, startVisit = visit, i = orphanBranches.length) => {
|
|
431
|
+
for (visitType !== "[" && (visitScope[nextToken()] = visitType === ")" || visitType === "}" ? parent : visit, accessor = "A" + lastToken, singleNode = visitType !== "]" && visitType !== ")", nextToken()); branchId = +lastToken;) {
|
|
432
|
+
if ((endedBranches ||= []).push(branch = getScope(branchId)), setParentBranch(branch, branch.F), (branch.O = render.p?.[branchId]) && (branch.O.m = render.m), singleNode) {
|
|
433
|
+
for (; startVisit.previousSibling && ~visits.indexOf(startVisit = startVisit.previousSibling););
|
|
434
|
+
branch.K = branch.S = startVisit, visitType === "'" && (branch.a = startVisit);
|
|
435
|
+
} else curBranchScopes = push(curBranchScopes, branch), accessor && (visitScope[accessor] = curBranchScopes, 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);
|
|
436
|
+
for (; i && orphanBranches[--i].L > branchId;) setParentBranch(orphanBranches.pop(), branch);
|
|
437
|
+
nextToken();
|
|
438
|
+
}
|
|
439
|
+
endedBranches && (orphanBranches.push(...endedBranches), singleNode && (visitScope[accessor] = endedBranches.length > 1 ? endedBranches.reverse() : endedBranches[0])), visitType === "[" && (endedBranches || (branchScopesStack.push(curBranchScopes), curBranchScopes = void 0), branchStarts.push(visit));
|
|
440
|
+
})(), nextToken = () => lastToken = visitText.slice(lastTokenIndex, (lastTokenIndex = visitText.indexOf(" ", lastTokenIndex) + 1 || visitText.length + 1) - 1), $global, lastEffect, visits, resumes, visit, visitText, visitType, visitScope, lastToken, lastTokenIndex, lastScopeId = 0;
|
|
441
|
+
return render.m = (effects = []) => {
|
|
442
|
+
if (readyLookup) {
|
|
443
|
+
for (let readyId in render.b) if (readyLookup[readyId] !== 1) return readyLookup[readyId] = ((prev) => () => {
|
|
444
|
+
render.m(), prev?.();
|
|
445
|
+
})(readyLookup[readyId]), effects;
|
|
446
|
+
render.b = 0;
|
|
447
|
+
}
|
|
448
|
+
for (let serialized of resumes = render.r || []) if (typeof serialized == "string") for (lastTokenIndex = 0, visitText = serialized; nextToken();) /\D/.test(lastToken) ? lastEffect = registeredValues[lastToken] : effects.push(lastEffect, getScope(lastToken));
|
|
449
|
+
else for (let scope of serialized(serializeContext)) $global ? typeof scope == "number" ? lastScopeId += scope : (scopeLookup[scope.L = ++lastScopeId] = scope, scope.$ = $global, branchesEnabled && (scope.F = getScope(scope.G))) : ($global = scope || {}, $global.runtimeId = runtimeId, $global.renderId = renderId);
|
|
450
|
+
for (visit of visits = render.v) if (lastTokenIndex = render.i.length, visitText = visit.data, visitType = visitText[lastTokenIndex++], visitScope = getScope(nextToken()), visitType === "*") {
|
|
451
|
+
let prev = visit.previousSibling;
|
|
452
|
+
visitScope[nextToken()] = prev && (prev.nodeType < 8 || prev.data) ? prev : visit.parentNode.insertBefore(new Text(), visit);
|
|
453
|
+
} else branchesEnabled && visitBranches();
|
|
454
|
+
return embedEnabled && (render.n ||= visit?.parentNode.insertBefore(new Text(), visit.nextSibling)), visits.length = resumes.length = 0, effects;
|
|
455
|
+
}, render.w = () => {
|
|
456
|
+
walk(), runResumeEffects(render);
|
|
457
|
+
}, render;
|
|
458
|
+
}) });
|
|
459
|
+
};
|
|
460
|
+
if (renders) {
|
|
461
|
+
initRuntime(renders);
|
|
462
|
+
for (let renderId in renders) runResumeEffects(resumeRender(renderId));
|
|
463
|
+
} else defineRuntime({
|
|
464
|
+
configurable: !0,
|
|
465
|
+
set: initRuntime
|
|
466
|
+
});
|
|
467
|
+
}
|
|
665
468
|
function runResumeEffects(render) {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
469
|
+
try {
|
|
470
|
+
isResuming = 1, runEffects(render.m(), 1);
|
|
471
|
+
} finally {
|
|
472
|
+
isResuming = 0;
|
|
473
|
+
}
|
|
671
474
|
}
|
|
672
475
|
function getRegisteredWithScope(id, scope) {
|
|
673
|
-
|
|
674
|
-
|
|
476
|
+
let val = registeredValues[id];
|
|
477
|
+
return scope ? val(scope) : val;
|
|
675
478
|
}
|
|
676
479
|
function _resume(id, obj) {
|
|
677
|
-
|
|
480
|
+
return registeredValues[id] = obj;
|
|
678
481
|
}
|
|
679
482
|
function _var_resume(id, signal) {
|
|
680
|
-
|
|
483
|
+
return _resume(id, (scope) => (value) => signal(scope, value)), signal;
|
|
681
484
|
}
|
|
682
485
|
function _el(id, accessor) {
|
|
683
|
-
|
|
486
|
+
return accessor = decodeAccessor(accessor), _resume(id, (scope) => () => scope[accessor]);
|
|
684
487
|
}
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
var inputType = "", controllableDelegate = createDelegator();
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region src/dom/controllable.ts
|
|
688
490
|
function _attr_input_checked_default(scope, nodeAccessor, checked) {
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
491
|
+
let el = scope[nodeAccessor], normalizedChecked = normalizeBoolProp(checked);
|
|
492
|
+
if (el.defaultChecked !== normalizedChecked) {
|
|
493
|
+
let restoreValue = scope.H ? normalizedChecked : el.checked;
|
|
494
|
+
el.defaultChecked = normalizedChecked, restoreValue !== normalizedChecked && (el.checked = restoreValue);
|
|
495
|
+
}
|
|
694
496
|
}
|
|
695
497
|
function _attr_input_checked(scope, nodeAccessor, checked, checkedChange) {
|
|
696
|
-
|
|
697
|
-
|
|
498
|
+
let el = scope[nodeAccessor], normalizedChecked = normalizeBoolProp(checked);
|
|
499
|
+
scope["E" + nodeAccessor] = checkedChange, scope["F" + nodeAccessor] = checkedChange ? 0 : 5, checkedChange && !scope.H ? el.checked = normalizedChecked : _attr_input_checked_default(scope, nodeAccessor, normalizedChecked);
|
|
698
500
|
}
|
|
699
501
|
function _attr_input_checked_script(scope, nodeAccessor) {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
502
|
+
let el = scope[nodeAccessor];
|
|
503
|
+
syncControllableFormInput(el, hasCheckboxChanged, () => {
|
|
504
|
+
let checkedChange = scope["E" + nodeAccessor];
|
|
505
|
+
if (checkedChange) {
|
|
506
|
+
let newValue = el.checked;
|
|
507
|
+
el.checked = !newValue, checkedChange(newValue), run();
|
|
508
|
+
}
|
|
509
|
+
});
|
|
708
510
|
}
|
|
709
511
|
function _attr_input_checkedValue_default(scope, nodeAccessor, checkedValue, value) {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
scope,
|
|
713
|
-
nodeAccessor,
|
|
714
|
-
multiple ? normalizedCheckedValue.includes(normalizedValue) : normalizedValue === normalizedCheckedValue
|
|
715
|
-
);
|
|
512
|
+
let multiple = Array.isArray(checkedValue), normalizedValue = normalizeStrProp(value), normalizedCheckedValue = multiple ? checkedValue.map(normalizeStrProp) : normalizeStrProp(checkedValue);
|
|
513
|
+
_attr(scope[nodeAccessor], "value", normalizedValue), _attr_input_checked_default(scope, nodeAccessor, multiple ? normalizedCheckedValue.includes(normalizedValue) : normalizedValue === normalizedCheckedValue);
|
|
716
514
|
}
|
|
717
515
|
function _attr_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValueChange, value) {
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
scope,
|
|
721
|
-
nodeAccessor,
|
|
722
|
-
normalizedCheckedValue,
|
|
723
|
-
normalizedValue
|
|
724
|
-
);
|
|
516
|
+
let el = scope[nodeAccessor], multiple = Array.isArray(checkedValue), normalizedValue = normalizeStrProp(value), normalizedCheckedValue = scope["G" + nodeAccessor] = multiple ? checkedValue.map(normalizeStrProp) : normalizeStrProp(checkedValue);
|
|
517
|
+
_attr(el, "value", normalizedValue), scope["E" + nodeAccessor] = checkedValueChange, scope["F" + nodeAccessor] = checkedValueChange ? 1 : 5, checkedValueChange && !scope.H ? el.checked = multiple ? normalizedCheckedValue.includes(normalizedValue) : normalizedValue === normalizedCheckedValue : _attr_input_checkedValue_default(scope, nodeAccessor, normalizedCheckedValue, normalizedValue);
|
|
725
518
|
}
|
|
726
519
|
function _attr_input_checkedValue_script(scope, nodeAccessor) {
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
))
|
|
738
|
-
radio.form === el.form && (radio.checked = Array.isArray(oldValue) ? oldValue.includes(radio.value) : oldValue === radio.value);
|
|
739
|
-
else
|
|
740
|
-
el.checked = !el.checked;
|
|
741
|
-
checkedValueChange(newValue), run();
|
|
742
|
-
}
|
|
743
|
-
});
|
|
520
|
+
let el = scope[nodeAccessor];
|
|
521
|
+
isResuming && el.defaultChecked && (scope["G" + nodeAccessor] ? scope["G" + nodeAccessor].push(el.value) : scope["G" + nodeAccessor] = el.value), syncControllableFormInput(el, hasCheckboxChanged, () => {
|
|
522
|
+
let checkedValueChange = scope["E" + nodeAccessor];
|
|
523
|
+
if (checkedValueChange) {
|
|
524
|
+
let oldValue = scope["G" + nodeAccessor], newValue = Array.isArray(oldValue) ? updateList(oldValue, el.value, el.checked) : el.checked ? el.value : void 0;
|
|
525
|
+
if (el.name && el.type[0] === "r") for (let radio of el.getRootNode().querySelectorAll(`[type=radio][name=${CSS.escape(el.name)}]`)) radio.form === el.form && (radio.checked = Array.isArray(oldValue) ? oldValue.includes(radio.value) : oldValue === radio.value);
|
|
526
|
+
else el.checked = !el.checked;
|
|
527
|
+
checkedValueChange(newValue), run();
|
|
528
|
+
}
|
|
529
|
+
});
|
|
744
530
|
}
|
|
745
531
|
function _attr_input_value_default(scope, nodeAccessor, value) {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
532
|
+
let el = scope[nodeAccessor], normalizedValue = normalizeStrProp(value);
|
|
533
|
+
if (el.defaultValue !== normalizedValue) {
|
|
534
|
+
let restoreValue = scope.H ? normalizedValue : el.value;
|
|
535
|
+
el.defaultValue = normalizedValue, setInputValue(el, restoreValue);
|
|
536
|
+
}
|
|
751
537
|
}
|
|
752
538
|
function _attr_input_value(scope, nodeAccessor, value, valueChange) {
|
|
753
|
-
|
|
754
|
-
|
|
539
|
+
let el = scope[nodeAccessor], normalizedValue = normalizeStrProp(value);
|
|
540
|
+
scope["E" + nodeAccessor] = valueChange, scope["G" + nodeAccessor] = normalizedValue, scope["F" + nodeAccessor] = valueChange ? 2 : 5, valueChange && !scope.H ? setInputValue(el, normalizedValue) : _attr_input_value_default(scope, nodeAccessor, normalizedValue);
|
|
755
541
|
}
|
|
756
542
|
function _attr_input_value_script(scope, nodeAccessor) {
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
543
|
+
let el = scope[nodeAccessor];
|
|
544
|
+
isResuming && (scope["G" + nodeAccessor] = el.defaultValue), syncControllableFormInput(el, hasValueChanged, (ev) => {
|
|
545
|
+
let valueChange = scope["E" + nodeAccessor];
|
|
546
|
+
valueChange && (inputType = ev?.inputType, valueChange(el.value), run(), setInputValue(el, scope["G" + nodeAccessor]), inputType = "");
|
|
547
|
+
});
|
|
762
548
|
}
|
|
763
549
|
function setInputValue(el, value) {
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
el.value,
|
|
769
|
-
el.value = value
|
|
770
|
-
);
|
|
771
|
-
~updatedPosition && el.setSelectionRange(updatedPosition, updatedPosition);
|
|
772
|
-
}
|
|
550
|
+
if (el.value !== value) {
|
|
551
|
+
let updatedPosition = resolveCursorPosition(inputType, el.getRootNode().activeElement === el && el.selectionStart, el.value, el.value = value);
|
|
552
|
+
~updatedPosition && el.setSelectionRange(updatedPosition, updatedPosition);
|
|
553
|
+
}
|
|
773
554
|
}
|
|
774
555
|
function _attr_select_value_default(scope, nodeAccessor, value) {
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
556
|
+
let restoreValue, el = scope[nodeAccessor], existing = !scope.H, multiple = Array.isArray(value), normalizedValue = multiple ? value.map(normalizeStrProp) : normalizeStrProp(value);
|
|
557
|
+
pendingEffects.unshift(() => {
|
|
558
|
+
for (let opt of el.options) {
|
|
559
|
+
let selected = multiple ? normalizedValue.includes(opt.value) : opt.value === normalizedValue;
|
|
560
|
+
opt.defaultSelected !== selected && (existing && (restoreValue ??= getSelectValue(el, multiple)), opt.defaultSelected = selected);
|
|
561
|
+
}
|
|
562
|
+
restoreValue !== void 0 && setSelectValue(el, restoreValue, multiple);
|
|
563
|
+
}, scope);
|
|
783
564
|
}
|
|
784
565
|
function _attr_select_value(scope, nodeAccessor, value, valueChange) {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
() => setSelectValue(el, normalizedValue, multiple),
|
|
788
|
-
scope
|
|
789
|
-
) : _attr_select_value_default(scope, nodeAccessor, normalizedValue);
|
|
566
|
+
let el = scope[nodeAccessor], existing = !scope.H, multiple = Array.isArray(value), normalizedValue = scope["G" + nodeAccessor] = multiple ? value.map(normalizeStrProp) : normalizeStrProp(value);
|
|
567
|
+
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);
|
|
790
568
|
}
|
|
791
569
|
function _attr_select_value_script(scope, nodeAccessor) {
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
570
|
+
let el = scope[nodeAccessor], onChange = () => {
|
|
571
|
+
let valueChange = scope["E" + nodeAccessor];
|
|
572
|
+
if (valueChange) {
|
|
573
|
+
let oldValue = scope["G" + nodeAccessor], multiple = Array.isArray(oldValue), newValue = getSelectValue(el, multiple);
|
|
574
|
+
setSelectValue(el, oldValue, multiple), valueChange(newValue), run();
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
if (isResuming) if (el.multiple) {
|
|
578
|
+
scope["G" + nodeAccessor] = [];
|
|
579
|
+
for (let opt of el.options) opt.defaultSelected && scope["G" + nodeAccessor].push(opt.value);
|
|
580
|
+
} else {
|
|
581
|
+
scope["G" + nodeAccessor] = "";
|
|
582
|
+
for (let opt of el.options) if (opt.defaultSelected) {
|
|
583
|
+
scope["G" + nodeAccessor] = opt.value;
|
|
584
|
+
break;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
syncControllableFormInput(el, hasSelectChanged, onChange), new MutationObserver(() => {
|
|
588
|
+
let value = scope["G" + nodeAccessor];
|
|
589
|
+
(Array.isArray(value) ? value.length !== el.selectedOptions.length || value.some((value, i) => value != el.selectedOptions[i].value) : el.value !== value) && onChange();
|
|
590
|
+
}).observe(el, {
|
|
591
|
+
childList: !0,
|
|
592
|
+
subtree: !0
|
|
593
|
+
});
|
|
816
594
|
}
|
|
817
595
|
function setSelectValue(el, value, multiple) {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
opt.selected = value.includes(opt.value);
|
|
821
|
-
else
|
|
822
|
-
el.value = value;
|
|
596
|
+
if (multiple) for (let opt of el.options) opt.selected = value.includes(opt.value);
|
|
597
|
+
else el.value = value;
|
|
823
598
|
}
|
|
824
599
|
function getSelectValue(el, multiple) {
|
|
825
|
-
|
|
600
|
+
return multiple ? Array.from(el.selectedOptions, (opt) => opt.value) : el.value;
|
|
826
601
|
}
|
|
827
602
|
function _attr_details_or_dialog_open_default(scope, nodeAccessor, open) {
|
|
828
|
-
|
|
603
|
+
scope.H && (scope[nodeAccessor].open = normalizeBoolProp(open));
|
|
829
604
|
}
|
|
830
605
|
function _attr_details_or_dialog_open(scope, nodeAccessor, open, openChange) {
|
|
831
|
-
|
|
832
|
-
|
|
606
|
+
let normalizedOpen = scope["G" + nodeAccessor] = normalizeBoolProp(open);
|
|
607
|
+
scope["E" + nodeAccessor] = openChange, scope["F" + nodeAccessor] = openChange ? 4 : 5, openChange && !scope.H ? scope[nodeAccessor].open = normalizedOpen : _attr_details_or_dialog_open_default(scope, nodeAccessor, normalizedOpen);
|
|
833
608
|
}
|
|
834
609
|
function _attr_details_or_dialog_open_script(scope, nodeAccessor) {
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
610
|
+
let el = scope[nodeAccessor];
|
|
611
|
+
new MutationObserver(() => {
|
|
612
|
+
let openChange = scope["E" + nodeAccessor];
|
|
613
|
+
if (openChange && el.open === !scope["G" + nodeAccessor]) {
|
|
614
|
+
let newValue = el.open;
|
|
615
|
+
el.open = !newValue, openChange(newValue), run();
|
|
616
|
+
}
|
|
617
|
+
}).observe(el, {
|
|
618
|
+
attributes: !0,
|
|
619
|
+
attributeFilter: ["open"]
|
|
620
|
+
});
|
|
843
621
|
}
|
|
844
622
|
function syncControllableFormInput(el, hasChanged, onChange) {
|
|
845
|
-
|
|
623
|
+
el._ = onChange, controllableDelegate(el, "input", handleChange), el.form && controllableDelegate(el.form, "reset", handleFormReset), isResuming && hasChanged(el) && queueMicrotask(onChange);
|
|
846
624
|
}
|
|
847
625
|
function handleChange(ev) {
|
|
848
|
-
|
|
626
|
+
ev.target._?.(ev);
|
|
849
627
|
}
|
|
850
628
|
function handleFormReset(ev) {
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
for (let change of handlers)
|
|
857
|
-
change();
|
|
858
|
-
});
|
|
629
|
+
let handlers = [];
|
|
630
|
+
for (let el of ev.target.elements) el._ && hasFormElementChanged(el) && handlers.push(el._);
|
|
631
|
+
requestAnimationFrame(() => {
|
|
632
|
+
if (!ev.defaultPrevented) for (let change of handlers) change();
|
|
633
|
+
});
|
|
859
634
|
}
|
|
860
635
|
function hasValueChanged(el) {
|
|
861
|
-
|
|
636
|
+
return el.value !== el.defaultValue;
|
|
862
637
|
}
|
|
863
638
|
function hasCheckboxChanged(el) {
|
|
864
|
-
|
|
639
|
+
return el.checked !== el.defaultChecked;
|
|
865
640
|
}
|
|
866
641
|
function hasSelectChanged(el) {
|
|
867
|
-
|
|
868
|
-
if (opt.selected !== opt.defaultSelected)
|
|
869
|
-
return !0;
|
|
642
|
+
for (let opt of el.options) if (opt.selected !== opt.defaultSelected) return !0;
|
|
870
643
|
}
|
|
871
644
|
function hasFormElementChanged(el) {
|
|
872
|
-
|
|
645
|
+
return el.options ? hasSelectChanged(el) : hasValueChanged(el) || hasCheckboxChanged(el);
|
|
873
646
|
}
|
|
874
647
|
function normalizeStrProp(value) {
|
|
875
|
-
|
|
648
|
+
return normalizeAttrValue(value) || "";
|
|
876
649
|
}
|
|
877
650
|
function normalizeBoolProp(value) {
|
|
878
|
-
|
|
651
|
+
return value != null && value !== !1;
|
|
879
652
|
}
|
|
880
|
-
function updateList(arr, val,
|
|
881
|
-
|
|
882
|
-
|
|
653
|
+
function updateList(arr, val, push) {
|
|
654
|
+
let index = arr.indexOf(val);
|
|
655
|
+
return (push ? !~index && [...arr, val] : ~index && arr.slice(0, index).concat(arr.slice(index + 1))) || arr;
|
|
883
656
|
}
|
|
884
|
-
|
|
885
|
-
|
|
657
|
+
//#endregion
|
|
658
|
+
//#region src/dom/dom.ts
|
|
886
659
|
function _to_text(value) {
|
|
887
|
-
|
|
660
|
+
return value || value === 0 ? value + "" : "";
|
|
888
661
|
}
|
|
889
662
|
function _attr(element, name, value) {
|
|
890
|
-
|
|
663
|
+
setAttribute(element, name, normalizeAttrValue(value));
|
|
891
664
|
}
|
|
892
665
|
function setAttribute(element, name, value) {
|
|
893
|
-
|
|
666
|
+
element.getAttribute(name) != value && (value === void 0 ? element.removeAttribute(name) : element.setAttribute(name, value));
|
|
894
667
|
}
|
|
895
668
|
function _attr_class(element, value) {
|
|
896
|
-
|
|
669
|
+
setAttribute(element, "class", toDelimitedString(value, " ", stringifyClassObject) || void 0);
|
|
897
670
|
}
|
|
898
671
|
function _attr_class_items(element, items) {
|
|
899
|
-
|
|
900
|
-
_attr_class_item(element, key, items[key]);
|
|
672
|
+
for (let key in items) _attr_class_item(element, key, items[key]);
|
|
901
673
|
}
|
|
902
674
|
function _attr_class_item(element, name, value) {
|
|
903
|
-
|
|
675
|
+
element.classList.toggle(name, !!value);
|
|
904
676
|
}
|
|
905
677
|
function _attr_style(element, value) {
|
|
906
|
-
|
|
678
|
+
setAttribute(element, "style", toDelimitedString(value, ";", stringifyStyleObject) || void 0);
|
|
907
679
|
}
|
|
908
680
|
function _attr_style_items(element, items) {
|
|
909
|
-
|
|
910
|
-
_attr_style_item(element, key, items[key]);
|
|
681
|
+
for (let key in items) _attr_style_item(element, key, items[key]);
|
|
911
682
|
}
|
|
912
683
|
function _attr_style_item(element, name, value) {
|
|
913
|
-
|
|
684
|
+
element.style.setProperty(name, _to_text(value));
|
|
914
685
|
}
|
|
915
686
|
function _attr_nonce(scope, nodeAccessor) {
|
|
916
|
-
|
|
687
|
+
_attr(scope[nodeAccessor], "nonce", scope.$.cspNonce);
|
|
917
688
|
}
|
|
918
689
|
function _text(node, value) {
|
|
919
|
-
|
|
920
|
-
|
|
690
|
+
let normalizedValue = _to_text(value);
|
|
691
|
+
node.data !== normalizedValue && (node.data = normalizedValue);
|
|
921
692
|
}
|
|
922
693
|
function _text_content(node, value) {
|
|
923
|
-
|
|
924
|
-
|
|
694
|
+
let normalizedValue = _to_text(value);
|
|
695
|
+
node.textContent !== normalizedValue && (node.textContent = normalizedValue);
|
|
925
696
|
}
|
|
926
697
|
function _attrs(scope, nodeAccessor, nextAttrs) {
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
698
|
+
let el = scope[nodeAccessor];
|
|
699
|
+
for (let i = el.attributes.length; i--;) {
|
|
700
|
+
let { name } = el.attributes.item(i);
|
|
701
|
+
nextAttrs && (name in nextAttrs || hasAttrAlias(el, name, nextAttrs)) || el.removeAttribute(name);
|
|
702
|
+
}
|
|
703
|
+
attrsInternal(scope, nodeAccessor, nextAttrs);
|
|
933
704
|
}
|
|
934
705
|
function _attrs_content(scope, nodeAccessor, nextAttrs) {
|
|
935
|
-
|
|
706
|
+
_attrs(scope, nodeAccessor, nextAttrs), _attr_content(scope, nodeAccessor, nextAttrs?.content);
|
|
936
707
|
}
|
|
937
708
|
function hasAttrAlias(element, attr, nextAttrs) {
|
|
938
|
-
|
|
709
|
+
return attr === "checked" && element.tagName === "INPUT" && "checkedValue" in nextAttrs;
|
|
939
710
|
}
|
|
940
711
|
function _attrs_partial(scope, nodeAccessor, nextAttrs, skip) {
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
712
|
+
let el = scope[nodeAccessor], partial = {};
|
|
713
|
+
for (let i = el.attributes.length; i--;) {
|
|
714
|
+
let { name } = el.attributes.item(i);
|
|
715
|
+
!skip[name] && !(nextAttrs && name in nextAttrs) && el.removeAttribute(name);
|
|
716
|
+
}
|
|
717
|
+
for (let name in nextAttrs) {
|
|
718
|
+
let key = isEventHandler(name) ? `on-${getEventHandlerName(name)}` : name;
|
|
719
|
+
skip[key] || (partial[key] = nextAttrs[name]);
|
|
720
|
+
}
|
|
721
|
+
attrsInternal(scope, nodeAccessor, partial);
|
|
951
722
|
}
|
|
952
723
|
function _attrs_partial_content(scope, nodeAccessor, nextAttrs, skip) {
|
|
953
|
-
|
|
724
|
+
_attrs_partial(scope, nodeAccessor, nextAttrs, skip), _attr_content(scope, nodeAccessor, nextAttrs?.content);
|
|
954
725
|
}
|
|
955
726
|
function attrsInternal(scope, nodeAccessor, nextAttrs) {
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
nextAttrs.valueChange
|
|
991
|
-
), skip = /^value(?:Change)?$/);
|
|
992
|
-
break;
|
|
993
|
-
case "TEXTAREA":
|
|
994
|
-
("value" in nextAttrs || "valueChange" in nextAttrs) && (_attr_input_value(
|
|
995
|
-
scope,
|
|
996
|
-
nodeAccessor,
|
|
997
|
-
nextAttrs.value,
|
|
998
|
-
nextAttrs.valueChange
|
|
999
|
-
), skip = /^value(?:Change)?$/);
|
|
1000
|
-
break;
|
|
1001
|
-
case "DETAILS":
|
|
1002
|
-
case "DIALOG":
|
|
1003
|
-
("open" in nextAttrs || "openChange" in nextAttrs) && (_attr_details_or_dialog_open(
|
|
1004
|
-
scope,
|
|
1005
|
-
nodeAccessor,
|
|
1006
|
-
nextAttrs.open,
|
|
1007
|
-
nextAttrs.openChange
|
|
1008
|
-
), skip = /^open(?:Change)?$/);
|
|
1009
|
-
break;
|
|
1010
|
-
}
|
|
1011
|
-
for (let name in nextAttrs) {
|
|
1012
|
-
let value = nextAttrs[name];
|
|
1013
|
-
switch (name) {
|
|
1014
|
-
case "class":
|
|
1015
|
-
_attr_class(el, value);
|
|
1016
|
-
break;
|
|
1017
|
-
case "style":
|
|
1018
|
-
_attr_style(el, value);
|
|
1019
|
-
break;
|
|
1020
|
-
default: {
|
|
1021
|
-
isEventHandler(name) ? (events ||= scope["I" /* EventAttributes */ + nodeAccessor] = {})[getEventHandlerName(name)] = value : skip?.test(name) || name === "content" && el.tagName !== "META" || _attr(el, name, value);
|
|
1022
|
-
break;
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
727
|
+
let el = scope[nodeAccessor], events, skip;
|
|
728
|
+
switch (el.tagName) {
|
|
729
|
+
case "INPUT":
|
|
730
|
+
if ("checked" in nextAttrs || "checkedChange" in nextAttrs) _attr_input_checked(scope, nodeAccessor, nextAttrs.checked, nextAttrs.checkedChange);
|
|
731
|
+
else if ("checkedValue" in nextAttrs || "checkedValueChange" in nextAttrs) _attr_input_checkedValue(scope, nodeAccessor, nextAttrs.checkedValue, nextAttrs.checkedValueChange, nextAttrs.value);
|
|
732
|
+
else if ("value" in nextAttrs || "valueChange" in nextAttrs) _attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange);
|
|
733
|
+
else break;
|
|
734
|
+
skip = /^(?:value|checked(?:Value)?)(?:Change)?$/;
|
|
735
|
+
break;
|
|
736
|
+
case "SELECT":
|
|
737
|
+
("value" in nextAttrs || "valueChange" in nextAttrs) && (_attr_select_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange), skip = /^value(?:Change)?$/);
|
|
738
|
+
break;
|
|
739
|
+
case "TEXTAREA":
|
|
740
|
+
("value" in nextAttrs || "valueChange" in nextAttrs) && (_attr_input_value(scope, nodeAccessor, nextAttrs.value, nextAttrs.valueChange), skip = /^value(?:Change)?$/);
|
|
741
|
+
break;
|
|
742
|
+
case "DETAILS":
|
|
743
|
+
case "DIALOG":
|
|
744
|
+
("open" in nextAttrs || "openChange" in nextAttrs) && (_attr_details_or_dialog_open(scope, nodeAccessor, nextAttrs.open, nextAttrs.openChange), skip = /^open(?:Change)?$/);
|
|
745
|
+
break;
|
|
746
|
+
}
|
|
747
|
+
for (let name in nextAttrs) {
|
|
748
|
+
let value = nextAttrs[name];
|
|
749
|
+
switch (name) {
|
|
750
|
+
case "class":
|
|
751
|
+
_attr_class(el, value);
|
|
752
|
+
break;
|
|
753
|
+
case "style":
|
|
754
|
+
_attr_style(el, value);
|
|
755
|
+
break;
|
|
756
|
+
default:
|
|
757
|
+
isEventHandler(name) ? (events ||= scope["I" + nodeAccessor] = {})[getEventHandlerName(name)] = value : skip?.test(name) || name === "content" && el.tagName !== "META" || _attr(el, name, value);
|
|
758
|
+
break;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
1026
761
|
}
|
|
1027
762
|
function _attr_content(scope, nodeAccessor, value) {
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
content.e,
|
|
1032
|
-
scope["A" /* BranchScopes */ + nodeAccessor]
|
|
1033
|
-
));
|
|
1034
|
-
for (let accessor in content?.h)
|
|
1035
|
-
content.h[accessor](
|
|
1036
|
-
scope["A" /* BranchScopes */ + nodeAccessor],
|
|
1037
|
-
content.t[accessor]
|
|
1038
|
-
);
|
|
763
|
+
let content = normalizeClientRender(value);
|
|
764
|
+
scope["D" + nodeAccessor] !== (scope["D" + nodeAccessor] = content?.a) && (setConditionalRenderer(scope, nodeAccessor, content, createAndSetupBranch), content?.f && subscribeToScopeSet(content.e, content.f, scope["A" + nodeAccessor]));
|
|
765
|
+
for (let accessor in content?.g) content.g[accessor](scope["A" + nodeAccessor], content.h[accessor]);
|
|
1039
766
|
}
|
|
1040
767
|
function _attrs_script(scope, nodeAccessor) {
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
_on(el, name, events[name]);
|
|
768
|
+
let el = scope[nodeAccessor], events = scope["I" + nodeAccessor];
|
|
769
|
+
switch (scope["F" + nodeAccessor]) {
|
|
770
|
+
case 0:
|
|
771
|
+
_attr_input_checked_script(scope, nodeAccessor);
|
|
772
|
+
break;
|
|
773
|
+
case 1:
|
|
774
|
+
_attr_input_checkedValue_script(scope, nodeAccessor);
|
|
775
|
+
break;
|
|
776
|
+
case 2:
|
|
777
|
+
_attr_input_value_script(scope, nodeAccessor);
|
|
778
|
+
break;
|
|
779
|
+
case 3:
|
|
780
|
+
_attr_select_value_script(scope, nodeAccessor);
|
|
781
|
+
break;
|
|
782
|
+
case 4:
|
|
783
|
+
_attr_details_or_dialog_open_script(scope, nodeAccessor);
|
|
784
|
+
break;
|
|
785
|
+
}
|
|
786
|
+
for (let name in events) _on(el, name, events[name]);
|
|
1061
787
|
}
|
|
1062
788
|
function _html(scope, value, accessor) {
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
parentNode.namespaceURI
|
|
1066
|
-
);
|
|
1067
|
-
insertChildNodes(
|
|
1068
|
-
parentNode,
|
|
1069
|
-
firstChild,
|
|
1070
|
-
scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()),
|
|
1071
|
-
scope["H" /* DynamicHTMLLastChild */ + accessor] = newContent.lastChild
|
|
1072
|
-
), removeChildNodes(firstChild, lastChild);
|
|
789
|
+
let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope["H" + accessor] || firstChild, newContent = parseHTML(_to_text(value), parentNode.namespaceURI);
|
|
790
|
+
insertChildNodes(parentNode, firstChild, scope[accessor] = newContent.firstChild || newContent.appendChild(new Text()), scope["H" + accessor] = newContent.lastChild), removeChildNodes(firstChild, lastChild);
|
|
1073
791
|
}
|
|
1074
792
|
function normalizeClientRender(value) {
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
return renderer;
|
|
793
|
+
let renderer = normalizeDynamicRenderer(value);
|
|
794
|
+
if (renderer && renderer.a) return renderer;
|
|
1078
795
|
}
|
|
1079
796
|
function normalizeAttrValue(value) {
|
|
1080
|
-
|
|
1081
|
-
return value === !0 ? "" : value + "";
|
|
797
|
+
if (value || value === 0) return value === !0 ? "" : value + "";
|
|
1082
798
|
}
|
|
1083
799
|
function _lifecycle(scope, thisObj, index = 0) {
|
|
1084
|
-
|
|
1085
|
-
|
|
800
|
+
let accessor = "K" + index, instance = scope[accessor];
|
|
801
|
+
instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[accessor] = thisObj, thisObj.onMount?.(), $signal(scope, accessor).onabort = () => thisObj.onDestroy?.());
|
|
1086
802
|
}
|
|
1087
803
|
function removeChildNodes(startNode, endNode) {
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
804
|
+
let stop = endNode.nextSibling, current = startNode;
|
|
805
|
+
for (; current !== stop;) {
|
|
806
|
+
let next = current.nextSibling;
|
|
807
|
+
current.remove(), current = next;
|
|
808
|
+
}
|
|
1093
809
|
}
|
|
1094
810
|
function insertChildNodes(parentNode, referenceNode, startNode, endNode) {
|
|
1095
|
-
|
|
811
|
+
parentNode.insertBefore(toInsertNode(startNode, endNode), referenceNode);
|
|
1096
812
|
}
|
|
1097
813
|
function toInsertNode(startNode, endNode) {
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
|
|
814
|
+
if (startNode === endNode) return startNode;
|
|
815
|
+
let parent = new DocumentFragment(), stop = endNode.nextSibling, current = startNode;
|
|
816
|
+
for (; current !== stop;) {
|
|
817
|
+
let next = current.nextSibling;
|
|
818
|
+
parent.appendChild(current), current = next;
|
|
819
|
+
}
|
|
820
|
+
return parent;
|
|
821
|
+
}
|
|
822
|
+
//#endregion
|
|
823
|
+
//#region src/dom/control-flow.ts
|
|
1108
824
|
function _await_promise(nodeAccessor, params) {
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
-1
|
|
1154
|
-
)
|
|
1155
|
-
)
|
|
1156
|
-
)
|
|
1157
|
-
));
|
|
1158
|
-
let thisPromise = scope[promiseAccessor] = promise.then(
|
|
1159
|
-
(data) => {
|
|
1160
|
-
if (thisPromise === scope[promiseAccessor]) {
|
|
1161
|
-
let referenceNode = scope[nodeAccessor];
|
|
1162
|
-
scope[promiseAccessor] = 0, queueMicrotask(run), queueRender(
|
|
1163
|
-
scope,
|
|
1164
|
-
() => {
|
|
1165
|
-
(awaitBranch = scope[branchAccessor]).V && (pendingScopes.push(awaitBranch), setupBranch(
|
|
1166
|
-
awaitBranch.V,
|
|
1167
|
-
awaitBranch
|
|
1168
|
-
), awaitBranch.V = 0, insertBranchBefore(
|
|
1169
|
-
awaitBranch,
|
|
1170
|
-
scope[nodeAccessor].parentNode,
|
|
1171
|
-
scope[nodeAccessor]
|
|
1172
|
-
), referenceNode.remove()), params?.(awaitBranch, [data]);
|
|
1173
|
-
let pendingRenders2 = awaitBranch.W;
|
|
1174
|
-
if (awaitBranch.W = 0, pendingRenders2?.forEach(queuePendingRender), placeholderShown.add(pendingEffects), awaitCounter.c(), awaitCounter.m) {
|
|
1175
|
-
let fnScopes = /* @__PURE__ */ new Map(), effects = awaitCounter.m();
|
|
1176
|
-
for (let i = 0; i < pendingEffects.length; ) {
|
|
1177
|
-
let fn = pendingEffects[i++], scopes = fnScopes.get(fn);
|
|
1178
|
-
scopes || fnScopes.set(fn, scopes = /* @__PURE__ */ new Set()), scopes.add(pendingEffects[i++]);
|
|
1179
|
-
}
|
|
1180
|
-
for (let i = 0; i < effects.length; ) {
|
|
1181
|
-
let fn = effects[i++], scope2 = effects[i++];
|
|
1182
|
-
fnScopes.get(fn)?.has(scope2) || queueEffect(scope2, fn);
|
|
1183
|
-
}
|
|
1184
|
-
}
|
|
1185
|
-
},
|
|
1186
|
-
-1
|
|
1187
|
-
);
|
|
1188
|
-
}
|
|
1189
|
-
},
|
|
1190
|
-
(error) => {
|
|
1191
|
-
thisPromise === scope[promiseAccessor] && (awaitCounter.i = scope[promiseAccessor] = 0, schedule(), queueRender(scope, renderCatch, -1, error));
|
|
1192
|
-
}
|
|
1193
|
-
);
|
|
1194
|
-
};
|
|
825
|
+
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
826
|
+
let promiseAccessor = "L" + nodeAccessor, branchAccessor = "A" + nodeAccessor;
|
|
827
|
+
return _enable_catch(), (scope, promise) => {
|
|
828
|
+
let awaitBranch = scope[branchAccessor], tryBranch = findBranchWithKey(scope, "Q") || awaitBranch, awaitCounter = tryBranch.O;
|
|
829
|
+
awaitCounter?.i || (awaitCounter = tryBranch.O = {
|
|
830
|
+
i: 0,
|
|
831
|
+
c() {
|
|
832
|
+
if (--awaitCounter.i) return 1;
|
|
833
|
+
if (tryBranch === scope[branchAccessor]) scope[nodeAccessor].parentNode && scope[nodeAccessor].replaceWith(scope[branchAccessor].S.parentNode);
|
|
834
|
+
else {
|
|
835
|
+
let placeholderBranch = tryBranch.P;
|
|
836
|
+
placeholderBranch && (tryBranch.P = 0, placeholderBranch.S.parentNode.insertBefore(tryBranch.S.parentNode, placeholderBranch.S), removeAndDestroyBranch(placeholderBranch));
|
|
837
|
+
}
|
|
838
|
+
queueEffect(tryBranch, (scope) => {
|
|
839
|
+
let pendingEffects = scope.J;
|
|
840
|
+
pendingEffects && (scope.J = [], runEffects(pendingEffects, 1));
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
}), placeholderShown.add(pendingEffects), scope[promiseAccessor] || (awaitBranch && (awaitBranch.W ||= []), awaitCounter.i++ || requestAnimationFrame(() => awaitCounter.i && runEffects(prepareEffects(() => queueRender(tryBranch === awaitBranch ? scope : tryBranch, () => {
|
|
844
|
+
tryBranch.Q ? (insertBranchBefore(tryBranch.P = createAndSetupBranch(scope.$, tryBranch.Q, tryBranch._, tryBranch.S.parentNode), tryBranch.S.parentNode, tryBranch.S), tempDetachBranch(tryBranch)) : awaitBranch.V || (awaitBranch.S.parentNode.insertBefore(scope[nodeAccessor], awaitBranch.S), tempDetachBranch(tryBranch));
|
|
845
|
+
}, -1)))));
|
|
846
|
+
let thisPromise = scope[promiseAccessor] = promise.then((data) => {
|
|
847
|
+
if (thisPromise === scope[promiseAccessor]) {
|
|
848
|
+
let referenceNode = scope[nodeAccessor];
|
|
849
|
+
scope[promiseAccessor] = 0, queueMicrotask(run), queueRender(scope, () => {
|
|
850
|
+
(awaitBranch = scope[branchAccessor]).V && (pendingScopes.push(awaitBranch), setupBranch(awaitBranch.V, awaitBranch), awaitBranch.V = 0, insertBranchBefore(awaitBranch, scope[nodeAccessor].parentNode, scope[nodeAccessor]), referenceNode.remove()), params?.(awaitBranch, [data]);
|
|
851
|
+
let pendingRenders = awaitBranch.W;
|
|
852
|
+
if (awaitBranch.W = 0, pendingRenders?.forEach(queuePendingRender), placeholderShown.add(pendingEffects), awaitCounter.c(), awaitCounter.m) {
|
|
853
|
+
let fnScopes = /* @__PURE__ */ new Map(), effects = awaitCounter.m();
|
|
854
|
+
for (let i = 0; i < pendingEffects.length;) {
|
|
855
|
+
let fn = pendingEffects[i++], scopes = fnScopes.get(fn);
|
|
856
|
+
scopes || fnScopes.set(fn, scopes = /* @__PURE__ */ new Set()), scopes.add(pendingEffects[i++]);
|
|
857
|
+
}
|
|
858
|
+
for (let i = 0; i < effects.length;) {
|
|
859
|
+
let fn = effects[i++], scope = effects[i++];
|
|
860
|
+
fnScopes.get(fn)?.has(scope) || queueEffect(scope, fn);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}, -1);
|
|
864
|
+
}
|
|
865
|
+
}, (error) => {
|
|
866
|
+
thisPromise === scope[promiseAccessor] && (awaitCounter.i = scope[promiseAccessor] = 0, schedule(), queueRender(scope, renderCatch, -1, error));
|
|
867
|
+
});
|
|
868
|
+
};
|
|
1195
869
|
}
|
|
1196
870
|
function _await_content(nodeAccessor, template, walks, setup) {
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
renderer,
|
|
1203
|
-
scope,
|
|
1204
|
-
scope[nodeAccessor].parentNode
|
|
1205
|
-
)).V = renderer, pendingScopes.pop();
|
|
1206
|
-
};
|
|
871
|
+
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
872
|
+
let branchAccessor = "A" + nodeAccessor, renderer = _content("", template, walks, setup)();
|
|
873
|
+
return (scope) => {
|
|
874
|
+
(scope[branchAccessor] = createBranch(scope.$, renderer, scope, scope[nodeAccessor].parentNode)).V = renderer, pendingScopes.pop();
|
|
875
|
+
};
|
|
1207
876
|
}
|
|
1208
877
|
function _try(nodeAccessor, template, walks, setup) {
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
createAndSetupBranch
|
|
1217
|
-
);
|
|
1218
|
-
let branch = scope[branchAccessor];
|
|
1219
|
-
branch && (branch.C = nodeAccessor, branch.E = normalizeDynamicRenderer(input.catch), branch.Q = normalizeDynamicRenderer(
|
|
1220
|
-
input.placeholder
|
|
1221
|
-
));
|
|
1222
|
-
};
|
|
878
|
+
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
879
|
+
let branchAccessor = "A" + nodeAccessor, renderer = _content("", template, walks, setup)();
|
|
880
|
+
return (scope, input) => {
|
|
881
|
+
scope[branchAccessor] || setConditionalRenderer(scope, nodeAccessor, renderer, createAndSetupBranch);
|
|
882
|
+
let branch = scope[branchAccessor];
|
|
883
|
+
branch && (branch.C = nodeAccessor, branch.E = input.catch && (normalizeDynamicRenderer(input.catch) || 0), branch.Q = normalizeDynamicRenderer(input.placeholder));
|
|
884
|
+
};
|
|
1223
885
|
}
|
|
1224
886
|
function renderCatch(scope, error) {
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
tryWithCatch.C,
|
|
1231
|
-
tryWithCatch.E,
|
|
1232
|
-
createAndSetupBranch
|
|
1233
|
-
), tryWithCatch.E.d?.(
|
|
1234
|
-
owner["A" /* BranchScopes */ + tryWithCatch.C],
|
|
1235
|
-
[error]
|
|
1236
|
-
);
|
|
1237
|
-
} else
|
|
1238
|
-
throw error;
|
|
887
|
+
let tryWithCatch = findBranchWithKey(scope, "E");
|
|
888
|
+
if (tryWithCatch) {
|
|
889
|
+
let owner = tryWithCatch._, placeholderBranch = tryWithCatch.P;
|
|
890
|
+
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]);
|
|
891
|
+
} else throw error;
|
|
1239
892
|
}
|
|
1240
893
|
function _if(nodeAccessor, ...branchesArgs) {
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
branchesArgs[i++],
|
|
1248
|
-
branchesArgs[i++],
|
|
1249
|
-
branchesArgs[i++]
|
|
1250
|
-
)()
|
|
1251
|
-
);
|
|
1252
|
-
return enableBranches(), (scope, newBranch) => {
|
|
1253
|
-
newBranch !== scope[branchAccessor] && setConditionalRenderer(
|
|
1254
|
-
scope,
|
|
1255
|
-
nodeAccessor,
|
|
1256
|
-
branches[scope[branchAccessor] = newBranch],
|
|
1257
|
-
createAndSetupBranch
|
|
1258
|
-
);
|
|
1259
|
-
};
|
|
894
|
+
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
895
|
+
let branchAccessor = "D" + nodeAccessor, branches = [], i = 0;
|
|
896
|
+
for (; i < branchesArgs.length;) branches.push(_content("", branchesArgs[i++], branchesArgs[i++], branchesArgs[i++])());
|
|
897
|
+
return enableBranches(), (scope, newBranch) => {
|
|
898
|
+
newBranch !== scope[branchAccessor] && setConditionalRenderer(scope, nodeAccessor, branches[scope[branchAccessor] = newBranch], createAndSetupBranch);
|
|
899
|
+
};
|
|
1260
900
|
}
|
|
1261
901
|
function patchDynamicTag(fn) {
|
|
1262
|
-
|
|
1263
|
-
}
|
|
1264
|
-
var _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
1265
|
-
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
1266
|
-
let childScopeAccessor = "A" /* BranchScopes */ + nodeAccessor, rendererAccessor = "D" /* ConditionalRenderer */ + nodeAccessor;
|
|
1267
|
-
return enableBranches(), (scope, newRenderer, getInput) => {
|
|
1268
|
-
let normalizedRenderer = normalizeDynamicRenderer(newRenderer);
|
|
1269
|
-
if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.g || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor]))
|
|
1270
|
-
if (setConditionalRenderer(
|
|
1271
|
-
scope,
|
|
1272
|
-
nodeAccessor,
|
|
1273
|
-
normalizedRenderer || (getContent ? getContent(scope) : void 0),
|
|
1274
|
-
createBranchWithTagNameOrRenderer
|
|
1275
|
-
), getTagVar && (scope[childScopeAccessor].T = (value) => getTagVar()(scope, value)), typeof normalizedRenderer == "string") {
|
|
1276
|
-
if (getContent) {
|
|
1277
|
-
let content = getContent(scope);
|
|
1278
|
-
setConditionalRenderer(
|
|
1279
|
-
scope[childScopeAccessor],
|
|
1280
|
-
"a",
|
|
1281
|
-
content,
|
|
1282
|
-
createAndSetupBranch
|
|
1283
|
-
), content.e && subscribeToScopeSet(
|
|
1284
|
-
content.f,
|
|
1285
|
-
content.e,
|
|
1286
|
-
scope[childScopeAccessor]["Aa"]
|
|
1287
|
-
);
|
|
1288
|
-
}
|
|
1289
|
-
} else normalizedRenderer?.e && subscribeToScopeSet(
|
|
1290
|
-
normalizedRenderer.f,
|
|
1291
|
-
normalizedRenderer.e,
|
|
1292
|
-
scope[childScopeAccessor]
|
|
1293
|
-
);
|
|
1294
|
-
if (normalizedRenderer) {
|
|
1295
|
-
let childScope = scope[childScopeAccessor], args = getInput?.();
|
|
1296
|
-
if (typeof normalizedRenderer == "string")
|
|
1297
|
-
(getContent ? _attrs : _attrs_content)(
|
|
1298
|
-
childScope,
|
|
1299
|
-
"a",
|
|
1300
|
-
(inputIsArgs ? args[0] : args) || {}
|
|
1301
|
-
), (childScope["Ia"] || childScope["Ea"]) && queueEffect(childScope, dynamicTagScript);
|
|
1302
|
-
else {
|
|
1303
|
-
for (let accessor in normalizedRenderer.h)
|
|
1304
|
-
normalizedRenderer.h[accessor](
|
|
1305
|
-
childScope,
|
|
1306
|
-
normalizedRenderer.t[accessor]
|
|
1307
|
-
);
|
|
1308
|
-
if (normalizedRenderer.d)
|
|
1309
|
-
if (inputIsArgs)
|
|
1310
|
-
normalizedRenderer.d(
|
|
1311
|
-
childScope,
|
|
1312
|
-
normalizedRenderer._ ? args[0] : args
|
|
1313
|
-
);
|
|
1314
|
-
else {
|
|
1315
|
-
let inputWithContent = getContent ? { ...args, content: getContent(scope) } : args || {};
|
|
1316
|
-
normalizedRenderer.d(
|
|
1317
|
-
childScope,
|
|
1318
|
-
normalizedRenderer._ ? inputWithContent : [inputWithContent]
|
|
1319
|
-
);
|
|
1320
|
-
}
|
|
1321
|
-
}
|
|
1322
|
-
}
|
|
1323
|
-
};
|
|
1324
|
-
};
|
|
902
|
+
_dynamic_tag = fn(_dynamic_tag);
|
|
903
|
+
}
|
|
1325
904
|
function _resume_dynamic_tag() {
|
|
1326
|
-
|
|
905
|
+
_resume("d", dynamicTagScript);
|
|
1327
906
|
}
|
|
1328
907
|
function dynamicTagScript(branch) {
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
referenceNode === parentNode ? (prevBranch && (destroyBranch(prevBranch), referenceNode.textContent = ""), newBranch && insertBranchBefore(newBranch, parentNode, null)) : prevBranch ? (newBranch ? insertBranchBefore(
|
|
1337
|
-
newBranch,
|
|
1338
|
-
parentNode,
|
|
1339
|
-
prevBranch.S
|
|
1340
|
-
) : parentNode.insertBefore(
|
|
1341
|
-
referenceNode,
|
|
1342
|
-
prevBranch.S
|
|
1343
|
-
), removeAndDestroyBranch(prevBranch)) : newBranch && (insertBranchBefore(newBranch, parentNode, referenceNode), referenceNode.remove());
|
|
1344
|
-
}
|
|
1345
|
-
var _for_of = loop(([all, by = bySecondArg], cb) => {
|
|
1346
|
-
typeof by == "string" ? forOf(
|
|
1347
|
-
all,
|
|
1348
|
-
(item, i) => cb(item[by], [item, i])
|
|
1349
|
-
) : forOf(all, (item, i) => cb(by(item, i), [item, i]));
|
|
1350
|
-
}), _for_in = loop(
|
|
1351
|
-
([obj, by = byFirstArg], cb) => forIn(obj, (key, value) => cb(by(key, value), [key, value]))
|
|
1352
|
-
), _for_to = loop(
|
|
1353
|
-
([to, from, step, by = byFirstArg], cb) => forTo(to, from, step, (v) => cb(by(v), [v]))
|
|
1354
|
-
), _for_until = loop(
|
|
1355
|
-
([until, from, step, by = byFirstArg], cb) => forUntil(until, from, step, (v) => cb(by(v), [v]))
|
|
1356
|
-
);
|
|
908
|
+
_attrs_script(branch, "a");
|
|
909
|
+
}
|
|
910
|
+
function setConditionalRenderer(scope, nodeAccessor, newRenderer, createBranch) {
|
|
911
|
+
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);
|
|
912
|
+
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());
|
|
913
|
+
}
|
|
914
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1357
915
|
function loop(forEach) {
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
if (oldEnd + 1 < oldLen && (afterReference = oldScopes[oldEnd + 1].S), start > oldEnd) {
|
|
1393
|
-
if (start <= newEnd)
|
|
1394
|
-
for (let i = start; i <= newEnd; i++)
|
|
1395
|
-
insertBranchBefore(newScopes[i], parentNode, afterReference);
|
|
1396
|
-
return;
|
|
1397
|
-
} else if (start > newEnd)
|
|
1398
|
-
return;
|
|
1399
|
-
let diffLen = newEnd - start + 1, oldPos = /* @__PURE__ */ new Map(), sources = new Array(diffLen), pred = new Array(diffLen), tails = [], tail = -1, lo, hi, mid;
|
|
1400
|
-
for (let i = start; i <= oldEnd; i++)
|
|
1401
|
-
oldPos.set(oldScopes[i], i);
|
|
1402
|
-
for (let i = diffLen; i--; )
|
|
1403
|
-
sources[i] = oldPos.get(newScopes[start + i]) ?? -1;
|
|
1404
|
-
for (let i = 0; i < diffLen; i++)
|
|
1405
|
-
if (~sources[i])
|
|
1406
|
-
if (tail < 0 || sources[tails[tail]] < sources[i])
|
|
1407
|
-
~tail && (pred[i] = tails[tail]), tails[++tail] = i;
|
|
1408
|
-
else {
|
|
1409
|
-
for (lo = 0, hi = tail; lo < hi; )
|
|
1410
|
-
mid = (lo + hi) / 2 | 0, sources[tails[mid]] < sources[i] ? lo = mid + 1 : hi = mid;
|
|
1411
|
-
sources[i] < sources[tails[lo]] && (lo > 0 && (pred[i] = tails[lo - 1]), tails[lo] = i);
|
|
1412
|
-
}
|
|
1413
|
-
for (hi = tails[tail], lo = tail + 1; lo-- > 0; )
|
|
1414
|
-
tails[lo] = hi, hi = pred[hi];
|
|
1415
|
-
for (let i = diffLen; i--; )
|
|
1416
|
-
~tail && i === tails[tail] ? tail-- : insertBranchBefore(newScopes[start + i], parentNode, afterReference), afterReference = newScopes[start + i].S;
|
|
1417
|
-
};
|
|
1418
|
-
};
|
|
916
|
+
return (nodeAccessor, template, walks, setup, params) => {
|
|
917
|
+
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
918
|
+
let scopesAccessor = "A" + nodeAccessor, renderer = _content("", template, walks, setup)();
|
|
919
|
+
return enableBranches(), (scope, value) => {
|
|
920
|
+
let referenceNode = scope[nodeAccessor], oldScopes = toArray(scope[scopesAccessor]), newScopes = scope[scopesAccessor] = [], oldLen = oldScopes.length, parentNode = referenceNode.nodeType > 1 ? referenceNode.parentNode || oldScopes[0]?.S.parentNode : referenceNode, oldScopesByKey, hasPotentialMoves;
|
|
921
|
+
forEach(value, (key, args) => {
|
|
922
|
+
let branch = oldLen && (oldScopesByKey ||= oldScopes.reduce((map, scope, i) => map.set(scope.M ?? i, scope), /* @__PURE__ */ new Map())).get(key);
|
|
923
|
+
branch ? hasPotentialMoves = oldScopesByKey.delete(key) : branch = createAndSetupBranch(scope.$, renderer, scope, parentNode), branch.M = key, newScopes.push(branch), params?.(branch, args);
|
|
924
|
+
});
|
|
925
|
+
let newLen = newScopes.length, hasSiblings = referenceNode !== parentNode, afterReference = null, oldEnd = oldLen - 1, newEnd = newLen - 1, start = 0;
|
|
926
|
+
if (hasSiblings && (oldLen ? (afterReference = oldScopes[oldEnd].K.nextSibling, newLen || parentNode.insertBefore(referenceNode, afterReference)) : newLen && (afterReference = referenceNode.nextSibling, referenceNode.remove())), !hasPotentialMoves) {
|
|
927
|
+
oldLen && (oldScopes.forEach(hasSiblings ? removeAndDestroyBranch : destroyBranch), hasSiblings || (parentNode.textContent = ""));
|
|
928
|
+
for (let newScope of newScopes) insertBranchBefore(newScope, parentNode, afterReference);
|
|
929
|
+
return;
|
|
930
|
+
}
|
|
931
|
+
for (let branch of oldScopesByKey.values()) removeAndDestroyBranch(branch);
|
|
932
|
+
for (; start < oldLen && start < newLen && oldScopes[start] === newScopes[start];) start++;
|
|
933
|
+
for (; oldEnd >= start && newEnd >= start && oldScopes[oldEnd] === newScopes[newEnd];) oldEnd--, newEnd--;
|
|
934
|
+
if (oldEnd + 1 < oldLen && (afterReference = oldScopes[oldEnd + 1].S), start > oldEnd) {
|
|
935
|
+
if (start <= newEnd) for (let i = start; i <= newEnd; i++) insertBranchBefore(newScopes[i], parentNode, afterReference);
|
|
936
|
+
return;
|
|
937
|
+
} else if (start > newEnd) return;
|
|
938
|
+
let diffLen = newEnd - start + 1, oldPos = /* @__PURE__ */ new Map(), sources = Array(diffLen), pred = Array(diffLen), tails = [], tail = -1, lo, hi, mid;
|
|
939
|
+
for (let i = start; i <= oldEnd; i++) oldPos.set(oldScopes[i], i);
|
|
940
|
+
for (let i = diffLen; i--;) sources[i] = oldPos.get(newScopes[start + i]) ?? -1;
|
|
941
|
+
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;
|
|
942
|
+
else {
|
|
943
|
+
for (lo = 0, hi = tail; lo < hi;) mid = (lo + hi) / 2 | 0, sources[tails[mid]] < sources[i] ? lo = mid + 1 : hi = mid;
|
|
944
|
+
sources[i] < sources[tails[lo]] && (lo > 0 && (pred[i] = tails[lo - 1]), tails[lo] = i);
|
|
945
|
+
}
|
|
946
|
+
for (hi = tails[tail], lo = tail + 1; lo-- > 0;) tails[lo] = hi, hi = pred[hi];
|
|
947
|
+
for (let i = diffLen; i--;) ~tail && i === tails[tail] ? tail-- : insertBranchBefore(newScopes[start + i], parentNode, afterReference), afterReference = newScopes[start + i].S;
|
|
948
|
+
};
|
|
949
|
+
};
|
|
1419
950
|
}
|
|
1420
951
|
function createBranchWithTagNameOrRenderer($global, tagNameOrRenderer, parentScope, parentNode) {
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
tagNameOrRenderer,
|
|
1424
|
-
parentScope,
|
|
1425
|
-
parentNode
|
|
1426
|
-
);
|
|
1427
|
-
return typeof tagNameOrRenderer == "string" ? branch.a = branch.S = branch.K = document.createElementNS(
|
|
1428
|
-
tagNameOrRenderer === "svg" ? "http://www.w3.org/2000/svg" : tagNameOrRenderer === "math" ? "http://www.w3.org/1998/Math/MathML" : parentNode.namespaceURI,
|
|
1429
|
-
tagNameOrRenderer
|
|
1430
|
-
) : setupBranch(tagNameOrRenderer, branch), branch;
|
|
952
|
+
let branch = createBranch($global, tagNameOrRenderer, parentScope, parentNode);
|
|
953
|
+
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;
|
|
1431
954
|
}
|
|
1432
955
|
function bySecondArg(_item, index) {
|
|
1433
|
-
|
|
956
|
+
return index;
|
|
1434
957
|
}
|
|
1435
958
|
function byFirstArg(name) {
|
|
1436
|
-
|
|
959
|
+
return name;
|
|
1437
960
|
}
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
var pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), asyncRendersLookup, caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingScopes = [], rendering, scopeKeyOffset = 1e3;
|
|
961
|
+
//#endregion
|
|
962
|
+
//#region src/dom/queue.ts
|
|
1441
963
|
function queueRender(scope, signal, signalKey, value, scopeKey = scope.L) {
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
}
|
|
1450
|
-
), signalKey >= 0 && pendingRendersLookup.set(key, render));
|
|
964
|
+
let key = scopeKey * 1e3 + signalKey, render = signalKey >= 0 && pendingRendersLookup.get(key);
|
|
965
|
+
render ? render.d = value : (queuePendingRender(render = {
|
|
966
|
+
a: key,
|
|
967
|
+
b: scope,
|
|
968
|
+
c: signal,
|
|
969
|
+
d: value
|
|
970
|
+
}), signalKey >= 0 && pendingRendersLookup.set(key, render));
|
|
1451
971
|
}
|
|
1452
972
|
function queuePendingRender(render) {
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
973
|
+
let i = pendingRenders.push(render) - 1;
|
|
974
|
+
for (; i;) {
|
|
975
|
+
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
|
976
|
+
if (render.a - parent.a >= 0) break;
|
|
977
|
+
pendingRenders[i] = parent, i = parentIndex;
|
|
978
|
+
}
|
|
979
|
+
pendingRenders[i] = render;
|
|
1460
980
|
}
|
|
1461
981
|
function queueEffect(scope, fn) {
|
|
1462
|
-
|
|
982
|
+
pendingEffects.push(fn, scope);
|
|
1463
983
|
}
|
|
1464
984
|
function run() {
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
985
|
+
let effects = pendingEffects;
|
|
986
|
+
asyncRendersLookup = /* @__PURE__ */ new Map();
|
|
987
|
+
try {
|
|
988
|
+
rendering = 1, runRenders();
|
|
989
|
+
} finally {
|
|
990
|
+
pendingRendersLookup = asyncRendersLookup, asyncRendersLookup = rendering = 0, pendingRenders = [], pendingEffects = [];
|
|
991
|
+
}
|
|
992
|
+
runEffects(effects);
|
|
1473
993
|
}
|
|
1474
994
|
function prepareEffects(fn) {
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
}
|
|
1484
|
-
var runEffects = ((effects) => {
|
|
1485
|
-
for (let i = 0; i < effects.length; )
|
|
1486
|
-
effects[i++](effects[i++]);
|
|
1487
|
-
});
|
|
995
|
+
let prevRenders = pendingRenders, prevEffects = pendingEffects, prevLookup = asyncRendersLookup, preparedEffects = pendingEffects = [];
|
|
996
|
+
pendingRenders = [], asyncRendersLookup = pendingRendersLookup, pendingRendersLookup = /* @__PURE__ */ new Map();
|
|
997
|
+
try {
|
|
998
|
+
rendering = 1, fn(), runRenders();
|
|
999
|
+
} finally {
|
|
1000
|
+
rendering = 0, pendingRendersLookup = asyncRendersLookup, asyncRendersLookup = prevLookup, pendingRenders = prevRenders, pendingEffects = prevEffects;
|
|
1001
|
+
}
|
|
1002
|
+
return preparedEffects;
|
|
1003
|
+
}
|
|
1488
1004
|
function runRenders() {
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
runRender2(render);
|
|
1536
|
-
} catch (error) {
|
|
1537
|
-
renderCatch(render.j, error);
|
|
1538
|
-
}
|
|
1539
|
-
})(runRender);
|
|
1540
|
-
};
|
|
1541
|
-
|
|
1542
|
-
// src/dom/abort-signal.ts
|
|
1005
|
+
for (; pendingRenders.length;) {
|
|
1006
|
+
let render = pendingRenders[0], item = pendingRenders.pop();
|
|
1007
|
+
if (render !== item) {
|
|
1008
|
+
let i = 0, mid = pendingRenders.length >> 1, key = (pendingRenders[0] = item).a;
|
|
1009
|
+
for (; i < mid;) {
|
|
1010
|
+
let bestChild = (i << 1) + 1, right = bestChild + 1;
|
|
1011
|
+
if (right < pendingRenders.length && pendingRenders[right].a - pendingRenders[bestChild].a < 0 && (bestChild = right), pendingRenders[bestChild].a - key >= 0) break;
|
|
1012
|
+
pendingRenders[i] = pendingRenders[bestChild], i = bestChild;
|
|
1013
|
+
}
|
|
1014
|
+
pendingRenders[i] = item;
|
|
1015
|
+
}
|
|
1016
|
+
render.b.F?.I || runRender(render);
|
|
1017
|
+
}
|
|
1018
|
+
for (let scope of pendingScopes) scope.H = 0;
|
|
1019
|
+
pendingScopes = [];
|
|
1020
|
+
}
|
|
1021
|
+
function _enable_catch() {
|
|
1022
|
+
if (!catchEnabled) {
|
|
1023
|
+
catchEnabled = 1, enableBranches();
|
|
1024
|
+
let handlePendingTry = (fn, scope, branch) => {
|
|
1025
|
+
for (; branch;) {
|
|
1026
|
+
if (branch.O?.i) return (branch.J ||= []).push(fn, scope);
|
|
1027
|
+
branch = branch.N;
|
|
1028
|
+
}
|
|
1029
|
+
};
|
|
1030
|
+
runEffects = ((runEffects) => (effects, checkPending = placeholderShown.has(effects)) => {
|
|
1031
|
+
if (checkPending || caughtError.has(effects)) {
|
|
1032
|
+
let i = 0, fn, scope, branch;
|
|
1033
|
+
for (; i < effects.length;) fn = effects[i++], scope = effects[i++], branch = scope.F, !branch?.I && !(checkPending && handlePendingTry(fn, scope, branch)) && fn(scope);
|
|
1034
|
+
} else runEffects(effects);
|
|
1035
|
+
})(runEffects), runRender = ((runRender) => (render) => {
|
|
1036
|
+
try {
|
|
1037
|
+
let branch = render.b.F;
|
|
1038
|
+
for (; branch;) {
|
|
1039
|
+
if (branch.W) return asyncRendersLookup.set(render.a, render), branch.W.push(render);
|
|
1040
|
+
branch = branch.N;
|
|
1041
|
+
}
|
|
1042
|
+
runRender(render);
|
|
1043
|
+
} catch (error) {
|
|
1044
|
+
renderCatch(render.b, error);
|
|
1045
|
+
}
|
|
1046
|
+
})(runRender);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
//#endregion
|
|
1050
|
+
//#region src/dom/abort-signal.ts
|
|
1543
1051
|
function $signalReset(scope, id) {
|
|
1544
|
-
|
|
1545
|
-
|
|
1052
|
+
let ctrl = scope.A?.[id];
|
|
1053
|
+
ctrl && (queueEffect(ctrl, abort), scope.A[id] = void 0);
|
|
1546
1054
|
}
|
|
1547
1055
|
function $signal(scope, id) {
|
|
1548
|
-
|
|
1056
|
+
return scope.F && (scope.F.B ||= /* @__PURE__ */ new Set()).add(scope), ((scope.A ||= {})[id] ||= new AbortController()).signal;
|
|
1549
1057
|
}
|
|
1550
1058
|
function abort(ctrl) {
|
|
1551
|
-
|
|
1552
|
-
}
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
patchDynamicTag,
|
|
1560
|
-
queueEffect,
|
|
1561
|
-
init(warp10Noop) {
|
|
1562
|
-
_resume(SET_SCOPE_REGISTER_ID, (branch) => {
|
|
1563
|
-
classIdToBranch.set(branch.m5c, branch);
|
|
1564
|
-
}), _resume(RENDER_BODY_ID, warp10Noop);
|
|
1565
|
-
},
|
|
1566
|
-
registerRenderer(fn) {
|
|
1567
|
-
_resume(RENDERER_REGISTER_ID, fn);
|
|
1568
|
-
},
|
|
1569
|
-
isRenderer(renderer) {
|
|
1570
|
-
return renderer.k;
|
|
1571
|
-
},
|
|
1572
|
-
getStartNode(branch) {
|
|
1573
|
-
return branch.S;
|
|
1574
|
-
},
|
|
1575
|
-
setScopeNodes(branch, startNode, endNode) {
|
|
1576
|
-
branch.S = startNode, branch.K = endNode;
|
|
1577
|
-
},
|
|
1578
|
-
runComponentEffects() {
|
|
1579
|
-
this.effects && runEffects(this.effects);
|
|
1580
|
-
},
|
|
1581
|
-
runComponentDestroy() {
|
|
1582
|
-
this.scope && destroyBranch(this.scope);
|
|
1583
|
-
},
|
|
1584
|
-
resolveRegistered(value, $global) {
|
|
1585
|
-
return Array.isArray(value) && typeof value[0] == "string" ? getRegisteredWithScope(
|
|
1586
|
-
value[0],
|
|
1587
|
-
value.length === 2 && self[$global.runtimeId]?.[$global.renderId]?.s[value[1]]
|
|
1588
|
-
) : value;
|
|
1589
|
-
},
|
|
1590
|
-
createRenderer(params, clone) {
|
|
1591
|
-
let renderer = _content("", 0, 0, 0, params)();
|
|
1592
|
-
return renderer.k = (branch) => {
|
|
1593
|
-
let cloned = clone();
|
|
1594
|
-
branch.S = cloned.startNode, branch.K = cloned.endNode;
|
|
1595
|
-
}, renderer;
|
|
1596
|
-
},
|
|
1597
|
-
render(out, component, renderer, args) {
|
|
1598
|
-
let branch = component.scope, created = 0;
|
|
1599
|
-
if (!branch && (branch = classIdToBranch.get(component.id)) && (component.scope = branch, classIdToBranch.delete(component.id)), typeof args[0] == "object" && "renderBody" in args[0]) {
|
|
1600
|
-
let input = args[0], normalizedInput = args[0] = {};
|
|
1601
|
-
for (let key in input)
|
|
1602
|
-
normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
|
1603
|
-
}
|
|
1604
|
-
if (component.effects = prepareEffects(() => {
|
|
1605
|
-
branch || (created = 1, branch = component.scope = createAndSetupBranch(
|
|
1606
|
-
out.global,
|
|
1607
|
-
renderer,
|
|
1608
|
-
renderer.f,
|
|
1609
|
-
document.body
|
|
1610
|
-
)), renderer.d?.(branch, renderer._ ? args[0] : args);
|
|
1611
|
-
}), created)
|
|
1612
|
-
return toInsertNode(
|
|
1613
|
-
branch.S,
|
|
1614
|
-
branch.K
|
|
1615
|
-
);
|
|
1616
|
-
}
|
|
1617
|
-
};
|
|
1618
|
-
|
|
1619
|
-
// src/dom/template.ts
|
|
1620
|
-
var _template = (id, template, walks, setup, inputSignal) => {
|
|
1621
|
-
let renderer = _content(
|
|
1622
|
-
id,
|
|
1623
|
-
template,
|
|
1624
|
-
walks,
|
|
1625
|
-
setup,
|
|
1626
|
-
inputSignal
|
|
1627
|
-
)();
|
|
1628
|
-
return renderer.mount = mount, renderer._ = renderer, _resume(id, renderer);
|
|
1629
|
-
};
|
|
1059
|
+
ctrl.abort();
|
|
1060
|
+
}
|
|
1061
|
+
//#endregion
|
|
1062
|
+
//#region src/common/compat-meta.ts
|
|
1063
|
+
//#endregion
|
|
1064
|
+
//#region src/dom/compat.ts
|
|
1065
|
+
//#endregion
|
|
1066
|
+
//#region src/dom/template.ts
|
|
1630
1067
|
function mount(input = {}, reference, position) {
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
},
|
|
1679
|
-
destroy() {
|
|
1680
|
-
removeAndDestroyBranch(branch);
|
|
1681
|
-
}
|
|
1682
|
-
};
|
|
1683
|
-
}
|
|
1068
|
+
let branch, parentNode = reference, nextSibling = null, { $global } = input;
|
|
1069
|
+
switch ($global ? ({$global, ...input} = input, $global = {
|
|
1070
|
+
runtimeId: "M",
|
|
1071
|
+
renderId: "_",
|
|
1072
|
+
...$global
|
|
1073
|
+
}) : $global = {
|
|
1074
|
+
runtimeId: "M",
|
|
1075
|
+
renderId: "_"
|
|
1076
|
+
}, position) {
|
|
1077
|
+
case "beforebegin":
|
|
1078
|
+
parentNode = reference.parentNode, nextSibling = reference;
|
|
1079
|
+
break;
|
|
1080
|
+
case "afterbegin":
|
|
1081
|
+
nextSibling = reference.firstChild;
|
|
1082
|
+
break;
|
|
1083
|
+
case "afterend":
|
|
1084
|
+
parentNode = reference.parentNode, nextSibling = reference.nextSibling;
|
|
1085
|
+
break;
|
|
1086
|
+
}
|
|
1087
|
+
let curValue, args = this.d, effects = prepareEffects(() => {
|
|
1088
|
+
branch = createBranch($global, this, void 0, parentNode), branch.T = (newValue) => {
|
|
1089
|
+
curValue = newValue;
|
|
1090
|
+
}, this.c?.(branch), args?.(branch, input);
|
|
1091
|
+
});
|
|
1092
|
+
return insertChildNodes(parentNode, nextSibling, branch.S, branch.K), runEffects(effects), {
|
|
1093
|
+
get value() {
|
|
1094
|
+
return curValue;
|
|
1095
|
+
},
|
|
1096
|
+
set value(newValue) {
|
|
1097
|
+
_var_change(branch, newValue);
|
|
1098
|
+
},
|
|
1099
|
+
update(newInput) {
|
|
1100
|
+
args && runEffects(prepareEffects(() => {
|
|
1101
|
+
args(branch, newInput);
|
|
1102
|
+
}));
|
|
1103
|
+
},
|
|
1104
|
+
destroy() {
|
|
1105
|
+
removeAndDestroyBranch(branch);
|
|
1106
|
+
}
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
1109
|
+
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_default = _attr_input_value_default, exports._attr_textarea_value_default = _attr_input_value_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, Object.defineProperty(exports, "_dynamic_tag", {
|
|
1110
|
+
enumerable: !0,
|
|
1111
|
+
get: function() {
|
|
1112
|
+
return _dynamic_tag;
|
|
1113
|
+
}
|
|
1114
|
+
}), exports._el = _el, exports._el_read = _el_read, exports._enable_catch = _enable_catch, exports._for_closure = _for_closure, exports._for_in = _for_in, exports._for_of = _for_of, 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._lifecycle = _lifecycle, 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._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.run = run;
|