@solidjs/signals 0.9.0 → 0.9.2

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/prod.js CHANGED
@@ -40,56 +40,56 @@ function actualInsertIntoHeap(e, t) {
40
40
  if (r === undefined) t.l[i] = e;
41
41
  else {
42
42
  const t = r.T;
43
- t.h = e;
43
+ t.R = e;
44
44
  e.T = t;
45
45
  r.T = e;
46
46
  }
47
- if (i > t.R) t.R = i;
47
+ if (i > t.h) t.h = i;
48
48
  }
49
49
  function insertIntoHeap(e, t) {
50
- let n = e._;
50
+ let n = e.S;
51
51
  if (n & (REACTIVE_IN_HEAP | REACTIVE_RECOMPUTING_DEPS)) return;
52
52
  if (n & REACTIVE_CHECK) {
53
- e._ = (n & -4) | REACTIVE_DIRTY | REACTIVE_IN_HEAP;
54
- } else e._ = n | REACTIVE_IN_HEAP;
53
+ e.S = (n & -4) | REACTIVE_DIRTY | REACTIVE_IN_HEAP;
54
+ } else e.S = n | REACTIVE_IN_HEAP;
55
55
  if (!(n & REACTIVE_IN_HEAP_HEIGHT)) actualInsertIntoHeap(e, t);
56
56
  }
57
57
  function insertIntoHeapHeight(e, t) {
58
- let n = e._;
58
+ let n = e.S;
59
59
  if (n & (REACTIVE_IN_HEAP | REACTIVE_RECOMPUTING_DEPS | REACTIVE_IN_HEAP_HEIGHT)) return;
60
- e._ = n | REACTIVE_IN_HEAP_HEIGHT;
60
+ e.S = n | REACTIVE_IN_HEAP_HEIGHT;
61
61
  actualInsertIntoHeap(e, t);
62
62
  }
63
63
  function deleteFromHeap(e, t) {
64
- const n = e._;
64
+ const n = e.S;
65
65
  if (!(n & (REACTIVE_IN_HEAP | REACTIVE_IN_HEAP_HEIGHT))) return;
66
- e._ = n & -25;
66
+ e.S = n & -25;
67
67
  const i = e.o;
68
68
  if (e.T === e) t.l[i] = undefined;
69
69
  else {
70
- const n = e.h;
70
+ const n = e.R;
71
71
  const r = t.l[i];
72
72
  const s = n ?? r;
73
73
  if (e === r) t.l[i] = n;
74
- else e.T.h = n;
74
+ else e.T.R = n;
75
75
  s.T = e.T;
76
76
  }
77
77
  e.T = e;
78
- e.h = undefined;
78
+ e.R = undefined;
79
79
  }
