@tempots/dom 31.4.0 → 31.6.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/README.md +36 -7
- package/index.cjs +1 -1
- package/index.js +614 -598
- package/package.json +1 -1
- package/renderable/attribute.d.ts +9 -0
- package/renderable/utils.d.ts +30 -0
- package/std/signal-utils.d.ts +19 -3
- package/types/html-attributes.d.ts +1 -0
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var We = Object.defineProperty;
|
|
2
|
+
var me = (s) => {
|
|
3
3
|
throw TypeError(s);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var o = (s, e, t) =>
|
|
7
|
-
var
|
|
8
|
-
const
|
|
9
|
-
const
|
|
5
|
+
var Ue = (s, e, t) => e in s ? We(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
6
|
+
var o = (s, e, t) => Ue(s, typeof e != "symbol" ? e + "" : e, t), ge = (s, e, t) => e.has(s) || me("Cannot " + t);
|
|
7
|
+
var U = (s, e, t) => (ge(s, e, "read from private field"), t ? t.call(s) : e.get(s)), ye = (s, e, t) => e.has(s) ? me("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), le = (s, e, t, r) => (ge(s, e, "write to private field"), r ? r.call(s, t) : e.set(s, t), t);
|
|
8
|
+
const Je = (s, e, t) => s + (e - s) * t;
|
|
9
|
+
const Ge = (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 Ve = (s, e, t) => {
|
|
|
16
16
|
isNaN(c) && (c = 97), n += String.fromCharCode(l + (c - l) * t);
|
|
17
17
|
}
|
|
18
18
|
return n;
|
|
19
|
-
},
|
|
20
|
-
var
|
|
21
|
-
class
|
|
19
|
+
}, Xe = (s, e, t) => new Date(s.getTime() + (e.getTime() - s.getTime()) * t), Ye = (s, e) => e, Qe = (s) => typeof s == "number" ? Je : typeof s == "string" ? Ge : s instanceof Date ? Xe : Ye;
|
|
20
|
+
var M;
|
|
21
|
+
class ce {
|
|
22
22
|
/**
|
|
23
23
|
* Creates a new instance of `ElementPosition`.
|
|
24
24
|
* @param index - The index of the element.
|
|
@@ -44,10 +44,10 @@ class ee {
|
|
|
44
44
|
* @returns `true` if the counter is odd, `false` otherwise.
|
|
45
45
|
*/
|
|
46
46
|
o(this, "isOdd");
|
|
47
|
-
|
|
47
|
+
ye(this, M);
|
|
48
48
|
o(this, "dispose", () => {
|
|
49
49
|
var e;
|
|
50
|
-
(e =
|
|
50
|
+
(e = U(this, M)) == null || e.dispose(), le(this, M, 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 ee {
|
|
|
56
56
|
* @returns `true` if the element is the last element, `false` otherwise.
|
|
57
57
|
*/
|
|
58
58
|
get isLast() {
|
|
59
|
-
return
|
|
59
|
+
return U(this, M) == null && le(this, M, this.total.map((e) => this.counter === e)), U(this, M);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
const
|
|
62
|
+
M = new WeakMap();
|
|
63
|
+
const B = class B {
|
|
64
64
|
/**
|
|
65
65
|
* Represents a signal with a value of type T.
|
|
66
66
|
*
|
|
@@ -203,7 +203,7 @@ const I = class I {
|
|
|
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 N(() => {
|
|
207
207
|
try {
|
|
208
208
|
return e(this.get());
|
|
209
209
|
} catch (n) {
|
|
@@ -223,7 +223,7 @@ const I = class I {
|
|
|
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 N(() => {
|
|
227
227
|
try {
|
|
228
228
|
return e(this.get()).get();
|
|
229
229
|
} catch (n) {
|
|
@@ -252,7 +252,7 @@ const I = class I {
|
|
|
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 N(() => {
|
|
256
256
|
try {
|
|
257
257
|
const i = this.get();
|
|
258
258
|
return r = e(i) ? i : r;
|
|
@@ -274,7 +274,7 @@ const I = class I {
|
|
|
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 N(() => {
|
|
278
278
|
try {
|
|
279
279
|
const l = this.get(), c = e(l);
|
|
280
280
|
return n = c ?? n;
|
|
@@ -298,17 +298,17 @@ const I = class I {
|
|
|
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 = w(t, n);
|
|
302
302
|
let l = 0, c = new AbortController();
|
|
303
303
|
return i.onDispose(
|
|
304
|
-
this.on(async (
|
|
305
|
-
const
|
|
304
|
+
this.on(async (a) => {
|
|
305
|
+
const u = ++l;
|
|
306
306
|
c.abort(), c = new AbortController();
|
|
307
307
|
try {
|
|
308
|
-
const h = await e(
|
|
309
|
-
|
|
308
|
+
const h = await e(a, { abortSignal: c.signal });
|
|
309
|
+
u === l && i.set(h);
|
|
310
310
|
} catch (h) {
|
|
311
|
-
if (
|
|
311
|
+
if (u === l)
|
|
312
312
|
if (r != null)
|
|
313
313
|
i.set(r(h));
|
|
314
314
|
else
|
|
@@ -348,7 +348,7 @@ const I = class I {
|
|
|
348
348
|
o(this, "deriveProp", ({
|
|
349
349
|
autoDisposeProp: e = !0,
|
|
350
350
|
equals: t
|
|
351
|
-
} = {}) => this.feedProp(
|
|
351
|
+
} = {}) => this.feedProp(w(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 I = class I {
|
|
|
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(B, "ofPromise", (e, t, r, n = (i, l) => i === l) => {
|
|
440
|
+
const i = new B(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(I, "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(B, "is", (e) => (
|
|
454
454
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
455
455
|
e != null && e.$__signal__ === !0
|
|
456
456
|
));
|
|
457
|
-
let
|
|
458
|
-
const
|
|
459
|
-
class
|
|
457
|
+
let y = B;
|
|
458
|
+
const Ze = typeof queueMicrotask == "function" ? queueMicrotask : (s) => Promise.resolve().then(s);
|
|
459
|
+
class N extends y {
|
|
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 M extends g {
|
|
|
491
491
|
*/
|
|
492
492
|
o(this, "_scheduleNotify", () => {
|
|
493
493
|
const t = ++this._scheduleCount;
|
|
494
|
-
|
|
494
|
+
Ze(() => {
|
|
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 M extends g {
|
|
|
513
513
|
return this.get();
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
const
|
|
516
|
+
const ee = class ee extends y {
|
|
517
517
|
constructor() {
|
|
518
518
|
super(...arguments);
|
|
519
519
|
/**
|
|
@@ -545,8 +545,8 @@ const Y = class Y extends g {
|
|
|
545
545
|
const n = this;
|
|
546
546
|
return function i(l) {
|
|
547
547
|
const c = n.value;
|
|
548
|
-
n.update((
|
|
549
|
-
(
|
|
548
|
+
n.update((a) => t(a, l)), !n.equals(c, n.value) && r.forEach(
|
|
549
|
+
(a) => a({
|
|
550
550
|
previousState: c,
|
|
551
551
|
state: n.value,
|
|
552
552
|
action: l,
|
|
@@ -567,7 +567,7 @@ const Y = class Y extends g {
|
|
|
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 ee(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 Y = class Y extends g {
|
|
|
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(ee, "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 G = ee;
|
|
604
|
+
const ae = (s, e, t = (r, n) => r === n) => {
|
|
605
|
+
const r = new N(s, t);
|
|
606
606
|
return e.forEach((n) => n.setDerivative(r)), r;
|
|
607
|
-
},
|
|
607
|
+
}, ze = (s, e, t = {}) => {
|
|
608
608
|
let r = t.once ? () => {
|
|
609
609
|
i(), s();
|
|
610
610
|
} : s;
|
|
@@ -615,27 +615,27 @@ const te = (s, e, t = (r, n) => r === n) => {
|
|
|
615
615
|
l ? c() : l = !0;
|
|
616
616
|
};
|
|
617
617
|
}
|
|
618
|
-
const n =
|
|
618
|
+
const n = ae(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
|
+
}, w = (s, e = (t, r) => t === r) => new G(s, e), te = (s, e = (t, r) => t === r) => new y(s, e), ue = () => (
|
|
623
623
|
/* c8 ignore next */
|
|
624
624
|
typeof window < "u" ? window : void 0
|
|
625
625
|
);
|
|
626
|
-
function
|
|
626
|
+
function Se(s) {
|
|
627
627
|
return s != null && s !== !1 && s !== 0 && s !== "";
|
|
628
628
|
}
|
|
629
|
-
function
|
|
630
|
-
return !
|
|
629
|
+
function Ke(s) {
|
|
630
|
+
return !Se(s);
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function et(s) {
|
|
633
633
|
return s == null;
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function tt(s) {
|
|
636
636
|
return s != null;
|
|
637
637
|
}
|
|
638
|
-
const
|
|
638
|
+
const b = {
|
|
639
639
|
/**
|
|
640
640
|
* Maps a value or a Signal to a new value.
|
|
641
641
|
* If the value is a Signal, it returns a new Signal with the mapped value.
|
|
@@ -647,7 +647,7 @@ const y = {
|
|
|
647
647
|
* @param fn - The function to map the value.
|
|
648
648
|
* @returns The mapped value.
|
|
649
649
|
*/
|
|
650
|
-
map: (s, e) =>
|
|
650
|
+
map: (s, e) => y.is(s) ? s.map(e) : e(s),
|
|
651
651
|
/**
|
|
652
652
|
* Wraps a value or a Signal instance into a Signal.
|
|
653
653
|
* If the value is already a Signal, it returns the value itself.
|
|
@@ -658,7 +658,7 @@ const y = {
|
|
|
658
658
|
* @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
|
|
659
659
|
* @returns A Signal instance.
|
|
660
660
|
*/
|
|
661
|
-
toSignal: (s, e) =>
|
|
661
|
+
toSignal: (s, e) => y.is(s) ? s : te(s, e),
|
|
662
662
|
/**
|
|
663
663
|
* Wraps a value in a `Signal` if it is not already a `Signal`.
|
|
664
664
|
* If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
|
|
@@ -667,21 +667,21 @@ const y = {
|
|
|
667
667
|
*/
|
|
668
668
|
maybeToSignal: (s, e) => {
|
|
669
669
|
if (s != null)
|
|
670
|
-
return
|
|
670
|
+
return b.toSignal(s, e);
|
|
671
671
|
},
|
|
672
672
|
/**
|
|
673
673
|
* Gets the value from a `Signal` or the value itself if it is not a `Signal`.
|
|
674
674
|
* @param value - The value or Signal instance to get the value from.
|
|
675
675
|
* @returns The value.
|
|
676
676
|
*/
|
|
677
|
-
get: (s) =>
|
|
677
|
+
get: (s) => y.is(s) ? s.get() : s,
|
|
678
678
|
/**
|
|
679
679
|
* Adds a listener to a `Signal` or calls the listener immediately if it is not a `Signal`.
|
|
680
680
|
* @param value - The value or Signal instance to add the listener to.
|
|
681
681
|
* @param listener - The listener to call when the value changes.
|
|
682
682
|
* @returns A function to remove the listener.
|
|
683
683
|
*/
|
|
684
|
-
on: (s, e) =>
|
|
684
|
+
on: (s, e) => y.is(s) ? s.on(e) : (e(s), () => {
|
|
685
685
|
}),
|
|
686
686
|
/**
|
|
687
687
|
* Disposes of a value or a Signal.
|
|
@@ -690,7 +690,7 @@ const y = {
|
|
|
690
690
|
* @param value - The value or Signal instance to dispose of.
|
|
691
691
|
*/
|
|
692
692
|
dispose: (s) => {
|
|
693
|
-
|
|
693
|
+
y.is(s) && s.dispose();
|
|
694
694
|
},
|
|
695
695
|
/**
|
|
696
696
|
* Derives a Prop from a Signal.
|
|
@@ -705,54 +705,54 @@ const y = {
|
|
|
705
705
|
deriveProp: (s, {
|
|
706
706
|
autoDisposeProp: e = !0,
|
|
707
707
|
equals: t
|
|
708
|
-
} = {}) =>
|
|
708
|
+
} = {}) => y.is(s) ? s.deriveProp({ autoDisposeProp: e, equals: t }) : w(s, t),
|
|
709
709
|
/**
|
|
710
710
|
* Creates a new signal that emits `true` if the value is truthy, `false` otherwise.
|
|
711
711
|
* @param value - The value or signal to check.
|
|
712
712
|
* @returns A signal that emits `true` if the value is truthy, `false` otherwise.
|
|
713
713
|
*/
|
|
714
|
-
truthy: (s) =>
|
|
714
|
+
truthy: (s) => b.map(s, Se),
|
|
715
715
|
/**
|
|
716
716
|
* Creates a new signal that emits `true` if the value is falsy, `false` otherwise.
|
|
717
717
|
* @param value - The value or signal to check.
|
|
718
718
|
* @returns A signal that emits `true` if the value is falsy, `false` otherwise.
|
|
719
719
|
*/
|
|
720
|
-
falsy: (s) =>
|
|
720
|
+
falsy: (s) => b.map(s, Ke),
|
|
721
721
|
/**
|
|
722
722
|
* Creates a new signal that emits `true` if the value is null or undefined, `false` otherwise.
|
|
723
723
|
* @param value - The value or signal to check.
|
|
724
724
|
* @returns A signal that emits `true` if the value is null or undefined, `false` otherwise.
|
|
725
725
|
*/
|
|
726
|
-
nil: (s) =>
|
|
726
|
+
nil: (s) => b.map(s, et),
|
|
727
727
|
/**
|
|
728
728
|
* Creates a new signal that emits `true` if the value is not null or undefined, `false` otherwise.
|
|
729
729
|
* @param value - The value or signal to check.
|
|
730
730
|
* @returns A signal that emits `true` if the value is not null or undefined, `false` otherwise.
|
|
731
731
|
*/
|
|
732
|
-
defined: (s) =>
|
|
733
|
-
},
|
|
732
|
+
defined: (s) => b.map(s, tt)
|
|
733
|
+
}, he = (...s) => (e, t) => {
|
|
734
734
|
if (s.length === 1)
|
|
735
|
-
return
|
|
736
|
-
const r = s.filter((n) =>
|
|
737
|
-
return
|
|
738
|
-
() => e(...s.map((n) =>
|
|
735
|
+
return b.toSignal(s[0]).map(e);
|
|
736
|
+
const r = s.filter((n) => y.is(n));
|
|
737
|
+
return ae(
|
|
738
|
+
() => e(...s.map((n) => b.get(n))),
|
|
739
739
|
r,
|
|
740
740
|
t
|
|
741
741
|
);
|
|
742
|
-
},
|
|
742
|
+
}, Jt = (s) => {
|
|
743
743
|
const e = Object.keys(s);
|
|
744
|
-
return
|
|
744
|
+
return he(...Object.values(s))(
|
|
745
745
|
(...t) => Object.fromEntries(e.map((r, n) => [r, t[n]]))
|
|
746
746
|
);
|
|
747
|
-
},
|
|
748
|
-
const r = s.filter((n) =>
|
|
749
|
-
return
|
|
750
|
-
() => e(...s.map(
|
|
747
|
+
}, Gt = (...s) => (e, t = {}) => {
|
|
748
|
+
const r = s.filter((n) => y.is(n));
|
|
749
|
+
return ze(
|
|
750
|
+
() => e(...s.map(b.get)),
|
|
751
751
|
r,
|
|
752
752
|
t
|
|
753
753
|
);
|
|
754
754
|
};
|
|
755
|
-
class
|
|
755
|
+
class ve {
|
|
756
756
|
constructor() {
|
|
757
757
|
o(this, "_store", /* @__PURE__ */ new Map());
|
|
758
758
|
/**
|
|
@@ -771,102 +771,131 @@ class pe {
|
|
|
771
771
|
});
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
|
-
const
|
|
774
|
+
const Ae = ({
|
|
775
775
|
key: s,
|
|
776
776
|
defaultValue: e,
|
|
777
777
|
store: t,
|
|
778
778
|
serialize: r = JSON.stringify,
|
|
779
779
|
deserialize: n = JSON.parse,
|
|
780
|
-
equals: i = (u,
|
|
780
|
+
equals: i = (u, h) => u === h,
|
|
781
781
|
onLoad: l = (u) => u,
|
|
782
|
-
syncTabs: c = !0
|
|
782
|
+
syncTabs: c = !0,
|
|
783
|
+
onKeyChange: a = "load"
|
|
783
784
|
}) => {
|
|
784
|
-
|
|
785
|
-
|
|
785
|
+
let u = b.get(s);
|
|
786
|
+
const h = t.getItem(u), d = new G(
|
|
787
|
+
h != null ? l(n(h)) : typeof e == "function" ? e() : e,
|
|
786
788
|
i
|
|
787
|
-
),
|
|
788
|
-
let
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
const
|
|
792
|
-
const
|
|
793
|
-
if (!(
|
|
789
|
+
), p = ue(), m = c && typeof (p == null ? void 0 : p.BroadcastChannel) == "function";
|
|
790
|
+
let g = !1, S = null, P = null;
|
|
791
|
+
const A = (T) => {
|
|
792
|
+
if (!m) return null;
|
|
793
|
+
const H = `tempo:storedProp:${T}`, v = new p.BroadcastChannel(H), k = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`, O = (W) => {
|
|
794
|
+
const E = W.data;
|
|
795
|
+
if (!(E == null || typeof E != "object" || E.key !== T || typeof E.value != "string" || E.sourceId != null && E.sourceId === k))
|
|
794
796
|
try {
|
|
795
|
-
|
|
796
|
-
const
|
|
797
|
-
|
|
798
|
-
} catch (
|
|
797
|
+
g = !0;
|
|
798
|
+
const oe = l(n(E.value));
|
|
799
|
+
d.set(oe);
|
|
800
|
+
} catch (oe) {
|
|
799
801
|
console.warn(
|
|
800
|
-
`Failed to sync storedProp for key "${
|
|
801
|
-
|
|
802
|
+
`Failed to sync storedProp for key "${T}" via BroadcastChannel`,
|
|
803
|
+
oe
|
|
802
804
|
);
|
|
803
805
|
} finally {
|
|
804
|
-
|
|
806
|
+
g = !1;
|
|
805
807
|
}
|
|
806
808
|
};
|
|
807
|
-
|
|
808
|
-
|
|
809
|
+
return v.addEventListener("message", O), d.onDispose(() => {
|
|
810
|
+
v == null || v.removeEventListener("message", O), v == null || v.close();
|
|
811
|
+
}), { channel: v, instanceId: k, handleMessage: O };
|
|
812
|
+
}, L = A(u);
|
|
813
|
+
L && (S = L.channel, P = L.instanceId);
|
|
814
|
+
const ie = (T) => {
|
|
815
|
+
const H = u;
|
|
816
|
+
if (H === T) return;
|
|
817
|
+
const v = d.get(), k = r(v);
|
|
818
|
+
if (t.setItem(H, k), S != null && (S.close(), S = null, P = null), u = T, a === "load") {
|
|
819
|
+
const W = t.getItem(T);
|
|
820
|
+
if (W != null)
|
|
821
|
+
try {
|
|
822
|
+
const E = l(n(W));
|
|
823
|
+
d.set(E);
|
|
824
|
+
} catch (E) {
|
|
825
|
+
console.warn(
|
|
826
|
+
`Failed to load storedProp from new key "${T}"`,
|
|
827
|
+
E
|
|
828
|
+
);
|
|
829
|
+
}
|
|
830
|
+
else
|
|
831
|
+
t.setItem(T, k);
|
|
832
|
+
} else a === "migrate" && t.setItem(T, k);
|
|
833
|
+
const O = A(T);
|
|
834
|
+
O && (S = O.channel, P = O.instanceId);
|
|
835
|
+
};
|
|
836
|
+
return y.is(s) && d.onDispose(s.on(ie)), d.on((T, H) => {
|
|
837
|
+
const v = r(T);
|
|
838
|
+
t.setItem(u, v), S != null && !g && H !== void 0 && P != null && S.postMessage({
|
|
839
|
+
key: u,
|
|
840
|
+
value: v,
|
|
841
|
+
sourceId: P
|
|
809
842
|
});
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
const b = r(P);
|
|
813
|
-
t.setItem(s, b), d != null && !p && S !== void 0 && A != null && d.postMessage({ key: s, value: b, sourceId: A });
|
|
814
|
-
}), a;
|
|
815
|
-
}, kt = (s) => {
|
|
843
|
+
}), d;
|
|
844
|
+
}, Xt = (s) => {
|
|
816
845
|
var e;
|
|
817
|
-
return
|
|
846
|
+
return Ae({
|
|
818
847
|
...s,
|
|
819
848
|
/* c8 ignore next 3 */
|
|
820
|
-
store: ((e =
|
|
849
|
+
store: ((e = ue()) == null ? void 0 : e.localStorage) ?? new ve()
|
|
821
850
|
});
|
|
822
|
-
},
|
|
851
|
+
}, Yt = (s) => {
|
|
823
852
|
var e;
|
|
824
|
-
return
|
|
853
|
+
return Ae({
|
|
825
854
|
...s,
|
|
826
855
|
/* c8 ignore next 3 */
|
|
827
|
-
store: ((e =
|
|
856
|
+
store: ((e = ue()) == null ? void 0 : e.sessionStorage) ?? new ve()
|
|
828
857
|
});
|
|
829
858
|
};
|
|
830
|
-
function
|
|
859
|
+
function be(s) {
|
|
831
860
|
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(s) : setTimeout(s, 0);
|
|
832
861
|
}
|
|
833
|
-
const
|
|
834
|
-
const n = (r == null ? void 0 : r.duration) ?? 300, i = (r == null ? void 0 : r.easing) ?? ((
|
|
835
|
-
let c = r == null ? void 0 : r.interpolate,
|
|
836
|
-
const
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
}),
|
|
840
|
-
|
|
862
|
+
const st = (s, e, t, r) => {
|
|
863
|
+
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, L) => A === L);
|
|
864
|
+
let c = r == null ? void 0 : r.interpolate, a = s, u = e(), h = performance.now(), d = null, p = !0;
|
|
865
|
+
const m = new N(e, l), g = w(s, l);
|
|
866
|
+
g.onDispose(() => {
|
|
867
|
+
d !== null && cancelAnimationFrame(d);
|
|
868
|
+
}), g.onDispose(m.dispose), t.forEach((A) => {
|
|
869
|
+
A.setDerivative(m), A.onDispose(g.dispose);
|
|
841
870
|
});
|
|
842
|
-
const
|
|
843
|
-
|
|
871
|
+
const S = (A) => {
|
|
872
|
+
u = A, h = performance.now(), a = g.value, p && (p = !1, d = be(P));
|
|
844
873
|
}, P = () => {
|
|
845
|
-
const
|
|
846
|
-
c == null && (c =
|
|
847
|
-
let
|
|
848
|
-
|
|
874
|
+
const L = (performance.now() - h) / b.get(n), ie = i(L);
|
|
875
|
+
c == null && (c = Qe(a));
|
|
876
|
+
let T = c(a, u, ie);
|
|
877
|
+
L >= 1 ? (p = !0, T = u) : d = be(P), g.set(T);
|
|
849
878
|
};
|
|
850
|
-
return
|
|
851
|
-
},
|
|
879
|
+
return m.on(S), g;
|
|
880
|
+
}, Qt = (s, e) => {
|
|
852
881
|
const { initialValue: t, ...r } = e ?? {};
|
|
853
|
-
return
|
|
882
|
+
return st(
|
|
854
883
|
/* c8 ignore next 2 */
|
|
855
884
|
t ?? s.get(),
|
|
856
885
|
s.get,
|
|
857
886
|
[s],
|
|
858
887
|
r
|
|
859
888
|
);
|
|
860
|
-
},
|
|
861
|
-
const t = Object.values(s).filter(
|
|
862
|
-
return
|
|
889
|
+
}, rt = (s, e) => {
|
|
890
|
+
const t = Object.values(s).filter(y.is), r = Object.keys(s);
|
|
891
|
+
return ae(() => {
|
|
863
892
|
const n = {};
|
|
864
893
|
for (const i of r)
|
|
865
|
-
n[i] =
|
|
894
|
+
n[i] = b.get(s[i]);
|
|
866
895
|
return e(n);
|
|
867
896
|
}, t);
|
|
868
|
-
},
|
|
869
|
-
const t =
|
|
897
|
+
}, Zt = (s) => rt(s, (e) => e), zt = (s, e) => {
|
|
898
|
+
const t = w(s.get());
|
|
870
899
|
let r = null;
|
|
871
900
|
const n = s.on((i) => {
|
|
872
901
|
r != null && clearTimeout(r), r = setTimeout(
|
|
@@ -879,33 +908,33 @@ const Ye = (s, e, t, r) => {
|
|
|
879
908
|
return t.onDispose(() => {
|
|
880
909
|
n(), r != null && clearTimeout(r);
|
|
881
910
|
}), t;
|
|
882
|
-
},
|
|
911
|
+
}, Kt = (s) => {
|
|
883
912
|
let e;
|
|
884
913
|
return s.map((t) => {
|
|
885
914
|
const r = e;
|
|
886
915
|
return e = t, r;
|
|
887
916
|
});
|
|
888
|
-
},
|
|
917
|
+
}, es = ({
|
|
889
918
|
size: s = void 0,
|
|
890
919
|
signal: e
|
|
891
920
|
}) => {
|
|
892
921
|
const t = [];
|
|
893
922
|
return e.map((r) => (t.push(r), s != null && t.length > s && t.shift(), t.slice()));
|
|
894
|
-
},
|
|
923
|
+
}, ts = (s) => (...e) => he(
|
|
895
924
|
s,
|
|
896
925
|
...e
|
|
897
926
|
)((t, ...r) => t(...r));
|
|
898
|
-
function
|
|
899
|
-
return
|
|
927
|
+
function ss(...s) {
|
|
928
|
+
return he(...s)((...e) => {
|
|
900
929
|
for (const t of e) if (t != null) return t;
|
|
901
930
|
});
|
|
902
931
|
}
|
|
903
|
-
const
|
|
932
|
+
const _e = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), Ee = /* @__PURE__ */ new Set(["selected"]), Ce = /* @__PURE__ */ new Set([
|
|
904
933
|
"rowSpan",
|
|
905
934
|
"colSpan",
|
|
906
935
|
"tabIndex",
|
|
907
936
|
"valueAsNumber"
|
|
908
|
-
]),
|
|
937
|
+
]), we = /* @__PURE__ */ new Set(["valueAsDate"]), xe = /* @__PURE__ */ new Set([
|
|
909
938
|
"value",
|
|
910
939
|
"textContent",
|
|
911
940
|
"innerText",
|
|
@@ -913,28 +942,28 @@ const me = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), ye = /* @
|
|
|
913
942
|
"outerHTML",
|
|
914
943
|
"className",
|
|
915
944
|
"classList"
|
|
916
|
-
]),
|
|
945
|
+
]), nt = (s, e) => Ee.has(s) ? (t) => {
|
|
917
946
|
t == null || t !== !0 ? e.removeAttribute(s) : e.setAttribute(s, "");
|
|
918
|
-
} :
|
|
947
|
+
} : _e.has(s) ? (t) => {
|
|
919
948
|
t == null ? e[s] = null : e[s] = !!t;
|
|
920
|
-
} :
|
|
949
|
+
} : Ce.has(s) ? (t) => {
|
|
921
950
|
t == null ? e[s] = null : e[s] = Number(t);
|
|
922
|
-
} :
|
|
951
|
+
} : we.has(s) ? (t) => {
|
|
923
952
|
t == null ? e[s] = null : e[s] = t;
|
|
924
|
-
} :
|
|
953
|
+
} : xe.has(s) ? (t) => {
|
|
925
954
|
t == null ? e[s] = null : e[s] = String(t);
|
|
926
955
|
} : (t) => {
|
|
927
956
|
t == null ? e.removeAttribute(s) : e.setAttribute(s, t);
|
|
928
|
-
},
|
|
957
|
+
}, it = (s, e) => Ee.has(s) ? () => e.hasAttribute(s) : _e.has(s) ? () => !!e[s] : Ce.has(s) ? () => Number(e[s]) : we.has(s) ? () => e[s] : xe.has(s) ? () => String(e[s]) : () => e.getAttribute(s), X = (s) => {
|
|
929
958
|
const e = s;
|
|
930
959
|
e && e.onblur && (e.onblur = null), !(!s || s.ownerDocument === void 0) && s.parentElement && s.parentElement.removeChild(s);
|
|
931
|
-
},
|
|
932
|
-
class
|
|
960
|
+
}, ot = (s) => Pe(s) ? s : s.parentElement, Pe = (s) => s.nodeType === 1;
|
|
961
|
+
class Le extends Error {
|
|
933
962
|
constructor(e) {
|
|
934
963
|
super(`Provider not found: ${e.description}`);
|
|
935
964
|
}
|
|
936
965
|
}
|
|
937
|
-
class
|
|
966
|
+
class R {
|
|
938
967
|
/**
|
|
939
968
|
* Constructs a new `DOMContext` instance.
|
|
940
969
|
*
|
|
@@ -1031,7 +1060,7 @@ class O {
|
|
|
1031
1060
|
* @param element - The DOM element to use in the new `DOMContext` instance.
|
|
1032
1061
|
* @returns A new `DOMContext` instance with the provided `element`.
|
|
1033
1062
|
*/
|
|
1034
|
-
o(this, "withElement", (e) => new
|
|
1063
|
+
o(this, "withElement", (e) => new R(this.document, e, void 0, this.providers));
|
|
1035
1064
|
/**
|
|
1036
1065
|
* Creates a portal to render content in a different part of the DOM tree.
|
|
1037
1066
|
*
|
|
@@ -1088,7 +1117,7 @@ class O {
|
|
|
1088
1117
|
* @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
|
|
1089
1118
|
* @returns A new `DOMContext` instance with the specified reference.
|
|
1090
1119
|
*/
|
|
1091
|
-
o(this, "withReference", (e) => new
|
|
1120
|
+
o(this, "withReference", (e) => new R(this.document, this.element, e, this.providers));
|
|
1092
1121
|
/**
|
|
1093
1122
|
* Sets a provider for the given provider mark.
|
|
1094
1123
|
*
|
|
@@ -1096,7 +1125,7 @@ class O {
|
|
|
1096
1125
|
* @param value - The provider to set for the given mark.
|
|
1097
1126
|
* @returns A new `DOMContext` instance with the specified provider.
|
|
1098
1127
|
*/
|
|
1099
|
-
o(this, "setProvider", (e, t, r) => new
|
|
1128
|
+
o(this, "setProvider", (e, t, r) => new R(this.document, this.element, this.reference, {
|
|
1100
1129
|
...this.providers,
|
|
1101
1130
|
[e]: [t, r]
|
|
1102
1131
|
}));
|
|
@@ -1109,12 +1138,12 @@ class O {
|
|
|
1109
1138
|
*/
|
|
1110
1139
|
o(this, "getProvider", (e) => {
|
|
1111
1140
|
if (this.providers[e] === void 0)
|
|
1112
|
-
throw new
|
|
1141
|
+
throw new Le(e);
|
|
1113
1142
|
const [t, r] = this.providers[e];
|
|
1114
1143
|
return { value: t, onUse: r };
|
|
1115
1144
|
});
|
|
1116
1145
|
o(this, "clear", (e) => {
|
|
1117
|
-
e && (this.reference !== void 0 ?
|
|
1146
|
+
e && (this.reference !== void 0 ? X(this.reference) : X(this.element));
|
|
1118
1147
|
});
|
|
1119
1148
|
/**
|
|
1120
1149
|
* Adds classes to the element.
|
|
@@ -1184,8 +1213,8 @@ class O {
|
|
|
1184
1213
|
*/
|
|
1185
1214
|
o(this, "getStyle", (e) => this.element.style[e]);
|
|
1186
1215
|
o(this, "makeAccessors", (e) => ({
|
|
1187
|
-
get:
|
|
1188
|
-
set:
|
|
1216
|
+
get: it(e, this.element),
|
|
1217
|
+
set: nt(e, this.element)
|
|
1189
1218
|
}));
|
|
1190
1219
|
o(this, "getWindow", () => this.document.defaultView);
|
|
1191
1220
|
this.document = e, this.element = t, this.reference = r, this.providers = n;
|
|
@@ -1199,54 +1228,54 @@ class O {
|
|
|
1199
1228
|
* @returns A new `DOMContext` instance.
|
|
1200
1229
|
*/
|
|
1201
1230
|
static of(e, t, r) {
|
|
1202
|
-
return new
|
|
1231
|
+
return new R(e.ownerDocument, e, t, r);
|
|
1203
1232
|
}
|
|
1204
1233
|
}
|
|
1205
|
-
const
|
|
1234
|
+
const lt = (s) => Symbol(s), fe = (s, e) => {
|
|
1206
1235
|
const t = s(e);
|
|
1207
1236
|
return (r = !0) => t(r);
|
|
1208
|
-
},
|
|
1237
|
+
}, rs = (s, e, { doc: t, clear: r, disposeWithParent: n = !0, providers: i = {} } = {}) => {
|
|
1209
1238
|
const l = typeof e == "string" ? (t ?? document).querySelector(e) : e;
|
|
1210
1239
|
if (l === null)
|
|
1211
|
-
throw new
|
|
1240
|
+
throw new ct(
|
|
1212
1241
|
`Cannot find element by selector for render: ${e}`
|
|
1213
1242
|
);
|
|
1214
1243
|
r !== !1 && (t ?? l.ownerDocument) != null && l.nodeType === 1 && (l.innerHTML = "");
|
|
1215
|
-
const c =
|
|
1216
|
-
let
|
|
1217
|
-
return n && (
|
|
1218
|
-
var
|
|
1219
|
-
(
|
|
1220
|
-
|
|
1244
|
+
const c = ot(l), a = Pe(l) ? void 0 : l, u = R.of(c, a, i), h = fe(s, u);
|
|
1245
|
+
let d;
|
|
1246
|
+
return n && (d = new MutationObserver((p) => {
|
|
1247
|
+
var m;
|
|
1248
|
+
(m = p[0]) == null || m.removedNodes.forEach((g) => {
|
|
1249
|
+
g === l && (d == null || d.disconnect(), h(l.nodeType !== 1));
|
|
1221
1250
|
});
|
|
1222
|
-
}),
|
|
1251
|
+
}), d.observe(l.parentElement, {
|
|
1223
1252
|
childList: !0,
|
|
1224
1253
|
subtree: !1,
|
|
1225
1254
|
attributes: !1
|
|
1226
1255
|
})), () => {
|
|
1227
|
-
|
|
1256
|
+
d == null || d.disconnect(), h(!0);
|
|
1228
1257
|
};
|
|
1229
|
-
},
|
|
1258
|
+
}, ns = (s, {
|
|
1230
1259
|
startUrl: e = "https://example.com",
|
|
1231
1260
|
selector: t,
|
|
1232
1261
|
providers: r = {}
|
|
1233
1262
|
} = {
|
|
1234
1263
|
selector: "body"
|
|
1235
1264
|
}) => {
|
|
1236
|
-
const n =
|
|
1265
|
+
const n = b.toSignal(e).deriveProp(), i = new He(t, void 0), l = new V(i, void 0, { currentURL: n }, r);
|
|
1237
1266
|
return {
|
|
1238
|
-
clear:
|
|
1267
|
+
clear: fe(s(), l),
|
|
1239
1268
|
root: i,
|
|
1240
1269
|
currentURL: n
|
|
1241
1270
|
};
|
|
1242
1271
|
};
|
|
1243
|
-
class
|
|
1272
|
+
class ct extends Error {
|
|
1244
1273
|
constructor(e) {
|
|
1245
1274
|
super(e);
|
|
1246
1275
|
}
|
|
1247
1276
|
}
|
|
1248
|
-
const
|
|
1249
|
-
class
|
|
1277
|
+
const De = "data-tts-node", Y = "data-tts-class", Q = "data-tts-style", Z = "data-tts-html", z = "data-tts-text", K = "data-tts-attrs";
|
|
1278
|
+
class is {
|
|
1250
1279
|
constructor({
|
|
1251
1280
|
select: e,
|
|
1252
1281
|
getAttribute: t,
|
|
@@ -1255,11 +1284,11 @@ class Gt {
|
|
|
1255
1284
|
setClass: i,
|
|
1256
1285
|
getStyles: l,
|
|
1257
1286
|
setStyles: c,
|
|
1258
|
-
appendHTML:
|
|
1259
|
-
getInnerHTML:
|
|
1287
|
+
appendHTML: a,
|
|
1288
|
+
getInnerHTML: u,
|
|
1260
1289
|
setInnerHTML: h,
|
|
1261
|
-
getInnerText:
|
|
1262
|
-
setInnerText:
|
|
1290
|
+
getInnerText: d,
|
|
1291
|
+
setInnerText: p
|
|
1263
1292
|
}) {
|
|
1264
1293
|
/**
|
|
1265
1294
|
* Selects elements from the headless environment.
|
|
@@ -1353,21 +1382,21 @@ class Gt {
|
|
|
1353
1382
|
if (n.hasChildren() && this.appendHTML(l, n.contentToHTML(t)), n.hasInnerHTML()) {
|
|
1354
1383
|
if (t) {
|
|
1355
1384
|
const c = this.getInnerHTML(l);
|
|
1356
|
-
c != null && this.setAttribute(l,
|
|
1385
|
+
c != null && this.setAttribute(l, Z, c);
|
|
1357
1386
|
}
|
|
1358
1387
|
this.setInnerHTML(l, n.getInnerHTML());
|
|
1359
1388
|
}
|
|
1360
1389
|
if (n.hasInnerText()) {
|
|
1361
1390
|
if (t) {
|
|
1362
1391
|
const c = this.getInnerText(l);
|
|
1363
|
-
c != null && this.setAttribute(l,
|
|
1392
|
+
c != null && this.setAttribute(l, z, c);
|
|
1364
1393
|
}
|
|
1365
1394
|
this.setInnerText(l, n.getInnerText());
|
|
1366
1395
|
}
|
|
1367
1396
|
if (n.hasClasses()) {
|
|
1368
1397
|
if (t) {
|
|
1369
1398
|
const c = this.getClass(l);
|
|
1370
|
-
c != null && this.setAttribute(l,
|
|
1399
|
+
c != null && this.setAttribute(l, Y, c);
|
|
1371
1400
|
}
|
|
1372
1401
|
this.setClass(l, n.getClasses().join(" "));
|
|
1373
1402
|
}
|
|
@@ -1376,7 +1405,7 @@ class Gt {
|
|
|
1376
1405
|
const c = this.getStyles(l);
|
|
1377
1406
|
Object.keys(c).length > 0 && this.setAttribute(
|
|
1378
1407
|
l,
|
|
1379
|
-
|
|
1408
|
+
Q,
|
|
1380
1409
|
JSON.stringify(c)
|
|
1381
1410
|
);
|
|
1382
1411
|
}
|
|
@@ -1385,74 +1414,74 @@ class Gt {
|
|
|
1385
1414
|
if (n.hasAttributes()) {
|
|
1386
1415
|
const c = n.getAttributes();
|
|
1387
1416
|
if (t) {
|
|
1388
|
-
const
|
|
1389
|
-
c.forEach(([
|
|
1390
|
-
const h = this.getAttribute(l,
|
|
1391
|
-
h != null &&
|
|
1392
|
-
}),
|
|
1417
|
+
const a = [];
|
|
1418
|
+
c.forEach(([u]) => {
|
|
1419
|
+
const h = this.getAttribute(l, u);
|
|
1420
|
+
h != null && a.push([u, h]);
|
|
1421
|
+
}), a.length > 0 && this.setAttribute(
|
|
1393
1422
|
l,
|
|
1394
|
-
|
|
1395
|
-
JSON.stringify(Object.fromEntries(
|
|
1423
|
+
K,
|
|
1424
|
+
JSON.stringify(Object.fromEntries(a))
|
|
1396
1425
|
);
|
|
1397
1426
|
}
|
|
1398
|
-
c.forEach(([
|
|
1399
|
-
this.setAttribute(l,
|
|
1427
|
+
c.forEach(([a, u]) => {
|
|
1428
|
+
this.setAttribute(l, a, u);
|
|
1400
1429
|
});
|
|
1401
1430
|
}
|
|
1402
1431
|
}
|
|
1403
1432
|
});
|
|
1404
1433
|
});
|
|
1405
|
-
this.select = e, this.getAttribute = t, this.setAttribute = r, this.getClass = n, this.setClass = i, this.getStyles = l, this.setStyles = c, this.appendHTML =
|
|
1434
|
+
this.select = e, this.getAttribute = t, this.setAttribute = r, this.getClass = n, this.setClass = i, this.getStyles = l, this.setStyles = c, this.appendHTML = a, this.getInnerHTML = u, this.setInnerHTML = h, this.getInnerText = d, this.setInnerText = p;
|
|
1406
1435
|
}
|
|
1407
1436
|
}
|
|
1408
|
-
const
|
|
1409
|
-
document.querySelectorAll(`[${
|
|
1410
|
-
},
|
|
1411
|
-
const e = s.getAttribute(
|
|
1412
|
-
s.removeAttribute(
|
|
1413
|
-
},
|
|
1414
|
-
document.querySelectorAll(`[${
|
|
1415
|
-
},
|
|
1416
|
-
const e = s.getAttribute(
|
|
1417
|
-
s.removeAttribute(
|
|
1418
|
-
},
|
|
1419
|
-
document.querySelectorAll(`[${
|
|
1420
|
-
},
|
|
1421
|
-
const e = s.getAttribute(
|
|
1422
|
-
s.removeAttribute(
|
|
1423
|
-
},
|
|
1424
|
-
document.querySelectorAll(`[${
|
|
1425
|
-
},
|
|
1426
|
-
const e = s.getAttribute(
|
|
1427
|
-
if (s.removeAttribute(
|
|
1428
|
-
const t =
|
|
1437
|
+
const at = () => {
|
|
1438
|
+
document.querySelectorAll(`[${De}]`).forEach(X);
|
|
1439
|
+
}, ut = (s) => {
|
|
1440
|
+
const e = s.getAttribute(Y);
|
|
1441
|
+
s.removeAttribute(Y), e != null && s.setAttribute("class", e);
|
|
1442
|
+
}, ht = () => {
|
|
1443
|
+
document.querySelectorAll(`[${Y}]`).forEach((e) => ut(e));
|
|
1444
|
+
}, ft = (s) => {
|
|
1445
|
+
const e = s.getAttribute(Z);
|
|
1446
|
+
s.removeAttribute(Z), e != null && (s.innerHTML = e);
|
|
1447
|
+
}, dt = () => {
|
|
1448
|
+
document.querySelectorAll(`[${Z}]`).forEach((e) => ft(e));
|
|
1449
|
+
}, pt = (s) => {
|
|
1450
|
+
const e = s.getAttribute(z);
|
|
1451
|
+
s.removeAttribute(z), e != null && (s.innerText = e);
|
|
1452
|
+
}, mt = () => {
|
|
1453
|
+
document.querySelectorAll(`[${z}]`).forEach((e) => pt(e));
|
|
1454
|
+
}, Me = (s) => JSON.parse(s.replace(/"/g, '"')), gt = (s) => {
|
|
1455
|
+
const e = s.getAttribute(Q);
|
|
1456
|
+
if (s.removeAttribute(Q), e != null) {
|
|
1457
|
+
const t = Me(e);
|
|
1429
1458
|
Object.entries(t).forEach(([r, n]) => {
|
|
1430
1459
|
s.style.setProperty(r, n);
|
|
1431
1460
|
});
|
|
1432
1461
|
}
|
|
1433
|
-
},
|
|
1434
|
-
document.querySelectorAll(`[${
|
|
1435
|
-
},
|
|
1436
|
-
const e = s.getAttribute(
|
|
1437
|
-
if (s.removeAttribute(
|
|
1438
|
-
const t =
|
|
1462
|
+
}, yt = () => {
|
|
1463
|
+
document.querySelectorAll(`[${Q}]`).forEach((e) => gt(e));
|
|
1464
|
+
}, bt = (s) => {
|
|
1465
|
+
const e = s.getAttribute(K);
|
|
1466
|
+
if (s.removeAttribute(K), e != null) {
|
|
1467
|
+
const t = Me(e);
|
|
1439
1468
|
Object.entries(t).forEach(([r, n]) => {
|
|
1440
1469
|
n == null ? s.removeAttribute(r) : s.setAttribute(r, n);
|
|
1441
1470
|
});
|
|
1442
1471
|
}
|
|
1443
|
-
},
|
|
1444
|
-
document.querySelectorAll(`[${
|
|
1445
|
-
},
|
|
1446
|
-
|
|
1447
|
-
},
|
|
1448
|
-
class
|
|
1472
|
+
}, Tt = () => {
|
|
1473
|
+
document.querySelectorAll(`[${K}]`).forEach((e) => bt(e));
|
|
1474
|
+
}, os = () => {
|
|
1475
|
+
at(), ht(), mt(), dt(), yt(), Tt();
|
|
1476
|
+
}, C = Symbol("class"), D = Symbol("style"), $ = Symbol("handler"), Oe = () => Math.random().toString(36).substring(2, 15), St = (s) => s.replace(/<[^>]*>?/g, "");
|
|
1477
|
+
class Ie {
|
|
1449
1478
|
constructor(e) {
|
|
1450
|
-
o(this, "id",
|
|
1479
|
+
o(this, "id", Oe());
|
|
1451
1480
|
o(this, "properties", {});
|
|
1452
1481
|
o(this, "children", []);
|
|
1453
1482
|
o(this, "isElement", () => !0);
|
|
1454
1483
|
o(this, "isText", () => !1);
|
|
1455
|
-
o(this, "getText", () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ?
|
|
1484
|
+
o(this, "getText", () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? St(this.properties.innerHTML) : this.children.map((e) => e.getText()).join(""));
|
|
1456
1485
|
o(this, "removeChild", (e) => {
|
|
1457
1486
|
const t = this.children.indexOf(e);
|
|
1458
1487
|
t !== -1 && this.children.splice(t, 1);
|
|
@@ -1473,10 +1502,10 @@ class we {
|
|
|
1473
1502
|
o(this, "getInnerText", () => this.properties.innerText ?? "");
|
|
1474
1503
|
o(this, "hasInnerText", () => this.properties.innerText != null);
|
|
1475
1504
|
o(this, "hasChildren", () => this.children.length > 0);
|
|
1476
|
-
o(this, "hasClasses", () => this.properties[
|
|
1477
|
-
o(this, "hasStyles", () => this.properties[
|
|
1505
|
+
o(this, "hasClasses", () => this.properties[C] != null);
|
|
1506
|
+
o(this, "hasStyles", () => this.properties[D] != null);
|
|
1478
1507
|
o(this, "hasAttributes", () => Object.keys(this.properties).length > 0);
|
|
1479
|
-
o(this, "hasHandlers", () => this.properties[
|
|
1508
|
+
o(this, "hasHandlers", () => this.properties[$] != null);
|
|
1480
1509
|
o(this, "hasRenderableProperties", () => this.hasClasses() || this.hasAttributes() || this.hasStyles());
|
|
1481
1510
|
o(this, "getById", (e) => {
|
|
1482
1511
|
if (this.properties.id === e)
|
|
@@ -1488,20 +1517,20 @@ class we {
|
|
|
1488
1517
|
}
|
|
1489
1518
|
});
|
|
1490
1519
|
o(this, "trigger", (e, t) => {
|
|
1491
|
-
((this.properties[
|
|
1520
|
+
((this.properties[$] ?? {})[e] ?? []).forEach((n) => n(t));
|
|
1492
1521
|
});
|
|
1493
1522
|
o(this, "click", () => {
|
|
1494
1523
|
this.trigger("click", {});
|
|
1495
1524
|
});
|
|
1496
1525
|
o(this, "on", (e, t, r, n) => {
|
|
1497
|
-
var
|
|
1498
|
-
const i = (
|
|
1499
|
-
c(), t(
|
|
1500
|
-
} : (
|
|
1526
|
+
var a;
|
|
1527
|
+
const i = (a = this.properties)[$] ?? (a[$] = {}), l = n != null && n.once ? (u) => {
|
|
1528
|
+
c(), t(u, r);
|
|
1529
|
+
} : (u) => t(u, r);
|
|
1501
1530
|
i[e] = [...i[e] ?? [], l];
|
|
1502
1531
|
const c = () => {
|
|
1503
|
-
const
|
|
1504
|
-
h !== -1 && (
|
|
1532
|
+
const u = i[e] ?? [], h = u.indexOf(l);
|
|
1533
|
+
h !== -1 && (u.splice(h, 1), u.length === 0 ? (delete i[e], Object.keys(i).length === 0 && delete this.properties[$]) : i[e] = u, (n == null ? void 0 : n.signal) != null && n.signal.removeEventListener("abort", c));
|
|
1505
1534
|
};
|
|
1506
1535
|
return (n == null ? void 0 : n.signal) != null && n.signal.addEventListener("abort", c), c;
|
|
1507
1536
|
});
|
|
@@ -1509,7 +1538,7 @@ class we {
|
|
|
1509
1538
|
var r;
|
|
1510
1539
|
if (e.length === 0)
|
|
1511
1540
|
return;
|
|
1512
|
-
const t = (r = this.properties)[
|
|
1541
|
+
const t = (r = this.properties)[C] ?? (r[C] = []);
|
|
1513
1542
|
e.forEach((n) => {
|
|
1514
1543
|
t.includes(n) || t.push(n);
|
|
1515
1544
|
});
|
|
@@ -1518,29 +1547,29 @@ class we {
|
|
|
1518
1547
|
var r;
|
|
1519
1548
|
if (e.length === 0)
|
|
1520
1549
|
return;
|
|
1521
|
-
const t = (r = this.properties)[
|
|
1550
|
+
const t = (r = this.properties)[C] ?? (r[C] = []);
|
|
1522
1551
|
e.forEach((n) => {
|
|
1523
1552
|
const i = t.indexOf(n);
|
|
1524
1553
|
i !== -1 && t.splice(i, 1);
|
|
1525
|
-
}), t.length === 0 && delete this.properties[
|
|
1554
|
+
}), t.length === 0 && delete this.properties[C];
|
|
1526
1555
|
});
|
|
1527
|
-
o(this, "getClasses", () => this.properties[
|
|
1556
|
+
o(this, "getClasses", () => this.properties[C] ?? []);
|
|
1528
1557
|
o(this, "getAttributes", () => Object.entries(this.properties).filter(
|
|
1529
1558
|
([e]) => !["innerText", "innerHTML"].includes(e)
|
|
1530
1559
|
));
|
|
1531
1560
|
o(this, "getVisibleAttributes", () => Reflect.ownKeys(this.properties).flatMap(
|
|
1532
|
-
(e) => e ===
|
|
1561
|
+
(e) => e === C ? [["class", this.getClasses()]] : e === D ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
|
|
1533
1562
|
));
|
|
1534
1563
|
o(this, "setStyle", (e, t) => {
|
|
1535
1564
|
var n;
|
|
1536
|
-
const r = (n = this.properties)[
|
|
1537
|
-
r[e] = t, t === "" && (delete r[e], Object.keys(r).length === 0 && delete this.properties[
|
|
1565
|
+
const r = (n = this.properties)[D] ?? (n[D] = {});
|
|
1566
|
+
r[e] = t, t === "" && (delete r[e], Object.keys(r).length === 0 && delete this.properties[D]);
|
|
1538
1567
|
});
|
|
1539
1568
|
o(this, "getStyle", (e) => {
|
|
1540
1569
|
var t;
|
|
1541
|
-
return ((t = this.properties[
|
|
1570
|
+
return ((t = this.properties[D]) == null ? void 0 : t[e]) ?? "";
|
|
1542
1571
|
});
|
|
1543
|
-
o(this, "getStyles", () => this.properties[
|
|
1572
|
+
o(this, "getStyles", () => this.properties[D] ?? {});
|
|
1544
1573
|
o(this, "makeAccessors", (e) => {
|
|
1545
1574
|
const t = this.properties;
|
|
1546
1575
|
return {
|
|
@@ -1551,21 +1580,21 @@ class we {
|
|
|
1551
1580
|
this.parent = e;
|
|
1552
1581
|
}
|
|
1553
1582
|
}
|
|
1554
|
-
const
|
|
1555
|
-
class
|
|
1583
|
+
const vt = (s) => s.replace(/"/g, """), At = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
1584
|
+
class _t extends Ie {
|
|
1556
1585
|
constructor(t, r, n) {
|
|
1557
1586
|
super(n);
|
|
1558
1587
|
o(this, "isPortal", () => !1);
|
|
1559
1588
|
o(this, "toHTML", (t = !1) => {
|
|
1560
|
-
const r = this.children.map((
|
|
1589
|
+
const r = this.children.map((a) => a.toHTML()).join(""), n = this.namespace ? ` xmlns="${this.namespace}"` : "";
|
|
1561
1590
|
let i = null;
|
|
1562
|
-
const l = this.getVisibleAttributes().map(([
|
|
1563
|
-
return
|
|
1591
|
+
const l = this.getVisibleAttributes().map(([a, u]) => a === "class" ? ` class="${u.join(" ")}"` : a === "style" ? typeof u == "string" ? ` style="${u}"` : ` style="${Object.entries(u).map(([h, d]) => `${h}: ${d};`).join(" ")}"` : Ct.has(a) ? ` ${a}` : a === "innerHTML" ? (i = u, "") : a === "innerText" ? (i = At(u), "") : ` ${a}="${vt(u)}"`).join(""), c = t ? ` ${De}` : "";
|
|
1592
|
+
return wt.has(this.tagName) && r === "" ? `<${this.tagName}${n}${l}${c} />` : `<${this.tagName}${n}${l}${c}>${i ?? r}</${this.tagName}>`;
|
|
1564
1593
|
});
|
|
1565
1594
|
this.tagName = t, this.namespace = r;
|
|
1566
1595
|
}
|
|
1567
1596
|
}
|
|
1568
|
-
class
|
|
1597
|
+
class He extends Ie {
|
|
1569
1598
|
constructor(t, r) {
|
|
1570
1599
|
super(r);
|
|
1571
1600
|
o(this, "isPortal", () => !0);
|
|
@@ -1574,9 +1603,9 @@ class xe extends we {
|
|
|
1574
1603
|
this.selector = t;
|
|
1575
1604
|
}
|
|
1576
1605
|
}
|
|
1577
|
-
class
|
|
1606
|
+
class Et {
|
|
1578
1607
|
constructor(e) {
|
|
1579
|
-
o(this, "id",
|
|
1608
|
+
o(this, "id", Oe());
|
|
1580
1609
|
o(this, "isElement", () => !1);
|
|
1581
1610
|
o(this, "isText", () => !0);
|
|
1582
1611
|
o(this, "getText", () => this.text);
|
|
@@ -1584,7 +1613,7 @@ class yt {
|
|
|
1584
1613
|
this.text = e;
|
|
1585
1614
|
}
|
|
1586
1615
|
}
|
|
1587
|
-
class
|
|
1616
|
+
class V {
|
|
1588
1617
|
constructor(e, t, r, n) {
|
|
1589
1618
|
o(this, "appendOrInsert", (e) => {
|
|
1590
1619
|
if (this.reference != null) {
|
|
@@ -1594,8 +1623,8 @@ class H {
|
|
|
1594
1623
|
this.element.children.push(e);
|
|
1595
1624
|
});
|
|
1596
1625
|
o(this, "makeChildElement", (e, t) => {
|
|
1597
|
-
const r = new
|
|
1598
|
-
return this.appendOrInsert(r), new
|
|
1626
|
+
const r = new _t(e, t, this.element);
|
|
1627
|
+
return this.appendOrInsert(r), new V(
|
|
1599
1628
|
r,
|
|
1600
1629
|
void 0,
|
|
1601
1630
|
this.container,
|
|
@@ -1603,8 +1632,8 @@ class H {
|
|
|
1603
1632
|
);
|
|
1604
1633
|
});
|
|
1605
1634
|
o(this, "makeChildText", (e) => {
|
|
1606
|
-
const t = new
|
|
1607
|
-
return this.appendOrInsert(t), new
|
|
1635
|
+
const t = new Et(e);
|
|
1636
|
+
return this.appendOrInsert(t), new V(
|
|
1608
1637
|
this.element,
|
|
1609
1638
|
t,
|
|
1610
1639
|
this.container,
|
|
@@ -1620,8 +1649,8 @@ class H {
|
|
|
1620
1649
|
});
|
|
1621
1650
|
o(this, "makeRef", () => this.makeChildText(""));
|
|
1622
1651
|
o(this, "makePortal", (e) => {
|
|
1623
|
-
const t = new
|
|
1624
|
-
return this.appendOrInsert(t), new
|
|
1652
|
+
const t = new He(e, this.element);
|
|
1653
|
+
return this.appendOrInsert(t), new V(
|
|
1625
1654
|
t,
|
|
1626
1655
|
void 0,
|
|
1627
1656
|
this.container,
|
|
@@ -1635,13 +1664,13 @@ class H {
|
|
|
1635
1664
|
* @param value - The provider to set for the given mark.
|
|
1636
1665
|
* @returns A new `DOMContext` instance with the specified provider.
|
|
1637
1666
|
*/
|
|
1638
|
-
o(this, "setProvider", (e, t, r) => new
|
|
1667
|
+
o(this, "setProvider", (e, t, r) => new V(this.element, this.reference, this.container, {
|
|
1639
1668
|
...this.providers,
|
|
1640
1669
|
[e]: [t, r]
|
|
1641
1670
|
}));
|
|
1642
1671
|
o(this, "getProvider", (e) => {
|
|
1643
1672
|
if (this.providers[e] === void 0)
|
|
1644
|
-
throw new
|
|
1673
|
+
throw new Le(e);
|
|
1645
1674
|
const [t, r] = this.providers[e];
|
|
1646
1675
|
return { value: t, onUse: r };
|
|
1647
1676
|
});
|
|
@@ -1662,27 +1691,27 @@ class H {
|
|
|
1662
1691
|
this.element = e, this.reference = t, this.container = r, this.providers = n;
|
|
1663
1692
|
}
|
|
1664
1693
|
}
|
|
1665
|
-
const
|
|
1694
|
+
const Ct = /* @__PURE__ */ new Set([
|
|
1666
1695
|
"checked",
|
|
1667
1696
|
"disabled",
|
|
1668
1697
|
"multiple",
|
|
1669
1698
|
"readonly",
|
|
1670
1699
|
"required",
|
|
1671
1700
|
"selected"
|
|
1672
|
-
]),
|
|
1701
|
+
]), wt = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), ke = (s) => (e) => e.makeChildText(s).clear, $e = (s) => (e) => {
|
|
1673
1702
|
const t = e.makeChildText(s.value), r = s.on(t.setText);
|
|
1674
1703
|
return (n) => {
|
|
1675
1704
|
r(), t.clear(n);
|
|
1676
1705
|
};
|
|
1677
|
-
},
|
|
1706
|
+
}, ls = (s) => y.is(s) ? $e(s) : ke(s), _ = (...s) => (e) => {
|
|
1678
1707
|
const t = s.map((r) => f(r)(e));
|
|
1679
1708
|
return (r) => {
|
|
1680
1709
|
t.forEach((n) => n(r));
|
|
1681
1710
|
};
|
|
1682
|
-
},
|
|
1683
|
-
},
|
|
1711
|
+
}, x = () => () => {
|
|
1712
|
+
}, xt = (s) => (e) => (e.addClasses(s), (t) => {
|
|
1684
1713
|
t && e.removeClasses(s);
|
|
1685
|
-
}),
|
|
1714
|
+
}), Pt = (s) => (e) => {
|
|
1686
1715
|
let t = [];
|
|
1687
1716
|
const r = s.on((n) => {
|
|
1688
1717
|
e.removeClasses(t), t = (n ?? "").split(" ").filter((i) => i.length > 0), e.addClasses(t);
|
|
@@ -1690,17 +1719,20 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1690
1719
|
return (n) => {
|
|
1691
1720
|
r(), n && e.removeClasses(t), t.length = 0;
|
|
1692
1721
|
};
|
|
1693
|
-
},
|
|
1722
|
+
}, Lt = (s, e) => (t) => {
|
|
1694
1723
|
const { get: r, set: n } = t.makeAccessors(s), i = r();
|
|
1695
1724
|
return n(e), (l) => {
|
|
1696
1725
|
l && n(i);
|
|
1697
1726
|
};
|
|
1698
|
-
},
|
|
1727
|
+
}, Dt = (s, e) => (t) => {
|
|
1699
1728
|
const { get: r, set: n } = t.makeAccessors(s), i = r(), l = e.on(n);
|
|
1700
1729
|
return (c) => {
|
|
1701
1730
|
l(), c && n(i);
|
|
1702
1731
|
};
|
|
1703
|
-
},
|
|
1732
|
+
}, j = (s, e) => y.is(e) ? Dt(s, e) : Lt(s, e), se = (s = "") => (e, t) => {
|
|
1733
|
+
const r = s ? `${s}${e}` : e;
|
|
1734
|
+
return j(r, t);
|
|
1735
|
+
}, q = new Proxy(
|
|
1704
1736
|
{},
|
|
1705
1737
|
{
|
|
1706
1738
|
/**
|
|
@@ -1714,18 +1746,12 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1714
1746
|
* @returns The renderable component for the specified attribute.
|
|
1715
1747
|
*
|
|
1716
1748
|
*/
|
|
1717
|
-
get: (s, e) => e === "class" ? (t) =>
|
|
1749
|
+
get: (s, e) => e === "class" ? (t) => y.is(t) ? Pt(t) : xt(
|
|
1718
1750
|
/* c8 ignore next */
|
|
1719
1751
|
(t ?? "").split(" ").filter((r) => r.length > 0)
|
|
1720
|
-
) : (
|
|
1721
|
-
e,
|
|
1722
|
-
t
|
|
1723
|
-
) : R(
|
|
1724
|
-
e,
|
|
1725
|
-
t
|
|
1726
|
-
)
|
|
1752
|
+
) : e === "set" ? se() : (t) => j(e, t)
|
|
1727
1753
|
}
|
|
1728
|
-
),
|
|
1754
|
+
), cs = new Proxy(
|
|
1729
1755
|
{},
|
|
1730
1756
|
{
|
|
1731
1757
|
/**
|
|
@@ -1736,12 +1762,9 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1736
1762
|
* @returns The renderable component for the specified attribute.
|
|
1737
1763
|
*
|
|
1738
1764
|
*/
|
|
1739
|
-
get: (s, e) => (
|
|
1740
|
-
`data-${e}`,
|
|
1741
|
-
t
|
|
1742
|
-
) : R(`data-${e}`, t)
|
|
1765
|
+
get: (s, e) => e === "set" ? se("data-") : (t) => j(`data-${e}`, t)
|
|
1743
1766
|
}
|
|
1744
|
-
),
|
|
1767
|
+
), as = new Proxy(
|
|
1745
1768
|
{},
|
|
1746
1769
|
{
|
|
1747
1770
|
/**
|
|
@@ -1752,15 +1775,9 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1752
1775
|
* @returns The renderable component for the specified attribute.
|
|
1753
1776
|
*
|
|
1754
1777
|
*/
|
|
1755
|
-
get: (s, e) => (
|
|
1756
|
-
`aria-${e}`,
|
|
1757
|
-
t
|
|
1758
|
-
) : R(
|
|
1759
|
-
`aria-${e}`,
|
|
1760
|
-
t
|
|
1761
|
-
)
|
|
1778
|
+
get: (s, e) => e === "set" ? se("aria-") : (t) => j(`aria-${e}`, t)
|
|
1762
1779
|
}
|
|
1763
|
-
),
|
|
1780
|
+
), us = new Proxy(
|
|
1764
1781
|
{},
|
|
1765
1782
|
{
|
|
1766
1783
|
/**
|
|
@@ -1771,15 +1788,9 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1771
1788
|
* @returns The renderable component for the specified attribute.
|
|
1772
1789
|
*
|
|
1773
1790
|
*/
|
|
1774
|
-
get: (s, e) => (
|
|
1775
|
-
e,
|
|
1776
|
-
t
|
|
1777
|
-
) : R(
|
|
1778
|
-
e,
|
|
1779
|
-
t
|
|
1780
|
-
)
|
|
1791
|
+
get: (s, e) => e === "set" ? se() : (t) => j(e, t)
|
|
1781
1792
|
}
|
|
1782
|
-
),
|
|
1793
|
+
), hs = new Proxy(
|
|
1783
1794
|
{},
|
|
1784
1795
|
{
|
|
1785
1796
|
/**
|
|
@@ -1789,37 +1800,31 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1789
1800
|
* @returns The renderable component for the specified attribute.
|
|
1790
1801
|
*
|
|
1791
1802
|
*/
|
|
1792
|
-
get: (s, e) => (t) =>
|
|
1793
|
-
e,
|
|
1794
|
-
t
|
|
1795
|
-
) : R(
|
|
1796
|
-
e,
|
|
1797
|
-
t
|
|
1798
|
-
)
|
|
1803
|
+
get: (s, e) => (t) => j(e, t)
|
|
1799
1804
|
}
|
|
1800
1805
|
), f = (s) => {
|
|
1801
1806
|
if (s == null)
|
|
1802
|
-
return
|
|
1807
|
+
return x;
|
|
1803
1808
|
if (Array.isArray(s))
|
|
1804
|
-
return
|
|
1809
|
+
return _(...s.map(f));
|
|
1805
1810
|
if (typeof s == "string")
|
|
1806
|
-
return
|
|
1807
|
-
if (
|
|
1808
|
-
return
|
|
1811
|
+
return ke(s);
|
|
1812
|
+
if (y.is(s))
|
|
1813
|
+
return $e(s);
|
|
1809
1814
|
if (typeof s == "function")
|
|
1810
1815
|
return s;
|
|
1811
1816
|
throw new Error(`Unknown type: '${typeof s}' for child: ${s}`);
|
|
1812
|
-
},
|
|
1817
|
+
}, Ne = (s, ...e) => (t) => {
|
|
1813
1818
|
const r = t.makeChildElement(s, void 0), n = e.map((i) => f(i)(r));
|
|
1814
1819
|
return (i) => {
|
|
1815
1820
|
n.forEach((l) => l(!1)), r.clear(i);
|
|
1816
1821
|
};
|
|
1817
|
-
},
|
|
1822
|
+
}, Re = (s, e, ...t) => (r) => {
|
|
1818
1823
|
const n = r.makeChildElement(s, e), i = t.map((l) => f(l)(n));
|
|
1819
1824
|
return (l) => {
|
|
1820
1825
|
i.forEach((c) => c(!1)), n.clear(l);
|
|
1821
1826
|
};
|
|
1822
|
-
},
|
|
1827
|
+
}, fs = new Proxy(
|
|
1823
1828
|
{},
|
|
1824
1829
|
{
|
|
1825
1830
|
/**
|
|
@@ -1827,9 +1832,9 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1827
1832
|
* @param tagName - The HTML tag name.
|
|
1828
1833
|
* @returns A renderable function that creates and appends the HTML element to the DOM.
|
|
1829
1834
|
*/
|
|
1830
|
-
get: (s, e) => (...t) =>
|
|
1835
|
+
get: (s, e) => (...t) => Ne(e, t.flatMap(f))
|
|
1831
1836
|
}
|
|
1832
|
-
),
|
|
1837
|
+
), ds = new Proxy(
|
|
1833
1838
|
{},
|
|
1834
1839
|
{
|
|
1835
1840
|
/**
|
|
@@ -1837,9 +1842,9 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1837
1842
|
* @param type - The input type name.
|
|
1838
1843
|
* @returns A renderable function that creates and appends the HTMLInput element to the DOM.
|
|
1839
1844
|
*/
|
|
1840
|
-
get: (s, e) => (...t) =>
|
|
1845
|
+
get: (s, e) => (...t) => Ne("input", q.type(e), ...t)
|
|
1841
1846
|
}
|
|
1842
|
-
),
|
|
1847
|
+
), Mt = "http://www.w3.org/2000/svg", ps = new Proxy(
|
|
1843
1848
|
{},
|
|
1844
1849
|
{
|
|
1845
1850
|
/**
|
|
@@ -1847,9 +1852,9 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1847
1852
|
* @param tagName - The SVG tag name.
|
|
1848
1853
|
* @returns A renderable function that creates and appends the SVG element to the DOM.
|
|
1849
1854
|
*/
|
|
1850
|
-
get: (s, e) => (...t) =>
|
|
1855
|
+
get: (s, e) => (...t) => Re(e, Mt, t.flatMap(f))
|
|
1851
1856
|
}
|
|
1852
|
-
),
|
|
1857
|
+
), Ot = "http://www.w3.org/1998/Math/MathML", ms = new Proxy(
|
|
1853
1858
|
{},
|
|
1854
1859
|
{
|
|
1855
1860
|
/**
|
|
@@ -1857,35 +1862,35 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1857
1862
|
* @param tagName - The Math tag name.
|
|
1858
1863
|
* @returns A renderable function that creates and appends the Math element to the DOM.
|
|
1859
1864
|
*/
|
|
1860
|
-
get: (s, e) => (...t) =>
|
|
1865
|
+
get: (s, e) => (...t) => Re(e, Ot, t.flatMap(f))
|
|
1861
1866
|
}
|
|
1862
|
-
),
|
|
1867
|
+
), Ve = (s, e) => {
|
|
1863
1868
|
if (typeof e == "function")
|
|
1864
|
-
return
|
|
1865
|
-
const t = e.pending != null ? f(e.pending()) :
|
|
1869
|
+
return Ve(s, { then: e });
|
|
1870
|
+
const t = e.pending != null ? f(e.pending()) : x, r = e.then, n = e.error != null ? (i) => f(e.error(i)) : () => x;
|
|
1866
1871
|
return (i) => {
|
|
1867
1872
|
let l = !0;
|
|
1868
|
-
const c = s(),
|
|
1869
|
-
let
|
|
1873
|
+
const c = s(), a = i.makeRef();
|
|
1874
|
+
let u = f(t)(a);
|
|
1870
1875
|
return c.then(
|
|
1871
1876
|
(h) => {
|
|
1872
|
-
l && (
|
|
1877
|
+
l && (u(!0), u = f(r(h))(a));
|
|
1873
1878
|
},
|
|
1874
1879
|
(h) => {
|
|
1875
|
-
l && (
|
|
1880
|
+
l && (u(!0), u = f(n(h))(a));
|
|
1876
1881
|
}
|
|
1877
1882
|
), (h) => {
|
|
1878
|
-
l = !1,
|
|
1883
|
+
l = !1, u(h), a.clear(h);
|
|
1879
1884
|
};
|
|
1880
1885
|
};
|
|
1881
|
-
},
|
|
1886
|
+
}, gs = (s, e) => Ve(() => s, e), je = (s, e, t) => (r) => r.on(s, e, t), It = (s) => je("click", (e, t) => {
|
|
1882
1887
|
e.preventDefault();
|
|
1883
1888
|
const r = e.target;
|
|
1884
1889
|
setTimeout(() => {
|
|
1885
1890
|
const n = r.ownerDocument != null ? r == null ? void 0 : r.checked : void 0;
|
|
1886
1891
|
n != null && s(!n, t);
|
|
1887
1892
|
}, 0);
|
|
1888
|
-
}),
|
|
1893
|
+
}), re = new Proxy(
|
|
1889
1894
|
{},
|
|
1890
1895
|
{
|
|
1891
1896
|
/**
|
|
@@ -1893,20 +1898,20 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1893
1898
|
* @param fn - The function to call when the event is triggered.
|
|
1894
1899
|
* @returns A `Renderable` function that adds the event listener to the element.
|
|
1895
1900
|
*/
|
|
1896
|
-
get: (s, e) => (t) =>
|
|
1901
|
+
get: (s, e) => (t) => je(e, t)
|
|
1897
1902
|
}
|
|
1898
|
-
),
|
|
1903
|
+
), Ht = (s, e) => (t) => {
|
|
1899
1904
|
(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);
|
|
1900
|
-
},
|
|
1905
|
+
}, I = (s, e) => Ht((t) => {
|
|
1901
1906
|
const r = t.target;
|
|
1902
1907
|
s(r, t);
|
|
1903
|
-
}, e),
|
|
1908
|
+
}, e), kt = (s, e) => I(
|
|
1904
1909
|
(t, r) => s(t.value, r),
|
|
1905
1910
|
e
|
|
1906
|
-
),
|
|
1911
|
+
), $t = (s, e) => I(
|
|
1907
1912
|
(t, r) => s(t.valueAsNumber, r),
|
|
1908
1913
|
e
|
|
1909
|
-
),
|
|
1914
|
+
), Nt = (s, e) => I((t, r) => {
|
|
1910
1915
|
if (t.value === "")
|
|
1911
1916
|
return;
|
|
1912
1917
|
const n = t.value.split("-"), i = new Date(
|
|
@@ -1915,7 +1920,7 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1915
1920
|
Number(n[2].substring(0, 2))
|
|
1916
1921
|
);
|
|
1917
1922
|
s(i, r);
|
|
1918
|
-
}, e),
|
|
1923
|
+
}, e), ys = (s, e) => I((t, r) => {
|
|
1919
1924
|
if (t.value === "") {
|
|
1920
1925
|
s(null, r);
|
|
1921
1926
|
return;
|
|
@@ -1926,7 +1931,7 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1926
1931
|
Number(n[2].substring(0, 2))
|
|
1927
1932
|
);
|
|
1928
1933
|
s(i, r);
|
|
1929
|
-
}, e),
|
|
1934
|
+
}, e), Rt = (s, e) => I((t, r) => {
|
|
1930
1935
|
if (t.value === "")
|
|
1931
1936
|
return;
|
|
1932
1937
|
const n = t.value.split("T"), i = n[0].split("-"), l = new Date(
|
|
@@ -1935,7 +1940,7 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1935
1940
|
Number(i[2])
|
|
1936
1941
|
), c = n[1].split(":");
|
|
1937
1942
|
l.setHours(Number(c[0])), l.setMinutes(Number(c[1])), l.setSeconds(Number(c[2])), s(l, r);
|
|
1938
|
-
}, e),
|
|
1943
|
+
}, e), bs = (s, e) => I((t, r) => {
|
|
1939
1944
|
if (t.value === "") {
|
|
1940
1945
|
s(null, r);
|
|
1941
1946
|
return;
|
|
@@ -1951,41 +1956,55 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1951
1956
|
Number(i[2])
|
|
1952
1957
|
), c = n[1].split(":");
|
|
1953
1958
|
l.setHours(Number(c[0] ?? 0)), l.setMinutes(Number(c[1] ?? 0)), l.setSeconds(Number(c[2] ?? 0)), s(l, r);
|
|
1954
|
-
}, e),
|
|
1959
|
+
}, e), Ts = (s, e) => I((t, r) => {
|
|
1955
1960
|
s(t.checked, r);
|
|
1956
|
-
}, e),
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1961
|
+
}, e), Ss = (s, e = "input") => _(q.valueAsDate(s), re[e](Nt(s.set))), vs = (s, e = "input") => _(q.valueAsDate(s), re[e](Rt(s.set))), As = (s, e = "input") => _(q.valueAsNumber(s), re[e]($t(s.set))), _s = (s, e = "input") => _(q.value(s), re[e](kt(s.set))), Es = (s) => _(q.checked(s), It(s.set)), de = (s, e, t) => y.is(s) ? e(s) : t(s), Vt = (s, e, t) => {
|
|
1962
|
+
const r = s.makeRef();
|
|
1963
|
+
let n = () => {
|
|
1964
|
+
};
|
|
1965
|
+
const i = e.on((l) => {
|
|
1966
|
+
n(!0), n = f(t(l))(r);
|
|
1967
|
+
});
|
|
1968
|
+
return (l) => {
|
|
1969
|
+
n(l), i(), r.clear(l);
|
|
1970
|
+
};
|
|
1971
|
+
}, ne = (s, e) => {
|
|
1972
|
+
function t(n) {
|
|
1973
|
+
return (i) => {
|
|
1974
|
+
const l = i.makeRef();
|
|
1975
|
+
let c, a;
|
|
1976
|
+
const u = n.map((p) => Object.keys(p)[0]);
|
|
1977
|
+
let h;
|
|
1978
|
+
const d = u.on((p) => {
|
|
1979
|
+
if (p !== h) {
|
|
1980
|
+
h = p, a == null || a.dispose(), c == null || c(!0), a = n.map((g) => g[p]);
|
|
1981
|
+
const m = e[p](a);
|
|
1982
|
+
c = f(m)(l);
|
|
1968
1983
|
}
|
|
1969
1984
|
});
|
|
1970
|
-
return (
|
|
1971
|
-
|
|
1985
|
+
return (p) => {
|
|
1986
|
+
a == null || a.dispose(), d(), l.clear(p), c == null || c(p);
|
|
1972
1987
|
};
|
|
1973
1988
|
};
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1989
|
+
}
|
|
1990
|
+
function r(n) {
|
|
1991
|
+
const i = Object.keys(n)[0];
|
|
1992
|
+
return f(e[i](te(n[i])));
|
|
1993
|
+
}
|
|
1994
|
+
return de(s, t, r);
|
|
1995
|
+
}, qe = (s, e, t) => ne(
|
|
1996
|
+
b.map(s, (r) => ({ [r[e]]: r })),
|
|
1978
1997
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1979
1998
|
t
|
|
1980
|
-
),
|
|
1981
|
-
const t =
|
|
1982
|
-
return
|
|
1983
|
-
},
|
|
1984
|
-
|
|
1999
|
+
), Cs = (s, e) => qe(s, "kind", e), ws = (s, e) => {
|
|
2000
|
+
const t = b.map(s, ([r, n]) => ({ [r]: n }));
|
|
2001
|
+
return ne(t, e);
|
|
2002
|
+
}, xs = (s, e) => qe(s, "type", e), jt = (s, e) => ne(
|
|
2003
|
+
b.map(s, (t) => ({ [t]: !0 })),
|
|
1985
2004
|
e
|
|
1986
|
-
),
|
|
2005
|
+
), Ps = (s, e = {}) => (t) => {
|
|
1987
2006
|
const r = (e == null ? void 0 : e.firstSeparator) ?? s, n = (e == null ? void 0 : e.lastSeparator) ?? s;
|
|
1988
|
-
return
|
|
2007
|
+
return jt(
|
|
1989
2008
|
t.map((i) => i.isFirst ? "first" : i.isLast ? "last" : "other"),
|
|
1990
2009
|
{
|
|
1991
2010
|
first: r,
|
|
@@ -1993,163 +2012,160 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
1993
2012
|
other: s
|
|
1994
2013
|
}
|
|
1995
2014
|
);
|
|
1996
|
-
},
|
|
1997
|
-
t &&
|
|
1998
|
-
}),
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
), c = !0);
|
|
2015
|
+
}, Ls = (s) => (e) => (e.appendOrInsert(s), (t) => {
|
|
2016
|
+
t && X(s);
|
|
2017
|
+
}), Ds = (s, e, t) => {
|
|
2018
|
+
function r(i) {
|
|
2019
|
+
return (l) => {
|
|
2020
|
+
const c = l.makeRef();
|
|
2021
|
+
let a = () => {
|
|
2022
|
+
}, u = !1, h = null;
|
|
2023
|
+
const d = i.on((p) => {
|
|
2024
|
+
p == null ? (a(!0), a = f(t == null ? void 0 : t())(c), u = !1, h == null || h.dispose(), h = null) : u ? h.set(p) : (h = w(p), a(!0), a = f(e(h))(
|
|
2025
|
+
c
|
|
2026
|
+
), u = !0);
|
|
2009
2027
|
});
|
|
2010
|
-
return (
|
|
2011
|
-
|
|
2028
|
+
return (p) => {
|
|
2029
|
+
h == null || h.dispose(), d(), a == null || a(p), c.clear(p);
|
|
2012
2030
|
};
|
|
2013
2031
|
};
|
|
2014
|
-
}
|
|
2015
|
-
|
|
2016
|
-
if (
|
|
2017
|
-
const
|
|
2018
|
-
return
|
|
2032
|
+
}
|
|
2033
|
+
function n(i) {
|
|
2034
|
+
if (i == null) {
|
|
2035
|
+
const l = t == null ? void 0 : t();
|
|
2036
|
+
return l != null ? f(l) : x;
|
|
2019
2037
|
}
|
|
2020
|
-
return f(e(
|
|
2038
|
+
return f(e(te(i)));
|
|
2021
2039
|
}
|
|
2022
|
-
|
|
2040
|
+
return de(
|
|
2041
|
+
s,
|
|
2042
|
+
r,
|
|
2043
|
+
n
|
|
2044
|
+
);
|
|
2045
|
+
}, Ms = (...s) => (e, t) => (r) => {
|
|
2023
2046
|
const n = r.makeRef();
|
|
2024
2047
|
if (s.some(
|
|
2025
|
-
(
|
|
2048
|
+
(m) => !y.is(m) && m == null
|
|
2026
2049
|
))
|
|
2027
|
-
return (t != null ? f(t == null ? void 0 : t()) :
|
|
2050
|
+
return (t != null ? f(t == null ? void 0 : t()) : x)(
|
|
2028
2051
|
n
|
|
2029
2052
|
);
|
|
2030
2053
|
const l = s.map(() => null), c = s.map(
|
|
2031
|
-
(
|
|
2054
|
+
(m) => y.is(m) ? m.value != null : m != null
|
|
2032
2055
|
);
|
|
2033
|
-
let
|
|
2034
|
-
const
|
|
2035
|
-
if (
|
|
2036
|
-
if (l[
|
|
2037
|
-
const
|
|
2038
|
-
l[
|
|
2056
|
+
let a = null;
|
|
2057
|
+
const u = w(c.every((m) => m)), h = (m, g) => {
|
|
2058
|
+
if (m.value != null) {
|
|
2059
|
+
if (l[g] == null) {
|
|
2060
|
+
const S = w(m.value);
|
|
2061
|
+
l[g] = S;
|
|
2039
2062
|
} else
|
|
2040
|
-
l[
|
|
2041
|
-
c[
|
|
2063
|
+
l[g].value = m.value;
|
|
2064
|
+
c[g] = !0;
|
|
2042
2065
|
} else
|
|
2043
|
-
c[
|
|
2066
|
+
c[g] = !1;
|
|
2044
2067
|
};
|
|
2045
|
-
let
|
|
2046
|
-
const
|
|
2047
|
-
if (!
|
|
2048
|
-
const
|
|
2049
|
-
return l[
|
|
2068
|
+
let d = s.length - 1;
|
|
2069
|
+
const p = s.map((m, g) => {
|
|
2070
|
+
if (!y.is(m)) {
|
|
2071
|
+
const S = w(m);
|
|
2072
|
+
return l[g] = S, () => {
|
|
2050
2073
|
};
|
|
2051
2074
|
}
|
|
2052
|
-
return
|
|
2053
|
-
h(
|
|
2075
|
+
return m.on(() => {
|
|
2076
|
+
h(m, g), d === 0 ? u.value = c.every((S) => S) : d--;
|
|
2054
2077
|
});
|
|
2055
2078
|
});
|
|
2056
|
-
return
|
|
2057
|
-
|
|
2058
|
-
}), (
|
|
2059
|
-
l.forEach((
|
|
2079
|
+
return u.on((m) => {
|
|
2080
|
+
a == null || a(!0), a = null, m ? a = f(e(...l))(n) : a = f((t == null ? void 0 : t()) ?? x)(n);
|
|
2081
|
+
}), (m) => {
|
|
2082
|
+
l.forEach((g) => g == null ? void 0 : g.dispose()), u.dispose(), p.forEach((g) => g()), a == null || a(m), n.clear(m);
|
|
2060
2083
|
};
|
|
2061
|
-
},
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
});
|
|
2071
|
-
return (u) => {
|
|
2072
|
-
l(u), c(), i.clear(u);
|
|
2073
|
-
};
|
|
2074
|
-
};
|
|
2075
|
-
} else {
|
|
2076
|
-
if (s) {
|
|
2084
|
+
}, F = (...s) => (e) => (t) => s.forEach((r) => r(t, e)), Fe = (s, e, t) => de(
|
|
2085
|
+
s,
|
|
2086
|
+
(r) => (n) => Vt(
|
|
2087
|
+
n,
|
|
2088
|
+
r,
|
|
2089
|
+
(i) => i ? e() : t == null ? void 0 : t()
|
|
2090
|
+
),
|
|
2091
|
+
(r) => {
|
|
2092
|
+
if (r) {
|
|
2077
2093
|
const n = e();
|
|
2078
|
-
return n != null ? f(n) :
|
|
2094
|
+
return n != null ? f(n) : x;
|
|
2079
2095
|
}
|
|
2080
2096
|
return f(t == null ? void 0 : t());
|
|
2081
2097
|
}
|
|
2082
|
-
|
|
2083
|
-
|
|
2098
|
+
), Os = (s, e, t) => Fe(
|
|
2099
|
+
b.map(s, (r) => !r),
|
|
2084
2100
|
e,
|
|
2085
2101
|
t
|
|
2086
|
-
),
|
|
2102
|
+
), Be = (s, e, t) => {
|
|
2087
2103
|
if (t != null)
|
|
2088
|
-
return
|
|
2089
|
-
const n = new
|
|
2104
|
+
return Be(s, (r) => {
|
|
2105
|
+
const n = new ce(
|
|
2090
2106
|
r.index,
|
|
2091
2107
|
r.total.map((i) => i - 1)
|
|
2092
2108
|
);
|
|
2093
|
-
return
|
|
2094
|
-
|
|
2109
|
+
return _(
|
|
2110
|
+
F(n.dispose),
|
|
2095
2111
|
f(e(r)),
|
|
2096
|
-
|
|
2112
|
+
Fe(
|
|
2097
2113
|
r.isLast,
|
|
2098
|
-
() =>
|
|
2114
|
+
() => x,
|
|
2099
2115
|
() => t(n)
|
|
2100
2116
|
)
|
|
2101
2117
|
);
|
|
2102
2118
|
});
|
|
2103
|
-
if (
|
|
2119
|
+
if (y.is(s))
|
|
2104
2120
|
return (r) => {
|
|
2105
2121
|
const n = s.derive(), i = r.makeRef(), l = [];
|
|
2106
2122
|
return n.on((c) => {
|
|
2107
|
-
const
|
|
2108
|
-
for (const
|
|
2109
|
-
|
|
2110
|
-
for (let
|
|
2111
|
-
const h = new
|
|
2123
|
+
const a = l.splice(c);
|
|
2124
|
+
for (const u of a)
|
|
2125
|
+
u(!0);
|
|
2126
|
+
for (let u = l.length; u < c; u++) {
|
|
2127
|
+
const h = new ce(u, n);
|
|
2112
2128
|
l.push(
|
|
2113
|
-
|
|
2114
|
-
|
|
2129
|
+
_(
|
|
2130
|
+
F(h.dispose),
|
|
2115
2131
|
f(e(h))
|
|
2116
2132
|
)(i)
|
|
2117
2133
|
);
|
|
2118
2134
|
}
|
|
2119
2135
|
}), (c) => {
|
|
2120
2136
|
n.dispose();
|
|
2121
|
-
for (const
|
|
2122
|
-
|
|
2137
|
+
for (const a of l)
|
|
2138
|
+
a(c);
|
|
2123
2139
|
l.length = 0, i.clear(c);
|
|
2124
2140
|
};
|
|
2125
2141
|
};
|
|
2126
2142
|
{
|
|
2127
|
-
const r =
|
|
2128
|
-
return
|
|
2143
|
+
const r = te(s);
|
|
2144
|
+
return _(
|
|
2129
2145
|
...Array.from({ length: s }, (n, i) => i).map((n) => {
|
|
2130
|
-
const i = new
|
|
2131
|
-
return
|
|
2132
|
-
|
|
2146
|
+
const i = new ce(n, r);
|
|
2147
|
+
return _(
|
|
2148
|
+
F(i.dispose),
|
|
2133
2149
|
f(e(i))
|
|
2134
2150
|
);
|
|
2135
2151
|
})
|
|
2136
2152
|
);
|
|
2137
2153
|
}
|
|
2138
|
-
},
|
|
2139
|
-
const r =
|
|
2140
|
-
return
|
|
2154
|
+
}, Is = (s, e, t) => {
|
|
2155
|
+
const r = b.map(s, (i) => i.length), n = b.toSignal(s);
|
|
2156
|
+
return Be(
|
|
2141
2157
|
r,
|
|
2142
2158
|
(i) => {
|
|
2143
2159
|
const l = n.map((c) => c[i.index]);
|
|
2144
|
-
return
|
|
2145
|
-
|
|
2160
|
+
return _(
|
|
2161
|
+
F(l.dispose),
|
|
2146
2162
|
f(e(l, i))
|
|
2147
2163
|
);
|
|
2148
2164
|
},
|
|
2149
2165
|
t
|
|
2150
2166
|
);
|
|
2151
|
-
},
|
|
2152
|
-
if (
|
|
2167
|
+
}, Hs = (s, e) => {
|
|
2168
|
+
if (y.is(s)) {
|
|
2153
2169
|
const t = s;
|
|
2154
2170
|
return (r) => {
|
|
2155
2171
|
r = r.makeRef();
|
|
@@ -2165,8 +2181,8 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
2165
2181
|
};
|
|
2166
2182
|
}
|
|
2167
2183
|
return f(e(s));
|
|
2168
|
-
},
|
|
2169
|
-
|
|
2184
|
+
}, ks = (s, e, t = () => x) => ne(
|
|
2185
|
+
b.map(
|
|
2170
2186
|
s,
|
|
2171
2187
|
(r) => r.length > 0 ? { notEmpty: r } : { whenEmpty: null }
|
|
2172
2188
|
),
|
|
@@ -2174,40 +2190,40 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
2174
2190
|
notEmpty: (r) => e(r),
|
|
2175
2191
|
whenEmpty: () => t()
|
|
2176
2192
|
}
|
|
2177
|
-
),
|
|
2178
|
-
const r = t.makePortal(s), n =
|
|
2193
|
+
), $s = (s, e) => (t) => {
|
|
2194
|
+
const r = t.makePortal(s), n = fe(f(e), r);
|
|
2179
2195
|
return () => n(!0);
|
|
2180
|
-
},
|
|
2181
|
-
mark:
|
|
2196
|
+
}, J = /* @__PURE__ */ new Map(), qt = (s) => ({
|
|
2197
|
+
mark: lt(`Probe(${s.description})`),
|
|
2182
2198
|
create: ({ callback: e = () => {
|
|
2183
2199
|
}, timeout: t = 10 } = {}) => {
|
|
2184
2200
|
const r = (c) => {
|
|
2185
|
-
clearTimeout(n),
|
|
2201
|
+
clearTimeout(n), J.delete(s), e(c);
|
|
2186
2202
|
};
|
|
2187
|
-
if (
|
|
2203
|
+
if (J.has(s))
|
|
2188
2204
|
throw new Error(`Probe already exists: ${s.description}`);
|
|
2189
2205
|
const n = setTimeout(() => r("timeout"), t), i = { counter: 0, timeoutId: n };
|
|
2190
|
-
return
|
|
2206
|
+
return J.set(s, i), {
|
|
2191
2207
|
value: () => {
|
|
2192
2208
|
clearTimeout(n);
|
|
2193
|
-
const c =
|
|
2209
|
+
const c = J.get(s);
|
|
2194
2210
|
c != null && --c.counter === 0 && r("resolved");
|
|
2195
2211
|
},
|
|
2196
2212
|
dispose: () => r("disposed"),
|
|
2197
2213
|
onUse: () => i.counter++
|
|
2198
2214
|
};
|
|
2199
2215
|
}
|
|
2200
|
-
}),
|
|
2216
|
+
}), Ns = qt(Symbol("GlobalProbe")), Ft = (s, e) => (t) => {
|
|
2201
2217
|
const r = t.getStyle(s);
|
|
2202
2218
|
return t.setStyle(s, e), (n) => {
|
|
2203
2219
|
n && t.setStyle(s, r);
|
|
2204
2220
|
};
|
|
2205
|
-
},
|
|
2221
|
+
}, Bt = (s, e) => (t) => {
|
|
2206
2222
|
const r = t.getStyle(s), n = e.on((i) => t.setStyle(s, i));
|
|
2207
2223
|
return (i) => {
|
|
2208
2224
|
n(), i && t.setStyle(s, r);
|
|
2209
2225
|
};
|
|
2210
|
-
},
|
|
2226
|
+
}, Te = (s, e) => y.is(e) ? Bt(s, e) : Ft(s, e), Rs = new Proxy({}, {
|
|
2211
2227
|
/**
|
|
2212
2228
|
* Creates a renderable component for the specified `style` property.
|
|
2213
2229
|
*
|
|
@@ -2216,8 +2232,8 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
2216
2232
|
* @returns The renderable component for the specified attribute.
|
|
2217
2233
|
*
|
|
2218
2234
|
*/
|
|
2219
|
-
get: (s, e) => e === "variable" ? (t, r) =>
|
|
2220
|
-
}),
|
|
2235
|
+
get: (s, e) => e === "variable" ? (t, r) => Te(t, r) : (t) => Te(e, t)
|
|
2236
|
+
}), Wt = (s) => (e) => {
|
|
2221
2237
|
if (e.isBrowser()) {
|
|
2222
2238
|
const t = s(e);
|
|
2223
2239
|
if (t != null)
|
|
@@ -2225,11 +2241,11 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
2225
2241
|
}
|
|
2226
2242
|
return () => {
|
|
2227
2243
|
};
|
|
2228
|
-
},
|
|
2244
|
+
}, Vs = (s) => (e) => {
|
|
2229
2245
|
const t = s(e);
|
|
2230
2246
|
return t == null ? () => {
|
|
2231
2247
|
} : f(t)(e);
|
|
2232
|
-
},
|
|
2248
|
+
}, js = (s) => Wt((e) => s(e.element)), qs = (s) => (e) => {
|
|
2233
2249
|
if (e.isHeadlessDOM()) {
|
|
2234
2250
|
const t = s(e);
|
|
2235
2251
|
if (t)
|
|
@@ -2237,7 +2253,7 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
2237
2253
|
}
|
|
2238
2254
|
return () => {
|
|
2239
2255
|
};
|
|
2240
|
-
},
|
|
2256
|
+
}, pe = (s) => (e) => {
|
|
2241
2257
|
let t = e;
|
|
2242
2258
|
function r() {
|
|
2243
2259
|
return t;
|
|
@@ -2247,137 +2263,137 @@ const Tt = /* @__PURE__ */ new Set([
|
|
|
2247
2263
|
}
|
|
2248
2264
|
const i = [], l = s({
|
|
2249
2265
|
use: ({ mark: c }) => {
|
|
2250
|
-
const { value:
|
|
2251
|
-
return
|
|
2266
|
+
const { value: a, onUse: u } = r().getProvider(c);
|
|
2267
|
+
return u == null || u(), a;
|
|
2252
2268
|
},
|
|
2253
|
-
set: ({ mark: c, create:
|
|
2254
|
-
const { value: h, dispose:
|
|
2255
|
-
i.push(
|
|
2269
|
+
set: ({ mark: c, create: a }, u) => {
|
|
2270
|
+
const { value: h, dispose: d, onUse: p } = a(u, r());
|
|
2271
|
+
i.push(d), n(r().setProvider(c, h, p));
|
|
2256
2272
|
}
|
|
2257
2273
|
});
|
|
2258
2274
|
return l == null ? () => {
|
|
2259
|
-
} :
|
|
2275
|
+
} : _(
|
|
2260
2276
|
f(l),
|
|
2261
|
-
|
|
2277
|
+
F(() => i.forEach((c) => c()))
|
|
2262
2278
|
)(r());
|
|
2263
|
-
},
|
|
2279
|
+
}, Fs = (s, e, t) => pe(({ set: r }) => (r(s, e), t())), Bs = (s, e) => pe(({ use: t }) => e(t(s))), Ws = (...s) => (e) => pe(({ use: t }) => {
|
|
2264
2280
|
const r = s.map(t);
|
|
2265
2281
|
return e(...r);
|
|
2266
2282
|
});
|
|
2267
2283
|
export {
|
|
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
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2284
|
+
gs as Async,
|
|
2285
|
+
Es as BindChecked,
|
|
2286
|
+
Ss as BindDate,
|
|
2287
|
+
vs as BindDateTime,
|
|
2288
|
+
As as BindNumber,
|
|
2289
|
+
_s as BindText,
|
|
2290
|
+
R as BrowserContext,
|
|
2291
|
+
Y as CLASS_PLACEHOLDER_ATTR,
|
|
2292
|
+
N as Computed,
|
|
2293
|
+
Ps as Conjunction,
|
|
2294
|
+
Ls as DOMNode,
|
|
2295
|
+
Ne as El,
|
|
2296
|
+
Re as ElNS,
|
|
2297
|
+
ce as ElementPosition,
|
|
2298
|
+
x as Empty,
|
|
2299
|
+
Ds as Ensure,
|
|
2300
|
+
Ms as EnsureAll,
|
|
2301
|
+
Is as ForEach,
|
|
2302
|
+
_ as Fragment,
|
|
2303
|
+
Ns as GlobalProbe,
|
|
2304
|
+
is as HeadlessAdapter,
|
|
2305
|
+
V as HeadlessContext,
|
|
2306
|
+
_t as HeadlessElement,
|
|
2307
|
+
He as HeadlessPortal,
|
|
2308
|
+
Et as HeadlessText,
|
|
2309
|
+
Hs as MapSignal,
|
|
2310
|
+
ve as MemoryStore,
|
|
2311
|
+
ks as NotEmpty,
|
|
2312
|
+
It as OnChecked,
|
|
2313
|
+
F as OnDispose,
|
|
2314
|
+
ne as OneOf,
|
|
2315
|
+
qe as OneOfField,
|
|
2316
|
+
Cs as OneOfKind,
|
|
2317
|
+
ws as OneOfTuple,
|
|
2318
|
+
xs as OneOfType,
|
|
2319
|
+
jt as OneOfValue,
|
|
2320
|
+
$s as Portal,
|
|
2321
|
+
G as Prop,
|
|
2322
|
+
Fs as Provide,
|
|
2323
|
+
Le as ProviderNotFoundError,
|
|
2324
|
+
ct as RenderingError,
|
|
2325
|
+
Be as Repeat,
|
|
2326
|
+
y as Signal,
|
|
2327
|
+
Ve as Task,
|
|
2328
|
+
ls as TextNode,
|
|
2329
|
+
Os as Unless,
|
|
2330
|
+
Bs as Use,
|
|
2331
|
+
Ws as UseMany,
|
|
2332
|
+
b as Value,
|
|
2333
|
+
Fe as When,
|
|
2334
|
+
Wt as WithBrowserCtx,
|
|
2335
|
+
Vs as WithCtx,
|
|
2336
|
+
js as WithElement,
|
|
2337
|
+
qs as WithHeadlessCtx,
|
|
2338
|
+
pe as WithProvider,
|
|
2339
|
+
De as _NODE_PLACEHOLDER_ATTR,
|
|
2340
|
+
ot as _getSelfOrParentElement,
|
|
2341
|
+
Pe as _isElement,
|
|
2342
|
+
it as _makeGetter,
|
|
2343
|
+
nt as _makeSetter,
|
|
2344
|
+
X as _removeDOMNode,
|
|
2345
|
+
$e as _signalText,
|
|
2346
|
+
ke as _staticText,
|
|
2347
|
+
Qt as animateSignal,
|
|
2348
|
+
st as animateSignals,
|
|
2349
|
+
as as aria,
|
|
2350
|
+
q as attr,
|
|
2351
|
+
ts as bind,
|
|
2352
|
+
ss as coalesce,
|
|
2353
|
+
ae as computed,
|
|
2354
|
+
he as computedOf,
|
|
2355
|
+
rt as computedRecord,
|
|
2356
|
+
cs as dataAttr,
|
|
2357
|
+
zt as delaySignal,
|
|
2358
|
+
ze as effect,
|
|
2359
|
+
Gt as effectOf,
|
|
2360
|
+
Ht as emit,
|
|
2361
|
+
Ts as emitChecked,
|
|
2362
|
+
I as emitTarget,
|
|
2363
|
+
kt as emitValue,
|
|
2364
|
+
Nt as emitValueAsDate,
|
|
2365
|
+
Rt as emitValueAsDateTime,
|
|
2366
|
+
ys as emitValueAsNullableDate,
|
|
2367
|
+
bs as emitValueAsNullableDateTime,
|
|
2368
|
+
$t as emitValueAsNumber,
|
|
2369
|
+
Ye as endInterpolate,
|
|
2370
|
+
ue as getWindow,
|
|
2371
|
+
Qe as guessInterpolate,
|
|
2372
|
+
fs as html,
|
|
2373
|
+
ds as input,
|
|
2374
|
+
Xe as interpolateDate,
|
|
2375
|
+
Je as interpolateNumber,
|
|
2376
|
+
Ge as interpolateString,
|
|
2377
|
+
Jt as joinSignals,
|
|
2378
|
+
Xt as localStorageProp,
|
|
2379
|
+
qt as makeProbe,
|
|
2380
|
+
lt as makeProviderMark,
|
|
2381
|
+
ms as math,
|
|
2382
|
+
hs as mathAttr,
|
|
2383
|
+
Zt as merge,
|
|
2384
|
+
re as on,
|
|
2385
|
+
Kt as previousSignal,
|
|
2386
|
+
w as prop,
|
|
2387
|
+
rs as render,
|
|
2388
|
+
fe as renderWithContext,
|
|
2373
2389
|
f as renderableOfTNode,
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2390
|
+
os as restoreTempoPlaceholders,
|
|
2391
|
+
ns as runHeadless,
|
|
2392
|
+
Yt as sessionStorageProp,
|
|
2393
|
+
te as signal,
|
|
2394
|
+
es as slidingWindowSignal,
|
|
2395
|
+
Ae as storedProp,
|
|
2396
|
+
Rs as style,
|
|
2397
|
+
ps as svg,
|
|
2398
|
+
us as svgAttr
|
|
2383
2399
|
};
|