@solidjs/signals 0.3.0 → 0.3.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
@@ -46,42 +46,39 @@ function schedule() {
46
46
  if (!globalQueue.J)
47
47
  queueMicrotask(flushSync);
48
48
  }
49
+ var pureQueue = [];
49
50
  var Queue = class {
51
+ o = null;
50
52
  J = false;
51
- s = [[], [], []];
52
- F = [];
53
+ K = [[], []];
54
+ E = [];
53
55
  created = clock;
54
56
  enqueue(type, node) {
55
- this.s[0].push(node);
57
+ pureQueue.push(node);
56
58
  if (type)
57
- this.s[type].push(node);
59
+ this.K[type - 1].push(node);
58
60
  schedule();
59
61
  }
60
62
  run(type) {
61
- if (this.s[type].length) {
62
- if (type === EFFECT_PURE) {
63
- runPureQueue(this.s[type]);
64
- this.s[type] = [];
65
- } else {
66
- const effects = this.s[type];
67
- this.s[type] = [];
68
- runEffectQueue(effects);
69
- }
63
+ if (type === EFFECT_PURE) {
64
+ pureQueue.length && runPureQueue(pureQueue);
65
+ pureQueue = [];
66
+ return;
67
+ } else if (this.K[type - 1].length) {
68
+ const effects = this.K[type - 1];
69
+ this.K[type - 1] = [];
70
+ runEffectQueue(effects);
70
71
  }
71
- let rerun = false;
72
- for (let i = 0; i < this.F.length; i++) {
73
- rerun = this.F[i].run(type) || rerun;
72
+ for (let i = 0; i < this.E.length; i++) {
73
+ this.E[i].run(type);
74
74
  }
75
- if (type === EFFECT_PURE)
76
- return rerun || !!this.s[type].length;
77
75
  }
78
76
  flush() {
79
77
  if (this.J)
80
78
  return;
81
79
  this.J = true;
82
80
  try {
83
- while (this.run(EFFECT_PURE)) {
84
- }
81
+ this.run(EFFECT_PURE);
85
82
  incrementClock();
86
83
  scheduled = false;
87
84
  this.run(EFFECT_RENDER);
@@ -91,12 +88,18 @@ var Queue = class {
91
88
  }
92
89
  }
93
90
  addChild(child) {
94
- this.F.push(child);
91
+ this.E.push(child);
92
+ child.o = this;
95
93
  }
96
94
  removeChild(child) {
97
- const index = this.F.indexOf(child);
95
+ const index = this.E.indexOf(child);
98
96
  if (index >= 0)
99
- this.F.splice(index, 1);
97
+ this.E.splice(index, 1);
98
+ }
99
+ notify(...args) {
100
+ if (this.o)
101
+ return this.o.notify(...args);
102
+ return false;
100
103
  }
101
104
  };
102
105
  var globalQueue = new Queue();
@@ -107,14 +110,14 @@ function flushSync() {
107
110
  }
108
111
  function runTop(node) {
109
112
  const ancestors = [];
110
- for (let current = node; current !== null; current = current.x) {
113
+ for (let current = node; current !== null; current = current.o) {
111
114
  if (current.a !== STATE_CLEAN) {
112
115
  ancestors.push(current);
113
116
  }
114
117
  }
115
118
  for (let i = ancestors.length - 1; i >= 0; i--) {
116
119
  if (ancestors[i].a !== STATE_DISPOSED)
117
- ancestors[i].y();
120
+ ancestors[i].x();
118
121
  }
119
122
  }
120
123
  function runPureQueue(queue) {
@@ -125,7 +128,7 @@ function runPureQueue(queue) {
125
128
  }
126
129
  function runEffectQueue(queue) {
127
130
  for (let i = 0; i < queue.length; i++)
128
- queue[i].T();
131
+ queue[i].V();
129
132
  }
130
133
 
131
134
  // src/core/utils.ts
@@ -172,38 +175,32 @@ var Owner = class {
172
175
  // We flatten the owner tree into a linked list so that we don't need a pointer to .firstChild
173
176
  // However, the children are actually added in reverse creation order
174
177
  // See comment at the top of the file for an example of the _nextSibling traversal
175
- x = null;
176
- l = null;
177
- t = null;
178
- a = STATE_CLEAN;
178
+ o = null;
179
179
  m = null;
180
- o = defaultContext;
181
- n = null;
180
+ s = null;
181
+ a = STATE_CLEAN;
182
+ l = null;
183
+ p = defaultContext;
182
184
  h = globalQueue;
183
- O = null;
184
- X = 0;
185
+ W = 0;
185
186
  id = null;
186
187
  constructor(id = null, skipAppend = false) {
187
188
  this.id = id;
188
- if (currentOwner && !skipAppend)
189
- currentOwner.append(this);
189
+ if (currentOwner) {
190
+ if (id == null && currentOwner.id != null)
191
+ this.id = currentOwner.getNextChildId();
192
+ !skipAppend && currentOwner.append(this);
193
+ }
190
194
  }
191
195
  append(child) {
192
- child.x = this;
193
- child.t = this;
194
- if (this.id) {
195
- child.O = this.l ? this.l.O + 1 : 0;
196
- child.id = formatId(this.id, child.O);
197
- }
198
- if (this.l)
199
- this.l.t = child;
200
- child.l = this.l;
201
- this.l = child;
202
- if (child.o !== this.o) {
203
- child.o = { ...this.o, ...child.o };
204
- }
205
- if (this.n) {
206
- child.n = !child.n ? this.n : [...child.n, ...this.n];
196
+ child.o = this;
197
+ child.s = this;
198
+ if (this.m)
199
+ this.m.s = child;
200
+ child.m = this.m;
201
+ this.m = child;
202
+ if (child.p !== this.p) {
203
+ child.p = { ...this.p, ...child.p };
207
204
  }
208
205
  if (this.h)
209
206
  child.h = this.h;
@@ -211,65 +208,47 @@ var Owner = class {
211
208
  dispose(self = true) {
212
209
  if (this.a === STATE_DISPOSED)
213
210
  return;
214
- let head = self ? this.t || this.x : this, current = this.l, next = null;
215
- while (current && current.x === this) {
211
+ let head = self ? this.s || this.o : this, current = this.m, next = null;
212
+ while (current && current.o === this) {
216
213
  current.dispose(true);
217
- current.z();
218
- next = current.l;
219
- current.l = null;
214
+ current.y();
215
+ next = current.m;
216
+ current.m = null;
220
217
  current = next;
221
218
  }
219
+ this.W = 0;
222
220
  if (self)
223
- this.z();
221
+ this.y();
224
222
  if (current)
225
- current.t = !self ? this : this.t;
223
+ current.s = !self ? this : this.s;
226
224
  if (head)
227
- head.l = current;
228
- }
229
- z() {
230
- if (this.t)
231
- this.t.l = null;
232
- this.x = null;
233
- this.t = null;
234
- this.o = defaultContext;
235
- this.n = null;
225
+ head.m = current;
226
+ }
227
+ y() {
228
+ if (this.s)
229
+ this.s.m = null;
230
+ this.o = null;
231
+ this.s = null;
232
+ this.p = defaultContext;
236
233
  this.a = STATE_DISPOSED;
237
234
  this.emptyDisposal();
238
235
  }
239
236
  emptyDisposal() {
240
- if (!this.m)
237
+ if (!this.l)
241
238
  return;
242
- if (Array.isArray(this.m)) {
243
- for (let i = 0; i < this.m.length; i++) {
244
- const callable = this.m[i];
239
+ if (Array.isArray(this.l)) {
240
+ for (let i = 0; i < this.l.length; i++) {
241
+ const callable = this.l[i];
245
242
  callable.call(callable);
246
243
  }
247
244
  } else {
248
- this.m.call(this.m);
249
- }
250
- this.m = null;
251
- }
252
- addErrorHandler(handler) {
253
- this.n = this.n ? [handler, ...this.n] : [handler];
254
- }
255
- handleError(error) {
256
- if (!this.n)
257
- throw error;
258
- let i = 0, len = this.n.length;
259
- for (i = 0; i < len; i++) {
260
- try {
261
- this.n[i](error, this);
262
- break;
263
- } catch (e) {
264
- error = e;
265
- }
245
+ this.l.call(this.l);
266
246
  }
267
- if (i === len)
268
- throw error;
247
+ this.l = null;
269
248
  }
270
249
  getNextChildId() {
271
- if (this.id)
272
- return formatId(this.id + "-", this.X++);
250
+ if (this.id != null)
251
+ return formatId(this.id, this.W++);
273
252
  throw new Error("Cannot get child id from owner without an id");
274
253
  }
275
254
  };
@@ -280,7 +259,7 @@ function getContext(context, owner = currentOwner) {
280
259
  if (!owner) {
281
260
  throw new NoOwnerError();
282
261
  }
283
- const value = hasContext(context, owner) ? owner.o[context.id] : context.defaultValue;
262
+ const value = hasContext(context, owner) ? owner.p[context.id] : context.defaultValue;
284
263
  if (isUndefined(value)) {
285
264
  throw new ContextNotFoundError();
286
265
  }
@@ -290,24 +269,24 @@ function setContext(context, value, owner = currentOwner) {
290
269
  if (!owner) {
291
270
  throw new NoOwnerError();
292
271
  }
293
- owner.o = {
294
- ...owner.o,
272
+ owner.p = {
273
+ ...owner.p,
295
274
  [context.id]: isUndefined(value) ? context.defaultValue : value
296
275
  };
297
276
  }
298
277
  function hasContext(context, owner = currentOwner) {
299
- return !isUndefined(owner?.o[context.id]);
278
+ return !isUndefined(owner?.p[context.id]);
300
279
  }
301
280
  function onCleanup(fn) {
302
281
  if (!currentOwner)
303
282
  return fn;
304
283
  const node = currentOwner;
305
- if (!node.m) {
306
- node.m = fn;
307
- } else if (Array.isArray(node.m)) {
308
- node.m.push(fn);
284
+ if (!node.l) {
285
+ node.l = fn;
286
+ } else if (Array.isArray(node.l)) {
287
+ node.l.push(fn);
309
288
  } else {
310
- node.m = [node.m, fn];
289
+ node.l = [node.l, fn];
311
290
  }
312
291
  return fn;
313
292
  }
@@ -336,44 +315,44 @@ function getObserver() {
336
315
  var UNCHANGED = Symbol(0);
337
316
  var Computation = class extends Owner {
338
317
  c = null;
339
- f = null;
318
+ e = null;
340
319
  g;
341
- G;
342
- A;
320
+ F;
321
+ z;
343
322
  // Used in __DEV__ mode, hopefully removed in production
344
- $;
323
+ ba;
345
324
  // Using false is an optimization as an alternative to _equals: () => false
346
325
  // which could enable more efficient DIRTY notification
347
- P = isEqual;
348
- U;
326
+ S = isEqual;
327
+ X;
349
328
  /** Whether the computation is an error or has ancestors that are unresolved */
350
- d = 0;
329
+ f = 0;
351
330
  /** Which flags raised by sources are handled, vs. being passed through. */
352
- Q = DEFAULT_FLAGS;
353
- B = -1;
354
- K = false;
331
+ T = DEFAULT_FLAGS;
332
+ A = -1;
333
+ w = false;
355
334
  constructor(initialValue, compute2, options) {
356
335
  super(null, compute2 === null);
357
- this.A = compute2;
336
+ this.z = compute2;
358
337
  this.a = compute2 ? STATE_DIRTY : STATE_CLEAN;
359
- this.d = compute2 && initialValue === void 0 ? UNINITIALIZED_BIT : 0;
338
+ this.f = compute2 && initialValue === void 0 ? UNINITIALIZED_BIT : 0;
360
339
  this.g = initialValue;
361
340
  if (options?.equals !== void 0)
362
- this.P = options.equals;
341
+ this.S = options.equals;
363
342
  if (options?.unobserved)
364
- this.U = options?.unobserved;
343
+ this.X = options?.unobserved;
365
344
  }
366
- V() {
367
- if (this.A) {
368
- if (this.d & ERROR_BIT && this.B <= getClock())
345
+ Y() {
346
+ if (this.z) {
347
+ if (this.f & ERROR_BIT && this.A <= getClock())
369
348
  update(this);
370
349
  else
371
- this.y();
350
+ this.x();
372
351
  }
373
352
  track(this);
374
- newFlags |= this.d & ~currentMask;
375
- if (this.d & ERROR_BIT) {
376
- throw this.G;
353
+ newFlags |= this.f & ~currentMask;
354
+ if (this.f & ERROR_BIT) {
355
+ throw this.F;
377
356
  } else {
378
357
  return this.g;
379
358
  }
@@ -383,7 +362,7 @@ var Computation = class extends Owner {
383
362
  * Automatically re-executes the surrounding computation when the value changes
384
363
  */
385
364
  read() {
386
- return this.V();
365
+ return this.Y();
387
366
  }
388
367
  /**
389
368
  * Return the current value of this computation
@@ -393,37 +372,37 @@ var Computation = class extends Owner {
393
372
  * before continuing
394
373
  */
395
374
  wait() {
396
- if (this.A && this.d & ERROR_BIT && this.B <= getClock()) {
375
+ if (this.z && this.f & ERROR_BIT && this.A <= getClock()) {
397
376
  update(this);
398
377
  } else {
399
- this.y();
378
+ this.x();
400
379
  }
401
380
  track(this);
402
- if ((notStale || this.d & UNINITIALIZED_BIT) && this.d & LOADING_BIT) {
381
+ if ((notStale || this.f & UNINITIALIZED_BIT) && this.f & LOADING_BIT) {
403
382
  throw new NotReadyError();
404
383
  }
405
- if (staleCheck && this.d & LOADING_BIT) {
384
+ if (staleCheck && this.f & LOADING_BIT) {
406
385
  staleCheck.g = true;
407
386
  }
408
- return this.V();
387
+ return this.Y();
409
388
  }
410
389
  /** Update the computation with a new value. */
411
390
  write(value, flags = 0, raw = false) {
412
391
  const newValue = !raw && typeof value === "function" ? value(this.g) : value;
413
- const valueChanged = newValue !== UNCHANGED && (!!(this.d & UNINITIALIZED_BIT) || this.d & LOADING_BIT & ~flags || this.P === false || !this.P(this.g, newValue));
392
+ const valueChanged = newValue !== UNCHANGED && (!!(this.f & UNINITIALIZED_BIT) || this.f & LOADING_BIT & ~flags || this.S === false || !this.S(this.g, newValue));
414
393
  if (valueChanged) {
415
394
  this.g = newValue;
416
- this.G = void 0;
395
+ this.F = void 0;
417
396
  }
418
- const changedFlagsMask = this.d ^ flags, changedFlags = changedFlagsMask & flags;
419
- this.d = flags;
420
- this.B = getClock() + 1;
421
- if (this.f) {
422
- for (let i = 0; i < this.f.length; i++) {
397
+ const changedFlagsMask = this.f ^ flags, changedFlags = changedFlagsMask & flags;
398
+ this.f = flags;
399
+ this.A = getClock() + 1;
400
+ if (this.e) {
401
+ for (let i = 0; i < this.e.length; i++) {
423
402
  if (valueChanged) {
424
- this.f[i].r(STATE_DIRTY);
403
+ this.e[i].r(STATE_DIRTY);
425
404
  } else if (changedFlagsMask) {
426
- this.f[i].W(changedFlagsMask, changedFlags);
405
+ this.e[i].Z(changedFlagsMask, changedFlags);
427
406
  }
428
407
  }
429
408
  }
@@ -433,13 +412,13 @@ var Computation = class extends Owner {
433
412
  * Set the current node's state, and recursively mark all of this node's observers as STATE_CHECK
434
413
  */
435
414
  r(state, skipQueue) {
436
- if (this.a >= state && !this.K)
415
+ if (this.a >= state && !this.w)
437
416
  return;
438
- this.K = !!skipQueue;
417
+ this.w = !!skipQueue;
439
418
  this.a = state;
440
- if (this.f) {
441
- for (let i = 0; i < this.f.length; i++) {
442
- this.f[i].r(STATE_CHECK, skipQueue);
419
+ if (this.e) {
420
+ for (let i = 0; i < this.e.length; i++) {
421
+ this.e[i].r(STATE_CHECK, skipQueue);
443
422
  }
444
423
  }
445
424
  }
@@ -449,31 +428,31 @@ var Computation = class extends Owner {
449
428
  * @param mask A bitmask for which flag(s) were changed.
450
429
  * @param newFlags The source's new flags, masked to just the changed ones.
451
430
  */
452
- W(mask, newFlags2) {
431
+ Z(mask, newFlags2) {
453
432
  if (this.a >= STATE_DIRTY)
454
433
  return;
455
- if (mask & this.Q) {
434
+ if (mask & this.T) {
456
435
  this.r(STATE_DIRTY);
457
436
  return;
458
437
  }
459
438
  if (this.a >= STATE_CHECK)
460
439
  return;
461
- const prevFlags = this.d & mask;
440
+ const prevFlags = this.f & mask;
462
441
  const deltaFlags = prevFlags ^ newFlags2;
463
442
  if (newFlags2 === prevFlags) ; else if (deltaFlags & prevFlags & mask) {
464
443
  this.r(STATE_CHECK);
465
444
  } else {
466
- this.d ^= deltaFlags;
467
- if (this.f) {
468
- for (let i = 0; i < this.f.length; i++) {
469
- this.f[i].W(mask, newFlags2);
445
+ this.f ^= deltaFlags;
446
+ if (this.e) {
447
+ for (let i = 0; i < this.e.length; i++) {
448
+ this.e[i].Z(mask, newFlags2);
470
449
  }
471
450
  }
472
451
  }
473
452
  }
474
- H(error) {
475
- this.G = error;
476
- this.write(UNCHANGED, this.d & ~LOADING_BIT | ERROR_BIT | UNINITIALIZED_BIT);
453
+ L(error) {
454
+ this.F = error;
455
+ this.write(UNCHANGED, this.f & ~LOADING_BIT | ERROR_BIT | UNINITIALIZED_BIT);
477
456
  }
478
457
  /**
479
458
  * This is the core part of the reactivity system, which makes sure that the values are updated
@@ -482,8 +461,8 @@ var Computation = class extends Owner {
482
461
  *
483
462
  * This function will ensure that the value and states we read from the computation are up to date
484
463
  */
485
- y() {
486
- if (!this.A) {
464
+ x() {
465
+ if (!this.z) {
487
466
  return;
488
467
  }
489
468
  if (this.a === STATE_DISPOSED) {
@@ -495,8 +474,8 @@ var Computation = class extends Owner {
495
474
  let observerFlags = 0;
496
475
  if (this.a === STATE_CHECK) {
497
476
  for (let i = 0; i < this.c.length; i++) {
498
- this.c[i].y();
499
- observerFlags |= this.c[i].d;
477
+ this.c[i].x();
478
+ observerFlags |= this.c[i].f;
500
479
  if (this.a === STATE_DIRTY) {
501
480
  break;
502
481
  }
@@ -512,12 +491,12 @@ var Computation = class extends Owner {
512
491
  /**
513
492
  * Remove ourselves from the owner graph and the computation graph
514
493
  */
515
- z() {
494
+ y() {
516
495
  if (this.a === STATE_DISPOSED)
517
496
  return;
518
497
  if (this.c)
519
498
  removeSourceObservers(this, 0);
520
- super.z();
499
+ super.y();
521
500
  }
522
501
  };
523
502
  function track(computation) {
@@ -530,7 +509,7 @@ function track(computation) {
530
509
  newSources.push(computation);
531
510
  }
532
511
  if (updateCheck) {
533
- updateCheck.g = computation.B > currentObserver.B;
512
+ updateCheck.g = computation.A > currentObserver.A;
534
513
  }
535
514
  }
536
515
  }
@@ -542,13 +521,13 @@ function update(node) {
542
521
  try {
543
522
  node.dispose(false);
544
523
  node.emptyDisposal();
545
- const result = compute(node, node.A, node);
524
+ const result = compute(node, node.z, node);
546
525
  node.write(result, newFlags, true);
547
526
  } catch (error) {
548
527
  if (error instanceof NotReadyError) {
549
- node.write(UNCHANGED, newFlags | LOADING_BIT | node.d & UNINITIALIZED_BIT);
528
+ node.write(UNCHANGED, newFlags | LOADING_BIT | node.f & UNINITIALIZED_BIT);
550
529
  } else {
551
- node.H(error);
530
+ node.L(error);
552
531
  }
553
532
  } finally {
554
533
  if (newSources) {
@@ -565,10 +544,10 @@ function update(node) {
565
544
  let source;
566
545
  for (let i = newSourcesIndex; i < node.c.length; i++) {
567
546
  source = node.c[i];
568
- if (!source.f)
569
- source.f = [node];
547
+ if (!source.e)
548
+ source.e = [node];
570
549
  else
571
- source.f.push(node);
550
+ source.e.push(node);
572
551
  }
573
552
  } else if (node.c && newSourcesIndex < node.c.length) {
574
553
  removeSourceObservers(node, newSourcesIndex);
@@ -577,7 +556,7 @@ function update(node) {
577
556
  newSources = prevSources;
578
557
  newSourcesIndex = prevSourcesIndex;
579
558
  newFlags = prevFlags;
580
- node.B = getClock() + 1;
559
+ node.A = getClock() + 1;
581
560
  node.a = STATE_CLEAN;
582
561
  }
583
562
  }
@@ -586,12 +565,12 @@ function removeSourceObservers(node, index) {
586
565
  let swap;
587
566
  for (let i = index; i < node.c.length; i++) {
588
567
  source = node.c[i];
589
- if (source.f) {
590
- swap = source.f.indexOf(node);
591
- source.f[swap] = source.f[source.f.length - 1];
592
- source.f.pop();
593
- if (!source.f.length)
594
- source.U?.();
568
+ if (source.e) {
569
+ swap = source.e.indexOf(node);
570
+ source.e[swap] = source.e[source.e.length - 1];
571
+ source.e.pop();
572
+ if (!source.e.length)
573
+ source.X?.();
595
574
  }
596
575
  }
597
576
  }
@@ -633,7 +612,7 @@ function isPending(fn, loadingValue) {
633
612
  if (!currentObserver)
634
613
  return pendingCheck(fn, loadingValue);
635
614
  const c = new Computation(void 0, () => pendingCheck(fn, loadingValue));
636
- c.Q |= LOADING_BIT;
615
+ c.T |= LOADING_BIT;
637
616
  return c.read();
638
617
  }
639
618
  function latest(fn, fallback) {
@@ -663,10 +642,10 @@ function runWithObserver(observer, run) {
663
642
  if (error instanceof NotReadyError) {
664
643
  observer.write(
665
644
  UNCHANGED,
666
- newFlags | LOADING_BIT | observer.d & UNINITIALIZED_BIT
645
+ newFlags | LOADING_BIT | observer.f & UNINITIALIZED_BIT
667
646
  );
668
647
  } else {
669
- observer.H(error);
648
+ observer.L(error);
670
649
  }
671
650
  } finally {
672
651
  if (newSources) {
@@ -681,10 +660,10 @@ function runWithObserver(observer, run) {
681
660
  let source;
682
661
  for (let i = newSourcesIndex; i < observer.c.length; i++) {
683
662
  source = observer.c[i];
684
- if (!source.f)
685
- source.f = [observer];
663
+ if (!source.e)
664
+ source.e = [observer];
686
665
  else
687
- source.f.push(observer);
666
+ source.e.push(observer);
688
667
  }
689
668
  }
690
669
  newSources = prevSources;
@@ -695,7 +674,7 @@ function runWithObserver(observer, run) {
695
674
  function compute(owner, fn, observer) {
696
675
  const prevOwner = setOwner(owner), prevObserver = currentObserver, prevMask = currentMask, prevNotStale = notStale;
697
676
  currentObserver = observer;
698
- currentMask = observer?.Q ?? DEFAULT_FLAGS;
677
+ currentMask = observer?.T ?? DEFAULT_FLAGS;
699
678
  notStale = true;
700
679
  try {
701
680
  return fn(observer ? observer.g : void 0);
@@ -771,80 +750,81 @@ function flattenArray(children, results = [], options) {
771
750
 
772
751
  // src/core/effect.ts
773
752
  var Effect = class extends Computation {
774
- L;
775
753
  M;
776
- C;
777
- R = false;
778
754
  N;
779
- u;
755
+ B;
756
+ U = false;
757
+ O;
758
+ t;
780
759
  constructor(initialValue, compute2, effect, error, options) {
781
760
  super(initialValue, compute2, options);
782
- this.L = effect;
783
- this.M = error;
784
- this.N = initialValue;
785
- this.u = options?.render ? EFFECT_RENDER : EFFECT_USER;
786
- if (this.u === EFFECT_RENDER) {
787
- this.A = (p) => getClock() > this.h.created && !(this.d & ERROR_BIT) ? latest(() => compute2(p)) : compute2(p);
761
+ this.M = effect;
762
+ this.N = error;
763
+ this.O = initialValue;
764
+ this.t = options?.render ? EFFECT_RENDER : EFFECT_USER;
765
+ if (this.t === EFFECT_RENDER) {
766
+ this.z = (p) => getClock() > this.h.created && !(this.f & ERROR_BIT) ? latest(() => compute2(p)) : compute2(p);
788
767
  }
789
- this.y();
790
- !options?.defer && (this.u === EFFECT_USER ? this.h.enqueue(this.u, this) : this.T());
768
+ this.x();
769
+ !options?.defer && (this.t === EFFECT_USER ? this.h.enqueue(this.t, this) : this.V());
791
770
  }
792
771
  write(value, flags = 0) {
793
772
  if (this.a == STATE_DIRTY) {
794
- const currentFlags = this.d;
795
- this.d = flags;
796
- if (this.u === EFFECT_RENDER && (flags & LOADING_BIT) !== (currentFlags & LOADING_BIT)) {
797
- this.h.S?.(this);
773
+ this.f;
774
+ this.f = flags;
775
+ if (this.t === EFFECT_RENDER) {
776
+ this.h.notify(this, LOADING_BIT | ERROR_BIT, flags);
798
777
  }
799
778
  }
800
779
  if (value === UNCHANGED)
801
780
  return this.g;
802
781
  this.g = value;
803
- this.R = true;
782
+ this.U = true;
804
783
  return value;
805
784
  }
806
785
  r(state, skipQueue) {
807
786
  if (this.a >= state || skipQueue)
808
787
  return;
809
788
  if (this.a === STATE_CLEAN)
810
- this.h.enqueue(this.u, this);
789
+ this.h.enqueue(this.t, this);
811
790
  this.a = state;
812
791
  }
813
- H(error) {
814
- this.C?.();
815
- if (this.d & LOADING_BIT) {
816
- this.h.S?.(this);
817
- }
818
- this.d = ERROR_BIT;
819
- if (this.u === EFFECT_USER) {
792
+ L(error) {
793
+ this.F = error;
794
+ this.B?.();
795
+ this.h.notify(this, LOADING_BIT, 0);
796
+ this.f = ERROR_BIT;
797
+ if (this.t === EFFECT_USER) {
820
798
  try {
821
- return this.M ? this.C = this.M(error) : console.error(new EffectError(this.L, error));
799
+ return this.N ? this.B = this.N(error) : console.error(new EffectError(this.M, error));
822
800
  } catch (e) {
823
801
  error = e;
824
802
  }
825
803
  }
826
- this.handleError(error);
804
+ if (!this.h.notify(this, ERROR_BIT, ERROR_BIT))
805
+ throw error;
827
806
  }
828
- z() {
807
+ y() {
829
808
  if (this.a === STATE_DISPOSED)
830
809
  return;
831
- this.L = void 0;
832
- this.N = void 0;
833
810
  this.M = void 0;
834
- this.C?.();
835
- this.C = void 0;
836
- super.z();
811
+ this.O = void 0;
812
+ this.N = void 0;
813
+ this.B?.();
814
+ this.B = void 0;
815
+ super.y();
837
816
  }
838
- T() {
839
- if (this.R && this.a !== STATE_DISPOSED) {
840
- this.C?.();
817
+ V() {
818
+ if (this.U && this.a !== STATE_DISPOSED) {
819
+ this.B?.();
841
820
  try {
842
- this.C = this.L(this.g, this.N);
821
+ this.B = this.M(this.g, this.O);
843
822
  } catch (e) {
844
- this.handleError(e);
823
+ if (!this.h.notify(this, ERROR_BIT, ERROR_BIT))
824
+ throw e;
845
825
  } finally {
846
- this.N = this.g;
847
- this.R = false;
826
+ this.O = this.g;
827
+ this.U = false;
848
828
  }
849
829
  }
850
830
  }
@@ -852,12 +832,12 @@ var Effect = class extends Computation {
852
832
  var EagerComputation = class extends Computation {
853
833
  constructor(initialValue, compute2, options) {
854
834
  super(initialValue, compute2, options);
855
- !options?.defer && this.y();
835
+ !options?.defer && this.x();
856
836
  }
857
837
  r(state, skipQueue) {
858
- if (this.a >= state && !this.K)
838
+ if (this.a >= state && !this.w)
859
839
  return;
860
- if (this.a === STATE_CLEAN && !skipQueue)
840
+ if (!skipQueue && (this.a === STATE_CLEAN || this.a === STATE_CHECK && this.w))
861
841
  this.h.enqueue(EFFECT_PURE, this);
862
842
  super.r(state, skipQueue);
863
843
  }
@@ -867,108 +847,141 @@ var ProjectionComputation = class extends Computation {
867
847
  super(void 0, compute2);
868
848
  }
869
849
  r(state, skipQueue) {
870
- if (this.a >= state && !this.K)
850
+ if (this.a >= state && !this.w)
871
851
  return;
872
- if (this.a === STATE_CLEAN && !skipQueue)
852
+ if (!skipQueue && (this.a === STATE_CLEAN || this.a === STATE_CHECK && this.w))
873
853
  this.h.enqueue(EFFECT_PURE, this);
874
854
  super.r(state, true);
855
+ this.w = !!skipQueue;
875
856
  }
876
857
  };
877
858
 
878
859
  // src/core/boundaries.ts
879
- function createBoundary(owner, fn, queue) {
880
- if (queue) {
881
- const parentQueue = owner.h;
882
- parentQueue.addChild(owner.h = queue);
883
- onCleanup(() => parentQueue.removeChild(owner.h));
860
+ var BoundaryComputation = class extends EagerComputation {
861
+ G;
862
+ constructor(compute2, propagationMask) {
863
+ super(void 0, compute2, { defer: true });
864
+ this.G = propagationMask;
884
865
  }
866
+ write(value, flags) {
867
+ super.write(value, flags & ~this.G);
868
+ if (this.G & LOADING_BIT && !(this.f & UNINITIALIZED_BIT)) {
869
+ flags &= ~LOADING_BIT;
870
+ }
871
+ this.h.notify(this, this.G, flags);
872
+ return this.g;
873
+ }
874
+ };
875
+ function createBoundChildren(owner, fn, queue, mask) {
876
+ const parentQueue = owner.h;
877
+ parentQueue.addChild(owner.h = queue);
878
+ onCleanup(() => parentQueue.removeChild(owner.h));
885
879
  return compute(
886
880
  owner,
887
881
  () => {
888
882
  const c = new Computation(void 0, fn);
889
- return new EagerComputation(void 0, () => flatten(c.wait()), { defer: true });
883
+ return new BoundaryComputation(() => flatten(c.wait()), mask);
890
884
  },
891
885
  null
892
886
  );
893
887
  }
894
- function createDecision(main, condition, fallback) {
895
- const decision = new Computation(void 0, () => {
896
- if (!condition.read()) {
897
- const resolved = main.read();
898
- if (!condition.read())
899
- return resolved;
888
+ var ConditionalQueue = class extends Queue {
889
+ n;
890
+ P = /* @__PURE__ */ new Set();
891
+ Q = /* @__PURE__ */ new Set();
892
+ constructor(disabled) {
893
+ super();
894
+ this.n = disabled;
895
+ }
896
+ run(type) {
897
+ if (!type || this.n.read())
898
+ return;
899
+ return super.run(type);
900
+ }
901
+ notify(node, type, flags) {
902
+ if (this.n.read()) {
903
+ if (type === LOADING_BIT) {
904
+ flags & LOADING_BIT ? this.Q.add(node) : this.Q.delete(node);
905
+ }
906
+ if (type === ERROR_BIT) {
907
+ flags & ERROR_BIT ? this.P.add(node) : this.P.delete(node);
908
+ }
909
+ return true;
900
910
  }
901
- return fallback();
902
- });
903
- return decision.read.bind(decision);
904
- }
905
- var SuspenseQueue = class extends Queue {
911
+ return super.notify(node, type, flags);
912
+ }
913
+ };
914
+ var CollectionQueue = class extends Queue {
915
+ R;
906
916
  b = /* @__PURE__ */ new Set();
907
- p = new Computation(false, null);
917
+ n = new Computation(false, null);
918
+ constructor(type) {
919
+ super();
920
+ this.R = type;
921
+ }
908
922
  run(type) {
909
- if (type && this.p.read())
923
+ if (!type || this.n.read())
910
924
  return;
911
925
  return super.run(type);
912
926
  }
913
- S(node) {
914
- if (node.d & LOADING_BIT) {
927
+ notify(node, type, flags) {
928
+ if (!(type & this.R))
929
+ return super.notify(node, type, flags);
930
+ if (flags & this.R) {
915
931
  this.b.add(node);
916
932
  if (this.b.size === 1)
917
- this.p.write(true);
933
+ this.n.write(true);
918
934
  } else {
919
935
  this.b.delete(node);
920
936
  if (this.b.size === 0)
921
- this.p.write(false);
937
+ this.n.write(false);
922
938
  }
939
+ type &= ~this.R;
940
+ return type ? super.notify(node, type, flags) : true;
923
941
  }
924
942
  };
925
- function createSuspense(fn, fallback) {
943
+ function createBoundary(fn, condition) {
926
944
  const owner = new Owner();
927
- const queue = new SuspenseQueue();
928
- const tree = createBoundary(owner, fn, queue);
929
- const ogWrite = tree.write;
930
- tree.write = function(value, flags = 0) {
931
- const currentFlags = this.d;
932
- const dirty = this.a === STATE_DIRTY;
933
- ogWrite.call(this, value, flags);
934
- if (dirty && (flags & LOADING_BIT) !== (currentFlags & LOADING_BIT)) {
935
- this.h.S?.(this);
945
+ const queue = new ConditionalQueue(new Computation(void 0, () => condition() === "hidden" /* HIDDEN */));
946
+ const tree = createBoundChildren(owner, fn, queue, 0);
947
+ new EagerComputation(void 0, () => {
948
+ const disabled = queue.n.read();
949
+ tree.G = disabled ? ERROR_BIT | LOADING_BIT : 0;
950
+ if (!disabled) {
951
+ queue.Q.forEach((node) => queue.notify(node, LOADING_BIT, LOADING_BIT));
952
+ queue.P.forEach((node) => queue.notify(node, ERROR_BIT, ERROR_BIT));
953
+ queue.Q.clear();
954
+ queue.P.clear();
936
955
  }
937
- return this.g;
938
- };
939
- return createDecision(tree, queue.p, fallback);
956
+ });
957
+ return () => queue.n.read() ? void 0 : tree.read();
940
958
  }
941
- function createErrorBoundary(fn, fallback) {
959
+ function createCollectionBoundary(type, fn, fallback) {
942
960
  const owner = new Owner();
943
- const error = new Computation(void 0, null);
944
- const nodes = /* @__PURE__ */ new Set();
945
- function handler(err, node) {
946
- if (nodes.has(node))
947
- return;
948
- compute(
949
- node,
950
- () => onCleanup(() => {
951
- nodes.delete(node);
952
- if (!nodes.size)
953
- error.write(void 0);
954
- }),
955
- null
956
- );
957
- nodes.add(node);
958
- if (nodes.size === 1)
959
- error.write({ G: err });
960
- }
961
- owner.addErrorHandler(handler);
962
- const tree = createBoundary(owner, fn);
963
- tree.H = tree.handleError;
964
- return createDecision(
965
- tree,
966
- error,
967
- () => fallback(error.read().G, () => {
961
+ const queue = new CollectionQueue(type);
962
+ const tree = createBoundChildren(owner, fn, queue, type);
963
+ const decision = new Computation(void 0, () => {
964
+ if (!queue.n.read()) {
965
+ const resolved = tree.read();
966
+ if (!queue.n.read())
967
+ return resolved;
968
+ }
969
+ return fallback(queue);
970
+ });
971
+ return decision.read.bind(decision);
972
+ }
973
+ function createSuspense(fn, fallback) {
974
+ return createCollectionBoundary(LOADING_BIT, fn, () => fallback());
975
+ }
976
+ function createErrorBoundary(fn, fallback) {
977
+ return createCollectionBoundary(
978
+ ERROR_BIT,
979
+ fn,
980
+ (queue) => fallback(queue.b.values().next().value.F, () => {
968
981
  incrementClock();
969
- for (let node of nodes) {
982
+ for (let node of queue.b) {
970
983
  node.a = STATE_DIRTY;
971
- node.h?.enqueue(node.u, node);
984
+ node.h?.enqueue(node.t, node);
972
985
  }
973
986
  })
974
987
  );
@@ -1004,7 +1017,7 @@ function createMemo(compute2, value, options) {
1004
1017
  return resolvedValue;
1005
1018
  }
1006
1019
  resolvedValue = node.wait();
1007
- if (!node.c?.length && node.l?.x !== node) {
1020
+ if (!node.c?.length && node.m?.o !== node) {
1008
1021
  node.dispose();
1009
1022
  node = void 0;
1010
1023
  }
@@ -1034,7 +1047,7 @@ function createAsync(compute2, value, options) {
1034
1047
  (error) => {
1035
1048
  if (abort)
1036
1049
  return;
1037
- node.H(error);
1050
+ node.L(error);
1038
1051
  }
1039
1052
  );
1040
1053
  } else {
@@ -1225,7 +1238,7 @@ function ownKeys(target) {
1225
1238
  trackSelf(target);
1226
1239
  return Reflect.ownKeys(target[STORE_VALUE]);
1227
1240
  }
1228
- var Writing = /* @__PURE__ */ new Set();
1241
+ var Writing = null;
1229
1242
  var proxyTraps = {
1230
1243
  get(target, property, receiver) {
1231
1244
  if (property === $TARGET)
@@ -1246,7 +1259,7 @@ var proxyTraps = {
1246
1259
  if (desc && desc.get)
1247
1260
  return desc.get.call(receiver);
1248
1261
  }
1249
- if (Writing.has(storeValue)) {
1262
+ if (Writing?.has(storeValue)) {
1250
1263
  const value2 = tracked ? tracked.g : storeValue[property];
1251
1264
  return isWrappable(value2) ? (Writing.add(value2[$RAW] || value2), wrap2(value2)) : value2;
1252
1265
  }
@@ -1269,11 +1282,11 @@ var proxyTraps = {
1269
1282
  return has;
1270
1283
  },
1271
1284
  set(target, property, value) {
1272
- Writing.has(target[STORE_VALUE]) && setProperty(target[STORE_VALUE], property, unwrap(value, false));
1285
+ Writing?.has(target[STORE_VALUE]) && setProperty(target[STORE_VALUE], property, unwrap(value, false));
1273
1286
  return true;
1274
1287
  },
1275
1288
  deleteProperty(target, property) {
1276
- Writing.has(target[STORE_VALUE]) && setProperty(target[STORE_VALUE], property, void 0, true);
1289
+ Writing?.has(target[STORE_VALUE]) && setProperty(target[STORE_VALUE], property, void 0, true);
1277
1290
  return true;
1278
1291
  },
1279
1292
  ownKeys,
@@ -1356,11 +1369,14 @@ function createStore(first, second) {
1356
1369
  const unwrappedStore = unwrap(store);
1357
1370
  let wrappedStore = wrap2(unwrappedStore);
1358
1371
  const setStore = (fn) => {
1372
+ const prevWriting = Writing;
1373
+ Writing = /* @__PURE__ */ new Set();
1374
+ Writing.add(unwrappedStore);
1359
1375
  try {
1360
- Writing.add(unwrappedStore);
1361
1376
  fn(wrappedStore);
1362
1377
  } finally {
1363
1378
  Writing.clear();
1379
+ Writing = prevWriting;
1364
1380
  }
1365
1381
  };
1366
1382
  if (derived)
@@ -1636,72 +1652,72 @@ function omit(props, ...keys) {
1636
1652
  function mapArray(list, map, options) {
1637
1653
  const keyFn = typeof options?.keyed === "function" ? options.keyed : void 0;
1638
1654
  return updateKeyedMap.bind({
1639
- I: new Owner(),
1655
+ H: new Owner(),
1640
1656
  i: 0,
1641
- Y: list,
1642
- w: [],
1643
- D: map,
1644
- e: [],
1657
+ _: list,
1658
+ u: [],
1659
+ C: map,
1660
+ d: [],
1645
1661
  b: [],
1646
- E: keyFn,
1662
+ D: keyFn,
1647
1663
  j: keyFn || options?.keyed === false ? [] : void 0,
1648
1664
  k: map.length > 1 ? [] : void 0,
1649
- p: options?.fallback
1665
+ I: options?.fallback
1650
1666
  });
1651
1667
  }
1652
1668
  function updateKeyedMap() {
1653
- const newItems = this.Y() || [], newLen = newItems.length;
1669
+ const newItems = this._() || [], newLen = newItems.length;
1654
1670
  newItems[$TRACK];
1655
- runWithOwner(this.I, () => {
1671
+ runWithOwner(this.H, () => {
1656
1672
  let i, j, mapper = this.j ? () => {
1657
1673
  this.j[j] = new Computation(newItems[j], null);
1658
1674
  this.k && (this.k[j] = new Computation(j, null));
1659
- return this.D(
1675
+ return this.C(
1660
1676
  Computation.prototype.read.bind(this.j[j]),
1661
1677
  this.k ? Computation.prototype.read.bind(this.k[j]) : void 0
1662
1678
  );
1663
1679
  } : this.k ? () => {
1664
1680
  const item = newItems[j];
1665
1681
  this.k[j] = new Computation(j, null);
1666
- return this.D(() => item, Computation.prototype.read.bind(this.k[j]));
1682
+ return this.C(() => item, Computation.prototype.read.bind(this.k[j]));
1667
1683
  } : () => {
1668
1684
  const item = newItems[j];
1669
- return this.D(() => item);
1685
+ return this.C(() => item);
1670
1686
  };
1671
1687
  if (newLen === 0) {
1672
1688
  if (this.i !== 0) {
1673
- this.I.dispose(false);
1689
+ this.H.dispose(false);
1674
1690
  this.b = [];
1675
- this.w = [];
1676
- this.e = [];
1691
+ this.u = [];
1692
+ this.d = [];
1677
1693
  this.i = 0;
1678
1694
  this.j && (this.j = []);
1679
1695
  this.k && (this.k = []);
1680
1696
  }
1681
- if (this.p && !this.e[0]) {
1682
- this.e[0] = compute(
1697
+ if (this.I && !this.d[0]) {
1698
+ this.d[0] = compute(
1683
1699
  this.b[0] = new Owner(),
1684
- this.p,
1700
+ this.I,
1685
1701
  null
1686
1702
  );
1687
1703
  }
1688
1704
  } else if (this.i === 0) {
1689
1705
  if (this.b[0])
1690
1706
  this.b[0].dispose();
1691
- this.e = new Array(newLen);
1707
+ this.d = new Array(newLen);
1692
1708
  for (j = 0; j < newLen; j++) {
1693
- this.w[j] = newItems[j];
1694
- this.e[j] = compute(this.b[j] = new Owner(), mapper, null);
1709
+ this.u[j] = newItems[j];
1710
+ this.d[j] = compute(this.b[j] = new Owner(), mapper, null);
1695
1711
  }
1696
1712
  this.i = newLen;
1697
1713
  } else {
1698
1714
  let start, end, newEnd, item, key, newIndices, newIndicesNext, temp = new Array(newLen), tempNodes = new Array(newLen), tempRows = this.j ? new Array(newLen) : void 0, tempIndexes = this.k ? new Array(newLen) : void 0;
1699
- for (start = 0, end = Math.min(this.i, newLen); start < end && (this.w[start] === newItems[start] || this.j && compare(this.E, this.w[start], newItems[start])); start++) {
1715
+ for (start = 0, end = Math.min(this.i, newLen); start < end && (this.u[start] === newItems[start] || this.j && compare(this.D, this.u[start], newItems[start])); start++) {
1700
1716
  if (this.j)
1701
1717
  this.j[start].write(newItems[start]);
1702
1718
  }
1703
- for (end = this.i - 1, newEnd = newLen - 1; end >= start && newEnd >= start && (this.w[end] === newItems[newEnd] || this.j && compare(this.E, this.w[end], newItems[newEnd])); end--, newEnd--) {
1704
- temp[newEnd] = this.e[end];
1719
+ for (end = this.i - 1, newEnd = newLen - 1; end >= start && newEnd >= start && (this.u[end] === newItems[newEnd] || this.j && compare(this.D, this.u[end], newItems[newEnd])); end--, newEnd--) {
1720
+ temp[newEnd] = this.d[end];
1705
1721
  tempNodes[newEnd] = this.b[end];
1706
1722
  tempRows && (tempRows[newEnd] = this.j[end]);
1707
1723
  tempIndexes && (tempIndexes[newEnd] = this.k[end]);
@@ -1710,17 +1726,17 @@ function updateKeyedMap() {
1710
1726
  newIndicesNext = new Array(newEnd + 1);
1711
1727
  for (j = newEnd; j >= start; j--) {
1712
1728
  item = newItems[j];
1713
- key = this.E ? this.E(item) : item;
1729
+ key = this.D ? this.D(item) : item;
1714
1730
  i = newIndices.get(key);
1715
1731
  newIndicesNext[j] = i === void 0 ? -1 : i;
1716
1732
  newIndices.set(key, j);
1717
1733
  }
1718
1734
  for (i = start; i <= end; i++) {
1719
- item = this.w[i];
1720
- key = this.E ? this.E(item) : item;
1735
+ item = this.u[i];
1736
+ key = this.D ? this.D(item) : item;
1721
1737
  j = newIndices.get(key);
1722
1738
  if (j !== void 0 && j !== -1) {
1723
- temp[j] = this.e[i];
1739
+ temp[j] = this.d[i];
1724
1740
  tempNodes[j] = this.b[i];
1725
1741
  tempRows && (tempRows[j] = this.j[i]);
1726
1742
  tempIndexes && (tempIndexes[j] = this.k[i]);
@@ -1731,7 +1747,7 @@ function updateKeyedMap() {
1731
1747
  }
1732
1748
  for (j = start; j < newLen; j++) {
1733
1749
  if (j in temp) {
1734
- this.e[j] = temp[j];
1750
+ this.d[j] = temp[j];
1735
1751
  this.b[j] = tempNodes[j];
1736
1752
  if (tempRows) {
1737
1753
  this.j[j] = tempRows[j];
@@ -1742,43 +1758,43 @@ function updateKeyedMap() {
1742
1758
  this.k[j].write(j);
1743
1759
  }
1744
1760
  } else {
1745
- this.e[j] = compute(this.b[j] = new Owner(), mapper, null);
1761
+ this.d[j] = compute(this.b[j] = new Owner(), mapper, null);
1746
1762
  }
1747
1763
  }
1748
- this.e = this.e.slice(0, this.i = newLen);
1749
- this.w = newItems.slice(0);
1764
+ this.d = this.d.slice(0, this.i = newLen);
1765
+ this.u = newItems.slice(0);
1750
1766
  }
1751
1767
  });
1752
- return this.e;
1768
+ return this.d;
1753
1769
  }
1754
1770
  function repeat(count, map, options) {
1755
1771
  return updateRepeat.bind({
1756
- I: new Owner(),
1772
+ H: new Owner(),
1757
1773
  i: 0,
1758
1774
  q: 0,
1759
- Z: count,
1760
- D: map,
1775
+ $: count,
1776
+ C: map,
1761
1777
  b: [],
1762
- e: [],
1763
- _: options?.from,
1764
- p: options?.fallback
1778
+ d: [],
1779
+ aa: options?.from,
1780
+ I: options?.fallback
1765
1781
  });
1766
1782
  }
1767
1783
  function updateRepeat() {
1768
- const newLen = this.Z();
1769
- const from = this._?.() || 0;
1770
- runWithOwner(this.I, () => {
1784
+ const newLen = this.$();
1785
+ const from = this.aa?.() || 0;
1786
+ runWithOwner(this.H, () => {
1771
1787
  if (newLen === 0) {
1772
1788
  if (this.i !== 0) {
1773
- this.I.dispose(false);
1789
+ this.H.dispose(false);
1774
1790
  this.b = [];
1775
- this.e = [];
1791
+ this.d = [];
1776
1792
  this.i = 0;
1777
1793
  }
1778
- if (this.p && !this.e[0]) {
1779
- this.e[0] = compute(
1794
+ if (this.I && !this.d[0]) {
1795
+ this.d[0] = compute(
1780
1796
  this.b[0] = new Owner(),
1781
- this.p,
1797
+ this.I,
1782
1798
  null
1783
1799
  );
1784
1800
  }
@@ -1795,39 +1811,39 @@ function updateRepeat() {
1795
1811
  while (i < from && i < this.i)
1796
1812
  this.b[i++].dispose();
1797
1813
  this.b.splice(0, from - this.q);
1798
- this.e.splice(0, from - this.q);
1814
+ this.d.splice(0, from - this.q);
1799
1815
  } else if (this.q > from) {
1800
1816
  let i = prevTo - this.q - 1;
1801
1817
  let difference = this.q - from;
1802
- this.b.length = this.e.length = newLen;
1818
+ this.b.length = this.d.length = newLen;
1803
1819
  while (i >= difference) {
1804
1820
  this.b[i] = this.b[i - difference];
1805
- this.e[i] = this.e[i - difference];
1821
+ this.d[i] = this.d[i - difference];
1806
1822
  i--;
1807
1823
  }
1808
1824
  for (let i2 = 0; i2 < difference; i2++) {
1809
- this.e[i2] = compute(
1825
+ this.d[i2] = compute(
1810
1826
  this.b[i2] = new Owner(),
1811
- () => this.D(i2 + from),
1827
+ () => this.C(i2 + from),
1812
1828
  null
1813
1829
  );
1814
1830
  }
1815
1831
  }
1816
1832
  for (let i = prevTo; i < to; i++) {
1817
- this.e[i - from] = compute(
1833
+ this.d[i - from] = compute(
1818
1834
  this.b[i - from] = new Owner(),
1819
- () => this.D(i),
1835
+ () => this.C(i),
1820
1836
  null
1821
1837
  );
1822
1838
  }
1823
- this.e = this.e.slice(0, newLen);
1839
+ this.d = this.d.slice(0, newLen);
1824
1840
  this.q = from;
1825
1841
  this.i = newLen;
1826
1842
  });
1827
- return this.e;
1843
+ return this.d;
1828
1844
  }
1829
1845
  function compare(key, a, b) {
1830
1846
  return key ? key(a) === key(b) : true;
1831
1847
  }
1832
1848
 
1833
- export { $PROXY, $RAW, $TARGET, $TRACK, Computation, ContextNotFoundError, NoOwnerError, NotReadyError, Owner, Queue, SUPPORTS_PROXY, createAsync, createContext, createEffect, createErrorBoundary, createMemo, createProjection, createRenderEffect, createRoot, createSignal, createStore, createSuspense, deep, flatten, flushSync, getContext, getObserver, getOwner, hasContext, hasUpdated, isEqual, isPending, isWrappable, latest, mapArray, merge, omit, onCleanup, reconcile, repeat, resolve, runWithObserver, runWithOwner, setContext, tryCatch, untrack, unwrap };
1849
+ export { $PROXY, $RAW, $TARGET, $TRACK, Computation, ContextNotFoundError, NoOwnerError, NotReadyError, Owner, Queue, SUPPORTS_PROXY, createAsync, createBoundary, createContext, createEffect, createErrorBoundary, createMemo, createProjection, createRenderEffect, createRoot, createSignal, createStore, createSuspense, deep, flatten, flushSync, getContext, getObserver, getOwner, hasContext, hasUpdated, isEqual, isPending, isWrappable, latest, mapArray, merge, omit, onCleanup, reconcile, repeat, resolve, runWithObserver, runWithOwner, setContext, tryCatch, untrack, unwrap };