solid-js 1.8.21 → 1.8.22

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 (48) hide show
  1. package/README.md +3 -3
  2. package/dist/dev.cjs +6 -4
  3. package/dist/dev.js +325 -564
  4. package/dist/server.js +74 -168
  5. package/dist/solid.cjs +6 -4
  6. package/dist/solid.js +283 -491
  7. package/h/dist/h.cjs +1 -1
  8. package/h/dist/h.js +9 -38
  9. package/h/jsx-runtime/dist/jsx.js +1 -1
  10. package/h/jsx-runtime/types/index.d.ts +8 -11
  11. package/h/jsx-runtime/types/jsx.d.ts +2 -0
  12. package/h/types/hyperscript.d.ts +11 -11
  13. package/html/dist/html.js +94 -216
  14. package/html/types/lit.d.ts +33 -47
  15. package/package.json +1 -1
  16. package/store/dist/dev.js +43 -122
  17. package/store/dist/server.js +8 -19
  18. package/store/dist/store.js +40 -113
  19. package/store/types/index.d.ts +7 -21
  20. package/store/types/modifiers.d.ts +3 -6
  21. package/store/types/mutable.d.ts +2 -5
  22. package/store/types/server.d.ts +4 -12
  23. package/store/types/store.d.ts +61 -218
  24. package/types/index.d.ts +10 -75
  25. package/types/jsx.d.ts +8 -18
  26. package/types/reactive/array.d.ts +4 -12
  27. package/types/reactive/observable.d.ts +17 -25
  28. package/types/reactive/scheduler.d.ts +6 -9
  29. package/types/reactive/signal.d.ts +142 -233
  30. package/types/render/Suspense.d.ts +5 -5
  31. package/types/render/component.d.ts +33 -64
  32. package/types/render/flow.d.ts +31 -43
  33. package/types/render/hydration.d.ts +15 -15
  34. package/types/server/index.d.ts +2 -57
  35. package/types/server/reactive.d.ts +42 -73
  36. package/types/server/rendering.d.ts +98 -169
  37. package/universal/dist/dev.js +12 -28
  38. package/universal/dist/universal.js +12 -28
  39. package/universal/types/index.d.ts +1 -3
  40. package/universal/types/universal.d.ts +1 -0
  41. package/web/dist/dev.js +83 -625
  42. package/web/dist/server.js +96 -210
  43. package/web/dist/web.js +81 -616
  44. package/web/storage/dist/storage.js +3 -3
  45. package/web/types/client.d.ts +2 -2
  46. package/web/types/core.d.ts +1 -10
  47. package/web/types/index.d.ts +10 -27
  48. 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
  }
@@ -119,6 +117,7 @@ function workLoop(hasTimeRemaining, initialTime) {
119
117
  const sharedConfig = {
120
118
  context: undefined,
121
119
  registry: undefined,
120
+ effects: undefined,
122
121
  done: false,
123
122
  getContextId() {
124
123
  return getContextId(this.context.count);
@@ -179,25 +178,20 @@ function createRoot(fn, detachedOwner) {
179
178
  owner = Owner,
180
179
  unowned = fn.length === 0,
181
180
  current = detachedOwner === undefined ? owner : detachedOwner,
182
- root = unowned
183
- ? {
184
- owned: null,
185
- cleanups: null,
186
- context: null,
187
- owner: null
188
- }
189
- : {
190
- owned: null,
191
- cleanups: null,
192
- context: current ? current.context : null,
193
- owner: current
194
- },
195
- updateFn = unowned
196
- ? () =>
197
- fn(() => {
198
- throw new Error("Dispose method must be an explicit argument to createRoot function");
199
- })
200
- : () => fn(() => untrack(() => cleanNode(root)));
181
+ root = unowned ? {
182
+ owned: null,
183
+ cleanups: null,
184
+ context: null,
185
+ owner: null
186
+ } : {
187
+ owned: null,
188
+ cleanups: null,
189
+ context: current ? current.context : null,
190
+ owner: current
191
+ },
192
+ updateFn = unowned ? () => fn(() => {
193
+ throw new Error("Dispose method must be an explicit argument to createRoot function");
194
+ }) : () => fn(() => untrack(() => cleanNode(root)));
201
195
  DevHooks.afterCreateOwner && DevHooks.afterCreateOwner(root);
202
196
  Owner = root;
203
197
  Listener = null;
@@ -223,26 +217,23 @@ function createSignal(value, options) {
223
217
  }
224
218
  const setter = value => {
225
219
  if (typeof value === "function") {
226
- if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);
227
- else value = value(s.value);
220
+ if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);else value = value(s.value);
228
221
  }
229
222
  return writeSignal(s, value);
230
223
  };
231
224
  return [readSignal.bind(s), setter];
232
225
  }
233
226
  function createComputed(fn, value, options) {
234
- const c = createComputation(fn, value, true, STALE, options);
235
- if (Scheduler && Transition && Transition.running) Updates.push(c);
236
- else updateComputation(c);
227
+ const c = createComputation(fn, value, true, STALE, options );
228
+ if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);
237
229
  }
238
230
  function createRenderEffect(fn, value, options) {
239
- const c = createComputation(fn, value, false, STALE, options);
240
- if (Scheduler && Transition && Transition.running) Updates.push(c);
241
- else updateComputation(c);
231
+ const c = createComputation(fn, value, false, STALE, options );
232
+ if (Scheduler && Transition && Transition.running) Updates.push(c);else updateComputation(c);
242
233
  }
