solid-js 1.9.6 → 1.9.8

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