@solidjs/signals 0.13.13 → 2.0.0-beta.8

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.
Files changed (44) hide show
  1. package/README.md +8 -7
  2. package/dist/dev.js +312 -174
  3. package/dist/node.cjs +1068 -953
  4. package/dist/prod.js +744 -619
  5. package/dist/types/boundaries.d.ts +44 -3
  6. package/dist/types/core/core.d.ts +2 -2
  7. package/dist/types/core/effect.d.ts +3 -2
  8. package/dist/types/core/graph.d.ts +1 -0
  9. package/dist/types/core/scheduler.d.ts +1 -0
  10. package/dist/types/core/types.d.ts +2 -2
  11. package/dist/types/index.d.ts +1 -1
  12. package/dist/types/signals.d.ts +34 -26
  13. package/dist/types/store/optimistic.d.ts +3 -3
  14. package/dist/types/store/projection.d.ts +19 -5
  15. package/dist/types/store/store.d.ts +4 -4
  16. package/dist/types-cjs/boundaries.d.cts +93 -0
  17. package/dist/types-cjs/core/action.d.cts +1 -0
  18. package/dist/types-cjs/core/async.d.cts +6 -0
  19. package/dist/types-cjs/core/constants.d.cts +25 -0
  20. package/dist/types-cjs/core/context.d.cts +28 -0
  21. package/dist/types-cjs/core/core.d.cts +54 -0
  22. package/dist/types-cjs/core/dev.d.cts +49 -0
  23. package/dist/types-cjs/core/effect.d.cts +31 -0
  24. package/dist/types-cjs/core/error.d.cts +14 -0
  25. package/dist/types-cjs/core/external.d.cts +26 -0
  26. package/dist/types-cjs/core/graph.d.cts +4 -0
  27. package/dist/types-cjs/core/heap.d.cts +14 -0
  28. package/dist/types-cjs/core/index.d.cts +12 -0
  29. package/dist/types-cjs/core/lanes.d.cts +54 -0
  30. package/dist/types-cjs/core/owner.d.cts +26 -0
  31. package/dist/types-cjs/core/scheduler.d.cts +82 -0
  32. package/dist/types-cjs/core/types.d.cts +86 -0
  33. package/dist/types-cjs/index.d.cts +9 -0
  34. package/dist/types-cjs/map.d.cts +24 -0
  35. package/dist/types-cjs/package.json +3 -0
  36. package/dist/types-cjs/signals.d.cts +200 -0
  37. package/dist/types-cjs/store/index.d.cts +9 -0
  38. package/dist/types-cjs/store/optimistic.d.cts +19 -0
  39. package/dist/types-cjs/store/projection.d.cts +40 -0
  40. package/dist/types-cjs/store/reconcile.d.cts +1 -0
  41. package/dist/types-cjs/store/store.d.cts +68 -0
  42. package/dist/types-cjs/store/storePath.d.cts +30 -0
  43. package/dist/types-cjs/store/utils.d.cts +43 -0
  44. package/package.json +31 -24
package/dist/prod.js CHANGED
@@ -150,16 +150,33 @@ let activeTransition = null;
150
150
  let scheduled = false;
151
151
  let projectionWriteActive = false;
152
152
  let stashedOptimisticReads = null;
153
+ const transientStoreNodes = new Set();
154
+ function registerTransientStoreNode(e) {
155
+ transientStoreNodes.add(e);
156
+ }
157
+ function sweepTransientStoreNodes() {
158
+ if (transientStoreNodes.size === 0) return;
159
+ for (const e of transientStoreNodes) {
160
+ if (e.I !== null) {
161
+ transientStoreNodes.delete(e);
162
+ continue;
163
+ }
164
+ if (e.U !== NOT_PENDING) continue;
165
+ if (e.k !== undefined && e.k !== NOT_PENDING) continue;
166
+ transientStoreNodes.delete(e);
167
+ e.G?.();
168
+ }
169
+ }
153
170
  function enforceLoadingBoundary(e) {}
154
171
  function shouldReadStashedOptimisticValue(e) {
155
172
  return !!stashedOptimisticReads?.has(e);
156
173
  }