243
234
  function createEffect(fn, value, options) {
244
235
  runEffects = runUserEffects;
245
- const c = createComputation(fn, value, false, STALE, options),
236
+ const c = createComputation(fn, value, false, STALE, options ),
246
237
  s = SuspenseContext && useContext(SuspenseContext);
247
238
  if (s) c.suspense = s;
248
239
  if (!options || !options.render) c.user = true;
@@ -250,16 +241,10 @@ function createEffect(fn, value, options) {
250
241
  }
251
242
  function createReaction(onInvalidate, options) {
252
243
  let fn;
253
- const c = createComputation(
254
- () => {
255
- fn ? fn() : untrack(onInvalidate);
256
- fn = undefined;
257
- },
258
- undefined,
259
- false,
260
- 0,
261
- options
262
- ),
244
+ const c = createComputation(() => {
245
+ fn ? fn() : untrack(onInvalidate);
246
+ fn = undefined;
247
+ }, undefined, false, 0, options ),
263
248
  s = SuspenseContext && useContext(SuspenseContext);
264
249
  if (s) c.suspense = s;
265
250
  c.user = true;
@@ -270,7 +255,7 @@ function createReaction(onInvalidate, options) {
270
255
  }
271
256
  function createMemo(fn, value, options) {
272
257
  options = options ? Object.assign({}, signalOptions, options) : signalOptions;
273
- const c = createComputation(fn, value, true, 0, options);
258
+ const c = createComputation(fn, value, true, 0, options );
274
259
  c.observers = null;
275
260
  c.observerSlots = null;
276
261
  c.comparator = options.equals || undefined;
@@ -287,7 +272,7 @@ function createResource(pSource, pFetcher, pOptions) {
287
272
  let source;
288
273
  let fetcher;
289
274
  let options;
290
- if ((arguments.length === 2 && typeof pFetcher === "object") || arguments.length === 1) {
275
+ if (arguments.length === 2 && typeof pFetcher === "object" || arguments.length === 1) {
291
276
  source = true;
292
277
  fetcher = pSource;
293
278
  options = pFetcher || {};
@@ -301,7 +286,7 @@ function createResource(pSource, pFetcher, pOptions) {
301
286
  id = null,
302
287
  loadedUnderTransition = false,
303
288
  scheduled = false,
304
- resolved = "initialValue" in options,
289
+ resolved = ("initialValue" in options),
305
290
  dynamic = typeof source === "function" && createMemo(source);
306
291
  const contexts = new Set(),
307
292
  [value, setValue] = (options.storage || createSignal)(options.initialValue),
@@ -312,19 +297,15 @@ function createResource(pSource, pFetcher, pOptions) {
312
297
  [state, setState] = createSignal(resolved ? "ready" : "unresolved");
313
298
  if (sharedConfig.context) {
314
299
  id = sharedConfig.getNextContextId();
315
- if (options.ssrLoadFrom === "initial") initP = options.initialValue;
316
- else if (sharedConfig.load && sharedConfig.has(id)) initP = sharedConfig.load(id);
300
+ if (options.ssrLoadFrom === "initial") initP = options.initialValue;else if (sharedConfig.load && sharedConfig.has(id)) initP = sharedConfig.load(id);
317
301
  }
318
302
  function loadEnd(p, v, error, key) {
319
303
  if (pr === p) {
320
304
  pr = null;
321
305
  key !== undefined && (resolved = true);
322
- if ((p === initP || v === initP) && options.onHydrated)
323
- queueMicrotask(() =>
324
- options.onHydrated(key, {
325
- value: v
326
- })
327
- );
306
+ if ((p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, {
307
+ value: v
308
+ }));
328
309
  initP = NO_INIT;
329
310
  if (Transition && p && loadedUnderTransition) {
330
311
  Transition.promises.delete(p);
@@ -355,8 +336,7 @@ function createResource(pSource, pFetcher, pOptions) {
355
336
  createComputed(() => {
356
337
  track();
357
338
  if (pr) {
358
- if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);
359
- else if (!contexts.has(c)) {
339
+ if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);else if (!contexts.has(c)) {
360
340
  c.increment();
361
341
  contexts.add(c);
362
342
  }
@@ -375,35 +355,26 @@ function createResource(pSource, pFetcher, pOptions) {
375
355
  return;
376
356
  }
377
357
  if (Transition && pr) Transition.promises.delete(pr);
378
- const p =
379
- initP !== NO_INIT
380
- ? initP
381
- : untrack(() =>
382
- fetcher(lookup, {
383
- value: value(),
384
- refetching
385
- })
386
- );
358
+ const p = initP !== NO_INIT ? initP : untrack(() => fetcher(lookup, {
359
+ value: value(),
360
+ refetching
361
+ }));
387
362
  if (!isPromise(p)) {
388
363
  loadEnd(pr, p, undefined, lookup);
389
364
  return p;
390
365
  }
391
366
  pr = p;
392
367
  if ("value" in p) {
393
- if (p.status === "success") loadEnd(pr, p.value, undefined, lookup);
394
- else loadEnd(pr, undefined, castError(p.value), lookup);
368
+ if (p.status === "success") loadEnd(pr, p.value, undefined, lookup);else loadEnd(pr, undefined, castError(p.value), lookup);
395
369
  return p;
396
370
  }
397
371
  scheduled = true;
398
- queueMicrotask(() => (scheduled = false));
372
+ queueMicrotask(() => scheduled = false);
399
373
  runUpdates(() => {
400
374
  setState(resolved ? "refreshing" : "pending");
401
375
  trigger();
402
376
  }, false);
403
- return p.then(
404
- v => loadEnd(p, v, undefined, lookup),
405
- e => loadEnd(p, undefined, castError(e), lookup)
406
- );
377
+ return p.then(v => loadEnd(p, v, undefined, lookup), e => loadEnd(p, undefined, castError(e), lookup));
407
378
  }
408
379
  Object.defineProperties(read, {
409
380
  state: {
@@ -427,81 +398,50 @@ function createResource(pSource, pFetcher, pOptions) {
427
398
  }
428
399
  }
429
400
  });
430
- if (dynamic) createComputed(() => load(false));
431
- else load(false);
432
- return [
433
- read,
434
- {
435
- refetch: load,
436
- mutate: setValue
437
- }
438
- ];
401
+ if (dynamic) createComputed(() => load(false));else load(false);
402
+ return [read, {
403
+ refetch: load,
404
+ mutate: setValue
405
+ }];
439
406
  }
440
407
  function createDeferred(source, options) {
441
408
  let t,
442
409
  timeout = options ? options.timeoutMs : undefined;
443
- const node = createComputation(
444
- () => {
445
- if (!t || !t.fn)
446
- t = requestCallback(
447
- () => setDeferred(() => node.value),
448
- timeout !== undefined
449
- ? {
450
- timeout
451
- }
452
- : undefined
453
- );
454
- return source();
455
- },
456
- undefined,
457
- true
458
- );
459
- const [deferred, setDeferred] = createSignal(
460
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
461
- options
462
- );
410
+ const node = createComputation(() => {
411
+ if (!t || !t.fn) t = requestCallback(() => setDeferred(() => node.value), timeout !== undefined ? {
412
+ timeout
413
+ } : undefined);
414
+ return source();
415
+ }, undefined, true);
416
+ const [deferred, setDeferred] = createSignal(Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, options);
463
417
  updateComputation(node);
464
- setDeferred(() =>
465
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value
466
- );
418
+ setDeferred(() => Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
467
419
  return deferred;
468
420
  }
469
421
  function createSelector(source, fn = equalFn, options) {
470
422
  const subs = new Map();
471
- const node = createComputation(
472
- p => {
473
- const v = source();
474
- for (const [key, val] of subs.entries())
475
- if (fn(key, v) !== fn(key, p)) {
476
- for (const c of val.values()) {
477
- c.state = STALE;
478
- if (c.pure) Updates.push(c);
479
- else Effects.push(c);
480
- }
481
- }
482
- return v;
483
- },
484
- undefined,
485
- true,
486
- STALE,
487
- options
488
- );
423
+ const node = createComputation(p => {
424
+ const v = source();
425
+ for (const [key, val] of subs.entries()) if (fn(key, v) !== fn(key, p)) {
426
+ for (const c of val.values()) {
427
+ c.state = STALE;
428
+ if (c.pure) Updates.push(c);else Effects.push(c);
429
+ }
430
+ }
431
+ return v;
432
+ }, undefined, true, STALE, options );
489
433
  updateComputation(node);
490
434
  return key => {
491
435
  const listener = Listener;
492
436
  if (listener) {
493
437
  let l;
494
- if ((l = subs.get(key))) l.add(listener);
495
- else subs.set(key, (l = new Set([listener])));
438
+ if (l = subs.get(key)) l.add(listener);else subs.set(key, l = new Set([listener]));
496
439
  onCleanup(() => {
497
440
  l.delete(listener);
498
441
  !l.size && subs.delete(key);
499
442
  });
500
443
  }
501
- return fn(
502
- key,
503
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value
504
- );
444
+ return fn(key, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value);
505
445
  };
506
446
  }
507
447
  function batch(fn) {
@@ -541,10 +481,7 @@ function onMount(fn) {
541
481
  createEffect(() => untrack(fn));
542
482
  }
543
483
  function onCleanup(fn) {
544
- if (Owner === null)
545
- console.warn("cleanups created outside a `createRoot` or `render` will never be run");
546
- else if (Owner.cleanups === null) Owner.cleanups = [fn];
547
- else Owner.cleanups.push(fn);
484
+ 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);
548
485
  return fn;
549
486
  }
550
487
  function catchError(fn, handler) {
@@ -598,17 +535,15 @@ function startTransition(fn) {
598
535
  Owner = o;
599
536
  let t;
600
537
  if (Scheduler || SuspenseContext) {
601
- t =
602
- Transition ||
603
- (Transition = {
604
- sources: new Set(),
605
- effects: [],
606
- promises: new Set(),
607
- disposed: new Set(),
608
- queue: new Set(),
609
- running: true
610
- });
611
- t.done || (t.done = new Promise(res => (t.resolve = res)));
538
+ t = Transition || (Transition = {
539
+ sources: new Set(),
540
+ effects: [],
541
+ promises: new Set(),
542
+ disposed: new Set(),
543
+ queue: new Set(),
544
+ running: true
545
+ });
546
+ t.done || (t.done = new Promise(res => t.resolve = res));
612
547
  t.running = true;
613
548
  }
614
549
  runUpdates(fn, false);
@@ -616,7 +551,7 @@ function startTransition(fn) {
616
551
  return t ? t.done : undefined;
617
552
  });
618
553
  }
619
- const [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);
554
+ const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
620
555
  function useTransition() {
621
556
  return [transPending, startTransition];
622
557
  }
@@ -625,18 +560,12 @@ function resumeEffects(e) {
625
560
  e.length = 0;
626
561
  }
627
562
  function devComponent(Comp, props) {
628
- const c = createComputation(
629
- () =>
630
- untrack(() => {
631
- Object.assign(Comp, {
632
- [$DEVCOMP]: true
633
- });
634
- return Comp(props);
635
- }),
636
- undefined,
637
- true,
638
- 0
639
- );
563
+ const c = createComputation(() => untrack(() => {
564
+ Object.assign(Comp, {
565
+ [$DEVCOMP]: true
566
+ });
567
+ return Comp(props);
568
+ }), undefined, true, 0);
640
569
  c.props = props;
641
570
  c.observers = null;
642
571
  c.observerSlots = null;
@@ -647,8 +576,7 @@ function devComponent(Comp, props) {
647
576
  }
648
577
  function registerGraph(value) {
649
578
  if (!Owner) return;
650
- if (Owner.sourceMap) Owner.sourceMap.push(value);
651
- else Owner.sourceMap = [value];
579
+ if (Owner.sourceMap) Owner.sourceMap.push(value);else Owner.sourceMap = [value];
652
580
  value.graph = Owner;
653
581
  }
654
582
  function createContext(defaultValue, options) {
@@ -661,15 +589,13 @@ function createContext(defaultValue, options) {
661
589
  }
662
590
  function useContext(context) {
663
591
  let value;
664
- return Owner && Owner.context && (value = Owner.context[context.id]) !== undefined
665
- ? value
666
- : context.defaultValue;
592
+ return Owner && Owner.context && (value = Owner.context[context.id]) !== undefined ? value : context.defaultValue;
667
593
  }
668
594
  function children(fn) {
669
595
  const children = createMemo(fn);
670
596
  const memo = createMemo(() => resolveChildren(children()), undefined, {
671
597
  name: "children"
672
- });
598
+ }) ;
673
599
  memo.toArray = () => {
674
600
  const c = memo();
675
601
  return Array.isArray(c) ? c : c != null ? [c] : [];
@@ -682,7 +608,10 @@ function getSuspenseContext() {
682
608
  }
683
609
  function enableExternalSource(factory, untrack = fn => fn()) {
684
610
  if (ExternalSourceConfig) {
685
- const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;
611
+ const {
612
+ factory: oldFactory,
613
+ untrack: oldUntrack
614
+ } = ExternalSourceConfig;
686
615
  ExternalSourceConfig = {
687
616
  factory: (fn, trigger) => {
688
617
  const oldSource = oldFactory(fn, trigger);
@@ -707,8 +636,7 @@ function enableExternalSource(factory, untrack = fn => fn()) {
707
636
  function readSignal() {
708
637
  const runningTransition = Transition && Transition.running;
709
638
  if (this.sources && (runningTransition ? this.tState : this.state)) {
710
- if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);
711
- else {
639
+ if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);else {
712
640
  const updates = Updates;
713
641
  Updates = null;
714
642
  runUpdates(() => lookUpstream(this), false);
@@ -736,12 +664,11 @@ function readSignal() {
736
664
  return this.value;
737
665
  }
738
666
  function writeSignal(node, value, isComp) {
739
- let current =
740
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
667
+ let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
741
668
  if (!node.comparator || !node.comparator(current, value)) {
742
669
  if (Transition) {
743
670
  const TransitionRunning = Transition.running;
744
- if (TransitionRunning || (!isComp && Transition.sources.has(node))) {
671
+ if (TransitionRunning || !isComp && Transition.sources.has(node)) {
745
672
  Transition.sources.add(node);
746
673
  node.tValue = value;
747
674
  }
@@ -754,12 +681,10 @@ function writeSignal(node, value, isComp) {
754
681
  const TransitionRunning = Transition && Transition.running;
755
682
  if (TransitionRunning && Transition.disposed.has(o)) continue;
756
683
  if (TransitionRunning ? !o.tState : !o.state) {
757
- if (o.pure) Updates.push(o);
758
- else Effects.push(o);
684
+ if (o.pure) Updates.push(o);else Effects.push(o);
759
685
  if (o.observers) markDownstream(o);
760
686
  }
761
- if (!TransitionRunning) o.state = STALE;
762
- else o.tState = STALE;
687
+ if (!TransitionRunning) o.state = STALE;else o.tState = STALE;
763
688
  }
764
689
  if (Updates.length > 10e5) {
765
690
  Updates = [];
@@ -775,11 +700,7 @@ function updateComputation(node) {
775
700
  if (!node.fn) return;
776
701
  cleanNode(node);
777
702
  const time = ExecCount;
778
- runComputation(
779
- node,
780
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
781
- time
782
- );
703
+ runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
783
704
  if (Transition && !Transition.running && Transition.sources.has(node)) {
784
705
  queueMicrotask(() => {
785
706
  runUpdates(() => {
@@ -844,15 +765,11 @@ function createComputation(fn, init, pure, state = STALE, options) {
844
765
  c.state = 0;
845
766
  c.tState = state;
846
767
  }
847
- if (Owner === null)
848
- console.warn("computations created outside a `createRoot` or `render` will never be disposed");
849
- else if (Owner !== UNOWNED) {
768
+ if (Owner === null) console.warn("computations created outside a `createRoot` or `render` will never be disposed");else if (Owner !== UNOWNED) {
850
769
  if (Transition && Transition.running && Owner.pure) {
851
- if (!Owner.tOwned) Owner.tOwned = [c];
852
- else Owner.tOwned.push(c);
770
+ if (!Owner.tOwned) Owner.tOwned = [c];else Owner.tOwned.push(c);
853
771
  } else {
854
- if (!Owner.owned) Owner.owned = [c];
855
- else Owner.owned.push(c);
772
+ if (!Owner.owned) Owner.owned = [c];else Owner.owned.push(c);
856
773
  }
857
774
  }
858
775
  if (options && options.name) c.name = options.name;
@@ -905,8 +822,7 @@ function runUpdates(fn, init) {
905
822
  if (Updates) return fn();
906
823
  let wait = false;
907
824
  if (!init) Updates = [];
908
- if (Effects) wait = true;
909
- else Effects = [];
825
+ if (Effects) wait = true;else Effects = [];
910
826
  ExecCount++;
911
827
  try {
912
828
  const res = fn();
@@ -920,8 +836,7 @@ function runUpdates(fn, init) {
920
836
  }
921
837
  function completeUpdates(wait) {
922
838
  if (Updates) {
923
- if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);
924
- else runQueue(Updates);
839
+ if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);else runQueue(Updates);
925
840
  Updates = null;
926
841
  }
927
842
  if (wait) return;
@@ -961,8 +876,7 @@ function completeUpdates(wait) {
961
876
  }
962
877
  const e = Effects;
963
878
  Effects = null;
964
- if (e.length) runUpdates(() => runEffects(e), false);
965
- else DevHooks.afterUpdate && DevHooks.afterUpdate();
879
+ if (e.length) runUpdates(() => runEffects(e), false);else DevHooks.afterUpdate && DevHooks.afterUpdate();
966
880
  if (res) res();
967
881
  }
968
882
  function runQueue(queue) {
@@ -990,34 +904,32 @@ function runUserEffects(queue) {
990
904
  userLength = 0;
991
905
  for (i = 0; i < queue.length; i++) {
992
906
  const e = queue[i];
993
- if (!e.user) runTop(e);
994
- else queue[userLength++] = e;
907
+ if (!e.user) runTop(e);else queue[userLength++] = e;
995
908
  }
996
909
  if (sharedConfig.context) {
997
910
  if (sharedConfig.count) {
998
911
  sharedConfig.effects || (sharedConfig.effects = []);
999
912
  sharedConfig.effects.push(...queue.slice(0, userLength));
1000
913
  return;
1001
- } else if (sharedConfig.effects) {
1002
- queue = [...sharedConfig.effects, ...queue];
1003
- userLength += sharedConfig.effects.length;
1004
- delete sharedConfig.effects;
1005
914
  }
1006
915
  setHydrateContext();
1007
916
  }
917
+ if (sharedConfig.effects && (sharedConfig.done || !sharedConfig.count)) {
918
+ queue = [...sharedConfig.effects, ...queue];
919
+ userLength += sharedConfig.effects.length;
920
+ delete sharedConfig.effects;
921
+ }
1008
922
  for (i = 0; i < userLength; i++) runTop(queue[i]);
1009
923
  }
1010
924
  function lookUpstream(node, ignore) {
1011
925
  const runningTransition = Transition && Transition.running;
1012
- if (runningTransition) node.tState = 0;
1013
- else node.state = 0;
926
+ if (runningTransition) node.tState = 0;else node.state = 0;
1014
927
  for (let i = 0; i < node.sources.length; i += 1) {
1015
928
  const source = node.sources[i];
1016
929
  if (source.sources) {
1017
930
  const state = runningTransition ? source.tState : source.state;
1018
931
  if (state === STALE) {
1019
- if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
1020
- runTop(source);
932
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
1021
933
  } else if (state === PENDING) lookUpstream(source, ignore);
1022
934
  }
1023
935
  }
@@ -1027,10 +939,8 @@ function markDownstream(node) {
1027
939
  for (let i = 0; i < node.observers.length; i += 1) {
1028
940
  const o = node.observers[i];
1029
941
  if (runningTransition ? !o.tState : !o.state) {
1030
- if (runningTransition) o.tState = PENDING;
1031
- else o.state = PENDING;
1032
- if (o.pure) Updates.push(o);
1033
- else Effects.push(o);
942
+ if (runningTransition) o.tState = PENDING;else o.state = PENDING;
943
+ if (o.pure) Updates.push(o);else Effects.push(o);
1034
944
  o.observers && markDownstream(o);
1035
945
  }
1036
946
  }
@@ -1067,8 +977,7 @@ function cleanNode(node) {
1067
977
  for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
1068
978
  node.cleanups = null;
1069
979
  }
1070
- if (Transition && Transition.running) node.tState = 0;
1071
- else node.state = 0;
980
+ if (Transition && Transition.running) node.tState = 0;else node.state = 0;
1072
981
  delete node.sourceMap;
1073
982
  }
1074
983
  function reset(node, top) {
@@ -1090,21 +999,19 @@ function runErrors(err, fns, owner) {
1090
999
  try {
1091
1000
  for (const f of fns) f(err);
1092
1001
  } catch (e) {
1093
- handleError(e, (owner && owner.owner) || null);
1002
+ handleError(e, owner && owner.owner || null);
1094
1003
  }
1095
1004
  }
1096
1005
  function handleError(err, owner = Owner) {
1097
1006
  const fns = ERROR && owner && owner.context && owner.context[ERROR];
1098
1007
  const error = castError(err);
1099
1008
  if (!fns) throw error;
1100
- if (Effects)
1101
- Effects.push({
1102
- fn() {
1103
- runErrors(error, fns, owner);
1104
- },
1105
- state: STALE
1106
- });
1107
- else runErrors(error, fns, owner);
1009
+ if (Effects) Effects.push({
1010
+ fn() {
1011
+ runErrors(error, fns, owner);
1012
+ },
1013
+ state: STALE
1014
+ });else runErrors(error, fns, owner);
1108
1015
  }
1109
1016
  function resolveChildren(children) {
1110
1017
  if (typeof children === "function" && !children.length) return resolveChildren(children());
@@ -1121,26 +1028,19 @@ function resolveChildren(children) {
1121
1028
  function createProvider(id, options) {
1122
1029
  return function provider(props) {
1123
1030
  let res;
1124
- createRenderEffect(
1125
- () =>
1126
- (res = untrack(() => {
1127
- Owner.context = {
1128
- ...Owner.context,
1129
- [id]: props.value
1130
- };
1131
- return children(() => props.children);
1132
- })),
1133
- undefined,
1134
- options
1135
- );
1031
+ createRenderEffect(() => res = untrack(() => {
1032
+ Owner.context = {
1033
+ ...Owner.context,
1034
+ [id]: props.value
1035
+ };
1036
+ return children(() => props.children);
1037
+ }), undefined, options);
1136
1038
  return res;
1137
1039
  };
1138
1040
  }
1139
1041
  function onError(fn) {
1140
1042
  ERROR || (ERROR = Symbol("error"));
1141
- if (Owner === null)
1142
- console.warn("error handlers created outside a `createRoot` or `render` will never be run");
1143
- else if (Owner.context === null || !Owner.context[ERROR]) {
1043
+ 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]) {
1144
1044
  Owner.context = {
1145
1045
  ...Owner.context,
1146
1046
  [ERROR]: [fn]
@@ -1169,8 +1069,7 @@ function observable(input) {
1169
1069
  if (!(observer instanceof Object) || observer == null) {
1170
1070
  throw new TypeError("Expected the observer to be an object.");
1171
1071
  }
1172
- const handler =
1173
- typeof observer === "function" ? observer : observer.next && observer.next.bind(observer);
1072
+ const handler = typeof observer === "function" ? observer : observer.next && observer.next.bind(observer);
1174
1073
  if (!handler) {
1175
1074
  return {
1176
1075
  unsubscribe() {}
@@ -1201,7 +1100,7 @@ function from(producer) {
1201
1100
  });
1202
1101
  if ("subscribe" in producer) {
1203
1102
  const unsub = producer.subscribe(v => set(() => v));
1204
- onCleanup(() => ("unsubscribe" in unsub ? unsub.unsubscribe() : unsub()));
1103
+ onCleanup(() => "unsubscribe" in unsub ? unsub.unsubscribe() : unsub());
1205
1104
  } else {
1206
1105
  const clean = producer(set);
1207
1106
  onCleanup(clean);
@@ -1245,7 +1144,8 @@ function mapArray(list, mapFn, options = {}) {
1245
1144
  });
1246
1145
  len = 1;
1247
1146
  }
1248
- } else if (len === 0) {
1147
+ }
1148
+ else if (len === 0) {
1249
1149
  mapped = new Array(newLen);
1250
1150
  for (j = 0; j < newLen; j++) {
1251
1151
  items[j] = newItems[j];
@@ -1256,16 +1156,8 @@ function mapArray(list, mapFn, options = {}) {
1256
1156
  temp = new Array(newLen);
1257
1157
  tempdisposers = new Array(newLen);
1258
1158
  indexes && (tempIndexes = new Array(newLen));
1259
- for (
1260
- start = 0, end = Math.min(len, newLen);
1261
- start < end && items[start] === newItems[start];
1262
- start++
1263
- );
1264
- for (
1265
- end = len - 1, newEnd = newLen - 1;
1266
- end >= start && newEnd >= start && items[end] === newItems[newEnd];
1267
- end--, newEnd--
1268
- ) {
1159
+ for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++);
1160
+ for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {
1269
1161
  temp[newEnd] = mapped[end];
1270
1162
  tempdisposers[newEnd] = disposers[end];
1271
1163
  indexes && (tempIndexes[newEnd] = indexes[end]);
@@ -1299,7 +1191,7 @@ function mapArray(list, mapFn, options = {}) {
1299
1191
  }
1300
1192
  } else mapped[j] = createRoot(mapper);
1301
1193
  }
1302
- mapped = mapped.slice(0, (len = newLen));
1194
+ mapped = mapped.slice(0, len = newLen);
1303
1195
  items = newItems.slice(0);
1304
1196
  }
1305
1197
  return mapped;
@@ -1309,7 +1201,7 @@ function mapArray(list, mapFn, options = {}) {
1309
1201
  if (indexes) {
1310
1202
  const [s, set] = createSignal(j, {
1311
1203
  name: "index"
1312
- });
1204
+ }) ;
1313
1205
  indexes[j] = set;
1314
1206
  return mapFn(newItems[j], s);
1315
1207
  }
@@ -1368,13 +1260,13 @@ function indexArray(list, mapFn, options = {}) {
1368
1260
  }
1369
1261
  len = signals.length = disposers.length = newLen;
1370
1262
  items = newItems.slice(0);
1371
- return (mapped = mapped.slice(0, len));
1263
+ return mapped = mapped.slice(0, len);
1372
1264
  });
1373
1265
  function mapper(disposer) {
1374
1266
  disposers[i] = disposer;
1375
1267
  const [s, set] = createSignal(newItems[i], {
1376
1268
  name: "value"
1377
- });
1269
+ }) ;
1378
1270
  signals[i] = set;
1379
1271
  return mapFn(s, i);
1380
1272
  }
@@ -1390,7 +1282,7 @@ function createComponent(Comp, props) {
1390
1282
  if (sharedConfig.context) {
1391
1283
  const c = sharedConfig.context;
1392
1284
  setHydrateContext(nextHydrateContext());
1393
- const r = devComponent(Comp, props || {});
1285
+ const r = devComponent(Comp, props || {}) ;
1394
1286
  setHydrateContext(c);
1395
1287
  return r;
1396
1288
  }
@@ -1439,33 +1331,29 @@ function mergeProps(...sources) {
1439
1331
  let proxy = false;
1440
1332
  for (let i = 0; i < sources.length; i++) {
1441
1333
  const s = sources[i];
1442
- proxy = proxy || (!!s && $PROXY in s);
1443
- sources[i] = typeof s === "function" ? ((proxy = true), createMemo(s)) : s;
1334
+ proxy = proxy || !!s && $PROXY in s;
1335
+ sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
1444
1336
  }
1445
1337
  if (proxy) {
1446
- return new Proxy(
1447
- {
1448
- get(property) {
1449
- for (let i = sources.length - 1; i >= 0; i--) {
1450
- const v = resolveSource(sources[i])[property];
1451
- if (v !== undefined) return v;
1452
- }
1453
- },
1454
- has(property) {
1455
- for (let i = sources.length - 1; i >= 0; i--) {
1456
- if (property in resolveSource(sources[i])) return true;
1457
- }
1458
- return false;
1459
- },
1460
- keys() {
1461
- const keys = [];
1462
- for (let i = 0; i < sources.length; i++)
1463
- keys.push(...Object.keys(resolveSource(sources[i])));
1464
- return [...new Set(keys)];
1338
+ return new Proxy({
1339
+ get(property) {
1340
+ for (let i = sources.length - 1; i >= 0; i--) {
1341
+ const v = resolveSource(sources[i])[property];
1342
+ if (v !== undefined) return v;
1465
1343
  }
1466
1344
  },
1467
- propTraps
1468
- );
1345
+ has(property) {
1346
+ for (let i = sources.length - 1; i >= 0; i--) {
1347
+ if (property in resolveSource(sources[i])) return true;
1348
+ }
1349
+ return false;
1350
+ },
1351
+ keys() {
1352
+ const keys = [];
1353
+ for (let i = 0; i < sources.length; i++) keys.push(...Object.keys(resolveSource(sources[i])));
1354
+ return [...new Set(keys)];
1355
+ }
1356
+ }, propTraps);
1469
1357
  }
1470
1358
  const sourcesMap = {};
1471
1359
  const defined = Object.create(null);
@@ -1478,20 +1366,15 @@ function mergeProps(...sources) {
1478
1366
  if (key === "__proto__" || key === "constructor") continue;
1479
1367
  const desc = Object.getOwnPropertyDescriptor(source, key);
1480
1368
  if (!defined[key]) {
1481
- defined[key] = desc.get
1482
- ? {
1483
- enumerable: true,
1484
- configurable: true,
1485
- get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))
1486
- }
1487
- : desc.value !== undefined
1488
- ? desc
1489
- : undefined;
1369
+ defined[key] = desc.get ? {
1370
+ enumerable: true,
1371
+ configurable: true,
1372
+ get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])
1373
+ } : desc.value !== undefined ? desc : undefined;
1490
1374
  } else {
1491
1375
  const sources = sourcesMap[key];
1492
1376
  if (sources) {
1493
- if (desc.get) sources.push(desc.get.bind(source));
1494
- else if (desc.value !== undefined) sources.push(() => desc.value);
1377
+ if (desc.get) sources.push(desc.get.bind(source));else if (desc.value !== undefined) sources.push(() => desc.value);
1495
1378
  }
1496
1379
  }
1497
1380
  }
@@ -1501,8 +1384,7 @@ function mergeProps(...sources) {
1501
1384
  for (let i = definedKeys.length - 1; i >= 0; i--) {
1502
1385
  const key = definedKeys[i],
1503
1386
  desc = defined[key];
1504
- if (desc && desc.get) Object.defineProperty(target, key, desc);
1505
- else target[key] = desc ? desc.value : undefined;
1387
+ if (desc && desc.get) Object.defineProperty(target, key, desc);else target[key] = desc ? desc.value : undefined;
1506
1388
  }
1507
1389
  return target;
1508
1390
  }
@@ -1510,60 +1392,47 @@ function splitProps(props, ...keys) {
1510
1392
  if ($PROXY in props) {
1511
1393
  const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);
1512
1394
  const res = keys.map(k => {
1513
- return new Proxy(
1514
- {
1515
- get(property) {
1516
- return k.includes(property) ? props[property] : undefined;
1517
- },
1518
- has(property) {
1519
- return k.includes(property) && property in props;
1520
- },
1521
- keys() {
1522
- return k.filter(property => property in props);
1523
- }
1395
+ return new Proxy({
1396
+ get(property) {
1397
+ return k.includes(property) ? props[property] : undefined;
1524
1398
  },
1525
- propTraps
1526
- );
1527
- });
1528
- res.push(
1529
- new Proxy(
1530
- {
1531
- get(property) {
1532
- return blocked.has(property) ? undefined : props[property];
1533
- },
1534
- has(property) {
1535
- return blocked.has(property) ? false : property in props;
1536
- },
1537
- keys() {
1538
- return Object.keys(props).filter(k => !blocked.has(k));
1539
- }
1399
+ has(property) {
1400
+ return k.includes(property) && property in props;
1540
1401
  },
1541
- propTraps
1542
- )
1543
- );
1402
+ keys() {
1403
+ return k.filter(property => property in props);
1404
+ }
1405
+ }, propTraps);
1406
+ });
1407
+ res.push(new Proxy({
1408
+ get(property) {
1409
+ return blocked.has(property) ? undefined : props[property];
1410
+ },
1411
+ has(property) {
1412
+ return blocked.has(property) ? false : property in props;
1413
+ },
1414
+ keys() {
1415
+ return Object.keys(props).filter(k => !blocked.has(k));
1416
+ }
1417
+ }, propTraps));
1544
1418
  return res;
1545
1419
  }
1546
1420
  const otherObject = {};
1547
1421
  const objects = keys.map(() => ({}));
1548
1422
  for (const propName of Object.getOwnPropertyNames(props)) {
1549
1423
  const desc = Object.getOwnPropertyDescriptor(props, propName);
1550
- const isDefaultDesc =
1551
- !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;
1424
+ const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;
1552
1425
  let blocked = false;
1553
1426
  let objectIndex = 0;
1554
1427
  for (const k of keys) {
1555
1428
  if (k.includes(propName)) {
1556
1429
  blocked = true;
1557
- isDefaultDesc
1558
- ? (objects[objectIndex][propName] = desc.value)
1559
- : Object.defineProperty(objects[objectIndex], propName, desc);
1430
+ isDefaultDesc ? objects[objectIndex][propName] = desc.value : Object.defineProperty(objects[objectIndex], propName, desc);
1560
1431
  }
1561
1432
  ++objectIndex;
1562
1433
  }
1563
1434
  if (!blocked) {
1564
- isDefaultDesc
1565
- ? (otherObject[propName] = desc.value)
1566
- : Object.defineProperty(otherObject, propName, desc);
1435
+ isDefaultDesc ? otherObject[propName] = desc.value : Object.defineProperty(otherObject, propName, desc);
1567
1436
  }
1568
1437
  }
1569
1438
  return [...objects, otherObject];
@@ -1589,24 +1458,19 @@ function lazy(fn) {
1589
1458
  comp = s;
1590
1459
  }
1591
1460
  let Comp;
1592
- return createMemo(() =>
1593
- (Comp = comp())
1594
- ? untrack(() => {
1595
- if (true)
1596
- Object.assign(Comp, {
1597
- [$DEVCOMP]: true
1598
- });
1599
- if (!ctx || sharedConfig.done) return Comp(props);
1600
- const c = sharedConfig.context;
1601
- setHydrateContext(ctx);
1602
- const r = Comp(props);
1603
- setHydrateContext(c);
1604
- return r;
1605
- })
1606
- : ""
1607
- );
1461
+ return createMemo(() => (Comp = comp()) ? untrack(() => {
1462
+ if (true) Object.assign(Comp, {
1463
+ [$DEVCOMP]: true
1464
+ });
1465
+ if (!ctx || sharedConfig.done) return Comp(props);
1466
+ const c = sharedConfig.context;
1467
+ setHydrateContext(ctx);
1468
+ const r = Comp(props);
1469
+ setHydrateContext(c);
1470
+ return r;
1471
+ }) : "");
1608
1472
  };
1609
- wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);
1473
+ wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p);
1610
1474
  return wrap;
1611
1475
  }
1612
1476
  let counter = 0;
@@ -1615,112 +1479,75 @@ function createUniqueId() {
1615
1479
  return ctx ? sharedConfig.getNextContextId() : `cl-${counter++}`;
1616
1480
  }
1617
1481
 
1618
- const narrowedError = name =>
1619
- `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.`;
1482
+ 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.` ;
1620
1483
  function For(props) {
1621
1484
  const fallback = "fallback" in props && {
1622
1485
  fallback: () => props.fallback
1623
1486
  };
1624
- return createMemo(
1625
- mapArray(() => props.each, props.children, fallback || undefined),
1626
- undefined,
1627
- {
1628
- name: "value"
1629
- }
1630
- );
1487
+ return createMemo(mapArray(() => props.each, props.children, fallback || undefined), undefined, {
1488
+ name: "value"
1489
+ }) ;
1631
1490
  }
1632
1491
  function Index(props) {
1633
1492
  const fallback = "fallback" in props && {
1634
1493
  fallback: () => props.fallback
1635
1494
  };
1636
- return createMemo(
1637
- indexArray(() => props.each, props.children, fallback || undefined),
1638
- undefined,
1639
- {
1640
- name: "value"
1641
- }
1642
- );
1495
+ return createMemo(indexArray(() => props.each, props.children, fallback || undefined), undefined, {
1496
+ name: "value"
1497
+ }) ;
1643
1498
  }
1644
1499
  function Show(props) {
1645
1500
  const keyed = props.keyed;
1646
1501
  const condition = createMemo(() => props.when, undefined, {
1647
- equals: (a, b) => (keyed ? a === b : !a === !b),
1502
+ equals: (a, b) => keyed ? a === b : !a === !b,
1648
1503
  name: "condition"
1649
- });
1650
- return createMemo(
1651
- () => {
1652
- const c = condition();
1653
- if (c) {
1654
- const child = props.children;
1655
- const fn = typeof child === "function" && child.length > 0;
1656
- return fn
1657
- ? untrack(() =>
1658
- child(
1659
- keyed
1660
- ? c
1661
- : () => {
1662
- if (!untrack(condition)) throw narrowedError("Show");
1663
- return props.when;
1664
- }
1665
- )
1666
- )
1667
- : child;
1668
- }
1669
- return props.fallback;
1670
- },
1671
- undefined,
1672
- {
1673
- name: "value"
1504
+ } );
1505
+ return createMemo(() => {
1506
+ const c = condition();
1507
+ if (c) {
1508
+ const child = props.children;
1509
+ const fn = typeof child === "function" && child.length > 0;
1510
+ return fn ? untrack(() => child(keyed ? c : () => {
1511
+ if (!untrack(condition)) throw narrowedError("Show");
1512
+ return props.when;
1513
+ })) : child;
1674
1514
  }
1675
- );
1515
+ return props.fallback;
1516
+ }, undefined, {
1517
+ name: "value"
1518
+ } );
1676
1519
  }
1677
1520
  function Switch(props) {
1678
1521
  let keyed = false;
1679
1522
  const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
1680
1523
  const conditions = children(() => props.children),
1681
- evalConditions = createMemo(
1682
- () => {
1683
- let conds = conditions();
1684
- if (!Array.isArray(conds)) conds = [conds];
1685
- for (let i = 0; i < conds.length; i++) {
1686
- const c = conds[i].when;
1687
- if (c) {
1688
- keyed = !!conds[i].keyed;
1689
- return [i, c, conds[i]];
1690
- }
1524
+ evalConditions = createMemo(() => {
1525
+ let conds = conditions();
1526
+ if (!Array.isArray(conds)) conds = [conds];
1527
+ for (let i = 0; i < conds.length; i++) {
1528
+ const c = conds[i].when;
1529
+ if (c) {
1530
+ keyed = !!conds[i].keyed;
1531
+ return [i, c, conds[i]];
1691
1532
  }
1692
- return [-1];
1693
- },
1694
- undefined,
1695
- {
1696
- equals,
1697
- name: "eval conditions"
1698
1533
  }
1699
- );
1700
- return createMemo(
1701
- () => {
1702
- const [index, when, cond] = evalConditions();
1703
- if (index < 0) return props.fallback;
1704
- const c = cond.children;
1705
- const fn = typeof c === "function" && c.length > 0;
1706
- return fn
1707
- ? untrack(() =>
1708
- c(
1709
- keyed
1710
- ? when
1711
- : () => {
1712
- if (untrack(evalConditions)[0] !== index) throw narrowedError("Match");
1713
- return cond.when;
1714
- }
1715
- )
1716
- )
1717
- : c;
1718
- },
1719
- undefined,
1720
- {
1721
- name: "value"
1722
- }
1723
- );
1534
+ return [-1];
1535
+ }, undefined, {
1536
+ equals,
1537
+ name: "eval conditions"
1538
+ } );
1539
+ return createMemo(() => {
1540
+ const [index, when, cond] = evalConditions();
1541
+ if (index < 0) return props.fallback;
1542
+ const c = cond.children;
1543
+ const fn = typeof c === "function" && c.length > 0;
1544
+ return fn ? untrack(() => c(keyed ? when : () => {
1545
+ if (untrack(evalConditions)[0] !== index) throw narrowedError("Match");
1546
+ return cond.when;
1547
+ })) : c;
1548
+ }, undefined, {
1549
+ name: "value"
1550
+ } );
1724
1551
  }
1725
1552
  function Match(props) {
1726
1553
  return props;
@@ -1731,34 +1558,28 @@ function resetErrorBoundaries() {
1731
1558
  }
1732
1559
  function ErrorBoundary(props) {
1733
1560
  let err;
1734
- if (sharedConfig.context && sharedConfig.load)
1735
- err = sharedConfig.load(sharedConfig.getContextId());
1561
+ if (sharedConfig.context && sharedConfig.load) err = sharedConfig.load(sharedConfig.getContextId());
1736
1562
  const [errored, setErrored] = createSignal(err, {
1737
1563
  name: "errored"
1738
- });
1564
+ } );
1739
1565
  Errors || (Errors = new Set());
1740
1566
  Errors.add(setErrored);
1741
1567
  onCleanup(() => Errors.delete(setErrored));
1742
- return createMemo(
1743
- () => {
1744
- let e;
1745
- if ((e = errored())) {
1746
- const f = props.fallback;
1747
- if (typeof f !== "function" || f.length == 0) console.error(e);
1748
- return typeof f === "function" && f.length ? untrack(() => f(e, () => setErrored())) : f;
1749
- }
1750
- return catchError(() => props.children, setErrored);
1751
- },
1752
- undefined,
1753
- {
1754
- name: "value"
1568
+ return createMemo(() => {
1569
+ let e;
1570
+ if (e = errored()) {
1571
+ const f = props.fallback;
1572
+ if ((typeof f !== "function" || f.length == 0)) console.error(e);
1573
+ return typeof f === "function" && f.length ? untrack(() => f(e, () => setErrored())) : f;
1755
1574
  }
1756
- );
1575
+ return catchError(() => props.children, setErrored);
1576
+ }, undefined, {
1577
+ name: "value"
1578
+ } );
1757
1579
  }
1758
1580
 
1759
- const suspenseListEquals = (a, b) =>
1760
- a.showContent === b.showContent && a.showFallback === b.showFallback;
1761
- const SuspenseListContext = /* #__PURE__ */ createContext();
1581
+ const suspenseListEquals = (a, b) => a.showContent === b.showContent && a.showFallback === b.showFallback;
1582
+ const SuspenseListContext = /* #__PURE__ */createContext();
1762
1583
  function SuspenseList(props) {
1763
1584
  let [wrapper, setWrapper] = createSignal(() => ({
1764
1585
  inFallback: false
@@ -1769,51 +1590,51 @@ function SuspenseList(props) {
1769
1590
  if (listContext) {
1770
1591
  show = listContext.register(createMemo(() => wrapper()().inFallback));
1771
1592
  }
1772
- const resolved = createMemo(
1773
- prev => {
1774
- const reveal = props.revealOrder,
1775
- tail = props.tail,
1776
- { showContent = true, showFallback = true } = show ? show() : {},
1777
- reg = registry(),
1778
- reverse = reveal === "backwards";
1779
- if (reveal === "together") {
1780
- const all = reg.every(inFallback => !inFallback());
1781
- const res = reg.map(() => ({
1782
- showContent: all && showContent,
1593
+ const resolved = createMemo(prev => {
1594
+ const reveal = props.revealOrder,
1595
+ tail = props.tail,
1596
+ {
1597
+ showContent = true,
1598
+ showFallback = true
1599
+ } = show ? show() : {},
1600
+ reg = registry(),
1601
+ reverse = reveal === "backwards";
1602
+ if (reveal === "together") {
1603
+ const all = reg.every(inFallback => !inFallback());
1604
+ const res = reg.map(() => ({
1605
+ showContent: all && showContent,
1606
+ showFallback
1607
+ }));
1608
+ res.inFallback = !all;
1609
+ return res;
1610
+ }
1611
+ let stop = false;
1612
+ let inFallback = prev.inFallback;
1613
+ const res = [];
1614
+ for (let i = 0, len = reg.length; i < len; i++) {
1615
+ const n = reverse ? len - i - 1 : i,
1616
+ s = reg[n]();
1617
+ if (!stop && !s) {
1618
+ res[n] = {
1619
+ showContent,
1783
1620
  showFallback
1784
- }));
1785
- res.inFallback = !all;
1786
- return res;
1787
- }
1788
- let stop = false;
1789
- let inFallback = prev.inFallback;
1790
- const res = [];
1791
- for (let i = 0, len = reg.length; i < len; i++) {
1792
- const n = reverse ? len - i - 1 : i,
1793
- s = reg[n]();
1794
- if (!stop && !s) {
1795
- res[n] = {
1796
- showContent,
1797
- showFallback
1798
- };
1799
- } else {
1800
- const next = !stop;
1801
- if (next) inFallback = true;
1802
- res[n] = {
1803
- showContent: next,
1804
- showFallback: !tail || (next && tail === "collapsed") ? showFallback : false
1805
- };
1806
- stop = true;
1807
- }
1621
+ };
1622
+ } else {
1623
+ const next = !stop;
1624
+ if (next) inFallback = true;
1625
+ res[n] = {
1626
+ showContent: next,
1627
+ showFallback: !tail || next && tail === "collapsed" ? showFallback : false
1628
+ };
1629
+ stop = true;
1808
1630
  }
1809
- if (!stop) inFallback = false;
1810
- res.inFallback = inFallback;
1811
- return res;
1812
- },
1813
- {
1814
- inFallback: false
1815
1631
  }
1816
- );
1632
+ if (!stop) inFallback = false;
1633
+ res.inFallback = inFallback;
1634
+ return res;
1635
+ }, {
1636
+ inFallback: false
1637
+ });
1817
1638
  setWrapper(() => resolved);
1818
1639
  return createComponent(SuspenseListContext.Provider, {
1819
1640
  value: {
@@ -1858,27 +1679,23 @@ function Suspense(props) {
1858
1679
  const key = sharedConfig.getContextId();
1859
1680
  let ref = sharedConfig.load(key);
1860
1681
  if (ref) {
1861
- if (typeof ref !== "object" || ref.status !== "success") p = ref;
1862
- else sharedConfig.gather(key);
1682
+ if (typeof ref !== "object" || ref.status !== "success") p = ref;else sharedConfig.gather(key);
1863
1683
  }
1864
1684
  if (p && p !== "$$f") {
1865
1685
  const [s, set] = createSignal(undefined, {
1866
1686
  equals: false
1867
1687
  });
1868
1688
  flicker = s;
1869
- p.then(
1870
- () => {
1871
- if (sharedConfig.done) return set();
1872
- sharedConfig.gather(key);
1873
- setHydrateContext(ctx);
1874
- set();
1875
- setHydrateContext();
1876
- },
1877
- err => {
1878
- error = err;
1879
- set();
1880
- }
1881
- );
1689
+ p.then(() => {
1690
+ if (sharedConfig.done) return set();
1691
+ sharedConfig.gather(key);
1692
+ setHydrateContext(ctx);
1693
+ set();
1694
+ setHydrateContext();
1695
+ }, err => {
1696
+ error = err;
1697
+ set();
1698
+ });
1882
1699
  }
1883
1700
  }
1884
1701
  const listContext = useContext(SuspenseListContext);
@@ -1893,14 +1710,17 @@ function Suspense(props) {
1893
1710
  ctx = sharedConfig.context;
1894
1711
  if (flicker) {
1895
1712
  flicker();
1896
- return (flicker = undefined);
1713
+ return flicker = undefined;
1897
1714
  }
1898
1715
  if (ctx && p === "$$f") setHydrateContext();
1899
1716
  const rendered = createMemo(() => props.children);
1900
1717
  return createMemo(prev => {
1901
1718
  const inFallback = store.inFallback(),
1902
- { showContent = true, showFallback = true } = show ? show() : {};
1903
- if ((!inFallback || (p && p !== "$$f")) && showContent) {
1719
+ {
1720
+ showContent = true,
1721
+ showFallback = true
1722
+ } = show ? show() : {};
1723
+ if ((!inFallback || p && p !== "$$f") && showContent) {
1904
1724
  store.resolved = true;
1905
1725
  dispose && dispose();
1906
1726
  dispose = ctx = p = undefined;
@@ -1930,68 +1750,9 @@ const DEV = {
1930
1750
  hooks: DevHooks,
1931
1751
  writeSignal,
1932
1752
  registerGraph
1933
- };
1753
+ } ;
1934
1754
  if (globalThis) {
1935
- if (!globalThis.Solid$$) globalThis.Solid$$ = true;
1936
- else
1937
- console.warn(
1938
- "You appear to have multiple instances of Solid. This can lead to unexpected behavior."
1939
- );
1755
+ if (!globalThis.Solid$$) globalThis.Solid$$ = true;else console.warn("You appear to have multiple instances of Solid. This can lead to unexpected behavior.");
1940
1756
  }
1941
1757
 
1942
- export {
1943
- $DEVCOMP,
1944
- $PROXY,
1945
- $TRACK,
1946
- DEV,
1947
- ErrorBoundary,
1948
- For,
1949
- Index,
1950
- Match,
1951
- Show,
1952
- Suspense,
1953
- SuspenseList,
1954
- Switch,
1955
- batch,
1956
- cancelCallback,
1957
- catchError,
1958
- children,
1959
- createComponent,
1960
- createComputed,
1961
- createContext,
1962
- createDeferred,
1963
- createEffect,
1964
- createMemo,
1965
- createReaction,
1966
- createRenderEffect,
1967
- createResource,
1968
- createRoot,
1969
- createSelector,
1970
- createSignal,
1971
- createUniqueId,
1972
- enableExternalSource,
1973
- enableHydration,
1974
- enableScheduling,
1975
- equalFn,
1976
- from,
1977
- getListener,
1978
- getOwner,
1979
- indexArray,
1980
- lazy,
1981
- mapArray,
1982
- mergeProps,
1983
- observable,
1984
- on,
1985
- onCleanup,
1986
- onError,
1987
- onMount,
1988
- requestCallback,
1989
- resetErrorBoundaries,
1990
- runWithOwner,
1991
- sharedConfig,
1992
- splitProps,
1993
- startTransition,
1994
- untrack,
1995
- useContext,
1996
- useTransition
1997
- };
1758
+ 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 };