@tempots/dom 18.0.0 → 19.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dom/animatable.d.ts +12 -12
  2. package/dom/attr.d.ts +14 -7
  3. package/dom/dom-context.d.ts +47 -2
  4. package/dom/dom-utils.d.ts +6 -3
  5. package/dom/handle-anchor-click.d.ts +13 -2
  6. package/dom/ssr.d.ts +48 -16
  7. package/index.cjs +1 -1
  8. package/index.js +1000 -755
  9. package/package.json +1 -1
  10. package/renderable/async.d.ts +33 -3
  11. package/renderable/attribute.d.ts +24 -7
  12. package/renderable/bind.d.ts +43 -13
  13. package/renderable/conjunction.d.ts +23 -4
  14. package/renderable/consumers.d.ts +54 -1
  15. package/renderable/domnode.d.ts +10 -2
  16. package/renderable/element.d.ts +50 -3
  17. package/renderable/empty.d.ts +5 -0
  18. package/renderable/ensure.d.ts +10 -0
  19. package/renderable/foreach.d.ts +12 -2
  20. package/renderable/fragment.d.ts +11 -0
  21. package/renderable/handler.d.ts +64 -10
  22. package/renderable/map-signal.d.ts +15 -0
  23. package/renderable/not-empty.d.ts +13 -1
  24. package/renderable/onctx.d.ts +9 -2
  25. package/renderable/oneof.d.ts +138 -16
  26. package/renderable/onmount.d.ts +8 -0
  27. package/renderable/onunmount.d.ts +6 -0
  28. package/renderable/portal.d.ts +12 -3
  29. package/renderable/providers.d.ts +39 -6
  30. package/renderable/render.d.ts +39 -3
  31. package/renderable/repeat.d.ts +11 -2
  32. package/renderable/style.d.ts +4 -0
  33. package/renderable/task.d.ts +18 -2
  34. package/renderable/text.d.ts +16 -3
  35. package/renderable/when.d.ts +21 -3
  36. package/std/interpolate.d.ts +56 -5
  37. package/std/position.d.ts +46 -2
  38. package/std/signal-utils.d.ts +195 -19
  39. package/std/signal.d.ts +401 -30
  40. package/types/aria-attributes.d.ts +5 -0
  41. package/types/css-styles.d.ts +11 -0
  42. package/types/domain.d.ts +62 -2
  43. package/types/html-attributes.d.ts +10 -0
  44. package/types/html-events.d.ts +5 -0
  45. package/types/html-tags.d.ts +5 -0
  46. package/types/mathml-attributes.d.ts +5 -0
  47. package/types/mathml-tags.d.ts +4 -0
  48. package/types/svg-attributes.d.ts +5 -0
  49. package/types/svg-tags.d.ts +5 -0
