@solidjs/signals 0.11.0 → 0.11.1
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 +6 -1
- package/dist/node.cjs +519 -514
- package/dist/prod.js +157 -152
- package/dist/types/core/constants.d.ts +1 -0
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -33,18 +33,19 @@ const o = 1 << 5;
|
|
|
33
33
|
const u = 1 << 6;
|
|
34
34
|
const f = 1 << 7;
|
|
35
35
|
const l = 1 << 8;
|
|
36
|
-
const c = 1 <<
|
|
37
|
-
const a = 1 <<
|
|
38
|
-
const d = 1 <<
|
|
39
|
-
const p = 1;
|
|
40
|
-
const h =
|
|
41
|
-
const y =
|
|
42
|
-
const g =
|
|
36
|
+
const c = 1 << 9;
|
|
37
|
+
const a = 1 << 0;
|
|
38
|
+
const d = 1 << 1;
|
|
39
|
+
const p = 1 << 2;
|
|
40
|
+
const h = 1;
|
|
41
|
+
const y = 2;
|
|
42
|
+
const g = 3;
|
|
43
43
|
const S = {};
|
|
44
|
-
const w =
|
|
44
|
+
const w = {};
|
|
45
|
+
const m = "sp";
|
|
45
46
|
const b = typeof Proxy === "function";
|
|
46
|
-
const
|
|
47
|
-
const
|
|
47
|
+
const _ = {};
|
|
48
|
+
const O = Symbol("refresh");
|
|
48
49
|
function actualInsertIntoHeap(e, t) {
|
|
49
50
|
const n = (e.i?.t ? e.i.u?.o : e.i?.o) ?? -1;
|
|
50
51
|
if (n >= e.o) e.o = n + 1;
|
|
@@ -141,15 +142,15 @@ function adjustHeight(e, t) {
|
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
|
-
const
|
|
145
|
-
const x = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
145
|
+
const x = new Set();
|
|
146
146
|
const v = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
147
|
-
|
|
148
|
-
let k =
|
|
149
|
-
let A =
|
|
147
|
+
const P = { l: new Array(2e3).fill(undefined), _: false, j: 0, S: 0 };
|
|
148
|
+
let k = 0;
|
|
149
|
+
let A = null;
|
|
150
150
|
let C = false;
|
|
151
|
+
let E = false;
|
|
151
152
|
function runLaneEffects(e) {
|
|
152
|
-
for (const t of
|
|
153
|
+
for (const t of N) {
|
|
153
154
|
if (t.H || t.T.size > 0) continue;
|
|
154
155
|
const n = t.M[e - 1];
|
|
155
156
|
if (n.length) {
|
|
@@ -159,18 +160,18 @@ function runLaneEffects(e) {
|
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
function setProjectionWriteActive(e) {
|
|
162
|
-
|
|
163
|
+
E = e;
|
|
163
164
|
}
|
|
164
165
|
function schedule() {
|
|
165
|
-
if (
|
|
166
|
-
|
|
167
|
-
if (!
|
|
166
|
+
if (C) return;
|
|
167
|
+
C = true;
|
|
168
|
+
if (!j.q) queueMicrotask(flush);
|
|
168
169
|
}
|
|
169
170
|
class Queue {
|
|
170
171
|
i = null;
|
|
171
172
|
F = [[], []];
|
|
172
173
|
V = [];
|
|
173
|
-
created =
|
|
174
|
+
created = k;
|
|
174
175
|
addChild(e) {
|
|
175
176
|
this.V.push(e);
|
|
176
177
|
e.i = this;
|
|
@@ -196,8 +197,8 @@ class Queue {
|
|
|
196
197
|
}
|
|
197
198
|
enqueue(e, t) {
|
|
198
199
|
if (e) {
|
|
199
|
-
if (
|
|
200
|
-
const n = findLane(
|
|
200
|
+
if (F) {
|
|
201
|
+
const n = findLane(F);
|
|
201
202
|
n.M[e - 1].push(t);
|
|
202
203
|
} else {
|
|
203
204
|
this.F[e - 1].push(t);
|
|
@@ -241,52 +242,52 @@ class GlobalQueue extends Queue {
|
|
|
241
242
|
if (this.q) return;
|
|
242
243
|
this.q = true;
|
|
243
244
|
try {
|
|
244
|
-
runHeap(
|
|
245
|
-
if (
|
|
246
|
-
const e = transitionComplete(
|
|
245
|
+
runHeap(v, GlobalQueue.K);
|
|
246
|
+
if (A) {
|
|
247
|
+
const e = transitionComplete(A);
|
|
247
248
|
if (!e) {
|
|
248
|
-
let e =
|
|
249
|
-
runHeap(
|
|
249
|
+
let e = A;
|
|
250
|
+
runHeap(P, GlobalQueue.K);
|
|
250
251
|
this.D = [];
|
|
251
252
|
this.B = [];
|
|
252
253
|
this.G = new Set();
|
|
253
|
-
runLaneEffects(p);
|
|
254
254
|
runLaneEffects(h);
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
255
|
+
runLaneEffects(y);
|
|
256
|
+
this.stashQueues(A.X);
|
|
257
|
+
k++;
|
|
258
|
+
C = v.S >= v.j;
|
|
259
|
+
reassignPendingTransition(A.D);
|
|
260
|
+
A = null;
|
|
260
261
|
finalizePureQueue(null, true);
|
|
261
262
|
return;
|
|
262
263
|
}
|
|
263
|
-
this.D !==
|
|
264
|
-
this.restoreQueues(
|
|
265
|
-
|
|
266
|
-
const t =
|
|
267
|
-
|
|
264
|
+
this.D !== A.D && this.D.push(...A.D);
|
|
265
|
+
this.restoreQueues(A.X);
|
|
266
|
+
x.delete(A);
|
|
267
|
+
const t = A;
|
|
268
|
+
A = null;
|
|
268
269
|
reassignPendingTransition(this.D);
|
|
269
270
|
finalizePureQueue(t);
|
|
270
271
|
} else {
|
|
271
|
-
if (
|
|
272
|
+
if (x.size) runHeap(P, GlobalQueue.K);
|
|
272
273
|
finalizePureQueue();
|
|
273
274
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
runLaneEffects(p);
|
|
277
|
-
this.run(p);
|
|
275
|
+
k++;
|
|
276
|
+
C = v.S >= v.j;
|
|
278
277
|
runLaneEffects(h);
|
|
279
278
|
this.run(h);
|
|
279
|
+
runLaneEffects(y);
|
|
280
|
+
this.run(y);
|
|
280
281
|
} finally {
|
|
281
282
|
this.q = false;
|
|
282
283
|
}
|
|
283
284
|
}
|
|
284
285
|
notify(e, t, n, r) {
|
|
285
|
-
if (t &
|
|
286
|
-
if (n &
|
|
286
|
+
if (t & a) {
|
|
287
|
+
if (n & a) {
|
|
287
288
|
const t = r !== undefined ? r : e.Y;
|
|
288
|
-
if (
|
|
289
|
-
|
|
289
|
+
if (A && t && !A.Z.includes(t.source)) {
|
|
290
|
+
A.Z.push(t.source);
|
|
290
291
|
schedule();
|
|
291
292
|
}
|
|
292
293
|
}
|
|
@@ -296,11 +297,11 @@ class GlobalQueue extends Queue {
|
|
|
296
297
|
}
|
|
297
298
|
initTransition(e) {
|
|
298
299
|
if (e) e = currentTransition(e);
|
|
299
|
-
if (e && e ===
|
|
300
|
-
if (!e &&
|
|
301
|
-
if (!
|
|
302
|
-
|
|
303
|
-
$:
|
|
300
|
+
if (e && e === A) return;
|
|
301
|
+
if (!e && A && A.$ === k) return;
|
|
302
|
+
if (!A) {
|
|
303
|
+
A = e ?? {
|
|
304
|
+
$: k,
|
|
304
305
|
D: [],
|
|
305
306
|
Z: [],
|
|
306
307
|
B: [],
|
|
@@ -310,42 +311,42 @@ class GlobalQueue extends Queue {
|
|
|
310
311
|
te: false
|
|
311
312
|
};
|
|
312
313
|
} else if (e) {
|
|
313
|
-
const t =
|
|
314
|
+
const t = A;
|
|
314
315
|
t.te = e;
|
|
315
316
|
e.ee.push(...t.ee);
|
|
316
|
-
for (const n of
|
|
317
|
+
for (const n of N) {
|
|
317
318
|
if (n.ne === t) n.ne = e;
|
|
318
319
|
}
|
|
319
320
|
e.B.push(...t.B);
|
|
320
321
|
for (const n of t.G) {
|
|
321
322
|
e.G.add(n);
|
|
322
323
|
}
|
|
323
|
-
|
|
324
|
-
|
|
324
|
+
x.delete(t);
|
|
325
|
+
A = e;
|
|
325
326
|
}
|
|
326
|
-
|
|
327
|
-
|
|
327
|
+
x.add(A);
|
|
328
|
+
A.$ = k;
|
|
328
329
|
for (let e = 0; e < this.D.length; e++) {
|
|
329
330
|
const t = this.D[e];
|
|
330
|
-
t.ne =
|
|
331
|
-
|
|
331
|
+
t.ne = A;
|
|
332
|
+
A.D.push(t);
|
|
332
333
|
}
|
|
333
|
-
this.D =
|
|
334
|
+
this.D = A.D;
|
|
334
335
|
for (let e = 0; e < this.B.length; e++) {
|
|
335
336
|
const t = this.B[e];
|
|
336
|
-
t.ne =
|
|
337
|
-
|
|
337
|
+
t.ne = A;
|
|
338
|
+
A.B.push(t);
|
|
338
339
|
}
|
|
339
|
-
this.B =
|
|
340
|
-
for (const e of
|
|
341
|
-
if (!e.ne) e.ne =
|
|
340
|
+
this.B = A.B;
|
|
341
|
+
for (const e of N) {
|
|
342
|
+
if (!e.ne) e.ne = A;
|
|
342
343
|
}
|
|
343
|
-
for (const e of this.G)
|
|
344
|
-
this.G =
|
|
344
|
+
for (const e of this.G) A.G.add(e);
|
|
345
|
+
this.G = A.G;
|
|
345
346
|
}
|
|
346
347
|
}
|
|
347
348
|
function insertSubs(e, t = false) {
|
|
348
|
-
const n = e.re ||
|
|
349
|
+
const n = e.re || F;
|
|
349
350
|
const r = e.ie !== undefined;
|
|
350
351
|
for (let i = e.O; i !== null; i = i.P) {
|
|
351
352
|
if (r && i.k.se) {
|
|
@@ -360,49 +361,49 @@ function insertSubs(e, t = false) {
|
|
|
360
361
|
i.k.re = undefined;
|
|
361
362
|
}
|
|
362
363
|
const e = i.k;
|
|
363
|
-
if (e.oe ===
|
|
364
|
+
if (e.oe === g) {
|
|
364
365
|
if (!e.ue) {
|
|
365
366
|
e.ue = true;
|
|
366
|
-
e.fe.enqueue(
|
|
367
|
+
e.fe.enqueue(y, e.le);
|
|
367
368
|
}
|
|
368
369
|
continue;
|
|
369
370
|
}
|
|
370
|
-
const s = i.k.m & o ?
|
|
371
|
+
const s = i.k.m & o ? P : v;
|
|
371
372
|
if (s.j > i.k.o) s.j = i.k.o;
|
|
372
373
|
insertIntoHeap(i.k, s);
|
|
373
374
|
}
|
|
374
375
|
}
|
|
375
376
|
function finalizePureQueue(e = null, t = false) {
|
|
376
377
|
let n = !t;
|
|
377
|
-
if (!t) checkBoundaryChildren(
|
|
378
|
-
if (
|
|
378
|
+
if (!t) checkBoundaryChildren(j);
|
|
379
|
+
if (v.S >= v.j) runHeap(v, GlobalQueue.K);
|
|
379
380
|
if (n) {
|
|
380
|
-
const t =
|
|
381
|
+
const t = j.D;
|
|
381
382
|
for (let e = 0; e < t.length; e++) {
|
|
382
383
|
const n = t[e];
|
|
383
|
-
if (n.ce !==
|
|
384
|
+
if (n.ce !== S) {
|
|
384
385
|
n.ae = n.ce;
|
|
385
|
-
n.ce =
|
|
386
|
-
if (n.oe && n.oe !==
|
|
386
|
+
n.ce = S;
|
|
387
|
+
if (n.oe && n.oe !== g) n.ue = true;
|
|
387
388
|
}
|
|
388
|
-
n.de &= ~
|
|
389
|
+
n.de &= ~p;
|
|
389
390
|
if (n.R) GlobalQueue.U(n, false, true);
|
|
390
391
|
}
|
|
391
392
|
t.length = 0;
|
|
392
|
-
const n = e ? e.B :
|
|
393
|
+
const n = e ? e.B : j.B;
|
|
393
394
|
for (let e = 0; e < n.length; e++) {
|
|
394
395
|
const t = n[e];
|
|
395
396
|
const r = t.ce;
|
|
396
397
|
t.re = undefined;
|
|
397
|
-
if (r !==
|
|
398
|
+
if (r !== S && t.ae !== r) {
|
|
398
399
|
t.ae = r;
|
|
399
400
|
insertSubs(t, true);
|
|
400
401
|
}
|
|
401
|
-
t.ce =
|
|
402
|
+
t.ce = S;
|
|
402
403
|
t.ne = null;
|
|
403
404
|
}
|
|
404
405
|
n.length = 0;
|
|
405
|
-
const r = e ? e.G :
|
|
406
|
+
const r = e ? e.G : j.G;
|
|
406
407
|
if (GlobalQueue.J && r.size) {
|
|
407
408
|
for (const e of r) {
|
|
408
409
|
GlobalQueue.J(e);
|
|
@@ -410,19 +411,19 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
410
411
|
r.clear();
|
|
411
412
|
schedule();
|
|
412
413
|
}
|
|
413
|
-
for (const t of
|
|
414
|
+
for (const t of N) {
|
|
414
415
|
const n = e ? t.ne === e : !t.ne;
|
|
415
416
|
if (!n) continue;
|
|
416
417
|
if (!t.H) {
|
|
417
|
-
if (t.M[0].length) runQueue(t.M[0],
|
|
418
|
-
if (t.M[1].length) runQueue(t.M[1],
|
|
418
|
+
if (t.M[0].length) runQueue(t.M[0], h);
|
|
419
|
+
if (t.M[1].length) runQueue(t.M[1], y);
|
|
419
420
|
}
|
|
420
421
|
if (t.pe.re === t) t.pe.re = undefined;
|
|
421
422
|
t.T.clear();
|
|
422
423
|
t.M[0].length = 0;
|
|
423
424
|
t.M[1].length = 0;
|
|
424
|
-
|
|
425
|
-
|
|
425
|
+
N.delete(t);
|
|
426
|
+
W.delete(t.pe);
|
|
426
427
|
}
|
|
427
428
|
}
|
|
428
429
|
}
|
|
@@ -433,18 +434,18 @@ function checkBoundaryChildren(e) {
|
|
|
433
434
|
}
|
|
434
435
|
}
|
|
435
436
|
function trackOptimisticStore(e) {
|
|
436
|
-
|
|
437
|
+
j.G.add(e);
|
|
437
438
|
schedule();
|
|
438
439
|
}
|
|
439
440
|
function reassignPendingTransition(e) {
|
|
440
441
|
for (let t = 0; t < e.length; t++) {
|
|
441
|
-
e[t].ne =
|
|
442
|
+
e[t].ne = A;
|
|
442
443
|
}
|
|
443
444
|
}
|
|
444
|
-
const
|
|
445
|
+
const j = new GlobalQueue();
|
|
445
446
|
function flush() {
|
|
446
|
-
while (
|
|
447
|
-
|
|
447
|
+
while (C) {
|
|
448
|
+
j.flush();
|
|
448
449
|
}
|
|
449
450
|
}
|
|
450
451
|
function runQueue(e, t) {
|
|
@@ -456,7 +457,7 @@ function transitionComplete(e) {
|
|
|
456
457
|
let t = true;
|
|
457
458
|
for (let n = 0; n < e.Z.length; n++) {
|
|
458
459
|
const r = e.Z[n];
|
|
459
|
-
if (r.de &
|
|
460
|
+
if (r.de & a && r.Y?.source === r) {
|
|
460
461
|
t = false;
|
|
461
462
|
break;
|
|
462
463
|
}
|
|
@@ -469,29 +470,29 @@ function currentTransition(e) {
|
|
|
469
470
|
return e;
|
|
470
471
|
}
|
|
471
472
|
function setActiveTransition(e) {
|
|
472
|
-
|
|
473
|
+
A = e;
|
|
473
474
|
}
|
|
474
475
|
function runInTransition(e, t) {
|
|
475
|
-
const n =
|
|
476
|
+
const n = A;
|
|
476
477
|
try {
|
|
477
|
-
|
|
478
|
+
A = currentTransition(e);
|
|
478
479
|
return t();
|
|
479
480
|
} finally {
|
|
480
|
-
|
|
481
|
+
A = n;
|
|
481
482
|
}
|
|
482
483
|
}
|
|
483
|
-
const
|
|
484
|
-
const
|
|
484
|
+
const W = new WeakMap();
|
|
485
|
+
const N = new Set();
|
|
485
486
|
function getOrCreateLane(e) {
|
|
486
|
-
let t =
|
|
487
|
+
let t = W.get(e);
|
|
487
488
|
if (t) {
|
|
488
489
|
return findLane(t);
|
|
489
490
|
}
|
|
490
491
|
const n = e.he;
|
|
491
492
|
const r = n?.re ? findLane(n.re) : null;
|
|
492
|
-
t = { pe: e, T: new Set(), M: [[], []], H: null, ne:
|
|
493
|
-
|
|
494
|
-
|
|
493
|
+
t = { pe: e, T: new Set(), M: [[], []], H: null, ne: A, ye: r };
|
|
494
|
+
W.set(e, t);
|
|
495
|
+
N.add(t);
|
|
495
496
|
e.ge = e.Se || 0;
|
|
496
497
|
return t;
|
|
497
498
|
}
|
|
@@ -513,12 +514,12 @@ function resolveLane(e) {
|
|
|
513
514
|
const t = e.re;
|
|
514
515
|
if (!t) return undefined;
|
|
515
516
|
const n = findLane(t);
|
|
516
|
-
if (
|
|
517
|
+
if (N.has(n)) return n;
|
|
517
518
|
e.re = undefined;
|
|
518
519
|
return undefined;
|
|
519
520
|
}
|
|
520
521
|
function hasActiveOverride(e) {
|
|
521
|
-
return !!(e.we && e.ce !==
|
|
522
|
+
return !!(e.we && e.ce !== S);
|
|
522
523
|
}
|
|
523
524
|
function assignOrMergeLane(e, t) {
|
|
524
525
|
const n = findLane(t);
|
|
@@ -529,7 +530,7 @@ function assignOrMergeLane(e, t) {
|
|
|
529
530
|
return;
|
|
530
531
|
}
|
|
531
532
|
const i = findLane(r);
|
|
532
|
-
if (
|
|
533
|
+
if (N.has(i)) {
|
|
533
534
|
if (i !== n && !hasActiveOverride(e)) {
|
|
534
535
|
if (n.ye && findLane(n.ye) === i) {
|
|
535
536
|
e.re = t;
|
|
@@ -546,39 +547,39 @@ function handleAsync(e, t, r) {
|
|
|
546
547
|
const s = i && untrack(() => t[Symbol.asyncIterator]);
|
|
547
548
|
const o = !s && i && untrack(() => typeof t.then === "function");
|
|
548
549
|
if (!o && !s) {
|
|
549
|
-
e.
|
|
550
|
+
e.me = null;
|
|
550
551
|
return t;
|
|
551
552
|
}
|
|
552
|
-
e.
|
|
553
|
+
e.me = t;
|
|
553
554
|
let u;
|
|
554
555
|
const handleError = n => {
|
|
555
|
-
if (e.
|
|
556
|
-
|
|
557
|
-
notifyStatus(e, n instanceof NotReadyError ?
|
|
558
|
-
e.$ =
|
|
556
|
+
if (e.me !== t) return;
|
|
557
|
+
j.initTransition(e.ne);
|
|
558
|
+
notifyStatus(e, n instanceof NotReadyError ? a : d, n);
|
|
559
|
+
e.$ = k;
|
|
559
560
|
};
|
|
560
561
|
const asyncWrite = (i, s) => {
|
|
561
|
-
if (e.
|
|
562
|
+
if (e.me !== t) return;
|
|
562
563
|
if (e.m & (n | f)) return;
|
|
563
|
-
|
|
564
|
+
j.initTransition(e.ne);
|
|
564
565
|
clearStatus(e);
|
|
565
566
|
const o = resolveLane(e);
|
|
566
567
|
if (o) o.T.delete(e);
|
|
567
568
|
if (r) r(i);
|
|
568
569
|
else if (e.we) {
|
|
569
|
-
const t = e.ce !==
|
|
570
|
+
const t = e.ce !== S;
|
|
570
571
|
if (e.R) e.ce = i;
|
|
571
572
|
if (!t) {
|
|
572
573
|
e.ae = i;
|
|
573
574
|
insertSubs(e);
|
|
574
575
|
}
|
|
575
|
-
e.$ =
|
|
576
|
+
e.$ = k;
|
|
576
577
|
} else if (o) {
|
|
577
578
|
const t = e.ae;
|
|
578
|
-
const n = e.
|
|
579
|
+
const n = e.be;
|
|
579
580
|
if (!n || !n(i, t)) {
|
|
580
581
|
e.ae = i;
|
|
581
|
-
e.$ =
|
|
582
|
+
e.$ = k;
|
|
582
583
|
if (e._e) {
|
|
583
584
|
setSignal(e._e, i);
|
|
584
585
|
}
|
|
@@ -607,8 +608,8 @@ function handleAsync(e, t, r) {
|
|
|
607
608
|
);
|
|
608
609
|
r = false;
|
|
609
610
|
if (!n) {
|
|
610
|
-
|
|
611
|
-
throw new NotReadyError(
|
|
611
|
+
j.initTransition(e.ne);
|
|
612
|
+
throw new NotReadyError(q);
|
|
612
613
|
}
|
|
613
614
|
}
|
|
614
615
|
if (s) {
|
|
@@ -639,36 +640,36 @@ function handleAsync(e, t, r) {
|
|
|
639
640
|
};
|
|
640
641
|
const i = iterate();
|
|
641
642
|
if (!r && !i) {
|
|
642
|
-
|
|
643
|
-
throw new NotReadyError(
|
|
643
|
+
j.initTransition(e.ne);
|
|
644
|
+
throw new NotReadyError(q);
|
|
644
645
|
}
|
|
645
646
|
}
|
|
646
647
|
return u;
|
|
647
648
|
}
|
|
648
649
|
function clearStatus(e) {
|
|
649
|
-
e.de = e.de &
|
|
650
|
+
e.de = e.de & p;
|
|
650
651
|
e.Y = null;
|
|
651
652
|
updatePendingSignal(e);
|
|
652
653
|
e.Oe?.();
|
|
653
654
|
}
|
|
654
655
|
function notifyStatus(e, t, n, r, i) {
|
|
655
|
-
if (t ===
|
|
656
|
+
if (t === d && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
656
657
|
n = new StatusError(e, n);
|
|
657
658
|
const s = n instanceof NotReadyError && n.source === e;
|
|
658
|
-
const o = t ===
|
|
659
|
+
const o = t === a && e.we && !s;
|
|
659
660
|
const u = o && hasActiveOverride(e);
|
|
660
661
|
if (!r) {
|
|
661
|
-
e.de = t | (t !==
|
|
662
|
+
e.de = t | (t !== d ? e.de & p : 0);
|
|
662
663
|
e.Y = n;
|
|
663
664
|
updatePendingSignal(e);
|
|
664
665
|
}
|
|
665
666
|
if (i && !r) {
|
|
666
667
|
assignOrMergeLane(e, i);
|
|
667
668
|
}
|
|
668
|
-
if (u &&
|
|
669
|
+
if (u && A && n instanceof NotReadyError) {
|
|
669
670
|
const e = n.source;
|
|
670
|
-
if (!
|
|
671
|
-
|
|
671
|
+
if (!A.Z.includes(e)) {
|
|
672
|
+
A.Z.push(e);
|
|
672
673
|
}
|
|
673
674
|
}
|
|
674
675
|
const f = r || u;
|
|
@@ -682,17 +683,17 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
682
683
|
return;
|
|
683
684
|
}
|
|
684
685
|
for (let r = e.O; r !== null; r = r.P) {
|
|
685
|
-
r.k.$ =
|
|
686
|
+
r.k.$ = k;
|
|
686
687
|
if (r.k.Y !== n) {
|
|
687
|
-
!r.k.ne &&
|
|
688
|
+
!r.k.ne && j.D.push(r.k);
|
|
688
689
|
notifyStatus(r.k, t, n, f, l);
|
|
689
690
|
}
|
|
690
691
|
}
|
|
691
692
|
for (let r = e.A; r !== null; r = r.C) {
|
|
692
693
|
for (let e = r.O; e !== null; e = e.P) {
|
|
693
|
-
e.k.$ =
|
|
694
|
+
e.k.$ = k;
|
|
694
695
|
if (e.k.Y !== n) {
|
|
695
|
-
!e.k.ne &&
|
|
696
|
+
!e.k.ne && j.D.push(e.k);
|
|
696
697
|
notifyStatus(e.k, t, n, f, l);
|
|
697
698
|
}
|
|
698
699
|
}
|
|
@@ -716,7 +717,7 @@ function unlinkSubs(e) {
|
|
|
716
717
|
return n;
|
|
717
718
|
}
|
|
718
719
|
function unobserved(e) {
|
|
719
|
-
deleteFromHeap(e, e.m & o ?
|
|
720
|
+
deleteFromHeap(e, e.m & o ? P : v);
|
|
720
721
|
let t = e.W;
|
|
721
722
|
while (t !== null) {
|
|
722
723
|
t = unlinkSubs(t);
|
|
@@ -756,14 +757,14 @@ function isValidLink(e, t) {
|
|
|
756
757
|
}
|
|
757
758
|
return false;
|
|
758
759
|
}
|
|
759
|
-
const
|
|
760
|
+
const L = {};
|
|
760
761
|
function markDisposal(e) {
|
|
761
762
|
let t = e.Ce;
|
|
762
763
|
while (t) {
|
|
763
764
|
t.m |= o;
|
|
764
765
|
if (t.m & i) {
|
|
765
|
-
deleteFromHeap(t,
|
|
766
|
-
insertIntoHeap(t,
|
|
766
|
+
deleteFromHeap(t, v);
|
|
767
|
+
insertIntoHeap(t, P);
|
|
767
768
|
}
|
|
768
769
|
markDisposal(t);
|
|
769
770
|
t = t.Ee;
|
|
@@ -786,7 +787,7 @@ function disposeChildren(e, t = false, n) {
|
|
|
786
787
|
const e = r.Ee;
|
|
787
788
|
if (r.W) {
|
|
788
789
|
const e = r;
|
|
789
|
-
deleteFromHeap(e, e.m & o ?
|
|
790
|
+
deleteFromHeap(e, e.m & o ? P : v);
|
|
790
791
|
let t = e.W;
|
|
791
792
|
do {
|
|
792
793
|
t = unlinkSubs(t);
|
|
@@ -837,24 +838,24 @@ function formatId(e, t) {
|
|
|
837
838
|
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
838
839
|
}
|
|
839
840
|
function getObserver() {
|
|
840
|
-
if (
|
|
841
|
-
return
|
|
841
|
+
if (Q || M) return L;
|
|
842
|
+
return I ? q : null;
|
|
842
843
|
}
|
|
843
844
|
function getOwner() {
|
|
844
|
-
return
|
|
845
|
+
return q;
|
|
845
846
|
}
|
|
846
847
|
function onCleanup(e) {
|
|
847
|
-
if (!
|
|
848
|
-
if (!
|
|
849
|
-
else if (Array.isArray(
|
|
850
|
-
else
|
|
848
|
+
if (!q) return e;
|
|
849
|
+
if (!q.Le) q.Le = e;
|
|
850
|
+
else if (Array.isArray(q.Le)) q.Le.push(e);
|
|
851
|
+
else q.Le = [q.Le, e];
|
|
851
852
|
return e;
|
|
852
853
|
}
|
|
853
854
|
function isDisposed(e) {
|
|
854
855
|
return !!(e.m & (u | o));
|
|
855
856
|
}
|
|
856
857
|
function createOwner(e) {
|
|
857
|
-
const t =
|
|
858
|
+
const t = q;
|
|
858
859
|
const n = e?.transparent ?? false;
|
|
859
860
|
const r = {
|
|
860
861
|
id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
|
|
@@ -864,8 +865,8 @@ function createOwner(e) {
|
|
|
864
865
|
Ce: null,
|
|
865
866
|
Ee: null,
|
|
866
867
|
Le: null,
|
|
867
|
-
fe: t?.fe ??
|
|
868
|
-
Re: t?.Re ||
|
|
868
|
+
fe: t?.fe ?? j,
|
|
869
|
+
Re: t?.Re || _,
|
|
869
870
|
We: 0,
|
|
870
871
|
Ne: null,
|
|
871
872
|
je: null,
|
|
@@ -904,14 +905,14 @@ function effect(e, t, n, r, i) {
|
|
|
904
905
|
o.Qe = t;
|
|
905
906
|
o.Te = n;
|
|
906
907
|
o.Me = undefined;
|
|
907
|
-
o.oe = i?.render ?
|
|
908
|
+
o.oe = i?.render ? h : y;
|
|
908
909
|
o.Oe = (e, t) => {
|
|
909
910
|
const n = e !== undefined ? e : o.de;
|
|
910
911
|
const r = t !== undefined ? t : o.Y;
|
|
911
|
-
if (n &
|
|
912
|
+
if (n & d) {
|
|
912
913
|
let e = r;
|
|
913
|
-
o.fe.notify(o,
|
|
914
|
-
if (o.oe ===
|
|
914
|
+
o.fe.notify(o, a, 0);
|
|
915
|
+
if (o.oe === y) {
|
|
915
916
|
try {
|
|
916
917
|
return o.Te
|
|
917
918
|
? o.Te(e, () => {
|
|
@@ -923,11 +924,11 @@ function effect(e, t, n, r, i) {
|
|
|
923
924
|
e = t;
|
|
924
925
|
}
|
|
925
926
|
}
|
|
926
|
-
if (!o.fe.notify(o,
|
|
927
|
-
} else if (o.oe ===
|
|
927
|
+
if (!o.fe.notify(o, d, d)) throw e;
|
|
928
|
+
} else if (o.oe === h) o.fe.notify(o, a | d, n, r);
|
|
928
929
|
};
|
|
929
930
|
recompute(o, true);
|
|
930
|
-
!i?.defer && (o.oe ===
|
|
931
|
+
!i?.defer && (o.oe === y ? o.fe.enqueue(o.oe, runEffect.bind(o)) : runEffect.call(o));
|
|
931
932
|
s = true;
|
|
932
933
|
onCleanup(() => o.Me?.());
|
|
933
934
|
}
|
|
@@ -938,7 +939,7 @@ function runEffect() {
|
|
|
938
939
|
try {
|
|
939
940
|
this.Me = this.Qe(this.ae, this.He);
|
|
940
941
|
} catch (e) {
|
|
941
|
-
if (!this.fe.notify(this,
|
|
942
|
+
if (!this.fe.notify(this, d, d)) throw e;
|
|
942
943
|
} finally {
|
|
943
944
|
this.He = this.ae;
|
|
944
945
|
this.ue = false;
|
|
@@ -964,23 +965,23 @@ function trackedEffect(e, t) {
|
|
|
964
965
|
);
|
|
965
966
|
n.Me = undefined;
|
|
966
967
|
n.ue = true;
|
|
967
|
-
n.oe =
|
|
968
|
+
n.oe = g;
|
|
968
969
|
n.le = run;
|
|
969
|
-
n.fe.enqueue(
|
|
970
|
+
n.fe.enqueue(y, run);
|
|
970
971
|
onCleanup(() => n.Me?.());
|
|
971
972
|
}
|
|
972
973
|
GlobalQueue.K = recompute;
|
|
973
974
|
GlobalQueue.U = disposeChildren;
|
|
974
|
-
let L = false;
|
|
975
975
|
let I = false;
|
|
976
976
|
let R = false;
|
|
977
977
|
let H = false;
|
|
978
978
|
let Q = false;
|
|
979
979
|
let T = false;
|
|
980
|
-
let M =
|
|
980
|
+
let M = false;
|
|
981
981
|
let q = null;
|
|
982
|
-
let F =
|
|
983
|
-
let V =
|
|
982
|
+
let F = null;
|
|
983
|
+
let V = false;
|
|
984
|
+
let D = null;
|
|
984
985
|
function ownerInSnapshotScope(e) {
|
|
985
986
|
while (e) {
|
|
986
987
|
if (e.qe) return true;
|
|
@@ -989,8 +990,8 @@ function ownerInSnapshotScope(e) {
|
|
|
989
990
|
return false;
|
|
990
991
|
}
|
|
991
992
|
function setSnapshotCapture(e) {
|
|
992
|
-
|
|
993
|
-
if (e && !
|
|
993
|
+
V = e;
|
|
994
|
+
if (e && !D) D = new Set();
|
|
994
995
|
}
|
|
995
996
|
function markSnapshotScope(e) {
|
|
996
997
|
e.qe = true;
|
|
@@ -1013,8 +1014,8 @@ function releaseSubtree(e) {
|
|
|
1013
1014
|
if (e.m & l) {
|
|
1014
1015
|
e.m &= ~l;
|
|
1015
1016
|
e.m |= n;
|
|
1016
|
-
if (
|
|
1017
|
-
insertIntoHeap(e,
|
|
1017
|
+
if (v.j > e.o) v.j = e.o;
|
|
1018
|
+
insertIntoHeap(e, v);
|
|
1018
1019
|
}
|
|
1019
1020
|
}
|
|
1020
1021
|
releaseSubtree(t);
|
|
@@ -1022,21 +1023,21 @@ function releaseSubtree(e) {
|
|
|
1022
1023
|
}
|
|
1023
1024
|
}
|
|
1024
1025
|
function clearSnapshots() {
|
|
1025
|
-
if (
|
|
1026
|
-
for (const e of
|
|
1026
|
+
if (D) {
|
|
1027
|
+
for (const e of D) {
|
|
1027
1028
|
delete e.ie;
|
|
1028
|
-
delete e[
|
|
1029
|
+
delete e[m];
|
|
1029
1030
|
}
|
|
1030
|
-
|
|
1031
|
+
D = null;
|
|
1031
1032
|
}
|
|
1032
|
-
|
|
1033
|
+
V = false;
|
|
1033
1034
|
}
|
|
1034
1035
|
function recompute(t, n = false) {
|
|
1035
1036
|
const i = t.oe;
|
|
1036
1037
|
if (!n) {
|
|
1037
|
-
if (t.ne && (!i ||
|
|
1038
|
-
deleteFromHeap(t, t.m & o ?
|
|
1039
|
-
if (t.ne || i ===
|
|
1038
|
+
if (t.ne && (!i || A) && A !== t.ne) j.initTransition(t.ne);
|
|
1039
|
+
deleteFromHeap(t, t.m & o ? P : v);
|
|
1040
|
+
if (t.ne || i === g) disposeChildren(t);
|
|
1040
1041
|
else {
|
|
1041
1042
|
markDisposal(t);
|
|
1042
1043
|
t.Ne = t.Le;
|
|
@@ -1048,20 +1049,20 @@ function recompute(t, n = false) {
|
|
|
1048
1049
|
}
|
|
1049
1050
|
const s = !!(t.m & f);
|
|
1050
1051
|
const u = hasActiveOverride(t);
|
|
1051
|
-
const
|
|
1052
|
-
const p =
|
|
1053
|
-
|
|
1052
|
+
const c = !!(t.de & a);
|
|
1053
|
+
const p = q;
|
|
1054
|
+
q = t;
|
|
1054
1055
|
t.Ae = null;
|
|
1055
1056
|
t.m = r;
|
|
1056
|
-
t.$ =
|
|
1057
|
-
let h = t.ce ===
|
|
1058
|
-
let
|
|
1059
|
-
let w =
|
|
1060
|
-
let
|
|
1061
|
-
|
|
1057
|
+
t.$ = k;
|
|
1058
|
+
let h = t.ce === S ? t.ae : t.ce;
|
|
1059
|
+
let y = t.o;
|
|
1060
|
+
let w = I;
|
|
1061
|
+
let m = F;
|
|
1062
|
+
I = true;
|
|
1062
1063
|
if (s) {
|
|
1063
1064
|
const e = resolveLane(t);
|
|
1064
|
-
if (e)
|
|
1065
|
+
if (e) F = e;
|
|
1065
1066
|
}
|
|
1066
1067
|
try {
|
|
1067
1068
|
h = handleAsync(t, t.R(h));
|
|
@@ -1072,8 +1073,8 @@ function recompute(t, n = false) {
|
|
|
1072
1073
|
updatePendingSignal(e.pe);
|
|
1073
1074
|
}
|
|
1074
1075
|
} catch (e) {
|
|
1075
|
-
if (e instanceof NotReadyError &&
|
|
1076
|
-
const e = findLane(
|
|
1076
|
+
if (e instanceof NotReadyError && F) {
|
|
1077
|
+
const e = findLane(F);
|
|
1077
1078
|
if (e.pe !== t) {
|
|
1078
1079
|
e.T.add(t);
|
|
1079
1080
|
t.re = e;
|
|
@@ -1082,15 +1083,15 @@ function recompute(t, n = false) {
|
|
|
1082
1083
|
}
|
|
1083
1084
|
notifyStatus(
|
|
1084
1085
|
t,
|
|
1085
|
-
e instanceof NotReadyError ?
|
|
1086
|
+
e instanceof NotReadyError ? a : d,
|
|
1086
1087
|
e,
|
|
1087
1088
|
undefined,
|
|
1088
1089
|
e instanceof NotReadyError ? t.re : undefined
|
|
1089
1090
|
);
|
|
1090
1091
|
} finally {
|
|
1091
|
-
|
|
1092
|
+
I = w;
|
|
1092
1093
|
t.m = e | (n ? t.m & l : 0);
|
|
1093
|
-
|
|
1094
|
+
q = p;
|
|
1094
1095
|
}
|
|
1095
1096
|
if (!t.Y) {
|
|
1096
1097
|
const e = t.Ae;
|
|
@@ -1102,13 +1103,13 @@ function recompute(t, n = false) {
|
|
|
1102
1103
|
if (e !== null) e.N = null;
|
|
1103
1104
|
else t.W = null;
|
|
1104
1105
|
}
|
|
1105
|
-
const f = u ? t.ae : t.ce ===
|
|
1106
|
-
const l = !t.
|
|
1106
|
+
const f = u ? t.ae : t.ce === S ? t.ae : t.ce;
|
|
1107
|
+
const l = !t.be || !t.be(f, h);
|
|
1107
1108
|
if (l) {
|
|
1108
1109
|
const e = u ? t.ae : undefined;
|
|
1109
|
-
if (n || (i &&
|
|
1110
|
+
if (n || (i && A !== t.ne) || s) t.ae = h;
|
|
1110
1111
|
else t.ce = h;
|
|
1111
|
-
if (u && !s &&
|
|
1112
|
+
if (u && !s && c) {
|
|
1112
1113
|
const e = t.Se || 0;
|
|
1113
1114
|
const n = t.ge || 0;
|
|
1114
1115
|
if (e <= n) t.ae = h;
|
|
@@ -1118,15 +1119,15 @@ function recompute(t, n = false) {
|
|
|
1118
1119
|
}
|
|
1119
1120
|
} else if (u) {
|
|
1120
1121
|
t.ce = h;
|
|
1121
|
-
} else if (t.o !=
|
|
1122
|
+
} else if (t.o != y) {
|
|
1122
1123
|
for (let e = t.O; e !== null; e = e.P) {
|
|
1123
|
-
insertIntoHeapHeight(e.k, e.k.m & o ?
|
|
1124
|
+
insertIntoHeapHeight(e.k, e.k.m & o ? P : v);
|
|
1124
1125
|
}
|
|
1125
1126
|
}
|
|
1126
1127
|
}
|
|
1127
|
-
|
|
1128
|
-
(!n || t.de &
|
|
1129
|
-
t.ne && i &&
|
|
1128
|
+
F = m;
|
|
1129
|
+
(!n || t.de & a) && !t.ne && !(A && t.we) && j.D.push(t);
|
|
1130
|
+
t.ne && i && A !== t.ne && runInTransition(t.ne, () => recompute(t));
|
|
1130
1131
|
}
|
|
1131
1132
|
function updateIfNecessary(r) {
|
|
1132
1133
|
if (r.m & t) {
|
|
@@ -1141,7 +1142,7 @@ function updateIfNecessary(r) {
|
|
|
1141
1142
|
}
|
|
1142
1143
|
}
|
|
1143
1144
|
}
|
|
1144
|
-
if (r.m & (n | f) || (r.Y && r.$ <
|
|
1145
|
+
if (r.m & (n | f) || (r.Y && r.$ < k)) {
|
|
1145
1146
|
recompute(r);
|
|
1146
1147
|
}
|
|
1147
1148
|
r.m = e | (r.m & l);
|
|
@@ -1149,14 +1150,14 @@ function updateIfNecessary(r) {
|
|
|
1149
1150
|
function computed(t, n, r) {
|
|
1150
1151
|
const i = r?.transparent ?? false;
|
|
1151
1152
|
const s = {
|
|
1152
|
-
id: r?.id ?? (i ?
|
|
1153
|
+
id: r?.id ?? (i ? q?.id : q?.id != null ? getNextChildId(q) : undefined),
|
|
1153
1154
|
Ie: i || undefined,
|
|
1154
|
-
|
|
1155
|
+
be: r?.equals != null ? r.equals : isEqual,
|
|
1155
1156
|
Fe: !!r?.pureWrite,
|
|
1156
1157
|
Pe: r?.unobserved,
|
|
1157
1158
|
Le: null,
|
|
1158
|
-
fe:
|
|
1159
|
-
Re:
|
|
1159
|
+
fe: q?.fe ?? j,
|
|
1160
|
+
Re: q?.Re ?? _,
|
|
1160
1161
|
We: 0,
|
|
1161
1162
|
R: t,
|
|
1162
1163
|
ae: n,
|
|
@@ -1168,57 +1169,57 @@ function computed(t, n, r) {
|
|
|
1168
1169
|
Ae: null,
|
|
1169
1170
|
O: null,
|
|
1170
1171
|
ve: null,
|
|
1171
|
-
i:
|
|
1172
|
+
i: q,
|
|
1172
1173
|
Ee: null,
|
|
1173
1174
|
Ce: null,
|
|
1174
|
-
m: e,
|
|
1175
|
-
de:
|
|
1176
|
-
$:
|
|
1177
|
-
ce:
|
|
1175
|
+
m: r?.lazy ? c : e,
|
|
1176
|
+
de: p,
|
|
1177
|
+
$: k,
|
|
1178
|
+
ce: S,
|
|
1178
1179
|
Ne: null,
|
|
1179
1180
|
je: null,
|
|
1180
|
-
|
|
1181
|
+
me: null,
|
|
1181
1182
|
ne: null
|
|
1182
1183
|
};
|
|
1183
1184
|
s.p = s;
|
|
1184
|
-
const o =
|
|
1185
|
-
if (
|
|
1186
|
-
const e =
|
|
1185
|
+
const o = q?.t ? q.u : q;
|
|
1186
|
+
if (q) {
|
|
1187
|
+
const e = q.Ce;
|
|
1187
1188
|
if (e === null) {
|
|
1188
|
-
|
|
1189
|
+
q.Ce = s;
|
|
1189
1190
|
} else {
|
|
1190
1191
|
s.Ee = e;
|
|
1191
|
-
|
|
1192
|
+
q.Ce = s;
|
|
1192
1193
|
}
|
|
1193
1194
|
}
|
|
1194
1195
|
if (o) s.o = o.o + 1;
|
|
1195
|
-
if (
|
|
1196
|
+
if (V && ownerInSnapshotScope(q)) s.se = true;
|
|
1196
1197
|
!r?.lazy && recompute(s, true);
|
|
1197
|
-
if (
|
|
1198
|
-
if (!(s.de &
|
|
1199
|
-
s.ie = s.ae === undefined ?
|
|
1200
|
-
|
|
1198
|
+
if (V && !r?.lazy) {
|
|
1199
|
+
if (!(s.de & a)) {
|
|
1200
|
+
s.ie = s.ae === undefined ? w : s.ae;
|
|
1201
|
+
D.add(s);
|
|
1201
1202
|
}
|
|
1202
1203
|
}
|
|
1203
1204
|
return s;
|
|
1204
1205
|
}
|
|
1205
1206
|
function signal(e, t, n = null) {
|
|
1206
1207
|
const r = {
|
|
1207
|
-
|
|
1208
|
+
be: t?.equals != null ? t.equals : isEqual,
|
|
1208
1209
|
Fe: !!t?.pureWrite,
|
|
1209
1210
|
Pe: t?.unobserved,
|
|
1210
1211
|
ae: e,
|
|
1211
1212
|
O: null,
|
|
1212
1213
|
ve: null,
|
|
1213
|
-
$:
|
|
1214
|
+
$: k,
|
|
1214
1215
|
I: n,
|
|
1215
1216
|
C: n?.A || null,
|
|
1216
|
-
ce:
|
|
1217
|
+
ce: S
|
|
1217
1218
|
};
|
|
1218
1219
|
n && (n.A = r);
|
|
1219
|
-
if (
|
|
1220
|
-
r.ie = e === undefined ?
|
|
1221
|
-
|
|
1220
|
+
if (V && !r.Fe) {
|
|
1221
|
+
r.ie = e === undefined ? w : e;
|
|
1222
|
+
D.add(r);
|
|
1222
1223
|
}
|
|
1223
1224
|
return r;
|
|
1224
1225
|
}
|
|
@@ -1235,68 +1236,72 @@ function optimisticComputed(e, t, n) {
|
|
|
1235
1236
|
function isEqual(e, t) {
|
|
1236
1237
|
return e === t;
|
|
1237
1238
|
}
|
|
1238
|
-
let
|
|
1239
|
+
let B = false;
|
|
1239
1240
|
function setStrictRead(e) {
|
|
1240
|
-
const t =
|
|
1241
|
-
|
|
1241
|
+
const t = B;
|
|
1242
|
+
B = e;
|
|
1242
1243
|
return t;
|
|
1243
1244
|
}
|
|
1244
1245
|
function untrack(e) {
|
|
1245
|
-
if (!
|
|
1246
|
-
|
|
1246
|
+
if (!I && true) return e();
|
|
1247
|
+
I = false;
|
|
1247
1248
|
try {
|
|
1248
1249
|
return e();
|
|
1249
1250
|
} finally {
|
|
1250
|
-
|
|
1251
|
+
I = true;
|
|
1251
1252
|
}
|
|
1252
1253
|
}
|
|
1253
1254
|
function read(e) {
|
|
1254
|
-
if (
|
|
1255
|
+
if (M) {
|
|
1255
1256
|
const t = getLatestValueComputed(e);
|
|
1256
|
-
const n =
|
|
1257
|
-
|
|
1257
|
+
const n = M;
|
|
1258
|
+
M = false;
|
|
1258
1259
|
let r;
|
|
1259
1260
|
try {
|
|
1260
1261
|
r = read(t);
|
|
1261
1262
|
} catch (t) {
|
|
1262
|
-
if (!
|
|
1263
|
+
if (!q && t instanceof NotReadyError) return e.ae;
|
|
1263
1264
|
throw t;
|
|
1264
1265
|
} finally {
|
|
1265
|
-
|
|
1266
|
+
M = n;
|
|
1266
1267
|
}
|
|
1267
|
-
if (t.de &
|
|
1268
|
-
if (
|
|
1268
|
+
if (t.de & a) return e.ae;
|
|
1269
|
+
if (R && F && t.re) {
|
|
1269
1270
|
const n = findLane(t.re);
|
|
1270
|
-
const r = findLane(
|
|
1271
|
+
const r = findLane(F);
|
|
1271
1272
|
if (n !== r && n.T.size > 0) {
|
|
1272
1273
|
return e.ae;
|
|
1273
1274
|
}
|
|
1274
1275
|
}
|
|
1275
1276
|
return r;
|
|
1276
1277
|
}
|
|
1277
|
-
if (
|
|
1278
|
+
if (Q) {
|
|
1278
1279
|
const t = e.I || e;
|
|
1279
1280
|
const n = getPendingSignal(t);
|
|
1280
|
-
const r =
|
|
1281
|
-
|
|
1281
|
+
const r = Q;
|
|
1282
|
+
Q = false;
|
|
1282
1283
|
if (read(n)) {
|
|
1283
|
-
|
|
1284
|
+
T = true;
|
|
1284
1285
|
}
|
|
1285
|
-
|
|
1286
|
+
Q = r;
|
|
1286
1287
|
return e.ae;
|
|
1287
1288
|
}
|
|
1288
|
-
let t =
|
|
1289
|
+
let t = q;
|
|
1289
1290
|
if (t?.t) t = t.u;
|
|
1290
|
-
if (
|
|
1291
|
-
if (
|
|
1291
|
+
if (H && e.R) recompute(e);
|
|
1292
|
+
if (e.m & c) {
|
|
1293
|
+
e.m &= ~c;
|
|
1294
|
+
recompute(e, true);
|
|
1295
|
+
}
|
|
1296
|
+
if (t && I) {
|
|
1292
1297
|
if (e.R && e.m & u) recompute(e);
|
|
1293
1298
|
link(e, t);
|
|
1294
1299
|
const n = e.I || e;
|
|
1295
1300
|
if (n.R) {
|
|
1296
1301
|
const r = e.m & o;
|
|
1297
|
-
if (n.o >= (r ?
|
|
1302
|
+
if (n.o >= (r ? P.j : v.j)) {
|
|
1298
1303
|
markNode(t);
|
|
1299
|
-
markHeap(r ?
|
|
1304
|
+
markHeap(r ? P : v);
|
|
1300
1305
|
updateIfNecessary(n);
|
|
1301
1306
|
}
|
|
1302
1307
|
const i = n.o;
|
|
@@ -1306,91 +1311,91 @@ function read(e) {
|
|
|
1306
1311
|
}
|
|
1307
1312
|
}
|
|
1308
1313
|
const n = e.I || e;
|
|
1309
|
-
if (n.de &
|
|
1310
|
-
if (t && !(
|
|
1311
|
-
if (
|
|
1314
|
+
if (n.de & a) {
|
|
1315
|
+
if (t && !(R && n.ne && A !== n.ne)) {
|
|
1316
|
+
if (F) {
|
|
1312
1317
|
const r = n.re;
|
|
1313
|
-
const i = findLane(
|
|
1318
|
+
const i = findLane(F);
|
|
1314
1319
|
if (r && findLane(r) === i && !hasActiveOverride(n)) {
|
|
1315
|
-
if (!
|
|
1320
|
+
if (!I) link(e, t);
|
|
1316
1321
|
throw n.Y;
|
|
1317
1322
|
}
|
|
1318
1323
|
} else {
|
|
1319
|
-
if (!
|
|
1324
|
+
if (!I) link(e, t);
|
|
1320
1325
|
throw n.Y;
|
|
1321
1326
|
}
|
|
1322
|
-
} else if (!t && n.de &
|
|
1327
|
+
} else if (!t && n.de & p) {
|
|
1323
1328
|
throw n.Y;
|
|
1324
1329
|
}
|
|
1325
1330
|
}
|
|
1326
|
-
if (e.R && e.de &
|
|
1327
|
-
if (e.$ <
|
|
1331
|
+
if (e.R && e.de & d) {
|
|
1332
|
+
if (e.$ < k) {
|
|
1328
1333
|
recompute(e, true);
|
|
1329
1334
|
return read(e);
|
|
1330
1335
|
} else throw e.Y;
|
|
1331
1336
|
}
|
|
1332
|
-
if (
|
|
1337
|
+
if (V && t && t.se) {
|
|
1333
1338
|
const n = e.ie;
|
|
1334
1339
|
if (n !== undefined) {
|
|
1335
|
-
const r = n ===
|
|
1336
|
-
const i = e.ce !==
|
|
1340
|
+
const r = n === w ? undefined : n;
|
|
1341
|
+
const i = e.ce !== S ? e.ce : e.ae;
|
|
1337
1342
|
if (i !== r) t.m |= l;
|
|
1338
1343
|
return r;
|
|
1339
1344
|
}
|
|
1340
1345
|
}
|
|
1341
|
-
return !t ||
|
|
1346
|
+
return !t || F !== null || e.ce === S || (R && e.ne && A !== e.ne) ? e.ae : e.ce;
|
|
1342
1347
|
}
|
|
1343
1348
|
function setSignal(e, t) {
|
|
1344
|
-
if (e.ne &&
|
|
1345
|
-
const n = e.we && !
|
|
1346
|
-
const r = n ? e.ae : e.ce ===
|
|
1349
|
+
if (e.ne && A !== e.ne) j.initTransition(e.ne);
|
|
1350
|
+
const n = e.we && !E;
|
|
1351
|
+
const r = n ? e.ae : e.ce === S ? e.ae : e.ce;
|
|
1347
1352
|
if (typeof t === "function") t = t(r);
|
|
1348
|
-
const i = !e.
|
|
1353
|
+
const i = !e.be || !e.be(r, t);
|
|
1349
1354
|
if (!i) {
|
|
1350
|
-
if (n && e.ce !==
|
|
1355
|
+
if (n && e.ce !== S && e.R) {
|
|
1351
1356
|
insertSubs(e, true);
|
|
1352
1357
|
schedule();
|
|
1353
1358
|
}
|
|
1354
1359
|
return t;
|
|
1355
1360
|
}
|
|
1356
1361
|
if (n) {
|
|
1357
|
-
const n =
|
|
1362
|
+
const n = j.B.includes(e);
|
|
1358
1363
|
if (e.ne && n) {
|
|
1359
|
-
|
|
1364
|
+
j.initTransition(e.ne);
|
|
1360
1365
|
}
|
|
1361
|
-
if (e.ce ===
|
|
1366
|
+
if (e.ce === S) {
|
|
1362
1367
|
e.ce = e.ae;
|
|
1363
1368
|
}
|
|
1364
1369
|
if (!n) {
|
|
1365
|
-
|
|
1370
|
+
j.B.push(e);
|
|
1366
1371
|
}
|
|
1367
1372
|
e.Se = (e.Se || 0) + 1;
|
|
1368
1373
|
const r = getOrCreateLane(e);
|
|
1369
1374
|
e.re = r;
|
|
1370
1375
|
e.ae = t;
|
|
1371
1376
|
} else {
|
|
1372
|
-
if (e.ce ===
|
|
1377
|
+
if (e.ce === S) j.D.push(e);
|
|
1373
1378
|
e.ce = t;
|
|
1374
1379
|
}
|
|
1375
1380
|
updatePendingSignal(e);
|
|
1376
1381
|
if (e._e) {
|
|
1377
1382
|
setSignal(e._e, t);
|
|
1378
1383
|
}
|
|
1379
|
-
e.$ =
|
|
1384
|
+
e.$ = k;
|
|
1380
1385
|
insertSubs(e, n);
|
|
1381
1386
|
schedule();
|
|
1382
1387
|
return t;
|
|
1383
1388
|
}
|
|
1384
1389
|
function runWithOwner(e, t) {
|
|
1385
|
-
const n =
|
|
1386
|
-
const r =
|
|
1387
|
-
|
|
1388
|
-
|
|
1390
|
+
const n = q;
|
|
1391
|
+
const r = I;
|
|
1392
|
+
q = e;
|
|
1393
|
+
I = false;
|
|
1389
1394
|
try {
|
|
1390
1395
|
return t();
|
|
1391
1396
|
} finally {
|
|
1392
|
-
|
|
1393
|
-
|
|
1397
|
+
q = n;
|
|
1398
|
+
I = r;
|
|
1394
1399
|
}
|
|
1395
1400
|
}
|
|
1396
1401
|
function getPendingSignal(e) {
|
|
@@ -1405,16 +1410,16 @@ function getPendingSignal(e) {
|
|
|
1405
1410
|
}
|
|
1406
1411
|
function computePendingState(e) {
|
|
1407
1412
|
const t = e;
|
|
1408
|
-
if (e.we && e.ce !==
|
|
1409
|
-
if (t.de &
|
|
1413
|
+
if (e.we && e.ce !== S) {
|
|
1414
|
+
if (t.de & a && !(t.de & p)) return true;
|
|
1410
1415
|
if (e.he) {
|
|
1411
1416
|
const t = e.re ? findLane(e.re) : null;
|
|
1412
1417
|
return !!(t && t.T.size > 0);
|
|
1413
1418
|
}
|
|
1414
1419
|
return true;
|
|
1415
1420
|
}
|
|
1416
|
-
if (e.ce !==
|
|
1417
|
-
return !!(t.de &
|
|
1421
|
+
if (e.ce !== S && !(t.de & p)) return true;
|
|
1422
|
+
return !!(t.de & a && !(t.de & p));
|
|
1418
1423
|
}
|
|
1419
1424
|
function updatePendingSignal(e) {
|
|
1420
1425
|
if (e.Ve) {
|
|
@@ -1429,78 +1434,78 @@ function updatePendingSignal(e) {
|
|
|
1429
1434
|
mergeLanes(t, e);
|
|
1430
1435
|
}
|
|
1431
1436
|
}
|
|
1432
|
-
|
|
1437
|
+
W.delete(n);
|
|
1433
1438
|
n.re = undefined;
|
|
1434
1439
|
}
|
|
1435
1440
|
}
|
|
1436
1441
|
}
|
|
1437
1442
|
function getLatestValueComputed(e) {
|
|
1438
1443
|
if (!e._e) {
|
|
1439
|
-
const t =
|
|
1440
|
-
|
|
1441
|
-
const n =
|
|
1442
|
-
|
|
1443
|
-
const r =
|
|
1444
|
-
|
|
1444
|
+
const t = M;
|
|
1445
|
+
M = false;
|
|
1446
|
+
const n = Q;
|
|
1447
|
+
Q = false;
|
|
1448
|
+
const r = q;
|
|
1449
|
+
q = null;
|
|
1445
1450
|
e._e = optimisticComputed(() => read(e));
|
|
1446
1451
|
e._e.he = e;
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1452
|
+
q = r;
|
|
1453
|
+
Q = n;
|
|
1454
|
+
M = t;
|
|
1450
1455
|
}
|
|
1451
1456
|
return e._e;
|
|
1452
1457
|
}
|
|
1453
1458
|
function staleValues(e, t = true) {
|
|
1454
|
-
const n =
|
|
1455
|
-
|
|
1459
|
+
const n = R;
|
|
1460
|
+
R = t;
|
|
1456
1461
|
try {
|
|
1457
1462
|
return e();
|
|
1458
1463
|
} finally {
|
|
1459
|
-
|
|
1464
|
+
R = n;
|
|
1460
1465
|
}
|
|
1461
1466
|
}
|
|
1462
1467
|
function latest(e) {
|
|
1463
|
-
const t =
|
|
1464
|
-
|
|
1468
|
+
const t = M;
|
|
1469
|
+
M = true;
|
|
1465
1470
|
try {
|
|
1466
1471
|
return e();
|
|
1467
1472
|
} finally {
|
|
1468
|
-
|
|
1473
|
+
M = t;
|
|
1469
1474
|
}
|
|
1470
1475
|
}
|
|
1471
1476
|
function isPending(e) {
|
|
1472
|
-
const t =
|
|
1473
|
-
const n =
|
|
1474
|
-
|
|
1475
|
-
|
|
1477
|
+
const t = Q;
|
|
1478
|
+
const n = T;
|
|
1479
|
+
Q = true;
|
|
1480
|
+
T = false;
|
|
1476
1481
|
try {
|
|
1477
1482
|
e();
|
|
1478
|
-
return
|
|
1483
|
+
return T;
|
|
1479
1484
|
} catch {
|
|
1480
|
-
return
|
|
1485
|
+
return T;
|
|
1481
1486
|
} finally {
|
|
1482
|
-
|
|
1483
|
-
|
|
1487
|
+
Q = t;
|
|
1488
|
+
T = n;
|
|
1484
1489
|
}
|
|
1485
1490
|
}
|
|
1486
1491
|
function refresh(e) {
|
|
1487
|
-
let t =
|
|
1488
|
-
|
|
1492
|
+
let t = H;
|
|
1493
|
+
H = true;
|
|
1489
1494
|
try {
|
|
1490
1495
|
if (typeof e !== "function") {
|
|
1491
|
-
recompute(e[
|
|
1496
|
+
recompute(e[O]);
|
|
1492
1497
|
return e;
|
|
1493
1498
|
}
|
|
1494
1499
|
return untrack(e);
|
|
1495
1500
|
} finally {
|
|
1496
|
-
|
|
1501
|
+
H = t;
|
|
1497
1502
|
if (!t) {
|
|
1498
1503
|
schedule();
|
|
1499
1504
|
}
|
|
1500
1505
|
}
|
|
1501
1506
|
}
|
|
1502
1507
|
function isRefreshing() {
|
|
1503
|
-
return
|
|
1508
|
+
return H;
|
|
1504
1509
|
}
|
|
1505
1510
|
function createContext(e, t) {
|
|
1506
1511
|
return { id: Symbol(t), defaultValue: e };
|
|
@@ -1528,7 +1533,7 @@ function isUndefined(e) {
|
|
|
1528
1533
|
return typeof e === "undefined";
|
|
1529
1534
|
}
|
|
1530
1535
|
function restoreTransition(e, t) {
|
|
1531
|
-
|
|
1536
|
+
j.initTransition(e);
|
|
1532
1537
|
const n = t();
|
|
1533
1538
|
flush();
|
|
1534
1539
|
return n;
|
|
@@ -1537,8 +1542,8 @@ function action(e) {
|
|
|
1537
1542
|
return (...t) =>
|
|
1538
1543
|
new Promise((n, r) => {
|
|
1539
1544
|
const i = e(...t);
|
|
1540
|
-
|
|
1541
|
-
let s =
|
|
1545
|
+
j.initTransition();
|
|
1546
|
+
let s = A;
|
|
1542
1547
|
s.ee.push(i);
|
|
1543
1548
|
const done = (e, t) => {
|
|
1544
1549
|
s = currentTransition(s);
|
|
@@ -1634,13 +1639,13 @@ function createOptimistic(e, t, n) {
|
|
|
1634
1639
|
function onSettled(e) {
|
|
1635
1640
|
getOwner()
|
|
1636
1641
|
? createTrackedEffect(() => untrack(e))
|
|
1637
|
-
:
|
|
1642
|
+
: j.enqueue(y, () => {
|
|
1638
1643
|
const t = e();
|
|
1639
1644
|
t?.();
|
|
1640
1645
|
});
|
|
1641
1646
|
}
|
|
1642
1647
|
function unwrap(e) {
|
|
1643
|
-
return e?.[
|
|
1648
|
+
return e?.[U]?.[te] ?? e;
|
|
1644
1649
|
}
|
|
1645
1650
|
function getOverrideValue(e, t, n, r, i) {
|
|
1646
1651
|
if (i && r in i) return i[r];
|
|
@@ -1652,16 +1657,16 @@ function getAllKeys(e, t, n) {
|
|
|
1652
1657
|
return Array.from(new Set([...r, ...i]));
|
|
1653
1658
|
}
|
|
1654
1659
|
function applyState(e, t, n, r) {
|
|
1655
|
-
const i = t?.[
|
|
1660
|
+
const i = t?.[U];
|
|
1656
1661
|
if (!i) return;
|
|
1657
|
-
const s = i[
|
|
1658
|
-
const o = i[
|
|
1659
|
-
const u = i[
|
|
1660
|
-
let f = i[
|
|
1662
|
+
const s = i[Z];
|
|
1663
|
+
const o = i[$];
|
|
1664
|
+
const u = i[ee];
|
|
1665
|
+
let f = i[te];
|
|
1661
1666
|
if (e === s && !o && !u) return;
|
|
1662
|
-
(i[
|
|
1663
|
-
i[
|
|
1664
|
-
i[
|
|
1667
|
+
(i[ie] || ue).set(e, i[J]);
|
|
1668
|
+
i[Z] = e;
|
|
1669
|
+
i[$] = undefined;
|
|
1665
1670
|
if (Array.isArray(s)) {
|
|
1666
1671
|
let t = false;
|
|
1667
1672
|
const l = getOverrideValue(s, o, f, "length", u);
|
|
@@ -1676,7 +1681,7 @@ function applyState(e, t, n, r) {
|
|
|
1676
1681
|
applyState(e[d], wrap(y, i), n, r);
|
|
1677
1682
|
}
|
|
1678
1683
|
const w = new Array(e.length),
|
|
1679
|
-
|
|
1684
|
+
m = new Map();
|
|
1680
1685
|
for (
|
|
1681
1686
|
p = l - 1, h = e.length - 1;
|
|
1682
1687
|
p >= d &&
|
|
@@ -1689,59 +1694,59 @@ function applyState(e, t, n, r) {
|
|
|
1689
1694
|
if (d > h || d > p) {
|
|
1690
1695
|
for (a = d; a <= h; a++) {
|
|
1691
1696
|
t = true;
|
|
1692
|
-
i[
|
|
1697
|
+
i[te][a] && setSignal(i[te][a], wrap(e[a], i));
|
|
1693
1698
|
}
|
|
1694
1699
|
for (; a < e.length; a++) {
|
|
1695
1700
|
t = true;
|
|
1696
1701
|
const s = wrap(w[a], i);
|
|
1697
|
-
i[
|
|
1702
|
+
i[te][a] && setSignal(i[te][a], s);
|
|
1698
1703
|
applyState(e[a], s, n, r);
|
|
1699
1704
|
}
|
|
1700
|
-
t && i[
|
|
1701
|
-
l !== e.length && i[
|
|
1705
|
+
t && i[te][K] && setSignal(i[te][K], void 0);
|
|
1706
|
+
l !== e.length && i[te].length && setSignal(i[te].length, e.length);
|
|
1702
1707
|
return;
|
|
1703
1708
|
}
|
|
1704
1709
|
g = new Array(h + 1);
|
|
1705
1710
|
for (a = h; a >= d; a--) {
|
|
1706
1711
|
y = e[a];
|
|
1707
1712
|
S = y ? n(y) : y;
|
|
1708
|
-
c =
|
|
1713
|
+
c = m.get(S);
|
|
1709
1714
|
g[a] = c === undefined ? -1 : c;
|
|
1710
|
-
|
|
1715
|
+
m.set(S, a);
|
|
1711
1716
|
}
|
|
1712
1717
|
for (c = d; c <= p; c++) {
|
|
1713
1718
|
y = getOverrideValue(s, o, f, c, u);
|
|
1714
1719
|
S = y ? n(y) : y;
|
|
1715
|
-
a =
|
|
1720
|
+
a = m.get(S);
|
|
1716
1721
|
if (a !== undefined && a !== -1) {
|
|
1717
1722
|
w[a] = y;
|
|
1718
1723
|
a = g[a];
|
|
1719
|
-
|
|
1724
|
+
m.set(S, a);
|
|
1720
1725
|
}
|
|
1721
1726
|
}
|
|
1722
1727
|
for (a = d; a < e.length; a++) {
|
|
1723
1728
|
if (a in w) {
|
|
1724
1729
|
const t = wrap(w[a], i);
|
|
1725
|
-
i[
|
|
1730
|
+
i[te][a] && setSignal(i[te][a], t);
|
|
1726
1731
|
applyState(e[a], t, n, r);
|
|
1727
|
-
} else i[
|
|
1732
|
+
} else i[te][a] && setSignal(i[te][a], wrap(e[a], i));
|
|
1728
1733
|
}
|
|
1729
1734
|
if (d < e.length) t = true;
|
|
1730
1735
|
} else if (e.length) {
|
|
1731
1736
|
for (let t = 0, l = e.length; t < l; t++) {
|
|
1732
1737
|
const l = getOverrideValue(s, o, f, t, u);
|
|
1733
|
-
isWrappable(l) ? applyState(e[t], wrap(l, i), n, r) : i[
|
|
1738
|
+
isWrappable(l) ? applyState(e[t], wrap(l, i), n, r) : i[te][t] && setSignal(i[te][t], e[t]);
|
|
1734
1739
|
}
|
|
1735
1740
|
}
|
|
1736
1741
|
if (l !== e.length) {
|
|
1737
1742
|
t = true;
|
|
1738
|
-
i[
|
|
1743
|
+
i[te].length && setSignal(i[te].length, e.length);
|
|
1739
1744
|
}
|
|
1740
|
-
t && i[
|
|
1745
|
+
t && i[te][K] && setSignal(i[te][K], void 0);
|
|
1741
1746
|
return;
|
|
1742
1747
|
}
|
|
1743
1748
|
if (f) {
|
|
1744
|
-
const t = f[
|
|
1749
|
+
const t = f[K];
|
|
1745
1750
|
const l = t || r ? getAllKeys(s, o, e) : Object.keys(f);
|
|
1746
1751
|
for (let c = 0, a = l.length; c < a; c++) {
|
|
1747
1752
|
const a = l[c];
|
|
@@ -1755,7 +1760,7 @@ function applyState(e, t, n, r) {
|
|
|
1755
1760
|
} else applyState(h, wrap(p, i), n, r);
|
|
1756
1761
|
}
|
|
1757
1762
|
}
|
|
1758
|
-
if ((f = i[
|
|
1763
|
+
if ((f = i[ne])) {
|
|
1759
1764
|
const t = Object.keys(f);
|
|
1760
1765
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1761
1766
|
const r = t[n];
|
|
@@ -1777,9 +1782,9 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1777
1782
|
let r;
|
|
1778
1783
|
const i = new WeakMap();
|
|
1779
1784
|
const wrapper = e => {
|
|
1780
|
-
e[
|
|
1781
|
-
e[
|
|
1782
|
-
Object.defineProperty(e,
|
|
1785
|
+
e[re] = wrapProjection;
|
|
1786
|
+
e[ie] = i;
|
|
1787
|
+
Object.defineProperty(e, se, {
|
|
1783
1788
|
get() {
|
|
1784
1789
|
return r;
|
|
1785
1790
|
},
|
|
@@ -1788,15 +1793,15 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1788
1793
|
};
|
|
1789
1794
|
const wrapProjection = e => {
|
|
1790
1795
|
if (i.has(e)) return i.get(e);
|
|
1791
|
-
if (e[
|
|
1792
|
-
const t = createStoreProxy(e,
|
|
1796
|
+
if (e[U]?.[re] === wrapProjection) return e;
|
|
1797
|
+
const t = createStoreProxy(e, ce, wrapper);
|
|
1793
1798
|
i.set(e, t);
|
|
1794
1799
|
return t;
|
|
1795
1800
|
};
|
|
1796
1801
|
const s = wrapProjection(t);
|
|
1797
1802
|
r = computed(() => {
|
|
1798
1803
|
const t = getOwner();
|
|
1799
|
-
storeSetter(new Proxy(s,
|
|
1804
|
+
storeSetter(new Proxy(s, G), r => {
|
|
1800
1805
|
const i = handleAsync(t, e(r), e => {
|
|
1801
1806
|
e !== r && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id", n?.all));
|
|
1802
1807
|
setSignal(t, undefined);
|
|
@@ -1810,7 +1815,7 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1810
1815
|
function createProjection(e, t = {}, n) {
|
|
1811
1816
|
return createProjectionInternal(e, t, n).store;
|
|
1812
1817
|
}
|
|
1813
|
-
const
|
|
1818
|
+
const G = {
|
|
1814
1819
|
get(e, t) {
|
|
1815
1820
|
let n;
|
|
1816
1821
|
setWriteOverride(true);
|
|
@@ -1821,7 +1826,7 @@ const B = {
|
|
|
1821
1826
|
setWriteOverride(false);
|
|
1822
1827
|
setProjectionWriteActive(false);
|
|
1823
1828
|
}
|
|
1824
|
-
return typeof n === "object" && n !== null ? new Proxy(n,
|
|
1829
|
+
return typeof n === "object" && n !== null ? new Proxy(n, G) : n;
|
|
1825
1830
|
},
|
|
1826
1831
|
set(e, t, n) {
|
|
1827
1832
|
setWriteOverride(true);
|
|
@@ -1846,46 +1851,46 @@ const B = {
|
|
|
1846
1851
|
return true;
|
|
1847
1852
|
}
|
|
1848
1853
|
};
|
|
1849
|
-
const
|
|
1850
|
-
K = Symbol(0),
|
|
1854
|
+
const K = Symbol(0),
|
|
1851
1855
|
z = Symbol(0),
|
|
1852
1856
|
U = Symbol(0),
|
|
1853
|
-
J = Symbol(0)
|
|
1854
|
-
|
|
1855
|
-
const Y =
|
|
1856
|
-
|
|
1857
|
-
$ = "
|
|
1858
|
-
ee = "
|
|
1859
|
-
te = "
|
|
1860
|
-
ne = "
|
|
1861
|
-
re = "
|
|
1862
|
-
ie = "
|
|
1863
|
-
se = "
|
|
1864
|
-
|
|
1857
|
+
J = Symbol(0),
|
|
1858
|
+
X = Symbol(0);
|
|
1859
|
+
const Y = new WeakMap();
|
|
1860
|
+
const Z = "v",
|
|
1861
|
+
$ = "o",
|
|
1862
|
+
ee = "x",
|
|
1863
|
+
te = "n",
|
|
1864
|
+
ne = "h",
|
|
1865
|
+
re = "w",
|
|
1866
|
+
ie = "l",
|
|
1867
|
+
se = "f",
|
|
1868
|
+
oe = "p";
|
|
1869
|
+
function createStoreProxy(e, t = ce, n) {
|
|
1865
1870
|
let r;
|
|
1866
1871
|
if (Array.isArray(e)) {
|
|
1867
1872
|
r = [];
|
|
1868
1873
|
r.v = e;
|
|
1869
1874
|
} else r = { v: e };
|
|
1870
1875
|
n && n(r);
|
|
1871
|
-
return (r[
|
|
1876
|
+
return (r[J] = new Proxy(r, t));
|
|
1872
1877
|
}
|
|
1873
|
-
const
|
|
1878
|
+
const ue = new WeakMap();
|
|
1874
1879
|
function wrap(e, t) {
|
|
1875
|
-
if (t?.[
|
|
1876
|
-
let n = e[
|
|
1877
|
-
if (!n)
|
|
1880
|
+
if (t?.[re]) return t[re](e, t);
|
|
1881
|
+
let n = e[J] || ue.get(e);
|
|
1882
|
+
if (!n) ue.set(e, (n = createStoreProxy(e)));
|
|
1878
1883
|
return n;
|
|
1879
1884
|
}
|
|
1880
1885
|
function isWrappable(e) {
|
|
1881
1886
|
return e != null && typeof e === "object" && !Object.isFrozen(e);
|
|
1882
1887
|
}
|
|
1883
|
-
let
|
|
1888
|
+
let fe = false;
|
|
1884
1889
|
function setWriteOverride(e) {
|
|
1885
|
-
|
|
1890
|
+
fe = e;
|
|
1886
1891
|
}
|
|
1887
1892
|
function writeOnly(e) {
|
|
1888
|
-
return
|
|
1893
|
+
return fe || !!le?.has(e);
|
|
1889
1894
|
}
|
|
1890
1895
|
function getNodes(e, t) {
|
|
1891
1896
|
let n = e[t];
|
|
@@ -1907,13 +1912,13 @@ function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
|
1907
1912
|
if (s) u.we = true;
|
|
1908
1913
|
if (o && t in o) {
|
|
1909
1914
|
const e = o[t];
|
|
1910
|
-
u.ie = e === undefined ?
|
|
1911
|
-
|
|
1915
|
+
u.ie = e === undefined ? w : e;
|
|
1916
|
+
D?.add(u);
|
|
1912
1917
|
}
|
|
1913
1918
|
return (e[t] = u);
|
|
1914
1919
|
}
|
|
1915
|
-
function trackSelf(e, t =
|
|
1916
|
-
getObserver() && read(getNode(getNodes(e,
|
|
1920
|
+
function trackSelf(e, t = K) {
|
|
1921
|
+
getObserver() && read(getNode(getNodes(e, te), t, undefined, e[se], false, e[oe]));
|
|
1917
1922
|
}
|
|
1918
1923
|
function getKeys(e, t, n = true) {
|
|
1919
1924
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -1921,7 +1926,7 @@ function getKeys(e, t, n = true) {
|
|
|
1921
1926
|
const i = new Set(r);
|
|
1922
1927
|
const s = Reflect.ownKeys(t);
|
|
1923
1928
|
for (const e of s) {
|
|
1924
|
-
if (t[e] !==
|
|
1929
|
+
if (t[e] !== X) i.add(e);
|
|
1925
1930
|
else i.delete(e);
|
|
1926
1931
|
}
|
|
1927
1932
|
return Array.from(i);
|
|
@@ -1929,97 +1934,97 @@ function getKeys(e, t, n = true) {
|
|
|
1929
1934
|
function getPropertyDescriptor(e, t, n) {
|
|
1930
1935
|
let r = e;
|
|
1931
1936
|
if (t && n in t) {
|
|
1932
|
-
if (r[n] ===
|
|
1937
|
+
if (r[n] === X) return void 0;
|
|
1933
1938
|
if (!(n in r)) r = t;
|
|
1934
1939
|
}
|
|
1935
1940
|
return Reflect.getOwnPropertyDescriptor(r, n);
|
|
1936
1941
|
}
|
|
1937
|
-
let
|
|
1938
|
-
const
|
|
1942
|
+
let le = null;
|
|
1943
|
+
const ce = {
|
|
1939
1944
|
get(e, t, n) {
|
|
1940
|
-
if (t ===
|
|
1941
|
-
if (t ===
|
|
1942
|
-
if (t ===
|
|
1943
|
-
if (t ===
|
|
1945
|
+
if (t === U) return e;
|
|
1946
|
+
if (t === J) return n;
|
|
1947
|
+
if (t === O) return e[se];
|
|
1948
|
+
if (t === K || t === z) {
|
|
1944
1949
|
trackSelf(e, t);
|
|
1945
1950
|
return n;
|
|
1946
1951
|
}
|
|
1947
|
-
const r = getNodes(e,
|
|
1952
|
+
const r = getNodes(e, te);
|
|
1948
1953
|
const i = r[t];
|
|
1949
|
-
const s = e[
|
|
1950
|
-
const o = s || (e[
|
|
1951
|
-
const u = !!e[
|
|
1952
|
-
const f = s ? e[
|
|
1954
|
+
const s = e[ee] && t in e[ee];
|
|
1955
|
+
const o = s || (e[$] && t in e[$]);
|
|
1956
|
+
const u = !!e[Z][U];
|
|
1957
|
+
const f = s ? e[ee] : e[$] && t in e[$] ? e[$] : e[Z];
|
|
1953
1958
|
if (!i) {
|
|
1954
1959
|
const e = Object.getOwnPropertyDescriptor(f, t);
|
|
1955
1960
|
if (e && e.get) return e.get.call(n);
|
|
1956
1961
|
}
|
|
1957
1962
|
if (writeOnly(n)) {
|
|
1958
|
-
let n = i && (o || !u) ? (i.ce !==
|
|
1959
|
-
n ===
|
|
1963
|
+
let n = i && (o || !u) ? (i.ce !== S ? (i.we ? i.ae : i.ce) : i.ae) : f[t];
|
|
1964
|
+
n === X && (n = undefined);
|
|
1960
1965
|
if (!isWrappable(n)) return n;
|
|
1961
1966
|
const r = wrap(n, e);
|
|
1962
|
-
|
|
1967
|
+
le?.add(r);
|
|
1963
1968
|
return r;
|
|
1964
1969
|
}
|
|
1965
1970
|
let l = i ? (o || !u ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
1966
|
-
l ===
|
|
1971
|
+
l === X && (l = undefined);
|
|
1967
1972
|
if (!i) {
|
|
1968
1973
|
if (!o && typeof l === "function" && !f.hasOwnProperty(t)) {
|
|
1969
1974
|
let t;
|
|
1970
|
-
return !Array.isArray(e[
|
|
1975
|
+
return !Array.isArray(e[Z]) && (t = Object.getPrototypeOf(e[Z])) && t !== Object.prototype
|
|
1971
1976
|
? l.bind(f)
|
|
1972
1977
|
: l;
|
|
1973
1978
|
} else if (getObserver()) {
|
|
1974
|
-
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[
|
|
1979
|
+
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[se], isEqual, e[oe], e[m]));
|
|
1975
1980
|
}
|
|
1976
1981
|
}
|
|
1977
1982
|
return isWrappable(l) ? wrap(l, e) : l;
|
|
1978
1983
|
},
|
|
1979
1984
|
has(e, t) {
|
|
1980
|
-
if (t ===
|
|
1981
|
-
const n = e[
|
|
1982
|
-
getObserver() && read(getNode(getNodes(e,
|
|
1985
|
+
if (t === J || t === K || t === "__proto__") return true;
|
|
1986
|
+
const n = e[ee] && t in e[ee] ? e[ee][t] !== X : e[$] && t in e[$] ? e[$][t] !== X : t in e[Z];
|
|
1987
|
+
getObserver() && read(getNode(getNodes(e, ne), t, n, e[se], isEqual, e[oe]));
|
|
1983
1988
|
return n;
|
|
1984
1989
|
},
|
|
1985
1990
|
set(e, t, n) {
|
|
1986
|
-
const r = e[
|
|
1991
|
+
const r = e[J];
|
|
1987
1992
|
if (writeOnly(r)) {
|
|
1988
|
-
if (e[
|
|
1989
|
-
const t = e[
|
|
1993
|
+
if (e[oe]) {
|
|
1994
|
+
const t = e[se];
|
|
1990
1995
|
if (t?.ne) {
|
|
1991
|
-
|
|
1996
|
+
j.initTransition(t.ne);
|
|
1992
1997
|
}
|
|
1993
1998
|
}
|
|
1994
1999
|
untrack(() => {
|
|
1995
|
-
const i = e[
|
|
2000
|
+
const i = e[Z];
|
|
1996
2001
|
const s = i[t];
|
|
1997
|
-
if (
|
|
1998
|
-
if (!e[
|
|
1999
|
-
e[
|
|
2000
|
-
|
|
2002
|
+
if (V && typeof t !== "symbol") {
|
|
2003
|
+
if (!e[m]) {
|
|
2004
|
+
e[m] = Object.create(null);
|
|
2005
|
+
D?.add(e);
|
|
2001
2006
|
}
|
|
2002
|
-
if (!(t in e[
|
|
2003
|
-
e[
|
|
2007
|
+
if (!(t in e[m])) {
|
|
2008
|
+
e[m][t] = s;
|
|
2004
2009
|
}
|
|
2005
2010
|
}
|
|
2006
|
-
const o = e[
|
|
2007
|
-
const u = o ?
|
|
2011
|
+
const o = e[oe] && !E;
|
|
2012
|
+
const u = o ? ee : $;
|
|
2008
2013
|
if (o) trackOptimisticStore(r);
|
|
2009
|
-
const f = e[
|
|
2010
|
-
const l = n?.[
|
|
2014
|
+
const f = e[ee] && t in e[ee] ? e[ee][t] : e[$] && t in e[$] ? e[$][t] : s;
|
|
2015
|
+
const l = n?.[U]?.[Z] ?? n;
|
|
2011
2016
|
if (f === l) return true;
|
|
2012
|
-
const c = e[
|
|
2017
|
+
const c = e[ee]?.length || e[$]?.length || i.length;
|
|
2013
2018
|
if (l !== undefined && l === s) delete e[u][t];
|
|
2014
2019
|
else (e[u] || (e[u] = Object.create(null)))[t] = l;
|
|
2015
2020
|
const a = isWrappable(l);
|
|
2016
2021
|
if (isWrappable(f)) {
|
|
2017
|
-
const e =
|
|
2018
|
-
e && (e instanceof Set ? e.delete(r) :
|
|
2022
|
+
const e = Y.get(f);
|
|
2023
|
+
e && (e instanceof Set ? e.delete(r) : Y.delete(f));
|
|
2019
2024
|
}
|
|
2020
|
-
if (recursivelyNotify(r,
|
|
2021
|
-
e[
|
|
2022
|
-
const d = getNodes(e,
|
|
2025
|
+
if (recursivelyNotify(r, ue) && a) recursivelyAddParent(l, r);
|
|
2026
|
+
e[ne]?.[t] && setSignal(e[ne][t], true);
|
|
2027
|
+
const d = getNodes(e, te);
|
|
2023
2028
|
d[t] && setSignal(d[t], () => (a ? wrap(l, e) : l));
|
|
2024
2029
|
if (Array.isArray(i)) {
|
|
2025
2030
|
if (t === "length") {
|
|
@@ -2029,44 +2034,44 @@ const le = {
|
|
|
2029
2034
|
if (e > c) d.length && setSignal(d.length, e);
|
|
2030
2035
|
}
|
|
2031
2036
|
}
|
|
2032
|
-
d[
|
|
2037
|
+
d[K] && setSignal(d[K], undefined);
|
|
2033
2038
|
});
|
|
2034
2039
|
}
|
|
2035
2040
|
return true;
|
|
2036
2041
|
},
|
|
2037
2042
|
deleteProperty(e, t) {
|
|
2038
|
-
const n = e[
|
|
2039
|
-
const r = e[
|
|
2040
|
-
if (writeOnly(e[
|
|
2043
|
+
const n = e[ee]?.[t] === X;
|
|
2044
|
+
const r = e[$]?.[t] === X;
|
|
2045
|
+
if (writeOnly(e[J]) && !n && !r) {
|
|
2041
2046
|
untrack(() => {
|
|
2042
|
-
const n = e[
|
|
2043
|
-
const r = n ?
|
|
2044
|
-
if (n) trackOptimisticStore(e[
|
|
2045
|
-
const i = e[
|
|
2046
|
-
if (t in e[
|
|
2047
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
2047
|
+
const n = e[oe] && !E;
|
|
2048
|
+
const r = n ? ee : $;
|
|
2049
|
+
if (n) trackOptimisticStore(e[J]);
|
|
2050
|
+
const i = e[ee] && t in e[ee] ? e[ee][t] : e[$] && t in e[$] ? e[$][t] : e[Z][t];
|
|
2051
|
+
if (t in e[Z] || (e[$] && t in e[$])) {
|
|
2052
|
+
(e[r] || (e[r] = Object.create(null)))[t] = X;
|
|
2048
2053
|
} else if (e[r] && t in e[r]) {
|
|
2049
2054
|
delete e[r][t];
|
|
2050
2055
|
} else return true;
|
|
2051
2056
|
if (isWrappable(i)) {
|
|
2052
|
-
const t =
|
|
2053
|
-
t && (t instanceof Set ? t.delete(e) :
|
|
2057
|
+
const t = Y.get(i);
|
|
2058
|
+
t && (t instanceof Set ? t.delete(e) : Y.delete(i));
|
|
2054
2059
|
}
|
|
2055
|
-
if (e[
|
|
2056
|
-
const s = getNodes(e,
|
|
2060
|
+
if (e[ne]?.[t]) setSignal(e[ne][t], false);
|
|
2061
|
+
const s = getNodes(e, te);
|
|
2057
2062
|
s[t] && setSignal(s[t], undefined);
|
|
2058
|
-
s[
|
|
2063
|
+
s[K] && setSignal(s[K], undefined);
|
|
2059
2064
|
});
|
|
2060
2065
|
}
|
|
2061
2066
|
return true;
|
|
2062
2067
|
},
|
|
2063
2068
|
ownKeys(e) {
|
|
2064
2069
|
trackSelf(e);
|
|
2065
|
-
let t = getKeys(e[
|
|
2066
|
-
if (e[
|
|
2070
|
+
let t = getKeys(e[Z], e[$], false);
|
|
2071
|
+
if (e[ee]) {
|
|
2067
2072
|
const n = new Set(t);
|
|
2068
|
-
for (const t of Reflect.ownKeys(e[
|
|
2069
|
-
if (e[
|
|
2073
|
+
for (const t of Reflect.ownKeys(e[ee])) {
|
|
2074
|
+
if (e[ee][t] !== X) n.add(t);
|
|
2070
2075
|
else n.delete(t);
|
|
2071
2076
|
}
|
|
2072
2077
|
t = Array.from(n);
|
|
@@ -2074,25 +2079,25 @@ const le = {
|
|
|
2074
2079
|
return t;
|
|
2075
2080
|
},
|
|
2076
2081
|
getOwnPropertyDescriptor(e, t) {
|
|
2077
|
-
if (t ===
|
|
2078
|
-
if (e[
|
|
2079
|
-
if (e[
|
|
2080
|
-
const n = getPropertyDescriptor(e[
|
|
2082
|
+
if (t === J) return { value: e[J], writable: true, configurable: true };
|
|
2083
|
+
if (e[ee] && t in e[ee]) {
|
|
2084
|
+
if (e[ee][t] === X) return undefined;
|
|
2085
|
+
const n = getPropertyDescriptor(e[Z], e[$], t);
|
|
2081
2086
|
if (n) {
|
|
2082
|
-
return { ...n, value: e[
|
|
2087
|
+
return { ...n, value: e[ee][t] };
|
|
2083
2088
|
}
|
|
2084
|
-
return { value: e[
|
|
2089
|
+
return { value: e[ee][t], writable: true, enumerable: true, configurable: true };
|
|
2085
2090
|
}
|
|
2086
|
-
return getPropertyDescriptor(e[
|
|
2091
|
+
return getPropertyDescriptor(e[Z], e[$], t);
|
|
2087
2092
|
},
|
|
2088
2093
|
getPrototypeOf(e) {
|
|
2089
|
-
return Object.getPrototypeOf(e[
|
|
2094
|
+
return Object.getPrototypeOf(e[Z]);
|
|
2090
2095
|
}
|
|
2091
2096
|
};
|
|
2092
2097
|
function storeSetter(e, t) {
|
|
2093
|
-
const n =
|
|
2094
|
-
|
|
2095
|
-
|
|
2098
|
+
const n = le;
|
|
2099
|
+
le = new Set();
|
|
2100
|
+
le.add(e);
|
|
2096
2101
|
try {
|
|
2097
2102
|
const n = t(e);
|
|
2098
2103
|
if (n !== e && n !== undefined) {
|
|
@@ -2108,8 +2113,8 @@ function storeSetter(e, t) {
|
|
|
2108
2113
|
}
|
|
2109
2114
|
}
|
|
2110
2115
|
} finally {
|
|
2111
|
-
|
|
2112
|
-
|
|
2116
|
+
le.clear();
|
|
2117
|
+
le = n;
|
|
2113
2118
|
}
|
|
2114
2119
|
}
|
|
2115
2120
|
function createStore(e, t, n) {
|
|
@@ -2118,17 +2123,17 @@ function createStore(e, t, n) {
|
|
|
2118
2123
|
return [i, e => storeSetter(i, e)];
|
|
2119
2124
|
}
|
|
2120
2125
|
function recursivelyNotify(e, t) {
|
|
2121
|
-
let n = e[
|
|
2126
|
+
let n = e[U] || t?.get(e)?.[U];
|
|
2122
2127
|
let r = false;
|
|
2123
2128
|
if (n) {
|
|
2124
|
-
const e = getNodes(n,
|
|
2129
|
+
const e = getNodes(n, te)[z];
|
|
2125
2130
|
if (e) {
|
|
2126
2131
|
setSignal(e, undefined);
|
|
2127
2132
|
r = true;
|
|
2128
2133
|
}
|
|
2129
|
-
t = n[
|
|
2134
|
+
t = n[ie] || t;
|
|
2130
2135
|
}
|
|
2131
|
-
const i =
|
|
2136
|
+
const i = Y.get(n?.[Z] || e);
|
|
2132
2137
|
if (!i) return r;
|
|
2133
2138
|
if (i instanceof Set) {
|
|
2134
2139
|
for (let e of i) r = recursivelyNotify(e, t) || r;
|
|
@@ -2137,16 +2142,16 @@ function recursivelyNotify(e, t) {
|
|
|
2137
2142
|
}
|
|
2138
2143
|
function recursivelyAddParent(e, t) {
|
|
2139
2144
|
let n;
|
|
2140
|
-
const r = e[
|
|
2145
|
+
const r = e[U];
|
|
2141
2146
|
if (r) {
|
|
2142
|
-
n = r[
|
|
2143
|
-
e = r[
|
|
2147
|
+
n = r[$];
|
|
2148
|
+
e = r[Z];
|
|
2144
2149
|
}
|
|
2145
2150
|
if (t) {
|
|
2146
|
-
let n =
|
|
2147
|
-
if (!n)
|
|
2151
|
+
let n = Y.get(e);
|
|
2152
|
+
if (!n) Y.set(e, t);
|
|
2148
2153
|
else if (n !== t) {
|
|
2149
|
-
if (!(n instanceof Set))
|
|
2154
|
+
if (!(n instanceof Set)) Y.set(e, (n = new Set([n])));
|
|
2150
2155
|
else if (n.has(t)) return;
|
|
2151
2156
|
n.add(t);
|
|
2152
2157
|
} else return;
|
|
@@ -2168,7 +2173,7 @@ function recursivelyAddParent(e, t) {
|
|
|
2168
2173
|
}
|
|
2169
2174
|
function deep(e) {
|
|
2170
2175
|
recursivelyAddParent(e);
|
|
2171
|
-
return e[
|
|
2176
|
+
return e[z];
|
|
2172
2177
|
}
|
|
2173
2178
|
function createOptimisticStore(e, t, n) {
|
|
2174
2179
|
GlobalQueue.J ||= clearOptimisticStore;
|
|
@@ -2179,39 +2184,39 @@ function createOptimisticStore(e, t, n) {
|
|
|
2179
2184
|
return [o, e => storeSetter(o, e)];
|
|
2180
2185
|
}
|
|
2181
2186
|
function clearOptimisticStore(e) {
|
|
2182
|
-
const t = e[
|
|
2183
|
-
if (!t || !t[
|
|
2184
|
-
const n = t[
|
|
2185
|
-
const r = t[
|
|
2187
|
+
const t = e[U];
|
|
2188
|
+
if (!t || !t[ee]) return;
|
|
2189
|
+
const n = t[ee];
|
|
2190
|
+
const r = t[te];
|
|
2186
2191
|
setProjectionWriteActive(true);
|
|
2187
2192
|
try {
|
|
2188
2193
|
if (r) {
|
|
2189
2194
|
for (const e of Reflect.ownKeys(n)) {
|
|
2190
2195
|
if (r[e]) {
|
|
2191
2196
|
r[e].re = undefined;
|
|
2192
|
-
const n = t[
|
|
2193
|
-
const i = n ===
|
|
2197
|
+
const n = t[$] && e in t[$] ? t[$][e] : t[Z][e];
|
|
2198
|
+
const i = n === X ? undefined : n;
|
|
2194
2199
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2195
2200
|
}
|
|
2196
2201
|
}
|
|
2197
|
-
if (r[
|
|
2198
|
-
r[
|
|
2199
|
-
setSignal(r[
|
|
2202
|
+
if (r[K]) {
|
|
2203
|
+
r[K].re = undefined;
|
|
2204
|
+
setSignal(r[K], undefined);
|
|
2200
2205
|
}
|
|
2201
2206
|
}
|
|
2202
2207
|
} finally {
|
|
2203
2208
|
setProjectionWriteActive(false);
|
|
2204
2209
|
}
|
|
2205
|
-
delete t[
|
|
2210
|
+
delete t[ee];
|
|
2206
2211
|
}
|
|
2207
2212
|
function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
2208
2213
|
let r;
|
|
2209
2214
|
const i = new WeakMap();
|
|
2210
2215
|
const wrapper = e => {
|
|
2211
|
-
e[
|
|
2212
|
-
e[
|
|
2213
|
-
e[
|
|
2214
|
-
Object.defineProperty(e,
|
|
2216
|
+
e[re] = wrapProjection;
|
|
2217
|
+
e[ie] = i;
|
|
2218
|
+
e[oe] = true;
|
|
2219
|
+
Object.defineProperty(e, se, {
|
|
2215
2220
|
get() {
|
|
2216
2221
|
return r;
|
|
2217
2222
|
},
|
|
@@ -2220,8 +2225,8 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2220
2225
|
};
|
|
2221
2226
|
const wrapProjection = e => {
|
|
2222
2227
|
if (i.has(e)) return i.get(e);
|
|
2223
|
-
if (e[
|
|
2224
|
-
const t = createStoreProxy(e,
|
|
2228
|
+
if (e[U]?.[re] === wrapProjection) return e;
|
|
2229
|
+
const t = createStoreProxy(e, ce, wrapper);
|
|
2225
2230
|
i.set(e, t);
|
|
2226
2231
|
return t;
|
|
2227
2232
|
};
|
|
@@ -2231,7 +2236,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2231
2236
|
const t = getOwner();
|
|
2232
2237
|
setProjectionWriteActive(true);
|
|
2233
2238
|
try {
|
|
2234
|
-
storeSetter(new Proxy(s,
|
|
2239
|
+
storeSetter(new Proxy(s, G), r => {
|
|
2235
2240
|
const i = handleAsync(t, e(r), e => {
|
|
2236
2241
|
setProjectionWriteActive(true);
|
|
2237
2242
|
try {
|
|
@@ -2250,7 +2255,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2250
2255
|
}
|
|
2251
2256
|
return { store: s, node: r };
|
|
2252
2257
|
}
|
|
2253
|
-
const
|
|
2258
|
+
const ae = Symbol(0);
|
|
2254
2259
|
function updatePath(e, t, n = 0) {
|
|
2255
2260
|
let r,
|
|
2256
2261
|
i = e;
|
|
@@ -2294,7 +2299,7 @@ function updatePath(e, t, n = 0) {
|
|
|
2294
2299
|
if (s === i) return;
|
|
2295
2300
|
}
|
|
2296
2301
|
if (r === undefined && s == undefined) return;
|
|
2297
|
-
if (s ===
|
|
2302
|
+
if (s === ae) {
|
|
2298
2303
|
delete e[r];
|
|
2299
2304
|
} else if (r === undefined || (isWrappable(i) && isWrappable(s) && !Array.isArray(s))) {
|
|
2300
2305
|
const t = r !== undefined ? e[r] : e;
|
|
@@ -2304,25 +2309,25 @@ function updatePath(e, t, n = 0) {
|
|
|
2304
2309
|
e[r] = s;
|
|
2305
2310
|
}
|
|
2306
2311
|
}
|
|
2307
|
-
const
|
|
2312
|
+
const de = Object.assign(
|
|
2308
2313
|
function storePath(...e) {
|
|
2309
2314
|
return t => {
|
|
2310
2315
|
updatePath(t, e);
|
|
2311
2316
|
};
|
|
2312
2317
|
},
|
|
2313
|
-
{ DELETE:
|
|
2318
|
+
{ DELETE: ae }
|
|
2314
2319
|
);
|
|
2315
2320
|
function snapshot(e, t, n) {
|
|
2316
2321
|
let r, i, s, o, u, f;
|
|
2317
2322
|
if (!isWrappable(e)) return e;
|
|
2318
2323
|
if (t && t.has(e)) return t.get(e);
|
|
2319
2324
|
if (!t) t = new Map();
|
|
2320
|
-
if ((r = e[
|
|
2321
|
-
s = r[
|
|
2322
|
-
i = Array.isArray(r[
|
|
2323
|
-
t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[
|
|
2324
|
-
e = r[
|
|
2325
|
-
n =
|
|
2325
|
+
if ((r = e[U] || n?.get(e)?.[U])) {
|
|
2326
|
+
s = r[$];
|
|
2327
|
+
i = Array.isArray(r[Z]);
|
|
2328
|
+
t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[Z]))) : r[Z]);
|
|
2329
|
+
e = r[Z];
|
|
2330
|
+
n = ue;
|
|
2326
2331
|
} else {
|
|
2327
2332
|
i = Array.isArray(e);
|
|
2328
2333
|
t.set(e, e);
|
|
@@ -2331,7 +2336,7 @@ function snapshot(e, t, n) {
|
|
|
2331
2336
|
const r = s?.length || e.length;
|
|
2332
2337
|
for (let i = 0; i < r; i++) {
|
|
2333
2338
|
f = s && i in s ? s[i] : e[i];
|
|
2334
|
-
if (f ===
|
|
2339
|
+
if (f === X) continue;
|
|
2335
2340
|
if ((u = snapshot(f, t, n)) !== f || o) {
|
|
2336
2341
|
if (!o) t.set(e, (o = [...e]));
|
|
2337
2342
|
o[i] = u;
|
|
@@ -2358,13 +2363,13 @@ function snapshot(e, t, n) {
|
|
|
2358
2363
|
function trueFn() {
|
|
2359
2364
|
return true;
|
|
2360
2365
|
}
|
|
2361
|
-
const
|
|
2366
|
+
const pe = {
|
|
2362
2367
|
get(e, t, n) {
|
|
2363
|
-
if (t ===
|
|
2368
|
+
if (t === J) return n;
|
|
2364
2369
|
return e.get(t);
|
|
2365
2370
|
},
|
|
2366
2371
|
has(e, t) {
|
|
2367
|
-
if (t ===
|
|
2372
|
+
if (t === J) return true;
|
|
2368
2373
|
return e.has(t);
|
|
2369
2374
|
},
|
|
2370
2375
|
set: trueFn,
|
|
@@ -2387,15 +2392,15 @@ const de = {
|
|
|
2387
2392
|
function resolveSource(e) {
|
|
2388
2393
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
2389
2394
|
}
|
|
2390
|
-
const
|
|
2395
|
+
const he = Symbol(0);
|
|
2391
2396
|
function merge(...e) {
|
|
2392
2397
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
2393
2398
|
let t = false;
|
|
2394
2399
|
const n = [];
|
|
2395
2400
|
for (let r = 0; r < e.length; r++) {
|
|
2396
2401
|
const i = e[r];
|
|
2397
|
-
t = t || (!!i &&
|
|
2398
|
-
const s = !!i && i[
|
|
2402
|
+
t = t || (!!i && J in i);
|
|
2403
|
+
const s = !!i && i[he];
|
|
2399
2404
|
if (s) n.push(...s);
|
|
2400
2405
|
else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
2401
2406
|
}
|
|
@@ -2403,7 +2408,7 @@ function merge(...e) {
|
|
|
2403
2408
|
return new Proxy(
|
|
2404
2409
|
{
|
|
2405
2410
|
get(e) {
|
|
2406
|
-
if (e ===
|
|
2411
|
+
if (e === he) return n;
|
|
2407
2412
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
2408
2413
|
const r = resolveSource(n[t]);
|
|
2409
2414
|
if (e in r) return r[e];
|
|
@@ -2421,7 +2426,7 @@ function merge(...e) {
|
|
|
2421
2426
|
return [...new Set(e)];
|
|
2422
2427
|
}
|
|
2423
2428
|
},
|
|
2424
|
-
|
|
2429
|
+
pe
|
|
2425
2430
|
);
|
|
2426
2431
|
}
|
|
2427
2432
|
const r = Object.create(null);
|
|
@@ -2453,12 +2458,12 @@ function merge(...e) {
|
|
|
2453
2458
|
if (n.get) Object.defineProperty(o, t, n);
|
|
2454
2459
|
else o[t] = n.value;
|
|
2455
2460
|
}
|
|
2456
|
-
o[
|
|
2461
|
+
o[he] = n;
|
|
2457
2462
|
return o;
|
|
2458
2463
|
}
|
|
2459
2464
|
function omit(e, ...t) {
|
|
2460
2465
|
const n = new Set(t);
|
|
2461
|
-
if (b &&
|
|
2466
|
+
if (b && J in e) {
|
|
2462
2467
|
return new Proxy(
|
|
2463
2468
|
{
|
|
2464
2469
|
get(t) {
|
|
@@ -2471,7 +2476,7 @@ function omit(e, ...t) {
|
|
|
2471
2476
|
return Object.keys(e).filter(e => !n.has(e));
|
|
2472
2477
|
}
|
|
2473
2478
|
},
|
|
2474
|
-
|
|
2479
|
+
pe
|
|
2475
2480
|
);
|
|
2476
2481
|
}
|
|
2477
2482
|
const r = {};
|
|
@@ -2505,18 +2510,18 @@ function mapArray(e, t, n) {
|
|
|
2505
2510
|
})
|
|
2506
2511
|
);
|
|
2507
2512
|
}
|
|
2508
|
-
const
|
|
2513
|
+
const ye = { pureWrite: true };
|
|
2509
2514
|
function updateKeyedMap() {
|
|
2510
2515
|
const e = this.Ge() || [],
|
|
2511
2516
|
t = e.length;
|
|
2512
|
-
e[
|
|
2517
|
+
e[K];
|
|
2513
2518
|
runWithOwner(this.De, () => {
|
|
2514
2519
|
let n,
|
|
2515
2520
|
r,
|
|
2516
2521
|
i = this.Ye
|
|
2517
2522
|
? () => {
|
|
2518
|
-
this.Ye[r] = signal(e[r],
|
|
2519
|
-
this.Ze && (this.Ze[r] = signal(r,
|
|
2523
|
+
this.Ye[r] = signal(e[r], ye);
|
|
2524
|
+
this.Ze && (this.Ze[r] = signal(r, ye));
|
|
2520
2525
|
return this.ze(
|
|
2521
2526
|
read.bind(null, this.Ye[r]),
|
|
2522
2527
|
this.Ze ? read.bind(null, this.Ze[r]) : undefined
|
|
@@ -2525,7 +2530,7 @@ function updateKeyedMap() {
|
|
|
2525
2530
|
: this.Ze
|
|
2526
2531
|
? () => {
|
|
2527
2532
|
const t = e[r];
|
|
2528
|
-
this.Ze[r] = signal(r,
|
|
2533
|
+
this.Ze[r] = signal(r, ye);
|
|
2529
2534
|
return this.ze(() => t, read.bind(null, this.Ze[r]));
|
|
2530
2535
|
}
|
|
2531
2536
|
: () => {
|
|
@@ -2728,7 +2733,7 @@ class CollectionQueue extends Queue {
|
|
|
2728
2733
|
return super.run(e);
|
|
2729
2734
|
}
|
|
2730
2735
|
notify(e, t, n, r) {
|
|
2731
|
-
if (!(t & this.it) || (this.it &
|
|
2736
|
+
if (!(t & this.it) || (this.it & a && this.ut)) return super.notify(e, t, n, r);
|
|
2732
2737
|
if (n & this.it) {
|
|
2733
2738
|
const t = r?.source || e.Y?.source;
|
|
2734
2739
|
if (t) {
|
|
@@ -2764,10 +2769,10 @@ function createCollectionBoundary(e, t, n) {
|
|
|
2764
2769
|
return read.bind(null, o);
|
|
2765
2770
|
}
|
|
2766
2771
|
function createLoadBoundary(e, t) {
|
|
2767
|
-
return createCollectionBoundary(
|
|
2772
|
+
return createCollectionBoundary(a, e, () => t());
|
|
2768
2773
|
}
|
|
2769
2774
|
function createErrorBoundary(e, t) {
|
|
2770
|
-
return createCollectionBoundary(
|
|
2775
|
+
return createCollectionBoundary(d, e, e => {
|
|
2771
2776
|
let n = e.st.values().next().value;
|
|
2772
2777
|
const r = n.Y?.cause ?? n.Y;
|
|
2773
2778
|
return t(r, () => {
|
|
@@ -2825,9 +2830,9 @@ function flattenArray(e, t = [], n) {
|
|
|
2825
2830
|
if (r) throw r;
|
|
2826
2831
|
return i;
|
|
2827
2832
|
}
|
|
2828
|
-
exports.$PROXY =
|
|
2829
|
-
exports.$TARGET =
|
|
2830
|
-
exports.$TRACK =
|
|
2833
|
+
exports.$PROXY = J;
|
|
2834
|
+
exports.$TARGET = U;
|
|
2835
|
+
exports.$TRACK = K;
|
|
2831
2836
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
2832
2837
|
exports.NoOwnerError = NoOwnerError;
|
|
2833
2838
|
exports.NotReadyError = NotReadyError;
|
|
@@ -2879,5 +2884,5 @@ exports.setContext = setContext;
|
|
|
2879
2884
|
exports.setSnapshotCapture = setSnapshotCapture;
|
|
2880
2885
|
exports.setStrictRead = setStrictRead;
|
|
2881
2886
|
exports.snapshot = snapshot;
|
|
2882
|
-
exports.storePath =
|
|
2887
|
+
exports.storePath = de;
|
|
2883
2888
|
exports.untrack = untrack;
|