solid-js 1.9.6 → 1.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/dev.cjs +18 -8
  2. package/dist/dev.js +326 -557
  3. package/dist/server.js +81 -178
  4. package/dist/solid.cjs +18 -8
  5. package/dist/solid.js +282 -486
  6. package/h/dist/h.js +9 -40
  7. package/h/jsx-runtime/dist/jsx.js +1 -1
  8. package/h/jsx-runtime/types/index.d.ts +8 -11
  9. package/h/types/hyperscript.d.ts +11 -11
  10. package/html/dist/html.js +94 -219
  11. package/html/types/lit.d.ts +33 -52
  12. package/package.json +3 -3
  13. package/store/dist/dev.js +43 -123
  14. package/store/dist/server.js +8 -20
  15. package/store/dist/store.js +40 -114
  16. package/store/types/index.d.ts +7 -21
  17. package/store/types/modifiers.d.ts +3 -6
  18. package/store/types/mutable.d.ts +2 -5
  19. package/store/types/server.d.ts +5 -25
  20. package/store/types/store.d.ts +61 -218
  21. package/types/index.d.ts +11 -78
  22. package/types/reactive/array.d.ts +4 -12
  23. package/types/reactive/observable.d.ts +16 -22
  24. package/types/reactive/scheduler.d.ts +6 -9
  25. package/types/reactive/signal.d.ts +145 -236
  26. package/types/render/Suspense.d.ts +5 -5
  27. package/types/render/component.d.ts +37 -73
  28. package/types/render/flow.d.ts +31 -43
  29. package/types/render/hydration.d.ts +15 -15
  30. package/types/server/index.d.ts +2 -57
  31. package/types/server/reactive.d.ts +45 -76
  32. package/types/server/rendering.d.ts +98 -169
  33. package/universal/dist/dev.js +12 -28
  34. package/universal/dist/universal.js +12 -28
  35. package/universal/types/index.d.ts +1 -3
  36. package/universal/types/universal.d.ts +1 -0
  37. package/web/dist/dev.js +90 -644
  38. package/web/dist/server.cjs +1 -1
  39. package/web/dist/server.js +110 -647
  40. package/web/dist/web.js +88 -632
  41. package/web/storage/dist/storage.js +3 -3
  42. package/web/types/core.d.ts +1 -9
  43. package/web/types/index.d.ts +11 -31
  44. package/web/types/server-mock.d.ts +32 -47
package/dist/dev.js CHANGED
@@ -52,11 +52,9 @@ function enqueue(taskQueue, task) {
52
52
  let m = 0;
53
53
  let n = taskQueue.length - 1;
54
54
  while (m <= n) {
55
- const k = (n + m) >> 1;
55
+ const k = n + m >> 1;
56
56
  const cmp = task.expirationTime - taskQueue[k].expirationTime;
57
- if (cmp > 0) m = k + 1;
58
- else if (cmp < 0) n = k - 1;
59
- else return k;
57
+ if (cmp > 0) m = k + 1;else if (cmp < 0) n = k - 1;else return k;
60
58
  }
61
59
  return m;
62
60
  }
@@ -183,25 +181,20 @@ function createRoot(fn, detachedOwner) {
183
181
  owner = Owner,
184
182
  unowned = fn.length === 0,
185
183
  current = detachedOwner === undefined ? owner : detachedOwner,
186
- root = unowned
187
- ? {
188
- owned: null,
189
- cleanups: null,
190
- context: null,
191
- owner: null
192
- }
193
- : {
194
- owned: null,
195
- cleanups: null,
196
- context: current ? current.context : null,
197
- owner: current
198
- },
199
- updateFn = unowned
200
- ? () =>
201
- fn(() => {
202
- throw new Error("Dispose method must be an explicit argument to createRoot function");
203
- })
204
- : () => fn(() => untrack(() => cleanNode(root)));
184
+ root = unowned ? {
185
+ owned: null,
186
+ cleanups: null,
187
+ context: null,
188
+ owner: null
189
+ } : {
190
+ owned: null,
191
+ cleanups: null,
192
+ context: current ? current.context : null,
193
+ owner: current
194
+ },
195
+ updateFn = unowned ? () => fn(() => {
196
+ throw new Error("Dispose method must be an explicit argument to createRoot function");
197
+ }) : () => fn(() => untrack(() => cleanNode(root)));
205
198
  DevHooks.afterCreateOwner && DevHooks.afterCreateOwner(root);
206
199
  Owner = root;
207
200
  Listener = null;
@@ -231,26 +224,23 @@ function createSignal(value, options) {
231
224
  }
232
225
  const setter = value => {
233
226
  if (typeof value === "function") {
234
- if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);
235
- else value = value(s.value);
227
+ if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);else value = value(s.value);
236
228
  }
237
229
  return writeSignal(s, value);
238
230
  };
239
231
  return [readSignal.bind(s), setter];
240
232
  }
241
233
  function createComputed(fn, value, options) {
242
- const c = createComputation(fn, value, true, STALE, options);
243
- if (Scheduler && Transition && Transition.running) Updates.push(c);
244
- else updateComputation(c);
234
+ const c = createComputation(fn, value, true, STALE, options );
235
+ if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);
245
236
  }
246
237
  function createRenderEffect(fn, value, options) {
247
- const c = createComputation(fn, value, false, STALE, options);
248
- if (Scheduler && Transition && Transition.running) Updates.push(c);
249
- else updateComputation(c);
238
+ const c = createComputation(fn, value, false, STALE, options );
239
+ if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);
250
240
  }