157
174
  function runLaneEffects(e) {
158
175
  for (const t of activeLanes) {
159
- if (t.U || t.k.size > 0) continue;
160
- const n = t.G[e - 1];
176
+ if (t.W || t.H.size > 0) continue;
177
+ const n = t.M[e - 1];
161
178
  if (n.length) {
162
- t.G[e - 1] = [];
179
+ t.M[e - 1] = [];
163
180
  runQueue(n, e);
164
181
  }
165
182
  }
@@ -167,11 +184,11 @@ function runLaneEffects(e) {
167
184
  function queueStashedOptimisticEffects(e) {
168
185
  for (let t = e.I; t !== null; t = t.h) {
169
186
  const e = t.p;
170
- if (!e.W) continue;
171
- if (e.W === EFFECT_TRACKED) {
172
- if (!e.H) {
173
- e.H = true;
174
- e.F.enqueue(EFFECT_USER, e.M);
187
+ if (!e.F) continue;
188
+ if (e.F === EFFECT_TRACKED) {
189
+ if (!e.j) {
190
+ e.j = true;
191
+ e.$.enqueue(EFFECT_USER, e.K);
175
192
  }
176
193
  continue;
177
194
  }
@@ -184,66 +201,66 @@ function setProjectionWriteActive(e) {
184
201
  projectionWriteActive = e;
185
202
  }
186
203
  function mergeTransitionState(e, t) {
187
- t.j = e;
188
- e.$.push(...t.$);
189
- for (const n of activeLanes) if (n.K === t) n.K = e;
190
- e.Y.push(...t.Y);
191
- for (const n of t.Z) e.Z.add(n);
192
- for (const [n, i] of t.B) {
193
- let t = e.B.get(n);
194
- if (!t) e.B.set(n, (t = new Set()));
204
+ t.Y = e;
205
+ e.Z.push(...t.Z);
206
+ for (const n of activeLanes) if (n.B === t) n.B = e;
207
+ e.q.push(...t.q);
208
+ for (const n of t.X) e.X.add(n);
209
+ for (const [n, i] of t.J) {
210
+ let t = e.J.get(n);
211
+ if (!t) e.J.set(n, (t = new Set()));
195
212
  for (const e of i) t.add(e);
196
213
  }
197
214
  }
198
215
  function resolveOptimisticNodes(e) {
199
216
  for (let t = 0; t < e.length; t++) {
200
217
  const n = e[t];
201
- n.q = undefined;
202
- if (n.X !== NOT_PENDING) {
203
- n.J = n.X;
204
- n.X = NOT_PENDING;
218
+ n.ee = undefined;
219
+ if (n.U !== NOT_PENDING) {
220
+ n.te = n.U;
221
+ n.U = NOT_PENDING;
205
222
  }
206
- const i = n.ee;
207
- n.ee = NOT_PENDING;
208
- if (i !== NOT_PENDING && n.J !== i) insertSubs(n, true);
209
- n.K = null;
223
+ const i = n.k;
224
+ n.k = NOT_PENDING;
225
+ if (i !== NOT_PENDING && n.te !== i) insertSubs(n, true);
226
+ n.B = null;
210
227
  }
211
228
  e.length = 0;
212
229
  }
213
230
  function cleanupCompletedLanes(e) {
214
231
  for (const t of activeLanes) {
215
- const n = e ? t.K === e : !t.K;
232
+ const n = e ? t.B === e : !t.B;
216
233
  if (!n) continue;
217
- if (!t.U) {
218
- if (t.G[0].length) runQueue(t.G[0], EFFECT_RENDER);
219
- if (t.G[1].length) runQueue(t.G[1], EFFECT_USER);
220
- }
221
- if (t.te.q === t) t.te.q = undefined;
222
- t.k.clear();
223
- t.G[0].length = 0;
224
- t.G[1].length = 0;
234
+ if (!t.W) {
235
+ if (t.M[0].length) runQueue(t.M[0], EFFECT_RENDER);
236
+ if (t.M[1].length) runQueue(t.M[1], EFFECT_USER);
237
+ }
238
+ if (t.ne.ee === t) t.ne.ee = undefined;
239
+ t.H.clear();
240
+ t.M[0].length = 0;
241
+ t.M[1].length = 0;
225
242
  activeLanes.delete(t);
226
- signalLanes.delete(t.te);
243
+ signalLanes.delete(t.ne);
227
244
  }
228
245
  }
229
246
  function schedule() {
230
247
  if (scheduled) return;
231
248
  scheduled = true;
232
- if (!globalQueue.ne && !projectionWriteActive) queueMicrotask(flush);
249
+ if (!globalQueue.ie && !projectionWriteActive) queueMicrotask(flush);
233
250
  }
234
251
  class Queue {
235
252
  i = null;
236
- ie = [[], []];
237
- re = [];
253
+ re = [[], []];
254
+ se = [];
238
255
  created = clock;
239
256
  addChild(e) {
240
- this.re.push(e);
257
+ this.se.push(e);
241
258
  e.i = this;
242
259
  }
243
260
  removeChild(e) {
244
- const t = this.re.indexOf(e);
261
+ const t = this.se.indexOf(e);
245
262
  if (t >= 0) {
246
- this.re.splice(t, 1);
263
+ this.se.splice(t, 1);
247
264
  e.i = null;
248
265
  }
249
266
  }
@@ -252,81 +269,81 @@ class Queue {
252
269
  return false;
253
270
  }
254
271
  run(e) {
255
- if (this.ie[e - 1].length) {
256
- const t = this.ie[e - 1];
257
- this.ie[e - 1] = [];
272
+ if (this.re[e - 1].length) {
273
+ const t = this.re[e - 1];
274
+ this.re[e - 1] = [];
258
275
  runQueue(t, e);
259
276
  }
260
- for (let t = 0; t < this.re.length; t++) this.re[t].run?.(e);
277
+ for (let t = 0; t < this.se.length; t++) this.se[t].run?.(e);
261
278
  }
262
279
  enqueue(e, t) {
263
280
  if (e) {
264
281
  if (currentOptimisticLane) {
265
282
  const n = findLane(currentOptimisticLane);
266
- n.G[e - 1].push(t);
283
+ n.M[e - 1].push(t);
267
284
  } else {
268
- this.ie[e - 1].push(t);
285
+ this.re[e - 1].push(t);
269
286
  }
270
287
  }
271
288
  schedule();
272
289
  }
273
290
  stashQueues(e) {
274
- e.ie[0].push(...this.ie[0]);
275
- e.ie[1].push(...this.ie[1]);
276
- this.ie = [[], []];
277
- for (let t = 0; t < this.re.length; t++) {
278
- let n = this.re[t];
279
- let i = e.re[t];
291
+ e.re[0].push(...this.re[0]);
292
+ e.re[1].push(...this.re[1]);
293
+ this.re = [[], []];
294
+ for (let t = 0; t < this.se.length; t++) {
295
+ let n = this.se[t];
296
+ let i = e.se[t];
280
297
  if (!i) {
281
- i = { ie: [[], []], re: [] };
282
- e.re[t] = i;
298
+ i = { re: [[], []], se: [] };
299
+ e.se[t] = i;
283
300
  }
284
301
  n.stashQueues(i);
285
302
  }
286
303
  }
287
304
  restoreQueues(e) {
288
- this.ie[0].push(...e.ie[0]);
289
- this.ie[1].push(...e.ie[1]);
290
- for (let t = 0; t < e.re.length; t++) {
291
- const n = e.re[t];
292
- let i = this.re[t];
305
+ this.re[0].push(...e.re[0]);
306
+ this.re[1].push(...e.re[1]);
307
+ for (let t = 0; t < e.se.length; t++) {
308
+ const n = e.se[t];
309
+ let i = this.se[t];
293
310
  if (i) i.restoreQueues(n);
294
311
  }
295
312
  }
296
313
  }
297
314
  class GlobalQueue extends Queue {
298
- ne = false;
299
- se = [];
300
- Y = [];
301
- Z = new Set();
302
- static oe;
315
+ ie = false;
316
+ oe = [];
317
+ q = [];
318
+ X = new Set();
303
319
  static ue;
304
- static ce = null;
320
+ static ce;
321
+ static ae = null;
305
322
  flush() {
306
- if (this.ne) return;
307
- this.ne = true;
323
+ if (this.ie) return;
324
+ this.ie = true;
308
325
  try {
309
- runHeap(dirtyQueue, GlobalQueue.oe);
326
+ runHeap(dirtyQueue, GlobalQueue.ue);
310
327
  if (activeTransition) {
311
328
  const e = transitionComplete(activeTransition);
312
329
  if (!e) {
313
330
  const e = activeTransition;
314
- runHeap(zombieQueue, GlobalQueue.oe);
315
- this.se = [];
316
- this.Y = [];
317
- this.Z = new Set();
331
+ runHeap(zombieQueue, GlobalQueue.ue);
332
+ this.oe = [];
333
+ this.q = [];
334
+ this.X = new Set();
318
335
  runLaneEffects(EFFECT_RENDER);
319
336
  runLaneEffects(EFFECT_USER);
320
- this.stashQueues(e.ae);
337
+ this.stashQueues(e.le);
321
338
  clock++;
322
339
  scheduled = dirtyQueue.R >= dirtyQueue.P;
323
- reassignPendingTransition(e.se);
340
+ reassignPendingTransition(e.oe);
324
341
  activeTransition = null;
325
- if (!e.$.length && e.Y.length) {
342
+ if (!e.Z.length && e.q.length) {
326
343
  stashedOptimisticReads = new Set();
327
- for (let t = 0; t < e.Y.length; t++) {
328
- const n = e.Y[t];
329
- if (n.L || n.le) continue;
344
+ for (let t = 0; t < e.q.length; t++) {
345
+ const n = e.q[t];
346
+ if (n.L || n.fe) continue;
330
347
  stashedOptimisticReads.add(n);
331
348
  queueStashedOptimisticEffects(n);
332
349
  }
@@ -338,15 +355,15 @@ class GlobalQueue extends Queue {
338
355
  }
339
356
  return;
340
357
  }
341
- this.se !== activeTransition.se && this.se.push(...activeTransition.se);
342
- this.restoreQueues(activeTransition.ae);
358
+ this.oe !== activeTransition.oe && this.oe.push(...activeTransition.oe);
359
+ this.restoreQueues(activeTransition.le);
343
360
  transitions.delete(activeTransition);
344
361
  const t = activeTransition;
345
362
  activeTransition = null;
346
- reassignPendingTransition(this.se);
363
+ reassignPendingTransition(this.oe);
347
364
  finalizePureQueue(t);
348
365
  } else {
349
- if (transitions.size) runHeap(zombieQueue, GlobalQueue.oe);
366
+ if (transitions.size) runHeap(zombieQueue, GlobalQueue.ue);
350
367
  finalizePureQueue();
351
368
  }
352
369
  clock++;
@@ -357,17 +374,17 @@ class GlobalQueue extends Queue {
357
374
  this.run(EFFECT_USER);
358
375
  if (false);
359
376
  } finally {
360
- this.ne = false;
377
+ this.ie = false;
361
378
  }
362
379
  }
363
380
  notify(e, t, n, i) {
364
381
  if (t & STATUS_PENDING) {
365
382
  if (n & STATUS_PENDING) {
366
- const t = i !== undefined ? i : e.fe;
383
+ const t = i !== undefined ? i : e.Ee;
367
384
  if (activeTransition && t) {
368
385
  const n = t.source;
369
- let i = activeTransition.B.get(n);
370
- if (!i) activeTransition.B.set(n, (i = new Set()));
386
+ let i = activeTransition.J.get(n);
387
+ if (!i) activeTransition.J.set(n, (i = new Set()));
371
388
  const r = i.size;
372
389
  i.add(e);
373
390
  if (i.size !== r) schedule();
@@ -380,17 +397,17 @@ class GlobalQueue extends Queue {
380
397
  initTransition(e) {
381
398
  if (e) e = currentTransition(e);
382
399
  if (e && e === activeTransition) return;
383
- if (!e && activeTransition && activeTransition.Ee === clock) return;
400
+ if (!e && activeTransition && activeTransition.de === clock) return;
384
401
  if (!activeTransition) {
385
402
  activeTransition = e ?? {
386
- Ee: clock,
387
- se: [],
388
- B: new Map(),
389
- Y: [],
390
- Z: new Set(),
391
- $: [],
392
- ae: { ie: [[], []], re: [] },
393
- j: false
403
+ de: clock,
404
+ oe: [],
405
+ J: new Map(),
406
+ q: [],
407
+ X: new Set(),
408
+ Z: [],
409
+ le: { re: [[], []], se: [] },
410
+ Y: false
394
411
  };
395
412
  } else if (e) {
396
413
  const t = activeTransition;
@@ -399,37 +416,37 @@ class GlobalQueue extends Queue {
399
416
  activeTransition = e;
400
417
  }
401
418
  transitions.add(activeTransition);
402
- activeTransition.Ee = clock;
403
- if (this.se !== activeTransition.se) {
404
- for (let e = 0; e < this.se.length; e++) {
405
- const t = this.se[e];
406
- t.K = activeTransition;
407
- activeTransition.se.push(t);
419
+ activeTransition.de = clock;
420
+ if (this.oe !== activeTransition.oe) {
421
+ for (let e = 0; e < this.oe.length; e++) {
422
+ const t = this.oe[e];
423
+ t.B = activeTransition;
424
+ activeTransition.oe.push(t);
408
425
  }
409
- this.se = activeTransition.se;
426
+ this.oe = activeTransition.oe;
410
427
  }
411
- if (this.Y !== activeTransition.Y) {
412
- for (let e = 0; e < this.Y.length; e++) {
413
- const t = this.Y[e];
414
- t.K = activeTransition;
415
- activeTransition.Y.push(t);
428
+ if (this.q !== activeTransition.q) {
429
+ for (let e = 0; e < this.q.length; e++) {
430
+ const t = this.q[e];
431
+ t.B = activeTransition;
432
+ activeTransition.q.push(t);
416
433
  }
417
- this.Y = activeTransition.Y;
434
+ this.q = activeTransition.q;
418
435
  }
419
436
  for (const e of activeLanes) {
420
- if (!e.K) e.K = activeTransition;
437
+ if (!e.B) e.B = activeTransition;
421
438
  }
422
- if (this.Z !== activeTransition.Z) {
423
- for (const e of this.Z) activeTransition.Z.add(e);
424
- this.Z = activeTransition.Z;
439
+ if (this.X !== activeTransition.X) {
440
+ for (const e of this.X) activeTransition.X.add(e);
441
+ this.X = activeTransition.X;
425
442
  }
426
443
  }
427
444
  }
428
445
  function insertSubs(e, t = false) {
429
- const n = e.q || currentOptimisticLane;
430
- const i = e.de !== undefined;
446
+ const n = e.ee || currentOptimisticLane;
447
+ const i = e.Te !== undefined;
431
448
  for (let r = e.I; r !== null; r = r.h) {
432
- if (i && r.p.Te) {
449
+ if (i && r.p.Se) {
433
450
  r.p.O |= REACTIVE_SNAPSHOT_STALE;
434
451
  continue;
435
452
  }
@@ -438,13 +455,13 @@ function insertSubs(e, t = false) {
438
455
  assignOrMergeLane(r.p, n);
439
456
  } else if (t) {
440
457
  r.p.O |= REACTIVE_OPTIMISTIC_DIRTY;
441
- r.p.q = undefined;
458
+ r.p.ee = undefined;
442
459
  }
443
460
  const e = r.p;
444
- if (e.W === EFFECT_TRACKED) {
445
- if (!e.H) {
446
- e.H = true;
447
- e.F.enqueue(EFFECT_USER, e.M);
461
+ if (e.F === EFFECT_TRACKED) {
462
+ if (!e.j) {
463
+ e.j = true;
464
+ e.$.enqueue(EFFECT_USER, e.K);
448
465
  }
449
466
  continue;
450
467
  }
@@ -454,16 +471,16 @@ function insertSubs(e, t = false) {
454
471
  }
455
472
  }
456
473
  function commitPendingNodes() {
457
- const e = globalQueue.se;
474
+ const e = globalQueue.oe;
458
475
  for (let t = 0; t < e.length; t++) {
459
476
  const n = e[t];
460
- if (n.X !== NOT_PENDING) {
461
- n.J = n.X;
462
- n.X = NOT_PENDING;
463
- if (n.W && n.W !== EFFECT_TRACKED) n.H = true;
477
+ if (n.U !== NOT_PENDING) {
478
+ n.te = n.U;
479
+ n.U = NOT_PENDING;
480
+ if (n.F && n.F !== EFFECT_TRACKED) n.j = true;
464
481
  }
465
- if (!(n.Se & STATUS_PENDING)) n.Se &= ~STATUS_UNINITIALIZED;
466
- if (n.L) GlobalQueue.ue(n, false, true);
482
+ if (!(n.Re & STATUS_PENDING)) n.Re &= ~STATUS_UNINITIALIZED;
483
+ if (n.L) GlobalQueue.ce(n, false, true);
467
484
  }
468
485
  e.length = 0;
469
486
  }
@@ -471,39 +488,40 @@ function finalizePureQueue(e = null, t = false) {
471
488
  const n = !t;
472
489
  if (n) commitPendingNodes();
473
490
  if (!t) checkBoundaryChildren(globalQueue);
474
- if (dirtyQueue.R >= dirtyQueue.P) runHeap(dirtyQueue, GlobalQueue.oe);
491
+ if (dirtyQueue.R >= dirtyQueue.P) runHeap(dirtyQueue, GlobalQueue.ue);
475
492
  if (n) {
476
493
  commitPendingNodes();
477
- resolveOptimisticNodes(e ? e.Y : globalQueue.Y);
478
- const t = e ? e.Z : globalQueue.Z;
479
- if (GlobalQueue.ce && t.size) {
494
+ resolveOptimisticNodes(e ? e.q : globalQueue.q);
495
+ const t = e ? e.X : globalQueue.X;
496
+ if (GlobalQueue.ae && t.size) {
480
497
  for (const e of t) {
481
- GlobalQueue.ce(e);
498
+ GlobalQueue.ae(e);
482
499
  }
483
500
  t.clear();
484
501
  schedule();
485
502
  }
503
+ sweepTransientStoreNodes();
486
504
  cleanupCompletedLanes(e);
487
505
  }
488
506
  }
489
507
  function checkBoundaryChildren(e) {
490
- for (const t of e.re) {
508
+ for (const t of e.se) {
491
509
  t.checkSources?.();
492
510
  checkBoundaryChildren(t);
493
511
  }
494
512
  }
495
513
  function trackOptimisticStore(e) {
496
- globalQueue.Z.add(e);
514
+ globalQueue.X.add(e);
497
515
  schedule();
498
516
  }
499
517
  function reassignPendingTransition(e) {
500
518
  for (let t = 0; t < e.length; t++) {
501
- e[t].K = activeTransition;
519
+ e[t].B = activeTransition;
502
520
  }
503
521
  }
504
522
  const globalQueue = new GlobalQueue();
505
523
  function flush() {
506
- if (globalQueue.ne) {
524
+ if (globalQueue.ie) {
507
525
  return;
508
526
  }
509
527
  while (scheduled || activeTransition) {
@@ -515,21 +533,21 @@ function runQueue(e, t) {
515
533
  }
516
534
  function reporterBlocksSource(e, t) {
517
535
  if (e.O & (REACTIVE_ZOMBIE | REACTIVE_DISPOSED)) return false;
518
- if (e.Re === t || e.Oe?.has(t)) return true;
536
+ if (e.Oe === t || e._e?.has(t)) return true;
519
537
  for (let n = e.C; n; n = n.D) {
520
538
  let e = n.m;
521
539
  while (e) {
522
540
  if (e === t || e.V === t) return true;
523
- e = e._e;
541
+ e = e.Ie;
524
542
  }
525
543
  }
526
- return !!(e.Se & STATUS_PENDING && e.fe instanceof NotReadyError && e.fe.source === t);
544
+ return !!(e.Re & STATUS_PENDING && e.Ee instanceof NotReadyError && e.Ee.source === t);
527
545
  }
528
546
  function transitionComplete(e) {
529
- if (e.j) return true;
530
- if (e.$.length) return false;
547
+ if (e.Y) return true;
548
+ if (e.Z.length) return false;
531
549
  let t = true;
532
- for (const [n, i] of e.B) {
550
+ for (const [n, i] of e.J) {
533
551
  let r = false;
534
552
  for (const e of i) {
535
553
  if (reporterBlocksSource(e, n)) {
@@ -538,32 +556,32 @@ function transitionComplete(e) {
538
556
  }
539
557
  i.delete(e);
540
558
  }
541
- if (!r) e.B.delete(n);
542
- else if (n.Se & STATUS_PENDING && n.fe?.source === n) {
559
+ if (!r) e.J.delete(n);
560
+ else if (n.Re & STATUS_PENDING && n.Ee?.source === n) {
543
561
  t = false;
544
562
  break;
545
563
  }
546
564
  }
547
565
  if (t) {
548
- for (let n = 0; n < e.Y.length; n++) {
549
- const i = e.Y[n];
566
+ for (let n = 0; n < e.q.length; n++) {
567
+ const i = e.q[n];
550
568
  if (
551
569
  hasActiveOverride(i) &&
552
- "Se" in i &&
553
- i.Se & STATUS_PENDING &&
554
- i.fe instanceof NotReadyError &&
555
- i.fe.source !== i
570
+ "Re" in i &&
571
+ i.Re & STATUS_PENDING &&
572
+ i.Ee instanceof NotReadyError &&
573
+ i.Ee.source !== i
556
574
  ) {
557
575
  t = false;
558
576
  break;
559
577
  }
560
578
  }
561
579
  }
562
- t && (e.j = true);
580
+ t && (e.Y = true);
563
581
  return t;
564
582
  }
565
583
  function currentTransition(e) {
566
- while (e.j && typeof e.j === "object") e = e.j;
584
+ while (e.Y && typeof e.Y === "object") e = e.Y;
567
585
  return e;
568
586
  }
569
587
  function setActiveTransition(e) {
@@ -585,75 +603,75 @@ function getOrCreateLane(e) {
585
603
  if (t) {
586
604
  return findLane(t);
587
605
  }
588
- const n = e._e;
589
- const i = n?.q ? findLane(n.q) : null;
590
- t = { te: e, k: new Set(), G: [[], []], U: null, K: activeTransition, Ie: i };
606
+ const n = e.Ie;
607
+ const i = n?.ee ? findLane(n.ee) : null;
608
+ t = { ne: e, H: new Set(), M: [[], []], W: null, B: activeTransition, he: i };
591
609
  signalLanes.set(e, t);
592
610
  activeLanes.add(t);
593
- e.he = false;
611
+ e.pe = false;
594
612
  return t;
595
613
  }
596
614
  function findLane(e) {
597
- while (e.U) e = e.U;
615
+ while (e.W) e = e.W;
598
616
  return e;
599
617
  }
600
618
  function mergeLanes(e, t) {
601
619
  e = findLane(e);
602
620
  t = findLane(t);
603
621
  if (e === t) return e;
604
- t.U = e;
605
- for (const n of t.k) e.k.add(n);
606
- e.G[0].push(...t.G[0]);
607
- e.G[1].push(...t.G[1]);
622
+ t.W = e;
623
+ for (const n of t.H) e.H.add(n);
624
+ e.M[0].push(...t.M[0]);
625
+ e.M[1].push(...t.M[1]);
608
626
  return e;
609
627
  }
610
628
  function resolveLane(e) {
611
- const t = e.q;
629
+ const t = e.ee;
612
630
  if (!t) return undefined;
613
631
  const n = findLane(t);
614
632
  if (activeLanes.has(n)) return n;
615
- e.q = undefined;
633
+ e.ee = undefined;
616
634
  return undefined;
617
635
  }
618
636
  function resolveTransition(e) {
619
- return resolveLane(e)?.K ?? e.K;
637
+ return resolveLane(e)?.B ?? e.B;
620
638
  }
621
639
  function hasActiveOverride(e) {
622
- return !!(e.ee !== undefined && e.ee !== NOT_PENDING);
640
+ return !!(e.k !== undefined && e.k !== NOT_PENDING);
623
641
  }
624
642
  function assignOrMergeLane(e, t) {
625
643
  const n = findLane(t);
626
- const i = e.q;
644
+ const i = e.ee;
627
645
  if (i) {
628
- if (i.U) {
629
- e.q = t;
646
+ if (i.W) {
647
+ e.ee = t;
630
648
  return;
631
649
  }
632
650
  const r = findLane(i);
633
651
  if (activeLanes.has(r)) {
634
652
  if (r !== n && !hasActiveOverride(e)) {
635
- if (n.Ie && findLane(n.Ie) === r) {
636
- e.q = t;
637
- } else if (r.Ie && findLane(r.Ie) === n);
653
+ if (n.he && findLane(n.he) === r) {
654
+ e.ee = t;
655
+ } else if (r.he && findLane(r.he) === n);
638
656
  else mergeLanes(n, r);
639
657
  }
640
658
  return;
641
659
  }
642
660
  }
643
- e.q = t;
661
+ e.ee = t;
644
662
  }
645
663
  function unlinkSubs(e) {
646
664
  const t = e.m;
647
665
  const n = e.D;
648
666
  const i = e.h;
649
- const r = e.pe;
650
- if (i !== null) i.pe = r;
651
- else t.Ae = r;
667
+ const r = e.Ae;
668
+ if (i !== null) i.Ae = r;
669
+ else t.Ne = r;
652
670
  if (r !== null) r.h = i;
653
671
  else {
654
672
  t.I = i;
655
673
  if (i === null) {
656
- t.Ne?.();
674
+ t.G?.();
657
675
  t.L && !t.Pe && !(t.O & REACTIVE_ZOMBIE) && unobserved(t);
658
676
  }
659
677
  }
@@ -666,6 +684,7 @@ function unobserved(e) {
666
684
  t = unlinkSubs(t);
667
685
  }
668
686
  e.C = null;
687
+ e.ge = null;
669
688
  disposeChildren(e, true);
670
689
  }
671
690
  function link(e, t) {
@@ -680,9 +699,9 @@ function link(e, t) {
680
699
  return;
681
700
  }
682
701
  }
683
- const s = e.Ae;
702
+ const s = e.Ne;
684
703
  if (s !== null && s.p === t && (!r || isValidLink(s, t))) return;
685
- const o = (t.ge = e.Ae = { m: e, p: t, D: i, pe: s, h: null });
704
+ const o = (t.ge = e.Ne = { m: e, p: t, D: i, Ae: s, h: null });
686
705
  if (n !== null) n.D = o;
687
706
  else t.C = o;
688
707
  if (s !== null) s.h = o;
@@ -808,7 +827,7 @@ function createOwner(e) {
808
827
  Ce: null,
809
828
  De: null,
810
829
  Ve: null,
811
- F: t?.F ?? globalQueue,
830
+ $: t?.$ ?? globalQueue,
812
831
  Le: t?.Le || defaultContext,
813
832
  me: 0,
814
833
  we: null,
@@ -834,51 +853,51 @@ function createRoot(e, t) {
834
853
  return runWithOwner(n, () => e(n.dispose));
835
854
  }
836
855
  function addPendingSource(e, t) {
837
- if (e.Re === t || e.Oe?.has(t)) return false;
838
- if (!e.Re) {
839
- e.Re = t;
856
+ if (e.Oe === t || e._e?.has(t)) return false;
857
+ if (!e.Oe) {
858
+ e.Oe = t;
840
859
  return true;
841
860
  }
842
- if (!e.Oe) {
843
- e.Oe = new Set([e.Re, t]);
861
+ if (!e._e) {
862
+ e._e = new Set([e.Oe, t]);
844
863
  } else {
845
- e.Oe.add(t);
864
+ e._e.add(t);
846
865
  }
847
- e.Re = undefined;
866
+ e.Oe = undefined;
848
867
  return true;
849
868
  }
850
869
  function removePendingSource(e, t) {
851
- if (e.Re) {
852
- if (e.Re !== t) return false;
853
- e.Re = undefined;
870
+ if (e.Oe) {
871
+ if (e.Oe !== t) return false;
872
+ e.Oe = undefined;
854
873
  return true;
855
874
  }
856
- if (!e.Oe?.delete(t)) return false;
857
- if (e.Oe.size === 1) {
858
- e.Re = e.Oe.values().next().value;
859
- e.Oe = undefined;
860
- } else if (e.Oe.size === 0) {
861
- e.Oe = undefined;
875
+ if (!e._e?.delete(t)) return false;
876
+ if (e._e.size === 1) {
877
+ e.Oe = e._e.values().next().value;
878
+ e._e = undefined;
879
+ } else if (e._e.size === 0) {
880
+ e._e = undefined;
862
881
  }
863
882
  return true;
864
883
  }
865
884
  function clearPendingSources(e) {
866
- e.Re = undefined;
867
- e.Oe?.clear();
868
885
  e.Oe = undefined;
886
+ e._e?.clear();
887
+ e._e = undefined;
869
888
  }
870
889
  function setPendingError(e, t, n) {
871
890
  if (!t) {
872
- e.fe = null;
891
+ e.Ee = null;
873
892
  return;
874
893
  }
875
894
  if (n instanceof NotReadyError && n.source === t) {
876
- e.fe = n;
895
+ e.Ee = n;
877
896
  return;
878
897
  }
879
- const i = e.fe;
898
+ const i = e.Ee;
880
899
  if (!(i instanceof NotReadyError) || i.source !== t) {
881
- e.fe = new NotReadyError(t);
900
+ e.Ee = new NotReadyError(t);
882
901
  }
883
902
  }
884
903
  function forEachDependent(e, t) {
@@ -893,21 +912,21 @@ function settlePendingSource(e) {
893
912
  const settle = i => {
894
913
  if (n.has(i) || !removePendingSource(i, e)) return;
895
914
  n.add(i);
896
- i.Ee = clock;
897
- const r = i.Re ?? i.Oe?.values().next().value;
915
+ i.de = clock;
916
+ const r = i.Oe ?? i._e?.values().next().value;
898
917
  if (r) {
899
918
  setPendingError(i, r);
900
919
  updatePendingSignal(i);
901
920
  } else {
902
- i.Se &= ~STATUS_PENDING;
921
+ i.Re &= ~STATUS_PENDING;
903
922
  setPendingError(i);
904
923
  updatePendingSignal(i);
905
924
  if (i.Ue) {
906
- if (i.W === EFFECT_TRACKED) {
925
+ if (i.F === EFFECT_TRACKED) {
907
926
  const e = i;
908
- if (!e.H) {
909
- e.H = true;
910
- e.F.enqueue(EFFECT_USER, e.M);
927
+ if (!e.j) {
928
+ e.j = true;
929
+ e.$.enqueue(EFFECT_USER, e.K);
911
930
  }
912
931
  } else {
913
932
  const e = i.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue;
@@ -937,33 +956,33 @@ function handleAsync(e, t, n) {
937
956
  if (e.ye !== t) return;
938
957
  globalQueue.initTransition(resolveTransition(e));
939
958
  notifyStatus(e, n instanceof NotReadyError ? STATUS_PENDING : STATUS_ERROR, n);
940
- e.Ee = clock;
959
+ e.de = clock;
941
960
  };
942
961
  const asyncWrite = (i, r) => {
943
962
  if (e.ye !== t) return;
944
963
  if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY)) return;
945
964
  globalQueue.initTransition(resolveTransition(e));
946
- const s = !!(e.Se & STATUS_UNINITIALIZED);
965
+ const s = !!(e.Re & STATUS_UNINITIALIZED);
947
966
  clearStatus(e);
948
967
  const o = resolveLane(e);
949
- if (o) o.k.delete(e);
968
+ if (o) o.H.delete(e);
950
969
  if (n) n(i);
951
- else if (e.ee !== undefined) {
952
- if (e.ee !== undefined && e.ee !== NOT_PENDING) e.X = i;
970
+ else if (e.k !== undefined) {
971
+ if (e.k !== undefined && e.k !== NOT_PENDING) e.U = i;
953
972
  else {
954
- e.J = i;
973
+ e.te = i;
955
974
  insertSubs(e);
956
975
  }
957
- e.Ee = clock;
976
+ e.de = clock;
958
977
  } else if (o) {
959
- const t = e.W;
960
- const n = e.J;
978
+ const t = e.F;
979
+ const n = e.te;
961
980
  const r = e.ke;
962
981
  if ((!t && s) || !r || !r(i, n)) {
963
- e.J = i;
964
- e.Ee = clock;
965
- if (e.xe) {
966
- setSignal(e.xe, i);
982
+ e.te = i;
983
+ e.de = clock;
984
+ if (e.Ge) {
985
+ setSignal(e.Ge, i);
967
986
  }
968
987
  insertSubs(e, true);
969
988
  }
@@ -1054,27 +1073,27 @@ function handleAsync(e, t, n) {
1054
1073
  function clearStatus(e, t = false) {
1055
1074
  clearPendingSources(e);
1056
1075
  e.Ue = false;
1057
- e.Se = t ? 0 : e.Se & STATUS_UNINITIALIZED;
1076
+ e.Re = t ? 0 : e.Re & STATUS_UNINITIALIZED;
1058
1077
  setPendingError(e);
1059
1078
  updatePendingSignal(e);
1060
- e.Ge?.();
1079
+ e.xe?.();
1061
1080
  }
1062
1081
  function notifyStatus(e, t, n, i, r) {
1063
1082
  if (t === STATUS_ERROR && !(n instanceof StatusError) && !(n instanceof NotReadyError))
1064
1083
  n = new StatusError(e, n);
1065
1084
  const s = t === STATUS_PENDING && n instanceof NotReadyError ? n.source : undefined;
1066
1085
  const o = s === e;
1067
- const u = t === STATUS_PENDING && e.ee !== undefined && !o;
1086
+ const u = t === STATUS_PENDING && e.k !== undefined && !o;
1068
1087
  const c = u && hasActiveOverride(e);
1069
1088
  if (!i) {
1070
1089
  if (t === STATUS_PENDING && s) {
1071
1090
  addPendingSource(e, s);
1072
- e.Se = STATUS_PENDING | (e.Se & STATUS_UNINITIALIZED);
1091
+ e.Re = STATUS_PENDING | (e.Re & STATUS_UNINITIALIZED);
1073
1092
  setPendingError(e, s, n);
1074
1093
  } else {
1075
1094
  clearPendingSources(e);
1076
- e.Se = t | (t !== STATUS_ERROR ? e.Se & STATUS_UNINITIALIZED : 0);
1077
- e.fe = n;
1095
+ e.Re = t | (t !== STATUS_ERROR ? e.Re & STATUS_UNINITIALIZED : 0);
1096
+ e.Ee = n;
1078
1097
  }
1079
1098
  updatePendingSignal(e);
1080
1099
  }
@@ -1083,24 +1102,24 @@ function notifyStatus(e, t, n, i, r) {
1083
1102
  }
1084
1103
  const a = i || c;
1085
1104
  const l = i || u ? undefined : r;
1086
- if (e.Ge) {
1105
+ if (e.xe) {
1087
1106
  if (i && t === STATUS_PENDING) {
1088
1107
  return;
1089
1108
  }
1090
1109
  if (a) {
1091
- e.Ge(t, n);
1110
+ e.xe(t, n);
1092
1111
  } else {
1093
- e.Ge();
1112
+ e.xe();
1094
1113
  }
1095
1114
  return;
1096
1115
  }
1097
1116
  forEachDependent(e, e => {
1098
- e.Ee = clock;
1117
+ e.de = clock;
1099
1118
  if (
1100
- (t === STATUS_PENDING && s && e.Re !== s && !e.Oe?.has(s)) ||
1101
- (t !== STATUS_PENDING && (e.fe !== n || e.Re || e.Oe))
1119
+ (t === STATUS_PENDING && s && e.Oe !== s && !e._e?.has(s)) ||
1120
+ (t !== STATUS_PENDING && (e.Ee !== n || e.Oe || e._e))
1102
1121
  ) {
1103
- if (!a && !e.K) globalQueue.se.push(e);
1122
+ if (!a && !e.B) globalQueue.oe.push(e);
1104
1123
  notifyStatus(e, t, n, a, l);
1105
1124
  }
1106
1125
  });
@@ -1128,8 +1147,8 @@ function enableExternalSource(e) {
1128
1147
  externalSourceConfig = { factory: t, untrack: n };
1129
1148
  }
1130
1149
  }
1131
- GlobalQueue.oe = recompute;
1132
- GlobalQueue.ue = disposeChildren;
1150
+ GlobalQueue.ue = recompute;
1151
+ GlobalQueue.ce = disposeChildren;
1133
1152
  let tracking = false;
1134
1153
  let stale = false;
1135
1154
  let refreshing = false;
@@ -1168,7 +1187,7 @@ function releaseSubtree(e) {
1168
1187
  }
1169
1188
  if (t.L) {
1170
1189
  const e = t;
1171
- e.Te = false;
1190
+ e.Se = false;
1172
1191
  if (e.O & REACTIVE_SNAPSHOT_STALE) {
1173
1192
  e.O &= ~REACTIVE_SNAPSHOT_STALE;
1174
1193
  e.O |= REACTIVE_DIRTY;
@@ -1183,7 +1202,7 @@ function releaseSubtree(e) {
1183
1202
  function clearSnapshots() {
1184
1203
  if (snapshotSources) {
1185
1204
  for (const e of snapshotSources) {
1186
- delete e.de;
1205
+ delete e.Te;
1187
1206
  delete e[STORE_SNAPSHOT_PROPS];
1188
1207
  }
1189
1208
  snapshotSources = null;
@@ -1191,13 +1210,13 @@ function clearSnapshots() {
1191
1210
  snapshotCaptureActive = false;
1192
1211
  }
1193
1212
  function recompute(e, t = false) {
1194
- const n = e.W;
1213
+ const n = e.F;
1195
1214
  if (!t) {
1196
- if (e.K && (!n || activeTransition) && activeTransition !== e.K)
1197
- globalQueue.initTransition(e.K);
1215
+ if (e.B && (!n || activeTransition) && activeTransition !== e.B)
1216
+ globalQueue.initTransition(e.B);
1198
1217
  deleteFromHeap(e, e.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
1199
1218
  e.ye = null;
1200
- if (e.K || n === EFFECT_TRACKED) disposeChildren(e);
1219
+ if (e.B || n === EFFECT_TRACKED) disposeChildren(e);
1201
1220
  else {
1202
1221
  markDisposal(e);
1203
1222
  e.we = e.Ve;
@@ -1208,15 +1227,15 @@ function recompute(e, t = false) {
1208
1227
  }
1209
1228
  }
1210
1229
  const i = !!(e.O & REACTIVE_OPTIMISTIC_DIRTY);
1211
- const r = e.ee !== undefined && e.ee !== NOT_PENDING;
1212
- const s = !!(e.Se & STATUS_PENDING);
1213
- const o = !!(e.Se & STATUS_UNINITIALIZED);
1230
+ const r = e.k !== undefined && e.k !== NOT_PENDING;
1231
+ const s = !!(e.Re & STATUS_PENDING);
1232
+ const o = !!(e.Re & STATUS_UNINITIALIZED);
1214
1233
  const u = context;
1215
1234
  context = e;
1216
1235
  e.ge = null;
1217
1236
  e.O = REACTIVE_RECOMPUTING_DEPS;
1218
- e.Ee = clock;
1219
- let c = e.X === NOT_PENDING ? e.J : e.X;
1237
+ e.de = clock;
1238
+ let c = e.U === NOT_PENDING ? e.te : e.U;
1220
1239
  let a = e.o;
1221
1240
  let l = tracking;
1222
1241
  let f = currentOptimisticLane;
@@ -1226,20 +1245,22 @@ function recompute(e, t = false) {
1226
1245
  if (t) currentOptimisticLane = t;
1227
1246
  }
1228
1247
  try {
1229
- c = handleAsync(e, e.L(c));
1248
+ const n = e.ye;
1249
+ const i = e.L(c);
1250
+ c = e.ye !== n ? i : handleAsync(e, i);
1230
1251
  clearStatus(e, t);
1231
- const n = resolveLane(e);
1232
- if (n) {
1233
- n.k.delete(e);
1234
- updatePendingSignal(n.te);
1252
+ const r = resolveLane(e);
1253
+ if (r) {
1254
+ r.H.delete(e);
1255
+ updatePendingSignal(r.ne);
1235
1256
  }
1236
1257
  } catch (t) {
1237
1258
  if (t instanceof NotReadyError && currentOptimisticLane) {
1238
1259
  const t = findLane(currentOptimisticLane);
1239
- if (t.te !== e) {
1240
- t.k.add(e);
1241
- e.q = t;
1242
- updatePendingSignal(t.te);
1260
+ if (t.ne !== e) {
1261
+ t.H.add(e);
1262
+ e.ee = t;
1263
+ updatePendingSignal(t.ne);
1243
1264
  }
1244
1265
  }
1245
1266
  if (t instanceof NotReadyError) e.Ue = true;
@@ -1248,14 +1269,14 @@ function recompute(e, t = false) {
1248
1269
  t instanceof NotReadyError ? STATUS_PENDING : STATUS_ERROR,
1249
1270
  t,
1250
1271
  undefined,
1251
- t instanceof NotReadyError ? e.q : undefined
1272
+ t instanceof NotReadyError ? e.ee : undefined
1252
1273
  );
1253
1274
  } finally {
1254
1275
  tracking = l;
1255
1276
  e.O = REACTIVE_NONE | (t ? e.O & REACTIVE_SNAPSHOT_STALE : 0);
1256
1277
  context = u;
1257
1278
  }
1258
- if (!e.fe) {
1279
+ if (!e.Ee) {
1259
1280
  const u = e.ge;
1260
1281
  let l = u !== null ? u.D : e.C;
1261
1282
  if (l !== null) {
@@ -1265,21 +1286,21 @@ function recompute(e, t = false) {
1265
1286
  if (u !== null) u.D = null;
1266
1287
  else e.C = null;
1267
1288
  }
1268
- const f = r ? e.ee : e.X === NOT_PENDING ? e.J : e.X;
1289
+ const f = r ? e.k : e.U === NOT_PENDING ? e.te : e.U;
1269
1290
  const E = (!n && o) || !e.ke || !e.ke(f, c);
1270
1291
  if (E) {
1271
- const o = r ? e.ee : undefined;
1272
- if (t || (n && activeTransition !== e.K) || i) {
1273
- e.J = c;
1292
+ const o = r ? e.k : undefined;
1293
+ if (t || (n && activeTransition !== e.B) || i) {
1294
+ e.te = c;
1274
1295
  if (r && i) {
1275
- e.ee = c;
1276
- e.X = c;
1296
+ e.k = c;
1297
+ e.U = c;
1277
1298
  }
1278
- } else e.X = c;
1279
- if (r && !i && s && !e.he) e.ee = c;
1280
- if (!r || i || e.ee !== o) insertSubs(e, i || r);
1299
+ } else e.U = c;
1300
+ if (r && !i && s && !e.pe) e.k = c;
1301
+ if (!r || i || e.k !== o) insertSubs(e, i || r);
1281
1302
  } else if (r) {
1282
- e.X = c;
1303
+ e.U = c;
1283
1304
  } else if (e.o != a) {
1284
1305
  for (let t = e.I; t !== null; t = t.h) {
1285
1306
  insertIntoHeapHeight(t.p, t.p.O & REACTIVE_ZOMBIE ? zombieQueue : dirtyQueue);
@@ -1287,8 +1308,8 @@ function recompute(e, t = false) {
1287
1308
  }
1288
1309
  }
1289
1310
  currentOptimisticLane = f;
1290
- (!t || e.Se & STATUS_PENDING) && !e.K && !(activeTransition && r) && globalQueue.se.push(e);
1291
- e.K && n && activeTransition !== e.K && runInTransition(e.K, () => recompute(e));
1311
+ (!t || e.Re & STATUS_PENDING) && !e.B && !(activeTransition && r) && globalQueue.oe.push(e);
1312
+ e.B && n && activeTransition !== e.B && runInTransition(e.B, () => recompute(e));
1292
1313
  }
1293
1314
  function updateIfNecessary(e) {
1294
1315
  if (e.O & REACTIVE_CHECK) {
@@ -1303,25 +1324,25 @@ function updateIfNecessary(e) {
1303
1324
  }
1304
1325
  }
1305
1326
  }
1306
- if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY) || (e.fe && e.Ee < clock && !e.ye)) {
1327
+ if (e.O & (REACTIVE_DIRTY | REACTIVE_OPTIMISTIC_DIRTY) || (e.Ee && e.de < clock && !e.ye)) {
1307
1328
  recompute(e);
1308
1329
  }
1309
1330
  e.O = e.O & (REACTIVE_SNAPSHOT_STALE | REACTIVE_IN_HEAP | REACTIVE_IN_HEAP_HEIGHT);
1310
1331
  }
1311
- function computed(e, t, n) {
1312
- const i = n?.transparent ?? false;
1313
- const r = {
1314
- id: n?.id ?? (i ? context?.id : context?.id != null ? getNextChildId(context) : undefined),
1315
- be: i || undefined,
1316
- ke: n?.equals != null ? n.equals : isEqual,
1317
- le: !!n?.pureWrite,
1318
- Ne: n?.unobserved,
1332
+ function computed(e, t) {
1333
+ const n = t?.transparent ?? false;
1334
+ const i = {
1335
+ id: t?.id ?? (n ? context?.id : context?.id != null ? getNextChildId(context) : undefined),
1336
+ be: n || undefined,
1337
+ ke: t?.equals != null ? t.equals : isEqual,
1338
+ fe: !!t?.ownedWrite,
1339
+ G: t?.unobserved,
1319
1340
  Ve: null,
1320
- F: context?.F ?? globalQueue,
1341
+ $: context?.$ ?? globalQueue,
1321
1342
  Le: context?.Le ?? defaultContext,
1322
1343
  me: 0,
1323
1344
  L: e,
1324
- J: t,
1345
+ te: undefined,
1325
1346
  o: 0,
1326
1347
  A: null,
1327
1348
  S: undefined,
@@ -1329,82 +1350,82 @@ function computed(e, t, n) {
1329
1350
  C: null,
1330
1351
  ge: null,
1331
1352
  I: null,
1332
- Ae: null,
1353
+ Ne: null,
1333
1354
  i: context,
1334
1355
  De: null,
1335
1356
  Ce: null,
1336
- O: n?.lazy ? REACTIVE_LAZY : REACTIVE_NONE,
1337
- Se: STATUS_UNINITIALIZED,
1338
- Ee: clock,
1339
- X: NOT_PENDING,
1357
+ O: t?.lazy ? REACTIVE_LAZY : REACTIVE_NONE,
1358
+ Re: STATUS_UNINITIALIZED,
1359
+ de: clock,
1360
+ U: NOT_PENDING,
1340
1361
  we: null,
1341
1362
  ve: null,
1342
1363
  ye: null,
1343
- K: null
1364
+ B: null
1344
1365
  };
1345
- r.T = r;
1346
- const s = context?.t ? context.u : context;
1366
+ i.T = i;
1367
+ const r = context?.t ? context.u : context;
1347
1368
  if (context) {
1348
1369
  const e = context.Ce;
1349
1370
  if (e === null) {
1350
- context.Ce = r;
1371
+ context.Ce = i;
1351
1372
  } else {
1352
- r.De = e;
1353
- context.Ce = r;
1373
+ i.De = e;
1374
+ context.Ce = i;
1354
1375
  }
1355
1376
  }
1356
- if (s) r.o = s.o + 1;
1357
- if (snapshotCaptureActive && ownerInSnapshotScope(context)) r.Te = true;
1377
+ if (r) i.o = r.o + 1;
1378
+ if (snapshotCaptureActive && ownerInSnapshotScope(context)) i.Se = true;
1358
1379
  if (externalSourceConfig) {
1359
- const e = signal(undefined, { equals: false, pureWrite: true });
1360
- const t = externalSourceConfig.factory(r.L, () => {
1380
+ const e = signal(undefined, { equals: false, ownedWrite: true });
1381
+ const t = externalSourceConfig.factory(i.L, () => {
1361
1382
  setSignal(e, undefined);
1362
1383
  });
1363
1384
  cleanup(() => t.dispose());
1364
- r.L = n => {
1385
+ i.L = n => {
1365
1386
  read(e);
1366
1387
  return t.track(n);
1367
1388
  };
1368
1389
  }
1369
- !n?.lazy && recompute(r, true);
1370
- if (snapshotCaptureActive && !n?.lazy) {
1371
- if (!(r.Se & STATUS_PENDING)) {
1372
- r.de = r.J === undefined ? NO_SNAPSHOT : r.J;
1373
- snapshotSources.add(r);
1390
+ !t?.lazy && recompute(i, true);
1391
+ if (snapshotCaptureActive && !t?.lazy) {
1392
+ if (!(i.Re & STATUS_PENDING)) {
1393
+ i.Te = i.te === undefined ? NO_SNAPSHOT : i.te;
1394
+ snapshotSources.add(i);
1374
1395
  }
1375
1396
  }
1376
- return r;
1397
+ return i;
1377
1398
  }
1378
1399
  function signal(e, t, n = null) {
1379
1400
  const i = {
1380
1401
  ke: t?.equals != null ? t.equals : isEqual,
1381
- le: !!t?.pureWrite,
1402
+ fe: !!t?.ownedWrite,
1382
1403
  He: !!t?.He,
1383
- Ne: t?.unobserved,
1384
- J: e,
1404
+ G: t?.unobserved,
1405
+ te: e,
1385
1406
  I: null,
1386
- Ae: null,
1387
- Ee: clock,
1407
+ Ne: null,
1408
+ de: clock,
1388
1409
  V: n,
1389
1410
  N: n?.A || null,
1390
- X: NOT_PENDING
1411
+ U: NOT_PENDING
1391
1412
  };
1392
1413
  n && (n.A = i);
1393
- if (snapshotCaptureActive && !i.He && !((n?.Se ?? 0) & STATUS_PENDING)) {
1394
- i.de = e === undefined ? NO_SNAPSHOT : e;
1414
+ if (snapshotCaptureActive && !i.He && !((n?.Re ?? 0) & STATUS_PENDING)) {
1415
+ i.Te = e === undefined ? NO_SNAPSHOT : e;
1395
1416
  snapshotSources.add(i);
1396
1417
  }
1397
1418
  return i;
1398
1419
  }
1399
1420
  function optimisticSignal(e, t) {
1400
1421
  const n = signal(e, t);
1401
- n.ee = NOT_PENDING;
1422
+ n.k = NOT_PENDING;
1402
1423
  return n;
1403
1424
  }
1404
- function optimisticComputed(e, t, n) {
1405
- const i = computed(e, t, n);
1406
- i.ee = NOT_PENDING;
1407
- return i;
1425
+ function optimisticComputed(e, t) {
1426
+ const n = computed(e, t);
1427
+ n.k = NOT_PENDING;
1428
+ return n;
1408
1429
  }
1409
1430
  function isEqual(e, t) {
1410
1431
  return e === t;
@@ -1425,7 +1446,7 @@ function read(e) {
1425
1446
  const t = getLatestValueComputed(e);
1426
1447
  const n = latestReadActive;
1427
1448
  latestReadActive = false;
1428
- const i = e.ee !== undefined && e.ee !== NOT_PENDING ? e.ee : e.J;
1449
+ const i = e.k !== undefined && e.k !== NOT_PENDING ? e.k : e.te;
1429
1450
  let r;
1430
1451
  try {
1431
1452
  r = read(t);
@@ -1435,11 +1456,11 @@ function read(e) {
1435
1456
  } finally {
1436
1457
  latestReadActive = n;
1437
1458
  }
1438
- if (t.Se & STATUS_PENDING) return i;
1439
- if (stale && currentOptimisticLane && t.q) {
1440
- const e = findLane(t.q);
1459
+ if (t.Re & STATUS_PENDING) return i;
1460
+ if (stale && currentOptimisticLane && t.ee) {
1461
+ const e = findLane(t.ee);
1441
1462
  const n = findLane(currentOptimisticLane);
1442
- if (e !== n && e.k.size > 0) {
1463
+ if (e !== n && e.H.size > 0) {
1443
1464
  return i;
1444
1465
  }
1445
1466
  }
@@ -1449,8 +1470,8 @@ function read(e) {
1449
1470
  const t = e.V;
1450
1471
  const n = pendingCheckActive;
1451
1472
  pendingCheckActive = false;
1452
- if (t && e.ee !== undefined) {
1453
- if (e.ee !== NOT_PENDING && (t.ye || !!(t.Se & STATUS_PENDING))) {
1473
+ if (t && e.k !== undefined) {
1474
+ if (e.k !== NOT_PENDING && (t.ye || !!(t.Re & STATUS_PENDING))) {
1454
1475
  foundPending = true;
1455
1476
  }
1456
1477
  let n = context;
@@ -1463,86 +1484,104 @@ function read(e) {
1463
1484
  if (t && read(getPendingSignal(t))) foundPending = true;
1464
1485
  }
1465
1486
  pendingCheckActive = n;
1466
- return e.J;
1487
+ return e.te;
1467
1488
  }
1468
1489
  let t = context;
1469
1490
  if (t?.t) t = t.u;
1470
- if (refreshing && e.L) recompute(e);
1471
- if (e.O & REACTIVE_LAZY) {
1472
- e.O &= ~REACTIVE_LAZY;
1473
- recompute(e, true);
1474
- }
1475
- const n = e.V || e;
1491
+ const n = e;
1492
+ if (typeof n.L === "function") {
1493
+ const t = e;
1494
+ if (refreshing && !(t.O & REACTIVE_DISPOSED)) recompute(t);
1495
+ if (t.O & REACTIVE_LAZY) {
1496
+ t.O &= ~REACTIVE_LAZY;
1497
+ recompute(t, true);
1498
+ } else if (t.O & REACTIVE_DISPOSED) {
1499
+ recompute(t, true);
1500
+ }
1501
+ }
1502
+ const i = e.V || e;
1476
1503
  if (t && tracking) {
1477
- if (e.L && e.O & REACTIVE_DISPOSED) recompute(e);
1478
1504
  link(e, t);
1479
- if (n.L) {
1480
- const i = e.O & REACTIVE_ZOMBIE;
1481
- if (n.o >= (i ? zombieQueue.P : dirtyQueue.P)) {
1505
+ if (i.L) {
1506
+ const n = e.O & REACTIVE_ZOMBIE;
1507
+ if (i.o >= (n ? zombieQueue.P : dirtyQueue.P)) {
1482
1508
  markNode(t);
1483
- markHeap(i ? zombieQueue : dirtyQueue);
1484
- updateIfNecessary(n);
1509
+ markHeap(n ? zombieQueue : dirtyQueue);
1510
+ updateIfNecessary(i);
1485
1511
  }
1486
- const r = n.o;
1512
+ const r = i.o;
1487
1513
  if (r >= t.o && e.i !== t) {
1488
1514
  t.o = r + 1;
1489
1515
  }
1490
1516
  }
1491
1517
  }
1492
- if (n.Se & STATUS_PENDING) {
1493
- if (t && !(stale && n.K && activeTransition !== n.K)) {
1518
+ if (i.Re & STATUS_PENDING) {
1519
+ if (t && !(stale && i.B && activeTransition !== i.B)) {
1494
1520
  if (currentOptimisticLane) {
1495
- const i = n.q;
1521
+ const n = i.ee;
1496
1522
  const r = findLane(currentOptimisticLane);
1497
- if (i && findLane(i) === r && !hasActiveOverride(n)) {
1523
+ if (n && findLane(n) === r && !hasActiveOverride(i)) {
1498
1524
  if (!tracking && e !== t) link(e, t);
1499
- throw n.fe;
1525
+ throw i.Ee;
1500
1526
  }
1501
1527
  } else {
1502
1528
  if (!tracking && e !== t) link(e, t);
1503
- throw n.fe;
1529
+ throw i.Ee;
1504
1530
  }
1505
- } else if (t && n !== e && n.Se & STATUS_UNINITIALIZED) {
1531
+ } else if (t && i !== e && i.Re & STATUS_UNINITIALIZED) {
1506
1532
  if (!tracking && e !== t) link(e, t);
1507
- throw n.fe;
1508
- } else if (!t && n.Se & STATUS_UNINITIALIZED) {
1509
- throw n.fe;
1533
+ throw i.Ee;
1534
+ } else if (!t && i.Re & STATUS_UNINITIALIZED) {
1535
+ throw i.Ee;
1510
1536
  }
1511
1537
  }
1512
- if (e.L && e.Se & STATUS_ERROR) {
1513
- if (e.Ee < clock) {
1538
+ if (e.L && e.Re & STATUS_ERROR) {
1539
+ if (e.de < clock) {
1514
1540
  recompute(e);
1515
1541
  return read(e);
1516
- } else throw e.fe;
1542
+ } else throw e.Ee;
1517
1543
  }
1518
- if (snapshotCaptureActive && t && t.Te) {
1519
- const n = e.de;
1544
+ if (snapshotCaptureActive && t && t.Se) {
1545
+ const n = e.Te;
1520
1546
  if (n !== undefined) {
1521
1547
  const i = n === NO_SNAPSHOT ? undefined : n;
1522
- const r = e.X !== NOT_PENDING ? e.X : e.J;
1548
+ const r = e.U !== NOT_PENDING ? e.U : e.te;
1523
1549
  if (r !== i) t.O |= REACTIVE_SNAPSHOT_STALE;
1524
1550
  return i;
1525
1551
  }
1526
1552
  }
1527
- if (e.ee !== undefined && e.ee !== NOT_PENDING) {
1528
- if (t && stale && shouldReadStashedOptimisticValue(e)) return e.J;
1529
- return e.ee;
1553
+ if (e.k !== undefined && e.k !== NOT_PENDING) {
1554
+ if (t && stale && shouldReadStashedOptimisticValue(e)) return e.te;
1555
+ return e.k;
1530
1556
  }
1531
- return !t ||
1557
+ const r =
1558
+ !t ||
1532
1559
  (currentOptimisticLane !== null &&
1533
- (e.ee !== undefined || e.q || (n === e && stale) || !!(n.Se & STATUS_PENDING))) ||
1534
- e.X === NOT_PENDING ||
1535
- (stale && e.K && activeTransition !== e.K)
1536
- ? e.J
1537
- : e.X;
1560
+ (e.k !== undefined || e.ee || (i === e && stale) || !!(i.Re & STATUS_PENDING))) ||
1561
+ e.U === NOT_PENDING ||
1562
+ (stale && e.B && activeTransition !== e.B)
1563
+ ? e.te
1564
+ : e.U;
1565
+ if (
1566
+ !t &&
1567
+ i === e &&
1568
+ typeof n.L === "function" &&
1569
+ !n.Pe &&
1570
+ !(i.Re & STATUS_PENDING) &&
1571
+ !n.i &&
1572
+ !e.I
1573
+ ) {
1574
+ unobserved(e);
1575
+ }
1576
+ return r;
1538
1577
  }
1539
1578
  function setSignal(e, t) {
1540
- if (e.K && activeTransition !== e.K) globalQueue.initTransition(e.K);
1541
- const n = e.ee !== undefined && !projectionWriteActive;
1542
- const i = e.ee !== undefined && e.ee !== NOT_PENDING;
1543
- const r = n ? (i ? e.ee : e.J) : e.X === NOT_PENDING ? e.J : e.X;
1579
+ if (e.B && activeTransition !== e.B) globalQueue.initTransition(e.B);
1580
+ const n = e.k !== undefined && !projectionWriteActive;
1581
+ const i = e.k !== undefined && e.k !== NOT_PENDING;
1582
+ const r = n ? (i ? e.k : e.te) : e.U === NOT_PENDING ? e.te : e.U;
1544
1583
  if (typeof t === "function") t = t(r);
1545
- const s = !e.ke || !e.ke(r, t) || !!(e.Se & STATUS_UNINITIALIZED);
1584
+ const s = !e.ke || !e.ke(r, t) || !!(e.Re & STATUS_UNINITIALIZED);
1546
1585
  if (!s) {
1547
1586
  if (n && i && e.L) {
1548
1587
  insertSubs(e, true);
@@ -1551,25 +1590,25 @@ function setSignal(e, t) {
1551
1590
  return t;
1552
1591
  }
1553
1592
  if (n) {
1554
- const n = e.ee === NOT_PENDING;
1593
+ const n = e.k === NOT_PENDING;
1555
1594
  if (!n) globalQueue.initTransition(resolveTransition(e));
1556
1595
  if (n) {
1557
- e.X = e.J;
1558
- globalQueue.Y.push(e);
1596
+ e.U = e.te;
1597
+ globalQueue.q.push(e);
1559
1598
  }
1560
- e.he = true;
1599
+ e.pe = true;
1561
1600
  const i = getOrCreateLane(e);
1562
- e.q = i;
1563
- e.ee = t;
1601
+ e.ee = i;
1602
+ e.k = t;
1564
1603
  } else {
1565
- if (e.X === NOT_PENDING) globalQueue.se.push(e);
1566
- e.X = t;
1604
+ if (e.U === NOT_PENDING) globalQueue.oe.push(e);
1605
+ e.U = t;
1567
1606
  }
1568
1607
  updatePendingSignal(e);
1569
- if (e.xe) {
1570
- setSignal(e.xe, t);
1608
+ if (e.Ge) {
1609
+ setSignal(e.Ge, t);
1571
1610
  }
1572
- e.Ee = clock;
1611
+ e.de = clock;
1573
1612
  insertSubs(e, n);
1574
1613
  schedule();
1575
1614
  return t;
@@ -1587,68 +1626,68 @@ function runWithOwner(e, t) {
1587
1626
  }
1588
1627
  }
1589
1628
  function getPendingSignal(e) {
1590
- if (!e.Fe) {
1591
- e.Fe = optimisticSignal(false, { pureWrite: true });
1592
- if (e._e) {
1593
- e.Fe._e = e;
1629
+ if (!e.Me) {
1630
+ e.Me = optimisticSignal(false, { ownedWrite: true });
1631
+ if (e.Ie) {
1632
+ e.Me.Ie = e;
1594
1633
  }
1595
- if (computePendingState(e)) setSignal(e.Fe, true);
1634
+ if (computePendingState(e)) setSignal(e.Me, true);
1596
1635
  }
1597
- return e.Fe;
1636
+ return e.Me;
1598
1637
  }
1599
1638
  function computePendingState(e) {
1600
1639
  const t = e;
1601
1640
  const n = e.V;
1602
- if (n && e.X !== NOT_PENDING) {
1603
- return !n.ye && !(n.Se & STATUS_PENDING);
1641
+ if (n && e.U !== NOT_PENDING) {
1642
+ return !n.ye && !(n.Re & STATUS_PENDING);
1604
1643
  }
1605
- if (e.ee !== undefined && e.ee !== NOT_PENDING) {
1606
- if (t.Se & STATUS_PENDING && !(t.Se & STATUS_UNINITIALIZED)) return true;
1607
- if (e._e) {
1608
- const t = e.q ? findLane(e.q) : null;
1609
- return !!(t && t.k.size > 0);
1644
+ if (e.k !== undefined && e.k !== NOT_PENDING) {
1645
+ if (t.Re & STATUS_PENDING && !(t.Re & STATUS_UNINITIALIZED)) return true;
1646
+ if (e.Ie) {
1647
+ const t = e.ee ? findLane(e.ee) : null;
1648
+ return !!(t && t.H.size > 0);
1610
1649
  }
1611
1650
  return true;
1612
1651
  }
1613
- if (e.ee !== undefined && e.ee === NOT_PENDING && !e._e) {
1652
+ if (e.k !== undefined && e.k === NOT_PENDING && !e.Ie) {
1614
1653
  return false;
1615
1654
  }
1616
- if (e.X !== NOT_PENDING && !(t.Se & STATUS_UNINITIALIZED)) return true;
1617
- return !!(t.Se & STATUS_PENDING && !(t.Se & STATUS_UNINITIALIZED));
1655
+ if (e.U !== NOT_PENDING && !(t.Re & STATUS_UNINITIALIZED)) return true;
1656
+ return !!(t.Re & STATUS_PENDING && !(t.Re & STATUS_UNINITIALIZED));
1618
1657
  }
1619
1658
  function updatePendingSignal(e) {
1620
- if (e.Fe) {
1659
+ if (e.Me) {
1621
1660
  const t = computePendingState(e);
1622
- const n = e.Fe;
1661
+ const n = e.Me;
1623
1662
  setSignal(n, t);
1624
- if (!t && n.q) {
1663
+ if (!t && n.ee) {
1625
1664
  const t = resolveLane(e);
1626
- if (t && t.k.size > 0) {
1627
- const e = findLane(n.q);
1665
+ if (t && t.H.size > 0) {
1666
+ const e = findLane(n.ee);
1628
1667
  if (e !== t) {
1629
1668
  mergeLanes(t, e);
1630
1669
  }
1631
1670
  }
1632
1671
  signalLanes.delete(n);
1633
- n.q = undefined;
1672
+ n.ee = undefined;
1634
1673
  }
1635
1674
  }
1636
1675
  }
1637
1676
  function getLatestValueComputed(e) {
1638
- if (!e.xe) {
1677
+ if (!e.Ge) {
1639
1678
  const t = latestReadActive;
1640
1679
  latestReadActive = false;
1641
1680
  const n = pendingCheckActive;
1642
1681
  pendingCheckActive = false;
1643
1682
  const i = context;
1644
1683
  context = null;
1645
- e.xe = optimisticComputed(() => read(e));
1646
- e.xe._e = e;
1684
+ e.Ge = optimisticComputed(() => read(e));
1685
+ e.Ge.Ie = e;
1647
1686
  context = i;
1648
1687
  pendingCheckActive = n;
1649
1688
  latestReadActive = t;
1650
1689
  }
1651
- return e.xe;
1690
+ return e.Ge;
1652
1691
  }
1653
1692
  function staleValues(e, t = true) {
1654
1693
  const n = stale;
@@ -1727,29 +1766,30 @@ function hasContext(e, t) {
1727
1766
  function isUndefined(e) {
1728
1767
  return typeof e === "undefined";
1729
1768
  }
1730
- function effect(e, t, n, i, r) {
1731
- let s = false;
1732
- const o = computed(r?.render ? t => staleValues(() => e(t)) : e, i, {
1733
- ...r,
1769
+ function effect(e, t, n, i) {
1770
+ let r = false;
1771
+ const s = !!i?.user;
1772
+ const o = computed(s ? e : t => staleValues(() => e(t)), {
1773
+ ...i,
1734
1774
  equals: () => {
1735
- o.H = !o.fe;
1736
- if (s) o.F.enqueue(o.W, runEffect.bind(o));
1775
+ o.j = !o.Ee;
1776
+ if (r) o.$.enqueue(o.F, runEffect.bind(o));
1737
1777
  return false;
1738
1778
  },
1739
1779
  lazy: true
1740
1780
  });
1741
- o.Qe = i;
1742
- o.Me = t;
1781
+ o.Qe = undefined;
1782
+ o.Fe = t;
1743
1783
  o.je = n;
1744
1784
  o.$e = undefined;
1745
- o.W = r?.render ? EFFECT_RENDER : EFFECT_USER;
1746
- o.Ge = (e, t) => {
1747
- const n = e !== undefined ? e : o.Se;
1748
- const i = t !== undefined ? t : o.fe;
1785
+ o.F = s ? EFFECT_USER : EFFECT_RENDER;
1786
+ o.xe = (e, t) => {
1787
+ const n = e !== undefined ? e : o.Re;
1788
+ const i = t !== undefined ? t : o.Ee;
1749
1789
  if (n & STATUS_ERROR) {
1750
1790
  let e = i;
1751
- o.F.notify(o, STATUS_PENDING, 0);
1752
- if (o.W === EFFECT_USER) {
1791
+ o.$.notify(o, STATUS_PENDING, 0);
1792
+ if (o.F === EFFECT_USER) {
1753
1793
  try {
1754
1794
  return o.je
1755
1795
  ? o.je(e, () => {
@@ -1761,38 +1801,39 @@ function effect(e, t, n, i, r) {
1761
1801
  e = t;
1762
1802
  }
1763
1803
  }
1764
- if (!o.F.notify(o, STATUS_ERROR, STATUS_ERROR)) throw e;
1765
- } else if (o.W === EFFECT_RENDER) {
1766
- o.F.notify(o, STATUS_PENDING | STATUS_ERROR, n, i);
1804
+ if (!o.$.notify(o, STATUS_ERROR, STATUS_ERROR)) throw e;
1805
+ } else if (o.F === EFFECT_RENDER) {
1806
+ o.$.notify(o, STATUS_PENDING | STATUS_ERROR, n, i);
1767
1807
  }
1768
1808
  };
1769
1809
  recompute(o, true);
1770
- !r?.defer && (o.W === EFFECT_USER ? o.F.enqueue(o.W, runEffect.bind(o)) : runEffect.call(o));
1771
- s = true;
1810
+ !i?.defer &&
1811
+ (o.F === EFFECT_USER || i?.schedule ? o.$.enqueue(o.F, runEffect.bind(o)) : runEffect.call(o));
1812
+ r = true;
1772
1813
  cleanup(() => o.$e?.());
1773
1814
  }
1774
1815
  function runEffect() {
1775
- if (!this.H || this.O & REACTIVE_DISPOSED) return;
1816
+ if (!this.j || this.O & REACTIVE_DISPOSED) return;
1776
1817
  this.$e?.();
1777
1818
  this.$e = undefined;
1778
1819
  try {
1779
- const e = this.Me(this.J, this.Qe);
1820
+ const e = this.Fe(this.te, this.Qe);
1780
1821
  if (false && e !== undefined && typeof e !== "function");
1781
1822
  this.$e = e;
1782
1823
  } catch (e) {
1783
- this.fe = new StatusError(this, e);
1784
- this.Se |= STATUS_ERROR;
1785
- if (!this.F.notify(this, STATUS_ERROR, STATUS_ERROR)) throw e;
1824
+ this.Ee = new StatusError(this, e);
1825
+ this.Re |= STATUS_ERROR;
1826
+ if (!this.$.notify(this, STATUS_ERROR, STATUS_ERROR)) throw e;
1786
1827
  } finally {
1787
- this.Qe = this.J;
1788
- this.H = false;
1828
+ this.Qe = this.te;
1829
+ this.j = false;
1789
1830
  }
1790
1831
  }
1791
1832
  function trackedEffect(e, t) {
1792
1833
  const run = () => {
1793
- if (!n.H || n.O & REACTIVE_DISPOSED) return;
1834
+ if (!n.j || n.O & REACTIVE_DISPOSED) return;
1794
1835
  try {
1795
- n.H = false;
1836
+ n.j = false;
1796
1837
  recompute(n);
1797
1838
  } finally {
1798
1839
  }
@@ -1804,23 +1845,22 @@ function trackedEffect(e, t) {
1804
1845
  const t = staleValues(e);
1805
1846
  n.$e = t;
1806
1847
  },
1807
- undefined,
1808
1848
  { ...t, lazy: true }
1809
1849
  );
1810
1850
  n.$e = undefined;
1811
1851
  n.Ke = true;
1812
- n.H = true;
1813
- n.W = EFFECT_TRACKED;
1814
- n.Ge = (e, t) => {
1815
- const i = e !== undefined ? e : n.Se;
1852
+ n.j = true;
1853
+ n.F = EFFECT_TRACKED;
1854
+ n.xe = (e, t) => {
1855
+ const i = e !== undefined ? e : n.Re;
1816
1856
  if (i & STATUS_ERROR) {
1817
- n.F.notify(n, STATUS_PENDING, 0);
1818
- const e = t !== undefined ? t : n.fe;
1819
- if (!n.F.notify(n, STATUS_ERROR, STATUS_ERROR)) throw e;
1857
+ n.$.notify(n, STATUS_PENDING, 0);
1858
+ const e = t !== undefined ? t : n.Ee;
1859
+ if (!n.$.notify(n, STATUS_ERROR, STATUS_ERROR)) throw e;
1820
1860
  }
1821
1861
  };
1822
- n.M = run;
1823
- n.F.enqueue(EFFECT_USER, run);
1862
+ n.K = run;
1863
+ n.$.enqueue(EFFECT_USER, run);
1824
1864
  cleanup(() => n.$e?.());
1825
1865
  }
1826
1866
  function restoreTransition(e, t) {
@@ -1835,11 +1875,11 @@ function action(e) {
1835
1875
  const r = e(...t);
1836
1876
  globalQueue.initTransition();
1837
1877
  let s = activeTransition;
1838
- s.$.push(r);
1878
+ s.Z.push(r);
1839
1879
  const done = (e, t) => {
1840
1880
  s = currentTransition(s);
1841
- const o = s.$.indexOf(r);
1842
- if (o >= 0) s.$.splice(o, 1);
1881
+ const o = s.Z.indexOf(r);
1882
+ if (o >= 0) s.Z.splice(o, 1);
1843
1883
  setActiveTransition(s);
1844
1884
  schedule();
1845
1885
  t ? i(t) : n(e);
@@ -1875,23 +1915,24 @@ function accessor(e) {
1875
1915
  t.$r = true;
1876
1916
  return t;
1877
1917
  }
1878
- function createSignal(e, t, n) {
1918
+ function createSignal(e, t) {
1879
1919
  if (typeof e === "function") {
1880
- const i = computed(e, t, n);
1881
- return [accessor(i), setSignal.bind(null, i)];
1920
+ const n = computed(e, t);
1921
+ n.Pe = true;
1922
+ return [accessor(n), setSignal.bind(null, n)];
1882
1923
  }
1883
- const i = signal(e, t);
1884
- return [accessor(i), setSignal.bind(null, i)];
1924
+ const n = signal(e, t);
1925
+ return [accessor(n), setSignal.bind(null, n)];
1885
1926
  }
1886
- function createMemo(e, t, n) {
1887
- let i = computed(e, t, n);
1888
- return accessor(i);
1927
+ function createMemo(e, t) {
1928
+ let n = computed(e, t);
1929
+ return accessor(n);
1889
1930
  }
1890
- function createEffect(e, t, n, i) {
1891
- effect(e, t.effect || t, t.error, n, i);
1931
+ function createEffect(e, t, n) {
1932
+ effect(e, t.effect || t, t.error, { user: true, ...n });
1892
1933
  }
1893
- function createRenderEffect(e, t, n, i) {
1894
- effect(e, t, undefined, n, { render: true, ...i });
1934
+ function createRenderEffect(e, t, n) {
1935
+ effect(e, t, undefined, n);
1895
1936
  }
1896
1937
  function createTrackedEffect(e, t) {
1897
1938
  trackedEffect(e, t);
@@ -1912,8 +1953,7 @@ function createReaction(e, t) {
1912
1953
  dispose(t);
1913
1954
  },
1914
1955
  e.error,
1915
- undefined,
1916
- { defer: true, ...(false ? { ...t, name: t?.name ?? "effect" } : t) }
1956
+ { ...(false ? { ...t, name: t?.name ?? "effect" } : t), user: true, defer: true }
1917
1957
  );
1918
1958
  });
1919
1959
  };
@@ -1933,13 +1973,14 @@ function resolve(e) {
1933
1973
  });
1934
1974
  });
1935
1975
  }
1936
- function createOptimistic(e, t, n) {
1976
+ function createOptimistic(e, t) {
1937
1977
  if (typeof e === "function") {
1938
- const i = optimisticComputed(e, t, n);
1939
- return [accessor(i), setSignal.bind(null, i)];
1978
+ const n = optimisticComputed(e, t);
1979
+ n.Pe = true;
1980
+ return [accessor(n), setSignal.bind(null, n)];
1940
1981
  }
1941
- const i = optimisticSignal(e, t);
1942
- return [accessor(i), setSignal.bind(null, i)];
1982
+ const n = optimisticSignal(e, t);
1983
+ return [accessor(n), setSignal.bind(null, n)];
1943
1984
  }
1944
1985
  function onSettled(e) {
1945
1986
  const t = getOwner();
@@ -2086,7 +2127,7 @@ function reconcile(e, t) {
2086
2127
  applyState(e, n, i);
2087
2128
  };
2088
2129
  }
2089
- function createProjectionInternal(e, t = {}, n) {
2130
+ function createProjectionInternal(e, t, n) {
2090
2131
  let i;
2091
2132
  const r = new WeakMap();
2092
2133
  const wrapper = e => {
@@ -2108,28 +2149,35 @@ function createProjectionInternal(e, t = {}, n) {
2108
2149
  };
2109
2150
  const s = wrapProjection(t);
2110
2151
  i = computed(() => {
2111
- const t = getOwner();
2112
- let i = false;
2113
- let r;
2114
- const o = new Proxy(
2115
- s,
2116
- createWriteTraps(() => !i || t.ye === r)
2117
- );
2118
- storeSetter(o, o => {
2119
- r = e(o);
2120
- i = true;
2121
- const u = handleAsync(t, r, e => {
2122
- e !== o && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id"));
2123
- });
2124
- u !== o && u !== undefined && reconcile(u, n?.key || "id")(s);
2125
- });
2126
- });
2152
+ if (!i) i = getOwner();
2153
+ runProjectionComputed(s, e, n?.key || "id");
2154
+ }, undefined);
2127
2155
  i.Pe = true;
2128
2156
  return { store: s, node: i };
2129
2157
  }
2130
- function createProjection(e, t = {}, n) {
2158
+ function createProjection(e, t, n) {
2131
2159
  return createProjectionInternal(e, t, n).store;
2132
2160
  }
2161
+ function runProjectionComputed(e, t, n, i) {
2162
+ const r = getOwner();
2163
+ let s = false;
2164
+ let o;
2165
+ const u = new Proxy(
2166
+ e,
2167
+ createWriteTraps(() => !s || r.ye === o)
2168
+ );
2169
+ storeSetter(u, u => {
2170
+ o = t(u);
2171
+ s = true;
2172
+ const commit = t => {
2173
+ if (t === u || t === undefined) return;
2174
+ const write = () => storeSetter(e, reconcile(t, n));
2175
+ i ? i(write) : write();
2176
+ };
2177
+ commit(handleAsync(r, o, commit));
2178
+ });
2179
+ return r;
2180
+ }
2133
2181
  function createWriteTraps(e) {
2134
2182
  const t = {
2135
2183
  get(e, n) {
@@ -2239,17 +2287,17 @@ function getNode(e, t, n, i, r = isEqual, s, o) {
2239
2287
  {
2240
2288
  equals: r,
2241
2289
  unobserved() {
2242
- delete e[t];
2290
+ if (e[t] === u) delete e[t];
2243
2291
  }
2244
2292
  },
2245
2293
  i
2246
2294
  );
2247
2295
  if (s) {
2248
- u.ee = NOT_PENDING;
2296
+ u.k = NOT_PENDING;
2249
2297
  }
2250
2298
  if (o && t in o) {
2251
2299
  const e = o[t];
2252
- u.de = e === undefined ? NO_SNAPSHOT : e;
2300
+ u.Te = e === undefined ? NO_SNAPSHOT : e;
2253
2301
  snapshotSources?.add(u);
2254
2302
  }
2255
2303
  return (e[t] = u);
@@ -2282,8 +2330,8 @@ function getPropertyDescriptor(e, t, n) {
2282
2330
  function prepareStoreWrite(e, t, n) {
2283
2331
  if (e[STORE_OPTIMISTIC]) {
2284
2332
  const t = e[STORE_FIREWALL];
2285
- if (t?.K) {
2286
- globalQueue.initTransition(t.K);
2333
+ if (t?.B) {
2334
+ globalQueue.initTransition(t.B);
2287
2335
  }
2288
2336
  }
2289
2337
  const i = e[STORE_VALUE];
@@ -2291,7 +2339,7 @@ function prepareStoreWrite(e, t, n) {
2291
2339
  if (
2292
2340
  snapshotCaptureActive &&
2293
2341
  typeof n !== "symbol" &&
2294
- !((e[STORE_FIREWALL]?.Se ?? 0) & STATUS_PENDING)
2342
+ !((e[STORE_FIREWALL]?.Re ?? 0) & STATUS_PENDING)
2295
2343
  ) {
2296
2344
  if (!e[STORE_SNAPSHOT_PROPS]) {
2297
2345
  e[STORE_SNAPSHOT_PROPS] = Object.create(null);
@@ -2306,20 +2354,45 @@ function prepareStoreWrite(e, t, n) {
2306
2354
  if (s) trackOptimisticStore(t);
2307
2355
  return { base: r, overrideKey: o, state: i };
2308
2356
  }
2309
- function notifyStoreProperty(e, t, n, i) {
2310
- if (e[STORE_HAS]?.[t]) setSignal(e[STORE_HAS][t], n !== "delete");
2311
- const r = getNodes(e, STORE_NODE);
2357
+ function upsertStoreNode(e, t, n, i, r) {
2358
+ if (t[n]) return t[n];
2359
+ const s = isWrappable(i) ? wrap(i, e) : i;
2360
+ const o = getNode(t, n, s, e[STORE_FIREWALL], isEqual, e[STORE_OPTIMISTIC], r);
2361
+ registerTransientStoreNode(o);
2362
+ return o;
2363
+ }
2364
+ function notifyStoreProperty(e, t, n, i, r, s) {
2365
+ const o = projectionWriteActive || e[STORE_OPTIMISTIC];
2366
+ const u = n !== "delete";
2367
+ const c = e[STORE_HAS]?.[t];
2368
+ if (c) {
2369
+ setSignal(c, u);
2370
+ } else if (!o && n !== "invalidate" && s !== u) {
2371
+ const n = upsertStoreNode(e, getNodes(e, STORE_HAS), t, s);
2372
+ setSignal(n, u);
2373
+ }
2374
+ const a = getNodes(e, STORE_NODE);
2312
2375
  if (n === "set") {
2313
- r[t] && setSignal(r[t], () => (isWrappable(i) ? wrap(i, e) : i));
2376
+ if (a[t]) {
2377
+ setSignal(a[t], () => (isWrappable(i) ? wrap(i, e) : i));
2378
+ } else if (!o) {
2379
+ const n = upsertStoreNode(e, a, t, r, e[STORE_SNAPSHOT_PROPS]);
2380
+ setSignal(n, () => (isWrappable(i) ? wrap(i, e) : i));
2381
+ }
2314
2382
  } else if (n === "invalidate") {
2315
- if (r[t]) {
2316
- setSignal(r[t], {});
2317
- delete r[t];
2383
+ if (a[t]) {
2384
+ setSignal(a[t], {});
2385
+ delete a[t];
2318
2386
  }
2319
2387
  } else {
2320
- r[t] && setSignal(r[t], undefined);
2388
+ if (a[t]) {
2389
+ setSignal(a[t], undefined);
2390
+ } else if (!o) {
2391
+ const n = upsertStoreNode(e, a, t, r, e[STORE_SNAPSHOT_PROPS]);
2392
+ setSignal(n, undefined);
2393
+ }
2321
2394
  }
2322
- r[$TRACK] && setSignal(r[$TRACK], undefined);
2395
+ a[$TRACK] && setSignal(a[$TRACK], undefined);
2323
2396
  }
2324
2397
  let Writing = null;
2325
2398
  const storeTraps = {
@@ -2348,11 +2421,11 @@ const storeTraps = {
2348
2421
  if (writeOnly(n)) {
2349
2422
  let n =
2350
2423
  r && (o || !u)
2351
- ? r.ee !== undefined && r.ee !== NOT_PENDING
2352
- ? r.ee
2353
- : r.X !== NOT_PENDING
2354
- ? r.X
2355
- : r.J
2424
+ ? r.k !== undefined && r.k !== NOT_PENDING
2425
+ ? r.k
2426
+ : r.U !== NOT_PENDING
2427
+ ? r.U
2428
+ : r.te
2356
2429
  : c[t];
2357
2430
  n === $DELETED && (n = undefined);
2358
2431
  if (!isWrappable(n)) return n;
@@ -2394,11 +2467,11 @@ const storeTraps = {
2394
2467
  : e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]
2395
2468
  ? e[STORE_OVERRIDE][t] !== $DELETED
2396
2469
  : t in e[STORE_VALUE];
2397
- if (!writeOnly(e[$PROXY])) {
2398
- getObserver() &&
2399
- read(
2400
- getNode(getNodes(e, STORE_HAS), t, n, e[STORE_FIREWALL], isEqual, e[STORE_OPTIMISTIC])
2401
- );
2470
+ if (writeOnly(e[$PROXY])) return n;
2471
+ const i = getNodes(e, STORE_HAS);
2472
+ if (i[t]) return read(i[t]);
2473
+ if (getObserver()) {
2474
+ return read(getNode(i, t, n, e[STORE_FIREWALL], isEqual, e[STORE_OPTIMISTIC]));
2402
2475
  }
2403
2476
  return n;
2404
2477
  },
@@ -2413,29 +2486,39 @@ const storeTraps = {
2413
2486
  : e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]
2414
2487
  ? e[STORE_OVERRIDE][t]
2415
2488
  : r;
2416
- const c = n?.[$TARGET]?.[STORE_VALUE] ?? n;
2417
- const a = Array.isArray(o) && t !== "length";
2418
- const l = a ? parseInt(t) + 1 : 0;
2419
- const f =
2420
- a &&
2489
+ const c =
2490
+ e[STORE_OPTIMISTIC_OVERRIDE] && t in e[STORE_OPTIMISTIC_OVERRIDE]
2491
+ ? e[STORE_OPTIMISTIC_OVERRIDE][t] !== $DELETED
2492
+ : e[STORE_OVERRIDE] && t in e[STORE_OVERRIDE]
2493
+ ? e[STORE_OVERRIDE][t] !== $DELETED
2494
+ : t in e[STORE_VALUE];
2495
+ const a = n?.[$TARGET]?.[STORE_VALUE] ?? n;
2496
+ const l = Array.isArray(o) && t !== "length";
2497
+ const f = l ? parseInt(t) + 1 : 0;
2498
+ const E =
2499
+ l &&
2421
2500
  (e[STORE_OPTIMISTIC_OVERRIDE] && "length" in e[STORE_OPTIMISTIC_OVERRIDE]
2422
2501
  ? e[STORE_OPTIMISTIC_OVERRIDE].length
2423
2502
  : e[STORE_OVERRIDE] && "length" in e[STORE_OVERRIDE]
2424
2503
  ? e[STORE_OVERRIDE].length
2425
2504
  : o.length);
2426
- const E = a && l > f ? l : undefined;
2427
- if (u === c && E === undefined) return true;
2428
- if (c !== undefined && c === r && E === undefined) delete e[s]?.[t];
2505
+ const d = l && f > E ? f : undefined;
2506
+ if (u === a && d === undefined) return true;
2507
+ if (a !== undefined && a === r && d === undefined) delete e[s]?.[t];
2429
2508
  else {
2430
2509
  const n = e[s] || (e[s] = Object.create(null));
2431
- n[t] = c;
2432
- if (E !== undefined) n.length = E;
2510
+ n[t] = a;
2511
+ if (d !== undefined) n.length = d;
2433
2512
  }
2434
- notifyStoreProperty(e, t, "set", c);
2435
- if (Array.isArray(o)) {
2436
- const n = getNodes(e, STORE_NODE);
2437
- const i = t === "length" ? c : E;
2438
- i !== undefined && n.length && setSignal(n.length, i);
2513
+ notifyStoreProperty(e, t, "set", a, u, c);
2514
+ if (Array.isArray(o) && t !== "length" && d !== undefined) {
2515
+ const t = getNodes(e, STORE_NODE);
2516
+ if (t.length) {
2517
+ setSignal(t.length, d);
2518
+ } else if (!projectionWriteActive && !e[STORE_OPTIMISTIC]) {
2519
+ const n = upsertStoreNode(e, t, "length", E, e[STORE_SNAPSHOT_PROPS]);
2520
+ setSignal(n, d);
2521
+ }
2439
2522
  }
2440
2523
  if (false);
2441
2524
  });
@@ -2474,7 +2557,7 @@ const storeTraps = {
2474
2557
  } else if (e[i] && t in e[i]) {
2475
2558
  delete e[i][t];
2476
2559
  } else return true;
2477
- notifyStoreProperty(e, t, "delete");
2560
+ notifyStoreProperty(e, t, "delete", undefined, r, true);
2478
2561
  });
2479
2562
  }
2480
2563
  return true;
@@ -2544,9 +2627,9 @@ function createStore(e, t, n) {
2544
2627
  return [r, e => storeSetter(r, e)];
2545
2628
  }
2546
2629
  function createOptimisticStore(e, t, n) {
2547
- GlobalQueue.ce ||= clearOptimisticStore;
2630
+ GlobalQueue.ae ||= clearOptimisticStore;
2548
2631
  const i = typeof e === "function";
2549
- const r = (i ? t : e) ?? {};
2632
+ const r = i ? t : e;
2550
2633
  const s = i ? e : undefined;
2551
2634
  const { store: o } = createOptimisticProjectionInternal(s, r, n);
2552
2635
  return [o, e => storeSetter(o, e)];
@@ -2561,7 +2644,7 @@ function clearOptimisticStore(e) {
2561
2644
  if (i) {
2562
2645
  for (const e of Reflect.ownKeys(n)) {
2563
2646
  if (i[e]) {
2564
- i[e].q = undefined;
2647
+ i[e].ee = undefined;
2565
2648
  const n =
2566
2649
  t[STORE_OVERRIDE] && e in t[STORE_OVERRIDE] ? t[STORE_OVERRIDE][e] : t[STORE_VALUE][e];
2567
2650
  const r = n === $DELETED ? undefined : n;
@@ -2569,7 +2652,7 @@ function clearOptimisticStore(e) {
2569
2652
  }
2570
2653
  }
2571
2654
  if (i[$TRACK]) {
2572
- i[$TRACK].q = undefined;
2655
+ i[$TRACK].ee = undefined;
2573
2656
  setSignal(i[$TRACK], undefined);
2574
2657
  }
2575
2658
  }
@@ -2578,7 +2661,7 @@ function clearOptimisticStore(e) {
2578
2661
  }
2579
2662
  delete t[STORE_OPTIMISTIC_OVERRIDE];
2580
2663
  }
2581
- function createOptimisticProjectionInternal(e, t = {}, n) {
2664
+ function createOptimisticProjectionInternal(e, t, n) {
2582
2665
  let i;
2583
2666
  const r = new WeakMap();
2584
2667
  const wrapper = e => {
@@ -2601,33 +2684,22 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
2601
2684
  };
2602
2685
  const s = wrapProjection(t);
2603
2686
  if (e) {
2687
+ const wrapCommit = e => {
2688
+ setProjectionWriteActive(true);
2689
+ try {
2690
+ e();
2691
+ } finally {
2692
+ setProjectionWriteActive(false);
2693
+ }
2694
+ };
2604
2695
  i = computed(() => {
2605
- const t = getOwner();
2606
- let i = false;
2607
- let r;
2608
- const o = new Proxy(
2609
- s,
2610
- createWriteTraps(() => !i || t.ye === r)
2611
- );
2612
2696
  setProjectionWriteActive(true);
2613
2697
  try {
2614
- storeSetter(o, o => {
2615
- r = e(o);
2616
- i = true;
2617
- const u = handleAsync(t, r, e => {
2618
- setProjectionWriteActive(true);
2619
- try {
2620
- e !== o && e !== undefined && storeSetter(s, reconcile(e, n?.key || "id"));
2621
- } finally {
2622
- setProjectionWriteActive(false);
2623
- }
2624
- });
2625
- u !== o && u !== undefined && reconcile(u, n?.key || "id")(s);
2626
- });
2698
+ runProjectionComputed(s, e, n?.key || "id", wrapCommit);
2627
2699
  } finally {
2628
2700
  setProjectionWriteActive(false);
2629
2701
  }
2630
- });
2702
+ }, undefined);
2631
2703
  i.Pe = true;
2632
2704
  }
2633
2705
  return { store: s, node: i };
@@ -2888,7 +2960,7 @@ function mapArray(e, t, n) {
2888
2960
  const i = typeof n?.keyed === "function" ? n.keyed : undefined;
2889
2961
  const r = t.length > 1;
2890
2962
  const s = t;
2891
- return createMemo(
2963
+ const o = computed(
2892
2964
  updateKeyedMap.bind({
2893
2965
  Ye: createOwner(),
2894
2966
  Ze: 0,
@@ -2903,8 +2975,10 @@ function mapArray(e, t, n) {
2903
2975
  it: n?.fallback
2904
2976
  })
2905
2977
  );
2978
+ o.Pe = true;
2979
+ return accessor(o);
2906
2980
  }
2907
- const pureOptions = { pureWrite: true };
2981
+ const pureOptions = { ownedWrite: true };
2908
2982
  function updateKeyedMap() {
2909
2983
  const e = this.Be() || [],
2910
2984
  t = e.length;
@@ -3026,17 +3100,21 @@ function updateKeyedMap() {
3026
3100
  }
3027
3101
  function repeat(e, t, n) {
3028
3102
  const i = t;
3029
- return updateRepeat.bind({
3030
- Ye: createOwner(),
3031
- Ze: 0,
3032
- rt: 0,
3033
- st: e,
3034
- Xe: i,
3035
- Je: [],
3036
- ze: [],
3037
- ot: n?.from,
3038
- it: n?.fallback
3039
- });
3103
+ const r = computed(
3104
+ updateRepeat.bind({
3105
+ Ye: createOwner(),
3106
+ Ze: 0,
3107
+ rt: 0,
3108
+ st: e,
3109
+ Xe: i,
3110
+ Je: [],
3111
+ ze: [],
3112
+ ot: n?.from,
3113
+ it: n?.fallback
3114
+ })
3115
+ );
3116
+ r.Pe = true;
3117
+ return accessor(r);
3040
3118
  }
3041
3119
  function updateRepeat() {
3042
3120
  const e = this.st();
@@ -3089,12 +3167,12 @@ function compare(e, t, n) {
3089
3167
  return e ? e(t) === e(n) : true;
3090
3168
  }
3091
3169
  function boundaryComputed(e, t) {
3092
- const n = computed(e, undefined, { lazy: true });
3093
- n.Ge = (e, t) => {
3094
- const i = e !== undefined ? e : n.Se;
3095
- const r = t !== undefined ? t : n.fe;
3096
- n.Se &= ~n.ut;
3097
- n.F.notify(n, n.ut, i, r);
3170
+ const n = computed(e, { lazy: true });
3171
+ n.xe = (e, t) => {
3172
+ const i = e !== undefined ? e : n.Re;
3173
+ const r = t !== undefined ? t : n.Ee;
3174
+ n.Re &= ~n.ut;
3175
+ n.$.notify(n, n.ut, i, r);
3098
3176
  };
3099
3177
  n.ut = t;
3100
3178
  n.Pe = true;
@@ -3102,9 +3180,9 @@ function boundaryComputed(e, t) {
3102
3180
  return n;
3103
3181
  }
3104
3182
  function createBoundChildren(e, t, n, i) {
3105
- const r = e.F;
3106
- r.addChild((e.F = n));
3107
- cleanup(() => r.removeChild(e.F));
3183
+ const r = e.$;
3184
+ r.addChild((e.$ = n));
3185
+ cleanup(() => r.removeChild(e.$));
3108
3186
  return runWithOwner(e, () => {
3109
3187
  const e = computed(t);
3110
3188
  return boundaryComputed(() => staleValues(() => flatten(read(e))), i);
@@ -3114,12 +3192,16 @@ const ON_INIT = Symbol();
3114
3192
  const RevealControllerContext = createContext(null);
3115
3193
  let _revealUsed = false;
3116
3194
  const FALSE_ACCESSOR = () => false;
3195
+ const SEQUENTIAL_ACCESSOR = () => "sequential";
3117
3196
  function isRevealController(e) {
3118
3197
  return e instanceof RevealController;
3119
3198
  }
3120
3199
  function isSlotReady(e) {
3121
3200
  return isRevealController(e) ? e.isReady() : e.ct.size === 0 && !e.lt;
3122
3201
  }
3202
+ function isSlotMinimallyReady(e) {
3203
+ return isRevealController(e) ? e.isMinimallyReady() : isSlotReady(e);
3204
+ }
3123
3205
  function setSlotState(e, t, n, i) {
3124
3206
  setSignal(e.ft, n);
3125
3207
  setSignal(e.Et, i);
@@ -3134,15 +3216,16 @@ class RevealController {
3134
3216
  Ot;
3135
3217
  _t = [];
3136
3218
  dt;
3137
- ft = signal(false, { pureWrite: true, He: true });
3138
- Et = signal(false, { pureWrite: true, He: true });
3219
+ ft = signal(false, { ownedWrite: true, He: true });
3220
+ Et = signal(false, { ownedWrite: true, He: true });
3139
3221
  It = true;
3140
- ht = false;
3222
+ ht = true;
3223
+ At = false;
3141
3224
  constructor(e, t) {
3142
3225
  this.Rt = e;
3143
3226
  this.Ot = t;
3144
3227
  }
3145
- At(e) {
3228
+ Nt(e) {
3146
3229
  for (let t = 0; t < this._t.length; t++) {
3147
3230
  const n = this._t[t];
3148
3231
  if ((isRevealController(n) ? n.dt : n.Tt) !== this) continue;
@@ -3151,13 +3234,35 @@ class RevealController {
3151
3234
  return true;
3152
3235
  }
3153
3236
  isReady() {
3154
- return this.At(isSlotReady);
3237
+ return this.Nt(isSlotReady);
3238
+ }
3239
+ isMinimallyReady() {
3240
+ const e = untrack(this.Rt);
3241
+ if (e === "together") return this.isReady();
3242
+ if (e === "natural") {
3243
+ let e = false;
3244
+ let t = false;
3245
+ this.Nt(n => {
3246
+ e = true;
3247
+ if (isSlotMinimallyReady(n)) {
3248
+ t = true;
3249
+ return false;
3250
+ }
3251
+ });
3252
+ return !e || t;
3253
+ }
3254
+ let t = true;
3255
+ this.Nt(e => {
3256
+ t = isSlotMinimallyReady(e);
3257
+ return false;
3258
+ });
3259
+ return t;
3155
3260
  }
3156
3261
  register(e) {
3157
3262
  if (this._t.includes(e)) return;
3158
3263
  this._t.push(e);
3159
- const t = !!untrack(this.Rt);
3160
- setSignal(e.ft, true), setSignal(e.Et, t ? false : !!untrack(this.Ot));
3264
+ const t = untrack(this.Rt);
3265
+ (setSignal(e.ft, true), setSignal(e.Et, t === "sequential" ? !!untrack(this.Ot) : false));
3161
3266
  untrack(() => this.evaluate());
3162
3267
  }
3163
3268
  unregister(e) {
@@ -3166,103 +3271,123 @@ class RevealController {
3166
3271
  untrack(() => this.evaluate());
3167
3272
  }
3168
3273
  evaluate(e, t) {
3169
- if (this.ht) return;
3170
- this.ht = true;
3274
+ if (this.At) return;
3275
+ this.At = true;
3171
3276
  const n = this.It;
3277
+ const i = this.ht;
3172
3278
  try {
3173
3279
  const n = e ?? read(this.ft),
3174
- i = !!untrack(this.Ot),
3175
- r = t ?? i;
3176
- if (n && r) this.At(e => setSlotState(e, this, true, true));
3177
- else if (!!untrack(this.Rt)) {
3178
- const e = this.isReady();
3179
- this.At(t => setSlotState(t, this, !e, false));
3280
+ i = untrack(this.Rt),
3281
+ r = i === "sequential" && !!untrack(this.Ot),
3282
+ s = t ?? r;
3283
+ if (n) {
3284
+ this.Nt(e => setSlotState(e, this, true, s));
3285
+ } else if (i === "natural") {
3286
+ this.Nt(e => {
3287
+ if (isRevealController(e)) {
3288
+ setSignal(e.Et, false);
3289
+ setSignal(e.ft, false);
3290
+ e.evaluate(false, false);
3291
+ } else {
3292
+ setSlotState(e, this, !isSlotReady(e), false);
3293
+ }
3294
+ });
3295
+ } else if (i === "together") {
3296
+ const e = this.Nt(isSlotMinimallyReady);
3297
+ this.Nt(t => setSlotState(t, this, !e, false));
3180
3298
  } else {
3181
3299
  let e = false;
3182
- this.At(t => {
3183
- if (e) return setSlotState(t, this, true, i);
3300
+ this.Nt(t => {
3301
+ if (e) return setSlotState(t, this, true, r);
3184
3302
  if (isSlotReady(t)) return setSlotState(t, this, false, false);
3185
3303
  e = true;
3186
- setSlotState(t, this, true, false);
3304
+ if (isRevealController(t)) {
3305
+ setSignal(t.Et, false);
3306
+ setSignal(t.ft, false);
3307
+ t.evaluate(false, false);
3308
+ } else {
3309
+ setSlotState(t, this, true, false);
3310
+ }
3187
3311
  });
3188
3312
  }
3189
3313
  } finally {
3190
3314
  this.It = this.isReady();
3191
- this.ht = false;
3315
+ this.ht = this.isMinimallyReady();
3316
+ this.At = false;
3192
3317
  }
3193
- if (this.dt && n !== this.It) this.dt.evaluate();
3318
+ if (this.dt && (n !== this.It || i !== this.ht)) this.dt.evaluate();
3194
3319
  }
3195
3320
  }
3196
3321
  class CollectionQueue extends Queue {
3197
- Nt;
3198
- ct = new Set();
3199
3322
  Pt;
3323
+ ct = new Set();
3324
+ gt;
3200
3325
  lt = true;
3201
- ft = signal(false, { pureWrite: true, He: true });
3202
- Et = signal(false, { pureWrite: true, He: true });
3326
+ ft = signal(false, { ownedWrite: true, He: true });
3327
+ Et = signal(false, { ownedWrite: true, He: true });
3203
3328
  Tt;
3204
3329
  St = false;
3205
- gt;
3206
- Ct = ON_INIT;
3330
+ Ct;
3331
+ Dt = ON_INIT;
3207
3332
  constructor(e) {
3208
3333
  super();
3209
- this.Nt = e;
3334
+ this.Pt = e;
3210
3335
  }
3211
3336
  run(e) {
3212
3337
  if (!e || (read(this.ft) && (!_revealUsed || read(this.Et)))) return;
3213
3338
  return super.run(e);
3214
3339
  }
3215
3340
  notify(e, t, n, i) {
3216
- if (!(t & this.Nt)) return super.notify(e, t, n, i);
3217
- if (this.St && this.gt) {
3341
+ if (!(t & this.Pt)) return super.notify(e, t, n, i);
3342
+ if (this.St && this.Ct) {
3218
3343
  const e = untrack(() => {
3219
3344
  try {
3220
- return this.gt();
3345
+ return this.Ct();
3221
3346
  } catch {
3222
3347
  return ON_INIT;
3223
3348
  }
3224
3349
  });
3225
- if (e !== this.Ct) {
3226
- this.Ct = e;
3350
+ if (e !== this.Dt) {
3351
+ this.Dt = e;
3227
3352
  this.St = false;
3228
3353
  this.ct.clear();
3229
3354
  }
3230
3355
  }
3231
- if (this.Nt & STATUS_PENDING && this.St) return super.notify(e, t, n, i);
3232
- if (this.Nt & STATUS_PENDING && n & STATUS_ERROR) {
3356
+ if (this.Pt & STATUS_PENDING && this.St) return super.notify(e, t, n, i);
3357
+ if (this.Pt & STATUS_PENDING && n & STATUS_ERROR) {
3233
3358
  return super.notify(e, STATUS_ERROR, n, i);
3234
3359
  }
3235
- if (n & this.Nt) {
3360
+ if (n & this.Pt) {
3236
3361
  this.lt = true;
3237
- const t = i?.source || e.fe?.source;
3362
+ const t = i?.source || e.Ee?.source;
3238
3363
  if (t) {
3239
3364
  const e = this.ct.size === 0;
3240
3365
  this.ct.add(t);
3241
3366
  if (e) setSignal(this.ft, true);
3242
3367
  }
3243
3368
  }
3244
- t &= ~this.Nt;
3369
+ t &= ~this.Pt;
3245
3370
  return t ? super.notify(e, t, n, i) : true;
3246
3371
  }
3247
3372
  checkSources() {
3248
3373
  for (const e of this.ct) {
3249
3374
  if (
3250
3375
  e.O & REACTIVE_DISPOSED ||
3251
- (!(e.Se & this.Nt) && !(this.Nt & STATUS_ERROR && e.Se & STATUS_PENDING))
3376
+ (!(e.Re & this.Pt) && !(this.Pt & STATUS_ERROR && e.Re & STATUS_PENDING))
3252
3377
  )
3253
3378
  this.ct.delete(e);
3254
3379
  }
3255
3380
  if (!this.ct.size) {
3256
- if (this.Nt & STATUS_PENDING && this.lt && !this.St && this.Pt) {
3257
- this.lt = !!(this.Pt.Se & this.Nt);
3381
+ if (this.Pt & STATUS_PENDING && this.lt && !this.St && this.gt) {
3382
+ this.lt = !!(this.gt.Re & this.Pt);
3258
3383
  } else {
3259
3384
  this.lt = false;
3260
3385
  }
3261
3386
  if (!this.lt) {
3262
3387
  setSignal(this.ft, false);
3263
- if (this.gt) {
3388
+ if (this.Ct) {
3264
3389
  try {
3265
- this.Ct = untrack(() => this.gt());
3390
+ this.Dt = untrack(() => this.Ct());
3266
3391
  } catch {}
3267
3392
  }
3268
3393
  }
@@ -3274,8 +3399,8 @@ function createCollectionBoundary(e, t, n, i) {
3274
3399
  const r = createOwner();
3275
3400
  if (_revealUsed) setContext(RevealControllerContext, null, r);
3276
3401
  const s = new CollectionQueue(e);
3277
- if (i) s.gt = i;
3278
- const o = (s.Pt = createBoundChildren(r, t, s, e));
3402
+ if (i) s.Ct = i;
3403
+ const o = (s.gt = createBoundChildren(r, t, s, e));
3279
3404
  untrack(() => {
3280
3405
  let t = false;
3281
3406
  try {
@@ -3284,7 +3409,7 @@ function createCollectionBoundary(e, t, n, i) {
3284
3409
  if (e instanceof NotReadyError) t = true;
3285
3410
  else throw e;
3286
3411
  }
3287
- s.lt = t || !!(o.Se & e) || o.fe instanceof NotReadyError;
3412
+ s.lt = t || !!(o.Re & e) || o.Ee instanceof NotReadyError;
3288
3413
  });
3289
3414
  const u = _revealUsed && e === STATUS_PENDING ? getContext(RevealControllerContext) : null;
3290
3415
  if (u) {
@@ -3295,7 +3420,7 @@ function createCollectionBoundary(e, t, n, i) {
3295
3420
  const c = computed(() => {
3296
3421
  if (!read(s.ft)) {
3297
3422
  const e = read(o);
3298
- if (!untrack(() => read(s.ft))) return (s.St = true), e;
3423
+ if (!untrack(() => read(s.ft))) return ((s.St = true), e);
3299
3424
  }
3300
3425
  if (_revealUsed && read(s.Et)) return undefined;
3301
3426
  return n(s);
@@ -3308,7 +3433,7 @@ function createLoadingBoundary(e, t, n) {
3308
3433
  function createErrorBoundary(e, t) {
3309
3434
  return createCollectionBoundary(STATUS_ERROR, e, e => {
3310
3435
  let n = e.ct.values().next().value;
3311
- const i = n.fe?.cause ?? n.fe;
3436
+ const i = n.Ee?.cause ?? n.Ee;
3312
3437
  return t(i, () => {
3313
3438
  for (const t of e.ct) recompute(t);
3314
3439
  schedule();
@@ -3319,7 +3444,7 @@ function createRevealOrder(e, t) {
3319
3444
  _revealUsed = true;
3320
3445
  const n = createOwner();
3321
3446
  const i = getContext(RevealControllerContext);
3322
- const r = t?.together || FALSE_ACCESSOR,
3447
+ const r = t?.order || SEQUENTIAL_ACCESSOR,
3323
3448
  s = t?.collapsed || FALSE_ACCESSOR;
3324
3449
  const o = new RevealController(r, s);
3325
3450
  setContext(RevealControllerContext, o, n);