@solidjs/signals 2.0.0-beta.13 → 2.0.0-beta.14
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/README.md +2 -3
- package/dist/dev.js +81 -23
- package/dist/node.cjs +712 -665
- package/dist/prod.js +481 -434
- package/dist/types/core/core.d.ts +4 -8
- package/dist/types/store/index.d.ts +1 -1
- package/dist/types/store/store.d.ts +6 -2
- package/dist/types-cjs/core/core.d.cts +4 -8
- package/dist/types-cjs/store/index.d.cts +1 -1
- package/dist/types-cjs/store/store.d.cts +6 -2
- package/package.json +1 -1
package/dist/prod.js
CHANGED
|
@@ -75,39 +75,39 @@ function actualInsertIntoHeap(e, t) {
|
|
|
75
75
|
e.S = t;
|
|
76
76
|
r.S = e;
|
|
77
77
|
}
|
|
78
|
-
if (i > t.
|
|
78
|
+
if (i > t._) t._ = i;
|
|
79
79
|
}
|
|
80
80
|
function insertIntoHeap(e, t) {
|
|
81
|
-
let n = e.
|
|
81
|
+
let n = e.O;
|
|
82
82
|
if (n & (REACTIVE_IN_HEAP | REACTIVE_RECOMPUTING_DEPS | REACTIVE_MANUAL_WRITE)) return;
|
|
83
83
|
if (n & REACTIVE_CHECK) {
|
|
84
|
-
e.
|
|
85
|
-
} else e.
|
|
84
|
+
e.O = (n & -4) | REACTIVE_DIRTY | REACTIVE_IN_HEAP;
|
|
85
|
+
} else e.O = n | REACTIVE_IN_HEAP;
|
|
86
86
|
if (!(n & REACTIVE_IN_HEAP_HEIGHT)) actualInsertIntoHeap(e, t);
|
|
87
87
|
}
|
|
88
88
|
function insertIntoHeapHeight(e, t) {
|
|
89
|
-
let n = e.
|
|
89
|
+
let n = e.O;
|
|
90
90
|
if (
|
|
91
91
|
n &
|
|
92
92
|
(REACTIVE_IN_HEAP | REACTIVE_RECOMPUTING_DEPS | REACTIVE_IN_HEAP_HEIGHT | REACTIVE_MANUAL_WRITE)
|
|
93
93
|
)
|
|
94
94
|
return;
|
|
95
|
-
e.
|
|
95
|
+
e.O = n | REACTIVE_IN_HEAP_HEIGHT;
|
|
96
96
|
actualInsertIntoHeap(e, t);
|
|
97
97
|
}
|
|
98
98
|
function deleteFromHeap(e, t) {
|
|
99
|
-
const n = e.
|
|
99
|
+
const n = e.O;
|
|
100
100
|
if (!(n & (REACTIVE_IN_HEAP | REACTIVE_IN_HEAP_HEIGHT))) return;
|
|
101
|
-
e.
|
|
101
|
+
e.O = n & -25;
|
|
102
102
|
const i = e.o;
|
|
103
103
|
if (e.S === e) t.l[i] = undefined;
|
|
104
104
|
else {
|
|
105
105
|
const n = e.T;
|
|
106
106
|
const r = t.l[i];
|
|
107
|
-
const
|
|
107
|
+
const o = n ?? r;
|
|
108
108
|
if (e === r) t.l[i] = n;
|
|
109
109
|
else e.S.T = n;
|
|
110
|
-
|
|
110
|
+
o.S = e.S;
|
|
111
111
|
}
|
|
112
112
|
e.S = e;
|
|
113
113
|
e.T = undefined;
|
|
@@ -115,16 +115,16 @@ function deleteFromHeap(e, t) {
|
|
|
115
115
|
function markHeap(e) {
|
|
116
116
|
if (e.R) return;
|
|
117
117
|
e.R = true;
|
|
118
|
-
for (let t = 0; t <= e.
|
|
118
|
+
for (let t = 0; t <= e._; t++) {
|
|
119
119
|
for (let n = e.l[t]; n !== undefined; n = n.T) {
|
|
120
|
-
if (n.
|
|
120
|
+
if (n.O & REACTIVE_IN_HEAP) markNode(n);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
function markNode(e, t = REACTIVE_DIRTY) {
|
|
125
|
-
const n = e.
|
|
125
|
+
const n = e.O;
|
|
126
126
|
if ((n & (REACTIVE_CHECK | REACTIVE_DIRTY)) >= t) return;
|
|
127
|
-
e.
|
|
127
|
+
e.O = (n & -4) | t;
|
|
128
128
|
for (let t = e.I; t !== null; t = t.p) {
|
|
129
129
|
markNode(t.h, REACTIVE_CHECK);
|
|
130
130
|
}
|
|
@@ -138,15 +138,15 @@ function markNode(e, t = REACTIVE_DIRTY) {
|
|
|
138
138
|
}
|
|
139
139
|
function runHeap(e, t) {
|
|
140
140
|
e.R = false;
|
|
141
|
-
for (e.C = 0; e.C <= e.
|
|
141
|
+
for (e.C = 0; e.C <= e._; e.C++) {
|
|
142
142
|
let n = e.l[e.C];
|
|
143
143
|
while (n !== undefined) {
|
|
144
|
-
if (n.
|
|
144
|
+
if (n.O & REACTIVE_IN_HEAP) t(n);
|
|
145
145
|
else adjustHeight(n, e);
|
|
146
146
|
n = e.l[e.C];
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
e.
|
|
149
|
+
e._ = 0;
|
|
150
150
|
}
|
|
151
151
|
function adjustHeight(e, t) {
|
|
152
152
|
deleteFromHeap(e, t);
|
|
@@ -228,8 +228,8 @@ function assignOrMergeLane(e, t) {
|
|
|
228
228
|
e.G = t;
|
|
229
229
|
}
|
|
230
230
|
const transitions = new Set();
|
|
231
|
-
const dirtyQueue = { l: new Array(2e3).fill(undefined), R: false, C: 0,
|
|
232
|
-
const zombieQueue = { l: new Array(2e3).fill(undefined), R: false, C: 0,
|
|
231
|
+
const dirtyQueue = { l: new Array(2e3).fill(undefined), R: false, C: 0, _: 0 };
|
|
232
|
+
const zombieQueue = { l: new Array(2e3).fill(undefined), R: false, C: 0, _: 0 };
|
|
233
233
|
let clock = 0;
|
|
234
234
|
let activeTransition = null;
|
|
235
235
|
let scheduled = false;
|
|
@@ -288,7 +288,7 @@ function queueStashedOptimisticEffects(e) {
|
|
|
288
288
|
}
|
|
289
289
|
continue;
|
|
290
290
|
}
|
|
291
|
-
const n = e.
|
|
291
|
+
const n = e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
|
|
292
292
|
if (n.C > e.o) n.C = e.o;
|
|
293
293
|
insertIntoHeap(e, n);
|
|
294
294
|
}
|
|
@@ -302,12 +302,12 @@ function mergeTransitionState(e, t) {
|
|
|
302
302
|
for (const n of activeLanes) if (n.M === t) n.M = e;
|
|
303
303
|
e.Z.push(...t.Z);
|
|
304
304
|
for (const n of t.q) e.q.add(n);
|
|
305
|
-
for (const [n, i] of t.
|
|
306
|
-
let t = e.
|
|
307
|
-
if (!t) e.
|
|
305
|
+
for (const [n, i] of t.oe) {
|
|
306
|
+
let t = e.oe.get(n);
|
|
307
|
+
if (!t) e.oe.set(n, (t = new Set()));
|
|
308
308
|
for (const e of i) t.add(e);
|
|
309
309
|
}
|
|
310
|
-
for (const n of t.
|
|
310
|
+
for (const n of t.se) e.se.add(n);
|
|
311
311
|
}
|
|
312
312
|
function resolveOptimisticNodes(e) {
|
|
313
313
|
for (let t = 0; t < e.length; t++) {
|
|
@@ -434,16 +434,16 @@ class GlobalQueue extends Queue {
|
|
|
434
434
|
this.q = new Set();
|
|
435
435
|
runLaneEffects(EFFECT_RENDER);
|
|
436
436
|
runLaneEffects(EFFECT_USER);
|
|
437
|
-
this.stashQueues(e.
|
|
437
|
+
this.stashQueues(e._e);
|
|
438
438
|
clock++;
|
|
439
|
-
scheduled = dirtyQueue.
|
|
439
|
+
scheduled = dirtyQueue._ >= dirtyQueue.C;
|
|
440
440
|
reassignPendingTransition(e.fe);
|
|
441
441
|
activeTransition = null;
|
|
442
|
-
if (!e.re.length && !e.
|
|
442
|
+
if (!e.re.length && !e.oe.size && e.Z.length) {
|
|
443
443
|
stashedOptimisticReads = new Set();
|
|
444
444
|
for (let t = 0; t < e.Z.length; t++) {
|
|
445
445
|
const n = e.Z[t];
|
|
446
|
-
if (n.L || n.
|
|
446
|
+
if (n.L || n.Oe & CONFIG_OWNED_WRITE) continue;
|
|
447
447
|
stashedOptimisticReads.add(n);
|
|
448
448
|
queueStashedOptimisticEffects(n);
|
|
449
449
|
}
|
|
@@ -456,7 +456,7 @@ class GlobalQueue extends Queue {
|
|
|
456
456
|
return;
|
|
457
457
|
}
|
|
458
458
|
this.fe !== activeTransition.fe && this.fe.push(...activeTransition.fe);
|
|
459
|
-
this.restoreQueues(activeTransition.
|
|
459
|
+
this.restoreQueues(activeTransition._e);
|
|
460
460
|
transitions.delete(activeTransition);
|
|
461
461
|
const t = activeTransition;
|
|
462
462
|
activeTransition = null;
|
|
@@ -465,7 +465,7 @@ class GlobalQueue extends Queue {
|
|
|
465
465
|
} else {
|
|
466
466
|
if (canUseSimpleSyncFlush(this)) {
|
|
467
467
|
commitPendingNodes();
|
|
468
|
-
if (dirtyQueue.
|
|
468
|
+
if (dirtyQueue._ >= dirtyQueue.C) {
|
|
469
469
|
runHeap(dirtyQueue, GlobalQueue.Ee);
|
|
470
470
|
commitPendingNodes();
|
|
471
471
|
}
|
|
@@ -475,7 +475,7 @@ class GlobalQueue extends Queue {
|
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
clock++;
|
|
478
|
-
scheduled = dirtyQueue.
|
|
478
|
+
scheduled = dirtyQueue._ >= dirtyQueue.C;
|
|
479
479
|
activeLanes.size && runLaneEffects(EFFECT_RENDER);
|
|
480
480
|
this.run(EFFECT_RENDER);
|
|
481
481
|
activeLanes.size && runLaneEffects(EFFECT_USER);
|
|
@@ -491,8 +491,8 @@ class GlobalQueue extends Queue {
|
|
|
491
491
|
const t = i !== undefined ? i : e.Re;
|
|
492
492
|
if (activeTransition && t) {
|
|
493
493
|
const n = t.source;
|
|
494
|
-
let i = activeTransition.
|
|
495
|
-
if (!i) activeTransition.
|
|
494
|
+
let i = activeTransition.oe.get(n);
|
|
495
|
+
if (!i) activeTransition.oe.set(n, (i = new Set()));
|
|
496
496
|
const r = i.size;
|
|
497
497
|
i.add(e);
|
|
498
498
|
if (i.size !== r) schedule();
|
|
@@ -510,13 +510,13 @@ class GlobalQueue extends Queue {
|
|
|
510
510
|
activeTransition = e ?? {
|
|
511
511
|
Ie: clock,
|
|
512
512
|
fe: [],
|
|
513
|
-
|
|
513
|
+
oe: new Map(),
|
|
514
514
|
Z: [],
|
|
515
515
|
q: new Set(),
|
|
516
516
|
re: [],
|
|
517
|
-
|
|
517
|
+
_e: { le: [[], []], Y: [] },
|
|
518
518
|
ie: false,
|
|
519
|
-
|
|
519
|
+
se: new Set()
|
|
520
520
|
};
|
|
521
521
|
} else if (e) {
|
|
522
522
|
const t = activeTransition;
|
|
@@ -575,15 +575,15 @@ function insertSubs(e, t = false) {
|
|
|
575
575
|
const n = e.G || currentOptimisticLane;
|
|
576
576
|
const i = e.pe !== undefined;
|
|
577
577
|
for (let r = e.I; r !== null; r = r.p) {
|
|
578
|
-
if (i && r.h.
|
|
579
|
-
r.h.
|
|
578
|
+
if (i && r.h.Oe & CONFIG_IN_SNAPSHOT_SCOPE) {
|
|
579
|
+
r.h.O |= REACTIVE_SNAPSHOT_STALE;
|
|
580
580
|
continue;
|
|
581
581
|
}
|
|
582
582
|
if (t && n) {
|
|
583
|
-
r.h.
|
|
583
|
+
r.h.O |= REACTIVE_OPTIMISTIC_DIRTY;
|
|
584
584
|
assignOrMergeLane(r.h, n);
|
|
585
585
|
} else if (t) {
|
|
586
|
-
r.h.
|
|
586
|
+
r.h.O |= REACTIVE_OPTIMISTIC_DIRTY;
|
|
587
587
|
r.h.G = undefined;
|
|
588
588
|
}
|
|
589
589
|
const e = r.h;
|
|
@@ -594,9 +594,9 @@ function insertSubs(e, t = false) {
|
|
|
594
594
|
}
|
|
595
595
|
continue;
|
|
596
596
|
}
|
|
597
|
-
const
|
|
598
|
-
if (
|
|
599
|
-
insertIntoHeap(r.h,
|
|
597
|
+
const o = r.h.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
|
|
598
|
+
if (o.C > r.h.o) o.C = r.h.o;
|
|
599
|
+
insertIntoHeap(r.h, o);
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
602
|
function commitPendingNode(e) {
|
|
@@ -613,7 +613,7 @@ function commitPendingNode(e) {
|
|
|
613
613
|
e.B = NOT_PENDING;
|
|
614
614
|
if (e.J && e.J !== EFFECT_TRACKED) e.ee = true;
|
|
615
615
|
}
|
|
616
|
-
t.
|
|
616
|
+
t.O &= ~REACTIVE_MANUAL_WRITE;
|
|
617
617
|
if (!(t.he & STATUS_PENDING)) t.he &= ~STATUS_UNINITIALIZED;
|
|
618
618
|
if (t.Ne !== null || t.Ae !== null) GlobalQueue.Se(t, false, true);
|
|
619
619
|
}
|
|
@@ -632,14 +632,14 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
632
632
|
const n = !t;
|
|
633
633
|
if (n) commitPendingNodes();
|
|
634
634
|
if (!t && globalQueue.Y.length) checkBoundaryChildren(globalQueue);
|
|
635
|
-
const i = dirtyQueue.
|
|
635
|
+
const i = dirtyQueue._ >= dirtyQueue.C;
|
|
636
636
|
if (i) runHeap(dirtyQueue, GlobalQueue.Ee);
|
|
637
637
|
if (n) {
|
|
638
638
|
if (i) commitPendingNodes();
|
|
639
639
|
resolveOptimisticNodes(e ? e.Z : globalQueue.Z);
|
|
640
|
-
if (e && e.
|
|
641
|
-
for (const t of e.
|
|
642
|
-
if (t.
|
|
640
|
+
if (e && e.se.size) {
|
|
641
|
+
for (const t of e.se) {
|
|
642
|
+
if (t.O & REACTIVE_DISPOSED) continue;
|
|
643
643
|
if (t.J === EFFECT_TRACKED) {
|
|
644
644
|
if (!t.ee) {
|
|
645
645
|
t.ee = true;
|
|
@@ -647,11 +647,11 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
647
647
|
}
|
|
648
648
|
continue;
|
|
649
649
|
}
|
|
650
|
-
const e = t.
|
|
650
|
+
const e = t.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
|
|
651
651
|
if (e.C > t.o) e.C = t.o;
|
|
652
652
|
insertIntoHeap(t, e);
|
|
653
653
|
}
|
|
654
|
-
e.
|
|
654
|
+
e.se.clear();
|
|
655
655
|
}
|
|
656
656
|
const t = e ? e.q : globalQueue.q;
|
|
657
657
|
if (GlobalQueue.de && t.size) {
|
|
@@ -702,7 +702,7 @@ function runQueue(e, t) {
|
|
|
702
702
|
for (let n = 0; n < e.length; n++) e[n](t);
|
|
703
703
|
}
|
|
704
704
|
function reporterBlocksSource(e, t) {
|
|
705
|
-
if (e.
|
|
705
|
+
if (e.O & (REACTIVE_ZOMBIE | REACTIVE_DISPOSED)) return false;
|
|
706
706
|
if (e.Ce === t || e.Pe?.has(t)) return true;
|
|
707
707
|
for (let n = e.P; n; n = n.D) {
|
|
708
708
|
let e = n.m;
|
|
@@ -717,7 +717,7 @@ function transitionComplete(e) {
|
|
|
717
717
|
if (e.ie) return true;
|
|
718
718
|
if (e.re.length) return false;
|
|
719
719
|
let t = true;
|
|
720
|
-
for (const [n, i] of e.
|
|
720
|
+
for (const [n, i] of e.oe) {
|
|
721
721
|
let r = false;
|
|
722
722
|
for (const e of i) {
|
|
723
723
|
if (reporterBlocksSource(e, n)) {
|
|
@@ -726,7 +726,7 @@ function transitionComplete(e) {
|
|
|
726
726
|
}
|
|
727
727
|
i.delete(e);
|
|
728
728
|
}
|
|
729
|
-
if (!r) e.
|
|
729
|
+
if (!r) e.oe.delete(n);
|
|
730
730
|
else if (n.he & STATUS_PENDING && n.Re?.source === n) {
|
|
731
731
|
t = false;
|
|
732
732
|
break;
|
|
@@ -770,8 +770,8 @@ const PENDING_OWNER = {};
|
|
|
770
770
|
function markDisposal(e) {
|
|
771
771
|
let t = e.ge;
|
|
772
772
|
while (t) {
|
|
773
|
-
t.
|
|
774
|
-
if (t.
|
|
773
|
+
t.O |= REACTIVE_ZOMBIE;
|
|
774
|
+
if (t.O & REACTIVE_IN_HEAP) {
|
|
775
775
|
deleteFromHeap(t, dirtyQueue);
|
|
776
776
|
insertIntoHeap(t, zombieQueue);
|
|
777
777
|
}
|
|
@@ -789,16 +789,16 @@ function dispose(e) {
|
|
|
789
789
|
disposeChildren(e, true);
|
|
790
790
|
}
|
|
791
791
|
function disposeChildren(e, t = false, n) {
|
|
792
|
-
const i = e.
|
|
792
|
+
const i = e.O;
|
|
793
793
|
if (i & REACTIVE_DISPOSED) return;
|
|
794
|
-
if (t) e.
|
|
794
|
+
if (t) e.O = i | REACTIVE_DISPOSED;
|
|
795
795
|
if (t && e.L) e.ve = null;
|
|
796
796
|
let r = n ? e.Ne : e.ge;
|
|
797
797
|
while (r) {
|
|
798
798
|
const e = r.De;
|
|
799
799
|
if (r.P) {
|
|
800
800
|
const e = r;
|
|
801
|
-
deleteFromHeap(e, e.
|
|
801
|
+
deleteFromHeap(e, e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
802
802
|
let t = e.P;
|
|
803
803
|
do {
|
|
804
804
|
t = unlinkSubs(t);
|
|
@@ -815,7 +815,7 @@ function disposeChildren(e, t = false, n) {
|
|
|
815
815
|
e.ge = null;
|
|
816
816
|
e.me = 0;
|
|
817
817
|
}
|
|
818
|
-
if (t && !n && !(i & REACTIVE_ZOMBIE) && e.i !== null && !(e.i.
|
|
818
|
+
if (t && !n && !(i & REACTIVE_ZOMBIE) && e.i !== null && !(e.i.O & REACTIVE_DISPOSED)) {
|
|
819
819
|
const t = e.we;
|
|
820
820
|
const n = e.De;
|
|
821
821
|
if (t !== null) t.De = n;
|
|
@@ -840,7 +840,7 @@ function runDisposal(e, t) {
|
|
|
840
840
|
}
|
|
841
841
|
function childId(e, t) {
|
|
842
842
|
let n = e;
|
|
843
|
-
while (n.
|
|
843
|
+
while (n.Oe & CONFIG_TRANSPARENT && n.i) n = n.i;
|
|
844
844
|
if (n.id != null) return formatId(n.id, t ? n.me++ : n.me);
|
|
845
845
|
throw new Error("Cannot get child id from owner without an id");
|
|
846
846
|
}
|
|
@@ -870,7 +870,7 @@ function cleanup(e) {
|
|
|
870
870
|
return e;
|
|
871
871
|
}
|
|
872
872
|
function isDisposed(e) {
|
|
873
|
-
return !!(e.
|
|
873
|
+
return !!(e.O & (REACTIVE_DISPOSED | REACTIVE_ZOMBIE));
|
|
874
874
|
}
|
|
875
875
|
function disposeRootSelf(e = true) {
|
|
876
876
|
disposeChildren(this, e);
|
|
@@ -880,7 +880,7 @@ function createOwner(e) {
|
|
|
880
880
|
const n = e?.transparent ?? false;
|
|
881
881
|
const i = {
|
|
882
882
|
id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
|
|
883
|
-
|
|
883
|
+
Oe: n ? CONFIG_TRANSPARENT : 0,
|
|
884
884
|
t: true,
|
|
885
885
|
u: t?.t ? t.u : t,
|
|
886
886
|
ge: null,
|
|
@@ -924,7 +924,7 @@ function unlinkSubs(e) {
|
|
|
924
924
|
if (i === null) {
|
|
925
925
|
t.X?.();
|
|
926
926
|
const e = t;
|
|
927
|
-
e.L && e.
|
|
927
|
+
e.L && e.Oe & CONFIG_AUTO_DISPOSE && !(e.O & REACTIVE_ZOMBIE) && unobserved(e);
|
|
928
928
|
}
|
|
929
929
|
}
|
|
930
930
|
return n;
|
|
@@ -941,7 +941,7 @@ function trimStaleDeps(e) {
|
|
|
941
941
|
}
|
|
942
942
|
}
|
|
943
943
|
function unobserved(e) {
|
|
944
|
-
deleteFromHeap(e, e.
|
|
944
|
+
deleteFromHeap(e, e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
945
945
|
let t = e.P;
|
|
946
946
|
while (t !== null) {
|
|
947
947
|
t = unlinkSubs(t);
|
|
@@ -954,7 +954,7 @@ function link(e, t) {
|
|
|
954
954
|
const n = t.ye;
|
|
955
955
|
if (n !== null && n.m === e) return;
|
|
956
956
|
let i = null;
|
|
957
|
-
const r = t.
|
|
957
|
+
const r = t.O & REACTIVE_RECOMPUTING_DEPS;
|
|
958
958
|
if (r) {
|
|
959
959
|
i = n !== null ? n.D : t.P;
|
|
960
960
|
if (i !== null && i.m === e) {
|
|
@@ -962,13 +962,13 @@ function link(e, t) {
|
|
|
962
962
|
return;
|
|
963
963
|
}
|
|
964
964
|
}
|
|
965
|
-
const
|
|
966
|
-
if (
|
|
967
|
-
const
|
|
968
|
-
if (n !== null) n.D =
|
|
969
|
-
else t.P =
|
|
970
|
-
if (
|
|
971
|
-
else e.I =
|
|
965
|
+
const o = e.Ue;
|
|
966
|
+
if (o !== null && o.h === t && (!r || isValidLink(o, t))) return;
|
|
967
|
+
const s = (t.ye = e.Ue = { m: e, h: t, D: i, Le: o, p: null });
|
|
968
|
+
if (n !== null) n.D = s;
|
|
969
|
+
else t.P = s;
|
|
970
|
+
if (o !== null) o.p = s;
|
|
971
|
+
else e.I = s;
|
|
972
972
|
}
|
|
973
973
|
function isValidLink(e, t) {
|
|
974
974
|
const n = t.ye;
|
|
@@ -1059,7 +1059,7 @@ function settlePendingSource(e) {
|
|
|
1059
1059
|
e.te.enqueue(EFFECT_USER, e.ne);
|
|
1060
1060
|
}
|
|
1061
1061
|
} else {
|
|
1062
|
-
const e = i.
|
|
1062
|
+
const e = i.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
|
|
1063
1063
|
if (e.C > i.o) e.C = i.o;
|
|
1064
1064
|
insertIntoHeap(i, e);
|
|
1065
1065
|
}
|
|
@@ -1086,7 +1086,7 @@ function handleAsync(e, t, n) {
|
|
|
1086
1086
|
return t;
|
|
1087
1087
|
}
|
|
1088
1088
|
e.ve = t;
|
|
1089
|
-
let
|
|
1089
|
+
let o;
|
|
1090
1090
|
const handleError = n => {
|
|
1091
1091
|
if (e.ve !== t) return;
|
|
1092
1092
|
globalQueue.initTransition(resolveTransition(e));
|
|
@@ -1095,13 +1095,13 @@ function handleAsync(e, t, n) {
|
|
|
1095
1095
|
};
|
|
1096
1096
|
const asyncWrite = (i, r) => {
|
|
1097
1097
|
if (e.ve !== t) return;
|
|
1098
|
-
if (e.
|
|
1098
|
+
if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY)) return;
|
|
1099
1099
|
globalQueue.initTransition(resolveTransition(e));
|
|
1100
|
-
const
|
|
1100
|
+
const o = !!(e.he & STATUS_UNINITIALIZED);
|
|
1101
1101
|
trimStaleDeps(e);
|
|
1102
1102
|
clearStatus(e);
|
|
1103
|
-
const
|
|
1104
|
-
if (
|
|
1103
|
+
const s = resolveLane(e);
|
|
1104
|
+
if (s) s.F.delete(e);
|
|
1105
1105
|
if (n) n(i);
|
|
1106
1106
|
else if (e.K !== undefined) {
|
|
1107
1107
|
if (e.K !== undefined && e.K !== NOT_PENDING) e.B = i;
|
|
@@ -1110,11 +1110,11 @@ function handleAsync(e, t, n) {
|
|
|
1110
1110
|
insertSubs(e);
|
|
1111
1111
|
}
|
|
1112
1112
|
e.Ie = clock;
|
|
1113
|
-
} else if (
|
|
1113
|
+
} else if (s) {
|
|
1114
1114
|
const t = e.J;
|
|
1115
1115
|
const n = e.ue;
|
|
1116
1116
|
const r = e.ke;
|
|
1117
|
-
if ((!t &&
|
|
1117
|
+
if ((!t && o) || !r || !r(i, n)) {
|
|
1118
1118
|
e.ue = i;
|
|
1119
1119
|
e.Ie = clock;
|
|
1120
1120
|
if (e.Fe) {
|
|
@@ -1136,7 +1136,7 @@ function handleAsync(e, t, n) {
|
|
|
1136
1136
|
t.then(
|
|
1137
1137
|
e => {
|
|
1138
1138
|
if (i) {
|
|
1139
|
-
|
|
1139
|
+
o = e;
|
|
1140
1140
|
n = true;
|
|
1141
1141
|
} else asyncWrite(e);
|
|
1142
1142
|
},
|
|
@@ -1165,13 +1165,13 @@ function handleAsync(e, t, n) {
|
|
|
1165
1165
|
} catch {}
|
|
1166
1166
|
});
|
|
1167
1167
|
const iterate = () => {
|
|
1168
|
-
let
|
|
1168
|
+
let s,
|
|
1169
1169
|
u = false,
|
|
1170
1170
|
c = true;
|
|
1171
1171
|
n.next().then(
|
|
1172
1172
|
n => {
|
|
1173
1173
|
if (c) {
|
|
1174
|
-
|
|
1174
|
+
s = n;
|
|
1175
1175
|
u = true;
|
|
1176
1176
|
if (n.done) r = true;
|
|
1177
1177
|
} else if (e.ve !== t) {
|
|
@@ -1191,20 +1191,20 @@ function handleAsync(e, t, n) {
|
|
|
1191
1191
|
}
|
|
1192
1192
|
);
|
|
1193
1193
|
c = false;
|
|
1194
|
-
if (u && !
|
|
1195
|
-
|
|
1194
|
+
if (u && !s.done) {
|
|
1195
|
+
o = s.value;
|
|
1196
1196
|
i = true;
|
|
1197
1197
|
return iterate();
|
|
1198
1198
|
}
|
|
1199
|
-
return u &&
|
|
1199
|
+
return u && s.done;
|
|
1200
1200
|
};
|
|
1201
|
-
const
|
|
1202
|
-
if (!i && !
|
|
1201
|
+
const s = iterate();
|
|
1202
|
+
if (!i && !s) {
|
|
1203
1203
|
globalQueue.initTransition(resolveTransition(e));
|
|
1204
1204
|
throw new NotReadyError(context);
|
|
1205
1205
|
}
|
|
1206
1206
|
}
|
|
1207
|
-
return
|
|
1207
|
+
return o;
|
|
1208
1208
|
}
|
|
1209
1209
|
function clearStatus(e, t = false) {
|
|
1210
1210
|
if (e.Ce || e.Pe) clearPendingSources(e);
|
|
@@ -1217,15 +1217,15 @@ function clearStatus(e, t = false) {
|
|
|
1217
1217
|
function notifyStatus(e, t, n, i, r) {
|
|
1218
1218
|
if (t === STATUS_ERROR && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
1219
1219
|
n = new StatusError(e, n);
|
|
1220
|
-
const
|
|
1221
|
-
const
|
|
1222
|
-
const u = t === STATUS_PENDING && e.K !== undefined && !
|
|
1220
|
+
const o = t === STATUS_PENDING && n instanceof NotReadyError ? n.source : undefined;
|
|
1221
|
+
const s = o === e;
|
|
1222
|
+
const u = t === STATUS_PENDING && e.K !== undefined && !s;
|
|
1223
1223
|
const c = u && hasActiveOverride(e);
|
|
1224
1224
|
if (!i) {
|
|
1225
|
-
if (t === STATUS_PENDING &&
|
|
1226
|
-
addPendingSource(e,
|
|
1225
|
+
if (t === STATUS_PENDING && o) {
|
|
1226
|
+
addPendingSource(e, o);
|
|
1227
1227
|
e.he = STATUS_PENDING | (e.he & STATUS_UNINITIALIZED);
|
|
1228
|
-
setPendingError(e,
|
|
1228
|
+
setPendingError(e, o, n);
|
|
1229
1229
|
} else {
|
|
1230
1230
|
clearPendingSources(e);
|
|
1231
1231
|
e.he = t | (t !== STATUS_ERROR ? e.he & STATUS_UNINITIALIZED : 0);
|
|
@@ -1252,7 +1252,7 @@ function notifyStatus(e, t, n, i, r) {
|
|
|
1252
1252
|
forEachDependent(e, e => {
|
|
1253
1253
|
e.Ie = clock;
|
|
1254
1254
|
if (
|
|
1255
|
-
(t === STATUS_PENDING &&
|
|
1255
|
+
(t === STATUS_PENDING && o && e.Ce !== o && !e.Pe?.has(o)) ||
|
|
1256
1256
|
(t !== STATUS_PENDING && (e.Re !== n || e.Ce || e.Pe))
|
|
1257
1257
|
) {
|
|
1258
1258
|
if (!l && !e.M) queuePendingNode(e);
|
|
@@ -1268,11 +1268,11 @@ function enableExternalSource(e) {
|
|
|
1268
1268
|
externalSourceConfig = {
|
|
1269
1269
|
factory: (n, i) => {
|
|
1270
1270
|
const r = e(n, i);
|
|
1271
|
-
const
|
|
1271
|
+
const o = t(e => r.track(e), i);
|
|
1272
1272
|
return {
|
|
1273
|
-
track: e =>
|
|
1273
|
+
track: e => o.track(e),
|
|
1274
1274
|
dispose() {
|
|
1275
|
-
|
|
1275
|
+
o.dispose();
|
|
1276
1276
|
r.dispose();
|
|
1277
1277
|
}
|
|
1278
1278
|
};
|
|
@@ -1293,7 +1293,7 @@ let foundPending = false;
|
|
|
1293
1293
|
let latestReadActive = false;
|
|
1294
1294
|
let context = null;
|
|
1295
1295
|
let currentOptimisticLane = null;
|
|
1296
|
-
let
|
|
1296
|
+
let pendingCheckSources = null;
|
|
1297
1297
|
let snapshotCaptureActive = false;
|
|
1298
1298
|
let snapshotSources = null;
|
|
1299
1299
|
function ownerInSnapshotScope(e) {
|
|
@@ -1324,10 +1324,10 @@ function releaseSubtree(e) {
|
|
|
1324
1324
|
}
|
|
1325
1325
|
if (t.L) {
|
|
1326
1326
|
const e = t;
|
|
1327
|
-
e.
|
|
1328
|
-
if (e.
|
|
1329
|
-
e.
|
|
1330
|
-
e.
|
|
1327
|
+
e.Oe &= ~CONFIG_IN_SNAPSHOT_SCOPE;
|
|
1328
|
+
if (e.O & REACTIVE_SNAPSHOT_STALE) {
|
|
1329
|
+
e.O &= ~REACTIVE_SNAPSHOT_STALE;
|
|
1330
|
+
e.O |= REACTIVE_DIRTY;
|
|
1331
1331
|
if (dirtyQueue.C > e.o) dirtyQueue.C = e.o;
|
|
1332
1332
|
insertIntoHeap(e, dirtyQueue);
|
|
1333
1333
|
}
|
|
@@ -1351,7 +1351,7 @@ function recompute(e, t = false) {
|
|
|
1351
1351
|
if (!t) {
|
|
1352
1352
|
if (e.M && (!n || activeTransition) && activeTransition !== e.M)
|
|
1353
1353
|
globalQueue.initTransition(e.M);
|
|
1354
|
-
deleteFromHeap(e, e.
|
|
1354
|
+
deleteFromHeap(e, e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
1355
1355
|
e.ve = null;
|
|
1356
1356
|
if (e.M || n === EFFECT_TRACKED) disposeChildren(e);
|
|
1357
1357
|
else if (e.ge !== null || e.be !== null) {
|
|
@@ -1363,14 +1363,14 @@ function recompute(e, t = false) {
|
|
|
1363
1363
|
e.me = 0;
|
|
1364
1364
|
} else;
|
|
1365
1365
|
}
|
|
1366
|
-
let i = !!(e.
|
|
1366
|
+
let i = !!(e.O & REACTIVE_OPTIMISTIC_DIRTY);
|
|
1367
1367
|
const r = e.K !== undefined && e.K !== NOT_PENDING;
|
|
1368
|
-
const
|
|
1369
|
-
const
|
|
1368
|
+
const o = !!(e.he & STATUS_PENDING);
|
|
1369
|
+
const s = !!(e.he & STATUS_UNINITIALIZED);
|
|
1370
1370
|
const u = context;
|
|
1371
1371
|
context = e;
|
|
1372
1372
|
e.ye = null;
|
|
1373
|
-
e.
|
|
1373
|
+
e.O = REACTIVE_RECOMPUTING_DEPS;
|
|
1374
1374
|
e.Ie = clock;
|
|
1375
1375
|
let c = e.B === NOT_PENDING ? e.ue : e.B;
|
|
1376
1376
|
let l = e.o;
|
|
@@ -1383,12 +1383,12 @@ function recompute(e, t = false) {
|
|
|
1383
1383
|
} else if (activeTransition && !t && activeTransition.Z.length) {
|
|
1384
1384
|
for (let t = e.P; t; t = t.D) {
|
|
1385
1385
|
const n = t.m;
|
|
1386
|
-
if (n.
|
|
1386
|
+
if (n.O & REACTIVE_OPTIMISTIC_DIRTY) {
|
|
1387
1387
|
const t = resolveLane(n);
|
|
1388
1388
|
if (t) {
|
|
1389
1389
|
i = true;
|
|
1390
1390
|
currentOptimisticLane = t;
|
|
1391
|
-
e.
|
|
1391
|
+
e.O |= REACTIVE_OPTIMISTIC_DIRTY;
|
|
1392
1392
|
assignOrMergeLane(e, t);
|
|
1393
1393
|
break;
|
|
1394
1394
|
}
|
|
@@ -1399,7 +1399,7 @@ function recompute(e, t = false) {
|
|
|
1399
1399
|
const S = stale;
|
|
1400
1400
|
if (E) stale = true;
|
|
1401
1401
|
try {
|
|
1402
|
-
if (!false && e.
|
|
1402
|
+
if (!false && e.Oe & CONFIG_SYNC) {
|
|
1403
1403
|
c = e.L(c);
|
|
1404
1404
|
e.ve = null;
|
|
1405
1405
|
} else {
|
|
@@ -1438,19 +1438,19 @@ function recompute(e, t = false) {
|
|
|
1438
1438
|
} finally {
|
|
1439
1439
|
tracking = a;
|
|
1440
1440
|
if (E) stale = S;
|
|
1441
|
-
e.
|
|
1441
|
+
e.O = REACTIVE_NONE | (t ? e.O & REACTIVE_SNAPSHOT_STALE : 0);
|
|
1442
1442
|
context = u;
|
|
1443
1443
|
}
|
|
1444
1444
|
if (!e.Re) {
|
|
1445
1445
|
trimStaleDeps(e);
|
|
1446
1446
|
const u = r ? e.K : e.B === NOT_PENDING ? e.ue : e.B;
|
|
1447
|
-
const a = (!n &&
|
|
1447
|
+
const a = (!n && s) || !e.ke || !e.ke(u, c);
|
|
1448
1448
|
if (n && a) {
|
|
1449
1449
|
e.ee = !e.Re;
|
|
1450
1450
|
if (!t) e.te.enqueue(n, GlobalQueue.Te.bind(null, e));
|
|
1451
1451
|
}
|
|
1452
1452
|
if (a) {
|
|
1453
|
-
const
|
|
1453
|
+
const s = r ? e.K : undefined;
|
|
1454
1454
|
if (t || (n && activeTransition !== e.M) || i) {
|
|
1455
1455
|
e.ue = c;
|
|
1456
1456
|
if (r && i) {
|
|
@@ -1458,13 +1458,13 @@ function recompute(e, t = false) {
|
|
|
1458
1458
|
e.B = c;
|
|
1459
1459
|
}
|
|
1460
1460
|
} else e.B = c;
|
|
1461
|
-
if (r && !i &&
|
|
1462
|
-
if (!r || i || e.K !==
|
|
1461
|
+
if (r && !i && o && !e.$) e.K = c;
|
|
1462
|
+
if (!r || i || e.K !== s) insertSubs(e, i || r);
|
|
1463
1463
|
} else if (r) {
|
|
1464
1464
|
e.B = c;
|
|
1465
1465
|
} else if (e.o != l) {
|
|
1466
1466
|
for (let t = e.I; t !== null; t = t.p) {
|
|
1467
|
-
insertIntoHeapHeight(t.h, t.h.
|
|
1467
|
+
insertIntoHeapHeight(t.h, t.h.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
1468
1468
|
}
|
|
1469
1469
|
}
|
|
1470
1470
|
}
|
|
@@ -1478,28 +1478,28 @@ function recompute(e, t = false) {
|
|
|
1478
1478
|
e.M && n && activeTransition !== e.M && runInTransition(e.M, () => recompute(e));
|
|
1479
1479
|
}
|
|
1480
1480
|
function updateIfNecessary(e) {
|
|
1481
|
-
if (e.
|
|
1481
|
+
if (e.O & REACTIVE_CHECK) {
|
|
1482
1482
|
for (let t = e.P; t; t = t.D) {
|
|
1483
1483
|
const n = t.m;
|
|
1484
1484
|
const i = n.V || n;
|
|
1485
1485
|
if (i.L) {
|
|
1486
1486
|
updateIfNecessary(i);
|
|
1487
1487
|
}
|
|
1488
|
-
if (e.
|
|
1488
|
+
if (e.O & REACTIVE_DIRTY) {
|
|
1489
1489
|
break;
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
1492
|
}
|
|
1493
|
-
if (e.
|
|
1493
|
+
if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY) || (e.Re && e.Ie < clock && !e.ve)) {
|
|
1494
1494
|
recompute(e);
|
|
1495
1495
|
}
|
|
1496
|
-
e.
|
|
1496
|
+
e.O = e.O & (REACTIVE_SNAPSHOT_STALE | REACTIVE_IN_HEAP | REACTIVE_IN_HEAP_HEIGHT);
|
|
1497
1497
|
}
|
|
1498
1498
|
function computed(e, t) {
|
|
1499
1499
|
const n = t?.transparent ?? false;
|
|
1500
1500
|
const i = {
|
|
1501
1501
|
id: t?.id ?? (n ? context?.id : context?.id != null ? getNextChildId(context) : undefined),
|
|
1502
|
-
|
|
1502
|
+
Oe:
|
|
1503
1503
|
(n ? CONFIG_TRANSPARENT : 0) |
|
|
1504
1504
|
(t?.ownedWrite ? CONFIG_OWNED_WRITE : 0) |
|
|
1505
1505
|
(!context || t?.lazy ? CONFIG_AUTO_DISPOSE : 0) |
|
|
@@ -1525,7 +1525,7 @@ function computed(e, t) {
|
|
|
1525
1525
|
De: null,
|
|
1526
1526
|
we: null,
|
|
1527
1527
|
ge: null,
|
|
1528
|
-
|
|
1528
|
+
O: t?.lazy ? REACTIVE_LAZY : REACTIVE_NONE,
|
|
1529
1529
|
he: STATUS_UNINITIALIZED,
|
|
1530
1530
|
Ie: clock,
|
|
1531
1531
|
B: NOT_PENDING,
|
|
@@ -1537,17 +1537,17 @@ function computed(e, t) {
|
|
|
1537
1537
|
setupComputedNode(i, t);
|
|
1538
1538
|
return i;
|
|
1539
1539
|
}
|
|
1540
|
-
function createEffectNode(e, t, n, i, r,
|
|
1541
|
-
const
|
|
1540
|
+
function createEffectNode(e, t, n, i, r, o) {
|
|
1541
|
+
const s = o?.transparent ?? false;
|
|
1542
1542
|
const u = {
|
|
1543
|
-
id:
|
|
1544
|
-
|
|
1545
|
-
(
|
|
1546
|
-
(
|
|
1547
|
-
(
|
|
1543
|
+
id: o?.id ?? (s ? context?.id : context?.id != null ? getNextChildId(context) : undefined),
|
|
1544
|
+
Oe:
|
|
1545
|
+
(s ? CONFIG_TRANSPARENT : 0) |
|
|
1546
|
+
(o?.ownedWrite ? CONFIG_OWNED_WRITE : 0) |
|
|
1547
|
+
(o?.sync ? CONFIG_SYNC : 0) |
|
|
1548
1548
|
(snapshotCaptureActive && ownerInSnapshotScope(context) ? CONFIG_IN_SNAPSHOT_SCOPE : 0),
|
|
1549
1549
|
ke: false,
|
|
1550
|
-
X:
|
|
1550
|
+
X: o?.unobserved,
|
|
1551
1551
|
be: null,
|
|
1552
1552
|
te: context?.te ?? globalQueue,
|
|
1553
1553
|
Ve: context?.Ve ?? defaultContext,
|
|
@@ -1566,7 +1566,7 @@ function createEffectNode(e, t, n, i, r, s) {
|
|
|
1566
1566
|
De: null,
|
|
1567
1567
|
we: null,
|
|
1568
1568
|
ge: null,
|
|
1569
|
-
|
|
1569
|
+
O: REACTIVE_LAZY,
|
|
1570
1570
|
he: STATUS_UNINITIALIZED,
|
|
1571
1571
|
Ie: clock,
|
|
1572
1572
|
B: NOT_PENDING,
|
|
@@ -1623,7 +1623,7 @@ function setupComputedNode(e, t) {
|
|
|
1623
1623
|
function signal(e, t, n = null) {
|
|
1624
1624
|
const i = {
|
|
1625
1625
|
ke: t?.equals != null ? t.equals : isEqual,
|
|
1626
|
-
|
|
1626
|
+
Oe: (t?.ownedWrite ? CONFIG_OWNED_WRITE : 0) | (t?.Ye ? CONFIG_NO_SNAPSHOT : 0),
|
|
1627
1627
|
X: t?.unobserved,
|
|
1628
1628
|
ue: e,
|
|
1629
1629
|
I: null,
|
|
@@ -1634,7 +1634,7 @@ function signal(e, t, n = null) {
|
|
|
1634
1634
|
B: NOT_PENDING
|
|
1635
1635
|
};
|
|
1636
1636
|
n && (n.N = i);
|
|
1637
|
-
if (snapshotCaptureActive && !(i.
|
|
1637
|
+
if (snapshotCaptureActive && !(i.Oe & CONFIG_NO_SNAPSHOT) && !((n?.he ?? 0) & STATUS_PENDING)) {
|
|
1638
1638
|
i.pe = e === undefined ? NO_SNAPSHOT : e;
|
|
1639
1639
|
snapshotSources.add(i);
|
|
1640
1640
|
}
|
|
@@ -1693,39 +1693,48 @@ function read(e) {
|
|
|
1693
1693
|
const t = e.V;
|
|
1694
1694
|
const n = pendingCheckActive;
|
|
1695
1695
|
pendingCheckActive = false;
|
|
1696
|
-
|
|
1697
|
-
if (
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1696
|
+
let i = context;
|
|
1697
|
+
if (i?.t) i = i.u;
|
|
1698
|
+
const r = t || e;
|
|
1699
|
+
const o = e;
|
|
1700
|
+
if (typeof o.L === "function") {
|
|
1701
|
+
const t = e;
|
|
1702
|
+
if (t.O & REACTIVE_LAZY) {
|
|
1703
|
+
t.O &= ~REACTIVE_LAZY;
|
|
1704
|
+
recompute(t, true);
|
|
1705
|
+
} else if (t.O & REACTIVE_DISPOSED) {
|
|
1706
|
+
recompute(t, true);
|
|
1707
|
+
} else {
|
|
1708
|
+
updateIfNecessary(t);
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
if (i && r.he & STATUS_PENDING && r.he & STATUS_UNINITIALIZED) {
|
|
1712
|
+
if (tracking && e !== i) link(e, i);
|
|
1701
1713
|
pendingCheckActive = n;
|
|
1702
|
-
throw
|
|
1714
|
+
throw r.Re;
|
|
1703
1715
|
}
|
|
1704
1716
|
if (t && e.K !== undefined) {
|
|
1705
1717
|
if (e.K !== NOT_PENDING && (t.ve || !!(t.he & STATUS_PENDING))) {
|
|
1706
1718
|
foundPending = true;
|
|
1707
1719
|
}
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
if (
|
|
1711
|
-
read(getPendingSignal(e));
|
|
1712
|
-
read(getPendingSignal(t));
|
|
1720
|
+
collectPendingSources(e);
|
|
1721
|
+
collectPendingSources(t);
|
|
1722
|
+
if (i && tracking) link(e, i);
|
|
1713
1723
|
} else {
|
|
1714
|
-
|
|
1715
|
-
if (t
|
|
1724
|
+
collectPendingSources(e);
|
|
1725
|
+
if (t) collectPendingSources(t);
|
|
1716
1726
|
}
|
|
1717
1727
|
pendingCheckActive = n;
|
|
1718
|
-
return e.ue;
|
|
1719
1728
|
}
|
|
1720
1729
|
let t = context;
|
|
1721
1730
|
if (t?.t) t = t.u;
|
|
1722
1731
|
const n = e;
|
|
1723
1732
|
if (typeof n.L === "function") {
|
|
1724
1733
|
const t = e;
|
|
1725
|
-
if (t.
|
|
1726
|
-
t.
|
|
1734
|
+
if (t.O & REACTIVE_LAZY) {
|
|
1735
|
+
t.O &= ~REACTIVE_LAZY;
|
|
1727
1736
|
recompute(t, true);
|
|
1728
|
-
} else if (t.
|
|
1737
|
+
} else if (t.O & REACTIVE_DISPOSED) {
|
|
1729
1738
|
recompute(t, true);
|
|
1730
1739
|
}
|
|
1731
1740
|
}
|
|
@@ -1746,7 +1755,7 @@ function read(e) {
|
|
|
1746
1755
|
if (t && tracking) {
|
|
1747
1756
|
link(e, t);
|
|
1748
1757
|
if (i.L) {
|
|
1749
|
-
const n = e.
|
|
1758
|
+
const n = e.O & REACTIVE_ZOMBIE;
|
|
1750
1759
|
if (i.o >= (n ? zombieQueue.C : dirtyQueue.C)) {
|
|
1751
1760
|
markNode(t);
|
|
1752
1761
|
markHeap(n ? zombieQueue : dirtyQueue);
|
|
@@ -1784,12 +1793,12 @@ function read(e) {
|
|
|
1784
1793
|
return read(e);
|
|
1785
1794
|
} else throw e.Re;
|
|
1786
1795
|
}
|
|
1787
|
-
if (snapshotCaptureActive && t && t.
|
|
1796
|
+
if (snapshotCaptureActive && t && t.Oe & CONFIG_IN_SNAPSHOT_SCOPE) {
|
|
1788
1797
|
const n = e.pe;
|
|
1789
1798
|
if (n !== undefined) {
|
|
1790
1799
|
const i = n === NO_SNAPSHOT ? undefined : n;
|
|
1791
1800
|
const r = e.B !== NOT_PENDING ? e.B : e.ue;
|
|
1792
|
-
if (r !== i) t.
|
|
1801
|
+
if (r !== i) t.O |= REACTIVE_SNAPSHOT_STALE;
|
|
1793
1802
|
return i;
|
|
1794
1803
|
}
|
|
1795
1804
|
}
|
|
@@ -1806,7 +1815,7 @@ function read(e) {
|
|
|
1806
1815
|
!e.L &&
|
|
1807
1816
|
t
|
|
1808
1817
|
) {
|
|
1809
|
-
activeTransition.
|
|
1818
|
+
activeTransition.se.add(t);
|
|
1810
1819
|
return e.ue;
|
|
1811
1820
|
}
|
|
1812
1821
|
const r =
|
|
@@ -1821,7 +1830,7 @@ function read(e) {
|
|
|
1821
1830
|
!t &&
|
|
1822
1831
|
i === e &&
|
|
1823
1832
|
typeof n.L === "function" &&
|
|
1824
|
-
e.
|
|
1833
|
+
e.Oe & CONFIG_AUTO_DISPOSE &&
|
|
1825
1834
|
!(i.he & STATUS_PENDING) &&
|
|
1826
1835
|
!e.I
|
|
1827
1836
|
) {
|
|
@@ -1835,8 +1844,8 @@ function setSignal(e, t) {
|
|
|
1835
1844
|
const i = e.K !== undefined && e.K !== NOT_PENDING;
|
|
1836
1845
|
const r = n ? (i ? e.K : e.ue) : e.B === NOT_PENDING ? e.ue : e.B;
|
|
1837
1846
|
if (typeof t === "function") t = t(r);
|
|
1838
|
-
const
|
|
1839
|
-
if (!
|
|
1847
|
+
const o = !e.ke || !e.ke(r, t) || !!(e.he & STATUS_UNINITIALIZED);
|
|
1848
|
+
if (!o) {
|
|
1840
1849
|
if (n && i && e.L) {
|
|
1841
1850
|
insertSubs(e, true);
|
|
1842
1851
|
schedule();
|
|
@@ -1868,9 +1877,9 @@ function setSignal(e, t) {
|
|
|
1868
1877
|
return t;
|
|
1869
1878
|
}
|
|
1870
1879
|
function suppressComputedRecompute(e) {
|
|
1871
|
-
deleteFromHeap(e, e.
|
|
1872
|
-
if (!(e.
|
|
1873
|
-
e.
|
|
1880
|
+
deleteFromHeap(e, e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
1881
|
+
if (!(e.O & REACTIVE_MANUAL_WRITE) && e.B === NOT_PENDING) queuePendingNode(e);
|
|
1882
|
+
e.O = (e.O & -4) | REACTIVE_MANUAL_WRITE;
|
|
1874
1883
|
}
|
|
1875
1884
|
function setMemo(e, t) {
|
|
1876
1885
|
const n = setSignal(e, t);
|
|
@@ -1899,9 +1908,19 @@ function getPendingSignal(e) {
|
|
|
1899
1908
|
}
|
|
1900
1909
|
return e.We;
|
|
1901
1910
|
}
|
|
1911
|
+
function collectPendingSources(e) {
|
|
1912
|
+
pendingCheckSources?.add(e);
|
|
1913
|
+
const t = e.V || e;
|
|
1914
|
+
if (t !== e) pendingCheckSources?.add(t);
|
|
1915
|
+
}
|
|
1902
1916
|
function computePendingState(e) {
|
|
1903
1917
|
const t = e;
|
|
1904
1918
|
const n = e.V;
|
|
1919
|
+
if (e.U) {
|
|
1920
|
+
const n = e.U;
|
|
1921
|
+
if (n.he & STATUS_PENDING && !(n.he & STATUS_UNINITIALIZED)) return true;
|
|
1922
|
+
return e.B !== NOT_PENDING && !(t.he & STATUS_UNINITIALIZED);
|
|
1923
|
+
}
|
|
1905
1924
|
if (n && e.B !== NOT_PENDING) {
|
|
1906
1925
|
return !n.ve && !(n.he & STATUS_PENDING);
|
|
1907
1926
|
}
|
|
@@ -1971,24 +1990,38 @@ function latest(e) {
|
|
|
1971
1990
|
latestReadActive = t;
|
|
1972
1991
|
}
|
|
1973
1992
|
}
|
|
1974
|
-
function isPending(e
|
|
1975
|
-
const
|
|
1976
|
-
const
|
|
1977
|
-
const
|
|
1978
|
-
const s = t === true;
|
|
1993
|
+
function isPending(e) {
|
|
1994
|
+
const t = pendingCheckActive;
|
|
1995
|
+
const n = foundPending;
|
|
1996
|
+
const i = pendingCheckSources;
|
|
1979
1997
|
pendingCheckActive = true;
|
|
1980
|
-
pendingCheckLoadingPath = s;
|
|
1981
1998
|
foundPending = false;
|
|
1999
|
+
pendingCheckSources = new Set();
|
|
2000
|
+
const collectPending = () => {
|
|
2001
|
+
pendingCheckActive = false;
|
|
2002
|
+
try {
|
|
2003
|
+
pendingCheckSources.forEach(e => {
|
|
2004
|
+
if (read(getPendingSignal(e))) foundPending = true;
|
|
2005
|
+
});
|
|
2006
|
+
} finally {
|
|
2007
|
+
pendingCheckActive = true;
|
|
2008
|
+
}
|
|
2009
|
+
};
|
|
1982
2010
|
try {
|
|
1983
2011
|
e();
|
|
2012
|
+
collectPending();
|
|
1984
2013
|
return foundPending;
|
|
1985
2014
|
} catch (e) {
|
|
1986
|
-
|
|
2015
|
+
collectPending();
|
|
2016
|
+
if (e instanceof NotReadyError) {
|
|
2017
|
+
if (foundPending && !(e.source?.he & STATUS_UNINITIALIZED)) return true;
|
|
2018
|
+
if (context) throw e;
|
|
2019
|
+
}
|
|
1987
2020
|
return foundPending;
|
|
1988
2021
|
} finally {
|
|
1989
|
-
pendingCheckActive =
|
|
1990
|
-
|
|
1991
|
-
|
|
2022
|
+
pendingCheckActive = t;
|
|
2023
|
+
foundPending = n;
|
|
2024
|
+
pendingCheckSources = i;
|
|
1992
2025
|
}
|
|
1993
2026
|
}
|
|
1994
2027
|
function refresh(e) {
|
|
@@ -1997,7 +2030,7 @@ function refresh(e) {
|
|
|
1997
2030
|
try {
|
|
1998
2031
|
const t = e?.[$REFRESH];
|
|
1999
2032
|
if (false && !t);
|
|
2000
|
-
if (t && typeof t.L === "function" && !(t.
|
|
2033
|
+
if (t && typeof t.L === "function" && !(t.O & REACTIVE_DISPOSED)) {
|
|
2001
2034
|
recompute(t);
|
|
2002
2035
|
}
|
|
2003
2036
|
} finally {
|
|
@@ -2037,12 +2070,12 @@ function isUndefined(e) {
|
|
|
2037
2070
|
}
|
|
2038
2071
|
function effect(e, t, n, i) {
|
|
2039
2072
|
const r = !!i?.user;
|
|
2040
|
-
const
|
|
2041
|
-
recompute(
|
|
2073
|
+
const o = createEffectNode(e, t, n, r ? EFFECT_USER : EFFECT_RENDER, notifyEffectStatus, i);
|
|
2074
|
+
recompute(o, true);
|
|
2042
2075
|
!i?.defer &&
|
|
2043
|
-
(
|
|
2044
|
-
?
|
|
2045
|
-
: runEffect(
|
|
2076
|
+
(o.J === EFFECT_USER || i?.schedule
|
|
2077
|
+
? o.te.enqueue(o.J, runEffect.bind(null, o))
|
|
2078
|
+
: runEffect(o));
|
|
2046
2079
|
}
|
|
2047
2080
|
function notifyEffectStatus(e, t) {
|
|
2048
2081
|
const n = e !== undefined ? e : this.he;
|
|
@@ -2068,7 +2101,7 @@ function notifyEffectStatus(e, t) {
|
|
|
2068
2101
|
}
|
|
2069
2102
|
}
|
|
2070
2103
|
function runEffect(e) {
|
|
2071
|
-
if (!e.ee || e.
|
|
2104
|
+
if (!e.ee || e.O & REACTIVE_DISPOSED) return;
|
|
2072
2105
|
e.$e?.();
|
|
2073
2106
|
e.$e = undefined;
|
|
2074
2107
|
try {
|
|
@@ -2091,7 +2124,7 @@ function runEffect(e) {
|
|
|
2091
2124
|
GlobalQueue.Te = runEffect;
|
|
2092
2125
|
function trackedEffect(e, t) {
|
|
2093
2126
|
const run = () => {
|
|
2094
|
-
if (!n.ee || n.
|
|
2127
|
+
if (!n.ee || n.O & REACTIVE_DISPOSED) return;
|
|
2095
2128
|
try {
|
|
2096
2129
|
n.ee = false;
|
|
2097
2130
|
recompute(n);
|
|
@@ -2108,7 +2141,7 @@ function trackedEffect(e, t) {
|
|
|
2108
2141
|
{ ...t, lazy: true }
|
|
2109
2142
|
);
|
|
2110
2143
|
n.$e = undefined;
|
|
2111
|
-
n.
|
|
2144
|
+
n.Oe = (n.Oe & ~CONFIG_AUTO_DISPOSE) | CONFIG_CHILDREN_FORBIDDEN;
|
|
2112
2145
|
n.ee = true;
|
|
2113
2146
|
n.J = EFFECT_TRACKED;
|
|
2114
2147
|
n.xe = (e, t) => {
|
|
@@ -2134,13 +2167,13 @@ function action(e) {
|
|
|
2134
2167
|
new Promise((n, i) => {
|
|
2135
2168
|
const r = e(...t);
|
|
2136
2169
|
globalQueue.initTransition();
|
|
2137
|
-
let
|
|
2138
|
-
|
|
2170
|
+
let o = activeTransition;
|
|
2171
|
+
o.re.push(r);
|
|
2139
2172
|
const done = (e, t) => {
|
|
2140
|
-
|
|
2141
|
-
const
|
|
2142
|
-
if (
|
|
2143
|
-
setActiveTransition(
|
|
2173
|
+
o = currentTransition(o);
|
|
2174
|
+
const s = o.re.indexOf(r);
|
|
2175
|
+
if (s >= 0) o.re.splice(s, 1);
|
|
2176
|
+
setActiveTransition(o);
|
|
2144
2177
|
schedule();
|
|
2145
2178
|
t ? i(t) : n(e);
|
|
2146
2179
|
};
|
|
@@ -2152,17 +2185,17 @@ function action(e) {
|
|
|
2152
2185
|
return done(undefined, e);
|
|
2153
2186
|
}
|
|
2154
2187
|
if (n instanceof Promise)
|
|
2155
|
-
return void n.then(run, e => restoreTransition(
|
|
2188
|
+
return void n.then(run, e => restoreTransition(o, () => step(e, true)));
|
|
2156
2189
|
run(n);
|
|
2157
2190
|
};
|
|
2158
2191
|
const run = e => {
|
|
2159
2192
|
if (e.done) return done(e.value);
|
|
2160
2193
|
if (e.value instanceof Promise)
|
|
2161
2194
|
return void e.value.then(
|
|
2162
|
-
e => restoreTransition(
|
|
2163
|
-
e => restoreTransition(
|
|
2195
|
+
e => restoreTransition(o, () => step(e)),
|
|
2196
|
+
e => restoreTransition(o, () => step(e, true))
|
|
2164
2197
|
);
|
|
2165
|
-
restoreTransition(
|
|
2198
|
+
restoreTransition(o, () => step(e.value));
|
|
2166
2199
|
};
|
|
2167
2200
|
step();
|
|
2168
2201
|
});
|
|
@@ -2178,7 +2211,7 @@ function accessor(e) {
|
|
|
2178
2211
|
function createSignal(e, t) {
|
|
2179
2212
|
if (typeof e === "function") {
|
|
2180
2213
|
const n = computed(e, t);
|
|
2181
|
-
n.
|
|
2214
|
+
n.Oe &= ~CONFIG_AUTO_DISPOSE;
|
|
2182
2215
|
return [accessor(n), setMemo.bind(null, n)];
|
|
2183
2216
|
}
|
|
2184
2217
|
const n = signal(e, t);
|
|
@@ -2235,7 +2268,7 @@ function resolve(e) {
|
|
|
2235
2268
|
function createOptimistic(e, t) {
|
|
2236
2269
|
if (typeof e === "function") {
|
|
2237
2270
|
const n = optimisticComputed(e, t);
|
|
2238
|
-
n.
|
|
2271
|
+
n.Oe &= ~CONFIG_AUTO_DISPOSE;
|
|
2239
2272
|
return [accessor(n), setSignal.bind(null, n)];
|
|
2240
2273
|
}
|
|
2241
2274
|
const n = optimisticSignal(e, t);
|
|
@@ -2243,7 +2276,7 @@ function createOptimistic(e, t) {
|
|
|
2243
2276
|
}
|
|
2244
2277
|
function onSettled(e) {
|
|
2245
2278
|
const t = getOwner();
|
|
2246
|
-
t && !(t.
|
|
2279
|
+
t && !(t.Oe & CONFIG_CHILDREN_FORBIDDEN)
|
|
2247
2280
|
? createTrackedEffect(() => untrack(e), undefined)
|
|
2248
2281
|
: globalQueue.enqueue(EFFECT_USER, () => {
|
|
2249
2282
|
const t = e();
|
|
@@ -2278,11 +2311,11 @@ function applyStateFast(e, t, n) {
|
|
|
2278
2311
|
t[STORE_VALUE] = e;
|
|
2279
2312
|
if (Array.isArray(i)) {
|
|
2280
2313
|
let r = false;
|
|
2281
|
-
const
|
|
2282
|
-
if (e.length &&
|
|
2283
|
-
let
|
|
2314
|
+
const o = i.length;
|
|
2315
|
+
if (e.length && o && e[0] && n(e[0]) != null) {
|
|
2316
|
+
let s, u, c, l, a, f, E, S;
|
|
2284
2317
|
for (
|
|
2285
|
-
c = 0, l = Math.min(
|
|
2318
|
+
c = 0, l = Math.min(o, e.length);
|
|
2286
2319
|
c < l && ((f = i[c]) === e[c] || (f && e[c] && n(f) === n(e[c])));
|
|
2287
2320
|
c++
|
|
2288
2321
|
) {
|
|
@@ -2291,7 +2324,7 @@ function applyStateFast(e, t, n) {
|
|
|
2291
2324
|
const T = new Array(e.length),
|
|
2292
2325
|
d = new Map();
|
|
2293
2326
|
for (
|
|
2294
|
-
l =
|
|
2327
|
+
l = o - 1, a = e.length - 1;
|
|
2295
2328
|
l >= c && a >= c && ((f = i[l]) === e[a] || (f && e[a] && n(f) === n(e[a])));
|
|
2296
2329
|
l--, a--
|
|
2297
2330
|
) {
|
|
@@ -2309,19 +2342,19 @@ function applyStateFast(e, t, n) {
|
|
|
2309
2342
|
applyState(e[u], i, n);
|
|
2310
2343
|
}
|
|
2311
2344
|
r && t[STORE_NODE][$TRACK] && setSignal(t[STORE_NODE][$TRACK], void 0);
|
|
2312
|
-
|
|
2345
|
+
o !== e.length && t[STORE_NODE].length && setSignal(t[STORE_NODE].length, e.length);
|
|
2313
2346
|
return;
|
|
2314
2347
|
}
|
|
2315
2348
|
E = new Array(a + 1);
|
|
2316
2349
|
for (u = a; u >= c; u--) {
|
|
2317
2350
|
f = e[u];
|
|
2318
2351
|
S = f ? n(f) : f;
|
|
2319
|
-
|
|
2320
|
-
E[u] =
|
|
2352
|
+
s = d.get(S);
|
|
2353
|
+
E[u] = s === undefined ? -1 : s;
|
|
2321
2354
|
d.set(S, u);
|
|
2322
2355
|
}
|
|
2323
|
-
for (
|
|
2324
|
-
f = i[
|
|
2356
|
+
for (s = c; s <= l; s++) {
|
|
2357
|
+
f = i[s];
|
|
2325
2358
|
S = f ? n(f) : f;
|
|
2326
2359
|
u = d.get(S);
|
|
2327
2360
|
if (u !== undefined && u !== -1) {
|
|
@@ -2339,14 +2372,14 @@ function applyStateFast(e, t, n) {
|
|
|
2339
2372
|
}
|
|
2340
2373
|
if (c < e.length) r = true;
|
|
2341
2374
|
} else if (e.length) {
|
|
2342
|
-
for (let r = 0,
|
|
2343
|
-
const
|
|
2344
|
-
isWrappable(
|
|
2345
|
-
? applyState(e[r], wrap(
|
|
2375
|
+
for (let r = 0, o = e.length; r < o; r++) {
|
|
2376
|
+
const o = i[r];
|
|
2377
|
+
isWrappable(o)
|
|
2378
|
+
? applyState(e[r], wrap(o, t), n)
|
|
2346
2379
|
: t[STORE_NODE][r] && setSignal(t[STORE_NODE][r], e[r]);
|
|
2347
2380
|
}
|
|
2348
2381
|
}
|
|
2349
|
-
if (
|
|
2382
|
+
if (o !== e.length) {
|
|
2350
2383
|
r = true;
|
|
2351
2384
|
t[STORE_NODE].length && setSignal(t[STORE_NODE].length, e.length);
|
|
2352
2385
|
}
|
|
@@ -2355,16 +2388,16 @@ function applyStateFast(e, t, n) {
|
|
|
2355
2388
|
}
|
|
2356
2389
|
let r = t[STORE_NODE];
|
|
2357
2390
|
if (r) {
|
|
2358
|
-
const
|
|
2359
|
-
const
|
|
2360
|
-
for (let u = 0, c =
|
|
2361
|
-
const c =
|
|
2391
|
+
const o = r[$TRACK];
|
|
2392
|
+
const s = o ? getAllKeys(i, undefined, e) : Object.keys(r);
|
|
2393
|
+
for (let u = 0, c = s.length; u < c; u++) {
|
|
2394
|
+
const c = s[u];
|
|
2362
2395
|
const l = r[c];
|
|
2363
2396
|
const a = unwrap(i[c]);
|
|
2364
2397
|
let f = unwrap(e[c]);
|
|
2365
2398
|
if (a === f) continue;
|
|
2366
2399
|
if (!a || !isWrappable(a) || !isWrappable(f) || (n(a) != null && n(a) !== n(f))) {
|
|
2367
|
-
|
|
2400
|
+
o && setSignal(o, void 0);
|
|
2368
2401
|
l && setSignal(l, isWrappable(f) ? wrap(f, t) : f);
|
|
2369
2402
|
} else applyState(f, wrap(a, t), n);
|
|
2370
2403
|
}
|
|
@@ -2380,46 +2413,46 @@ function applyStateFast(e, t, n) {
|
|
|
2380
2413
|
function applyStateSlow(e, t, n) {
|
|
2381
2414
|
const i = t[STORE_VALUE];
|
|
2382
2415
|
const r = t[STORE_OVERRIDE];
|
|
2383
|
-
const
|
|
2384
|
-
let
|
|
2416
|
+
const o = t[STORE_OPTIMISTIC_OVERRIDE];
|
|
2417
|
+
let s = t[STORE_NODE];
|
|
2385
2418
|
(t[STORE_LOOKUP] || storeLookup).set(e, t[$PROXY]);
|
|
2386
2419
|
t[STORE_VALUE] = e;
|
|
2387
2420
|
t[STORE_OVERRIDE] = undefined;
|
|
2388
2421
|
if (Array.isArray(i)) {
|
|
2389
|
-
let
|
|
2390
|
-
const u = getOverrideValue(i, r, "length",
|
|
2422
|
+
let s = false;
|
|
2423
|
+
const u = getOverrideValue(i, r, "length", o);
|
|
2391
2424
|
if (e.length && u && e[0] && n(e[0]) != null) {
|
|
2392
2425
|
let c, l, a, f, E, S, T, d;
|
|
2393
2426
|
for (
|
|
2394
2427
|
a = 0, f = Math.min(u, e.length);
|
|
2395
|
-
a < f && ((S = getOverrideValue(i, r, a,
|
|
2428
|
+
a < f && ((S = getOverrideValue(i, r, a, o)) === e[a] || (S && e[a] && n(S) === n(e[a])));
|
|
2396
2429
|
a++
|
|
2397
2430
|
) {
|
|
2398
2431
|
applyState(e[a], wrap(S, t), n);
|
|
2399
2432
|
}
|
|
2400
|
-
const
|
|
2401
|
-
|
|
2433
|
+
const _ = new Array(e.length),
|
|
2434
|
+
O = new Map();
|
|
2402
2435
|
for (
|
|
2403
2436
|
f = u - 1, E = e.length - 1;
|
|
2404
2437
|
f >= a &&
|
|
2405
2438
|
E >= a &&
|
|
2406
|
-
((S = getOverrideValue(i, r, f,
|
|
2439
|
+
((S = getOverrideValue(i, r, f, o)) === e[E] || (S && e[E] && n(S) === n(e[E])));
|
|
2407
2440
|
f--, E--
|
|
2408
2441
|
) {
|
|
2409
|
-
|
|
2442
|
+
_[E] = S;
|
|
2410
2443
|
}
|
|
2411
2444
|
if (a > E || a > f) {
|
|
2412
2445
|
for (l = a; l <= E; l++) {
|
|
2413
|
-
|
|
2446
|
+
s = true;
|
|
2414
2447
|
t[STORE_NODE][l] && setSignal(t[STORE_NODE][l], wrap(e[l], t));
|
|
2415
2448
|
}
|
|
2416
2449
|
for (; l < e.length; l++) {
|
|
2417
|
-
|
|
2418
|
-
const i = wrap(
|
|
2450
|
+
s = true;
|
|
2451
|
+
const i = wrap(_[l], t);
|
|
2419
2452
|
t[STORE_NODE][l] && setSignal(t[STORE_NODE][l], i);
|
|
2420
2453
|
applyState(e[l], i, n);
|
|
2421
2454
|
}
|
|
2422
|
-
|
|
2455
|
+
s && t[STORE_NODE][$TRACK] && setSignal(t[STORE_NODE][$TRACK], void 0);
|
|
2423
2456
|
u !== e.length && t[STORE_NODE].length && setSignal(t[STORE_NODE].length, e.length);
|
|
2424
2457
|
return;
|
|
2425
2458
|
}
|
|
@@ -2427,50 +2460,50 @@ function applyStateSlow(e, t, n) {
|
|
|
2427
2460
|
for (l = E; l >= a; l--) {
|
|
2428
2461
|
S = e[l];
|
|
2429
2462
|
d = S ? n(S) : S;
|
|
2430
|
-
c =
|
|
2463
|
+
c = O.get(d);
|
|
2431
2464
|
T[l] = c === undefined ? -1 : c;
|
|
2432
|
-
|
|
2465
|
+
O.set(d, l);
|
|
2433
2466
|
}
|
|
2434
2467
|
for (c = a; c <= f; c++) {
|
|
2435
|
-
S = getOverrideValue(i, r, c,
|
|
2468
|
+
S = getOverrideValue(i, r, c, o);
|
|
2436
2469
|
d = S ? n(S) : S;
|
|
2437
|
-
l =
|
|
2470
|
+
l = O.get(d);
|
|
2438
2471
|
if (l !== undefined && l !== -1) {
|
|
2439
|
-
|
|
2472
|
+
_[l] = S;
|
|
2440
2473
|
l = T[l];
|
|
2441
|
-
|
|
2474
|
+
O.set(d, l);
|
|
2442
2475
|
}
|
|
2443
2476
|
}
|
|
2444
2477
|
for (l = a; l < e.length; l++) {
|
|
2445
|
-
if (l in
|
|
2446
|
-
const i = wrap(
|
|
2478
|
+
if (l in _) {
|
|
2479
|
+
const i = wrap(_[l], t);
|
|
2447
2480
|
t[STORE_NODE][l] && setSignal(t[STORE_NODE][l], i);
|
|
2448
2481
|
applyState(e[l], i, n);
|
|
2449
2482
|
} else t[STORE_NODE][l] && setSignal(t[STORE_NODE][l], wrap(e[l], t));
|
|
2450
2483
|
}
|
|
2451
|
-
if (a < e.length)
|
|
2484
|
+
if (a < e.length) s = true;
|
|
2452
2485
|
} else if (e.length) {
|
|
2453
|
-
for (let
|
|
2454
|
-
const u = getOverrideValue(i, r,
|
|
2486
|
+
for (let s = 0, u = e.length; s < u; s++) {
|
|
2487
|
+
const u = getOverrideValue(i, r, s, o);
|
|
2455
2488
|
isWrappable(u)
|
|
2456
|
-
? applyState(e[
|
|
2457
|
-
: t[STORE_NODE][
|
|
2489
|
+
? applyState(e[s], wrap(u, t), n)
|
|
2490
|
+
: t[STORE_NODE][s] && setSignal(t[STORE_NODE][s], e[s]);
|
|
2458
2491
|
}
|
|
2459
2492
|
}
|
|
2460
2493
|
if (u !== e.length) {
|
|
2461
|
-
|
|
2494
|
+
s = true;
|
|
2462
2495
|
t[STORE_NODE].length && setSignal(t[STORE_NODE].length, e.length);
|
|
2463
2496
|
}
|
|
2464
|
-
|
|
2497
|
+
s && t[STORE_NODE][$TRACK] && setSignal(t[STORE_NODE][$TRACK], void 0);
|
|
2465
2498
|
return;
|
|
2466
2499
|
}
|
|
2467
|
-
if (
|
|
2468
|
-
const u =
|
|
2469
|
-
const c = u ? getAllKeys(i, r, e) : Object.keys(
|
|
2500
|
+
if (s) {
|
|
2501
|
+
const u = s[$TRACK];
|
|
2502
|
+
const c = u ? getAllKeys(i, r, e) : Object.keys(s);
|
|
2470
2503
|
for (let l = 0, a = c.length; l < a; l++) {
|
|
2471
2504
|
const a = c[l];
|
|
2472
|
-
const f =
|
|
2473
|
-
const E = unwrap(getOverrideValue(i, r, a,
|
|
2505
|
+
const f = s[a];
|
|
2506
|
+
const E = unwrap(getOverrideValue(i, r, a, o));
|
|
2474
2507
|
let S = unwrap(e[a]);
|
|
2475
2508
|
if (E === S) continue;
|
|
2476
2509
|
if (!E || !isWrappable(E) || !isWrappable(S) || (n(E) != null && n(E) !== n(S))) {
|
|
@@ -2479,11 +2512,11 @@ function applyStateSlow(e, t, n) {
|
|
|
2479
2512
|
} else applyState(S, wrap(E, t), n);
|
|
2480
2513
|
}
|
|
2481
2514
|
}
|
|
2482
|
-
if ((
|
|
2483
|
-
const t = Object.keys(
|
|
2515
|
+
if ((s = t[STORE_HAS])) {
|
|
2516
|
+
const t = Object.keys(s);
|
|
2484
2517
|
for (let n = 0, i = t.length; n < i; n++) {
|
|
2485
2518
|
const i = t[n];
|
|
2486
|
-
setSignal(
|
|
2519
|
+
setSignal(s[i], i in e);
|
|
2487
2520
|
}
|
|
2488
2521
|
}
|
|
2489
2522
|
}
|
|
@@ -2517,34 +2550,34 @@ function createProjectionInternal(e, t, n) {
|
|
|
2517
2550
|
r.set(e, t);
|
|
2518
2551
|
return t;
|
|
2519
2552
|
};
|
|
2520
|
-
const
|
|
2553
|
+
const o = wrapProjection(t);
|
|
2521
2554
|
i = computed(() => {
|
|
2522
2555
|
if (!i) i = getOwner();
|
|
2523
|
-
runProjectionComputed(
|
|
2556
|
+
runProjectionComputed(o, e, n?.key || "id");
|
|
2524
2557
|
}, undefined);
|
|
2525
|
-
i.
|
|
2526
|
-
return { store:
|
|
2558
|
+
i.Oe &= ~CONFIG_AUTO_DISPOSE;
|
|
2559
|
+
return { store: o, node: i };
|
|
2527
2560
|
}
|
|
2528
2561
|
function createProjection(e, t, n) {
|
|
2529
2562
|
return createProjectionInternal(e, t, n).store;
|
|
2530
2563
|
}
|
|
2531
2564
|
function runProjectionComputed(e, t, n, i) {
|
|
2532
2565
|
const r = getOwner();
|
|
2533
|
-
let
|
|
2534
|
-
let
|
|
2566
|
+
let o = false;
|
|
2567
|
+
let s;
|
|
2535
2568
|
const u = new Proxy(
|
|
2536
2569
|
e,
|
|
2537
|
-
createWriteTraps(() => !
|
|
2570
|
+
createWriteTraps(() => !o || r.ve === s)
|
|
2538
2571
|
);
|
|
2539
2572
|
storeSetter(u, u => {
|
|
2540
|
-
|
|
2541
|
-
|
|
2573
|
+
s = t(u);
|
|
2574
|
+
o = true;
|
|
2542
2575
|
const commit = t => {
|
|
2543
2576
|
if (t === u || t === undefined) return;
|
|
2544
2577
|
const write = () => storeSetter(e, reconcile(t, n));
|
|
2545
2578
|
i ? i(write) : write();
|
|
2546
2579
|
};
|
|
2547
|
-
commit(handleAsync(r,
|
|
2580
|
+
commit(handleAsync(r, s, commit));
|
|
2548
2581
|
});
|
|
2549
2582
|
return r;
|
|
2550
2583
|
}
|
|
@@ -2652,6 +2685,16 @@ function writeOnly(e) {
|
|
|
2652
2685
|
function unwrapStoreValue(e) {
|
|
2653
2686
|
return e?.[$TARGET]?.[STORE_VALUE] ?? e;
|
|
2654
2687
|
}
|
|
2688
|
+
function isPrototypePollutionKey$1(e) {
|
|
2689
|
+
return e === "__proto__" || e === "constructor" || e === "prototype";
|
|
2690
|
+
}
|
|
2691
|
+
function hasOwnStoreProperty(e, t) {
|
|
2692
|
+
const n = e[STORE_OPTIMISTIC_OVERRIDE];
|
|
2693
|
+
if (n && Object.prototype.hasOwnProperty.call(n, t) && n[t] !== $DELETED) return true;
|
|
2694
|
+
const i = e[STORE_OVERRIDE];
|
|
2695
|
+
if (i && Object.prototype.hasOwnProperty.call(i, t) && i[t] !== $DELETED) return true;
|
|
2696
|
+
return Object.prototype.hasOwnProperty.call(unwrapStoreValue(e[STORE_VALUE]), t);
|
|
2697
|
+
}
|
|
2655
2698
|
function hasInheritedAccessor(e, t) {
|
|
2656
2699
|
let n = Object.getPrototypeOf(e);
|
|
2657
2700
|
while (n && n !== Object.prototype) {
|
|
@@ -2666,7 +2709,7 @@ function getNodes(e, t) {
|
|
|
2666
2709
|
if (!n) e[t] = n = Object.create(null);
|
|
2667
2710
|
return n;
|
|
2668
2711
|
}
|
|
2669
|
-
function getNode(e, t, n, i, r = isEqual,
|
|
2712
|
+
function getNode(e, t, n, i, r = isEqual, o, s) {
|
|
2670
2713
|
if (e[t]) return e[t];
|
|
2671
2714
|
const u = signal(
|
|
2672
2715
|
n,
|
|
@@ -2678,11 +2721,11 @@ function getNode(e, t, n, i, r = isEqual, s, o) {
|
|
|
2678
2721
|
},
|
|
2679
2722
|
i
|
|
2680
2723
|
);
|
|
2681
|
-
if (
|
|
2724
|
+
if (o) {
|
|
2682
2725
|
u.K = NOT_PENDING;
|
|
2683
2726
|
}
|
|
2684
|
-
if (
|
|
2685
|
-
const e =
|
|
2727
|
+
if (s && t in s) {
|
|
2728
|
+
const e = s[t];
|
|
2686
2729
|
u.pe = e === undefined ? NO_SNAPSHOT : e;
|
|
2687
2730
|
snapshotSources?.add(u);
|
|
2688
2731
|
}
|
|
@@ -2698,8 +2741,8 @@ function getKeys(e, t, n = true) {
|
|
|
2698
2741
|
const i = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
2699
2742
|
if (!t) return i;
|
|
2700
2743
|
const r = new Set(i);
|
|
2701
|
-
const
|
|
2702
|
-
for (const e of
|
|
2744
|
+
const o = Reflect.ownKeys(t);
|
|
2745
|
+
for (const e of o) {
|
|
2703
2746
|
if (t[e] !== $DELETED) r.add(e);
|
|
2704
2747
|
else r.delete(e);
|
|
2705
2748
|
}
|
|
@@ -2735,33 +2778,33 @@ function prepareStoreWrite(e, t, n) {
|
|
|
2735
2778
|
e[STORE_SNAPSHOT_PROPS][n] = r;
|
|
2736
2779
|
}
|
|
2737
2780
|
}
|
|
2738
|
-
const
|
|
2739
|
-
const
|
|
2740
|
-
if (
|
|
2741
|
-
return { base: r, overrideKey:
|
|
2781
|
+
const o = e[STORE_OPTIMISTIC] && !projectionWriteActive;
|
|
2782
|
+
const s = o ? STORE_OPTIMISTIC_OVERRIDE : STORE_OVERRIDE;
|
|
2783
|
+
if (o) trackOptimisticStore(t);
|
|
2784
|
+
return { base: r, overrideKey: s, state: i };
|
|
2742
2785
|
}
|
|
2743
2786
|
function upsertStoreNode(e, t, n, i, r) {
|
|
2744
2787
|
if (t[n]) return t[n];
|
|
2745
|
-
const
|
|
2746
|
-
const
|
|
2747
|
-
registerTransientStoreNode(
|
|
2748
|
-
return
|
|
2788
|
+
const o = isWrappable(i) ? wrap(i, e) : i;
|
|
2789
|
+
const s = getNode(t, n, o, e[STORE_FIREWALL], isEqual, e[STORE_OPTIMISTIC], r);
|
|
2790
|
+
registerTransientStoreNode(s);
|
|
2791
|
+
return s;
|
|
2749
2792
|
}
|
|
2750
|
-
function notifyStoreProperty(e, t, n, i, r,
|
|
2751
|
-
const
|
|
2793
|
+
function notifyStoreProperty(e, t, n, i, r, o) {
|
|
2794
|
+
const s = projectionWriteActive || e[STORE_OPTIMISTIC];
|
|
2752
2795
|
const u = n !== "delete";
|
|
2753
2796
|
const c = e[STORE_HAS]?.[t];
|
|
2754
2797
|
if (c) {
|
|
2755
2798
|
setSignal(c, u);
|
|
2756
|
-
} else if (!
|
|
2757
|
-
const n = upsertStoreNode(e, getNodes(e, STORE_HAS), t,
|
|
2799
|
+
} else if (!s && n !== "invalidate" && o !== u) {
|
|
2800
|
+
const n = upsertStoreNode(e, getNodes(e, STORE_HAS), t, o);
|
|
2758
2801
|
setSignal(n, u);
|
|
2759
2802
|
}
|
|
2760
2803
|
const l = getNodes(e, STORE_NODE);
|
|
2761
2804
|
if (n === "set") {
|
|
2762
2805
|
if (l[t]) {
|
|
2763
2806
|
setSignal(l[t], () => (isWrappable(i) ? wrap(i, e) : i));
|
|
2764
|
-
} else if (!
|
|
2807
|
+
} else if (!s) {
|
|
2765
2808
|
const n = upsertStoreNode(e, l, t, r, e[STORE_SNAPSHOT_PROPS]);
|
|
2766
2809
|
setSignal(n, () => (isWrappable(i) ? wrap(i, e) : i));
|
|
2767
2810
|
}
|
|
@@ -2773,7 +2816,7 @@ function notifyStoreProperty(e, t, n, i, r, s) {
|
|
|
2773
2816
|
} else {
|
|
2774
2817
|
if (l[t]) {
|
|
2775
2818
|
setSignal(l[t], undefined);
|
|
2776
|
-
} else if (!
|
|
2819
|
+
} else if (!s) {
|
|
2777
2820
|
const n = upsertStoreNode(e, l, t, r, e[STORE_SNAPSHOT_PROPS]);
|
|
2778
2821
|
setSignal(n, undefined);
|
|
2779
2822
|
}
|
|
@@ -2792,7 +2835,7 @@ const storeTraps = {
|
|
|
2792
2835
|
}
|
|
2793
2836
|
const i = getNodes(e, STORE_NODE);
|
|
2794
2837
|
const r = i[t];
|
|
2795
|
-
const
|
|
2838
|
+
const o = e[STORE_VALUE];
|
|
2796
2839
|
if (
|
|
2797
2840
|
!r &&
|
|
2798
2841
|
!e[STORE_OVERRIDE] &&
|
|
@@ -2800,17 +2843,17 @@ const storeTraps = {
|
|
|
2800
2843
|
!e[STORE_CUSTOM_PROTO] &&
|
|
2801
2844
|
!e[STORE_OPTIMISTIC] &&
|
|
2802
2845
|
!e[STORE_SNAPSHOT_PROPS] &&
|
|
2803
|
-
!
|
|
2804
|
-
!(t in
|
|
2846
|
+
!o[$TARGET] &&
|
|
2847
|
+
!(t in o) &&
|
|
2805
2848
|
getObserver() &&
|
|
2806
2849
|
!writeOnly(n)
|
|
2807
2850
|
) {
|
|
2808
2851
|
return read(getNode(i, t, undefined, e[STORE_FIREWALL]));
|
|
2809
2852
|
}
|
|
2810
|
-
const
|
|
2811
|
-
const u =
|
|
2853
|
+
const s = e[STORE_OPTIMISTIC_OVERRIDE] && t in e[STORE_OPTIMISTIC_OVERRIDE];
|
|
2854
|
+
const u = s || (e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]);
|
|
2812
2855
|
const c = !!e[STORE_VALUE][$TARGET];
|
|
2813
|
-
const l =
|
|
2856
|
+
const l = s
|
|
2814
2857
|
? e[STORE_OPTIMISTIC_OVERRIDE]
|
|
2815
2858
|
: e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]
|
|
2816
2859
|
? e[STORE_OVERRIDE]
|
|
@@ -2826,6 +2869,7 @@ const storeTraps = {
|
|
|
2826
2869
|
}
|
|
2827
2870
|
}
|
|
2828
2871
|
if (writeOnly(n)) {
|
|
2872
|
+
if (isPrototypePollutionKey$1(t) && !hasOwnStoreProperty(e, t)) return undefined;
|
|
2829
2873
|
let n =
|
|
2830
2874
|
r && (u || !c)
|
|
2831
2875
|
? r.K !== undefined && r.K !== NOT_PENDING
|
|
@@ -2883,10 +2927,11 @@ const storeTraps = {
|
|
|
2883
2927
|
return n;
|
|
2884
2928
|
},
|
|
2885
2929
|
set(e, t, n) {
|
|
2930
|
+
if (t === "__proto__") return true;
|
|
2886
2931
|
const i = e[$PROXY];
|
|
2887
2932
|
if (writeOnly(i)) {
|
|
2888
2933
|
untrack(() => {
|
|
2889
|
-
const { base: r, overrideKey:
|
|
2934
|
+
const { base: r, overrideKey: o, state: s } = prepareStoreWrite(e, i, t);
|
|
2890
2935
|
const u =
|
|
2891
2936
|
e[STORE_OPTIMISTIC_OVERRIDE] && t in e[STORE_OPTIMISTIC_OVERRIDE]
|
|
2892
2937
|
? e[STORE_OPTIMISTIC_OVERRIDE][t]
|
|
@@ -2900,7 +2945,7 @@ const storeTraps = {
|
|
|
2900
2945
|
? e[STORE_OVERRIDE][t] !== $DELETED
|
|
2901
2946
|
: t in e[STORE_VALUE];
|
|
2902
2947
|
const l = unwrapStoreValue(n);
|
|
2903
|
-
const a = Array.isArray(
|
|
2948
|
+
const a = Array.isArray(s) && t !== "length";
|
|
2904
2949
|
const f = a ? parseInt(t) + 1 : 0;
|
|
2905
2950
|
const E =
|
|
2906
2951
|
a &&
|
|
@@ -2908,17 +2953,17 @@ const storeTraps = {
|
|
|
2908
2953
|
? e[STORE_OPTIMISTIC_OVERRIDE].length
|
|
2909
2954
|
: e[STORE_OVERRIDE] && "length" in e[STORE_OVERRIDE]
|
|
2910
2955
|
? e[STORE_OVERRIDE].length
|
|
2911
|
-
:
|
|
2956
|
+
: s.length);
|
|
2912
2957
|
const S = a && f > E ? f : undefined;
|
|
2913
2958
|
if (u === l && S === undefined) return true;
|
|
2914
|
-
if (l !== undefined && l === r && S === undefined) delete e[
|
|
2959
|
+
if (l !== undefined && l === r && S === undefined) delete e[o]?.[t];
|
|
2915
2960
|
else {
|
|
2916
|
-
const n = e[
|
|
2961
|
+
const n = e[o] || (e[o] = Object.create(null));
|
|
2917
2962
|
n[t] = l;
|
|
2918
2963
|
if (S !== undefined) n.length = S;
|
|
2919
2964
|
}
|
|
2920
2965
|
notifyStoreProperty(e, t, "set", l, u, c);
|
|
2921
|
-
if (Array.isArray(
|
|
2966
|
+
if (Array.isArray(s) && t !== "length" && S !== undefined) {
|
|
2922
2967
|
const t = getNodes(e, STORE_NODE);
|
|
2923
2968
|
if (t.length) {
|
|
2924
2969
|
setSignal(t.length, S);
|
|
@@ -2933,12 +2978,13 @@ const storeTraps = {
|
|
|
2933
2978
|
return true;
|
|
2934
2979
|
},
|
|
2935
2980
|
defineProperty(e, t, n) {
|
|
2981
|
+
if (t === "__proto__") return true;
|
|
2936
2982
|
const i = e[$PROXY];
|
|
2937
2983
|
if (writeOnly(i)) {
|
|
2938
2984
|
untrack(() => {
|
|
2939
|
-
const { base: r, overrideKey:
|
|
2940
|
-
const
|
|
2941
|
-
Object.defineProperty(e[
|
|
2985
|
+
const { base: r, overrideKey: o } = prepareStoreWrite(e, i, t);
|
|
2986
|
+
const s = "value" in n ? { ...n, value: unwrapStoreValue(n.value) } : n;
|
|
2987
|
+
Object.defineProperty(e[o] || (e[o] = Object.create(null)), t, s);
|
|
2942
2988
|
notifyStoreProperty(e, t, "invalidate");
|
|
2943
2989
|
if (false);
|
|
2944
2990
|
});
|
|
@@ -2946,6 +2992,7 @@ const storeTraps = {
|
|
|
2946
2992
|
return true;
|
|
2947
2993
|
},
|
|
2948
2994
|
deleteProperty(e, t) {
|
|
2995
|
+
if (t === "__proto__") return true;
|
|
2949
2996
|
const n = e[STORE_OPTIMISTIC_OVERRIDE]?.[t] === $DELETED;
|
|
2950
2997
|
const i = e[STORE_OVERRIDE]?.[t] === $DELETED;
|
|
2951
2998
|
if (writeOnly(e[$PROXY]) && !n && !i) {
|
|
@@ -3040,9 +3087,9 @@ function createOptimisticStore(e, t, n) {
|
|
|
3040
3087
|
GlobalQueue.de ||= clearOptimisticStore;
|
|
3041
3088
|
const i = typeof e === "function";
|
|
3042
3089
|
const r = i ? t : e;
|
|
3043
|
-
const
|
|
3044
|
-
const { store:
|
|
3045
|
-
return [
|
|
3090
|
+
const o = i ? e : undefined;
|
|
3091
|
+
const { store: s } = createOptimisticProjectionInternal(o, r, n);
|
|
3092
|
+
return [s, e => storeSetter(s, e)];
|
|
3046
3093
|
}
|
|
3047
3094
|
function clearOptimisticStore(e) {
|
|
3048
3095
|
const t = e[$TARGET];
|
|
@@ -3092,7 +3139,7 @@ function createOptimisticProjectionInternal(e, t, n) {
|
|
|
3092
3139
|
r.set(e, t);
|
|
3093
3140
|
return t;
|
|
3094
3141
|
};
|
|
3095
|
-
const
|
|
3142
|
+
const o = wrapProjection(t);
|
|
3096
3143
|
if (e) {
|
|
3097
3144
|
const wrapCommit = e => {
|
|
3098
3145
|
setProjectionWriteActive(true);
|
|
@@ -3105,14 +3152,14 @@ function createOptimisticProjectionInternal(e, t, n) {
|
|
|
3105
3152
|
i = computed(() => {
|
|
3106
3153
|
setProjectionWriteActive(true);
|
|
3107
3154
|
try {
|
|
3108
|
-
runProjectionComputed(
|
|
3155
|
+
runProjectionComputed(o, e, n?.key || "id", wrapCommit);
|
|
3109
3156
|
} finally {
|
|
3110
3157
|
setProjectionWriteActive(false);
|
|
3111
3158
|
}
|
|
3112
3159
|
}, undefined);
|
|
3113
|
-
i.
|
|
3160
|
+
i.Oe &= ~CONFIG_AUTO_DISPOSE;
|
|
3114
3161
|
}
|
|
3115
|
-
return { store:
|
|
3162
|
+
return { store: o, node: i };
|
|
3116
3163
|
}
|
|
3117
3164
|
const DELETE = Symbol(0);
|
|
3118
3165
|
function isPrototypePollutionKey(e) {
|
|
@@ -3123,9 +3170,9 @@ function updatePath(e, t, n = 0) {
|
|
|
3123
3170
|
r = e;
|
|
3124
3171
|
if (n < t.length - 1) {
|
|
3125
3172
|
i = t[n];
|
|
3126
|
-
const
|
|
3127
|
-
const
|
|
3128
|
-
if (
|
|
3173
|
+
const o = typeof i;
|
|
3174
|
+
const s = Array.isArray(e);
|
|
3175
|
+
if (o === "string" && isPrototypePollutionKey(i)) return;
|
|
3129
3176
|
if (Array.isArray(i)) {
|
|
3130
3177
|
for (let r = 0; r < i.length; r++) {
|
|
3131
3178
|
t[n] = i[r];
|
|
@@ -3133,7 +3180,7 @@ function updatePath(e, t, n = 0) {
|
|
|
3133
3180
|
}
|
|
3134
3181
|
t[n] = i;
|
|
3135
3182
|
return;
|
|
3136
|
-
} else if (
|
|
3183
|
+
} else if (s && o === "function") {
|
|
3137
3184
|
for (let r = 0; r < e.length; r++) {
|
|
3138
3185
|
if (i(e[r], r)) {
|
|
3139
3186
|
t[n] = r;
|
|
@@ -3142,9 +3189,9 @@ function updatePath(e, t, n = 0) {
|
|
|
3142
3189
|
}
|
|
3143
3190
|
t[n] = i;
|
|
3144
3191
|
return;
|
|
3145
|
-
} else if (
|
|
3146
|
-
const { from: r = 0, to:
|
|
3147
|
-
for (let i = r; i <=
|
|
3192
|
+
} else if (s && o === "object") {
|
|
3193
|
+
const { from: r = 0, to: o = e.length - 1, by: s = 1 } = i;
|
|
3194
|
+
for (let i = r; i <= o; i += s) {
|
|
3148
3195
|
t[n] = i;
|
|
3149
3196
|
updatePath(e, t, n);
|
|
3150
3197
|
}
|
|
@@ -3156,26 +3203,26 @@ function updatePath(e, t, n = 0) {
|
|
|
3156
3203
|
}
|
|
3157
3204
|
r = e[i];
|
|
3158
3205
|
}
|
|
3159
|
-
let
|
|
3160
|
-
if (typeof
|
|
3161
|
-
|
|
3162
|
-
if (
|
|
3206
|
+
let o = t[t.length - 1];
|
|
3207
|
+
if (typeof o === "function") {
|
|
3208
|
+
o = o(r);
|
|
3209
|
+
if (o === r) return;
|
|
3163
3210
|
}
|
|
3164
|
-
if (i === undefined &&
|
|
3165
|
-
if (
|
|
3211
|
+
if (i === undefined && o == undefined) return;
|
|
3212
|
+
if (o === DELETE) {
|
|
3166
3213
|
delete e[i];
|
|
3167
|
-
} else if (i === undefined || (isWrappable(r) && isWrappable(
|
|
3214
|
+
} else if (i === undefined || (isWrappable(r) && isWrappable(o) && !Array.isArray(o))) {
|
|
3168
3215
|
const t = i !== undefined ? e[i] : e;
|
|
3169
|
-
const n = Object.keys(
|
|
3216
|
+
const n = Object.keys(o);
|
|
3170
3217
|
for (let e = 0; e < n.length; e++) {
|
|
3171
3218
|
const i = n[e];
|
|
3172
3219
|
if (isPrototypePollutionKey(i)) continue;
|
|
3173
|
-
const r = Object.getOwnPropertyDescriptor(
|
|
3220
|
+
const r = Object.getOwnPropertyDescriptor(o, i);
|
|
3174
3221
|
if (r.get || r.set) Object.defineProperty(t, i, r);
|
|
3175
3222
|
else t[i] = r.value;
|
|
3176
3223
|
}
|
|
3177
3224
|
} else {
|
|
3178
|
-
e[i] =
|
|
3225
|
+
e[i] = o;
|
|
3179
3226
|
}
|
|
3180
3227
|
}
|
|
3181
3228
|
const storePath = Object.assign(
|
|
@@ -3187,28 +3234,28 @@ const storePath = Object.assign(
|
|
|
3187
3234
|
{ DELETE: DELETE }
|
|
3188
3235
|
);
|
|
3189
3236
|
function snapshotImpl(e, t, n, i) {
|
|
3190
|
-
let r,
|
|
3237
|
+
let r, o, s, u, c, l;
|
|
3191
3238
|
if (!isWrappable(e)) return e;
|
|
3192
3239
|
if (n && n.has(e)) return n.get(e);
|
|
3193
3240
|
if (!n) n = new Map();
|
|
3194
3241
|
if ((r = e[$TARGET] || i?.get(e)?.[$TARGET])) {
|
|
3195
3242
|
if (t) trackSelf(r, $TRACK);
|
|
3196
|
-
|
|
3197
|
-
|
|
3243
|
+
s = r[STORE_OVERRIDE];
|
|
3244
|
+
o = Array.isArray(r[STORE_VALUE]);
|
|
3198
3245
|
n.set(
|
|
3199
3246
|
e,
|
|
3200
|
-
|
|
3247
|
+
s ? (u = o ? [] : Object.create(Object.getPrototypeOf(r[STORE_VALUE]))) : r[STORE_VALUE]
|
|
3201
3248
|
);
|
|
3202
3249
|
e = r[STORE_VALUE];
|
|
3203
3250
|
i = storeLookup;
|
|
3204
3251
|
} else {
|
|
3205
|
-
|
|
3252
|
+
o = Array.isArray(e);
|
|
3206
3253
|
n.set(e, e);
|
|
3207
3254
|
}
|
|
3208
|
-
if (
|
|
3209
|
-
const
|
|
3210
|
-
for (let a = 0; a <
|
|
3211
|
-
l =
|
|
3255
|
+
if (o) {
|
|
3256
|
+
const o = s?.length || e.length;
|
|
3257
|
+
for (let a = 0; a < o; a++) {
|
|
3258
|
+
l = s && a in s ? s[a] : e[a];
|
|
3212
3259
|
if (l === $DELETED) continue;
|
|
3213
3260
|
if (t && isWrappable(l)) wrap(l, r);
|
|
3214
3261
|
if ((c = snapshotImpl(l, t, n, i)) !== l || u) {
|
|
@@ -3217,12 +3264,12 @@ function snapshotImpl(e, t, n, i) {
|
|
|
3217
3264
|
}
|
|
3218
3265
|
}
|
|
3219
3266
|
} else {
|
|
3220
|
-
const
|
|
3221
|
-
for (let a = 0, f =
|
|
3222
|
-
let f =
|
|
3223
|
-
const E = getPropertyDescriptor(e,
|
|
3267
|
+
const o = getKeys(e, s);
|
|
3268
|
+
for (let a = 0, f = o.length; a < f; a++) {
|
|
3269
|
+
let f = o[a];
|
|
3270
|
+
const E = getPropertyDescriptor(e, s, f);
|
|
3224
3271
|
if (E.get) continue;
|
|
3225
|
-
l =
|
|
3272
|
+
l = s && f in s ? s[f] : e[f];
|
|
3226
3273
|
if (t && isWrappable(l)) wrap(l, r);
|
|
3227
3274
|
if ((c = snapshotImpl(l, t, n, i)) !== e[f] || u) {
|
|
3228
3275
|
if (!u) {
|
|
@@ -3281,9 +3328,9 @@ function merge(...e) {
|
|
|
3281
3328
|
for (let i = 0; i < e.length; i++) {
|
|
3282
3329
|
const r = e[i];
|
|
3283
3330
|
t = t || (!!r && $PROXY in r);
|
|
3284
|
-
const
|
|
3285
|
-
if (
|
|
3286
|
-
for (let e = 0; e <
|
|
3331
|
+
const o = !!r && r[$SOURCES];
|
|
3332
|
+
if (o) {
|
|
3333
|
+
for (let e = 0; e < o.length; e++) n.push(o[e]);
|
|
3287
3334
|
} else n.push(typeof r === "function" ? ((t = true), createMemo(r)) : r);
|
|
3288
3335
|
}
|
|
3289
3336
|
if (SUPPORTS_PROXY && t) {
|
|
@@ -3316,35 +3363,35 @@ function merge(...e) {
|
|
|
3316
3363
|
}
|
|
3317
3364
|
const i = Object.create(null);
|
|
3318
3365
|
let r = false;
|
|
3319
|
-
let
|
|
3320
|
-
for (let e =
|
|
3366
|
+
let o = n.length - 1;
|
|
3367
|
+
for (let e = o; e >= 0; e--) {
|
|
3321
3368
|
const t = n[e];
|
|
3322
3369
|
if (!t) {
|
|
3323
|
-
e ===
|
|
3370
|
+
e === o && o--;
|
|
3324
3371
|
continue;
|
|
3325
3372
|
}
|
|
3326
|
-
const
|
|
3327
|
-
for (let n =
|
|
3328
|
-
const u =
|
|
3373
|
+
const s = Object.getOwnPropertyNames(t);
|
|
3374
|
+
for (let n = s.length - 1; n >= 0; n--) {
|
|
3375
|
+
const u = s[n];
|
|
3329
3376
|
if (u === "__proto__" || u === "constructor") continue;
|
|
3330
3377
|
if (!i[u]) {
|
|
3331
|
-
r = r || e !==
|
|
3378
|
+
r = r || e !== o;
|
|
3332
3379
|
const n = Object.getOwnPropertyDescriptor(t, u);
|
|
3333
3380
|
i[u] = n.get ? { enumerable: true, configurable: true, get: n.get.bind(t) } : n;
|
|
3334
3381
|
}
|
|
3335
3382
|
}
|
|
3336
3383
|
}
|
|
3337
|
-
if (!r) return n[
|
|
3338
|
-
const
|
|
3384
|
+
if (!r) return n[o];
|
|
3385
|
+
const s = {};
|
|
3339
3386
|
const u = Object.keys(i);
|
|
3340
3387
|
for (let e = u.length - 1; e >= 0; e--) {
|
|
3341
3388
|
const t = u[e],
|
|
3342
3389
|
n = i[t];
|
|
3343
|
-
if (n.get) Object.defineProperty(
|
|
3344
|
-
else
|
|
3390
|
+
if (n.get) Object.defineProperty(s, t, n);
|
|
3391
|
+
else s[t] = n.value;
|
|
3345
3392
|
}
|
|
3346
|
-
|
|
3347
|
-
return
|
|
3393
|
+
s[$SOURCES] = n;
|
|
3394
|
+
return s;
|
|
3348
3395
|
}
|
|
3349
3396
|
function omit(e, ...t) {
|
|
3350
3397
|
if (SUPPORTS_PROXY && $PROXY in e) {
|
|
@@ -3366,12 +3413,12 @@ function omit(e, ...t) {
|
|
|
3366
3413
|
const n = {};
|
|
3367
3414
|
const i = Object.getOwnPropertyNames(e);
|
|
3368
3415
|
const r = t.length > 4 && i.length > t.length ? new Set(t) : undefined;
|
|
3369
|
-
for (const
|
|
3370
|
-
if (r ? !r.has(
|
|
3371
|
-
const t = Object.getOwnPropertyDescriptor(e,
|
|
3416
|
+
for (const o of i) {
|
|
3417
|
+
if (r ? !r.has(o) : !t.includes(o)) {
|
|
3418
|
+
const t = Object.getOwnPropertyDescriptor(e, o);
|
|
3372
3419
|
!t.get && !t.set && t.enumerable && t.writable && t.configurable
|
|
3373
|
-
? (n[
|
|
3374
|
-
: Object.defineProperty(n,
|
|
3420
|
+
? (n[o] = t.value)
|
|
3421
|
+
: Object.defineProperty(n, o, t);
|
|
3375
3422
|
}
|
|
3376
3423
|
}
|
|
3377
3424
|
return n;
|
|
@@ -3379,24 +3426,24 @@ function omit(e, ...t) {
|
|
|
3379
3426
|
function mapArray(e, t, n) {
|
|
3380
3427
|
const i = typeof n?.keyed === "function" ? n.keyed : undefined;
|
|
3381
3428
|
const r = t.length > 1;
|
|
3382
|
-
const
|
|
3383
|
-
const
|
|
3429
|
+
const o = t;
|
|
3430
|
+
const s = {
|
|
3384
3431
|
Ze: createOwner(),
|
|
3385
3432
|
qe: 0,
|
|
3386
3433
|
Be: e,
|
|
3387
3434
|
ze: [],
|
|
3388
|
-
Xe:
|
|
3435
|
+
Xe: o,
|
|
3389
3436
|
Je: [],
|
|
3390
3437
|
et: [],
|
|
3391
3438
|
tt: i,
|
|
3392
3439
|
nt: i || n?.keyed === false ? [] : undefined,
|
|
3393
3440
|
it: r && n?.keyed !== false ? [] : undefined,
|
|
3394
3441
|
rt: n?.keyed === false,
|
|
3395
|
-
|
|
3442
|
+
ot: n?.fallback
|
|
3396
3443
|
};
|
|
3397
|
-
const u = computed(updateKeyedMap.bind(
|
|
3398
|
-
|
|
3399
|
-
u.
|
|
3444
|
+
const u = computed(updateKeyedMap.bind(s));
|
|
3445
|
+
s.Ze.u = u;
|
|
3446
|
+
u.Oe &= ~CONFIG_AUTO_DISPOSE;
|
|
3400
3447
|
return accessor(u);
|
|
3401
3448
|
}
|
|
3402
3449
|
const pureOptions = { ownedWrite: true };
|
|
@@ -3438,8 +3485,8 @@ function updateKeyedMap() {
|
|
|
3438
3485
|
this.nt && (this.nt = []);
|
|
3439
3486
|
this.it && (this.it = []);
|
|
3440
3487
|
}
|
|
3441
|
-
if (this.
|
|
3442
|
-
this.Je[0] = runWithOwner((this.et[0] = createOwner()), this.
|
|
3488
|
+
if (this.ot && !this.Je[0]) {
|
|
3489
|
+
this.Je[0] = runWithOwner((this.et[0] = createOwner()), this.ot);
|
|
3443
3490
|
}
|
|
3444
3491
|
} else if (this.qe === 0) {
|
|
3445
3492
|
if (this.et[0]) this.et[0].dispose();
|
|
@@ -3450,8 +3497,8 @@ function updateKeyedMap() {
|
|
|
3450
3497
|
}
|
|
3451
3498
|
this.qe = t;
|
|
3452
3499
|
} else {
|
|
3453
|
-
let
|
|
3454
|
-
|
|
3500
|
+
let o,
|
|
3501
|
+
s,
|
|
3455
3502
|
u,
|
|
3456
3503
|
c,
|
|
3457
3504
|
l,
|
|
@@ -3462,34 +3509,34 @@ function updateKeyedMap() {
|
|
|
3462
3509
|
T = this.nt ? new Array(t) : undefined,
|
|
3463
3510
|
d = this.it ? new Array(t) : undefined;
|
|
3464
3511
|
for (
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3512
|
+
o = 0, s = Math.min(this.qe, t);
|
|
3513
|
+
o < s && (this.ze[o] === e[o] || (this.nt && compare(this.tt, this.ze[o], e[o])));
|
|
3514
|
+
o++
|
|
3468
3515
|
) {
|
|
3469
|
-
if (this.nt) setSignal(this.nt[
|
|
3516
|
+
if (this.nt) setSignal(this.nt[o], e[o]);
|
|
3470
3517
|
}
|
|
3471
3518
|
for (
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
u >=
|
|
3475
|
-
(this.ze[
|
|
3476
|
-
|
|
3519
|
+
s = this.qe - 1, u = t - 1;
|
|
3520
|
+
s >= o &&
|
|
3521
|
+
u >= o &&
|
|
3522
|
+
(this.ze[s] === e[u] || (this.nt && compare(this.tt, this.ze[s], e[u])));
|
|
3523
|
+
s--, u--
|
|
3477
3524
|
) {
|
|
3478
|
-
E[u] = this.Je[
|
|
3479
|
-
S[u] = this.et[
|
|
3480
|
-
T && (T[u] = this.nt[
|
|
3481
|
-
d && (d[u] = this.it[
|
|
3525
|
+
E[u] = this.Je[s];
|
|
3526
|
+
S[u] = this.et[s];
|
|
3527
|
+
T && (T[u] = this.nt[s]);
|
|
3528
|
+
d && (d[u] = this.it[s]);
|
|
3482
3529
|
}
|
|
3483
3530
|
a = new Map();
|
|
3484
3531
|
f = new Array(u + 1);
|
|
3485
|
-
for (i = u; i >=
|
|
3532
|
+
for (i = u; i >= o; i--) {
|
|
3486
3533
|
c = e[i];
|
|
3487
3534
|
l = this.tt ? this.tt(c) : c;
|
|
3488
3535
|
n = a.get(l);
|
|
3489
3536
|
f[i] = n === undefined ? -1 : n;
|
|
3490
3537
|
a.set(l, i);
|
|
3491
3538
|
}
|
|
3492
|
-
for (n =
|
|
3539
|
+
for (n = o; n <= s; n++) {
|
|
3493
3540
|
c = this.ze[n];
|
|
3494
3541
|
l = this.tt ? this.tt(c) : c;
|
|
3495
3542
|
i = a.get(l);
|
|
@@ -3502,7 +3549,7 @@ function updateKeyedMap() {
|
|
|
3502
3549
|
a.set(l, i);
|
|
3503
3550
|
} else this.et[n].dispose();
|
|
3504
3551
|
}
|
|
3505
|
-
for (i =
|
|
3552
|
+
for (i = o; i < t; i++) {
|
|
3506
3553
|
if (i in E) {
|
|
3507
3554
|
this.Je[i] = E[i];
|
|
3508
3555
|
this.et[i] = S[i];
|
|
@@ -3530,16 +3577,16 @@ function repeat(e, t, n) {
|
|
|
3530
3577
|
updateRepeat.bind({
|
|
3531
3578
|
Ze: createOwner(),
|
|
3532
3579
|
qe: 0,
|
|
3533
|
-
|
|
3580
|
+
st: 0,
|
|
3534
3581
|
ut: e,
|
|
3535
3582
|
Xe: i,
|
|
3536
3583
|
et: [],
|
|
3537
3584
|
Je: [],
|
|
3538
3585
|
ct: n?.from,
|
|
3539
|
-
|
|
3586
|
+
ot: n?.fallback
|
|
3540
3587
|
})
|
|
3541
3588
|
);
|
|
3542
|
-
r.
|
|
3589
|
+
r.Oe &= ~CONFIG_AUTO_DISPOSE;
|
|
3543
3590
|
return accessor(r);
|
|
3544
3591
|
}
|
|
3545
3592
|
function updateRepeat() {
|
|
@@ -3553,23 +3600,23 @@ function updateRepeat() {
|
|
|
3553
3600
|
this.Je = [];
|
|
3554
3601
|
this.qe = 0;
|
|
3555
3602
|
}
|
|
3556
|
-
if (this.
|
|
3557
|
-
this.Je[0] = runWithOwner((this.et[0] = createOwner()), this.
|
|
3603
|
+
if (this.ot && !this.Je[0]) {
|
|
3604
|
+
this.Je[0] = runWithOwner((this.et[0] = createOwner()), this.ot);
|
|
3558
3605
|
}
|
|
3559
3606
|
return;
|
|
3560
3607
|
}
|
|
3561
3608
|
const n = t + e;
|
|
3562
|
-
const i = this.
|
|
3609
|
+
const i = this.st + this.qe;
|
|
3563
3610
|
if (this.qe === 0 && this.et[0]) this.et[0].dispose();
|
|
3564
|
-
for (let e = n; e < i; e++) this.et[e - this.
|
|
3565
|
-
if (this.
|
|
3566
|
-
let e = this.
|
|
3611
|
+
for (let e = n; e < i; e++) this.et[e - this.st].dispose();
|
|
3612
|
+
if (this.st < t) {
|
|
3613
|
+
let e = this.st;
|
|
3567
3614
|
while (e < t && e < this.qe) this.et[e++].dispose();
|
|
3568
|
-
this.et.splice(0, t - this.
|
|
3569
|
-
this.Je.splice(0, t - this.
|
|
3570
|
-
} else if (this.
|
|
3571
|
-
let n = i - this.
|
|
3572
|
-
let r = this.
|
|
3615
|
+
this.et.splice(0, t - this.st);
|
|
3616
|
+
this.Je.splice(0, t - this.st);
|
|
3617
|
+
} else if (this.st > t) {
|
|
3618
|
+
let n = i - this.st - 1;
|
|
3619
|
+
let r = this.st - t;
|
|
3573
3620
|
this.et.length = this.Je.length = e;
|
|
3574
3621
|
while (n >= r) {
|
|
3575
3622
|
this.et[n] = this.et[n - r];
|
|
@@ -3584,7 +3631,7 @@ function updateRepeat() {
|
|
|
3584
3631
|
this.Je[e - t] = runWithOwner((this.et[e - t] = createOwner()), () => this.Xe(e));
|
|
3585
3632
|
}
|
|
3586
3633
|
this.Je = this.Je.slice(0, e);
|
|
3587
|
-
this.
|
|
3634
|
+
this.st = t;
|
|
3588
3635
|
this.qe = e;
|
|
3589
3636
|
});
|
|
3590
3637
|
return this.Je;
|
|
@@ -3601,7 +3648,7 @@ function boundaryComputed(e, t) {
|
|
|
3601
3648
|
n.te.notify(n, n.lt, i, r);
|
|
3602
3649
|
};
|
|
3603
3650
|
n.lt = t;
|
|
3604
|
-
n.
|
|
3651
|
+
n.Oe &= ~CONFIG_AUTO_DISPOSE;
|
|
3605
3652
|
recompute(n, true);
|
|
3606
3653
|
return n;
|
|
3607
3654
|
}
|
|
@@ -3611,7 +3658,7 @@ function createBoundChildren(e, t, n, i) {
|
|
|
3611
3658
|
cleanup(() => r.removeChild(e.te));
|
|
3612
3659
|
return runWithOwner(e, () => {
|
|
3613
3660
|
const e = computed(t);
|
|
3614
|
-
return boundaryComputed(() =>
|
|
3661
|
+
return boundaryComputed(() => flatten(read(e)), i);
|
|
3615
3662
|
});
|
|
3616
3663
|
}
|
|
3617
3664
|
const ON_INIT = Symbol();
|
|
@@ -3635,7 +3682,7 @@ function setSlotState(e, t, n, i) {
|
|
|
3635
3682
|
if (!n && e.dt === t) e.dt = undefined;
|
|
3636
3683
|
return e.evaluate(n, i);
|
|
3637
3684
|
}
|
|
3638
|
-
if (!n && e.
|
|
3685
|
+
if (!n && e._t === t && e.Ot) e._t = undefined;
|
|
3639
3686
|
}
|
|
3640
3687
|
class RevealController {
|
|
3641
3688
|
Rt;
|
|
@@ -3654,7 +3701,7 @@ class RevealController {
|
|
|
3654
3701
|
Pt(e) {
|
|
3655
3702
|
for (let t = 0; t < this.ht.length; t++) {
|
|
3656
3703
|
const n = this.ht[t];
|
|
3657
|
-
if ((isRevealController(n) ? n.dt : n.
|
|
3704
|
+
if ((isRevealController(n) ? n.dt : n._t) !== this) continue;
|
|
3658
3705
|
if (e(n) === false) return false;
|
|
3659
3706
|
}
|
|
3660
3707
|
return true;
|
|
@@ -3705,9 +3752,9 @@ class RevealController {
|
|
|
3705
3752
|
const n = e ?? read(this.St),
|
|
3706
3753
|
i = untrack(this.Rt),
|
|
3707
3754
|
r = i === "sequential" && !!untrack(this.It),
|
|
3708
|
-
|
|
3755
|
+
o = t ?? r;
|
|
3709
3756
|
if (n) {
|
|
3710
|
-
this.Pt(e => setSlotState(e, this, true,
|
|
3757
|
+
this.Pt(e => setSlotState(e, this, true, o));
|
|
3711
3758
|
} else if (i === "natural") {
|
|
3712
3759
|
this.Pt(e => {
|
|
3713
3760
|
if (isRevealController(e)) {
|
|
@@ -3752,8 +3799,8 @@ class CollectionQueue extends Queue {
|
|
|
3752
3799
|
St = signal(false, { ownedWrite: true, Ye: true });
|
|
3753
3800
|
Re;
|
|
3754
3801
|
Tt = signal(false, { ownedWrite: true, Ye: true });
|
|
3755
|
-
|
|
3756
|
-
|
|
3802
|
+
_t;
|
|
3803
|
+
Ot = false;
|
|
3757
3804
|
yt;
|
|
3758
3805
|
vt = ON_INIT;
|
|
3759
3806
|
constructor(e) {
|
|
@@ -3766,7 +3813,7 @@ class CollectionQueue extends Queue {
|
|
|
3766
3813
|
}
|
|
3767
3814
|
notify(e, t, n, i) {
|
|
3768
3815
|
if (!(t & this.gt)) return super.notify(e, t, n, i);
|
|
3769
|
-
if (this.
|
|
3816
|
+
if (this.Ot && this.yt) {
|
|
3770
3817
|
const e = untrack(() => {
|
|
3771
3818
|
try {
|
|
3772
3819
|
return this.yt();
|
|
@@ -3776,11 +3823,11 @@ class CollectionQueue extends Queue {
|
|
|
3776
3823
|
});
|
|
3777
3824
|
if (e !== this.vt) {
|
|
3778
3825
|
this.vt = e;
|
|
3779
|
-
this.
|
|
3826
|
+
this.Ot = false;
|
|
3780
3827
|
this.ft.clear();
|
|
3781
3828
|
}
|
|
3782
3829
|
}
|
|
3783
|
-
if (this.gt & STATUS_PENDING && this.
|
|
3830
|
+
if (this.gt & STATUS_PENDING && this.Ot) return super.notify(e, t, n, i);
|
|
3784
3831
|
if (this.gt & STATUS_PENDING && n & STATUS_ERROR) {
|
|
3785
3832
|
return super.notify(e, STATUS_ERROR, n, i);
|
|
3786
3833
|
}
|
|
@@ -3802,13 +3849,13 @@ class CollectionQueue extends Queue {
|
|
|
3802
3849
|
checkSources() {
|
|
3803
3850
|
for (const e of this.ft) {
|
|
3804
3851
|
if (
|
|
3805
|
-
e.
|
|
3852
|
+
e.O & REACTIVE_DISPOSED ||
|
|
3806
3853
|
(!(e.he & this.gt) && !(this.gt & STATUS_ERROR && e.he & STATUS_PENDING))
|
|
3807
3854
|
)
|
|
3808
3855
|
this.ft.delete(e);
|
|
3809
3856
|
}
|
|
3810
3857
|
if (!this.ft.size) {
|
|
3811
|
-
if (this.gt & STATUS_PENDING && this.Et && !this.
|
|
3858
|
+
if (this.gt & STATUS_PENDING && this.Et && !this.Ot && this.Dt) {
|
|
3812
3859
|
this.Et = !!(this.Dt.he & this.gt);
|
|
3813
3860
|
} else {
|
|
3814
3861
|
this.Et = false;
|
|
@@ -3822,40 +3869,40 @@ class CollectionQueue extends Queue {
|
|
|
3822
3869
|
}
|
|
3823
3870
|
}
|
|
3824
3871
|
}
|
|
3825
|
-
if (_revealUsed) this.
|
|
3872
|
+
if (_revealUsed) this._t?.evaluate();
|
|
3826
3873
|
}
|
|
3827
3874
|
}
|
|
3828
3875
|
function createCollectionBoundary(e, t, n, i) {
|
|
3829
3876
|
const r = createOwner();
|
|
3830
3877
|
if (_revealUsed) setContext(RevealControllerContext, null, r);
|
|
3831
|
-
const
|
|
3832
|
-
if (e === STATUS_ERROR)
|
|
3833
|
-
if (i)
|
|
3834
|
-
const
|
|
3878
|
+
const o = new CollectionQueue(e);
|
|
3879
|
+
if (e === STATUS_ERROR) o.Re = signal(undefined, { ownedWrite: true, Ye: true });
|
|
3880
|
+
if (i) o.yt = i;
|
|
3881
|
+
const s = (o.Dt = createBoundChildren(r, t, o, e));
|
|
3835
3882
|
untrack(() => {
|
|
3836
3883
|
let t = false;
|
|
3837
3884
|
try {
|
|
3838
|
-
read(
|
|
3885
|
+
read(s);
|
|
3839
3886
|
} catch (e) {
|
|
3840
3887
|
if (e instanceof NotReadyError) t = true;
|
|
3841
3888
|
else throw e;
|
|
3842
3889
|
}
|
|
3843
|
-
|
|
3890
|
+
o.Et = t || !!(s.he & e) || s.Re instanceof NotReadyError;
|
|
3844
3891
|
});
|
|
3845
3892
|
const u = _revealUsed && e === STATUS_PENDING ? getContext(RevealControllerContext) : null;
|
|
3846
3893
|
if (u) {
|
|
3847
|
-
|
|
3848
|
-
u.register(
|
|
3849
|
-
cleanup(() => u.unregister(
|
|
3894
|
+
o._t = u;
|
|
3895
|
+
u.register(o);
|
|
3896
|
+
cleanup(() => u.unregister(o));
|
|
3850
3897
|
}
|
|
3851
3898
|
return accessor(
|
|
3852
3899
|
computed(() => {
|
|
3853
|
-
if (!read(
|
|
3854
|
-
const e = read(
|
|
3855
|
-
if (!untrack(() => read(
|
|
3900
|
+
if (!read(o.St)) {
|
|
3901
|
+
const e = read(s);
|
|
3902
|
+
if (!untrack(() => read(o.St))) return ((o.Ot = true), e);
|
|
3856
3903
|
}
|
|
3857
|
-
if (_revealUsed && read(
|
|
3858
|
-
return n(
|
|
3904
|
+
if (_revealUsed && read(o.Tt)) return undefined;
|
|
3905
|
+
return n(o);
|
|
3859
3906
|
})
|
|
3860
3907
|
);
|
|
3861
3908
|
}
|
|
@@ -3875,20 +3922,20 @@ function createRevealOrder(e, t) {
|
|
|
3875
3922
|
const n = createOwner();
|
|
3876
3923
|
const i = getContext(RevealControllerContext);
|
|
3877
3924
|
const r = t?.order || SEQUENTIAL_ACCESSOR,
|
|
3878
|
-
|
|
3879
|
-
const
|
|
3880
|
-
setContext(RevealControllerContext,
|
|
3925
|
+
o = t?.collapsed || FALSE_ACCESSOR;
|
|
3926
|
+
const s = new RevealController(r, o);
|
|
3927
|
+
setContext(RevealControllerContext, s, n);
|
|
3881
3928
|
return runWithOwner(n, () => {
|
|
3882
3929
|
const t = e();
|
|
3883
3930
|
computed(() => {
|
|
3884
3931
|
r();
|
|
3885
|
-
|
|
3886
|
-
|
|
3932
|
+
o();
|
|
3933
|
+
s.evaluate();
|
|
3887
3934
|
});
|
|
3888
3935
|
if (i) {
|
|
3889
|
-
|
|
3890
|
-
i.register(
|
|
3891
|
-
cleanup(() => i.unregister(
|
|
3936
|
+
s.dt = i;
|
|
3937
|
+
i.register(s);
|
|
3938
|
+
cleanup(() => i.unregister(s));
|
|
3892
3939
|
}
|
|
3893
3940
|
return t;
|
|
3894
3941
|
});
|
|
@@ -3917,9 +3964,9 @@ function flatten(e, t) {
|
|
|
3917
3964
|
function flattenArray(e, t = [], n) {
|
|
3918
3965
|
let i = null;
|
|
3919
3966
|
let r = false;
|
|
3920
|
-
for (let
|
|
3967
|
+
for (let o = 0; o < e.length; o++) {
|
|
3921
3968
|
try {
|
|
3922
|
-
let i = e[
|
|
3969
|
+
let i = e[o];
|
|
3923
3970
|
if (typeof i === "function" && !i.length) {
|
|
3924
3971
|
if (n?.doNotUnwrap) {
|
|
3925
3972
|
t.push(i);
|