@solidjs/signals 0.11.2 → 0.12.0
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 +38 -20
- package/dist/node.cjs +332 -327
- package/dist/prod.js +13 -13
- package/dist/types/core/core.d.ts +9 -3
- package/dist/types/core/index.d.ts +2 -2
- package/dist/types/core/scheduler.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -105,12 +105,12 @@ function markNode(e, r = n) {
|
|
|
105
105
|
if ((i & (t | n)) >= r) return;
|
|
106
106
|
e.m = (i & -4) | r;
|
|
107
107
|
for (let n = e.O; n !== null; n = n.P) {
|
|
108
|
-
markNode(n.
|
|
108
|
+
markNode(n.A, t);
|
|
109
109
|
}
|
|
110
|
-
if (e.
|
|
111
|
-
for (let n = e.
|
|
110
|
+
if (e.k !== null) {
|
|
111
|
+
for (let n = e.k; n !== null; n = n.C) {
|
|
112
112
|
for (let e = n.O; e !== null; e = e.P) {
|
|
113
|
-
markNode(e.
|
|
113
|
+
markNode(e.A, t);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
}
|
|
@@ -133,25 +133,26 @@ function adjustHeight(e, t) {
|
|
|
133
133
|
for (let t = e.W; t; t = t.N) {
|
|
134
134
|
const e = t.L;
|
|
135
135
|
const r = e.I || e;
|
|
136
|
-
if (r.
|
|
136
|
+
if (r.H && r.o >= n) n = r.o + 1;
|
|
137
137
|
}
|
|
138
138
|
if (e.o !== n) {
|
|
139
139
|
e.o = n;
|
|
140
140
|
for (let n = e.O; n !== null; n = n.P) {
|
|
141
|
-
insertIntoHeapHeight(n.
|
|
141
|
+
insertIntoHeapHeight(n.A, t);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
const x = new Set();
|
|
146
146
|
const v = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
147
147
|
const P = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
148
|
-
let
|
|
149
|
-
let
|
|
148
|
+
let A = 0;
|
|
149
|
+
let k = null;
|
|
150
150
|
let C = false;
|
|
151
151
|
let E = false;
|
|
152
|
+
function setOnUnhandledAsync(e) {}
|
|
152
153
|
function runLaneEffects(e) {
|
|
153
154
|
for (const t of N) {
|
|
154
|
-
if (t.
|
|
155
|
+
if (t.R || t.T.size > 0) continue;
|
|
155
156
|
const n = t.M[e - 1];
|
|
156
157
|
if (n.length) {
|
|
157
158
|
t.M[e - 1] = [];
|
|
@@ -165,13 +166,13 @@ function setProjectionWriteActive(e) {
|
|
|
165
166
|
function schedule() {
|
|
166
167
|
if (C) return;
|
|
167
168
|
C = true;
|
|
168
|
-
if (!j.q) queueMicrotask(flush);
|
|
169
|
+
if (!j.q && !E) queueMicrotask(flush);
|
|
169
170
|
}
|
|
170
171
|
class Queue {
|
|
171
172
|
i = null;
|
|
172
173
|
F = [[], []];
|
|
173
174
|
V = [];
|
|
174
|
-
created =
|
|
175
|
+
created = A;
|
|
175
176
|
addChild(e) {
|
|
176
177
|
this.V.push(e);
|
|
177
178
|
e.i = this;
|
|
@@ -243,36 +244,36 @@ class GlobalQueue extends Queue {
|
|
|
243
244
|
this.q = true;
|
|
244
245
|
try {
|
|
245
246
|
runHeap(v, GlobalQueue.K);
|
|
246
|
-
if (
|
|
247
|
-
const e = transitionComplete(
|
|
247
|
+
if (k) {
|
|
248
|
+
const e = transitionComplete(k);
|
|
248
249
|
if (!e) {
|
|
249
|
-
let e =
|
|
250
|
+
let e = k;
|
|
250
251
|
runHeap(P, GlobalQueue.K);
|
|
251
252
|
this.D = [];
|
|
252
253
|
this.B = [];
|
|
253
254
|
this.G = new Set();
|
|
254
255
|
runLaneEffects(h);
|
|
255
256
|
runLaneEffects(y);
|
|
256
|
-
this.stashQueues(
|
|
257
|
-
|
|
257
|
+
this.stashQueues(k.X);
|
|
258
|
+
A++;
|
|
258
259
|
C = v.S >= v.j;
|
|
259
|
-
reassignPendingTransition(
|
|
260
|
-
|
|
260
|
+
reassignPendingTransition(k.D);
|
|
261
|
+
k = null;
|
|
261
262
|
finalizePureQueue(null, true);
|
|
262
263
|
return;
|
|
263
264
|
}
|
|
264
|
-
this.D !==
|
|
265
|
-
this.restoreQueues(
|
|
266
|
-
x.delete(
|
|
267
|
-
const t =
|
|
268
|
-
|
|
265
|
+
this.D !== k.D && this.D.push(...k.D);
|
|
266
|
+
this.restoreQueues(k.X);
|
|
267
|
+
x.delete(k);
|
|
268
|
+
const t = k;
|
|
269
|
+
k = null;
|
|
269
270
|
reassignPendingTransition(this.D);
|
|
270
271
|
finalizePureQueue(t);
|
|
271
272
|
} else {
|
|
272
273
|
if (x.size) runHeap(P, GlobalQueue.K);
|
|
273
274
|
finalizePureQueue();
|
|
274
275
|
}
|
|
275
|
-
|
|
276
|
+
A++;
|
|
276
277
|
C = v.S >= v.j;
|
|
277
278
|
runLaneEffects(h);
|
|
278
279
|
this.run(h);
|
|
@@ -286,8 +287,8 @@ class GlobalQueue extends Queue {
|
|
|
286
287
|
if (t & a) {
|
|
287
288
|
if (n & a) {
|
|
288
289
|
const t = r !== undefined ? r : e.Y;
|
|
289
|
-
if (
|
|
290
|
-
|
|
290
|
+
if (k && t && !k.Z.includes(t.source)) {
|
|
291
|
+
k.Z.push(t.source);
|
|
291
292
|
schedule();
|
|
292
293
|
}
|
|
293
294
|
}
|
|
@@ -297,11 +298,11 @@ class GlobalQueue extends Queue {
|
|
|
297
298
|
}
|
|
298
299
|
initTransition(e) {
|
|
299
300
|
if (e) e = currentTransition(e);
|
|
300
|
-
if (e && e ===
|
|
301
|
-
if (!e &&
|
|
302
|
-
if (!
|
|
303
|
-
|
|
304
|
-
$:
|
|
301
|
+
if (e && e === k) return;
|
|
302
|
+
if (!e && k && k.$ === A) return;
|
|
303
|
+
if (!k) {
|
|
304
|
+
k = e ?? {
|
|
305
|
+
$: A,
|
|
305
306
|
D: [],
|
|
306
307
|
Z: [],
|
|
307
308
|
B: [],
|
|
@@ -311,7 +312,7 @@ class GlobalQueue extends Queue {
|
|
|
311
312
|
te: false
|
|
312
313
|
};
|
|
313
314
|
} else if (e) {
|
|
314
|
-
const t =
|
|
315
|
+
const t = k;
|
|
315
316
|
t.te = e;
|
|
316
317
|
e.ee.push(...t.ee);
|
|
317
318
|
for (const n of N) {
|
|
@@ -322,45 +323,45 @@ class GlobalQueue extends Queue {
|
|
|
322
323
|
e.G.add(n);
|
|
323
324
|
}
|
|
324
325
|
x.delete(t);
|
|
325
|
-
|
|
326
|
+
k = e;
|
|
326
327
|
}
|
|
327
|
-
x.add(
|
|
328
|
-
|
|
328
|
+
x.add(k);
|
|
329
|
+
k.$ = A;
|
|
329
330
|
for (let e = 0; e < this.D.length; e++) {
|
|
330
331
|
const t = this.D[e];
|
|
331
|
-
t.ne =
|
|
332
|
-
|
|
332
|
+
t.ne = k;
|
|
333
|
+
k.D.push(t);
|
|
333
334
|
}
|
|
334
|
-
this.D =
|
|
335
|
+
this.D = k.D;
|
|
335
336
|
for (let e = 0; e < this.B.length; e++) {
|
|
336
337
|
const t = this.B[e];
|
|
337
|
-
t.ne =
|
|
338
|
-
|
|
338
|
+
t.ne = k;
|
|
339
|
+
k.B.push(t);
|
|
339
340
|
}
|
|
340
|
-
this.B =
|
|
341
|
+
this.B = k.B;
|
|
341
342
|
for (const e of N) {
|
|
342
|
-
if (!e.ne) e.ne =
|
|
343
|
+
if (!e.ne) e.ne = k;
|
|
343
344
|
}
|
|
344
|
-
for (const e of this.G)
|
|
345
|
-
this.G =
|
|
345
|
+
for (const e of this.G) k.G.add(e);
|
|
346
|
+
this.G = k.G;
|
|
346
347
|
}
|
|
347
348
|
}
|
|
348
349
|
function insertSubs(e, t = false) {
|
|
349
350
|
const n = e.re || F;
|
|
350
351
|
const r = e.ie !== undefined;
|
|
351
352
|
for (let i = e.O; i !== null; i = i.P) {
|
|
352
|
-
if (r && i.
|
|
353
|
-
i.
|
|
353
|
+
if (r && i.A.se) {
|
|
354
|
+
i.A.m |= l;
|
|
354
355
|
continue;
|
|
355
356
|
}
|
|
356
357
|
if (t && n) {
|
|
357
|
-
i.
|
|
358
|
-
assignOrMergeLane(i.
|
|
358
|
+
i.A.m |= f;
|
|
359
|
+
assignOrMergeLane(i.A, n);
|
|
359
360
|
} else if (t) {
|
|
360
|
-
i.
|
|
361
|
-
i.
|
|
361
|
+
i.A.m |= f;
|
|
362
|
+
i.A.re = undefined;
|
|
362
363
|
}
|
|
363
|
-
const e = i.
|
|
364
|
+
const e = i.A;
|
|
364
365
|
if (e.oe === g) {
|
|
365
366
|
if (!e.ue) {
|
|
366
367
|
e.ue = true;
|
|
@@ -368,9 +369,9 @@ function insertSubs(e, t = false) {
|
|
|
368
369
|
}
|
|
369
370
|
continue;
|
|
370
371
|
}
|
|
371
|
-
const s = i.
|
|
372
|
-
if (s.j > i.
|
|
373
|
-
insertIntoHeap(i.
|
|
372
|
+
const s = i.A.m & o ? P : v;
|
|
373
|
+
if (s.j > i.A.o) s.j = i.A.o;
|
|
374
|
+
insertIntoHeap(i.A, s);
|
|
374
375
|
}
|
|
375
376
|
}
|
|
376
377
|
function finalizePureQueue(e = null, t = false) {
|
|
@@ -387,7 +388,7 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
387
388
|
if (n.oe && n.oe !== g) n.ue = true;
|
|
388
389
|
}
|
|
389
390
|
if (!(n.de & a)) n.de &= ~p;
|
|
390
|
-
if (n.
|
|
391
|
+
if (n.H) GlobalQueue.U(n, false, true);
|
|
391
392
|
}
|
|
392
393
|
t.length = 0;
|
|
393
394
|
const n = e ? e.B : j.B;
|
|
@@ -414,7 +415,7 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
414
415
|
for (const t of N) {
|
|
415
416
|
const n = e ? t.ne === e : !t.ne;
|
|
416
417
|
if (!n) continue;
|
|
417
|
-
if (!t.
|
|
418
|
+
if (!t.R) {
|
|
418
419
|
if (t.M[0].length) runQueue(t.M[0], h);
|
|
419
420
|
if (t.M[1].length) runQueue(t.M[1], y);
|
|
420
421
|
}
|
|
@@ -439,7 +440,7 @@ function trackOptimisticStore(e) {
|
|
|
439
440
|
}
|
|
440
441
|
function reassignPendingTransition(e) {
|
|
441
442
|
for (let t = 0; t < e.length; t++) {
|
|
442
|
-
e[t].ne =
|
|
443
|
+
e[t].ne = k;
|
|
443
444
|
}
|
|
444
445
|
}
|
|
445
446
|
const j = new GlobalQueue();
|
|
@@ -470,15 +471,15 @@ function currentTransition(e) {
|
|
|
470
471
|
return e;
|
|
471
472
|
}
|
|
472
473
|
function setActiveTransition(e) {
|
|
473
|
-
|
|
474
|
+
k = e;
|
|
474
475
|
}
|
|
475
476
|
function runInTransition(e, t) {
|
|
476
|
-
const n =
|
|
477
|
+
const n = k;
|
|
477
478
|
try {
|
|
478
|
-
|
|
479
|
+
k = currentTransition(e);
|
|
479
480
|
return t();
|
|
480
481
|
} finally {
|
|
481
|
-
|
|
482
|
+
k = n;
|
|
482
483
|
}
|
|
483
484
|
}
|
|
484
485
|
const W = new WeakMap();
|
|
@@ -490,21 +491,21 @@ function getOrCreateLane(e) {
|
|
|
490
491
|
}
|
|
491
492
|
const n = e.he;
|
|
492
493
|
const r = n?.re ? findLane(n.re) : null;
|
|
493
|
-
t = { pe: e, T: new Set(), M: [[], []],
|
|
494
|
+
t = { pe: e, T: new Set(), M: [[], []], R: null, ne: k, ye: r };
|
|
494
495
|
W.set(e, t);
|
|
495
496
|
N.add(t);
|
|
496
497
|
e.ge = e.Se || 0;
|
|
497
498
|
return t;
|
|
498
499
|
}
|
|
499
500
|
function findLane(e) {
|
|
500
|
-
while (e.
|
|
501
|
+
while (e.R) e = e.R;
|
|
501
502
|
return e;
|
|
502
503
|
}
|
|
503
504
|
function mergeLanes(e, t) {
|
|
504
505
|
e = findLane(e);
|
|
505
506
|
t = findLane(t);
|
|
506
507
|
if (e === t) return e;
|
|
507
|
-
t.
|
|
508
|
+
t.R = e;
|
|
508
509
|
for (const n of t.T) e.T.add(n);
|
|
509
510
|
e.M[0].push(...t.M[0]);
|
|
510
511
|
e.M[1].push(...t.M[1]);
|
|
@@ -525,7 +526,7 @@ function assignOrMergeLane(e, t) {
|
|
|
525
526
|
const n = findLane(t);
|
|
526
527
|
const r = e.re;
|
|
527
528
|
if (r) {
|
|
528
|
-
if (r.
|
|
529
|
+
if (r.R) {
|
|
529
530
|
e.re = t;
|
|
530
531
|
return;
|
|
531
532
|
}
|
|
@@ -556,7 +557,7 @@ function handleAsync(e, t, r) {
|
|
|
556
557
|
if (e.me !== t) return;
|
|
557
558
|
j.initTransition(e.ne);
|
|
558
559
|
notifyStatus(e, n instanceof NotReadyError ? a : d, n);
|
|
559
|
-
e.$ =
|
|
560
|
+
e.$ = A;
|
|
560
561
|
};
|
|
561
562
|
const asyncWrite = (i, s) => {
|
|
562
563
|
if (e.me !== t) return;
|
|
@@ -568,18 +569,18 @@ function handleAsync(e, t, r) {
|
|
|
568
569
|
if (r) r(i);
|
|
569
570
|
else if (e.we) {
|
|
570
571
|
const t = e.ce !== S;
|
|
571
|
-
if (e.
|
|
572
|
+
if (e.H) e.ce = i;
|
|
572
573
|
if (!t) {
|
|
573
574
|
e.ae = i;
|
|
574
575
|
insertSubs(e);
|
|
575
576
|
}
|
|
576
|
-
e.$ =
|
|
577
|
+
e.$ = A;
|
|
577
578
|
} else if (o) {
|
|
578
579
|
const t = e.ae;
|
|
579
580
|
const n = e.be;
|
|
580
581
|
if (!n || !n(i, t)) {
|
|
581
582
|
e.ae = i;
|
|
582
|
-
e.$ =
|
|
583
|
+
e.$ = A;
|
|
583
584
|
if (e._e) {
|
|
584
585
|
setSignal(e._e, i);
|
|
585
586
|
}
|
|
@@ -625,6 +626,10 @@ function handleAsync(e, t, r) {
|
|
|
625
626
|
e = n;
|
|
626
627
|
t = true;
|
|
627
628
|
} else if (!n.done) asyncWrite(n.value, iterate);
|
|
629
|
+
else {
|
|
630
|
+
schedule();
|
|
631
|
+
flush();
|
|
632
|
+
}
|
|
628
633
|
},
|
|
629
634
|
e => {
|
|
630
635
|
if (!i) handleError(e);
|
|
@@ -666,10 +671,10 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
666
671
|
if (i && !r) {
|
|
667
672
|
assignOrMergeLane(e, i);
|
|
668
673
|
}
|
|
669
|
-
if (u &&
|
|
674
|
+
if (u && k && n instanceof NotReadyError) {
|
|
670
675
|
const e = n.source;
|
|
671
|
-
if (!
|
|
672
|
-
|
|
676
|
+
if (!k.Z.includes(e)) {
|
|
677
|
+
k.Z.push(e);
|
|
673
678
|
}
|
|
674
679
|
}
|
|
675
680
|
const f = r || u;
|
|
@@ -683,18 +688,18 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
683
688
|
return;
|
|
684
689
|
}
|
|
685
690
|
for (let r = e.O; r !== null; r = r.P) {
|
|
686
|
-
r.
|
|
687
|
-
if (r.
|
|
688
|
-
!r.
|
|
689
|
-
notifyStatus(r.
|
|
691
|
+
r.A.$ = A;
|
|
692
|
+
if (r.A.Y !== n) {
|
|
693
|
+
!r.A.ne && j.D.push(r.A);
|
|
694
|
+
notifyStatus(r.A, t, n, f, l);
|
|
690
695
|
}
|
|
691
696
|
}
|
|
692
|
-
for (let r = e.
|
|
697
|
+
for (let r = e.k; r !== null; r = r.C) {
|
|
693
698
|
for (let e = r.O; e !== null; e = e.P) {
|
|
694
|
-
e.
|
|
695
|
-
if (e.
|
|
696
|
-
!e.
|
|
697
|
-
notifyStatus(e.
|
|
699
|
+
e.A.$ = A;
|
|
700
|
+
if (e.A.Y !== n) {
|
|
701
|
+
!e.A.ne && j.D.push(e.A);
|
|
702
|
+
notifyStatus(e.A, t, n, f, l);
|
|
698
703
|
}
|
|
699
704
|
}
|
|
700
705
|
}
|
|
@@ -711,7 +716,7 @@ function unlinkSubs(e) {
|
|
|
711
716
|
t.O = r;
|
|
712
717
|
if (r === null) {
|
|
713
718
|
t.Pe?.();
|
|
714
|
-
t.
|
|
719
|
+
t.H && !t.Ae && !(t.m & o) && unobserved(t);
|
|
715
720
|
}
|
|
716
721
|
}
|
|
717
722
|
return n;
|
|
@@ -726,27 +731,27 @@ function unobserved(e) {
|
|
|
726
731
|
disposeChildren(e, true);
|
|
727
732
|
}
|
|
728
733
|
function link(e, t) {
|
|
729
|
-
const n = t.
|
|
734
|
+
const n = t.ke;
|
|
730
735
|
if (n !== null && n.L === e) return;
|
|
731
736
|
let i = null;
|
|
732
737
|
const s = t.m & r;
|
|
733
738
|
if (s) {
|
|
734
739
|
i = n !== null ? n.N : t.W;
|
|
735
740
|
if (i !== null && i.L === e) {
|
|
736
|
-
t.
|
|
741
|
+
t.ke = i;
|
|
737
742
|
return;
|
|
738
743
|
}
|
|
739
744
|
}
|
|
740
745
|
const o = e.ve;
|
|
741
|
-
if (o !== null && o.
|
|
742
|
-
const u = (t.
|
|
746
|
+
if (o !== null && o.A === t && (!s || isValidLink(o, t))) return;
|
|
747
|
+
const u = (t.ke = e.ve = { L: e, A: t, N: i, xe: o, P: null });
|
|
743
748
|
if (n !== null) n.N = u;
|
|
744
749
|
else t.W = u;
|
|
745
750
|
if (o !== null) o.P = u;
|
|
746
751
|
else e.O = u;
|
|
747
752
|
}
|
|
748
753
|
function isValidLink(e, t) {
|
|
749
|
-
const n = t.
|
|
754
|
+
const n = t.ke;
|
|
750
755
|
if (n !== null) {
|
|
751
756
|
let r = t.W;
|
|
752
757
|
do {
|
|
@@ -776,7 +781,7 @@ function dispose(e) {
|
|
|
776
781
|
t = unlinkSubs(t);
|
|
777
782
|
} while (t !== null);
|
|
778
783
|
e.W = null;
|
|
779
|
-
e.
|
|
784
|
+
e.ke = null;
|
|
780
785
|
disposeChildren(e, true);
|
|
781
786
|
}
|
|
782
787
|
function disposeChildren(e, t = false, n) {
|
|
@@ -793,7 +798,7 @@ function disposeChildren(e, t = false, n) {
|
|
|
793
798
|
t = unlinkSubs(t);
|
|
794
799
|
} while (t !== null);
|
|
795
800
|
e.W = null;
|
|
796
|
-
e.
|
|
801
|
+
e.ke = null;
|
|
797
802
|
}
|
|
798
803
|
disposeChildren(r, true);
|
|
799
804
|
r = e;
|
|
@@ -866,7 +871,7 @@ function createOwner(e) {
|
|
|
866
871
|
Ee: null,
|
|
867
872
|
Le: null,
|
|
868
873
|
fe: t?.fe ?? j,
|
|
869
|
-
|
|
874
|
+
He: t?.He || _,
|
|
870
875
|
We: 0,
|
|
871
876
|
Ne: null,
|
|
872
877
|
je: null,
|
|
@@ -901,7 +906,7 @@ function effect(e, t, n, r, i) {
|
|
|
901
906
|
},
|
|
902
907
|
lazy: true
|
|
903
908
|
});
|
|
904
|
-
o.
|
|
909
|
+
o.Re = r;
|
|
905
910
|
o.Qe = t;
|
|
906
911
|
o.Te = n;
|
|
907
912
|
o.Me = undefined;
|
|
@@ -937,11 +942,11 @@ function runEffect() {
|
|
|
937
942
|
this.Me?.();
|
|
938
943
|
this.Me = undefined;
|
|
939
944
|
try {
|
|
940
|
-
this.Me = this.Qe(this.ae, this.
|
|
945
|
+
this.Me = this.Qe(this.ae, this.Re);
|
|
941
946
|
} catch (e) {
|
|
942
947
|
if (!this.fe.notify(this, d, d)) throw e;
|
|
943
948
|
} finally {
|
|
944
|
-
this.
|
|
949
|
+
this.Re = this.ae;
|
|
945
950
|
this.ue = false;
|
|
946
951
|
}
|
|
947
952
|
}
|
|
@@ -973,8 +978,8 @@ function trackedEffect(e, t) {
|
|
|
973
978
|
GlobalQueue.K = recompute;
|
|
974
979
|
GlobalQueue.U = disposeChildren;
|
|
975
980
|
let I = false;
|
|
976
|
-
let R = false;
|
|
977
981
|
let H = false;
|
|
982
|
+
let R = false;
|
|
978
983
|
let Q = false;
|
|
979
984
|
let T = false;
|
|
980
985
|
let M = false;
|
|
@@ -1008,7 +1013,7 @@ function releaseSubtree(e) {
|
|
|
1008
1013
|
t = t.Ee;
|
|
1009
1014
|
continue;
|
|
1010
1015
|
}
|
|
1011
|
-
if (t.
|
|
1016
|
+
if (t.H) {
|
|
1012
1017
|
const e = t;
|
|
1013
1018
|
e.se = false;
|
|
1014
1019
|
if (e.m & l) {
|
|
@@ -1035,7 +1040,7 @@ function clearSnapshots() {
|
|
|
1035
1040
|
function recompute(t, n = false) {
|
|
1036
1041
|
const i = t.oe;
|
|
1037
1042
|
if (!n) {
|
|
1038
|
-
if (t.ne && (!i ||
|
|
1043
|
+
if (t.ne && (!i || k) && k !== t.ne) j.initTransition(t.ne);
|
|
1039
1044
|
deleteFromHeap(t, t.m & o ? P : v);
|
|
1040
1045
|
if (t.ne || i === g) disposeChildren(t);
|
|
1041
1046
|
else {
|
|
@@ -1052,9 +1057,9 @@ function recompute(t, n = false) {
|
|
|
1052
1057
|
const c = !!(t.de & a);
|
|
1053
1058
|
const p = q;
|
|
1054
1059
|
q = t;
|
|
1055
|
-
t.
|
|
1060
|
+
t.ke = null;
|
|
1056
1061
|
t.m = r;
|
|
1057
|
-
t.$ =
|
|
1062
|
+
t.$ = A;
|
|
1058
1063
|
let h = t.ce === S ? t.ae : t.ce;
|
|
1059
1064
|
let y = t.o;
|
|
1060
1065
|
let w = I;
|
|
@@ -1065,7 +1070,7 @@ function recompute(t, n = false) {
|
|
|
1065
1070
|
if (e) F = e;
|
|
1066
1071
|
}
|
|
1067
1072
|
try {
|
|
1068
|
-
h = handleAsync(t, t.
|
|
1073
|
+
h = handleAsync(t, t.H(h));
|
|
1069
1074
|
clearStatus(t);
|
|
1070
1075
|
const e = resolveLane(t);
|
|
1071
1076
|
if (e) {
|
|
@@ -1094,7 +1099,7 @@ function recompute(t, n = false) {
|
|
|
1094
1099
|
q = p;
|
|
1095
1100
|
}
|
|
1096
1101
|
if (!t.Y) {
|
|
1097
|
-
const e = t.
|
|
1102
|
+
const e = t.ke;
|
|
1098
1103
|
let r = e !== null ? e.N : t.W;
|
|
1099
1104
|
if (r !== null) {
|
|
1100
1105
|
do {
|
|
@@ -1107,7 +1112,7 @@ function recompute(t, n = false) {
|
|
|
1107
1112
|
const l = !t.be || !t.be(f, h);
|
|
1108
1113
|
if (l) {
|
|
1109
1114
|
const e = u ? t.ae : undefined;
|
|
1110
|
-
if (n || (i &&
|
|
1115
|
+
if (n || (i && k !== t.ne) || s) t.ae = h;
|
|
1111
1116
|
else t.ce = h;
|
|
1112
1117
|
if (u && !s && c) {
|
|
1113
1118
|
const e = t.Se || 0;
|
|
@@ -1121,20 +1126,20 @@ function recompute(t, n = false) {
|
|
|
1121
1126
|
t.ce = h;
|
|
1122
1127
|
} else if (t.o != y) {
|
|
1123
1128
|
for (let e = t.O; e !== null; e = e.P) {
|
|
1124
|
-
insertIntoHeapHeight(e.
|
|
1129
|
+
insertIntoHeapHeight(e.A, e.A.m & o ? P : v);
|
|
1125
1130
|
}
|
|
1126
1131
|
}
|
|
1127
1132
|
}
|
|
1128
1133
|
F = m;
|
|
1129
|
-
(!n || t.de & a) && !t.ne && !(
|
|
1130
|
-
t.ne && i &&
|
|
1134
|
+
(!n || t.de & a) && !t.ne && !(k && t.we) && j.D.push(t);
|
|
1135
|
+
t.ne && i && k !== t.ne && runInTransition(t.ne, () => recompute(t));
|
|
1131
1136
|
}
|
|
1132
1137
|
function updateIfNecessary(r) {
|
|
1133
1138
|
if (r.m & t) {
|
|
1134
1139
|
for (let e = r.W; e; e = e.N) {
|
|
1135
1140
|
const t = e.L;
|
|
1136
1141
|
const i = t.I || t;
|
|
1137
|
-
if (i.
|
|
1142
|
+
if (i.H) {
|
|
1138
1143
|
updateIfNecessary(i);
|
|
1139
1144
|
}
|
|
1140
1145
|
if (r.m & n) {
|
|
@@ -1142,7 +1147,7 @@ function updateIfNecessary(r) {
|
|
|
1142
1147
|
}
|
|
1143
1148
|
}
|
|
1144
1149
|
}
|
|
1145
|
-
if (r.m & (n | f) || (r.Y && r.$ <
|
|
1150
|
+
if (r.m & (n | f) || (r.Y && r.$ < A && !r.me)) {
|
|
1146
1151
|
recompute(r);
|
|
1147
1152
|
}
|
|
1148
1153
|
r.m = e | (r.m & l);
|
|
@@ -1157,16 +1162,16 @@ function computed(t, n, r) {
|
|
|
1157
1162
|
Pe: r?.unobserved,
|
|
1158
1163
|
Le: null,
|
|
1159
1164
|
fe: q?.fe ?? j,
|
|
1160
|
-
|
|
1165
|
+
He: q?.He ?? _,
|
|
1161
1166
|
We: 0,
|
|
1162
|
-
|
|
1167
|
+
H: t,
|
|
1163
1168
|
ae: n,
|
|
1164
1169
|
o: 0,
|
|
1165
|
-
|
|
1170
|
+
k: null,
|
|
1166
1171
|
h: undefined,
|
|
1167
1172
|
p: null,
|
|
1168
1173
|
W: null,
|
|
1169
|
-
|
|
1174
|
+
ke: null,
|
|
1170
1175
|
O: null,
|
|
1171
1176
|
ve: null,
|
|
1172
1177
|
i: q,
|
|
@@ -1174,7 +1179,7 @@ function computed(t, n, r) {
|
|
|
1174
1179
|
Ce: null,
|
|
1175
1180
|
m: r?.lazy ? c : e,
|
|
1176
1181
|
de: p,
|
|
1177
|
-
$:
|
|
1182
|
+
$: A,
|
|
1178
1183
|
ce: S,
|
|
1179
1184
|
Ne: null,
|
|
1180
1185
|
je: null,
|
|
@@ -1211,12 +1216,12 @@ function signal(e, t, n = null) {
|
|
|
1211
1216
|
ae: e,
|
|
1212
1217
|
O: null,
|
|
1213
1218
|
ve: null,
|
|
1214
|
-
$:
|
|
1219
|
+
$: A,
|
|
1215
1220
|
I: n,
|
|
1216
|
-
C: n?.
|
|
1221
|
+
C: n?.k || null,
|
|
1217
1222
|
ce: S
|
|
1218
1223
|
};
|
|
1219
|
-
n && (n.
|
|
1224
|
+
n && (n.k = r);
|
|
1220
1225
|
if (V && !r.Fe) {
|
|
1221
1226
|
r.ie = e === undefined ? w : e;
|
|
1222
1227
|
D.add(r);
|
|
@@ -1236,19 +1241,14 @@ function optimisticComputed(e, t, n) {
|
|
|
1236
1241
|
function isEqual(e, t) {
|
|
1237
1242
|
return e === t;
|
|
1238
1243
|
}
|
|
1239
|
-
|
|
1240
|
-
function setStrictRead(e) {
|
|
1241
|
-
const t = B;
|
|
1242
|
-
B = e;
|
|
1243
|
-
return t;
|
|
1244
|
-
}
|
|
1245
|
-
function untrack(e) {
|
|
1244
|
+
function untrack(e, t) {
|
|
1246
1245
|
if (!I && true) return e();
|
|
1246
|
+
const n = I;
|
|
1247
1247
|
I = false;
|
|
1248
1248
|
try {
|
|
1249
1249
|
return e();
|
|
1250
1250
|
} finally {
|
|
1251
|
-
I =
|
|
1251
|
+
I = n;
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
1254
|
function read(e) {
|
|
@@ -1266,7 +1266,7 @@ function read(e) {
|
|
|
1266
1266
|
M = n;
|
|
1267
1267
|
}
|
|
1268
1268
|
if (t.de & a) return e.ae;
|
|
1269
|
-
if (
|
|
1269
|
+
if (H && F && t.re) {
|
|
1270
1270
|
const n = findLane(t.re);
|
|
1271
1271
|
const r = findLane(F);
|
|
1272
1272
|
if (n !== r && n.T.size > 0) {
|
|
@@ -1288,16 +1288,16 @@ function read(e) {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
let t = q;
|
|
1290
1290
|
if (t?.t) t = t.u;
|
|
1291
|
-
if (
|
|
1291
|
+
if (R && e.H) recompute(e);
|
|
1292
1292
|
if (e.m & c) {
|
|
1293
1293
|
e.m &= ~c;
|
|
1294
1294
|
recompute(e, true);
|
|
1295
1295
|
}
|
|
1296
1296
|
const n = e.I || e;
|
|
1297
1297
|
if (t && I) {
|
|
1298
|
-
if (e.
|
|
1298
|
+
if (e.H && e.m & u) recompute(e);
|
|
1299
1299
|
link(e, t);
|
|
1300
|
-
if (n.
|
|
1300
|
+
if (n.H) {
|
|
1301
1301
|
const r = e.m & o;
|
|
1302
1302
|
if (n.o >= (r ? P.j : v.j)) {
|
|
1303
1303
|
markNode(t);
|
|
@@ -1311,7 +1311,7 @@ function read(e) {
|
|
|
1311
1311
|
}
|
|
1312
1312
|
}
|
|
1313
1313
|
if (n.de & a) {
|
|
1314
|
-
if (t && !(
|
|
1314
|
+
if (t && !(H && n.ne && k !== n.ne)) {
|
|
1315
1315
|
if (F) {
|
|
1316
1316
|
const r = n.re;
|
|
1317
1317
|
const i = findLane(F);
|
|
@@ -1327,8 +1327,8 @@ function read(e) {
|
|
|
1327
1327
|
throw n.Y;
|
|
1328
1328
|
}
|
|
1329
1329
|
}
|
|
1330
|
-
if (e.
|
|
1331
|
-
if (e.$ <
|
|
1330
|
+
if (e.H && e.de & d) {
|
|
1331
|
+
if (e.$ < A) {
|
|
1332
1332
|
recompute(e, true);
|
|
1333
1333
|
return read(e);
|
|
1334
1334
|
} else throw e.Y;
|
|
@@ -1342,16 +1342,21 @@ function read(e) {
|
|
|
1342
1342
|
return r;
|
|
1343
1343
|
}
|
|
1344
1344
|
}
|
|
1345
|
-
return !t ||
|
|
1345
|
+
return !t ||
|
|
1346
|
+
(F !== null && (e.we || e.re || n === e || !!(n.de & a))) ||
|
|
1347
|
+
e.ce === S ||
|
|
1348
|
+
(H && e.ne && k !== e.ne)
|
|
1349
|
+
? e.ae
|
|
1350
|
+
: e.ce;
|
|
1346
1351
|
}
|
|
1347
1352
|
function setSignal(e, t) {
|
|
1348
|
-
if (e.ne &&
|
|
1353
|
+
if (e.ne && k !== e.ne) j.initTransition(e.ne);
|
|
1349
1354
|
const n = e.we && !E;
|
|
1350
1355
|
const r = n ? e.ae : e.ce === S ? e.ae : e.ce;
|
|
1351
1356
|
if (typeof t === "function") t = t(r);
|
|
1352
1357
|
const i = !e.be || !e.be(r, t) || !!(e.de & p);
|
|
1353
1358
|
if (!i) {
|
|
1354
|
-
if (n && e.ce !== S && e.
|
|
1359
|
+
if (n && e.ce !== S && e.H) {
|
|
1355
1360
|
insertSubs(e, true);
|
|
1356
1361
|
schedule();
|
|
1357
1362
|
}
|
|
@@ -1380,7 +1385,7 @@ function setSignal(e, t) {
|
|
|
1380
1385
|
if (e._e) {
|
|
1381
1386
|
setSignal(e._e, t);
|
|
1382
1387
|
}
|
|
1383
|
-
e.$ =
|
|
1388
|
+
e.$ = A;
|
|
1384
1389
|
insertSubs(e, n);
|
|
1385
1390
|
schedule();
|
|
1386
1391
|
return t;
|
|
@@ -1455,12 +1460,12 @@ function getLatestValueComputed(e) {
|
|
|
1455
1460
|
return e._e;
|
|
1456
1461
|
}
|
|
1457
1462
|
function staleValues(e, t = true) {
|
|
1458
|
-
const n =
|
|
1459
|
-
|
|
1463
|
+
const n = H;
|
|
1464
|
+
H = t;
|
|
1460
1465
|
try {
|
|
1461
1466
|
return e();
|
|
1462
1467
|
} finally {
|
|
1463
|
-
|
|
1468
|
+
H = n;
|
|
1464
1469
|
}
|
|
1465
1470
|
}
|
|
1466
1471
|
function latest(e) {
|
|
@@ -1488,8 +1493,8 @@ function isPending(e) {
|
|
|
1488
1493
|
}
|
|
1489
1494
|
}
|
|
1490
1495
|
function refresh(e) {
|
|
1491
|
-
let t =
|
|
1492
|
-
|
|
1496
|
+
let t = R;
|
|
1497
|
+
R = true;
|
|
1493
1498
|
try {
|
|
1494
1499
|
if (typeof e !== "function") {
|
|
1495
1500
|
recompute(e[O]);
|
|
@@ -1497,14 +1502,14 @@ function refresh(e) {
|
|
|
1497
1502
|
}
|
|
1498
1503
|
return untrack(e);
|
|
1499
1504
|
} finally {
|
|
1500
|
-
|
|
1505
|
+
R = t;
|
|
1501
1506
|
if (!t) {
|
|
1502
1507
|
schedule();
|
|
1503
1508
|
}
|
|
1504
1509
|
}
|
|
1505
1510
|
}
|
|
1506
1511
|
function isRefreshing() {
|
|
1507
|
-
return
|
|
1512
|
+
return R;
|
|
1508
1513
|
}
|
|
1509
1514
|
function createContext(e, t) {
|
|
1510
1515
|
return { id: Symbol(t), defaultValue: e };
|
|
@@ -1513,7 +1518,7 @@ function getContext(e, t = getOwner()) {
|
|
|
1513
1518
|
if (!t) {
|
|
1514
1519
|
throw new NoOwnerError();
|
|
1515
1520
|
}
|
|
1516
|
-
const n = hasContext(e, t) ? t.
|
|
1521
|
+
const n = hasContext(e, t) ? t.He[e.id] : e.defaultValue;
|
|
1517
1522
|
if (isUndefined(n)) {
|
|
1518
1523
|
throw new ContextNotFoundError();
|
|
1519
1524
|
}
|
|
@@ -1523,10 +1528,10 @@ function setContext(e, t, n = getOwner()) {
|
|
|
1523
1528
|
if (!n) {
|
|
1524
1529
|
throw new NoOwnerError();
|
|
1525
1530
|
}
|
|
1526
|
-
n.
|
|
1531
|
+
n.He = { ...n.He, [e.id]: isUndefined(t) ? e.defaultValue : t };
|
|
1527
1532
|
}
|
|
1528
1533
|
function hasContext(e, t) {
|
|
1529
|
-
return !isUndefined(t?.
|
|
1534
|
+
return !isUndefined(t?.He[e.id]);
|
|
1530
1535
|
}
|
|
1531
1536
|
function isUndefined(e) {
|
|
1532
1537
|
return typeof e === "undefined";
|
|
@@ -1542,7 +1547,7 @@ function action(e) {
|
|
|
1542
1547
|
new Promise((n, r) => {
|
|
1543
1548
|
const i = e(...t);
|
|
1544
1549
|
j.initTransition();
|
|
1545
|
-
let s =
|
|
1550
|
+
let s = k;
|
|
1546
1551
|
s.ee.push(i);
|
|
1547
1552
|
const done = (e, t) => {
|
|
1548
1553
|
s = currentTransition(s);
|
|
@@ -1644,7 +1649,7 @@ function onSettled(e) {
|
|
|
1644
1649
|
});
|
|
1645
1650
|
}
|
|
1646
1651
|
function unwrap(e) {
|
|
1647
|
-
return e?.[
|
|
1652
|
+
return e?.[z]?.[ee] ?? e;
|
|
1648
1653
|
}
|
|
1649
1654
|
function getOverrideValue(e, t, n, r, i) {
|
|
1650
1655
|
if (i && r in i) return i[r];
|
|
@@ -1656,16 +1661,16 @@ function getAllKeys(e, t, n) {
|
|
|
1656
1661
|
return Array.from(new Set([...r, ...i]));
|
|
1657
1662
|
}
|
|
1658
1663
|
function applyState(e, t, n, r) {
|
|
1659
|
-
const i = t?.[
|
|
1664
|
+
const i = t?.[z];
|
|
1660
1665
|
if (!i) return;
|
|
1661
|
-
const s = i[
|
|
1662
|
-
const o = i[
|
|
1663
|
-
const u = i[
|
|
1664
|
-
let f = i[
|
|
1666
|
+
const s = i[Y];
|
|
1667
|
+
const o = i[Z];
|
|
1668
|
+
const u = i[$];
|
|
1669
|
+
let f = i[ee];
|
|
1665
1670
|
if (e === s && !o && !u) return;
|
|
1666
|
-
(i[
|
|
1667
|
-
i[
|
|
1668
|
-
i[
|
|
1671
|
+
(i[re] || oe).set(e, i[U]);
|
|
1672
|
+
i[Y] = e;
|
|
1673
|
+
i[Z] = undefined;
|
|
1669
1674
|
if (Array.isArray(s)) {
|
|
1670
1675
|
let t = false;
|
|
1671
1676
|
const l = getOverrideValue(s, o, f, "length", u);
|
|
@@ -1693,16 +1698,16 @@ function applyState(e, t, n, r) {
|
|
|
1693
1698
|
if (d > h || d > p) {
|
|
1694
1699
|
for (a = d; a <= h; a++) {
|
|
1695
1700
|
t = true;
|
|
1696
|
-
i[
|
|
1701
|
+
i[ee][a] && setSignal(i[ee][a], wrap(e[a], i));
|
|
1697
1702
|
}
|
|
1698
1703
|
for (; a < e.length; a++) {
|
|
1699
1704
|
t = true;
|
|
1700
1705
|
const s = wrap(w[a], i);
|
|
1701
|
-
i[
|
|
1706
|
+
i[ee][a] && setSignal(i[ee][a], s);
|
|
1702
1707
|
applyState(e[a], s, n, r);
|
|
1703
1708
|
}
|
|
1704
|
-
t && i[
|
|
1705
|
-
l !== e.length && i[
|
|
1709
|
+
t && i[ee][G] && setSignal(i[ee][G], void 0);
|
|
1710
|
+
l !== e.length && i[ee].length && setSignal(i[ee].length, e.length);
|
|
1706
1711
|
return;
|
|
1707
1712
|
}
|
|
1708
1713
|
g = new Array(h + 1);
|
|
@@ -1726,26 +1731,26 @@ function applyState(e, t, n, r) {
|
|
|
1726
1731
|
for (a = d; a < e.length; a++) {
|
|
1727
1732
|
if (a in w) {
|
|
1728
1733
|
const t = wrap(w[a], i);
|
|
1729
|
-
i[
|
|
1734
|
+
i[ee][a] && setSignal(i[ee][a], t);
|
|
1730
1735
|
applyState(e[a], t, n, r);
|
|
1731
|
-
} else i[
|
|
1736
|
+
} else i[ee][a] && setSignal(i[ee][a], wrap(e[a], i));
|
|
1732
1737
|
}
|
|
1733
1738
|
if (d < e.length) t = true;
|
|
1734
1739
|
} else if (e.length) {
|
|
1735
1740
|
for (let t = 0, l = e.length; t < l; t++) {
|
|
1736
1741
|
const l = getOverrideValue(s, o, f, t, u);
|
|
1737
|
-
isWrappable(l) ? applyState(e[t], wrap(l, i), n, r) : i[
|
|
1742
|
+
isWrappable(l) ? applyState(e[t], wrap(l, i), n, r) : i[ee][t] && setSignal(i[ee][t], e[t]);
|
|
1738
1743
|
}
|
|
1739
1744
|
}
|
|
1740
1745
|
if (l !== e.length) {
|
|
1741
1746
|
t = true;
|
|
1742
|
-
i[
|
|
1747
|
+
i[ee].length && setSignal(i[ee].length, e.length);
|
|
1743
1748
|
}
|
|
1744
|
-
t && i[
|
|
1749
|
+
t && i[ee][G] && setSignal(i[ee][G], void 0);
|
|
1745
1750
|
return;
|
|
1746
1751
|
}
|
|
1747
1752
|
if (f) {
|
|
1748
|
-
const t = f[
|
|
1753
|
+
const t = f[G];
|
|
1749
1754
|
const l = t || r ? getAllKeys(s, o, e) : Object.keys(f);
|
|
1750
1755
|
for (let c = 0, a = l.length; c < a; c++) {
|
|
1751
1756
|
const a = l[c];
|
|
@@ -1759,7 +1764,7 @@ function applyState(e, t, n, r) {
|
|
|
1759
1764
|
} else applyState(h, wrap(p, i), n, r);
|
|
1760
1765
|
}
|
|
1761
1766
|
}
|
|
1762
|
-
if ((f = i[
|
|
1767
|
+
if ((f = i[te])) {
|
|
1763
1768
|
const t = Object.keys(f);
|
|
1764
1769
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1765
1770
|
const r = t[n];
|
|
@@ -1781,9 +1786,9 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1781
1786
|
let r;
|
|
1782
1787
|
const i = new WeakMap();
|
|
1783
1788
|
const wrapper = e => {
|
|
1784
|
-
e[
|
|
1785
|
-
e[
|
|
1786
|
-
Object.defineProperty(e,
|
|
1789
|
+
e[ne] = wrapProjection;
|
|
1790
|
+
e[re] = i;
|
|
1791
|
+
Object.defineProperty(e, ie, {
|
|
1787
1792
|
get() {
|
|
1788
1793
|
return r;
|
|
1789
1794
|
},
|
|
@@ -1792,29 +1797,28 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1792
1797
|
};
|
|
1793
1798
|
const wrapProjection = e => {
|
|
1794
1799
|
if (i.has(e)) return i.get(e);
|
|
1795
|
-
if (e[
|
|
1796
|
-
const t = createStoreProxy(e,
|
|
1800
|
+
if (e[z]?.[ne] === wrapProjection) return e;
|
|
1801
|
+
const t = createStoreProxy(e, le, wrapper);
|
|
1797
1802
|
i.set(e, t);
|
|
1798
1803
|
return t;
|
|
1799
1804
|
};
|
|
1800
1805
|
const s = wrapProjection(t);
|
|
1801
1806
|
r = computed(() => {
|
|
1802
1807
|
const t = getOwner();
|
|
1803
|
-
storeSetter(new Proxy(s,
|
|
1808
|
+
storeSetter(new Proxy(s, B), r => {
|
|
1804
1809
|
const i = handleAsync(t, e(r), e => {
|
|
1805
1810
|
e !== r && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id", n?.all));
|
|
1806
|
-
setSignal(t, undefined);
|
|
1807
1811
|
});
|
|
1808
1812
|
i !== r && i !== undefined && reconcile(i, n?.key || "id", n?.all)(s);
|
|
1809
1813
|
});
|
|
1810
1814
|
});
|
|
1811
|
-
r.
|
|
1815
|
+
r.Ae = true;
|
|
1812
1816
|
return { store: s, node: r };
|
|
1813
1817
|
}
|
|
1814
1818
|
function createProjection(e, t = {}, n) {
|
|
1815
1819
|
return createProjectionInternal(e, t, n).store;
|
|
1816
1820
|
}
|
|
1817
|
-
const
|
|
1821
|
+
const B = {
|
|
1818
1822
|
get(e, t) {
|
|
1819
1823
|
let n;
|
|
1820
1824
|
setWriteOverride(true);
|
|
@@ -1825,7 +1829,7 @@ const G = {
|
|
|
1825
1829
|
setWriteOverride(false);
|
|
1826
1830
|
setProjectionWriteActive(false);
|
|
1827
1831
|
}
|
|
1828
|
-
return typeof n === "object" && n !== null ? new Proxy(n,
|
|
1832
|
+
return typeof n === "object" && n !== null ? new Proxy(n, B) : n;
|
|
1829
1833
|
},
|
|
1830
1834
|
set(e, t, n) {
|
|
1831
1835
|
setWriteOverride(true);
|
|
@@ -1850,46 +1854,46 @@ const G = {
|
|
|
1850
1854
|
return true;
|
|
1851
1855
|
}
|
|
1852
1856
|
};
|
|
1853
|
-
const
|
|
1857
|
+
const G = Symbol(0),
|
|
1858
|
+
K = Symbol(0),
|
|
1854
1859
|
z = Symbol(0),
|
|
1855
1860
|
U = Symbol(0),
|
|
1856
|
-
J = Symbol(0)
|
|
1857
|
-
|
|
1858
|
-
const Y =
|
|
1859
|
-
|
|
1860
|
-
$ = "
|
|
1861
|
-
ee = "
|
|
1862
|
-
te = "
|
|
1863
|
-
ne = "
|
|
1864
|
-
re = "
|
|
1865
|
-
ie = "
|
|
1866
|
-
se = "
|
|
1867
|
-
|
|
1868
|
-
function createStoreProxy(e, t = ce, n) {
|
|
1861
|
+
J = Symbol(0);
|
|
1862
|
+
const X = new WeakMap();
|
|
1863
|
+
const Y = "v",
|
|
1864
|
+
Z = "o",
|
|
1865
|
+
$ = "x",
|
|
1866
|
+
ee = "n",
|
|
1867
|
+
te = "h",
|
|
1868
|
+
ne = "w",
|
|
1869
|
+
re = "l",
|
|
1870
|
+
ie = "f",
|
|
1871
|
+
se = "p";
|
|
1872
|
+
function createStoreProxy(e, t = le, n) {
|
|
1869
1873
|
let r;
|
|
1870
1874
|
if (Array.isArray(e)) {
|
|
1871
1875
|
r = [];
|
|
1872
1876
|
r.v = e;
|
|
1873
1877
|
} else r = { v: e };
|
|
1874
1878
|
n && n(r);
|
|
1875
|
-
return (r[
|
|
1879
|
+
return (r[U] = new Proxy(r, t));
|
|
1876
1880
|
}
|
|
1877
|
-
const
|
|
1881
|
+
const oe = new WeakMap();
|
|
1878
1882
|
function wrap(e, t) {
|
|
1879
|
-
if (t?.[
|
|
1880
|
-
let n = e[
|
|
1881
|
-
if (!n)
|
|
1883
|
+
if (t?.[ne]) return t[ne](e, t);
|
|
1884
|
+
let n = e[U] || oe.get(e);
|
|
1885
|
+
if (!n) oe.set(e, (n = createStoreProxy(e)));
|
|
1882
1886
|
return n;
|
|
1883
1887
|
}
|
|
1884
1888
|
function isWrappable(e) {
|
|
1885
1889
|
return e != null && typeof e === "object" && !Object.isFrozen(e);
|
|
1886
1890
|
}
|
|
1887
|
-
let
|
|
1891
|
+
let ue = false;
|
|
1888
1892
|
function setWriteOverride(e) {
|
|
1889
|
-
|
|
1893
|
+
ue = e;
|
|
1890
1894
|
}
|
|
1891
1895
|
function writeOnly(e) {
|
|
1892
|
-
return
|
|
1896
|
+
return ue || !!fe?.has(e);
|
|
1893
1897
|
}
|
|
1894
1898
|
function getNodes(e, t) {
|
|
1895
1899
|
let n = e[t];
|
|
@@ -1916,8 +1920,8 @@ function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
|
1916
1920
|
}
|
|
1917
1921
|
return (e[t] = u);
|
|
1918
1922
|
}
|
|
1919
|
-
function trackSelf(e, t =
|
|
1920
|
-
getObserver() && read(getNode(getNodes(e,
|
|
1923
|
+
function trackSelf(e, t = G) {
|
|
1924
|
+
getObserver() && read(getNode(getNodes(e, ee), t, undefined, e[ie], false, e[se]));
|
|
1921
1925
|
}
|
|
1922
1926
|
function getKeys(e, t, n = true) {
|
|
1923
1927
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -1925,7 +1929,7 @@ function getKeys(e, t, n = true) {
|
|
|
1925
1929
|
const i = new Set(r);
|
|
1926
1930
|
const s = Reflect.ownKeys(t);
|
|
1927
1931
|
for (const e of s) {
|
|
1928
|
-
if (t[e] !==
|
|
1932
|
+
if (t[e] !== J) i.add(e);
|
|
1929
1933
|
else i.delete(e);
|
|
1930
1934
|
}
|
|
1931
1935
|
return Array.from(i);
|
|
@@ -1933,70 +1937,70 @@ function getKeys(e, t, n = true) {
|
|
|
1933
1937
|
function getPropertyDescriptor(e, t, n) {
|
|
1934
1938
|
let r = e;
|
|
1935
1939
|
if (t && n in t) {
|
|
1936
|
-
if (r[n] ===
|
|
1940
|
+
if (r[n] === J) return void 0;
|
|
1937
1941
|
if (!(n in r)) r = t;
|
|
1938
1942
|
}
|
|
1939
1943
|
return Reflect.getOwnPropertyDescriptor(r, n);
|
|
1940
1944
|
}
|
|
1941
|
-
let
|
|
1942
|
-
const
|
|
1945
|
+
let fe = null;
|
|
1946
|
+
const le = {
|
|
1943
1947
|
get(e, t, n) {
|
|
1944
|
-
if (t ===
|
|
1945
|
-
if (t ===
|
|
1946
|
-
if (t === O) return e[
|
|
1947
|
-
if (t ===
|
|
1948
|
+
if (t === z) return e;
|
|
1949
|
+
if (t === U) return n;
|
|
1950
|
+
if (t === O) return e[ie];
|
|
1951
|
+
if (t === G || t === K) {
|
|
1948
1952
|
trackSelf(e, t);
|
|
1949
1953
|
return n;
|
|
1950
1954
|
}
|
|
1951
|
-
const r = getNodes(e,
|
|
1955
|
+
const r = getNodes(e, ee);
|
|
1952
1956
|
const i = r[t];
|
|
1953
|
-
const s = e[
|
|
1954
|
-
const o = s || (e[
|
|
1955
|
-
const u = !!e[
|
|
1956
|
-
const f = s ? e[
|
|
1957
|
+
const s = e[$] && t in e[$];
|
|
1958
|
+
const o = s || (e[Z] && t in e[Z]);
|
|
1959
|
+
const u = !!e[Y][z];
|
|
1960
|
+
const f = s ? e[$] : e[Z] && t in e[Z] ? e[Z] : e[Y];
|
|
1957
1961
|
if (!i) {
|
|
1958
1962
|
const e = Object.getOwnPropertyDescriptor(f, t);
|
|
1959
1963
|
if (e && e.get) return e.get.call(n);
|
|
1960
1964
|
}
|
|
1961
1965
|
if (writeOnly(n)) {
|
|
1962
1966
|
let n = i && (o || !u) ? (i.ce !== S ? (i.we ? i.ae : i.ce) : i.ae) : f[t];
|
|
1963
|
-
n ===
|
|
1967
|
+
n === J && (n = undefined);
|
|
1964
1968
|
if (!isWrappable(n)) return n;
|
|
1965
1969
|
const r = wrap(n, e);
|
|
1966
|
-
|
|
1970
|
+
fe?.add(r);
|
|
1967
1971
|
return r;
|
|
1968
1972
|
}
|
|
1969
1973
|
let l = i ? (o || !u ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
1970
|
-
l ===
|
|
1974
|
+
l === J && (l = undefined);
|
|
1971
1975
|
if (!i) {
|
|
1972
1976
|
if (!o && typeof l === "function" && !f.hasOwnProperty(t)) {
|
|
1973
1977
|
let t;
|
|
1974
|
-
return !Array.isArray(e[
|
|
1978
|
+
return !Array.isArray(e[Y]) && (t = Object.getPrototypeOf(e[Y])) && t !== Object.prototype
|
|
1975
1979
|
? l.bind(f)
|
|
1976
1980
|
: l;
|
|
1977
1981
|
} else if (getObserver()) {
|
|
1978
|
-
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[
|
|
1982
|
+
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[ie], isEqual, e[se], e[m]));
|
|
1979
1983
|
}
|
|
1980
1984
|
}
|
|
1981
1985
|
return isWrappable(l) ? wrap(l, e) : l;
|
|
1982
1986
|
},
|
|
1983
1987
|
has(e, t) {
|
|
1984
|
-
if (t ===
|
|
1985
|
-
const n = e[
|
|
1986
|
-
getObserver() && read(getNode(getNodes(e,
|
|
1988
|
+
if (t === U || t === G || t === "__proto__") return true;
|
|
1989
|
+
const n = e[$] && t in e[$] ? e[$][t] !== J : e[Z] && t in e[Z] ? e[Z][t] !== J : t in e[Y];
|
|
1990
|
+
getObserver() && read(getNode(getNodes(e, te), t, n, e[ie], isEqual, e[se]));
|
|
1987
1991
|
return n;
|
|
1988
1992
|
},
|
|
1989
1993
|
set(e, t, n) {
|
|
1990
|
-
const r = e[
|
|
1994
|
+
const r = e[U];
|
|
1991
1995
|
if (writeOnly(r)) {
|
|
1992
|
-
if (e[
|
|
1993
|
-
const t = e[
|
|
1996
|
+
if (e[se]) {
|
|
1997
|
+
const t = e[ie];
|
|
1994
1998
|
if (t?.ne) {
|
|
1995
1999
|
j.initTransition(t.ne);
|
|
1996
2000
|
}
|
|
1997
2001
|
}
|
|
1998
2002
|
untrack(() => {
|
|
1999
|
-
const i = e[
|
|
2003
|
+
const i = e[Y];
|
|
2000
2004
|
const s = i[t];
|
|
2001
2005
|
if (V && typeof t !== "symbol") {
|
|
2002
2006
|
if (!e[m]) {
|
|
@@ -2007,23 +2011,23 @@ const ce = {
|
|
|
2007
2011
|
e[m][t] = s;
|
|
2008
2012
|
}
|
|
2009
2013
|
}
|
|
2010
|
-
const o = e[
|
|
2011
|
-
const u = o ?
|
|
2014
|
+
const o = e[se] && !E;
|
|
2015
|
+
const u = o ? $ : Z;
|
|
2012
2016
|
if (o) trackOptimisticStore(r);
|
|
2013
|
-
const f = e[
|
|
2014
|
-
const l = n?.[
|
|
2017
|
+
const f = e[$] && t in e[$] ? e[$][t] : e[Z] && t in e[Z] ? e[Z][t] : s;
|
|
2018
|
+
const l = n?.[z]?.[Y] ?? n;
|
|
2015
2019
|
if (f === l) return true;
|
|
2016
|
-
const c = e[
|
|
2020
|
+
const c = e[$]?.length || e[Z]?.length || i.length;
|
|
2017
2021
|
if (l !== undefined && l === s) delete e[u][t];
|
|
2018
2022
|
else (e[u] || (e[u] = Object.create(null)))[t] = l;
|
|
2019
2023
|
const a = isWrappable(l);
|
|
2020
2024
|
if (isWrappable(f)) {
|
|
2021
|
-
const e =
|
|
2022
|
-
e && (e instanceof Set ? e.delete(r) :
|
|
2025
|
+
const e = X.get(f);
|
|
2026
|
+
e && (e instanceof Set ? e.delete(r) : X.delete(f));
|
|
2023
2027
|
}
|
|
2024
|
-
if (recursivelyNotify(r,
|
|
2025
|
-
e[
|
|
2026
|
-
const d = getNodes(e,
|
|
2028
|
+
if (recursivelyNotify(r, oe) && a) recursivelyAddParent(l, r);
|
|
2029
|
+
e[te]?.[t] && setSignal(e[te][t], true);
|
|
2030
|
+
const d = getNodes(e, ee);
|
|
2027
2031
|
d[t] && setSignal(d[t], () => (a ? wrap(l, e) : l));
|
|
2028
2032
|
if (Array.isArray(i)) {
|
|
2029
2033
|
if (t === "length") {
|
|
@@ -2033,44 +2037,44 @@ const ce = {
|
|
|
2033
2037
|
if (e > c) d.length && setSignal(d.length, e);
|
|
2034
2038
|
}
|
|
2035
2039
|
}
|
|
2036
|
-
d[
|
|
2040
|
+
d[G] && setSignal(d[G], undefined);
|
|
2037
2041
|
});
|
|
2038
2042
|
}
|
|
2039
2043
|
return true;
|
|
2040
2044
|
},
|
|
2041
2045
|
deleteProperty(e, t) {
|
|
2042
|
-
const n = e[
|
|
2043
|
-
const r = e[
|
|
2044
|
-
if (writeOnly(e[
|
|
2046
|
+
const n = e[$]?.[t] === J;
|
|
2047
|
+
const r = e[Z]?.[t] === J;
|
|
2048
|
+
if (writeOnly(e[U]) && !n && !r) {
|
|
2045
2049
|
untrack(() => {
|
|
2046
|
-
const n = e[
|
|
2047
|
-
const r = n ?
|
|
2048
|
-
if (n) trackOptimisticStore(e[
|
|
2049
|
-
const i = e[
|
|
2050
|
-
if (t in e[
|
|
2051
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
2050
|
+
const n = e[se] && !E;
|
|
2051
|
+
const r = n ? $ : Z;
|
|
2052
|
+
if (n) trackOptimisticStore(e[U]);
|
|
2053
|
+
const i = e[$] && t in e[$] ? e[$][t] : e[Z] && t in e[Z] ? e[Z][t] : e[Y][t];
|
|
2054
|
+
if (t in e[Y] || (e[Z] && t in e[Z])) {
|
|
2055
|
+
(e[r] || (e[r] = Object.create(null)))[t] = J;
|
|
2052
2056
|
} else if (e[r] && t in e[r]) {
|
|
2053
2057
|
delete e[r][t];
|
|
2054
2058
|
} else return true;
|
|
2055
2059
|
if (isWrappable(i)) {
|
|
2056
|
-
const t =
|
|
2057
|
-
t && (t instanceof Set ? t.delete(e) :
|
|
2060
|
+
const t = X.get(i);
|
|
2061
|
+
t && (t instanceof Set ? t.delete(e) : X.delete(i));
|
|
2058
2062
|
}
|
|
2059
|
-
if (e[
|
|
2060
|
-
const s = getNodes(e,
|
|
2063
|
+
if (e[te]?.[t]) setSignal(e[te][t], false);
|
|
2064
|
+
const s = getNodes(e, ee);
|
|
2061
2065
|
s[t] && setSignal(s[t], undefined);
|
|
2062
|
-
s[
|
|
2066
|
+
s[G] && setSignal(s[G], undefined);
|
|
2063
2067
|
});
|
|
2064
2068
|
}
|
|
2065
2069
|
return true;
|
|
2066
2070
|
},
|
|
2067
2071
|
ownKeys(e) {
|
|
2068
2072
|
trackSelf(e);
|
|
2069
|
-
let t = getKeys(e[
|
|
2070
|
-
if (e[
|
|
2073
|
+
let t = getKeys(e[Y], e[Z], false);
|
|
2074
|
+
if (e[$]) {
|
|
2071
2075
|
const n = new Set(t);
|
|
2072
|
-
for (const t of Reflect.ownKeys(e[
|
|
2073
|
-
if (e[
|
|
2076
|
+
for (const t of Reflect.ownKeys(e[$])) {
|
|
2077
|
+
if (e[$][t] !== J) n.add(t);
|
|
2074
2078
|
else n.delete(t);
|
|
2075
2079
|
}
|
|
2076
2080
|
t = Array.from(n);
|
|
@@ -2078,25 +2082,25 @@ const ce = {
|
|
|
2078
2082
|
return t;
|
|
2079
2083
|
},
|
|
2080
2084
|
getOwnPropertyDescriptor(e, t) {
|
|
2081
|
-
if (t ===
|
|
2082
|
-
if (e[
|
|
2083
|
-
if (e[
|
|
2084
|
-
const n = getPropertyDescriptor(e[
|
|
2085
|
+
if (t === U) return { value: e[U], writable: true, configurable: true };
|
|
2086
|
+
if (e[$] && t in e[$]) {
|
|
2087
|
+
if (e[$][t] === J) return undefined;
|
|
2088
|
+
const n = getPropertyDescriptor(e[Y], e[Z], t);
|
|
2085
2089
|
if (n) {
|
|
2086
|
-
return { ...n, value: e[
|
|
2090
|
+
return { ...n, value: e[$][t] };
|
|
2087
2091
|
}
|
|
2088
|
-
return { value: e[
|
|
2092
|
+
return { value: e[$][t], writable: true, enumerable: true, configurable: true };
|
|
2089
2093
|
}
|
|
2090
|
-
return getPropertyDescriptor(e[
|
|
2094
|
+
return getPropertyDescriptor(e[Y], e[Z], t);
|
|
2091
2095
|
},
|
|
2092
2096
|
getPrototypeOf(e) {
|
|
2093
|
-
return Object.getPrototypeOf(e[
|
|
2097
|
+
return Object.getPrototypeOf(e[Y]);
|
|
2094
2098
|
}
|
|
2095
2099
|
};
|
|
2096
2100
|
function storeSetter(e, t) {
|
|
2097
|
-
const n =
|
|
2098
|
-
|
|
2099
|
-
|
|
2101
|
+
const n = fe;
|
|
2102
|
+
fe = new Set();
|
|
2103
|
+
fe.add(e);
|
|
2100
2104
|
try {
|
|
2101
2105
|
const n = t(e);
|
|
2102
2106
|
if (n !== e && n !== undefined) {
|
|
@@ -2112,8 +2116,8 @@ function storeSetter(e, t) {
|
|
|
2112
2116
|
}
|
|
2113
2117
|
}
|
|
2114
2118
|
} finally {
|
|
2115
|
-
|
|
2116
|
-
|
|
2119
|
+
fe.clear();
|
|
2120
|
+
fe = n;
|
|
2117
2121
|
}
|
|
2118
2122
|
}
|
|
2119
2123
|
function createStore(e, t, n) {
|
|
@@ -2122,17 +2126,17 @@ function createStore(e, t, n) {
|
|
|
2122
2126
|
return [i, e => storeSetter(i, e)];
|
|
2123
2127
|
}
|
|
2124
2128
|
function recursivelyNotify(e, t) {
|
|
2125
|
-
let n = e[
|
|
2129
|
+
let n = e[z] || t?.get(e)?.[z];
|
|
2126
2130
|
let r = false;
|
|
2127
2131
|
if (n) {
|
|
2128
|
-
const e = getNodes(n,
|
|
2132
|
+
const e = getNodes(n, ee)[K];
|
|
2129
2133
|
if (e) {
|
|
2130
2134
|
setSignal(e, undefined);
|
|
2131
2135
|
r = true;
|
|
2132
2136
|
}
|
|
2133
|
-
t = n[
|
|
2137
|
+
t = n[re] || t;
|
|
2134
2138
|
}
|
|
2135
|
-
const i =
|
|
2139
|
+
const i = X.get(n?.[Y] || e);
|
|
2136
2140
|
if (!i) return r;
|
|
2137
2141
|
if (i instanceof Set) {
|
|
2138
2142
|
for (let e of i) r = recursivelyNotify(e, t) || r;
|
|
@@ -2141,16 +2145,16 @@ function recursivelyNotify(e, t) {
|
|
|
2141
2145
|
}
|
|
2142
2146
|
function recursivelyAddParent(e, t) {
|
|
2143
2147
|
let n;
|
|
2144
|
-
const r = e[
|
|
2148
|
+
const r = e[z];
|
|
2145
2149
|
if (r) {
|
|
2146
|
-
n = r[
|
|
2147
|
-
e = r[
|
|
2150
|
+
n = r[Z];
|
|
2151
|
+
e = r[Y];
|
|
2148
2152
|
}
|
|
2149
2153
|
if (t) {
|
|
2150
|
-
let n =
|
|
2151
|
-
if (!n)
|
|
2154
|
+
let n = X.get(e);
|
|
2155
|
+
if (!n) X.set(e, t);
|
|
2152
2156
|
else if (n !== t) {
|
|
2153
|
-
if (!(n instanceof Set))
|
|
2157
|
+
if (!(n instanceof Set)) X.set(e, (n = new Set([n])));
|
|
2154
2158
|
else if (n.has(t)) return;
|
|
2155
2159
|
n.add(t);
|
|
2156
2160
|
} else return;
|
|
@@ -2172,7 +2176,7 @@ function recursivelyAddParent(e, t) {
|
|
|
2172
2176
|
}
|
|
2173
2177
|
function deep(e) {
|
|
2174
2178
|
recursivelyAddParent(e);
|
|
2175
|
-
return e[
|
|
2179
|
+
return e[K];
|
|
2176
2180
|
}
|
|
2177
2181
|
function createOptimisticStore(e, t, n) {
|
|
2178
2182
|
GlobalQueue.J ||= clearOptimisticStore;
|
|
@@ -2183,39 +2187,39 @@ function createOptimisticStore(e, t, n) {
|
|
|
2183
2187
|
return [o, e => storeSetter(o, e)];
|
|
2184
2188
|
}
|
|
2185
2189
|
function clearOptimisticStore(e) {
|
|
2186
|
-
const t = e[
|
|
2187
|
-
if (!t || !t[
|
|
2188
|
-
const n = t[
|
|
2189
|
-
const r = t[
|
|
2190
|
+
const t = e[z];
|
|
2191
|
+
if (!t || !t[$]) return;
|
|
2192
|
+
const n = t[$];
|
|
2193
|
+
const r = t[ee];
|
|
2190
2194
|
setProjectionWriteActive(true);
|
|
2191
2195
|
try {
|
|
2192
2196
|
if (r) {
|
|
2193
2197
|
for (const e of Reflect.ownKeys(n)) {
|
|
2194
2198
|
if (r[e]) {
|
|
2195
2199
|
r[e].re = undefined;
|
|
2196
|
-
const n = t[
|
|
2197
|
-
const i = n ===
|
|
2200
|
+
const n = t[Z] && e in t[Z] ? t[Z][e] : t[Y][e];
|
|
2201
|
+
const i = n === J ? undefined : n;
|
|
2198
2202
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2199
2203
|
}
|
|
2200
2204
|
}
|
|
2201
|
-
if (r[
|
|
2202
|
-
r[
|
|
2203
|
-
setSignal(r[
|
|
2205
|
+
if (r[G]) {
|
|
2206
|
+
r[G].re = undefined;
|
|
2207
|
+
setSignal(r[G], undefined);
|
|
2204
2208
|
}
|
|
2205
2209
|
}
|
|
2206
2210
|
} finally {
|
|
2207
2211
|
setProjectionWriteActive(false);
|
|
2208
2212
|
}
|
|
2209
|
-
delete t[
|
|
2213
|
+
delete t[$];
|
|
2210
2214
|
}
|
|
2211
2215
|
function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
2212
2216
|
let r;
|
|
2213
2217
|
const i = new WeakMap();
|
|
2214
2218
|
const wrapper = e => {
|
|
2215
|
-
e[
|
|
2216
|
-
e[
|
|
2217
|
-
e[
|
|
2218
|
-
Object.defineProperty(e,
|
|
2219
|
+
e[ne] = wrapProjection;
|
|
2220
|
+
e[re] = i;
|
|
2221
|
+
e[se] = true;
|
|
2222
|
+
Object.defineProperty(e, ie, {
|
|
2219
2223
|
get() {
|
|
2220
2224
|
return r;
|
|
2221
2225
|
},
|
|
@@ -2224,8 +2228,8 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2224
2228
|
};
|
|
2225
2229
|
const wrapProjection = e => {
|
|
2226
2230
|
if (i.has(e)) return i.get(e);
|
|
2227
|
-
if (e[
|
|
2228
|
-
const t = createStoreProxy(e,
|
|
2231
|
+
if (e[z]?.[ne] === wrapProjection) return e;
|
|
2232
|
+
const t = createStoreProxy(e, le, wrapper);
|
|
2229
2233
|
i.set(e, t);
|
|
2230
2234
|
return t;
|
|
2231
2235
|
};
|
|
@@ -2235,7 +2239,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2235
2239
|
const t = getOwner();
|
|
2236
2240
|
setProjectionWriteActive(true);
|
|
2237
2241
|
try {
|
|
2238
|
-
storeSetter(new Proxy(s,
|
|
2242
|
+
storeSetter(new Proxy(s, B), r => {
|
|
2239
2243
|
const i = handleAsync(t, e(r), e => {
|
|
2240
2244
|
setProjectionWriteActive(true);
|
|
2241
2245
|
try {
|
|
@@ -2250,11 +2254,11 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2250
2254
|
setProjectionWriteActive(false);
|
|
2251
2255
|
}
|
|
2252
2256
|
});
|
|
2253
|
-
r.
|
|
2257
|
+
r.Ae = true;
|
|
2254
2258
|
}
|
|
2255
2259
|
return { store: s, node: r };
|
|
2256
2260
|
}
|
|
2257
|
-
const
|
|
2261
|
+
const ce = Symbol(0);
|
|
2258
2262
|
function updatePath(e, t, n = 0) {
|
|
2259
2263
|
let r,
|
|
2260
2264
|
i = e;
|
|
@@ -2298,7 +2302,7 @@ function updatePath(e, t, n = 0) {
|
|
|
2298
2302
|
if (s === i) return;
|
|
2299
2303
|
}
|
|
2300
2304
|
if (r === undefined && s == undefined) return;
|
|
2301
|
-
if (s ===
|
|
2305
|
+
if (s === ce) {
|
|
2302
2306
|
delete e[r];
|
|
2303
2307
|
} else if (r === undefined || (isWrappable(i) && isWrappable(s) && !Array.isArray(s))) {
|
|
2304
2308
|
const t = r !== undefined ? e[r] : e;
|
|
@@ -2308,25 +2312,25 @@ function updatePath(e, t, n = 0) {
|
|
|
2308
2312
|
e[r] = s;
|
|
2309
2313
|
}
|
|
2310
2314
|
}
|
|
2311
|
-
const
|
|
2315
|
+
const ae = Object.assign(
|
|
2312
2316
|
function storePath(...e) {
|
|
2313
2317
|
return t => {
|
|
2314
2318
|
updatePath(t, e);
|
|
2315
2319
|
};
|
|
2316
2320
|
},
|
|
2317
|
-
{ DELETE:
|
|
2321
|
+
{ DELETE: ce }
|
|
2318
2322
|
);
|
|
2319
2323
|
function snapshot(e, t, n) {
|
|
2320
2324
|
let r, i, s, o, u, f;
|
|
2321
2325
|
if (!isWrappable(e)) return e;
|
|
2322
2326
|
if (t && t.has(e)) return t.get(e);
|
|
2323
2327
|
if (!t) t = new Map();
|
|
2324
|
-
if ((r = e[
|
|
2325
|
-
s = r[
|
|
2326
|
-
i = Array.isArray(r[
|
|
2327
|
-
t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[
|
|
2328
|
-
e = r[
|
|
2329
|
-
n =
|
|
2328
|
+
if ((r = e[z] || n?.get(e)?.[z])) {
|
|
2329
|
+
s = r[Z];
|
|
2330
|
+
i = Array.isArray(r[Y]);
|
|
2331
|
+
t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[Y]))) : r[Y]);
|
|
2332
|
+
e = r[Y];
|
|
2333
|
+
n = oe;
|
|
2330
2334
|
} else {
|
|
2331
2335
|
i = Array.isArray(e);
|
|
2332
2336
|
t.set(e, e);
|
|
@@ -2335,7 +2339,7 @@ function snapshot(e, t, n) {
|
|
|
2335
2339
|
const r = s?.length || e.length;
|
|
2336
2340
|
for (let i = 0; i < r; i++) {
|
|
2337
2341
|
f = s && i in s ? s[i] : e[i];
|
|
2338
|
-
if (f ===
|
|
2342
|
+
if (f === J) continue;
|
|
2339
2343
|
if ((u = snapshot(f, t, n)) !== f || o) {
|
|
2340
2344
|
if (!o) t.set(e, (o = [...e]));
|
|
2341
2345
|
o[i] = u;
|
|
@@ -2362,13 +2366,13 @@ function snapshot(e, t, n) {
|
|
|
2362
2366
|
function trueFn() {
|
|
2363
2367
|
return true;
|
|
2364
2368
|
}
|
|
2365
|
-
const
|
|
2369
|
+
const de = {
|
|
2366
2370
|
get(e, t, n) {
|
|
2367
|
-
if (t ===
|
|
2371
|
+
if (t === U) return n;
|
|
2368
2372
|
return e.get(t);
|
|
2369
2373
|
},
|
|
2370
2374
|
has(e, t) {
|
|
2371
|
-
if (t ===
|
|
2375
|
+
if (t === U) return true;
|
|
2372
2376
|
return e.has(t);
|
|
2373
2377
|
},
|
|
2374
2378
|
set: trueFn,
|
|
@@ -2391,15 +2395,15 @@ const pe = {
|
|
|
2391
2395
|
function resolveSource(e) {
|
|
2392
2396
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
2393
2397
|
}
|
|
2394
|
-
const
|
|
2398
|
+
const pe = Symbol(0);
|
|
2395
2399
|
function merge(...e) {
|
|
2396
2400
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
2397
2401
|
let t = false;
|
|
2398
2402
|
const n = [];
|
|
2399
2403
|
for (let r = 0; r < e.length; r++) {
|
|
2400
2404
|
const i = e[r];
|
|
2401
|
-
t = t || (!!i &&
|
|
2402
|
-
const s = !!i && i[
|
|
2405
|
+
t = t || (!!i && U in i);
|
|
2406
|
+
const s = !!i && i[pe];
|
|
2403
2407
|
if (s) n.push(...s);
|
|
2404
2408
|
else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
2405
2409
|
}
|
|
@@ -2407,7 +2411,7 @@ function merge(...e) {
|
|
|
2407
2411
|
return new Proxy(
|
|
2408
2412
|
{
|
|
2409
2413
|
get(e) {
|
|
2410
|
-
if (e ===
|
|
2414
|
+
if (e === pe) return n;
|
|
2411
2415
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
2412
2416
|
const r = resolveSource(n[t]);
|
|
2413
2417
|
if (e in r) return r[e];
|
|
@@ -2425,7 +2429,7 @@ function merge(...e) {
|
|
|
2425
2429
|
return [...new Set(e)];
|
|
2426
2430
|
}
|
|
2427
2431
|
},
|
|
2428
|
-
|
|
2432
|
+
de
|
|
2429
2433
|
);
|
|
2430
2434
|
}
|
|
2431
2435
|
const r = Object.create(null);
|
|
@@ -2457,12 +2461,12 @@ function merge(...e) {
|
|
|
2457
2461
|
if (n.get) Object.defineProperty(o, t, n);
|
|
2458
2462
|
else o[t] = n.value;
|
|
2459
2463
|
}
|
|
2460
|
-
o[
|
|
2464
|
+
o[pe] = n;
|
|
2461
2465
|
return o;
|
|
2462
2466
|
}
|
|
2463
2467
|
function omit(e, ...t) {
|
|
2464
2468
|
const n = new Set(t);
|
|
2465
|
-
if (b &&
|
|
2469
|
+
if (b && U in e) {
|
|
2466
2470
|
return new Proxy(
|
|
2467
2471
|
{
|
|
2468
2472
|
get(t) {
|
|
@@ -2475,7 +2479,7 @@ function omit(e, ...t) {
|
|
|
2475
2479
|
return Object.keys(e).filter(e => !n.has(e));
|
|
2476
2480
|
}
|
|
2477
2481
|
},
|
|
2478
|
-
|
|
2482
|
+
de
|
|
2479
2483
|
);
|
|
2480
2484
|
}
|
|
2481
2485
|
const r = {};
|
|
@@ -2509,18 +2513,18 @@ function mapArray(e, t, n) {
|
|
|
2509
2513
|
})
|
|
2510
2514
|
);
|
|
2511
2515
|
}
|
|
2512
|
-
const
|
|
2516
|
+
const he = { pureWrite: true };
|
|
2513
2517
|
function updateKeyedMap() {
|
|
2514
2518
|
const e = this.Ge() || [],
|
|
2515
2519
|
t = e.length;
|
|
2516
|
-
e[
|
|
2520
|
+
e[G];
|
|
2517
2521
|
runWithOwner(this.De, () => {
|
|
2518
2522
|
let n,
|
|
2519
2523
|
r,
|
|
2520
2524
|
i = this.Ye
|
|
2521
2525
|
? () => {
|
|
2522
|
-
this.Ye[r] = signal(e[r],
|
|
2523
|
-
this.Ze && (this.Ze[r] = signal(r,
|
|
2526
|
+
this.Ye[r] = signal(e[r], he);
|
|
2527
|
+
this.Ze && (this.Ze[r] = signal(r, he));
|
|
2524
2528
|
return this.ze(
|
|
2525
2529
|
read.bind(null, this.Ye[r]),
|
|
2526
2530
|
this.Ze ? read.bind(null, this.Ze[r]) : undefined
|
|
@@ -2529,7 +2533,7 @@ function updateKeyedMap() {
|
|
|
2529
2533
|
: this.Ze
|
|
2530
2534
|
? () => {
|
|
2531
2535
|
const t = e[r];
|
|
2532
|
-
this.Ze[r] = signal(r,
|
|
2536
|
+
this.Ze[r] = signal(r, he);
|
|
2533
2537
|
return this.ze(() => t, read.bind(null, this.Ze[r]));
|
|
2534
2538
|
}
|
|
2535
2539
|
: () => {
|
|
@@ -2705,7 +2709,7 @@ function boundaryComputed(e, t) {
|
|
|
2705
2709
|
n.fe.notify(n, n.rt, r, i);
|
|
2706
2710
|
};
|
|
2707
2711
|
n.rt = t;
|
|
2708
|
-
n.
|
|
2712
|
+
n.Ae = true;
|
|
2709
2713
|
recompute(n, true);
|
|
2710
2714
|
return n;
|
|
2711
2715
|
}
|
|
@@ -2829,9 +2833,10 @@ function flattenArray(e, t = [], n) {
|
|
|
2829
2833
|
if (r) throw r;
|
|
2830
2834
|
return i;
|
|
2831
2835
|
}
|
|
2832
|
-
exports.$PROXY =
|
|
2833
|
-
exports.$
|
|
2834
|
-
exports.$
|
|
2836
|
+
exports.$PROXY = U;
|
|
2837
|
+
exports.$REFRESH = O;
|
|
2838
|
+
exports.$TARGET = z;
|
|
2839
|
+
exports.$TRACK = G;
|
|
2835
2840
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
2836
2841
|
exports.NoOwnerError = NoOwnerError;
|
|
2837
2842
|
exports.NotReadyError = NotReadyError;
|
|
@@ -2880,8 +2885,8 @@ exports.repeat = repeat;
|
|
|
2880
2885
|
exports.resolve = resolve;
|
|
2881
2886
|
exports.runWithOwner = runWithOwner;
|
|
2882
2887
|
exports.setContext = setContext;
|
|
2888
|
+
exports.setOnUnhandledAsync = setOnUnhandledAsync;
|
|
2883
2889
|
exports.setSnapshotCapture = setSnapshotCapture;
|
|
2884
|
-
exports.setStrictRead = setStrictRead;
|
|
2885
2890
|
exports.snapshot = snapshot;
|
|
2886
|
-
exports.storePath =
|
|
2891
|
+
exports.storePath = ae;
|
|
2887
2892
|
exports.untrack = untrack;
|