@solidjs/signals 0.13.4 → 0.13.5
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/dev.js +95 -59
- package/dist/node.cjs +342 -311
- package/dist/prod.js +123 -92
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/core/owner.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/signals.d.ts +2 -0
- package/dist/types/store/projection.d.ts +1 -0
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -108,7 +108,7 @@ function markNode(e, r = n) {
|
|
|
108
108
|
markNode(n.k, t);
|
|
109
109
|
}
|
|
110
110
|
if (e.C !== null) {
|
|
111
|
-
for (let n = e.C; n !== null; n = n.
|
|
111
|
+
for (let n = e.C; n !== null; n = n.W) {
|
|
112
112
|
for (let e = n.O; e !== null; e = e.P) {
|
|
113
113
|
markNode(e.k, t);
|
|
114
114
|
}
|
|
@@ -117,12 +117,12 @@ function markNode(e, r = n) {
|
|
|
117
117
|
}
|
|
118
118
|
function runHeap(e, t) {
|
|
119
119
|
e._ = false;
|
|
120
|
-
for (e.
|
|
121
|
-
let n = e.l[e.
|
|
120
|
+
for (e.j = 0; e.j <= e.S; e.j++) {
|
|
121
|
+
let n = e.l[e.j];
|
|
122
122
|
while (n !== undefined) {
|
|
123
123
|
if (n.m & i) t(n);
|
|
124
124
|
else adjustHeight(n, e);
|
|
125
|
-
n = e.l[e.
|
|
125
|
+
n = e.l[e.j];
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
e.S = 0;
|
|
@@ -130,7 +130,7 @@ function runHeap(e, t) {
|
|
|
130
130
|
function adjustHeight(e, t) {
|
|
131
131
|
deleteFromHeap(e, t);
|
|
132
132
|
let n = e.o;
|
|
133
|
-
for (let t = e.
|
|
133
|
+
for (let t = e.A; t; t = t.N) {
|
|
134
134
|
const e = t.L;
|
|
135
135
|
const r = e.I || e;
|
|
136
136
|
if (r.T && r.o >= n) n = r.o + 1;
|
|
@@ -143,16 +143,16 @@ function adjustHeight(e, t) {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
const x = new Set();
|
|
146
|
-
const P = { l: new Array(2e3).fill(undefined), _: false,
|
|
147
|
-
const v = { l: new Array(2e3).fill(undefined), _: false,
|
|
146
|
+
const P = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
147
|
+
const v = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
148
148
|
let E = 0;
|
|
149
149
|
let k = null;
|
|
150
150
|
let C = false;
|
|
151
|
-
let
|
|
152
|
-
let
|
|
151
|
+
let W = false;
|
|
152
|
+
let j = null;
|
|
153
153
|
function enforceLoadingBoundary(e) {}
|
|
154
154
|
function shouldReadStashedOptimisticValue(e) {
|
|
155
|
-
return !!
|
|
155
|
+
return !!j?.has(e);
|
|
156
156
|
}
|
|
157
157
|
function runLaneEffects(e) {
|
|
158
158
|
for (const t of L) {
|
|
@@ -176,12 +176,12 @@ function queueStashedOptimisticEffects(e) {
|
|
|
176
176
|
continue;
|
|
177
177
|
}
|
|
178
178
|
const n = e.m & o ? v : P;
|
|
179
|
-
if (n.
|
|
179
|
+
if (n.j > e.o) n.j = e.o;
|
|
180
180
|
insertIntoHeap(e, n);
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
function setProjectionWriteActive(e) {
|
|
184
|
-
|
|
184
|
+
W = e;
|
|
185
185
|
}
|
|
186
186
|
function mergeTransitionState(e, t) {
|
|
187
187
|
t.M = e;
|
|
@@ -223,13 +223,13 @@ function cleanupCompletedLanes(e) {
|
|
|
223
223
|
t.q[0].length = 0;
|
|
224
224
|
t.q[1].length = 0;
|
|
225
225
|
L.delete(t);
|
|
226
|
-
|
|
226
|
+
N.delete(t.te);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
function schedule() {
|
|
230
230
|
if (C) return;
|
|
231
231
|
C = true;
|
|
232
|
-
if (!
|
|
232
|
+
if (!A.ne && !W) queueMicrotask(flush);
|
|
233
233
|
}
|
|
234
234
|
function addTransitionBlocker(e) {
|
|
235
235
|
if (k && !k.X.includes(e)) {
|
|
@@ -333,22 +333,22 @@ class GlobalQueue extends Queue {
|
|
|
333
333
|
runLaneEffects(g);
|
|
334
334
|
this.stashQueues(e.ce);
|
|
335
335
|
E++;
|
|
336
|
-
C = P.S >= P.
|
|
336
|
+
C = P.S >= P.j;
|
|
337
337
|
reassignPendingTransition(e.se);
|
|
338
338
|
k = null;
|
|
339
339
|
if (!e.G.length && e.U.length) {
|
|
340
|
-
|
|
340
|
+
j = new Set();
|
|
341
341
|
for (let t = 0; t < e.U.length; t++) {
|
|
342
342
|
const n = e.U[t];
|
|
343
343
|
if (n.T || n.le) continue;
|
|
344
|
-
|
|
344
|
+
j.add(n);
|
|
345
345
|
queueStashedOptimisticEffects(n);
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
try {
|
|
349
349
|
finalizePureQueue(null, true);
|
|
350
350
|
} finally {
|
|
351
|
-
|
|
351
|
+
j = null;
|
|
352
352
|
}
|
|
353
353
|
return;
|
|
354
354
|
}
|
|
@@ -364,7 +364,7 @@ class GlobalQueue extends Queue {
|
|
|
364
364
|
finalizePureQueue();
|
|
365
365
|
}
|
|
366
366
|
E++;
|
|
367
|
-
C = P.S >= P.
|
|
367
|
+
C = P.S >= P.j;
|
|
368
368
|
runLaneEffects(h);
|
|
369
369
|
this.run(h);
|
|
370
370
|
runLaneEffects(g);
|
|
@@ -461,12 +461,12 @@ function insertSubs(e, t = false) {
|
|
|
461
461
|
continue;
|
|
462
462
|
}
|
|
463
463
|
const s = i.k.m & o ? v : P;
|
|
464
|
-
if (s.
|
|
464
|
+
if (s.j > i.k.o) s.j = i.k.o;
|
|
465
465
|
insertIntoHeap(i.k, s);
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
468
|
function commitPendingNodes() {
|
|
469
|
-
const e =
|
|
469
|
+
const e = A.se;
|
|
470
470
|
for (let t = 0; t < e.length; t++) {
|
|
471
471
|
const n = e[t];
|
|
472
472
|
if (n.Z !== S) {
|
|
@@ -482,12 +482,12 @@ function commitPendingNodes() {
|
|
|
482
482
|
function finalizePureQueue(e = null, t = false) {
|
|
483
483
|
const n = !t;
|
|
484
484
|
if (n) commitPendingNodes();
|
|
485
|
-
if (!t) checkBoundaryChildren(
|
|
486
|
-
if (P.S >= P.
|
|
485
|
+
if (!t) checkBoundaryChildren(A);
|
|
486
|
+
if (P.S >= P.j) runHeap(P, GlobalQueue.oe);
|
|
487
487
|
if (n) {
|
|
488
488
|
commitPendingNodes();
|
|
489
|
-
resolveOptimisticNodes(e ? e.U :
|
|
490
|
-
const t = e ? e.J :
|
|
489
|
+
resolveOptimisticNodes(e ? e.U : A.U);
|
|
490
|
+
const t = e ? e.J : A.J;
|
|
491
491
|
if (GlobalQueue.fe && t.size) {
|
|
492
492
|
for (const e of t) {
|
|
493
493
|
GlobalQueue.fe(e);
|
|
@@ -505,7 +505,7 @@ function checkBoundaryChildren(e) {
|
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
function trackOptimisticStore(e) {
|
|
508
|
-
|
|
508
|
+
A.J.add(e);
|
|
509
509
|
schedule();
|
|
510
510
|
}
|
|
511
511
|
function reassignPendingTransition(e) {
|
|
@@ -513,10 +513,10 @@ function reassignPendingTransition(e) {
|
|
|
513
513
|
e[t].K = k;
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
const
|
|
516
|
+
const A = new GlobalQueue();
|
|
517
517
|
function flush() {
|
|
518
518
|
while (C || k) {
|
|
519
|
-
|
|
519
|
+
A.flush();
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
522
|
function runQueue(e, t) {
|
|
@@ -552,17 +552,17 @@ function runInTransition(e, t) {
|
|
|
552
552
|
k = n;
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
const
|
|
555
|
+
const N = new WeakMap();
|
|
556
556
|
const L = new Set();
|
|
557
557
|
function getOrCreateLane(e) {
|
|
558
|
-
let t =
|
|
558
|
+
let t = N.get(e);
|
|
559
559
|
if (t) {
|
|
560
560
|
return findLane(t);
|
|
561
561
|
}
|
|
562
562
|
const n = e.ye;
|
|
563
563
|
const r = n?.Y ? findLane(n.Y) : null;
|
|
564
564
|
t = { te: e, H: new Set(), q: [[], []], R: null, K: k, Se: r };
|
|
565
|
-
|
|
565
|
+
N.set(e, t);
|
|
566
566
|
L.add(t);
|
|
567
567
|
e.we = false;
|
|
568
568
|
return t;
|
|
@@ -666,7 +666,7 @@ function setPendingError(e, t, n) {
|
|
|
666
666
|
}
|
|
667
667
|
function forEachDependent(e, t) {
|
|
668
668
|
for (let n = e.O; n !== null; n = n.P) t(n.k);
|
|
669
|
-
for (let n = e.C; n !== null; n = n.
|
|
669
|
+
for (let n = e.C; n !== null; n = n.W) {
|
|
670
670
|
for (let e = n.O; e !== null; e = e.P) t(e.k);
|
|
671
671
|
}
|
|
672
672
|
}
|
|
@@ -694,7 +694,7 @@ function settlePendingSource(e) {
|
|
|
694
694
|
}
|
|
695
695
|
} else {
|
|
696
696
|
const e = r.m & o ? v : P;
|
|
697
|
-
if (e.
|
|
697
|
+
if (e.j > r.o) e.j = r.o;
|
|
698
698
|
insertIntoHeap(r, e);
|
|
699
699
|
}
|
|
700
700
|
t = true;
|
|
@@ -718,14 +718,14 @@ function handleAsync(e, t, r) {
|
|
|
718
718
|
let u;
|
|
719
719
|
const handleError = n => {
|
|
720
720
|
if (e.Oe !== t) return;
|
|
721
|
-
|
|
721
|
+
A.initTransition(resolveTransition(e));
|
|
722
722
|
notifyStatus(e, n instanceof NotReadyError ? a : d, n);
|
|
723
723
|
e.de = E;
|
|
724
724
|
};
|
|
725
725
|
const asyncWrite = (i, s) => {
|
|
726
726
|
if (e.Oe !== t) return;
|
|
727
727
|
if (e.m & (n | f)) return;
|
|
728
|
-
|
|
728
|
+
A.initTransition(resolveTransition(e));
|
|
729
729
|
clearStatus(e);
|
|
730
730
|
const o = resolveLane(e);
|
|
731
731
|
if (o) o.H.delete(e);
|
|
@@ -772,7 +772,7 @@ function handleAsync(e, t, r) {
|
|
|
772
772
|
);
|
|
773
773
|
r = false;
|
|
774
774
|
if (!n) {
|
|
775
|
-
|
|
775
|
+
A.initTransition(resolveTransition(e));
|
|
776
776
|
throw new NotReadyError(B);
|
|
777
777
|
}
|
|
778
778
|
}
|
|
@@ -808,7 +808,7 @@ function handleAsync(e, t, r) {
|
|
|
808
808
|
};
|
|
809
809
|
const i = iterate();
|
|
810
810
|
if (!r && !i) {
|
|
811
|
-
|
|
811
|
+
A.initTransition(resolveTransition(e));
|
|
812
812
|
throw new NotReadyError(B);
|
|
813
813
|
}
|
|
814
814
|
}
|
|
@@ -863,7 +863,7 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
863
863
|
(t === a && s && e.me !== s && !e.be?.has(s)) ||
|
|
864
864
|
(t !== a && (e.ae !== n || e.me || e.be))
|
|
865
865
|
) {
|
|
866
|
-
!e.K &&
|
|
866
|
+
!e.K && A.se.push(e);
|
|
867
867
|
notifyStatus(e, t, n, c, l);
|
|
868
868
|
}
|
|
869
869
|
});
|
|
@@ -905,43 +905,43 @@ function markDisposal(e) {
|
|
|
905
905
|
}
|
|
906
906
|
}
|
|
907
907
|
function dispose(e) {
|
|
908
|
-
let t = e.
|
|
908
|
+
let t = e.A || null;
|
|
909
909
|
do {
|
|
910
910
|
t = unlinkSubs(t);
|
|
911
911
|
} while (t !== null);
|
|
912
|
-
e.
|
|
912
|
+
e.A = null;
|
|
913
913
|
e.Ce = null;
|
|
914
914
|
disposeChildren(e, true);
|
|
915
915
|
}
|
|
916
916
|
function disposeChildren(e, t = false, n) {
|
|
917
917
|
if (e.m & u) return;
|
|
918
918
|
if (t) e.m = u;
|
|
919
|
-
let r = n ? e.
|
|
919
|
+
let r = n ? e.We : e.Ee;
|
|
920
920
|
while (r) {
|
|
921
921
|
const e = r.ke;
|
|
922
|
-
if (r.
|
|
922
|
+
if (r.A) {
|
|
923
923
|
const e = r;
|
|
924
924
|
deleteFromHeap(e, e.m & o ? v : P);
|
|
925
|
-
let t = e.
|
|
925
|
+
let t = e.A;
|
|
926
926
|
do {
|
|
927
927
|
t = unlinkSubs(t);
|
|
928
928
|
} while (t !== null);
|
|
929
|
-
e.
|
|
929
|
+
e.A = null;
|
|
930
930
|
e.Ce = null;
|
|
931
931
|
}
|
|
932
932
|
disposeChildren(r, true);
|
|
933
933
|
r = e;
|
|
934
934
|
}
|
|
935
935
|
if (n) {
|
|
936
|
-
e.
|
|
936
|
+
e.We = null;
|
|
937
937
|
} else {
|
|
938
938
|
e.Ee = null;
|
|
939
|
-
e.
|
|
939
|
+
e.je = 0;
|
|
940
940
|
}
|
|
941
941
|
runDisposal(e, n);
|
|
942
942
|
}
|
|
943
943
|
function runDisposal(e, t) {
|
|
944
|
-
let n = t ? e.
|
|
944
|
+
let n = t ? e.Ae : e.Ne;
|
|
945
945
|
if (!n) return;
|
|
946
946
|
if (Array.isArray(n)) {
|
|
947
947
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -951,12 +951,12 @@ function runDisposal(e, t) {
|
|
|
951
951
|
} else {
|
|
952
952
|
n.call(n);
|
|
953
953
|
}
|
|
954
|
-
t ? (e.
|
|
954
|
+
t ? (e.Ae = null) : (e.Ne = null);
|
|
955
955
|
}
|
|
956
956
|
function childId(e, t) {
|
|
957
957
|
let n = e;
|
|
958
958
|
while (n.Le && n.i) n = n.i;
|
|
959
|
-
if (n.id != null) return formatId(n.id, t ? n.
|
|
959
|
+
if (n.id != null) return formatId(n.id, t ? n.je++ : n.je);
|
|
960
960
|
throw new Error("Cannot get child id from owner without an id");
|
|
961
961
|
}
|
|
962
962
|
function getNextChildId(e) {
|
|
@@ -977,13 +977,11 @@ function getObserver() {
|
|
|
977
977
|
function getOwner() {
|
|
978
978
|
return B;
|
|
979
979
|
}
|
|
980
|
-
function
|
|
981
|
-
if (!B)
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
else if (Array.isArray(B.We)) B.We.push(e);
|
|
986
|
-
else B.We = [B.We, e];
|
|
980
|
+
function cleanup(e) {
|
|
981
|
+
if (!B) return e;
|
|
982
|
+
if (!B.Ne) B.Ne = e;
|
|
983
|
+
else if (Array.isArray(B.Ne)) B.Ne.push(e);
|
|
984
|
+
else B.Ne = [B.Ne, e];
|
|
987
985
|
return e;
|
|
988
986
|
}
|
|
989
987
|
function isDisposed(e) {
|
|
@@ -999,12 +997,12 @@ function createOwner(e) {
|
|
|
999
997
|
u: t?.t ? t.u : t,
|
|
1000
998
|
Ee: null,
|
|
1001
999
|
ke: null,
|
|
1002
|
-
We: null,
|
|
1003
|
-
B: t?.B ?? N,
|
|
1004
|
-
Ie: t?.Ie || _,
|
|
1005
|
-
Ae: 0,
|
|
1006
1000
|
Ne: null,
|
|
1007
|
-
|
|
1001
|
+
B: t?.B ?? A,
|
|
1002
|
+
Ie: t?.Ie || _,
|
|
1003
|
+
je: 0,
|
|
1004
|
+
Ae: null,
|
|
1005
|
+
We: null,
|
|
1008
1006
|
i: t,
|
|
1009
1007
|
dispose(e = true) {
|
|
1010
1008
|
disposeChildren(r, e);
|
|
@@ -1027,7 +1025,7 @@ function createRoot(e, t) {
|
|
|
1027
1025
|
}
|
|
1028
1026
|
function unlinkSubs(e) {
|
|
1029
1027
|
const t = e.L;
|
|
1030
|
-
const n = e.
|
|
1028
|
+
const n = e.N;
|
|
1031
1029
|
const r = e.P;
|
|
1032
1030
|
const i = e.Te;
|
|
1033
1031
|
if (r !== null) r.Te = i;
|
|
@@ -1044,11 +1042,11 @@ function unlinkSubs(e) {
|
|
|
1044
1042
|
}
|
|
1045
1043
|
function unobserved(e) {
|
|
1046
1044
|
deleteFromHeap(e, e.m & o ? v : P);
|
|
1047
|
-
let t = e.
|
|
1045
|
+
let t = e.A;
|
|
1048
1046
|
while (t !== null) {
|
|
1049
1047
|
t = unlinkSubs(t);
|
|
1050
1048
|
}
|
|
1051
|
-
e.
|
|
1049
|
+
e.A = null;
|
|
1052
1050
|
disposeChildren(e, true);
|
|
1053
1051
|
}
|
|
1054
1052
|
function link(e, t) {
|
|
@@ -1057,7 +1055,7 @@ function link(e, t) {
|
|
|
1057
1055
|
let i = null;
|
|
1058
1056
|
const s = t.m & r;
|
|
1059
1057
|
if (s) {
|
|
1060
|
-
i = n !== null ? n.
|
|
1058
|
+
i = n !== null ? n.N : t.A;
|
|
1061
1059
|
if (i !== null && i.L === e) {
|
|
1062
1060
|
t.Ce = i;
|
|
1063
1061
|
return;
|
|
@@ -1065,20 +1063,20 @@ function link(e, t) {
|
|
|
1065
1063
|
}
|
|
1066
1064
|
const o = e.Re;
|
|
1067
1065
|
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
1068
|
-
const u = (t.Ce = e.Re = { L: e, k: t,
|
|
1069
|
-
if (n !== null) n.
|
|
1070
|
-
else t.
|
|
1066
|
+
const u = (t.Ce = e.Re = { L: e, k: t, N: i, Te: o, P: null });
|
|
1067
|
+
if (n !== null) n.N = u;
|
|
1068
|
+
else t.A = u;
|
|
1071
1069
|
if (o !== null) o.P = u;
|
|
1072
1070
|
else e.O = u;
|
|
1073
1071
|
}
|
|
1074
1072
|
function isValidLink(e, t) {
|
|
1075
1073
|
const n = t.Ce;
|
|
1076
1074
|
if (n !== null) {
|
|
1077
|
-
let r = t.
|
|
1075
|
+
let r = t.A;
|
|
1078
1076
|
do {
|
|
1079
1077
|
if (r === e) return true;
|
|
1080
1078
|
if (r === n) break;
|
|
1081
|
-
r = r.
|
|
1079
|
+
r = r.N;
|
|
1082
1080
|
} while (r !== null);
|
|
1083
1081
|
}
|
|
1084
1082
|
return false;
|
|
@@ -1127,7 +1125,7 @@ function releaseSubtree(e) {
|
|
|
1127
1125
|
if (e.m & c) {
|
|
1128
1126
|
e.m &= ~c;
|
|
1129
1127
|
e.m |= n;
|
|
1130
|
-
if (P.
|
|
1128
|
+
if (P.j > e.o) P.j = e.o;
|
|
1131
1129
|
insertIntoHeap(e, P);
|
|
1132
1130
|
}
|
|
1133
1131
|
}
|
|
@@ -1148,16 +1146,16 @@ function clearSnapshots() {
|
|
|
1148
1146
|
function recompute(t, n = false) {
|
|
1149
1147
|
const i = t.D;
|
|
1150
1148
|
if (!n) {
|
|
1151
|
-
if (t.K && (!i || k) && k !== t.K)
|
|
1149
|
+
if (t.K && (!i || k) && k !== t.K) A.initTransition(t.K);
|
|
1152
1150
|
deleteFromHeap(t, t.m & o ? v : P);
|
|
1153
1151
|
if (t.K || i === y) disposeChildren(t);
|
|
1154
1152
|
else {
|
|
1155
1153
|
markDisposal(t);
|
|
1156
|
-
t.
|
|
1157
|
-
t.
|
|
1158
|
-
t.
|
|
1154
|
+
t.Ae = t.Ne;
|
|
1155
|
+
t.We = t.Ee;
|
|
1156
|
+
t.Ne = null;
|
|
1159
1157
|
t.Ee = null;
|
|
1160
|
-
t.
|
|
1158
|
+
t.je = 0;
|
|
1161
1159
|
}
|
|
1162
1160
|
}
|
|
1163
1161
|
const s = !!(t.m & f);
|
|
@@ -1209,13 +1207,13 @@ function recompute(t, n = false) {
|
|
|
1209
1207
|
}
|
|
1210
1208
|
if (!t.ae) {
|
|
1211
1209
|
const e = t.Ce;
|
|
1212
|
-
let r = e !== null ? e.
|
|
1210
|
+
let r = e !== null ? e.N : t.A;
|
|
1213
1211
|
if (r !== null) {
|
|
1214
1212
|
do {
|
|
1215
1213
|
r = unlinkSubs(r);
|
|
1216
1214
|
} while (r !== null);
|
|
1217
|
-
if (e !== null) e.
|
|
1218
|
-
else t.
|
|
1215
|
+
if (e !== null) e.N = null;
|
|
1216
|
+
else t.A = null;
|
|
1219
1217
|
}
|
|
1220
1218
|
const f = u ? t.ee : t.Z === S ? t.$ : t.Z;
|
|
1221
1219
|
const c = !t.xe || !t.xe(f, h);
|
|
@@ -1239,12 +1237,12 @@ function recompute(t, n = false) {
|
|
|
1239
1237
|
}
|
|
1240
1238
|
}
|
|
1241
1239
|
F = m;
|
|
1242
|
-
(!n || t.ge & a) && !t.K && !(k && u) &&
|
|
1240
|
+
(!n || t.ge & a) && !t.K && !(k && u) && A.se.push(t);
|
|
1243
1241
|
t.K && i && k !== t.K && runInTransition(t.K, () => recompute(t));
|
|
1244
1242
|
}
|
|
1245
1243
|
function updateIfNecessary(r) {
|
|
1246
1244
|
if (r.m & t) {
|
|
1247
|
-
for (let e = r.
|
|
1245
|
+
for (let e = r.A; e; e = e.N) {
|
|
1248
1246
|
const t = e.L;
|
|
1249
1247
|
const i = t.I || t;
|
|
1250
1248
|
if (i.T) {
|
|
@@ -1268,17 +1266,17 @@ function computed(t, n, r) {
|
|
|
1268
1266
|
xe: r?.equals != null ? r.equals : isEqual,
|
|
1269
1267
|
le: !!r?.pureWrite,
|
|
1270
1268
|
He: r?.unobserved,
|
|
1271
|
-
|
|
1272
|
-
B: B?.B ??
|
|
1269
|
+
Ne: null,
|
|
1270
|
+
B: B?.B ?? A,
|
|
1273
1271
|
Ie: B?.Ie ?? _,
|
|
1274
|
-
|
|
1272
|
+
je: 0,
|
|
1275
1273
|
T: t,
|
|
1276
1274
|
$: n,
|
|
1277
1275
|
o: 0,
|
|
1278
1276
|
C: null,
|
|
1279
1277
|
h: undefined,
|
|
1280
1278
|
p: null,
|
|
1281
|
-
|
|
1279
|
+
A: null,
|
|
1282
1280
|
Ce: null,
|
|
1283
1281
|
O: null,
|
|
1284
1282
|
Re: null,
|
|
@@ -1289,8 +1287,8 @@ function computed(t, n, r) {
|
|
|
1289
1287
|
ge: p,
|
|
1290
1288
|
de: E,
|
|
1291
1289
|
Z: S,
|
|
1292
|
-
|
|
1293
|
-
|
|
1290
|
+
Ae: null,
|
|
1291
|
+
We: null,
|
|
1294
1292
|
Oe: null,
|
|
1295
1293
|
K: null
|
|
1296
1294
|
};
|
|
@@ -1312,7 +1310,7 @@ function computed(t, n, r) {
|
|
|
1312
1310
|
const t = I.factory(s.T, () => {
|
|
1313
1311
|
setSignal(e, undefined);
|
|
1314
1312
|
});
|
|
1315
|
-
|
|
1313
|
+
cleanup(() => t.dispose());
|
|
1316
1314
|
s.T = n => {
|
|
1317
1315
|
read(e);
|
|
1318
1316
|
return t.track(n);
|
|
@@ -1338,7 +1336,7 @@ function signal(e, t, n = null) {
|
|
|
1338
1336
|
Re: null,
|
|
1339
1337
|
de: E,
|
|
1340
1338
|
I: n,
|
|
1341
|
-
|
|
1339
|
+
W: n?.C || null,
|
|
1342
1340
|
Z: S
|
|
1343
1341
|
};
|
|
1344
1342
|
n && (n.C = r);
|
|
@@ -1401,8 +1399,14 @@ function read(e) {
|
|
|
1401
1399
|
const t = e.I;
|
|
1402
1400
|
const n = q;
|
|
1403
1401
|
q = false;
|
|
1404
|
-
if (
|
|
1405
|
-
|
|
1402
|
+
if (t && e.ee !== undefined) {
|
|
1403
|
+
if (e.ee !== S && (t.Oe || !!(t.ge & a))) {
|
|
1404
|
+
D = true;
|
|
1405
|
+
}
|
|
1406
|
+
} else {
|
|
1407
|
+
if (read(getPendingSignal(e))) D = true;
|
|
1408
|
+
if (t && read(getPendingSignal(t))) D = true;
|
|
1409
|
+
}
|
|
1406
1410
|
q = n;
|
|
1407
1411
|
return e.$;
|
|
1408
1412
|
}
|
|
@@ -1419,7 +1423,7 @@ function read(e) {
|
|
|
1419
1423
|
link(e, t);
|
|
1420
1424
|
if (n.T) {
|
|
1421
1425
|
const r = e.m & o;
|
|
1422
|
-
if (n.o >= (r ? v.
|
|
1426
|
+
if (n.o >= (r ? v.j : P.j)) {
|
|
1423
1427
|
markNode(t);
|
|
1424
1428
|
markHeap(r ? v : P);
|
|
1425
1429
|
updateIfNecessary(n);
|
|
@@ -1474,8 +1478,8 @@ function read(e) {
|
|
|
1474
1478
|
: e.Z;
|
|
1475
1479
|
}
|
|
1476
1480
|
function setSignal(e, t) {
|
|
1477
|
-
if (e.K && k !== e.K)
|
|
1478
|
-
const n = e.ee !== undefined && !
|
|
1481
|
+
if (e.K && k !== e.K) A.initTransition(e.K);
|
|
1482
|
+
const n = e.ee !== undefined && !W;
|
|
1479
1483
|
const r = e.ee !== undefined && e.ee !== S;
|
|
1480
1484
|
const i = n ? (r ? e.ee : e.$) : e.Z === S ? e.$ : e.Z;
|
|
1481
1485
|
if (typeof t === "function") t = t(i);
|
|
@@ -1489,17 +1493,17 @@ function setSignal(e, t) {
|
|
|
1489
1493
|
}
|
|
1490
1494
|
if (n) {
|
|
1491
1495
|
const n = e.ee === S;
|
|
1492
|
-
if (!n)
|
|
1496
|
+
if (!n) A.initTransition(resolveTransition(e));
|
|
1493
1497
|
if (n) {
|
|
1494
1498
|
e.Z = e.$;
|
|
1495
|
-
|
|
1499
|
+
A.U.push(e);
|
|
1496
1500
|
}
|
|
1497
1501
|
e.we = true;
|
|
1498
1502
|
const r = getOrCreateLane(e);
|
|
1499
1503
|
e.Y = r;
|
|
1500
1504
|
e.ee = t;
|
|
1501
1505
|
} else {
|
|
1502
|
-
if (e.Z === S)
|
|
1506
|
+
if (e.Z === S) A.se.push(e);
|
|
1503
1507
|
e.Z = t;
|
|
1504
1508
|
}
|
|
1505
1509
|
updatePendingSignal(e);
|
|
@@ -1547,6 +1551,9 @@ function computePendingState(e) {
|
|
|
1547
1551
|
}
|
|
1548
1552
|
return true;
|
|
1549
1553
|
}
|
|
1554
|
+
if (e.ee !== undefined && e.ee === S && !e.ye) {
|
|
1555
|
+
return false;
|
|
1556
|
+
}
|
|
1550
1557
|
if (e.Z !== S && !(t.ge & p)) return true;
|
|
1551
1558
|
return !!(t.ge & a && !(t.ge & p));
|
|
1552
1559
|
}
|
|
@@ -1563,7 +1570,7 @@ function updatePendingSignal(e) {
|
|
|
1563
1570
|
mergeLanes(t, e);
|
|
1564
1571
|
}
|
|
1565
1572
|
}
|
|
1566
|
-
|
|
1573
|
+
N.delete(n);
|
|
1567
1574
|
n.Y = undefined;
|
|
1568
1575
|
}
|
|
1569
1576
|
}
|
|
@@ -1703,7 +1710,7 @@ function effect(e, t, n, r, i) {
|
|
|
1703
1710
|
recompute(o, true);
|
|
1704
1711
|
!i?.defer && (o.D === g ? o.B.enqueue(o.D, runEffect.bind(o)) : runEffect.call(o));
|
|
1705
1712
|
s = true;
|
|
1706
|
-
|
|
1713
|
+
cleanup(() => o.Ge?.());
|
|
1707
1714
|
}
|
|
1708
1715
|
function runEffect() {
|
|
1709
1716
|
if (!this.V || this.m & u) return;
|
|
@@ -1749,10 +1756,10 @@ function trackedEffect(e, t) {
|
|
|
1749
1756
|
};
|
|
1750
1757
|
n.F = run;
|
|
1751
1758
|
n.B.enqueue(g, run);
|
|
1752
|
-
|
|
1759
|
+
cleanup(() => n.Ge?.());
|
|
1753
1760
|
}
|
|
1754
1761
|
function restoreTransition(e, t) {
|
|
1755
|
-
|
|
1762
|
+
A.initTransition(e);
|
|
1756
1763
|
const n = t();
|
|
1757
1764
|
flush();
|
|
1758
1765
|
return n;
|
|
@@ -1761,7 +1768,7 @@ function action(e) {
|
|
|
1761
1768
|
return (...t) =>
|
|
1762
1769
|
new Promise((n, r) => {
|
|
1763
1770
|
const i = e(...t);
|
|
1764
|
-
|
|
1771
|
+
A.initTransition();
|
|
1765
1772
|
let s = k;
|
|
1766
1773
|
s.G.push(i);
|
|
1767
1774
|
const done = (e, t) => {
|
|
@@ -1795,6 +1802,9 @@ function action(e) {
|
|
|
1795
1802
|
step();
|
|
1796
1803
|
});
|
|
1797
1804
|
}
|
|
1805
|
+
function onCleanup(e) {
|
|
1806
|
+
return cleanup(e);
|
|
1807
|
+
}
|
|
1798
1808
|
function accessor(e) {
|
|
1799
1809
|
const t = read.bind(null, e);
|
|
1800
1810
|
t.$r = true;
|
|
@@ -1823,7 +1833,7 @@ function createTrackedEffect(e, t) {
|
|
|
1823
1833
|
}
|
|
1824
1834
|
function createReaction(e, t) {
|
|
1825
1835
|
let n = undefined;
|
|
1826
|
-
|
|
1836
|
+
cleanup(() => n?.());
|
|
1827
1837
|
const r = getOwner();
|
|
1828
1838
|
return i => {
|
|
1829
1839
|
runWithOwner(r, () => {
|
|
@@ -1864,13 +1874,13 @@ function onSettled(e) {
|
|
|
1864
1874
|
const t = getOwner();
|
|
1865
1875
|
t && !t.Ke
|
|
1866
1876
|
? createTrackedEffect(() => untrack(e))
|
|
1867
|
-
:
|
|
1877
|
+
: A.enqueue(g, () => {
|
|
1868
1878
|
const t = e();
|
|
1869
1879
|
t?.();
|
|
1870
1880
|
});
|
|
1871
1881
|
}
|
|
1872
1882
|
function unwrap(e) {
|
|
1873
|
-
return e?.[
|
|
1883
|
+
return e?.[z]?.[$] ?? e;
|
|
1874
1884
|
}
|
|
1875
1885
|
function getOverrideValue(e, t, n, r, i) {
|
|
1876
1886
|
if (i && r in i) return i[r];
|
|
@@ -1882,16 +1892,16 @@ function getAllKeys(e, t, n) {
|
|
|
1882
1892
|
return Array.from(new Set([...r, ...i]));
|
|
1883
1893
|
}
|
|
1884
1894
|
function applyState(e, t, n) {
|
|
1885
|
-
const r = t?.[
|
|
1895
|
+
const r = t?.[z];
|
|
1886
1896
|
if (!r) return;
|
|
1887
|
-
const i = r[
|
|
1888
|
-
const s = r[
|
|
1889
|
-
const o = r[
|
|
1890
|
-
let u = r[
|
|
1897
|
+
const i = r[X];
|
|
1898
|
+
const s = r[Y];
|
|
1899
|
+
const o = r[Z];
|
|
1900
|
+
let u = r[$];
|
|
1891
1901
|
if (e === i && !s && !o) return;
|
|
1892
|
-
(r[
|
|
1893
|
-
r[
|
|
1894
|
-
r[
|
|
1902
|
+
(r[ne] || se).set(e, r[U]);
|
|
1903
|
+
r[X] = e;
|
|
1904
|
+
r[Y] = undefined;
|
|
1895
1905
|
if (Array.isArray(i)) {
|
|
1896
1906
|
let t = false;
|
|
1897
1907
|
const f = getOverrideValue(i, s, u, "length", o);
|
|
@@ -1919,16 +1929,16 @@ function applyState(e, t, n) {
|
|
|
1919
1929
|
if (a > p || a > d) {
|
|
1920
1930
|
for (l = a; l <= p; l++) {
|
|
1921
1931
|
t = true;
|
|
1922
|
-
r[
|
|
1932
|
+
r[$][l] && setSignal(r[$][l], wrap(e[l], r));
|
|
1923
1933
|
}
|
|
1924
1934
|
for (; l < e.length; l++) {
|
|
1925
1935
|
t = true;
|
|
1926
1936
|
const i = wrap(S[l], r);
|
|
1927
|
-
r[
|
|
1937
|
+
r[$][l] && setSignal(r[$][l], i);
|
|
1928
1938
|
applyState(e[l], i, n);
|
|
1929
1939
|
}
|
|
1930
|
-
t && r[
|
|
1931
|
-
f !== e.length && r[
|
|
1940
|
+
t && r[$][K] && setSignal(r[$][K], void 0);
|
|
1941
|
+
f !== e.length && r[$].length && setSignal(r[$].length, e.length);
|
|
1932
1942
|
return;
|
|
1933
1943
|
}
|
|
1934
1944
|
g = new Array(p + 1);
|
|
@@ -1952,26 +1962,26 @@ function applyState(e, t, n) {
|
|
|
1952
1962
|
for (l = a; l < e.length; l++) {
|
|
1953
1963
|
if (l in S) {
|
|
1954
1964
|
const t = wrap(S[l], r);
|
|
1955
|
-
r[
|
|
1965
|
+
r[$][l] && setSignal(r[$][l], t);
|
|
1956
1966
|
applyState(e[l], t, n);
|
|
1957
|
-
} else r[
|
|
1967
|
+
} else r[$][l] && setSignal(r[$][l], wrap(e[l], r));
|
|
1958
1968
|
}
|
|
1959
1969
|
if (a < e.length) t = true;
|
|
1960
1970
|
} else if (e.length) {
|
|
1961
1971
|
for (let t = 0, f = e.length; t < f; t++) {
|
|
1962
1972
|
const f = getOverrideValue(i, s, u, t, o);
|
|
1963
|
-
isWrappable(f) ? applyState(e[t], wrap(f, r), n) : r[
|
|
1973
|
+
isWrappable(f) ? applyState(e[t], wrap(f, r), n) : r[$][t] && setSignal(r[$][t], e[t]);
|
|
1964
1974
|
}
|
|
1965
1975
|
}
|
|
1966
1976
|
if (f !== e.length) {
|
|
1967
1977
|
t = true;
|
|
1968
|
-
r[
|
|
1978
|
+
r[$].length && setSignal(r[$].length, e.length);
|
|
1969
1979
|
}
|
|
1970
|
-
t && r[
|
|
1980
|
+
t && r[$][K] && setSignal(r[$][K], void 0);
|
|
1971
1981
|
return;
|
|
1972
1982
|
}
|
|
1973
1983
|
if (u) {
|
|
1974
|
-
const t = u[
|
|
1984
|
+
const t = u[K];
|
|
1975
1985
|
const f = t ? getAllKeys(i, s, e) : Object.keys(u);
|
|
1976
1986
|
for (let c = 0, l = f.length; c < l; c++) {
|
|
1977
1987
|
const l = f[c];
|
|
@@ -1985,7 +1995,7 @@ function applyState(e, t, n) {
|
|
|
1985
1995
|
} else applyState(p, wrap(d, r), n);
|
|
1986
1996
|
}
|
|
1987
1997
|
}
|
|
1988
|
-
if ((u = r[
|
|
1998
|
+
if ((u = r[ee])) {
|
|
1989
1999
|
const t = Object.keys(u);
|
|
1990
2000
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1991
2001
|
const r = t[n];
|
|
@@ -2007,9 +2017,9 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
2007
2017
|
let r;
|
|
2008
2018
|
const i = new WeakMap();
|
|
2009
2019
|
const wrapper = e => {
|
|
2010
|
-
e[
|
|
2011
|
-
e[
|
|
2012
|
-
Object.defineProperty(e,
|
|
2020
|
+
e[te] = wrapProjection;
|
|
2021
|
+
e[ne] = i;
|
|
2022
|
+
Object.defineProperty(e, re, {
|
|
2013
2023
|
get() {
|
|
2014
2024
|
return r;
|
|
2015
2025
|
},
|
|
@@ -2018,19 +2028,27 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
2018
2028
|
};
|
|
2019
2029
|
const wrapProjection = e => {
|
|
2020
2030
|
if (i.has(e)) return i.get(e);
|
|
2021
|
-
if (e[
|
|
2022
|
-
const t = createStoreProxy(e,
|
|
2031
|
+
if (e[z]?.[te] === wrapProjection) return e;
|
|
2032
|
+
const t = createStoreProxy(e, fe, wrapper);
|
|
2023
2033
|
i.set(e, t);
|
|
2024
2034
|
return t;
|
|
2025
2035
|
};
|
|
2026
2036
|
const s = wrapProjection(t);
|
|
2027
2037
|
r = computed(() => {
|
|
2028
2038
|
const t = getOwner();
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2039
|
+
let r = false;
|
|
2040
|
+
let i;
|
|
2041
|
+
const o = new Proxy(
|
|
2042
|
+
s,
|
|
2043
|
+
createWriteTraps(() => !r || t.Oe === i)
|
|
2044
|
+
);
|
|
2045
|
+
storeSetter(o, o => {
|
|
2046
|
+
i = e(o);
|
|
2047
|
+
r = true;
|
|
2048
|
+
const u = handleAsync(t, i, e => {
|
|
2049
|
+
e !== o && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id"));
|
|
2032
2050
|
});
|
|
2033
|
-
|
|
2051
|
+
u !== o && u !== undefined && reconcile(u, n?.key || "id")(s);
|
|
2034
2052
|
});
|
|
2035
2053
|
});
|
|
2036
2054
|
r.Qe = true;
|
|
@@ -2039,80 +2057,85 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
2039
2057
|
function createProjection(e, t = {}, n) {
|
|
2040
2058
|
return createProjectionInternal(e, t, n).store;
|
|
2041
2059
|
}
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2060
|
+
function createWriteTraps(e) {
|
|
2061
|
+
const t = {
|
|
2062
|
+
get(e, n) {
|
|
2063
|
+
let r;
|
|
2064
|
+
setWriteOverride(true);
|
|
2065
|
+
setProjectionWriteActive(true);
|
|
2066
|
+
try {
|
|
2067
|
+
r = e[n];
|
|
2068
|
+
} finally {
|
|
2069
|
+
setWriteOverride(false);
|
|
2070
|
+
setProjectionWriteActive(false);
|
|
2071
|
+
}
|
|
2072
|
+
return typeof r === "object" && r !== null ? new Proxy(r, t) : r;
|
|
2073
|
+
},
|
|
2074
|
+
set(t, n, r) {
|
|
2075
|
+
if (e && !e()) return true;
|
|
2076
|
+
setWriteOverride(true);
|
|
2077
|
+
setProjectionWriteActive(true);
|
|
2078
|
+
try {
|
|
2079
|
+
t[n] = r;
|
|
2080
|
+
} finally {
|
|
2081
|
+
setWriteOverride(false);
|
|
2082
|
+
setProjectionWriteActive(false);
|
|
2083
|
+
}
|
|
2084
|
+
return true;
|
|
2085
|
+
},
|
|
2086
|
+
deleteProperty(t, n) {
|
|
2087
|
+
if (e && !e()) return true;
|
|
2088
|
+
setWriteOverride(true);
|
|
2089
|
+
setProjectionWriteActive(true);
|
|
2090
|
+
try {
|
|
2091
|
+
delete t[n];
|
|
2092
|
+
} finally {
|
|
2093
|
+
setWriteOverride(false);
|
|
2094
|
+
setProjectionWriteActive(false);
|
|
2095
|
+
}
|
|
2096
|
+
return true;
|
|
2074
2097
|
}
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
}
|
|
2078
|
-
const
|
|
2098
|
+
};
|
|
2099
|
+
return t;
|
|
2100
|
+
}
|
|
2101
|
+
const K = Symbol(0),
|
|
2102
|
+
z = Symbol(0),
|
|
2079
2103
|
U = Symbol(0),
|
|
2080
|
-
J = Symbol(0)
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
Z = "
|
|
2084
|
-
$ = "
|
|
2085
|
-
ee = "
|
|
2086
|
-
te = "
|
|
2087
|
-
ne = "
|
|
2088
|
-
re = "
|
|
2089
|
-
ie = "
|
|
2090
|
-
|
|
2091
|
-
function createStoreProxy(e, t = ce, n) {
|
|
2104
|
+
J = Symbol(0);
|
|
2105
|
+
const X = "v",
|
|
2106
|
+
Y = "o",
|
|
2107
|
+
Z = "x",
|
|
2108
|
+
$ = "n",
|
|
2109
|
+
ee = "h",
|
|
2110
|
+
te = "w",
|
|
2111
|
+
ne = "l",
|
|
2112
|
+
re = "f",
|
|
2113
|
+
ie = "p";
|
|
2114
|
+
function createStoreProxy(e, t = fe, n) {
|
|
2092
2115
|
let r;
|
|
2093
2116
|
if (Array.isArray(e)) {
|
|
2094
2117
|
r = [];
|
|
2095
2118
|
r.v = e;
|
|
2096
2119
|
} else r = { v: e };
|
|
2097
2120
|
n && n(r);
|
|
2098
|
-
return (r[
|
|
2121
|
+
return (r[U] = new Proxy(r, t));
|
|
2099
2122
|
}
|
|
2100
|
-
const
|
|
2123
|
+
const se = new WeakMap();
|
|
2101
2124
|
function wrap(e, t) {
|
|
2102
|
-
if (t?.[
|
|
2103
|
-
let n = e[
|
|
2104
|
-
if (!n)
|
|
2125
|
+
if (t?.[te]) return t[te](e, t);
|
|
2126
|
+
let n = e[U] || se.get(e);
|
|
2127
|
+
if (!n) se.set(e, (n = createStoreProxy(e)));
|
|
2105
2128
|
return n;
|
|
2106
2129
|
}
|
|
2107
2130
|
function isWrappable(e) {
|
|
2108
2131
|
return e != null && typeof e === "object" && !Object.isFrozen(e);
|
|
2109
2132
|
}
|
|
2110
|
-
let
|
|
2133
|
+
let oe = false;
|
|
2111
2134
|
function setWriteOverride(e) {
|
|
2112
|
-
|
|
2135
|
+
oe = e;
|
|
2113
2136
|
}
|
|
2114
2137
|
function writeOnly(e) {
|
|
2115
|
-
return
|
|
2138
|
+
return oe || !!ue?.has(e);
|
|
2116
2139
|
}
|
|
2117
2140
|
function getNodes(e, t) {
|
|
2118
2141
|
let n = e[t];
|
|
@@ -2141,8 +2164,8 @@ function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
|
2141
2164
|
}
|
|
2142
2165
|
return (e[t] = u);
|
|
2143
2166
|
}
|
|
2144
|
-
function trackSelf(e, t =
|
|
2145
|
-
getObserver() && read(getNode(getNodes(e,
|
|
2167
|
+
function trackSelf(e, t = K) {
|
|
2168
|
+
getObserver() && read(getNode(getNodes(e, $), t, undefined, e[re], false, e[ie]));
|
|
2146
2169
|
}
|
|
2147
2170
|
function getKeys(e, t, n = true) {
|
|
2148
2171
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -2150,7 +2173,7 @@ function getKeys(e, t, n = true) {
|
|
|
2150
2173
|
const i = new Set(r);
|
|
2151
2174
|
const s = Reflect.ownKeys(t);
|
|
2152
2175
|
for (const e of s) {
|
|
2153
|
-
if (t[e] !==
|
|
2176
|
+
if (t[e] !== J) i.add(e);
|
|
2154
2177
|
else i.delete(e);
|
|
2155
2178
|
}
|
|
2156
2179
|
return Array.from(i);
|
|
@@ -2158,27 +2181,27 @@ function getKeys(e, t, n = true) {
|
|
|
2158
2181
|
function getPropertyDescriptor(e, t, n) {
|
|
2159
2182
|
let r = e;
|
|
2160
2183
|
if (t && n in t) {
|
|
2161
|
-
if (r[n] ===
|
|
2184
|
+
if (r[n] === J) return void 0;
|
|
2162
2185
|
if (!(n in r)) r = t;
|
|
2163
2186
|
}
|
|
2164
2187
|
return Reflect.getOwnPropertyDescriptor(r, n);
|
|
2165
2188
|
}
|
|
2166
|
-
let
|
|
2167
|
-
const
|
|
2189
|
+
let ue = null;
|
|
2190
|
+
const fe = {
|
|
2168
2191
|
get(e, t, n) {
|
|
2169
|
-
if (t ===
|
|
2170
|
-
if (t ===
|
|
2171
|
-
if (t === O) return e[
|
|
2172
|
-
if (t ===
|
|
2192
|
+
if (t === z) return e;
|
|
2193
|
+
if (t === U) return n;
|
|
2194
|
+
if (t === O) return e[re];
|
|
2195
|
+
if (t === K) {
|
|
2173
2196
|
trackSelf(e);
|
|
2174
2197
|
return n;
|
|
2175
2198
|
}
|
|
2176
|
-
const r = getNodes(e,
|
|
2199
|
+
const r = getNodes(e, $);
|
|
2177
2200
|
const i = r[t];
|
|
2178
|
-
const s = e[
|
|
2179
|
-
const o = s || (e[
|
|
2180
|
-
const u = !!e[
|
|
2181
|
-
const f = s ? e[
|
|
2201
|
+
const s = e[Z] && t in e[Z];
|
|
2202
|
+
const o = s || (e[Y] && t in e[Y]);
|
|
2203
|
+
const u = !!e[X][z];
|
|
2204
|
+
const f = s ? e[Z] : e[Y] && t in e[Y] ? e[Y] : e[X];
|
|
2182
2205
|
if (!i) {
|
|
2183
2206
|
const e = Object.getOwnPropertyDescriptor(f, t);
|
|
2184
2207
|
if (e && e.get) return e.get.call(n);
|
|
@@ -2186,45 +2209,45 @@ const ce = {
|
|
|
2186
2209
|
if (writeOnly(n)) {
|
|
2187
2210
|
let n =
|
|
2188
2211
|
i && (o || !u) ? (i.ee !== undefined && i.ee !== S ? i.ee : i.Z !== S ? i.Z : i.$) : f[t];
|
|
2189
|
-
n ===
|
|
2212
|
+
n === J && (n = undefined);
|
|
2190
2213
|
if (!isWrappable(n)) return n;
|
|
2191
2214
|
const r = wrap(n, e);
|
|
2192
|
-
|
|
2215
|
+
ue?.add(r);
|
|
2193
2216
|
return r;
|
|
2194
2217
|
}
|
|
2195
2218
|
let c = i ? (o || !u ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
2196
|
-
c ===
|
|
2219
|
+
c === J && (c = undefined);
|
|
2197
2220
|
if (!i) {
|
|
2198
2221
|
if (!o && typeof c === "function" && !f.hasOwnProperty(t)) {
|
|
2199
2222
|
let t;
|
|
2200
|
-
return !Array.isArray(e[
|
|
2223
|
+
return !Array.isArray(e[X]) && (t = Object.getPrototypeOf(e[X])) && t !== Object.prototype
|
|
2201
2224
|
? c.bind(f)
|
|
2202
2225
|
: c;
|
|
2203
2226
|
} else if (getObserver()) {
|
|
2204
|
-
return read(getNode(r, t, isWrappable(c) ? wrap(c, e) : c, e[
|
|
2227
|
+
return read(getNode(r, t, isWrappable(c) ? wrap(c, e) : c, e[re], isEqual, e[ie], e[m]));
|
|
2205
2228
|
}
|
|
2206
2229
|
}
|
|
2207
2230
|
return isWrappable(c) ? wrap(c, e) : c;
|
|
2208
2231
|
},
|
|
2209
2232
|
has(e, t) {
|
|
2210
|
-
if (t ===
|
|
2211
|
-
const n = e[
|
|
2212
|
-
getObserver() && read(getNode(getNodes(e,
|
|
2233
|
+
if (t === U || t === K || t === "__proto__") return true;
|
|
2234
|
+
const n = e[Z] && t in e[Z] ? e[Z][t] !== J : e[Y] && t in e[Y] ? e[Y][t] !== J : t in e[X];
|
|
2235
|
+
getObserver() && read(getNode(getNodes(e, ee), t, n, e[re], isEqual, e[ie]));
|
|
2213
2236
|
return n;
|
|
2214
2237
|
},
|
|
2215
2238
|
set(e, t, n) {
|
|
2216
|
-
const r = e[
|
|
2239
|
+
const r = e[U];
|
|
2217
2240
|
if (writeOnly(r)) {
|
|
2218
|
-
if (e[
|
|
2219
|
-
const t = e[
|
|
2241
|
+
if (e[ie]) {
|
|
2242
|
+
const t = e[re];
|
|
2220
2243
|
if (t?.K) {
|
|
2221
|
-
|
|
2244
|
+
A.initTransition(t.K);
|
|
2222
2245
|
}
|
|
2223
2246
|
}
|
|
2224
2247
|
untrack(() => {
|
|
2225
|
-
const i = e[
|
|
2248
|
+
const i = e[X];
|
|
2226
2249
|
const s = i[t];
|
|
2227
|
-
if (M && typeof t !== "symbol" && !((e[
|
|
2250
|
+
if (M && typeof t !== "symbol" && !((e[re]?.ge ?? 0) & a)) {
|
|
2228
2251
|
if (!e[m]) {
|
|
2229
2252
|
e[m] = Object.create(null);
|
|
2230
2253
|
G?.add(e);
|
|
@@ -2233,18 +2256,18 @@ const ce = {
|
|
|
2233
2256
|
e[m][t] = s;
|
|
2234
2257
|
}
|
|
2235
2258
|
}
|
|
2236
|
-
const o = e[
|
|
2237
|
-
const u = o ?
|
|
2259
|
+
const o = e[ie] && !W;
|
|
2260
|
+
const u = o ? Z : Y;
|
|
2238
2261
|
if (o) trackOptimisticStore(r);
|
|
2239
|
-
const f = e[
|
|
2240
|
-
const c = n?.[
|
|
2262
|
+
const f = e[Z] && t in e[Z] ? e[Z][t] : e[Y] && t in e[Y] ? e[Y][t] : s;
|
|
2263
|
+
const c = n?.[z]?.[X] ?? n;
|
|
2241
2264
|
if (f === c) return true;
|
|
2242
|
-
const l = e[
|
|
2265
|
+
const l = e[Z]?.length || e[Y]?.length || i.length;
|
|
2243
2266
|
if (c !== undefined && c === s) delete e[u][t];
|
|
2244
2267
|
else (e[u] || (e[u] = Object.create(null)))[t] = c;
|
|
2245
2268
|
const d = isWrappable(c);
|
|
2246
|
-
e[
|
|
2247
|
-
const p = getNodes(e,
|
|
2269
|
+
e[ee]?.[t] && setSignal(e[ee][t], true);
|
|
2270
|
+
const p = getNodes(e, $);
|
|
2248
2271
|
p[t] && setSignal(p[t], () => (d ? wrap(c, e) : c));
|
|
2249
2272
|
if (Array.isArray(i)) {
|
|
2250
2273
|
if (t === "length") {
|
|
@@ -2254,40 +2277,40 @@ const ce = {
|
|
|
2254
2277
|
if (e > l) p.length && setSignal(p.length, e);
|
|
2255
2278
|
}
|
|
2256
2279
|
}
|
|
2257
|
-
p[
|
|
2280
|
+
p[K] && setSignal(p[K], undefined);
|
|
2258
2281
|
});
|
|
2259
2282
|
}
|
|
2260
2283
|
return true;
|
|
2261
2284
|
},
|
|
2262
2285
|
deleteProperty(e, t) {
|
|
2263
|
-
const n = e[
|
|
2264
|
-
const r = e[
|
|
2265
|
-
if (writeOnly(e[
|
|
2286
|
+
const n = e[Z]?.[t] === J;
|
|
2287
|
+
const r = e[Y]?.[t] === J;
|
|
2288
|
+
if (writeOnly(e[U]) && !n && !r) {
|
|
2266
2289
|
untrack(() => {
|
|
2267
|
-
const n = e[
|
|
2268
|
-
const r = n ?
|
|
2269
|
-
if (n) trackOptimisticStore(e[
|
|
2270
|
-
const i = e[
|
|
2271
|
-
if (t in e[
|
|
2272
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
2290
|
+
const n = e[ie] && !W;
|
|
2291
|
+
const r = n ? Z : Y;
|
|
2292
|
+
if (n) trackOptimisticStore(e[U]);
|
|
2293
|
+
const i = e[Z] && t in e[Z] ? e[Z][t] : e[Y] && t in e[Y] ? e[Y][t] : e[X][t];
|
|
2294
|
+
if (t in e[X] || (e[Y] && t in e[Y])) {
|
|
2295
|
+
(e[r] || (e[r] = Object.create(null)))[t] = J;
|
|
2273
2296
|
} else if (e[r] && t in e[r]) {
|
|
2274
2297
|
delete e[r][t];
|
|
2275
2298
|
} else return true;
|
|
2276
|
-
if (e[
|
|
2277
|
-
const s = getNodes(e,
|
|
2299
|
+
if (e[ee]?.[t]) setSignal(e[ee][t], false);
|
|
2300
|
+
const s = getNodes(e, $);
|
|
2278
2301
|
s[t] && setSignal(s[t], undefined);
|
|
2279
|
-
s[
|
|
2302
|
+
s[K] && setSignal(s[K], undefined);
|
|
2280
2303
|
});
|
|
2281
2304
|
}
|
|
2282
2305
|
return true;
|
|
2283
2306
|
},
|
|
2284
2307
|
ownKeys(e) {
|
|
2285
2308
|
trackSelf(e);
|
|
2286
|
-
let t = getKeys(e[
|
|
2287
|
-
if (e[
|
|
2309
|
+
let t = getKeys(e[X], e[Y], false);
|
|
2310
|
+
if (e[Z]) {
|
|
2288
2311
|
const n = new Set(t);
|
|
2289
|
-
for (const t of Reflect.ownKeys(e[
|
|
2290
|
-
if (e[
|
|
2312
|
+
for (const t of Reflect.ownKeys(e[Z])) {
|
|
2313
|
+
if (e[Z][t] !== J) n.add(t);
|
|
2291
2314
|
else n.delete(t);
|
|
2292
2315
|
}
|
|
2293
2316
|
t = Array.from(n);
|
|
@@ -2295,25 +2318,25 @@ const ce = {
|
|
|
2295
2318
|
return t;
|
|
2296
2319
|
},
|
|
2297
2320
|
getOwnPropertyDescriptor(e, t) {
|
|
2298
|
-
if (t ===
|
|
2299
|
-
if (e[
|
|
2300
|
-
if (e[
|
|
2301
|
-
const n = getPropertyDescriptor(e[
|
|
2321
|
+
if (t === U) return { value: e[U], writable: true, configurable: true };
|
|
2322
|
+
if (e[Z] && t in e[Z]) {
|
|
2323
|
+
if (e[Z][t] === J) return undefined;
|
|
2324
|
+
const n = getPropertyDescriptor(e[X], e[Y], t);
|
|
2302
2325
|
if (n) {
|
|
2303
|
-
return { ...n, value: e[
|
|
2326
|
+
return { ...n, value: e[Z][t] };
|
|
2304
2327
|
}
|
|
2305
|
-
return { value: e[
|
|
2328
|
+
return { value: e[Z][t], writable: true, enumerable: true, configurable: true };
|
|
2306
2329
|
}
|
|
2307
|
-
return getPropertyDescriptor(e[
|
|
2330
|
+
return getPropertyDescriptor(e[X], e[Y], t);
|
|
2308
2331
|
},
|
|
2309
2332
|
getPrototypeOf(e) {
|
|
2310
|
-
return Object.getPrototypeOf(e[
|
|
2333
|
+
return Object.getPrototypeOf(e[X]);
|
|
2311
2334
|
}
|
|
2312
2335
|
};
|
|
2313
2336
|
function storeSetter(e, t) {
|
|
2314
|
-
const n =
|
|
2315
|
-
|
|
2316
|
-
|
|
2337
|
+
const n = ue;
|
|
2338
|
+
ue = new Set();
|
|
2339
|
+
ue.add(e);
|
|
2317
2340
|
try {
|
|
2318
2341
|
const n = t(e);
|
|
2319
2342
|
if (n !== e && n !== undefined) {
|
|
@@ -2329,8 +2352,8 @@ function storeSetter(e, t) {
|
|
|
2329
2352
|
}
|
|
2330
2353
|
}
|
|
2331
2354
|
} finally {
|
|
2332
|
-
|
|
2333
|
-
|
|
2355
|
+
ue.clear();
|
|
2356
|
+
ue = n;
|
|
2334
2357
|
}
|
|
2335
2358
|
}
|
|
2336
2359
|
function createStore(e, t, n) {
|
|
@@ -2347,39 +2370,39 @@ function createOptimisticStore(e, t, n) {
|
|
|
2347
2370
|
return [o, e => storeSetter(o, e)];
|
|
2348
2371
|
}
|
|
2349
2372
|
function clearOptimisticStore(e) {
|
|
2350
|
-
const t = e[
|
|
2351
|
-
if (!t || !t[
|
|
2352
|
-
const n = t[
|
|
2353
|
-
const r = t[
|
|
2373
|
+
const t = e[z];
|
|
2374
|
+
if (!t || !t[Z]) return;
|
|
2375
|
+
const n = t[Z];
|
|
2376
|
+
const r = t[$];
|
|
2354
2377
|
setProjectionWriteActive(true);
|
|
2355
2378
|
try {
|
|
2356
2379
|
if (r) {
|
|
2357
2380
|
for (const e of Reflect.ownKeys(n)) {
|
|
2358
2381
|
if (r[e]) {
|
|
2359
2382
|
r[e].Y = undefined;
|
|
2360
|
-
const n = t[
|
|
2361
|
-
const i = n ===
|
|
2383
|
+
const n = t[Y] && e in t[Y] ? t[Y][e] : t[X][e];
|
|
2384
|
+
const i = n === J ? undefined : n;
|
|
2362
2385
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2363
2386
|
}
|
|
2364
2387
|
}
|
|
2365
|
-
if (r[
|
|
2366
|
-
r[
|
|
2367
|
-
setSignal(r[
|
|
2388
|
+
if (r[K]) {
|
|
2389
|
+
r[K].Y = undefined;
|
|
2390
|
+
setSignal(r[K], undefined);
|
|
2368
2391
|
}
|
|
2369
2392
|
}
|
|
2370
2393
|
} finally {
|
|
2371
2394
|
setProjectionWriteActive(false);
|
|
2372
2395
|
}
|
|
2373
|
-
delete t[
|
|
2396
|
+
delete t[Z];
|
|
2374
2397
|
}
|
|
2375
2398
|
function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
2376
2399
|
let r;
|
|
2377
2400
|
const i = new WeakMap();
|
|
2378
2401
|
const wrapper = e => {
|
|
2379
|
-
e[
|
|
2380
|
-
e[
|
|
2381
|
-
e[
|
|
2382
|
-
Object.defineProperty(e,
|
|
2402
|
+
e[te] = wrapProjection;
|
|
2403
|
+
e[ne] = i;
|
|
2404
|
+
e[ie] = true;
|
|
2405
|
+
Object.defineProperty(e, re, {
|
|
2383
2406
|
get() {
|
|
2384
2407
|
return r;
|
|
2385
2408
|
},
|
|
@@ -2388,8 +2411,8 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2388
2411
|
};
|
|
2389
2412
|
const wrapProjection = e => {
|
|
2390
2413
|
if (i.has(e)) return i.get(e);
|
|
2391
|
-
if (e[
|
|
2392
|
-
const t = createStoreProxy(e,
|
|
2414
|
+
if (e[z]?.[te] === wrapProjection) return e;
|
|
2415
|
+
const t = createStoreProxy(e, fe, wrapper);
|
|
2393
2416
|
i.set(e, t);
|
|
2394
2417
|
return t;
|
|
2395
2418
|
};
|
|
@@ -2397,18 +2420,26 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2397
2420
|
if (e) {
|
|
2398
2421
|
r = computed(() => {
|
|
2399
2422
|
const t = getOwner();
|
|
2423
|
+
let r = false;
|
|
2424
|
+
let i;
|
|
2425
|
+
const o = new Proxy(
|
|
2426
|
+
s,
|
|
2427
|
+
createWriteTraps(() => !r || t.Oe === i)
|
|
2428
|
+
);
|
|
2400
2429
|
setProjectionWriteActive(true);
|
|
2401
2430
|
try {
|
|
2402
|
-
storeSetter(
|
|
2403
|
-
|
|
2431
|
+
storeSetter(o, o => {
|
|
2432
|
+
i = e(o);
|
|
2433
|
+
r = true;
|
|
2434
|
+
const u = handleAsync(t, i, e => {
|
|
2404
2435
|
setProjectionWriteActive(true);
|
|
2405
2436
|
try {
|
|
2406
|
-
e !==
|
|
2437
|
+
e !== o && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id"));
|
|
2407
2438
|
} finally {
|
|
2408
2439
|
setProjectionWriteActive(false);
|
|
2409
2440
|
}
|
|
2410
2441
|
});
|
|
2411
|
-
|
|
2442
|
+
u !== o && u !== undefined && reconcile(u, n?.key || "id")(s);
|
|
2412
2443
|
});
|
|
2413
2444
|
} finally {
|
|
2414
2445
|
setProjectionWriteActive(false);
|
|
@@ -2418,7 +2449,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2418
2449
|
}
|
|
2419
2450
|
return { store: s, node: r };
|
|
2420
2451
|
}
|
|
2421
|
-
const
|
|
2452
|
+
const ce = Symbol(0);
|
|
2422
2453
|
function updatePath(e, t, n = 0) {
|
|
2423
2454
|
let r,
|
|
2424
2455
|
i = e;
|
|
@@ -2462,7 +2493,7 @@ function updatePath(e, t, n = 0) {
|
|
|
2462
2493
|
if (s === i) return;
|
|
2463
2494
|
}
|
|
2464
2495
|
if (r === undefined && s == undefined) return;
|
|
2465
|
-
if (s ===
|
|
2496
|
+
if (s === ce) {
|
|
2466
2497
|
delete e[r];
|
|
2467
2498
|
} else if (r === undefined || (isWrappable(i) && isWrappable(s) && !Array.isArray(s))) {
|
|
2468
2499
|
const t = r !== undefined ? e[r] : e;
|
|
@@ -2472,26 +2503,26 @@ function updatePath(e, t, n = 0) {
|
|
|
2472
2503
|
e[r] = s;
|
|
2473
2504
|
}
|
|
2474
2505
|
}
|
|
2475
|
-
const
|
|
2506
|
+
const le = Object.assign(
|
|
2476
2507
|
function storePath(...e) {
|
|
2477
2508
|
return t => {
|
|
2478
2509
|
updatePath(t, e);
|
|
2479
2510
|
};
|
|
2480
2511
|
},
|
|
2481
|
-
{ DELETE:
|
|
2512
|
+
{ DELETE: ce }
|
|
2482
2513
|
);
|
|
2483
2514
|
function snapshotImpl(e, t, n, r) {
|
|
2484
2515
|
let i, s, o, u, f, c;
|
|
2485
2516
|
if (!isWrappable(e)) return e;
|
|
2486
2517
|
if (n && n.has(e)) return n.get(e);
|
|
2487
2518
|
if (!n) n = new Map();
|
|
2488
|
-
if ((i = e[
|
|
2489
|
-
if (t) trackSelf(i,
|
|
2490
|
-
o = i[
|
|
2491
|
-
s = Array.isArray(i[
|
|
2492
|
-
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[
|
|
2493
|
-
e = i[
|
|
2494
|
-
r =
|
|
2519
|
+
if ((i = e[z] || r?.get(e)?.[z])) {
|
|
2520
|
+
if (t) trackSelf(i, K);
|
|
2521
|
+
o = i[Y];
|
|
2522
|
+
s = Array.isArray(i[X]);
|
|
2523
|
+
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[X]))) : i[X]);
|
|
2524
|
+
e = i[X];
|
|
2525
|
+
r = se;
|
|
2495
2526
|
} else {
|
|
2496
2527
|
s = Array.isArray(e);
|
|
2497
2528
|
n.set(e, e);
|
|
@@ -2500,7 +2531,7 @@ function snapshotImpl(e, t, n, r) {
|
|
|
2500
2531
|
const s = o?.length || e.length;
|
|
2501
2532
|
for (let l = 0; l < s; l++) {
|
|
2502
2533
|
c = o && l in o ? o[l] : e[l];
|
|
2503
|
-
if (c ===
|
|
2534
|
+
if (c === J) continue;
|
|
2504
2535
|
if (t && isWrappable(c)) wrap(c, i);
|
|
2505
2536
|
if ((f = snapshotImpl(c, t, n, r)) !== c || u) {
|
|
2506
2537
|
if (!u) n.set(e, (u = [...e]));
|
|
@@ -2535,13 +2566,13 @@ function deep(e) {
|
|
|
2535
2566
|
function trueFn() {
|
|
2536
2567
|
return true;
|
|
2537
2568
|
}
|
|
2538
|
-
const
|
|
2569
|
+
const ae = {
|
|
2539
2570
|
get(e, t, n) {
|
|
2540
|
-
if (t ===
|
|
2571
|
+
if (t === U) return n;
|
|
2541
2572
|
return e.get(t);
|
|
2542
2573
|
},
|
|
2543
2574
|
has(e, t) {
|
|
2544
|
-
if (t ===
|
|
2575
|
+
if (t === U) return true;
|
|
2545
2576
|
return e.has(t);
|
|
2546
2577
|
},
|
|
2547
2578
|
set: trueFn,
|
|
@@ -2564,15 +2595,15 @@ const de = {
|
|
|
2564
2595
|
function resolveSource(e) {
|
|
2565
2596
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
2566
2597
|
}
|
|
2567
|
-
const
|
|
2598
|
+
const de = Symbol(0);
|
|
2568
2599
|
function merge(...e) {
|
|
2569
2600
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
2570
2601
|
let t = false;
|
|
2571
2602
|
const n = [];
|
|
2572
2603
|
for (let r = 0; r < e.length; r++) {
|
|
2573
2604
|
const i = e[r];
|
|
2574
|
-
t = t || (!!i &&
|
|
2575
|
-
const s = !!i && i[
|
|
2605
|
+
t = t || (!!i && U in i);
|
|
2606
|
+
const s = !!i && i[de];
|
|
2576
2607
|
if (s) n.push(...s);
|
|
2577
2608
|
else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
2578
2609
|
}
|
|
@@ -2580,7 +2611,7 @@ function merge(...e) {
|
|
|
2580
2611
|
return new Proxy(
|
|
2581
2612
|
{
|
|
2582
2613
|
get(e) {
|
|
2583
|
-
if (e ===
|
|
2614
|
+
if (e === de) return n;
|
|
2584
2615
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
2585
2616
|
const r = resolveSource(n[t]);
|
|
2586
2617
|
if (e in r) return r[e];
|
|
@@ -2598,7 +2629,7 @@ function merge(...e) {
|
|
|
2598
2629
|
return [...new Set(e)];
|
|
2599
2630
|
}
|
|
2600
2631
|
},
|
|
2601
|
-
|
|
2632
|
+
ae
|
|
2602
2633
|
);
|
|
2603
2634
|
}
|
|
2604
2635
|
const r = Object.create(null);
|
|
@@ -2630,12 +2661,12 @@ function merge(...e) {
|
|
|
2630
2661
|
if (n.get) Object.defineProperty(o, t, n);
|
|
2631
2662
|
else o[t] = n.value;
|
|
2632
2663
|
}
|
|
2633
|
-
o[
|
|
2664
|
+
o[de] = n;
|
|
2634
2665
|
return o;
|
|
2635
2666
|
}
|
|
2636
2667
|
function omit(e, ...t) {
|
|
2637
2668
|
const n = new Set(t);
|
|
2638
|
-
if (b &&
|
|
2669
|
+
if (b && U in e) {
|
|
2639
2670
|
return new Proxy(
|
|
2640
2671
|
{
|
|
2641
2672
|
get(t) {
|
|
@@ -2648,7 +2679,7 @@ function omit(e, ...t) {
|
|
|
2648
2679
|
return Object.keys(e).filter(e => !n.has(e));
|
|
2649
2680
|
}
|
|
2650
2681
|
},
|
|
2651
|
-
|
|
2682
|
+
ae
|
|
2652
2683
|
);
|
|
2653
2684
|
}
|
|
2654
2685
|
const r = {};
|
|
@@ -2682,24 +2713,24 @@ function mapArray(e, t, n) {
|
|
|
2682
2713
|
})
|
|
2683
2714
|
);
|
|
2684
2715
|
}
|
|
2685
|
-
const
|
|
2716
|
+
const pe = { pureWrite: true };
|
|
2686
2717
|
function updateKeyedMap() {
|
|
2687
2718
|
const e = this.Je() || [],
|
|
2688
2719
|
t = e.length;
|
|
2689
|
-
e[
|
|
2720
|
+
e[K];
|
|
2690
2721
|
runWithOwner(this.ze, () => {
|
|
2691
2722
|
let n,
|
|
2692
2723
|
r,
|
|
2693
2724
|
i = this.tt
|
|
2694
2725
|
? () => {
|
|
2695
|
-
this.tt[r] = signal(e[r],
|
|
2696
|
-
this.nt && (this.nt[r] = signal(r,
|
|
2726
|
+
this.tt[r] = signal(e[r], pe);
|
|
2727
|
+
this.nt && (this.nt[r] = signal(r, pe));
|
|
2697
2728
|
return this.Ye(accessor(this.tt[r]), this.nt ? accessor(this.nt[r]) : undefined);
|
|
2698
2729
|
}
|
|
2699
2730
|
: this.nt
|
|
2700
2731
|
? () => {
|
|
2701
2732
|
const t = e[r];
|
|
2702
|
-
this.nt[r] = signal(r,
|
|
2733
|
+
this.nt[r] = signal(r, pe);
|
|
2703
2734
|
return this.Ye(() => t, accessor(this.nt[r]));
|
|
2704
2735
|
}
|
|
2705
2736
|
: () => {
|
|
@@ -2882,20 +2913,20 @@ function boundaryComputed(e, t) {
|
|
|
2882
2913
|
function createBoundChildren(e, t, n, r) {
|
|
2883
2914
|
const i = e.B;
|
|
2884
2915
|
i.addChild((e.B = n));
|
|
2885
|
-
|
|
2916
|
+
cleanup(() => i.removeChild(e.B));
|
|
2886
2917
|
return runWithOwner(e, () => {
|
|
2887
2918
|
const e = computed(t);
|
|
2888
2919
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|
|
2889
2920
|
});
|
|
2890
2921
|
}
|
|
2891
|
-
const
|
|
2922
|
+
const he = Symbol();
|
|
2892
2923
|
class CollectionQueue extends Queue {
|
|
2893
2924
|
ft;
|
|
2894
2925
|
ct = new Set();
|
|
2895
2926
|
lt = signal(false, { pureWrite: true, De: true });
|
|
2896
2927
|
dt = false;
|
|
2897
2928
|
ht;
|
|
2898
|
-
gt =
|
|
2929
|
+
gt = he;
|
|
2899
2930
|
constructor(e) {
|
|
2900
2931
|
super();
|
|
2901
2932
|
this.ft = e;
|
|
@@ -2911,7 +2942,7 @@ class CollectionQueue extends Queue {
|
|
|
2911
2942
|
try {
|
|
2912
2943
|
return this.ht();
|
|
2913
2944
|
} catch {
|
|
2914
|
-
return
|
|
2945
|
+
return he;
|
|
2915
2946
|
}
|
|
2916
2947
|
});
|
|
2917
2948
|
if (e !== this.gt) {
|
|
@@ -3028,10 +3059,10 @@ function flattenArray(e, t = [], n) {
|
|
|
3028
3059
|
if (r) throw r;
|
|
3029
3060
|
return i;
|
|
3030
3061
|
}
|
|
3031
|
-
exports.$PROXY =
|
|
3062
|
+
exports.$PROXY = U;
|
|
3032
3063
|
exports.$REFRESH = O;
|
|
3033
|
-
exports.$TARGET =
|
|
3034
|
-
exports.$TRACK =
|
|
3064
|
+
exports.$TARGET = z;
|
|
3065
|
+
exports.$TRACK = K;
|
|
3035
3066
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
3036
3067
|
exports.NoOwnerError = NoOwnerError;
|
|
3037
3068
|
exports.NotReadyError = NotReadyError;
|
|
@@ -3084,5 +3115,5 @@ exports.runWithOwner = runWithOwner;
|
|
|
3084
3115
|
exports.setContext = setContext;
|
|
3085
3116
|
exports.setSnapshotCapture = setSnapshotCapture;
|
|
3086
3117
|
exports.snapshot = snapshot;
|
|
3087
|
-
exports.storePath =
|
|
3118
|
+
exports.storePath = le;
|
|
3088
3119
|
exports.untrack = untrack;
|