@solidjs/signals 0.10.5 → 0.10.7
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 +130 -17
- package/dist/node.cjs +903 -790
- package/dist/prod.js +604 -490
- package/dist/types/core/constants.d.ts +3 -0
- package/dist/types/core/core.d.ts +6 -0
- package/dist/types/core/index.d.ts +2 -2
- package/dist/types/core/owner.d.ts +1 -0
- package/dist/types/core/types.d.ts +3 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/store/store.d.ts +2 -1
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -32,16 +32,19 @@ const s = 1 << 4;
|
|
|
32
32
|
const o = 1 << 5;
|
|
33
33
|
const u = 1 << 6;
|
|
34
34
|
const f = 1 << 7;
|
|
35
|
-
const l = 1 <<
|
|
36
|
-
const c = 1 <<
|
|
37
|
-
const a = 1 <<
|
|
38
|
-
const d = 1;
|
|
39
|
-
const p =
|
|
40
|
-
const h =
|
|
41
|
-
const y =
|
|
42
|
-
const g =
|
|
43
|
-
const
|
|
44
|
-
const
|
|
35
|
+
const l = 1 << 8;
|
|
36
|
+
const c = 1 << 0;
|
|
37
|
+
const a = 1 << 1;
|
|
38
|
+
const d = 1 << 2;
|
|
39
|
+
const p = 1;
|
|
40
|
+
const h = 2;
|
|
41
|
+
const y = 3;
|
|
42
|
+
const g = {};
|
|
43
|
+
const S = {};
|
|
44
|
+
const w = "sp";
|
|
45
|
+
const m = typeof Proxy === "function";
|
|
46
|
+
const b = {};
|
|
47
|
+
const _ = Symbol("refresh");
|
|
45
48
|
function actualInsertIntoHeap(e, t) {
|
|
46
49
|
const n = (e.i?.t ? e.i.u?.o : e.i?.o) ?? -1;
|
|
47
50
|
if (n >= e.o) e.o = n + 1;
|
|
@@ -138,15 +141,15 @@ function adjustHeight(e, t) {
|
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
143
|
}
|
|
141
|
-
const
|
|
142
|
-
const
|
|
143
|
-
const
|
|
144
|
-
let
|
|
145
|
-
let
|
|
146
|
-
let
|
|
147
|
-
let
|
|
144
|
+
const O = new Set();
|
|
145
|
+
const x = { l: new Array(2e3).fill(undefined), _: false, W: 0, S: 0 };
|
|
146
|
+
const v = { l: new Array(2e3).fill(undefined), _: false, W: 0, S: 0 };
|
|
147
|
+
let P = 0;
|
|
148
|
+
let k = null;
|
|
149
|
+
let C = false;
|
|
150
|
+
let A = false;
|
|
148
151
|
function runLaneEffects(e) {
|
|
149
|
-
for (const t of
|
|
152
|
+
for (const t of j) {
|
|
150
153
|
if (t.R || t.T.size > 0) continue;
|
|
151
154
|
const n = t.M[e - 1];
|
|
152
155
|
if (n.length) {
|
|
@@ -156,18 +159,18 @@ function runLaneEffects(e) {
|
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
function setProjectionWriteActive(e) {
|
|
159
|
-
|
|
162
|
+
A = e;
|
|
160
163
|
}
|
|
161
164
|
function schedule() {
|
|
162
|
-
if (
|
|
163
|
-
|
|
164
|
-
if (!
|
|
165
|
+
if (C) return;
|
|
166
|
+
C = true;
|
|
167
|
+
if (!W.q) queueMicrotask(flush);
|
|
165
168
|
}
|
|
166
169
|
class Queue {
|
|
167
170
|
i = null;
|
|
168
171
|
F = [[], []];
|
|
169
172
|
V = [];
|
|
170
|
-
created =
|
|
173
|
+
created = P;
|
|
171
174
|
addChild(e) {
|
|
172
175
|
this.V.push(e);
|
|
173
176
|
e.i = this;
|
|
@@ -193,8 +196,8 @@ class Queue {
|
|
|
193
196
|
}
|
|
194
197
|
enqueue(e, t) {
|
|
195
198
|
if (e) {
|
|
196
|
-
if (
|
|
197
|
-
const n = findLane(
|
|
199
|
+
if (q) {
|
|
200
|
+
const n = findLane(q);
|
|
198
201
|
n.M[e - 1].push(t);
|
|
199
202
|
} else {
|
|
200
203
|
this.F[e - 1].push(t);
|
|
@@ -238,52 +241,52 @@ class GlobalQueue extends Queue {
|
|
|
238
241
|
if (this.q) return;
|
|
239
242
|
this.q = true;
|
|
240
243
|
try {
|
|
241
|
-
runHeap(
|
|
242
|
-
if (
|
|
243
|
-
const e = transitionComplete(
|
|
244
|
+
runHeap(x, GlobalQueue.K);
|
|
245
|
+
if (k) {
|
|
246
|
+
const e = transitionComplete(k);
|
|
244
247
|
if (!e) {
|
|
245
|
-
let e =
|
|
246
|
-
runHeap(
|
|
248
|
+
let e = k;
|
|
249
|
+
runHeap(v, GlobalQueue.K);
|
|
247
250
|
this.D = [];
|
|
248
251
|
this.B = [];
|
|
249
252
|
this.G = new Set();
|
|
250
|
-
runLaneEffects(d);
|
|
251
253
|
runLaneEffects(p);
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
254
|
+
runLaneEffects(h);
|
|
255
|
+
this.stashQueues(k.X);
|
|
256
|
+
P++;
|
|
257
|
+
C = x.S >= x.W;
|
|
258
|
+
reassignPendingTransition(k.D);
|
|
259
|
+
k = null;
|
|
257
260
|
finalizePureQueue(null, true);
|
|
258
261
|
return;
|
|
259
262
|
}
|
|
260
|
-
this.D !==
|
|
261
|
-
this.restoreQueues(
|
|
262
|
-
|
|
263
|
-
const t =
|
|
264
|
-
|
|
263
|
+
this.D !== k.D && this.D.push(...k.D);
|
|
264
|
+
this.restoreQueues(k.X);
|
|
265
|
+
O.delete(k);
|
|
266
|
+
const t = k;
|
|
267
|
+
k = null;
|
|
265
268
|
reassignPendingTransition(this.D);
|
|
266
269
|
finalizePureQueue(t);
|
|
267
270
|
} else {
|
|
268
|
-
if (
|
|
271
|
+
if (O.size) runHeap(v, GlobalQueue.K);
|
|
269
272
|
finalizePureQueue();
|
|
270
273
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
runLaneEffects(d);
|
|
274
|
-
this.run(d);
|
|
274
|
+
P++;
|
|
275
|
+
C = x.S >= x.W;
|
|
275
276
|
runLaneEffects(p);
|
|
276
277
|
this.run(p);
|
|
278
|
+
runLaneEffects(h);
|
|
279
|
+
this.run(h);
|
|
277
280
|
} finally {
|
|
278
281
|
this.q = false;
|
|
279
282
|
}
|
|
280
283
|
}
|
|
281
284
|
notify(e, t, n, r) {
|
|
282
|
-
if (t &
|
|
283
|
-
if (n &
|
|
285
|
+
if (t & c) {
|
|
286
|
+
if (n & c) {
|
|
284
287
|
const t = r !== undefined ? r : e.Y;
|
|
285
|
-
if (
|
|
286
|
-
|
|
288
|
+
if (k && t && !k.Z.includes(t.source)) {
|
|
289
|
+
k.Z.push(t.source);
|
|
287
290
|
schedule();
|
|
288
291
|
}
|
|
289
292
|
}
|
|
@@ -293,11 +296,11 @@ class GlobalQueue extends Queue {
|
|
|
293
296
|
}
|
|
294
297
|
initTransition(e) {
|
|
295
298
|
if (e) e = currentTransition(e);
|
|
296
|
-
if (e && e ===
|
|
297
|
-
if (!e &&
|
|
298
|
-
if (!
|
|
299
|
-
|
|
300
|
-
$:
|
|
299
|
+
if (e && e === k) return;
|
|
300
|
+
if (!e && k && k.$ === P) return;
|
|
301
|
+
if (!k) {
|
|
302
|
+
k = e ?? {
|
|
303
|
+
$: P,
|
|
301
304
|
D: [],
|
|
302
305
|
Z: [],
|
|
303
306
|
B: [],
|
|
@@ -307,94 +310,99 @@ class GlobalQueue extends Queue {
|
|
|
307
310
|
te: false
|
|
308
311
|
};
|
|
309
312
|
} else if (e) {
|
|
310
|
-
const t =
|
|
313
|
+
const t = k;
|
|
311
314
|
t.te = e;
|
|
312
315
|
e.ee.push(...t.ee);
|
|
313
|
-
for (const n of
|
|
316
|
+
for (const n of j) {
|
|
314
317
|
if (n.ne === t) n.ne = e;
|
|
315
318
|
}
|
|
316
319
|
e.B.push(...t.B);
|
|
317
320
|
for (const n of t.G) {
|
|
318
321
|
e.G.add(n);
|
|
319
322
|
}
|
|
320
|
-
|
|
321
|
-
|
|
323
|
+
O.delete(t);
|
|
324
|
+
k = e;
|
|
322
325
|
}
|
|
323
|
-
|
|
324
|
-
|
|
326
|
+
O.add(k);
|
|
327
|
+
k.$ = P;
|
|
325
328
|
for (let e = 0; e < this.D.length; e++) {
|
|
326
329
|
const t = this.D[e];
|
|
327
|
-
t.ne =
|
|
328
|
-
|
|
330
|
+
t.ne = k;
|
|
331
|
+
k.D.push(t);
|
|
329
332
|
}
|
|
330
|
-
this.D =
|
|
333
|
+
this.D = k.D;
|
|
331
334
|
for (let e = 0; e < this.B.length; e++) {
|
|
332
335
|
const t = this.B[e];
|
|
333
|
-
t.ne =
|
|
334
|
-
|
|
336
|
+
t.ne = k;
|
|
337
|
+
k.B.push(t);
|
|
335
338
|
}
|
|
336
|
-
this.B =
|
|
337
|
-
for (const e of
|
|
338
|
-
if (!e.ne) e.ne =
|
|
339
|
+
this.B = k.B;
|
|
340
|
+
for (const e of j) {
|
|
341
|
+
if (!e.ne) e.ne = k;
|
|
339
342
|
}
|
|
340
|
-
for (const e of this.G)
|
|
341
|
-
this.G =
|
|
343
|
+
for (const e of this.G) k.G.add(e);
|
|
344
|
+
this.G = k.G;
|
|
342
345
|
}
|
|
343
346
|
}
|
|
344
347
|
function insertSubs(e, t = false) {
|
|
345
|
-
const n = e.re ||
|
|
346
|
-
|
|
348
|
+
const n = e.re || q;
|
|
349
|
+
const r = e.ie !== undefined;
|
|
350
|
+
for (let i = e.O; i !== null; i = i.P) {
|
|
351
|
+
if (r && i.k.se) {
|
|
352
|
+
i.k.m |= l;
|
|
353
|
+
continue;
|
|
354
|
+
}
|
|
347
355
|
if (t && n) {
|
|
348
|
-
|
|
349
|
-
assignOrMergeLane(
|
|
356
|
+
i.k.m |= f;
|
|
357
|
+
assignOrMergeLane(i.k, n);
|
|
350
358
|
} else if (t) {
|
|
351
|
-
|
|
352
|
-
|
|
359
|
+
i.k.m |= f;
|
|
360
|
+
i.k.re = undefined;
|
|
353
361
|
}
|
|
354
|
-
const e =
|
|
355
|
-
if (e.
|
|
356
|
-
if (!e.
|
|
357
|
-
e.
|
|
358
|
-
e.
|
|
362
|
+
const e = i.k;
|
|
363
|
+
if (e.oe === y) {
|
|
364
|
+
if (!e.ue) {
|
|
365
|
+
e.ue = true;
|
|
366
|
+
e.fe.enqueue(h, e.le);
|
|
359
367
|
}
|
|
360
368
|
continue;
|
|
361
369
|
}
|
|
362
|
-
const
|
|
363
|
-
if (
|
|
364
|
-
insertIntoHeap(
|
|
370
|
+
const s = i.k.m & o ? v : x;
|
|
371
|
+
if (s.W > i.k.o) s.W = i.k.o;
|
|
372
|
+
insertIntoHeap(i.k, s);
|
|
365
373
|
}
|
|
366
374
|
}
|
|
367
375
|
function finalizePureQueue(e = null, t = false) {
|
|
368
376
|
let n = !t;
|
|
369
|
-
if (!t) checkBoundaryChildren(
|
|
370
|
-
if (
|
|
377
|
+
if (!t) checkBoundaryChildren(W);
|
|
378
|
+
if (x.S >= x.W) runHeap(x, GlobalQueue.K);
|
|
371
379
|
if (n) {
|
|
372
|
-
const t =
|
|
380
|
+
const t = W.D;
|
|
373
381
|
for (let e = 0; e < t.length; e++) {
|
|
374
382
|
const n = t[e];
|
|
375
|
-
if (n.
|
|
376
|
-
n.
|
|
377
|
-
n.
|
|
378
|
-
if (n.
|
|
383
|
+
if (n.ce !== g) {
|
|
384
|
+
n.ae = n.ce;
|
|
385
|
+
n.ce = g;
|
|
386
|
+
if (n.oe && n.oe !== y) n.ue = true;
|
|
379
387
|
}
|
|
380
|
-
n.
|
|
388
|
+
n.de &= ~d;
|
|
381
389
|
if (n.H) GlobalQueue.U(n, false, true);
|
|
382
390
|
}
|
|
383
391
|
t.length = 0;
|
|
384
|
-
const n = e ? e.B :
|
|
392
|
+
const n = e ? e.B : W.B;
|
|
385
393
|
for (let e = 0; e < n.length; e++) {
|
|
386
394
|
const t = n[e];
|
|
387
|
-
const r = t.
|
|
395
|
+
const r = t.ce;
|
|
388
396
|
t.re = undefined;
|
|
389
|
-
if (r !==
|
|
390
|
-
t.
|
|
397
|
+
if (r !== g && t.ae !== r) {
|
|
398
|
+
t.ae = r;
|
|
391
399
|
insertSubs(t, true);
|
|
392
400
|
}
|
|
393
|
-
t.
|
|
401
|
+
t.ce = g;
|
|
394
402
|
t.ne = null;
|
|
395
403
|
}
|
|
396
404
|
n.length = 0;
|
|
397
|
-
const r = e ? e.G :
|
|
405
|
+
const r = e ? e.G : W.G;
|
|
398
406
|
if (GlobalQueue.J && r.size) {
|
|
399
407
|
for (const e of r) {
|
|
400
408
|
GlobalQueue.J(e);
|
|
@@ -402,19 +410,19 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
402
410
|
r.clear();
|
|
403
411
|
schedule();
|
|
404
412
|
}
|
|
405
|
-
for (const t of
|
|
413
|
+
for (const t of j) {
|
|
406
414
|
const n = e ? t.ne === e : !t.ne;
|
|
407
415
|
if (!n) continue;
|
|
408
416
|
if (!t.R) {
|
|
409
|
-
if (t.M[0].length) runQueue(t.M[0],
|
|
410
|
-
if (t.M[1].length) runQueue(t.M[1],
|
|
417
|
+
if (t.M[0].length) runQueue(t.M[0], p);
|
|
418
|
+
if (t.M[1].length) runQueue(t.M[1], h);
|
|
411
419
|
}
|
|
412
|
-
if (t.
|
|
420
|
+
if (t.pe.re === t) t.pe.re = undefined;
|
|
413
421
|
t.T.clear();
|
|
414
422
|
t.M[0].length = 0;
|
|
415
423
|
t.M[1].length = 0;
|
|
416
|
-
|
|
417
|
-
|
|
424
|
+
j.delete(t);
|
|
425
|
+
E.delete(t.pe);
|
|
418
426
|
}
|
|
419
427
|
}
|
|
420
428
|
}
|
|
@@ -425,18 +433,18 @@ function checkBoundaryChildren(e) {
|
|
|
425
433
|
}
|
|
426
434
|
}
|
|
427
435
|
function trackOptimisticStore(e) {
|
|
428
|
-
|
|
436
|
+
W.G.add(e);
|
|
429
437
|
schedule();
|
|
430
438
|
}
|
|
431
439
|
function reassignPendingTransition(e) {
|
|
432
440
|
for (let t = 0; t < e.length; t++) {
|
|
433
|
-
e[t].ne =
|
|
441
|
+
e[t].ne = k;
|
|
434
442
|
}
|
|
435
443
|
}
|
|
436
|
-
const
|
|
444
|
+
const W = new GlobalQueue();
|
|
437
445
|
function flush() {
|
|
438
|
-
while (
|
|
439
|
-
|
|
446
|
+
while (C) {
|
|
447
|
+
W.flush();
|
|
440
448
|
}
|
|
441
449
|
}
|
|
442
450
|
function runQueue(e, t) {
|
|
@@ -448,7 +456,7 @@ function transitionComplete(e) {
|
|
|
448
456
|
let t = true;
|
|
449
457
|
for (let n = 0; n < e.Z.length; n++) {
|
|
450
458
|
const r = e.Z[n];
|
|
451
|
-
if (r.
|
|
459
|
+
if (r.de & c && r.Y?.source === r) {
|
|
452
460
|
t = false;
|
|
453
461
|
break;
|
|
454
462
|
}
|
|
@@ -461,30 +469,30 @@ function currentTransition(e) {
|
|
|
461
469
|
return e;
|
|
462
470
|
}
|
|
463
471
|
function setActiveTransition(e) {
|
|
464
|
-
|
|
472
|
+
k = e;
|
|
465
473
|
}
|
|
466
474
|
function runInTransition(e, t) {
|
|
467
|
-
const n =
|
|
475
|
+
const n = k;
|
|
468
476
|
try {
|
|
469
|
-
|
|
477
|
+
k = currentTransition(e);
|
|
470
478
|
return t();
|
|
471
479
|
} finally {
|
|
472
|
-
|
|
480
|
+
k = n;
|
|
473
481
|
}
|
|
474
482
|
}
|
|
475
|
-
const
|
|
476
|
-
const
|
|
483
|
+
const E = new WeakMap();
|
|
484
|
+
const j = new Set();
|
|
477
485
|
function getOrCreateLane(e) {
|
|
478
|
-
let t =
|
|
486
|
+
let t = E.get(e);
|
|
479
487
|
if (t) {
|
|
480
488
|
return findLane(t);
|
|
481
489
|
}
|
|
482
|
-
const n = e.
|
|
490
|
+
const n = e.he;
|
|
483
491
|
const r = n?.re ? findLane(n.re) : null;
|
|
484
|
-
t = {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
e.
|
|
492
|
+
t = { pe: e, T: new Set(), M: [[], []], R: null, ne: k, ye: r };
|
|
493
|
+
E.set(e, t);
|
|
494
|
+
j.add(t);
|
|
495
|
+
e.ge = e.Se || 0;
|
|
488
496
|
return t;
|
|
489
497
|
}
|
|
490
498
|
function findLane(e) {
|
|
@@ -505,12 +513,12 @@ function resolveLane(e) {
|
|
|
505
513
|
const t = e.re;
|
|
506
514
|
if (!t) return undefined;
|
|
507
515
|
const n = findLane(t);
|
|
508
|
-
if (
|
|
516
|
+
if (j.has(n)) return n;
|
|
509
517
|
e.re = undefined;
|
|
510
518
|
return undefined;
|
|
511
519
|
}
|
|
512
520
|
function hasActiveOverride(e) {
|
|
513
|
-
return !!(e.
|
|
521
|
+
return !!(e.we && e.ce !== g);
|
|
514
522
|
}
|
|
515
523
|
function assignOrMergeLane(e, t) {
|
|
516
524
|
const n = findLane(t);
|
|
@@ -521,11 +529,11 @@ function assignOrMergeLane(e, t) {
|
|
|
521
529
|
return;
|
|
522
530
|
}
|
|
523
531
|
const i = findLane(r);
|
|
524
|
-
if (
|
|
532
|
+
if (j.has(i)) {
|
|
525
533
|
if (i !== n && !hasActiveOverride(e)) {
|
|
526
|
-
if (n.
|
|
534
|
+
if (n.ye && findLane(n.ye) === i) {
|
|
527
535
|
e.re = t;
|
|
528
|
-
} else if (i.
|
|
536
|
+
} else if (i.ye && findLane(i.ye) === n);
|
|
529
537
|
else mergeLanes(n, i);
|
|
530
538
|
}
|
|
531
539
|
return;
|
|
@@ -538,41 +546,41 @@ function handleAsync(e, t, r) {
|
|
|
538
546
|
const s = i && untrack(() => t[Symbol.asyncIterator]);
|
|
539
547
|
const o = !s && i && untrack(() => typeof t.then === "function");
|
|
540
548
|
if (!o && !s) {
|
|
541
|
-
e.
|
|
549
|
+
e.me = null;
|
|
542
550
|
return t;
|
|
543
551
|
}
|
|
544
|
-
e.
|
|
552
|
+
e.me = t;
|
|
545
553
|
let u;
|
|
546
554
|
const handleError = n => {
|
|
547
|
-
if (e.
|
|
548
|
-
|
|
549
|
-
notifyStatus(e, n instanceof NotReadyError ?
|
|
550
|
-
e.$ =
|
|
555
|
+
if (e.me !== t) return;
|
|
556
|
+
W.initTransition(e.ne);
|
|
557
|
+
notifyStatus(e, n instanceof NotReadyError ? c : a, n);
|
|
558
|
+
e.$ = P;
|
|
551
559
|
};
|
|
552
560
|
const asyncWrite = (i, s) => {
|
|
553
|
-
if (e.
|
|
561
|
+
if (e.me !== t) return;
|
|
554
562
|
if (e.m & (n | f)) return;
|
|
555
|
-
|
|
563
|
+
W.initTransition(e.ne);
|
|
556
564
|
clearStatus(e);
|
|
557
565
|
const o = resolveLane(e);
|
|
558
566
|
if (o) o.T.delete(e);
|
|
559
567
|
if (r) r(i);
|
|
560
|
-
else if (e.
|
|
561
|
-
const t = e.
|
|
562
|
-
if (e.H) e.
|
|
568
|
+
else if (e.we) {
|
|
569
|
+
const t = e.ce !== g;
|
|
570
|
+
if (e.H) e.ce = i;
|
|
563
571
|
if (!t) {
|
|
564
|
-
e.
|
|
572
|
+
e.ae = i;
|
|
565
573
|
insertSubs(e);
|
|
566
574
|
}
|
|
567
|
-
e.$ =
|
|
575
|
+
e.$ = P;
|
|
568
576
|
} else if (o) {
|
|
569
|
-
const t = e.
|
|
570
|
-
const n = e.
|
|
577
|
+
const t = e.ae;
|
|
578
|
+
const n = e.be;
|
|
571
579
|
if (!n || !n(i, t)) {
|
|
572
|
-
e.
|
|
573
|
-
e.$ =
|
|
574
|
-
if (e.
|
|
575
|
-
setSignal(e.
|
|
580
|
+
e.ae = i;
|
|
581
|
+
e.$ = P;
|
|
582
|
+
if (e._e) {
|
|
583
|
+
setSignal(e._e, i);
|
|
576
584
|
}
|
|
577
585
|
insertSubs(e, true);
|
|
578
586
|
}
|
|
@@ -599,8 +607,8 @@ function handleAsync(e, t, r) {
|
|
|
599
607
|
);
|
|
600
608
|
r = false;
|
|
601
609
|
if (!n) {
|
|
602
|
-
|
|
603
|
-
throw new NotReadyError(
|
|
610
|
+
W.initTransition(e.ne);
|
|
611
|
+
throw new NotReadyError(M);
|
|
604
612
|
}
|
|
605
613
|
}
|
|
606
614
|
if (s) {
|
|
@@ -631,61 +639,61 @@ function handleAsync(e, t, r) {
|
|
|
631
639
|
};
|
|
632
640
|
const i = iterate();
|
|
633
641
|
if (!r && !i) {
|
|
634
|
-
|
|
635
|
-
throw new NotReadyError(
|
|
642
|
+
W.initTransition(e.ne);
|
|
643
|
+
throw new NotReadyError(M);
|
|
636
644
|
}
|
|
637
645
|
}
|
|
638
646
|
return u;
|
|
639
647
|
}
|
|
640
648
|
function clearStatus(e) {
|
|
641
|
-
e.
|
|
649
|
+
e.de = e.de & d;
|
|
642
650
|
e.Y = null;
|
|
643
651
|
updatePendingSignal(e);
|
|
644
|
-
e.
|
|
652
|
+
e.Oe?.();
|
|
645
653
|
}
|
|
646
654
|
function notifyStatus(e, t, n, r, i) {
|
|
647
|
-
if (t ===
|
|
655
|
+
if (t === a && !(n instanceof StatusError) && !(n instanceof NotReadyError))
|
|
648
656
|
n = new StatusError(e, n);
|
|
649
657
|
const s = n instanceof NotReadyError && n.source === e;
|
|
650
|
-
const o = t ===
|
|
658
|
+
const o = t === c && e.we && !s;
|
|
651
659
|
const u = o && hasActiveOverride(e);
|
|
652
660
|
if (!r) {
|
|
653
|
-
e.
|
|
661
|
+
e.de = t | (t !== a ? e.de & d : 0);
|
|
654
662
|
e.Y = n;
|
|
655
663
|
updatePendingSignal(e);
|
|
656
664
|
}
|
|
657
665
|
if (i && !r) {
|
|
658
666
|
assignOrMergeLane(e, i);
|
|
659
667
|
}
|
|
660
|
-
if (u &&
|
|
668
|
+
if (u && k && n instanceof NotReadyError) {
|
|
661
669
|
const e = n.source;
|
|
662
|
-
if (!
|
|
663
|
-
|
|
670
|
+
if (!k.Z.includes(e)) {
|
|
671
|
+
k.Z.push(e);
|
|
664
672
|
}
|
|
665
673
|
}
|
|
666
674
|
const f = r || u;
|
|
667
|
-
const
|
|
668
|
-
if (e.
|
|
675
|
+
const l = r || o ? undefined : i;
|
|
676
|
+
if (e.Oe) {
|
|
669
677
|
if (f) {
|
|
670
|
-
e.
|
|
678
|
+
e.Oe(t, n);
|
|
671
679
|
} else {
|
|
672
|
-
e.
|
|
680
|
+
e.Oe();
|
|
673
681
|
}
|
|
674
682
|
return;
|
|
675
683
|
}
|
|
676
684
|
for (let r = e.O; r !== null; r = r.P) {
|
|
677
|
-
r.k.$ =
|
|
685
|
+
r.k.$ = P;
|
|
678
686
|
if (r.k.Y !== n) {
|
|
679
|
-
!r.k.ne &&
|
|
680
|
-
notifyStatus(r.k, t, n, f,
|
|
687
|
+
!r.k.ne && W.D.push(r.k);
|
|
688
|
+
notifyStatus(r.k, t, n, f, l);
|
|
681
689
|
}
|
|
682
690
|
}
|
|
683
691
|
for (let r = e.C; r !== null; r = r.A) {
|
|
684
692
|
for (let e = r.O; e !== null; e = e.P) {
|
|
685
|
-
e.k.$ =
|
|
693
|
+
e.k.$ = P;
|
|
686
694
|
if (e.k.Y !== n) {
|
|
687
|
-
!e.k.ne &&
|
|
688
|
-
notifyStatus(e.k, t, n, f,
|
|
695
|
+
!e.k.ne && W.D.push(e.k);
|
|
696
|
+
notifyStatus(e.k, t, n, f, l);
|
|
689
697
|
}
|
|
690
698
|
}
|
|
691
699
|
}
|
|
@@ -694,21 +702,21 @@ function unlinkSubs(e) {
|
|
|
694
702
|
const t = e.L;
|
|
695
703
|
const n = e.N;
|
|
696
704
|
const r = e.P;
|
|
697
|
-
const i = e.
|
|
698
|
-
if (r !== null) r.
|
|
699
|
-
else t.
|
|
705
|
+
const i = e.xe;
|
|
706
|
+
if (r !== null) r.xe = i;
|
|
707
|
+
else t.ve = i;
|
|
700
708
|
if (i !== null) i.P = r;
|
|
701
709
|
else {
|
|
702
710
|
t.O = r;
|
|
703
711
|
if (r === null) {
|
|
704
|
-
t.
|
|
705
|
-
t.H && !t.
|
|
712
|
+
t.Pe?.();
|
|
713
|
+
t.H && !t.ke && !(t.m & o) && unobserved(t);
|
|
706
714
|
}
|
|
707
715
|
}
|
|
708
716
|
return n;
|
|
709
717
|
}
|
|
710
718
|
function unobserved(e) {
|
|
711
|
-
deleteFromHeap(e, e.m & o ?
|
|
719
|
+
deleteFromHeap(e, e.m & o ? v : x);
|
|
712
720
|
let t = e.j;
|
|
713
721
|
while (t !== null) {
|
|
714
722
|
t = unlinkSubs(t);
|
|
@@ -717,27 +725,27 @@ function unobserved(e) {
|
|
|
717
725
|
disposeChildren(e, true);
|
|
718
726
|
}
|
|
719
727
|
function link(e, t) {
|
|
720
|
-
const n = t.
|
|
728
|
+
const n = t.Ce;
|
|
721
729
|
if (n !== null && n.L === e) return;
|
|
722
730
|
let i = null;
|
|
723
731
|
const s = t.m & r;
|
|
724
732
|
if (s) {
|
|
725
733
|
i = n !== null ? n.N : t.j;
|
|
726
734
|
if (i !== null && i.L === e) {
|
|
727
|
-
t.
|
|
735
|
+
t.Ce = i;
|
|
728
736
|
return;
|
|
729
737
|
}
|
|
730
738
|
}
|
|
731
|
-
const o = e.
|
|
739
|
+
const o = e.ve;
|
|
732
740
|
if (o !== null && o.k === t && (!s || isValidLink(o, t))) return;
|
|
733
|
-
const u = (t.
|
|
741
|
+
const u = (t.Ce = e.ve = { L: e, k: t, N: i, xe: o, P: null });
|
|
734
742
|
if (n !== null) n.N = u;
|
|
735
743
|
else t.j = u;
|
|
736
744
|
if (o !== null) o.P = u;
|
|
737
745
|
else e.O = u;
|
|
738
746
|
}
|
|
739
747
|
function isValidLink(e, t) {
|
|
740
|
-
const n = t.
|
|
748
|
+
const n = t.Ce;
|
|
741
749
|
if (n !== null) {
|
|
742
750
|
let r = t.j;
|
|
743
751
|
do {
|
|
@@ -748,17 +756,17 @@ function isValidLink(e, t) {
|
|
|
748
756
|
}
|
|
749
757
|
return false;
|
|
750
758
|
}
|
|
751
|
-
const
|
|
759
|
+
const N = {};
|
|
752
760
|
function markDisposal(e) {
|
|
753
|
-
let t = e.
|
|
761
|
+
let t = e.Ae;
|
|
754
762
|
while (t) {
|
|
755
763
|
t.m |= o;
|
|
756
764
|
if (t.m & i) {
|
|
757
|
-
deleteFromHeap(t,
|
|
758
|
-
insertIntoHeap(t,
|
|
765
|
+
deleteFromHeap(t, x);
|
|
766
|
+
insertIntoHeap(t, v);
|
|
759
767
|
}
|
|
760
768
|
markDisposal(t);
|
|
761
|
-
t = t.
|
|
769
|
+
t = t.We;
|
|
762
770
|
}
|
|
763
771
|
}
|
|
764
772
|
function dispose(e) {
|
|
@@ -767,39 +775,39 @@ function dispose(e) {
|
|
|
767
775
|
t = unlinkSubs(t);
|
|
768
776
|
} while (t !== null);
|
|
769
777
|
e.j = null;
|
|
770
|
-
e.
|
|
778
|
+
e.Ce = null;
|
|
771
779
|
disposeChildren(e, true);
|
|
772
780
|
}
|
|
773
781
|
function disposeChildren(e, t = false, n) {
|
|
774
782
|
if (e.m & u) return;
|
|
775
783
|
if (t) e.m = u;
|
|
776
|
-
let r = n ? e.
|
|
784
|
+
let r = n ? e.Ee : e.Ae;
|
|
777
785
|
while (r) {
|
|
778
|
-
const e = r.
|
|
786
|
+
const e = r.We;
|
|
779
787
|
if (r.j) {
|
|
780
788
|
const e = r;
|
|
781
|
-
deleteFromHeap(e, e.m & o ?
|
|
789
|
+
deleteFromHeap(e, e.m & o ? v : x);
|
|
782
790
|
let t = e.j;
|
|
783
791
|
do {
|
|
784
792
|
t = unlinkSubs(t);
|
|
785
793
|
} while (t !== null);
|
|
786
794
|
e.j = null;
|
|
787
|
-
e.
|
|
795
|
+
e.Ce = null;
|
|
788
796
|
}
|
|
789
797
|
disposeChildren(r, true);
|
|
790
798
|
r = e;
|
|
791
799
|
}
|
|
792
800
|
if (n) {
|
|
793
|
-
e.
|
|
801
|
+
e.Ee = null;
|
|
794
802
|
} else {
|
|
795
|
-
e.
|
|
796
|
-
e.
|
|
797
|
-
e.
|
|
803
|
+
e.Ae = null;
|
|
804
|
+
e.We = null;
|
|
805
|
+
e.je = 0;
|
|
798
806
|
}
|
|
799
807
|
runDisposal(e, n);
|
|
800
808
|
}
|
|
801
809
|
function runDisposal(e, t) {
|
|
802
|
-
let n = t ? e.
|
|
810
|
+
let n = t ? e.Ne : e.Le;
|
|
803
811
|
if (!n) return;
|
|
804
812
|
if (Array.isArray(n)) {
|
|
805
813
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -809,12 +817,12 @@ function runDisposal(e, t) {
|
|
|
809
817
|
} else {
|
|
810
818
|
n.call(n);
|
|
811
819
|
}
|
|
812
|
-
t ? (e.
|
|
820
|
+
t ? (e.Ne = null) : (e.Le = null);
|
|
813
821
|
}
|
|
814
822
|
function childId(e, t) {
|
|
815
823
|
let n = e;
|
|
816
|
-
while (n.
|
|
817
|
-
if (n.id != null) return formatId(n.id, t ? n.
|
|
824
|
+
while (n.Ie && n.i) n = n.i;
|
|
825
|
+
if (n.id != null) return formatId(n.id, t ? n.je++ : n.je);
|
|
818
826
|
throw new Error("Cannot get child id from owner without an id");
|
|
819
827
|
}
|
|
820
828
|
function getNextChildId(e) {
|
|
@@ -829,47 +837,50 @@ function formatId(e, t) {
|
|
|
829
837
|
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
830
838
|
}
|
|
831
839
|
function getObserver() {
|
|
832
|
-
if (
|
|
833
|
-
return
|
|
840
|
+
if (R || T) return N;
|
|
841
|
+
return L ? M : null;
|
|
834
842
|
}
|
|
835
843
|
function getOwner() {
|
|
836
|
-
return
|
|
844
|
+
return M;
|
|
837
845
|
}
|
|
838
846
|
function onCleanup(e) {
|
|
839
|
-
if (!
|
|
840
|
-
if (!
|
|
841
|
-
else if (Array.isArray(
|
|
842
|
-
else
|
|
847
|
+
if (!M) return e;
|
|
848
|
+
if (!M.Le) M.Le = e;
|
|
849
|
+
else if (Array.isArray(M.Le)) M.Le.push(e);
|
|
850
|
+
else M.Le = [M.Le, e];
|
|
843
851
|
return e;
|
|
844
852
|
}
|
|
853
|
+
function isDisposed(e) {
|
|
854
|
+
return !!(e.m & (u | o));
|
|
855
|
+
}
|
|
845
856
|
function createOwner(e) {
|
|
846
|
-
const t =
|
|
857
|
+
const t = M;
|
|
847
858
|
const n = e?.transparent ?? false;
|
|
848
859
|
const r = {
|
|
849
860
|
id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
|
|
850
|
-
|
|
861
|
+
Ie: n || undefined,
|
|
851
862
|
t: true,
|
|
852
863
|
u: t?.t ? t.u : t,
|
|
853
|
-
ke: null,
|
|
854
|
-
Ce: null,
|
|
855
|
-
je: null,
|
|
856
|
-
oe: t?.oe ?? k,
|
|
857
|
-
Le: t?.Le || w,
|
|
858
|
-
We: 0,
|
|
859
|
-
Ee: null,
|
|
860
864
|
Ae: null,
|
|
865
|
+
We: null,
|
|
866
|
+
Le: null,
|
|
867
|
+
fe: t?.fe ?? W,
|
|
868
|
+
He: t?.He || b,
|
|
869
|
+
je: 0,
|
|
870
|
+
Ne: null,
|
|
871
|
+
Ee: null,
|
|
861
872
|
i: t,
|
|
862
873
|
dispose(e = true) {
|
|
863
874
|
disposeChildren(r, e);
|
|
864
875
|
}
|
|
865
876
|
};
|
|
866
877
|
if (t) {
|
|
867
|
-
const e = t.
|
|
878
|
+
const e = t.Ae;
|
|
868
879
|
if (e === null) {
|
|
869
|
-
t.
|
|
880
|
+
t.Ae = r;
|
|
870
881
|
} else {
|
|
871
|
-
r.
|
|
872
|
-
t.
|
|
882
|
+
r.We = e;
|
|
883
|
+
t.Ae = r;
|
|
873
884
|
}
|
|
874
885
|
}
|
|
875
886
|
return r;
|
|
@@ -883,154 +894,206 @@ function effect(e, t, n, r, i) {
|
|
|
883
894
|
const o = computed(i?.render ? t => staleValues(() => e(t)) : e, r, {
|
|
884
895
|
...i,
|
|
885
896
|
equals: () => {
|
|
886
|
-
o.
|
|
887
|
-
if (s) o.
|
|
897
|
+
o.ue = !o.Y;
|
|
898
|
+
if (s) o.fe.enqueue(o.oe, runEffect.bind(o));
|
|
888
899
|
return false;
|
|
889
900
|
},
|
|
890
901
|
lazy: true
|
|
891
902
|
});
|
|
892
|
-
o.
|
|
893
|
-
o.
|
|
894
|
-
o.
|
|
895
|
-
o.
|
|
896
|
-
o.
|
|
897
|
-
o.
|
|
898
|
-
const n = e !== undefined ? e : o.
|
|
903
|
+
o.Re = r;
|
|
904
|
+
o.Qe = t;
|
|
905
|
+
o.Te = n;
|
|
906
|
+
o.Me = undefined;
|
|
907
|
+
o.oe = i?.render ? p : h;
|
|
908
|
+
o.Oe = (e, t) => {
|
|
909
|
+
const n = e !== undefined ? e : o.de;
|
|
899
910
|
const r = t !== undefined ? t : o.Y;
|
|
900
|
-
if (n &
|
|
911
|
+
if (n & a) {
|
|
901
912
|
let e = r;
|
|
902
|
-
o.
|
|
903
|
-
if (o.
|
|
913
|
+
o.fe.notify(o, c, 0);
|
|
914
|
+
if (o.oe === h) {
|
|
904
915
|
try {
|
|
905
|
-
return o.
|
|
906
|
-
? o.
|
|
907
|
-
o.
|
|
908
|
-
o.
|
|
916
|
+
return o.Te
|
|
917
|
+
? o.Te(e, () => {
|
|
918
|
+
o.Me?.();
|
|
919
|
+
o.Me = undefined;
|
|
909
920
|
})
|
|
910
921
|
: console.error(e);
|
|
911
922
|
} catch (t) {
|
|
912
923
|
e = t;
|
|
913
924
|
}
|
|
914
925
|
}
|
|
915
|
-
if (!o.
|
|
916
|
-
} else if (o.
|
|
926
|
+
if (!o.fe.notify(o, a, a)) throw e;
|
|
927
|
+
} else if (o.oe === p) o.fe.notify(o, c | a, n, r);
|
|
917
928
|
};
|
|
918
929
|
recompute(o, true);
|
|
919
|
-
!i?.defer && (o.
|
|
930
|
+
!i?.defer && (o.oe === h ? o.fe.enqueue(o.oe, runEffect.bind(o)) : runEffect.call(o));
|
|
920
931
|
s = true;
|
|
921
|
-
onCleanup(() => o.
|
|
932
|
+
onCleanup(() => o.Me?.());
|
|
922
933
|
}
|
|
923
934
|
function runEffect() {
|
|
924
|
-
if (!this.
|
|
925
|
-
this.
|
|
926
|
-
this.
|
|
935
|
+
if (!this.ue || this.m & u) return;
|
|
936
|
+
this.Me?.();
|
|
937
|
+
this.Me = undefined;
|
|
927
938
|
try {
|
|
928
|
-
this.
|
|
939
|
+
this.Me = this.Qe(this.ae, this.Re);
|
|
929
940
|
} catch (e) {
|
|
930
|
-
if (!this.
|
|
941
|
+
if (!this.fe.notify(this, a, a)) throw e;
|
|
931
942
|
} finally {
|
|
932
|
-
this.
|
|
933
|
-
this.
|
|
943
|
+
this.Re = this.ae;
|
|
944
|
+
this.ue = false;
|
|
934
945
|
}
|
|
935
946
|
}
|
|
936
947
|
function trackedEffect(e, t) {
|
|
937
948
|
const run = () => {
|
|
938
|
-
if (!n.
|
|
939
|
-
n.
|
|
949
|
+
if (!n.ue || n.m & u) return;
|
|
950
|
+
n.ue = false;
|
|
940
951
|
recompute(n);
|
|
941
952
|
};
|
|
942
953
|
const n = computed(
|
|
943
954
|
() => {
|
|
944
955
|
try {
|
|
945
|
-
n.
|
|
946
|
-
n.
|
|
947
|
-
n.
|
|
956
|
+
n.Me?.();
|
|
957
|
+
n.Me = undefined;
|
|
958
|
+
n.Me = staleValues(e) || undefined;
|
|
948
959
|
} finally {
|
|
949
960
|
}
|
|
950
961
|
},
|
|
951
962
|
undefined,
|
|
952
963
|
{ ...t, lazy: true, pureWrite: true }
|
|
953
964
|
);
|
|
954
|
-
n.
|
|
955
|
-
n.
|
|
956
|
-
n.
|
|
957
|
-
n.
|
|
958
|
-
n.
|
|
959
|
-
onCleanup(() => n.
|
|
965
|
+
n.Me = undefined;
|
|
966
|
+
n.ue = true;
|
|
967
|
+
n.oe = y;
|
|
968
|
+
n.le = run;
|
|
969
|
+
n.fe.enqueue(h, run);
|
|
970
|
+
onCleanup(() => n.Me?.());
|
|
960
971
|
}
|
|
961
972
|
GlobalQueue.K = recompute;
|
|
962
973
|
GlobalQueue.U = disposeChildren;
|
|
963
|
-
let E = false;
|
|
964
|
-
let j = false;
|
|
965
|
-
let N = false;
|
|
966
974
|
let L = false;
|
|
967
975
|
let I = false;
|
|
968
976
|
let H = false;
|
|
969
|
-
let
|
|
970
|
-
let
|
|
977
|
+
let R = false;
|
|
978
|
+
let Q = false;
|
|
979
|
+
let T = false;
|
|
980
|
+
let M = null;
|
|
981
|
+
let q = null;
|
|
982
|
+
let F = false;
|
|
983
|
+
let V = null;
|
|
984
|
+
function ownerInSnapshotScope(e) {
|
|
985
|
+
while (e) {
|
|
986
|
+
if (e.qe) return true;
|
|
987
|
+
e = e.i;
|
|
988
|
+
}
|
|
989
|
+
return false;
|
|
990
|
+
}
|
|
991
|
+
function setSnapshotCapture(e) {
|
|
992
|
+
F = e;
|
|
993
|
+
if (e && !V) V = new Set();
|
|
994
|
+
}
|
|
995
|
+
function markSnapshotScope(e) {
|
|
996
|
+
e.qe = true;
|
|
997
|
+
}
|
|
998
|
+
function releaseSnapshotScope(e) {
|
|
999
|
+
e.qe = false;
|
|
1000
|
+
releaseSubtree(e);
|
|
1001
|
+
schedule();
|
|
1002
|
+
}
|
|
1003
|
+
function releaseSubtree(e) {
|
|
1004
|
+
let t = e.Ae;
|
|
1005
|
+
while (t) {
|
|
1006
|
+
if (t.qe) {
|
|
1007
|
+
t = t.We;
|
|
1008
|
+
continue;
|
|
1009
|
+
}
|
|
1010
|
+
if (t.H) {
|
|
1011
|
+
const e = t;
|
|
1012
|
+
e.se = false;
|
|
1013
|
+
if (e.m & l) {
|
|
1014
|
+
e.m &= ~l;
|
|
1015
|
+
e.m |= n;
|
|
1016
|
+
if (x.W > e.o) x.W = e.o;
|
|
1017
|
+
insertIntoHeap(e, x);
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
releaseSubtree(t);
|
|
1021
|
+
t = t.We;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
function clearSnapshots() {
|
|
1025
|
+
if (V) {
|
|
1026
|
+
for (const e of V) {
|
|
1027
|
+
delete e.ie;
|
|
1028
|
+
delete e[w];
|
|
1029
|
+
}
|
|
1030
|
+
V = null;
|
|
1031
|
+
}
|
|
1032
|
+
F = false;
|
|
1033
|
+
}
|
|
971
1034
|
function recompute(t, n = false) {
|
|
972
|
-
const i = t.
|
|
1035
|
+
const i = t.oe;
|
|
973
1036
|
if (!n) {
|
|
974
|
-
if (t.ne && (!i ||
|
|
975
|
-
deleteFromHeap(t, t.m & o ?
|
|
976
|
-
if (t.ne || i ===
|
|
1037
|
+
if (t.ne && (!i || k) && k !== t.ne) W.initTransition(t.ne);
|
|
1038
|
+
deleteFromHeap(t, t.m & o ? v : x);
|
|
1039
|
+
if (t.ne || i === y) disposeChildren(t);
|
|
977
1040
|
else {
|
|
978
1041
|
markDisposal(t);
|
|
979
|
-
t.
|
|
980
|
-
t.
|
|
981
|
-
t.
|
|
982
|
-
t.
|
|
983
|
-
t.
|
|
1042
|
+
t.Ne = t.Le;
|
|
1043
|
+
t.Ee = t.Ae;
|
|
1044
|
+
t.Le = null;
|
|
1045
|
+
t.Ae = null;
|
|
1046
|
+
t.je = 0;
|
|
984
1047
|
}
|
|
985
1048
|
}
|
|
986
1049
|
const s = !!(t.m & f);
|
|
987
1050
|
const u = hasActiveOverride(t);
|
|
988
|
-
const
|
|
989
|
-
const
|
|
990
|
-
|
|
991
|
-
t.
|
|
1051
|
+
const d = !!(t.de & c);
|
|
1052
|
+
const p = M;
|
|
1053
|
+
M = t;
|
|
1054
|
+
t.Ce = null;
|
|
992
1055
|
t.m = r;
|
|
993
|
-
t.$ =
|
|
994
|
-
let
|
|
995
|
-
let
|
|
996
|
-
let w =
|
|
997
|
-
let
|
|
998
|
-
|
|
1056
|
+
t.$ = P;
|
|
1057
|
+
let h = t.ce === g ? t.ae : t.ce;
|
|
1058
|
+
let S = t.o;
|
|
1059
|
+
let w = L;
|
|
1060
|
+
let m = q;
|
|
1061
|
+
L = true;
|
|
999
1062
|
if (s) {
|
|
1000
1063
|
const e = resolveLane(t);
|
|
1001
|
-
if (e)
|
|
1064
|
+
if (e) q = e;
|
|
1002
1065
|
}
|
|
1003
1066
|
try {
|
|
1004
|
-
|
|
1067
|
+
h = handleAsync(t, t.H(h));
|
|
1005
1068
|
clearStatus(t);
|
|
1006
1069
|
const e = resolveLane(t);
|
|
1007
1070
|
if (e) {
|
|
1008
1071
|
e.T.delete(t);
|
|
1009
|
-
updatePendingSignal(e.
|
|
1072
|
+
updatePendingSignal(e.pe);
|
|
1010
1073
|
}
|
|
1011
1074
|
} catch (e) {
|
|
1012
|
-
if (e instanceof NotReadyError &&
|
|
1013
|
-
const e = findLane(
|
|
1014
|
-
if (e.
|
|
1075
|
+
if (e instanceof NotReadyError && q) {
|
|
1076
|
+
const e = findLane(q);
|
|
1077
|
+
if (e.pe !== t) {
|
|
1015
1078
|
e.T.add(t);
|
|
1016
1079
|
t.re = e;
|
|
1017
|
-
updatePendingSignal(e.
|
|
1080
|
+
updatePendingSignal(e.pe);
|
|
1018
1081
|
}
|
|
1019
1082
|
}
|
|
1020
1083
|
notifyStatus(
|
|
1021
1084
|
t,
|
|
1022
|
-
e instanceof NotReadyError ?
|
|
1085
|
+
e instanceof NotReadyError ? c : a,
|
|
1023
1086
|
e,
|
|
1024
1087
|
undefined,
|
|
1025
1088
|
e instanceof NotReadyError ? t.re : undefined
|
|
1026
1089
|
);
|
|
1027
1090
|
} finally {
|
|
1028
|
-
|
|
1029
|
-
t.m = e;
|
|
1030
|
-
|
|
1091
|
+
L = w;
|
|
1092
|
+
t.m = e | (n ? t.m & l : 0);
|
|
1093
|
+
M = p;
|
|
1031
1094
|
}
|
|
1032
1095
|
if (!t.Y) {
|
|
1033
|
-
const e = t.
|
|
1096
|
+
const e = t.Ce;
|
|
1034
1097
|
let r = e !== null ? e.N : t.j;
|
|
1035
1098
|
if (r !== null) {
|
|
1036
1099
|
do {
|
|
@@ -1039,31 +1102,31 @@ function recompute(t, n = false) {
|
|
|
1039
1102
|
if (e !== null) e.N = null;
|
|
1040
1103
|
else t.j = null;
|
|
1041
1104
|
}
|
|
1042
|
-
const f = u ? t.
|
|
1043
|
-
const l = !t.
|
|
1105
|
+
const f = u ? t.ae : t.ce === g ? t.ae : t.ce;
|
|
1106
|
+
const l = !t.be || !t.be(f, h);
|
|
1044
1107
|
if (l) {
|
|
1045
|
-
const e = u ? t.
|
|
1046
|
-
if (n || (i &&
|
|
1047
|
-
else t.
|
|
1048
|
-
if (u && !s &&
|
|
1049
|
-
const e = t.
|
|
1050
|
-
const n = t.
|
|
1051
|
-
if (e <= n) t.
|
|
1052
|
-
}
|
|
1053
|
-
if (!u || s || t.
|
|
1108
|
+
const e = u ? t.ae : undefined;
|
|
1109
|
+
if (n || (i && k !== t.ne) || s) t.ae = h;
|
|
1110
|
+
else t.ce = h;
|
|
1111
|
+
if (u && !s && d) {
|
|
1112
|
+
const e = t.Se || 0;
|
|
1113
|
+
const n = t.ge || 0;
|
|
1114
|
+
if (e <= n) t.ae = h;
|
|
1115
|
+
}
|
|
1116
|
+
if (!u || s || t.ae !== e) {
|
|
1054
1117
|
insertSubs(t, s || u);
|
|
1055
1118
|
}
|
|
1056
1119
|
} else if (u) {
|
|
1057
|
-
t.
|
|
1058
|
-
} else if (t.o !=
|
|
1120
|
+
t.ce = h;
|
|
1121
|
+
} else if (t.o != S) {
|
|
1059
1122
|
for (let e = t.O; e !== null; e = e.P) {
|
|
1060
|
-
insertIntoHeapHeight(e.k, e.k.m & o ?
|
|
1123
|
+
insertIntoHeapHeight(e.k, e.k.m & o ? v : x);
|
|
1061
1124
|
}
|
|
1062
1125
|
}
|
|
1063
1126
|
}
|
|
1064
|
-
|
|
1065
|
-
(!n || t.
|
|
1066
|
-
t.ne && i &&
|
|
1127
|
+
q = m;
|
|
1128
|
+
(!n || t.de & c) && !t.ne && !(k && t.we) && W.D.push(t);
|
|
1129
|
+
t.ne && i && k !== t.ne && runInTransition(t.ne, () => recompute(t));
|
|
1067
1130
|
}
|
|
1068
1131
|
function updateIfNecessary(r) {
|
|
1069
1132
|
if (r.m & t) {
|
|
@@ -1078,138 +1141,156 @@ function updateIfNecessary(r) {
|
|
|
1078
1141
|
}
|
|
1079
1142
|
}
|
|
1080
1143
|
}
|
|
1081
|
-
if (r.m & (n | f) || (r.Y && r.$ <
|
|
1144
|
+
if (r.m & (n | f) || (r.Y && r.$ < P)) {
|
|
1082
1145
|
recompute(r);
|
|
1083
1146
|
}
|
|
1084
|
-
r.m = e;
|
|
1147
|
+
r.m = e | (r.m & l);
|
|
1085
1148
|
}
|
|
1086
1149
|
function computed(t, n, r) {
|
|
1087
1150
|
const i = r?.transparent ?? false;
|
|
1088
1151
|
const s = {
|
|
1089
|
-
id: r?.id ?? (i ?
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1152
|
+
id: r?.id ?? (i ? M?.id : M?.id != null ? getNextChildId(M) : undefined),
|
|
1153
|
+
Ie: i || undefined,
|
|
1154
|
+
be: r?.equals != null ? r.equals : isEqual,
|
|
1155
|
+
Fe: !!r?.pureWrite,
|
|
1156
|
+
Pe: r?.unobserved,
|
|
1157
|
+
Le: null,
|
|
1158
|
+
fe: M?.fe ?? W,
|
|
1159
|
+
He: M?.He ?? b,
|
|
1160
|
+
je: 0,
|
|
1098
1161
|
H: t,
|
|
1099
|
-
|
|
1162
|
+
ae: n,
|
|
1100
1163
|
o: 0,
|
|
1101
1164
|
C: null,
|
|
1102
1165
|
h: undefined,
|
|
1103
1166
|
p: null,
|
|
1104
1167
|
j: null,
|
|
1105
|
-
Pe: null,
|
|
1106
|
-
O: null,
|
|
1107
|
-
Oe: null,
|
|
1108
|
-
i: Q,
|
|
1109
1168
|
Ce: null,
|
|
1110
|
-
|
|
1169
|
+
O: null,
|
|
1170
|
+
ve: null,
|
|
1171
|
+
i: M,
|
|
1172
|
+
We: null,
|
|
1173
|
+
Ae: null,
|
|
1111
1174
|
m: e,
|
|
1112
|
-
|
|
1113
|
-
$:
|
|
1114
|
-
|
|
1175
|
+
de: d,
|
|
1176
|
+
$: P,
|
|
1177
|
+
ce: g,
|
|
1178
|
+
Ne: null,
|
|
1115
1179
|
Ee: null,
|
|
1116
|
-
|
|
1117
|
-
we: null,
|
|
1180
|
+
me: null,
|
|
1118
1181
|
ne: null
|
|
1119
1182
|
};
|
|
1120
1183
|
s.p = s;
|
|
1121
|
-
const o =
|
|
1122
|
-
if (
|
|
1123
|
-
const e =
|
|
1184
|
+
const o = M?.t ? M.u : M;
|
|
1185
|
+
if (M) {
|
|
1186
|
+
const e = M.Ae;
|
|
1124
1187
|
if (e === null) {
|
|
1125
|
-
|
|
1188
|
+
M.Ae = s;
|
|
1126
1189
|
} else {
|
|
1127
|
-
s.
|
|
1128
|
-
|
|
1190
|
+
s.We = e;
|
|
1191
|
+
M.Ae = s;
|
|
1129
1192
|
}
|
|
1130
1193
|
}
|
|
1131
1194
|
if (o) s.o = o.o + 1;
|
|
1195
|
+
if (F && ownerInSnapshotScope(M)) s.se = true;
|
|
1132
1196
|
!r?.lazy && recompute(s, true);
|
|
1197
|
+
if (F && !r?.lazy) {
|
|
1198
|
+
if (!(s.de & c)) {
|
|
1199
|
+
s.ie = s.ae === undefined ? S : s.ae;
|
|
1200
|
+
V.add(s);
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1133
1203
|
return s;
|
|
1134
1204
|
}
|
|
1135
1205
|
function signal(e, t, n = null) {
|
|
1136
1206
|
const r = {
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1207
|
+
be: t?.equals != null ? t.equals : isEqual,
|
|
1208
|
+
Fe: !!t?.pureWrite,
|
|
1209
|
+
Pe: t?.unobserved,
|
|
1210
|
+
ae: e,
|
|
1141
1211
|
O: null,
|
|
1142
|
-
|
|
1143
|
-
$:
|
|
1212
|
+
ve: null,
|
|
1213
|
+
$: P,
|
|
1144
1214
|
I: n,
|
|
1145
1215
|
A: n?.C || null,
|
|
1146
|
-
|
|
1216
|
+
ce: g
|
|
1147
1217
|
};
|
|
1148
1218
|
n && (n.C = r);
|
|
1219
|
+
if (F && !r.Fe) {
|
|
1220
|
+
r.ie = e === undefined ? S : e;
|
|
1221
|
+
V.add(r);
|
|
1222
|
+
}
|
|
1149
1223
|
return r;
|
|
1150
1224
|
}
|
|
1151
1225
|
function optimisticSignal(e, t) {
|
|
1152
1226
|
const n = signal(e, t);
|
|
1153
|
-
n.
|
|
1227
|
+
n.we = true;
|
|
1154
1228
|
return n;
|
|
1155
1229
|
}
|
|
1156
1230
|
function optimisticComputed(e, t, n) {
|
|
1157
1231
|
const r = computed(e, t, n);
|
|
1158
|
-
r.
|
|
1232
|
+
r.we = true;
|
|
1159
1233
|
return r;
|
|
1160
1234
|
}
|
|
1161
1235
|
function isEqual(e, t) {
|
|
1162
1236
|
return e === t;
|
|
1163
1237
|
}
|
|
1164
1238
|
function untrack(e) {
|
|
1165
|
-
if (!
|
|
1166
|
-
|
|
1239
|
+
if (!L) return e();
|
|
1240
|
+
L = false;
|
|
1167
1241
|
try {
|
|
1168
1242
|
return e();
|
|
1169
1243
|
} finally {
|
|
1170
|
-
|
|
1244
|
+
L = true;
|
|
1171
1245
|
}
|
|
1172
1246
|
}
|
|
1173
1247
|
function read(e) {
|
|
1174
|
-
if (
|
|
1248
|
+
if (T) {
|
|
1175
1249
|
const t = getPendingValueComputed(e);
|
|
1176
|
-
const n =
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1250
|
+
const n = T;
|
|
1251
|
+
T = false;
|
|
1252
|
+
let r;
|
|
1253
|
+
try {
|
|
1254
|
+
r = read(t);
|
|
1255
|
+
} catch (t) {
|
|
1256
|
+
if (!M && t instanceof NotReadyError) return e.ae;
|
|
1257
|
+
throw t;
|
|
1258
|
+
} finally {
|
|
1259
|
+
T = n;
|
|
1260
|
+
}
|
|
1261
|
+
if (t.de & c) return e.ae;
|
|
1262
|
+
if (I && q && t.re) {
|
|
1182
1263
|
const n = findLane(t.re);
|
|
1183
|
-
const r = findLane(
|
|
1264
|
+
const r = findLane(q);
|
|
1184
1265
|
if (n !== r && n.T.size > 0) {
|
|
1185
|
-
return e.
|
|
1266
|
+
return e.ae;
|
|
1186
1267
|
}
|
|
1187
1268
|
}
|
|
1188
1269
|
return r;
|
|
1189
1270
|
}
|
|
1190
|
-
if (
|
|
1271
|
+
if (R) {
|
|
1191
1272
|
const t = e.I || e;
|
|
1192
1273
|
const n = getPendingSignal(t);
|
|
1193
|
-
const r =
|
|
1194
|
-
|
|
1274
|
+
const r = R;
|
|
1275
|
+
R = false;
|
|
1195
1276
|
if (read(n)) {
|
|
1196
|
-
|
|
1277
|
+
Q = true;
|
|
1197
1278
|
}
|
|
1198
|
-
|
|
1199
|
-
return e.
|
|
1279
|
+
R = r;
|
|
1280
|
+
return e.ae;
|
|
1200
1281
|
}
|
|
1201
|
-
let t =
|
|
1282
|
+
let t = M;
|
|
1202
1283
|
if (t?.t) t = t.u;
|
|
1203
|
-
if (
|
|
1204
|
-
if (t &&
|
|
1284
|
+
if (H && e.H) recompute(e);
|
|
1285
|
+
if (t && L) {
|
|
1205
1286
|
if (e.H && e.m & u) recompute(e);
|
|
1206
1287
|
link(e, t);
|
|
1207
1288
|
const n = e.I || e;
|
|
1208
1289
|
if (n.H) {
|
|
1209
1290
|
const r = e.m & o;
|
|
1210
|
-
if (n.o >= (r ?
|
|
1291
|
+
if (n.o >= (r ? v.W : x.W)) {
|
|
1211
1292
|
markNode(t);
|
|
1212
|
-
markHeap(r ?
|
|
1293
|
+
markHeap(r ? v : x);
|
|
1213
1294
|
updateIfNecessary(n);
|
|
1214
1295
|
}
|
|
1215
1296
|
const i = n.o;
|
|
@@ -1219,107 +1300,120 @@ function read(e) {
|
|
|
1219
1300
|
}
|
|
1220
1301
|
}
|
|
1221
1302
|
const n = e.I || e;
|
|
1222
|
-
if (
|
|
1223
|
-
if (
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
if (
|
|
1303
|
+
if (n.de & c) {
|
|
1304
|
+
if (t && !(I && n.ne && k !== n.ne)) {
|
|
1305
|
+
if (q) {
|
|
1306
|
+
const r = n.re;
|
|
1307
|
+
const i = findLane(q);
|
|
1308
|
+
if (r && findLane(r) === i && !hasActiveOverride(n)) {
|
|
1309
|
+
if (!L) link(e, t);
|
|
1310
|
+
throw n.Y;
|
|
1311
|
+
}
|
|
1312
|
+
} else {
|
|
1313
|
+
if (!L) link(e, t);
|
|
1228
1314
|
throw n.Y;
|
|
1229
1315
|
}
|
|
1230
|
-
} else {
|
|
1231
|
-
if (!E) link(e, t);
|
|
1316
|
+
} else if (!t && n.de & d) {
|
|
1232
1317
|
throw n.Y;
|
|
1233
1318
|
}
|
|
1234
1319
|
}
|
|
1235
|
-
if (e.H && e.
|
|
1236
|
-
if (e.$ <
|
|
1320
|
+
if (e.H && e.de & a) {
|
|
1321
|
+
if (e.$ < P) {
|
|
1237
1322
|
recompute(e, true);
|
|
1238
1323
|
return read(e);
|
|
1239
1324
|
} else throw e.Y;
|
|
1240
1325
|
}
|
|
1241
|
-
|
|
1326
|
+
if (F && t && t.se) {
|
|
1327
|
+
const n = e.ie;
|
|
1328
|
+
if (n !== undefined) {
|
|
1329
|
+
const r = n === S ? undefined : n;
|
|
1330
|
+
const i = e.ce !== g ? e.ce : e.ae;
|
|
1331
|
+
if (i !== r) t.m |= l;
|
|
1332
|
+
return r;
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
return !t || q !== null || e.ce === g || (I && e.ne && k !== e.ne) ? e.ae : e.ce;
|
|
1242
1336
|
}
|
|
1243
1337
|
function setSignal(e, t) {
|
|
1244
|
-
if (e.ne &&
|
|
1245
|
-
const n = e.
|
|
1246
|
-
const r = n ? e.
|
|
1338
|
+
if (e.ne && k !== e.ne) W.initTransition(e.ne);
|
|
1339
|
+
const n = e.we && !A;
|
|
1340
|
+
const r = n ? e.ae : e.ce === g ? e.ae : e.ce;
|
|
1247
1341
|
if (typeof t === "function") t = t(r);
|
|
1248
|
-
const i = !e.
|
|
1342
|
+
const i = !e.be || !e.be(r, t);
|
|
1249
1343
|
if (!i) {
|
|
1250
|
-
if (n && e.
|
|
1344
|
+
if (n && e.ce !== g && e.H) {
|
|
1251
1345
|
insertSubs(e, true);
|
|
1252
1346
|
schedule();
|
|
1253
1347
|
}
|
|
1254
1348
|
return t;
|
|
1255
1349
|
}
|
|
1256
1350
|
if (n) {
|
|
1257
|
-
const n =
|
|
1351
|
+
const n = W.B.includes(e);
|
|
1258
1352
|
if (e.ne && n) {
|
|
1259
|
-
|
|
1353
|
+
W.initTransition(e.ne);
|
|
1260
1354
|
}
|
|
1261
|
-
if (e.
|
|
1262
|
-
e.
|
|
1355
|
+
if (e.ce === g) {
|
|
1356
|
+
e.ce = e.ae;
|
|
1263
1357
|
}
|
|
1264
1358
|
if (!n) {
|
|
1265
|
-
|
|
1359
|
+
W.B.push(e);
|
|
1266
1360
|
}
|
|
1267
|
-
e.
|
|
1361
|
+
e.Se = (e.Se || 0) + 1;
|
|
1268
1362
|
const r = getOrCreateLane(e);
|
|
1269
1363
|
e.re = r;
|
|
1270
|
-
e.
|
|
1364
|
+
e.ae = t;
|
|
1271
1365
|
} else {
|
|
1272
|
-
if (e.
|
|
1273
|
-
e.
|
|
1366
|
+
if (e.ce === g) W.D.push(e);
|
|
1367
|
+
e.ce = t;
|
|
1274
1368
|
}
|
|
1275
1369
|
updatePendingSignal(e);
|
|
1276
|
-
if (e.
|
|
1277
|
-
setSignal(e.
|
|
1370
|
+
if (e._e) {
|
|
1371
|
+
setSignal(e._e, t);
|
|
1278
1372
|
}
|
|
1279
|
-
e.$ =
|
|
1373
|
+
e.$ = P;
|
|
1280
1374
|
insertSubs(e, n);
|
|
1281
1375
|
schedule();
|
|
1282
1376
|
return t;
|
|
1283
1377
|
}
|
|
1284
1378
|
function runWithOwner(e, t) {
|
|
1285
|
-
const n =
|
|
1286
|
-
const r =
|
|
1287
|
-
|
|
1288
|
-
|
|
1379
|
+
const n = M;
|
|
1380
|
+
const r = L;
|
|
1381
|
+
M = e;
|
|
1382
|
+
L = false;
|
|
1289
1383
|
try {
|
|
1290
1384
|
return t();
|
|
1291
1385
|
} finally {
|
|
1292
|
-
|
|
1293
|
-
|
|
1386
|
+
M = n;
|
|
1387
|
+
L = r;
|
|
1294
1388
|
}
|
|
1295
1389
|
}
|
|
1296
1390
|
function getPendingSignal(e) {
|
|
1297
|
-
if (!e.
|
|
1298
|
-
e.
|
|
1299
|
-
if (e.
|
|
1300
|
-
e.
|
|
1391
|
+
if (!e.Ve) {
|
|
1392
|
+
e.Ve = optimisticSignal(false, { pureWrite: true });
|
|
1393
|
+
if (e.he) {
|
|
1394
|
+
e.Ve.he = e;
|
|
1301
1395
|
}
|
|
1302
|
-
if (computePendingState(e)) setSignal(e.
|
|
1396
|
+
if (computePendingState(e)) setSignal(e.Ve, true);
|
|
1303
1397
|
}
|
|
1304
|
-
return e.
|
|
1398
|
+
return e.Ve;
|
|
1305
1399
|
}
|
|
1306
1400
|
function computePendingState(e) {
|
|
1307
1401
|
const t = e;
|
|
1308
|
-
if (e.
|
|
1309
|
-
if (t.
|
|
1310
|
-
if (e.
|
|
1402
|
+
if (e.we && e.ce !== g) {
|
|
1403
|
+
if (t.de & c && !(t.de & d)) return true;
|
|
1404
|
+
if (e.he) {
|
|
1311
1405
|
const t = e.re ? findLane(e.re) : null;
|
|
1312
1406
|
return !!(t && t.T.size > 0);
|
|
1313
1407
|
}
|
|
1314
1408
|
return true;
|
|
1315
1409
|
}
|
|
1316
|
-
if (e.
|
|
1317
|
-
return !!(t.
|
|
1410
|
+
if (e.ce !== g && !(t.de & d)) return true;
|
|
1411
|
+
return !!(t.de & c && !(t.de & d));
|
|
1318
1412
|
}
|
|
1319
1413
|
function updatePendingSignal(e) {
|
|
1320
|
-
if (e.
|
|
1414
|
+
if (e.Ve) {
|
|
1321
1415
|
const t = computePendingState(e);
|
|
1322
|
-
const n = e.
|
|
1416
|
+
const n = e.Ve;
|
|
1323
1417
|
setSignal(n, t);
|
|
1324
1418
|
if (!t && n.re) {
|
|
1325
1419
|
const t = resolveLane(e);
|
|
@@ -1329,78 +1423,78 @@ function updatePendingSignal(e) {
|
|
|
1329
1423
|
mergeLanes(t, e);
|
|
1330
1424
|
}
|
|
1331
1425
|
}
|
|
1332
|
-
|
|
1426
|
+
E.delete(n);
|
|
1333
1427
|
n.re = undefined;
|
|
1334
1428
|
}
|
|
1335
1429
|
}
|
|
1336
1430
|
}
|
|
1337
1431
|
function getPendingValueComputed(e) {
|
|
1338
|
-
if (!e.
|
|
1339
|
-
const t =
|
|
1340
|
-
|
|
1341
|
-
const n =
|
|
1342
|
-
|
|
1343
|
-
const r =
|
|
1344
|
-
|
|
1345
|
-
e.
|
|
1346
|
-
e.
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
}
|
|
1351
|
-
return e.
|
|
1432
|
+
if (!e._e) {
|
|
1433
|
+
const t = T;
|
|
1434
|
+
T = false;
|
|
1435
|
+
const n = R;
|
|
1436
|
+
R = false;
|
|
1437
|
+
const r = M;
|
|
1438
|
+
M = null;
|
|
1439
|
+
e._e = optimisticComputed(() => read(e));
|
|
1440
|
+
e._e.he = e;
|
|
1441
|
+
M = r;
|
|
1442
|
+
R = n;
|
|
1443
|
+
T = t;
|
|
1444
|
+
}
|
|
1445
|
+
return e._e;
|
|
1352
1446
|
}
|
|
1353
1447
|
function staleValues(e, t = true) {
|
|
1354
|
-
const n =
|
|
1355
|
-
|
|
1448
|
+
const n = I;
|
|
1449
|
+
I = t;
|
|
1356
1450
|
try {
|
|
1357
1451
|
return e();
|
|
1358
1452
|
} finally {
|
|
1359
|
-
|
|
1453
|
+
I = n;
|
|
1360
1454
|
}
|
|
1361
1455
|
}
|
|
1362
1456
|
function pending(e) {
|
|
1363
|
-
const t =
|
|
1364
|
-
|
|
1457
|
+
const t = T;
|
|
1458
|
+
T = true;
|
|
1365
1459
|
try {
|
|
1366
1460
|
return e();
|
|
1367
1461
|
} finally {
|
|
1368
|
-
|
|
1462
|
+
T = t;
|
|
1369
1463
|
}
|
|
1370
1464
|
}
|
|
1371
1465
|
function isPending(e) {
|
|
1372
|
-
const t =
|
|
1373
|
-
const n =
|
|
1374
|
-
|
|
1375
|
-
|
|
1466
|
+
const t = R;
|
|
1467
|
+
const n = Q;
|
|
1468
|
+
R = true;
|
|
1469
|
+
Q = false;
|
|
1376
1470
|
try {
|
|
1377
1471
|
e();
|
|
1378
|
-
return
|
|
1472
|
+
return Q;
|
|
1379
1473
|
} catch {
|
|
1380
|
-
return
|
|
1474
|
+
return Q;
|
|
1381
1475
|
} finally {
|
|
1382
|
-
|
|
1383
|
-
|
|
1476
|
+
R = t;
|
|
1477
|
+
Q = n;
|
|
1384
1478
|
}
|
|
1385
1479
|
}
|
|
1386
1480
|
function refresh(e) {
|
|
1387
|
-
let t =
|
|
1388
|
-
|
|
1481
|
+
let t = H;
|
|
1482
|
+
H = true;
|
|
1389
1483
|
try {
|
|
1390
1484
|
if (typeof e !== "function") {
|
|
1391
|
-
recompute(e[
|
|
1485
|
+
recompute(e[_]);
|
|
1392
1486
|
return e;
|
|
1393
1487
|
}
|
|
1394
1488
|
return untrack(e);
|
|
1395
1489
|
} finally {
|
|
1396
|
-
|
|
1490
|
+
H = t;
|
|
1397
1491
|
if (!t) {
|
|
1398
1492
|
schedule();
|
|
1399
1493
|
}
|
|
1400
1494
|
}
|
|
1401
1495
|
}
|
|
1402
1496
|
function isRefreshing() {
|
|
1403
|
-
return
|
|
1497
|
+
return H;
|
|
1404
1498
|
}
|
|
1405
1499
|
function createContext(e, t) {
|
|
1406
1500
|
return { id: Symbol(t), defaultValue: e };
|
|
@@ -1409,7 +1503,7 @@ function getContext(e, t = getOwner()) {
|
|
|
1409
1503
|
if (!t) {
|
|
1410
1504
|
throw new NoOwnerError();
|
|
1411
1505
|
}
|
|
1412
|
-
const n = hasContext(e, t) ? t.
|
|
1506
|
+
const n = hasContext(e, t) ? t.He[e.id] : e.defaultValue;
|
|
1413
1507
|
if (isUndefined(n)) {
|
|
1414
1508
|
throw new ContextNotFoundError();
|
|
1415
1509
|
}
|
|
@@ -1419,16 +1513,16 @@ function setContext(e, t, n = getOwner()) {
|
|
|
1419
1513
|
if (!n) {
|
|
1420
1514
|
throw new NoOwnerError();
|
|
1421
1515
|
}
|
|
1422
|
-
n.
|
|
1516
|
+
n.He = { ...n.He, [e.id]: isUndefined(t) ? e.defaultValue : t };
|
|
1423
1517
|
}
|
|
1424
1518
|
function hasContext(e, t) {
|
|
1425
|
-
return !isUndefined(t?.
|
|
1519
|
+
return !isUndefined(t?.He[e.id]);
|
|
1426
1520
|
}
|
|
1427
1521
|
function isUndefined(e) {
|
|
1428
1522
|
return typeof e === "undefined";
|
|
1429
1523
|
}
|
|
1430
1524
|
function restoreTransition(e, t) {
|
|
1431
|
-
|
|
1525
|
+
W.initTransition(e);
|
|
1432
1526
|
const n = t();
|
|
1433
1527
|
flush();
|
|
1434
1528
|
return n;
|
|
@@ -1437,8 +1531,8 @@ function action(e) {
|
|
|
1437
1531
|
return (...t) =>
|
|
1438
1532
|
new Promise((n, r) => {
|
|
1439
1533
|
const i = e(...t);
|
|
1440
|
-
|
|
1441
|
-
let s =
|
|
1534
|
+
W.initTransition();
|
|
1535
|
+
let s = k;
|
|
1442
1536
|
s.ee.push(i);
|
|
1443
1537
|
const done = (e, t) => {
|
|
1444
1538
|
s = currentTransition(s);
|
|
@@ -1534,13 +1628,13 @@ function createOptimistic(e, t, n) {
|
|
|
1534
1628
|
function onSettled(e) {
|
|
1535
1629
|
getOwner()
|
|
1536
1630
|
? createTrackedEffect(() => untrack(e))
|
|
1537
|
-
:
|
|
1631
|
+
: W.enqueue(h, () => {
|
|
1538
1632
|
const t = e();
|
|
1539
1633
|
t?.();
|
|
1540
1634
|
});
|
|
1541
1635
|
}
|
|
1542
1636
|
function unwrap(e) {
|
|
1543
|
-
return e?.[
|
|
1637
|
+
return e?.[K]?.[$] ?? e;
|
|
1544
1638
|
}
|
|
1545
1639
|
function getOverrideValue(e, t, n, r, i) {
|
|
1546
1640
|
if (i && r in i) return i[r];
|
|
@@ -1552,21 +1646,21 @@ function getAllKeys(e, t, n) {
|
|
|
1552
1646
|
return Array.from(new Set([...r, ...i]));
|
|
1553
1647
|
}
|
|
1554
1648
|
function applyState(e, t, n, r) {
|
|
1555
|
-
const i = t?.[
|
|
1649
|
+
const i = t?.[K];
|
|
1556
1650
|
if (!i) return;
|
|
1557
|
-
const s = i[
|
|
1558
|
-
const o = i[
|
|
1559
|
-
const u = i[
|
|
1560
|
-
let f = i[
|
|
1651
|
+
const s = i[X];
|
|
1652
|
+
const o = i[Y];
|
|
1653
|
+
const u = i[Z];
|
|
1654
|
+
let f = i[$];
|
|
1561
1655
|
if (e === s && !o && !u) return;
|
|
1562
|
-
(i[
|
|
1563
|
-
i[
|
|
1564
|
-
i[
|
|
1656
|
+
(i[ne] || se).set(e, i[z]);
|
|
1657
|
+
i[X] = e;
|
|
1658
|
+
i[Y] = undefined;
|
|
1565
1659
|
if (Array.isArray(s)) {
|
|
1566
1660
|
let t = false;
|
|
1567
1661
|
const l = getOverrideValue(s, o, f, "length", u);
|
|
1568
1662
|
if (e.length && l && e[0] && n(e[0]) != null) {
|
|
1569
|
-
let c, a, d, p, h, y, g,
|
|
1663
|
+
let c, a, d, p, h, y, g, S;
|
|
1570
1664
|
for (
|
|
1571
1665
|
d = 0, p = Math.min(l, e.length);
|
|
1572
1666
|
d < p &&
|
|
@@ -1575,7 +1669,7 @@ function applyState(e, t, n, r) {
|
|
|
1575
1669
|
) {
|
|
1576
1670
|
applyState(e[d], wrap(y, i), n, r);
|
|
1577
1671
|
}
|
|
1578
|
-
const
|
|
1672
|
+
const w = new Array(e.length),
|
|
1579
1673
|
m = new Map();
|
|
1580
1674
|
for (
|
|
1581
1675
|
p = l - 1, h = e.length - 1;
|
|
@@ -1584,64 +1678,64 @@ function applyState(e, t, n, r) {
|
|
|
1584
1678
|
((y = getOverrideValue(s, o, f, p, u)) === e[h] || (y && e[h] && n(y) === n(e[h])));
|
|
1585
1679
|
p--, h--
|
|
1586
1680
|
) {
|
|
1587
|
-
|
|
1681
|
+
w[h] = y;
|
|
1588
1682
|
}
|
|
1589
1683
|
if (d > h || d > p) {
|
|
1590
1684
|
for (a = d; a <= h; a++) {
|
|
1591
1685
|
t = true;
|
|
1592
|
-
i[
|
|
1686
|
+
i[$][a] && setSignal(i[$][a], wrap(e[a], i));
|
|
1593
1687
|
}
|
|
1594
1688
|
for (; a < e.length; a++) {
|
|
1595
1689
|
t = true;
|
|
1596
|
-
const s = wrap(
|
|
1597
|
-
i[
|
|
1690
|
+
const s = wrap(w[a], i);
|
|
1691
|
+
i[$][a] && setSignal(i[$][a], s);
|
|
1598
1692
|
applyState(e[a], s, n, r);
|
|
1599
1693
|
}
|
|
1600
|
-
t && i[
|
|
1601
|
-
l !== e.length && i[
|
|
1694
|
+
t && i[$][B] && setSignal(i[$][B], void 0);
|
|
1695
|
+
l !== e.length && i[$].length && setSignal(i[$].length, e.length);
|
|
1602
1696
|
return;
|
|
1603
1697
|
}
|
|
1604
1698
|
g = new Array(h + 1);
|
|
1605
1699
|
for (a = h; a >= d; a--) {
|
|
1606
1700
|
y = e[a];
|
|
1607
|
-
|
|
1608
|
-
c = m.get(
|
|
1701
|
+
S = y ? n(y) : y;
|
|
1702
|
+
c = m.get(S);
|
|
1609
1703
|
g[a] = c === undefined ? -1 : c;
|
|
1610
|
-
m.set(
|
|
1704
|
+
m.set(S, a);
|
|
1611
1705
|
}
|
|
1612
1706
|
for (c = d; c <= p; c++) {
|
|
1613
1707
|
y = getOverrideValue(s, o, f, c, u);
|
|
1614
|
-
|
|
1615
|
-
a = m.get(
|
|
1708
|
+
S = y ? n(y) : y;
|
|
1709
|
+
a = m.get(S);
|
|
1616
1710
|
if (a !== undefined && a !== -1) {
|
|
1617
|
-
|
|
1711
|
+
w[a] = y;
|
|
1618
1712
|
a = g[a];
|
|
1619
|
-
m.set(
|
|
1713
|
+
m.set(S, a);
|
|
1620
1714
|
}
|
|
1621
1715
|
}
|
|
1622
1716
|
for (a = d; a < e.length; a++) {
|
|
1623
|
-
if (a in
|
|
1624
|
-
const t = wrap(
|
|
1625
|
-
i[
|
|
1717
|
+
if (a in w) {
|
|
1718
|
+
const t = wrap(w[a], i);
|
|
1719
|
+
i[$][a] && setSignal(i[$][a], t);
|
|
1626
1720
|
applyState(e[a], t, n, r);
|
|
1627
|
-
} else i[
|
|
1721
|
+
} else i[$][a] && setSignal(i[$][a], wrap(e[a], i));
|
|
1628
1722
|
}
|
|
1629
1723
|
if (d < e.length) t = true;
|
|
1630
1724
|
} else if (e.length) {
|
|
1631
1725
|
for (let t = 0, l = e.length; t < l; t++) {
|
|
1632
1726
|
const l = getOverrideValue(s, o, f, t, u);
|
|
1633
|
-
isWrappable(l) ? applyState(e[t], wrap(l, i), n, r) : i[
|
|
1727
|
+
isWrappable(l) ? applyState(e[t], wrap(l, i), n, r) : i[$][t] && setSignal(i[$][t], e[t]);
|
|
1634
1728
|
}
|
|
1635
1729
|
}
|
|
1636
1730
|
if (l !== e.length) {
|
|
1637
1731
|
t = true;
|
|
1638
|
-
i[
|
|
1732
|
+
i[$].length && setSignal(i[$].length, e.length);
|
|
1639
1733
|
}
|
|
1640
|
-
t && i[
|
|
1734
|
+
t && i[$][B] && setSignal(i[$][B], void 0);
|
|
1641
1735
|
return;
|
|
1642
1736
|
}
|
|
1643
1737
|
if (f) {
|
|
1644
|
-
const t = f[
|
|
1738
|
+
const t = f[B];
|
|
1645
1739
|
const l = t || r ? getAllKeys(s, o, e) : Object.keys(f);
|
|
1646
1740
|
for (let c = 0, a = l.length; c < a; c++) {
|
|
1647
1741
|
const a = l[c];
|
|
@@ -1655,7 +1749,7 @@ function applyState(e, t, n, r) {
|
|
|
1655
1749
|
} else applyState(h, wrap(p, i), n, r);
|
|
1656
1750
|
}
|
|
1657
1751
|
}
|
|
1658
|
-
if ((f = i[
|
|
1752
|
+
if ((f = i[ee])) {
|
|
1659
1753
|
const t = Object.keys(f);
|
|
1660
1754
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
1661
1755
|
const r = t[n];
|
|
@@ -1677,9 +1771,9 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1677
1771
|
let r;
|
|
1678
1772
|
const i = new WeakMap();
|
|
1679
1773
|
const wrapper = e => {
|
|
1680
|
-
e[
|
|
1681
|
-
e[
|
|
1682
|
-
Object.defineProperty(e,
|
|
1774
|
+
e[te] = wrapProjection;
|
|
1775
|
+
e[ne] = i;
|
|
1776
|
+
Object.defineProperty(e, re, {
|
|
1683
1777
|
get() {
|
|
1684
1778
|
return r;
|
|
1685
1779
|
},
|
|
@@ -1688,15 +1782,15 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1688
1782
|
};
|
|
1689
1783
|
const wrapProjection = e => {
|
|
1690
1784
|
if (i.has(e)) return i.get(e);
|
|
1691
|
-
if (e[
|
|
1692
|
-
const t = createStoreProxy(e,
|
|
1785
|
+
if (e[K]?.[te] === wrapProjection) return e;
|
|
1786
|
+
const t = createStoreProxy(e, fe, wrapper);
|
|
1693
1787
|
i.set(e, t);
|
|
1694
1788
|
return t;
|
|
1695
1789
|
};
|
|
1696
1790
|
const s = wrapProjection(t);
|
|
1697
1791
|
r = computed(() => {
|
|
1698
1792
|
const t = getOwner();
|
|
1699
|
-
storeSetter(new Proxy(s,
|
|
1793
|
+
storeSetter(new Proxy(s, D), r => {
|
|
1700
1794
|
const i = handleAsync(t, e(r), e => {
|
|
1701
1795
|
e !== r && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id", n?.all));
|
|
1702
1796
|
setSignal(t, undefined);
|
|
@@ -1704,13 +1798,13 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
1704
1798
|
i !== r && i !== undefined && reconcile(i, n?.key || "id", n?.all)(s);
|
|
1705
1799
|
});
|
|
1706
1800
|
});
|
|
1707
|
-
r.
|
|
1801
|
+
r.ke = true;
|
|
1708
1802
|
return { store: s, node: r };
|
|
1709
1803
|
}
|
|
1710
1804
|
function createProjection(e, t = {}, n) {
|
|
1711
1805
|
return createProjectionInternal(e, t, n).store;
|
|
1712
1806
|
}
|
|
1713
|
-
const
|
|
1807
|
+
const D = {
|
|
1714
1808
|
get(e, t) {
|
|
1715
1809
|
let n;
|
|
1716
1810
|
setWriteOverride(true);
|
|
@@ -1721,7 +1815,7 @@ const T = {
|
|
|
1721
1815
|
setWriteOverride(false);
|
|
1722
1816
|
setProjectionWriteActive(false);
|
|
1723
1817
|
}
|
|
1724
|
-
return typeof n === "object" && n !== null ? new Proxy(n,
|
|
1818
|
+
return typeof n === "object" && n !== null ? new Proxy(n, D) : n;
|
|
1725
1819
|
},
|
|
1726
1820
|
set(e, t, n) {
|
|
1727
1821
|
setWriteOverride(true);
|
|
@@ -1746,55 +1840,55 @@ const T = {
|
|
|
1746
1840
|
return true;
|
|
1747
1841
|
}
|
|
1748
1842
|
};
|
|
1749
|
-
const
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
const
|
|
1755
|
-
const
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
function createStoreProxy(e, t =
|
|
1843
|
+
const B = Symbol(0),
|
|
1844
|
+
G = Symbol(0),
|
|
1845
|
+
K = Symbol(0),
|
|
1846
|
+
z = Symbol(0),
|
|
1847
|
+
U = Symbol(0);
|
|
1848
|
+
const J = new WeakMap();
|
|
1849
|
+
const X = "v",
|
|
1850
|
+
Y = "o",
|
|
1851
|
+
Z = "x",
|
|
1852
|
+
$ = "n",
|
|
1853
|
+
ee = "h",
|
|
1854
|
+
te = "w",
|
|
1855
|
+
ne = "l",
|
|
1856
|
+
re = "f",
|
|
1857
|
+
ie = "p";
|
|
1858
|
+
function createStoreProxy(e, t = fe, n) {
|
|
1765
1859
|
let r;
|
|
1766
1860
|
if (Array.isArray(e)) {
|
|
1767
1861
|
r = [];
|
|
1768
1862
|
r.v = e;
|
|
1769
1863
|
} else r = { v: e };
|
|
1770
1864
|
n && n(r);
|
|
1771
|
-
return (r[
|
|
1865
|
+
return (r[z] = new Proxy(r, t));
|
|
1772
1866
|
}
|
|
1773
|
-
const
|
|
1867
|
+
const se = new WeakMap();
|
|
1774
1868
|
function wrap(e, t) {
|
|
1775
|
-
if (t?.[
|
|
1776
|
-
let n = e[
|
|
1777
|
-
if (!n)
|
|
1869
|
+
if (t?.[te]) return t[te](e, t);
|
|
1870
|
+
let n = e[z] || se.get(e);
|
|
1871
|
+
if (!n) se.set(e, (n = createStoreProxy(e)));
|
|
1778
1872
|
return n;
|
|
1779
1873
|
}
|
|
1780
1874
|
function isWrappable(e) {
|
|
1781
1875
|
return e != null && typeof e === "object" && !Object.isFrozen(e);
|
|
1782
1876
|
}
|
|
1783
|
-
let
|
|
1877
|
+
let oe = false;
|
|
1784
1878
|
function setWriteOverride(e) {
|
|
1785
|
-
|
|
1879
|
+
oe = e;
|
|
1786
1880
|
}
|
|
1787
1881
|
function writeOnly(e) {
|
|
1788
|
-
return
|
|
1882
|
+
return oe || !!ue?.has(e);
|
|
1789
1883
|
}
|
|
1790
1884
|
function getNodes(e, t) {
|
|
1791
1885
|
let n = e[t];
|
|
1792
1886
|
if (!n) e[t] = n = Object.create(null);
|
|
1793
1887
|
return n;
|
|
1794
1888
|
}
|
|
1795
|
-
function getNode(e, t, n, r, i = isEqual, s) {
|
|
1889
|
+
function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
1796
1890
|
if (e[t]) return e[t];
|
|
1797
|
-
const
|
|
1891
|
+
const u = signal(
|
|
1798
1892
|
n,
|
|
1799
1893
|
{
|
|
1800
1894
|
equals: i,
|
|
@@ -1804,11 +1898,16 @@ function getNode(e, t, n, r, i = isEqual, s) {
|
|
|
1804
1898
|
},
|
|
1805
1899
|
r
|
|
1806
1900
|
);
|
|
1807
|
-
if (s)
|
|
1808
|
-
|
|
1901
|
+
if (s) u.we = true;
|
|
1902
|
+
if (o && t in o) {
|
|
1903
|
+
const e = o[t];
|
|
1904
|
+
u.ie = e === undefined ? S : e;
|
|
1905
|
+
V?.add(u);
|
|
1906
|
+
}
|
|
1907
|
+
return (e[t] = u);
|
|
1809
1908
|
}
|
|
1810
|
-
function trackSelf(e, t =
|
|
1811
|
-
getObserver() && read(getNode(getNodes(e,
|
|
1909
|
+
function trackSelf(e, t = B) {
|
|
1910
|
+
getObserver() && read(getNode(getNodes(e, $), t, undefined, e[re], false, e[ie]));
|
|
1812
1911
|
}
|
|
1813
1912
|
function getKeys(e, t, n = true) {
|
|
1814
1913
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -1816,7 +1915,7 @@ function getKeys(e, t, n = true) {
|
|
|
1816
1915
|
const i = new Set(r);
|
|
1817
1916
|
const s = Reflect.ownKeys(t);
|
|
1818
1917
|
for (const e of s) {
|
|
1819
|
-
if (t[e] !==
|
|
1918
|
+
if (t[e] !== U) i.add(e);
|
|
1820
1919
|
else i.delete(e);
|
|
1821
1920
|
}
|
|
1822
1921
|
return Array.from(i);
|
|
@@ -1824,88 +1923,97 @@ function getKeys(e, t, n = true) {
|
|
|
1824
1923
|
function getPropertyDescriptor(e, t, n) {
|
|
1825
1924
|
let r = e;
|
|
1826
1925
|
if (t && n in t) {
|
|
1827
|
-
if (r[n] ===
|
|
1926
|
+
if (r[n] === U) return void 0;
|
|
1828
1927
|
if (!(n in r)) r = t;
|
|
1829
1928
|
}
|
|
1830
1929
|
return Reflect.getOwnPropertyDescriptor(r, n);
|
|
1831
1930
|
}
|
|
1832
|
-
let
|
|
1833
|
-
const
|
|
1931
|
+
let ue = null;
|
|
1932
|
+
const fe = {
|
|
1834
1933
|
get(e, t, n) {
|
|
1835
|
-
if (t ===
|
|
1836
|
-
if (t ===
|
|
1837
|
-
if (t ===
|
|
1838
|
-
if (t ===
|
|
1934
|
+
if (t === K) return e;
|
|
1935
|
+
if (t === z) return n;
|
|
1936
|
+
if (t === _) return e[re];
|
|
1937
|
+
if (t === B || t === G) {
|
|
1839
1938
|
trackSelf(e, t);
|
|
1840
1939
|
return n;
|
|
1841
1940
|
}
|
|
1842
|
-
const r = getNodes(e,
|
|
1941
|
+
const r = getNodes(e, $);
|
|
1843
1942
|
const i = r[t];
|
|
1844
|
-
const s = e[
|
|
1845
|
-
const o = s || (e[
|
|
1846
|
-
const u = !!e[
|
|
1847
|
-
const f = s ? e[
|
|
1943
|
+
const s = e[Z] && t in e[Z];
|
|
1944
|
+
const o = s || (e[Y] && t in e[Y]);
|
|
1945
|
+
const u = !!e[X][K];
|
|
1946
|
+
const f = s ? e[Z] : e[Y] && t in e[Y] ? e[Y] : e[X];
|
|
1848
1947
|
if (!i) {
|
|
1849
1948
|
const e = Object.getOwnPropertyDescriptor(f, t);
|
|
1850
1949
|
if (e && e.get) return e.get.call(n);
|
|
1851
1950
|
}
|
|
1852
1951
|
if (writeOnly(n)) {
|
|
1853
|
-
let n = i && (o || !u) ? (i.
|
|
1854
|
-
n ===
|
|
1952
|
+
let n = i && (o || !u) ? (i.ce !== g ? (i.we ? i.ae : i.ce) : i.ae) : f[t];
|
|
1953
|
+
n === U && (n = undefined);
|
|
1855
1954
|
if (!isWrappable(n)) return n;
|
|
1856
1955
|
const r = wrap(n, e);
|
|
1857
|
-
|
|
1956
|
+
ue?.add(r);
|
|
1858
1957
|
return r;
|
|
1859
1958
|
}
|
|
1860
1959
|
let l = i ? (o || !u ? read(r[t]) : (read(r[t]), f[t])) : f[t];
|
|
1861
|
-
l ===
|
|
1960
|
+
l === U && (l = undefined);
|
|
1862
1961
|
if (!i) {
|
|
1863
1962
|
if (!o && typeof l === "function" && !f.hasOwnProperty(t)) {
|
|
1864
1963
|
let t;
|
|
1865
|
-
return !Array.isArray(e[
|
|
1964
|
+
return !Array.isArray(e[X]) && (t = Object.getPrototypeOf(e[X])) && t !== Object.prototype
|
|
1866
1965
|
? l.bind(f)
|
|
1867
1966
|
: l;
|
|
1868
1967
|
} else if (getObserver()) {
|
|
1869
|
-
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[
|
|
1968
|
+
return read(getNode(r, t, isWrappable(l) ? wrap(l, e) : l, e[re], isEqual, e[ie], e[w]));
|
|
1870
1969
|
}
|
|
1871
1970
|
}
|
|
1872
1971
|
return isWrappable(l) ? wrap(l, e) : l;
|
|
1873
1972
|
},
|
|
1874
1973
|
has(e, t) {
|
|
1875
|
-
if (t ===
|
|
1876
|
-
const n = e[
|
|
1877
|
-
getObserver() && read(getNode(getNodes(e,
|
|
1974
|
+
if (t === z || t === B || t === "__proto__") return true;
|
|
1975
|
+
const n = e[Z] && t in e[Z] ? e[Z][t] !== U : e[Y] && t in e[Y] ? e[Y][t] !== U : t in e[X];
|
|
1976
|
+
getObserver() && read(getNode(getNodes(e, ee), t, n, e[re], isEqual, e[ie]));
|
|
1878
1977
|
return n;
|
|
1879
1978
|
},
|
|
1880
1979
|
set(e, t, n) {
|
|
1881
|
-
const r = e[
|
|
1980
|
+
const r = e[z];
|
|
1882
1981
|
if (writeOnly(r)) {
|
|
1883
|
-
if (e[
|
|
1884
|
-
const t = e[
|
|
1982
|
+
if (e[ie]) {
|
|
1983
|
+
const t = e[re];
|
|
1885
1984
|
if (t?.ne) {
|
|
1886
|
-
|
|
1985
|
+
W.initTransition(t.ne);
|
|
1887
1986
|
}
|
|
1888
1987
|
}
|
|
1889
1988
|
untrack(() => {
|
|
1890
|
-
const i = e[
|
|
1989
|
+
const i = e[X];
|
|
1891
1990
|
const s = i[t];
|
|
1892
|
-
|
|
1893
|
-
|
|
1991
|
+
if (F && typeof t !== "symbol") {
|
|
1992
|
+
if (!e[w]) {
|
|
1993
|
+
e[w] = Object.create(null);
|
|
1994
|
+
V?.add(e);
|
|
1995
|
+
}
|
|
1996
|
+
if (!(t in e[w])) {
|
|
1997
|
+
e[w][t] = s;
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
const o = e[ie] && !A;
|
|
2001
|
+
const u = o ? Z : Y;
|
|
1894
2002
|
if (o) trackOptimisticStore(r);
|
|
1895
|
-
const f = e[
|
|
1896
|
-
const l = n?.[
|
|
2003
|
+
const f = e[Z] && t in e[Z] ? e[Z][t] : e[Y] && t in e[Y] ? e[Y][t] : s;
|
|
2004
|
+
const l = n?.[K]?.[X] ?? n;
|
|
1897
2005
|
if (f === l) return true;
|
|
1898
|
-
const c = e[
|
|
2006
|
+
const c = e[Z]?.length || e[Y]?.length || i.length;
|
|
1899
2007
|
if (l !== undefined && l === s) delete e[u][t];
|
|
1900
2008
|
else (e[u] || (e[u] = Object.create(null)))[t] = l;
|
|
1901
2009
|
const a = isWrappable(l);
|
|
1902
2010
|
if (isWrappable(f)) {
|
|
1903
|
-
const e =
|
|
1904
|
-
e && (e instanceof Set ? e.delete(r) :
|
|
2011
|
+
const e = J.get(f);
|
|
2012
|
+
e && (e instanceof Set ? e.delete(r) : J.delete(f));
|
|
1905
2013
|
}
|
|
1906
|
-
if (recursivelyNotify(r,
|
|
1907
|
-
e[
|
|
1908
|
-
const d = getNodes(e,
|
|
2014
|
+
if (recursivelyNotify(r, se) && a) recursivelyAddParent(l, r);
|
|
2015
|
+
e[ee]?.[t] && setSignal(e[ee][t], true);
|
|
2016
|
+
const d = getNodes(e, $);
|
|
1909
2017
|
d[t] && setSignal(d[t], () => (a ? wrap(l, e) : l));
|
|
1910
2018
|
if (Array.isArray(i)) {
|
|
1911
2019
|
if (t === "length") {
|
|
@@ -1915,44 +2023,44 @@ const re = {
|
|
|
1915
2023
|
if (e > c) d.length && setSignal(d.length, e);
|
|
1916
2024
|
}
|
|
1917
2025
|
}
|
|
1918
|
-
d[
|
|
2026
|
+
d[B] && setSignal(d[B], undefined);
|
|
1919
2027
|
});
|
|
1920
2028
|
}
|
|
1921
2029
|
return true;
|
|
1922
2030
|
},
|
|
1923
2031
|
deleteProperty(e, t) {
|
|
1924
|
-
const n = e[
|
|
1925
|
-
const r = e[
|
|
1926
|
-
if (writeOnly(e[
|
|
2032
|
+
const n = e[Z]?.[t] === U;
|
|
2033
|
+
const r = e[Y]?.[t] === U;
|
|
2034
|
+
if (writeOnly(e[z]) && !n && !r) {
|
|
1927
2035
|
untrack(() => {
|
|
1928
|
-
const n = e[
|
|
1929
|
-
const r = n ?
|
|
1930
|
-
if (n) trackOptimisticStore(e[
|
|
1931
|
-
const i = e[
|
|
1932
|
-
if (t in e[
|
|
1933
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
2036
|
+
const n = e[ie] && !A;
|
|
2037
|
+
const r = n ? Z : Y;
|
|
2038
|
+
if (n) trackOptimisticStore(e[z]);
|
|
2039
|
+
const i = e[Z] && t in e[Z] ? e[Z][t] : e[Y] && t in e[Y] ? e[Y][t] : e[X][t];
|
|
2040
|
+
if (t in e[X] || (e[Y] && t in e[Y])) {
|
|
2041
|
+
(e[r] || (e[r] = Object.create(null)))[t] = U;
|
|
1934
2042
|
} else if (e[r] && t in e[r]) {
|
|
1935
2043
|
delete e[r][t];
|
|
1936
2044
|
} else return true;
|
|
1937
2045
|
if (isWrappable(i)) {
|
|
1938
|
-
const t =
|
|
1939
|
-
t && (t instanceof Set ? t.delete(e) :
|
|
2046
|
+
const t = J.get(i);
|
|
2047
|
+
t && (t instanceof Set ? t.delete(e) : J.delete(i));
|
|
1940
2048
|
}
|
|
1941
|
-
if (e[
|
|
1942
|
-
const s = getNodes(e,
|
|
2049
|
+
if (e[ee]?.[t]) setSignal(e[ee][t], false);
|
|
2050
|
+
const s = getNodes(e, $);
|
|
1943
2051
|
s[t] && setSignal(s[t], undefined);
|
|
1944
|
-
s[
|
|
2052
|
+
s[B] && setSignal(s[B], undefined);
|
|
1945
2053
|
});
|
|
1946
2054
|
}
|
|
1947
2055
|
return true;
|
|
1948
2056
|
},
|
|
1949
2057
|
ownKeys(e) {
|
|
1950
2058
|
trackSelf(e);
|
|
1951
|
-
let t = getKeys(e[
|
|
1952
|
-
if (e[
|
|
2059
|
+
let t = getKeys(e[X], e[Y], false);
|
|
2060
|
+
if (e[Z]) {
|
|
1953
2061
|
const n = new Set(t);
|
|
1954
|
-
for (const t of Reflect.ownKeys(e[
|
|
1955
|
-
if (e[
|
|
2062
|
+
for (const t of Reflect.ownKeys(e[Z])) {
|
|
2063
|
+
if (e[Z][t] !== U) n.add(t);
|
|
1956
2064
|
else n.delete(t);
|
|
1957
2065
|
}
|
|
1958
2066
|
t = Array.from(n);
|
|
@@ -1960,25 +2068,25 @@ const re = {
|
|
|
1960
2068
|
return t;
|
|
1961
2069
|
},
|
|
1962
2070
|
getOwnPropertyDescriptor(e, t) {
|
|
1963
|
-
if (t ===
|
|
1964
|
-
if (e[
|
|
1965
|
-
if (e[
|
|
1966
|
-
const n = getPropertyDescriptor(e[
|
|
2071
|
+
if (t === z) return { value: e[z], writable: true, configurable: true };
|
|
2072
|
+
if (e[Z] && t in e[Z]) {
|
|
2073
|
+
if (e[Z][t] === U) return undefined;
|
|
2074
|
+
const n = getPropertyDescriptor(e[X], e[Y], t);
|
|
1967
2075
|
if (n) {
|
|
1968
|
-
return { ...n, value: e[
|
|
2076
|
+
return { ...n, value: e[Z][t] };
|
|
1969
2077
|
}
|
|
1970
|
-
return { value: e[
|
|
2078
|
+
return { value: e[Z][t], writable: true, enumerable: true, configurable: true };
|
|
1971
2079
|
}
|
|
1972
|
-
return getPropertyDescriptor(e[
|
|
2080
|
+
return getPropertyDescriptor(e[X], e[Y], t);
|
|
1973
2081
|
},
|
|
1974
2082
|
getPrototypeOf(e) {
|
|
1975
|
-
return Object.getPrototypeOf(e[
|
|
2083
|
+
return Object.getPrototypeOf(e[X]);
|
|
1976
2084
|
}
|
|
1977
2085
|
};
|
|
1978
2086
|
function storeSetter(e, t) {
|
|
1979
|
-
const n =
|
|
1980
|
-
|
|
1981
|
-
|
|
2087
|
+
const n = ue;
|
|
2088
|
+
ue = new Set();
|
|
2089
|
+
ue.add(e);
|
|
1982
2090
|
try {
|
|
1983
2091
|
const n = t(e);
|
|
1984
2092
|
if (n !== e && n !== undefined) {
|
|
@@ -1994,8 +2102,8 @@ function storeSetter(e, t) {
|
|
|
1994
2102
|
}
|
|
1995
2103
|
}
|
|
1996
2104
|
} finally {
|
|
1997
|
-
|
|
1998
|
-
|
|
2105
|
+
ue.clear();
|
|
2106
|
+
ue = n;
|
|
1999
2107
|
}
|
|
2000
2108
|
}
|
|
2001
2109
|
function createStore(e, t, n) {
|
|
@@ -2004,17 +2112,17 @@ function createStore(e, t, n) {
|
|
|
2004
2112
|
return [i, e => storeSetter(i, e)];
|
|
2005
2113
|
}
|
|
2006
2114
|
function recursivelyNotify(e, t) {
|
|
2007
|
-
let n = e[
|
|
2115
|
+
let n = e[K] || t?.get(e)?.[K];
|
|
2008
2116
|
let r = false;
|
|
2009
2117
|
if (n) {
|
|
2010
|
-
const e = getNodes(n,
|
|
2118
|
+
const e = getNodes(n, $)[G];
|
|
2011
2119
|
if (e) {
|
|
2012
2120
|
setSignal(e, undefined);
|
|
2013
2121
|
r = true;
|
|
2014
2122
|
}
|
|
2015
|
-
t = n[
|
|
2123
|
+
t = n[ne] || t;
|
|
2016
2124
|
}
|
|
2017
|
-
const i =
|
|
2125
|
+
const i = J.get(n?.[X] || e);
|
|
2018
2126
|
if (!i) return r;
|
|
2019
2127
|
if (i instanceof Set) {
|
|
2020
2128
|
for (let e of i) r = recursivelyNotify(e, t) || r;
|
|
@@ -2023,16 +2131,16 @@ function recursivelyNotify(e, t) {
|
|
|
2023
2131
|
}
|
|
2024
2132
|
function recursivelyAddParent(e, t) {
|
|
2025
2133
|
let n;
|
|
2026
|
-
const r = e[
|
|
2134
|
+
const r = e[K];
|
|
2027
2135
|
if (r) {
|
|
2028
|
-
n = r[
|
|
2029
|
-
e = r[
|
|
2136
|
+
n = r[Y];
|
|
2137
|
+
e = r[X];
|
|
2030
2138
|
}
|
|
2031
2139
|
if (t) {
|
|
2032
|
-
let n =
|
|
2033
|
-
if (!n)
|
|
2140
|
+
let n = J.get(e);
|
|
2141
|
+
if (!n) J.set(e, t);
|
|
2034
2142
|
else if (n !== t) {
|
|
2035
|
-
if (!(n instanceof Set))
|
|
2143
|
+
if (!(n instanceof Set)) J.set(e, (n = new Set([n])));
|
|
2036
2144
|
else if (n.has(t)) return;
|
|
2037
2145
|
n.add(t);
|
|
2038
2146
|
} else return;
|
|
@@ -2054,7 +2162,7 @@ function recursivelyAddParent(e, t) {
|
|
|
2054
2162
|
}
|
|
2055
2163
|
function deep(e) {
|
|
2056
2164
|
recursivelyAddParent(e);
|
|
2057
|
-
return e[
|
|
2165
|
+
return e[G];
|
|
2058
2166
|
}
|
|
2059
2167
|
function createOptimisticStore(e, t, n) {
|
|
2060
2168
|
GlobalQueue.J ||= clearOptimisticStore;
|
|
@@ -2065,39 +2173,39 @@ function createOptimisticStore(e, t, n) {
|
|
|
2065
2173
|
return [o, e => storeSetter(o, e)];
|
|
2066
2174
|
}
|
|
2067
2175
|
function clearOptimisticStore(e) {
|
|
2068
|
-
const t = e[
|
|
2069
|
-
if (!t || !t[
|
|
2070
|
-
const n = t[
|
|
2071
|
-
const r = t[
|
|
2176
|
+
const t = e[K];
|
|
2177
|
+
if (!t || !t[Z]) return;
|
|
2178
|
+
const n = t[Z];
|
|
2179
|
+
const r = t[$];
|
|
2072
2180
|
setProjectionWriteActive(true);
|
|
2073
2181
|
try {
|
|
2074
2182
|
if (r) {
|
|
2075
2183
|
for (const e of Reflect.ownKeys(n)) {
|
|
2076
2184
|
if (r[e]) {
|
|
2077
2185
|
r[e].re = undefined;
|
|
2078
|
-
const n = t[
|
|
2079
|
-
const i = n ===
|
|
2186
|
+
const n = t[Y] && e in t[Y] ? t[Y][e] : t[X][e];
|
|
2187
|
+
const i = n === U ? undefined : n;
|
|
2080
2188
|
setSignal(r[e], isWrappable(i) ? wrap(i, t) : i);
|
|
2081
2189
|
}
|
|
2082
2190
|
}
|
|
2083
|
-
if (r[
|
|
2084
|
-
r[
|
|
2085
|
-
setSignal(r[
|
|
2191
|
+
if (r[B]) {
|
|
2192
|
+
r[B].re = undefined;
|
|
2193
|
+
setSignal(r[B], undefined);
|
|
2086
2194
|
}
|
|
2087
2195
|
}
|
|
2088
2196
|
} finally {
|
|
2089
2197
|
setProjectionWriteActive(false);
|
|
2090
2198
|
}
|
|
2091
|
-
delete t[
|
|
2199
|
+
delete t[Z];
|
|
2092
2200
|
}
|
|
2093
2201
|
function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
2094
2202
|
let r;
|
|
2095
2203
|
const i = new WeakMap();
|
|
2096
2204
|
const wrapper = e => {
|
|
2097
|
-
e[
|
|
2098
|
-
e[
|
|
2099
|
-
e[
|
|
2100
|
-
Object.defineProperty(e,
|
|
2205
|
+
e[te] = wrapProjection;
|
|
2206
|
+
e[ne] = i;
|
|
2207
|
+
e[ie] = true;
|
|
2208
|
+
Object.defineProperty(e, re, {
|
|
2101
2209
|
get() {
|
|
2102
2210
|
return r;
|
|
2103
2211
|
},
|
|
@@ -2106,8 +2214,8 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2106
2214
|
};
|
|
2107
2215
|
const wrapProjection = e => {
|
|
2108
2216
|
if (i.has(e)) return i.get(e);
|
|
2109
|
-
if (e[
|
|
2110
|
-
const t = createStoreProxy(e,
|
|
2217
|
+
if (e[K]?.[te] === wrapProjection) return e;
|
|
2218
|
+
const t = createStoreProxy(e, fe, wrapper);
|
|
2111
2219
|
i.set(e, t);
|
|
2112
2220
|
return t;
|
|
2113
2221
|
};
|
|
@@ -2117,7 +2225,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2117
2225
|
const t = getOwner();
|
|
2118
2226
|
setProjectionWriteActive(true);
|
|
2119
2227
|
try {
|
|
2120
|
-
storeSetter(new Proxy(s,
|
|
2228
|
+
storeSetter(new Proxy(s, D), r => {
|
|
2121
2229
|
const i = handleAsync(t, e(r), e => {
|
|
2122
2230
|
setProjectionWriteActive(true);
|
|
2123
2231
|
try {
|
|
@@ -2132,7 +2240,7 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2132
2240
|
setProjectionWriteActive(false);
|
|
2133
2241
|
}
|
|
2134
2242
|
});
|
|
2135
|
-
r.
|
|
2243
|
+
r.ke = true;
|
|
2136
2244
|
}
|
|
2137
2245
|
return { store: s, node: r };
|
|
2138
2246
|
}
|
|
@@ -2141,12 +2249,12 @@ function snapshot(e, t, n) {
|
|
|
2141
2249
|
if (!isWrappable(e)) return e;
|
|
2142
2250
|
if (t && t.has(e)) return t.get(e);
|
|
2143
2251
|
if (!t) t = new Map();
|
|
2144
|
-
if ((r = e[
|
|
2145
|
-
s = r[
|
|
2146
|
-
i = Array.isArray(r[
|
|
2147
|
-
t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[
|
|
2148
|
-
e = r[
|
|
2149
|
-
n =
|
|
2252
|
+
if ((r = e[K] || n?.get(e)?.[K])) {
|
|
2253
|
+
s = r[Y];
|
|
2254
|
+
i = Array.isArray(r[X]);
|
|
2255
|
+
t.set(e, s ? (o = i ? [] : Object.create(Object.getPrototypeOf(r[X]))) : r[X]);
|
|
2256
|
+
e = r[X];
|
|
2257
|
+
n = se;
|
|
2150
2258
|
} else {
|
|
2151
2259
|
i = Array.isArray(e);
|
|
2152
2260
|
t.set(e, e);
|
|
@@ -2155,7 +2263,7 @@ function snapshot(e, t, n) {
|
|
|
2155
2263
|
const r = s?.length || e.length;
|
|
2156
2264
|
for (let i = 0; i < r; i++) {
|
|
2157
2265
|
f = s && i in s ? s[i] : e[i];
|
|
2158
|
-
if (f ===
|
|
2266
|
+
if (f === U) continue;
|
|
2159
2267
|
if ((u = snapshot(f, t, n)) !== f || o) {
|
|
2160
2268
|
if (!o) t.set(e, (o = [...e]));
|
|
2161
2269
|
o[i] = u;
|
|
@@ -2182,13 +2290,13 @@ function snapshot(e, t, n) {
|
|
|
2182
2290
|
function trueFn() {
|
|
2183
2291
|
return true;
|
|
2184
2292
|
}
|
|
2185
|
-
const
|
|
2293
|
+
const le = {
|
|
2186
2294
|
get(e, t, n) {
|
|
2187
|
-
if (t ===
|
|
2295
|
+
if (t === z) return n;
|
|
2188
2296
|
return e.get(t);
|
|
2189
2297
|
},
|
|
2190
2298
|
has(e, t) {
|
|
2191
|
-
if (t ===
|
|
2299
|
+
if (t === z) return true;
|
|
2192
2300
|
return e.has(t);
|
|
2193
2301
|
},
|
|
2194
2302
|
set: trueFn,
|
|
@@ -2211,23 +2319,23 @@ const ie = {
|
|
|
2211
2319
|
function resolveSource(e) {
|
|
2212
2320
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
2213
2321
|
}
|
|
2214
|
-
const
|
|
2322
|
+
const ce = Symbol(0);
|
|
2215
2323
|
function merge(...e) {
|
|
2216
2324
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
2217
2325
|
let t = false;
|
|
2218
2326
|
const n = [];
|
|
2219
2327
|
for (let r = 0; r < e.length; r++) {
|
|
2220
2328
|
const i = e[r];
|
|
2221
|
-
t = t || (!!i &&
|
|
2222
|
-
const s = !!i && i[
|
|
2329
|
+
t = t || (!!i && z in i);
|
|
2330
|
+
const s = !!i && i[ce];
|
|
2223
2331
|
if (s) n.push(...s);
|
|
2224
2332
|
else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
2225
2333
|
}
|
|
2226
|
-
if (
|
|
2334
|
+
if (m && t) {
|
|
2227
2335
|
return new Proxy(
|
|
2228
2336
|
{
|
|
2229
2337
|
get(e) {
|
|
2230
|
-
if (e ===
|
|
2338
|
+
if (e === ce) return n;
|
|
2231
2339
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
2232
2340
|
const r = resolveSource(n[t]);
|
|
2233
2341
|
if (e in r) return r[e];
|
|
@@ -2245,7 +2353,7 @@ function merge(...e) {
|
|
|
2245
2353
|
return [...new Set(e)];
|
|
2246
2354
|
}
|
|
2247
2355
|
},
|
|
2248
|
-
|
|
2356
|
+
le
|
|
2249
2357
|
);
|
|
2250
2358
|
}
|
|
2251
2359
|
const r = Object.create(null);
|
|
@@ -2277,12 +2385,12 @@ function merge(...e) {
|
|
|
2277
2385
|
if (n.get) Object.defineProperty(o, t, n);
|
|
2278
2386
|
else o[t] = n.value;
|
|
2279
2387
|
}
|
|
2280
|
-
o[
|
|
2388
|
+
o[ce] = n;
|
|
2281
2389
|
return o;
|
|
2282
2390
|
}
|
|
2283
2391
|
function omit(e, ...t) {
|
|
2284
2392
|
const n = new Set(t);
|
|
2285
|
-
if (
|
|
2393
|
+
if (m && z in e) {
|
|
2286
2394
|
return new Proxy(
|
|
2287
2395
|
{
|
|
2288
2396
|
get(t) {
|
|
@@ -2295,7 +2403,7 @@ function omit(e, ...t) {
|
|
|
2295
2403
|
return Object.keys(e).filter(e => !n.has(e));
|
|
2296
2404
|
}
|
|
2297
2405
|
},
|
|
2298
|
-
|
|
2406
|
+
le
|
|
2299
2407
|
);
|
|
2300
2408
|
}
|
|
2301
2409
|
const r = {};
|
|
@@ -2313,68 +2421,68 @@ function mapArray(e, t, n) {
|
|
|
2313
2421
|
const r = typeof n?.keyed === "function" ? n.keyed : undefined;
|
|
2314
2422
|
return createMemo(
|
|
2315
2423
|
updateKeyedMap.bind({
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
De: [],
|
|
2320
|
-
Be: t,
|
|
2321
|
-
Ge: [],
|
|
2424
|
+
De: createOwner(),
|
|
2425
|
+
Be: 0,
|
|
2426
|
+
Ge: e,
|
|
2322
2427
|
Ke: [],
|
|
2323
|
-
ze:
|
|
2324
|
-
Ue:
|
|
2325
|
-
Je:
|
|
2326
|
-
Xe:
|
|
2428
|
+
ze: t,
|
|
2429
|
+
Ue: [],
|
|
2430
|
+
Je: [],
|
|
2431
|
+
Xe: r,
|
|
2432
|
+
Ye: r || n?.keyed === false ? [] : undefined,
|
|
2433
|
+
Ze: t.length > 1 ? [] : undefined,
|
|
2434
|
+
$e: n?.fallback
|
|
2327
2435
|
})
|
|
2328
2436
|
);
|
|
2329
2437
|
}
|
|
2330
|
-
const
|
|
2438
|
+
const ae = { pureWrite: true };
|
|
2331
2439
|
function updateKeyedMap() {
|
|
2332
|
-
const e = this.
|
|
2440
|
+
const e = this.Ge() || [],
|
|
2333
2441
|
t = e.length;
|
|
2334
|
-
e[
|
|
2335
|
-
runWithOwner(this.
|
|
2442
|
+
e[B];
|
|
2443
|
+
runWithOwner(this.De, () => {
|
|
2336
2444
|
let n,
|
|
2337
2445
|
r,
|
|
2338
|
-
i = this.
|
|
2446
|
+
i = this.Ye
|
|
2339
2447
|
? () => {
|
|
2340
|
-
this.
|
|
2341
|
-
this.
|
|
2342
|
-
return this.
|
|
2343
|
-
read.bind(null, this.
|
|
2344
|
-
this.
|
|
2448
|
+
this.Ye[r] = signal(e[r], ae);
|
|
2449
|
+
this.Ze && (this.Ze[r] = signal(r, ae));
|
|
2450
|
+
return this.ze(
|
|
2451
|
+
read.bind(null, this.Ye[r]),
|
|
2452
|
+
this.Ze ? read.bind(null, this.Ze[r]) : undefined
|
|
2345
2453
|
);
|
|
2346
2454
|
}
|
|
2347
|
-
: this.
|
|
2455
|
+
: this.Ze
|
|
2348
2456
|
? () => {
|
|
2349
2457
|
const t = e[r];
|
|
2350
|
-
this.
|
|
2351
|
-
return this.
|
|
2458
|
+
this.Ze[r] = signal(r, ae);
|
|
2459
|
+
return this.ze(() => t, read.bind(null, this.Ze[r]));
|
|
2352
2460
|
}
|
|
2353
2461
|
: () => {
|
|
2354
2462
|
const t = e[r];
|
|
2355
|
-
return this.
|
|
2463
|
+
return this.ze(() => t);
|
|
2356
2464
|
};
|
|
2357
2465
|
if (t === 0) {
|
|
2358
|
-
if (this.
|
|
2359
|
-
this.
|
|
2466
|
+
if (this.Be !== 0) {
|
|
2467
|
+
this.De.dispose(false);
|
|
2468
|
+
this.Je = [];
|
|
2360
2469
|
this.Ke = [];
|
|
2361
|
-
this.
|
|
2362
|
-
this.
|
|
2363
|
-
this.
|
|
2364
|
-
this.
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
this.Ge = new Array(t);
|
|
2470
|
+
this.Ue = [];
|
|
2471
|
+
this.Be = 0;
|
|
2472
|
+
this.Ye && (this.Ye = []);
|
|
2473
|
+
this.Ze && (this.Ze = []);
|
|
2474
|
+
}
|
|
2475
|
+
if (this.$e && !this.Ue[0]) {
|
|
2476
|
+
this.Ue[0] = runWithOwner((this.Je[0] = createOwner()), this.$e);
|
|
2477
|
+
}
|
|
2478
|
+
} else if (this.Be === 0) {
|
|
2479
|
+
if (this.Je[0]) this.Je[0].dispose();
|
|
2480
|
+
this.Ue = new Array(t);
|
|
2373
2481
|
for (r = 0; r < t; r++) {
|
|
2374
|
-
this.
|
|
2375
|
-
this.
|
|
2482
|
+
this.Ke[r] = e[r];
|
|
2483
|
+
this.Ue[r] = runWithOwner((this.Je[r] = createOwner()), i);
|
|
2376
2484
|
}
|
|
2377
|
-
this.
|
|
2485
|
+
this.Be = t;
|
|
2378
2486
|
} else {
|
|
2379
2487
|
let s,
|
|
2380
2488
|
o,
|
|
@@ -2385,187 +2493,187 @@ function updateKeyedMap() {
|
|
|
2385
2493
|
a,
|
|
2386
2494
|
d = new Array(t),
|
|
2387
2495
|
p = new Array(t),
|
|
2388
|
-
h = this.
|
|
2389
|
-
y = this.
|
|
2496
|
+
h = this.Ye ? new Array(t) : undefined,
|
|
2497
|
+
y = this.Ze ? new Array(t) : undefined;
|
|
2390
2498
|
for (
|
|
2391
|
-
s = 0, o = Math.min(this.
|
|
2392
|
-
s < o && (this.
|
|
2499
|
+
s = 0, o = Math.min(this.Be, t);
|
|
2500
|
+
s < o && (this.Ke[s] === e[s] || (this.Ye && compare(this.Xe, this.Ke[s], e[s])));
|
|
2393
2501
|
s++
|
|
2394
2502
|
) {
|
|
2395
|
-
if (this.
|
|
2503
|
+
if (this.Ye) setSignal(this.Ye[s], e[s]);
|
|
2396
2504
|
}
|
|
2397
2505
|
for (
|
|
2398
|
-
o = this.
|
|
2506
|
+
o = this.Be - 1, u = t - 1;
|
|
2399
2507
|
o >= s &&
|
|
2400
2508
|
u >= s &&
|
|
2401
|
-
(this.
|
|
2509
|
+
(this.Ke[o] === e[u] || (this.Ye && compare(this.Xe, this.Ke[o], e[u])));
|
|
2402
2510
|
o--, u--
|
|
2403
2511
|
) {
|
|
2404
|
-
d[u] = this.
|
|
2405
|
-
p[u] = this.
|
|
2406
|
-
h && (h[u] = this.
|
|
2407
|
-
y && (y[u] = this.
|
|
2512
|
+
d[u] = this.Ue[o];
|
|
2513
|
+
p[u] = this.Je[o];
|
|
2514
|
+
h && (h[u] = this.Ye[o]);
|
|
2515
|
+
y && (y[u] = this.Ze[o]);
|
|
2408
2516
|
}
|
|
2409
2517
|
c = new Map();
|
|
2410
2518
|
a = new Array(u + 1);
|
|
2411
2519
|
for (r = u; r >= s; r--) {
|
|
2412
2520
|
f = e[r];
|
|
2413
|
-
l = this.
|
|
2521
|
+
l = this.Xe ? this.Xe(f) : f;
|
|
2414
2522
|
n = c.get(l);
|
|
2415
2523
|
a[r] = n === undefined ? -1 : n;
|
|
2416
2524
|
c.set(l, r);
|
|
2417
2525
|
}
|
|
2418
2526
|
for (n = s; n <= o; n++) {
|
|
2419
|
-
f = this.
|
|
2420
|
-
l = this.
|
|
2527
|
+
f = this.Ke[n];
|
|
2528
|
+
l = this.Xe ? this.Xe(f) : f;
|
|
2421
2529
|
r = c.get(l);
|
|
2422
2530
|
if (r !== undefined && r !== -1) {
|
|
2423
|
-
d[r] = this.
|
|
2424
|
-
p[r] = this.
|
|
2425
|
-
h && (h[r] = this.
|
|
2426
|
-
y && (y[r] = this.
|
|
2531
|
+
d[r] = this.Ue[n];
|
|
2532
|
+
p[r] = this.Je[n];
|
|
2533
|
+
h && (h[r] = this.Ye[n]);
|
|
2534
|
+
y && (y[r] = this.Ze[n]);
|
|
2427
2535
|
r = a[r];
|
|
2428
2536
|
c.set(l, r);
|
|
2429
|
-
} else this.
|
|
2537
|
+
} else this.Je[n].dispose();
|
|
2430
2538
|
}
|
|
2431
2539
|
for (r = s; r < t; r++) {
|
|
2432
2540
|
if (r in d) {
|
|
2433
|
-
this.
|
|
2434
|
-
this.
|
|
2541
|
+
this.Ue[r] = d[r];
|
|
2542
|
+
this.Je[r] = p[r];
|
|
2435
2543
|
if (h) {
|
|
2436
|
-
this.
|
|
2437
|
-
setSignal(this.
|
|
2544
|
+
this.Ye[r] = h[r];
|
|
2545
|
+
setSignal(this.Ye[r], e[r]);
|
|
2438
2546
|
}
|
|
2439
2547
|
if (y) {
|
|
2440
|
-
this.
|
|
2441
|
-
setSignal(this.
|
|
2548
|
+
this.Ze[r] = y[r];
|
|
2549
|
+
setSignal(this.Ze[r], r);
|
|
2442
2550
|
}
|
|
2443
2551
|
} else {
|
|
2444
|
-
this.
|
|
2552
|
+
this.Ue[r] = runWithOwner((this.Je[r] = createOwner()), i);
|
|
2445
2553
|
}
|
|
2446
2554
|
}
|
|
2447
|
-
this.
|
|
2448
|
-
this.
|
|
2555
|
+
this.Ue = this.Ue.slice(0, (this.Be = t));
|
|
2556
|
+
this.Ke = e.slice(0);
|
|
2449
2557
|
}
|
|
2450
2558
|
});
|
|
2451
|
-
return this.
|
|
2559
|
+
return this.Ue;
|
|
2452
2560
|
}
|
|
2453
2561
|
function repeat(e, t, n) {
|
|
2454
2562
|
return updateRepeat.bind({
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2563
|
+
De: createOwner(),
|
|
2564
|
+
Be: 0,
|
|
2565
|
+
et: 0,
|
|
2566
|
+
tt: e,
|
|
2567
|
+
ze: t,
|
|
2568
|
+
Je: [],
|
|
2569
|
+
Ue: [],
|
|
2570
|
+
nt: n?.from,
|
|
2571
|
+
$e: n?.fallback
|
|
2464
2572
|
});
|
|
2465
2573
|
}
|
|
2466
2574
|
function updateRepeat() {
|
|
2467
|
-
const e = this.
|
|
2468
|
-
const t = this
|
|
2469
|
-
runWithOwner(this.
|
|
2575
|
+
const e = this.tt();
|
|
2576
|
+
const t = this.nt?.() || 0;
|
|
2577
|
+
runWithOwner(this.De, () => {
|
|
2470
2578
|
if (e === 0) {
|
|
2471
|
-
if (this.
|
|
2472
|
-
this.
|
|
2473
|
-
this.
|
|
2474
|
-
this.
|
|
2475
|
-
this.
|
|
2579
|
+
if (this.Be !== 0) {
|
|
2580
|
+
this.De.dispose(false);
|
|
2581
|
+
this.Je = [];
|
|
2582
|
+
this.Ue = [];
|
|
2583
|
+
this.Be = 0;
|
|
2476
2584
|
}
|
|
2477
|
-
if (this
|
|
2478
|
-
this.
|
|
2585
|
+
if (this.$e && !this.Ue[0]) {
|
|
2586
|
+
this.Ue[0] = runWithOwner((this.Je[0] = createOwner()), this.$e);
|
|
2479
2587
|
}
|
|
2480
2588
|
return;
|
|
2481
2589
|
}
|
|
2482
2590
|
const n = t + e;
|
|
2483
|
-
const r = this.
|
|
2484
|
-
if (this.
|
|
2485
|
-
for (let e = n; e < r; e++) this.
|
|
2486
|
-
if (this.
|
|
2487
|
-
let e = this.
|
|
2488
|
-
while (e < t && e < this.
|
|
2489
|
-
this.
|
|
2490
|
-
this.
|
|
2491
|
-
} else if (this.
|
|
2492
|
-
let n = r - this.
|
|
2493
|
-
let i = this.
|
|
2494
|
-
this.
|
|
2591
|
+
const r = this.et + this.Be;
|
|
2592
|
+
if (this.Be === 0 && this.Je[0]) this.Je[0].dispose();
|
|
2593
|
+
for (let e = n; e < r; e++) this.Je[e - this.et].dispose();
|
|
2594
|
+
if (this.et < t) {
|
|
2595
|
+
let e = this.et;
|
|
2596
|
+
while (e < t && e < this.Be) this.Je[e++].dispose();
|
|
2597
|
+
this.Je.splice(0, t - this.et);
|
|
2598
|
+
this.Ue.splice(0, t - this.et);
|
|
2599
|
+
} else if (this.et > t) {
|
|
2600
|
+
let n = r - this.et - 1;
|
|
2601
|
+
let i = this.et - t;
|
|
2602
|
+
this.Je.length = this.Ue.length = e;
|
|
2495
2603
|
while (n >= i) {
|
|
2496
|
-
this.
|
|
2497
|
-
this.
|
|
2604
|
+
this.Je[n] = this.Je[n - i];
|
|
2605
|
+
this.Ue[n] = this.Ue[n - i];
|
|
2498
2606
|
n--;
|
|
2499
2607
|
}
|
|
2500
2608
|
for (let e = 0; e < i; e++) {
|
|
2501
|
-
this.
|
|
2609
|
+
this.Ue[e] = runWithOwner((this.Je[e] = createOwner()), () => this.ze(e + t));
|
|
2502
2610
|
}
|
|
2503
2611
|
}
|
|
2504
2612
|
for (let e = r; e < n; e++) {
|
|
2505
|
-
this.
|
|
2613
|
+
this.Ue[e - t] = runWithOwner((this.Je[e - t] = createOwner()), () => this.ze(e));
|
|
2506
2614
|
}
|
|
2507
|
-
this.
|
|
2508
|
-
this.
|
|
2509
|
-
this.
|
|
2615
|
+
this.Ue = this.Ue.slice(0, e);
|
|
2616
|
+
this.et = t;
|
|
2617
|
+
this.Be = e;
|
|
2510
2618
|
});
|
|
2511
|
-
return this.
|
|
2619
|
+
return this.Ue;
|
|
2512
2620
|
}
|
|
2513
2621
|
function compare(e, t, n) {
|
|
2514
2622
|
return e ? e(t) === e(n) : true;
|
|
2515
2623
|
}
|
|
2516
2624
|
function boundaryComputed(e, t) {
|
|
2517
2625
|
const n = computed(e, undefined, { lazy: true });
|
|
2518
|
-
n.
|
|
2519
|
-
const r = e !== undefined ? e : n.
|
|
2626
|
+
n.Oe = (e, t) => {
|
|
2627
|
+
const r = e !== undefined ? e : n.de;
|
|
2520
2628
|
const i = t !== undefined ? t : n.Y;
|
|
2521
|
-
n.
|
|
2522
|
-
n.
|
|
2629
|
+
n.de &= ~n.rt;
|
|
2630
|
+
n.fe.notify(n, n.rt, r, i);
|
|
2523
2631
|
};
|
|
2524
|
-
n.
|
|
2525
|
-
n.
|
|
2632
|
+
n.rt = t;
|
|
2633
|
+
n.ke = true;
|
|
2526
2634
|
recompute(n, true);
|
|
2527
2635
|
return n;
|
|
2528
2636
|
}
|
|
2529
2637
|
function createBoundChildren(e, t, n, r) {
|
|
2530
|
-
const i = e.
|
|
2531
|
-
i.addChild((e.
|
|
2532
|
-
onCleanup(() => i.removeChild(e.
|
|
2638
|
+
const i = e.fe;
|
|
2639
|
+
i.addChild((e.fe = n));
|
|
2640
|
+
onCleanup(() => i.removeChild(e.fe));
|
|
2533
2641
|
return runWithOwner(e, () => {
|
|
2534
2642
|
const e = computed(t);
|
|
2535
2643
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), r);
|
|
2536
2644
|
});
|
|
2537
2645
|
}
|
|
2538
2646
|
class CollectionQueue extends Queue {
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2647
|
+
it;
|
|
2648
|
+
st = new Set();
|
|
2649
|
+
ot = signal(false, { pureWrite: true });
|
|
2650
|
+
ut = false;
|
|
2543
2651
|
constructor(e) {
|
|
2544
2652
|
super();
|
|
2545
|
-
this.
|
|
2653
|
+
this.it = e;
|
|
2546
2654
|
}
|
|
2547
2655
|
run(e) {
|
|
2548
|
-
if (!e || read(this.
|
|
2656
|
+
if (!e || read(this.ot)) return;
|
|
2549
2657
|
return super.run(e);
|
|
2550
2658
|
}
|
|
2551
2659
|
notify(e, t, n, r) {
|
|
2552
|
-
if (!(t & this.
|
|
2553
|
-
if (n & this.
|
|
2660
|
+
if (!(t & this.it) || (this.it & c && this.ut)) return super.notify(e, t, n, r);
|
|
2661
|
+
if (n & this.it) {
|
|
2554
2662
|
const t = r?.source || e.Y?.source;
|
|
2555
2663
|
if (t) {
|
|
2556
|
-
const e = this.
|
|
2557
|
-
this.
|
|
2558
|
-
if (e) setSignal(this.
|
|
2664
|
+
const e = this.st.size === 0;
|
|
2665
|
+
this.st.add(t);
|
|
2666
|
+
if (e) setSignal(this.ot, true);
|
|
2559
2667
|
}
|
|
2560
2668
|
}
|
|
2561
|
-
t &= ~this.
|
|
2669
|
+
t &= ~this.it;
|
|
2562
2670
|
return t ? super.notify(e, t, n, r) : true;
|
|
2563
2671
|
}
|
|
2564
2672
|
checkSources() {
|
|
2565
|
-
for (const e of this.
|
|
2566
|
-
if (!(e.
|
|
2673
|
+
for (const e of this.st) {
|
|
2674
|
+
if (!(e.de & this.it)) this.st.delete(e);
|
|
2567
2675
|
}
|
|
2568
|
-
if (!this.
|
|
2676
|
+
if (!this.st.size) setSignal(this.ot, false);
|
|
2569
2677
|
}
|
|
2570
2678
|
}
|
|
2571
2679
|
function createCollectionBoundary(e, t, n) {
|
|
@@ -2573,10 +2681,10 @@ function createCollectionBoundary(e, t, n) {
|
|
|
2573
2681
|
const i = new CollectionQueue(e);
|
|
2574
2682
|
const s = createBoundChildren(r, t, i, e);
|
|
2575
2683
|
const o = computed(() => {
|
|
2576
|
-
if (!read(i.
|
|
2684
|
+
if (!read(i.ot)) {
|
|
2577
2685
|
const e = read(s);
|
|
2578
|
-
if (!untrack(() => read(i.
|
|
2579
|
-
i.
|
|
2686
|
+
if (!untrack(() => read(i.ot))) {
|
|
2687
|
+
i.ut = true;
|
|
2580
2688
|
return e;
|
|
2581
2689
|
}
|
|
2582
2690
|
}
|
|
@@ -2585,14 +2693,14 @@ function createCollectionBoundary(e, t, n) {
|
|
|
2585
2693
|
return read.bind(null, o);
|
|
2586
2694
|
}
|
|
2587
2695
|
function createLoadBoundary(e, t) {
|
|
2588
|
-
return createCollectionBoundary(
|
|
2696
|
+
return createCollectionBoundary(c, e, () => t());
|
|
2589
2697
|
}
|
|
2590
2698
|
function createErrorBoundary(e, t) {
|
|
2591
|
-
return createCollectionBoundary(
|
|
2592
|
-
let n = e.
|
|
2699
|
+
return createCollectionBoundary(a, e, e => {
|
|
2700
|
+
let n = e.st.values().next().value;
|
|
2593
2701
|
const r = n.Y?.cause ?? n.Y;
|
|
2594
2702
|
return t(r, () => {
|
|
2595
|
-
for (const t of e.
|
|
2703
|
+
for (const t of e.st) recompute(t);
|
|
2596
2704
|
schedule();
|
|
2597
2705
|
});
|
|
2598
2706
|
});
|
|
@@ -2646,14 +2754,15 @@ function flattenArray(e, t = [], n) {
|
|
|
2646
2754
|
if (r) throw r;
|
|
2647
2755
|
return i;
|
|
2648
2756
|
}
|
|
2649
|
-
exports.$PROXY =
|
|
2650
|
-
exports.$TARGET =
|
|
2651
|
-
exports.$TRACK =
|
|
2757
|
+
exports.$PROXY = z;
|
|
2758
|
+
exports.$TARGET = K;
|
|
2759
|
+
exports.$TRACK = B;
|
|
2652
2760
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
2653
2761
|
exports.NoOwnerError = NoOwnerError;
|
|
2654
2762
|
exports.NotReadyError = NotReadyError;
|
|
2655
|
-
exports.SUPPORTS_PROXY =
|
|
2763
|
+
exports.SUPPORTS_PROXY = m;
|
|
2656
2764
|
exports.action = action;
|
|
2765
|
+
exports.clearSnapshots = clearSnapshots;
|
|
2657
2766
|
exports.createContext = createContext;
|
|
2658
2767
|
exports.createEffect = createEffect;
|
|
2659
2768
|
exports.createErrorBoundary = createErrorBoundary;
|
|
@@ -2676,11 +2785,13 @@ exports.getContext = getContext;
|
|
|
2676
2785
|
exports.getNextChildId = getNextChildId;
|
|
2677
2786
|
exports.getObserver = getObserver;
|
|
2678
2787
|
exports.getOwner = getOwner;
|
|
2788
|
+
exports.isDisposed = isDisposed;
|
|
2679
2789
|
exports.isEqual = isEqual;
|
|
2680
2790
|
exports.isPending = isPending;
|
|
2681
2791
|
exports.isRefreshing = isRefreshing;
|
|
2682
2792
|
exports.isWrappable = isWrappable;
|
|
2683
2793
|
exports.mapArray = mapArray;
|
|
2794
|
+
exports.markSnapshotScope = markSnapshotScope;
|
|
2684
2795
|
exports.merge = merge;
|
|
2685
2796
|
exports.omit = omit;
|
|
2686
2797
|
exports.onCleanup = onCleanup;
|
|
@@ -2689,9 +2800,11 @@ exports.peekNextChildId = peekNextChildId;
|
|
|
2689
2800
|
exports.pending = pending;
|
|
2690
2801
|
exports.reconcile = reconcile;
|
|
2691
2802
|
exports.refresh = refresh;
|
|
2803
|
+
exports.releaseSnapshotScope = releaseSnapshotScope;
|
|
2692
2804
|
exports.repeat = repeat;
|
|
2693
2805
|
exports.resolve = resolve;
|
|
2694
2806
|
exports.runWithOwner = runWithOwner;
|
|
2695
2807
|
exports.setContext = setContext;
|
|
2808
|
+
exports.setSnapshotCapture = setSnapshotCapture;
|
|
2696
2809
|
exports.snapshot = snapshot;
|
|
2697
2810
|
exports.untrack = untrack;
|