marko 6.0.0-next.3.39 → 6.0.0-next.3.40
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/debug/dom.js +799 -862
- package/dist/debug/dom.mjs +799 -862
- package/dist/dom/control-flow.d.ts +1 -2
- package/dist/dom/scope.d.ts +0 -1
- package/dist/dom.js +299 -332
- package/dist/dom.mjs +299 -332
- package/dist/translator/index.js +8 -1
- package/package.json +1 -1
package/dist/dom.mjs
CHANGED
@@ -75,26 +75,20 @@ function normalizeDynamicRenderer(value2) {
|
|
75
75
|
}
|
76
76
|
|
77
77
|
// src/dom/event.ts
|
78
|
-
var
|
78
|
+
var defaultDelegator = createDelegator();
|
79
79
|
function on(element, type, handler) {
|
80
|
-
|
81
|
-
handlersByElement || elementHandlersByEvent.set(type, handlersByElement = /* @__PURE__ */ new WeakMap()), handlersByElement.has(element) || defaultDelegator(element, type, handleDelegated), handlersByElement.set(element, handler || null);
|
80
|
+
element["$" + type] === void 0 && defaultDelegator(element, type, handleDelegated), element["$" + type] = handler || null;
|
82
81
|
}
|
83
82
|
function createDelegator() {
|
84
83
|
let kEvents = Symbol();
|
85
84
|
return function(node, type, handler) {
|
86
|
-
|
87
|
-
(root[kEvents] ||= {})[type] ||= (root.addEventListener(type, handler, !0), 1);
|
85
|
+
((node = node.getRootNode())[kEvents] ||= {})[type] ||= (node.addEventListener(type, handler, !0), 1);
|
88
86
|
};
|
89
87
|
}
|
90
88
|
function handleDelegated(ev) {
|
91
89
|
let target = !rendering && ev.target;
|
92
|
-
|
93
|
-
|
94
|
-
if (handlersByElement.get(target)?.(ev, target), ev.bubbles)
|
95
|
-
for (; (target = target.parentNode) && !ev.cancelBubble; )
|
96
|
-
handlersByElement.get(target)?.(ev, target);
|
97
|
-
}
|
90
|
+
for (; target; )
|
91
|
+
target["$" + ev.type]?.(ev, target), target = ev.bubbles && !ev.cancelBubble && target.parentNode;
|
98
92
|
}
|
99
93
|
|
100
94
|
// src/dom/resolve-cursor-position.ts
|
@@ -315,7 +309,7 @@ function controllable_select_value_effect(scope, nodeAccessor) {
|
|
315
309
|
valueChange
|
316
310
|
));
|
317
311
|
};
|
318
|
-
|
312
|
+
el._ || new MutationObserver(() => {
|
319
313
|
let value2 = scope[nodeAccessor + ":" /* ControlledValue */];
|
320
314
|
(Array.isArray(value2) ? value2.length !== el.selectedOptions.length || value2.some((value3, i) => value3 != el.selectedOptions[i].value) : el.value != value2) && onChange();
|
321
315
|
}).observe(el, {
|
@@ -373,19 +367,17 @@ function setValueAndUpdateSelection(el, value2) {
|
|
373
367
|
function setCheckboxValue(scope, nodeAccessor, type, checked, checkedChange) {
|
374
368
|
scope[nodeAccessor + ";" /* ControlledHandler */] = checkedChange, checkedChange ? (scope[nodeAccessor + "=" /* ControlledType */] = type, scope[nodeAccessor].checked = checked) : (scope[nodeAccessor + "=" /* ControlledType */] = 5 /* None */, scope[nodeAccessor].defaultChecked = checked);
|
375
369
|
}
|
376
|
-
var controllableDelegate = createDelegator()
|
370
|
+
var controllableDelegate = createDelegator();
|
377
371
|
function syncControllable(el, event, hasChanged, onChange) {
|
378
|
-
|
372
|
+
el._ || (controllableDelegate(el, event, handleChange), el.form && controllableDelegate(el.form, "reset", handleFormReset), isResuming && hasChanged(el) && queueMicrotask(onChange)), el._ = onChange;
|
379
373
|
}
|
380
374
|
function handleChange(ev) {
|
381
|
-
|
375
|
+
ev.target._?.(ev);
|
382
376
|
}
|
383
377
|
function handleFormReset(ev) {
|
384
378
|
let handlers = [];
|
385
|
-
for (let el of ev.target.elements)
|
386
|
-
|
387
|
-
handler && hasFormElementChanged(el) && handlers.push(handler);
|
388
|
-
}
|
379
|
+
for (let el of ev.target.elements)
|
380
|
+
el._ && hasFormElementChanged(el) && handlers.push(el._);
|
389
381
|
requestAnimationFrame(() => {
|
390
382
|
if (!ev.defaultPrevented)
|
391
383
|
for (let change of handlers)
|
@@ -633,10 +625,6 @@ function finishPendingScopes() {
|
|
633
625
|
scope.g = 0;
|
634
626
|
pendingScopes = [];
|
635
627
|
}
|
636
|
-
var emptyBranch = createScope({});
|
637
|
-
function getEmptyBranch(marker) {
|
638
|
-
return emptyBranch.a = emptyBranch.b = marker, emptyBranch;
|
639
|
-
}
|
640
628
|
function destroyBranch(branch) {
|
641
629
|
branch.q?.j?.delete(branch), destroyNestedBranches(branch);
|
642
630
|
}
|
@@ -658,6 +646,222 @@ function insertBranchBefore(branch, parentNode, nextSibling) {
|
|
658
646
|
);
|
659
647
|
}
|
660
648
|
|
649
|
+
// src/dom/schedule.ts
|
650
|
+
var port2 = /* @__PURE__ */ (() => {
|
651
|
+
let { port1, port2: port22 } = new MessageChannel();
|
652
|
+
return port1.onmessage = () => {
|
653
|
+
isScheduled = !1, run();
|
654
|
+
}, port22;
|
655
|
+
})(), isScheduled;
|
656
|
+
function schedule() {
|
657
|
+
isScheduled || (isScheduled = !0, queueMicrotask(flushAndWaitFrame));
|
658
|
+
}
|
659
|
+
function flushAndWaitFrame() {
|
660
|
+
run(), requestAnimationFrame(triggerMacroTask);
|
661
|
+
}
|
662
|
+
function triggerMacroTask() {
|
663
|
+
port2.postMessage(0);
|
664
|
+
}
|
665
|
+
|
666
|
+
// src/dom/signals.ts
|
667
|
+
var MARK = {}, CLEAN = {}, DIRTY = {};
|
668
|
+
function state(valueAccessor, fn, getIntersection) {
|
669
|
+
let valueSignal = value(valueAccessor, fn, getIntersection), markAccessor = valueAccessor + "#" /* Mark */, valueChangeAccessor = valueAccessor + "@" /* TagVariableChange */;
|
670
|
+
return (scope, valueOrOp, valueChange) => (rendering ? valueSignal(
|
671
|
+
scope,
|
672
|
+
valueOrOp === MARK || valueOrOp === CLEAN || valueOrOp === DIRTY || (scope[valueChangeAccessor] = valueChange) || scope[markAccessor] === void 0 ? valueOrOp : CLEAN
|
673
|
+
) : scope[valueChangeAccessor] ? scope[valueChangeAccessor](valueOrOp) : (schedule(), queueSource(scope, valueSignal, valueOrOp)), valueOrOp);
|
674
|
+
}
|
675
|
+
function value(valueAccessor, fn, getIntersection) {
|
676
|
+
let markAccessor = valueAccessor + "#" /* Mark */, intersection2;
|
677
|
+
return (scope, valueOrOp) => {
|
678
|
+
if (valueOrOp === MARK)
|
679
|
+
(scope[markAccessor] = (scope[markAccessor] ?? 0) + 1) === 1 && getIntersection && (intersection2 ||= getIntersection())(scope, MARK);
|
680
|
+
else if (valueOrOp !== DIRTY) {
|
681
|
+
let existing = scope[markAccessor] !== void 0;
|
682
|
+
(scope[markAccessor] ||= 1) === 1 && (valueOrOp === CLEAN || existing && scope[valueAccessor] === valueOrOp ? getIntersection && (intersection2 ||= getIntersection())(scope, CLEAN) : (scope[valueAccessor] = valueOrOp, fn && fn(scope, valueOrOp), getIntersection && (intersection2 ||= getIntersection())(scope, DIRTY))), scope[markAccessor]--;
|
683
|
+
}
|
684
|
+
};
|
685
|
+
}
|
686
|
+
var accessorId = 0;
|
687
|
+
function intersection(count, fn, getIntersection) {
|
688
|
+
let dirtyAccessor = "?" /* Dynamic */ + accessorId++, markAccessor = dirtyAccessor + "#" /* Mark */, intersection2;
|
689
|
+
return (scope, op) => {
|
690
|
+
op === MARK ? (scope[markAccessor] = (scope[markAccessor] ?? 0) + 1) === 1 && getIntersection && (intersection2 ||= getIntersection())(scope, MARK) : scope[markAccessor] === void 0 ? (scope[markAccessor] = count - 1, scope[dirtyAccessor] = !0) : --scope[markAccessor] === 0 ? op === DIRTY || scope[dirtyAccessor] ? (scope[dirtyAccessor] = !1, fn(scope), getIntersection && (intersection2 ||= getIntersection())(scope, DIRTY)) : getIntersection && (intersection2 ||= getIntersection())(scope, CLEAN) : scope[dirtyAccessor] ||= op === DIRTY;
|
691
|
+
};
|
692
|
+
}
|
693
|
+
function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn, getIntersection) {
|
694
|
+
let childSignal = closure(valueAccessor, fn, getIntersection), loopScopeAccessor = ownerLoopNodeAccessor + "!" /* LoopScopeArray */, loopScopeMapAccessor = ownerLoopNodeAccessor + "(" /* LoopScopeMap */, ownerSignal = (ownerScope) => {
|
695
|
+
for (let scope of ownerScope[loopScopeAccessor] || ownerScope[loopScopeMapAccessor]?.values() || [])
|
696
|
+
scope.g || queueSource(scope, childSignal);
|
697
|
+
};
|
698
|
+
return ownerSignal._ = childSignal, ownerSignal;
|
699
|
+
}
|
700
|
+
function conditionalClosure(valueAccessor, ownerConditionalNodeAccessor, branch, fn, getIntersection) {
|
701
|
+
let childSignal = closure(valueAccessor, fn, getIntersection), scopeAccessor = ownerConditionalNodeAccessor + "!" /* ConditionalScope */, branchAccessor = ownerConditionalNodeAccessor + "(" /* ConditionalRenderer */, ownerSignal = (scope) => {
|
702
|
+
let ifScope = scope[scopeAccessor];
|
703
|
+
ifScope && !ifScope.g && scope[branchAccessor] === branch && queueSource(ifScope, childSignal);
|
704
|
+
};
|
705
|
+
return ownerSignal._ = childSignal, ownerSignal;
|
706
|
+
}
|
707
|
+
function dynamicClosure(valueAccessor, fn, getIntersection, getOwnerScope) {
|
708
|
+
let subscribersAccessor = "?" /* Dynamic */ + accessorId++, childSignal = closure(
|
709
|
+
valueAccessor,
|
710
|
+
fn,
|
711
|
+
getIntersection,
|
712
|
+
getOwnerScope
|
713
|
+
), ownerSignal = (ownerScope) => {
|
714
|
+
let subscribers = ownerScope[subscribersAccessor];
|
715
|
+
if (subscribers)
|
716
|
+
for (let subscriber of subscribers)
|
717
|
+
subscriber.g || queueSource(subscriber, childSignal);
|
718
|
+
}, subscribe = (scope) => {
|
719
|
+
let owner = getOwnerScope ? getOwnerScope(scope) : scope._, subscribers = owner[subscribersAccessor] ||= /* @__PURE__ */ new Set();
|
720
|
+
subscribers.has(scope) || (subscribers.add(scope), getAbortSignal(scope, -1).addEventListener(
|
721
|
+
"abort",
|
722
|
+
() => subscribers.delete(scope)
|
723
|
+
));
|
724
|
+
};
|
725
|
+
return ownerSignal.H = subscribe, ownerSignal._ = (scope) => {
|
726
|
+
childSignal(scope), subscribe(scope);
|
727
|
+
}, ownerSignal;
|
728
|
+
}
|
729
|
+
function registerDynamicClosure(id, valueAccessor, fn, getIntersection, getOwnerScope) {
|
730
|
+
let signal = dynamicClosure(
|
731
|
+
valueAccessor,
|
732
|
+
fn,
|
733
|
+
getIntersection,
|
734
|
+
getOwnerScope
|
735
|
+
);
|
736
|
+
return register(id, signal.H), signal;
|
737
|
+
}
|
738
|
+
function closure(valueAccessor, fn, getIntersection, getOwnerScope) {
|
739
|
+
let intersection2;
|
740
|
+
return (scope, op) => {
|
741
|
+
op || fn && fn(
|
742
|
+
scope,
|
743
|
+
(getOwnerScope ? getOwnerScope(scope) : scope._)[valueAccessor]
|
744
|
+
), getIntersection && (intersection2 ||= getIntersection())(scope, op ? MARK : DIRTY);
|
745
|
+
};
|
746
|
+
}
|
747
|
+
function setTagVar(scope, childAccessor, tagVarSignal2) {
|
748
|
+
scope[childAccessor]["/" /* TagVariable */] = (valueOrOp) => tagVarSignal2(scope, valueOrOp);
|
749
|
+
}
|
750
|
+
var tagVarSignal = (scope, valueOrOp) => scope["/" /* TagVariable */]?.(valueOrOp);
|
751
|
+
function setTagVarChange(scope, changeHandler) {
|
752
|
+
scope["@" /* TagVariableChange */] = changeHandler;
|
753
|
+
}
|
754
|
+
var tagVarSignalChange = (scope, value2) => scope["@" /* TagVariableChange */]?.(value2);
|
755
|
+
var tagIdsByGlobal = /* @__PURE__ */ new WeakMap();
|
756
|
+
function nextTagId({ $global }) {
|
757
|
+
let id = tagIdsByGlobal.get($global) || 0;
|
758
|
+
return tagIdsByGlobal.set($global, id + 1), "c" + $global.runtimeId + $global.renderId + id.toString(36);
|
759
|
+
}
|
760
|
+
function inChild(childAccessor, signal) {
|
761
|
+
return (scope, valueOrOp) => {
|
762
|
+
signal(scope[childAccessor], valueOrOp);
|
763
|
+
};
|
764
|
+
}
|
765
|
+
function intersections(signals) {
|
766
|
+
return (scope, op) => {
|
767
|
+
for (let signal of signals)
|
768
|
+
signal(scope, op);
|
769
|
+
};
|
770
|
+
}
|
771
|
+
function effect(id, fn) {
|
772
|
+
return register(id, fn), (scope) => {
|
773
|
+
queueEffect(scope, fn);
|
774
|
+
};
|
775
|
+
}
|
776
|
+
|
777
|
+
// src/dom/queue.ts
|
778
|
+
var pendingRenders = [], pendingEffects = [], rendering = !1;
|
779
|
+
function queueSource(scope, signal, value2) {
|
780
|
+
let prevRendering = rendering;
|
781
|
+
rendering = !0, signal(scope, MARK), rendering = prevRendering, queueRender(scope, signal, value2);
|
782
|
+
}
|
783
|
+
function queueRender(scope, signal, value2) {
|
784
|
+
let i = pendingRenders.length, render = {
|
785
|
+
s: scope,
|
786
|
+
I: signal,
|
787
|
+
J: value2,
|
788
|
+
t: scope.c?.f || 0,
|
789
|
+
u: i
|
790
|
+
};
|
791
|
+
for (pendingRenders.push(render); i; ) {
|
792
|
+
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
793
|
+
if (comparePendingRenders(render, parent) >= 0) break;
|
794
|
+
pendingRenders[i] = parent, i = parentIndex;
|
795
|
+
}
|
796
|
+
pendingRenders[i] = render;
|
797
|
+
}
|
798
|
+
function queueEffect(scope, fn) {
|
799
|
+
pendingEffects.push(scope, fn);
|
800
|
+
}
|
801
|
+
function run() {
|
802
|
+
let effects = pendingEffects;
|
803
|
+
try {
|
804
|
+
rendering = !0, runRenders();
|
805
|
+
} finally {
|
806
|
+
pendingRenders = [], pendingEffects = [], rendering = !1;
|
807
|
+
}
|
808
|
+
runEffects(effects);
|
809
|
+
}
|
810
|
+
function prepareEffects(fn) {
|
811
|
+
let prevRenders = pendingRenders, prevEffects = pendingEffects, preparedEffects = pendingEffects = [];
|
812
|
+
pendingRenders = [];
|
813
|
+
try {
|
814
|
+
rendering = !0, fn(), runRenders();
|
815
|
+
} finally {
|
816
|
+
rendering = !1, pendingRenders = prevRenders, pendingEffects = prevEffects;
|
817
|
+
}
|
818
|
+
return preparedEffects;
|
819
|
+
}
|
820
|
+
function runEffects(effects) {
|
821
|
+
for (let i = 0; i < effects.length; i += 2 /* Total */) {
|
822
|
+
let scope = effects[i], fn = effects[i + 1];
|
823
|
+
fn(scope, scope);
|
824
|
+
}
|
825
|
+
}
|
826
|
+
function runRenders() {
|
827
|
+
for (; pendingRenders.length; ) {
|
828
|
+
let render = pendingRenders[0], next = pendingRenders.pop();
|
829
|
+
if (render !== next) {
|
830
|
+
let i = 0, mid = pendingRenders.length >> 1, item = pendingRenders[0] = next;
|
831
|
+
for (; i < mid; ) {
|
832
|
+
let bestChild = (i << 1) + 1, right = bestChild + 1;
|
833
|
+
if (right < pendingRenders.length && comparePendingRenders(
|
834
|
+
pendingRenders[right],
|
835
|
+
pendingRenders[bestChild]
|
836
|
+
) < 0 && (bestChild = right), comparePendingRenders(pendingRenders[bestChild], item) >= 0)
|
837
|
+
break;
|
838
|
+
pendingRenders[i] = pendingRenders[bestChild], i = bestChild;
|
839
|
+
}
|
840
|
+
pendingRenders[i] = item;
|
841
|
+
}
|
842
|
+
render.s.c?.F || render.I(render.s, render.J);
|
843
|
+
}
|
844
|
+
finishPendingScopes();
|
845
|
+
}
|
846
|
+
function comparePendingRenders(a, b) {
|
847
|
+
return a.t - b.t || a.u - b.u;
|
848
|
+
}
|
849
|
+
|
850
|
+
// src/dom/abort-signal.ts
|
851
|
+
function resetAbortSignal(scope, id) {
|
852
|
+
let ctrl = scope.h?.[id];
|
853
|
+
ctrl && (queueEffect(ctrl, abort), scope.h[id] = void 0);
|
854
|
+
}
|
855
|
+
function getAbortSignal(scope, id) {
|
856
|
+
return scope.c && (scope.c.G ||= /* @__PURE__ */ new Set()).add(scope), ((scope.h ||= {})[id] ||= new AbortController()).signal;
|
857
|
+
}
|
858
|
+
function abort(ctrl) {
|
859
|
+
ctrl.abort();
|
860
|
+
}
|
861
|
+
|
862
|
+
// src/common/compat-meta.ts
|
863
|
+
var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
|
864
|
+
|
661
865
|
// src/dom/reconcile.ts
|
662
866
|
var WRONG_POS = 2147483647;
|
663
867
|
function reconcile(parent, oldBranches, newBranches, afterReference) {
|
@@ -713,9 +917,7 @@ function reconcile(parent, oldBranches, newBranches, afterReference) {
|
|
713
917
|
}
|
714
918
|
}
|
715
919
|
function longestIncreasingSubsequence(a) {
|
716
|
-
let p = a.slice(), result = [];
|
717
|
-
result.push(0);
|
718
|
-
let u, v;
|
920
|
+
let p = a.slice(), result = [0], u, v;
|
719
921
|
for (let i = 0, il = a.length; i < il; ++i) {
|
720
922
|
if (a[i] === -1)
|
721
923
|
continue;
|
@@ -743,47 +945,46 @@ function trimWalkString(walkString) {
|
|
743
945
|
return walkString.slice(0, end + 1);
|
744
946
|
}
|
745
947
|
function walk(startNode, walkCodes, branch) {
|
746
|
-
walker.currentNode = startNode, walkInternal(0, walkCodes, branch)
|
948
|
+
walker.currentNode = startNode, walkInternal(0, walkCodes, branch);
|
747
949
|
}
|
748
950
|
function walkInternal(currentWalkIndex, walkCodes, scope) {
|
749
951
|
let value2, storedMultiplier = 0, currentMultiplier = 0, currentScopeIndex = 0;
|
750
|
-
for (;
|
751
|
-
if (currentMultiplier = storedMultiplier, storedMultiplier = 0, value2
|
752
|
-
|
753
|
-
else if (value2
|
754
|
-
|
755
|
-
walker.
|
756
|
-
walker.nextSibling();
|
757
|
-
} else if (value2 >= 97 /* Over */)
|
758
|
-
for (value2 = 10 /* Over */ * currentMultiplier + value2 - 97 /* Over */; value2--; )
|
759
|
-
walker.nextSibling();
|
760
|
-
else if (value2 >= 67 /* Next */)
|
761
|
-
for (value2 = 20 /* Next */ * currentMultiplier + value2 - 67 /* Next */; value2--; )
|
762
|
-
walker.nextNode();
|
763
|
-
else if (value2 === 47 /* BeginChild */)
|
764
|
-
currentWalkIndex = walkInternal(
|
765
|
-
currentWalkIndex,
|
766
|
-
walkCodes,
|
767
|
-
scope[currentScopeIndex++] = createScope(scope.$global, scope.c)
|
952
|
+
for (; currentWalkIndex < walkCodes.length; )
|
953
|
+
if (value2 = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value2 === 32 /* Get */)
|
954
|
+
scope[currentScopeIndex++] = walker.currentNode;
|
955
|
+
else if (value2 === 37 /* Replace */)
|
956
|
+
walker.currentNode.replaceWith(
|
957
|
+
walker.currentNode = scope[currentScopeIndex++] = new Text()
|
768
958
|
);
|
769
959
|
else {
|
770
960
|
if (value2 === 38 /* EndChild */)
|
771
961
|
return currentWalkIndex;
|
772
|
-
if (value2 ===
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
962
|
+
if (value2 === 47 /* BeginChild */)
|
963
|
+
currentWalkIndex = walkInternal(
|
964
|
+
currentWalkIndex,
|
965
|
+
walkCodes,
|
966
|
+
scope[currentScopeIndex++] = createScope(scope.$global, scope.c)
|
967
|
+
);
|
968
|
+
else if (value2 < 92)
|
969
|
+
for (value2 = 20 /* Next */ * currentMultiplier + value2 - 67 /* Next */; value2--; )
|
970
|
+
walker.nextNode();
|
971
|
+
else if (value2 < 107)
|
972
|
+
for (value2 = 10 /* Over */ * currentMultiplier + value2 - 97 /* Over */; value2--; )
|
973
|
+
walker.nextSibling();
|
974
|
+
else if (value2 < 117) {
|
975
|
+
for (value2 = 10 /* Out */ * currentMultiplier + value2 - 107 /* Out */; value2--; )
|
976
|
+
walker.parentNode();
|
977
|
+
walker.nextSibling();
|
978
|
+
} else
|
979
|
+
storedMultiplier = currentMultiplier * 10 /* Multiplier */ + value2 - 117 /* Multiplier */;
|
778
980
|
}
|
779
|
-
return currentWalkIndex;
|
780
981
|
}
|
781
982
|
|
782
983
|
// src/dom/renderer.ts
|
783
984
|
function createBranchScopeWithRenderer(renderer, $global, parentScope, parentNode) {
|
784
985
|
let branch = createBranch(
|
785
986
|
$global,
|
786
|
-
renderer.
|
987
|
+
renderer.x || parentScope,
|
787
988
|
parentScope
|
788
989
|
);
|
789
990
|
return initBranch(renderer, branch, parentNode), branch;
|
@@ -808,7 +1009,7 @@ function createBranch($global, ownerScope, parentScope) {
|
|
808
1009
|
}
|
809
1010
|
function initBranch(renderer, branch, parentNode) {
|
810
1011
|
let clone = renderer.k(parentNode.namespaceURI), cloneParent = clone.parentNode;
|
811
|
-
cloneParent ? (walk(cloneParent.firstChild, renderer.
|
1012
|
+
cloneParent ? (walk(cloneParent.firstChild, renderer.y, branch), branch.a = cloneParent.firstChild, branch.b = cloneParent.lastChild) : (walk(clone, renderer.y, branch), branch.a = branch.b = clone), renderer.z && queueRender(branch, renderer.z);
|
812
1013
|
}
|
813
1014
|
function dynamicTagAttrs(nodeAccessor, getContent, inputIsArgs) {
|
814
1015
|
return (scope, attrsOrOp) => {
|
@@ -820,7 +1021,7 @@ function dynamicTagAttrs(nodeAccessor, getContent, inputIsArgs) {
|
|
820
1021
|
return renderer.d?.(childScope, attrsOrOp);
|
821
1022
|
let content = getContent?.(scope);
|
822
1023
|
if (typeof renderer == "string")
|
823
|
-
|
1024
|
+
setConditionalRenderer(
|
824
1025
|
childScope,
|
825
1026
|
0,
|
826
1027
|
content,
|
@@ -843,12 +1044,12 @@ function dynamicTagAttrs(nodeAccessor, getContent, inputIsArgs) {
|
|
843
1044
|
function createRendererWithOwner(template, rawWalks, setup, getArgs) {
|
844
1045
|
let args, id = {}, walks = rawWalks ? /* @__PURE__ */ trimWalkString(rawWalks) : " ";
|
845
1046
|
return (owner) => ({
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
1047
|
+
A: id,
|
1048
|
+
B: template,
|
1049
|
+
y: walks,
|
1050
|
+
z: setup,
|
850
1051
|
k: _clone,
|
851
|
-
|
1052
|
+
x: owner,
|
852
1053
|
get d() {
|
853
1054
|
return args ||= getArgs?.();
|
854
1055
|
}
|
@@ -858,8 +1059,8 @@ function createRenderer(template, walks, setup, getArgs) {
|
|
858
1059
|
return createRendererWithOwner(template, walks, setup, getArgs)();
|
859
1060
|
}
|
860
1061
|
function _clone(ns) {
|
861
|
-
return ((cloneCache[ns] ||= {})[this.
|
862
|
-
this.
|
1062
|
+
return ((cloneCache[ns] ||= {})[this.B] ||= createCloneableHTML(
|
1063
|
+
this.B,
|
863
1064
|
ns
|
864
1065
|
))();
|
865
1066
|
}
|
@@ -873,7 +1074,7 @@ function createCloneableHTML(html2, ns) {
|
|
873
1074
|
function conditional(nodeAccessor, ...branches) {
|
874
1075
|
let branchAccessor = nodeAccessor + "(" /* ConditionalRenderer */;
|
875
1076
|
return (scope, newBranchIndexOrOp) => {
|
876
|
-
newBranchIndexOrOp !== scope[branchAccessor] && newBranchIndexOrOp !== DIRTY && newBranchIndexOrOp !== MARK && newBranchIndexOrOp !== CLEAN &&
|
1077
|
+
newBranchIndexOrOp !== scope[branchAccessor] && newBranchIndexOrOp !== DIRTY && newBranchIndexOrOp !== MARK && newBranchIndexOrOp !== CLEAN && setConditionalRenderer(
|
877
1078
|
scope,
|
878
1079
|
nodeAccessor,
|
879
1080
|
branches[scope[branchAccessor] = newBranchIndexOrOp],
|
@@ -889,40 +1090,21 @@ var dynamicTag = function(nodeAccessor, fn, getIntersection) {
|
|
889
1090
|
return (scope, newRendererOrOp) => {
|
890
1091
|
if (newRendererOrOp === DIRTY) return;
|
891
1092
|
let currentRenderer = scope[rendererAccessor], op = newRendererOrOp;
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
intersection2?.(scope, op);
|
1093
|
+
newRendererOrOp !== MARK && newRendererOrOp !== CLEAN && (isDifferentRenderer(
|
1094
|
+
currentRenderer,
|
1095
|
+
scope[rendererAccessor] = normalizeDynamicRenderer(newRendererOrOp)
|
1096
|
+
) ? (setConditionalRenderer(
|
1097
|
+
scope,
|
1098
|
+
nodeAccessor,
|
1099
|
+
scope[rendererAccessor],
|
1100
|
+
createBranchScopeWithTagNameOrRenderer
|
1101
|
+
), fn && fn(scope), op = DIRTY) : op = CLEAN), intersection2?.(scope, op);
|
902
1102
|
};
|
903
1103
|
};
|
904
1104
|
function setConditionalRenderer(scope, nodeAccessor, newRenderer, createBranch2) {
|
905
|
-
let prevBranch = scope[nodeAccessor + "!" /* ConditionalScope */] ||
|
906
|
-
|
907
|
-
|
908
|
-
scope,
|
909
|
-
prevBranch.b.parentNode
|
910
|
-
) : getEmptyBranch(scope[nodeAccessor]);
|
911
|
-
prevBranch !== newBranch && (insertBranchBefore(
|
912
|
-
newBranch,
|
913
|
-
prevBranch.b.parentNode,
|
914
|
-
prevBranch.b.nextSibling
|
915
|
-
), removeAndDestroyBranch(prevBranch), scope[nodeAccessor + "!" /* ConditionalScope */] = newRenderer && newBranch);
|
916
|
-
}
|
917
|
-
function setConditionalRendererOnlyChild(scope, nodeAccessor, newRenderer, createBranch2) {
|
918
|
-
let prevBranch = scope[nodeAccessor + "!" /* ConditionalScope */], referenceNode = scope[nodeAccessor], newBranch = newRenderer && createBranch2(newRenderer, scope.$global, scope, referenceNode);
|
919
|
-
referenceNode.textContent = "", newBranch && insertBranchBefore(newBranch, referenceNode, null), prevBranch && destroyBranch(prevBranch), scope[nodeAccessor + "!" /* ConditionalScope */] = newBranch;
|
920
|
-
}
|
921
|
-
var emptyMarkerMap = /* @__PURE__ */ new Map([
|
922
|
-
[Symbol(), /* @__PURE__ */ getEmptyBranch(0)]
|
923
|
-
]), emptyMarkerArray = [
|
924
|
-
/* @__PURE__ */ getEmptyBranch(0)
|
925
|
-
], emptyMap = /* @__PURE__ */ new Map(), emptyArray = [];
|
1105
|
+
let referenceNode = scope[nodeAccessor], prevBranch = scope[nodeAccessor + "!" /* ConditionalScope */], parentNode = referenceNode.nodeType > 1 /* Element */ ? (prevBranch?.a || referenceNode).parentNode : referenceNode, newBranch = scope[nodeAccessor + "!" /* ConditionalScope */] = newRenderer && createBranch2(newRenderer, scope.$global, scope, parentNode);
|
1106
|
+
referenceNode === parentNode ? (prevBranch && (destroyBranch(prevBranch), referenceNode.textContent = ""), newBranch && insertBranchBefore(newBranch, parentNode, null)) : prevBranch ? (newBranch ? insertBranchBefore(newBranch, parentNode, prevBranch.a) : parentNode.insertBefore(referenceNode, prevBranch.a), removeAndDestroyBranch(prevBranch)) : newBranch && (insertBranchBefore(newBranch, parentNode, referenceNode), referenceNode.remove());
|
1107
|
+
}
|
926
1108
|
function loopOf(nodeAccessor, renderer) {
|
927
1109
|
return loop(
|
928
1110
|
nodeAccessor,
|
@@ -952,24 +1134,27 @@ function loopTo(nodeAccessor, renderer) {
|
|
952
1134
|
function loop(nodeAccessor, renderer, forEach) {
|
953
1135
|
let loopScopeAccessor = nodeAccessor + "!" /* LoopScopeArray */, params = renderer.d;
|
954
1136
|
return (scope, valueOrOp) => {
|
955
|
-
if (valueOrOp
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
1137
|
+
if (valueOrOp !== DIRTY)
|
1138
|
+
if (valueOrOp === MARK || valueOrOp === CLEAN) {
|
1139
|
+
if (params)
|
1140
|
+
for (let branch of scope[loopScopeAccessor] || scope[nodeAccessor + "(" /* LoopScopeMap */]?.values() || [])
|
1141
|
+
params(branch, valueOrOp);
|
1142
|
+
} else {
|
1143
|
+
let referenceNode = scope[nodeAccessor], oldMap = scope[nodeAccessor + "(" /* LoopScopeMap */], oldArray = oldMap ? scope[nodeAccessor + "!" /* LoopScopeArray */] || [
|
1144
|
+
...oldMap.values()
|
1145
|
+
] : [], parentNode = referenceNode.nodeType > 1 /* Element */ ? referenceNode.parentNode || oldArray[0].a.parentNode : referenceNode, newMap = scope[nodeAccessor + "(" /* LoopScopeMap */] = /* @__PURE__ */ new Map(), newArray = scope[nodeAccessor + "!" /* LoopScopeArray */] = [];
|
1146
|
+
forEach(valueOrOp, (key, args) => {
|
1147
|
+
let branch = oldMap?.get(key) || createBranchScopeWithRenderer(
|
1148
|
+
renderer,
|
1149
|
+
scope.$global,
|
1150
|
+
scope,
|
1151
|
+
parentNode
|
1152
|
+
);
|
1153
|
+
params?.(branch, args), newMap.set(key, branch), newArray.push(branch);
|
1154
|
+
});
|
1155
|
+
let afterReference = null;
|
1156
|
+
referenceNode !== parentNode && (oldArray.length ? (afterReference = oldArray[oldArray.length - 1].b.nextSibling, newArray.length || parentNode.insertBefore(referenceNode, afterReference)) : newArray.length && (afterReference = referenceNode.nextSibling, referenceNode.remove())), reconcile(parentNode, oldArray, newArray, afterReference);
|
1157
|
+
}
|
973
1158
|
};
|
974
1159
|
}
|
975
1160
|
function bySecondArg(_item, index) {
|
@@ -979,226 +1164,8 @@ function byFirstArg(name) {
|
|
979
1164
|
return name;
|
980
1165
|
}
|
981
1166
|
function isDifferentRenderer(a, b) {
|
982
|
-
return a !== b && (a?.
|
983
|
-
}
|
984
|
-
|
985
|
-
// src/dom/schedule.ts
|
986
|
-
var port2 = /* @__PURE__ */ (() => {
|
987
|
-
let { port1, port2: port22 } = new MessageChannel();
|
988
|
-
return port1.onmessage = () => {
|
989
|
-
isScheduled = !1, run();
|
990
|
-
}, port22;
|
991
|
-
})(), isScheduled;
|
992
|
-
function schedule() {
|
993
|
-
isScheduled || (isScheduled = !0, queueMicrotask(flushAndWaitFrame));
|
994
|
-
}
|
995
|
-
function flushAndWaitFrame() {
|
996
|
-
run(), requestAnimationFrame(triggerMacroTask);
|
997
|
-
}
|
998
|
-
function triggerMacroTask() {
|
999
|
-
port2.postMessage(0);
|
1000
|
-
}
|
1001
|
-
|
1002
|
-
// src/dom/signals.ts
|
1003
|
-
var MARK = {}, CLEAN = {}, DIRTY = {};
|
1004
|
-
function state(valueAccessor, fn, getIntersection) {
|
1005
|
-
let valueSignal = value(valueAccessor, fn, getIntersection), markAccessor = valueAccessor + "#" /* Mark */, valueChangeAccessor = valueAccessor + "@" /* TagVariableChange */;
|
1006
|
-
return (scope, valueOrOp, valueChange) => (rendering ? valueSignal(
|
1007
|
-
scope,
|
1008
|
-
valueOrOp === MARK || valueOrOp === CLEAN || valueOrOp === DIRTY || (scope[valueChangeAccessor] = valueChange) || scope[markAccessor] === void 0 ? valueOrOp : CLEAN
|
1009
|
-
) : scope[valueChangeAccessor] ? scope[valueChangeAccessor](valueOrOp) : (schedule(), queueSource(scope, valueSignal, valueOrOp)), valueOrOp);
|
1010
|
-
}
|
1011
|
-
function value(valueAccessor, fn, getIntersection) {
|
1012
|
-
let markAccessor = valueAccessor + "#" /* Mark */, intersection2;
|
1013
|
-
return (scope, valueOrOp) => {
|
1014
|
-
if (valueOrOp === MARK)
|
1015
|
-
(scope[markAccessor] = (scope[markAccessor] ?? 0) + 1) === 1 && getIntersection && (intersection2 ||= getIntersection())(scope, MARK);
|
1016
|
-
else if (valueOrOp !== DIRTY) {
|
1017
|
-
let existing = scope[markAccessor] !== void 0;
|
1018
|
-
(scope[markAccessor] ||= 1) === 1 && (valueOrOp === CLEAN || existing && scope[valueAccessor] === valueOrOp ? getIntersection && (intersection2 ||= getIntersection())(scope, CLEAN) : (scope[valueAccessor] = valueOrOp, fn && fn(scope, valueOrOp), getIntersection && (intersection2 ||= getIntersection())(scope, DIRTY))), scope[markAccessor]--;
|
1019
|
-
}
|
1020
|
-
};
|
1021
|
-
}
|
1022
|
-
var accessorId = 0;
|
1023
|
-
function intersection(count, fn, getIntersection) {
|
1024
|
-
let dirtyAccessor = "?" /* Dynamic */ + accessorId++, markAccessor = dirtyAccessor + "#" /* Mark */, intersection2;
|
1025
|
-
return (scope, op) => {
|
1026
|
-
op === MARK ? (scope[markAccessor] = (scope[markAccessor] ?? 0) + 1) === 1 && getIntersection && (intersection2 ||= getIntersection())(scope, MARK) : scope[markAccessor] === void 0 ? (scope[markAccessor] = count - 1, scope[dirtyAccessor] = !0) : --scope[markAccessor] === 0 ? op === DIRTY || scope[dirtyAccessor] ? (scope[dirtyAccessor] = !1, fn(scope), getIntersection && (intersection2 ||= getIntersection())(scope, DIRTY)) : getIntersection && (intersection2 ||= getIntersection())(scope, CLEAN) : scope[dirtyAccessor] ||= op === DIRTY;
|
1027
|
-
};
|
1028
|
-
}
|
1029
|
-
function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn, getIntersection) {
|
1030
|
-
let childSignal = closure(valueAccessor, fn, getIntersection), loopScopeAccessor = ownerLoopNodeAccessor + "!" /* LoopScopeArray */, loopScopeMapAccessor = ownerLoopNodeAccessor + "(" /* LoopScopeMap */, ownerSignal = (ownerScope) => {
|
1031
|
-
let loopScopes = ownerScope[loopScopeAccessor] ?? ownerScope[loopScopeMapAccessor]?.values() ?? [];
|
1032
|
-
if (loopScopes !== emptyMarkerArray)
|
1033
|
-
for (let scope of loopScopes)
|
1034
|
-
scope.g || queueSource(scope, childSignal);
|
1035
|
-
};
|
1036
|
-
return ownerSignal._ = childSignal, ownerSignal;
|
1037
|
-
}
|
1038
|
-
function conditionalClosure(valueAccessor, ownerConditionalNodeAccessor, branch, fn, getIntersection) {
|
1039
|
-
let childSignal = closure(valueAccessor, fn, getIntersection), scopeAccessor = ownerConditionalNodeAccessor + "!" /* ConditionalScope */, branchAccessor = ownerConditionalNodeAccessor + "(" /* ConditionalRenderer */, ownerSignal = (scope) => {
|
1040
|
-
let ifScope = scope[scopeAccessor];
|
1041
|
-
ifScope && !ifScope.g && scope[branchAccessor] === branch && queueSource(ifScope, childSignal);
|
1042
|
-
};
|
1043
|
-
return ownerSignal._ = childSignal, ownerSignal;
|
1044
|
-
}
|
1045
|
-
function dynamicClosure(valueAccessor, fn, getIntersection, getOwnerScope) {
|
1046
|
-
let subscribersAccessor = "?" /* Dynamic */ + accessorId++, childSignal = closure(
|
1047
|
-
valueAccessor,
|
1048
|
-
fn,
|
1049
|
-
getIntersection,
|
1050
|
-
getOwnerScope
|
1051
|
-
), ownerSignal = (ownerScope) => {
|
1052
|
-
let subscribers = ownerScope[subscribersAccessor];
|
1053
|
-
if (subscribers)
|
1054
|
-
for (let subscriber of subscribers)
|
1055
|
-
subscriber.g || queueSource(subscriber, childSignal);
|
1056
|
-
}, subscribe = (scope) => {
|
1057
|
-
let owner = getOwnerScope ? getOwnerScope(scope) : scope._, subscribers = owner[subscribersAccessor] ||= /* @__PURE__ */ new Set();
|
1058
|
-
subscribers.has(scope) || (subscribers.add(scope), getAbortSignal(scope, -1).addEventListener(
|
1059
|
-
"abort",
|
1060
|
-
() => owner[subscribersAccessor].delete(scope)
|
1061
|
-
));
|
1062
|
-
};
|
1063
|
-
return ownerSignal.H = subscribe, ownerSignal._ = (scope) => {
|
1064
|
-
childSignal(scope), subscribe(scope);
|
1065
|
-
}, ownerSignal;
|
1066
|
-
}
|
1067
|
-
function registerDynamicClosure(id, valueAccessor, fn, getIntersection, getOwnerScope) {
|
1068
|
-
let signal = dynamicClosure(
|
1069
|
-
valueAccessor,
|
1070
|
-
fn,
|
1071
|
-
getIntersection,
|
1072
|
-
getOwnerScope
|
1073
|
-
);
|
1074
|
-
return register(id, signal.H), signal;
|
1075
|
-
}
|
1076
|
-
function closure(valueAccessor, fn, getIntersection, getOwnerScope) {
|
1077
|
-
let intersection2;
|
1078
|
-
return (scope, op) => {
|
1079
|
-
op || fn && fn(
|
1080
|
-
scope,
|
1081
|
-
(getOwnerScope ? getOwnerScope(scope) : scope._)[valueAccessor]
|
1082
|
-
), getIntersection && (intersection2 ||= getIntersection())(scope, op ? MARK : DIRTY);
|
1083
|
-
};
|
1084
|
-
}
|
1085
|
-
function setTagVar(scope, childAccessor, tagVarSignal2) {
|
1086
|
-
scope[childAccessor]["/" /* TagVariable */] = (valueOrOp) => tagVarSignal2(scope, valueOrOp);
|
1167
|
+
return a !== b && (a?.A || 0) !== b?.A;
|
1087
1168
|
}
|
1088
|
-
var tagVarSignal = (scope, valueOrOp) => scope["/" /* TagVariable */]?.(valueOrOp);
|
1089
|
-
function setTagVarChange(scope, changeHandler) {
|
1090
|
-
scope["@" /* TagVariableChange */] = changeHandler;
|
1091
|
-
}
|
1092
|
-
var tagVarSignalChange = (scope, value2) => scope["@" /* TagVariableChange */]?.(value2);
|
1093
|
-
var tagIdsByGlobal = /* @__PURE__ */ new WeakMap();
|
1094
|
-
function nextTagId({ $global }) {
|
1095
|
-
let id = tagIdsByGlobal.get($global) || 0;
|
1096
|
-
return tagIdsByGlobal.set($global, id + 1), "c" + $global.runtimeId + $global.renderId + id.toString(36);
|
1097
|
-
}
|
1098
|
-
function inChild(childAccessor, signal) {
|
1099
|
-
return (scope, valueOrOp) => {
|
1100
|
-
signal(scope[childAccessor], valueOrOp);
|
1101
|
-
};
|
1102
|
-
}
|
1103
|
-
function intersections(signals) {
|
1104
|
-
return (scope, op) => {
|
1105
|
-
for (let signal of signals)
|
1106
|
-
signal(scope, op);
|
1107
|
-
};
|
1108
|
-
}
|
1109
|
-
function effect(id, fn) {
|
1110
|
-
return register(id, fn), (scope) => {
|
1111
|
-
queueEffect(scope, fn);
|
1112
|
-
};
|
1113
|
-
}
|
1114
|
-
|
1115
|
-
// src/dom/queue.ts
|
1116
|
-
var pendingRenders = [], pendingEffects = [], rendering = !1;
|
1117
|
-
function queueSource(scope, signal, value2) {
|
1118
|
-
let prevRendering = rendering;
|
1119
|
-
rendering = !0, signal(scope, MARK), rendering = prevRendering, queueRender(scope, signal, value2);
|
1120
|
-
}
|
1121
|
-
function queueRender(scope, signal, value2) {
|
1122
|
-
let i = pendingRenders.length, render = {
|
1123
|
-
z: scope,
|
1124
|
-
I: signal,
|
1125
|
-
J: value2,
|
1126
|
-
A: scope.c?.f || 0,
|
1127
|
-
B: i
|
1128
|
-
};
|
1129
|
-
for (pendingRenders.push(render); i; ) {
|
1130
|
-
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
1131
|
-
if (comparePendingRenders(render, parent) >= 0) break;
|
1132
|
-
pendingRenders[i] = parent, i = parentIndex;
|
1133
|
-
}
|
1134
|
-
pendingRenders[i] = render;
|
1135
|
-
}
|
1136
|
-
function queueEffect(scope, fn) {
|
1137
|
-
pendingEffects.push(scope, fn);
|
1138
|
-
}
|
1139
|
-
function run() {
|
1140
|
-
let effects = pendingEffects;
|
1141
|
-
try {
|
1142
|
-
rendering = !0, runRenders();
|
1143
|
-
} finally {
|
1144
|
-
pendingRenders = [], pendingEffects = [], rendering = !1;
|
1145
|
-
}
|
1146
|
-
runEffects(effects);
|
1147
|
-
}
|
1148
|
-
function prepareEffects(fn) {
|
1149
|
-
let prevRenders = pendingRenders, prevEffects = pendingEffects, preparedEffects = pendingEffects = [];
|
1150
|
-
pendingRenders = [];
|
1151
|
-
try {
|
1152
|
-
rendering = !0, fn(), runRenders();
|
1153
|
-
} finally {
|
1154
|
-
rendering = !1, pendingRenders = prevRenders, pendingEffects = prevEffects;
|
1155
|
-
}
|
1156
|
-
return preparedEffects;
|
1157
|
-
}
|
1158
|
-
function runEffects(effects) {
|
1159
|
-
for (let i = 0; i < effects.length; i += 2 /* Total */) {
|
1160
|
-
let scope = effects[i], fn = effects[i + 1];
|
1161
|
-
fn(scope, scope);
|
1162
|
-
}
|
1163
|
-
}
|
1164
|
-
function runRenders() {
|
1165
|
-
for (; pendingRenders.length; ) {
|
1166
|
-
let render = pendingRenders[0], next = pendingRenders.pop();
|
1167
|
-
if (render !== next) {
|
1168
|
-
let i = 0, mid = pendingRenders.length >> 1, item = pendingRenders[0] = next;
|
1169
|
-
for (; i < mid; ) {
|
1170
|
-
let bestChild = (i << 1) + 1, right = bestChild + 1;
|
1171
|
-
if (right < pendingRenders.length && comparePendingRenders(
|
1172
|
-
pendingRenders[right],
|
1173
|
-
pendingRenders[bestChild]
|
1174
|
-
) < 0 && (bestChild = right), comparePendingRenders(pendingRenders[bestChild], item) >= 0)
|
1175
|
-
break;
|
1176
|
-
pendingRenders[i] = pendingRenders[bestChild], i = bestChild;
|
1177
|
-
}
|
1178
|
-
pendingRenders[i] = item;
|
1179
|
-
}
|
1180
|
-
render.z.c?.F || render.I(render.z, render.J);
|
1181
|
-
}
|
1182
|
-
finishPendingScopes();
|
1183
|
-
}
|
1184
|
-
function comparePendingRenders(a, b) {
|
1185
|
-
return a.A - b.A || a.B - b.B;
|
1186
|
-
}
|
1187
|
-
|
1188
|
-
// src/dom/abort-signal.ts
|
1189
|
-
function resetAbortSignal(scope, id) {
|
1190
|
-
let ctrl = scope.h?.[id];
|
1191
|
-
ctrl && (queueEffect(ctrl, abort), scope.h[id] = void 0);
|
1192
|
-
}
|
1193
|
-
function getAbortSignal(scope, id) {
|
1194
|
-
return scope.c && (scope.c.G ||= /* @__PURE__ */ new Set()).add(scope), ((scope.h ||= {})[id] ||= new AbortController()).signal;
|
1195
|
-
}
|
1196
|
-
function abort(ctrl) {
|
1197
|
-
ctrl.abort();
|
1198
|
-
}
|
1199
|
-
|
1200
|
-
// src/common/compat-meta.ts
|
1201
|
-
var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
|
1202
1169
|
|
1203
1170
|
// src/dom/compat.ts
|
1204
1171
|
var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
@@ -1253,7 +1220,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
1253
1220
|
normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
1254
1221
|
}
|
1255
1222
|
if (component.effects = prepareEffects(() => {
|
1256
|
-
branch ? (applyArgs(branch, MARK), existing = !0) : (branch = component.scope = createScope(out.global), branch._ = renderer.
|
1223
|
+
branch ? (applyArgs(branch, MARK), existing = !0) : (branch = component.scope = createScope(out.global), branch._ = renderer.x, initBranch(renderer, branch, document.body)), applyArgs(branch, args);
|
1257
1224
|
}), !existing)
|
1258
1225
|
return toInsertNode(branch.a, branch.b);
|
1259
1226
|
}
|