@solidjs/signals 2.0.0-beta.11 → 2.0.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/dist/dev.js +47 -19
- package/dist/node.cjs +427 -404
- package/dist/prod.js +338 -315
- package/dist/types/boundaries.d.ts +7 -5
- package/dist/types/core/core.d.ts +11 -3
- package/dist/types/map.d.ts +21 -5
- package/dist/types-cjs/boundaries.d.cts +7 -5
- package/dist/types-cjs/core/core.d.cts +11 -3
- package/dist/types-cjs/map.d.cts +21 -5
- package/package.json +1 -1
package/dist/prod.js
CHANGED
|
@@ -172,7 +172,7 @@ function getOrCreateLane(e) {
|
|
|
172
172
|
}
|
|
173
173
|
const n = e.U;
|
|
174
174
|
const i = n?.G ? findLane(n.G) : null;
|
|
175
|
-
t = {
|
|
175
|
+
t = { k: e, F: new Set(), W: [[], []], H: null, M: activeTransition, j: i };
|
|
176
176
|
signalLanes.set(e, t);
|
|
177
177
|
activeLanes.add(t);
|
|
178
178
|
e.$ = false;
|
|
@@ -187,7 +187,7 @@ function mergeLanes(e, t) {
|
|
|
187
187
|
t = findLane(t);
|
|
188
188
|
if (e === t) return e;
|
|
189
189
|
t.H = e;
|
|
190
|
-
for (const n of t.
|
|
190
|
+
for (const n of t.F) e.F.add(n);
|
|
191
191
|
e.W[0].push(...t.W[0]);
|
|
192
192
|
e.W[1].push(...t.W[1]);
|
|
193
193
|
return e;
|
|
@@ -269,7 +269,7 @@ function shouldReadStashedOptimisticValue(e) {
|
|
|
269
269
|
}
|
|
270
270
|
function runLaneEffects(e) {
|
|
271
271
|
for (const t of activeLanes) {
|
|
272
|
-
if (t.H || t.
|
|
272
|
+
if (t.H || t.F.size > 0) continue;
|
|
273
273
|
const n = t.W[e - 1];
|
|
274
274
|
if (n.length) {
|
|
275
275
|
t.W[e - 1] = [];
|
|
@@ -332,22 +332,22 @@ function cleanupCompletedLanes(e) {
|
|
|
332
332
|
if (t.W[0].length) runQueue(t.W[0], EFFECT_RENDER);
|
|
333
333
|
if (t.W[1].length) runQueue(t.W[1], EFFECT_USER);
|
|
334
334
|
}
|
|
335
|
-
if (t.
|
|
336
|
-
t.
|
|
335
|
+
if (t.k.G === t) t.k.G = undefined;
|
|
336
|
+
t.F.clear();
|
|
337
337
|
t.W[0].length = 0;
|
|
338
338
|
t.W[1].length = 0;
|
|
339
339
|
activeLanes.delete(t);
|
|
340
|
-
signalLanes.delete(t.
|
|
340
|
+
signalLanes.delete(t.k);
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
function schedule() {
|
|
344
344
|
if (scheduled) return;
|
|
345
345
|
scheduled = true;
|
|
346
|
-
if (!syncDepth && !globalQueue.
|
|
346
|
+
if (!syncDepth && !globalQueue.ce && !projectionWriteActive) queueMicrotask(flush);
|
|
347
347
|
}
|
|
348
348
|
class Queue {
|
|
349
349
|
i = null;
|
|
350
|
-
|
|
350
|
+
le = [[], []];
|
|
351
351
|
Y = [];
|
|
352
352
|
created = clock;
|
|
353
353
|
addChild(e) {
|
|
@@ -366,9 +366,9 @@ class Queue {
|
|
|
366
366
|
return false;
|
|
367
367
|
}
|
|
368
368
|
run(e) {
|
|
369
|
-
if (this.
|
|
370
|
-
const t = this.
|
|
371
|
-
this.
|
|
369
|
+
if (this.le[e - 1].length) {
|
|
370
|
+
const t = this.le[e - 1];
|
|
371
|
+
this.le[e - 1] = [];
|
|
372
372
|
runQueue(t, e);
|
|
373
373
|
}
|
|
374
374
|
for (let t = 0; t < this.Y.length; t++) this.Y[t].run?.(e);
|
|
@@ -379,28 +379,28 @@ class Queue {
|
|
|
379
379
|
const n = findLane(currentOptimisticLane);
|
|
380
380
|
n.W[e - 1].push(t);
|
|
381
381
|
} else {
|
|
382
|
-
this.
|
|
382
|
+
this.le[e - 1].push(t);
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
385
|
schedule();
|
|
386
386
|
}
|
|
387
387
|
stashQueues(e) {
|
|
388
|
-
e.
|
|
389
|
-
e.
|
|
390
|
-
this.
|
|
388
|
+
e.le[0].push(...this.le[0]);
|
|
389
|
+
e.le[1].push(...this.le[1]);
|
|
390
|
+
this.le = [[], []];
|
|
391
391
|
for (let t = 0; t < this.Y.length; t++) {
|
|
392
392
|
let n = this.Y[t];
|
|
393
393
|
let i = e.Y[t];
|
|
394
394
|
if (!i) {
|
|
395
|
-
i = {
|
|
395
|
+
i = { le: [[], []], Y: [] };
|
|
396
396
|
e.Y[t] = i;
|
|
397
397
|
}
|
|
398
398
|
n.stashQueues(i);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
restoreQueues(e) {
|
|
402
|
-
this.
|
|
403
|
-
this.
|
|
402
|
+
this.le[0].push(...e.le[0]);
|
|
403
|
+
this.le[1].push(...e.le[1]);
|
|
404
404
|
for (let t = 0; t < e.Y.length; t++) {
|
|
405
405
|
const n = e.Y[t];
|
|
406
406
|
let i = this.Y[t];
|
|
@@ -409,7 +409,7 @@ class Queue {
|
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
class GlobalQueue extends Queue {
|
|
412
|
-
|
|
412
|
+
ce = false;
|
|
413
413
|
ae = null;
|
|
414
414
|
fe = [];
|
|
415
415
|
Z = [];
|
|
@@ -419,8 +419,8 @@ class GlobalQueue extends Queue {
|
|
|
419
419
|
static Te;
|
|
420
420
|
static de = null;
|
|
421
421
|
flush() {
|
|
422
|
-
if (this.
|
|
423
|
-
this.
|
|
422
|
+
if (this.ce) return;
|
|
423
|
+
this.ce = true;
|
|
424
424
|
try {
|
|
425
425
|
runHeap(dirtyQueue, GlobalQueue.Ee);
|
|
426
426
|
if (activeTransition) {
|
|
@@ -482,7 +482,7 @@ class GlobalQueue extends Queue {
|
|
|
482
482
|
this.run(EFFECT_USER);
|
|
483
483
|
if (false);
|
|
484
484
|
} finally {
|
|
485
|
-
this.
|
|
485
|
+
this.ce = false;
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
488
|
notify(e, t, n, i) {
|
|
@@ -514,7 +514,7 @@ class GlobalQueue extends Queue {
|
|
|
514
514
|
Z: [],
|
|
515
515
|
q: new Set(),
|
|
516
516
|
re: [],
|
|
517
|
-
Oe: {
|
|
517
|
+
Oe: { le: [[], []], Y: [] },
|
|
518
518
|
ie: false,
|
|
519
519
|
oe: new Set()
|
|
520
520
|
};
|
|
@@ -691,7 +691,7 @@ function flush(e) {
|
|
|
691
691
|
syncDepth--;
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
|
-
if (globalQueue.
|
|
694
|
+
if (globalQueue.ce) {
|
|
695
695
|
return;
|
|
696
696
|
}
|
|
697
697
|
while (scheduled || activeTransition) {
|
|
@@ -816,17 +816,17 @@ function disposeChildren(e, t = false, n) {
|
|
|
816
816
|
e.me = 0;
|
|
817
817
|
}
|
|
818
818
|
if (t && !n && !(i & REACTIVE_ZOMBIE) && e.i !== null && !(e.i._ & REACTIVE_DISPOSED)) {
|
|
819
|
-
const t = e.
|
|
819
|
+
const t = e.we;
|
|
820
820
|
const n = e.De;
|
|
821
821
|
if (t !== null) t.De = n;
|
|
822
822
|
else e.i.ge = n;
|
|
823
|
-
if (n !== null) n.
|
|
824
|
-
e.
|
|
823
|
+
if (n !== null) n.we = t;
|
|
824
|
+
e.we = null;
|
|
825
825
|
}
|
|
826
826
|
runDisposal(e, n);
|
|
827
827
|
}
|
|
828
828
|
function runDisposal(e, t) {
|
|
829
|
-
let n = t ? e.Ae : e.
|
|
829
|
+
let n = t ? e.Ae : e.be;
|
|
830
830
|
if (!n) return;
|
|
831
831
|
if (Array.isArray(n)) {
|
|
832
832
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -836,7 +836,7 @@ function runDisposal(e, t) {
|
|
|
836
836
|
} else {
|
|
837
837
|
n.call(n);
|
|
838
838
|
}
|
|
839
|
-
t ? (e.Ae = null) : (e.
|
|
839
|
+
t ? (e.Ae = null) : (e.be = null);
|
|
840
840
|
}
|
|
841
841
|
function childId(e, t) {
|
|
842
842
|
let n = e;
|
|
@@ -864,9 +864,9 @@ function getOwner() {
|
|
|
864
864
|
}
|
|
865
865
|
function cleanup(e) {
|
|
866
866
|
if (!context) return e;
|
|
867
|
-
if (!context.
|
|
868
|
-
else if (Array.isArray(context.
|
|
869
|
-
else context.
|
|
867
|
+
if (!context.be) context.be = e;
|
|
868
|
+
else if (Array.isArray(context.be)) context.be.push(e);
|
|
869
|
+
else context.be = [context.be, e];
|
|
870
870
|
return e;
|
|
871
871
|
}
|
|
872
872
|
function isDisposed(e) {
|
|
@@ -885,8 +885,8 @@ function createOwner(e) {
|
|
|
885
885
|
u: t?.t ? t.u : t,
|
|
886
886
|
ge: null,
|
|
887
887
|
De: null,
|
|
888
|
-
be: null,
|
|
889
888
|
we: null,
|
|
889
|
+
be: null,
|
|
890
890
|
te: t?.te ?? globalQueue,
|
|
891
891
|
Ve: t?.Ve || defaultContext,
|
|
892
892
|
me: 0,
|
|
@@ -901,7 +901,7 @@ function createOwner(e) {
|
|
|
901
901
|
t.ge = i;
|
|
902
902
|
} else {
|
|
903
903
|
i.De = e;
|
|
904
|
-
e.
|
|
904
|
+
e.we = i;
|
|
905
905
|
t.ge = i;
|
|
906
906
|
}
|
|
907
907
|
}
|
|
@@ -1101,7 +1101,7 @@ function handleAsync(e, t, n) {
|
|
|
1101
1101
|
trimStaleDeps(e);
|
|
1102
1102
|
clearStatus(e);
|
|
1103
1103
|
const o = resolveLane(e);
|
|
1104
|
-
if (o) o.
|
|
1104
|
+
if (o) o.F.delete(e);
|
|
1105
1105
|
if (n) n(i);
|
|
1106
1106
|
else if (e.K !== undefined) {
|
|
1107
1107
|
if (e.K !== undefined && e.K !== NOT_PENDING) e.B = i;
|
|
@@ -1113,12 +1113,12 @@ function handleAsync(e, t, n) {
|
|
|
1113
1113
|
} else if (o) {
|
|
1114
1114
|
const t = e.J;
|
|
1115
1115
|
const n = e.ue;
|
|
1116
|
-
const r = e.
|
|
1116
|
+
const r = e.ke;
|
|
1117
1117
|
if ((!t && s) || !r || !r(i, n)) {
|
|
1118
1118
|
e.ue = i;
|
|
1119
1119
|
e.Ie = clock;
|
|
1120
|
-
if (e.
|
|
1121
|
-
setSignal(e.
|
|
1120
|
+
if (e.Fe) {
|
|
1121
|
+
setSignal(e.Fe, i);
|
|
1122
1122
|
}
|
|
1123
1123
|
insertSubs(e, true);
|
|
1124
1124
|
}
|
|
@@ -1167,10 +1167,10 @@ function handleAsync(e, t, n) {
|
|
|
1167
1167
|
const iterate = () => {
|
|
1168
1168
|
let o,
|
|
1169
1169
|
u = false,
|
|
1170
|
-
|
|
1170
|
+
c = true;
|
|
1171
1171
|
n.next().then(
|
|
1172
1172
|
n => {
|
|
1173
|
-
if (
|
|
1173
|
+
if (c) {
|
|
1174
1174
|
o = n;
|
|
1175
1175
|
u = true;
|
|
1176
1176
|
if (n.done) r = true;
|
|
@@ -1184,13 +1184,13 @@ function handleAsync(e, t, n) {
|
|
|
1184
1184
|
}
|
|
1185
1185
|
},
|
|
1186
1186
|
n => {
|
|
1187
|
-
if (!
|
|
1187
|
+
if (!c && e.ve === t) {
|
|
1188
1188
|
r = true;
|
|
1189
1189
|
handleError(n);
|
|
1190
1190
|
}
|
|
1191
1191
|
}
|
|
1192
1192
|
);
|
|
1193
|
-
|
|
1193
|
+
c = false;
|
|
1194
1194
|
if (u && !o.done) {
|
|
1195
1195
|
s = o.value;
|
|
1196
1196
|
i = true;
|
|
@@ -1220,7 +1220,7 @@ function notifyStatus(e, t, n, i, r) {
|
|
|
1220
1220
|
const s = t === STATUS_PENDING && n instanceof NotReadyError ? n.source : undefined;
|
|
1221
1221
|
const o = s === e;
|
|
1222
1222
|
const u = t === STATUS_PENDING && e.K !== undefined && !o;
|
|
1223
|
-
const
|
|
1223
|
+
const c = u && hasActiveOverride(e);
|
|
1224
1224
|
if (!i) {
|
|
1225
1225
|
if (t === STATUS_PENDING && s) {
|
|
1226
1226
|
addPendingSource(e, s);
|
|
@@ -1236,13 +1236,13 @@ function notifyStatus(e, t, n, i, r) {
|
|
|
1236
1236
|
if (r && !i) {
|
|
1237
1237
|
assignOrMergeLane(e, r);
|
|
1238
1238
|
}
|
|
1239
|
-
const
|
|
1239
|
+
const l = i || c;
|
|
1240
1240
|
const a = i || u ? undefined : r;
|
|
1241
1241
|
if (e.xe) {
|
|
1242
1242
|
if (i && t === STATUS_PENDING) {
|
|
1243
1243
|
return;
|
|
1244
1244
|
}
|
|
1245
|
-
if (
|
|
1245
|
+
if (l) {
|
|
1246
1246
|
e.xe(t, n);
|
|
1247
1247
|
} else {
|
|
1248
1248
|
e.xe();
|
|
@@ -1255,8 +1255,8 @@ function notifyStatus(e, t, n, i, r) {
|
|
|
1255
1255
|
(t === STATUS_PENDING && s && e.Ce !== s && !e.Pe?.has(s)) ||
|
|
1256
1256
|
(t !== STATUS_PENDING && (e.Re !== n || e.Ce || e.Pe))
|
|
1257
1257
|
) {
|
|
1258
|
-
if (!
|
|
1259
|
-
notifyStatus(e, t, n,
|
|
1258
|
+
if (!l && !e.M) queuePendingNode(e);
|
|
1259
|
+
notifyStatus(e, t, n, l, a);
|
|
1260
1260
|
}
|
|
1261
1261
|
});
|
|
1262
1262
|
}
|
|
@@ -1293,6 +1293,7 @@ let foundPending = false;
|
|
|
1293
1293
|
let latestReadActive = false;
|
|
1294
1294
|
let context = null;
|
|
1295
1295
|
let currentOptimisticLane = null;
|
|
1296
|
+
let pendingCheckLoadingPath = false;
|
|
1296
1297
|
let snapshotCaptureActive = false;
|
|
1297
1298
|
let snapshotSources = null;
|
|
1298
1299
|
function ownerInSnapshotScope(e) {
|
|
@@ -1353,11 +1354,11 @@ function recompute(e, t = false) {
|
|
|
1353
1354
|
deleteFromHeap(e, e._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
1354
1355
|
e.ve = null;
|
|
1355
1356
|
if (e.M || n === EFFECT_TRACKED) disposeChildren(e);
|
|
1356
|
-
else if (e.ge !== null || e.
|
|
1357
|
+
else if (e.ge !== null || e.be !== null) {
|
|
1357
1358
|
markDisposal(e);
|
|
1358
|
-
e.Ae = e.
|
|
1359
|
+
e.Ae = e.be;
|
|
1359
1360
|
e.Ne = e.ge;
|
|
1360
|
-
e.
|
|
1361
|
+
e.be = null;
|
|
1361
1362
|
e.ge = null;
|
|
1362
1363
|
e.me = 0;
|
|
1363
1364
|
} else;
|
|
@@ -1371,8 +1372,8 @@ function recompute(e, t = false) {
|
|
|
1371
1372
|
e.ye = null;
|
|
1372
1373
|
e._ = REACTIVE_RECOMPUTING_DEPS;
|
|
1373
1374
|
e.Ie = clock;
|
|
1374
|
-
let
|
|
1375
|
-
let
|
|
1375
|
+
let c = e.B === NOT_PENDING ? e.ue : e.B;
|
|
1376
|
+
let l = e.o;
|
|
1376
1377
|
let a = tracking;
|
|
1377
1378
|
let f = currentOptimisticLane;
|
|
1378
1379
|
tracking = true;
|
|
@@ -1399,31 +1400,31 @@ function recompute(e, t = false) {
|
|
|
1399
1400
|
if (E) stale = true;
|
|
1400
1401
|
try {
|
|
1401
1402
|
if (!false && e._e & CONFIG_SYNC) {
|
|
1402
|
-
|
|
1403
|
+
c = e.L(c);
|
|
1403
1404
|
e.ve = null;
|
|
1404
1405
|
} else {
|
|
1405
1406
|
const t = e.ve;
|
|
1406
|
-
const n = e.L(
|
|
1407
|
+
const n = e.L(c);
|
|
1407
1408
|
const i = typeof n === "object" && n !== null;
|
|
1408
1409
|
const r = e.ve !== t;
|
|
1409
|
-
|
|
1410
|
+
c = r || !i ? n : handleAsync(e, n);
|
|
1410
1411
|
if (!r && !i) e.ve = null;
|
|
1411
1412
|
}
|
|
1412
1413
|
clearStatus(e, t);
|
|
1413
1414
|
if (e.G) {
|
|
1414
1415
|
const t = resolveLane(e);
|
|
1415
1416
|
if (t) {
|
|
1416
|
-
t.
|
|
1417
|
-
updatePendingSignal(t.
|
|
1417
|
+
t.F.delete(e);
|
|
1418
|
+
updatePendingSignal(t.k);
|
|
1418
1419
|
}
|
|
1419
1420
|
}
|
|
1420
1421
|
} catch (t) {
|
|
1421
1422
|
if (t instanceof NotReadyError && currentOptimisticLane) {
|
|
1422
1423
|
const t = findLane(currentOptimisticLane);
|
|
1423
|
-
if (t.
|
|
1424
|
-
t.
|
|
1424
|
+
if (t.k !== e) {
|
|
1425
|
+
t.F.add(e);
|
|
1425
1426
|
e.G = t;
|
|
1426
|
-
updatePendingSignal(t.
|
|
1427
|
+
updatePendingSignal(t.k);
|
|
1427
1428
|
}
|
|
1428
1429
|
}
|
|
1429
1430
|
if (t instanceof NotReadyError) e.Ge = true;
|
|
@@ -1443,7 +1444,7 @@ function recompute(e, t = false) {
|
|
|
1443
1444
|
if (!e.Re) {
|
|
1444
1445
|
trimStaleDeps(e);
|
|
1445
1446
|
const u = r ? e.K : e.B === NOT_PENDING ? e.ue : e.B;
|
|
1446
|
-
const a = (!n && o) || !e.
|
|
1447
|
+
const a = (!n && o) || !e.ke || !e.ke(u, c);
|
|
1447
1448
|
if (n && a) {
|
|
1448
1449
|
e.ee = !e.Re;
|
|
1449
1450
|
if (!t) e.te.enqueue(n, GlobalQueue.Te.bind(null, e));
|
|
@@ -1451,17 +1452,17 @@ function recompute(e, t = false) {
|
|
|
1451
1452
|
if (a) {
|
|
1452
1453
|
const o = r ? e.K : undefined;
|
|
1453
1454
|
if (t || (n && activeTransition !== e.M) || i) {
|
|
1454
|
-
e.ue =
|
|
1455
|
+
e.ue = c;
|
|
1455
1456
|
if (r && i) {
|
|
1456
|
-
e.K =
|
|
1457
|
-
e.B =
|
|
1457
|
+
e.K = c;
|
|
1458
|
+
e.B = c;
|
|
1458
1459
|
}
|
|
1459
|
-
} else e.B =
|
|
1460
|
-
if (r && !i && s && !e.$) e.K =
|
|
1460
|
+
} else e.B = c;
|
|
1461
|
+
if (r && !i && s && !e.$) e.K = c;
|
|
1461
1462
|
if (!r || i || e.K !== o) insertSubs(e, i || r);
|
|
1462
1463
|
} else if (r) {
|
|
1463
|
-
e.B =
|
|
1464
|
-
} else if (e.o !=
|
|
1464
|
+
e.B = c;
|
|
1465
|
+
} else if (e.o != l) {
|
|
1465
1466
|
for (let t = e.I; t !== null; t = t.p) {
|
|
1466
1467
|
insertIntoHeapHeight(t.h, t.h._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
|
|
1467
1468
|
}
|
|
@@ -1504,9 +1505,9 @@ function computed(e, t) {
|
|
|
1504
1505
|
(!context || t?.lazy ? CONFIG_AUTO_DISPOSE : 0) |
|
|
1505
1506
|
(t?.sync ? CONFIG_SYNC : 0) |
|
|
1506
1507
|
(snapshotCaptureActive && ownerInSnapshotScope(context) ? CONFIG_IN_SNAPSHOT_SCOPE : 0),
|
|
1507
|
-
|
|
1508
|
+
ke: t?.equals != null ? t.equals : isEqual,
|
|
1508
1509
|
X: t?.unobserved,
|
|
1509
|
-
|
|
1510
|
+
be: null,
|
|
1510
1511
|
te: context?.te ?? globalQueue,
|
|
1511
1512
|
Ve: context?.Ve ?? defaultContext,
|
|
1512
1513
|
me: 0,
|
|
@@ -1522,7 +1523,7 @@ function computed(e, t) {
|
|
|
1522
1523
|
Ue: null,
|
|
1523
1524
|
i: context,
|
|
1524
1525
|
De: null,
|
|
1525
|
-
|
|
1526
|
+
we: null,
|
|
1526
1527
|
ge: null,
|
|
1527
1528
|
_: t?.lazy ? REACTIVE_LAZY : REACTIVE_NONE,
|
|
1528
1529
|
he: STATUS_UNINITIALIZED,
|
|
@@ -1545,9 +1546,9 @@ function createEffectNode(e, t, n, i, r, s) {
|
|
|
1545
1546
|
(s?.ownedWrite ? CONFIG_OWNED_WRITE : 0) |
|
|
1546
1547
|
(s?.sync ? CONFIG_SYNC : 0) |
|
|
1547
1548
|
(snapshotCaptureActive && ownerInSnapshotScope(context) ? CONFIG_IN_SNAPSHOT_SCOPE : 0),
|
|
1548
|
-
|
|
1549
|
+
ke: false,
|
|
1549
1550
|
X: s?.unobserved,
|
|
1550
|
-
|
|
1551
|
+
be: null,
|
|
1551
1552
|
te: context?.te ?? globalQueue,
|
|
1552
1553
|
Ve: context?.Ve ?? defaultContext,
|
|
1553
1554
|
me: 0,
|
|
@@ -1563,7 +1564,7 @@ function createEffectNode(e, t, n, i, r, s) {
|
|
|
1563
1564
|
Ue: null,
|
|
1564
1565
|
i: context,
|
|
1565
1566
|
De: null,
|
|
1566
|
-
|
|
1567
|
+
we: null,
|
|
1567
1568
|
ge: null,
|
|
1568
1569
|
_: REACTIVE_LAZY,
|
|
1569
1570
|
he: STATUS_UNINITIALIZED,
|
|
@@ -1595,7 +1596,7 @@ function setupComputedNode(e, t) {
|
|
|
1595
1596
|
context.ge = e;
|
|
1596
1597
|
} else {
|
|
1597
1598
|
e.De = t;
|
|
1598
|
-
t.
|
|
1599
|
+
t.we = e;
|
|
1599
1600
|
context.ge = e;
|
|
1600
1601
|
}
|
|
1601
1602
|
}
|
|
@@ -1621,7 +1622,7 @@ function setupComputedNode(e, t) {
|
|
|
1621
1622
|
}
|
|
1622
1623
|
function signal(e, t, n = null) {
|
|
1623
1624
|
const i = {
|
|
1624
|
-
|
|
1625
|
+
ke: t?.equals != null ? t.equals : isEqual,
|
|
1625
1626
|
_e: (t?.ownedWrite ? CONFIG_OWNED_WRITE : 0) | (t?.Ye ? CONFIG_NO_SNAPSHOT : 0),
|
|
1626
1627
|
X: t?.unobserved,
|
|
1627
1628
|
ue: e,
|
|
@@ -1682,7 +1683,7 @@ function read(e) {
|
|
|
1682
1683
|
if (stale && currentOptimisticLane && t.G) {
|
|
1683
1684
|
const e = findLane(t.G);
|
|
1684
1685
|
const n = findLane(currentOptimisticLane);
|
|
1685
|
-
if (e !== n && e.
|
|
1686
|
+
if (e !== n && e.F.size > 0) {
|
|
1686
1687
|
return i;
|
|
1687
1688
|
}
|
|
1688
1689
|
}
|
|
@@ -1692,6 +1693,14 @@ function read(e) {
|
|
|
1692
1693
|
const t = e.V;
|
|
1693
1694
|
const n = pendingCheckActive;
|
|
1694
1695
|
pendingCheckActive = false;
|
|
1696
|
+
const i = t || e;
|
|
1697
|
+
if (pendingCheckLoadingPath && i.he & STATUS_PENDING && i.he & STATUS_UNINITIALIZED) {
|
|
1698
|
+
let t = context;
|
|
1699
|
+
if (t?.t) t = t.u;
|
|
1700
|
+
if (t && tracking) link(e, t);
|
|
1701
|
+
pendingCheckActive = n;
|
|
1702
|
+
throw i.Re;
|
|
1703
|
+
}
|
|
1695
1704
|
if (t && e.K !== undefined) {
|
|
1696
1705
|
if (e.K !== NOT_PENDING && (t.ve || !!(t.he & STATUS_PENDING))) {
|
|
1697
1706
|
foundPending = true;
|
|
@@ -1826,7 +1835,7 @@ function setSignal(e, t) {
|
|
|
1826
1835
|
const i = e.K !== undefined && e.K !== NOT_PENDING;
|
|
1827
1836
|
const r = n ? (i ? e.K : e.ue) : e.B === NOT_PENDING ? e.ue : e.B;
|
|
1828
1837
|
if (typeof t === "function") t = t(r);
|
|
1829
|
-
const s = !e.
|
|
1838
|
+
const s = !e.ke || !e.ke(r, t) || !!(e.he & STATUS_UNINITIALIZED);
|
|
1830
1839
|
if (!s) {
|
|
1831
1840
|
if (n && i && e.L) {
|
|
1832
1841
|
insertSubs(e, true);
|
|
@@ -1850,8 +1859,8 @@ function setSignal(e, t) {
|
|
|
1850
1859
|
e.B = t;
|
|
1851
1860
|
}
|
|
1852
1861
|
if (e.We) updatePendingSignal(e);
|
|
1853
|
-
if (e.
|
|
1854
|
-
setSignal(e.
|
|
1862
|
+
if (e.Fe) {
|
|
1863
|
+
setSignal(e.Fe, t);
|
|
1855
1864
|
}
|
|
1856
1865
|
e.Ie = clock;
|
|
1857
1866
|
insertSubs(e, n);
|
|
@@ -1900,7 +1909,7 @@ function computePendingState(e) {
|
|
|
1900
1909
|
if (t.he & STATUS_PENDING && !(t.he & STATUS_UNINITIALIZED)) return true;
|
|
1901
1910
|
if (e.U) {
|
|
1902
1911
|
const t = e.G ? findLane(e.G) : null;
|
|
1903
|
-
return !!(t && t.
|
|
1912
|
+
return !!(t && t.F.size > 0);
|
|
1904
1913
|
}
|
|
1905
1914
|
return true;
|
|
1906
1915
|
}
|
|
@@ -1917,7 +1926,7 @@ function updatePendingSignal(e) {
|
|
|
1917
1926
|
setSignal(n, t);
|
|
1918
1927
|
if (!t && n.G) {
|
|
1919
1928
|
const t = resolveLane(e);
|
|
1920
|
-
if (t && t.
|
|
1929
|
+
if (t && t.F.size > 0) {
|
|
1921
1930
|
const e = findLane(n.G);
|
|
1922
1931
|
if (e !== t) {
|
|
1923
1932
|
mergeLanes(t, e);
|
|
@@ -1929,20 +1938,20 @@ function updatePendingSignal(e) {
|
|
|
1929
1938
|
}
|
|
1930
1939
|
}
|
|
1931
1940
|
function getLatestValueComputed(e) {
|
|
1932
|
-
if (!e.
|
|
1941
|
+
if (!e.Fe) {
|
|
1933
1942
|
const t = latestReadActive;
|
|
1934
1943
|
latestReadActive = false;
|
|
1935
1944
|
const n = pendingCheckActive;
|
|
1936
1945
|
pendingCheckActive = false;
|
|
1937
1946
|
const i = context;
|
|
1938
1947
|
context = null;
|
|
1939
|
-
e.
|
|
1940
|
-
e.
|
|
1948
|
+
e.Fe = optimisticComputed(() => read(e));
|
|
1949
|
+
e.Fe.U = e;
|
|
1941
1950
|
context = i;
|
|
1942
1951
|
pendingCheckActive = n;
|
|
1943
1952
|
latestReadActive = t;
|
|
1944
1953
|
}
|
|
1945
|
-
return e.
|
|
1954
|
+
return e.Fe;
|
|
1946
1955
|
}
|
|
1947
1956
|
function staleValues(e, t = true) {
|
|
1948
1957
|
const n = stale;
|
|
@@ -1962,19 +1971,24 @@ function latest(e) {
|
|
|
1962
1971
|
latestReadActive = t;
|
|
1963
1972
|
}
|
|
1964
1973
|
}
|
|
1965
|
-
function isPending(e) {
|
|
1966
|
-
const
|
|
1967
|
-
const
|
|
1974
|
+
function isPending(e, t) {
|
|
1975
|
+
const n = pendingCheckActive;
|
|
1976
|
+
const i = pendingCheckLoadingPath;
|
|
1977
|
+
const r = foundPending;
|
|
1978
|
+
const s = t === true;
|
|
1968
1979
|
pendingCheckActive = true;
|
|
1980
|
+
pendingCheckLoadingPath = s;
|
|
1969
1981
|
foundPending = false;
|
|
1970
1982
|
try {
|
|
1971
1983
|
e();
|
|
1972
1984
|
return foundPending;
|
|
1973
|
-
} catch {
|
|
1985
|
+
} catch (e) {
|
|
1986
|
+
if (s && e instanceof NotReadyError) throw e;
|
|
1974
1987
|
return foundPending;
|
|
1975
1988
|
} finally {
|
|
1976
|
-
pendingCheckActive =
|
|
1977
|
-
|
|
1989
|
+
pendingCheckActive = n;
|
|
1990
|
+
pendingCheckLoadingPath = i;
|
|
1991
|
+
foundPending = r;
|
|
1978
1992
|
}
|
|
1979
1993
|
}
|
|
1980
1994
|
function refresh(e) {
|
|
@@ -2266,25 +2280,25 @@ function applyStateFast(e, t, n) {
|
|
|
2266
2280
|
let r = false;
|
|
2267
2281
|
const s = i.length;
|
|
2268
2282
|
if (e.length && s && e[0] && n(e[0]) != null) {
|
|
2269
|
-
let o, u,
|
|
2283
|
+
let o, u, c, l, a, f, E, S;
|
|
2270
2284
|
for (
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2285
|
+
c = 0, l = Math.min(s, e.length);
|
|
2286
|
+
c < l && ((f = i[c]) === e[c] || (f && e[c] && n(f) === n(e[c])));
|
|
2287
|
+
c++
|
|
2274
2288
|
) {
|
|
2275
|
-
applyState(e[
|
|
2289
|
+
applyState(e[c], wrap(f, t), n);
|
|
2276
2290
|
}
|
|
2277
2291
|
const T = new Array(e.length),
|
|
2278
2292
|
d = new Map();
|
|
2279
2293
|
for (
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2294
|
+
l = s - 1, a = e.length - 1;
|
|
2295
|
+
l >= c && a >= c && ((f = i[l]) === e[a] || (f && e[a] && n(f) === n(e[a])));
|
|
2296
|
+
l--, a--
|
|
2283
2297
|
) {
|
|
2284
2298
|
T[a] = f;
|
|
2285
2299
|
}
|
|
2286
|
-
if (
|
|
2287
|
-
for (u =
|
|
2300
|
+
if (c > a || c > l) {
|
|
2301
|
+
for (u = c; u <= a; u++) {
|
|
2288
2302
|
r = true;
|
|
2289
2303
|
t[STORE_NODE][u] && setSignal(t[STORE_NODE][u], wrap(e[u], t));
|
|
2290
2304
|
}
|
|
@@ -2299,14 +2313,14 @@ function applyStateFast(e, t, n) {
|
|
|
2299
2313
|
return;
|
|
2300
2314
|
}
|
|
2301
2315
|
E = new Array(a + 1);
|
|
2302
|
-
for (u = a; u >=
|
|
2316
|
+
for (u = a; u >= c; u--) {
|
|
2303
2317
|
f = e[u];
|
|
2304
2318
|
S = f ? n(f) : f;
|
|
2305
2319
|
o = d.get(S);
|
|
2306
2320
|
E[u] = o === undefined ? -1 : o;
|
|
2307
2321
|
d.set(S, u);
|
|
2308
2322
|
}
|
|
2309
|
-
for (o =
|
|
2323
|
+
for (o = c; o <= l; o++) {
|
|
2310
2324
|
f = i[o];
|
|
2311
2325
|
S = f ? n(f) : f;
|
|
2312
2326
|
u = d.get(S);
|
|
@@ -2316,14 +2330,14 @@ function applyStateFast(e, t, n) {
|
|
|
2316
2330
|
d.set(S, u);
|
|
2317
2331
|
}
|
|
2318
2332
|
}
|
|
2319
|
-
for (u =
|
|
2333
|
+
for (u = c; u < e.length; u++) {
|
|
2320
2334
|
if (u in T) {
|
|
2321
2335
|
const i = wrap(T[u], t);
|
|
2322
2336
|
t[STORE_NODE][u] && setSignal(t[STORE_NODE][u], i);
|
|
2323
2337
|
applyState(e[u], i, n);
|
|
2324
2338
|
} else t[STORE_NODE][u] && setSignal(t[STORE_NODE][u], wrap(e[u], t));
|
|
2325
2339
|
}
|
|
2326
|
-
if (
|
|
2340
|
+
if (c < e.length) r = true;
|
|
2327
2341
|
} else if (e.length) {
|
|
2328
2342
|
for (let r = 0, s = e.length; r < s; r++) {
|
|
2329
2343
|
const s = i[r];
|
|
@@ -2343,15 +2357,15 @@ function applyStateFast(e, t, n) {
|
|
|
2343
2357
|
if (r) {
|
|
2344
2358
|
const s = r[$TRACK];
|
|
2345
2359
|
const o = s ? getAllKeys(i, undefined, e) : Object.keys(r);
|
|
2346
|
-
for (let u = 0,
|
|
2347
|
-
const
|
|
2348
|
-
const
|
|
2349
|
-
const a = unwrap(i[
|
|
2350
|
-
let f = unwrap(e[
|
|
2360
|
+
for (let u = 0, c = o.length; u < c; u++) {
|
|
2361
|
+
const c = o[u];
|
|
2362
|
+
const l = r[c];
|
|
2363
|
+
const a = unwrap(i[c]);
|
|
2364
|
+
let f = unwrap(e[c]);
|
|
2351
2365
|
if (a === f) continue;
|
|
2352
2366
|
if (!a || !isWrappable(a) || !isWrappable(f) || (n(a) != null && n(a) !== n(f))) {
|
|
2353
2367
|
s && setSignal(s, void 0);
|
|
2354
|
-
|
|
2368
|
+
l && setSignal(l, isWrappable(f) ? wrap(f, t) : f);
|
|
2355
2369
|
} else applyState(f, wrap(a, t), n);
|
|
2356
2370
|
}
|
|
2357
2371
|
}
|
|
@@ -2375,7 +2389,7 @@ function applyStateSlow(e, t, n) {
|
|
|
2375
2389
|
let o = false;
|
|
2376
2390
|
const u = getOverrideValue(i, r, "length", s);
|
|
2377
2391
|
if (e.length && u && e[0] && n(e[0]) != null) {
|
|
2378
|
-
let
|
|
2392
|
+
let c, l, a, f, E, S, T, d;
|
|
2379
2393
|
for (
|
|
2380
2394
|
a = 0, f = Math.min(u, e.length);
|
|
2381
2395
|
a < f && ((S = getOverrideValue(i, r, a, s)) === e[a] || (S && e[a] && n(S) === n(e[a])));
|
|
@@ -2395,44 +2409,44 @@ function applyStateSlow(e, t, n) {
|
|
|
2395
2409
|
O[E] = S;
|
|
2396
2410
|
}
|
|
2397
2411
|
if (a > E || a > f) {
|
|
2398
|
-
for (
|
|
2412
|
+
for (l = a; l <= E; l++) {
|
|
2399
2413
|
o = true;
|
|
2400
|
-
t[STORE_NODE][
|
|
2414
|
+
t[STORE_NODE][l] && setSignal(t[STORE_NODE][l], wrap(e[l], t));
|
|
2401
2415
|
}
|
|
2402
|
-
for (;
|
|
2416
|
+
for (; l < e.length; l++) {
|
|
2403
2417
|
o = true;
|
|
2404
|
-
const i = wrap(O[
|
|
2405
|
-
t[STORE_NODE][
|
|
2406
|
-
applyState(e[
|
|
2418
|
+
const i = wrap(O[l], t);
|
|
2419
|
+
t[STORE_NODE][l] && setSignal(t[STORE_NODE][l], i);
|
|
2420
|
+
applyState(e[l], i, n);
|
|
2407
2421
|
}
|
|
2408
2422
|
o && t[STORE_NODE][$TRACK] && setSignal(t[STORE_NODE][$TRACK], void 0);
|
|
2409
2423
|
u !== e.length && t[STORE_NODE].length && setSignal(t[STORE_NODE].length, e.length);
|
|
2410
2424
|
return;
|
|
2411
2425
|
}
|
|
2412
2426
|
T = new Array(E + 1);
|
|
2413
|
-
for (
|
|
2414
|
-
S = e[
|
|
2427
|
+
for (l = E; l >= a; l--) {
|
|
2428
|
+
S = e[l];
|
|
2415
2429
|
d = S ? n(S) : S;
|
|
2416
|
-
|
|
2417
|
-
T[
|
|
2418
|
-
_.set(d,
|
|
2430
|
+
c = _.get(d);
|
|
2431
|
+
T[l] = c === undefined ? -1 : c;
|
|
2432
|
+
_.set(d, l);
|
|
2419
2433
|
}
|
|
2420
|
-
for (
|
|
2421
|
-
S = getOverrideValue(i, r,
|
|
2434
|
+
for (c = a; c <= f; c++) {
|
|
2435
|
+
S = getOverrideValue(i, r, c, s);
|
|
2422
2436
|
d = S ? n(S) : S;
|
|
2423
|
-
|
|
2424
|
-
if (
|
|
2425
|
-
O[
|
|
2426
|
-
|
|
2427
|
-
_.set(d,
|
|
2437
|
+
l = _.get(d);
|
|
2438
|
+
if (l !== undefined && l !== -1) {
|
|
2439
|
+
O[l] = S;
|
|
2440
|
+
l = T[l];
|
|
2441
|
+
_.set(d, l);
|
|
2428
2442
|
}
|
|
2429
2443
|
}
|
|
2430
|
-
for (
|
|
2431
|
-
if (
|
|
2432
|
-
const i = wrap(O[
|
|
2433
|
-
t[STORE_NODE][
|
|
2434
|
-
applyState(e[
|
|
2435
|
-
} else t[STORE_NODE][
|
|
2444
|
+
for (l = a; l < e.length; l++) {
|
|
2445
|
+
if (l in O) {
|
|
2446
|
+
const i = wrap(O[l], t);
|
|
2447
|
+
t[STORE_NODE][l] && setSignal(t[STORE_NODE][l], i);
|
|
2448
|
+
applyState(e[l], i, n);
|
|
2449
|
+
} else t[STORE_NODE][l] && setSignal(t[STORE_NODE][l], wrap(e[l], t));
|
|
2436
2450
|
}
|
|
2437
2451
|
if (a < e.length) o = true;
|
|
2438
2452
|
} else if (e.length) {
|
|
@@ -2452,9 +2466,9 @@ function applyStateSlow(e, t, n) {
|
|
|
2452
2466
|
}
|
|
2453
2467
|
if (o) {
|
|
2454
2468
|
const u = o[$TRACK];
|
|
2455
|
-
const
|
|
2456
|
-
for (let
|
|
2457
|
-
const a = l
|
|
2469
|
+
const c = u ? getAllKeys(i, r, e) : Object.keys(o);
|
|
2470
|
+
for (let l = 0, a = c.length; l < a; l++) {
|
|
2471
|
+
const a = c[l];
|
|
2458
2472
|
const f = o[a];
|
|
2459
2473
|
const E = unwrap(getOverrideValue(i, r, a, s));
|
|
2460
2474
|
let S = unwrap(e[a]);
|
|
@@ -2736,35 +2750,35 @@ function upsertStoreNode(e, t, n, i, r) {
|
|
|
2736
2750
|
function notifyStoreProperty(e, t, n, i, r, s) {
|
|
2737
2751
|
const o = projectionWriteActive || e[STORE_OPTIMISTIC];
|
|
2738
2752
|
const u = n !== "delete";
|
|
2739
|
-
const
|
|
2740
|
-
if (
|
|
2741
|
-
setSignal(
|
|
2753
|
+
const c = e[STORE_HAS]?.[t];
|
|
2754
|
+
if (c) {
|
|
2755
|
+
setSignal(c, u);
|
|
2742
2756
|
} else if (!o && n !== "invalidate" && s !== u) {
|
|
2743
2757
|
const n = upsertStoreNode(e, getNodes(e, STORE_HAS), t, s);
|
|
2744
2758
|
setSignal(n, u);
|
|
2745
2759
|
}
|
|
2746
|
-
const
|
|
2760
|
+
const l = getNodes(e, STORE_NODE);
|
|
2747
2761
|
if (n === "set") {
|
|
2748
|
-
if (
|
|
2749
|
-
setSignal(
|
|
2762
|
+
if (l[t]) {
|
|
2763
|
+
setSignal(l[t], () => (isWrappable(i) ? wrap(i, e) : i));
|
|
2750
2764
|
} else if (!o) {
|
|
2751
|
-
const n = upsertStoreNode(e,
|
|
2765
|
+
const n = upsertStoreNode(e, l, t, r, e[STORE_SNAPSHOT_PROPS]);
|
|
2752
2766
|
setSignal(n, () => (isWrappable(i) ? wrap(i, e) : i));
|
|
2753
2767
|
}
|
|
2754
2768
|
} else if (n === "invalidate") {
|
|
2755
|
-
if (
|
|
2756
|
-
setSignal(
|
|
2757
|
-
delete
|
|
2769
|
+
if (l[t]) {
|
|
2770
|
+
setSignal(l[t], {});
|
|
2771
|
+
delete l[t];
|
|
2758
2772
|
}
|
|
2759
2773
|
} else {
|
|
2760
|
-
if (
|
|
2761
|
-
setSignal(
|
|
2774
|
+
if (l[t]) {
|
|
2775
|
+
setSignal(l[t], undefined);
|
|
2762
2776
|
} else if (!o) {
|
|
2763
|
-
const n = upsertStoreNode(e,
|
|
2777
|
+
const n = upsertStoreNode(e, l, t, r, e[STORE_SNAPSHOT_PROPS]);
|
|
2764
2778
|
setSignal(n, undefined);
|
|
2765
2779
|
}
|
|
2766
2780
|
}
|
|
2767
|
-
|
|
2781
|
+
l[$TRACK] && setSignal(l[$TRACK], undefined);
|
|
2768
2782
|
}
|
|
2769
2783
|
let Writing = null;
|
|
2770
2784
|
const storeTraps = {
|
|
@@ -2795,46 +2809,46 @@ const storeTraps = {
|
|
|
2795
2809
|
}
|
|
2796
2810
|
const o = e[STORE_OPTIMISTIC_OVERRIDE] && t in e[STORE_OPTIMISTIC_OVERRIDE];
|
|
2797
2811
|
const u = o || (e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]);
|
|
2798
|
-
const
|
|
2799
|
-
const
|
|
2812
|
+
const c = !!e[STORE_VALUE][$TARGET];
|
|
2813
|
+
const l = o
|
|
2800
2814
|
? e[STORE_OPTIMISTIC_OVERRIDE]
|
|
2801
2815
|
: e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]
|
|
2802
2816
|
? e[STORE_OVERRIDE]
|
|
2803
2817
|
: e[STORE_VALUE];
|
|
2804
2818
|
if (!r) {
|
|
2805
|
-
const i = Object.getOwnPropertyDescriptor(
|
|
2819
|
+
const i = Object.getOwnPropertyDescriptor(l, t);
|
|
2806
2820
|
if (i && i.get) return i.get.call(n);
|
|
2807
2821
|
if (!i && !u && e[STORE_CUSTOM_PROTO]) {
|
|
2808
|
-
const e = unwrapStoreValue(
|
|
2822
|
+
const e = unwrapStoreValue(l);
|
|
2809
2823
|
if (hasInheritedAccessor(e, t)) {
|
|
2810
|
-
return Reflect.get(
|
|
2824
|
+
return Reflect.get(l, t, n);
|
|
2811
2825
|
}
|
|
2812
2826
|
}
|
|
2813
2827
|
}
|
|
2814
2828
|
if (writeOnly(n)) {
|
|
2815
2829
|
let n =
|
|
2816
|
-
r && (u || !
|
|
2830
|
+
r && (u || !c)
|
|
2817
2831
|
? r.K !== undefined && r.K !== NOT_PENDING
|
|
2818
2832
|
? r.K
|
|
2819
2833
|
: r.B !== NOT_PENDING
|
|
2820
2834
|
? r.B
|
|
2821
2835
|
: r.ue
|
|
2822
|
-
:
|
|
2836
|
+
: l[t];
|
|
2823
2837
|
n === $DELETED && (n = undefined);
|
|
2824
2838
|
if (!isWrappable(n)) return n;
|
|
2825
2839
|
const i = wrap(n, e);
|
|
2826
2840
|
Writing?.add(i);
|
|
2827
2841
|
return i;
|
|
2828
2842
|
}
|
|
2829
|
-
let a = r ? (u || !
|
|
2843
|
+
let a = r ? (u || !c ? read(i[t]) : (read(i[t]), l[t])) : l[t];
|
|
2830
2844
|
a === $DELETED && (a = undefined);
|
|
2831
2845
|
if (!r) {
|
|
2832
|
-
if (!u && typeof a === "function" && !
|
|
2846
|
+
if (!u && typeof a === "function" && !l.hasOwnProperty(t)) {
|
|
2833
2847
|
let t;
|
|
2834
2848
|
return !Array.isArray(e[STORE_VALUE]) &&
|
|
2835
2849
|
(t = Object.getPrototypeOf(e[STORE_VALUE])) &&
|
|
2836
2850
|
t !== Object.prototype
|
|
2837
|
-
? a.bind(
|
|
2851
|
+
? a.bind(l)
|
|
2838
2852
|
: a;
|
|
2839
2853
|
} else if (getObserver()) {
|
|
2840
2854
|
return read(
|
|
@@ -2879,13 +2893,13 @@ const storeTraps = {
|
|
|
2879
2893
|
: e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]
|
|
2880
2894
|
? e[STORE_OVERRIDE][t]
|
|
2881
2895
|
: r;
|
|
2882
|
-
const
|
|
2896
|
+
const c =
|
|
2883
2897
|
e[STORE_OPTIMISTIC_OVERRIDE] && t in e[STORE_OPTIMISTIC_OVERRIDE]
|
|
2884
2898
|
? e[STORE_OPTIMISTIC_OVERRIDE][t] !== $DELETED
|
|
2885
2899
|
: e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]
|
|
2886
2900
|
? e[STORE_OVERRIDE][t] !== $DELETED
|
|
2887
2901
|
: t in e[STORE_VALUE];
|
|
2888
|
-
const
|
|
2902
|
+
const l = unwrapStoreValue(n);
|
|
2889
2903
|
const a = Array.isArray(o) && t !== "length";
|
|
2890
2904
|
const f = a ? parseInt(t) + 1 : 0;
|
|
2891
2905
|
const E =
|
|
@@ -2896,14 +2910,14 @@ const storeTraps = {
|
|
|
2896
2910
|
? e[STORE_OVERRIDE].length
|
|
2897
2911
|
: o.length);
|
|
2898
2912
|
const S = a && f > E ? f : undefined;
|
|
2899
|
-
if (u ===
|
|
2900
|
-
if (
|
|
2913
|
+
if (u === l && S === undefined) return true;
|
|
2914
|
+
if (l !== undefined && l === r && S === undefined) delete e[s]?.[t];
|
|
2901
2915
|
else {
|
|
2902
2916
|
const n = e[s] || (e[s] = Object.create(null));
|
|
2903
|
-
n[t] =
|
|
2917
|
+
n[t] = l;
|
|
2904
2918
|
if (S !== undefined) n.length = S;
|
|
2905
2919
|
}
|
|
2906
|
-
notifyStoreProperty(e, t, "set",
|
|
2920
|
+
notifyStoreProperty(e, t, "set", l, u, c);
|
|
2907
2921
|
if (Array.isArray(o) && t !== "length" && S !== undefined) {
|
|
2908
2922
|
const t = getNodes(e, STORE_NODE);
|
|
2909
2923
|
if (t.length) {
|
|
@@ -3173,7 +3187,7 @@ const storePath = Object.assign(
|
|
|
3173
3187
|
{ DELETE: DELETE }
|
|
3174
3188
|
);
|
|
3175
3189
|
function snapshotImpl(e, t, n, i) {
|
|
3176
|
-
let r, s, o, u,
|
|
3190
|
+
let r, s, o, u, c, l;
|
|
3177
3191
|
if (!isWrappable(e)) return e;
|
|
3178
3192
|
if (n && n.has(e)) return n.get(e);
|
|
3179
3193
|
if (!n) n = new Map();
|
|
@@ -3194,12 +3208,12 @@ function snapshotImpl(e, t, n, i) {
|
|
|
3194
3208
|
if (s) {
|
|
3195
3209
|
const s = o?.length || e.length;
|
|
3196
3210
|
for (let a = 0; a < s; a++) {
|
|
3197
|
-
|
|
3198
|
-
if (
|
|
3199
|
-
if (t && isWrappable(
|
|
3200
|
-
if ((
|
|
3211
|
+
l = o && a in o ? o[a] : e[a];
|
|
3212
|
+
if (l === $DELETED) continue;
|
|
3213
|
+
if (t && isWrappable(l)) wrap(l, r);
|
|
3214
|
+
if ((c = snapshotImpl(l, t, n, i)) !== l || u) {
|
|
3201
3215
|
if (!u) n.set(e, (u = [...e]));
|
|
3202
|
-
u[a] =
|
|
3216
|
+
u[a] = c;
|
|
3203
3217
|
}
|
|
3204
3218
|
}
|
|
3205
3219
|
} else {
|
|
@@ -3208,14 +3222,14 @@ function snapshotImpl(e, t, n, i) {
|
|
|
3208
3222
|
let f = s[a];
|
|
3209
3223
|
const E = getPropertyDescriptor(e, o, f);
|
|
3210
3224
|
if (E.get) continue;
|
|
3211
|
-
|
|
3212
|
-
if (t && isWrappable(
|
|
3213
|
-
if ((
|
|
3225
|
+
l = o && f in o ? o[f] : e[f];
|
|
3226
|
+
if (t && isWrappable(l)) wrap(l, r);
|
|
3227
|
+
if ((c = snapshotImpl(l, t, n, i)) !== e[f] || u) {
|
|
3214
3228
|
if (!u) {
|
|
3215
3229
|
u = Object.create(Object.getPrototypeOf(e));
|
|
3216
3230
|
Object.assign(u, e);
|
|
3217
3231
|
}
|
|
3218
|
-
u[f] =
|
|
3232
|
+
u[f] = c;
|
|
3219
3233
|
}
|
|
3220
3234
|
}
|
|
3221
3235
|
}
|
|
@@ -3376,8 +3390,9 @@ function mapArray(e, t, n) {
|
|
|
3376
3390
|
et: [],
|
|
3377
3391
|
tt: i,
|
|
3378
3392
|
nt: i || n?.keyed === false ? [] : undefined,
|
|
3379
|
-
it: r ? [] : undefined,
|
|
3380
|
-
rt: n?.
|
|
3393
|
+
it: r && n?.keyed !== false ? [] : undefined,
|
|
3394
|
+
rt: n?.keyed === false,
|
|
3395
|
+
st: n?.fallback
|
|
3381
3396
|
};
|
|
3382
3397
|
const u = computed(updateKeyedMap.bind(o));
|
|
3383
3398
|
o.Ze.u = u;
|
|
@@ -3393,20 +3408,25 @@ function updateKeyedMap() {
|
|
|
3393
3408
|
let n,
|
|
3394
3409
|
i,
|
|
3395
3410
|
r = this.nt
|
|
3396
|
-
?
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3411
|
+
? this.rt
|
|
3412
|
+
? () => {
|
|
3413
|
+
this.nt[i] = signal(e[i], pureOptions);
|
|
3414
|
+
return this.Xe(accessor(this.nt[i]), i);
|
|
3415
|
+
}
|
|
3416
|
+
: () => {
|
|
3417
|
+
this.nt[i] = signal(e[i], pureOptions);
|
|
3418
|
+
this.it && (this.it[i] = signal(i, pureOptions));
|
|
3419
|
+
return this.Xe(accessor(this.nt[i]), this.it ? accessor(this.it[i]) : undefined);
|
|
3420
|
+
}
|
|
3401
3421
|
: this.it
|
|
3402
3422
|
? () => {
|
|
3403
3423
|
const t = e[i];
|
|
3404
3424
|
this.it[i] = signal(i, pureOptions);
|
|
3405
|
-
return this.Xe(
|
|
3425
|
+
return this.Xe(t, accessor(this.it[i]));
|
|
3406
3426
|
}
|
|
3407
3427
|
: () => {
|
|
3408
3428
|
const t = e[i];
|
|
3409
|
-
return this.Xe(
|
|
3429
|
+
return this.Xe(t);
|
|
3410
3430
|
};
|
|
3411
3431
|
if (t === 0) {
|
|
3412
3432
|
if (this.qe !== 0) {
|
|
@@ -3418,8 +3438,8 @@ function updateKeyedMap() {
|
|
|
3418
3438
|
this.nt && (this.nt = []);
|
|
3419
3439
|
this.it && (this.it = []);
|
|
3420
3440
|
}
|
|
3421
|
-
if (this.
|
|
3422
|
-
this.Je[0] = runWithOwner((this.et[0] = createOwner()), this.
|
|
3441
|
+
if (this.st && !this.Je[0]) {
|
|
3442
|
+
this.Je[0] = runWithOwner((this.et[0] = createOwner()), this.st);
|
|
3423
3443
|
}
|
|
3424
3444
|
} else if (this.qe === 0) {
|
|
3425
3445
|
if (this.et[0]) this.et[0].dispose();
|
|
@@ -3433,8 +3453,8 @@ function updateKeyedMap() {
|
|
|
3433
3453
|
let s,
|
|
3434
3454
|
o,
|
|
3435
3455
|
u,
|
|
3436
|
-
l,
|
|
3437
3456
|
c,
|
|
3457
|
+
l,
|
|
3438
3458
|
a,
|
|
3439
3459
|
f,
|
|
3440
3460
|
E = new Array(t),
|
|
@@ -3463,23 +3483,23 @@ function updateKeyedMap() {
|
|
|
3463
3483
|
a = new Map();
|
|
3464
3484
|
f = new Array(u + 1);
|
|
3465
3485
|
for (i = u; i >= s; i--) {
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
n = a.get(
|
|
3486
|
+
c = e[i];
|
|
3487
|
+
l = this.tt ? this.tt(c) : c;
|
|
3488
|
+
n = a.get(l);
|
|
3469
3489
|
f[i] = n === undefined ? -1 : n;
|
|
3470
|
-
a.set(
|
|
3490
|
+
a.set(l, i);
|
|
3471
3491
|
}
|
|
3472
3492
|
for (n = s; n <= o; n++) {
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
i = a.get(
|
|
3493
|
+
c = this.ze[n];
|
|
3494
|
+
l = this.tt ? this.tt(c) : c;
|
|
3495
|
+
i = a.get(l);
|
|
3476
3496
|
if (i !== undefined && i !== -1) {
|
|
3477
3497
|
E[i] = this.Je[n];
|
|
3478
3498
|
S[i] = this.et[n];
|
|
3479
3499
|
T && (T[i] = this.nt[n]);
|
|
3480
3500
|
d && (d[i] = this.it[n]);
|
|
3481
3501
|
i = f[i];
|
|
3482
|
-
a.set(
|
|
3502
|
+
a.set(l, i);
|
|
3483
3503
|
} else this.et[n].dispose();
|
|
3484
3504
|
}
|
|
3485
3505
|
for (i = s; i < t; i++) {
|
|
@@ -3510,21 +3530,21 @@ function repeat(e, t, n) {
|
|
|
3510
3530
|
updateRepeat.bind({
|
|
3511
3531
|
Ze: createOwner(),
|
|
3512
3532
|
qe: 0,
|
|
3513
|
-
|
|
3514
|
-
|
|
3533
|
+
ot: 0,
|
|
3534
|
+
ut: e,
|
|
3515
3535
|
Xe: i,
|
|
3516
3536
|
et: [],
|
|
3517
3537
|
Je: [],
|
|
3518
|
-
|
|
3519
|
-
|
|
3538
|
+
ct: n?.from,
|
|
3539
|
+
st: n?.fallback
|
|
3520
3540
|
})
|
|
3521
3541
|
);
|
|
3522
3542
|
r._e &= ~CONFIG_AUTO_DISPOSE;
|
|
3523
3543
|
return accessor(r);
|
|
3524
3544
|
}
|
|
3525
3545
|
function updateRepeat() {
|
|
3526
|
-
const e = this.
|
|
3527
|
-
const t = this.
|
|
3546
|
+
const e = this.ut();
|
|
3547
|
+
const t = this.ct?.() || 0;
|
|
3528
3548
|
runWithOwner(this.Ze, () => {
|
|
3529
3549
|
if (e === 0) {
|
|
3530
3550
|
if (this.qe !== 0) {
|
|
@@ -3533,23 +3553,23 @@ function updateRepeat() {
|
|
|
3533
3553
|
this.Je = [];
|
|
3534
3554
|
this.qe = 0;
|
|
3535
3555
|
}
|
|
3536
|
-
if (this.
|
|
3537
|
-
this.Je[0] = runWithOwner((this.et[0] = createOwner()), this.
|
|
3556
|
+
if (this.st && !this.Je[0]) {
|
|
3557
|
+
this.Je[0] = runWithOwner((this.et[0] = createOwner()), this.st);
|
|
3538
3558
|
}
|
|
3539
3559
|
return;
|
|
3540
3560
|
}
|
|
3541
3561
|
const n = t + e;
|
|
3542
|
-
const i = this.
|
|
3562
|
+
const i = this.ot + this.qe;
|
|
3543
3563
|
if (this.qe === 0 && this.et[0]) this.et[0].dispose();
|
|
3544
|
-
for (let e = n; e < i; e++) this.et[e - this.
|
|
3545
|
-
if (this.
|
|
3546
|
-
let e = this.
|
|
3564
|
+
for (let e = n; e < i; e++) this.et[e - this.ot].dispose();
|
|
3565
|
+
if (this.ot < t) {
|
|
3566
|
+
let e = this.ot;
|
|
3547
3567
|
while (e < t && e < this.qe) this.et[e++].dispose();
|
|
3548
|
-
this.et.splice(0, t - this.
|
|
3549
|
-
this.Je.splice(0, t - this.
|
|
3550
|
-
} else if (this.
|
|
3551
|
-
let n = i - this.
|
|
3552
|
-
let r = this.
|
|
3568
|
+
this.et.splice(0, t - this.ot);
|
|
3569
|
+
this.Je.splice(0, t - this.ot);
|
|
3570
|
+
} else if (this.ot > t) {
|
|
3571
|
+
let n = i - this.ot - 1;
|
|
3572
|
+
let r = this.ot - t;
|
|
3553
3573
|
this.et.length = this.Je.length = e;
|
|
3554
3574
|
while (n >= r) {
|
|
3555
3575
|
this.et[n] = this.et[n - r];
|
|
@@ -3564,7 +3584,7 @@ function updateRepeat() {
|
|
|
3564
3584
|
this.Je[e - t] = runWithOwner((this.et[e - t] = createOwner()), () => this.Xe(e));
|
|
3565
3585
|
}
|
|
3566
3586
|
this.Je = this.Je.slice(0, e);
|
|
3567
|
-
this.
|
|
3587
|
+
this.ot = t;
|
|
3568
3588
|
this.qe = e;
|
|
3569
3589
|
});
|
|
3570
3590
|
return this.Je;
|
|
@@ -3603,52 +3623,52 @@ function isRevealController(e) {
|
|
|
3603
3623
|
return e instanceof RevealController;
|
|
3604
3624
|
}
|
|
3605
3625
|
function isSlotReady(e) {
|
|
3606
|
-
return isRevealController(e) ? e.isReady() : e.
|
|
3626
|
+
return isRevealController(e) ? e.isReady() : e.ft.size === 0 && !e.Et;
|
|
3607
3627
|
}
|
|
3608
3628
|
function isSlotMinimallyReady(e) {
|
|
3609
3629
|
return isRevealController(e) ? e.isMinimallyReady() : isSlotReady(e);
|
|
3610
3630
|
}
|
|
3611
3631
|
function setSlotState(e, t, n, i) {
|
|
3612
|
-
setSignal(e.
|
|
3613
|
-
setSignal(e.
|
|
3632
|
+
setSignal(e.St, n);
|
|
3633
|
+
setSignal(e.Tt, i);
|
|
3614
3634
|
if (isRevealController(e)) {
|
|
3615
|
-
if (!n && e.
|
|
3635
|
+
if (!n && e.dt === t) e.dt = undefined;
|
|
3616
3636
|
return e.evaluate(n, i);
|
|
3617
3637
|
}
|
|
3618
|
-
if (!n && e.
|
|
3638
|
+
if (!n && e.Ot === t && e._t) e.Ot = undefined;
|
|
3619
3639
|
}
|
|
3620
3640
|
class RevealController {
|
|
3621
|
-
_t;
|
|
3622
3641
|
Rt;
|
|
3623
|
-
It
|
|
3624
|
-
|
|
3625
|
-
|
|
3642
|
+
It;
|
|
3643
|
+
ht = [];
|
|
3644
|
+
dt;
|
|
3626
3645
|
St = signal(false, { ownedWrite: true, Ye: true });
|
|
3627
|
-
|
|
3646
|
+
Tt = signal(false, { ownedWrite: true, Ye: true });
|
|
3628
3647
|
Nt = true;
|
|
3629
|
-
At =
|
|
3648
|
+
At = true;
|
|
3649
|
+
Ct = false;
|
|
3630
3650
|
constructor(e, t) {
|
|
3631
|
-
this.
|
|
3632
|
-
this.
|
|
3651
|
+
this.Rt = e;
|
|
3652
|
+
this.It = t;
|
|
3633
3653
|
}
|
|
3634
|
-
|
|
3635
|
-
for (let t = 0; t < this.
|
|
3636
|
-
const n = this.
|
|
3637
|
-
if ((isRevealController(n) ? n.
|
|
3654
|
+
Pt(e) {
|
|
3655
|
+
for (let t = 0; t < this.ht.length; t++) {
|
|
3656
|
+
const n = this.ht[t];
|
|
3657
|
+
if ((isRevealController(n) ? n.dt : n.Ot) !== this) continue;
|
|
3638
3658
|
if (e(n) === false) return false;
|
|
3639
3659
|
}
|
|
3640
3660
|
return true;
|
|
3641
3661
|
}
|
|
3642
3662
|
isReady() {
|
|
3643
|
-
return this.
|
|
3663
|
+
return this.Pt(isSlotReady);
|
|
3644
3664
|
}
|
|
3645
3665
|
isMinimallyReady() {
|
|
3646
|
-
const e = untrack(this.
|
|
3666
|
+
const e = untrack(this.Rt);
|
|
3647
3667
|
if (e === "together") return this.isReady();
|
|
3648
3668
|
if (e === "natural") {
|
|
3649
3669
|
let e = false;
|
|
3650
3670
|
let t = false;
|
|
3651
|
-
this.
|
|
3671
|
+
this.Pt(n => {
|
|
3652
3672
|
e = true;
|
|
3653
3673
|
if (isSlotMinimallyReady(n)) {
|
|
3654
3674
|
t = true;
|
|
@@ -3658,58 +3678,58 @@ class RevealController {
|
|
|
3658
3678
|
return !e || t;
|
|
3659
3679
|
}
|
|
3660
3680
|
let t = true;
|
|
3661
|
-
this.
|
|
3681
|
+
this.Pt(e => {
|
|
3662
3682
|
t = isSlotMinimallyReady(e);
|
|
3663
3683
|
return false;
|
|
3664
3684
|
});
|
|
3665
3685
|
return t;
|
|
3666
3686
|
}
|
|
3667
3687
|
register(e) {
|
|
3668
|
-
if (this.
|
|
3669
|
-
this.
|
|
3670
|
-
const t = untrack(this.
|
|
3671
|
-
(setSignal(e.
|
|
3688
|
+
if (this.ht.includes(e)) return;
|
|
3689
|
+
this.ht.push(e);
|
|
3690
|
+
const t = untrack(this.Rt);
|
|
3691
|
+
(setSignal(e.St, true), setSignal(e.Tt, t === "sequential" ? !!untrack(this.It) : false));
|
|
3672
3692
|
untrack(() => this.evaluate());
|
|
3673
3693
|
}
|
|
3674
3694
|
unregister(e) {
|
|
3675
|
-
const t = this.
|
|
3676
|
-
if (t >= 0) this.
|
|
3695
|
+
const t = this.ht.indexOf(e);
|
|
3696
|
+
if (t >= 0) this.ht.splice(t, 1);
|
|
3677
3697
|
untrack(() => this.evaluate());
|
|
3678
3698
|
}
|
|
3679
3699
|
evaluate(e, t) {
|
|
3680
|
-
if (this.
|
|
3681
|
-
this.
|
|
3682
|
-
const n = this.
|
|
3683
|
-
const i = this.
|
|
3700
|
+
if (this.Ct) return;
|
|
3701
|
+
this.Ct = true;
|
|
3702
|
+
const n = this.Nt;
|
|
3703
|
+
const i = this.At;
|
|
3684
3704
|
try {
|
|
3685
|
-
const n = e ?? read(this.
|
|
3686
|
-
i = untrack(this.
|
|
3687
|
-
r = i === "sequential" && !!untrack(this.
|
|
3705
|
+
const n = e ?? read(this.St),
|
|
3706
|
+
i = untrack(this.Rt),
|
|
3707
|
+
r = i === "sequential" && !!untrack(this.It),
|
|
3688
3708
|
s = t ?? r;
|
|
3689
3709
|
if (n) {
|
|
3690
|
-
this.
|
|
3710
|
+
this.Pt(e => setSlotState(e, this, true, s));
|
|
3691
3711
|
} else if (i === "natural") {
|
|
3692
|
-
this.
|
|
3712
|
+
this.Pt(e => {
|
|
3693
3713
|
if (isRevealController(e)) {
|
|
3714
|
+
setSignal(e.Tt, false);
|
|
3694
3715
|
setSignal(e.St, false);
|
|
3695
|
-
setSignal(e.Et, false);
|
|
3696
3716
|
e.evaluate(false, false);
|
|
3697
3717
|
} else {
|
|
3698
3718
|
setSlotState(e, this, !isSlotReady(e), false);
|
|
3699
3719
|
}
|
|
3700
3720
|
});
|
|
3701
3721
|
} else if (i === "together") {
|
|
3702
|
-
const e = this.
|
|
3703
|
-
this.
|
|
3722
|
+
const e = this.Pt(isSlotMinimallyReady);
|
|
3723
|
+
this.Pt(t => setSlotState(t, this, !e, false));
|
|
3704
3724
|
} else {
|
|
3705
3725
|
let e = false;
|
|
3706
|
-
this.
|
|
3726
|
+
this.Pt(t => {
|
|
3707
3727
|
if (e) return setSlotState(t, this, true, r);
|
|
3708
3728
|
if (isSlotReady(t)) return setSlotState(t, this, false, false);
|
|
3709
3729
|
e = true;
|
|
3710
3730
|
if (isRevealController(t)) {
|
|
3731
|
+
setSignal(t.Tt, false);
|
|
3711
3732
|
setSignal(t.St, false);
|
|
3712
|
-
setSignal(t.Et, false);
|
|
3713
3733
|
t.evaluate(false, false);
|
|
3714
3734
|
} else {
|
|
3715
3735
|
setSlotState(t, this, true, false);
|
|
@@ -3717,96 +3737,101 @@ class RevealController {
|
|
|
3717
3737
|
});
|
|
3718
3738
|
}
|
|
3719
3739
|
} finally {
|
|
3720
|
-
this.
|
|
3721
|
-
this.
|
|
3722
|
-
this.
|
|
3740
|
+
this.Nt = this.isReady();
|
|
3741
|
+
this.At = this.isMinimallyReady();
|
|
3742
|
+
this.Ct = false;
|
|
3723
3743
|
}
|
|
3724
|
-
if (this.
|
|
3744
|
+
if (this.dt && (n !== this.Nt || i !== this.At)) this.dt.evaluate();
|
|
3725
3745
|
}
|
|
3726
3746
|
}
|
|
3727
3747
|
class CollectionQueue extends Queue {
|
|
3728
|
-
Pt;
|
|
3729
|
-
ct = new Set();
|
|
3730
3748
|
gt;
|
|
3731
|
-
ft =
|
|
3732
|
-
Et = signal(false, { ownedWrite: true, Ye: true });
|
|
3733
|
-
St = signal(false, { ownedWrite: true, Ye: true });
|
|
3734
|
-
dt;
|
|
3735
|
-
Ot = false;
|
|
3749
|
+
ft = new Set();
|
|
3736
3750
|
Dt;
|
|
3737
|
-
|
|
3751
|
+
Et = true;
|
|
3752
|
+
St = signal(false, { ownedWrite: true, Ye: true });
|
|
3753
|
+
Re;
|
|
3754
|
+
Tt = signal(false, { ownedWrite: true, Ye: true });
|
|
3755
|
+
Ot;
|
|
3756
|
+
_t = false;
|
|
3757
|
+
yt;
|
|
3758
|
+
vt = ON_INIT;
|
|
3738
3759
|
constructor(e) {
|
|
3739
3760
|
super();
|
|
3740
|
-
this.
|
|
3761
|
+
this.gt = e;
|
|
3741
3762
|
}
|
|
3742
3763
|
run(e) {
|
|
3743
|
-
if (!e || (read(this.
|
|
3764
|
+
if (!e || (read(this.St) && (!_revealUsed || read(this.Tt)))) return;
|
|
3744
3765
|
return super.run(e);
|
|
3745
3766
|
}
|
|
3746
3767
|
notify(e, t, n, i) {
|
|
3747
|
-
if (!(t & this.
|
|
3748
|
-
if (this.
|
|
3768
|
+
if (!(t & this.gt)) return super.notify(e, t, n, i);
|
|
3769
|
+
if (this._t && this.yt) {
|
|
3749
3770
|
const e = untrack(() => {
|
|
3750
3771
|
try {
|
|
3751
|
-
return this.
|
|
3772
|
+
return this.yt();
|
|
3752
3773
|
} catch {
|
|
3753
3774
|
return ON_INIT;
|
|
3754
3775
|
}
|
|
3755
3776
|
});
|
|
3756
|
-
if (e !== this.
|
|
3757
|
-
this.
|
|
3758
|
-
this.
|
|
3759
|
-
this.
|
|
3777
|
+
if (e !== this.vt) {
|
|
3778
|
+
this.vt = e;
|
|
3779
|
+
this._t = false;
|
|
3780
|
+
this.ft.clear();
|
|
3760
3781
|
}
|
|
3761
3782
|
}
|
|
3762
|
-
if (this.
|
|
3763
|
-
if (this.
|
|
3783
|
+
if (this.gt & STATUS_PENDING && this._t) return super.notify(e, t, n, i);
|
|
3784
|
+
if (this.gt & STATUS_PENDING && n & STATUS_ERROR) {
|
|
3764
3785
|
return super.notify(e, STATUS_ERROR, n, i);
|
|
3765
3786
|
}
|
|
3766
|
-
if (n & this.
|
|
3767
|
-
this.
|
|
3787
|
+
if (n & this.gt) {
|
|
3788
|
+
this.Et = true;
|
|
3768
3789
|
const t = i?.source || e.Re?.source;
|
|
3769
3790
|
if (t) {
|
|
3770
|
-
const e = this.
|
|
3771
|
-
this.
|
|
3772
|
-
if (e) setSignal(this.
|
|
3791
|
+
const e = this.ft.size === 0;
|
|
3792
|
+
this.ft.add(t);
|
|
3793
|
+
if (e) setSignal(this.St, true);
|
|
3794
|
+
if (this.gt & STATUS_ERROR) {
|
|
3795
|
+
setSignal(this.Re, t.Re?.cause ?? t.Re);
|
|
3796
|
+
}
|
|
3773
3797
|
}
|
|
3774
3798
|
}
|
|
3775
|
-
t &= ~this.
|
|
3799
|
+
t &= ~this.gt;
|
|
3776
3800
|
return t ? super.notify(e, t, n, i) : true;
|
|
3777
3801
|
}
|
|
3778
3802
|
checkSources() {
|
|
3779
|
-
for (const e of this.
|
|
3803
|
+
for (const e of this.ft) {
|
|
3780
3804
|
if (
|
|
3781
3805
|
e._ & REACTIVE_DISPOSED ||
|
|
3782
|
-
(!(e.he & this.
|
|
3806
|
+
(!(e.he & this.gt) && !(this.gt & STATUS_ERROR && e.he & STATUS_PENDING))
|
|
3783
3807
|
)
|
|
3784
|
-
this.
|
|
3808
|
+
this.ft.delete(e);
|
|
3785
3809
|
}
|
|
3786
|
-
if (!this.
|
|
3787
|
-
if (this.
|
|
3788
|
-
this.
|
|
3810
|
+
if (!this.ft.size) {
|
|
3811
|
+
if (this.gt & STATUS_PENDING && this.Et && !this._t && this.Dt) {
|
|
3812
|
+
this.Et = !!(this.Dt.he & this.gt);
|
|
3789
3813
|
} else {
|
|
3790
|
-
this.
|
|
3814
|
+
this.Et = false;
|
|
3791
3815
|
}
|
|
3792
|
-
if (!this.
|
|
3793
|
-
setSignal(this.
|
|
3794
|
-
if (this.
|
|
3816
|
+
if (!this.Et) {
|
|
3817
|
+
setSignal(this.St, false);
|
|
3818
|
+
if (this.yt) {
|
|
3795
3819
|
try {
|
|
3796
|
-
this.
|
|
3820
|
+
this.vt = untrack(() => this.yt());
|
|
3797
3821
|
} catch {}
|
|
3798
3822
|
}
|
|
3799
3823
|
}
|
|
3800
3824
|
}
|
|
3801
|
-
if (_revealUsed) this.
|
|
3825
|
+
if (_revealUsed) this.Ot?.evaluate();
|
|
3802
3826
|
}
|
|
3803
3827
|
}
|
|
3804
3828
|
function createCollectionBoundary(e, t, n, i) {
|
|
3805
3829
|
const r = createOwner();
|
|
3806
3830
|
if (_revealUsed) setContext(RevealControllerContext, null, r);
|
|
3807
3831
|
const s = new CollectionQueue(e);
|
|
3808
|
-
if (
|
|
3809
|
-
|
|
3832
|
+
if (e === STATUS_ERROR) s.Re = signal(undefined, { ownedWrite: true, Ye: true });
|
|
3833
|
+
if (i) s.yt = i;
|
|
3834
|
+
const o = (s.Dt = createBoundChildren(r, t, s, e));
|
|
3810
3835
|
untrack(() => {
|
|
3811
3836
|
let t = false;
|
|
3812
3837
|
try {
|
|
@@ -3815,21 +3840,21 @@ function createCollectionBoundary(e, t, n, i) {
|
|
|
3815
3840
|
if (e instanceof NotReadyError) t = true;
|
|
3816
3841
|
else throw e;
|
|
3817
3842
|
}
|
|
3818
|
-
s.
|
|
3843
|
+
s.Et = t || !!(o.he & e) || o.Re instanceof NotReadyError;
|
|
3819
3844
|
});
|
|
3820
3845
|
const u = _revealUsed && e === STATUS_PENDING ? getContext(RevealControllerContext) : null;
|
|
3821
3846
|
if (u) {
|
|
3822
|
-
s.
|
|
3847
|
+
s.Ot = u;
|
|
3823
3848
|
u.register(s);
|
|
3824
3849
|
cleanup(() => u.unregister(s));
|
|
3825
3850
|
}
|
|
3826
3851
|
return accessor(
|
|
3827
3852
|
computed(() => {
|
|
3828
|
-
if (!read(s.
|
|
3853
|
+
if (!read(s.St)) {
|
|
3829
3854
|
const e = read(o);
|
|
3830
|
-
if (!untrack(() => read(s.
|
|
3855
|
+
if (!untrack(() => read(s.St))) return ((s._t = true), e);
|
|
3831
3856
|
}
|
|
3832
|
-
if (_revealUsed && read(s.
|
|
3857
|
+
if (_revealUsed && read(s.Tt)) return undefined;
|
|
3833
3858
|
return n(s);
|
|
3834
3859
|
})
|
|
3835
3860
|
);
|
|
@@ -3838,14 +3863,12 @@ function createLoadingBoundary(e, t, n) {
|
|
|
3838
3863
|
return createCollectionBoundary(STATUS_PENDING, e, () => t(), n?.on);
|
|
3839
3864
|
}
|
|
3840
3865
|
function createErrorBoundary(e, t) {
|
|
3841
|
-
return createCollectionBoundary(STATUS_ERROR, e, e =>
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
return t(i, () => {
|
|
3845
|
-
for (const t of e.ct) recompute(t);
|
|
3866
|
+
return createCollectionBoundary(STATUS_ERROR, e, e =>
|
|
3867
|
+
t(accessor(e.Re), () => {
|
|
3868
|
+
for (const t of e.ft) recompute(t);
|
|
3846
3869
|
schedule();
|
|
3847
|
-
})
|
|
3848
|
-
|
|
3870
|
+
})
|
|
3871
|
+
);
|
|
3849
3872
|
}
|
|
3850
3873
|
function createRevealOrder(e, t) {
|
|
3851
3874
|
_revealUsed = true;
|
|
@@ -3863,7 +3886,7 @@ function createRevealOrder(e, t) {
|
|
|
3863
3886
|
o.evaluate();
|
|
3864
3887
|
});
|
|
3865
3888
|
if (i) {
|
|
3866
|
-
o.
|
|
3889
|
+
o.dt = i;
|
|
3867
3890
|
i.register(o);
|
|
3868
3891
|
cleanup(() => i.unregister(o));
|
|
3869
3892
|
}
|