251
241
  function createEffect(fn, value, options) {
252
242
  runEffects = runUserEffects;
253
- const c = createComputation(fn, value, false, STALE, options),
243
+ const c = createComputation(fn, value, false, STALE, options ),
254
244
  s = SuspenseContext && useContext(SuspenseContext);
255
245
  if (s) c.suspense = s;
256
246
  if (!options || !options.render) c.user = true;
@@ -258,16 +248,10 @@ function createEffect(fn, value, options) {
258
248
  }
259
249
  function createReaction(onInvalidate, options) {
260
250
  let fn;
261
- const c = createComputation(
262
- () => {
263
- fn ? fn() : untrack(onInvalidate);
264
- fn = undefined;
265
- },
266
- undefined,
267
- false,
268
- 0,
269
- options
270
- ),
251
+ const c = createComputation(() => {
252
+ fn ? fn() : untrack(onInvalidate);
253
+ fn = undefined;
254
+ }, undefined, false, 0, options ),
271
255
  s = SuspenseContext && useContext(SuspenseContext);
272
256
  if (s) c.suspense = s;
273
257
  c.user = true;
@@ -278,7 +262,7 @@ function createReaction(onInvalidate, options) {
278
262
  }
279
263
  function createMemo(fn, value, options) {
280
264
  options = options ? Object.assign({}, signalOptions, options) : signalOptions;
281
- const c = createComputation(fn, value, true, 0, options);
265
+ const c = createComputation(fn, value, true, 0, options );
282
266
  c.observers = null;
283
267
  c.observerSlots = null;
284
268
  c.comparator = options.equals || undefined;
@@ -320,19 +304,15 @@ function createResource(pSource, pFetcher, pOptions) {
320
304
  [state, setState] = createSignal(resolved ? "ready" : "unresolved");
321
305
  if (sharedConfig.context) {
322
306
  id = sharedConfig.getNextContextId();
323
- if (options.ssrLoadFrom === "initial") initP = options.initialValue;
324
- else if (sharedConfig.load && sharedConfig.has(id)) initP = sharedConfig.load(id);
307
+ if (options.ssrLoadFrom === "initial") initP = options.initialValue;else if (sharedConfig.load && sharedConfig.has(id)) initP = sharedConfig.load(id);
325
308
  }
326
309
  function loadEnd(p, v, error, key) {
327
310
  if (pr === p) {
328
311
  pr = null;
329
312
  key !== undefined && (resolved = true);
330
- if ((p === initP || v === initP) && options.onHydrated)
331
- queueMicrotask(() =>
332
- options.onHydrated(key, {
333
- value: v
334
- })
335
- );
313
+ if ((p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, {
314
+ value: v
315
+ }));
336
316
  initP = NO_INIT;
337
317
  if (Transition && p && loadedUnderTransition) {
338
318
  Transition.promises.delete(p);
@@ -363,8 +343,7 @@ function createResource(pSource, pFetcher, pOptions) {
363
343
  createComputed(() => {
364
344
  track();
365
345
  if (pr) {
366
- if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);
367
- else if (!contexts.has(c)) {
346
+ if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);else if (!contexts.has(c)) {
368
347
  c.increment();
369
348
  contexts.add(c);
370
349
  }
@@ -383,35 +362,36 @@ function createResource(pSource, pFetcher, pOptions) {
383
362
  return;
384
363
  }
385
364
  if (Transition && pr) Transition.promises.delete(pr);
386
- const p =
387
- initP !== NO_INIT
388
- ? initP
389
- : untrack(() =>
390
- fetcher(lookup, {
391
- value: value(),
392
- refetching
393
- })
394
- );
395
- if (!isPromise(p)) {
365
+ let error;
366
+ const p = initP !== NO_INIT ? initP : untrack(() => {
367
+ try {
368
+ return fetcher(lookup, {
369
+ value: value(),
370
+ refetching
371
+ });
372
+ } catch (fetcherError) {
373
+ error = fetcherError;
374
+ }
375
+ });
376
+ if (error !== undefined) {
377
+ loadEnd(pr, undefined, castError(error), lookup);
378
+ return;
379
+ } else if (!isPromise(p)) {
396
380
  loadEnd(pr, p, undefined, lookup);
397
381
  return p;
398
382
  }
399
383
  pr = p;
400
- if ("value" in p) {
401
- if (p.status === "success") loadEnd(pr, p.value, undefined, lookup);
402
- else loadEnd(pr, undefined, castError(p.value), lookup);
384
+ if ("v" in p) {
385
+ if (p.s === 1) loadEnd(pr, p.v, undefined, lookup);else loadEnd(pr, undefined, castError(p.v), lookup);
403
386
  return p;
404
387
  }
405
388
  scheduled = true;
406
- queueMicrotask(() => (scheduled = false));
389
+ queueMicrotask(() => scheduled = false);
407
390
  runUpdates(() => {
408
391
  setState(resolved ? "refreshing" : "pending");
409
392
  trigger();
410
393
  }, false);
411
- return p.then(
412
- v => loadEnd(p, v, undefined, lookup),
413
- e => loadEnd(p, undefined, castError(e), lookup)
414
- );
394
+ return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e), lookup));
415
395
  }
416
396
  Object.defineProperties(read, {
417
397
  state: {
@@ -436,81 +416,50 @@ function createResource(pSource, pFetcher, pOptions) {
436
416
  }
437
417
  });
438
418
  let owner = Owner;
439
- if (dynamic) createComputed(() => ((owner = Owner), load(false)));
440
- else load(false);
441
- return [
442
- read,
443
- {
444
- refetch: info => runWithOwner(owner, () => load(info)),
445
- mutate: setValue
446
- }
447
- ];
419
+ if (dynamic) createComputed(() => (owner = Owner, load(false)));else load(false);
420
+ return [read, {
421
+ refetch: info => runWithOwner(owner, () => load(info)),
422
+ mutate: setValue
423
+ }];
448
424
  }
449
425
  function createDeferred(source, options) {
450
426
  let t,
451
427
  timeout = options ? options.timeoutMs : undefined;
452
- const node = createComputation(
453
- () => {
454
- if (!t || !t.fn)
455
- t = requestCallback(
456
- () => setDeferred(() => node.value),
457
- timeout !== undefined
458
- ? {
459
- timeout
460
- }
461
- : undefined
462
- );
463
- return source();
464
- },
465
- undefined,
466
- true
467
- );
468
- const [deferred, setDeferred] = createSignal(
469
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
470
- options
471
- );
428
+ const node = createComputation(() => {
429
+ if (!t || !t.fn) t = requestCallback(() => setDeferred(() => node.value), timeout !== undefined ? {
430
+ timeout
431
+ } : undefined);
432
+ return source();
433
+ }, undefined, true);
434
+ const [deferred, setDeferred] = createSignal(Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, options);
472
435
  updateComputation(node);
473
- setDeferred(() =>
474
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value
475
- );
436
+ setDeferred(() => Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
476
437
  return deferred;
477
438
  }
478
439
  function createSelector(source, fn = equalFn, options) {
479
440
  const subs = new Map();
480
- const node = createComputation(
481
- p => {
482
- const v = source();
483
- for (const [key, val] of subs.entries())
484
- if (fn(key, v) !== fn(key, p)) {
485
- for (const c of val.values()) {
486
- c.state = STALE;
487
- if (c.pure) Updates.push(c);
488
- else Effects.push(c);
489
- }
490
- }
491
- return v;
492
- },
493
- undefined,
494
- true,
495
- STALE,
496
- options
497
- );
441
+ const node = createComputation(p => {
442
+ const v = source();
443
+ for (const [key, val] of subs.entries()) if (fn(key, v) !== fn(key, p)) {
444
+ for (const c of val.values()) {
445
+ c.state = STALE;
446
+ if (c.pure) Updates.push(c);else Effects.push(c);
447
+ }
448
+ }
449
+ return v;
450
+ }, undefined, true, STALE, options );
498
451
  updateComputation(node);
499
452
  return key => {
500
453
  const listener = Listener;
501
454
  if (listener) {
502
455
  let l;
503
- if ((l = subs.get(key))) l.add(listener);
504
- else subs.set(key, (l = new Set([listener])));
456
+ if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));
505
457
  onCleanup(() => {
506
458
  l.delete(listener);
507
459
  !l.size && subs.delete(key);
508
460
  });
509
461
  }
510
- return fn(
511
- key,
512
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value
513
- );
462
+ return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
514
463
  };
515
464
  }
516
465
  function batch(fn) {
@@ -550,10 +499,7 @@ function onMount(fn) {
550
499
  createEffect(() => untrack(fn));
551
500
  }
552
501
  function onCleanup(fn) {
553
- if (Owner === null)
554
- console.warn("cleanups created outside a `createRoot` or `render` will never be run");
555
- else if (Owner.cleanups === null) Owner.cleanups = [fn];
556
- else Owner.cleanups.push(fn);
502
+ if (Owner === null) console.warn("cleanups created outside a `createRoot` or `render` will never be run");else if (Owner.cleanups === null) Owner.cleanups = [fn];else Owner.cleanups.push(fn);
557
503
  return fn;
558
504
  }
559
505
  function catchError(fn, handler) {
@@ -607,17 +553,15 @@ function startTransition(fn) {
607
553
  Owner = o;
608
554
  let t;
609
555
  if (Scheduler || SuspenseContext) {
610
- t =
611
- Transition ||
612
- (Transition = {
613
- sources: new Set(),
614
- effects: [],
615
- promises: new Set(),
616
- disposed: new Set(),
617
- queue: new Set(),
618
- running: true
619
- });
620
- t.done || (t.done = new Promise(res => (t.resolve = res)));
556
+ t = Transition || (Transition = {
557
+ sources: new Set(),
558
+ effects: [],
559
+ promises: new Set(),
560
+ disposed: new Set(),
561
+ queue: new Set(),
562
+ running: true
563
+ });
564
+ t.done || (t.done = new Promise(res => t.resolve = res));
621
565
  t.running = true;
622
566
  }
623
567
  runUpdates(fn, false);
@@ -625,7 +569,7 @@ function startTransition(fn) {
625
569
  return t ? t.done : undefined;
626
570
  });
627
571
  }
628
- const [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);
572
+ const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
629
573
  function useTransition() {
630
574
  return [transPending, startTransition];
631
575
  }
@@ -634,18 +578,12 @@ function resumeEffects(e) {
634
578
  e.length = 0;
635
579
  }
636
580
  function devComponent(Comp, props) {
637
- const c = createComputation(
638
- () =>
639
- untrack(() => {
640
- Object.assign(Comp, {
641
- [$DEVCOMP]: true
642
- });
643
- return Comp(props);
644
- }),
645
- undefined,
646
- true,
647
- 0
648
- );
581
+ const c = createComputation(() => untrack(() => {
582
+ Object.assign(Comp, {
583
+ [$DEVCOMP]: true
584
+ });
585
+ return Comp(props);
586
+ }), undefined, true, 0);
649
587
  c.props = props;
650
588
  c.observers = null;
651
589
  c.observerSlots = null;
@@ -656,8 +594,7 @@ function devComponent(Comp, props) {
656
594
  }
657
595
  function registerGraph(value) {
658
596
  if (Owner) {
659
- if (Owner.sourceMap) Owner.sourceMap.push(value);
660
- else Owner.sourceMap = [value];
597
+ if (Owner.sourceMap) Owner.sourceMap.push(value);else Owner.sourceMap = [value];
661
598
  value.graph = Owner;
662
599
  }
663
600
  if (DevHooks.afterRegisterGraph) DevHooks.afterRegisterGraph(value);
@@ -672,15 +609,13 @@ function createContext(defaultValue, options) {
672
609
  }
673
610
  function useContext(context) {
674
611
  let value;
675
- return Owner && Owner.context && (value = Owner.context[context.id]) !== undefined
676
- ? value
677
- : context.defaultValue;
612
+ return Owner && Owner.context && (value = Owner.context[context.id]) !== undefined ? value : context.defaultValue;
678
613
  }
679
614
  function children(fn) {
680
615
  const children = createMemo(fn);
681
616
  const memo = createMemo(() => resolveChildren(children()), undefined, {
682
617
  name: "children"
683
- });
618
+ }) ;
684
619
  memo.toArray = () => {
685
620
  const c = memo();
686
621
  return Array.isArray(c) ? c : c != null ? [c] : [];
@@ -693,7 +628,10 @@ function getSuspenseContext() {
693
628
  }
694
629
  function enableExternalSource(factory, untrack = fn => fn()) {
695
630
  if (ExternalSourceConfig) {
696
- const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;
631
+ const {
632
+ factory: oldFactory,
633
+ untrack: oldUntrack
634
+ } = ExternalSourceConfig;
697
635
  ExternalSourceConfig = {
698
636
  factory: (fn, trigger) => {
699
637
  const oldSource = oldFactory(fn, trigger);
@@ -718,8 +656,7 @@ function enableExternalSource(factory, untrack = fn => fn()) {
718
656
  function readSignal() {
719
657
  const runningTransition = Transition && Transition.running;
720
658
  if (this.sources && (runningTransition ? this.tState : this.state)) {
721
- if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);
722
- else {
659
+ if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);else {
723
660
  const updates = Updates;
724
661
  Updates = null;
725
662
  runUpdates(() => lookUpstream(this), false);
@@ -747,12 +684,11 @@ function readSignal() {
747
684
  return this.value;
748
685
  }
749
686
  function writeSignal(node, value, isComp) {
750
- let current =
751
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
687
+ let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
752
688
  if (!node.comparator || !node.comparator(current, value)) {
753
689
  if (Transition) {
754
690
  const TransitionRunning = Transition.running;
755
- if (TransitionRunning || (!isComp && Transition.sources.has(node))) {
691
+ if (TransitionRunning || !isComp && Transition.sources.has(node)) {
756
692
  Transition.sources.add(node);
757
693
  node.tValue = value;
758
694
  }
@@ -765,12 +701,10 @@ function writeSignal(node, value, isComp) {
765
701
  const TransitionRunning = Transition && Transition.running;
766
702
  if (TransitionRunning && Transition.disposed.has(o)) continue;
767
703
  if (TransitionRunning ? !o.tState : !o.state) {
768
- if (o.pure) Updates.push(o);
769
- else Effects.push(o);
704
+ if (o.pure) Updates.push(o);else Effects.push(o);
770
705
  if (o.observers) markDownstream(o);
771
706
  }
772
- if (!TransitionRunning) o.state = STALE;
773
- else o.tState = STALE;
707
+ if (!TransitionRunning) o.state = STALE;else o.tState = STALE;
774
708
  }
775
709
  if (Updates.length > 10e5) {
776
710
  Updates = [];
@@ -786,11 +720,7 @@ function updateComputation(node) {
786
720
  if (!node.fn) return;
787
721
  cleanNode(node);
788
722
  const time = ExecCount;
789
- runComputation(
790
- node,
791
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
792
- time
793
- );
723
+ runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
794
724
  if (Transition && !Transition.running && Transition.sources.has(node)) {
795
725
  queueMicrotask(() => {
796
726
  runUpdates(() => {
@@ -855,15 +785,11 @@ function createComputation(fn, init, pure, state = STALE, options) {
855
785
  c.state = 0;
856
786
  c.tState = state;
857
787
  }
858
- if (Owner === null)
859
- console.warn("computations created outside a `createRoot` or `render` will never be disposed");
860
- else if (Owner !== UNOWNED) {
788
+ if (Owner === null) console.warn("computations created outside a `createRoot` or `render` will never be disposed");else if (Owner !== UNOWNED) {
861
789
  if (Transition && Transition.running && Owner.pure) {
862
- if (!Owner.tOwned) Owner.tOwned = [c];
863
- else Owner.tOwned.push(c);
790
+ if (!Owner.tOwned) Owner.tOwned = [c];else Owner.tOwned.push(c);
864
791
  } else {
865
- if (!Owner.owned) Owner.owned = [c];
866
- else Owner.owned.push(c);
792
+ if (!Owner.owned) Owner.owned = [c];else Owner.owned.push(c);
867
793
  }
868
794
  }
869
795
  if (options && options.name) c.name = options.name;
@@ -916,8 +842,7 @@ function runUpdates(fn, init) {
916
842
  if (Updates) return fn();
917
843
  let wait = false;
918
844
  if (!init) Updates = [];
919
- if (Effects) wait = true;
920
- else Effects = [];
845
+ if (Effects) wait = true;else Effects = [];
921
846
  ExecCount++;
922
847
  try {
923
848
  const res = fn();
@@ -931,8 +856,7 @@ function runUpdates(fn, init) {
931
856
  }
932
857
  function completeUpdates(wait) {
933
858
  if (Updates) {
934
- if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);
935
- else runQueue(Updates);
859
+ if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);else runQueue(Updates);
936
860
  Updates = null;
937
861
  }
938
862
  if (wait) return;
@@ -972,8 +896,7 @@ function completeUpdates(wait) {
972
896
  }
973
897
  const e = Effects;
974
898
  Effects = null;
975
- if (e.length) runUpdates(() => runEffects(e), false);
976
- else DevHooks.afterUpdate && DevHooks.afterUpdate();
899
+ if (e.length) runUpdates(() => runEffects(e), false);else DevHooks.afterUpdate && DevHooks.afterUpdate();
977
900
  if (res) res();
978
901
  }
979
902
  function runQueue(queue) {
@@ -1001,8 +924,7 @@ function runUserEffects(queue) {
1001
924
  userLength = 0;
1002
925
  for (i = 0; i < queue.length; i++) {
1003
926
  const e = queue[i];
1004
- if (!e.user) runTop(e);
1005
- else queue[userLength++] = e;
927
+ if (!e.user) runTop(e);else queue[userLength++] = e;
1006
928
  }
1007
929
  if (sharedConfig.context) {
1008
930
  if (sharedConfig.count) {
@@ -1021,15 +943,13 @@ function runUserEffects(queue) {
1021
943
  }
1022
944
  function lookUpstream(node, ignore) {
1023
945
  const runningTransition = Transition && Transition.running;
1024
- if (runningTransition) node.tState = 0;
1025
- else node.state = 0;
946
+ if (runningTransition) node.tState = 0;else node.state = 0;
1026
947
  for (let i = 0; i < node.sources.length; i += 1) {
1027
948
  const source = node.sources[i];
1028
949
  if (source.sources) {
1029
950
  const state = runningTransition ? source.tState : source.state;
1030
951
  if (state === STALE) {
1031
- if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
1032
- runTop(source);
952
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
1033
953
  } else if (state === PENDING) lookUpstream(source, ignore);
1034
954
  }
1035
955
  }
@@ -1039,10 +959,8 @@ function markDownstream(node) {
1039
959
  for (let i = 0; i < node.observers.length; i += 1) {
1040
960
  const o = node.observers[i];
1041
961
  if (runningTransition ? !o.tState : !o.state) {
1042
- if (runningTransition) o.tState = PENDING;
1043
- else o.state = PENDING;
1044
- if (o.pure) Updates.push(o);
1045
- else Effects.push(o);
962
+ if (runningTransition) o.tState = PENDING;else o.state = PENDING;
963
+ if (o.pure) Updates.push(o);else Effects.push(o);
1046
964
  o.observers && markDownstream(o);
1047
965
  }
1048
966
  }
@@ -1079,8 +997,7 @@ function cleanNode(node) {
1079
997
  for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
1080
998
  node.cleanups = null;
1081
999
  }
1082
- if (Transition && Transition.running) node.tState = 0;
1083
- else node.state = 0;
1000
+ if (Transition && Transition.running) node.tState = 0;else node.state = 0;
1084
1001
  delete node.sourceMap;
1085
1002
  }
1086
1003
  function reset(node, top) {
@@ -1102,21 +1019,19 @@ function runErrors(err, fns, owner) {
1102
1019
  try {
1103
1020
  for (const f of fns) f(err);
1104
1021
  } catch (e) {
1105
- handleError(e, (owner && owner.owner) || null);
1022
+ handleError(e, owner && owner.owner || null);
1106
1023
  }
1107
1024
  }
1108
1025
  function handleError(err, owner = Owner) {
1109
1026
  const fns = ERROR && owner && owner.context && owner.context[ERROR];
1110
1027
  const error = castError(err);
1111
1028
  if (!fns) throw error;
1112
- if (Effects)
1113
- Effects.push({
1114
- fn() {
1115
- runErrors(error, fns, owner);
1116
- },
1117
- state: STALE
1118
- });
1119
- else runErrors(error, fns, owner);
1029
+ if (Effects) Effects.push({
1030
+ fn() {
1031
+ runErrors(error, fns, owner);
1032
+ },
1033
+ state: STALE
1034
+ });else runErrors(error, fns, owner);
1120
1035
  }
1121
1036
  function resolveChildren(children) {
1122
1037
  if (typeof children === "function" && !children.length) return resolveChildren(children());
@@ -1133,26 +1048,19 @@ function resolveChildren(children) {
1133
1048
  function createProvider(id, options) {
1134
1049
  return function provider(props) {
1135
1050
  let res;
1136
- createRenderEffect(
1137
- () =>
1138
- (res = untrack(() => {
1139
- Owner.context = {
1140
- ...Owner.context,
1141
- [id]: props.value
1142
- };
1143
- return children(() => props.children);
1144
- })),
1145
- undefined,
1146
- options
1147
- );
1051
+ createRenderEffect(() => res = untrack(() => {
1052
+ Owner.context = {
1053
+ ...Owner.context,
1054
+ [id]: props.value
1055
+ };
1056
+ return children(() => props.children);
1057
+ }), undefined, options);
1148
1058
  return res;
1149
1059
  };
1150
1060
  }
1151
1061
  function onError(fn) {
1152
1062
  ERROR || (ERROR = Symbol("error"));
1153
- if (Owner === null)
1154
- console.warn("error handlers created outside a `createRoot` or `render` will never be run");
1155
- else if (Owner.context === null || !Owner.context[ERROR]) {
1063
+ if (Owner === null) console.warn("error handlers created outside a `createRoot` or `render` will never be run");else if (Owner.context === null || !Owner.context[ERROR]) {
1156
1064
  Owner.context = {
1157
1065
  ...Owner.context,
1158
1066
  [ERROR]: [fn]
@@ -1181,8 +1089,7 @@ function observable(input) {
1181
1089
  if (!(observer instanceof Object) || observer == null) {
1182
1090
  throw new TypeError("Expected the observer to be an object.");
1183
1091
  }
1184
- const handler =
1185
- typeof observer === "function" ? observer : observer.next && observer.next.bind(observer);
1092
+ const handler = typeof observer === "function" ? observer : observer.next && observer.next.bind(observer);
1186
1093
  if (!handler) {
1187
1094
  return {
1188
1095
  unsubscribe() {}
@@ -1213,7 +1120,7 @@ function from(producer, initalValue = undefined) {
1213
1120
  });
1214
1121
  if ("subscribe" in producer) {
1215
1122
  const unsub = producer.subscribe(v => set(() => v));
1216
- onCleanup(() => ("unsubscribe" in unsub ? unsub.unsubscribe() : unsub()));
1123
+ onCleanup(() => "unsubscribe" in unsub ? unsub.unsubscribe() : unsub());
1217
1124
  } else {
1218
1125
  const clean = producer(set);
1219
1126
  onCleanup(clean);
@@ -1257,7 +1164,8 @@ function mapArray(list, mapFn, options = {}) {
1257
1164
  });
1258
1165
  len = 1;
1259
1166
  }
1260
- } else if (len === 0) {
1167
+ }
1168
+ else if (len === 0) {
1261
1169
  mapped = new Array(newLen);
1262
1170
  for (j = 0; j < newLen; j++) {
1263
1171
  items[j] = newItems[j];
@@ -1268,16 +1176,8 @@ function mapArray(list, mapFn, options = {}) {
1268
1176
  temp = new Array(newLen);
1269
1177
  tempdisposers = new Array(newLen);
1270
1178
  indexes && (tempIndexes = new Array(newLen));
1271
- for (
1272
- start = 0, end = Math.min(len, newLen);
1273
- start < end && items[start] === newItems[start];
1274
- start++
1275
- );
1276
- for (
1277
- end = len - 1, newEnd = newLen - 1;
1278
- end >= start && newEnd >= start && items[end] === newItems[newEnd];
1279
- end--, newEnd--
1280
- ) {
1179
+ for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++);
1180
+ for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {
1281
1181
  temp[newEnd] = mapped[end];
1282
1182
  tempdisposers[newEnd] = disposers[end];
1283
1183
  indexes && (tempIndexes[newEnd] = indexes[end]);
@@ -1311,7 +1211,7 @@ function mapArray(list, mapFn, options = {}) {
1311
1211
  }
1312
1212
  } else mapped[j] = createRoot(mapper);
1313
1213
  }
1314
- mapped = mapped.slice(0, (len = newLen));
1214
+ mapped = mapped.slice(0, len = newLen);
1315
1215
  items = newItems.slice(0);
1316
1216
  }
1317
1217
  return mapped;
@@ -1321,7 +1221,7 @@ function mapArray(list, mapFn, options = {}) {
1321
1221
  if (indexes) {
1322
1222
  const [s, set] = createSignal(j, {
1323
1223
  name: "index"
1324
- });
1224
+ }) ;
1325
1225
  indexes[j] = set;
1326
1226
  return mapFn(newItems[j], s);
1327
1227
  }
@@ -1380,13 +1280,13 @@ function indexArray(list, mapFn, options = {}) {
1380
1280
  }
1381
1281
  len = signals.length = disposers.length = newLen;
1382
1282
  items = newItems.slice(0);
1383
- return (mapped = mapped.slice(0, len));
1283
+ return mapped = mapped.slice(0, len);
1384
1284
  });
1385
1285
  function mapper(disposer) {
1386
1286
  disposers[i] = disposer;
1387
1287
  const [s, set] = createSignal(newItems[i], {
1388
1288
  name: "value"
1389
- });
1289
+ }) ;
1390
1290
  signals[i] = set;
1391
1291
  return mapFn(s, i);
1392
1292
  }
@@ -1402,7 +1302,7 @@ function createComponent(Comp, props) {
1402
1302
  if (sharedConfig.context) {
1403
1303
  const c = sharedConfig.context;
1404
1304
  setHydrateContext(nextHydrateContext());
1405
- const r = devComponent(Comp, props || {});
1305
+ const r = devComponent(Comp, props || {}) ;
1406
1306
  setHydrateContext(c);
1407
1307
  return r;
1408
1308
  }
@@ -1451,33 +1351,29 @@ function mergeProps(...sources) {
1451
1351
  let proxy = false;
1452
1352
  for (let i = 0; i < sources.length; i++) {
1453
1353
  const s = sources[i];
1454
- proxy = proxy || (!!s && $PROXY in s);
1455
- sources[i] = typeof s === "function" ? ((proxy = true), createMemo(s)) : s;
1354
+ proxy = proxy || !!s && $PROXY in s;
1355
+ sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
1456
1356
  }
1457
1357
  if (SUPPORTS_PROXY && proxy) {
1458
- return new Proxy(
1459
- {
1460
- get(property) {
1461
- for (let i = sources.length - 1; i >= 0; i--) {
1462
- const v = resolveSource(sources[i])[property];
1463
- if (v !== undefined) return v;
1464
- }
1465
- },
1466
- has(property) {
1467
- for (let i = sources.length - 1; i >= 0; i--) {
1468
- if (property in resolveSource(sources[i])) return true;
1469
- }
1470
- return false;
1471
- },
1472
- keys() {
1473
- const keys = [];
1474
- for (let i = 0; i < sources.length; i++)
1475
- keys.push(...Object.keys(resolveSource(sources[i])));
1476
- return [...new Set(keys)];
1358
+ return new Proxy({
1359
+ get(property) {
1360
+ for (let i = sources.length - 1; i >= 0; i--) {
1361
+ const v = resolveSource(sources[i])[property];
1362
+ if (v !== undefined) return v;
1363
+ }
1364
+ },
1365
+ has(property) {
1366
+ for (let i = sources.length - 1; i >= 0; i--) {
1367
+ if (property in resolveSource(sources[i])) return true;
1477
1368
  }
1369
+ return false;
1478
1370
  },
1479
- propTraps
1480
- );
1371
+ keys() {
1372
+ const keys = [];
1373
+ for (let i = 0; i < sources.length; i++) keys.push(...Object.keys(resolveSource(sources[i])));
1374
+ return [...new Set(keys)];
1375
+ }
1376
+ }, propTraps);
1481
1377
  }
1482
1378
  const sourcesMap = {};
1483
1379
  const defined = Object.create(null);
@@ -1490,20 +1386,15 @@ function mergeProps(...sources) {
1490
1386
  if (key === "__proto__" || key === "constructor") continue;
1491
1387
  const desc = Object.getOwnPropertyDescriptor(source, key);
1492
1388
  if (!defined[key]) {
1493
- defined[key] = desc.get
1494
- ? {
1495
- enumerable: true,
1496
- configurable: true,
1497
- get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))
1498
- }
1499
- : desc.value !== undefined
1500
- ? desc
1501
- : undefined;
1389
+ defined[key] = desc.get ? {
1390
+ enumerable: true,
1391
+ configurable: true,
1392
+ get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])
1393
+ } : desc.value !== undefined ? desc : undefined;
1502
1394
  } else {
1503
1395
  const sources = sourcesMap[key];
1504
1396
  if (sources) {
1505
- if (desc.get) sources.push(desc.get.bind(source));
1506
- else if (desc.value !== undefined) sources.push(() => desc.value);
1397
+ if (desc.get) sources.push(desc.get.bind(source));else if (desc.value !== undefined) sources.push(() => desc.value);
1507
1398
  }
1508
1399
  }
1509
1400
  }
@@ -1513,8 +1404,7 @@ function mergeProps(...sources) {
1513
1404
  for (let i = definedKeys.length - 1; i >= 0; i--) {
1514
1405
  const key = definedKeys[i],
1515
1406
  desc = defined[key];
1516
- if (desc && desc.get) Object.defineProperty(target, key, desc);
1517
- else target[key] = desc ? desc.value : undefined;
1407
+ if (desc && desc.get) Object.defineProperty(target, key, desc);else target[key] = desc ? desc.value : undefined;
1518
1408
  }
1519
1409
  return target;
1520
1410
  }
@@ -1522,60 +1412,47 @@ function splitProps(props, ...keys) {
1522
1412
  if (SUPPORTS_PROXY && $PROXY in props) {
1523
1413
  const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);
1524
1414
  const res = keys.map(k => {
1525
- return new Proxy(
1526
- {
1527
- get(property) {
1528
- return k.includes(property) ? props[property] : undefined;
1529
- },
1530
- has(property) {
1531
- return k.includes(property) && property in props;
1532
- },
1533
- keys() {
1534
- return k.filter(property => property in props);
1535
- }
1415
+ return new Proxy({
1416
+ get(property) {
1417
+ return k.includes(property) ? props[property] : undefined;
1536
1418
  },
1537
- propTraps
1538
- );
1539
- });
1540
- res.push(
1541
- new Proxy(
1542
- {
1543
- get(property) {
1544
- return blocked.has(property) ? undefined : props[property];
1545
- },
1546
- has(property) {
1547
- return blocked.has(property) ? false : property in props;
1548
- },
1549
- keys() {
1550
- return Object.keys(props).filter(k => !blocked.has(k));
1551
- }
1419
+ has(property) {
1420
+ return k.includes(property) && property in props;
1552
1421
  },
1553
- propTraps
1554
- )
1555
- );
1422
+ keys() {
1423
+ return k.filter(property => property in props);
1424
+ }
1425
+ }, propTraps);
1426
+ });
1427
+ res.push(new Proxy({
1428
+ get(property) {
1429
+ return blocked.has(property) ? undefined : props[property];
1430
+ },
1431
+ has(property) {
1432
+ return blocked.has(property) ? false : property in props;
1433
+ },
1434
+ keys() {
1435
+ return Object.keys(props).filter(k => !blocked.has(k));
1436
+ }
1437
+ }, propTraps));
1556
1438
  return res;
1557
1439
  }
1558
1440
  const otherObject = {};
1559
1441
  const objects = keys.map(() => ({}));
1560
1442
  for (const propName of Object.getOwnPropertyNames(props)) {
1561
1443
  const desc = Object.getOwnPropertyDescriptor(props, propName);
1562
- const isDefaultDesc =
1563
- !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;
1444
+ const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;
1564
1445
  let blocked = false;
1565
1446
  let objectIndex = 0;
1566
1447
  for (const k of keys) {
1567
1448
  if (k.includes(propName)) {
1568
1449
  blocked = true;
1569
- isDefaultDesc
1570
- ? (objects[objectIndex][propName] = desc.value)
1571
- : Object.defineProperty(objects[objectIndex], propName, desc);
1450
+ isDefaultDesc ? objects[objectIndex][propName] = desc.value : Object.defineProperty(objects[objectIndex], propName, desc);
1572
1451
  }
1573
1452
  ++objectIndex;
1574
1453
  }
1575
1454
  if (!blocked) {
1576
- isDefaultDesc
1577
- ? (otherObject[propName] = desc.value)
1578
- : Object.defineProperty(otherObject, propName, desc);
1455
+ isDefaultDesc ? otherObject[propName] = desc.value : Object.defineProperty(otherObject, propName, desc);
1579
1456
  }
1580
1457
  }
1581
1458
  return [...objects, otherObject];
@@ -1601,24 +1478,19 @@ function lazy(fn) {
1601
1478
  comp = s;
1602
1479
  }
1603
1480
  let Comp;
1604
- return createMemo(() =>
1605
- (Comp = comp())
1606
- ? untrack(() => {
1607
- if (IS_DEV)
1608
- Object.assign(Comp, {
1609
- [$DEVCOMP]: true
1610
- });
1611
- if (!ctx || sharedConfig.done) return Comp(props);
1612
- const c = sharedConfig.context;
1613
- setHydrateContext(ctx);
1614
- const r = Comp(props);
1615
- setHydrateContext(c);
1616
- return r;
1617
- })
1618
- : ""
1619
- );
1481
+ return createMemo(() => (Comp = comp()) ? untrack(() => {
1482
+ if (IS_DEV) Object.assign(Comp, {
1483
+ [$DEVCOMP]: true
1484
+ });
1485
+ if (!ctx || sharedConfig.done) return Comp(props);
1486
+ const c = sharedConfig.context;
1487
+ setHydrateContext(ctx);
1488
+ const r = Comp(props);
1489
+ setHydrateContext(c);
1490
+ return r;
1491
+ }) : "");
1620
1492
  };
1621
- wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);
1493
+ wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p);
1622
1494
  return wrap;
1623
1495
  }
1624
1496
  let counter = 0;
@@ -1627,69 +1499,46 @@ function createUniqueId() {
1627
1499
  return ctx ? sharedConfig.getNextContextId() : `cl-${counter++}`;
1628
1500
  }
1629
1501
 
1630
- const narrowedError = name =>
1631
- `Attempting to access a stale value from <${name}> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.`;
1502
+ const narrowedError = name => `Attempting to access a stale value from <${name}> that could possibly be undefined. This may occur because you are reading the accessor returned from the component at a time where it has already been unmounted. We recommend cleaning up any stale timers or async, or reading from the initial condition.` ;
1632
1503
  function For(props) {
1633
1504
  const fallback = "fallback" in props && {
1634
1505
  fallback: () => props.fallback
1635
1506
  };
1636
- return createMemo(
1637
- mapArray(() => props.each, props.children, fallback || undefined),
1638
- undefined,
1639
- {
1640
- name: "value"
1641
- }
1642
- );
1507
+ return createMemo(mapArray(() => props.each, props.children, fallback || undefined), undefined, {
1508
+ name: "value"
1509
+ }) ;
1643
1510
  }
1644
1511
  function Index(props) {
1645
1512
  const fallback = "fallback" in props && {
1646
1513
  fallback: () => props.fallback
1647
1514
  };
1648
- return createMemo(
1649
- indexArray(() => props.each, props.children, fallback || undefined),
1650
- undefined,
1651
- {
1652
- name: "value"
1653
- }
1654
- );
1515
+ return createMemo(indexArray(() => props.each, props.children, fallback || undefined), undefined, {
1516
+ name: "value"
1517
+ }) ;
1655
1518
  }
1656
1519
  function Show(props) {
1657
1520
  const keyed = props.keyed;
1658
1521
  const conditionValue = createMemo(() => props.when, undefined, {
1659
1522
  name: "condition value"
1660
- });
1661
- const condition = keyed
1662
- ? conditionValue
1663
- : createMemo(conditionValue, undefined, {
1664
- equals: (a, b) => !a === !b,
1665
- name: "condition"
1666
- });
1667
- return createMemo(
1668
- () => {
1669
- const c = condition();
1670
- if (c) {
1671
- const child = props.children;
1672
- const fn = typeof child === "function" && child.length > 0;
1673
- return fn
1674
- ? untrack(() =>
1675
- child(
1676
- keyed
1677
- ? c
1678
- : () => {
1679
- if (!untrack(condition)) throw narrowedError("Show");
1680
- return conditionValue();
1681
- }
1682
- )
1683
- )
1684
- : child;
1685
- }
1686
- return props.fallback;
1687
- },
1688
- undefined,
1689
- {
1690
- name: "value"
1523
+ } );
1524
+ const condition = keyed ? conditionValue : createMemo(conditionValue, undefined, {
1525
+ equals: (a, b) => !a === !b,
1526
+ name: "condition"
1527
+ } );
1528
+ return createMemo(() => {
1529
+ const c = condition();
1530
+ if (c) {
1531
+ const child = props.children;
1532
+ const fn = typeof child === "function" && child.length > 0;
1533
+ return fn ? untrack(() => child(keyed ? c : () => {
1534
+ if (!untrack(condition)) throw narrowedError("Show");
1535
+ return conditionValue();
1536
+ })) : child;
1691
1537
  }
1692
- );
1538
+ return props.fallback;
1539
+ }, undefined, {
1540
+ name: "value"
1541
+ } );
1693
1542
  }
1694
1543
  function Switch(props) {
1695
1544
  const chs = children(() => props.children);
@@ -1701,44 +1550,30 @@ function Switch(props) {
1701
1550
  const index = i;
1702
1551
  const mp = mps[i];
1703
1552
  const prevFunc = func;
1704
- const conditionValue = createMemo(() => (prevFunc() ? undefined : mp.when), undefined, {
1553
+ const conditionValue = createMemo(() => prevFunc() ? undefined : mp.when, undefined, {
1705
1554
  name: "condition value"
1706
- });
1707
- const condition = mp.keyed
1708
- ? conditionValue
1709
- : createMemo(conditionValue, undefined, {
1710
- equals: (a, b) => !a === !b,
1711
- name: "condition"
1712
- });
1555
+ } );
1556
+ const condition = mp.keyed ? conditionValue : createMemo(conditionValue, undefined, {
1557
+ equals: (a, b) => !a === !b,
1558
+ name: "condition"
1559
+ } );
1713
1560
  func = () => prevFunc() || (condition() ? [index, conditionValue, mp] : undefined);
1714
1561
  }
1715
1562
  return func;
1716
1563
  });
1717
- return createMemo(
1718
- () => {
1719
- const sel = switchFunc()();
1720
- if (!sel) return props.fallback;
1721
- const [index, conditionValue, mp] = sel;
1722
- const child = mp.children;
1723
- const fn = typeof child === "function" && child.length > 0;
1724
- return fn
1725
- ? untrack(() =>
1726
- child(
1727
- mp.keyed
1728
- ? conditionValue()
1729
- : () => {
1730
- if (untrack(switchFunc)()?.[0] !== index) throw narrowedError("Match");
1731
- return conditionValue();
1732
- }
1733
- )
1734
- )
1735
- : child;
1736
- },
1737
- undefined,
1738
- {
1739
- name: "eval conditions"
1740
- }
1741
- );
1564
+ return createMemo(() => {
1565
+ const sel = switchFunc()();
1566
+ if (!sel) return props.fallback;
1567
+ const [index, conditionValue, mp] = sel;
1568
+ const child = mp.children;
1569
+ const fn = typeof child === "function" && child.length > 0;
1570
+ return fn ? untrack(() => child(mp.keyed ? conditionValue() : () => {
1571
+ if (untrack(switchFunc)()?.[0] !== index) throw narrowedError("Match");
1572
+ return conditionValue();
1573
+ })) : child;
1574
+ }, undefined, {
1575
+ name: "eval conditions"
1576
+ } );
1742
1577
  }
1743
1578
  function Match(props) {
1744
1579
  return props;
@@ -1749,34 +1584,28 @@ function resetErrorBoundaries() {
1749
1584
  }
1750
1585
  function ErrorBoundary(props) {
1751
1586
  let err;
1752
- if (sharedConfig.context && sharedConfig.load)
1753
- err = sharedConfig.load(sharedConfig.getContextId());
1587
+ if (sharedConfig.context && sharedConfig.load) err = sharedConfig.load(sharedConfig.getContextId());
1754
1588
  const [errored, setErrored] = createSignal(err, {
1755
1589
  name: "errored"
1756
- });
1590
+ } );
1757
1591
  Errors || (Errors = new Set());
1758
1592
  Errors.add(setErrored);
1759
1593
  onCleanup(() => Errors.delete(setErrored));
1760
- return createMemo(
1761
- () => {
1762
- let e;
1763
- if ((e = errored())) {
1764
- const f = props.fallback;
1765
- if (typeof f !== "function" || f.length == 0) console.error(e);
1766
- return typeof f === "function" && f.length ? untrack(() => f(e, () => setErrored())) : f;
1767
- }
1768
- return catchError(() => props.children, setErrored);
1769
- },
1770
- undefined,
1771
- {
1772
- name: "value"
1594
+ return createMemo(() => {
1595
+ let e;
1596
+ if (e = errored()) {
1597
+ const f = props.fallback;
1598
+ if ((typeof f !== "function" || f.length == 0)) console.error(e);
1599
+ return typeof f === "function" && f.length ? untrack(() => f(e, () => setErrored())) : f;
1773
1600
  }
1774
- );
1601
+ return catchError(() => props.children, setErrored);
1602
+ }, undefined, {
1603
+ name: "value"
1604
+ } );
1775
1605
  }
1776
1606
 
1777
- const suspenseListEquals = (a, b) =>
1778
- a.showContent === b.showContent && a.showFallback === b.showFallback;
1779
- const SuspenseListContext = /* #__PURE__ */ createContext();
1607
+ const suspenseListEquals = (a, b) => a.showContent === b.showContent && a.showFallback === b.showFallback;
1608
+ const SuspenseListContext = /* #__PURE__ */createContext();
1780
1609
  function SuspenseList(props) {
1781
1610
  let [wrapper, setWrapper] = createSignal(() => ({
1782
1611
  inFallback: false
@@ -1787,51 +1616,51 @@ function SuspenseList(props) {
1787
1616
  if (listContext) {
1788
1617
  show = listContext.register(createMemo(() => wrapper()().inFallback));
1789
1618
  }
1790
- const resolved = createMemo(
1791
- prev => {
1792
- const reveal = props.revealOrder,
1793
- tail = props.tail,
1794
- { showContent = true, showFallback = true } = show ? show() : {},
1795
- reg = registry(),
1796
- reverse = reveal === "backwards";
1797
- if (reveal === "together") {
1798
- const all = reg.every(inFallback => !inFallback());
1799
- const res = reg.map(() => ({
1800
- showContent: all && showContent,
1619
+ const resolved = createMemo(prev => {
1620
+ const reveal = props.revealOrder,
1621
+ tail = props.tail,
1622
+ {
1623
+ showContent = true,
1624
+ showFallback = true
1625
+ } = show ? show() : {},
1626
+ reg = registry(),
1627
+ reverse = reveal === "backwards";
1628
+ if (reveal === "together") {
1629
+ const all = reg.every(inFallback => !inFallback());
1630
+ const res = reg.map(() => ({
1631
+ showContent: all && showContent,
1632
+ showFallback
1633
+ }));
1634
+ res.inFallback = !all;
1635
+ return res;
1636
+ }
1637
+ let stop = false;
1638
+ let inFallback = prev.inFallback;
1639
+ const res = [];
1640
+ for (let i = 0, len = reg.length; i < len; i++) {
1641
+ const n = reverse ? len - i - 1 : i,
1642
+ s = reg[n]();
1643
+ if (!stop && !s) {
1644
+ res[n] = {
1645
+ showContent,
1801
1646
  showFallback
1802
- }));
1803
- res.inFallback = !all;
1804
- return res;
1805
- }
1806
- let stop = false;
1807
- let inFallback = prev.inFallback;
1808
- const res = [];
1809
- for (let i = 0, len = reg.length; i < len; i++) {
1810
- const n = reverse ? len - i - 1 : i,
1811
- s = reg[n]();
1812
- if (!stop && !s) {
1813
- res[n] = {
1814
- showContent,
1815
- showFallback
1816
- };
1817
- } else {
1818
- const next = !stop;
1819
- if (next) inFallback = true;
1820
- res[n] = {
1821
- showContent: next,
1822
- showFallback: !tail || (next && tail === "collapsed") ? showFallback : false
1823
- };
1824
- stop = true;
1825
- }
1647
+ };
1648
+ } else {
1649
+ const next = !stop;
1650
+ if (next) inFallback = true;
1651
+ res[n] = {
1652
+ showContent: next,
1653
+ showFallback: !tail || next && tail === "collapsed" ? showFallback : false
1654
+ };
1655
+ stop = true;
1826
1656
  }
1827
- if (!stop) inFallback = false;
1828
- res.inFallback = inFallback;
1829
- return res;
1830
- },
1831
- {
1832
- inFallback: false
1833
1657
  }
1834
- );
1658
+ if (!stop) inFallback = false;
1659
+ res.inFallback = inFallback;
1660
+ return res;
1661
+ }, {
1662
+ inFallback: false
1663
+ });
1835
1664
  setWrapper(() => resolved);
1836
1665
  return createComponent(SuspenseListContext.Provider, {
1837
1666
  value: {
@@ -1876,27 +1705,23 @@ function Suspense(props) {
1876
1705
  const key = sharedConfig.getContextId();
1877
1706
  let ref = sharedConfig.load(key);
1878
1707
  if (ref) {
1879
- if (typeof ref !== "object" || ref.status !== "success") p = ref;
1880
- else sharedConfig.gather(key);
1708
+ if (typeof ref !== "object" || ref.s !== 1) p = ref;else sharedConfig.gather(key);
1881
1709
  }
1882
1710
  if (p && p !== "$$f") {
1883
1711
  const [s, set] = createSignal(undefined, {
1884
1712
  equals: false
1885
1713
  });
1886
1714
  flicker = s;
1887
- p.then(
1888
- () => {
1889
- if (sharedConfig.done) return set();
1890
- sharedConfig.gather(key);
1891
- setHydrateContext(ctx);
1892
- set();
1893
- setHydrateContext();
1894
- },
1895
- err => {
1896
- error = err;
1897
- set();
1898
- }
1899
- );
1715
+ p.then(() => {
1716
+ if (sharedConfig.done) return set();
1717
+ sharedConfig.gather(key);
1718
+ setHydrateContext(ctx);
1719
+ set();
1720
+ setHydrateContext();
1721
+ }, err => {
1722
+ error = err;
1723
+ set();
1724
+ });
1900
1725
  }
1901
1726
  }
1902
1727
  const listContext = useContext(SuspenseListContext);
@@ -1911,14 +1736,17 @@ function Suspense(props) {
1911
1736
  ctx = sharedConfig.context;
1912
1737
  if (flicker) {
1913
1738
  flicker();
1914
- return (flicker = undefined);
1739
+ return flicker = undefined;
1915
1740
  }
1916
1741
  if (ctx && p === "$$f") setHydrateContext();
1917
1742
  const rendered = createMemo(() => props.children);
1918
1743
  return createMemo(prev => {
1919
1744
  const inFallback = store.inFallback(),
1920
- { showContent = true, showFallback = true } = show ? show() : {};
1921
- if ((!inFallback || (p && p !== "$$f")) && showContent) {
1745
+ {
1746
+ showContent = true,
1747
+ showFallback = true
1748
+ } = show ? show() : {};
1749
+ if ((!inFallback || p && p !== "$$f") && showContent) {
1922
1750
  store.resolved = true;
1923
1751
  dispose && dispose();
1924
1752
  dispose = ctx = p = undefined;
@@ -1948,68 +1776,9 @@ const DEV = {
1948
1776
  hooks: DevHooks,
1949
1777
  writeSignal,
1950
1778
  registerGraph
1951
- };
1779
+ } ;
1952
1780
  if (globalThis) {
1953
- if (!globalThis.Solid$$) globalThis.Solid$$ = true;
1954
- else
1955
- console.warn(
1956
- "You appear to have multiple instances of Solid. This can lead to unexpected behavior."
1957
- );
1781
+ if (!globalThis.Solid$$) globalThis.Solid$$ = true;else console.warn("You appear to have multiple instances of Solid. This can lead to unexpected behavior.");
1958
1782
  }
1959
1783
 
1960
- export {
1961
- $DEVCOMP,
1962
- $PROXY,
1963
- $TRACK,
1964
- DEV,
1965
- ErrorBoundary,
1966
- For,
1967
- Index,
1968
- Match,
1969
- Show,
1970
- Suspense,
1971
- SuspenseList,
1972
- Switch,
1973
- batch,
1974
- cancelCallback,
1975
- catchError,
1976
- children,
1977
- createComponent,
1978
- createComputed,
1979
- createContext,
1980
- createDeferred,
1981
- createEffect,
1982
- createMemo,
1983
- createReaction,
1984
- createRenderEffect,
1985
- createResource,
1986
- createRoot,
1987
- createSelector,
1988
- createSignal,
1989
- createUniqueId,
1990
- enableExternalSource,
1991
- enableHydration,
1992
- enableScheduling,
1993
- equalFn,
1994
- from,
1995
- getListener,
1996
- getOwner,
1997
- indexArray,
1998
- lazy,
1999
- mapArray,
2000
- mergeProps,
2001
- observable,
2002
- on,
2003
- onCleanup,
2004
- onError,
2005
- onMount,
2006
- requestCallback,
2007
- resetErrorBoundaries,
2008
- runWithOwner,
2009
- sharedConfig,
2010
- splitProps,
2011
- startTransition,
2012
- untrack,
2013
- useContext,
2014
- useTransition
2015
- };
1784
+ export { $DEVCOMP, $PROXY, $TRACK, DEV, ErrorBoundary, For, Index, Match, Show, Suspense, SuspenseList, Switch, batch, cancelCallback, catchError, children, createComponent, createComputed, createContext, createDeferred, createEffect, createMemo, createReaction, createRenderEffect, createResource, createRoot, createSelector, createSignal, createUniqueId, enableExternalSource, enableHydration, enableScheduling, equalFn, from, getListener, getOwner, indexArray, lazy, mapArray, mergeProps, observable, on, onCleanup, onError, onMount, requestCallback, resetErrorBoundaries, runWithOwner, sharedConfig, splitProps, startTransition, untrack, useContext, useTransition };