80
80
  function markHeap(e) {
81
- if (e.S) return;
82
- e.S = true;
83
- for (let t = 0; t <= e.R; t++) {
84
- for (let n = e.l[t]; n !== undefined; n = n.h) {
85
- if (n._ & REACTIVE_IN_HEAP) markNode(n);
81
+ if (e._) return;
82
+ e._ = true;
83
+ for (let t = 0; t <= e.h; t++) {
84
+ for (let n = e.l[t]; n !== undefined; n = n.R) {
85
+ if (n.S & REACTIVE_IN_HEAP) markNode(n);
86
86
  }
87
87
  }
88
88
  }
89
89
  function markNode(e, t = REACTIVE_DIRTY) {
90
- const n = e._;
90
+ const n = e.S;
91
91
  if ((n & (REACTIVE_CHECK | REACTIVE_DIRTY)) >= t) return;
92
- e._ = (n & -4) | t;
92
+ e.S = (n & -4) | t;
93
93
  for (let t = e.O; t !== null; t = t.p) {
94
94
  markNode(t.A, REACTIVE_CHECK);
95
95
  }
@@ -102,24 +102,24 @@ function markNode(e, t = REACTIVE_DIRTY) {
102
102
  }
103
103
  }
104
104
  function runHeap(e, t) {
105
- e.S = false;
106
- for (e.C = 0; e.C <= e.R; e.C++) {
105
+ e._ = false;
106
+ for (e.C = 0; e.C <= e.h; e.C++) {
107
107
  let n = e.l[e.C];
108
108
  while (n !== undefined) {
109
- if (n._ & REACTIVE_IN_HEAP) t(n);
109
+ if (n.S & REACTIVE_IN_HEAP) t(n);
110
110
  else adjustHeight(n, e);
111
111
  n = e.l[e.C];
112
112
  }
113
113
  }
114
- e.R = 0;
114
+ e.h = 0;
115
115
  }
116
116
  function adjustHeight(e, t) {
117
117
  deleteFromHeap(e, t);
118
118
  let n = e.o;
119
119
  for (let t = e.D; t; t = t.P) {
120
120
  const e = t.V;
121
- const i = e.U || e;
122
- if (i.m && i.o >= n) n = i.o + 1;
121
+ const i = e.m || e;
122
+ if (i.U && i.o >= n) n = i.o + 1;
123
123
  }
124
124
  if (e.o !== n) {
125
125
  e.o = n;
@@ -129,8 +129,9 @@ function adjustHeight(e, t) {
129
129
  }
130
130
  }
131
131
  const transitions = new Set();
132
- const dirtyQueue = { l: new Array(2e3).fill(undefined), S: false, C: 0, R: 0 };
133
- const zombieQueue = { l: new Array(2e3).fill(undefined), S: false, C: 0, R: 0 };
132
+ let optimisticRun = false;
133
+ const dirtyQueue = { l: new Array(2e3).fill(undefined), _: false, C: 0, h: 0 };
134
+ const zombieQueue = { l: new Array(2e3).fill(undefined), _: false, C: 0, h: 0 };
134
135
  let clock = 0;
135
136
  let activeTransition = null;
136
137
  let scheduled = false;
@@ -200,40 +201,34 @@ class Queue {
200
201
  class GlobalQueue extends Queue {
201
202
  k = false;
202
203
  $ = [];
203
- static L;
204
+ L = [];
204
205
  static F;
206
+ static W;
205
207
  flush() {
206
208
  if (this.k) return;
207
209
  this.k = true;
208
210
  try {
209
- runHeap(dirtyQueue, GlobalQueue.L);
211
+ runHeap(dirtyQueue, GlobalQueue.F);
210
212
  if (activeTransition) {
211
213
  if (!transitionComplete(activeTransition)) {
212
- runHeap(zombieQueue, GlobalQueue.L);
214
+ let e = activeTransition;
215
+ runHeap(zombieQueue, GlobalQueue.F);
213
216
  this.$ = [];
214
217
  this.stashQueues(activeTransition.queueStash);
215
218
  clock++;
216
219
  scheduled = false;
217
- runPending(activeTransition.pendingNodes, true);
220
+ runTransitionPending(activeTransition.pendingNodes, true);
218
221
  activeTransition = null;
222
+ runOptimistic(e);
219
223
  return;
220
224
  }
221
225
  this.$.push(...activeTransition.pendingNodes);
222
226
  this.restoreQueues(activeTransition.queueStash);
223
227
  transitions.delete(activeTransition);
224
228
  activeTransition = null;
225
- if (runPending(this.$, false)) runHeap(dirtyQueue, GlobalQueue.L);
226
- } else if (transitions.size) runHeap(zombieQueue, GlobalQueue.L);
227
- for (let e = 0; e < this.$.length; e++) {
228
- const t = this.$[e];
229
- if (t.W !== NOT_PENDING) {
230
- t.j = t.W;
231
- t.W = NOT_PENDING;
232
- if (t.K) t.M = true;
233
- }
234
- if (t.m) GlobalQueue.F(t, false, true);
235
- }
236
- this.$.length = 0;
229
+ runTransitionPending(this.$, false);
230
+ } else if (transitions.size) runHeap(zombieQueue, GlobalQueue.F);
231
+ runOptimistic();
237
232
  clock++;
238
233
  scheduled = false;
239
234
  this.run(EFFECT_RENDER);
@@ -245,8 +240,8 @@ class GlobalQueue extends Queue {
245
240
  notify(e, t, n) {
246
241
  if (t & STATUS_PENDING) {
247
242
  if (n & STATUS_PENDING) {
248
- if (activeTransition && !activeTransition.asyncNodes.includes(e.Y.cause)) {
249
- activeTransition.asyncNodes.push(e.Y.cause);
243
+ if (activeTransition && !activeTransition.asyncNodes.includes(e.j.cause)) {
244
+ activeTransition.asyncNodes.push(e.j.cause);
250
245
  schedule();
251
246
  }
252
247
  }
@@ -257,40 +252,78 @@ class GlobalQueue extends Queue {
257
252
  initTransition(e) {
258
253
  if (activeTransition && activeTransition.time === clock) return;
259
254
  if (!activeTransition) {
260
- activeTransition = e.B ?? {
255
+ activeTransition = e.K ?? {
261
256
  time: clock,
262
257
  pendingNodes: [],
263
258
  asyncNodes: [],
264
- queueStash: { G: [[], []], H: [] }
259
+ optimisticNodes: [],
260
+ queueStash: { G: [[], []], H: [] },
261
+ done: false
265
262
  };
266
263
  }
267
264
  transitions.add(activeTransition);
268
265
  activeTransition.time = clock;
269
266
  for (let e = 0; e < this.$.length; e++) {
270
267
  const t = this.$[e];
271
- t.B = activeTransition;
268
+ t.K = activeTransition;
272
269
  activeTransition.pendingNodes.push(t);
273
270
  }
271
+ for (let e = 0; e < this.L.length; e++) {
272
+ const t = this.L[e];
273
+ t.K = activeTransition;
274
+ activeTransition.optimisticNodes.push(t);
275
+ }
274
276
  this.$ = activeTransition.pendingNodes;
277
+ this.L = activeTransition.optimisticNodes;
278
+ }
279
+ }
280
+ function notifySubs(e) {
281
+ for (let t = e.O; t !== null; t = t.p) {
282
+ const e = t.A.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
283
+ if (e.C > t.A.o) e.C = t.A.o;
284
+ insertIntoHeap(t.A, e);
275
285
  }
276
286
  }
277
- function runPending(e, t) {
278
- let n = false;
279
- const i = e.slice();
280
- for (let e = 0; e < i.length; e++) {
281
- const r = i[e];
282
- r.B = activeTransition;
283
- if (r.X) {
284
- r.X.q(t);
285
- n = true;
287
+ function runOptimistic(e = null) {
288
+ let t = !e;
289
+ const n = globalQueue.L;
290
+ optimisticRun = true;
291
+ for (let t = 0; t < n.length; t++) {
292
+ const i = n[t];
293
+ if (!e && (!i.K || i.K.done) && i.M !== NOT_PENDING) {
294
+ i.Y = i.M;
295
+ i.M = NOT_PENDING;
286
296
  }
287
- if (r.Z && r.Z.W !== NOT_PENDING) {
288
- r.Z.q(r.Z.W);
289
- r.Z.W = NOT_PENDING;
290
- n = true;
297
+ i.K = e;
298
+ notifySubs(i);
299
+ }
300
+ globalQueue.L = [];
301
+ if (dirtyQueue.h >= dirtyQueue.C) {
302
+ t = true;
303
+ runHeap(dirtyQueue, GlobalQueue.F);
304
+ }
305
+ optimisticRun = false;
306
+ t && runPending(globalQueue.$);
307
+ }
308
+ function runPending(e) {
309
+ for (let t = 0; t < e.length; t++) {
310
+ const n = e[t];
311
+ if (n.M !== NOT_PENDING) {
312
+ n.Y = n.M;
313
+ n.M = NOT_PENDING;
314
+ if (n.B) n.X = true;
291
315
  }
316
+ if (n.U) GlobalQueue.W(n, false, true);
317
+ }
318
+ e.length = 0;
319
+ }
320
+ function runTransitionPending(e, t) {
321
+ const n = e.slice();
322
+ for (let e = 0; e < n.length; e++) {
323
+ const i = n[e];
324
+ i.K = activeTransition;
325
+ if (i.q) i.q.Z(t);
292
326
  }
293
- return n;
294
327
  }
295
328
  const globalQueue = new GlobalQueue();
296
329
  function flush() {
@@ -302,6 +335,7 @@ function runQueue(e, t) {
302
335
  for (let n = 0; n < e.length; n++) e[n](t);
303
336
  }
304
337
  function transitionComplete(e) {
338
+ if (e.done) return true;
305
339
  let t = true;
306
340
  for (let n = 0; n < e.asyncNodes.length; n++) {
307
341
  if (e.asyncNodes[n].J & STATUS_PENDING) {
@@ -309,35 +343,29 @@ function transitionComplete(e) {
309
343
  break;
310
344
  }
311
345
  }
346
+ t && (e.done = true);
312
347
  return t;
313
348
  }
314
349
  function runInTransition(e, t) {
315
350
  const n = activeTransition;
316
- activeTransition = e.B;
351
+ activeTransition = e.K;
317
352
  t(e);
318
353
  activeTransition = n;
319
354
  }
320
- GlobalQueue.L = recompute;
321
- GlobalQueue.F = disposeChildren;
355
+ GlobalQueue.F = recompute;
356
+ GlobalQueue.W = disposeChildren;
322
357
  let tracking = false;
323
358
  let stale = false;
324
359
  let pendingValueCheck = false;
325
360
  let pendingCheck = null;
326
361
  let refreshing = false;
327
362
  let context = null;
328
- function notifySubs(e) {
329
- for (let t = e.O; t !== null; t = t.p) {
330
- const e = t.A._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
331
- if (e.C > t.A.o) e.C = t.A.o;
332
- insertIntoHeap(t.A, e);
333
- }
334
- }
335
363
  function recompute(e, t = false) {
336
- const n = e.K && e.B != activeTransition;
364
+ const n = e.B && e.K != activeTransition;
337
365
  if (!t) {
338
- if (e.B && activeTransition !== e.B && !n) globalQueue.initTransition(e);
339
- deleteFromHeap(e, e._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
340
- if (e.B) disposeChildren(e);
366
+ if (e.K && activeTransition !== e.K && !n) globalQueue.initTransition(e);
367
+ deleteFromHeap(e, e.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
368
+ if (e.K) disposeChildren(e);
341
369
  else {
342
370
  markDisposal(e);
343
371
  e.ee = e.te;
@@ -349,17 +377,17 @@ function recompute(e, t = false) {
349
377
  const i = context;
350
378
  context = e;
351
379
  e.re = null;
352
- e._ = REACTIVE_RECOMPUTING_DEPS;
380
+ e.S = REACTIVE_RECOMPUTING_DEPS;
353
381
  e.se = clock;
354
- let r = e.W === NOT_PENDING ? e.j : e.W;
382
+ let r = e.M === NOT_PENDING || (e.oe && e.K) ? e.Y : e.M;
355
383
  let s = e.o;
356
384
  let o = e.J;
357
- let u = e.Y;
385
+ let u = e.j;
358
386
  let l = tracking;
359
387
  setStatusFlags(e, STATUS_NONE | (o & STATUS_UNINITIALIZED));
360
388
  tracking = true;
361
389
  try {
362
- r = handleAsync(e, e.m(r));
390
+ r = handleAsync(e, e.U(r));
363
391
  e.J &= ~STATUS_UNINITIALIZED;
364
392
  } catch (t) {
365
393
  if (t instanceof NotReadyError) {
@@ -369,7 +397,7 @@ function recompute(e, t = false) {
369
397
  } finally {
370
398
  tracking = l;
371
399
  }
372
- e._ = REACTIVE_NONE;
400
+ e.S = REACTIVE_NONE;
373
401
  context = i;
374
402
  if (!(e.J & STATUS_PENDING)) {
375
403
  const t = e.re;
@@ -382,45 +410,42 @@ function recompute(e, t = false) {
382
410
  else e.D = null;
383
411
  }
384
412
  }
385
- const c = !e.oe || !e.oe(e.W === NOT_PENDING || e.ue || n ? e.j : e.W, r);
386
- const a = e.J !== o || e.Y !== u;
413
+ const c = !e.ue || !e.ue(e.M === NOT_PENDING || e.oe || n ? e.Y : e.M, r);
414
+ const a = e.J !== o || e.j !== u;
387
415
  e.le?.(a, o);
388
416
  if (c || a) {
389
417
  if (c) {
390
- if (t || e.ue || n) e.j = r;
391
- else e.W = r;
392
- if (e.Z) e.Z.W = r;
393
- }
394
- for (let t = e.O; t !== null; t = t.p) {
395
- const n = t.A._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
396
- if (t.A.o < e.o && n.C > t.A.o) n.C = t.A.o;
397
- insertIntoHeap(t.A, n);
418
+ if (t || e.oe || n) e.Y = r;
419
+ else e.M = r;
420
+ if (e.ce) setSignal(e.ce, r);
398
421
  }
422
+ (!e.oe || optimisticRun) && notifySubs(e);
399
423
  } else if (e.o != s) {
400
424
  for (let t = e.O; t !== null; t = t.p) {
401
- insertIntoHeapHeight(t.A, t.A._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
425
+ insertIntoHeapHeight(t.A, t.A.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
402
426
  }
403
427
  }
404
- if ((!t || e.J & STATUS_PENDING) && !e.ue && !e.B) globalQueue.$.push(e);
405
- if (e.B && n) runInTransition(e, recompute);
428
+ e.oe && !optimisticRun && globalQueue.L.push(e);
429
+ (!t || e.J & STATUS_PENDING) && !e.K && globalQueue.$.push(e);
430
+ e.K && n && runInTransition(e, recompute);
406
431
  }
407
432
  function handleAsync(e, t, n) {
408
433
  const i = typeof t === "object" && t !== null;
409
434
  const r = i && t instanceof Promise;
410
435
  const s = i && untrack(() => t[Symbol.asyncIterator]);
411
436
  if (!r && !s) {
412
- e.ce = null;
437
+ e.ae = null;
413
438
  return t;
414
439
  }
415
- e.ce = t;
440
+ e.ae = t;
416
441
  if (r) {
417
442
  t.then(i => {
418
- if (e.ce !== t) return;
443
+ if (e.ae !== t) return;
419
444
  globalQueue.initTransition(e);
420
445
  n?.(i) ?? setSignal(e, () => i);
421
446
  flush();
422
447
  }).catch(n => {
423
- if (e.ce !== t) return;
448
+ if (e.ae !== t) return;
424
449
  globalQueue.initTransition(e);
425
450
  setStatusFlags(e, STATUS_ERROR, n);
426
451
  e.se = clock;
@@ -432,13 +457,13 @@ function handleAsync(e, t, n) {
432
457
  (async () => {
433
458
  try {
434
459
  for await (let i of t) {
435
- if (e.ce !== t) return;
460
+ if (e.ae !== t) return;
436
461
  globalQueue.initTransition(e);
437
462
  n?.(i) ?? setSignal(e, () => i);
438
463
  flush();
439
464
  }
440
465
  } catch (n) {
441
- if (e.ce !== t) return;
466
+ if (e.ae !== t) return;
442
467
  globalQueue.initTransition(e);
443
468
  setStatusFlags(e, STATUS_ERROR, n);
444
469
  e.se = clock;
@@ -452,42 +477,42 @@ function handleAsync(e, t, n) {
452
477
  throw new NotReadyError(context);
453
478
  }
454
479
  function updateIfNecessary(e) {
455
- if (e._ & REACTIVE_CHECK) {
480
+ if (e.S & REACTIVE_CHECK) {
456
481
  for (let t = e.D; t; t = t.P) {
457
482
  const n = t.V;
458
- const i = n.U || n;
459
- if (i.m) {
483
+ const i = n.m || n;
484
+ if (i.U) {
460
485
  updateIfNecessary(i);
461
486
  }
462
- if (e._ & REACTIVE_DIRTY) {
487
+ if (e.S & REACTIVE_DIRTY) {
463
488
  break;
464
489
  }
465
490
  }
466
491
  }
467
- if (e._ & REACTIVE_DIRTY) {
492
+ if (e.S & REACTIVE_DIRTY) {
468
493
  recompute(e);
469
494
  }
470
- e._ = REACTIVE_NONE;
495
+ e.S = REACTIVE_NONE;
471
496
  }
472
497
  function unlinkSubs(e) {
473
498
  const t = e.V;
474
499
  const n = e.P;
475
500
  const i = e.p;
476
- const r = e.ae;
477
- if (i !== null) i.ae = r;
478
- else t.fe = r;
501
+ const r = e.fe;
502
+ if (i !== null) i.fe = r;
503
+ else t.Ee = r;
479
504
  if (r !== null) r.p = i;
480
505
  else {
481
506
  t.O = i;
482
507
  if (i === null) {
483
- t.Ee?.();
484
- t.m && !t.de && unobserved(t);
508
+ t.de?.();
509
+ t.U && !t.Te && unobserved(t);
485
510
  }
486
511
  }
487
512
  return n;
488
513
  }
489
514
  function unobserved(e) {
490
- deleteFromHeap(e, e._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
515
+ deleteFromHeap(e, e.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
491
516
  let t = e.D;
492
517
  while (t !== null) {
493
518
  t = unlinkSubs(t);
@@ -499,7 +524,7 @@ function link(e, t) {
499
524
  const n = t.re;
500
525
  if (n !== null && n.V === e) return;
501
526
  let i = null;
502
- const r = t._ & REACTIVE_RECOMPUTING_DEPS;
527
+ const r = t.S & REACTIVE_RECOMPUTING_DEPS;
503
528
  if (r) {
504
529
  i = n !== null ? n.P : t.D;
505
530
  if (i !== null && i.V === e) {
@@ -507,9 +532,9 @@ function link(e, t) {
507
532
  return;
508
533
  }
509
534
  }
510
- const s = e.fe;
535
+ const s = e.Ee;
511
536
  if (s !== null && s.A === t && (!r || isValidLink(s, t))) return;
512
- const o = (t.re = e.fe = { V: e, A: t, P: i, ae: s, p: null });
537
+ const o = (t.re = e.Ee = { V: e, A: t, P: i, fe: s, p: null });
513
538
  if (n !== null) n.P = o;
514
539
  else t.D = o;
515
540
  if (s !== null) s.p = o;
@@ -529,18 +554,18 @@ function isValidLink(e, t) {
529
554
  }
530
555
  function setStatusFlags(e, t, n = null) {
531
556
  e.J = t;
532
- e.Y = n;
557
+ e.j = n;
533
558
  }
534
559
  function markDisposal(e) {
535
560
  let t = e.ie;
536
561
  while (t) {
537
- t._ |= REACTIVE_ZOMBIE;
538
- if (t._ & REACTIVE_IN_HEAP) {
562
+ t.S |= REACTIVE_ZOMBIE;
563
+ if (t.S & REACTIVE_IN_HEAP) {
539
564
  deleteFromHeap(t, dirtyQueue);
540
565
  insertIntoHeap(t, zombieQueue);
541
566
  }
542
567
  markDisposal(t);
543
- t = t.Te;
568
+ t = t.Re;
544
569
  }
545
570
  }
546
571
  function dispose(e) {
@@ -553,14 +578,14 @@ function dispose(e) {
553
578
  disposeChildren(e, true);
554
579
  }
555
580
  function disposeChildren(e, t = false, n) {
556
- if (e._ & REACTIVE_DISPOSED) return;
557
- if (t) e._ = REACTIVE_DISPOSED;
581
+ if (e.S & REACTIVE_DISPOSED) return;
582
+ if (t) e.S = REACTIVE_DISPOSED;
558
583
  let i = n ? e.ne : e.ie;
559
584
  while (i) {
560
- const e = i.Te;
585
+ const e = i.Re;
561
586
  if (i.D) {
562
587
  const e = i;
563
- deleteFromHeap(e, e._ & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
588
+ deleteFromHeap(e, e.S & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
564
589
  let t = e.D;
565
590
  do {
566
591
  t = unlinkSubs(t);
@@ -575,7 +600,7 @@ function disposeChildren(e, t = false, n) {
575
600
  e.ne = null;
576
601
  } else {
577
602
  e.ie = null;
578
- e.Te = null;
603
+ e.Re = null;
579
604
  }
580
605
  runDisposal(e, n);
581
606
  }
@@ -604,36 +629,36 @@ function formatId(e, t) {
604
629
  function computed(e, t, n) {
605
630
  const i = {
606
631
  id: n?.id ?? (context?.id != null ? getNextChildId(context) : undefined),
607
- oe: n?.equals != null ? n.equals : isEqual,
608
- Re: !!n?.pureWrite,
609
- Ee: n?.unobserved,
632
+ ue: n?.equals != null ? n.equals : isEqual,
633
+ Se: !!n?.pureWrite,
634
+ de: n?.unobserved,
610
635
  te: null,
611
636
  _e: context?._e ?? globalQueue,
612
- Se: context?.Se ?? defaultContext,
637
+ Oe: context?.Oe ?? defaultContext,
613
638
  he: 0,
614
- m: e,
615
- j: t,
639
+ U: e,
640
+ Y: t,
616
641
  o: 0,
617
642
  N: null,
618
- h: undefined,
643
+ R: undefined,
619
644
  T: null,
620
645
  D: null,
621
646
  re: null,
622
647
  O: null,
623
- fe: null,
648
+ Ee: null,
624
649
  i: context,
625
- Te: null,
650
+ Re: null,
626
651
  ie: null,
627
- _: REACTIVE_NONE,
652
+ S: REACTIVE_NONE,
628
653
  J: STATUS_UNINITIALIZED,
629
654
  se: clock,
630
- W: NOT_PENDING,
655
+ M: NOT_PENDING,
631
656
  ee: null,
632
657
  ne: null,
633
- ce: null,
634
- B: null
658
+ ae: null,
659
+ K: null
635
660
  };
636
- if (n?.Oe) Object.assign(i, n.Oe);
661
+ if (n?.pe) Object.assign(i, n.pe);
637
662
  i.T = i;
638
663
  const r = context?.t ? context.u : context;
639
664
  if (context) {
@@ -641,28 +666,28 @@ function computed(e, t, n) {
641
666
  if (e === null) {
642
667
  context.ie = i;
643
668
  } else {
644
- i.Te = e;
669
+ i.Re = e;
645
670
  context.ie = i;
646
671
  }
647
672
  }
648
673
  if (r) i.o = r.o + 1;
649
- recompute(i, true);
674
+ !n?.lazy && recompute(i, true);
650
675
  return i;
651
676
  }
652
677
  function signal(e, t, n = null) {
653
678
  const i = {
654
679
  id: t?.id ?? (context?.id != null ? getNextChildId(context) : undefined),
655
- oe: t?.equals != null ? t.equals : isEqual,
656
- Re: !!t?.pureWrite,
657
- Ee: t?.unobserved,
658
- j: e,
680
+ ue: t?.equals != null ? t.equals : isEqual,
681
+ Se: !!t?.pureWrite,
682
+ de: t?.unobserved,
683
+ Y: e,
659
684
  O: null,
660
- fe: null,
685
+ Ee: null,
661
686
  J: STATUS_NONE,
662
687
  se: clock,
663
- U: n,
688
+ m: n,
664
689
  I: n?.N || null,
665
- W: NOT_PENDING
690
+ M: NOT_PENDING
666
691
  };
667
692
  n && (n.N = i);
668
693
  return i;
@@ -682,13 +707,13 @@ function untrack(e) {
682
707
  function read(e) {
683
708
  let t = context;
684
709
  if (t?.t) t = t.u;
685
- if (refreshing && e.m) recompute(e);
710
+ if (refreshing && e.U) recompute(e);
686
711
  if (t && tracking && !pendingCheck && !pendingValueCheck) {
687
- if (e.m && e._ & REACTIVE_DISPOSED) recompute(e);
712
+ if (e.U && e.S & REACTIVE_DISPOSED) recompute(e);
688
713
  link(e, t);
689
- const n = e.U || e;
690
- if (n.m) {
691
- const i = e._ & REACTIVE_ZOMBIE;
714
+ const n = e.m || e;
715
+ if (n.U) {
716
+ const i = e.S & REACTIVE_ZOMBIE;
692
717
  if (n.o >= (i ? zombieQueue.C : dirtyQueue.C)) {
693
718
  markNode(t);
694
719
  markHeap(i ? zombieQueue : dirtyQueue);
@@ -701,33 +726,32 @@ function read(e) {
701
726
  }
702
727
  }
703
728
  if (pendingCheck) {
704
- if (!e.X) {
705
- e.X = signal(false);
706
- e.X.ue = true;
707
- e.X.q = t => setSignal(e.X, t);
729
+ if (!e.q) {
730
+ e.q = signal(false);
731
+ e.q.oe = true;
732
+ e.q.Z = t => setSignal(e.q, t);
708
733
  }
709
734
  const t = pendingCheck;
710
735
  pendingCheck = null;
711
- t.j = read(e.X) || t.j;
736
+ t.Y = read(e.q) || t.Y;
712
737
  pendingCheck = t;
713
738
  }
714
739
  if (pendingValueCheck) {
715
- if (!e.Z) {
716
- e.Z = signal(e.j);
717
- e.Z.ue = true;
718
- e.Z.q = t => setSignal(e.Z, t);
740
+ if (!e.ce) {
741
+ e.ce = signal(e.Y);
742
+ e.ce.oe = true;
719
743
  }
720
744
  pendingValueCheck = false;
721
745
  try {
722
- return read(e.Z);
746
+ return read(e.ce);
723
747
  } finally {
724
748
  pendingValueCheck = true;
725
749
  }
726
750
  }
727
751
  if (e.J & STATUS_PENDING && !pendingCheck) {
728
- if ((t && !stale) || e.J & STATUS_UNINITIALIZED) throw e.Y;
752
+ if ((t && !stale) || e.J & STATUS_UNINITIALIZED) throw e.j;
729
753
  else if (t && stale) {
730
- setStatusFlags(t, t.J | 1, e.Y);
754
+ setStatusFlags(t, t.J | 1, e.j);
731
755
  }
732
756
  }
733
757
  if (e.J & STATUS_ERROR) {
@@ -735,33 +759,33 @@ function read(e) {
735
759
  recompute(e, true);
736
760
  return read(e);
737
761
  } else {
738
- throw e.Y;
762
+ throw e.j;
739
763
  }
740
764
  }
741
765
  return !t ||
742
- e.ue ||
743
- e.W === NOT_PENDING ||
744
- (stale && !pendingCheck && e.B && activeTransition !== e.B)
745
- ? e.j
746
- : e.W;
766
+ e.oe ||
767
+ e.M === NOT_PENDING ||
768
+ (stale && !pendingCheck && (t.oe || (e.K && activeTransition !== e.K)))
769
+ ? e.Y
770
+ : e.M;
747
771
  }
748
772
  function setSignal(e, t) {
749
773
  if (typeof t === "function") {
750
- t = t(e.W === NOT_PENDING ? e.j : e.W);
774
+ t = t(e.M === NOT_PENDING || (e.oe && e.K) ? e.Y : e.M);
751
775
  }
752
- const n = !e.oe || !e.oe(e.W === NOT_PENDING || e.ue ? e.j : e.W, t);
776
+ const n = !e.ue || !e.ue(e.M === NOT_PENDING || e.oe ? e.Y : e.M, t);
753
777
  if (!n && !e.J) return t;
754
778
  if (n) {
755
- if (e.ue) e.j = t;
779
+ if (e.oe) e.Y = t;
756
780
  else {
757
- if (e.W === NOT_PENDING) globalQueue.$.push(e);
758
- e.W = t;
781
+ if (e.M === NOT_PENDING) globalQueue.$.push(e);
782
+ e.M = t;
759
783
  }
760
- if (e.Z) e.Z.W = t;
784
+ if (e.ce) setSignal(e.ce, t);
761
785
  }
762
786
  setStatusFlags(e, STATUS_NONE);
763
787
  e.se = clock;
764
- notifySubs(e);
788
+ e.oe && !optimisticRun ? globalQueue.L.push(e) : notifySubs(e);
765
789
  schedule();
766
790
  return t;
767
791
  }
@@ -789,11 +813,11 @@ function createOwner(e) {
789
813
  t: true,
790
814
  u: t?.t ? t.u : t,
791
815
  ie: null,
792
- Te: null,
816
+ Re: null,
793
817
  te: null,
794
818
  id: e?.id ?? (t?.id != null ? getNextChildId(t) : undefined),
795
819
  _e: t?._e ?? globalQueue,
796
- Se: t?.Se || defaultContext,
820
+ Oe: t?.Oe || defaultContext,
797
821
  he: 0,
798
822
  ee: null,
799
823
  ne: null,
@@ -807,7 +831,7 @@ function createOwner(e) {
807
831
  if (e === null) {
808
832
  t.ie = n;
809
833
  } else {
810
- n.Te = e;
834
+ n.Re = e;
811
835
  t.ie = n;
812
836
  }
813
837
  }
@@ -846,10 +870,10 @@ function pending(e) {
846
870
  }
847
871
  function isPending(e) {
848
872
  const t = pendingCheck;
849
- pendingCheck = { j: false };
873
+ pendingCheck = { Y: false };
850
874
  try {
851
875
  staleValues(e);
852
- return pendingCheck.j;
876
+ return pendingCheck.Y;
853
877
  } catch (e) {
854
878
  if (!(e instanceof NotReadyError)) return false;
855
879
  throw e;
@@ -880,7 +904,7 @@ function getContext(e, t = getOwner()) {
880
904
  if (!t) {
881
905
  throw new NoOwnerError();
882
906
  }
883
- const n = hasContext(e, t) ? t.Se[e.id] : e.defaultValue;
907
+ const n = hasContext(e, t) ? t.Oe[e.id] : e.defaultValue;
884
908
  if (isUndefined(n)) {
885
909
  throw new ContextNotFoundError();
886
910
  }
@@ -890,10 +914,10 @@ function setContext(e, t, n = getOwner()) {
890
914
  if (!n) {
891
915
  throw new NoOwnerError();
892
916
  }
893
- n.Se = { ...n.Se, [e.id]: isUndefined(t) ? e.defaultValue : t };
917
+ n.Oe = { ...n.Oe, [e.id]: isUndefined(t) ? e.defaultValue : t };
894
918
  }
895
919
  function hasContext(e, t) {
896
- return !isUndefined(t?.Se[e.id]);
920
+ return !isUndefined(t?.Oe[e.id]);
897
921
  }
898
922
  function isUndefined(e) {
899
923
  return typeof e === "undefined";
@@ -902,23 +926,23 @@ function effect(e, t, n, i, r) {
902
926
  let s = false;
903
927
  const o = computed(e, i, {
904
928
  ...r,
905
- Oe: {
906
- M: true,
907
- pe: i,
908
- Ae: t,
929
+ pe: {
930
+ X: true,
931
+ Ae: i,
932
+ ge: t,
909
933
  Ne: n,
910
934
  Ie: undefined,
911
- K: r?.render ? EFFECT_RENDER : EFFECT_USER,
935
+ B: r?.render ? EFFECT_RENDER : EFFECT_USER,
912
936
  le(e, t) {
913
937
  if (s) {
914
938
  const n = this.J && this.J === t && e;
915
- this.M = !(this.J & STATUS_ERROR) && !(this.J & STATUS_PENDING & ~t) && !n;
916
- if (this.M) this._e.enqueue(this.K, runEffect.bind(this));
939
+ this.X = !(this.J & STATUS_ERROR) && !(this.J & STATUS_PENDING & ~t) && !n;
940
+ if (this.X) this._e.enqueue(this.B, runEffect.bind(this));
917
941
  }
918
942
  if (this.J & STATUS_ERROR) {
919
- let e = this.Y;
943
+ let e = this.j;
920
944
  this._e.notify(this, STATUS_PENDING, 0);
921
- if (this.K === EFFECT_USER) {
945
+ if (this.B === EFFECT_USER) {
922
946
  try {
923
947
  return this.Ne
924
948
  ? this.Ne(e, () => {
@@ -931,30 +955,30 @@ function effect(e, t, n, i, r) {
931
955
  }
932
956
  }
933
957
  if (!this._e.notify(this, STATUS_ERROR, STATUS_ERROR)) throw e;
934
- } else if (this.K === EFFECT_RENDER) {
958
+ } else if (this.B === EFFECT_RENDER) {
935
959
  this._e.notify(this, STATUS_PENDING | STATUS_ERROR, this.J);
936
960
  }
937
961
  }
938
962
  }
939
963
  });
940
964
  s = true;
941
- if (o.K === EFFECT_RENDER) o.m = t => staleValues(() => e(t));
965
+ if (o.B === EFFECT_RENDER) o.U = t => staleValues(() => e(t));
942
966
  !r?.defer &&
943
967
  !(o.J & (STATUS_ERROR | STATUS_PENDING)) &&
944
- (o.K === EFFECT_USER ? o._e.enqueue(o.K, runEffect.bind(o)) : runEffect.call(o));
968
+ (o.B === EFFECT_USER ? o._e.enqueue(o.B, runEffect.bind(o)) : runEffect.call(o));
945
969
  onCleanup(() => o.Ie?.());
946
970
  }
947
971
  function runEffect() {
948
- if (!this.M || this._ & REACTIVE_DISPOSED) return;
972
+ if (!this.X || this.S & REACTIVE_DISPOSED) return;
949
973
  this.Ie?.();
950
974
  this.Ie = undefined;
951
975
  try {
952
- this.Ie = this.Ae(this.j, this.pe);
976
+ this.Ie = this.ge(this.Y, this.Ae);
953
977
  } catch (e) {
954
978
  if (!this._e.notify(this, STATUS_ERROR, STATUS_ERROR)) throw e;
955
979
  } finally {
956
- this.pe = this.j;
957
- this.M = false;
980
+ this.Ae = this.Y;
981
+ this.X = false;
958
982
  }
959
983
  }
960
984
  function createSignal(e, t, n) {
@@ -1014,7 +1038,30 @@ function resolve(e) {
1014
1038
  });
1015
1039
  }
1016
1040
  function createOptimistic(e, t, n) {
1017
- return {};
1041
+ if (typeof e === "function") {
1042
+ const i = computed(
1043
+ t => {
1044
+ let n = i || getOwner();
1045
+ n.M = e(t);
1046
+ return t;
1047
+ },
1048
+ t,
1049
+ n
1050
+ );
1051
+ i.oe = true;
1052
+ return [read.bind(null, i), setSignal.bind(null, i)];
1053
+ }
1054
+ const i = getOwner();
1055
+ const r = i?.id != null;
1056
+ const s = signal(e, r ? { id: getNextChildId(i), ...t } : t);
1057
+ s.oe = true;
1058
+ return [
1059
+ read.bind(null, s),
1060
+ t => {
1061
+ s.M = e;
1062
+ return setSignal(s, t);
1063
+ }
1064
+ ];
1018
1065
  }
1019
1066
  function onSettled(e) {
1020
1067
  let t;
@@ -1050,7 +1097,7 @@ function applyState(e, t, n, i) {
1050
1097
  let t = false;
1051
1098
  const l = getOverrideValue(s, o, u, "length");
1052
1099
  if (e.length && l && e[0] && n(e[0]) != null) {
1053
- let c, a, f, E, d, T, h, R;
1100
+ let c, a, f, E, d, T, R, h;
1054
1101
  for (
1055
1102
  f = 0, E = Math.min(l, e.length);
1056
1103
  f < E && ((T = getOverrideValue(s, o, u, f)) === e[f] || (T && e[f] && n(T) === n(e[f])));
@@ -1058,8 +1105,8 @@ function applyState(e, t, n, i) {
1058
1105
  ) {
1059
1106
  applyState(e[f], wrap(T, r), n, i);
1060
1107
  }
1061
- const _ = new Array(e.length),
1062
- S = new Map();
1108
+ const S = new Array(e.length),
1109
+ _ = new Map();
1063
1110
  for (
1064
1111
  E = l - 1, d = e.length - 1;
1065
1112
  E >= f &&
@@ -1067,7 +1114,7 @@ function applyState(e, t, n, i) {
1067
1114
  ((T = getOverrideValue(s, o, u, E)) === e[d] || (T && e[d] && n(T) === n(e[d])));
1068
1115
  E--, d--
1069
1116
  ) {
1070
- _[d] = T;
1117
+ S[d] = T;
1071
1118
  }
1072
1119
  if (f > d || f > E) {
1073
1120
  for (a = f; a <= d; a++) {
@@ -1076,7 +1123,7 @@ function applyState(e, t, n, i) {
1076
1123
  }
1077
1124
  for (; a < e.length; a++) {
1078
1125
  t = true;
1079
- const s = wrap(_[a], r);
1126
+ const s = wrap(S[a], r);
1080
1127
  r[STORE_NODE][a] && setSignal(r[STORE_NODE][a], s);
1081
1128
  applyState(e[a], s, n, i);
1082
1129
  }
@@ -1084,27 +1131,27 @@ function applyState(e, t, n, i) {
1084
1131
  l !== e.length && r[STORE_NODE].length && setSignal(r[STORE_NODE].length, e.length);
1085
1132
  return;
1086
1133
  }
1087
- h = new Array(d + 1);
1134
+ R = new Array(d + 1);
1088
1135
  for (a = d; a >= f; a--) {
1089
1136
  T = e[a];
1090
- R = T ? n(T) : T;
1091
- c = S.get(R);
1092
- h[a] = c === undefined ? -1 : c;
1093
- S.set(R, a);
1137
+ h = T ? n(T) : T;
1138
+ c = _.get(h);
1139
+ R[a] = c === undefined ? -1 : c;
1140
+ _.set(h, a);
1094
1141
  }
1095
1142
  for (c = f; c <= E; c++) {
1096
1143
  T = getOverrideValue(s, o, u, c);
1097
- R = T ? n(T) : T;
1098
- a = S.get(R);
1144
+ h = T ? n(T) : T;
1145
+ a = _.get(h);
1099
1146
  if (a !== undefined && a !== -1) {
1100
- _[a] = T;
1101
- a = h[a];
1102
- S.set(R, a);
1147
+ S[a] = T;
1148
+ a = R[a];
1149
+ _.set(h, a);
1103
1150
  }
1104
1151
  }
1105
1152
  for (a = f; a < e.length; a++) {
1106
- if (a in _) {
1107
- const t = wrap(_[a], r);
1153
+ if (a in S) {
1154
+ const t = wrap(S[a], r);
1108
1155
  r[STORE_NODE][a] && setSignal(r[STORE_NODE][a], t);
1109
1156
  applyState(e[a], t, n, i);
1110
1157
  } else r[STORE_NODE][a] && setSignal(r[STORE_NODE][a], wrap(e[a], r));
@@ -1279,7 +1326,7 @@ const storeTraps = {
1279
1326
  if (e && e.get) return e.get.call(n);
1280
1327
  }
1281
1328
  if (Writing?.has(n)) {
1282
- let n = r && (s || !o) ? (r.W !== NOT_PENDING ? r.W : r.j) : u[t];
1329
+ let n = r && (s || !o) ? (r.M !== NOT_PENDING ? r.M : r.Y) : u[t];
1283
1330
  n === $DELETED && (n = undefined);
1284
1331
  if (!isWrappable(n)) return n;
1285
1332
  const i = wrap(n, e);
@@ -1639,68 +1686,68 @@ function mapArray(e, t, n) {
1639
1686
  const i = typeof n?.keyed === "function" ? n.keyed : undefined;
1640
1687
  return createMemo(
1641
1688
  updateKeyedMap.bind({
1642
- ge: createOwner(),
1643
- ye: 0,
1644
- Ce: e,
1645
- De: [],
1646
- Pe: t,
1647
- we: [],
1689
+ ye: createOwner(),
1690
+ Ce: 0,
1691
+ De: e,
1692
+ Pe: [],
1693
+ we: t,
1648
1694
  be: [],
1649
- Ve: i,
1695
+ Ve: [],
1696
+ me: i,
1650
1697
  Ue: i || n?.keyed === false ? [] : undefined,
1651
- me: t.length > 1 ? [] : undefined,
1652
- ke: n?.fallback
1698
+ ke: t.length > 1 ? [] : undefined,
1699
+ ve: n?.fallback
1653
1700
  })
1654
1701
  );
1655
1702
  }
1656
1703
  const pureOptions = { pureWrite: true };
1657
1704
  function updateKeyedMap() {
1658
- const e = this.Ce() || [],
1705
+ const e = this.De() || [],
1659
1706
  t = e.length;
1660
1707
  e[$TRACK];
1661
- runWithOwner(this.ge, () => {
1708
+ runWithOwner(this.ye, () => {
1662
1709
  let n,
1663
1710
  i,
1664
1711
  r = this.Ue
1665
1712
  ? () => {
1666
1713
  this.Ue[i] = signal(e[i], pureOptions);
1667
- this.me && (this.me[i] = signal(i, pureOptions));
1668
- return this.Pe(
1714
+ this.ke && (this.ke[i] = signal(i, pureOptions));
1715
+ return this.we(
1669
1716
  read.bind(null, this.Ue[i]),
1670
- this.me ? read.bind(null, this.me[i]) : undefined
1717
+ this.ke ? read.bind(null, this.ke[i]) : undefined
1671
1718
  );
1672
1719
  }
1673
- : this.me
1720
+ : this.ke
1674
1721
  ? () => {
1675
1722
  const t = e[i];
1676
- this.me[i] = signal(i, pureOptions);
1677
- return this.Pe(() => t, read.bind(null, this.me[i]));
1723
+ this.ke[i] = signal(i, pureOptions);
1724
+ return this.we(() => t, read.bind(null, this.ke[i]));
1678
1725
  }
1679
1726
  : () => {
1680
1727
  const t = e[i];
1681
- return this.Pe(() => t);
1728
+ return this.we(() => t);
1682
1729
  };
1683
1730
  if (t === 0) {
1684
- if (this.ye !== 0) {
1685
- this.ge.dispose(false);
1731
+ if (this.Ce !== 0) {
1732
+ this.ye.dispose(false);
1733
+ this.Ve = [];
1734
+ this.Pe = [];
1686
1735
  this.be = [];
1687
- this.De = [];
1688
- this.we = [];
1689
- this.ye = 0;
1736
+ this.Ce = 0;
1690
1737
  this.Ue && (this.Ue = []);
1691
- this.me && (this.me = []);
1738
+ this.ke && (this.ke = []);
1692
1739
  }
1693
- if (this.ke && !this.we[0]) {
1694
- this.we[0] = runWithOwner((this.be[0] = createOwner()), this.ke);
1740
+ if (this.ve && !this.be[0]) {
1741
+ this.be[0] = runWithOwner((this.Ve[0] = createOwner()), this.ve);
1695
1742
  }
1696
- } else if (this.ye === 0) {
1697
- if (this.be[0]) this.be[0].dispose();
1698
- this.we = new Array(t);
1743
+ } else if (this.Ce === 0) {
1744
+ if (this.Ve[0]) this.Ve[0].dispose();
1745
+ this.be = new Array(t);
1699
1746
  for (i = 0; i < t; i++) {
1700
- this.De[i] = e[i];
1701
- this.we[i] = runWithOwner((this.be[i] = createOwner()), r);
1747
+ this.Pe[i] = e[i];
1748
+ this.be[i] = runWithOwner((this.Ve[i] = createOwner()), r);
1702
1749
  }
1703
- this.ye = t;
1750
+ this.Ce = t;
1704
1751
  } else {
1705
1752
  let s,
1706
1753
  o,
@@ -1712,149 +1759,149 @@ function updateKeyedMap() {
1712
1759
  E = new Array(t),
1713
1760
  d = new Array(t),
1714
1761
  T = this.Ue ? new Array(t) : undefined,
1715
- h = this.me ? new Array(t) : undefined;
1762
+ R = this.ke ? new Array(t) : undefined;
1716
1763
  for (
1717
- s = 0, o = Math.min(this.ye, t);
1718
- s < o && (this.De[s] === e[s] || (this.Ue && compare(this.Ve, this.De[s], e[s])));
1764
+ s = 0, o = Math.min(this.Ce, t);
1765
+ s < o && (this.Pe[s] === e[s] || (this.Ue && compare(this.me, this.Pe[s], e[s])));
1719
1766
  s++
1720
1767
  ) {
1721
1768
  if (this.Ue) setSignal(this.Ue[s], e[s]);
1722
1769
  }
1723
1770
  for (
1724
- o = this.ye - 1, u = t - 1;
1771
+ o = this.Ce - 1, u = t - 1;
1725
1772
  o >= s &&
1726
1773
  u >= s &&
1727
- (this.De[o] === e[u] || (this.Ue && compare(this.Ve, this.De[o], e[u])));
1774
+ (this.Pe[o] === e[u] || (this.Ue && compare(this.me, this.Pe[o], e[u])));
1728
1775
  o--, u--
1729
1776
  ) {
1730
- E[u] = this.we[o];
1731
- d[u] = this.be[o];
1777
+ E[u] = this.be[o];
1778
+ d[u] = this.Ve[o];
1732
1779
  T && (T[u] = this.Ue[o]);
1733
- h && (h[u] = this.me[o]);
1780
+ R && (R[u] = this.ke[o]);
1734
1781
  }
1735
1782
  a = new Map();
1736
1783
  f = new Array(u + 1);
1737
1784
  for (i = u; i >= s; i--) {
1738
1785
  l = e[i];
1739
- c = this.Ve ? this.Ve(l) : l;
1786
+ c = this.me ? this.me(l) : l;
1740
1787
  n = a.get(c);
1741
1788
  f[i] = n === undefined ? -1 : n;
1742
1789
  a.set(c, i);
1743
1790
  }
1744
1791
  for (n = s; n <= o; n++) {
1745
- l = this.De[n];
1746
- c = this.Ve ? this.Ve(l) : l;
1792
+ l = this.Pe[n];
1793
+ c = this.me ? this.me(l) : l;
1747
1794
  i = a.get(c);
1748
1795
  if (i !== undefined && i !== -1) {
1749
- E[i] = this.we[n];
1750
- d[i] = this.be[n];
1796
+ E[i] = this.be[n];
1797
+ d[i] = this.Ve[n];
1751
1798
  T && (T[i] = this.Ue[n]);
1752
- h && (h[i] = this.me[n]);
1799
+ R && (R[i] = this.ke[n]);
1753
1800
  i = f[i];
1754
1801
  a.set(c, i);
1755
- } else this.be[n].dispose();
1802
+ } else this.Ve[n].dispose();
1756
1803
  }
1757
1804
  for (i = s; i < t; i++) {
1758
1805
  if (i in E) {
1759
- this.we[i] = E[i];
1760
- this.be[i] = d[i];
1806
+ this.be[i] = E[i];
1807
+ this.Ve[i] = d[i];
1761
1808
  if (T) {
1762
1809
  this.Ue[i] = T[i];
1763
1810
  setSignal(this.Ue[i], e[i]);
1764
1811
  }
1765
- if (h) {
1766
- this.me[i] = h[i];
1767
- setSignal(this.me[i], i);
1812
+ if (R) {
1813
+ this.ke[i] = R[i];
1814
+ setSignal(this.ke[i], i);
1768
1815
  }
1769
1816
  } else {
1770
- this.we[i] = runWithOwner((this.be[i] = createOwner()), r);
1817
+ this.be[i] = runWithOwner((this.Ve[i] = createOwner()), r);
1771
1818
  }
1772
1819
  }
1773
- this.we = this.we.slice(0, (this.ye = t));
1774
- this.De = e.slice(0);
1820
+ this.be = this.be.slice(0, (this.Ce = t));
1821
+ this.Pe = e.slice(0);
1775
1822
  }
1776
1823
  });
1777
- return this.we;
1824
+ return this.be;
1778
1825
  }
1779
1826
  function repeat(e, t, n) {
1780
1827
  return updateRepeat.bind({
1781
- ge: createOwner(),
1782
- ye: 0,
1783
- ve: 0,
1784
- xe: e,
1785
- Pe: t,
1828
+ ye: createOwner(),
1829
+ Ce: 0,
1830
+ xe: 0,
1831
+ Ge: e,
1832
+ we: t,
1833
+ Ve: [],
1786
1834
  be: [],
1787
- we: [],
1788
- Ge: n?.from,
1789
- ke: n?.fallback
1835
+ He: n?.from,
1836
+ ve: n?.fallback
1790
1837
  });
1791
1838
  }
1792
1839
  function updateRepeat() {
1793
- const e = this.xe();
1794
- const t = this.Ge?.() || 0;
1795
- runWithOwner(this.ge, () => {
1840
+ const e = this.Ge();
1841
+ const t = this.He?.() || 0;
1842
+ runWithOwner(this.ye, () => {
1796
1843
  if (e === 0) {
1797
- if (this.ye !== 0) {
1798
- this.ge.dispose(false);
1844
+ if (this.Ce !== 0) {
1845
+ this.ye.dispose(false);
1846
+ this.Ve = [];
1799
1847
  this.be = [];
1800
- this.we = [];
1801
- this.ye = 0;
1848
+ this.Ce = 0;
1802
1849
  }
1803
- if (this.ke && !this.we[0]) {
1804
- this.we[0] = runWithOwner((this.be[0] = createOwner()), this.ke);
1850
+ if (this.ve && !this.be[0]) {
1851
+ this.be[0] = runWithOwner((this.Ve[0] = createOwner()), this.ve);
1805
1852
  }
1806
1853
  return;
1807
1854
  }
1808
1855
  const n = t + e;
1809
- const i = this.ve + this.ye;
1810
- if (this.ye === 0 && this.be[0]) this.be[0].dispose();
1811
- for (let e = n; e < i; e++) this.be[e - this.ve].dispose();
1812
- if (this.ve < t) {
1813
- let e = this.ve;
1814
- while (e < t && e < this.ye) this.be[e++].dispose();
1815
- this.be.splice(0, t - this.ve);
1816
- this.we.splice(0, t - this.ve);
1817
- } else if (this.ve > t) {
1818
- let n = i - this.ve - 1;
1819
- let r = this.ve - t;
1820
- this.be.length = this.we.length = e;
1856
+ const i = this.xe + this.Ce;
1857
+ if (this.Ce === 0 && this.Ve[0]) this.Ve[0].dispose();
1858
+ for (let e = n; e < i; e++) this.Ve[e - this.xe].dispose();
1859
+ if (this.xe < t) {
1860
+ let e = this.xe;
1861
+ while (e < t && e < this.Ce) this.Ve[e++].dispose();
1862
+ this.Ve.splice(0, t - this.xe);
1863
+ this.be.splice(0, t - this.xe);
1864
+ } else if (this.xe > t) {
1865
+ let n = i - this.xe - 1;
1866
+ let r = this.xe - t;
1867
+ this.Ve.length = this.be.length = e;
1821
1868
  while (n >= r) {
1869
+ this.Ve[n] = this.Ve[n - r];
1822
1870
  this.be[n] = this.be[n - r];
1823
- this.we[n] = this.we[n - r];
1824
1871
  n--;
1825
1872
  }
1826
1873
  for (let e = 0; e < r; e++) {
1827
- this.we[e] = runWithOwner((this.be[e] = createOwner()), () => this.Pe(e + t));
1874
+ this.be[e] = runWithOwner((this.Ve[e] = createOwner()), () => this.we(e + t));
1828
1875
  }
1829
1876
  }
1830
1877
  for (let e = i; e < n; e++) {
1831
- this.we[e - t] = runWithOwner((this.be[e - t] = createOwner()), () => this.Pe(e));
1878
+ this.be[e - t] = runWithOwner((this.Ve[e - t] = createOwner()), () => this.we(e));
1832
1879
  }
1833
- this.we = this.we.slice(0, e);
1834
- this.ve = t;
1835
- this.ye = e;
1880
+ this.be = this.be.slice(0, e);
1881
+ this.xe = t;
1882
+ this.Ce = e;
1836
1883
  });
1837
- return this.we;
1884
+ return this.be;
1838
1885
  }
1839
1886
  function compare(e, t, n) {
1840
1887
  return e ? e(t) === e(n) : true;
1841
1888
  }
1842
1889
  function boundaryComputed(e, t) {
1843
1890
  const n = computed(e, undefined, {
1844
- Oe: {
1891
+ pe: {
1845
1892
  le() {
1846
1893
  let e = this.J;
1847
- this.J &= ~this.He;
1848
- if (this.He & STATUS_PENDING && !(this.J & STATUS_UNINITIALIZED)) {
1894
+ this.J &= ~this.Qe;
1895
+ if (this.Qe & STATUS_PENDING && !(this.J & STATUS_UNINITIALIZED)) {
1849
1896
  e &= ~STATUS_PENDING;
1850
1897
  }
1851
- this._e.notify(this, this.He, e);
1898
+ this._e.notify(this, this.Qe, e);
1852
1899
  },
1853
- He: t
1900
+ Qe: t
1854
1901
  }
1855
1902
  });
1856
- n.He = t;
1857
- n.de = true;
1903
+ n.Qe = t;
1904
+ n.Te = true;
1858
1905
  return n;
1859
1906
  }
1860
1907
  function createBoundChildren(e, t, n, i) {
@@ -1867,19 +1914,19 @@ function createBoundChildren(e, t, n, i) {
1867
1914
  });
1868
1915
  }
1869
1916
  class ConditionalQueue extends Queue {
1870
- Qe;
1871
- $e = new Set();
1917
+ $e;
1918
+ Le = new Set();
1872
1919
  $ = new Set();
1873
1920
  constructor(e) {
1874
1921
  super();
1875
- this.Qe = e;
1922
+ this.$e = e;
1876
1923
  }
1877
1924
  run(e) {
1878
- if (!e || read(this.Qe)) return;
1925
+ if (!e || read(this.$e)) return;
1879
1926
  return super.run(e);
1880
1927
  }
1881
1928
  notify(e, t, n) {
1882
- if (read(this.Qe)) {
1929
+ if (read(this.$e)) {
1883
1930
  if (t & STATUS_PENDING) {
1884
1931
  if (n & STATUS_PENDING) {
1885
1932
  this.$.add(e);
@@ -1888,37 +1935,37 @@ class ConditionalQueue extends Queue {
1888
1935
  }
1889
1936
  if (t & STATUS_ERROR) {
1890
1937
  if (n & STATUS_ERROR) {
1891
- this.$e.add(e);
1938
+ this.Le.add(e);
1892
1939
  t &= ~STATUS_ERROR;
1893
- } else if (this.$e.delete(e)) t &= ~STATUS_ERROR;
1940
+ } else if (this.Le.delete(e)) t &= ~STATUS_ERROR;
1894
1941
  }
1895
1942
  }
1896
1943
  return t ? super.notify(e, t, n) : true;
1897
1944
  }
1898
1945
  }
1899
1946
  class CollectionQueue extends Queue {
1900
- Le;
1901
- be = new Set();
1902
- Qe = signal(false, { pureWrite: true });
1903
- Fe = false;
1947
+ Fe;
1948
+ Ve = new Set();
1949
+ $e = signal(false, { pureWrite: true });
1950
+ We = false;
1904
1951
  constructor(e) {
1905
1952
  super();
1906
- this.Le = e;
1953
+ this.Fe = e;
1907
1954
  }
1908
1955
  run(e) {
1909
- if (!e || read(this.Qe)) return;
1956
+ if (!e || read(this.$e)) return;
1910
1957
  return super.run(e);
1911
1958
  }
1912
1959
  notify(e, t, n) {
1913
- if (!(t & this.Le) || (this.Le & STATUS_PENDING && this.Fe)) return super.notify(e, t, n);
1914
- if (n & this.Le) {
1915
- this.be.add(e);
1916
- if (this.be.size === 1) setSignal(this.Qe, true);
1917
- } else if (this.be.size > 0) {
1918
- this.be.delete(e);
1919
- if (this.be.size === 0) setSignal(this.Qe, false);
1920
- }
1921
- t &= ~this.Le;
1960
+ if (!(t & this.Fe) || (this.Fe & STATUS_PENDING && this.We)) return super.notify(e, t, n);
1961
+ if (n & this.Fe) {
1962
+ this.Ve.add(e);
1963
+ if (this.Ve.size === 1) setSignal(this.$e, true);
1964
+ } else if (this.Ve.size > 0) {
1965
+ this.Ve.delete(e);
1966
+ if (this.Ve.size === 0) setSignal(this.$e, false);
1967
+ }
1968
+ t &= ~this.Fe;
1922
1969
  return t ? super.notify(e, t, n) : true;
1923
1970
  }
1924
1971
  }
@@ -1932,25 +1979,25 @@ function createBoundary(e, t) {
1932
1979
  const i = new ConditionalQueue(computed(() => t() === BoundaryMode.HIDDEN));
1933
1980
  const r = createBoundChildren(n, e, i, 0);
1934
1981
  computed(() => {
1935
- const e = read(i.Qe);
1936
- r.He = e ? STATUS_ERROR | STATUS_PENDING : 0;
1982
+ const e = read(i.$e);
1983
+ r.Qe = e ? STATUS_ERROR | STATUS_PENDING : 0;
1937
1984
  if (!e) {
1938
1985
  i.$.forEach(e => i.notify(e, STATUS_PENDING, STATUS_PENDING));
1939
- i.$e.forEach(e => i.notify(e, STATUS_ERROR, STATUS_ERROR));
1986
+ i.Le.forEach(e => i.notify(e, STATUS_ERROR, STATUS_ERROR));
1940
1987
  i.$.clear();
1941
- i.$e.clear();
1988
+ i.Le.clear();
1942
1989
  }
1943
1990
  });
1944
- return () => (read(i.Qe) ? undefined : read(r));
1991
+ return () => (read(i.$e) ? undefined : read(r));
1945
1992
  }
1946
1993
  function createCollectionBoundary(e, t, n) {
1947
1994
  const i = createOwner();
1948
1995
  const r = new CollectionQueue(e);
1949
1996
  const s = createBoundChildren(i, t, r, e);
1950
1997
  const o = computed(() => {
1951
- if (!read(r.Qe)) {
1998
+ if (!read(r.$e)) {
1952
1999
  const e = read(s);
1953
- if (!untrack(() => read(r.Qe))) r.Fe = true;
2000
+ if (!untrack(() => read(r.$e))) r.We = true;
1954
2001
  return e;
1955
2002
  }
1956
2003
  return n(r);
@@ -1975,10 +2022,10 @@ function collectErrorSources(e, t) {
1975
2022
  }
1976
2023
  function createErrorBoundary(e, t) {
1977
2024
  return createCollectionBoundary(STATUS_ERROR, e, e => {
1978
- let n = e.be.values().next().value;
1979
- return t(n.Y, () => {
2025
+ let n = e.Ve.values().next().value;
2026
+ return t(n.j, () => {
1980
2027
  const t = [];
1981
- for (const n of e.be) collectErrorSources(n, t);
2028
+ for (const n of e.Ve) collectErrorSources(n, t);
1982
2029
  for (const e of t) recompute(e);
1983
2030
  schedule();
1984
2031
  });