package/index.js CHANGED
@@ -1,154 +1,315 @@
1
- var Me = Object.defineProperty;
2
- var Oe = (t, e, r) => e in t ? Me(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var l = (t, e, r) => Oe(t, typeof e != "symbol" ? e + "" : e, r);
4
- function Ie(t, e, r) {
5
- return t + (e - t) * r;
6
- }
7
- const z = 97;
8
- function $e(t, e, r) {
9
- const n = Math.max(t.length, e.length);
10
- let s = "";
11
- for (let i = 0; i < n; i++) {
12
- let o = t.charCodeAt(i);
13
- isNaN(o) && (o = z);
14
- let a = e.charCodeAt(i);
15
- isNaN(a) && (a = z), s += String.fromCharCode(o + (a - o) * r);
1
+ var De = Object.defineProperty;
2
+ var be = (t, e, r) => e in t ? De(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var l = (t, e, r) => be(t, typeof e != "symbol" ? e + "" : e, r);
4
+ const Te = (t, e, r) => t + (e - t) * r;
5
+ const Ce = (t, e, r) => {
6
+ const s = Math.max(t.length, e.length);
7
+ let n = "";
8
+ for (let o = 0; o < s; o++) {
9
+ let i = t.charCodeAt(o);
10
+ isNaN(i) && (i = 97);
11
+ let a = e.charCodeAt(o);
12
+ isNaN(a) && (a = 97), n += String.fromCharCode(i + (a - i) * r);
16
13
  }
17
- return s;
18
- }
19
- function Fe(t, e, r) {
20
- return new Date(t.getTime() + (e.getTime() - t.getTime()) * r);
21
- }
22
- function qe(t, e, r) {
23
- return e;
24
- }
25
- function Ve(t) {
26
- return typeof t == "number" ? Ie : typeof t == "string" ? $e : t instanceof Date ? Fe : qe;
27
- }
28
- class Ue {
14
+ return n;
15
+ }, Le = (t, e, r) => new Date(t.getTime() + (e.getTime() - t.getTime()) * r), Ne = (t, e) => e, Oe = (t) => typeof t == "number" ? Te : typeof t == "string" ? Ce : t instanceof Date ? Le : Ne;
16
+ class ke {
17
+ /**
18
+ * Creates a new instance of `ElementPosition`.
19
+ * @param index - The index of the element.
20
+ * @param total - The total number of elements in the collection.
21
+ */
29
22
  constructor(e, r) {
30
23
  this.index = e, this.total = r;
31
24
  }
25
+ /**
26
+ * Gets the counter of the element.
27
+ */
28
+ get counter() {
29
+ return this.index + 1;
30
+ }
31
+ /**
32
+ * Checks if the element is the first element in the collection.
33
+ * @returns `true` if the element is the first element, `false` otherwise.
34
+ */
32
35
  get isFirst() {
33
36
  return this.index === 0;
34
37
  }
38
+ /**
39
+ * Checks if the element is the last element in the collection.
40
+ * @returns `true` if the element is the last element, `false` otherwise.
41
+ */
35
42
  get isLast() {
36
43
  return this.index === this.total - 1;
37
44
  }
45
+ /**
46
+ * Checks if the index of the element is even.
47
+ * @returns `true` if the index is even, `false` otherwise.
48
+ */
38
49
  get isEven() {
39
50
  return this.index % 2 === 0;
40
51
  }
52
+ /**
53
+ * Checks if the index of the element is odd.
54
+ * @returns `true` if the index is odd, `false` otherwise.
55
+ */
41
56
  get isOdd() {
42
57
  return this.index % 2 === 1;
43
58
  }
44
59
  }
45
- const K = "$__signal__", Q = "$__prop__", Y = "$__computed__";
46
- var x;
47
- x = K;
48
- const w = class w {
60
+ const p = class p {
61
+ /**
62
+ * Represents a signal with a value of type T.
63
+ *
64
+ * @param value - The initial value of the signal.
65
+ * @param equals - A function that determines whether two values of type T are equal.
66
+ * @public
67
+ */
49
68
  constructor(e, r) {
50
- l(this, x, !0);
69
+ /**
70
+ * @internal
71
+ */
72
+ l(this, "$__signal__", !0);
73
+ /**
74
+ * @internal
75
+ */
51
76
  l(this, "_value");
77
+ /**
78
+ * @internal
79
+ */
52
80
  l(this, "_derivatives", []);
81
+ /**
82
+ * @internal
83
+ */
53
84
  l(this, "_onValueListeners", []);
85
+ /**
86
+ * @internal
87
+ */
54
88
  l(this, "_onDisposeListeners", []);
89
+ /**
90
+ * Gets the current value of the signal.
91
+ * @returns The current value of the signal.
92
+ */
55
93
  l(this, "get", () => this._value);
94
+ /**
95
+ * Checks if the signal has any registered listeners.
96
+ * @returns `true` if the signal has listeners, `false` otherwise.
97
+ */
56
98
  l(this, "hasListeners", () => this._onValueListeners.length > 0);
99
+ /**
100
+ * Registers a listener function to be called whenever the value of the signal changes.
101
+ * The listener function will be immediately called with the current value of the signal.
102
+ * Returns a function that can be called to unregister the listener.
103
+ *
104
+ * @param listener - The listener function to be called when the value of the signal changes.
105
+ */
57
106
  l(this, "on", (e) => (e(this.get()), this._onValueListeners.push(e), () => {
58
107
  this._onValueListeners.splice(this._onValueListeners.indexOf(e), 1);
59
108
  }));
109
+ /**
110
+ * @internal
111
+ */
60
112
  l(this, "_setAndNotify", (e, r) => {
61
- const n = this.equals(this._value, e);
62
- n || (this._value = e), (r || !n) && this._onValueListeners.forEach((s) => s(e));
113
+ const s = this.equals(this._value, e);
114
+ s || (this._value = e), (r || !s) && this._onValueListeners.forEach((n) => n(e));
63
115
  });
116
+ /**
117
+ * @internal
118
+ */
64
119
  l(this, "_disposed", !1);
120
+ /**
121
+ * Checks whether the signal is disposed.
122
+ * @returns True if the signal is disposed, false otherwise.
123
+ */
65
124
  l(this, "isDisposed", () => this._disposed);
125
+ /**
126
+ * Adds a listener function to be called when the object is disposed.
127
+ * @param listener - The listener function to be called when the object is disposed.
128
+ * @returns A function that can be called to remove the listener.
129
+ */
66
130
  l(this, "onDispose", (e) => {
67
131
  this._onDisposeListeners.push(e);
68
132
  });
133
+ /**
134
+ * Disposes the signal, releasing any resources associated with it.
135
+ */
69
136
  l(this, "dispose", () => {
70
137
  this._disposed || (this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
71
138
  });
72
- l(this, "map", (e, r = (n, s) => n === s) => {
73
- const n = new E(() => {
139
+ /**
140
+ * Returns a new Computed instance that applies the given mapping function to the value of this Signal.
141
+ * The mapping function is called whenever the value of this Signal changes.
142
+ *
143
+ * @typeParam O - The type of the mapped value.
144
+ * @param fn - The mapping function to apply to the value of this Signal.
145
+ * @param equals - Optional equality function to determine if two mapped values are equal.
146
+ * @returns - A new Computed instance with the mapped value.
147
+ */
148
+ l(this, "map", (e, r = (s, n) => s === n) => {
149
+ const s = new E(() => {
74
150
  try {
75
151
  return e(this.get());
76
- } catch (s) {
77
- throw console.error("Error in Signal.map:", s), s;
152
+ } catch (n) {
153
+ throw console.error("Error in Signal.map:", n), n;
78
154
  }
79
155
  }, r);
80
- return this.setDerivative(n), n;
156
+ return this.setDerivative(s), s;
81
157
  });
82
- l(this, "flatMap", (e, r = (n, s) => n === s) => {
83
- const n = new E(() => {
158
+ /**
159
+ * Returns a new Signal that applies the given function to the value of the current Signal,
160
+ * and then flattens the resulting Signal.
161
+ *
162
+ * @typeParam O - The type of the value emitted by the resulting Signal.
163
+ * @param fn - The function to apply to the value of the current Signal.
164
+ * @param equals - A function that determines whether two values of type O are equal.
165
+ * Defaults to a strict equality check (===).
166
+ * @returns A new Signal that emits the values of the resulting Signal.
167
+ */
168
+ l(this, "flatMap", (e, r = (s, n) => s === n) => {
169
+ const s = new E(() => {
84
170
  try {
85
171
  return e(this.get()).get();
86
- } catch (s) {
87
- throw console.error("Error in Signal.flatMap:", s), s;
172
+ } catch (n) {
173
+ throw console.error("Error in Signal.flatMap:", n), n;
88
174
  }
89
175
  }, r);
90
- return this.setDerivative(n), n;
176
+ return this.setDerivative(s), s;
91
177
  });
178
+ /**
179
+ * Invokes a callback function with the current value of the signal, without modifying the signal.
180
+ *
181
+ * @param fn - The callback function to be invoked with the current value of the signal.
182
+ * @returns A new signal that emits the same value as the original signal and invokes the callback function.
183
+ */
92
184
  l(this, "tap", (e) => this.map((r) => (e(r), r)));
185
+ /**
186
+ * Returns a new Signal that emits the value at the specified key of the current value.
187
+ *
188
+ * @param key - The key of the value to retrieve.
189
+ * @returns A new Signal that emits the value at the specified key.
190
+ */
93
191
  l(this, "at", (e) => this.map((r) => r[e]));
192
+ /**
193
+ * Represents a collection of signals for each key in the value of the signal.
194
+ * @typeParam T - The type of the signals.
195
+ */
94
196
  l(this, "$", new Proxy(this, {
197
+ /**
198
+ * Retrieves the signal with the specified key.
199
+ * @param _ - The target object.
200
+ * @param key - The key of the signal.
201
+ * @returns The signal associated with the key.
202
+ */
95
203
  get: (e, r) => this.at(r)
96
204
  }));
97
205
  l(this, "filter", (e, r) => {
98
- let n = r ?? this.get();
99
- const s = new E(() => {
206
+ let s = r ?? this.get();
207
+ const n = new E(() => {
100
208
  try {
101
- const i = this.get();
102
- return n = e(i) ? i : n;
103
- } catch (i) {
104
- throw console.error("Error in Signal.filter:", i), i;
209
+ const o = this.get();
210
+ return s = e(o) ? o : s;
211
+ } catch (o) {
212
+ throw console.error("Error in Signal.filter:", o), o;
105
213
  }
106
214
  }, this.equals);
107
- return this.setDerivative(s), s;
215
+ return this.setDerivative(n), n;
108
216
  });
109
- l(this, "filterMap", (e, r, n = (s, i) => s === i) => {
110
- let s = r;
111
- const i = new E(() => {
217
+ /**
218
+ * Returns a new Computed object that applies the provided mapping function to the value of this Signal,
219
+ * and filters out values that are `undefined` or `null`.
220
+ *
221
+ * @typeParam O - The type of the mapped value.
222
+ * @param fn - The mapping function to apply to the value of this Signal.
223
+ * @param startValue - The initial value for the Computed object.
224
+ * @param equals - Optional equality function to determine if two values are equal.
225
+ * @returns - A new Computed object with the mapped and filtered values.
226
+ */
227
+ l(this, "filterMap", (e, r, s = (n, o) => n === o) => {
228
+ let n = r;
229
+ const o = new E(() => {
112
230
  try {
113
- const o = this.get(), a = e(o);
114
- return s = a ?? s;
115
- } catch (o) {
116
- throw console.error("Error in Signal.filterMap:", o), o;
231
+ const i = this.get(), a = e(i);
232
+ return n = a ?? n;
233
+ } catch (i) {
234
+ throw console.error("Error in Signal.filterMap:", i), i;
117
235
  }
118
- }, n);
119
- return this.setDerivative(i), i;
236
+ }, s);
237
+ return this.setDerivative(o), o;
120
238
  });
121
- l(this, "mapAsync", (e, r, n, s = (i, o) => i === o) => {
122
- const i = L(r, s);
123
- let o = 0;
124
- return i.onDispose(
125
- this.on((a) => {
126
- const u = ++o;
239
+ /**
240
+ * Maps the values emitted by the signal to a new value asynchronously using the provided function.
241
+ * If the function throws an error, it will be caught and logged.
242
+ * If a recovery function is provided, it will be called with the error and its return value will be used as the mapped value.
243
+ * If no recovery function is provided, the error will be logged as an unhandled promise rejection.
244
+ *
245
+ * @typeParam O - The type of the mapped value.
246
+ * @param fn - The function to map the values emitted by the signal. The second argument to this function allows to cancel the previously running mapping function if it has not completed by the time a new value is emitted.
247
+ * @param alt - The alternate value to use if the signal is disposed or the mapping function throws an error.
248
+ * @param recover - The recovery function to handle errors thrown by the mapping function.
249
+ * @param equals - The equality function to compare the mapped values for equality.
250
+ * @returns A property that holds the mapped value and can be observed for changes.
251
+ */
252
+ l(this, "mapAsync", (e, r, s, n = (o, i) => o === i) => {
253
+ const o = C(r, n);
254
+ let i = 0, a = new AbortController();
255
+ return o.onDispose(
256
+ this.on(async (u) => {
257
+ const f = ++i;
258
+ a.abort(), a = new AbortController();
127
259
  try {
128
- e(a).then((f) => {
129
- u === o && i.set(f);
130
- }).catch((f) => {
131
- u === o && (n != null ? i.set(n(f)) : console.error(
132
- "Unhandled promise rejection in Signal.mapAsync:",
133
- f
134
- ));
135
- });
136
- } catch (f) {
137
- throw console.error("Error in Signal.mapAsync:", f), f;
260
+ const d = await e(u, { abortSignal: a.signal });
261
+ f === i && o.set(d);
262
+ } catch (d) {
263
+ if (f === i)
264
+ if (s != null)
265
+ o.set(s(d));
266
+ else
267
+ throw d;
138
268
  }
139
269
  })
140
- ), i;
270
+ ), o;
141
271
  });
142
- l(this, "mapMaybe", (e, r) => this.map((n) => e(n) ?? r));
272
+ /**
273
+ * Maps the values of the signal using the provided function `fn`, and returns a new signal
274
+ * containing the mapped values. If the mapped value is `undefined` or `null`, it is replaced
275
+ * with the provided `alt` value.
276
+ *
277
+ * @typeParam O - The type of the mapped value.
278
+ * @param fn - The function used to map the values of the signal.
279
+ * @param alt - The alternative value to use when the mapped value is `undefined` or `null`.
280
+ * @returns A new signal containing the mapped values.
281
+ */
282
+ l(this, "mapMaybe", (e, r) => this.map((s) => e(s) ?? r));
283
+ /**
284
+ * Feeds a property into the signal and sets up disposal behavior.
285
+ * @param prop - The property to feed into the signal.
286
+ * @param autoDisposeProp - Determines whether the property should be automatically disposed when the signal is disposed.
287
+ * @returns The input property.
288
+ */
143
289
  l(this, "feedProp", (e, r = !1) => {
144
- const n = this.on(e.set);
145
- return e.onDispose(n), r ? this.onDispose(e.dispose) : this.onDispose(n), e;
290
+ const s = this.on(e.set);
291
+ return e.onDispose(s), r ? this.onDispose(e.dispose) : this.onDispose(s), e;
146
292
  });
147
- l(this, "deriveProp", (e = !0) => this.feedProp(L(this.get()), e));
293
+ /**
294
+ * Derives a new property from the current signal.
295
+ * @param autoDisposeProp - Determines whether the derived property should be automatically disposed.
296
+ * @returns The derived property.
297
+ */
298
+ l(this, "deriveProp", (e = !0) => this.feedProp(C(this.get()), e));
299
+ /**
300
+ * Returns a signal that emits the count of values received so far.
301
+ * @returns A signal that emits the count of values received so far.
302
+ */
148
303
  l(this, "count", () => {
149
304
  let e = 0;
150
305
  return this.map(() => ++e);
151
306
  });
307
+ /**
308
+ * Adds a computed value as a derivative of the signal.
309
+ * When the computed value is disposed, it is automatically removed from the derivatives list.
310
+ * Additionally, when the computed value is disposed, it sets the signal as dirty.
311
+ * @param computed - The computed value to add as a derivative.
312
+ */
152
313
  l(this, "setDerivative", (e) => {
153
314
  this._derivatives.push(e), e.onDispose(() => {
154
315
  this._derivatives.splice(
@@ -159,49 +320,115 @@ const w = class w {
159
320
  });
160
321
  this.equals = r, this._value = e;
161
322
  }
162
- static ofPromise(e, r, n, s = (i, o) => i === o) {
163
- const i = new w(r, s);
164
- return e.then((o) => i._setAndNotify(o, !1)).catch((o) => {
165
- n != null ? i._setAndNotify(n(o), !1) : console.error(
166
- "Unhandled promise rejection in Signal.ofPromise:",
167
- o
168
- );
169
- }), i;
170
- }
171
- static is(e) {
172
- return e != null && e[K] === !0;
173
- }
174
- static wrap(e, r = (n, s) => n === s) {
175
- return w.is(e) ? e : new w(e, r);
176
- }
177
- static maybeWrap(e) {
178
- return e == null ? e : w.wrap(e);
179
- }
180
- static unwrap(e) {
181
- return w.is(e) ? e.get() : e;
182
- }
183
- static map(e, r) {
184
- return w.is(e) ? e.map(r) : r(e);
185
- }
323
+ /**
324
+ * Gets the value of the signal.
325
+ * @returns The current value of the signal.
326
+ */
186
327
  get value() {
187
328
  return this._value;
188
329
  }
189
330
  };
190
- let h = w;
191
- const je = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
192
- var ee, te;
193
- class E extends (te = h, ee = Y, te) {
194
- constructor(r, n) {
195
- super(void 0, n);
196
- l(this, ee, !0);
331
+ /**
332
+ * Creates a Signal that holds the result of a Promise.
333
+ *
334
+ * @typeParam O - The type of the value returned by the Promise.
335
+ * @param promise - The Promise to use to feed the Signal.
336
+ * @param init - The initial value of the Signal before the Promise resolves.
337
+ * @param recover - A function to recover from Promise rejection and provide an alternative value for the Signal.
338
+ * @param equals - A function to compare two values of type O for equality. Defaults to strict equality (===).
339
+ * @returns - A Signal that represents the result of the Promise.
340
+ */
341
+ l(p, "ofPromise", (e, r, s, n = (o, i) => o === i) => {
342
+ const o = new p(r, n);
343
+ return e.then((i) => o._setAndNotify(i, !1)).catch((i) => {
344
+ s != null ? o._setAndNotify(s(i), !1) : console.error(
345
+ "Unhandled promise rejection in Signal.ofPromise:",
346
+ i
347
+ );
348
+ }), o;
349
+ }), /**
350
+ * Checks if a value is a Signal.
351
+ *
352
+ * @param value - The value to check.
353
+ * @returns `true` if the value is a Signal, `false` otherwise.
354
+ */
355
+ l(p, "is", (e) => (
356
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
357
+ e != null && e.$__signal__ === !0
358
+ )), /**
359
+ * Wraps a value or a Signal instance into a Signal.
360
+ * If the value is already a Signal, it returns the value itself.
361
+ * If the value is not a Signal, it creates a new Signal instance with the given value.
362
+ *
363
+ * @typeParam O - The type of the value.
364
+ * @param value - The value or Signal instance to wrap.
365
+ * @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
366
+ * @returns A Signal instance.
367
+ */
368
+ l(p, "wrap", (e, r = (s, n) => s === n) => p.is(e) ? e : new p(e, r)), /**
369
+ * Wraps a value in a `Signal` if it is not already a `Signal`.
370
+ * If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
371
+ * @param value - The value to wrap or check.
372
+ * @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
373
+ */
374
+ l(p, "maybeWrap", (e) => e == null ? e : p.wrap(e)), /**
375
+ * Unwraps a value from a `Signal` if it is a `Signal`, otherwise returns the value as is.
376
+ *
377
+ * @param value - The value to unwrap.
378
+ * @returns The unwrapped value.
379
+ */
380
+ l(p, "unwrap", (e) => p.is(e) ? e.get() : e), /**
381
+ * Maps the value of a `Signal` or a regular value using the provided mapping function.
382
+ * If the input value is a `Signal`, the mapping function is applied to its value.
383
+ * If the input value is not a `Signal`, the mapping function is directly applied to the value.
384
+ *
385
+ * @param value - The input value to be mapped.
386
+ * @param fn - The mapping function to be applied to the value.
387
+ * @returns A new `Signal` with the mapped value if the input value is a `Signal`,
388
+ * otherwise, the result of applying the mapping function to the value.
389
+ *
390
+ * @typeParam N - The type of the input value.
391
+ * @typeParam O - The type of the mapped value.
392
+ */
393
+ l(p, "map", (e, r) => p.is(e) ? e.map(r) : r(e));
394
+ let h = p;
395
+ const Re = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
396
+ class E extends h {
397
+ /**
398
+ * Represents a Signal object.
399
+ * @param _fn - The function that returns the value of the signal.
400
+ * @param equals - The function used to compare two values of type T for equality.
401
+ */
402
+ constructor(r, s) {
403
+ super(void 0, s);
404
+ /**
405
+ * @internal
406
+ */
407
+ l(this, "$__computed__", !0);
408
+ /**
409
+ * @internal
410
+ */
197
411
  l(this, "_isDirty", !1);
412
+ /**
413
+ * Marks the signal as dirty, indicating that its value has changed and needs to be recalculated.
414
+ * If the signal is already dirty or disposed, this method does nothing.
415
+ * It also marks all dependent signals as dirty and schedules a notification to update their values.
416
+ */
198
417
  l(this, "setDirty", () => {
199
- this._isDirty || this._disposed || (this._isDirty = !0, this._derivatives.forEach((r) => r.setDirty()), this.scheduleNotify());
418
+ this._isDirty || this._disposed || (this._isDirty = !0, this._derivatives.forEach((r) => r.setDirty()), this._scheduleNotify());
200
419
  });
420
+ /**
421
+ * @internal
422
+ */
201
423
  l(this, "_scheduleCount", 0);
202
- l(this, "scheduleNotify", () => {
424
+ /**
425
+ * Schedules a notification to be executed asynchronously.
426
+ * If the signal is dirty, it will be updated and notified.
427
+ * @internal
428
+ */
429
+ l(this, "_scheduleNotify", () => {
203
430
  const r = ++this._scheduleCount;
204
- je(() => {
431
+ Re(() => {
205
432
  this._scheduleCount !== r || this._disposed !== !1 || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn(), !1));
206
433
  });
207
434
  });
@@ -209,154 +436,195 @@ class E extends (te = h, ee = Y, te) {
209
436
  l(this, "get", () => (this._isDirty && (this._isDirty = !1, this._value = this._fn(), this._setAndNotify(this._value, !0)), this._value));
210
437
  this._fn = r, this.setDirty();
211
438
  }
439
+ /**
440
+ * Checks if a value is an instance of `Computed`.
441
+ *
442
+ * @param value - The value to check.
443
+ * @returns `true` if the value is an instance of `Computed`, `false` otherwise.
444
+ */
212
445
  static is(r) {
213
- return r != null && r[Y] === !0;
446
+ return r != null && r.$__computed__ === !0;
214
447
  }
215
448
  /** {@inheritDoc Signal.value} */
216
449
  get value() {
217
450
  return this.get();
218
451
  }
219
452
  }
220
- var re, ne;
221
- class F extends (ne = h, re = Q, ne) {
453
+ const V = class V extends h {
222
454
  constructor() {
223
455
  super(...arguments);
224
- l(this, re, !0);
456
+ /**
457
+ * @internal
458
+ */
459
+ l(this, "$__prop__", !0);
460
+ /**
461
+ * Changes the value of the property and notifies its listeners.
462
+ *
463
+ * @param value - The new value of the property.
464
+ */
225
465
  l(this, "set", (r) => {
226
466
  this._setAndNotify(r, !1);
227
467
  });
468
+ /**
469
+ * Updates the value of the signal by applying the provided function to the current value.
470
+ * @param fn - The function to apply to the current value.
471
+ */
228
472
  l(this, "update", (r) => {
229
473
  this._setAndNotify(r(this.get()), !1);
230
474
  });
231
- l(this, "reducer", (r, ...n) => {
232
- const s = this;
233
- return function i(o) {
234
- const a = s.value;
235
- s.update((u) => r(u, o)), !s.equals(a, s.value) && n.forEach(
475
+ /**
476
+ * Creates a reducer function that combines the provided reducer function and effects.
477
+ * @param fn - The reducer function that takes the current state and an action, and returns the new state.
478
+ * @param effects - An array of effects to be executed after the state is updated.
479
+ * @returns A dispatch function that can be used to update the state and trigger the effects.
480
+ */
481
+ l(this, "reducer", (r, ...s) => {
482
+ const n = this;
483
+ return function o(i) {
484
+ const a = n.value;
485
+ n.update((u) => r(u, i)), !n.equals(a, n.value) && s.forEach(
236
486
  (u) => u({
237
487
  previousState: a,
238
- state: s.value,
239
- action: o,
240
- dispatch: i
488
+ state: n.value,
489
+ action: i,
490
+ dispatch: o
241
491
  })
242
492
  );
243
493
  };
244
494
  });
245
- l(this, "iso", (r, n, s = (i, o) => i === o) => {
246
- const i = new F(r(this.get()), s);
247
- return i.onDispose(this.on((o) => i.set(r(o)))), i.on((o) => this._setAndNotify(n(o), !1)), i;
495
+ /**
496
+ * Creates an isomorphism for the Signal.
497
+ * An isomorphism is a pair of functions that convert values between two types,
498
+ * along with an equality function to compare values of the second type.
499
+ *
500
+ * @param to - A function that converts values from type T to type O.
501
+ * @param from - A function that converts values from type O to type T.
502
+ * @param equals - An optional function that compares values of type O for equality.
503
+ * Defaults to a strict equality check (===).
504
+ * @returns A Prop object representing the isomorphism.
505
+ */
506
+ l(this, "iso", (r, s, n = (o, i) => o === i) => {
507
+ const o = new V(r(this.get()), n);
508
+ return o.onDispose(this.on((i) => o.set(r(i)))), o.on((i) => this._setAndNotify(s(i), !1)), o;
248
509
  });
510
+ /**
511
+ * Returns a `Prop` that represents the value at the specified key of the current value.
512
+ *
513
+ * @param key - The key of the value to access.
514
+ * @returns A `Prop` that represents the value at the specified key.
515
+ */
249
516
  l(this, "atProp", (r) => this.iso(
250
- (n) => n[r],
251
- (n) => ({ ...this.value, [r]: n })
517
+ (s) => s[r],
518
+ (s) => ({ ...this.value, [r]: s })
252
519
  ));
253
520
  }
254
- static is(r) {
255
- return r != null && r[Q] === !0;
256
- }
257
- /** {@inheritDoc Signal.get} */
521
+ /**
522
+ * Access for the current value of the property.
523
+ */
258
524
  get value() {
259
525
  return this.get();
260
526
  }
261
527
  set value(r) {
262
528
  this._setAndNotify(r, !1);
263
529
  }
264
- }
265
- function H(t, e, r = (n, s) => n === s) {
266
- const n = new E(t, r);
267
- return e.forEach((s) => s.setDerivative(n)), n;
268
- }
269
- function At(t, e) {
270
- return H(t, e).dispose;
271
- }
272
- function L(t, e = (r, n) => r === n) {
273
- return new F(t, e);
274
- }
275
- function Et(t, e = (r, n) => r === n) {
276
- return new h(t, e);
277
- }
278
- class se {
530
+ };
531
+ /**
532
+ * Checks if a value is a Prop.
533
+ * @param value - The value to check.
534
+ * @returns `true` if the value is a Prop, `false` otherwise.
535
+ */
536
+ l(V, "is", (r) => (
537
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
538
+ r != null && r.$__prop__ === !0
539
+ ));
540
+ let F = V;
541
+ const j = (t, e, r = (s, n) => s === n) => {
542
+ const s = new E(t, r);
543
+ return e.forEach((n) => n.setDerivative(s)), s;
544
+ }, pt = (t, e) => j(t, e).dispose, C = (t, e = (r, s) => r === s) => new F(t, e), mt = (t, e = (r, s) => r === s) => new h(t, e);
545
+ class z {
279
546
  constructor() {
280
547
  l(this, "_store", /* @__PURE__ */ new Map());
548
+ /**
549
+ * Retrieves the value associated with the specified key from the memory store.
550
+ * @param key - The key to retrieve the value for.
551
+ * @returns The value associated with the key, or `null` if the key is not found.
552
+ */
281
553
  l(this, "getItem", (e) => this._store.get(e) ?? null);
554
+ /**
555
+ * Sets the value associated with the specified key in the memory store.
556
+ * @param key - The key to set the value for.
557
+ * @param value - The value to set.
558
+ */
282
559
  l(this, "setItem", (e, r) => {
283
560
  this._store.set(e, r);
284
561
  });
285
562
  }
286
563
  }
287
- function ie({
564
+ const Q = ({
288
565
  key: t,
289
566
  defaultValue: e,
290
567
  store: r,
291
- serialize: n = JSON.stringify,
292
- deserialize: s = JSON.parse,
293
- equals: i = (a, u) => a === u,
294
- onLoad: o = (a) => a
295
- }) {
568
+ serialize: s = JSON.stringify,
569
+ deserialize: n = JSON.parse,
570
+ equals: o = (a, u) => a === u,
571
+ onLoad: i = (a) => a
572
+ }) => {
296
573
  const a = r.getItem(t), u = new F(
297
- a != null ? o(s(a)) : typeof e == "function" ? e() : e,
298
- i
574
+ a != null ? i(n(a)) : typeof e == "function" ? e() : e,
575
+ o
299
576
  );
300
577
  return u.on((f) => {
301
- r.setItem(t, n(f));
578
+ r.setItem(t, s(f));
302
579
  }), u;
303
- }
304
- function bt(t) {
305
- return ie({
306
- ...t,
307
- store: (window == null ? void 0 : window.localStorage) ?? new se()
308
- });
309
- }
310
- function Pt(t) {
311
- return ie({
312
- ...t,
313
- store: (window == null ? void 0 : window.sessionStorage) ?? new se()
314
- });
315
- }
316
- function Z(t) {
580
+ }, gt = (t) => Q({
581
+ ...t,
582
+ store: (window == null ? void 0 : window.localStorage) ?? new z()
583
+ }), _t = (t) => Q({
584
+ ...t,
585
+ store: (window == null ? void 0 : window.sessionStorage) ?? new z()
586
+ });
587
+ function X(t) {
317
588
  return typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
318
589
  }
319
- function Ge(t, e, r, n) {
320
- const s = (n == null ? void 0 : n.duration) ?? 300, i = (n == null ? void 0 : n.easing) ?? ((g) => g), o = (n == null ? void 0 : n.equals) ?? ((g, M) => g === M);
321
- let a = n == null ? void 0 : n.interpolate, u = t, f = e(), m = performance.now(), _ = null, d = !0;
322
- const P = new E(e, o), A = L(t, o);
323
- A.onDispose(() => {
324
- _ !== null && cancelAnimationFrame(_);
325
- }), A.onDispose(P.dispose), r.forEach((g) => {
326
- g.setDerivative(P), g.onDispose(A.dispose);
590
+ const Me = (t, e, r, s) => {
591
+ const n = (s == null ? void 0 : s.duration) ?? 300, o = (s == null ? void 0 : s.easing) ?? ((_) => _), i = (s == null ? void 0 : s.equals) ?? ((_, k) => _ === k);
592
+ let a = s == null ? void 0 : s.interpolate, u = t, f = e(), d = performance.now(), A = null, m = !0;
593
+ const D = new E(e, i), S = C(t, i);
594
+ S.onDispose(() => {
595
+ A !== null && cancelAnimationFrame(A);
596
+ }), S.onDispose(D.dispose), r.forEach((_) => {
597
+ _.setDerivative(D), _.onDispose(S.dispose);
327
598
  });
328
- const Ce = (g) => {
329
- f = g, m = performance.now(), u = A.value, d && (d = !1, _ = Z(B));
330
- }, B = () => {
331
- const M = (performance.now() - m) / h.unwrap(s), Re = i(M);
332
- a == null && (a = Ve(u));
333
- let X = a(u, f, Re);
334
- M >= 1 ? (d = !0, X = f) : _ = Z(B), A.set(X);
599
+ const Ee = (_) => {
600
+ f = _, d = performance.now(), u = S.value, m && (m = !1, A = X(J));
601
+ }, J = () => {
602
+ const k = (performance.now() - d) / h.unwrap(n), Pe = o(k);
603
+ a == null && (a = Oe(u));
604
+ let K = a(u, f, Pe);
605
+ k >= 1 ? (m = !0, K = f) : A = X(J), S.set(K);
335
606
  };
336
- return P.on(Ce), A;
337
- }
338
- function Dt(t, e) {
339
- const { initialValue: r, ...n } = e ?? {};
340
- return Ge(
607
+ return D.on(Ee), S;
608
+ }, vt = (t, e) => {
609
+ const { initialValue: r, ...s } = e ?? {};
610
+ return Me(
341
611
  r ?? t.get(),
342
612
  t.get,
343
613
  [t],
344
- n
614
+ s
345
615
  );
346
- }
347
- function Tt(t, e) {
348
- const { signals: r, literals: n } = Object.entries(t).reduce(
349
- ({ signals: i, literals: o }, [a, u]) => (h.is(u) ? i.push([a, u]) : o[a] = u, { signals: i, literals: o }),
616
+ }, yt = (t, e) => {
617
+ const { signals: r, literals: s } = Object.entries(t).reduce(
618
+ ({ signals: o, literals: i }, [a, u]) => (h.is(u) ? o.push([a, u]) : i[a] = u, { signals: o, literals: i }),
350
619
  { signals: [], literals: {} }
351
- ), s = r.map(([, i]) => i);
352
- return H(() => (r.forEach(([i, o]) => n[i] = o.value), e(n)), s);
353
- }
354
- const oe = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), ue = /* @__PURE__ */ new Set([
620
+ ), n = r.map(([, o]) => o);
621
+ return j(() => (r.forEach(([o, i]) => s[o] = i.value), e(s)), n);
622
+ }, Y = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), Z = /* @__PURE__ */ new Set([
355
623
  "rowSpan",
356
624
  "colSpan",
357
625
  "tabIndex",
358
626
  "valueAsNumber"
359
- ]), le = /* @__PURE__ */ new Set(["valueAsDate"]), ae = /* @__PURE__ */ new Set([
627
+ ]), x = /* @__PURE__ */ new Set(["valueAsDate"]), ee = /* @__PURE__ */ new Set([
360
628
  "value",
361
629
  "textContent",
362
630
  "innerText",
@@ -364,46 +632,24 @@ const oe = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]
364
632
  "outerHTML",
365
633
  "className",
366
634
  "classList"
367
- ]), U = /* @__PURE__ */ new Map();
368
- function D(t, e) {
369
- if (U.has(t))
370
- return U.get(t);
635
+ ]), q = /* @__PURE__ */ new Map(), b = (t, e) => {
636
+ if (q.has(t))
637
+ return q.get(t);
371
638
  {
372
639
  const r = e(t);
373
- return U.set(t, r), r;
640
+ return q.set(t, r), r;
374
641
  }
375
- }
376
- function He(t) {
377
- return (e, r) => {
378
- r == null ? e[t] = null : e[t] = !!r;
379
- };
380
- }
381
- function Je(t) {
382
- return (e, r) => {
383
- r == null ? e[t] = null : e[t] = Number(r);
384
- };
385
- }
386
- function We(t) {
387
- return (e, r) => {
388
- r == null ? e[t] = null : e[t] = r;
389
- };
390
- }
391
- function Be(t) {
392
- return (e, r) => {
393
- r == null ? e[t] = null : e[t] = String(r);
394
- };
395
- }
396
- function Xe(t) {
397
- return (e, r) => {
398
- r == null ? e.removeAttribute(t) : e.setAttribute(t, r);
399
- };
400
- }
401
- function ce(t) {
402
- return oe.has(t) ? D(t, He) : ue.has(t) ? D(t, Je) : le.has(t) ? D(t, We) : ae.has(t) ? D(t, Be) : D(t, Xe);
403
- }
404
- function fe(t) {
405
- return (e) => oe.has(t) ? !!e[t] : ue.has(t) ? Number(e[t]) : le.has(t) ? e[t] : ae.has(t) ? String(e[t]) : e.getAttribute(t);
406
- }
642
+ }, Fe = (t) => (e, r) => {
643
+ r == null ? e[t] = null : e[t] = !!r;
644
+ }, Ve = (t) => (e, r) => {
645
+ r == null ? e[t] = null : e[t] = Number(r);
646
+ }, $e = (t) => (e, r) => {
647
+ r == null ? e[t] = null : e[t] = r;
648
+ }, qe = (t) => (e, r) => {
649
+ r == null ? e[t] = null : e[t] = String(r);
650
+ }, Ie = (t) => (e, r) => {
651
+ r == null ? e.removeAttribute(t) : e.setAttribute(t, r);
652
+ }, te = (t) => Y.has(t) ? b(t, Fe) : Z.has(t) ? b(t, Ve) : x.has(t) ? b(t, $e) : ee.has(t) ? b(t, qe) : b(t, Ie), re = (t) => (e) => Y.has(t) ? !!e[t] : Z.has(t) ? Number(e[t]) : x.has(t) ? e[t] : ee.has(t) ? String(e[t]) : e.getAttribute(t);
407
653
  class v {
408
654
  /**
409
655
  * Constructs a new `DOMContext` instance.
@@ -414,7 +660,7 @@ class v {
414
660
  * @param providers - The `Providers` instance associated with this context.
415
661
  * @param isFirstLevel - A boolean value indicating whether this context is at the first level, meaning the outermost node in the generated DOM.
416
662
  */
417
- constructor(e, r, n, s, i) {
663
+ constructor(e, r, s, n, o) {
418
664
  /**
419
665
  * Creates a new DOM element (eg: HTML or SVG) with the specified tag name and namespace.
420
666
  *
@@ -521,14 +767,14 @@ class v {
521
767
  *
522
768
  * @param mark - The provider mark to retrieve the provider for.
523
769
  * @returns The provider for the given mark.
524
- * @throws Error If the provider for the given mark is not found.
770
+ * @throws Throws `ProviderNotFoundError` if the provider for the given mark is not found.
525
771
  */
526
772
  l(this, "getProvider", (e) => {
527
773
  if (this.providers[e] === void 0)
528
- throw new Error(`Provider not found: ${e.description}`);
774
+ throw new Be(e);
529
775
  return this.providers[e];
530
776
  });
531
- this.document = e, this.element = r, this.reference = n, this.providers = s, this.isFirstLevel = i;
777
+ this.document = e, this.element = r, this.reference = s, this.providers = n, this.isFirstLevel = o;
532
778
  }
533
779
  /**
534
780
  * Creates a new `DOMContext` instance for the given `Element` and optional reference `Node`.
@@ -541,316 +787,335 @@ class v {
541
787
  return new v(e.ownerDocument, e, r, {}, !0);
542
788
  }
543
789
  }
544
- function p(t) {
790
+ class Be extends Error {
791
+ constructor(e) {
792
+ super(`Provider not found: ${e.description}`);
793
+ }
794
+ }
795
+ const g = (t) => {
545
796
  const e = t;
546
797
  e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentElement && t.parentElement.removeChild(t);
547
- }
548
- function ze(t) {
549
- return he(t) ? t : t.parentElement;
550
- }
551
- function he(t) {
552
- return t.nodeType === 1;
553
- }
554
- function Ke(t, e, r) {
555
- let n = t.target;
556
- for (; n != null && !(n instanceof HTMLAnchorElement); )
557
- n = n.parentElement;
558
- if (n == null) return !0;
559
- const s = n;
560
- if (t.button !== 0 || t.ctrlKey || t.metaKey || s.target !== "_self" && s.target !== "" || s.getAttribute("download") != null)
798
+ }, je = (t) => se(t) ? t : t.parentElement, se = (t) => t.nodeType === 1;
799
+ function Ue(t, e, r) {
800
+ let s = t.target;
801
+ for (; s != null && !(s instanceof HTMLAnchorElement); )
802
+ s = s.parentElement;
803
+ if (s == null) return !0;
804
+ const n = s;
805
+ if (t.button !== 0 || t.ctrlKey || t.metaKey || n.target !== "_self" && n.target !== "" || n.getAttribute("download") != null)
561
806
  return !0;
562
807
  if (r) {
563
- const { pathname: i, search: o, hash: a } = s, u = i + o + a;
564
- if (s.getAttribute("href") !== u || e && !/\/[^/.]*$/.test(i))
808
+ const { pathname: o, search: i, hash: a } = n, u = o + i + a;
809
+ if (n.getAttribute("href") !== u || e === !0 && !/\/[^/.]*$/.test(o) || Array.isArray(e) && !e.some((f) => o.endsWith(f)))
565
810
  return !0;
566
811
  }
567
812
  return !1;
568
813
  }
569
- const Lt = (t, e = {
570
- checkExtension: !0,
571
- checkExternalUrl: !0
572
- }) => (r) => {
573
- const { checkExtension: n, checkExternalUrl: s } = e;
574
- Ke(
575
- r,
576
- n === !0,
577
- s === !0
578
- ) || t() && r.preventDefault();
579
- }, de = (t) => (e) => {
580
- _e(e);
814
+ const wt = (t, {
815
+ checkExtension: e = [".html"],
816
+ checkExternalUrl: r = !0
817
+ } = {}) => (s) => {
818
+ Ue(s, e, r) || t() && s.preventDefault();
819
+ }, ne = (t) => (e) => {
820
+ he(e);
581
821
  const r = e.createText(t);
582
- return e.appendOrInsert(r), (n) => {
583
- n && p(r);
822
+ return e.appendOrInsert(r), (s) => {
823
+ s && g(r);
584
824
  };
585
- }, pe = (t) => (e) => {
586
- _e(e);
825
+ }, oe = (t) => (e) => {
826
+ he(e);
587
827
  const r = e.createText(t.value);
588
828
  e.appendOrInsert(r);
589
- const n = t.on((s) => r.data = s);
590
- return (s) => {
591
- n(), s && p(r);
592
- };
593
- };
594
- function kt(t) {
595
- return h.is(t) ? pe(t) : de(t);
596
- }
597
- const y = (...t) => (e) => {
598
- const r = t.map((n) => c(n)(e));
829
+ const s = t.on((n) => r.data = n);
599
830
  return (n) => {
600
- r.forEach((s) => s(n));
831
+ s(), n && g(r);
832
+ };
833
+ }, At = (t) => h.is(t) ? oe(t) : ne(t), y = (...t) => (e) => {
834
+ const r = t.map((s) => c(s)(e));
835
+ return (s) => {
836
+ r.forEach((n) => n(s));
601
837
  };
602
- }, S = () => () => {
603
- }, Qe = (t) => (e) => (Se(e), e.element.classList.add(...t), (r) => {
838
+ }, w = () => () => {
839
+ }, We = (t) => (e) => (ce(e), e.element.classList.add(...t), (r) => {
604
840
  r && e.element.classList.remove(...t);
605
- }), Ye = (t) => (e) => {
606
- Se(e);
841
+ }), Ge = (t) => (e) => {
842
+ ce(e);
607
843
  const r = e.element;
608
- let n = [];
609
- const s = t.on((i) => {
610
- n.forEach((o) => r.classList.remove(o)), n = (i ?? "").split(" ").filter((o) => o.length > 0), r.classList.add(...n);
844
+ let s = [];
845
+ const n = t.on((o) => {
846
+ s.forEach((i) => r.classList.remove(i)), s = (o ?? "").split(" ").filter((i) => i.length > 0), r.classList.add(...s);
611
847
  });
612
- return (i) => {
613
- s(), i && n.forEach((o) => r.classList.remove(o)), n.length = 0;
848
+ return (o) => {
849
+ n(), o && s.forEach((i) => r.classList.remove(i)), s.length = 0;
614
850
  };
615
- }, N = (t, e) => {
616
- const r = ce(t), n = fe(t);
617
- return (s) => {
618
- ye(s, t);
619
- const i = n(s.element);
620
- return r(s.element, e), (o) => {
621
- o && r(s.element, i);
851
+ }, L = (t, e) => {
852
+ const r = te(t), s = re(t);
853
+ return (n) => {
854
+ ae(n, t);
855
+ const o = s(n.element);
856
+ return r(n.element, e), (i) => {
857
+ i && r(n.element, o);
622
858
  };
623
859
  };
624
- }, C = (t, e) => {
625
- const r = ce(t), n = fe(t);
626
- return (s) => {
627
- ye(s, t);
628
- const i = n(s.element);
629
- return e.on((o) => r(s.element, o)), (o) => {
630
- o && r(s.element, i);
860
+ }, N = (t, e) => {
861
+ const r = te(t), s = re(t);
862
+ return (n) => {
863
+ ae(n, t);
864
+ const o = s(n.element), i = e.on((a) => r(n.element, a));
865
+ return (a) => {
866
+ i(), a && r(n.element, o);
631
867
  };
632
868
  };
633
- }, b = new Proxy(
869
+ }, P = new Proxy(
634
870
  {},
635
871
  {
636
- get: (t, e) => e === "class" ? (r) => h.is(r) ? Ye(r) : Qe(
637
- (r ?? "").split(" ").filter((n) => n.length > 0)
638
- ) : (r) => h.is(r) ? C(
872
+ /**
873
+ * Creates a renderable component for the specified attribute.
874
+ *
875
+ * Generally using multiple attributes with the same name is not recommended.
876
+ * `class` is the exception and can be used multiple times.
877
+ *
878
+ * @param _ - The target object.
879
+ * @param name - The name of the attribute.
880
+ * @returns The renderable component for the specified attribute.
881
+ *
882
+ */
883
+ get: (t, e) => e === "class" ? (r) => h.is(r) ? Ge(r) : We(
884
+ (r ?? "").split(" ").filter((s) => s.length > 0)
885
+ ) : (r) => h.is(r) ? N(
639
886
  e,
640
887
  r
641
- ) : N(
888
+ ) : L(
642
889
  e,
643
890
  r
644
891
  )
645
892
  }
646
- ), Nt = new Proxy(
893
+ ), St = new Proxy(
647
894
  {},
648
895
  {
649
- get: (t, e) => (r) => h.is(r) ? C(
896
+ /**
897
+ * Creates a renderable component for the specified `data-?` attribute.
898
+ *
899
+ * @param _ - The target object.
900
+ * @param name - The name of the data attribute.
901
+ * @returns The renderable component for the specified attribute.
902
+ *
903
+ */
904
+ get: (t, e) => (r) => h.is(r) ? N(
650
905
  `data-${e}`,
651
906
  r
652
- ) : N(`data-${e}`, r)
907
+ ) : L(`data-${e}`, r)
653
908
  }
654
- ), Ct = new Proxy(
909
+ ), Et = new Proxy(
655
910
  {},
656
911
  {
657
- get: (t, e) => (r) => h.is(r) ? C(
912
+ /**
913
+ * Creates a renderable component for the specified `aria-?` attribute.
914
+ *
915
+ * @param _ - The target object.
916
+ * @param name - The name of the aria attribute.
917
+ * @returns The renderable component for the specified attribute.
918
+ *
919
+ */
920
+ get: (t, e) => (r) => h.is(r) ? N(
658
921
  `aria-${e}`,
659
922
  r
660
- ) : N(
923
+ ) : L(
661
924
  `aria-${e}`,
662
925
  r
663
926
  )
664
927
  }
665
- ), Rt = new Proxy(
928
+ ), Pt = new Proxy(
666
929
  {},
667
930
  {
668
- get: (t, e) => (r) => h.is(r) ? C(
931
+ /**
932
+ * Creates a renderable component for the specified `svg` attribute.
933
+ *
934
+ * @param _ - The target object.
935
+ * @param name - The name of the SVG attribute.
936
+ * @returns The renderable component for the specified attribute.
937
+ *
938
+ */
939
+ get: (t, e) => (r) => h.is(r) ? N(
669
940
  e,
670
941
  r
671
- ) : N(
942
+ ) : L(
672
943
  e,
673
944
  r
674
945
  )
675
946
  }
676
- ), Mt = new Proxy(
947
+ ), Dt = new Proxy(
677
948
  {},
678
949
  {
679
- get: (t, e) => (r) => h.is(r) ? C(
950
+ /**
951
+ * Creates a renderable component for the specified `math` attribute.
952
+ *
953
+ * @param name - The name of the Math attribute.
954
+ * @returns The renderable component for the specified attribute.
955
+ *
956
+ */
957
+ get: (t, e) => (r) => h.is(r) ? N(
680
958
  e,
681
959
  r
682
- ) : N(
960
+ ) : L(
683
961
  e,
684
962
  r
685
963
  )
686
964
  }
687
- );
688
- function c(t) {
689
- return t == null ? S : Array.isArray(t) ? y(...t.map(c)) : typeof t == "string" ? de(t) : h.is(t) ? pe(t) : t;
690
- }
691
- function me(t, ...e) {
692
- return (r) => {
693
- const n = r.createElement(t, void 0);
694
- r.isFirstLevel && R.isSSR() && we(n), r.appendOrInsert(n), r = r.withElement(n);
695
- const s = e.map((i) => c(i)(r));
696
- return (i) => {
697
- s.forEach((o) => o(!1)), i && p(n);
698
- };
965
+ ), c = (t) => t == null ? w : Array.isArray(t) ? y(...t.map(c)) : typeof t == "string" ? ne(t) : h.is(t) ? oe(t) : t, ie = (t, ...e) => (r) => {
966
+ const s = r.createElement(t, void 0);
967
+ r.isFirstLevel && O() && fe(s), r.appendOrInsert(s), r = r.withElement(s);
968
+ const n = e.map((o) => c(o)(r));
969
+ return (o) => {
970
+ n.forEach((i) => i(!1)), o && g(s);
699
971
  };
700
- }
701
- function ge(t, e, ...r) {
702
- return (n) => {
703
- const s = n.createElement(t, e);
704
- n.isFirstLevel && R.isSSR() && we(s), n.appendOrInsert(s), n = n.withElement(s);
705
- const i = r.map((o) => c(o)(n));
706
- return (o) => {
707
- i.forEach((a) => a(!1)), o && p(s);
708
- };
972
+ }, le = (t, e, ...r) => (s) => {
973
+ const n = s.createElement(t, e);
974
+ s.isFirstLevel && O() && fe(n), s.appendOrInsert(n), s = s.withElement(n);
975
+ const o = r.map((i) => c(i)(s));
976
+ return (i) => {
977
+ o.forEach((a) => a(!1)), i && g(n);
709
978
  };
710
- }
711
- const Ot = new Proxy(
979
+ }, bt = new Proxy(
712
980
  {},
713
981
  {
714
- get: (t, e) => (...r) => me(e, r.flatMap(c))
982
+ /**
983
+ * Creates a renderable that represents an HTML element.
984
+ * @param tagName - The HTML tag name.
985
+ * @returns A renderable function that creates and appends the HTML element to the DOM.
986
+ */
987
+ get: (t, e) => (...r) => ie(e, r.flatMap(c))
715
988
  }
716
- ), It = new Proxy(
989
+ ), Tt = new Proxy(
717
990
  {},
718
991
  {
719
- get: (t, e) => (...r) => me("input", b.type(e), ...r)
992
+ /**
993
+ * Creates a renderable that represents an HTMLInput element.
994
+ * @param type - The input type name.
995
+ * @returns A renderable function that creates and appends the HTMLInput element to the DOM.
996
+ */
997
+ get: (t, e) => (...r) => ie("input", P.type(e), ...r)
720
998
  }
721
- ), Ze = "http://www.w3.org/2000/svg", $t = new Proxy(
999
+ ), He = "http://www.w3.org/2000/svg", Ct = new Proxy(
722
1000
  {},
723
1001
  {
724
- get: (t, e) => (...r) => ge(e, Ze, r.flatMap(c))
1002
+ /**
1003
+ * Creates a renderable that represents an SVG element.
1004
+ * @param tagName - The SVG tag name.
1005
+ * @returns A renderable function that creates and appends the SVG element to the DOM.
1006
+ */
1007
+ get: (t, e) => (...r) => le(e, He, r.flatMap(c))
725
1008
  }
726
- ), xe = "http://www.w3.org/1998/Math/MathML", Ft = new Proxy(
1009
+ ), Je = "http://www.w3.org/1998/Math/MathML", Lt = new Proxy(
727
1010
  {},
728
1011
  {
729
- get: (t, e) => (...r) => ge(e, xe, r.flatMap(c))
1012
+ /**
1013
+ * Creates a renderable that represents an Math element.
1014
+ * @param tagName - The Math tag name.
1015
+ * @returns A renderable function that creates and appends the Math element to the DOM.
1016
+ */
1017
+ get: (t, e) => (...r) => le(e, Je, r.flatMap(c))
730
1018
  }
731
- ), T = "data-tempo-attr", I = "data-tempo-class", ve = "data-tempo-node", $ = "data-tempo-text";
732
- function et(t, e) {
1019
+ ), T = "data-tempo-attr", R = "data-tempo-class", ue = "data-tempo-node", M = "data-tempo-text", Ke = (t, e) => {
733
1020
  const r = t.getAttribute(e);
734
1021
  if (r != null) {
735
- const n = t.getAttribute(T) ?? "{}", s = { ...JSON.parse(n), name: r };
736
- t.setAttribute(T, JSON.stringify(s));
1022
+ const s = t.getAttribute(T) ?? "{}", n = { ...JSON.parse(s), name: r };
1023
+ t.setAttribute(
1024
+ T,
1025
+ JSON.stringify(n).replace(/"/g, "&quot;")
1026
+ );
737
1027
  }
738
- }
739
- function ye(t, e) {
740
- R.isSSR() && t.isFirstLevel && et(t.element, e);
741
- }
742
- function tt(t) {
1028
+ }, ae = (t, e) => {
1029
+ O() && t.isFirstLevel && Ke(t.element, e);
1030
+ }, Xe = (t) => {
743
1031
  t.querySelectorAll(`[${T}]`).forEach((e) => {
744
- const r = JSON.parse(e.getAttribute(T) ?? "{}");
745
- for (const [n, s] of Object.entries(r))
746
- e.setAttribute(n, s);
1032
+ const r = JSON.parse(
1033
+ (e.getAttribute(T) ?? "{}").replace(/&quot;/g, '"')
1034
+ );
1035
+ for (const [s, n] of Object.entries(r))
1036
+ e.setAttribute(s, n);
747
1037
  e.removeAttribute(T);
748
1038
  });
749
- }
750
- function rt(t) {
751
- t.setAttribute(I, t.className);
752
- }
753
- function Se(t) {
754
- R.isSSR() && t.isFirstLevel && rt(t.element);
755
- }
756
- function nt(t) {
757
- t.querySelectorAll(`[${I}]`).forEach((e) => {
758
- const r = e.getAttribute(I);
759
- r !== null && (e.className = r, e.removeAttribute(I));
1039
+ };
1040
+ function ze(t) {
1041
+ t.setAttribute(R, t.className);
1042
+ }
1043
+ const ce = (t) => {
1044
+ O() && t.isFirstLevel && ze(t.element);
1045
+ }, Qe = (t) => {
1046
+ t.querySelectorAll(`[${R}]`).forEach((e) => {
1047
+ const r = e.getAttribute(R);
1048
+ r !== null && (e.className = r, e.removeAttribute(R));
760
1049
  });
761
- }
762
- function we(t) {
763
- t.setAttribute(ve, "");
764
- }
765
- function st(t) {
766
- t.querySelectorAll(`[${ve}]`).forEach((e) => {
767
- p(e);
1050
+ }, fe = (t) => {
1051
+ t.setAttribute(ue, "");
1052
+ }, Ye = (t) => {
1053
+ t.querySelectorAll(`[${ue}]`).forEach((e) => {
1054
+ g(e);
768
1055
  });
769
- }
770
- function it(t) {
771
- t.setAttribute($, t.textContent ?? "");
772
- }
773
- function _e(t) {
774
- R.isSSR() && t.isFirstLevel && it(t.element);
775
- }
776
- function ot(t) {
777
- t.querySelectorAll(`[${$}]`).forEach((e) => {
778
- e.textContent = e.getAttribute($), e.removeAttribute($);
1056
+ }, Ze = (t) => {
1057
+ t.setAttribute(M, t.textContent ?? "");
1058
+ }, he = (t) => {
1059
+ O() && t.isFirstLevel && Ze(t.element);
1060
+ }, xe = (t) => {
1061
+ t.querySelectorAll(`[${M}]`).forEach((e) => {
1062
+ e.textContent = e.getAttribute(M), e.removeAttribute(M);
779
1063
  });
780
- }
781
- function ut(t) {
782
- st(t), nt(t), tt(t), ot(t);
783
- }
784
- function Ae() {
1064
+ }, et = (t) => {
1065
+ Ye(t), Qe(t), Xe(t), xe(t);
1066
+ }, de = () => {
785
1067
  const t = globalThis;
786
1068
  return t.__tempoSSR__ == null && (t.__tempoSSR__ = {
787
1069
  isSSR: !1,
788
1070
  counter: 0
789
1071
  }), t.__tempoSSR__;
790
- }
791
- function J(t, e) {
792
- const r = Ae();
1072
+ }, U = (t, e) => {
1073
+ const r = de();
793
1074
  r[t] = e;
794
- }
795
- function Ee(t) {
796
- return Ae()[t];
797
- }
798
- function lt() {
799
- return Ee("isSSR");
800
- }
801
- function j(t) {
802
- J("isSSR", t);
803
- }
804
- function W() {
805
- return Ee("counter");
806
- }
807
- function at() {
808
- J("counter", (W() ?? 0) + 1);
809
- }
810
- function ct() {
811
- J("counter", (W() ?? 0) - 1);
812
- }
813
- const qt = (t = 30) => (j(!0), new Promise((e, r) => {
814
- let n;
815
- const s = setInterval(() => {
816
- W() <= 0 && (clearInterval(s), clearTimeout(n), j(!1), e());
1075
+ }, pe = (t) => de()[t], I = (t) => {
1076
+ U("isSSR", t);
1077
+ }, W = () => pe("counter"), tt = () => {
1078
+ U("counter", (W() ?? 0) + 1);
1079
+ }, rt = () => {
1080
+ U("counter", (W() ?? 0) - 1);
1081
+ }, Nt = (t = 30) => (I(!0), new Promise((e, r) => {
1082
+ let s;
1083
+ const n = setInterval(() => {
1084
+ W() <= 0 && (clearInterval(n), clearTimeout(s), I(!1), e());
817
1085
  }, 30);
818
- n = setTimeout(() => {
819
- clearInterval(s), j(!1), r(new Error("SSR Timeout"));
1086
+ s = setTimeout(() => {
1087
+ clearInterval(n), I(!1), r(new Error("SSR Timeout"));
820
1088
  }, t * 1e3);
821
- })), R = {
822
- useDone: (t) => (at(), c(t(ct))),
823
- isSSR: lt
824
- }, be = (t, e) => {
1089
+ })), Ot = (t) => (tt(), c(t(rt))), O = () => pe("isSSR"), me = (t, e) => {
825
1090
  if (typeof e == "function")
826
- return be(t, { then: e });
827
- const r = e.pending != null ? c(e.pending) : S, n = e.then, s = e.error != null ? (i) => c(e.error(i)) : () => S;
828
- return (i) => {
829
- let o = !0;
1091
+ return me(t, { then: e });
1092
+ const r = e.pending != null ? c(e.pending) : w, s = e.then, n = e.error != null ? (o) => c(e.error(o)) : () => w;
1093
+ return (o) => {
1094
+ let i = !0;
830
1095
  const a = t();
831
- i = i.makeRef();
832
- let u = c(r)(i);
1096
+ o = o.makeRef();
1097
+ let u = c(r)(o);
833
1098
  return a.then(
834
1099
  (f) => {
835
- o && (u(!0), u = c(n(f))(i));
1100
+ i && (u(!0), u = c(s(f))(o));
836
1101
  },
837
1102
  (f) => {
838
- o && (u(!0), u = c(s(f))(i));
1103
+ i && (u(!0), u = c(n(f))(o));
839
1104
  }
840
1105
  ), (f) => {
841
- o = !1, u(f), f && i.reference && p(i.reference);
1106
+ i = !1, u(f), f && o.reference && g(o.reference);
842
1107
  };
843
1108
  };
844
- }, Vt = (t, e) => be(() => t, e), Pe = (t, e) => (r) => (r.element.addEventListener(t, e), (n) => {
845
- n && r.element.removeEventListener(t, e);
846
- }), ft = (t) => Pe("click", (e) => {
1109
+ }, kt = (t, e) => me(() => t, e), ge = (t, e) => (r) => (r.element.addEventListener(t, e), (s) => {
1110
+ s && r.element.removeEventListener(t, e);
1111
+ }), st = (t) => ge("click", (e) => {
847
1112
  e.preventDefault();
848
1113
  const r = e.target;
849
1114
  setTimeout(() => {
850
- const n = r.ownerDocument != null ? r == null ? void 0 : r.checked : void 0;
851
- n != null && t(!n);
1115
+ const s = r.ownerDocument != null ? r == null ? void 0 : r.checked : void 0;
1116
+ s != null && t(!s);
852
1117
  }, 0);
853
- }), q = new Proxy(
1118
+ }), $ = new Proxy(
854
1119
  {},
855
1120
  {
856
1121
  /**
@@ -858,369 +1123,349 @@ const qt = (t = 30) => (j(!0), new Promise((e, r) => {
858
1123
  * @param fn - The function to call when the event is triggered.
859
1124
  * @returns A `Renderable` function that adds the event listener to the element.
860
1125
  */
861
- get: (t, e) => (r) => Pe(e, r)
862
- }
863
- ), V = {
864
- value: (t) => (e) => {
865
- const r = e.target;
866
- t(r.value);
867
- },
868
- valueAsNumber: (t) => (e) => {
869
- const r = e.target;
870
- t(r.valueAsNumber);
871
- },
872
- valueAsDate: (t) => (e) => {
873
- const r = e.target;
874
- if (r.value === "")
875
- return;
876
- const n = r.value.split("-"), s = new Date(
877
- Number(n[0]),
878
- Number(n[1]) - 1,
879
- Number(n[2].substring(0, 2))
880
- );
881
- t(s);
882
- },
883
- valueAsDateTime: (t) => (e) => {
884
- const r = e.target;
885
- if (r.value === "")
886
- return;
887
- const n = r.value.split("T"), s = n[0].split("-"), i = new Date(
888
- Number(s[0]),
889
- Number(s[1]) - 1,
890
- Number(s[2])
891
- ), o = n[1].split(":");
892
- i.setHours(Number(o[0])), i.setMinutes(Number(o[1])), i.setSeconds(Number(o[2])), t(i);
893
- },
894
- checked: (t) => (e) => {
895
- const r = e.target;
896
- t(r.checked);
897
- },
898
- preventDefault: (t) => (e) => {
899
- e.preventDefault(), t();
900
- },
901
- stopPropagation: (t) => (e) => {
902
- e.stopPropagation(), t();
903
- },
904
- stopImmediatePropagation: (t) => (e) => {
905
- e.stopImmediatePropagation(), t();
1126
+ get: (t, e) => (r) => ge(e, r)
906
1127
  }
907
- };
908
- function ht(t, e = "input") {
909
- return y(
910
- b.valueAsDate(t),
911
- q[e](V.valueAsDate(t.set))
912
- );
913
- }
914
- function dt(t, e = "input") {
915
- return y(
916
- b.valueAsDate(t),
917
- q[e](V.valueAsDateTime(t.set))
918
- );
919
- }
920
- function pt(t, e = "input") {
921
- return y(
922
- b.valueAsNumber(t),
923
- q[e](V.valueAsNumber(t.set))
1128
+ ), nt = (t) => (e) => {
1129
+ const r = e.target;
1130
+ t(r.value);
1131
+ }, ot = (t) => (e) => {
1132
+ const r = e.target;
1133
+ t(r.valueAsNumber);
1134
+ }, it = (t) => (e) => {
1135
+ const r = e.target;
1136
+ if (r.value === "")
1137
+ return;
1138
+ const s = r.value.split("-"), n = new Date(
1139
+ Number(s[0]),
1140
+ Number(s[1]) - 1,
1141
+ Number(s[2].substring(0, 2))
924
1142
  );
925
- }
926
- function mt(t, e = "input") {
927
- return y(b.value(t), q[e](V.value(t.set)));
928
- }
929
- function gt(t) {
930
- return y(b.checked(t), ft(t.set));
931
- }
932
- const Ut = {
933
- date: ht,
934
- dateTime: dt,
935
- number: pt,
936
- text: mt,
937
- checked: gt
938
- }, O = (t, e) => (r) => {
1143
+ t(n);
1144
+ }, lt = (t) => (e) => {
1145
+ const r = e.target;
1146
+ if (r.value === "")
1147
+ return;
1148
+ const s = r.value.split("T"), n = s[0].split("-"), o = new Date(
1149
+ Number(n[0]),
1150
+ Number(n[1]) - 1,
1151
+ Number(n[2])
1152
+ ), i = s[1].split(":");
1153
+ o.setHours(Number(i[0])), o.setMinutes(Number(i[1])), o.setSeconds(Number(i[2])), t(o);
1154
+ }, Rt = (t) => (e) => {
1155
+ const r = e.target;
1156
+ t(r.checked);
1157
+ }, Mt = (t) => (e) => {
1158
+ e.preventDefault(), t();
1159
+ }, Ft = (t) => (e) => {
1160
+ e.stopPropagation(), t();
1161
+ }, Vt = (t) => (e) => {
1162
+ e.stopImmediatePropagation(), t();
1163
+ }, $t = (t, e = "input") => y(
1164
+ P.valueAsDate(t),
1165
+ $[e](it(t.set))
1166
+ ), qt = (t, e = "input") => y(
1167
+ P.valueAsDate(t),
1168
+ $[e](lt(t.set))
1169
+ ), It = (t, e = "input") => y(
1170
+ P.valueAsNumber(t),
1171
+ $[e](ot(t.set))
1172
+ ), Bt = (t, e = "input") => y(P.value(t), $[e](nt(t.set))), jt = (t) => y(P.checked(t), st(t.set)), G = (t, e) => (r) => {
939
1173
  r = r.makeRef();
940
- let n, s;
941
- const i = t.map((u) => Object.keys(u)[0]);
942
- let o;
943
- const a = i.on((u) => {
944
- if (u !== o) {
945
- s == null || s.dispose(), n == null || n(!0), s = t.map((m) => m[u]);
946
- const f = e[u](s);
947
- n = c(f)(r), o = u;
1174
+ let s, n;
1175
+ const o = t.map((u) => Object.keys(u)[0]);
1176
+ let i;
1177
+ const a = o.on((u) => {
1178
+ if (u !== i) {
1179
+ n == null || n.dispose(), s == null || s(!0), n = t.map((d) => d[u]);
1180
+ const f = e[u](n);
1181
+ s = c(f)(r), i = u;
948
1182
  }
949
1183
  });
950
1184
  return (u) => {
951
- a(), u && r.reference != null && p(r.reference), n == null || n(!0);
1185
+ a(), u && r.reference != null && g(r.reference), s == null || s(!0);
952
1186
  };
953
- }, k = {
954
- bool: (t, e) => O(
955
- t.map((r) => r ? { true: !0 } : { false: !0 }),
956
- e
957
- ),
958
- field: (t, e, r) => O(
959
- t.map((n) => ({ [n[e]]: n })),
960
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
961
- r
962
- ),
963
- kind: (t, e) => k.field(t, "kind", e),
964
- tuple: (t, e) => {
965
- const r = t.map(([n, s]) => ({ [n]: s }));
966
- return O(r, e);
967
- },
968
- type: (t, e) => k.field(t, "type", e),
969
- value: (t, e) => O(
970
- t.map((r) => ({ [r]: !0 })),
971
- e
972
- )
973
- }, jt = (t, e) => (r) => {
974
- const n = (e == null ? void 0 : e.firstSeparator) ?? S, s = (e == null ? void 0 : e.lastSeparator) ?? S;
975
- return k.value(
976
- r.map((i) => i.isFirst ? "first" : i.isLast ? "last" : "other"),
1187
+ }, _e = (t, e, r) => G(
1188
+ t.map((s) => ({ [s[e]]: s })),
1189
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1190
+ r
1191
+ ), Ut = (t, e) => _e(t, "kind", e), Wt = (t, e) => {
1192
+ const r = t.map(([s, n]) => ({ [s]: n }));
1193
+ return G(r, e);
1194
+ }, Gt = (t, e) => _e(t, "type", e), H = (t, e) => G(
1195
+ t.map((r) => ({ [r]: !0 })),
1196
+ e
1197
+ ), Ht = (t, e = {}) => (r) => {
1198
+ const s = (e == null ? void 0 : e.firstSeparator) ?? w, n = (e == null ? void 0 : e.lastSeparator) ?? w;
1199
+ return H(
1200
+ r.map((o) => o.isFirst ? "first" : o.isLast ? "last" : "other"),
977
1201
  {
978
- first: () => n,
979
- last: () => s,
1202
+ first: () => s,
1203
+ last: () => n,
980
1204
  other: () => t
981
1205
  }
982
1206
  );
983
- }, De = (t, e) => (r) => {
984
- const n = Object.values(t).reduce((s, i) => {
985
- const o = r.getProvider(i);
986
- if (o == null)
987
- throw new Error(`No provider found for mark: ${i.description}`);
988
- return s[i] = o, s;
1207
+ }, ve = (t, e) => (r) => {
1208
+ const s = Object.values(t).reduce((n, o) => {
1209
+ const i = r.getProvider(o);
1210
+ if (i == null)
1211
+ throw new Error(`No provider found for mark: ${o.description}`);
1212
+ return n[o] = i, n;
989
1213
  }, {});
990
- return c(e(n))(r);
991
- }, Gt = (t, e) => (r) => {
992
- const n = [], s = Object.entries(t).reduce(
993
- (i, [o, a]) => (n.push(
994
- a((u) => (Reflect.set(i, o, u), null))(r)
995
- ), i),
1214
+ return c(e(s))(r);
1215
+ }, Jt = (t, e) => (r) => {
1216
+ const s = [], n = Object.entries(t).reduce(
1217
+ (o, [i, a]) => (s.push(
1218
+ a((u) => (Reflect.set(o, i, u), null))(r)
1219
+ ), o),
996
1220
  {}
997
1221
  );
998
- return n.push(e(s)(r)), (i) => {
999
- n.forEach((o) => o(i));
1222
+ return s.push(e(n)(r)), (o) => {
1223
+ s.forEach((i) => i(o));
1000
1224
  };
1001
- }, Ht = (t, e) => De([t], (r) => c(e(r[t]))), Jt = (t, e) => De(t, (r) => c(e(r))), Wt = (t) => (e) => t(e), Bt = (t) => (e) => (e.appendOrInsert(t), (r) => {
1002
- r && p(t);
1003
- }), vt = (t, e, r) => (n) => {
1004
- n = n.makeRef();
1005
- let s = null, i = !1;
1006
- const o = L(null), a = t.on((u) => {
1007
- u == null ? (s == null || s(!0), s = c((r == null ? void 0 : r()) ?? S)(n), i = !1) : (o.value = u, i || (s == null || s(!0), s = c(e(o))(n), i = !0));
1225
+ }, Kt = (t, e) => ve([t], (r) => c(e(r[t]))), Xt = (t, e) => ve(t, (r) => c(e(r))), zt = (t) => (e) => t(e), Qt = (t) => (e) => (e.appendOrInsert(t), (r) => {
1226
+ r && g(t);
1227
+ }), ut = (t, e, r) => (s) => {
1228
+ s = s.makeRef();
1229
+ let n = null, o = !1;
1230
+ const i = C(null), a = t.on((u) => {
1231
+ u == null ? (n == null || n(!0), n = c((r == null ? void 0 : r()) ?? w)(s), o = !1) : (i.value = u, o || (n == null || n(!0), n = c(e(i))(s), o = !0));
1008
1232
  });
1009
1233
  return (u) => {
1010
- a(), s == null || s(u), u && n.reference && p(n.reference);
1234
+ a(), n == null || n(u), u && s.reference && g(s.reference);
1011
1235
  };
1012
- }, G = (t) => (e) => (r) => t(r, e), Te = (t, e, r) => r != null ? Te(t, (n) => {
1013
- const s = n.map((i) => i.isLast ? "last" : "other");
1236
+ }, B = (t) => (e) => (r) => t(r, e), ye = (t, e, r) => r != null ? ye(t, (s) => {
1237
+ const n = s.map((o) => o.isLast ? "last" : "other");
1014
1238
  return y(
1015
- G(() => s.dispose()),
1016
- c(e(n)),
1017
- k.value(s, {
1018
- last: () => S,
1019
- other: () => r(n)
1239
+ B(() => n.dispose()),
1240
+ c(e(s)),
1241
+ H(n, {
1242
+ last: () => w,
1243
+ other: () => r(s)
1020
1244
  })
1021
1245
  );
1022
- }) : (n) => {
1023
- n = n.makeRef();
1024
- const s = t.map(
1025
- (u) => Array.from({ length: u }, (f, m) => m).map(
1026
- (f) => new Ue(f, u)
1246
+ }) : (s) => {
1247
+ s = s.makeRef();
1248
+ const n = t.map(
1249
+ (u) => Array.from({ length: u }, (f, d) => d).map(
1250
+ (f) => new ke(f, u)
1027
1251
  )
1028
- ), i = [], o = [], a = s.on((u) => {
1029
- var m, _;
1252
+ ), o = [], i = [], a = n.on((u) => {
1253
+ var d, A;
1030
1254
  const f = u.length;
1031
- for (; f < i.length; )
1032
- (m = i.pop()) == null || m(!0), (_ = o.pop()) == null || _.dispose();
1033
- for (let d = 0; d < f; d++)
1034
- if (o[d] == null) {
1035
- o[d] = L(u[d]);
1036
- const P = c(e(o[d]));
1037
- i[d] = P(n);
1255
+ for (; f < o.length; )
1256
+ (d = o.pop()) == null || d(!0), (A = i.pop()) == null || A.dispose();
1257
+ for (let m = 0; m < f; m++)
1258
+ if (i[m] == null) {
1259
+ i[m] = C(u[m]);
1260
+ const D = c(e(i[m]));
1261
+ o[m] = D(s);
1038
1262
  } else
1039
- o[d].value = u[d];
1263
+ i[m].value = u[m];
1040
1264
  });
1041
1265
  return (u) => {
1042
- a(), u && n.reference && p(n.reference);
1266
+ a(), u && s.reference && g(s.reference);
1043
1267
  };
1044
- }, yt = (t, e, r) => r != null ? yt(t, (n, s) => {
1045
- const i = s.map((o) => o.isLast ? "last" : "other");
1268
+ }, at = (t, e, r) => r != null ? at(t, (s, n) => {
1269
+ const o = n.map((i) => i.isLast ? "last" : "other");
1046
1270
  return y([
1047
- G(() => i.dispose()),
1048
- c(e(n, s)),
1049
- k.value(i, {
1050
- last: () => S,
1051
- other: () => r(s)
1271
+ B(() => o.dispose()),
1272
+ c(e(s, n)),
1273
+ H(o, {
1274
+ last: () => w,
1275
+ other: () => r(n)
1052
1276
  })
1053
1277
  ]);
1054
- }) : (n) => {
1055
- const s = t.map((i) => i.length);
1056
- return Te(s, (i) => {
1057
- const o = H(
1058
- () => t.value[i.value.index],
1059
- [i, t]
1278
+ }) : (s) => {
1279
+ const n = t.map((o) => o.length);
1280
+ return ye(n, (o) => {
1281
+ const i = j(
1282
+ () => t.value[o.value.index],
1283
+ [o, t]
1060
1284
  );
1061
1285
  return y(
1062
- G(() => o.dispose()),
1063
- c(e(o, i))
1286
+ B(() => i.dispose()),
1287
+ c(e(i, o))
1064
1288
  );
1065
- })(n);
1066
- }, Xt = (t, e) => (r) => {
1289
+ })(s);
1290
+ }, Yt = (t, e) => (r) => {
1067
1291
  r = r.makeRef();
1068
- const n = t.map((o) => c(e(o)));
1069
- let s = () => {
1292
+ const s = t.map((i) => c(e(i)));
1293
+ let n = () => {
1070
1294
  };
1071
- const i = n.on((o) => {
1072
- s(!0), s = o(r);
1295
+ const o = s.on((i) => {
1296
+ n(!0), n = i(r);
1073
1297
  });
1074
- return (o) => {
1075
- i(), s(o);
1298
+ return (i) => {
1299
+ o(), n(i);
1076
1300
  };
1077
- }, Le = (t, e, r) => vt(
1078
- t.map((n) => n ? !0 : null),
1301
+ }, we = (t, e, r) => ut(
1302
+ t.map((s) => s ? !0 : null),
1079
1303
  () => e,
1080
1304
  r != null ? () => r : void 0
1081
- ), zt = (t, e, r) => Le(
1082
- t.map((n) => !n),
1305
+ ), Zt = (t, e, r) => we(
1306
+ t.map((s) => !s),
1083
1307
  e,
1084
1308
  r
1085
- );
1086
- function Kt(t, e, r = S) {
1087
- return Le(
1088
- t.map((n) => n.length > 0),
1089
- e,
1090
- r
1091
- );
1092
- }
1093
- const Qt = (t) => (e) => t(e.element) ?? (() => {
1094
- });
1095
- function ke(t, e) {
1309
+ ), xt = (t, e, r = w) => we(
1310
+ t.map((s) => s.length > 0),
1311
+ e,
1312
+ r
1313
+ ), er = (t) => (e) => t(e.element) ?? (() => {
1314
+ }), Ae = (t, e) => {
1096
1315
  const r = t(e);
1097
1316
  return () => r(!0);
1317
+ }, tr = (t, e, { doc: r, clear: s } = {}) => {
1318
+ const n = typeof e == "string" ? (r ?? document).querySelector(e) : e;
1319
+ if (n === null)
1320
+ throw new ct(
1321
+ `Cannot find element by selector for render: ${e}`
1322
+ );
1323
+ s !== !1 && (r ?? n.ownerDocument) != null && et(r ?? n.ownerDocument);
1324
+ const o = je(n), i = se(n) ? void 0 : n, a = v.of(o, i);
1325
+ return Ae(t, a);
1326
+ };
1327
+ class ct extends Error {
1328
+ constructor(e) {
1329
+ super(e);
1330
+ }
1098
1331
  }
1099
- function Yt(t, e, { doc: r, clear: n } = {}) {
1100
- const s = typeof e == "string" ? (r ?? document).querySelector(e) : e;
1332
+ const rr = (t, e) => (r) => {
1333
+ const s = r.document.querySelector(t);
1101
1334
  if (s === null)
1102
- throw new Error(`Cannot find element by selector for render: ${e}`);
1103
- n && (r ?? s.ownerDocument) != null && ut(r ?? s.ownerDocument);
1104
- const i = ze(s), o = he(s) ? void 0 : s, a = v.of(i, o);
1105
- return ke(t, a);
1106
- }
1107
- const Zt = (t, e) => (r) => {
1108
- const n = r.document.querySelector(t);
1109
- if (n === null)
1110
1335
  throw new Error(`Cannot find element by selector for portal: ${t}`);
1111
- return ke(
1336
+ return Ae(
1112
1337
  c(e),
1113
- r.withElement(n).withFirstLevel()
1338
+ r.withElement(s).withFirstLevel()
1114
1339
  );
1115
- };
1116
- function xt(t) {
1117
- return Symbol(t);
1118
- }
1119
- const Ne = (t, e) => (r) => c(e)(r.withProviders(t)), er = (...t) => t.length > 0 ? t.reduceRight((e, r) => (n) => e(r(n))) : c, tr = (t, e, r) => Ne({ [t]: e }, c(r)), rr = (t, e) => Ne(t, c(e)), St = (t, e) => (r) => {
1120
- const n = r.element, s = n.style.getPropertyValue(t);
1121
- return n.style.setProperty(t, e), (i) => {
1122
- i && n.style.setProperty(t, s);
1340
+ }, sr = (t) => Symbol(t), Se = (t, e) => (r) => c(e)(r.withProviders(t)), nr = (...t) => t.length > 0 ? t.reduceRight((e, r) => (s) => e(r(s))) : c, or = (t, e, r) => Se({ [t]: e }, c(r)), ir = (t, e) => Se(t, c(e)), ft = (t, e) => (r) => {
1341
+ const s = r.element, n = s.style.getPropertyValue(t);
1342
+ return s.style.setProperty(t, e), (o) => {
1343
+ o && s.style.setProperty(t, n);
1123
1344
  };
1124
- }, wt = (t, e) => (r) => {
1125
- const n = r.element, s = n.style.getPropertyValue(t);
1126
- return e.on((i) => n.style.setProperty(t, i)), (i) => {
1127
- i && n.style.setProperty(t, s);
1345
+ }, ht = (t, e) => (r) => {
1346
+ const s = r.element, n = s.style.getPropertyValue(t);
1347
+ return e.on((o) => s.style.setProperty(t, o)), (o) => {
1348
+ o && s.style.setProperty(t, n);
1128
1349
  };
1129
- }, nr = new Proxy(
1350
+ }, lr = new Proxy(
1130
1351
  {},
1131
1352
  {
1132
- get: (t, e) => (r) => h.is(r) ? wt(e, r) : St(e, r)
1353
+ /**
1354
+ * Creates a renderable component for the specified `style` property.
1355
+ *
1356
+ * @param _ - The target object.
1357
+ * @param name - The name of the CSS style property.
1358
+ * @returns The renderable component for the specified attribute.
1359
+ *
1360
+ */
1361
+ get: (t, e) => (r) => h.is(r) ? ht(e, r) : ft(e, r)
1133
1362
  }
1134
1363
  );
1135
1364
  export {
1136
- Vt as Async,
1365
+ kt as Async,
1366
+ jt as BindChecked,
1367
+ $t as BindDate,
1368
+ qt as BindDateTime,
1369
+ It as BindNumber,
1370
+ Bt as BindText,
1137
1371
  E as Computed,
1138
- jt as Conjunction,
1372
+ Ht as Conjunction,
1139
1373
  v as DOMContext,
1140
- Bt as DOMNode,
1141
- me as El,
1142
- ge as ElNS,
1143
- S as Empty,
1144
- vt as Ensure,
1145
- yt as ForEach,
1374
+ Qt as DOMNode,
1375
+ ie as El,
1376
+ le as ElNS,
1377
+ ke as ElementPosition,
1378
+ w as Empty,
1379
+ ut as Ensure,
1380
+ at as ForEach,
1146
1381
  y as Fragment,
1147
- Xt as MapSignal,
1148
- se as MemoryStore,
1149
- Kt as NotEmpty,
1150
- ft as OnChecked,
1151
- Wt as OnCtx,
1152
- Qt as OnMount,
1153
- G as OnUnmount,
1154
- Zt as Portal,
1155
- Ue as Position,
1382
+ Yt as MapSignal,
1383
+ z as MemoryStore,
1384
+ xt as NotEmpty,
1385
+ st as OnChecked,
1386
+ zt as OnCtx,
1387
+ er as OnMount,
1388
+ B as OnUnmount,
1389
+ G as OneOf,
1390
+ _e as OneOfField,
1391
+ Ut as OneOfKind,
1392
+ Wt as OneOfTuple,
1393
+ Gt as OneOfType,
1394
+ H as OneOfValue,
1395
+ rr as Portal,
1156
1396
  F as Prop,
1157
- er as Provide,
1158
- Te as Repeat,
1397
+ nr as Provide,
1398
+ Be as ProviderNotFoundError,
1399
+ ct as RenderingError,
1400
+ ye as Repeat,
1159
1401
  h as Signal,
1160
- be as Task,
1161
- kt as Text,
1162
- zt as Unless,
1163
- Gt as Use,
1164
- Ht as UseProvider,
1165
- Jt as UseProviders,
1166
- Le as When,
1167
- tr as WithProvider,
1168
- rr as WithProviders,
1169
- we as addNodeTracker,
1170
- Dt as animateSignal,
1171
- Ge as animateSignals,
1172
- Ct as aria,
1173
- b as attr,
1174
- Ut as bind,
1175
- ut as clearSSR,
1176
- Tt as computedRecord,
1177
- Nt as dataAttr,
1178
- Fe as dateInterpolate,
1179
- V as emit,
1180
- qe as endInterpolate,
1181
- ze as getSelfOrParentElement,
1182
- Ve as guessInterpolate,
1183
- Lt as handleAnchorClick,
1184
- Ot as html,
1185
- It as input,
1186
- he as isElement,
1187
- bt as localStorageProp,
1188
- fe as makeGetter,
1189
- xt as makeProviderMark,
1190
- ce as makeSetter,
1191
- Ft as math,
1192
- Mt as mathAttr,
1193
- ye as maybeAddAttributeTracker,
1194
- Se as maybeAddClassTracker,
1195
- _e as maybeAddTextTracker,
1196
- Ie as numberInterpolate,
1197
- q as on,
1198
- k as oneof,
1199
- tt as removeAttributeTrackers,
1200
- nt as removeClassTrackers,
1201
- p as removeDOMNode,
1202
- st as removeNodeTrackers,
1203
- ot as removeTextTrackers,
1204
- Yt as render,
1205
- ke as renderWithContext,
1402
+ me as Task,
1403
+ At as TextNode,
1404
+ Zt as Unless,
1405
+ Jt as Use,
1406
+ Kt as UseProvider,
1407
+ Xt as UseProviders,
1408
+ we as When,
1409
+ or as WithProvider,
1410
+ ir as WithProviders,
1411
+ fe as _addNodeTracker,
1412
+ et as _clearSSR,
1413
+ je as _getSelfOrParentElement,
1414
+ se as _isElement,
1415
+ re as _makeGetter,
1416
+ te as _makeSetter,
1417
+ ae as _maybeAddAttributeTracker,
1418
+ ce as _maybeAddClassTracker,
1419
+ he as _maybeAddTextTracker,
1420
+ g as _removeDOMNode,
1421
+ Ie as _setAttribute,
1422
+ Fe as _setBooleanProperty,
1423
+ $e as _setDateProperty,
1424
+ Ve as _setNumberProperty,
1425
+ qe as _setStringProperty,
1426
+ oe as _signalText,
1427
+ ne as _staticText,
1428
+ vt as animateSignal,
1429
+ Me as animateSignals,
1430
+ Et as aria,
1431
+ P as attr,
1432
+ St as dataAttr,
1433
+ Rt as emitChecked,
1434
+ Mt as emitPreventDefault,
1435
+ Vt as emitStopImmediatePropagation,
1436
+ Ft as emitStopPropagation,
1437
+ nt as emitValue,
1438
+ it as emitValueAsDate,
1439
+ lt as emitValueAsDateTime,
1440
+ ot as emitValueAsNumber,
1441
+ Ne as endInterpolate,
1442
+ Oe as guessInterpolate,
1443
+ wt as handleAnchorClick,
1444
+ bt as html,
1445
+ Tt as input,
1446
+ Le as interpolateDate,
1447
+ Te as interpolateNumber,
1448
+ Ce as interpolateString,
1449
+ O as isSSR,
1450
+ gt as localStorageProp,
1451
+ j as makeComputed,
1452
+ yt as makeComputedRecord,
1453
+ pt as makeEffect,
1454
+ C as makeProp,
1455
+ sr as makeProviderMark,
1456
+ mt as makeSignal,
1457
+ Lt as math,
1458
+ Dt as mathAttr,
1459
+ $ as on,
1460
+ Nt as prepareSSR,
1461
+ xe as removeTextTrackers,
1462
+ tr as render,
1463
+ Ae as renderWithContext,
1206
1464
  c as renderableOfTNode,
1207
- Pt as sessionStorageProp,
1208
- Xe as setAttribute,
1209
- He as setBooleanProperty,
1210
- We as setDateProperty,
1211
- Je as setNumberProperty,
1212
- Be as setStringProperty,
1213
- pe as signalText,
1214
- R as ssr,
1215
- qt as startSSR,
1216
- de as staticText,
1217
- ie as storedProp,
1218
- $e as stringInterpolate,
1219
- nr as style,
1220
- $t as svg,
1221
- Rt as svgAttr,
1222
- H as useComputed,
1223
- At as useEffect,
1224
- L as useProp,
1225
- Et as useSignal
1465
+ _t as sessionStorageProp,
1466
+ Q as storedProp,
1467
+ lr as style,
1468
+ Ct as svg,
1469
+ Pt as svgAttr,
1470
+ Ot as useSSRDone
1226
1471
  };