@tempots/dom 20.1.0 → 21.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
- var Te = Object.defineProperty;
2
- var Ce = (t, e, r) => e in t ? Te(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var u = (t, e, r) => Ce(t, typeof e != "symbol" ? e + "" : e, r);
4
- const Le = (t, e, r) => t + (e - t) * r;
5
- const Oe = (t, e, r) => {
1
+ var Ce = Object.defineProperty;
2
+ var Le = (t, e, r) => e in t ? Ce(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var u = (t, e, r) => Le(t, typeof e != "symbol" ? e + "" : e, r);
4
+ const Oe = (t, e, r) => t + (e - t) * r;
5
+ const ke = (t, e, r) => {
6
6
  const s = Math.max(t.length, e.length);
7
7
  let n = "";
8
8
  for (let o = 0; o < s; o++) {
@@ -12,8 +12,8 @@ const Oe = (t, e, r) => {
12
12
  isNaN(l) && (l = 97), n += String.fromCharCode(i + (l - i) * r);
13
13
  }
14
14
  return n;
15
- }, ke = (t, e, r) => new Date(t.getTime() + (e.getTime() - t.getTime()) * r), Ne = (t, e) => e, Re = (t) => typeof t == "number" ? Le : typeof t == "string" ? Oe : t instanceof Date ? ke : Ne;
16
- class R {
15
+ }, Ne = (t, e, r) => new Date(t.getTime() + (e.getTime() - t.getTime()) * r), Re = (t, e) => e, Me = (t) => typeof t == "number" ? Oe : typeof t == "string" ? ke : t instanceof Date ? Ne : Re;
16
+ class M {
17
17
  /**
18
18
  * Creates a new instance of `ElementPosition`.
19
19
  * @param index - The index of the element.
@@ -57,7 +57,7 @@ class R {
57
57
  return this.index % 2 === 0;
58
58
  }
59
59
  }
60
- const p = class p {
60
+ const C = class C {
61
61
  /**
62
62
  * Represents a signal with a value of type T.
63
63
  *
@@ -241,7 +241,7 @@ const p = class p {
241
241
  * @returns A property that holds the mapped value and can be observed for changes.
242
242
  */
243
243
  u(this, "mapAsync", (e, r, s, n = (o, i) => o === i) => {
244
- const o = C(r, n);
244
+ const o = L(r, n);
245
245
  let i = 0, l = new AbortController();
246
246
  return o.onDispose(
247
247
  this.on(async (a) => {
@@ -286,7 +286,7 @@ const p = class p {
286
286
  * @param autoDisposeProp - Determines whether the derived property should be automatically disposed.
287
287
  * @returns The derived property.
288
288
  */
289
- u(this, "deriveProp", (e = !0) => this.feedProp(C(this.get()), e));
289
+ u(this, "deriveProp", (e = !0) => this.feedProp(L(this.get()), e));
290
290
  /**
291
291
  * Returns a signal that emits the count of values received so far.
292
292
  * @returns A signal that emits the count of values received so far.
@@ -338,8 +338,8 @@ const p = class p {
338
338
  * @param equals - A function to compare two values of type O for equality. Defaults to strict equality (===).
339
339
  * @returns - A Signal that represents the result of the Promise.
340
340
  */
341
- u(p, "ofPromise", (e, r, s, n = (o, i) => o === i) => {
342
- const o = new p(r, n);
341
+ u(C, "ofPromise", (e, r, s, n = (o, i) => o === i) => {
342
+ const o = new C(r, n);
343
343
  return e.then((i) => o._setAndNotify(i, !1)).catch((i) => {
344
344
  s != null ? o._setAndNotify(s(i), !1) : console.error(
345
345
  "Unhandled promise rejection in Signal.ofPromise:",
@@ -352,47 +352,12 @@ u(p, "ofPromise", (e, r, s, n = (o, i) => o === i) => {
352
352
  * @param value - The value to check.
353
353
  * @returns `true` if the value is a Signal, `false` otherwise.
354
354
  */
355
- u(p, "is", (e) => (
355
+ u(C, "is", (e) => (
356
356
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
357
357
  e != null && e.$__signal__ === !0
358
- )), /**
359
- * Wraps a value or a Signal instance into a Signal.
360
- * If the value is already a Signal, it returns the value itself.
361
- * If the value is not a Signal, it creates a new Signal instance with the given value.
362
- *
363
- * @typeParam O - The type of the value.
364
- * @param value - The value or Signal instance to wrap.
365
- * @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
366
- * @returns A Signal instance.
367
- */
368
- u(p, "wrap", (e, r = (s, n) => s === n) => p.is(e) ? e : new p(e, r)), /**
369
- * Wraps a value in a `Signal` if it is not already a `Signal`.
370
- * If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
371
- * @param value - The value to wrap or check.
372
- * @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
373
- */
374
- u(p, "maybeWrap", (e) => e == null ? e : p.wrap(e)), /**
375
- * Unwraps a value from a `Signal` if it is a `Signal`, otherwise returns the value as is.
376
- *
377
- * @param value - The value to unwrap.
378
- * @returns The unwrapped value.
379
- */
380
- u(p, "unwrap", (e) => p.is(e) ? e.get() : e), /**
381
- * Maps the value of a `Signal` or a regular value using the provided mapping function.
382
- * If the input value is a `Signal`, the mapping function is applied to its value.
383
- * If the input value is not a `Signal`, the mapping function is directly applied to the value.
384
- *
385
- * @param value - The input value to be mapped.
386
- * @param fn - The mapping function to be applied to the value.
387
- * @returns A new `Signal` with the mapped value if the input value is a `Signal`,
388
- * otherwise, the result of applying the mapping function to the value.
389
- *
390
- * @typeParam N - The type of the input value.
391
- * @typeParam O - The type of the mapped value.
392
- */
393
- u(p, "map", (e, r) => p.is(e) ? e.map(r) : r(e));
394
- let h = p;
395
- const Me = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
358
+ ));
359
+ let h = C;
360
+ const $e = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
396
361
  class E extends h {
397
362
  /**
398
363
  * Represents a Signal object.
@@ -428,7 +393,7 @@ class E extends h {
428
393
  */
429
394
  u(this, "_scheduleNotify", () => {
430
395
  const r = ++this._scheduleCount;
431
- Me(() => {
396
+ $e(() => {
432
397
  this._scheduleCount !== r || this._disposed !== !1 || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn(), !1));
433
398
  });
434
399
  });
@@ -450,7 +415,7 @@ class E extends h {
450
415
  return this.get();
451
416
  }
452
417
  }
453
- const V = class V extends h {
418
+ const q = class q extends h {
454
419
  constructor() {
455
420
  super(...arguments);
456
421
  /**
@@ -504,7 +469,7 @@ const V = class V extends h {
504
469
  * @returns A Prop object representing the isomorphism.
505
470
  */
506
471
  u(this, "iso", (r, s, n = (o, i) => o === i) => {
507
- const o = new V(r(this.get()), n);
472
+ const o = new q(r(this.get()), n);
508
473
  return o.onDispose(this.on((i) => o.set(r(i)))), o.on((i) => this._setAndNotify(s(i), !1)), o;
509
474
  });
510
475
  /**
@@ -533,29 +498,74 @@ const V = class V extends h {
533
498
  * @param value - The value to check.
534
499
  * @returns `true` if the value is a Prop, `false` otherwise.
535
500
  */
536
- u(V, "is", (r) => (
501
+ u(q, "is", (r) => (
537
502
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
538
503
  r != null && r.$__prop__ === !0
539
504
  ));
540
- let F = V;
541
- const U = (t, e, r = (s, n) => s === n) => {
505
+ let F = q;
506
+ const J = (t, e, r = (s, n) => s === n) => {
542
507
  const s = new E(t, r);
543
508
  return e.forEach((n) => n.setDerivative(s)), s;
544
- }, $e = (...t) => (e, r) => {
509
+ }, Ve = (t, e) => J(t, e).dispose, L = (t, e = (r, s) => r === s) => new F(t, e), I = (t, e = (r, s) => r === s) => new h(t, e), m = {
510
+ /**
511
+ * Maps a value or a Signal to a new value.
512
+ * If the value is a Signal, it returns a new Signal with the mapped value.
513
+ * If the value is not a Signal, it returns the mapped value.
514
+ *
515
+ * @typeParam T - The type of the value.
516
+ * @typeParam U - The type of the new value.
517
+ * @param value - The value or Signal to map.
518
+ * @param fn - The function to map the value.
519
+ * @returns The mapped value.
520
+ */
521
+ map: (t, e) => h.is(t) ? t.map(e) : e(t),
522
+ /**
523
+ * Wraps a value or a Signal instance into a Signal.
524
+ * If the value is already a Signal, it returns the value itself.
525
+ * If the value is not a Signal, it creates a new Signal instance with the given value.
526
+ *
527
+ * @typeParam O - The type of the value.
528
+ * @param value - The value or Signal instance to wrap.
529
+ * @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
530
+ * @returns A Signal instance.
531
+ */
532
+ toSignal: (t, e) => h.is(t) ? t : I(t, e),
533
+ /**
534
+ * Wraps a value in a `Signal` if it is not already a `Signal`.
535
+ * If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
536
+ * @param value - The value to wrap or check.
537
+ * @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
538
+ */
539
+ maybeToSignal: (t, e) => {
540
+ if (t != null)
541
+ return m.toSignal(t, e);
542
+ },
543
+ /**
544
+ * Gets the value from a `Signal` or the value itself if it is not a `Signal`.
545
+ * @param value - The value or Signal instance to get the value from.
546
+ * @returns The value.
547
+ */
548
+ get: (t) => h.is(t) ? t.get() : t,
549
+ /**
550
+ * Adds a listener to a `Signal` or calls the listener immediately if it is not a `Signal`.
551
+ * @param value - The value or Signal instance to add the listener to.
552
+ * @param listener - The listener to call when the value changes.
553
+ * @returns A function to remove the listener.
554
+ */
555
+ on: (t, e) => h.is(t) ? t.on(e) : (e(t), () => {
556
+ })
557
+ }, Fe = (...t) => (e, r) => {
545
558
  const s = t.filter((n) => h.is(n));
546
- return U(
547
- () => e(...t.map((n) => h.unwrap(n))),
559
+ return J(
560
+ () => e(...t.map((n) => m.get(n))),
548
561
  s,
549
562
  r
550
563
  );
551
- }, Fe = (t, e) => U(t, e).dispose, gt = (...t) => (e) => {
564
+ }, _t = (...t) => (e) => {
552
565
  const r = t.filter((s) => h.is(s));
553
- Fe(
554
- () => e(...t.map(h.unwrap)),
555
- r
556
- );
557
- }, C = (t, e = (r, s) => r === s) => new F(t, e), G = (t, e = (r, s) => r === s) => new h(t, e);
558
- class Z {
566
+ Ve(() => e(...t.map(m.get)), r);
567
+ };
568
+ class K {
559
569
  constructor() {
560
570
  u(this, "_store", /* @__PURE__ */ new Map());
561
571
  /**
@@ -574,7 +584,7 @@ class Z {
574
584
  });
575
585
  }
576
586
  }
577
- const K = ({
587
+ const x = ({
578
588
  key: t,
579
589
  defaultValue: e,
580
590
  store: r,
@@ -590,37 +600,37 @@ const K = ({
590
600
  return a.on((c) => {
591
601
  r.setItem(t, s(c));
592
602
  }), a;
593
- }, _t = (t) => K({
603
+ }, vt = (t) => x({
594
604
  ...t,
595
- store: (window == null ? void 0 : window.localStorage) ?? new Z()
596
- }), vt = (t) => K({
605
+ store: (window == null ? void 0 : window.localStorage) ?? new K()
606
+ }), yt = (t) => x({
597
607
  ...t,
598
- store: (window == null ? void 0 : window.sessionStorage) ?? new Z()
608
+ store: (window == null ? void 0 : window.sessionStorage) ?? new K()
599
609
  });
600
- function Y(t) {
610
+ function Z(t) {
601
611
  return typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
602
612
  }
603
- const Ve = (t, e, r, s) => {
604
- const n = (s == null ? void 0 : s.duration) ?? 300, o = (s == null ? void 0 : s.easing) ?? ((y) => y), i = (s == null ? void 0 : s.equals) ?? ((y, N) => y === N);
605
- let l = s == null ? void 0 : s.interpolate, a = t, c = e(), d = performance.now(), v = null, m = !0;
606
- const D = new E(e, i), A = C(t, i);
613
+ const qe = (t, e, r, s) => {
614
+ const n = (s == null ? void 0 : s.duration) ?? 300, o = (s == null ? void 0 : s.easing) ?? ((y) => y), i = (s == null ? void 0 : s.equals) ?? ((y, R) => y === R);
615
+ let l = s == null ? void 0 : s.interpolate, a = t, c = e(), d = performance.now(), v = null, p = !0;
616
+ const D = new E(e, i), A = L(t, i);
607
617
  A.onDispose(() => {
608
618
  v !== null && cancelAnimationFrame(v);
609
619
  }), A.onDispose(D.dispose), r.forEach((y) => {
610
620
  y.setDerivative(D), y.onDispose(A.dispose);
611
621
  });
612
- const De = (y) => {
613
- c = y, d = performance.now(), a = A.value, m && (m = !1, v = Y(z));
614
- }, z = () => {
615
- const N = (performance.now() - d) / h.unwrap(n), be = o(N);
616
- l == null && (l = Re(a));
617
- let Q = l(a, c, be);
618
- N >= 1 ? (m = !0, Q = c) : v = Y(z), A.set(Q);
622
+ const be = (y) => {
623
+ c = y, d = performance.now(), a = A.value, p && (p = !1, v = Z(Q));
624
+ }, Q = () => {
625
+ const R = (performance.now() - d) / m.get(n), Te = o(R);
626
+ l == null && (l = Me(a));
627
+ let Y = l(a, c, Te);
628
+ R >= 1 ? (p = !0, Y = c) : v = Z(Q), A.set(Y);
619
629
  };
620
- return D.on(De), A;
621
- }, yt = (t, e) => {
630
+ return D.on(be), A;
631
+ }, St = (t, e) => {
622
632
  const { initialValue: r, ...s } = e ?? {};
623
- return Ve(
633
+ return qe(
624
634
  r ?? t.get(),
625
635
  t.get,
626
636
  [t],
@@ -631,13 +641,13 @@ const Ve = (t, e, r, s) => {
631
641
  ({ signals: o, literals: i }, [l, a]) => (h.is(a) ? o.push([l, a]) : i[l] = a, { signals: o, literals: i }),
632
642
  { signals: [], literals: {} }
633
643
  ), n = r.map(([, o]) => o);
634
- return U(() => (r.forEach(([o, i]) => s[o] = i.value), e(s)), n);
635
- }, x = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), ee = /* @__PURE__ */ new Set([
644
+ return J(() => (r.forEach(([o, i]) => s[o] = i.value), e(s)), n);
645
+ }, ee = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), te = /* @__PURE__ */ new Set([
636
646
  "rowSpan",
637
647
  "colSpan",
638
648
  "tabIndex",
639
649
  "valueAsNumber"
640
- ]), te = /* @__PURE__ */ new Set(["valueAsDate"]), re = /* @__PURE__ */ new Set([
650
+ ]), re = /* @__PURE__ */ new Set(["valueAsDate"]), se = /* @__PURE__ */ new Set([
641
651
  "value",
642
652
  "textContent",
643
653
  "innerText",
@@ -645,25 +655,25 @@ const Ve = (t, e, r, s) => {
645
655
  "outerHTML",
646
656
  "className",
647
657
  "classList"
648
- ]), I = /* @__PURE__ */ new Map(), b = (t, e) => {
649
- if (I.has(t))
650
- return I.get(t);
658
+ ]), j = /* @__PURE__ */ new Map(), b = (t, e) => {
659
+ if (j.has(t))
660
+ return j.get(t);
651
661
  {
652
662
  const r = e(t);
653
- return I.set(t, r), r;
663
+ return j.set(t, r), r;
654
664
  }
655
- }, qe = (t) => (e, r) => {
656
- r == null ? e[t] = null : e[t] = !!r;
657
665
  }, Ie = (t) => (e, r) => {
658
- r == null ? e[t] = null : e[t] = Number(r);
666
+ r == null ? e[t] = null : e[t] = !!r;
659
667
  }, Be = (t) => (e, r) => {
660
- r == null ? e[t] = null : e[t] = r;
668
+ r == null ? e[t] = null : e[t] = Number(r);
661
669
  }, je = (t) => (e, r) => {
662
- r == null ? e[t] = null : e[t] = String(r);
670
+ r == null ? e[t] = null : e[t] = r;
663
671
  }, Ue = (t) => (e, r) => {
672
+ r == null ? e[t] = null : e[t] = String(r);
673
+ }, Ge = (t) => (e, r) => {
664
674
  r == null ? e.removeAttribute(t) : e.setAttribute(t, r);
665
- }, se = (t) => x.has(t) ? b(t, qe) : ee.has(t) ? b(t, Ie) : te.has(t) ? b(t, Be) : re.has(t) ? b(t, je) : b(t, Ue), ne = (t) => (e) => x.has(t) ? !!e[t] : ee.has(t) ? Number(e[t]) : te.has(t) ? e[t] : re.has(t) ? String(e[t]) : e.getAttribute(t);
666
- class w {
675
+ }, ne = (t) => ee.has(t) ? b(t, Ie) : te.has(t) ? b(t, Be) : re.has(t) ? b(t, je) : se.has(t) ? b(t, Ue) : b(t, Ge), oe = (t) => (e) => ee.has(t) ? !!e[t] : te.has(t) ? Number(e[t]) : re.has(t) ? e[t] : se.has(t) ? String(e[t]) : e.getAttribute(t);
676
+ class S {
667
677
  /**
668
678
  * Constructs a new `DOMContext` instance.
669
679
  *
@@ -711,18 +721,18 @@ class w {
711
721
  * @param document - The `Document` to use for the `DOMContext`.
712
722
  * @returns A new `DOMContext` instance.
713
723
  */
714
- u(this, "withDocument", (e) => new w(e, this.element, this.reference, this.providers, !0));
724
+ u(this, "withDocument", (e) => new S(e, this.element, this.reference, this.providers, !0));
715
725
  /**
716
726
  * Creates a new `DOMContext` instance with the provided `element`.
717
727
  * @param element - The DOM element to use in the new `DOMContext` instance.
718
728
  * @returns A new `DOMContext` instance with the provided `element`.
719
729
  */
720
- u(this, "withElement", (e) => new w(this.document, e, void 0, this.providers, !1));
730
+ u(this, "withElement", (e) => new S(this.document, e, void 0, this.providers, !1));
721
731
  /**
722
732
  * Creates a new `DOMContext` instance with the `isFirstLevel` property set to `true`.
723
733
  * @returns A new `DOMContext` instance with the `isFirstLevel` property set to `true`.
724
734
  */
725
- u(this, "withFirstLevel", () => new w(
735
+ u(this, "withFirstLevel", () => new S(
726
736
  this.document,
727
737
  this.element,
728
738
  this.reference,
@@ -735,7 +745,7 @@ class w {
735
745
  * @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
736
746
  * @returns A new `DOMContext` instance with the specified reference.
737
747
  */
738
- u(this, "withReference", (e) => new w(
748
+ u(this, "withReference", (e) => new S(
739
749
  this.document,
740
750
  this.element,
741
751
  e,
@@ -748,7 +758,7 @@ class w {
748
758
  * @param value - The value to set for the provider.
749
759
  * @returns A new DOMContext with the updated providers.
750
760
  */
751
- u(this, "withProvider", (e, r) => new w(
761
+ u(this, "withProvider", (e, r) => new S(
752
762
  this.document,
753
763
  this.element,
754
764
  this.reference,
@@ -765,7 +775,7 @@ class w {
765
775
  * @param providers - An object containing the providers to be merged into the existing providers.
766
776
  * @returns A new DOMContext instance with the merged providers.
767
777
  */
768
- u(this, "withProviders", (e) => new w(
778
+ u(this, "withProviders", (e) => new S(
769
779
  this.document,
770
780
  this.element,
771
781
  this.reference,
@@ -784,7 +794,7 @@ class w {
784
794
  */
785
795
  u(this, "getProvider", (e) => {
786
796
  if (this.providers[e] === void 0)
787
- throw new Ge(e);
797
+ throw new Je(e);
788
798
  return this.providers[e];
789
799
  });
790
800
  this.document = e, this.element = r, this.reference = s, this.providers = n, this.isFirstLevel = o;
@@ -797,10 +807,10 @@ class w {
797
807
  * @returns A new `DOMContext` instance.
798
808
  */
799
809
  static of(e, r) {
800
- return new w(e.ownerDocument, e, r, {}, !0);
810
+ return new S(e.ownerDocument, e, r, {}, !0);
801
811
  }
802
812
  }
803
- class Ge extends Error {
813
+ class Je extends Error {
804
814
  constructor(e) {
805
815
  super(`Provider not found: ${e.description}`);
806
816
  }
@@ -808,30 +818,30 @@ class Ge extends Error {
808
818
  const _ = (t) => {
809
819
  const e = t;
810
820
  e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentElement && t.parentElement.removeChild(t);
811
- }, Je = (t) => oe(t) ? t : t.parentElement, oe = (t) => t.nodeType === 1, ie = (t) => (e) => {
812
- pe(e);
821
+ }, He = (t) => ie(t) ? t : t.parentElement, ie = (t) => t.nodeType === 1, le = (t) => (e) => {
822
+ me(e);
813
823
  const r = e.createText(t);
814
824
  return e.appendOrInsert(r), (s) => {
815
825
  s && _(r);
816
826
  };
817
- }, le = (t) => (e) => {
818
- pe(e);
827
+ }, ue = (t) => (e) => {
828
+ me(e);
819
829
  const r = e.createText(t.value);
820
830
  e.appendOrInsert(r);
821
831
  const s = t.on((n) => r.data = n);
822
832
  return (n) => {
823
833
  s(), n && _(r);
824
834
  };
825
- }, St = (t) => h.is(t) ? le(t) : ie(t), g = (...t) => (e) => {
835
+ }, At = (t) => h.is(t) ? ue(t) : le(t), g = (...t) => (e) => {
826
836
  const r = t.map((s) => f(s)(e));
827
837
  return (s) => {
828
838
  r.forEach((n) => n(s));
829
839
  };
830
- }, S = () => () => {
831
- }, We = (t) => (e) => (he(e), e.element.classList.add(...t), (r) => {
840
+ }, w = () => () => {
841
+ }, We = (t) => (e) => (de(e), e.element.classList.add(...t), (r) => {
832
842
  r && e.element.classList.remove(...t);
833
- }), He = (t) => (e) => {
834
- he(e);
843
+ }), Xe = (t) => (e) => {
844
+ de(e);
835
845
  const r = e.element;
836
846
  let s = [];
837
847
  const n = t.on((o) => {
@@ -840,19 +850,19 @@ const _ = (t) => {
840
850
  return (o) => {
841
851
  n(), o && s.forEach((i) => r.classList.remove(i)), s.length = 0;
842
852
  };
843
- }, L = (t, e) => {
844
- const r = se(t), s = ne(t);
853
+ }, O = (t, e) => {
854
+ const r = ne(t), s = oe(t);
845
855
  return (n) => {
846
- fe(n, t);
856
+ he(n, t);
847
857
  const o = s(n.element);
848
858
  return r(n.element, e), (i) => {
849
859
  i && r(n.element, o);
850
860
  };
851
861
  };
852
- }, O = (t, e) => {
853
- const r = se(t), s = ne(t);
862
+ }, k = (t, e) => {
863
+ const r = ne(t), s = oe(t);
854
864
  return (n) => {
855
- fe(n, t);
865
+ he(n, t);
856
866
  const o = s(n.element), i = e.on((l) => r(n.element, l));
857
867
  return (l) => {
858
868
  i(), l && r(n.element, o);
@@ -872,17 +882,17 @@ const _ = (t) => {
872
882
  * @returns The renderable component for the specified attribute.
873
883
  *
874
884
  */
875
- get: (t, e) => e === "class" ? (r) => h.is(r) ? He(r) : We(
885
+ get: (t, e) => e === "class" ? (r) => h.is(r) ? Xe(r) : We(
876
886
  (r ?? "").split(" ").filter((s) => s.length > 0)
877
- ) : (r) => h.is(r) ? O(
887
+ ) : (r) => h.is(r) ? k(
878
888
  e,
879
889
  r
880
- ) : L(
890
+ ) : O(
881
891
  e,
882
892
  r
883
893
  )
884
894
  }
885
- ), At = new Proxy(
895
+ ), Et = new Proxy(
886
896
  {},
887
897
  {
888
898
  /**
@@ -893,12 +903,12 @@ const _ = (t) => {
893
903
  * @returns The renderable component for the specified attribute.
894
904
  *
895
905
  */
896
- get: (t, e) => (r) => h.is(r) ? O(
906
+ get: (t, e) => (r) => h.is(r) ? k(
897
907
  `data-${e}`,
898
908
  r
899
- ) : L(`data-${e}`, r)
909
+ ) : O(`data-${e}`, r)
900
910
  }
901
- ), Et = new Proxy(
911
+ ), Pt = new Proxy(
902
912
  {},
903
913
  {
904
914
  /**
@@ -909,15 +919,15 @@ const _ = (t) => {
909
919
  * @returns The renderable component for the specified attribute.
910
920
  *
911
921
  */
912
- get: (t, e) => (r) => h.is(r) ? O(
922
+ get: (t, e) => (r) => h.is(r) ? k(
913
923
  `aria-${e}`,
914
924
  r
915
- ) : L(
925
+ ) : O(
916
926
  `aria-${e}`,
917
927
  r
918
928
  )
919
929
  }
920
- ), Pt = new Proxy(
930
+ ), Dt = new Proxy(
921
931
  {},
922
932
  {
923
933
  /**
@@ -928,15 +938,15 @@ const _ = (t) => {
928
938
  * @returns The renderable component for the specified attribute.
929
939
  *
930
940
  */
931
- get: (t, e) => (r) => h.is(r) ? O(
941
+ get: (t, e) => (r) => h.is(r) ? k(
932
942
  e,
933
943
  r
934
- ) : L(
944
+ ) : O(
935
945
  e,
936
946
  r
937
947
  )
938
948
  }
939
- ), Dt = new Proxy(
949
+ ), bt = new Proxy(
940
950
  {},
941
951
  {
942
952
  /**
@@ -946,29 +956,29 @@ const _ = (t) => {
946
956
  * @returns The renderable component for the specified attribute.
947
957
  *
948
958
  */
949
- get: (t, e) => (r) => h.is(r) ? O(
959
+ get: (t, e) => (r) => h.is(r) ? k(
950
960
  e,
951
961
  r
952
- ) : L(
962
+ ) : O(
953
963
  e,
954
964
  r
955
965
  )
956
966
  }
957
- ), f = (t) => t == null ? S : Array.isArray(t) ? g(...t.map(f)) : typeof t == "string" ? ie(t) : h.is(t) ? le(t) : t, ue = (t, ...e) => (r) => {
967
+ ), f = (t) => t == null ? w : Array.isArray(t) ? g(...t.map(f)) : typeof t == "string" ? le(t) : h.is(t) ? ue(t) : t, ae = (t, ...e) => (r) => {
958
968
  const s = r.createElement(t, void 0);
959
- r.isFirstLevel && k() && de(s), r.appendOrInsert(s), r = r.withElement(s);
969
+ r.isFirstLevel && N() && pe(s), r.appendOrInsert(s), r = r.withElement(s);
960
970
  const n = e.map((o) => f(o)(r));
961
971
  return (o) => {
962
972
  n.forEach((i) => i(!1)), o && _(s);
963
973
  };
964
- }, ae = (t, e, ...r) => (s) => {
974
+ }, ce = (t, e, ...r) => (s) => {
965
975
  const n = s.createElement(t, e);
966
- s.isFirstLevel && k() && de(n), s.appendOrInsert(n), s = s.withElement(n);
976
+ s.isFirstLevel && N() && pe(n), s.appendOrInsert(n), s = s.withElement(n);
967
977
  const o = r.map((i) => f(i)(s));
968
978
  return (i) => {
969
979
  o.forEach((l) => l(!1)), i && _(n);
970
980
  };
971
- }, bt = new Proxy(
981
+ }, Tt = new Proxy(
972
982
  {},
973
983
  {
974
984
  /**
@@ -976,9 +986,9 @@ const _ = (t) => {
976
986
  * @param tagName - The HTML tag name.
977
987
  * @returns A renderable function that creates and appends the HTML element to the DOM.
978
988
  */
979
- get: (t, e) => (...r) => ue(e, r.flatMap(f))
989
+ get: (t, e) => (...r) => ae(e, r.flatMap(f))
980
990
  }
981
- ), Tt = new Proxy(
991
+ ), Ct = new Proxy(
982
992
  {},
983
993
  {
984
994
  /**
@@ -986,9 +996,9 @@ const _ = (t) => {
986
996
  * @param type - The input type name.
987
997
  * @returns A renderable function that creates and appends the HTMLInput element to the DOM.
988
998
  */
989
- get: (t, e) => (...r) => ue("input", P.type(e), ...r)
999
+ get: (t, e) => (...r) => ae("input", P.type(e), ...r)
990
1000
  }
991
- ), Xe = "http://www.w3.org/2000/svg", Ct = new Proxy(
1001
+ ), ze = "http://www.w3.org/2000/svg", Lt = new Proxy(
992
1002
  {},
993
1003
  {
994
1004
  /**
@@ -996,9 +1006,9 @@ const _ = (t) => {
996
1006
  * @param tagName - The SVG tag name.
997
1007
  * @returns A renderable function that creates and appends the SVG element to the DOM.
998
1008
  */
999
- get: (t, e) => (...r) => ae(e, Xe, r.flatMap(f))
1009
+ get: (t, e) => (...r) => ce(e, ze, r.flatMap(f))
1000
1010
  }
1001
- ), ze = "http://www.w3.org/1998/Math/MathML", Lt = new Proxy(
1011
+ ), Qe = "http://www.w3.org/1998/Math/MathML", Ot = new Proxy(
1002
1012
  {},
1003
1013
  {
1004
1014
  /**
@@ -1006,9 +1016,9 @@ const _ = (t) => {
1006
1016
  * @param tagName - The Math tag name.
1007
1017
  * @returns A renderable function that creates and appends the Math element to the DOM.
1008
1018
  */
1009
- get: (t, e) => (...r) => ae(e, ze, r.flatMap(f))
1019
+ get: (t, e) => (...r) => ce(e, Qe, r.flatMap(f))
1010
1020
  }
1011
- ), T = "data-tempo-attr", M = "data-tempo-class", ce = "data-tempo-node", $ = "data-tempo-text", Qe = (t, e) => {
1021
+ ), T = "data-tempo-attr", $ = "data-tempo-class", fe = "data-tempo-node", V = "data-tempo-text", Ye = (t, e) => {
1012
1022
  const r = t.getAttribute(e);
1013
1023
  if (r != null) {
1014
1024
  const s = t.getAttribute(T) ?? "{}", n = { ...JSON.parse(s), name: r };
@@ -1017,9 +1027,9 @@ const _ = (t) => {
1017
1027
  JSON.stringify(n).replace(/"/g, "&quot;")
1018
1028
  );
1019
1029
  }
1020
- }, fe = (t, e) => {
1021
- k() && t.isFirstLevel && Qe(t.element, e);
1022
- }, Ye = (t) => {
1030
+ }, he = (t, e) => {
1031
+ N() && t.isFirstLevel && Ye(t.element, e);
1032
+ }, Ze = (t) => {
1023
1033
  t.querySelectorAll(`[${T}]`).forEach((e) => {
1024
1034
  const r = JSON.parse(
1025
1035
  (e.getAttribute(T) ?? "{}").replace(/&quot;/g, '"')
@@ -1029,59 +1039,59 @@ const _ = (t) => {
1029
1039
  e.removeAttribute(T);
1030
1040
  });
1031
1041
  };
1032
- function Ze(t) {
1033
- t.setAttribute(M, t.className);
1042
+ function Ke(t) {
1043
+ t.setAttribute($, t.className);
1034
1044
  }
1035
- const he = (t) => {
1036
- k() && t.isFirstLevel && Ze(t.element);
1037
- }, Ke = (t) => {
1038
- t.querySelectorAll(`[${M}]`).forEach((e) => {
1039
- const r = e.getAttribute(M);
1040
- r !== null && (e.className = r, e.removeAttribute(M));
1041
- });
1042
- }, de = (t) => {
1043
- t.setAttribute(ce, "");
1045
+ const de = (t) => {
1046
+ N() && t.isFirstLevel && Ke(t.element);
1044
1047
  }, xe = (t) => {
1045
- t.querySelectorAll(`[${ce}]`).forEach((e) => {
1046
- _(e);
1048
+ t.querySelectorAll(`[${$}]`).forEach((e) => {
1049
+ const r = e.getAttribute($);
1050
+ r !== null && (e.className = r, e.removeAttribute($));
1047
1051
  });
1048
- }, et = (t) => {
1049
- t.setAttribute($, t.textContent ?? "");
1050
1052
  }, pe = (t) => {
1051
- k() && t.isFirstLevel && et(t.element);
1052
- }, tt = (t) => {
1053
- t.querySelectorAll(`[${$}]`).forEach((e) => {
1054
- e.textContent = e.getAttribute($), e.removeAttribute($);
1053
+ t.setAttribute(fe, "");
1054
+ }, et = (t) => {
1055
+ t.querySelectorAll(`[${fe}]`).forEach((e) => {
1056
+ _(e);
1055
1057
  });
1058
+ }, tt = (t) => {
1059
+ t.setAttribute(V, t.textContent ?? "");
1060
+ }, me = (t) => {
1061
+ N() && t.isFirstLevel && tt(t.element);
1056
1062
  }, rt = (t) => {
1057
- xe(t), Ke(t), Ye(t), tt(t);
1058
- }, me = () => {
1063
+ t.querySelectorAll(`[${V}]`).forEach((e) => {
1064
+ e.textContent = e.getAttribute(V), e.removeAttribute(V);
1065
+ });
1066
+ }, st = (t) => {
1067
+ et(t), xe(t), Ze(t), rt(t);
1068
+ }, ge = () => {
1059
1069
  const t = globalThis;
1060
1070
  return t.__tempoSSR__ == null && (t.__tempoSSR__ = {
1061
1071
  isSSR: !1,
1062
1072
  counter: 0
1063
1073
  }), t.__tempoSSR__;
1064
- }, J = (t, e) => {
1065
- const r = me();
1074
+ }, H = (t, e) => {
1075
+ const r = ge();
1066
1076
  r[t] = e;
1067
- }, ge = (t) => me()[t], B = (t) => {
1068
- J("isSSR", t);
1069
- }, W = () => ge("counter"), st = () => {
1070
- J("counter", (W() ?? 0) + 1);
1071
- }, nt = () => {
1072
- J("counter", (W() ?? 0) - 1);
1073
- }, Ot = (t = 30) => (B(!0), new Promise((e, r) => {
1077
+ }, _e = (t) => ge()[t], U = (t) => {
1078
+ H("isSSR", t);
1079
+ }, W = () => _e("counter"), nt = () => {
1080
+ H("counter", (W() ?? 0) + 1);
1081
+ }, ot = () => {
1082
+ H("counter", (W() ?? 0) - 1);
1083
+ }, kt = (t = 30) => (U(!0), new Promise((e, r) => {
1074
1084
  let s;
1075
1085
  const n = setInterval(() => {
1076
- W() <= 0 && (clearInterval(n), clearTimeout(s), B(!1), e());
1086
+ W() <= 0 && (clearInterval(n), clearTimeout(s), U(!1), e());
1077
1087
  }, 30);
1078
1088
  s = setTimeout(() => {
1079
- clearInterval(n), B(!1), r(new Error("SSR Timeout"));
1089
+ clearInterval(n), U(!1), r(new Error("SSR Timeout"));
1080
1090
  }, t * 1e3);
1081
- })), kt = (t) => (st(), f(t(nt))), k = () => ge("isSSR"), _e = (t, e) => {
1091
+ })), Nt = (t) => (nt(), f(t(ot))), N = () => _e("isSSR"), ve = (t, e) => {
1082
1092
  if (typeof e == "function")
1083
- return _e(t, { then: e });
1084
- const r = e.pending != null ? f(e.pending) : S, s = e.then, n = e.error != null ? (o) => f(e.error(o)) : () => S;
1093
+ return ve(t, { then: e });
1094
+ const r = e.pending != null ? f(e.pending) : w, s = e.then, n = e.error != null ? (o) => f(e.error(o)) : () => w;
1085
1095
  return (o) => {
1086
1096
  let i = !0;
1087
1097
  const l = t();
@@ -1098,16 +1108,16 @@ const he = (t) => {
1098
1108
  i = !1, a(c), c && o.reference && _(o.reference);
1099
1109
  };
1100
1110
  };
1101
- }, Nt = (t, e) => _e(() => t, e), ve = (t, e) => (r) => (r.element.addEventListener(t, e), (s) => {
1111
+ }, Rt = (t, e) => ve(() => t, e), ye = (t, e) => (r) => (r.element.addEventListener(t, e), (s) => {
1102
1112
  s && r.element.removeEventListener(t, e);
1103
- }), ot = (t) => ve("click", (e) => {
1113
+ }), it = (t) => ye("click", (e) => {
1104
1114
  e.preventDefault();
1105
1115
  const r = e.target;
1106
1116
  setTimeout(() => {
1107
1117
  const s = r.ownerDocument != null ? r == null ? void 0 : r.checked : void 0;
1108
1118
  s != null && t(!s);
1109
1119
  }, 0);
1110
- }), q = new Proxy(
1120
+ }), B = new Proxy(
1111
1121
  {},
1112
1122
  {
1113
1123
  /**
@@ -1115,15 +1125,15 @@ const he = (t) => {
1115
1125
  * @param fn - The function to call when the event is triggered.
1116
1126
  * @returns A `Renderable` function that adds the event listener to the element.
1117
1127
  */
1118
- get: (t, e) => (r) => ve(e, r)
1128
+ get: (t, e) => (r) => ye(e, r)
1119
1129
  }
1120
- ), it = (t) => (e) => {
1130
+ ), lt = (t) => (e) => {
1121
1131
  const r = e.target;
1122
1132
  t(r.value);
1123
- }, lt = (t) => (e) => {
1133
+ }, ut = (t) => (e) => {
1124
1134
  const r = e.target;
1125
1135
  t(r.valueAsNumber);
1126
- }, ut = (t) => (e) => {
1136
+ }, at = (t) => (e) => {
1127
1137
  const r = e.target;
1128
1138
  if (r.value === "")
1129
1139
  return;
@@ -1133,7 +1143,7 @@ const he = (t) => {
1133
1143
  Number(s[2].substring(0, 2))
1134
1144
  );
1135
1145
  t(n);
1136
- }, at = (t) => (e) => {
1146
+ }, ct = (t) => (e) => {
1137
1147
  const r = e.target;
1138
1148
  if (r.value === "")
1139
1149
  return;
@@ -1143,25 +1153,25 @@ const he = (t) => {
1143
1153
  Number(n[2])
1144
1154
  ), i = s[1].split(":");
1145
1155
  o.setHours(Number(i[0])), o.setMinutes(Number(i[1])), o.setSeconds(Number(i[2])), t(o);
1146
- }, Rt = (t) => (e) => {
1156
+ }, Mt = (t) => (e) => {
1147
1157
  const r = e.target;
1148
1158
  t(r.checked);
1149
- }, Mt = (t) => (e) => {
1150
- e.preventDefault(), t();
1151
1159
  }, $t = (t) => (e) => {
1160
+ e.preventDefault(), t();
1161
+ }, Vt = (t) => (e) => {
1152
1162
  e.stopPropagation(), t();
1153
1163
  }, Ft = (t) => (e) => {
1154
1164
  e.stopImmediatePropagation(), t();
1155
- }, Vt = (t, e = "input") => g(
1156
- P.valueAsDate(t),
1157
- q[e](ut(t.set))
1158
- ), qt = (t, e = "input") => g(
1165
+ }, qt = (t, e = "input") => g(
1159
1166
  P.valueAsDate(t),
1160
- q[e](at(t.set))
1167
+ B[e](at(t.set))
1161
1168
  ), It = (t, e = "input") => g(
1169
+ P.valueAsDate(t),
1170
+ B[e](ct(t.set))
1171
+ ), Bt = (t, e = "input") => g(
1162
1172
  P.valueAsNumber(t),
1163
- q[e](lt(t.set))
1164
- ), Bt = (t, e = "input") => g(P.value(t), q[e](it(t.set))), jt = (t) => g(P.checked(t), ot(t.set)), H = (t, e) => {
1173
+ B[e](ut(t.set))
1174
+ ), jt = (t, e = "input") => g(P.value(t), B[e](lt(t.set))), Ut = (t) => g(P.checked(t), it(t.set)), X = (t, e) => {
1165
1175
  if (h.is(t))
1166
1176
  return (s) => {
1167
1177
  s = s.makeRef();
@@ -1180,20 +1190,20 @@ const he = (t) => {
1180
1190
  };
1181
1191
  };
1182
1192
  const r = Object.keys(t)[0];
1183
- return f(e[r](G(t[r])));
1184
- }, ye = (t, e, r) => H(
1185
- h.map(t, (s) => ({ [s[e]]: s })),
1193
+ return f(e[r](I(t[r])));
1194
+ }, Se = (t, e, r) => X(
1195
+ m.map(t, (s) => ({ [s[e]]: s })),
1186
1196
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1187
1197
  r
1188
- ), Ut = (t, e) => ye(t, "kind", e), Gt = (t, e) => {
1189
- const r = h.map(t, ([s, n]) => ({ [s]: n }));
1190
- return H(r, e);
1191
- }, Jt = (t, e) => ye(t, "type", e), X = (t, e) => H(
1192
- h.map(t, (r) => ({ [r]: !0 })),
1198
+ ), Gt = (t, e) => Se(t, "kind", e), Jt = (t, e) => {
1199
+ const r = m.map(t, ([s, n]) => ({ [s]: n }));
1200
+ return X(r, e);
1201
+ }, Ht = (t, e) => Se(t, "type", e), z = (t, e) => X(
1202
+ m.map(t, (r) => ({ [r]: !0 })),
1193
1203
  e
1194
1204
  ), Wt = (t, e = {}) => (r) => {
1195
1205
  const s = (e == null ? void 0 : e.firstSeparator) ?? t, n = (e == null ? void 0 : e.lastSeparator) ?? t;
1196
- return X(
1206
+ return z(
1197
1207
  r.map((o) => o.isFirst ? "first" : o.isLast ? "last" : "other"),
1198
1208
  {
1199
1209
  first: () => s,
@@ -1209,7 +1219,7 @@ const he = (t) => {
1209
1219
  return n[o] = i, n;
1210
1220
  }, {});
1211
1221
  return f(e(s))(r);
1212
- }, Ht = (t, e) => (r) => {
1222
+ }, Xt = (t, e) => (r) => {
1213
1223
  const s = [], n = Object.entries(t).reduce(
1214
1224
  (o, [i, l]) => (s.push(
1215
1225
  l((a) => (Reflect.set(o, i, a), null))(r)
@@ -1219,16 +1229,16 @@ const he = (t) => {
1219
1229
  return s.push(e(n)(r)), (o) => {
1220
1230
  s.forEach((i) => i(o));
1221
1231
  };
1222
- }, Xt = (t, e) => we([t], (r) => f(e(r[t]))), zt = (t, e) => we(t, (r) => f(e(r))), Qt = (t) => (e) => t(e), Yt = (t) => (e) => (e.appendOrInsert(t), (r) => {
1232
+ }, zt = (t, e) => we([t], (r) => f(e(r[t]))), Qt = (t, e) => we(t, (r) => f(e(r))), Yt = (t) => (e) => t(e), Zt = (t) => (e) => (e.appendOrInsert(t), (r) => {
1223
1233
  r && _(t);
1224
- }), ct = (t, e, r) => {
1234
+ }), ft = (t, e, r) => {
1225
1235
  if (h.is(t)) {
1226
1236
  const s = t;
1227
1237
  return (n) => {
1228
1238
  n = n.makeRef();
1229
1239
  let o = null, i = !1;
1230
- const l = C(null), a = s.on((c) => {
1231
- c == null ? (o == null || o(!0), o = f((r == null ? void 0 : r()) ?? S)(n), i = !1) : (l.value = c, i || (o == null || o(!0), o = f(e(l))(n), i = !0));
1240
+ const l = L(null), a = s.on((c) => {
1241
+ c == null ? (o == null || o(!0), o = f((r == null ? void 0 : r()) ?? w)(n), i = !1) : (l.value = c, i || (o == null || o(!0), o = f(e(l))(n), i = !0));
1232
1242
  });
1233
1243
  return (c) => {
1234
1244
  a(), o == null || o(c), c && n.reference && _(n.reference);
@@ -1238,19 +1248,19 @@ const he = (t) => {
1238
1248
  const s = t;
1239
1249
  if (s == null) {
1240
1250
  const n = r == null ? void 0 : r();
1241
- return n != null ? f(n) : S;
1251
+ return n != null ? f(n) : w;
1242
1252
  }
1243
- return f(e(G(s)));
1253
+ return f(e(I(s)));
1244
1254
  }
1245
- }, j = (t) => (e) => (r) => t(r, e), Se = (t, e, r) => r != null ? Se(t, (s) => {
1246
- const n = s.map((i) => new R(i.index, i.total - 1)), o = s.map((i) => i.isLast ? "last" : "other");
1255
+ }, G = (t) => (e) => (r) => t(r, e), Ae = (t, e, r) => r != null ? Ae(t, (s) => {
1256
+ const n = s.map((i) => new M(i.index, i.total - 1)), o = s.map((i) => i.isLast ? "last" : "other");
1247
1257
  return g(
1248
- j(() => {
1258
+ G(() => {
1249
1259
  n.dispose(), o.dispose();
1250
1260
  }),
1251
1261
  f(e(s)),
1252
- X(o, {
1253
- last: () => S,
1262
+ z(o, {
1263
+ last: () => w,
1254
1264
  other: () => r(n)
1255
1265
  })
1256
1266
  );
@@ -1258,53 +1268,53 @@ const he = (t) => {
1258
1268
  s = s.makeRef();
1259
1269
  const n = t.map(
1260
1270
  (a) => Array.from({ length: a }, (c, d) => d).map(
1261
- (c) => new R(c, a)
1271
+ (c) => new M(c, a)
1262
1272
  )
1263
1273
  ), o = [], i = [], l = n.on((a) => {
1264
1274
  var d, v;
1265
1275
  const c = a.length;
1266
1276
  for (; c < o.length; )
1267
1277
  (d = o.pop()) == null || d(!0), (v = i.pop()) == null || v.dispose();
1268
- for (let m = 0; m < c; m++)
1269
- if (i[m] == null) {
1270
- i[m] = C(a[m]);
1271
- const D = f(e(i[m]));
1272
- o[m] = D(s);
1278
+ for (let p = 0; p < c; p++)
1279
+ if (i[p] == null) {
1280
+ i[p] = L(a[p]);
1281
+ const D = f(e(i[p]));
1282
+ o[p] = D(s);
1273
1283
  } else
1274
- i[m].value = a[m];
1284
+ i[p].value = a[p];
1275
1285
  });
1276
1286
  return (a) => {
1277
1287
  l(), a && s.reference && _(s.reference);
1278
1288
  };
1279
1289
  } : g(
1280
1290
  ...Array.from({ length: t }, (s, n) => n).map(
1281
- (s) => f(e(G(new R(s, t))))
1291
+ (s) => f(e(I(new M(s, t))))
1282
1292
  )
1283
- ), ft = (t, e, r) => r != null ? ft(t, (s, n) => {
1284
- const o = n.map((l) => new R(l.index, l.total - 1)), i = n.map((l) => l.isLast ? "last" : "other");
1293
+ ), ht = (t, e, r) => r != null ? ht(t, (s, n) => {
1294
+ const o = n.map((l) => new M(l.index, l.total - 1)), i = n.map((l) => l.isLast ? "last" : "other");
1285
1295
  return g([
1286
- j(() => {
1296
+ G(() => {
1287
1297
  i.dispose(), o.dispose();
1288
1298
  }),
1289
1299
  f(e(s, n)),
1290
- X(i, {
1291
- last: () => S,
1300
+ z(i, {
1301
+ last: () => w,
1292
1302
  other: () => r(o)
1293
1303
  })
1294
1304
  ]);
1295
1305
  }) : (s) => {
1296
- const n = h.map(t, (o) => o.length);
1297
- return Se(n, (o) => {
1298
- const i = $e(
1306
+ const n = m.map(t, (o) => o.length);
1307
+ return Ae(n, (o) => {
1308
+ const i = Fe(
1299
1309
  o,
1300
1310
  t
1301
1311
  )((l, a) => a[l.index]);
1302
1312
  return g(
1303
- j(() => i.dispose()),
1313
+ G(() => i.dispose()),
1304
1314
  f(e(i, o))
1305
1315
  );
1306
1316
  })(s);
1307
- }, Zt = (t, e) => {
1317
+ }, Kt = (t, e) => {
1308
1318
  if (h.is(t)) {
1309
1319
  const r = t;
1310
1320
  return (s) => {
@@ -1321,56 +1331,56 @@ const he = (t) => {
1321
1331
  };
1322
1332
  }
1323
1333
  return f(e(t));
1324
- }, Ae = (t, e, r) => ct(
1325
- h.map(t, (s) => s ? !0 : null),
1334
+ }, Ee = (t, e, r) => ft(
1335
+ m.map(t, (s) => s ? !0 : null),
1326
1336
  () => e,
1327
1337
  r != null ? () => r : void 0
1328
- ), Kt = (t, e, r) => Ae(
1329
- h.map(t, (s) => !s),
1338
+ ), xt = (t, e, r) => Ee(
1339
+ m.map(t, (s) => !s),
1330
1340
  e,
1331
1341
  r
1332
- ), xt = (t, e, r = S) => Ae(
1333
- h.map(t, (s) => s.length > 0),
1342
+ ), er = (t, e, r = w) => Ee(
1343
+ m.map(t, (s) => s.length > 0),
1334
1344
  e,
1335
1345
  r
1336
- ), er = (t) => (e) => t(e.element) ?? (() => {
1337
- }), Ee = (t, e) => {
1346
+ ), tr = (t) => (e) => t(e.element) ?? (() => {
1347
+ }), Pe = (t, e) => {
1338
1348
  const r = t(e);
1339
1349
  return () => r(!0);
1340
- }, tr = (t, e, { doc: r, clear: s } = {}) => {
1350
+ }, rr = (t, e, { doc: r, clear: s } = {}) => {
1341
1351
  const n = typeof e == "string" ? (r ?? document).querySelector(e) : e;
1342
1352
  if (n === null)
1343
- throw new ht(
1353
+ throw new dt(
1344
1354
  `Cannot find element by selector for render: ${e}`
1345
1355
  );
1346
- s !== !1 && (r ?? n.ownerDocument) != null && rt(r ?? n.ownerDocument);
1347
- const o = Je(n), i = oe(n) ? void 0 : n, l = w.of(o, i);
1348
- return Ee(t, l);
1356
+ s !== !1 && (r ?? n.ownerDocument) != null && st(r ?? n.ownerDocument);
1357
+ const o = He(n), i = ie(n) ? void 0 : n, l = S.of(o, i);
1358
+ return Pe(t, l);
1349
1359
  };
1350
- class ht extends Error {
1360
+ class dt extends Error {
1351
1361
  constructor(e) {
1352
1362
  super(e);
1353
1363
  }
1354
1364
  }
1355
- const rr = (t, e) => (r) => {
1365
+ const sr = (t, e) => (r) => {
1356
1366
  const s = r.document.querySelector(t);
1357
1367
  if (s === null)
1358
1368
  throw new Error(`Cannot find element by selector for portal: ${t}`);
1359
- return Ee(
1369
+ return Pe(
1360
1370
  f(e),
1361
1371
  r.withElement(s).withFirstLevel()
1362
1372
  );
1363
- }, sr = (t) => Symbol(t), Pe = (t, e) => (r) => f(e)(r.withProviders(t)), nr = (...t) => t.length > 0 ? t.reduceRight((e, r) => (s) => e(r(s))) : f, or = (t, e, r) => Pe({ [t]: e }, f(r)), ir = (t, e) => Pe(t, f(e)), dt = (t, e) => (r) => {
1373
+ }, nr = (t) => Symbol(t), De = (t, e) => (r) => f(e)(r.withProviders(t)), or = (...t) => t.length > 0 ? t.reduceRight((e, r) => (s) => e(r(s))) : f, ir = (t, e, r) => De({ [t]: e }, f(r)), lr = (t, e) => De(t, f(e)), pt = (t, e) => (r) => {
1364
1374
  const s = r.element, n = s.style.getPropertyValue(t);
1365
1375
  return s.style.setProperty(t, e), (o) => {
1366
1376
  o && s.style.setProperty(t, n);
1367
1377
  };
1368
- }, pt = (t, e) => (r) => {
1378
+ }, mt = (t, e) => (r) => {
1369
1379
  const s = r.element, n = s.style.getPropertyValue(t);
1370
1380
  return e.on((o) => s.style.setProperty(t, o)), (o) => {
1371
1381
  o && s.style.setProperty(t, n);
1372
1382
  };
1373
- }, lr = new Proxy(
1383
+ }, ur = new Proxy(
1374
1384
  {},
1375
1385
  {
1376
1386
  /**
@@ -1381,115 +1391,116 @@ const rr = (t, e) => (r) => {
1381
1391
  * @returns The renderable component for the specified attribute.
1382
1392
  *
1383
1393
  */
1384
- get: (t, e) => (r) => h.is(r) ? pt(e, r) : dt(e, r)
1394
+ get: (t, e) => (r) => h.is(r) ? mt(e, r) : pt(e, r)
1385
1395
  }
1386
1396
  );
1387
1397
  export {
1388
- Nt as Async,
1389
- jt as BindChecked,
1390
- Vt as BindDate,
1391
- qt as BindDateTime,
1392
- It as BindNumber,
1393
- Bt as BindText,
1398
+ Rt as Async,
1399
+ Ut as BindChecked,
1400
+ qt as BindDate,
1401
+ It as BindDateTime,
1402
+ Bt as BindNumber,
1403
+ jt as BindText,
1394
1404
  E as Computed,
1395
1405
  Wt as Conjunction,
1396
- w as DOMContext,
1397
- Yt as DOMNode,
1398
- ue as El,
1399
- ae as ElNS,
1400
- R as ElementPosition,
1401
- S as Empty,
1402
- ct as Ensure,
1403
- ft as ForEach,
1406
+ S as DOMContext,
1407
+ Zt as DOMNode,
1408
+ ae as El,
1409
+ ce as ElNS,
1410
+ M as ElementPosition,
1411
+ w as Empty,
1412
+ ft as Ensure,
1413
+ ht as ForEach,
1404
1414
  g as Fragment,
1405
- Zt as MapSignal,
1406
- Z as MemoryStore,
1407
- xt as NotEmpty,
1408
- ot as OnChecked,
1409
- Qt as OnCtx,
1410
- er as OnMount,
1411
- j as OnUnmount,
1412
- H as OneOf,
1413
- ye as OneOfField,
1414
- Ut as OneOfKind,
1415
- Gt as OneOfTuple,
1416
- Jt as OneOfType,
1417
- X as OneOfValue,
1418
- rr as Portal,
1415
+ Kt as MapSignal,
1416
+ K as MemoryStore,
1417
+ er as NotEmpty,
1418
+ it as OnChecked,
1419
+ Yt as OnCtx,
1420
+ tr as OnMount,
1421
+ G as OnUnmount,
1422
+ X as OneOf,
1423
+ Se as OneOfField,
1424
+ Gt as OneOfKind,
1425
+ Jt as OneOfTuple,
1426
+ Ht as OneOfType,
1427
+ z as OneOfValue,
1428
+ sr as Portal,
1419
1429
  F as Prop,
1420
- nr as Provide,
1421
- Ge as ProviderNotFoundError,
1422
- ht as RenderingError,
1423
- Se as Repeat,
1430
+ or as Provide,
1431
+ Je as ProviderNotFoundError,
1432
+ dt as RenderingError,
1433
+ Ae as Repeat,
1424
1434
  h as Signal,
1425
- _e as Task,
1426
- St as TextNode,
1427
- Kt as Unless,
1428
- Ht as Use,
1429
- Xt as UseProvider,
1430
- zt as UseProviders,
1431
- kt as UseSSRDone,
1432
- Ae as When,
1433
- or as WithProvider,
1434
- ir as WithProviders,
1435
- de as _addNodeTracker,
1436
- rt as _clearSSR,
1437
- Je as _getSelfOrParentElement,
1438
- oe as _isElement,
1439
- ne as _makeGetter,
1440
- se as _makeSetter,
1441
- fe as _maybeAddAttributeTracker,
1442
- he as _maybeAddClassTracker,
1443
- pe as _maybeAddTextTracker,
1435
+ ve as Task,
1436
+ At as TextNode,
1437
+ xt as Unless,
1438
+ Xt as Use,
1439
+ zt as UseProvider,
1440
+ Qt as UseProviders,
1441
+ Nt as UseSSRDone,
1442
+ m as Value,
1443
+ Ee as When,
1444
+ ir as WithProvider,
1445
+ lr as WithProviders,
1446
+ pe as _addNodeTracker,
1447
+ st as _clearSSR,
1448
+ He as _getSelfOrParentElement,
1449
+ ie as _isElement,
1450
+ oe as _makeGetter,
1451
+ ne as _makeSetter,
1452
+ he as _maybeAddAttributeTracker,
1453
+ de as _maybeAddClassTracker,
1454
+ me as _maybeAddTextTracker,
1444
1455
  _ as _removeDOMNode,
1445
- Ue as _setAttribute,
1446
- qe as _setBooleanProperty,
1447
- Be as _setDateProperty,
1448
- Ie as _setNumberProperty,
1449
- je as _setStringProperty,
1450
- le as _signalText,
1451
- ie as _staticText,
1452
- yt as animateSignal,
1453
- Ve as animateSignals,
1454
- Et as aria,
1456
+ Ge as _setAttribute,
1457
+ Ie as _setBooleanProperty,
1458
+ je as _setDateProperty,
1459
+ Be as _setNumberProperty,
1460
+ Ue as _setStringProperty,
1461
+ ue as _signalText,
1462
+ le as _staticText,
1463
+ St as animateSignal,
1464
+ qe as animateSignals,
1465
+ Pt as aria,
1455
1466
  P as attr,
1456
- At as dataAttr,
1457
- Rt as emitChecked,
1458
- Mt as emitPreventDefault,
1467
+ Et as dataAttr,
1468
+ Mt as emitChecked,
1469
+ $t as emitPreventDefault,
1459
1470
  Ft as emitStopImmediatePropagation,
1460
- $t as emitStopPropagation,
1461
- it as emitValue,
1462
- ut as emitValueAsDate,
1463
- at as emitValueAsDateTime,
1464
- lt as emitValueAsNumber,
1465
- Ne as endInterpolate,
1466
- Re as guessInterpolate,
1467
- bt as html,
1468
- Tt as input,
1469
- ke as interpolateDate,
1470
- Le as interpolateNumber,
1471
- Oe as interpolateString,
1472
- k as isSSR,
1473
- _t as localStorageProp,
1474
- U as makeComputed,
1475
- $e as makeComputedOf,
1471
+ Vt as emitStopPropagation,
1472
+ lt as emitValue,
1473
+ at as emitValueAsDate,
1474
+ ct as emitValueAsDateTime,
1475
+ ut as emitValueAsNumber,
1476
+ Re as endInterpolate,
1477
+ Me as guessInterpolate,
1478
+ Tt as html,
1479
+ Ct as input,
1480
+ Ne as interpolateDate,
1481
+ Oe as interpolateNumber,
1482
+ ke as interpolateString,
1483
+ N as isSSR,
1484
+ vt as localStorageProp,
1485
+ J as makeComputed,
1486
+ Fe as makeComputedOf,
1476
1487
  wt as makeComputedRecord,
1477
- Fe as makeEffect,
1478
- gt as makeEffectOf,
1479
- C as makeProp,
1480
- sr as makeProviderMark,
1481
- G as makeSignal,
1482
- Lt as math,
1483
- Dt as mathAttr,
1484
- q as on,
1485
- Ot as prepareSSR,
1486
- tt as removeTextTrackers,
1487
- tr as render,
1488
- Ee as renderWithContext,
1488
+ Ve as makeEffect,
1489
+ _t as makeEffectOf,
1490
+ L as makeProp,
1491
+ nr as makeProviderMark,
1492
+ I as makeSignal,
1493
+ Ot as math,
1494
+ bt as mathAttr,
1495
+ B as on,
1496
+ kt as prepareSSR,
1497
+ rt as removeTextTrackers,
1498
+ rr as render,
1499
+ Pe as renderWithContext,
1489
1500
  f as renderableOfTNode,
1490
- vt as sessionStorageProp,
1491
- K as storedProp,
1492
- lr as style,
1493
- Ct as svg,
1494
- Pt as svgAttr
1501
+ yt as sessionStorageProp,
1502
+ x as storedProp,
1503
+ ur as style,
1504
+ Lt as svg,
1505
+ Dt as svgAttr
1495
1506
  };