@tempots/dom 28.6.3 → 29.0.1
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.cjs +1 -1
- package/index.js +414 -421
- package/package.json +1 -1
- package/renderable/attribute.d.ts +582 -583
- package/renderable/on.d.ts +41 -28
- package/types/domain.d.ts +4 -3
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var ke = Object.defineProperty;
|
|
2
|
+
var ie = (s) => {
|
|
3
3
|
throw TypeError(s);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var o = (s, e, t) =>
|
|
7
|
-
var
|
|
8
|
-
const
|
|
9
|
-
const
|
|
5
|
+
var Ne = (s, e, t) => e in s ? ke(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
6
|
+
var o = (s, e, t) => Ne(s, typeof e != "symbol" ? e + "" : e, t), oe = (s, e, t) => e.has(s) || ie("Cannot " + t);
|
|
7
|
+
var R = (s, e, t) => (oe(s, e, "read from private field"), t ? t.call(s) : e.get(s)), le = (s, e, t) => e.has(s) ? ie("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), Q = (s, e, t, r) => (oe(s, e, "write to private field"), r ? r.call(s, t) : e.set(s, t), t);
|
|
8
|
+
const $e = (s, e, t) => s + (e - s) * t;
|
|
9
|
+
const Ie = (s, e, t) => {
|
|
10
10
|
const r = Math.max(s.length, e.length);
|
|
11
11
|
let n = "";
|
|
12
12
|
for (let i = 0; i < r; i++) {
|
|
@@ -16,9 +16,9 @@ const $e = (s, e, t) => {
|
|
|
16
16
|
isNaN(c) && (c = 97), n += String.fromCharCode(l + (c - l) * t);
|
|
17
17
|
}
|
|
18
18
|
return n;
|
|
19
|
-
},
|
|
19
|
+
}, Re = (s, e, t) => new Date(s.getTime() + (e.getTime() - s.getTime()) * t), je = (s, e) => e, Ve = (s) => typeof s == "number" ? $e : typeof s == "string" ? Ie : s instanceof Date ? Re : je;
|
|
20
20
|
var w;
|
|
21
|
-
class
|
|
21
|
+
class Z {
|
|
22
22
|
/**
|
|
23
23
|
* Creates a new instance of `ElementPosition`.
|
|
24
24
|
* @param index - The index of the element.
|
|
@@ -44,10 +44,10 @@ class Q {
|
|
|
44
44
|
* @returns `true` if the counter is odd, `false` otherwise.
|
|
45
45
|
*/
|
|
46
46
|
o(this, "isOdd");
|
|
47
|
-
|
|
47
|
+
le(this, w);
|
|
48
48
|
o(this, "dispose", () => {
|
|
49
49
|
var e;
|
|
50
|
-
(e =
|
|
50
|
+
(e = R(this, w)) == null || e.dispose(), Q(this, w, void 0);
|
|
51
51
|
});
|
|
52
52
|
this.index = e, this.total = t, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
|
|
53
53
|
}
|
|
@@ -56,11 +56,11 @@ class Q {
|
|
|
56
56
|
* @returns `true` if the element is the last element, `false` otherwise.
|
|
57
57
|
*/
|
|
58
58
|
get isLast() {
|
|
59
|
-
return
|
|
59
|
+
return R(this, w) == null && Q(this, w, this.total.map((e) => this.counter === e)), R(this, w);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
w = new WeakMap();
|
|
63
|
-
const
|
|
63
|
+
const k = class k {
|
|
64
64
|
/**
|
|
65
65
|
* Represents a signal with a value of type T.
|
|
66
66
|
*
|
|
@@ -203,7 +203,7 @@ const H = class H {
|
|
|
203
203
|
* @returns A new computed signal with the transformed value
|
|
204
204
|
*/
|
|
205
205
|
o(this, "map", (e, t = (r, n) => r === n) => {
|
|
206
|
-
const r = new
|
|
206
|
+
const r = new L(() => {
|
|
207
207
|
try {
|
|
208
208
|
return e(this.get());
|
|
209
209
|
} catch (n) {
|
|
@@ -223,7 +223,7 @@ const H = class H {
|
|
|
223
223
|
* @returns A new Signal that emits the values of the resulting Signal.
|
|
224
224
|
*/
|
|
225
225
|
o(this, "flatMap", (e, t = (r, n) => r === n) => {
|
|
226
|
-
const r = new
|
|
226
|
+
const r = new L(() => {
|
|
227
227
|
try {
|
|
228
228
|
return e(this.get()).get();
|
|
229
229
|
} catch (n) {
|
|
@@ -252,7 +252,7 @@ const H = class H {
|
|
|
252
252
|
o(this, "_$");
|
|
253
253
|
o(this, "filter", (e, t) => {
|
|
254
254
|
let r = t ?? this.get();
|
|
255
|
-
const n = new
|
|
255
|
+
const n = new L(() => {
|
|
256
256
|
try {
|
|
257
257
|
const i = this.get();
|
|
258
258
|
return r = e(i) ? i : r;
|
|
@@ -274,7 +274,7 @@ const H = class H {
|
|
|
274
274
|
*/
|
|
275
275
|
o(this, "filterMap", (e, t, r = (n, i) => n === i) => {
|
|
276
276
|
let n = t;
|
|
277
|
-
const i = new
|
|
277
|
+
const i = new L(() => {
|
|
278
278
|
try {
|
|
279
279
|
const l = this.get(), c = e(l);
|
|
280
280
|
return n = c ?? n;
|
|
@@ -298,7 +298,7 @@ const H = class H {
|
|
|
298
298
|
* @returns A property that holds the mapped value and can be observed for changes.
|
|
299
299
|
*/
|
|
300
300
|
o(this, "mapAsync", (e, t, r, n = (i, l) => i === l) => {
|
|
301
|
-
const i =
|
|
301
|
+
const i = _(t, n);
|
|
302
302
|
let l = 0, c = new AbortController();
|
|
303
303
|
return i.onDispose(
|
|
304
304
|
this.on(async (u) => {
|
|
@@ -348,7 +348,7 @@ const H = class H {
|
|
|
348
348
|
o(this, "deriveProp", ({
|
|
349
349
|
autoDisposeProp: e = !0,
|
|
350
350
|
equals: t
|
|
351
|
-
} = {}) => this.feedProp(
|
|
351
|
+
} = {}) => this.feedProp(_(this.get(), t), e));
|
|
352
352
|
/**
|
|
353
353
|
* Derives a new signal from the current signal. Useful to create a new signal that emits the same values as the current signal but can be disposed independently.
|
|
354
354
|
* @returns A new signal that emits the same values as the current signal.
|
|
@@ -436,8 +436,8 @@ const H = class H {
|
|
|
436
436
|
* @param equals - Function to compare two values for equality (defaults to strict equality)
|
|
437
437
|
* @returns A Signal that represents the result of the Promise
|
|
438
438
|
*/
|
|
439
|
-
o(
|
|
440
|
-
const i = new
|
|
439
|
+
o(k, "ofPromise", (e, t, r, n = (i, l) => i === l) => {
|
|
440
|
+
const i = new k(t, n);
|
|
441
441
|
return e.then((l) => i._setAndNotify(l)).catch((l) => {
|
|
442
442
|
r != null ? i._setAndNotify(r(l)) : console.error(
|
|
443
443
|
"Unhandled promise rejection in Signal.ofPromise:",
|
|
@@ -450,13 +450,13 @@ o(H, "ofPromise", (e, t, r, n = (i, l) => i === l) => {
|
|
|
450
450
|
* @param value - The value to check.
|
|
451
451
|
* @returns `true` if the value is a Signal, `false` otherwise.
|
|
452
452
|
*/
|
|
453
|
-
o(
|
|
453
|
+
o(k, "is", (e) => (
|
|
454
454
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
455
455
|
e != null && e.$__signal__ === !0
|
|
456
456
|
));
|
|
457
|
-
let d =
|
|
458
|
-
const
|
|
459
|
-
class
|
|
457
|
+
let d = k;
|
|
458
|
+
const qe = typeof queueMicrotask == "function" ? queueMicrotask : (s) => Promise.resolve().then(s);
|
|
459
|
+
class L extends d {
|
|
460
460
|
/**
|
|
461
461
|
* Represents a Signal object.
|
|
462
462
|
* @param _fn - The function that returns the value of the signal.
|
|
@@ -491,7 +491,7 @@ class P extends d {
|
|
|
491
491
|
*/
|
|
492
492
|
o(this, "_scheduleNotify", () => {
|
|
493
493
|
const t = ++this._scheduleCount;
|
|
494
|
-
|
|
494
|
+
qe(() => {
|
|
495
495
|
this._scheduleCount !== t || this._disposed || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn()));
|
|
496
496
|
});
|
|
497
497
|
});
|
|
@@ -513,7 +513,7 @@ class P extends d {
|
|
|
513
513
|
return this.get();
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
const
|
|
516
|
+
const G = class G extends d {
|
|
517
517
|
constructor() {
|
|
518
518
|
super(...arguments);
|
|
519
519
|
/**
|
|
@@ -567,7 +567,7 @@ const J = class J extends d {
|
|
|
567
567
|
* @returns A Prop object representing the isomorphism.
|
|
568
568
|
*/
|
|
569
569
|
o(this, "iso", (t, r, n = (i, l) => i === l) => {
|
|
570
|
-
const i = new
|
|
570
|
+
const i = new G(t(this.get()), n);
|
|
571
571
|
return i.onDispose(this.on((l) => i.set(t(l)))), i.on((l) => this._setAndNotify(r(l))), i;
|
|
572
572
|
});
|
|
573
573
|
/**
|
|
@@ -596,15 +596,15 @@ const J = class J extends d {
|
|
|
596
596
|
* @param value - The value to check.
|
|
597
597
|
* @returns `true` if the value is a Prop, `false` otherwise.
|
|
598
598
|
*/
|
|
599
|
-
o(
|
|
599
|
+
o(G, "is", (t) => (
|
|
600
600
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
601
601
|
t != null && t.$__prop__ === !0
|
|
602
602
|
));
|
|
603
|
-
let
|
|
604
|
-
const
|
|
605
|
-
const r = new
|
|
603
|
+
let V = G;
|
|
604
|
+
const K = (s, e, t = (r, n) => r === n) => {
|
|
605
|
+
const r = new L(s, t);
|
|
606
606
|
return e.forEach((n) => n.setDerivative(r)), r;
|
|
607
|
-
},
|
|
607
|
+
}, Fe = (s, e, t = {}) => {
|
|
608
608
|
let r = t.once ? () => {
|
|
609
609
|
i(), s();
|
|
610
610
|
} : s;
|
|
@@ -615,11 +615,11 @@ const Z = (s, e, t = (r, n) => r === n) => {
|
|
|
615
615
|
l ? c() : l = !0;
|
|
616
616
|
};
|
|
617
617
|
}
|
|
618
|
-
const n =
|
|
618
|
+
const n = K(r, e), i = () => {
|
|
619
619
|
n.dispose(), t.abortSignal != null && t.abortSignal.removeEventListener("abort", i);
|
|
620
620
|
};
|
|
621
621
|
return t.abortSignal != null && t.abortSignal.addEventListener("abort", i), i;
|
|
622
|
-
},
|
|
622
|
+
}, _ = (s, e = (t, r) => t === r) => new V(s, e), X = (s, e = (t, r) => t === r) => new d(s, e), ue = () => (
|
|
623
623
|
/* c8 ignore next */
|
|
624
624
|
typeof window < "u" ? window : void 0
|
|
625
625
|
), y = {
|
|
@@ -645,7 +645,7 @@ const Z = (s, e, t = (r, n) => r === n) => {
|
|
|
645
645
|
* @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
|
|
646
646
|
* @returns A Signal instance.
|
|
647
647
|
*/
|
|
648
|
-
toSignal: (s, e) => d.is(s) ? s :
|
|
648
|
+
toSignal: (s, e) => d.is(s) ? s : X(s, e),
|
|
649
649
|
/**
|
|
650
650
|
* Wraps a value in a `Signal` if it is not already a `Signal`.
|
|
651
651
|
* If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
|
|
@@ -692,30 +692,30 @@ const Z = (s, e, t = (r, n) => r === n) => {
|
|
|
692
692
|
deriveProp: (s, {
|
|
693
693
|
autoDisposeProp: e = !0,
|
|
694
694
|
equals: t
|
|
695
|
-
} = {}) => d.is(s) ? s.deriveProp({ autoDisposeProp: e, equals: t }) :
|
|
696
|
-
},
|
|
695
|
+
} = {}) => d.is(s) ? s.deriveProp({ autoDisposeProp: e, equals: t }) : _(s, t)
|
|
696
|
+
}, ee = (...s) => (e, t) => {
|
|
697
697
|
if (s.length === 1)
|
|
698
698
|
return y.toSignal(s[0]).map(e);
|
|
699
699
|
const r = s.filter((n) => d.is(n));
|
|
700
|
-
return
|
|
700
|
+
return K(
|
|
701
701
|
() => e(...s.map((n) => y.get(n))),
|
|
702
702
|
r,
|
|
703
703
|
t
|
|
704
704
|
);
|
|
705
|
-
},
|
|
705
|
+
}, Dt = (s) => {
|
|
706
706
|
const e = Object.keys(s);
|
|
707
|
-
return
|
|
707
|
+
return ee(...Object.values(s))(
|
|
708
708
|
(...t) => Object.fromEntries(e.map((r, n) => [r, t[n]]))
|
|
709
709
|
);
|
|
710
|
-
},
|
|
710
|
+
}, Ot = (...s) => (e, t = {}) => {
|
|
711
711
|
const r = s.filter((n) => d.is(n));
|
|
712
|
-
return
|
|
712
|
+
return Fe(
|
|
713
713
|
() => e(...s.map(y.get)),
|
|
714
714
|
r,
|
|
715
715
|
t
|
|
716
716
|
);
|
|
717
717
|
};
|
|
718
|
-
class
|
|
718
|
+
class ae {
|
|
719
719
|
constructor() {
|
|
720
720
|
o(this, "_store", /* @__PURE__ */ new Map());
|
|
721
721
|
/**
|
|
@@ -734,7 +734,7 @@ class ue {
|
|
|
734
734
|
});
|
|
735
735
|
}
|
|
736
736
|
}
|
|
737
|
-
const
|
|
737
|
+
const he = ({
|
|
738
738
|
key: s,
|
|
739
739
|
defaultValue: e,
|
|
740
740
|
store: t,
|
|
@@ -743,66 +743,66 @@ const ae = ({
|
|
|
743
743
|
equals: i = (c, u) => c === u,
|
|
744
744
|
onLoad: l = (c) => c
|
|
745
745
|
}) => {
|
|
746
|
-
const c = t.getItem(s), u = new
|
|
746
|
+
const c = t.getItem(s), u = new V(
|
|
747
747
|
c != null ? l(n(c)) : typeof e == "function" ? e() : e,
|
|
748
748
|
i
|
|
749
749
|
);
|
|
750
750
|
return u.on((a) => t.setItem(s, r(a))), u;
|
|
751
|
-
},
|
|
751
|
+
}, Mt = (s) => {
|
|
752
752
|
var e;
|
|
753
|
-
return
|
|
753
|
+
return he({
|
|
754
754
|
...s,
|
|
755
755
|
/* c8 ignore next 3 */
|
|
756
|
-
store: ((e =
|
|
756
|
+
store: ((e = ue()) == null ? void 0 : e.localStorage) ?? new ae()
|
|
757
757
|
});
|
|
758
|
-
},
|
|
758
|
+
}, Ht = (s) => {
|
|
759
759
|
var e;
|
|
760
|
-
return
|
|
760
|
+
return he({
|
|
761
761
|
...s,
|
|
762
762
|
/* c8 ignore next 3 */
|
|
763
|
-
store: ((e =
|
|
763
|
+
store: ((e = ue()) == null ? void 0 : e.sessionStorage) ?? new ae()
|
|
764
764
|
});
|
|
765
765
|
};
|
|
766
|
-
function
|
|
766
|
+
function ce(s) {
|
|
767
767
|
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(s) : setTimeout(s, 0);
|
|
768
768
|
}
|
|
769
|
-
const
|
|
770
|
-
const n = (r == null ? void 0 : r.duration) ?? 300, i = (r == null ? void 0 : r.easing) ?? ((A) => A), l = (r == null ? void 0 : r.equals) ?? ((A,
|
|
769
|
+
const Be = (s, e, t, r) => {
|
|
770
|
+
const n = (r == null ? void 0 : r.duration) ?? 300, i = (r == null ? void 0 : r.easing) ?? ((A) => A), l = (r == null ? void 0 : r.equals) ?? ((A, I) => A === I);
|
|
771
771
|
let c = r == null ? void 0 : r.interpolate, u = s, a = e(), h = performance.now(), g = null, T = !0;
|
|
772
|
-
const p = new
|
|
772
|
+
const p = new L(e, l), m = _(s, l);
|
|
773
773
|
m.onDispose(() => {
|
|
774
774
|
g !== null && cancelAnimationFrame(g);
|
|
775
775
|
}), m.onDispose(p.dispose), t.forEach((A) => {
|
|
776
776
|
A.setDerivative(p), A.onDispose(m.dispose);
|
|
777
777
|
});
|
|
778
778
|
const C = (A) => {
|
|
779
|
-
a = A, h = performance.now(), u = m.value, T && (T = !1, g =
|
|
780
|
-
},
|
|
781
|
-
const
|
|
782
|
-
c == null && (c =
|
|
783
|
-
let
|
|
784
|
-
|
|
779
|
+
a = A, h = performance.now(), u = m.value, T && (T = !1, g = ce(re));
|
|
780
|
+
}, re = () => {
|
|
781
|
+
const I = (performance.now() - h) / y.get(n), He = i(I);
|
|
782
|
+
c == null && (c = Ve(u));
|
|
783
|
+
let ne = c(u, a, He);
|
|
784
|
+
I >= 1 ? (T = !0, ne = a) : g = ce(re), m.set(ne);
|
|
785
785
|
};
|
|
786
786
|
return p.on(C), m;
|
|
787
|
-
},
|
|
787
|
+
}, kt = (s, e) => {
|
|
788
788
|
const { initialValue: t, ...r } = e ?? {};
|
|
789
|
-
return
|
|
789
|
+
return Be(
|
|
790
790
|
/* c8 ignore next 2 */
|
|
791
791
|
t ?? s.get(),
|
|
792
792
|
s.get,
|
|
793
793
|
[s],
|
|
794
794
|
r
|
|
795
795
|
);
|
|
796
|
-
},
|
|
796
|
+
}, We = (s, e) => {
|
|
797
797
|
const t = Object.values(s).filter(d.is), r = Object.keys(s);
|
|
798
|
-
return
|
|
798
|
+
return K(() => {
|
|
799
799
|
const n = {};
|
|
800
800
|
for (const i of r)
|
|
801
801
|
n[i] = y.get(s[i]);
|
|
802
802
|
return e(n);
|
|
803
803
|
}, t);
|
|
804
|
-
},
|
|
805
|
-
const t =
|
|
804
|
+
}, Nt = (s) => We(s, (e) => e), $t = (s, e) => {
|
|
805
|
+
const t = _(s.get());
|
|
806
806
|
let r = null;
|
|
807
807
|
const n = s.on((i) => {
|
|
808
808
|
r != null && clearTimeout(r), r = setTimeout(
|
|
@@ -815,21 +815,21 @@ const Fe = (s, e, t, r) => {
|
|
|
815
815
|
return t.onDispose(() => {
|
|
816
816
|
n(), r != null && clearTimeout(r);
|
|
817
817
|
}), t;
|
|
818
|
-
},
|
|
818
|
+
}, It = (s) => (...e) => ee(
|
|
819
819
|
s,
|
|
820
820
|
...e
|
|
821
821
|
)((t, ...r) => t(...r));
|
|
822
|
-
function
|
|
823
|
-
return
|
|
822
|
+
function Rt(...s) {
|
|
823
|
+
return ee(...s)((...e) => {
|
|
824
824
|
for (const t of e) if (t != null) return t;
|
|
825
825
|
});
|
|
826
826
|
}
|
|
827
|
-
const
|
|
827
|
+
const fe = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), de = /* @__PURE__ */ new Set(["selected"]), pe = /* @__PURE__ */ new Set([
|
|
828
828
|
"rowSpan",
|
|
829
829
|
"colSpan",
|
|
830
830
|
"tabIndex",
|
|
831
831
|
"valueAsNumber"
|
|
832
|
-
]),
|
|
832
|
+
]), ge = /* @__PURE__ */ new Set(["valueAsDate"]), me = /* @__PURE__ */ new Set([
|
|
833
833
|
"value",
|
|
834
834
|
"textContent",
|
|
835
835
|
"innerText",
|
|
@@ -837,28 +837,28 @@ const he = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), fe = /* @
|
|
|
837
837
|
"outerHTML",
|
|
838
838
|
"className",
|
|
839
839
|
"classList"
|
|
840
|
-
]),
|
|
840
|
+
]), Ue = (s, e) => de.has(s) ? (t) => {
|
|
841
841
|
t == null || t !== !0 ? e.removeAttribute(s) : e.setAttribute(s, "");
|
|
842
|
-
} :
|
|
842
|
+
} : fe.has(s) ? (t) => {
|
|
843
843
|
t == null ? e[s] = null : e[s] = !!t;
|
|
844
|
-
} : de.has(s) ? (t) => {
|
|
845
|
-
t == null ? e[s] = null : e[s] = Number(t);
|
|
846
844
|
} : pe.has(s) ? (t) => {
|
|
847
|
-
t == null ? e[s] = null : e[s] = t;
|
|
845
|
+
t == null ? e[s] = null : e[s] = Number(t);
|
|
848
846
|
} : ge.has(s) ? (t) => {
|
|
847
|
+
t == null ? e[s] = null : e[s] = t;
|
|
848
|
+
} : me.has(s) ? (t) => {
|
|
849
849
|
t == null ? e[s] = null : e[s] = String(t);
|
|
850
850
|
} : (t) => {
|
|
851
851
|
t == null ? e.removeAttribute(s) : e.setAttribute(s, t);
|
|
852
|
-
},
|
|
852
|
+
}, Je = (s, e) => de.has(s) ? () => e.hasAttribute(s) : fe.has(s) ? () => !!e[s] : pe.has(s) ? () => Number(e[s]) : ge.has(s) ? () => e[s] : me.has(s) ? () => String(e[s]) : () => e.getAttribute(s), q = (s) => {
|
|
853
853
|
const e = s;
|
|
854
854
|
e && e.onblur && (e.onblur = null), !(!s || s.ownerDocument === void 0) && s.parentElement && s.parentElement.removeChild(s);
|
|
855
|
-
},
|
|
856
|
-
class
|
|
855
|
+
}, Ge = (s) => ye(s) ? s : s.parentElement, ye = (s) => s.nodeType === 1;
|
|
856
|
+
class Te extends Error {
|
|
857
857
|
constructor(e) {
|
|
858
858
|
super(`Provider not found: ${e.description}`);
|
|
859
859
|
}
|
|
860
860
|
}
|
|
861
|
-
class
|
|
861
|
+
class D {
|
|
862
862
|
/**
|
|
863
863
|
* Constructs a new `DOMContext` instance.
|
|
864
864
|
*
|
|
@@ -955,7 +955,7 @@ class L {
|
|
|
955
955
|
* @param element - The DOM element to use in the new `DOMContext` instance.
|
|
956
956
|
* @returns A new `DOMContext` instance with the provided `element`.
|
|
957
957
|
*/
|
|
958
|
-
o(this, "withElement", (e) => new
|
|
958
|
+
o(this, "withElement", (e) => new D(this.document, e, void 0, this.providers));
|
|
959
959
|
/**
|
|
960
960
|
* Creates a portal to render content in a different part of the DOM tree.
|
|
961
961
|
*
|
|
@@ -1012,7 +1012,7 @@ class L {
|
|
|
1012
1012
|
* @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
|
|
1013
1013
|
* @returns A new `DOMContext` instance with the specified reference.
|
|
1014
1014
|
*/
|
|
1015
|
-
o(this, "withReference", (e) => new
|
|
1015
|
+
o(this, "withReference", (e) => new D(this.document, this.element, e, this.providers));
|
|
1016
1016
|
/**
|
|
1017
1017
|
* Sets a provider for the given provider mark.
|
|
1018
1018
|
*
|
|
@@ -1020,7 +1020,7 @@ class L {
|
|
|
1020
1020
|
* @param value - The provider to set for the given mark.
|
|
1021
1021
|
* @returns A new `DOMContext` instance with the specified provider.
|
|
1022
1022
|
*/
|
|
1023
|
-
o(this, "setProvider", (e, t, r) => new
|
|
1023
|
+
o(this, "setProvider", (e, t, r) => new D(this.document, this.element, this.reference, {
|
|
1024
1024
|
...this.providers,
|
|
1025
1025
|
[e]: [t, r]
|
|
1026
1026
|
}));
|
|
@@ -1033,12 +1033,12 @@ class L {
|
|
|
1033
1033
|
*/
|
|
1034
1034
|
o(this, "getProvider", (e) => {
|
|
1035
1035
|
if (this.providers[e] === void 0)
|
|
1036
|
-
throw new
|
|
1036
|
+
throw new Te(e);
|
|
1037
1037
|
const [t, r] = this.providers[e];
|
|
1038
1038
|
return { value: t, onUse: r };
|
|
1039
1039
|
});
|
|
1040
1040
|
o(this, "clear", (e) => {
|
|
1041
|
-
e && (this.reference !== void 0 ?
|
|
1041
|
+
e && (this.reference !== void 0 ? q(this.reference) : q(this.element));
|
|
1042
1042
|
});
|
|
1043
1043
|
/**
|
|
1044
1044
|
* Adds classes to the element.
|
|
@@ -1108,8 +1108,8 @@ class L {
|
|
|
1108
1108
|
*/
|
|
1109
1109
|
o(this, "getStyle", (e) => this.element.style[e]);
|
|
1110
1110
|
o(this, "makeAccessors", (e) => ({
|
|
1111
|
-
get:
|
|
1112
|
-
set:
|
|
1111
|
+
get: Je(e, this.element),
|
|
1112
|
+
set: Ue(e, this.element)
|
|
1113
1113
|
}));
|
|
1114
1114
|
o(this, "getWindow", () => this.document.defaultView);
|
|
1115
1115
|
this.document = e, this.element = t, this.reference = r, this.providers = n;
|
|
@@ -1123,20 +1123,20 @@ class L {
|
|
|
1123
1123
|
* @returns A new `DOMContext` instance.
|
|
1124
1124
|
*/
|
|
1125
1125
|
static of(e, t, r) {
|
|
1126
|
-
return new
|
|
1126
|
+
return new D(e.ownerDocument, e, t, r);
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
const
|
|
1129
|
+
const Xe = (s) => Symbol(s), te = (s, e) => {
|
|
1130
1130
|
const t = s(e);
|
|
1131
1131
|
return (r = !0) => t(r);
|
|
1132
|
-
},
|
|
1132
|
+
}, jt = (s, e, { doc: t, clear: r, disposeWithParent: n = !0, providers: i = {} } = {}) => {
|
|
1133
1133
|
const l = typeof e == "string" ? (t ?? document).querySelector(e) : e;
|
|
1134
1134
|
if (l === null)
|
|
1135
|
-
throw new
|
|
1135
|
+
throw new Ye(
|
|
1136
1136
|
`Cannot find element by selector for render: ${e}`
|
|
1137
1137
|
);
|
|
1138
1138
|
r !== !1 && (t ?? l.ownerDocument) != null && l.nodeType === 1 && (l.innerHTML = "");
|
|
1139
|
-
const c =
|
|
1139
|
+
const c = Ge(l), u = ye(l) ? void 0 : l, a = D.of(c, u, i), h = te(s, a);
|
|
1140
1140
|
let g;
|
|
1141
1141
|
return n && (g = new MutationObserver((T) => {
|
|
1142
1142
|
var p;
|
|
@@ -1150,27 +1150,27 @@ const Ge = (s) => Symbol(s), ee = (s, e) => {
|
|
|
1150
1150
|
})), () => {
|
|
1151
1151
|
g == null || g.disconnect(), h(!0);
|
|
1152
1152
|
};
|
|
1153
|
-
},
|
|
1153
|
+
}, Vt = (s, {
|
|
1154
1154
|
startUrl: e = "https://example.com",
|
|
1155
1155
|
selector: t,
|
|
1156
1156
|
providers: r = {}
|
|
1157
1157
|
} = {
|
|
1158
1158
|
selector: "body"
|
|
1159
1159
|
}) => {
|
|
1160
|
-
const n = y.toSignal(e).deriveProp(), i = new
|
|
1160
|
+
const n = y.toSignal(e).deriveProp(), i = new Ee(t, void 0), l = new O(i, void 0, { currentURL: n }, r);
|
|
1161
1161
|
return {
|
|
1162
|
-
clear:
|
|
1162
|
+
clear: te(s(), l),
|
|
1163
1163
|
root: i,
|
|
1164
1164
|
currentURL: n
|
|
1165
1165
|
};
|
|
1166
1166
|
};
|
|
1167
|
-
class
|
|
1167
|
+
class Ye extends Error {
|
|
1168
1168
|
constructor(e) {
|
|
1169
1169
|
super(e);
|
|
1170
1170
|
}
|
|
1171
1171
|
}
|
|
1172
|
-
const
|
|
1173
|
-
class
|
|
1172
|
+
const be = "data-tts-node", F = "data-tts-class", B = "data-tts-style", W = "data-tts-html", U = "data-tts-text", J = "data-tts-attrs";
|
|
1173
|
+
class qt {
|
|
1174
1174
|
constructor({
|
|
1175
1175
|
select: e,
|
|
1176
1176
|
getAttribute: t,
|
|
@@ -1277,21 +1277,21 @@ class jt {
|
|
|
1277
1277
|
if (n.hasChildren() && this.appendHTML(l, n.contentToHTML(t)), n.hasInnerHTML()) {
|
|
1278
1278
|
if (t) {
|
|
1279
1279
|
const c = this.getInnerHTML(l);
|
|
1280
|
-
c != null && this.setAttribute(l,
|
|
1280
|
+
c != null && this.setAttribute(l, W, c);
|
|
1281
1281
|
}
|
|
1282
1282
|
this.setInnerHTML(l, n.getInnerHTML());
|
|
1283
1283
|
}
|
|
1284
1284
|
if (n.hasInnerText()) {
|
|
1285
1285
|
if (t) {
|
|
1286
1286
|
const c = this.getInnerText(l);
|
|
1287
|
-
c != null && this.setAttribute(l,
|
|
1287
|
+
c != null && this.setAttribute(l, U, c);
|
|
1288
1288
|
}
|
|
1289
1289
|
this.setInnerText(l, n.getInnerText());
|
|
1290
1290
|
}
|
|
1291
1291
|
if (n.hasClasses()) {
|
|
1292
1292
|
if (t) {
|
|
1293
1293
|
const c = this.getClass(l);
|
|
1294
|
-
c != null && this.setAttribute(l,
|
|
1294
|
+
c != null && this.setAttribute(l, F, c);
|
|
1295
1295
|
}
|
|
1296
1296
|
this.setClass(l, n.getClasses().join(" "));
|
|
1297
1297
|
}
|
|
@@ -1300,7 +1300,7 @@ class jt {
|
|
|
1300
1300
|
const c = this.getStyles(l);
|
|
1301
1301
|
Object.keys(c).length > 0 && this.setAttribute(
|
|
1302
1302
|
l,
|
|
1303
|
-
|
|
1303
|
+
B,
|
|
1304
1304
|
JSON.stringify(c)
|
|
1305
1305
|
);
|
|
1306
1306
|
}
|
|
@@ -1315,7 +1315,7 @@ class jt {
|
|
|
1315
1315
|
h != null && u.push([a, h]);
|
|
1316
1316
|
}), u.length > 0 && this.setAttribute(
|
|
1317
1317
|
l,
|
|
1318
|
-
|
|
1318
|
+
J,
|
|
1319
1319
|
JSON.stringify(Object.fromEntries(u))
|
|
1320
1320
|
);
|
|
1321
1321
|
}
|
|
@@ -1329,54 +1329,54 @@ class jt {
|
|
|
1329
1329
|
this.select = e, this.getAttribute = t, this.setAttribute = r, this.getClass = n, this.setClass = i, this.getStyles = l, this.setStyles = c, this.appendHTML = u, this.getInnerHTML = a, this.setInnerHTML = h, this.getInnerText = g, this.setInnerText = T;
|
|
1330
1330
|
}
|
|
1331
1331
|
}
|
|
1332
|
-
const
|
|
1333
|
-
document.querySelectorAll(`[${
|
|
1334
|
-
},
|
|
1335
|
-
const e = s.getAttribute(q);
|
|
1336
|
-
s.removeAttribute(q), e != null && s.setAttribute("class", e);
|
|
1337
|
-
}, Qe = () => {
|
|
1338
|
-
document.querySelectorAll(`[${q}]`).forEach((e) => ze(e));
|
|
1339
|
-
}, Ze = (s) => {
|
|
1340
|
-
const e = s.getAttribute(B);
|
|
1341
|
-
s.removeAttribute(B), e != null && (s.innerHTML = e);
|
|
1342
|
-
}, Ke = () => {
|
|
1343
|
-
document.querySelectorAll(`[${B}]`).forEach((e) => Ze(e));
|
|
1344
|
-
}, et = (s) => {
|
|
1345
|
-
const e = s.getAttribute(W);
|
|
1346
|
-
s.removeAttribute(W), e != null && (s.innerText = e);
|
|
1347
|
-
}, tt = () => {
|
|
1348
|
-
document.querySelectorAll(`[${W}]`).forEach((e) => et(e));
|
|
1349
|
-
}, be = (s) => JSON.parse(s.replace(/"/g, '"')), st = (s) => {
|
|
1332
|
+
const ze = () => {
|
|
1333
|
+
document.querySelectorAll(`[${be}]`).forEach(q);
|
|
1334
|
+
}, Qe = (s) => {
|
|
1350
1335
|
const e = s.getAttribute(F);
|
|
1351
|
-
|
|
1352
|
-
|
|
1336
|
+
s.removeAttribute(F), e != null && s.setAttribute("class", e);
|
|
1337
|
+
}, Ze = () => {
|
|
1338
|
+
document.querySelectorAll(`[${F}]`).forEach((e) => Qe(e));
|
|
1339
|
+
}, Ke = (s) => {
|
|
1340
|
+
const e = s.getAttribute(W);
|
|
1341
|
+
s.removeAttribute(W), e != null && (s.innerHTML = e);
|
|
1342
|
+
}, et = () => {
|
|
1343
|
+
document.querySelectorAll(`[${W}]`).forEach((e) => Ke(e));
|
|
1344
|
+
}, tt = (s) => {
|
|
1345
|
+
const e = s.getAttribute(U);
|
|
1346
|
+
s.removeAttribute(U), e != null && (s.innerText = e);
|
|
1347
|
+
}, st = () => {
|
|
1348
|
+
document.querySelectorAll(`[${U}]`).forEach((e) => tt(e));
|
|
1349
|
+
}, Se = (s) => JSON.parse(s.replace(/"/g, '"')), rt = (s) => {
|
|
1350
|
+
const e = s.getAttribute(B);
|
|
1351
|
+
if (s.removeAttribute(B), e != null) {
|
|
1352
|
+
const t = Se(e);
|
|
1353
1353
|
Object.entries(t).forEach(([r, n]) => {
|
|
1354
1354
|
s.style.setProperty(r, n);
|
|
1355
1355
|
});
|
|
1356
1356
|
}
|
|
1357
|
-
},
|
|
1358
|
-
document.querySelectorAll(`[${
|
|
1359
|
-
},
|
|
1360
|
-
const e = s.getAttribute(
|
|
1361
|
-
if (s.removeAttribute(
|
|
1362
|
-
const t =
|
|
1357
|
+
}, nt = () => {
|
|
1358
|
+
document.querySelectorAll(`[${B}]`).forEach((e) => rt(e));
|
|
1359
|
+
}, it = (s) => {
|
|
1360
|
+
const e = s.getAttribute(J);
|
|
1361
|
+
if (s.removeAttribute(J), e != null) {
|
|
1362
|
+
const t = Se(e);
|
|
1363
1363
|
Object.entries(t).forEach(([r, n]) => {
|
|
1364
1364
|
n == null ? s.removeAttribute(r) : s.setAttribute(r, n);
|
|
1365
1365
|
});
|
|
1366
1366
|
}
|
|
1367
|
-
},
|
|
1368
|
-
document.querySelectorAll(`[${
|
|
1369
|
-
},
|
|
1370
|
-
|
|
1371
|
-
}, S = Symbol("class"),
|
|
1372
|
-
class
|
|
1367
|
+
}, ot = () => {
|
|
1368
|
+
document.querySelectorAll(`[${J}]`).forEach((e) => it(e));
|
|
1369
|
+
}, Ft = () => {
|
|
1370
|
+
ze(), Ze(), st(), et(), nt(), ot();
|
|
1371
|
+
}, S = Symbol("class"), v = Symbol("style"), P = Symbol("handler"), Ae = () => Math.random().toString(36).substring(2, 15), lt = (s) => s.replace(/<[^>]*>?/g, "");
|
|
1372
|
+
class _e {
|
|
1373
1373
|
constructor(e) {
|
|
1374
|
-
o(this, "id",
|
|
1374
|
+
o(this, "id", Ae());
|
|
1375
1375
|
o(this, "properties", {});
|
|
1376
1376
|
o(this, "children", []);
|
|
1377
1377
|
o(this, "isElement", () => !0);
|
|
1378
1378
|
o(this, "isText", () => !1);
|
|
1379
|
-
o(this, "getText", () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ?
|
|
1379
|
+
o(this, "getText", () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? lt(this.properties.innerHTML) : this.children.map((e) => e.getText()).join(""));
|
|
1380
1380
|
o(this, "removeChild", (e) => {
|
|
1381
1381
|
const t = this.children.indexOf(e);
|
|
1382
1382
|
t !== -1 && this.children.splice(t, 1);
|
|
@@ -1398,9 +1398,9 @@ class Ae {
|
|
|
1398
1398
|
o(this, "hasInnerText", () => this.properties.innerText != null);
|
|
1399
1399
|
o(this, "hasChildren", () => this.children.length > 0);
|
|
1400
1400
|
o(this, "hasClasses", () => this.properties[S] != null);
|
|
1401
|
-
o(this, "hasStyles", () => this.properties[
|
|
1401
|
+
o(this, "hasStyles", () => this.properties[v] != null);
|
|
1402
1402
|
o(this, "hasAttributes", () => Object.keys(this.properties).length > 0);
|
|
1403
|
-
o(this, "hasHandlers", () => this.properties[
|
|
1403
|
+
o(this, "hasHandlers", () => this.properties[P] != null);
|
|
1404
1404
|
o(this, "hasRenderableProperties", () => this.hasClasses() || this.hasAttributes() || this.hasStyles());
|
|
1405
1405
|
o(this, "getById", (e) => {
|
|
1406
1406
|
if (this.properties.id === e)
|
|
@@ -1412,20 +1412,20 @@ class Ae {
|
|
|
1412
1412
|
}
|
|
1413
1413
|
});
|
|
1414
1414
|
o(this, "trigger", (e, t) => {
|
|
1415
|
-
((this.properties[
|
|
1415
|
+
((this.properties[P] ?? {})[e] ?? []).forEach((n) => n(t));
|
|
1416
1416
|
});
|
|
1417
1417
|
o(this, "click", () => {
|
|
1418
1418
|
this.trigger("click", {});
|
|
1419
1419
|
});
|
|
1420
1420
|
o(this, "on", (e, t, r, n) => {
|
|
1421
1421
|
var u;
|
|
1422
|
-
const i = (u = this.properties)[
|
|
1422
|
+
const i = (u = this.properties)[P] ?? (u[P] = {}), l = n != null && n.once ? (a) => {
|
|
1423
1423
|
c(), t(a, r);
|
|
1424
1424
|
} : (a) => t(a, r);
|
|
1425
1425
|
i[e] = [...i[e] ?? [], l];
|
|
1426
1426
|
const c = () => {
|
|
1427
1427
|
const a = i[e] ?? [], h = a.indexOf(l);
|
|
1428
|
-
h !== -1 && (a.splice(h, 1), a.length === 0 ? (delete i[e], Object.keys(i).length === 0 && delete this.properties[
|
|
1428
|
+
h !== -1 && (a.splice(h, 1), a.length === 0 ? (delete i[e], Object.keys(i).length === 0 && delete this.properties[P]) : i[e] = a, (n == null ? void 0 : n.signal) != null && n.signal.removeEventListener("abort", c));
|
|
1429
1429
|
};
|
|
1430
1430
|
return (n == null ? void 0 : n.signal) != null && n.signal.addEventListener("abort", c), c;
|
|
1431
1431
|
});
|
|
@@ -1453,18 +1453,18 @@ class Ae {
|
|
|
1453
1453
|
([e]) => !["innerText", "innerHTML"].includes(e)
|
|
1454
1454
|
));
|
|
1455
1455
|
o(this, "getVisibleAttributes", () => Reflect.ownKeys(this.properties).flatMap(
|
|
1456
|
-
(e) => e === S ? [["class", this.getClasses()]] : e ===
|
|
1456
|
+
(e) => e === S ? [["class", this.getClasses()]] : e === v ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
|
|
1457
1457
|
));
|
|
1458
1458
|
o(this, "setStyle", (e, t) => {
|
|
1459
1459
|
var n;
|
|
1460
|
-
const r = (n = this.properties)[
|
|
1461
|
-
r[e] = t, t === "" && (delete r[e], Object.keys(r).length === 0 && delete this.properties[
|
|
1460
|
+
const r = (n = this.properties)[v] ?? (n[v] = {});
|
|
1461
|
+
r[e] = t, t === "" && (delete r[e], Object.keys(r).length === 0 && delete this.properties[v]);
|
|
1462
1462
|
});
|
|
1463
1463
|
o(this, "getStyle", (e) => {
|
|
1464
1464
|
var t;
|
|
1465
|
-
return ((t = this.properties[
|
|
1465
|
+
return ((t = this.properties[v]) == null ? void 0 : t[e]) ?? "";
|
|
1466
1466
|
});
|
|
1467
|
-
o(this, "getStyles", () => this.properties[
|
|
1467
|
+
o(this, "getStyles", () => this.properties[v] ?? {});
|
|
1468
1468
|
o(this, "makeAccessors", (e) => {
|
|
1469
1469
|
const t = this.properties;
|
|
1470
1470
|
return {
|
|
@@ -1475,21 +1475,21 @@ class Ae {
|
|
|
1475
1475
|
this.parent = e;
|
|
1476
1476
|
}
|
|
1477
1477
|
}
|
|
1478
|
-
const
|
|
1479
|
-
class
|
|
1478
|
+
const ct = (s) => s.replace(/"/g, """), ut = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
1479
|
+
class at extends _e {
|
|
1480
1480
|
constructor(t, r, n) {
|
|
1481
1481
|
super(n);
|
|
1482
1482
|
o(this, "isPortal", () => !1);
|
|
1483
1483
|
o(this, "toHTML", (t = !1) => {
|
|
1484
1484
|
const r = this.children.map((u) => u.toHTML()).join(""), n = this.namespace ? ` xmlns="${this.namespace}"` : "";
|
|
1485
1485
|
let i = null;
|
|
1486
|
-
const l = this.getVisibleAttributes().map(([u, a]) => u === "class" ? ` class="${a.join(" ")}"` : u === "style" ? typeof a == "string" ? ` style="${a}"` : ` style="${Object.entries(a).map(([h, g]) => `${h}: ${g};`).join(" ")}"` :
|
|
1487
|
-
return
|
|
1486
|
+
const l = this.getVisibleAttributes().map(([u, a]) => u === "class" ? ` class="${a.join(" ")}"` : u === "style" ? typeof a == "string" ? ` style="${a}"` : ` style="${Object.entries(a).map(([h, g]) => `${h}: ${g};`).join(" ")}"` : ft.has(u) ? ` ${u}` : u === "innerHTML" ? (i = a, "") : u === "innerText" ? (i = ut(a), "") : ` ${u}="${ct(a)}"`).join(""), c = t ? ` ${be}` : "";
|
|
1487
|
+
return dt.has(this.tagName) && r === "" ? `<${this.tagName}${n}${l}${c} />` : `<${this.tagName}${n}${l}${c}>${i ?? r}</${this.tagName}>`;
|
|
1488
1488
|
});
|
|
1489
1489
|
this.tagName = t, this.namespace = r;
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
|
-
class
|
|
1492
|
+
class Ee extends _e {
|
|
1493
1493
|
constructor(t, r) {
|
|
1494
1494
|
super(r);
|
|
1495
1495
|
o(this, "isPortal", () => !0);
|
|
@@ -1498,9 +1498,9 @@ class ve extends Ae {
|
|
|
1498
1498
|
this.selector = t;
|
|
1499
1499
|
}
|
|
1500
1500
|
}
|
|
1501
|
-
class
|
|
1501
|
+
class ht {
|
|
1502
1502
|
constructor(e) {
|
|
1503
|
-
o(this, "id",
|
|
1503
|
+
o(this, "id", Ae());
|
|
1504
1504
|
o(this, "isElement", () => !1);
|
|
1505
1505
|
o(this, "isText", () => !0);
|
|
1506
1506
|
o(this, "getText", () => this.text);
|
|
@@ -1508,7 +1508,7 @@ class at {
|
|
|
1508
1508
|
this.text = e;
|
|
1509
1509
|
}
|
|
1510
1510
|
}
|
|
1511
|
-
class
|
|
1511
|
+
class O {
|
|
1512
1512
|
constructor(e, t, r, n) {
|
|
1513
1513
|
o(this, "appendOrInsert", (e) => {
|
|
1514
1514
|
if (this.reference != null) {
|
|
@@ -1518,8 +1518,8 @@ class D {
|
|
|
1518
1518
|
this.element.children.push(e);
|
|
1519
1519
|
});
|
|
1520
1520
|
o(this, "makeChildElement", (e, t) => {
|
|
1521
|
-
const r = new
|
|
1522
|
-
return this.appendOrInsert(r), new
|
|
1521
|
+
const r = new at(e, t, this.element);
|
|
1522
|
+
return this.appendOrInsert(r), new O(
|
|
1523
1523
|
r,
|
|
1524
1524
|
void 0,
|
|
1525
1525
|
this.container,
|
|
@@ -1527,8 +1527,8 @@ class D {
|
|
|
1527
1527
|
);
|
|
1528
1528
|
});
|
|
1529
1529
|
o(this, "makeChildText", (e) => {
|
|
1530
|
-
const t = new
|
|
1531
|
-
return this.appendOrInsert(t), new
|
|
1530
|
+
const t = new ht(e);
|
|
1531
|
+
return this.appendOrInsert(t), new O(
|
|
1532
1532
|
this.element,
|
|
1533
1533
|
t,
|
|
1534
1534
|
this.container,
|
|
@@ -1544,8 +1544,8 @@ class D {
|
|
|
1544
1544
|
});
|
|
1545
1545
|
o(this, "makeRef", () => this.makeChildText(""));
|
|
1546
1546
|
o(this, "makePortal", (e) => {
|
|
1547
|
-
const t = new
|
|
1548
|
-
return this.appendOrInsert(t), new
|
|
1547
|
+
const t = new Ee(e, this.element);
|
|
1548
|
+
return this.appendOrInsert(t), new O(
|
|
1549
1549
|
t,
|
|
1550
1550
|
void 0,
|
|
1551
1551
|
this.container,
|
|
@@ -1559,13 +1559,13 @@ class D {
|
|
|
1559
1559
|
* @param value - The provider to set for the given mark.
|
|
1560
1560
|
* @returns A new `DOMContext` instance with the specified provider.
|
|
1561
1561
|
*/
|
|
1562
|
-
o(this, "setProvider", (e, t, r) => new
|
|
1562
|
+
o(this, "setProvider", (e, t, r) => new O(this.element, this.reference, this.container, {
|
|
1563
1563
|
...this.providers,
|
|
1564
1564
|
[e]: [t, r]
|
|
1565
1565
|
}));
|
|
1566
1566
|
o(this, "getProvider", (e) => {
|
|
1567
1567
|
if (this.providers[e] === void 0)
|
|
1568
|
-
throw new
|
|
1568
|
+
throw new Te(e);
|
|
1569
1569
|
const [t, r] = this.providers[e];
|
|
1570
1570
|
return { value: t, onUse: r };
|
|
1571
1571
|
});
|
|
@@ -1586,27 +1586,27 @@ class D {
|
|
|
1586
1586
|
this.element = e, this.reference = t, this.container = r, this.providers = n;
|
|
1587
1587
|
}
|
|
1588
1588
|
}
|
|
1589
|
-
const
|
|
1589
|
+
const ft = /* @__PURE__ */ new Set([
|
|
1590
1590
|
"checked",
|
|
1591
1591
|
"disabled",
|
|
1592
1592
|
"multiple",
|
|
1593
1593
|
"readonly",
|
|
1594
1594
|
"required",
|
|
1595
1595
|
"selected"
|
|
1596
|
-
]),
|
|
1596
|
+
]), dt = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), ve = (s) => (e) => e.makeChildText(s).clear, we = (s) => (e) => {
|
|
1597
1597
|
const t = e.makeChildText(s.value), r = s.on(t.setText);
|
|
1598
1598
|
return (n) => {
|
|
1599
1599
|
r(), t.clear(n);
|
|
1600
1600
|
};
|
|
1601
|
-
},
|
|
1601
|
+
}, Bt = (s) => d.is(s) ? we(s) : ve(s), b = (...s) => (e) => {
|
|
1602
1602
|
const t = s.map((r) => f(r)(e));
|
|
1603
1603
|
return (r) => {
|
|
1604
1604
|
t.forEach((n) => n(r));
|
|
1605
1605
|
};
|
|
1606
|
-
},
|
|
1607
|
-
},
|
|
1606
|
+
}, E = () => () => {
|
|
1607
|
+
}, pt = (s) => (e) => (e.addClasses(s), (t) => {
|
|
1608
1608
|
t && e.removeClasses(s);
|
|
1609
|
-
}),
|
|
1609
|
+
}), gt = (s) => (e) => {
|
|
1610
1610
|
let t = [];
|
|
1611
1611
|
const r = s.on((n) => {
|
|
1612
1612
|
e.removeClasses(t), t = (n ?? "").split(" ").filter((i) => i.length > 0), e.addClasses(t);
|
|
@@ -1614,17 +1614,17 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1614
1614
|
return (n) => {
|
|
1615
1615
|
r(), n && e.removeClasses(t), t.length = 0;
|
|
1616
1616
|
};
|
|
1617
|
-
},
|
|
1617
|
+
}, N = (s, e) => (t) => {
|
|
1618
1618
|
const { get: r, set: n } = t.makeAccessors(s), i = r();
|
|
1619
1619
|
return n(e), (l) => {
|
|
1620
1620
|
l && n(i);
|
|
1621
1621
|
};
|
|
1622
|
-
},
|
|
1622
|
+
}, $ = (s, e) => (t) => {
|
|
1623
1623
|
const { get: r, set: n } = t.makeAccessors(s), i = r(), l = e.on(n);
|
|
1624
1624
|
return (c) => {
|
|
1625
1625
|
l(), c && n(i);
|
|
1626
1626
|
};
|
|
1627
|
-
},
|
|
1627
|
+
}, M = new Proxy(
|
|
1628
1628
|
{},
|
|
1629
1629
|
{
|
|
1630
1630
|
/**
|
|
@@ -1638,18 +1638,18 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1638
1638
|
* @returns The renderable component for the specified attribute.
|
|
1639
1639
|
*
|
|
1640
1640
|
*/
|
|
1641
|
-
get: (s, e) => e === "class" ? (t) => d.is(t) ?
|
|
1641
|
+
get: (s, e) => e === "class" ? (t) => d.is(t) ? gt(t) : pt(
|
|
1642
1642
|
/* c8 ignore next */
|
|
1643
1643
|
(t ?? "").split(" ").filter((r) => r.length > 0)
|
|
1644
|
-
) : (t) => d.is(t) ?
|
|
1644
|
+
) : (t) => d.is(t) ? $(
|
|
1645
1645
|
e,
|
|
1646
1646
|
t
|
|
1647
|
-
) :
|
|
1647
|
+
) : N(
|
|
1648
1648
|
e,
|
|
1649
1649
|
t
|
|
1650
1650
|
)
|
|
1651
1651
|
}
|
|
1652
|
-
),
|
|
1652
|
+
), Wt = new Proxy(
|
|
1653
1653
|
{},
|
|
1654
1654
|
{
|
|
1655
1655
|
/**
|
|
@@ -1660,12 +1660,12 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1660
1660
|
* @returns The renderable component for the specified attribute.
|
|
1661
1661
|
*
|
|
1662
1662
|
*/
|
|
1663
|
-
get: (s, e) => (t) => d.is(t) ?
|
|
1663
|
+
get: (s, e) => (t) => d.is(t) ? $(
|
|
1664
1664
|
`data-${e}`,
|
|
1665
1665
|
t
|
|
1666
|
-
) :
|
|
1666
|
+
) : N(`data-${e}`, t)
|
|
1667
1667
|
}
|
|
1668
|
-
),
|
|
1668
|
+
), Ut = new Proxy(
|
|
1669
1669
|
{},
|
|
1670
1670
|
{
|
|
1671
1671
|
/**
|
|
@@ -1676,15 +1676,15 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1676
1676
|
* @returns The renderable component for the specified attribute.
|
|
1677
1677
|
*
|
|
1678
1678
|
*/
|
|
1679
|
-
get: (s, e) => (t) => d.is(t) ?
|
|
1679
|
+
get: (s, e) => (t) => d.is(t) ? $(
|
|
1680
1680
|
`aria-${e}`,
|
|
1681
1681
|
t
|
|
1682
|
-
) :
|
|
1682
|
+
) : N(
|
|
1683
1683
|
`aria-${e}`,
|
|
1684
1684
|
t
|
|
1685
1685
|
)
|
|
1686
1686
|
}
|
|
1687
|
-
),
|
|
1687
|
+
), Jt = new Proxy(
|
|
1688
1688
|
{},
|
|
1689
1689
|
{
|
|
1690
1690
|
/**
|
|
@@ -1695,15 +1695,15 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1695
1695
|
* @returns The renderable component for the specified attribute.
|
|
1696
1696
|
*
|
|
1697
1697
|
*/
|
|
1698
|
-
get: (s, e) => (t) => d.is(t) ?
|
|
1698
|
+
get: (s, e) => (t) => d.is(t) ? $(
|
|
1699
1699
|
e,
|
|
1700
1700
|
t
|
|
1701
|
-
) :
|
|
1701
|
+
) : N(
|
|
1702
1702
|
e,
|
|
1703
1703
|
t
|
|
1704
1704
|
)
|
|
1705
1705
|
}
|
|
1706
|
-
),
|
|
1706
|
+
), Gt = new Proxy(
|
|
1707
1707
|
{},
|
|
1708
1708
|
{
|
|
1709
1709
|
/**
|
|
@@ -1713,37 +1713,37 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1713
1713
|
* @returns The renderable component for the specified attribute.
|
|
1714
1714
|
*
|
|
1715
1715
|
*/
|
|
1716
|
-
get: (s, e) => (t) => d.is(t) ?
|
|
1716
|
+
get: (s, e) => (t) => d.is(t) ? $(
|
|
1717
1717
|
e,
|
|
1718
1718
|
t
|
|
1719
|
-
) :
|
|
1719
|
+
) : N(
|
|
1720
1720
|
e,
|
|
1721
1721
|
t
|
|
1722
1722
|
)
|
|
1723
1723
|
}
|
|
1724
1724
|
), f = (s) => {
|
|
1725
1725
|
if (s == null)
|
|
1726
|
-
return
|
|
1726
|
+
return E;
|
|
1727
1727
|
if (Array.isArray(s))
|
|
1728
1728
|
return b(...s.map(f));
|
|
1729
1729
|
if (typeof s == "string")
|
|
1730
|
-
return
|
|
1730
|
+
return ve(s);
|
|
1731
1731
|
if (d.is(s))
|
|
1732
|
-
return
|
|
1732
|
+
return we(s);
|
|
1733
1733
|
if (typeof s == "function")
|
|
1734
1734
|
return s;
|
|
1735
1735
|
throw new Error(`Unknown type: '${typeof s}' for child: ${s}`);
|
|
1736
|
-
},
|
|
1736
|
+
}, Ce = (s, ...e) => (t) => {
|
|
1737
1737
|
const r = t.makeChildElement(s, void 0), n = e.map((i) => f(i)(r));
|
|
1738
1738
|
return (i) => {
|
|
1739
1739
|
n.forEach((l) => l(!1)), r.clear(i);
|
|
1740
1740
|
};
|
|
1741
|
-
},
|
|
1741
|
+
}, xe = (s, e, ...t) => (r) => {
|
|
1742
1742
|
const n = r.makeChildElement(s, e), i = t.map((l) => f(l)(n));
|
|
1743
1743
|
return (l) => {
|
|
1744
1744
|
i.forEach((c) => c(!1)), n.clear(l);
|
|
1745
1745
|
};
|
|
1746
|
-
},
|
|
1746
|
+
}, Xt = new Proxy(
|
|
1747
1747
|
{},
|
|
1748
1748
|
{
|
|
1749
1749
|
/**
|
|
@@ -1751,9 +1751,9 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1751
1751
|
* @param tagName - The HTML tag name.
|
|
1752
1752
|
* @returns A renderable function that creates and appends the HTML element to the DOM.
|
|
1753
1753
|
*/
|
|
1754
|
-
get: (s, e) => (...t) =>
|
|
1754
|
+
get: (s, e) => (...t) => Ce(e, t.flatMap(f))
|
|
1755
1755
|
}
|
|
1756
|
-
),
|
|
1756
|
+
), Yt = new Proxy(
|
|
1757
1757
|
{},
|
|
1758
1758
|
{
|
|
1759
1759
|
/**
|
|
@@ -1761,9 +1761,9 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1761
1761
|
* @param type - The input type name.
|
|
1762
1762
|
* @returns A renderable function that creates and appends the HTMLInput element to the DOM.
|
|
1763
1763
|
*/
|
|
1764
|
-
get: (s, e) => (...t) =>
|
|
1764
|
+
get: (s, e) => (...t) => Ce("input", M.type(e), ...t)
|
|
1765
1765
|
}
|
|
1766
|
-
),
|
|
1766
|
+
), mt = "http://www.w3.org/2000/svg", zt = new Proxy(
|
|
1767
1767
|
{},
|
|
1768
1768
|
{
|
|
1769
1769
|
/**
|
|
@@ -1771,9 +1771,9 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1771
1771
|
* @param tagName - The SVG tag name.
|
|
1772
1772
|
* @returns A renderable function that creates and appends the SVG element to the DOM.
|
|
1773
1773
|
*/
|
|
1774
|
-
get: (s, e) => (...t) =>
|
|
1774
|
+
get: (s, e) => (...t) => xe(e, mt, t.flatMap(f))
|
|
1775
1775
|
}
|
|
1776
|
-
),
|
|
1776
|
+
), yt = "http://www.w3.org/1998/Math/MathML", Qt = new Proxy(
|
|
1777
1777
|
{},
|
|
1778
1778
|
{
|
|
1779
1779
|
/**
|
|
@@ -1781,12 +1781,12 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1781
1781
|
* @param tagName - The Math tag name.
|
|
1782
1782
|
* @returns A renderable function that creates and appends the Math element to the DOM.
|
|
1783
1783
|
*/
|
|
1784
|
-
get: (s, e) => (...t) =>
|
|
1784
|
+
get: (s, e) => (...t) => xe(e, yt, t.flatMap(f))
|
|
1785
1785
|
}
|
|
1786
|
-
),
|
|
1786
|
+
), Pe = (s, e) => {
|
|
1787
1787
|
if (typeof e == "function")
|
|
1788
|
-
return
|
|
1789
|
-
const t = e.pending != null ? f(e.pending()) :
|
|
1788
|
+
return Pe(s, { then: e });
|
|
1789
|
+
const t = e.pending != null ? f(e.pending()) : E, r = e.then, n = e.error != null ? (i) => f(e.error(i)) : () => E;
|
|
1790
1790
|
return (i) => {
|
|
1791
1791
|
let l = !0;
|
|
1792
1792
|
const c = s(), u = i.makeRef();
|
|
@@ -1802,14 +1802,14 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1802
1802
|
l = !1, a(h), u.clear(h);
|
|
1803
1803
|
};
|
|
1804
1804
|
};
|
|
1805
|
-
},
|
|
1805
|
+
}, Zt = (s, e) => Pe(() => s, e), Le = (s, e, t) => (r) => r.on(s, e, t), Tt = (s) => Le("click", (e, t) => {
|
|
1806
1806
|
e.preventDefault();
|
|
1807
1807
|
const r = e.target;
|
|
1808
1808
|
setTimeout(() => {
|
|
1809
1809
|
const n = r.ownerDocument != null ? r == null ? void 0 : r.checked : void 0;
|
|
1810
1810
|
n != null && s(!n, t);
|
|
1811
1811
|
}, 0);
|
|
1812
|
-
}),
|
|
1812
|
+
}), Y = new Proxy(
|
|
1813
1813
|
{},
|
|
1814
1814
|
{
|
|
1815
1815
|
/**
|
|
@@ -1817,73 +1817,67 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1817
1817
|
* @param fn - The function to call when the event is triggered.
|
|
1818
1818
|
* @returns A `Renderable` function that adds the event listener to the element.
|
|
1819
1819
|
*/
|
|
1820
|
-
get: (s, e) => (t) =>
|
|
1820
|
+
get: (s, e) => (t) => Le(e, t)
|
|
1821
1821
|
}
|
|
1822
|
-
),
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1822
|
+
), bt = (s, e) => (t) => {
|
|
1823
|
+
(e == null ? void 0 : e.preventDefault) === !0 && t.preventDefault(), (e == null ? void 0 : e.stopPropagation) === !0 && t.stopPropagation(), (e == null ? void 0 : e.stopImmediatePropagation) === !0 && t.stopImmediatePropagation(), s(t);
|
|
1824
|
+
}, x = (s, e) => bt((t) => {
|
|
1825
|
+
const r = t.target;
|
|
1826
|
+
s(r, t);
|
|
1827
|
+
}, e), St = (s, e) => x(
|
|
1828
|
+
(t, r) => s(t.value, r),
|
|
1829
|
+
e
|
|
1830
|
+
), At = (s, e) => x(
|
|
1831
|
+
(t, r) => s(t.valueAsNumber, r),
|
|
1832
|
+
e
|
|
1833
|
+
), _t = (s, e) => x((t, r) => {
|
|
1830
1834
|
if (t.value === "")
|
|
1831
1835
|
return;
|
|
1832
|
-
const
|
|
1833
|
-
Number(
|
|
1834
|
-
Number(
|
|
1835
|
-
Number(
|
|
1836
|
+
const n = t.value.split("-"), i = new Date(
|
|
1837
|
+
Number(n[0]),
|
|
1838
|
+
Number(n[1]) - 1,
|
|
1839
|
+
Number(n[2].substring(0, 2))
|
|
1836
1840
|
);
|
|
1837
|
-
s(
|
|
1838
|
-
},
|
|
1839
|
-
const t = e.target;
|
|
1841
|
+
s(i, r);
|
|
1842
|
+
}, e), Kt = (s, e) => x((t, r) => {
|
|
1840
1843
|
if (t.value === "") {
|
|
1841
|
-
s(null);
|
|
1844
|
+
s(null, r);
|
|
1842
1845
|
return;
|
|
1843
1846
|
}
|
|
1844
|
-
const
|
|
1845
|
-
Number(
|
|
1846
|
-
Number(
|
|
1847
|
-
Number(
|
|
1847
|
+
const n = t.value.split("-"), i = new Date(
|
|
1848
|
+
Number(n[0]),
|
|
1849
|
+
Number(n[1]) - 1,
|
|
1850
|
+
Number(n[2].substring(0, 2))
|
|
1848
1851
|
);
|
|
1849
|
-
s(
|
|
1850
|
-
},
|
|
1851
|
-
const t = e.target;
|
|
1852
|
+
s(i, r);
|
|
1853
|
+
}, e), Et = (s, e) => x((t, r) => {
|
|
1852
1854
|
if (t.value === "")
|
|
1853
1855
|
return;
|
|
1854
|
-
const
|
|
1855
|
-
Number(
|
|
1856
|
-
Number(
|
|
1857
|
-
Number(
|
|
1858
|
-
),
|
|
1859
|
-
|
|
1860
|
-
},
|
|
1861
|
-
const t = e.target;
|
|
1856
|
+
const n = t.value.split("T"), i = n[0].split("-"), l = new Date(
|
|
1857
|
+
Number(i[0]),
|
|
1858
|
+
Number(i[1]) - 1,
|
|
1859
|
+
Number(i[2])
|
|
1860
|
+
), c = n[1].split(":");
|
|
1861
|
+
l.setHours(Number(c[0])), l.setMinutes(Number(c[1])), l.setSeconds(Number(c[2])), s(l, r);
|
|
1862
|
+
}, e), es = (s, e) => x((t, r) => {
|
|
1862
1863
|
if (t.value === "") {
|
|
1863
|
-
s(null);
|
|
1864
|
+
s(null, r);
|
|
1864
1865
|
return;
|
|
1865
1866
|
}
|
|
1866
|
-
const
|
|
1867
|
-
if (
|
|
1868
|
-
s(null);
|
|
1867
|
+
const n = t.value.split("T");
|
|
1868
|
+
if (n.length !== 2) {
|
|
1869
|
+
s(null, r);
|
|
1869
1870
|
return;
|
|
1870
1871
|
}
|
|
1871
|
-
const
|
|
1872
|
-
Number(
|
|
1873
|
-
Number(
|
|
1874
|
-
Number(
|
|
1875
|
-
),
|
|
1876
|
-
|
|
1877
|
-
},
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
}, es = (s) => (e) => {
|
|
1881
|
-
e.preventDefault(), s();
|
|
1882
|
-
}, ts = (s) => (e) => {
|
|
1883
|
-
e.stopPropagation(), s();
|
|
1884
|
-
}, ss = (s) => (e) => {
|
|
1885
|
-
e.stopImmediatePropagation(), s();
|
|
1886
|
-
}, rs = (s, e = "input") => b(O.valueAsDate(s), X[e](St(s.set))), ns = (s, e = "input") => b(O.valueAsDate(s), X[e](At(s.set))), is = (s, e = "input") => b(O.valueAsNumber(s), X[e](bt(s.set))), os = (s, e = "input") => b(O.value(s), X[e](Tt(s.set))), ls = (s) => b(O.checked(s), yt(s.set)), Y = (s, e) => {
|
|
1872
|
+
const i = n[0].split("-"), l = new Date(
|
|
1873
|
+
Number(i[0]),
|
|
1874
|
+
Number(i[1]) - 1,
|
|
1875
|
+
Number(i[2])
|
|
1876
|
+
), c = n[1].split(":");
|
|
1877
|
+
l.setHours(Number(c[0] ?? 0)), l.setMinutes(Number(c[1] ?? 0)), l.setSeconds(Number(c[2] ?? 0)), s(l, r);
|
|
1878
|
+
}, e), ts = (s, e) => x((t, r) => {
|
|
1879
|
+
s(t.checked, r);
|
|
1880
|
+
}, e), ss = (s, e = "input") => b(M.valueAsDate(s), Y[e](_t(s.set))), rs = (s, e = "input") => b(M.valueAsDate(s), Y[e](Et(s.set))), ns = (s, e = "input") => b(M.valueAsNumber(s), Y[e](At(s.set))), is = (s, e = "input") => b(M.value(s), Y[e](St(s.set))), os = (s) => b(M.checked(s), Tt(s.set)), z = (s, e) => {
|
|
1887
1881
|
if (d.is(s))
|
|
1888
1882
|
return (r) => {
|
|
1889
1883
|
const n = r.makeRef();
|
|
@@ -1902,18 +1896,18 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1902
1896
|
};
|
|
1903
1897
|
};
|
|
1904
1898
|
const t = Object.keys(s)[0];
|
|
1905
|
-
return f(e[t](
|
|
1906
|
-
},
|
|
1899
|
+
return f(e[t](X(s[t])));
|
|
1900
|
+
}, De = (s, e, t) => z(
|
|
1907
1901
|
y.map(s, (r) => ({ [r[e]]: r })),
|
|
1908
1902
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1909
1903
|
t
|
|
1910
|
-
),
|
|
1904
|
+
), ls = (s, e) => De(s, "kind", e), cs = (s, e) => {
|
|
1911
1905
|
const t = y.map(s, ([r, n]) => ({ [r]: n }));
|
|
1912
|
-
return
|
|
1913
|
-
},
|
|
1906
|
+
return z(t, e);
|
|
1907
|
+
}, us = (s, e) => De(s, "type", e), vt = (s, e) => z(
|
|
1914
1908
|
y.map(s, (t) => ({ [t]: !0 })),
|
|
1915
1909
|
e
|
|
1916
|
-
),
|
|
1910
|
+
), as = (s, e = {}) => (t) => {
|
|
1917
1911
|
const r = (e == null ? void 0 : e.firstSeparator) ?? s, n = (e == null ? void 0 : e.lastSeparator) ?? s;
|
|
1918
1912
|
return vt(
|
|
1919
1913
|
t.map((i) => i.isFirst ? "first" : i.isLast ? "last" : "other"),
|
|
@@ -1923,9 +1917,9 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1923
1917
|
other: s
|
|
1924
1918
|
}
|
|
1925
1919
|
);
|
|
1926
|
-
},
|
|
1927
|
-
t &&
|
|
1928
|
-
}),
|
|
1920
|
+
}, hs = (s) => (e) => (e.appendOrInsert(s), (t) => {
|
|
1921
|
+
t && q(s);
|
|
1922
|
+
}), fs = (s, e, t) => {
|
|
1929
1923
|
if (d.is(s)) {
|
|
1930
1924
|
const r = s;
|
|
1931
1925
|
return (n) => {
|
|
@@ -1933,7 +1927,7 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1933
1927
|
let l = () => {
|
|
1934
1928
|
}, c = !1, u = null;
|
|
1935
1929
|
const a = r.on((h) => {
|
|
1936
|
-
h == null ? (l(!0), l = f(t == null ? void 0 : t())(i), c = !1, u == null || u.dispose(), u = null) : c ? u.set(h) : (u =
|
|
1930
|
+
h == null ? (l(!0), l = f(t == null ? void 0 : t())(i), c = !1, u == null || u.dispose(), u = null) : c ? u.set(h) : (u = _(h), l(!0), l = f(e(u))(
|
|
1937
1931
|
i
|
|
1938
1932
|
), c = !0);
|
|
1939
1933
|
});
|
|
@@ -1945,26 +1939,26 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1945
1939
|
const r = s;
|
|
1946
1940
|
if (r == null) {
|
|
1947
1941
|
const n = t == null ? void 0 : t();
|
|
1948
|
-
return n != null ? f(n) :
|
|
1942
|
+
return n != null ? f(n) : E;
|
|
1949
1943
|
}
|
|
1950
|
-
return f(e(
|
|
1944
|
+
return f(e(X(r)));
|
|
1951
1945
|
}
|
|
1952
|
-
},
|
|
1946
|
+
}, ds = (...s) => (e, t) => (r) => {
|
|
1953
1947
|
const n = r.makeRef();
|
|
1954
1948
|
if (s.some(
|
|
1955
1949
|
(p) => !d.is(p) && p == null
|
|
1956
1950
|
))
|
|
1957
|
-
return (t != null ? f(t == null ? void 0 : t()) :
|
|
1951
|
+
return (t != null ? f(t == null ? void 0 : t()) : E)(
|
|
1958
1952
|
n
|
|
1959
1953
|
);
|
|
1960
1954
|
const l = s.map(() => null), c = s.map(
|
|
1961
1955
|
(p) => d.is(p) ? p.value != null : p != null
|
|
1962
1956
|
);
|
|
1963
1957
|
let u = null;
|
|
1964
|
-
const a =
|
|
1958
|
+
const a = _(c.every((p) => p)), h = (p, m) => {
|
|
1965
1959
|
if (p.value != null) {
|
|
1966
1960
|
if (l[m] == null) {
|
|
1967
|
-
const C =
|
|
1961
|
+
const C = _(p.value);
|
|
1968
1962
|
l[m] = C;
|
|
1969
1963
|
} else
|
|
1970
1964
|
l[m].value = p.value;
|
|
@@ -1975,7 +1969,7 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1975
1969
|
let g = s.length - 1;
|
|
1976
1970
|
const T = s.map((p, m) => {
|
|
1977
1971
|
if (!d.is(p)) {
|
|
1978
|
-
const C =
|
|
1972
|
+
const C = _(p);
|
|
1979
1973
|
return l[m] = C, () => {
|
|
1980
1974
|
};
|
|
1981
1975
|
}
|
|
@@ -1984,11 +1978,11 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
1984
1978
|
});
|
|
1985
1979
|
});
|
|
1986
1980
|
return a.on((p) => {
|
|
1987
|
-
u == null || u(!0), u = null, p ? u = f(e(...l))(n) : u = f((t == null ? void 0 : t()) ??
|
|
1981
|
+
u == null || u(!0), u = null, p ? u = f(e(...l))(n) : u = f((t == null ? void 0 : t()) ?? E)(n);
|
|
1988
1982
|
}), (p) => {
|
|
1989
1983
|
l.forEach((m) => m == null ? void 0 : m.dispose()), a.dispose(), T.forEach((m) => m()), u == null || u(p), n.clear(p);
|
|
1990
1984
|
};
|
|
1991
|
-
},
|
|
1985
|
+
}, H = (...s) => (e) => (t) => s.forEach((r) => r(t, e)), Oe = (s, e, t) => {
|
|
1992
1986
|
if (d.is(s)) {
|
|
1993
1987
|
const r = s;
|
|
1994
1988
|
return (n) => {
|
|
@@ -2005,27 +1999,27 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
2005
1999
|
} else {
|
|
2006
2000
|
if (s) {
|
|
2007
2001
|
const n = e();
|
|
2008
|
-
return n != null ? f(n) :
|
|
2002
|
+
return n != null ? f(n) : E;
|
|
2009
2003
|
}
|
|
2010
2004
|
return f(t == null ? void 0 : t());
|
|
2011
2005
|
}
|
|
2012
|
-
},
|
|
2006
|
+
}, ps = (s, e, t) => Oe(
|
|
2013
2007
|
y.map(s, (r) => !r),
|
|
2014
2008
|
e,
|
|
2015
2009
|
t
|
|
2016
|
-
),
|
|
2010
|
+
), Me = (s, e, t) => {
|
|
2017
2011
|
if (t != null)
|
|
2018
|
-
return
|
|
2019
|
-
const n = new
|
|
2012
|
+
return Me(s, (r) => {
|
|
2013
|
+
const n = new Z(
|
|
2020
2014
|
r.index,
|
|
2021
2015
|
r.total.map((i) => i - 1)
|
|
2022
2016
|
);
|
|
2023
2017
|
return b(
|
|
2024
|
-
|
|
2018
|
+
H(n.dispose),
|
|
2025
2019
|
f(e(r)),
|
|
2026
|
-
|
|
2020
|
+
Oe(
|
|
2027
2021
|
r.isLast,
|
|
2028
|
-
() =>
|
|
2022
|
+
() => E,
|
|
2029
2023
|
() => t(n)
|
|
2030
2024
|
)
|
|
2031
2025
|
);
|
|
@@ -2038,10 +2032,10 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
2038
2032
|
for (const a of u)
|
|
2039
2033
|
a(!0);
|
|
2040
2034
|
for (let a = l.length; a < c; a++) {
|
|
2041
|
-
const h = new
|
|
2035
|
+
const h = new Z(a, n);
|
|
2042
2036
|
l.push(
|
|
2043
2037
|
b(
|
|
2044
|
-
|
|
2038
|
+
H(h.dispose),
|
|
2045
2039
|
f(e(h))
|
|
2046
2040
|
)(i)
|
|
2047
2041
|
);
|
|
@@ -2054,31 +2048,31 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
2054
2048
|
};
|
|
2055
2049
|
};
|
|
2056
2050
|
{
|
|
2057
|
-
const r =
|
|
2051
|
+
const r = X(s);
|
|
2058
2052
|
return b(
|
|
2059
2053
|
...Array.from({ length: s }, (n, i) => i).map((n) => {
|
|
2060
|
-
const i = new
|
|
2054
|
+
const i = new Z(n, r);
|
|
2061
2055
|
return b(
|
|
2062
|
-
|
|
2056
|
+
H(i.dispose),
|
|
2063
2057
|
f(e(i))
|
|
2064
2058
|
);
|
|
2065
2059
|
})
|
|
2066
2060
|
);
|
|
2067
2061
|
}
|
|
2068
|
-
},
|
|
2062
|
+
}, gs = (s, e, t) => {
|
|
2069
2063
|
const r = y.map(s, (i) => i.length), n = y.toSignal(s);
|
|
2070
|
-
return
|
|
2064
|
+
return Me(
|
|
2071
2065
|
r,
|
|
2072
2066
|
(i) => {
|
|
2073
2067
|
const l = n.map((c) => c[i.index]);
|
|
2074
2068
|
return b(
|
|
2075
|
-
|
|
2069
|
+
H(l.dispose),
|
|
2076
2070
|
f(e(l, i))
|
|
2077
2071
|
);
|
|
2078
2072
|
},
|
|
2079
2073
|
t
|
|
2080
2074
|
);
|
|
2081
|
-
},
|
|
2075
|
+
}, ms = (s, e) => {
|
|
2082
2076
|
if (d.is(s)) {
|
|
2083
2077
|
const t = s;
|
|
2084
2078
|
return (r) => {
|
|
@@ -2095,7 +2089,7 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
2095
2089
|
};
|
|
2096
2090
|
}
|
|
2097
2091
|
return f(e(s));
|
|
2098
|
-
},
|
|
2092
|
+
}, ys = (s, e, t = () => E) => z(
|
|
2099
2093
|
y.map(
|
|
2100
2094
|
s,
|
|
2101
2095
|
(r) => r.length > 0 ? { notEmpty: r } : { whenEmpty: null }
|
|
@@ -2104,40 +2098,40 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
2104
2098
|
notEmpty: (r) => e(r),
|
|
2105
2099
|
whenEmpty: () => t()
|
|
2106
2100
|
}
|
|
2107
|
-
),
|
|
2108
|
-
const r = t.makePortal(s), n =
|
|
2101
|
+
), Ts = (s, e) => (t) => {
|
|
2102
|
+
const r = t.makePortal(s), n = te(f(e), r);
|
|
2109
2103
|
return () => n(!0);
|
|
2110
|
-
},
|
|
2111
|
-
mark:
|
|
2104
|
+
}, j = /* @__PURE__ */ new Map(), wt = (s) => ({
|
|
2105
|
+
mark: Xe(`Probe(${s.description})`),
|
|
2112
2106
|
create: ({ callback: e = () => {
|
|
2113
2107
|
}, timeout: t = 10 } = {}) => {
|
|
2114
2108
|
const r = (c) => {
|
|
2115
|
-
clearTimeout(n),
|
|
2109
|
+
clearTimeout(n), j.delete(s), e(c);
|
|
2116
2110
|
};
|
|
2117
|
-
if (
|
|
2111
|
+
if (j.has(s))
|
|
2118
2112
|
throw new Error(`Probe already exists: ${s.description}`);
|
|
2119
2113
|
const n = setTimeout(() => r("timeout"), t), i = { counter: 0, timeoutId: n };
|
|
2120
|
-
return
|
|
2114
|
+
return j.set(s, i), {
|
|
2121
2115
|
value: () => {
|
|
2122
2116
|
clearTimeout(n);
|
|
2123
|
-
const c =
|
|
2117
|
+
const c = j.get(s);
|
|
2124
2118
|
c != null && --c.counter === 0 && r("resolved");
|
|
2125
2119
|
},
|
|
2126
2120
|
dispose: () => r("disposed"),
|
|
2127
2121
|
onUse: () => i.counter++
|
|
2128
2122
|
};
|
|
2129
2123
|
}
|
|
2130
|
-
}),
|
|
2124
|
+
}), bs = wt(Symbol("GlobalProbe")), Ct = (s, e) => (t) => {
|
|
2131
2125
|
const r = t.getStyle(s);
|
|
2132
2126
|
return t.setStyle(s, e), (n) => {
|
|
2133
2127
|
n && t.setStyle(s, r);
|
|
2134
2128
|
};
|
|
2135
|
-
},
|
|
2129
|
+
}, xt = (s, e) => (t) => {
|
|
2136
2130
|
const r = t.getStyle(s), n = e.on((i) => t.setStyle(s, i));
|
|
2137
2131
|
return (i) => {
|
|
2138
2132
|
n(), i && t.setStyle(s, r);
|
|
2139
2133
|
};
|
|
2140
|
-
},
|
|
2134
|
+
}, Ss = new Proxy(
|
|
2141
2135
|
{},
|
|
2142
2136
|
{
|
|
2143
2137
|
/**
|
|
@@ -2148,9 +2142,9 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
2148
2142
|
* @returns The renderable component for the specified attribute.
|
|
2149
2143
|
*
|
|
2150
2144
|
*/
|
|
2151
|
-
get: (s, e) => (t) => d.is(t) ?
|
|
2145
|
+
get: (s, e) => (t) => d.is(t) ? xt(e, t) : Ct(e, t)
|
|
2152
2146
|
}
|
|
2153
|
-
),
|
|
2147
|
+
), Pt = (s) => (e) => {
|
|
2154
2148
|
if (e.isBrowser()) {
|
|
2155
2149
|
const t = s(e);
|
|
2156
2150
|
if (t != null)
|
|
@@ -2158,11 +2152,11 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
2158
2152
|
}
|
|
2159
2153
|
return () => {
|
|
2160
2154
|
};
|
|
2161
|
-
},
|
|
2155
|
+
}, As = (s) => (e) => {
|
|
2162
2156
|
const t = s(e);
|
|
2163
2157
|
return t == null ? () => {
|
|
2164
2158
|
} : f(t)(e);
|
|
2165
|
-
}, _s = (s) =>
|
|
2159
|
+
}, _s = (s) => Pt((e) => s(e.element)), Es = (s) => (e) => {
|
|
2166
2160
|
if (e.isHeadlessDOM()) {
|
|
2167
2161
|
const t = s(e);
|
|
2168
2162
|
if (t)
|
|
@@ -2170,7 +2164,7 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
2170
2164
|
}
|
|
2171
2165
|
return () => {
|
|
2172
2166
|
};
|
|
2173
|
-
},
|
|
2167
|
+
}, se = (s) => (e) => {
|
|
2174
2168
|
let t = e;
|
|
2175
2169
|
function r() {
|
|
2176
2170
|
return t;
|
|
@@ -2191,125 +2185,124 @@ const ht = /* @__PURE__ */ new Set([
|
|
|
2191
2185
|
return l == null ? () => {
|
|
2192
2186
|
} : b(
|
|
2193
2187
|
f(l),
|
|
2194
|
-
|
|
2188
|
+
H(() => i.forEach((c) => c()))
|
|
2195
2189
|
)(r());
|
|
2196
|
-
},
|
|
2190
|
+
}, vs = (s, e, t) => se(({ set: r }) => (r(s, e), t())), ws = (s, e) => se(({ use: t }) => e(t(s))), Cs = (...s) => (e) => se(({ use: t }) => {
|
|
2197
2191
|
const r = s.map(t);
|
|
2198
2192
|
return e(...r);
|
|
2199
2193
|
});
|
|
2200
2194
|
export {
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2195
|
+
Zt as Async,
|
|
2196
|
+
os as BindChecked,
|
|
2197
|
+
ss as BindDate,
|
|
2198
|
+
rs as BindDateTime,
|
|
2199
|
+
ns as BindNumber,
|
|
2200
|
+
is as BindText,
|
|
2201
|
+
D as BrowserContext,
|
|
2202
|
+
F as CLASS_PLACEHOLDER_ATTR,
|
|
2203
|
+
L as Computed,
|
|
2204
|
+
as as Conjunction,
|
|
2205
|
+
hs as DOMNode,
|
|
2206
|
+
Ce as El,
|
|
2207
|
+
xe as ElNS,
|
|
2208
|
+
Z as ElementPosition,
|
|
2209
|
+
E as Empty,
|
|
2210
|
+
fs as Ensure,
|
|
2211
|
+
ds as EnsureAll,
|
|
2212
|
+
gs as ForEach,
|
|
2219
2213
|
b as Fragment,
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2214
|
+
bs as GlobalProbe,
|
|
2215
|
+
qt as HeadlessAdapter,
|
|
2216
|
+
O as HeadlessContext,
|
|
2217
|
+
at as HeadlessElement,
|
|
2218
|
+
Ee as HeadlessPortal,
|
|
2219
|
+
ht as HeadlessText,
|
|
2220
|
+
ms as MapSignal,
|
|
2221
|
+
ae as MemoryStore,
|
|
2222
|
+
ys as NotEmpty,
|
|
2223
|
+
Tt as OnChecked,
|
|
2224
|
+
H as OnDispose,
|
|
2225
|
+
z as OneOf,
|
|
2226
|
+
De as OneOfField,
|
|
2227
|
+
ls as OneOfKind,
|
|
2228
|
+
cs as OneOfTuple,
|
|
2229
|
+
us as OneOfType,
|
|
2236
2230
|
vt as OneOfValue,
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2231
|
+
Ts as Portal,
|
|
2232
|
+
V as Prop,
|
|
2233
|
+
vs as Provide,
|
|
2234
|
+
Te as ProviderNotFoundError,
|
|
2235
|
+
Ye as RenderingError,
|
|
2236
|
+
Me as Repeat,
|
|
2243
2237
|
d as Signal,
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2238
|
+
Pe as Task,
|
|
2239
|
+
Bt as TextNode,
|
|
2240
|
+
ps as Unless,
|
|
2241
|
+
ws as Use,
|
|
2242
|
+
Cs as UseMany,
|
|
2249
2243
|
y as Value,
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2244
|
+
Oe as When,
|
|
2245
|
+
Pt as WithBrowserCtx,
|
|
2246
|
+
As as WithCtx,
|
|
2253
2247
|
_s as WithElement,
|
|
2254
2248
|
Es as WithHeadlessCtx,
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
ee as renderWithContext,
|
|
2249
|
+
se as WithProvider,
|
|
2250
|
+
be as _NODE_PLACEHOLDER_ATTR,
|
|
2251
|
+
Ge as _getSelfOrParentElement,
|
|
2252
|
+
ye as _isElement,
|
|
2253
|
+
Je as _makeGetter,
|
|
2254
|
+
Ue as _makeSetter,
|
|
2255
|
+
q as _removeDOMNode,
|
|
2256
|
+
we as _signalText,
|
|
2257
|
+
ve as _staticText,
|
|
2258
|
+
kt as animateSignal,
|
|
2259
|
+
Be as animateSignals,
|
|
2260
|
+
Ut as aria,
|
|
2261
|
+
M as attr,
|
|
2262
|
+
It as bind,
|
|
2263
|
+
Rt as coalesce,
|
|
2264
|
+
K as computed,
|
|
2265
|
+
ee as computedOf,
|
|
2266
|
+
We as computedRecord,
|
|
2267
|
+
Wt as dataAttr,
|
|
2268
|
+
$t as delaySignal,
|
|
2269
|
+
Fe as effect,
|
|
2270
|
+
Ot as effectOf,
|
|
2271
|
+
bt as emit,
|
|
2272
|
+
ts as emitChecked,
|
|
2273
|
+
x as emitTarget,
|
|
2274
|
+
St as emitValue,
|
|
2275
|
+
_t as emitValueAsDate,
|
|
2276
|
+
Et as emitValueAsDateTime,
|
|
2277
|
+
Kt as emitValueAsNullableDate,
|
|
2278
|
+
es as emitValueAsNullableDateTime,
|
|
2279
|
+
At as emitValueAsNumber,
|
|
2280
|
+
je as endInterpolate,
|
|
2281
|
+
ue as getWindow,
|
|
2282
|
+
Ve as guessInterpolate,
|
|
2283
|
+
Xt as html,
|
|
2284
|
+
Yt as input,
|
|
2285
|
+
Re as interpolateDate,
|
|
2286
|
+
$e as interpolateNumber,
|
|
2287
|
+
Ie as interpolateString,
|
|
2288
|
+
Dt as joinSignals,
|
|
2289
|
+
Mt as localStorageProp,
|
|
2290
|
+
wt as makeProbe,
|
|
2291
|
+
Xe as makeProviderMark,
|
|
2292
|
+
Qt as math,
|
|
2293
|
+
Gt as mathAttr,
|
|
2294
|
+
Nt as merge,
|
|
2295
|
+
Y as on,
|
|
2296
|
+
_ as prop,
|
|
2297
|
+
jt as render,
|
|
2298
|
+
te as renderWithContext,
|
|
2306
2299
|
f as renderableOfTNode,
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2300
|
+
Ft as restoreTempoPlaceholders,
|
|
2301
|
+
Vt as runHeadless,
|
|
2302
|
+
Ht as sessionStorageProp,
|
|
2303
|
+
X as signal,
|
|
2304
|
+
he as storedProp,
|
|
2305
|
+
Ss as style,
|
|
2306
|
+
zt as svg,
|
|
2307
|
+
Jt as svgAttr
|
|
2315
2308
|
};
|