@tempots/dom 24.0.0-next.5 → 24.0.0-next.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,65 +1,65 @@
1
- var De = Object.defineProperty;
2
- var X = (s) => {
3
- throw TypeError(s);
1
+ var $e = Object.defineProperty;
2
+ var te = (t) => {
3
+ throw TypeError(t);
4
4
  };
5
- var Oe = (s, e, t) => e in s ? De(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
6
- var i = (s, e, t) => Oe(s, typeof e != "symbol" ? e + "" : e, t), Y = (s, e, t) => e.has(s) || X("Cannot " + t);
7
- var A = (s, e, t) => (Y(s, e, "read from private field"), t ? t.call(s) : e.get(s)), Z = (s, e, t) => e.has(s) ? X("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), U = (s, e, t, r) => (Y(s, e, "write to private field"), r ? r.call(s, t) : e.set(s, t), t);
8
- const Ae = (s, e, t) => s + (e - s) * t;
9
- const Me = (s, e, t) => {
10
- const r = Math.max(s.length, e.length);
5
+ var Ie = (t, e, s) => e in t ? $e(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
6
+ var o = (t, e, s) => Ie(t, typeof e != "symbol" ? e + "" : e, s), se = (t, e, s) => e.has(t) || te("Cannot " + s);
7
+ var O = (t, e, s) => (se(t, e, "read from private field"), s ? s.call(t) : e.get(t)), re = (t, e, s) => e.has(t) ? te("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), Y = (t, e, s, r) => (se(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s);
8
+ const ke = (t, e, s) => t + (e - t) * s;
9
+ const Ne = (t, e, s) => {
10
+ const r = Math.max(t.length, e.length);
11
11
  let n = "";
12
- for (let o = 0; o < r; o++) {
13
- let l = s.charCodeAt(o);
12
+ for (let i = 0; i < r; i++) {
13
+ let l = t.charCodeAt(i);
14
14
  isNaN(l) && (l = 97);
15
- let c = e.charCodeAt(o);
16
- isNaN(c) && (c = 97), n += String.fromCharCode(l + (c - l) * t);
15
+ let c = e.charCodeAt(i);
16
+ isNaN(c) && (c = 97), n += String.fromCharCode(l + (c - l) * s);
17
17
  }
18
18
  return n;
19
- }, ke = (s, e, t) => new Date(s.getTime() + (e.getTime() - s.getTime()) * t), Le = (s, e) => e, $e = (s) => typeof s == "number" ? Ae : typeof s == "string" ? Me : s instanceof Date ? ke : Le;
19
+ }, Re = (t, e, s) => new Date(t.getTime() + (e.getTime() - t.getTime()) * s), Ve = (t, e) => e, je = (t) => typeof t == "number" ? ke : typeof t == "string" ? Ne : t instanceof Date ? Re : Ve;
20
20
  var w;
21
- class M {
21
+ class D {
22
22
  /**
23
23
  * Creates a new instance of `ElementPosition`.
24
24
  * @param index - The index of the element.
25
25
  * @param total - The total number of elements in the collection.
26
26
  */
27
- constructor(e, t) {
27
+ constructor(e, s) {
28
28
  /**
29
29
  * The counter of the element starting from 1.
30
30
  */
31
- i(this, "counter");
31
+ o(this, "counter");
32
32
  /**
33
33
  * Checks if the element is the first element in the collection.
34
34
  * @returns `true` if the element is the first element, `false` otherwise.
35
35
  */
36
- i(this, "isFirst");
36
+ o(this, "isFirst");
37
37
  /**
38
38
  * Checks if the counter of the element is even.
39
39
  * @returns `true` if the counter is even, `false` otherwise.
40
40
  */
41
- i(this, "isEven");
41
+ o(this, "isEven");
42
42
  /**
43
43
  * Checks if the counter of the element is odd.
44
44
  * @returns `true` if the counter is odd, `false` otherwise.
45
45
  */
46
- i(this, "isOdd");
47
- Z(this, w);
48
- i(this, "dispose", () => {
49
- A(this, w) != null && (A(this, w).dispose(), U(this, w, void 0));
46
+ o(this, "isOdd");
47
+ re(this, w);
48
+ o(this, "dispose", () => {
49
+ O(this, w) != null && (O(this, w).dispose(), Y(this, w, void 0));
50
50
  });
51
- this.index = e, this.total = t, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
51
+ this.index = e, this.total = s, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
52
52
  }
53
53
  /**
54
54
  * Checks if the element is the last element in the collection.
55
55
  * @returns `true` if the element is the last element, `false` otherwise.
56
56
  */
57
57
  get isLast() {
58
- return A(this, w) == null && U(this, w, this.total.map((e) => this.counter === e)), A(this, w);
58
+ return O(this, w) == null && Y(this, w, this.total.map((e) => this.counter === e)), O(this, w);
59
59
  }
60
60
  }
61
61
  w = new WeakMap();
62
- const k = class k {
62
+ const M = class M {
63
63
  /**
64
64
  * Represents a signal with a value of type T.
65
65
  *
@@ -67,37 +67,37 @@ const k = class k {
67
67
  * @param equals - A function that determines whether two values of type T are equal.
68
68
  * @public
69
69
  */
70
- constructor(e, t) {
70
+ constructor(e, s) {
71
71
  /**
72
72
  * @internal
73
73
  */
74
- i(this, "$__signal__", !0);
74
+ o(this, "$__signal__", !0);
75
75
  /**
76
76
  * @internal
77
77
  */
78
- i(this, "_value");
78
+ o(this, "_value");
79
79
  /**
80
80
  * @internal
81
81
  */
82
- i(this, "_derivatives", []);
82
+ o(this, "_derivatives", []);
83
83
  /**
84
84
  * @internal
85
85
  */
86
- i(this, "_onValueListeners", []);
86
+ o(this, "_onValueListeners", []);
87
87
  /**
88
88
  * @internal
89
89
  */
90
- i(this, "_onDisposeListeners", []);
90
+ o(this, "_onDisposeListeners", []);
91
91
  /**
92
92
  * Gets the current value of the signal.
93
93
  * @returns The current value of the signal.
94
94
  */
95
- i(this, "get", () => this._value);
95
+ o(this, "get", () => this._value);
96
96
  /**
97
97
  * Checks if the signal has any registered listeners.
98
98
  * @returns `true` if the signal has listeners, `false` otherwise.
99
99
  */
100
- i(this, "hasListeners", () => this._onValueListeners.length > 0);
100
+ o(this, "hasListeners", () => this._onValueListeners.length > 0);
101
101
  /**
102
102
  * Registers a listener function to be called whenever the value of the signal changes.
103
103
  * The listener function will be immediately called with the current value of the signal.
@@ -105,37 +105,37 @@ const k = class k {
105
105
  *
106
106
  * @param listener - The listener function to be called when the value of the signal changes.
107
107
  */
108
- i(this, "on", (e) => (e(this.get()), this._onValueListeners.push(e), () => {
108
+ o(this, "on", (e) => (e(this.get()), this._onValueListeners.push(e), () => {
109
109
  this._onValueListeners.splice(this._onValueListeners.indexOf(e), 1);
110
110
  }));
111
111
  /**
112
112
  * @internal
113
113
  */
114
- i(this, "_setAndNotify", (e, t) => {
114
+ o(this, "_setAndNotify", (e, s) => {
115
115
  const r = this.equals(this._value, e);
116
- r || (this._value = e), (t || !r) && this._onValueListeners.forEach((n) => n(e));
116
+ r || (this._value = e), (s || !r) && this._onValueListeners.forEach((n) => n(e));
117
117
  });
118
118
  /**
119
119
  * @internal
120
120
  */
121
- i(this, "_disposed", !1);
121
+ o(this, "_disposed", !1);
122
122
  /**
123
123
  * Checks whether the signal is disposed.
124
124
  * @returns True if the signal is disposed, false otherwise.
125
125
  */
126
- i(this, "isDisposed", () => this._disposed);
126
+ o(this, "isDisposed", () => this._disposed);
127
127
  /**
128
128
  * Adds a listener function to be called when the object is disposed.
129
129
  * @param listener - The listener function to be called when the object is disposed.
130
130
  * @returns A function that can be called to remove the listener.
131
131
  */
132
- i(this, "onDispose", (e) => {
132
+ o(this, "onDispose", (e) => {
133
133
  this._onDisposeListeners.push(e);
134
134
  });
135
135
  /**
136
136
  * Disposes the signal, releasing any resources associated with it.
137
137
  */
138
- i(this, "dispose", () => {
138
+ o(this, "dispose", () => {
139
139
  this._disposed || (this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
140
140
  });
141
141
  /**
@@ -147,14 +147,14 @@ const k = class k {
147
147
  * @param equals - Optional equality function to determine if two mapped values are equal.
148
148
  * @returns - A new Computed instance with the mapped value.
149
149
  */
150
- i(this, "map", (e, t = (r, n) => r === n) => {
151
- const r = new C(() => {
150
+ o(this, "map", (e, s = (r, n) => r === n) => {
151
+ const r = new v(() => {
152
152
  try {
153
153
  return e(this.get());
154
154
  } catch (n) {
155
155
  throw console.error("Error in Signal.map:", n), n;
156
156
  }
157
- }, t);
157
+ }, s);
158
158
  return this.setDerivative(r), r;
159
159
  });
160
160
  /**
@@ -167,14 +167,14 @@ const k = class k {
167
167
  * Defaults to a strict equality check (===).
168
168
  * @returns A new Signal that emits the values of the resulting Signal.
169
169
  */
170
- i(this, "flatMap", (e, t = (r, n) => r === n) => {
171
- const r = new C(() => {
170
+ o(this, "flatMap", (e, s = (r, n) => r === n) => {
171
+ const r = new v(() => {
172
172
  try {
173
173
  return e(this.get()).get();
174
174
  } catch (n) {
175
175
  throw console.error("Error in Signal.flatMap:", n), n;
176
176
  }
177
- }, t);
177
+ }, s);
178
178
  return this.setDerivative(r), r;
179
179
  });
180
180
  /**
@@ -183,26 +183,26 @@ const k = class k {
183
183
  * @param fn - The callback function to be invoked with the current value of the signal.
184
184
  * @returns A new signal that emits the same value as the original signal and invokes the callback function.
185
185
  */
186
- i(this, "tap", (e) => this.map((t) => (e(t), t)));
186
+ o(this, "tap", (e) => this.map((s) => (e(s), s)));
187
187
  /**
188
188
  * Returns a new Signal that emits the value at the specified key of the current value.
189
189
  *
190
190
  * @param key - The key of the value to retrieve.
191
191
  * @returns A new Signal that emits the value at the specified key.
192
192
  */
193
- i(this, "at", (e) => this.map((t) => t[e]));
193
+ o(this, "at", (e) => this.map((s) => s[e]));
194
194
  /**
195
195
  * @internal
196
196
  */
197
- i(this, "_$");
198
- i(this, "filter", (e, t) => {
199
- let r = t ?? this.get();
200
- const n = new C(() => {
197
+ o(this, "_$");
198
+ o(this, "filter", (e, s) => {
199
+ let r = s ?? this.get();
200
+ const n = new v(() => {
201
201
  try {
202
- const o = this.get();
203
- return r = e(o) ? o : r;
204
- } catch (o) {
205
- throw console.error("Error in Signal.filter:", o), o;
202
+ const i = this.get();
203
+ return r = e(i) ? i : r;
204
+ } catch (i) {
205
+ throw console.error("Error in Signal.filter:", i), i;
206
206
  }
207
207
  }, this.equals);
208
208
  return this.setDerivative(n), n;
@@ -217,9 +217,9 @@ const k = class k {
217
217
  * @param equals - Optional equality function to determine if two values are equal.
218
218
  * @returns - A new Computed object with the mapped and filtered values.
219
219
  */
220
- i(this, "filterMap", (e, t, r = (n, o) => n === o) => {
221
- let n = t;
222
- const o = new C(() => {
220
+ o(this, "filterMap", (e, s, r = (n, i) => n === i) => {
221
+ let n = s;
222
+ const i = new v(() => {
223
223
  try {
224
224
  const l = this.get(), c = e(l);
225
225
  return n = c ?? n;
@@ -227,7 +227,7 @@ const k = class k {
227
227
  throw console.error("Error in Signal.filterMap:", l), l;
228
228
  }
229
229
  }, r);
230
- return this.setDerivative(o), o;
230
+ return this.setDerivative(i), i;
231
231
  });
232
232
  /**
233
233
  * Maps the values emitted by the signal to a new value asynchronously using the provided function.
@@ -242,25 +242,25 @@ const k = class k {
242
242
  * @param equals - The equality function to compare the mapped values for equality.
243
243
  * @returns A property that holds the mapped value and can be observed for changes.
244
244
  */
245
- i(this, "mapAsync", (e, t, r, n = (o, l) => o === l) => {
246
- const o = I(t, n);
245
+ o(this, "mapAsync", (e, s, r, n = (i, l) => i === l) => {
246
+ const i = N(s, n);
247
247
  let l = 0, c = new AbortController();
248
- return o.onDispose(
248
+ return i.onDispose(
249
249
  this.on(async (a) => {
250
- const f = ++l;
250
+ const u = ++l;
251
251
  c.abort(), c = new AbortController();
252
252
  try {
253
253
  const h = await e(a, { abortSignal: c.signal });
254
- f === l && o.set(h);
254
+ u === l && i.set(h);
255
255
  } catch (h) {
256
- if (f === l)
256
+ if (u === l)
257
257
  if (r != null)
258
- o.set(r(h));
258
+ i.set(r(h));
259
259
  else
260
260
  throw h;
261
261
  }
262
262
  })
263
- ), o;
263
+ ), i;
264
264
  });
265
265
  /**
266
266
  * Maps the values of the signal using the provided function `fn`, and returns a new signal
@@ -272,28 +272,28 @@ const k = class k {
272
272
  * @param alt - The alternative value to use when the mapped value is `undefined` or `null`.
273
273
  * @returns A new signal containing the mapped values.
274
274
  */
275
- i(this, "mapMaybe", (e, t) => this.map((r) => e(r) ?? t));
275
+ o(this, "mapMaybe", (e, s) => this.map((r) => e(r) ?? s));
276
276
  /**
277
277
  * Feeds a property into the signal and sets up disposal behavior.
278
278
  * @param prop - The property to feed into the signal.
279
279
  * @param autoDisposeProp - Determines whether the property should be automatically disposed when the signal is disposed.
280
280
  * @returns The input property.
281
281
  */
282
- i(this, "feedProp", (e, t = !1) => {
282
+ o(this, "feedProp", (e, s = !1) => {
283
283
  const r = this.on(e.set);
284
- return e.onDispose(r), t ? this.onDispose(e.dispose) : this.onDispose(r), e;
284
+ return e.onDispose(r), s ? this.onDispose(e.dispose) : this.onDispose(r), e;
285
285
  });
286
286
  /**
287
287
  * Derives a new property from the current signal.
288
288
  * @param autoDisposeProp - Determines whether the derived property should be automatically disposed.
289
289
  * @returns The derived property.
290
290
  */
291
- i(this, "deriveProp", (e = !0) => this.feedProp(I(this.get()), e));
291
+ o(this, "deriveProp", (e = !0) => this.feedProp(N(this.get()), e));
292
292
  /**
293
293
  * Returns a signal that emits the count of values received so far.
294
294
  * @returns A signal that emits the count of values received so far.
295
295
  */
296
- i(this, "count", () => {
296
+ o(this, "count", () => {
297
297
  let e = 0;
298
298
  return this.map(() => ++e);
299
299
  });
@@ -303,7 +303,7 @@ const k = class k {
303
303
  * Additionally, when the computed value is disposed, it sets the signal as dirty.
304
304
  * @param computed - The computed value to add as a derivative.
305
305
  */
306
- i(this, "setDerivative", (e) => {
306
+ o(this, "setDerivative", (e) => {
307
307
  this._derivatives.push(e), e.onDispose(() => {
308
308
  this._derivatives.splice(
309
309
  this._derivatives.indexOf(e),
@@ -311,7 +311,7 @@ const k = class k {
311
311
  );
312
312
  }), e.onDispose(this.on(e.setDirty)), this.onDispose(e.dispose);
313
313
  });
314
- this.equals = t, this._value = e;
314
+ this.equals = s, this._value = e;
315
315
  }
316
316
  /**
317
317
  * Gets the value of the signal.
@@ -326,7 +326,7 @@ const k = class k {
326
326
  */
327
327
  get $() {
328
328
  return this._$ !== void 0 ? this._$ : this._$ = new Proxy(this, {
329
- get: (e, t) => this.at(t)
329
+ get: (e, s) => this.at(s)
330
330
  });
331
331
  }
332
332
  };
@@ -340,68 +340,68 @@ const k = class k {
340
340
  * @param equals - A function to compare two values of type O for equality. Defaults to strict equality (===).
341
341
  * @returns - A Signal that represents the result of the Promise.
342
342
  */
343
- i(k, "ofPromise", (e, t, r, n = (o, l) => o === l) => {
344
- const o = new k(t, n);
345
- return e.then((l) => o._setAndNotify(l, !1)).catch((l) => {
346
- r != null ? o._setAndNotify(r(l), !1) : console.error(
343
+ o(M, "ofPromise", (e, s, r, n = (i, l) => i === l) => {
344
+ const i = new M(s, n);
345
+ return e.then((l) => i._setAndNotify(l, !1)).catch((l) => {
346
+ r != null ? i._setAndNotify(r(l), !1) : console.error(
347
347
  "Unhandled promise rejection in Signal.ofPromise:",
348
348
  l
349
349
  );
350
- }), o;
350
+ }), i;
351
351
  }), /**
352
352
  * Checks if a value is a Signal.
353
353
  *
354
354
  * @param value - The value to check.
355
355
  * @returns `true` if the value is a Signal, `false` otherwise.
356
356
  */
357
- i(k, "is", (e) => (
357
+ o(M, "is", (e) => (
358
358
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
359
359
  e != null && e.$__signal__ === !0
360
360
  ));
361
- let d = k;
362
- const Ne = typeof queueMicrotask == "function" ? queueMicrotask : (s) => Promise.resolve().then(s);
363
- class C extends d {
361
+ let d = M;
362
+ const qe = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
363
+ class v extends d {
364
364
  /**
365
365
  * Represents a Signal object.
366
366
  * @param _fn - The function that returns the value of the signal.
367
367
  * @param equals - The function used to compare two values of type T for equality.
368
368
  */
369
- constructor(t, r) {
369
+ constructor(s, r) {
370
370
  super(void 0, r);
371
371
  /**
372
372
  * @internal
373
373
  */
374
- i(this, "$__computed__", !0);
374
+ o(this, "$__computed__", !0);
375
375
  /**
376
376
  * @internal
377
377
  */
378
- i(this, "_isDirty", !1);
378
+ o(this, "_isDirty", !1);
379
379
  /**
380
380
  * Marks the signal as dirty, indicating that its value has changed and needs to be recalculated.
381
381
  * If the signal is already dirty or disposed, this method does nothing.
382
382
  * It also marks all dependent signals as dirty and schedules a notification to update their values.
383
383
  */
384
- i(this, "setDirty", () => {
385
- this._isDirty || this._disposed || (this._isDirty = !0, this._derivatives.forEach((t) => t.setDirty()), this._scheduleNotify());
384
+ o(this, "setDirty", () => {
385
+ this._isDirty || this._disposed || (this._isDirty = !0, this._derivatives.forEach((s) => s.setDirty()), this._scheduleNotify());
386
386
  });
387
387
  /**
388
388
  * @internal
389
389
  */
390
- i(this, "_scheduleCount", 0);
390
+ o(this, "_scheduleCount", 0);
391
391
  /**
392
392
  * Schedules a notification to be executed asynchronously.
393
393
  * If the signal is dirty, it will be updated and notified.
394
394
  * @internal
395
395
  */
396
- i(this, "_scheduleNotify", () => {
397
- const t = ++this._scheduleCount;
398
- Ne(() => {
399
- this._scheduleCount !== t || this._disposed !== !1 || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn(), !1));
396
+ o(this, "_scheduleNotify", () => {
397
+ const s = ++this._scheduleCount;
398
+ qe(() => {
399
+ this._scheduleCount !== s || this._disposed !== !1 || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn(), !1));
400
400
  });
401
401
  });
402
402
  /** {@inheritDoc Signal.get} */
403
- i(this, "get", () => (this._isDirty && (this._isDirty = !1, this._value = this._fn(), this._setAndNotify(this._value, !0)), this._value));
404
- this._fn = t, this.setDirty();
403
+ o(this, "get", () => (this._isDirty && (this._isDirty = !1, this._value = this._fn(), this._setAndNotify(this._value, !0)), this._value));
404
+ this._fn = s, this.setDirty();
405
405
  }
406
406
  /**
407
407
  * Checks if a value is an instance of `Computed`.
@@ -409,35 +409,35 @@ class C extends d {
409
409
  * @param value - The value to check.
410
410
  * @returns `true` if the value is an instance of `Computed`, `false` otherwise.
411
411
  */
412
- static is(t) {
413
- return t != null && t.$__computed__ === !0;
412
+ static is(s) {
413
+ return s != null && s.$__computed__ === !0;
414
414
  }
415
415
  /** {@inheritDoc Signal.value} */
416
416
  get value() {
417
417
  return this.get();
418
418
  }
419
419
  }
420
- const R = class R extends d {
420
+ const W = class W extends d {
421
421
  constructor() {
422
422
  super(...arguments);
423
423
  /**
424
424
  * @internal
425
425
  */
426
- i(this, "$__prop__", !0);
426
+ o(this, "$__prop__", !0);
427
427
  /**
428
428
  * Changes the value of the property and notifies its listeners.
429
429
  *
430
430
  * @param value - The new value of the property.
431
431
  */
432
- i(this, "set", (t) => {
433
- this._setAndNotify(t, !1);
432
+ o(this, "set", (s) => {
433
+ this._setAndNotify(s, !1);
434
434
  });
435
435
  /**
436
436
  * Updates the value of the signal by applying the provided function to the current value.
437
437
  * @param fn - The function to apply to the current value.
438
438
  */
439
- i(this, "update", (t) => {
440
- this._setAndNotify(t(this.get()), !1);
439
+ o(this, "update", (s) => {
440
+ this._setAndNotify(s(this.get()), !1);
441
441
  });
442
442
  /**
443
443
  * Creates a reducer function that combines the provided reducer function and effects.
@@ -445,16 +445,16 @@ const R = class R extends d {
445
445
  * @param effects - An array of effects to be executed after the state is updated.
446
446
  * @returns A dispatch function that can be used to update the state and trigger the effects.
447
447
  */
448
- i(this, "reducer", (t, ...r) => {
448
+ o(this, "reducer", (s, ...r) => {
449
449
  const n = this;
450
- return function o(l) {
450
+ return function i(l) {
451
451
  const c = n.value;
452
- n.update((a) => t(a, l)), !n.equals(c, n.value) && r.forEach(
452
+ n.update((a) => s(a, l)), !n.equals(c, n.value) && r.forEach(
453
453
  (a) => a({
454
454
  previousState: c,
455
455
  state: n.value,
456
456
  action: l,
457
- dispatch: o
457
+ dispatch: i
458
458
  })
459
459
  );
460
460
  };
@@ -470,9 +470,9 @@ const R = class R extends d {
470
470
  * Defaults to a strict equality check (===).
471
471
  * @returns A Prop object representing the isomorphism.
472
472
  */
473
- i(this, "iso", (t, r, n = (o, l) => o === l) => {
474
- const o = new R(t(this.get()), n);
475
- return o.onDispose(this.on((l) => o.set(t(l)))), o.on((l) => this._setAndNotify(r(l), !1)), o;
473
+ o(this, "iso", (s, r, n = (i, l) => i === l) => {
474
+ const i = new W(s(this.get()), n);
475
+ return i.onDispose(this.on((l) => i.set(s(l)))), i.on((l) => this._setAndNotify(r(l), !1)), i;
476
476
  });
477
477
  /**
478
478
  * Returns a `Prop` that represents the value at the specified key of the current value.
@@ -480,9 +480,9 @@ const R = class R extends d {
480
480
  * @param key - The key of the value to access.
481
481
  * @returns A `Prop` that represents the value at the specified key.
482
482
  */
483
- i(this, "atProp", (t) => this.iso(
484
- (r) => r[t],
485
- (r) => ({ ...this.value, [t]: r })
483
+ o(this, "atProp", (s) => this.iso(
484
+ (r) => r[s],
485
+ (r) => ({ ...this.value, [s]: r })
486
486
  ));
487
487
  }
488
488
  /**
@@ -491,8 +491,8 @@ const R = class R extends d {
491
491
  get value() {
492
492
  return this.get();
493
493
  }
494
- set value(t) {
495
- this._setAndNotify(t, !1);
494
+ set value(s) {
495
+ this._setAndNotify(s, !1);
496
496
  }
497
497
  };
498
498
  /**
@@ -500,15 +500,15 @@ const R = class R extends d {
500
500
  * @param value - The value to check.
501
501
  * @returns `true` if the value is a Prop, `false` otherwise.
502
502
  */
503
- i(R, "is", (t) => (
503
+ o(W, "is", (s) => (
504
504
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
505
- t != null && t.$__prop__ === !0
505
+ s != null && s.$__prop__ === !0
506
506
  ));
507
- let H = R;
508
- const G = (s, e, t = (r, n) => r === n) => {
509
- const r = new C(s, t);
507
+ let k = W;
508
+ const Q = (t, e, s = (r, n) => r === n) => {
509
+ const r = new v(t, s);
510
510
  return e.forEach((n) => n.setDerivative(r)), r;
511
- }, He = (s, e) => G(s, e).dispose, I = (s, e = (t, r) => t === r) => new H(s, e), j = (s, e = (t, r) => t === r) => new d(s, e), ee = () => typeof window < "u" ? window : void 0, p = {
511
+ }, Be = (t, e) => Q(t, e).dispose, N = (t, e = (s, r) => s === r) => new k(t, e), J = (t, e = (s, r) => s === r) => new d(t, e), ie = () => typeof window < "u" ? window : void 0, p = {
512
512
  /**
513
513
  * Maps a value or a Signal to a new value.
514
514
  * If the value is a Signal, it returns a new Signal with the mapped value.
@@ -520,7 +520,7 @@ const G = (s, e, t = (r, n) => r === n) => {
520
520
  * @param fn - The function to map the value.
521
521
  * @returns The mapped value.
522
522
  */
523
- map: (s, e) => d.is(s) ? s.map(e) : e(s),
523
+ map: (t, e) => d.is(t) ? t.map(e) : e(t),
524
524
  /**
525
525
  * Wraps a value or a Signal instance into a Signal.
526
526
  * If the value is already a Signal, it returns the value itself.
@@ -531,30 +531,30 @@ const G = (s, e, t = (r, n) => r === n) => {
531
531
  * @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
532
532
  * @returns A Signal instance.
533
533
  */
534
- toSignal: (s, e) => d.is(s) ? s : j(s, e),
534
+ toSignal: (t, e) => d.is(t) ? t : J(t, e),
535
535
  /**
536
536
  * Wraps a value in a `Signal` if it is not already a `Signal`.
537
537
  * If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
538
538
  * @param value - The value to wrap or check.
539
539
  * @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
540
540
  */
541
- maybeToSignal: (s, e) => {
542
- if (s != null)
543
- return p.toSignal(s, e);
541
+ maybeToSignal: (t, e) => {
542
+ if (t != null)
543
+ return p.toSignal(t, e);
544
544
  },
545
545
  /**
546
546
  * Gets the value from a `Signal` or the value itself if it is not a `Signal`.
547
547
  * @param value - The value or Signal instance to get the value from.
548
548
  * @returns The value.
549
549
  */
550
- get: (s) => d.is(s) ? s.get() : s,
550
+ get: (t) => d.is(t) ? t.get() : t,
551
551
  /**
552
552
  * Adds a listener to a `Signal` or calls the listener immediately if it is not a `Signal`.
553
553
  * @param value - The value or Signal instance to add the listener to.
554
554
  * @param listener - The listener to call when the value changes.
555
555
  * @returns A function to remove the listener.
556
556
  */
557
- on: (s, e) => d.is(s) ? s.on(e) : (e(s), () => {
557
+ on: (t, e) => d.is(t) ? t.on(e) : (e(t), () => {
558
558
  }),
559
559
  /**
560
560
  * Disposes of a value or a Signal.
@@ -562,109 +562,109 @@ const G = (s, e, t = (r, n) => r === n) => {
562
562
  * If the value is not a Signal, it does nothing.
563
563
  * @param value - The value or Signal instance to dispose of.
564
564
  */
565
- dispose: (s) => {
566
- d.is(s) && s.dispose();
565
+ dispose: (t) => {
566
+ d.is(t) && t.dispose();
567
567
  }
568
- }, yt = (...s) => (e, t) => {
569
- const r = s.filter((n) => d.is(n));
570
- return G(
571
- () => e(...s.map((n) => p.get(n))),
568
+ }, $t = (...t) => (e, s) => {
569
+ const r = t.filter((n) => d.is(n));
570
+ return Q(
571
+ () => e(...t.map((n) => p.get(n))),
572
572
  r,
573
- t
573
+ s
574
574
  );
575
- }, wt = (...s) => (e) => {
576
- const t = s.filter((r) => d.is(r));
577
- He(() => e(...s.map(p.get)), t);
575
+ }, It = (...t) => (e) => {
576
+ const s = t.filter((r) => d.is(r));
577
+ Be(() => e(...t.map(p.get)), s);
578
578
  };
579
- class te {
579
+ class oe {
580
580
  constructor() {
581
- i(this, "_store", /* @__PURE__ */ new Map());
581
+ o(this, "_store", /* @__PURE__ */ new Map());
582
582
  /**
583
583
  * Retrieves the value associated with the specified key from the memory store.
584
584
  * @param key - The key to retrieve the value for.
585
585
  * @returns The value associated with the key, or `null` if the key is not found.
586
586
  */
587
- i(this, "getItem", (e) => this._store.get(e) ?? null);
587
+ o(this, "getItem", (e) => this._store.get(e) ?? null);
588
588
  /**
589
589
  * Sets the value associated with the specified key in the memory store.
590
590
  * @param key - The key to set the value for.
591
591
  * @param value - The value to set.
592
592
  */
593
- i(this, "setItem", (e, t) => {
594
- this._store.set(e, t);
593
+ o(this, "setItem", (e, s) => {
594
+ this._store.set(e, s);
595
595
  });
596
596
  }
597
597
  }
598
- const se = ({
599
- key: s,
598
+ const le = ({
599
+ key: t,
600
600
  defaultValue: e,
601
- store: t,
601
+ store: s,
602
602
  serialize: r = JSON.stringify,
603
603
  deserialize: n = JSON.parse,
604
- equals: o = (c, a) => c === a,
604
+ equals: i = (c, a) => c === a,
605
605
  onLoad: l = (c) => c
606
606
  }) => {
607
- const c = t.getItem(s), a = new H(
607
+ const c = s.getItem(t), a = new k(
608
608
  c != null ? l(n(c)) : typeof e == "function" ? e() : e,
609
- o
609
+ i
610
610
  );
611
- return a.on((f) => {
612
- t.setItem(s, r(f));
611
+ return a.on((u) => {
612
+ s.setItem(t, r(u));
613
613
  }), a;
614
- }, _t = (s) => {
614
+ }, kt = (t) => {
615
615
  var e;
616
- return se({
617
- ...s,
618
- store: ((e = ee()) == null ? void 0 : e.localStorage) ?? new te()
616
+ return le({
617
+ ...t,
618
+ store: ((e = ie()) == null ? void 0 : e.localStorage) ?? new oe()
619
619
  });
620
- }, vt = (s) => {
620
+ }, Nt = (t) => {
621
621
  var e;
622
- return se({
623
- ...s,
624
- store: ((e = ee()) == null ? void 0 : e.sessionStorage) ?? new te()
622
+ return le({
623
+ ...t,
624
+ store: ((e = ie()) == null ? void 0 : e.sessionStorage) ?? new oe()
625
625
  });
626
626
  };
627
- function K(s) {
628
- return typeof requestAnimationFrame == "function" ? requestAnimationFrame(s) : setTimeout(s, 0);
627
+ function ne(t) {
628
+ return typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
629
629
  }
630
- const Ie = (s, e, t, r) => {
631
- const n = (r == null ? void 0 : r.duration) ?? 300, o = (r == null ? void 0 : r.easing) ?? ((y) => y), l = (r == null ? void 0 : r.equals) ?? ((y, N) => y === N);
632
- let c = r == null ? void 0 : r.interpolate, a = s, f = e(), h = performance.now(), S = null, O = !0;
633
- const F = new C(e, l), P = I(s, l);
634
- P.onDispose(() => {
635
- S !== null && cancelAnimationFrame(S);
636
- }), P.onDispose(F.dispose), t.forEach((y) => {
637
- y.setDerivative(F), y.onDispose(P.dispose);
630
+ const Fe = (t, e, s, r) => {
631
+ const n = (r == null ? void 0 : r.duration) ?? 300, i = (r == null ? void 0 : r.easing) ?? ((T) => T), l = (r == null ? void 0 : r.equals) ?? ((T, I) => T === I);
632
+ let c = r == null ? void 0 : r.interpolate, a = t, u = e(), h = performance.now(), m = null, S = !0;
633
+ const X = new v(e, l), b = N(t, l);
634
+ b.onDispose(() => {
635
+ m !== null && cancelAnimationFrame(m);
636
+ }), b.onDispose(X.dispose), s.forEach((T) => {
637
+ T.setDerivative(X), T.onDispose(b.dispose);
638
638
  });
639
- const be = (y) => {
640
- f = y, h = performance.now(), a = P.value, O && (O = !1, S = K(J));
641
- }, J = () => {
642
- const N = (performance.now() - h) / p.get(n), Ee = o(N);
643
- c == null && (c = $e(a));
644
- let Q = c(a, f, Ee);
645
- N >= 1 ? (O = !0, Q = f) : S = K(J), P.set(Q);
639
+ const Me = (T) => {
640
+ u = T, h = performance.now(), a = b.value, S && (S = !1, m = ne(K));
641
+ }, K = () => {
642
+ const I = (performance.now() - h) / p.get(n), He = i(I);
643
+ c == null && (c = je(a));
644
+ let ee = c(a, u, He);
645
+ I >= 1 ? (S = !0, ee = u) : m = ne(K), b.set(ee);
646
646
  };
647
- return F.on(be), P;
648
- }, St = (s, e) => {
649
- const { initialValue: t, ...r } = e ?? {};
650
- return Ie(
651
- t ?? s.get(),
652
- s.get,
653
- [s],
647
+ return X.on(Me), b;
648
+ }, Rt = (t, e) => {
649
+ const { initialValue: s, ...r } = e ?? {};
650
+ return Fe(
651
+ s ?? t.get(),
652
+ t.get,
653
+ [t],
654
654
  r
655
655
  );
656
- }, Pt = (s, e) => {
657
- const { signals: t, literals: r } = Object.entries(s).reduce(
658
- ({ signals: o, literals: l }, [c, a]) => (d.is(a) ? o.push([c, a]) : l[c] = a, { signals: o, literals: l }),
656
+ }, Vt = (t, e) => {
657
+ const { signals: s, literals: r } = Object.entries(t).reduce(
658
+ ({ signals: i, literals: l }, [c, a]) => (d.is(a) ? i.push([c, a]) : l[c] = a, { signals: i, literals: l }),
659
659
  { signals: [], literals: {} }
660
- ), n = t.map(([, o]) => o);
661
- return G(() => (t.forEach(([o, l]) => r[o] = l.value), e(r)), n);
662
- }, re = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), ne = /* @__PURE__ */ new Set([
660
+ ), n = s.map(([, i]) => i);
661
+ return Q(() => (s.forEach(([i, l]) => r[i] = l.value), e(r)), n);
662
+ }, ce = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), ae = /* @__PURE__ */ new Set([
663
663
  "rowSpan",
664
664
  "colSpan",
665
665
  "tabIndex",
666
666
  "valueAsNumber"
667
- ]), ie = /* @__PURE__ */ new Set(["valueAsDate"]), oe = /* @__PURE__ */ new Set([
667
+ ]), ue = /* @__PURE__ */ new Set(["valueAsDate"]), he = /* @__PURE__ */ new Set([
668
668
  "value",
669
669
  "textContent",
670
670
  "innerText",
@@ -672,26 +672,26 @@ const Ie = (s, e, t, r) => {
672
672
  "outerHTML",
673
673
  "className",
674
674
  "classList"
675
- ]), Ve = (s, e) => re.has(s) ? (t) => {
676
- t == null ? e[s] = null : e[s] = !!t;
677
- } : ne.has(s) ? (t) => {
678
- t == null ? e[s] = null : e[s] = Number(t);
679
- } : ie.has(s) ? (t) => {
680
- t == null ? e[s] = null : e[s] = t;
681
- } : oe.has(s) ? (t) => {
682
- t == null ? e[s] = null : e[s] = String(t);
683
- } : (t) => {
684
- t == null ? e.removeAttribute(s) : e.setAttribute(s, t);
685
- }, Re = (s, e) => re.has(s) ? () => !!e[s] : ne.has(s) ? () => Number(e[s]) : ie.has(s) ? () => e[s] : oe.has(s) ? () => String(e[s]) : () => e.getAttribute(s), W = (s) => {
686
- const e = s;
687
- e && e.onblur && (e.onblur = null), !(!s || s.ownerDocument === void 0) && s.parentElement && s.parentElement.removeChild(s);
688
- }, je = (s) => le(s) ? s : s.parentElement, le = (s) => s.nodeType === 1;
689
- class ce extends Error {
675
+ ]), Ue = (t, e) => ce.has(t) ? (s) => {
676
+ s == null ? e[t] = null : e[t] = !!s;
677
+ } : ae.has(t) ? (s) => {
678
+ s == null ? e[t] = null : e[t] = Number(s);
679
+ } : ue.has(t) ? (s) => {
680
+ s == null ? e[t] = null : e[t] = s;
681
+ } : he.has(t) ? (s) => {
682
+ s == null ? e[t] = null : e[t] = String(s);
683
+ } : (s) => {
684
+ s == null ? e.removeAttribute(t) : e.setAttribute(t, s);
685
+ }, We = (t, e) => ce.has(t) ? () => !!e[t] : ae.has(t) ? () => Number(e[t]) : ue.has(t) ? () => e[t] : he.has(t) ? () => String(e[t]) : () => e.getAttribute(t), R = (t) => {
686
+ const e = t;
687
+ e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentElement && t.parentElement.removeChild(t);
688
+ }, Je = (t) => fe(t) ? t : t.parentElement, fe = (t) => t.nodeType === 1;
689
+ class de extends Error {
690
690
  constructor(e) {
691
691
  super(`Provider not found: ${e.description}`);
692
692
  }
693
693
  }
694
- class b {
694
+ class P {
695
695
  /**
696
696
  * Constructs a new `DOMContext` instance.
697
697
  *
@@ -701,7 +701,7 @@ class b {
701
701
  * @param providers - The `Providers` instance associated with this context.
702
702
  * @param isFirstLevel - A boolean value indicating whether this context is at the first level, meaning the outermost node in the generated DOM.
703
703
  */
704
- constructor(e, t, r, n) {
704
+ constructor(e, s, r, n) {
705
705
  /**
706
706
  * Creates a new DOM element (eg: HTML or SVG) with the specified tag name and namespace.
707
707
  *
@@ -709,7 +709,7 @@ class b {
709
709
  * @param namespace - The namespace URI to create the element in, or `undefined` to create a standard HTML element.
710
710
  * @returns The newly created element.
711
711
  */
712
- i(this, "createElement", (e, t) => t !== void 0 ? this.document.createElementNS(t, e) : this.document.createElement(e));
712
+ o(this, "createElement", (e, s) => s !== void 0 ? this.document.createElementNS(s, e) : this.document.createElement(e));
713
713
  /**
714
714
  * Creates a new DOM element (eg: HTML or SVG) with the specified tag name and namespace and appends it to the current element.
715
715
  *
@@ -717,8 +717,8 @@ class b {
717
717
  * @param namespace - The namespace URI to create the element in, or `undefined` to create a standard HTML element.
718
718
  * @returns The newly created element.
719
719
  */
720
- i(this, "makeChildElement", (e, t) => {
721
- const r = this.createElement(e, t);
720
+ o(this, "makeChildElement", (e, s) => {
721
+ const r = this.createElement(e, s);
722
722
  return this.appendOrInsert(r), this.withElement(r);
723
723
  });
724
724
  /**
@@ -726,28 +726,28 @@ class b {
726
726
  * @param text - The text content for the new text node.
727
727
  * @returns A new `Text` node with the specified text content.
728
728
  */
729
- i(this, "createText", (e) => this.document.createTextNode(e));
729
+ o(this, "createText", (e) => this.document.createTextNode(e));
730
730
  /**
731
731
  * Creates a new text node with the specified text content and appends it to the current element.
732
732
  * @param text - The text content for the new text node.
733
733
  * @returns A new `DOMContext` with a reference to the new text node.
734
734
  */
735
- i(this, "makeChildText", (e) => {
736
- const t = this.createText(e);
737
- return this.appendOrInsert(t), this.withReference(t);
735
+ o(this, "makeChildText", (e) => {
736
+ const s = this.createText(e);
737
+ return this.appendOrInsert(s), this.withReference(s);
738
738
  });
739
739
  /**
740
740
  * Sets the text content of the current element.
741
741
  * @param text - The text content to set.
742
742
  */
743
- i(this, "setText", (e) => {
743
+ o(this, "setText", (e) => {
744
744
  this.reference.nodeValue = e;
745
745
  });
746
746
  /**
747
747
  * Gets the text content of the current element or text node.
748
748
  * @returns The text content of the current element or text node.
749
749
  */
750
- i(this, "getText", () => {
750
+ o(this, "getText", () => {
751
751
  var e;
752
752
  return ((e = this.reference) == null ? void 0 : e.nodeValue) ?? this.element.textContent ?? "";
753
753
  });
@@ -756,7 +756,7 @@ class b {
756
756
  * The text node is appended or inserted to the current `DOMContext`.
757
757
  * The new `DOMContext` with the reference is returned.
758
758
  */
759
- i(this, "makeRef", () => {
759
+ o(this, "makeRef", () => {
760
760
  const e = this.createText("");
761
761
  return this.appendOrInsert(e), this.withReference(e);
762
762
  });
@@ -765,7 +765,7 @@ class b {
765
765
  *
766
766
  * @param child - The child node to append or insert.
767
767
  */
768
- i(this, "appendOrInsert", (e) => {
768
+ o(this, "appendOrInsert", (e) => {
769
769
  this.reference === void 0 ? this.element.appendChild(e) : this.element.insertBefore(e, this.reference);
770
770
  });
771
771
  /**
@@ -773,17 +773,17 @@ class b {
773
773
  * @param element - The DOM element to use in the new `DOMContext` instance.
774
774
  * @returns A new `DOMContext` instance with the provided `element`.
775
775
  */
776
- i(this, "withElement", (e) => new b(this.document, e, void 0, this.providers));
776
+ o(this, "withElement", (e) => new P(this.document, e, void 0, this.providers));
777
777
  /**
778
778
  * Creates a new `DOMContext` instance with a reference to a DOM element selected by the provided `selector`.
779
779
  * @param selector - The CSS selector for the target DOM element.
780
780
  * @returns A new `DOMContext` instance with a reference to the selected DOM element.
781
781
  */
782
- i(this, "makePortal", (e) => {
783
- const t = this.document.querySelector(e);
784
- if (t == null)
782
+ o(this, "makePortal", (e) => {
783
+ const s = this.document.querySelector(e);
784
+ if (s == null)
785
785
  throw new Error(`Cannot find element by selector for portal: ${e}`);
786
- return this.withElement(t);
786
+ return this.withElement(s);
787
787
  });
788
788
  /**
789
789
  * Creates a new `DOMContext` instance with the specified reference.
@@ -791,7 +791,7 @@ class b {
791
791
  * @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
792
792
  * @returns A new `DOMContext` instance with the specified reference.
793
793
  */
794
- i(this, "withReference", (e) => new b(this.document, this.element, e, this.providers));
794
+ o(this, "withReference", (e) => new P(this.document, this.element, e, this.providers));
795
795
  /**
796
796
  * Returns a new HTMLDOMContext instance with the specified providers merged into
797
797
  * the existing providers.
@@ -799,7 +799,7 @@ class b {
799
799
  * @param providers - An object containing the providers to be merged into the existing providers.
800
800
  * @returns A new HTMLDOMContext instance with the merged providers.
801
801
  */
802
- i(this, "withProviders", (e) => new b(this.document, this.element, this.reference, {
802
+ o(this, "withProviders", (e) => new P(this.document, this.element, this.reference, {
803
803
  ...this.providers,
804
804
  ...e
805
805
  }));
@@ -810,71 +810,71 @@ class b {
810
810
  * @returns The provider for the given mark.
811
811
  * @throws Throws `ProviderNotFoundError` if the provider for the given mark is not found.
812
812
  */
813
- i(this, "getProvider", (e) => {
813
+ o(this, "getProvider", (e) => {
814
814
  if (this.providers[e] === void 0)
815
- throw new ce(e);
815
+ throw new de(e);
816
816
  return this.providers[e];
817
817
  });
818
- i(this, "clear", (e) => {
819
- e && (this.reference !== void 0 ? W(this.reference) : W(this.element));
818
+ o(this, "clear", (e) => {
819
+ e && (this.reference !== void 0 ? R(this.reference) : R(this.element));
820
820
  });
821
821
  /**
822
822
  * Adds classes to the element.
823
823
  * @param tokens - The class names to add.
824
824
  */
825
- i(this, "addClasses", (e) => {
825
+ o(this, "addClasses", (e) => {
826
826
  this.element.classList.add(...e);
827
827
  });
828
828
  /**
829
829
  * Removes classes from the element.
830
830
  * @param tokens - The class names to remove.
831
831
  */
832
- i(this, "removeClasses", (e) => {
832
+ o(this, "removeClasses", (e) => {
833
833
  this.element.classList.remove(...e);
834
834
  });
835
835
  /**
836
836
  * Gets the classes of the element.
837
837
  * @returns The classes of the element.
838
838
  */
839
- i(this, "getClasses", () => Array.from(this.element.classList));
839
+ o(this, "getClasses", () => Array.from(this.element.classList));
840
840
  /**
841
841
  * Adds an event listener to the element.
842
842
  * @param event - The event to listen for.
843
843
  * @param listener - The listener to call when the event occurs.
844
844
  * @returns A function to remove the event listener.
845
845
  */
846
- i(this, "on", (e, t) => (this.element.addEventListener(e, t), (r) => {
847
- r && this.element.removeEventListener(e, t);
846
+ o(this, "on", (e, s) => (this.element.addEventListener(e, s), (r) => {
847
+ r && this.element.removeEventListener(e, s);
848
848
  }));
849
849
  /**
850
850
  * Returns `true` if the context is a browser DOM context.
851
851
  * @returns `true` if the context is a browser DOM context.
852
852
  */
853
- i(this, "isBrowserDOM", () => !0);
853
+ o(this, "isBrowserDOM", () => !0);
854
854
  /**
855
855
  * Returns `true` if the context is a headless DOM context.
856
856
  * @returns `true` if the context is a headless DOM context.
857
857
  */
858
- i(this, "isHeadlessDOM", () => !1);
858
+ o(this, "isHeadlessDOM", () => !1);
859
859
  /**
860
860
  * Sets the style of the element.
861
861
  * @param name - The name of the style to set.
862
862
  * @param value - The value of the style to set.
863
863
  */
864
- i(this, "setStyle", (e, t) => {
865
- this.element.style.setProperty(e, t);
864
+ o(this, "setStyle", (e, s) => {
865
+ this.element.style.setProperty(e, s);
866
866
  });
867
867
  /**
868
868
  * Gets the style of the element.
869
869
  * @param name - The name of the style to get.
870
870
  * @returns The value of the style.
871
871
  */
872
- i(this, "getStyle", (e) => this.element.style.getPropertyValue(e));
873
- i(this, "makeAccessors", (e) => ({
874
- get: Re(e, this.element),
875
- set: Ve(e, this.element)
872
+ o(this, "getStyle", (e) => this.element.style.getPropertyValue(e));
873
+ o(this, "makeAccessors", (e) => ({
874
+ get: We(e, this.element),
875
+ set: Ue(e, this.element)
876
876
  }));
877
- this.document = e, this.element = t, this.reference = r, this.providers = n;
877
+ this.document = e, this.element = s, this.reference = r, this.providers = n;
878
878
  }
879
879
  /**
880
880
  * Creates a new `DOMContext` instance for the given `Element` and optional reference `Node`.
@@ -883,256 +883,412 @@ class b {
883
883
  * @param ref - An optional reference `Node` to associate with the `DOMContext`.
884
884
  * @returns A new `DOMContext` instance.
885
885
  */
886
- static of(e, t) {
887
- return new b(e.ownerDocument, e, t, {});
886
+ static of(e, s) {
887
+ return new P(e.ownerDocument, e, s, {});
888
888
  }
889
889
  }
890
- const g = Symbol("class"), _ = Symbol("style"), T = Symbol("handler"), ae = () => Math.random().toString(36).substring(2, 15), qe = (s) => s.replace(/<[^>]*>?/g, "");
891
- class ue {
890
+ const Z = (t, e) => {
891
+ const s = t(e);
892
+ return () => s(!0);
893
+ }, jt = (t, e, { doc: s, clear: r } = {}) => {
894
+ const n = typeof e == "string" ? (s ?? document).querySelector(e) : e;
895
+ if (n === null)
896
+ throw new Ge(
897
+ `Cannot find element by selector for render: ${e}`
898
+ );
899
+ r !== !1 && (s ?? n.ownerDocument) != null && n.nodeType === 1 && (n.innerHTML = "");
900
+ const i = Je(n), l = fe(n) ? void 0 : n, c = P.of(i, l);
901
+ return Z(t, c);
902
+ }, qt = (t, {
903
+ startUrl: e = "https://example.com",
904
+ selector: s = ":root"
905
+ } = {}) => {
906
+ const r = p.toSignal(e).deriveProp(), n = new ye(s, void 0), i = new x(n, void 0, { currentURL: r }, {});
907
+ return {
908
+ clear: Z(t(), i),
909
+ root: n,
910
+ currentURL: r
911
+ };
912
+ };
913
+ class Ge extends Error {
914
+ constructor(e) {
915
+ super(e);
916
+ }
917
+ }
918
+ const pe = "data-tts-node", V = "data-tts-class", j = "data-tts-style", q = "data-tts-html", B = "data-tts-text", F = "data-tts-attrs";
919
+ class Bt {
920
+ constructor({
921
+ select: e,
922
+ getAttribute: s,
923
+ setAttribute: r,
924
+ getClass: n,
925
+ setClass: i,
926
+ getStyles: l,
927
+ setStyles: c,
928
+ appendHTML: a,
929
+ getInnerHTML: u,
930
+ setInnerHTML: h,
931
+ getInnerText: m,
932
+ setInnerText: S
933
+ }) {
934
+ o(this, "select");
935
+ o(this, "getAttribute");
936
+ o(this, "setAttribute");
937
+ o(this, "getClass");
938
+ o(this, "setClass");
939
+ o(this, "getStyles");
940
+ o(this, "setStyles");
941
+ o(this, "appendHTML");
942
+ o(this, "getInnerHTML");
943
+ o(this, "setInnerHTML");
944
+ o(this, "getInnerText");
945
+ o(this, "setInnerText");
946
+ o(this, "setFromRoot", (e, s) => {
947
+ e.getPortals().forEach((n) => {
948
+ const i = this.select(n.selector)[0];
949
+ if (i == null)
950
+ throw new Error(
951
+ `Cannot find element by selector for render: ${n.selector}`
952
+ );
953
+ if (n.hasChildren() && this.appendHTML(i, n.contentToHTML(s)), n.hasInnerHTML()) {
954
+ if (s) {
955
+ const l = this.getInnerHTML(i);
956
+ l != null && this.setAttribute(i, q, l);
957
+ }
958
+ this.setInnerHTML(i, n.getInnerHTML());
959
+ }
960
+ if (n.hasInnerText()) {
961
+ if (s) {
962
+ const l = this.getInnerText(i);
963
+ l != null && this.setAttribute(i, B, l);
964
+ }
965
+ this.setInnerText(i, n.getInnerText());
966
+ }
967
+ if (n.hasClasses()) {
968
+ if (s) {
969
+ const l = this.getClass(i);
970
+ l != null && this.setAttribute(i, V, l);
971
+ }
972
+ this.setClass(i, n.getClasses().join(" "));
973
+ }
974
+ if (n.hasStyles()) {
975
+ if (s) {
976
+ const l = this.getStyles(i);
977
+ l != null && this.setAttribute(
978
+ i,
979
+ j,
980
+ JSON.stringify(l)
981
+ );
982
+ }
983
+ this.setStyles(i, n.getStyles());
984
+ }
985
+ if (n.hasAttributes()) {
986
+ const l = n.getAttributes();
987
+ if (s) {
988
+ const c = [];
989
+ l.forEach(([a]) => {
990
+ const u = this.getAttribute(i, a);
991
+ u != null && c.push([a, u]);
992
+ }), this.setAttribute(
993
+ i,
994
+ F,
995
+ JSON.stringify(Object.fromEntries(c))
996
+ );
997
+ }
998
+ l.forEach(([c, a]) => {
999
+ this.setAttribute(i, c, a);
1000
+ });
1001
+ }
1002
+ });
1003
+ });
1004
+ this.select = e, this.getAttribute = s, 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 = m, this.setInnerText = S;
1005
+ }
1006
+ }
1007
+ const ze = () => {
1008
+ document.querySelectorAll(`[${pe}]`).forEach(R);
1009
+ }, Xe = (t) => {
1010
+ const e = t.getAttribute(V);
1011
+ t.removeAttribute(V), e != null && t.setAttribute("class", e);
1012
+ }, Ye = () => {
1013
+ document.querySelectorAll(`[${V}]`).forEach((e) => Xe(e));
1014
+ }, Qe = (t) => {
1015
+ const e = t.getAttribute(q);
1016
+ t.removeAttribute(q), e != null && (t.innerHTML = e);
1017
+ }, Ze = () => {
1018
+ document.querySelectorAll(`[${q}]`).forEach((e) => Qe(e));
1019
+ }, Ke = (t) => {
1020
+ const e = t.getAttribute(B);
1021
+ t.removeAttribute(B), e != null && (t.innerText = e);
1022
+ }, et = () => {
1023
+ document.querySelectorAll(`[${B}]`).forEach((e) => Ke(e));
1024
+ }, tt = (t) => {
1025
+ const e = t.getAttribute(j);
1026
+ if (t.removeAttribute(j), e != null) {
1027
+ const s = JSON.parse(e);
1028
+ Object.entries(s).forEach(([r, n]) => {
1029
+ t.style.setProperty(r, n);
1030
+ });
1031
+ }
1032
+ }, st = () => {
1033
+ document.querySelectorAll(`[${j}]`).forEach((e) => tt(e));
1034
+ }, rt = (t) => {
1035
+ const e = t.getAttribute(F);
1036
+ if (t.removeAttribute(F), e != null) {
1037
+ const s = JSON.parse(e);
1038
+ Object.entries(s).forEach(([r, n]) => {
1039
+ n == null ? t.removeAttribute(r) : t.setAttribute(r, n);
1040
+ });
1041
+ }
1042
+ }, nt = () => {
1043
+ document.querySelectorAll(`[${F}]`).forEach((e) => rt(e));
1044
+ }, Ft = () => {
1045
+ ze(), Ye(), et(), Ze(), st(), nt();
1046
+ }, y = Symbol("class"), _ = Symbol("style"), E = Symbol("handler"), ge = () => Math.random().toString(36).substring(2, 15), it = (t) => t.replace(/<[^>]*>?/g, "");
1047
+ class me {
892
1048
  constructor(e) {
893
- i(this, "id", ae());
894
- i(this, "properties", {});
895
- i(this, "children", []);
896
- i(this, "isElement", () => !0);
897
- i(this, "isText", () => !1);
898
- i(this, "getText", () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? qe(this.properties.innerHTML) : this.children.map((e) => e.getText()).join(""));
899
- i(this, "removeChild", (e) => {
900
- const t = this.children.indexOf(e);
901
- t !== -1 && this.children.splice(t, 1);
1049
+ o(this, "id", ge());
1050
+ o(this, "properties", {});
1051
+ o(this, "children", []);
1052
+ o(this, "isElement", () => !0);
1053
+ o(this, "isText", () => !1);
1054
+ o(this, "getText", () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? it(this.properties.innerHTML) : this.children.map((e) => e.getText()).join(""));
1055
+ o(this, "removeChild", (e) => {
1056
+ const s = this.children.indexOf(e);
1057
+ s !== -1 && this.children.splice(s, 1);
902
1058
  });
903
- i(this, "remove", () => {
1059
+ o(this, "remove", () => {
904
1060
  if (this.parent != null)
905
1061
  this.parent.removeChild(this);
906
1062
  else
907
1063
  throw new Error("Parent is undefined");
908
1064
  });
909
- i(this, "getPortals", () => {
910
- const e = this.elements().flatMap((t) => t.isPortal() ? [t, ...t.getPortals()] : t.getPortals());
1065
+ o(this, "getPortals", () => {
1066
+ const e = this.elements().flatMap((s) => s.isPortal() ? [s, ...s.getPortals()] : s.getPortals());
911
1067
  return this.isPortal() && e.unshift(this), e;
912
1068
  });
913
- i(this, "elements", () => this.children.filter((e) => e.isElement()));
914
- i(this, "hasInnerHTML", () => this.properties.innerHTML != null);
915
- i(this, "getInnerHTML", () => this.properties.innerHTML ?? "");
916
- i(this, "getInnerText", () => this.properties.innerText ?? "");
917
- i(this, "hasInnerText", () => this.properties.innerText != null);
918
- i(this, "hasChildren", () => this.children.length > 0);
919
- i(this, "hasClasses", () => this.properties[g] != null);
920
- i(this, "hasStyles", () => this.properties[_] != null);
921
- i(this, "hasAttributes", () => Object.keys(this.properties).length > 0);
922
- i(this, "hasHandlers", () => this.properties[T] != null);
923
- i(this, "hasRenderableProperties", () => this.hasClasses() || this.hasAttributes() || this.hasStyles());
924
- i(this, "getById", (e) => {
1069
+ o(this, "elements", () => this.children.filter((e) => e.isElement()));
1070
+ o(this, "hasInnerHTML", () => this.properties.innerHTML != null);
1071
+ o(this, "getInnerHTML", () => this.properties.innerHTML ?? "");
1072
+ o(this, "getInnerText", () => this.properties.innerText ?? "");
1073
+ o(this, "hasInnerText", () => this.properties.innerText != null);
1074
+ o(this, "hasChildren", () => this.children.length > 0);
1075
+ o(this, "hasClasses", () => this.properties[y] != null);
1076
+ o(this, "hasStyles", () => this.properties[_] != null);
1077
+ o(this, "hasAttributes", () => Object.keys(this.properties).length > 0);
1078
+ o(this, "hasHandlers", () => this.properties[E] != null);
1079
+ o(this, "hasRenderableProperties", () => this.hasClasses() || this.hasAttributes() || this.hasStyles());
1080
+ o(this, "getById", (e) => {
925
1081
  if (this.properties.id === e)
926
1082
  return this;
927
- for (const t of this.elements()) {
928
- const r = t.getById(e);
1083
+ for (const s of this.elements()) {
1084
+ const r = s.getById(e);
929
1085
  if (r != null)
930
1086
  return r;
931
1087
  }
932
1088
  });
933
- i(this, "trigger", (e, t) => {
934
- ((this.properties[T] ?? {})[e] ?? []).forEach((n) => n(t));
1089
+ o(this, "trigger", (e, s) => {
1090
+ ((this.properties[E] ?? {})[e] ?? []).forEach((n) => n(s));
935
1091
  });
936
- i(this, "click", () => {
1092
+ o(this, "click", () => {
937
1093
  this.trigger("click", {});
938
1094
  });
939
- i(this, "on", (e, t) => {
940
- var o;
941
- const r = (o = this.properties)[T] ?? (o[T] = {}), n = t;
1095
+ o(this, "on", (e, s) => {
1096
+ var i;
1097
+ const r = (i = this.properties)[E] ?? (i[E] = {}), n = s;
942
1098
  return r[e] = [...r[e] ?? [], n], () => {
943
1099
  const l = r[e] ?? [], c = l.indexOf(n);
944
- c !== -1 && (l.splice(c, 1), l.length === 0 ? (delete r[e], Object.keys(r).length === 0 && delete this.properties[T]) : r[e] = l);
1100
+ c !== -1 && (l.splice(c, 1), l.length === 0 ? (delete r[e], Object.keys(r).length === 0 && delete this.properties[E]) : r[e] = l);
945
1101
  };
946
1102
  });
947
- i(this, "addClasses", (e) => {
1103
+ o(this, "addClasses", (e) => {
948
1104
  var r;
949
1105
  if (e.length === 0)
950
1106
  return;
951
- const t = (r = this.properties)[g] ?? (r[g] = []);
1107
+ const s = (r = this.properties)[y] ?? (r[y] = []);
952
1108
  e.forEach((n) => {
953
- t.includes(n) || t.push(n);
1109
+ s.includes(n) || s.push(n);
954
1110
  });
955
1111
  });
956
- i(this, "removeClasses", (e) => {
1112
+ o(this, "removeClasses", (e) => {
957
1113
  var r;
958
1114
  if (e.length === 0)
959
1115
  return;
960
- const t = (r = this.properties)[g] ?? (r[g] = []);
1116
+ const s = (r = this.properties)[y] ?? (r[y] = []);
961
1117
  e.forEach((n) => {
962
- const o = t.indexOf(n);
963
- o !== -1 && t.splice(o, 1);
964
- }), t.length === 0 && delete this.properties[g];
1118
+ const i = s.indexOf(n);
1119
+ i !== -1 && s.splice(i, 1);
1120
+ }), s.length === 0 && delete this.properties[y];
965
1121
  });
966
- i(this, "getClasses", () => this.properties[g] ?? []);
967
- i(this, "getAttributes", () => Object.entries(this.properties).filter(
1122
+ o(this, "getClasses", () => this.properties[y] ?? []);
1123
+ o(this, "getAttributes", () => Object.entries(this.properties).filter(
968
1124
  ([e]) => !["innerText", "innerHTML"].includes(e)
969
1125
  ));
970
- i(this, "getVisibleAttributes", () => Reflect.ownKeys(this.properties).flatMap(
971
- (e) => e === g ? [["class", this.getClasses()]] : e === _ ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
1126
+ o(this, "getVisibleAttributes", () => Reflect.ownKeys(this.properties).flatMap(
1127
+ (e) => e === y ? [["class", this.getClasses()]] : e === _ ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
972
1128
  ));
973
- i(this, "setStyle", (e, t) => {
1129
+ o(this, "setStyle", (e, s) => {
974
1130
  var n;
975
1131
  const r = (n = this.properties)[_] ?? (n[_] = {});
976
- r[e] = t, t === "" && (delete r[e], Object.keys(r).length === 0 && delete this.properties[_]);
1132
+ r[e] = s, s === "" && (delete r[e], Object.keys(r).length === 0 && delete this.properties[_]);
977
1133
  });
978
- i(this, "getStyle", (e) => {
979
- var t;
980
- return ((t = this.properties[_]) == null ? void 0 : t[e]) ?? "";
1134
+ o(this, "getStyle", (e) => {
1135
+ var s;
1136
+ return ((s = this.properties[_]) == null ? void 0 : s[e]) ?? "";
981
1137
  });
982
- i(this, "getStyles", () => this.properties[_] ?? {});
983
- i(this, "makeAccessors", (e) => {
984
- const t = this.properties;
1138
+ o(this, "getStyles", () => this.properties[_] ?? {});
1139
+ o(this, "makeAccessors", (e) => {
1140
+ const s = this.properties;
985
1141
  return {
986
- get: () => t[e],
987
- set: (r) => t[e] = r
1142
+ get: () => s[e],
1143
+ set: (r) => s[e] = r
988
1144
  };
989
1145
  });
990
1146
  this.parent = e;
991
1147
  }
992
1148
  }
993
- const Be = (s) => s.replace(/"/g, "&quot;"), Fe = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
994
- class Ue extends ue {
995
- constructor(t, r, n) {
1149
+ const ot = (t) => t.replace(/"/g, "&quot;"), lt = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1150
+ class ct extends me {
1151
+ constructor(s, r, n) {
996
1152
  super(n);
997
- i(this, "isPortal", () => !1);
998
- i(this, "toHTML", () => {
999
- const t = this.children.map((l) => l.toHTML()).join(""), r = this.namespace ? ` xmlns="${this.namespace}"` : "";
1000
- let n = null;
1001
- const o = this.getVisibleAttributes().map(([l, c]) => l === "class" ? ` class="${c.join(" ")}"` : l === "style" ? typeof c == "string" ? ` style="${c}"` : ` style="${Object.entries(c).map(([a, f]) => `${a}: ${f};`).join(" ")}"` : Ge.has(l) ? ` ${l}` : l === "innerHTML" ? (n = c, "") : l === "innerText" ? (n = Fe(c), "") : ` ${l}="${Be(c)}"`).join("");
1002
- return ze.has(this.tagName) && t === "" ? `<${this.tagName}${r}${o} />` : `<${this.tagName}${r}${o}>${n ?? t}</${this.tagName}>`;
1153
+ o(this, "isPortal", () => !1);
1154
+ o(this, "toHTML", (s = !1) => {
1155
+ const r = this.children.map((a) => a.toHTML()).join(""), n = this.namespace ? ` xmlns="${this.namespace}"` : "";
1156
+ let i = null;
1157
+ 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, m]) => `${h}: ${m};`).join(" ")}"` : ut.has(a) ? ` ${a}` : a === "innerHTML" ? (i = u, "") : a === "innerText" ? (i = lt(u), "") : ` ${a}="${ot(u)}"`).join(""), c = s ? ` ${pe}` : "";
1158
+ return ht.has(this.tagName) && r === "" ? `<${this.tagName}${n}${l}${c} />` : `<${this.tagName}${n}${l}${c}>${i ?? r}</${this.tagName}>`;
1003
1159
  });
1004
- this.tagName = t, this.namespace = r;
1160
+ this.tagName = s, this.namespace = r;
1005
1161
  }
1006
1162
  }
1007
- class he extends ue {
1008
- constructor(t, r) {
1163
+ class ye extends me {
1164
+ constructor(s, r) {
1009
1165
  super(r);
1010
- i(this, "isPortal", () => !0);
1011
- i(this, "toHTML", () => "");
1012
- i(this, "contentToHTML", () => this.children.map((t) => t.toHTML()).join(""));
1013
- this.selector = t;
1166
+ o(this, "isPortal", () => !0);
1167
+ o(this, "toHTML", () => "");
1168
+ o(this, "contentToHTML", (s = !1) => this.children.map((r) => r.toHTML(s)).join(""));
1169
+ this.selector = s;
1014
1170
  }
1015
1171
  }
1016
- class We {
1172
+ class at {
1017
1173
  constructor(e) {
1018
- i(this, "id", ae());
1019
- i(this, "isElement", () => !1);
1020
- i(this, "isText", () => !0);
1021
- i(this, "getText", () => this.text);
1022
- i(this, "toHTML", () => this.text);
1174
+ o(this, "id", ge());
1175
+ o(this, "isElement", () => !1);
1176
+ o(this, "isText", () => !0);
1177
+ o(this, "getText", () => this.text);
1178
+ o(this, "toHTML", () => this.text);
1023
1179
  this.text = e;
1024
1180
  }
1025
1181
  }
1026
- class E {
1027
- constructor(e, t, r, n) {
1028
- i(this, "appendOrInsert", (e) => {
1182
+ class x {
1183
+ constructor(e, s, r, n) {
1184
+ o(this, "appendOrInsert", (e) => {
1029
1185
  if (this.reference != null) {
1030
- const t = this.element.children.indexOf(this.reference);
1031
- this.element.children.splice(t, 0, e);
1186
+ const s = this.element.children.indexOf(this.reference);
1187
+ this.element.children.splice(s, 0, e);
1032
1188
  } else
1033
1189
  this.element.children.push(e);
1034
1190
  });
1035
- i(this, "makeChildElement", (e, t) => {
1036
- const r = new Ue(e, t, this.element);
1037
- return this.appendOrInsert(r), new E(
1191
+ o(this, "makeChildElement", (e, s) => {
1192
+ const r = new ct(e, s, this.element);
1193
+ return this.appendOrInsert(r), new x(
1038
1194
  r,
1039
1195
  void 0,
1040
1196
  this.container,
1041
1197
  this.providers
1042
1198
  );
1043
1199
  });
1044
- i(this, "makeChildText", (e) => {
1045
- const t = new We(e);
1046
- return this.appendOrInsert(t), new E(
1200
+ o(this, "makeChildText", (e) => {
1201
+ const s = new at(e);
1202
+ return this.appendOrInsert(s), new x(
1047
1203
  this.element,
1048
- t,
1204
+ s,
1049
1205
  this.container,
1050
1206
  this.providers
1051
1207
  );
1052
1208
  });
1053
- i(this, "setText", (e) => {
1209
+ o(this, "setText", (e) => {
1054
1210
  this.reference && this.reference.isText() && (this.reference.text = e);
1055
1211
  });
1056
- i(this, "getText", () => {
1212
+ o(this, "getText", () => {
1057
1213
  var e;
1058
1214
  return ((e = this.reference) == null ? void 0 : e.getText()) ?? this.element.getText();
1059
1215
  });
1060
- i(this, "makeRef", () => this.makeChildText(""));
1061
- i(this, "makePortal", (e) => {
1062
- const t = new he(e, this.element);
1063
- return this.appendOrInsert(t), new E(
1064
- t,
1216
+ o(this, "makeRef", () => this.makeChildText(""));
1217
+ o(this, "makePortal", (e) => {
1218
+ const s = new ye(e, this.element);
1219
+ return this.appendOrInsert(s), new x(
1220
+ s,
1065
1221
  void 0,
1066
1222
  this.container,
1067
1223
  this.providers
1068
1224
  );
1069
1225
  });
1070
- i(this, "withProviders", (e) => new E(this.element, this.reference, this.container, {
1226
+ o(this, "withProviders", (e) => new x(this.element, this.reference, this.container, {
1071
1227
  ...this.providers,
1072
1228
  ...e
1073
1229
  }));
1074
- i(this, "getProvider", (e) => {
1230
+ o(this, "getProvider", (e) => {
1075
1231
  if (this.providers[e] === void 0)
1076
- throw new ce(e);
1232
+ throw new de(e);
1077
1233
  return this.providers[e];
1078
1234
  });
1079
- i(this, "clear", (e) => {
1235
+ o(this, "clear", (e) => {
1080
1236
  e && (this.reference !== void 0 ? this.element.removeChild(this.reference) : this.element.remove());
1081
1237
  });
1082
- i(this, "on", (e, t) => this.element.on(e, t));
1083
- i(this, "addClasses", (e) => this.element.addClasses(e));
1084
- i(this, "removeClasses", (e) => this.element.removeClasses(e));
1085
- i(this, "getClasses", () => this.element.getClasses());
1086
- i(this, "isBrowserDOM", () => !1);
1087
- i(this, "isHeadlessDOM", () => !0);
1088
- i(this, "setStyle", (e, t) => this.element.setStyle(e, t));
1089
- i(this, "getStyle", (e) => this.element.getStyle(e));
1090
- i(this, "makeAccessors", (e) => this.element.makeAccessors(e));
1091
- this.element = e, this.reference = t, this.container = r, this.providers = n;
1238
+ o(this, "on", (e, s) => this.element.on(e, s));
1239
+ o(this, "addClasses", (e) => this.element.addClasses(e));
1240
+ o(this, "removeClasses", (e) => this.element.removeClasses(e));
1241
+ o(this, "getClasses", () => this.element.getClasses());
1242
+ o(this, "isBrowserDOM", () => !1);
1243
+ o(this, "isHeadlessDOM", () => !0);
1244
+ o(this, "setStyle", (e, s) => this.element.setStyle(e, s));
1245
+ o(this, "getStyle", (e) => this.element.getStyle(e));
1246
+ o(this, "makeAccessors", (e) => this.element.makeAccessors(e));
1247
+ this.element = e, this.reference = s, this.container = r, this.providers = n;
1092
1248
  }
1093
1249
  }
1094
- const Ge = /* @__PURE__ */ new Set([
1250
+ const ut = /* @__PURE__ */ new Set([
1095
1251
  "checked",
1096
1252
  "disabled",
1097
1253
  "multiple",
1098
1254
  "readonly",
1099
1255
  "required",
1100
1256
  "selected"
1101
- ]), ze = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), fe = (s) => (e) => {
1102
- const t = e.makeChildText(s);
1103
- return (r) => t.clear(r);
1104
- }, de = (s) => (e) => {
1105
- const t = e.makeChildText(s.value), r = s.on((n) => t.setText(n));
1257
+ ]), ht = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), Te = (t) => (e) => {
1258
+ const s = e.makeChildText(t);
1259
+ return (r) => s.clear(r);
1260
+ }, we = (t) => (e) => {
1261
+ const s = e.makeChildText(t.value), r = t.on((n) => s.setText(n));
1106
1262
  return (n) => {
1107
- r(), t.clear(n);
1263
+ r(), s.clear(n);
1108
1264
  };
1109
- }, Tt = (s) => d.is(s) ? de(s) : fe(s), m = (...s) => (e) => {
1110
- const t = s.map((r) => u(r)(e));
1265
+ }, Ut = (t) => d.is(t) ? we(t) : Te(t), g = (...t) => (e) => {
1266
+ const s = t.map((r) => f(r)(e));
1111
1267
  return (r) => {
1112
- t.forEach((n) => n(r));
1268
+ s.forEach((n) => n(r));
1113
1269
  };
1114
- }, v = () => () => {
1115
- }, Je = (s) => (e) => (e.addClasses(s), (t) => {
1116
- t && e.removeClasses(s);
1117
- }), Qe = (s) => (e) => {
1118
- let t = [];
1119
- const r = s.on((n) => {
1120
- e.removeClasses(t), t = (n ?? "").split(" ").filter((o) => o.length > 0), e.addClasses(t);
1270
+ }, A = () => () => {
1271
+ }, ft = (t) => (e) => (e.addClasses(t), (s) => {
1272
+ s && e.removeClasses(t);
1273
+ }), dt = (t) => (e) => {
1274
+ let s = [];
1275
+ const r = t.on((n) => {
1276
+ e.removeClasses(s), s = (n ?? "").split(" ").filter((i) => i.length > 0), e.addClasses(s);
1121
1277
  });
1122
1278
  return (n) => {
1123
- r(), n && e.removeClasses(t), t.length = 0;
1279
+ r(), n && e.removeClasses(s), s.length = 0;
1124
1280
  };
1125
- }, L = (s, e) => (t) => {
1126
- const { get: r, set: n } = t.makeAccessors(s), o = r();
1281
+ }, H = (t, e) => (s) => {
1282
+ const { get: r, set: n } = s.makeAccessors(t), i = r();
1127
1283
  return n(e), (l) => {
1128
- l && n(o);
1284
+ l && n(i);
1129
1285
  };
1130
- }, $ = (s, e) => (t) => {
1131
- const { get: r, set: n } = t.makeAccessors(s), o = r(), l = e.on(n);
1286
+ }, $ = (t, e) => (s) => {
1287
+ const { get: r, set: n } = s.makeAccessors(t), i = r(), l = e.on(n);
1132
1288
  return (c) => {
1133
- l(), c && n(o);
1289
+ l(), c && n(i);
1134
1290
  };
1135
- }, D = new Proxy(
1291
+ }, L = new Proxy(
1136
1292
  {},
1137
1293
  {
1138
1294
  /**
@@ -1146,17 +1302,17 @@ const Ge = /* @__PURE__ */ new Set([
1146
1302
  * @returns The renderable component for the specified attribute.
1147
1303
  *
1148
1304
  */
1149
- get: (s, e) => e === "class" ? (t) => d.is(t) ? Qe(t) : Je(
1150
- (t ?? "").split(" ").filter((r) => r.length > 0)
1151
- ) : (t) => d.is(t) ? $(
1305
+ get: (t, e) => e === "class" ? (s) => d.is(s) ? dt(s) : ft(
1306
+ (s ?? "").split(" ").filter((r) => r.length > 0)
1307
+ ) : (s) => d.is(s) ? $(
1152
1308
  e,
1153
- t
1154
- ) : L(
1309
+ s
1310
+ ) : H(
1155
1311
  e,
1156
- t
1312
+ s
1157
1313
  )
1158
1314
  }
1159
- ), xt = new Proxy(
1315
+ ), Wt = new Proxy(
1160
1316
  {},
1161
1317
  {
1162
1318
  /**
@@ -1167,12 +1323,12 @@ const Ge = /* @__PURE__ */ new Set([
1167
1323
  * @returns The renderable component for the specified attribute.
1168
1324
  *
1169
1325
  */
1170
- get: (s, e) => (t) => d.is(t) ? $(
1326
+ get: (t, e) => (s) => d.is(s) ? $(
1171
1327
  `data-${e}`,
1172
- t
1173
- ) : L(`data-${e}`, t)
1328
+ s
1329
+ ) : H(`data-${e}`, s)
1174
1330
  }
1175
- ), Ct = new Proxy(
1331
+ ), Jt = new Proxy(
1176
1332
  {},
1177
1333
  {
1178
1334
  /**
@@ -1183,15 +1339,15 @@ const Ge = /* @__PURE__ */ new Set([
1183
1339
  * @returns The renderable component for the specified attribute.
1184
1340
  *
1185
1341
  */
1186
- get: (s, e) => (t) => d.is(t) ? $(
1342
+ get: (t, e) => (s) => d.is(s) ? $(
1187
1343
  `aria-${e}`,
1188
- t
1189
- ) : L(
1344
+ s
1345
+ ) : H(
1190
1346
  `aria-${e}`,
1191
- t
1347
+ s
1192
1348
  )
1193
1349
  }
1194
- ), bt = new Proxy(
1350
+ ), Gt = new Proxy(
1195
1351
  {},
1196
1352
  {
1197
1353
  /**
@@ -1202,15 +1358,15 @@ const Ge = /* @__PURE__ */ new Set([
1202
1358
  * @returns The renderable component for the specified attribute.
1203
1359
  *
1204
1360
  */
1205
- get: (s, e) => (t) => d.is(t) ? $(
1361
+ get: (t, e) => (s) => d.is(s) ? $(
1206
1362
  e,
1207
- t
1208
- ) : L(
1363
+ s
1364
+ ) : H(
1209
1365
  e,
1210
- t
1366
+ s
1211
1367
  )
1212
1368
  }
1213
- ), Et = new Proxy(
1369
+ ), zt = new Proxy(
1214
1370
  {},
1215
1371
  {
1216
1372
  /**
@@ -1220,37 +1376,37 @@ const Ge = /* @__PURE__ */ new Set([
1220
1376
  * @returns The renderable component for the specified attribute.
1221
1377
  *
1222
1378
  */
1223
- get: (s, e) => (t) => d.is(t) ? $(
1379
+ get: (t, e) => (s) => d.is(s) ? $(
1224
1380
  e,
1225
- t
1226
- ) : L(
1381
+ s
1382
+ ) : H(
1227
1383
  e,
1228
- t
1384
+ s
1229
1385
  )
1230
1386
  }
1231
- ), u = (s) => {
1232
- if (s == null)
1233
- return v;
1234
- if (Array.isArray(s))
1235
- return m(...s.map(u));
1236
- if (typeof s == "string")
1237
- return fe(s);
1238
- if (d.is(s))
1239
- return de(s);
1240
- if (typeof s == "function")
1241
- return s;
1242
- throw new Error(`Unknown type: '${typeof s}' for child: ${s}`);
1243
- }, pe = (s, ...e) => (t) => {
1244
- const r = t.makeChildElement(s, void 0), n = e.map((o) => u(o)(r));
1245
- return (o) => {
1246
- n.forEach((l) => l(!1)), r.clear(o);
1387
+ ), f = (t) => {
1388
+ if (t == null)
1389
+ return A;
1390
+ if (Array.isArray(t))
1391
+ return g(...t.map(f));
1392
+ if (typeof t == "string")
1393
+ return Te(t);
1394
+ if (d.is(t))
1395
+ return we(t);
1396
+ if (typeof t == "function")
1397
+ return t;
1398
+ throw new Error(`Unknown type: '${typeof t}' for child: ${t}`);
1399
+ }, _e = (t, ...e) => (s) => {
1400
+ const r = s.makeChildElement(t, void 0), n = e.map((i) => f(i)(r));
1401
+ return (i) => {
1402
+ n.forEach((l) => l(!1)), r.clear(i);
1247
1403
  };
1248
- }, me = (s, e, ...t) => (r) => {
1249
- const n = r.makeChildElement(s, e), o = t.map((l) => u(l)(n));
1404
+ }, Ae = (t, e, ...s) => (r) => {
1405
+ const n = r.makeChildElement(t, e), i = s.map((l) => f(l)(n));
1250
1406
  return (l) => {
1251
- o.forEach((c) => c(!1)), n.clear(l);
1407
+ i.forEach((c) => c(!1)), n.clear(l);
1252
1408
  };
1253
- }, Dt = new Proxy(
1409
+ }, Xt = new Proxy(
1254
1410
  {},
1255
1411
  {
1256
1412
  /**
@@ -1258,9 +1414,9 @@ const Ge = /* @__PURE__ */ new Set([
1258
1414
  * @param tagName - The HTML tag name.
1259
1415
  * @returns A renderable function that creates and appends the HTML element to the DOM.
1260
1416
  */
1261
- get: (s, e) => (...t) => pe(e, t.flatMap(u))
1417
+ get: (t, e) => (...s) => _e(e, s.flatMap(f))
1262
1418
  }
1263
- ), Ot = new Proxy(
1419
+ ), Yt = new Proxy(
1264
1420
  {},
1265
1421
  {
1266
1422
  /**
@@ -1268,9 +1424,9 @@ const Ge = /* @__PURE__ */ new Set([
1268
1424
  * @param type - The input type name.
1269
1425
  * @returns A renderable function that creates and appends the HTMLInput element to the DOM.
1270
1426
  */
1271
- get: (s, e) => (...t) => pe("input", D.type(e), ...t)
1427
+ get: (t, e) => (...s) => _e("input", L.type(e), ...s)
1272
1428
  }
1273
- ), Xe = "http://www.w3.org/2000/svg", At = new Proxy(
1429
+ ), pt = "http://www.w3.org/2000/svg", Qt = new Proxy(
1274
1430
  {},
1275
1431
  {
1276
1432
  /**
@@ -1278,9 +1434,9 @@ const Ge = /* @__PURE__ */ new Set([
1278
1434
  * @param tagName - The SVG tag name.
1279
1435
  * @returns A renderable function that creates and appends the SVG element to the DOM.
1280
1436
  */
1281
- get: (s, e) => (...t) => me(e, Xe, t.flatMap(u))
1437
+ get: (t, e) => (...s) => Ae(e, pt, s.flatMap(f))
1282
1438
  }
1283
- ), Ye = "http://www.w3.org/1998/Math/MathML", Mt = new Proxy(
1439
+ ), gt = "http://www.w3.org/1998/Math/MathML", Zt = new Proxy(
1284
1440
  {},
1285
1441
  {
1286
1442
  /**
@@ -1288,35 +1444,35 @@ const Ge = /* @__PURE__ */ new Set([
1288
1444
  * @param tagName - The Math tag name.
1289
1445
  * @returns A renderable function that creates and appends the Math element to the DOM.
1290
1446
  */
1291
- get: (s, e) => (...t) => me(e, Ye, t.flatMap(u))
1447
+ get: (t, e) => (...s) => Ae(e, gt, s.flatMap(f))
1292
1448
  }
1293
- ), ge = (s, e) => {
1449
+ ), Se = (t, e) => {
1294
1450
  if (typeof e == "function")
1295
- return ge(s, { then: e });
1296
- const t = e.pending != null ? u(e.pending) : v, r = e.then, n = e.error != null ? (o) => u(e.error(o)) : () => v;
1297
- return (o) => {
1451
+ return Se(t, { then: e });
1452
+ const s = e.pending != null ? f(e.pending) : A, r = e.then, n = e.error != null ? (i) => f(e.error(i)) : () => A;
1453
+ return (i) => {
1298
1454
  let l = !0;
1299
- const c = s(), a = o.makeRef();
1300
- let f = u(t)(a);
1455
+ const c = t(), a = i.makeRef();
1456
+ let u = f(s)(a);
1301
1457
  return c.then(
1302
1458
  (h) => {
1303
- l && (f(!0), f = u(r(h))(a));
1459
+ l && (u(!0), u = f(r(h))(a));
1304
1460
  },
1305
1461
  (h) => {
1306
- l && (f(!0), f = u(n(h))(a));
1462
+ l && (u(!0), u = f(n(h))(a));
1307
1463
  }
1308
1464
  ), (h) => {
1309
- l = !1, f(h), a.clear(h);
1465
+ l = !1, u(h), a.clear(h);
1310
1466
  };
1311
1467
  };
1312
- }, kt = (s, e) => ge(() => s, e), ye = (s, e) => (t) => t.on(s, e), Ze = (s) => ye("click", (e) => {
1468
+ }, Kt = (t, e) => Se(() => t, e), be = (t, e) => (s) => s.on(t, e), mt = (t) => be("click", (e) => {
1313
1469
  e.preventDefault();
1314
- const t = e.target;
1470
+ const s = e.target;
1315
1471
  setTimeout(() => {
1316
- const r = t.ownerDocument != null ? t == null ? void 0 : t.checked : void 0;
1317
- r != null && s(!r);
1472
+ const r = s.ownerDocument != null ? s == null ? void 0 : s.checked : void 0;
1473
+ r != null && t(!r);
1318
1474
  }, 0);
1319
- }), q = new Proxy(
1475
+ }), G = new Proxy(
1320
1476
  {},
1321
1477
  {
1322
1478
  /**
@@ -1324,311 +1480,282 @@ const Ge = /* @__PURE__ */ new Set([
1324
1480
  * @param fn - The function to call when the event is triggered.
1325
1481
  * @returns A `Renderable` function that adds the event listener to the element.
1326
1482
  */
1327
- get: (s, e) => (t) => ye(e, t)
1483
+ get: (t, e) => (s) => be(e, s)
1328
1484
  }
1329
- ), Ke = (s) => (e) => {
1330
- const t = e.target;
1331
- s(t.value);
1332
- }, et = (s) => (e) => {
1333
- const t = e.target;
1334
- s(t.valueAsNumber);
1335
- }, tt = (s) => (e) => {
1336
- const t = e.target;
1337
- if (t.value === "")
1485
+ ), yt = (t) => (e) => {
1486
+ const s = e.target;
1487
+ t(s.value);
1488
+ }, Tt = (t) => (e) => {
1489
+ const s = e.target;
1490
+ t(s.valueAsNumber);
1491
+ }, wt = (t) => (e) => {
1492
+ const s = e.target;
1493
+ if (s.value === "")
1338
1494
  return;
1339
- const r = t.value.split("-"), n = new Date(
1495
+ const r = s.value.split("-"), n = new Date(
1340
1496
  Number(r[0]),
1341
1497
  Number(r[1]) - 1,
1342
1498
  Number(r[2].substring(0, 2))
1343
1499
  );
1344
- s(n);
1345
- }, st = (s) => (e) => {
1346
- const t = e.target;
1347
- if (t.value === "")
1500
+ t(n);
1501
+ }, _t = (t) => (e) => {
1502
+ const s = e.target;
1503
+ if (s.value === "")
1348
1504
  return;
1349
- const r = t.value.split("T"), n = r[0].split("-"), o = new Date(
1505
+ const r = s.value.split("T"), n = r[0].split("-"), i = new Date(
1350
1506
  Number(n[0]),
1351
1507
  Number(n[1]) - 1,
1352
1508
  Number(n[2])
1353
1509
  ), l = r[1].split(":");
1354
- o.setHours(Number(l[0])), o.setMinutes(Number(l[1])), o.setSeconds(Number(l[2])), s(o);
1355
- }, Lt = (s) => (e) => {
1356
- const t = e.target;
1357
- s(t.checked);
1358
- }, $t = (s) => (e) => {
1359
- e.preventDefault(), s();
1360
- }, Nt = (s) => (e) => {
1361
- e.stopPropagation(), s();
1362
- }, Ht = (s) => (e) => {
1363
- e.stopImmediatePropagation(), s();
1364
- }, It = (s, e = "input") => m(
1365
- D.valueAsDate(s),
1366
- q[e](tt(s.set))
1367
- ), Vt = (s, e = "input") => m(
1368
- D.valueAsDate(s),
1369
- q[e](st(s.set))
1370
- ), Rt = (s, e = "input") => m(
1371
- D.valueAsNumber(s),
1372
- q[e](et(s.set))
1373
- ), jt = (s, e = "input") => m(D.value(s), q[e](Ke(s.set))), qt = (s) => m(D.checked(s), Ze(s.set)), B = (s, e) => {
1374
- if (d.is(s))
1510
+ i.setHours(Number(l[0])), i.setMinutes(Number(l[1])), i.setSeconds(Number(l[2])), t(i);
1511
+ }, es = (t) => (e) => {
1512
+ const s = e.target;
1513
+ t(s.checked);
1514
+ }, ts = (t) => (e) => {
1515
+ e.preventDefault(), t();
1516
+ }, ss = (t) => (e) => {
1517
+ e.stopPropagation(), t();
1518
+ }, rs = (t) => (e) => {
1519
+ e.stopImmediatePropagation(), t();
1520
+ }, ns = (t, e = "input") => g(
1521
+ L.valueAsDate(t),
1522
+ G[e](wt(t.set))
1523
+ ), is = (t, e = "input") => g(
1524
+ L.valueAsDate(t),
1525
+ G[e](_t(t.set))
1526
+ ), os = (t, e = "input") => g(
1527
+ L.valueAsNumber(t),
1528
+ G[e](Tt(t.set))
1529
+ ), ls = (t, e = "input") => g(L.value(t), G[e](yt(t.set))), cs = (t) => g(L.checked(t), mt(t.set)), z = (t, e) => {
1530
+ if (d.is(t))
1375
1531
  return (r) => {
1376
1532
  const n = r.makeRef();
1377
- let o, l;
1378
- const c = s.map((h) => Object.keys(h)[0]);
1533
+ let i, l;
1534
+ const c = t.map((h) => Object.keys(h)[0]);
1379
1535
  let a;
1380
- const f = c.on((h) => {
1536
+ const u = c.on((h) => {
1381
1537
  if (h !== a) {
1382
- l == null || l.dispose(), o == null || o(!0), l = s.map((O) => O[h]);
1383
- const S = e[h](l);
1384
- o = u(S)(n), a = h;
1538
+ l == null || l.dispose(), i == null || i(!0), l = t.map((S) => S[h]);
1539
+ const m = e[h](l);
1540
+ i = f(m)(n), a = h;
1385
1541
  }
1386
1542
  });
1387
1543
  return (h) => {
1388
- f(), n.clear(h), o == null || o(h);
1544
+ u(), n.clear(h), i == null || i(h);
1389
1545
  };
1390
1546
  };
1391
- const t = Object.keys(s)[0];
1392
- return u(e[t](j(s[t])));
1393
- }, we = (s, e, t) => B(
1394
- p.map(s, (r) => ({ [r[e]]: r })),
1547
+ const s = Object.keys(t)[0];
1548
+ return f(e[s](J(t[s])));
1549
+ }, Ee = (t, e, s) => z(
1550
+ p.map(t, (r) => ({ [r[e]]: r })),
1395
1551
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1396
- t
1397
- ), Bt = (s, e) => we(s, "kind", e), Ft = (s, e) => {
1398
- const t = p.map(s, ([r, n]) => ({ [r]: n }));
1399
- return B(t, e);
1400
- }, Ut = (s, e) => we(s, "type", e), rt = (s, e) => B(
1401
- p.map(s, (t) => ({ [t]: !0 })),
1552
+ s
1553
+ ), as = (t, e) => Ee(t, "kind", e), us = (t, e) => {
1554
+ const s = p.map(t, ([r, n]) => ({ [r]: n }));
1555
+ return z(s, e);
1556
+ }, hs = (t, e) => Ee(t, "type", e), At = (t, e) => z(
1557
+ p.map(t, (s) => ({ [s]: !0 })),
1402
1558
  e
1403
- ), Wt = (s, e = {}) => (t) => {
1404
- const r = (e == null ? void 0 : e.firstSeparator) ?? s, n = (e == null ? void 0 : e.lastSeparator) ?? s;
1405
- return rt(
1406
- t.map((o) => o.isFirst ? "first" : o.isLast ? "last" : "other"),
1559
+ ), fs = (t, e = {}) => (s) => {
1560
+ const r = (e == null ? void 0 : e.firstSeparator) ?? t, n = (e == null ? void 0 : e.lastSeparator) ?? t;
1561
+ return At(
1562
+ s.map((i) => i.isFirst ? "first" : i.isLast ? "last" : "other"),
1407
1563
  {
1408
1564
  first: () => r,
1409
1565
  last: () => n,
1410
- other: () => s
1566
+ other: () => t
1411
1567
  }
1412
1568
  );
1413
- }, _e = (s, e) => (t) => {
1414
- const r = Object.values(s).reduce((n, o) => {
1415
- const l = t.getProvider(o);
1416
- return n[o] = l, n;
1569
+ }, Ce = (t, e) => (s) => {
1570
+ const r = Object.values(t).reduce((n, i) => {
1571
+ const l = s.getProvider(i);
1572
+ return n[i] = l, n;
1417
1573
  }, {});
1418
- return u(e(r))(t);
1419
- }, Gt = (s, e) => (t) => {
1420
- const r = [], n = Object.entries(s).reduce(
1421
- (o, [l, c]) => (r.push(
1422
- c((a) => (Reflect.set(o, l, a), null))(t)
1423
- ), o),
1574
+ return f(e(r))(s);
1575
+ }, ds = (t, e) => (s) => {
1576
+ const r = [], n = Object.entries(t).reduce(
1577
+ (i, [l, c]) => (r.push(
1578
+ c((a) => (Reflect.set(i, l, a), null))(s)
1579
+ ), i),
1424
1580
  {}
1425
1581
  );
1426
- return r.push(e(n)(t)), (o) => {
1427
- r.forEach((l) => l(o));
1582
+ return r.push(e(n)(s)), (i) => {
1583
+ r.forEach((l) => l(i));
1428
1584
  };
1429
- }, nt = (s, e) => _e([s], (t) => u(e(t[s]))), zt = (s, e) => _e(s, (t) => u(e(t))), Jt = (s) => (e) => s(e) ?? (() => {
1430
- }), Qt = (s) => (e) => (e.appendOrInsert(s), (t) => {
1431
- t && W(s);
1432
- }), it = (s, e, t) => {
1433
- if (d.is(s)) {
1434
- const r = s;
1585
+ }, St = (t, e) => Ce([t], (s) => f(e(s[t]))), ps = (t, e) => Ce(t, (s) => f(e(s))), gs = (t) => (e) => t(e) ?? (() => {
1586
+ }), ms = (t) => (e) => (e.appendOrInsert(t), (s) => {
1587
+ s && R(t);
1588
+ }), bt = (t, e, s) => {
1589
+ if (d.is(t)) {
1590
+ const r = t;
1435
1591
  return (n) => {
1436
- const o = n.makeRef();
1592
+ const i = n.makeRef();
1437
1593
  let l = null, c = !1;
1438
- const a = I(null), f = r.on((h) => {
1439
- h == null ? (l == null || l(!0), l = u((t == null ? void 0 : t()) ?? v)(o), c = !1) : (a.value = h, c || (l == null || l(!0), l = u(e(a))(
1440
- o
1594
+ const a = N(null), u = r.on((h) => {
1595
+ h == null ? (l == null || l(!0), l = f((s == null ? void 0 : s()) ?? A)(i), c = !1) : (a.value = h, c || (l == null || l(!0), l = f(e(a))(
1596
+ i
1441
1597
  ), c = !0));
1442
1598
  });
1443
1599
  return (h) => {
1444
- f(), l == null || l(h), o.clear(h);
1600
+ u(), l == null || l(h), i.clear(h);
1445
1601
  };
1446
1602
  };
1447
1603
  } else {
1448
- const r = s;
1604
+ const r = t;
1449
1605
  if (r == null) {
1450
- const n = t == null ? void 0 : t();
1451
- return n != null ? u(n) : v;
1606
+ const n = s == null ? void 0 : s();
1607
+ return n != null ? f(n) : A;
1452
1608
  }
1453
- return u(e(j(r)));
1609
+ return f(e(J(r)));
1454
1610
  }
1455
- }, V = (s) => (e) => (t) => s(t, e), ve = (s, e, t) => Se(
1456
- s,
1611
+ }, U = (t) => (e) => (s) => t(s, e), ve = (t, e, s) => Pe(
1612
+ t,
1457
1613
  () => e,
1458
- () => t
1459
- ), Se = (s, e, t) => it(
1460
- p.map(s, (r) => r ? !0 : null),
1614
+ () => s
1615
+ ), Pe = (t, e, s) => bt(
1616
+ p.map(t, (r) => r ? !0 : null),
1461
1617
  e,
1462
- t ?? void 0
1463
- ), Xt = (s, e, t) => ot(
1464
- s,
1618
+ s ?? void 0
1619
+ ), ys = (t, e, s) => Et(
1620
+ t,
1465
1621
  () => e,
1466
- () => t
1467
- ), ot = (s, e, t) => Se(
1468
- p.map(s, (r) => !r),
1622
+ () => s
1623
+ ), Et = (t, e, s) => Pe(
1624
+ p.map(t, (r) => !r),
1469
1625
  e,
1470
- t
1471
- ), Pe = (s, e, t) => t != null ? Pe(s, (r) => {
1472
- const n = new M(
1626
+ s
1627
+ ), xe = (t, e, s) => s != null ? xe(t, (r) => {
1628
+ const n = new D(
1473
1629
  r.index,
1474
- r.total.map((o) => o - 1)
1630
+ r.total.map((i) => i - 1)
1475
1631
  );
1476
- return m(
1477
- V(n.dispose),
1478
- u(e(r)),
1479
- ve(r.isLast, v, t(n))
1632
+ return g(
1633
+ U(n.dispose),
1634
+ f(e(r)),
1635
+ ve(r.isLast, A, s(n))
1480
1636
  );
1481
- }) : d.is(s) ? (r) => {
1482
- const n = r.makeRef(), o = Array.from(
1483
- { length: s.value },
1484
- (a, f) => f
1485
- ).map((a) => new M(a, s)), l = o.map(
1486
- (a) => u(e(a))(n)
1487
- ), c = s.on((a) => {
1637
+ }) : d.is(t) ? (r) => {
1638
+ const n = r.makeRef(), i = Array.from(
1639
+ { length: t.value },
1640
+ (a, u) => u
1641
+ ).map((a) => new D(a, t)), l = i.map(
1642
+ (a) => f(e(a))(n)
1643
+ ), c = t.on((a) => {
1488
1644
  for (; a < l.length; )
1489
- o.pop().dispose(), l.pop()(!0);
1490
- for (let f = 0; f < a; f++)
1491
- if (o[f] == null) {
1492
- o[f] = new M(f, s);
1493
- const h = u(e(o[f]));
1494
- l[f] = h(n);
1645
+ i.pop().dispose(), l.pop()(!0);
1646
+ for (let u = 0; u < a; u++)
1647
+ if (i[u] == null) {
1648
+ i[u] = new D(u, t);
1649
+ const h = f(e(i[u]));
1650
+ l[u] = h(n);
1495
1651
  }
1496
1652
  });
1497
1653
  return (a) => {
1498
1654
  c(), n.clear(a);
1499
1655
  };
1500
- } : m(
1501
- ...Array.from({ length: s }, (r, n) => n).map(
1502
- (r) => u(e(new M(r, j(s))))
1656
+ } : g(
1657
+ ...Array.from({ length: t }, (r, n) => n).map(
1658
+ (r) => f(e(new D(r, J(t))))
1503
1659
  )
1504
- ), lt = (s, e, t) => {
1505
- if (t != null)
1506
- return lt(s, (r, n) => {
1507
- const o = new M(
1660
+ ), Ct = (t, e, s) => {
1661
+ if (s != null)
1662
+ return Ct(t, (r, n) => {
1663
+ const i = new D(
1508
1664
  n.index,
1509
1665
  n.total.map((l) => l - 1)
1510
1666
  );
1511
- return m([
1512
- V(o.dispose),
1513
- u(e(r, n)),
1514
- ve(n.isLast, v, t(o))
1667
+ return g([
1668
+ U(i.dispose),
1669
+ f(e(r, n)),
1670
+ ve(n.isLast, A, s(i))
1515
1671
  ]);
1516
1672
  });
1517
1673
  {
1518
- const r = p.map(s, (o) => o.length), n = p.toSignal(s);
1519
- return Pe(r, (o) => {
1520
- const l = n.map((c) => c[o.index]);
1521
- return m(
1522
- V(l.dispose),
1523
- u(e(l, o))
1674
+ const r = p.map(t, (i) => i.length), n = p.toSignal(t);
1675
+ return xe(r, (i) => {
1676
+ const l = n.map((c) => c[i.index]);
1677
+ return g(
1678
+ U(l.dispose),
1679
+ f(e(l, i))
1524
1680
  );
1525
1681
  });
1526
1682
  }
1527
- }, ct = (s) => (e) => e.isBrowserDOM() ? s(e) ?? (() => {
1683
+ }, vt = (t) => (e) => e.isBrowserDOM() ? t(e) ?? (() => {
1528
1684
  }) : () => {
1529
- }, Yt = (s) => (e) => e.isHeadlessDOM() ? s(e) ?? (() => {
1685
+ }, Ts = (t) => (e) => e.isHeadlessDOM() ? t(e) ?? (() => {
1530
1686
  }) : () => {
1531
- }, Zt = (s) => ct((e) => s(e.element) ?? (() => {
1532
- })), Kt = (s, e) => {
1533
- if (d.is(s)) {
1534
- const t = s;
1687
+ }, ws = (t) => vt((e) => t(e.element) ?? (() => {
1688
+ })), _s = (t, e) => {
1689
+ if (d.is(t)) {
1690
+ const s = t;
1535
1691
  return (r) => {
1536
1692
  r = r.makeRef();
1537
- const n = t.map((c) => u(e(c)));
1538
- let o = () => {
1693
+ const n = s.map((c) => f(e(c)));
1694
+ let i = () => {
1539
1695
  };
1540
1696
  const l = n.on((c) => {
1541
- o(!0), o = c(r);
1697
+ i(!0), i = c(r);
1542
1698
  });
1543
1699
  return (c) => {
1544
- l(), o(c);
1700
+ l(), i(c);
1545
1701
  };
1546
1702
  };
1547
1703
  }
1548
- return u(e(s));
1549
- }, es = (s, e, t = () => v) => B(
1704
+ return f(e(t));
1705
+ }, As = (t, e, s = () => A) => z(
1550
1706
  p.map(
1551
- s,
1707
+ t,
1552
1708
  (r) => r.length > 0 ? { notEmpty: r } : { whenEmpty: null }
1553
1709
  ),
1554
1710
  {
1555
1711
  notEmpty: (r) => e(r),
1556
- whenEmpty: () => t()
1712
+ whenEmpty: () => s()
1557
1713
  }
1558
- ), z = (s, e) => {
1559
- const t = s(e);
1560
- return () => t(!0);
1561
- }, ts = (s, e, { doc: t, clear: r } = {}) => {
1562
- const n = typeof e == "string" ? (t ?? document).querySelector(e) : e;
1563
- if (n === null)
1564
- throw new at(
1565
- `Cannot find element by selector for render: ${e}`
1566
- );
1567
- r !== !1 && (t ?? n.ownerDocument) != null && n.nodeType === 1 && (n.innerHTML = "");
1568
- const o = je(n), l = le(n) ? void 0 : n, c = b.of(o, l);
1569
- return z(s, c);
1570
- }, ss = (s, {
1571
- startUrl: e = "https://example.com",
1572
- selector: t = ":root"
1573
- } = {}) => {
1574
- const r = p.toSignal(e).deriveProp(), n = new he(t, void 0), o = new E(n, void 0, { currentURL: r }, {});
1575
- return {
1576
- clear: z(s(), o),
1577
- root: n,
1578
- currentURL: r
1579
- };
1580
- };
1581
- class at extends Error {
1582
- constructor(e) {
1583
- super(e);
1584
- }
1585
- }
1586
- const rs = (s, e) => (t) => {
1587
- const r = t.makePortal(s);
1588
- return z(u(e), r);
1589
- }, ut = (s) => Symbol(s), Te = (s, e) => (t) => u(e)(t.withProviders(s)), ns = (...s) => s.length > 0 ? s.reduceRight((e, t) => (r) => e(t(r))) : u, ht = (s, e, t) => Te({ [s]: e }, u(t)), is = (s, e) => Te(s, u(e)), xe = ut("Probe"), x = /* @__PURE__ */ new Map(), ft = ({
1590
- identifier: s,
1714
+ ), Ss = (t, e) => (s) => {
1715
+ const r = s.makePortal(t);
1716
+ return Z(f(e), r);
1717
+ }, Pt = (t) => Symbol(t), Le = (t, e) => (s) => f(e)(s.withProviders(t)), bs = (...t) => t.length > 0 ? t.reduceRight((e, s) => (r) => e(s(r))) : f, xt = (t, e, s) => Le({ [t]: e }, f(s)), Es = (t, e) => Le(t, f(e)), Oe = Pt("Probe"), C = /* @__PURE__ */ new Map(), Lt = ({
1718
+ identifier: t,
1591
1719
  callback: e,
1592
- child: t,
1720
+ child: s,
1593
1721
  timeout: r = 10
1594
1722
  }) => {
1595
- if (x.has(s))
1596
- throw new Error(`Probe already exists: ${s.description}`);
1723
+ if (C.has(t))
1724
+ throw new Error(`Probe already exists: ${t.description}`);
1597
1725
  const n = setTimeout(() => e("timeout"), r);
1598
- x.set(s, {
1726
+ C.set(t, {
1599
1727
  counter: 0,
1600
1728
  timeoutId: n
1601
1729
  });
1602
- const o = (l) => {
1730
+ const i = (l) => {
1603
1731
  clearTimeout(n);
1604
- const c = x.get(l);
1732
+ const c = C.get(l);
1605
1733
  if (c == null)
1606
1734
  throw new Error(`Probe not found: ${l.description}`);
1607
- --c.counter === 0 ? (e("resolved"), x.delete(l)) : x.set(l, c);
1735
+ --c.counter === 0 ? (e("resolved"), C.delete(l)) : C.set(l, c);
1608
1736
  };
1609
- return m(
1610
- V(() => clearTimeout(n)),
1611
- ht(xe, o, t)
1737
+ return g(
1738
+ U(() => clearTimeout(n)),
1739
+ xt(Oe, i, s)
1612
1740
  );
1613
- }, dt = (s, e) => nt(xe, (t) => {
1614
- const r = x.get(s);
1615
- if (r == null)
1616
- throw new Error(`Probe not found: ${s.description}`);
1617
- return clearTimeout(r.timeoutId), r.counter++, e(() => t(s));
1618
- }), Ce = Symbol("globalProbe"), os = ({
1619
- callback: s,
1741
+ }, Ot = (t, e) => St(Oe, (s) => {
1742
+ const r = C.get(t);
1743
+ return r == null ? e(() => {
1744
+ }) : (clearTimeout(r.timeoutId), r.counter++, e(() => s(t)));
1745
+ }), De = Symbol("globalProbe"), Cs = ({
1746
+ callback: t,
1620
1747
  timeout: e
1621
- }, t) => ft({ identifier: Ce, callback: s, child: t, timeout: e }), ls = (s) => dt(Ce, s), pt = (s, e) => (t) => {
1622
- const r = t.getStyle(s);
1623
- return t.setStyle(s, e), (n) => {
1624
- n && t.setStyle(s, r);
1748
+ }, s) => Lt({ identifier: De, callback: t, child: s, timeout: e }), vs = (t) => Ot(De, t), Dt = (t, e) => (s) => {
1749
+ const r = s.getStyle(t);
1750
+ return s.setStyle(t, e), (n) => {
1751
+ n && s.setStyle(t, r);
1625
1752
  };
1626
- }, mt = (s, e) => (t) => {
1627
- const r = t.getStyle(s);
1628
- return e.on((n) => t.setStyle(s, n)), (n) => {
1629
- n && t.setStyle(s, r);
1753
+ }, Mt = (t, e) => (s) => {
1754
+ const r = s.getStyle(t);
1755
+ return e.on((n) => s.setStyle(t, n)), (n) => {
1756
+ n && s.setStyle(t, r);
1630
1757
  };
1631
- }, cs = new Proxy(
1758
+ }, Ps = new Proxy(
1632
1759
  {},
1633
1760
  {
1634
1761
  /**
@@ -1639,117 +1766,125 @@ const rs = (s, e) => (t) => {
1639
1766
  * @returns The renderable component for the specified attribute.
1640
1767
  *
1641
1768
  */
1642
- get: (s, e) => (t) => d.is(t) ? mt(e, t) : pt(e, t)
1769
+ get: (t, e) => (s) => d.is(s) ? Mt(e, s) : Dt(e, s)
1643
1770
  }
1644
1771
  );
1645
1772
  export {
1646
- kt as Async,
1647
- qt as BindChecked,
1648
- It as BindDate,
1649
- Vt as BindDateTime,
1650
- Rt as BindNumber,
1651
- jt as BindText,
1652
- b as BrowserContext,
1653
- C as Computed,
1654
- Wt as Conjunction,
1655
- Qt as DOMNode,
1656
- pe as El,
1657
- me as ElNS,
1658
- M as ElementPosition,
1659
- v as Empty,
1660
- it as Ensure,
1661
- lt as ForEach,
1662
- m as Fragment,
1663
- E as HeadlessContext,
1664
- Ue as HeadlessElement,
1665
- he as HeadlessPortal,
1666
- We as HeadlessText,
1667
- ot as LazyUnless,
1668
- Se as LazyWhen,
1669
- Kt as MapSignal,
1670
- te as MemoryStore,
1671
- es as NotEmpty,
1672
- ct as OnBrowserCtx,
1673
- Ze as OnChecked,
1674
- Jt as OnCtx,
1675
- V as OnDispose,
1676
- Zt as OnElement,
1677
- Yt as OnHeadlessCtx,
1678
- B as OneOf,
1679
- we as OneOfField,
1680
- Bt as OneOfKind,
1681
- Ft as OneOfTuple,
1682
- Ut as OneOfType,
1683
- rt as OneOfValue,
1684
- rs as Portal,
1685
- H as Prop,
1686
- ns as Provide,
1687
- os as ProvideGlobalProbe,
1688
- ft as ProvideProbe,
1689
- ce as ProviderNotFoundError,
1690
- at as RenderingError,
1691
- Pe as Repeat,
1773
+ F as ATTRS_PLACEHOLDER_ATTR,
1774
+ Kt as Async,
1775
+ cs as BindChecked,
1776
+ ns as BindDate,
1777
+ is as BindDateTime,
1778
+ os as BindNumber,
1779
+ ls as BindText,
1780
+ P as BrowserContext,
1781
+ V as CLASS_PLACEHOLDER_ATTR,
1782
+ v as Computed,
1783
+ fs as Conjunction,
1784
+ ms as DOMNode,
1785
+ _e as El,
1786
+ Ae as ElNS,
1787
+ D as ElementPosition,
1788
+ A as Empty,
1789
+ bt as Ensure,
1790
+ Ct as ForEach,
1791
+ g as Fragment,
1792
+ q as HTML_PLACEHOLDER_ATTR,
1793
+ Bt as HeadlessAdapter,
1794
+ x as HeadlessContext,
1795
+ ct as HeadlessElement,
1796
+ ye as HeadlessPortal,
1797
+ at as HeadlessText,
1798
+ Et as LazyUnless,
1799
+ Pe as LazyWhen,
1800
+ _s as MapSignal,
1801
+ oe as MemoryStore,
1802
+ pe as NODE_PLACEHOLDER_ATTR,
1803
+ As as NotEmpty,
1804
+ vt as OnBrowserCtx,
1805
+ mt as OnChecked,
1806
+ gs as OnCtx,
1807
+ U as OnDispose,
1808
+ ws as OnElement,
1809
+ Ts as OnHeadlessCtx,
1810
+ z as OneOf,
1811
+ Ee as OneOfField,
1812
+ as as OneOfKind,
1813
+ us as OneOfTuple,
1814
+ hs as OneOfType,
1815
+ At as OneOfValue,
1816
+ Ss as Portal,
1817
+ k as Prop,
1818
+ bs as Provide,
1819
+ Cs as ProvideGlobalProbe,
1820
+ Lt as ProvideProbe,
1821
+ de as ProviderNotFoundError,
1822
+ Ge as RenderingError,
1823
+ xe as Repeat,
1824
+ j as STYLE_PLACEHOLDER_ATTR,
1692
1825
  d as Signal,
1693
- ge as Task,
1694
- Tt as TextNode,
1695
- Xt as Unless,
1696
- Gt as Use,
1697
- ls as UseGlobalProbe,
1698
- dt as UseProbe,
1699
- nt as UseProvider,
1700
- zt as UseProviders,
1826
+ B as TEXT_PLACEHOLDER_ATTR,
1827
+ Se as Task,
1828
+ Ut as TextNode,
1829
+ ys as Unless,
1830
+ ds as Use,
1831
+ vs as UseGlobalProbe,
1832
+ Ot as UseProbe,
1833
+ St as UseProvider,
1834
+ ps as UseProviders,
1701
1835
  p as Value,
1702
1836
  ve as When,
1703
- ht as WithProvider,
1704
- is as WithProviders,
1705
- je as _getSelfOrParentElement,
1706
- le as _isElement,
1707
- Re as _makeGetter,
1708
- Ve as _makeSetter,
1709
- W as _removeDOMNode,
1710
- de as _signalText,
1711
- fe as _staticText,
1712
- St as animateSignal,
1713
- Ie as animateSignals,
1714
- Ct as aria,
1715
- D as attr,
1716
- xt as dataAttr,
1717
- Lt as emitChecked,
1718
- $t as emitPreventDefault,
1719
- Ht as emitStopImmediatePropagation,
1720
- Nt as emitStopPropagation,
1721
- Ke as emitValue,
1722
- tt as emitValueAsDate,
1723
- st as emitValueAsDateTime,
1724
- et as emitValueAsNumber,
1725
- Le as endInterpolate,
1726
- ee as getWindow,
1727
- $e as guessInterpolate,
1728
- Dt as html,
1729
- Ot as input,
1730
- ke as interpolateDate,
1731
- Ae as interpolateNumber,
1732
- Me as interpolateString,
1733
- _t as localStorageProp,
1734
- G as makeComputed,
1735
- yt as makeComputedOf,
1736
- Pt as makeComputedRecord,
1737
- He as makeEffect,
1738
- wt as makeEffectOf,
1739
- I as makeProp,
1740
- ut as makeProviderMark,
1741
- j as makeSignal,
1742
- Mt as math,
1743
- Et as mathAttr,
1744
- q as on,
1745
- xe as probeMarker,
1746
- ts as render,
1747
- z as renderWithContext,
1748
- u as renderableOfTNode,
1749
- ss as runHeadless,
1750
- vt as sessionStorageProp,
1751
- se as storedProp,
1752
- cs as style,
1753
- At as svg,
1754
- bt as svgAttr
1837
+ xt as WithProvider,
1838
+ Es as WithProviders,
1839
+ Je as _getSelfOrParentElement,
1840
+ fe as _isElement,
1841
+ We as _makeGetter,
1842
+ Ue as _makeSetter,
1843
+ R as _removeDOMNode,
1844
+ we as _signalText,
1845
+ Te as _staticText,
1846
+ Rt as animateSignal,
1847
+ Fe as animateSignals,
1848
+ Jt as aria,
1849
+ L as attr,
1850
+ Wt as dataAttr,
1851
+ es as emitChecked,
1852
+ ts as emitPreventDefault,
1853
+ rs as emitStopImmediatePropagation,
1854
+ ss as emitStopPropagation,
1855
+ yt as emitValue,
1856
+ wt as emitValueAsDate,
1857
+ _t as emitValueAsDateTime,
1858
+ Tt as emitValueAsNumber,
1859
+ Ve as endInterpolate,
1860
+ ie as getWindow,
1861
+ je as guessInterpolate,
1862
+ Xt as html,
1863
+ Yt as input,
1864
+ Re as interpolateDate,
1865
+ ke as interpolateNumber,
1866
+ Ne as interpolateString,
1867
+ kt as localStorageProp,
1868
+ Q as makeComputed,
1869
+ $t as makeComputedOf,
1870
+ Vt as makeComputedRecord,
1871
+ Be as makeEffect,
1872
+ It as makeEffectOf,
1873
+ N as makeProp,
1874
+ Pt as makeProviderMark,
1875
+ J as makeSignal,
1876
+ Zt as math,
1877
+ zt as mathAttr,
1878
+ G as on,
1879
+ Oe as probeMarker,
1880
+ jt as render,
1881
+ Z as renderWithContext,
1882
+ f as renderableOfTNode,
1883
+ Ft as restoreTempoPlaceholders,
1884
+ qt as runHeadless,
1885
+ Nt as sessionStorageProp,
1886
+ le as storedProp,
1887
+ Ps as style,
1888
+ Qt as svg,
1889
+ Gt as svgAttr
1755
1890
  };