@tempots/dom 26.11.0 → 27.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -5,8 +5,8 @@ var se = (s) => {
5
5
  var He = (s, e, t) => e in s ? Oe(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
6
6
  var i = (s, e, t) => He(s, typeof e != "symbol" ? e + "" : e, t), re = (s, e, t) => e.has(s) || se("Cannot " + t);
7
7
  var X = (s, e, t) => (re(s, e, "read from private field"), t ? t.call(s) : e.get(s)), ne = (s, e, t) => e.has(s) ? se("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), ie = (s, e, t, r) => (re(s, e, "write to private field"), r ? r.call(s, t) : e.set(s, t), t);
8
- const Ne = (s, e, t) => s + (e - s) * t;
9
- const $e = (s, e, t) => {
8
+ const $e = (s, e, t) => s + (e - s) * t;
9
+ const ke = (s, e, t) => {
10
10
  const r = Math.max(s.length, e.length);
11
11
  let n = "";
12
12
  for (let o = 0; o < r; o++) {
@@ -16,7 +16,7 @@ const $e = (s, e, t) => {
16
16
  isNaN(c) && (c = 97), n += String.fromCharCode(l + (c - l) * t);
17
17
  }
18
18
  return n;
19
- }, ke = (s, e, t) => new Date(s.getTime() + (e.getTime() - s.getTime()) * t), Ie = (s, e) => e, Re = (s) => typeof s == "number" ? Ne : typeof s == "string" ? $e : s instanceof Date ? ke : Ie;
19
+ }, Ne = (s, e, t) => new Date(s.getTime() + (e.getTime() - s.getTime()) * t), Ie = (s, e) => e, Re = (s) => typeof s == "number" ? $e : typeof s == "string" ? ke : s instanceof Date ? Ne : Ie;
20
20
  var D;
21
21
  class Y {
22
22
  /**
@@ -152,13 +152,54 @@ const O = class O {
152
152
  this._disposed || (this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
153
153
  });
154
154
  /**
155
- * Returns a new Computed instance that applies the given mapping function to the value of this Signal.
156
- * The mapping function is called whenever the value of this Signal changes.
155
+ * Creates a new computed signal by applying a transformation function to this signal's value.
157
156
  *
158
- * @typeParam O - The type of the mapped value.
159
- * @param fn - The mapping function to apply to the value of this Signal.
160
- * @param equals - Optional equality function to determine if two mapped values are equal.
161
- * @returns - A new Computed instance with the mapped value.
157
+ * The `map` method is one of the most commonly used signal operations. It creates a new
158
+ * computed signal that automatically updates whenever the source signal changes. The
159
+ * transformation function is called with the current value and should return the new value.
160
+ *
161
+ * @example
162
+ * ```typescript
163
+ * const count = prop(5)
164
+ *
165
+ * // Transform to different types
166
+ * const doubled = count.map(n => n * 2)
167
+ * const message = count.map(n => `Count is ${n}`)
168
+ * const isEven = count.map(n => n % 2 === 0)
169
+ *
170
+ * // Use in UI
171
+ * html.div(
172
+ * html.div('Original: ', count.map(String)),
173
+ * html.div('Doubled: ', doubled.map(String)),
174
+ * html.div('Message: ', message),
175
+ * html.div('Is even: ', isEven.map(String))
176
+ * )
177
+ * ```
178
+ *
179
+ * @example
180
+ * ```typescript
181
+ * // Chain multiple transformations
182
+ * const user = prop({ name: 'John', age: 30 })
183
+ * const greeting = user
184
+ * .map(u => u.name)
185
+ * .map(name => name.toUpperCase())
186
+ * .map(name => `Hello, ${name}!`)
187
+ * ```
188
+ *
189
+ * @example
190
+ * ```typescript
191
+ * // With custom equality function for objects
192
+ * const items = prop([{ id: 1, name: 'Item 1' }])
193
+ * const itemNames = items.map(
194
+ * items => items.map(item => item.name),
195
+ * (a, b) => JSON.stringify(a) === JSON.stringify(b) // deep equality
196
+ * )
197
+ * ```
198
+ *
199
+ * @typeParam O - The type of the transformed value
200
+ * @param fn - Function that transforms the signal's value to a new value
201
+ * @param equals - Optional function to determine if two transformed values are equal (defaults to strict equality)
202
+ * @returns A new computed signal with the transformed value
162
203
  */
163
204
  i(this, "map", (e, t = (r, n) => r === n) => {
164
205
  const r = new x(() => {
@@ -256,7 +297,7 @@ const O = class O {
256
297
  * @returns A property that holds the mapped value and can be observed for changes.
257
298
  */
258
299
  i(this, "mapAsync", (e, t, r, n = (o, l) => o === l) => {
259
- const o = w(t, n);
300
+ const o = E(t, n);
260
301
  let l = 0, c = new AbortController();
261
302
  return o.onDispose(
262
303
  this.on(async (a) => {
@@ -306,7 +347,7 @@ const O = class O {
306
347
  i(this, "deriveProp", ({
307
348
  autoDisposeProp: e = !0,
308
349
  equals: t
309
- } = {}) => this.feedProp(w(this.get(), t), e));
350
+ } = {}) => this.feedProp(E(this.get(), t), e));
310
351
  /**
311
352
  * Derives a new signal from the current signal. Useful to create a new signal that emits the same values as the current signal but can be disposed independently.
312
353
  * @returns A new signal that emits the same values as the current signal.
@@ -354,14 +395,45 @@ const O = class O {
354
395
  }
355
396
  };
356
397
  /**
357
- * Creates a Signal that holds the result of a Promise.
398
+ * Creates a Signal that holds the result of a Promise, with proper error handling.
358
399
  *
359
- * @typeParam O - The type of the value returned by the Promise.
360
- * @param promise - The Promise to use to feed the Signal.
361
- * @param init - The initial value of the Signal before the Promise resolves.
362
- * @param recover - A function to recover from Promise rejection and provide an alternative value for the Signal.
363
- * @param equals - A function to compare two values of type O for equality. Defaults to strict equality (===).
364
- * @returns - A Signal that represents the result of the Promise.
400
+ * This static method creates a signal that starts with an initial value and updates
401
+ * when the promise resolves. If the promise rejects, an optional recovery function
402
+ * can provide a fallback value.
403
+ *
404
+ * @example
405
+ * ```typescript
406
+ * // Basic usage with API call
407
+ * const userData = Signal.ofPromise(
408
+ * fetch('/api/user').then(r => r.json()),
409
+ * { loading: true }, // initial state
410
+ * error => ({ error: error.message, loading: false }) // error recovery
411
+ * )
412
+ *
413
+ * // Use in UI
414
+ * Ensure(userData,
415
+ * (user) => html.div('Welcome, ', user.map(u => u.name)),
416
+ * () => html.div('Loading...')
417
+ * )
418
+ * ```
419
+ *
420
+ * @example
421
+ * ```typescript
422
+ * // With custom equality function
423
+ * const config = Signal.ofPromise(
424
+ * loadConfig(),
425
+ * {},
426
+ * () => ({}),
427
+ * (a, b) => JSON.stringify(a) === JSON.stringify(b) // deep equality
428
+ * )
429
+ * ```
430
+ *
431
+ * @typeParam O - The type of the value returned by the Promise
432
+ * @param promise - The Promise to use to feed the Signal
433
+ * @param init - The initial value of the Signal before the Promise resolves
434
+ * @param recover - Optional function to recover from Promise rejection and provide an alternative value
435
+ * @param equals - Function to compare two values for equality (defaults to strict equality)
436
+ * @returns A Signal that represents the result of the Promise
365
437
  */
366
438
  i(O, "ofPromise", (e, t, r, n = (o, l) => o === l) => {
367
439
  const o = new O(t, n);
@@ -546,7 +618,7 @@ const z = (s, e, t = (r, n) => r === n) => {
546
618
  n.dispose(), t.abortSignal != null && t.abortSignal.removeEventListener("abort", o);
547
619
  };
548
620
  return t.abortSignal != null && t.abortSignal.addEventListener("abort", o), o;
549
- }, w = (s, e = (t, r) => t === r) => new I(s, e), U = (s, e = (t, r) => t === r) => new d(s, e), le = () => typeof window < "u" ? window : void 0, T = {
621
+ }, E = (s, e = (t, r) => t === r) => new I(s, e), U = (s, e = (t, r) => t === r) => new d(s, e), le = () => typeof window < "u" ? window : void 0, T = {
550
622
  /**
551
623
  * Maps a value or a Signal to a new value.
552
624
  * If the value is a Signal, it returns a new Signal with the mapped value.
@@ -616,7 +688,7 @@ const z = (s, e, t = (r, n) => r === n) => {
616
688
  deriveProp: (s, {
617
689
  autoDisposeProp: e = !0,
618
690
  equals: t
619
- } = {}) => d.is(s) ? s.deriveProp({ autoDisposeProp: e, equals: t }) : w(s, t)
691
+ } = {}) => d.is(s) ? s.deriveProp({ autoDisposeProp: e, equals: t }) : E(s, t)
620
692
  }, qe = (...s) => (e, t) => {
621
693
  const r = s.filter((n) => d.is(n));
622
694
  return z(
@@ -624,12 +696,12 @@ const z = (s, e, t = (r, n) => r === n) => {
624
696
  r,
625
697
  t
626
698
  );
627
- }, Lt = (s) => {
699
+ }, Pt = (s) => {
628
700
  const e = Object.keys(s);
629
701
  return qe(...Object.values(s))(
630
702
  (...t) => Object.fromEntries(e.map((r, n) => [r, t[n]]))
631
703
  );
632
- }, Pt = (...s) => (e, t = {}) => {
704
+ }, Lt = (...s) => (e, t = {}) => {
633
705
  const r = s.filter((n) => d.is(n));
634
706
  return je(
635
707
  () => e(...s.map(T.get)),
@@ -689,9 +761,9 @@ function oe(s) {
689
761
  return typeof requestAnimationFrame == "function" ? requestAnimationFrame(s) : setTimeout(s, 0);
690
762
  }
691
763
  const Fe = (s, e, t, r) => {
692
- const n = (r == null ? void 0 : r.duration) ?? 300, o = (r == null ? void 0 : r.easing) ?? ((S) => S), l = (r == null ? void 0 : r.equals) ?? ((S, $) => S === $);
764
+ const n = (r == null ? void 0 : r.duration) ?? 300, o = (r == null ? void 0 : r.easing) ?? ((S) => S), l = (r == null ? void 0 : r.equals) ?? ((S, k) => S === k);
693
765
  let c = r == null ? void 0 : r.interpolate, a = s, u = e(), h = performance.now(), g = null, y = !0;
694
- const p = new x(e, l), m = w(s, l);
766
+ const p = new x(e, l), m = E(s, l);
695
767
  m.onDispose(() => {
696
768
  g !== null && cancelAnimationFrame(g);
697
769
  }), m.onDispose(p.dispose), t.forEach((S) => {
@@ -700,10 +772,10 @@ const Fe = (s, e, t, r) => {
700
772
  const C = (S) => {
701
773
  u = S, h = performance.now(), a = m.value, y && (y = !1, g = oe(ee));
702
774
  }, ee = () => {
703
- const $ = (performance.now() - h) / T.get(n), Me = o($);
775
+ const k = (performance.now() - h) / T.get(n), Me = o(k);
704
776
  c == null && (c = Re(a));
705
777
  let te = c(a, u, Me);
706
- $ >= 1 ? (y = !0, te = u) : g = oe(ee), m.set(te);
778
+ k >= 1 ? (y = !0, te = u) : g = oe(ee), m.set(te);
707
779
  };
708
780
  return p.on(C), m;
709
781
  }, Ot = (s, e) => {
@@ -754,7 +826,7 @@ class me extends Error {
754
826
  super(`Provider not found: ${e.description}`);
755
827
  }
756
828
  }
757
- class L {
829
+ class P {
758
830
  /**
759
831
  * Constructs a new `DOMContext` instance.
760
832
  *
@@ -774,11 +846,26 @@ class L {
774
846
  */
775
847
  i(this, "createElement", (e, t) => t !== void 0 ? this.document.createElementNS(t, e) : this.document.createElement(e));
776
848
  /**
777
- * Creates a new DOM element (eg: HTML or SVG) with the specified tag name and namespace and appends it to the current element.
849
+ * Creates a new child element and appends it to the current element, returning a new context.
778
850
  *
779
- * @param tagName - The tag name of the element to create.
780
- * @param namespace - The namespace URI to create the element in, or `undefined` to create a standard HTML element.
781
- * @returns The newly created element.
851
+ * This method creates a new DOM element with the specified tag name and namespace,
852
+ * appends it to the current element, and returns a new DOMContext focused on the
853
+ * newly created child element. This is the primary method for building DOM trees.
854
+ *
855
+ * @example
856
+ * ```typescript
857
+ * // Create HTML elements
858
+ * const divCtx = ctx.makeChildElement('div', undefined)
859
+ * const spanCtx = divCtx.makeChildElement('span', undefined)
860
+ *
861
+ * // Create SVG elements
862
+ * const svgCtx = ctx.makeChildElement('svg', 'http://www.w3.org/2000/svg')
863
+ * const circleCtx = svgCtx.makeChildElement('circle', 'http://www.w3.org/2000/svg')
864
+ * ```
865
+ *
866
+ * @param tagName - The tag name of the element to create (e.g., 'div', 'span', 'svg')
867
+ * @param namespace - The namespace URI for the element, or undefined for HTML elements
868
+ * @returns A new DOMContext focused on the newly created child element
782
869
  */
783
870
  i(this, "makeChildElement", (e, t) => {
784
871
  const r = this.createElement(e, t);
@@ -836,11 +923,50 @@ class L {
836
923
  * @param element - The DOM element to use in the new `DOMContext` instance.
837
924
  * @returns A new `DOMContext` instance with the provided `element`.
838
925
  */
839
- i(this, "withElement", (e) => new L(this.document, e, void 0, this.providers));
926
+ i(this, "withElement", (e) => new P(this.document, e, void 0, this.providers));
840
927
  /**
841
- * Creates a new `DOMContext` instance with a reference to a DOM element selected by the provided `selector`.
842
- * @param selector - The CSS selector for the target DOM element.
843
- * @returns A new `DOMContext` instance with a reference to the selected DOM element.
928
+ * Creates a portal to render content in a different part of the DOM tree.
929
+ *
930
+ * Portals allow you to render child components into a DOM node that exists outside
931
+ * the parent component's DOM hierarchy. This is useful for modals, tooltips,
932
+ * dropdowns, and other UI elements that need to break out of their container's
933
+ * styling or z-index context.
934
+ *
935
+ * @example
936
+ * ```typescript
937
+ * // Portal to a modal container
938
+ * const modalCtx = ctx.makePortal('#modal-root')
939
+ * const modal = modalCtx.makeChildElement('div', undefined)
940
+ *
941
+ * // Add modal content
942
+ * modal.makeChildText('This renders in #modal-root')
943
+ * ```
944
+ *
945
+ * @example
946
+ * ```typescript
947
+ * // Portal to an existing element reference
948
+ * const tooltipContainer = document.getElementById('tooltip-container')!
949
+ * const tooltipCtx = ctx.makePortal(tooltipContainer)
950
+ *
951
+ * // Render tooltip content
952
+ * const tooltip = tooltipCtx.makeChildElement('div', undefined)
953
+ * tooltip.addClasses(['tooltip', 'tooltip-top'])
954
+ * ```
955
+ *
956
+ * @example
957
+ * ```typescript
958
+ * // Portal for dropdown menu
959
+ * const dropdownCtx = ctx.makePortal('body') // Render at body level
960
+ * const dropdown = dropdownCtx.makeChildElement('div', undefined)
961
+ * dropdown.addClasses(['dropdown-menu'])
962
+ * dropdown.setStyle('position', 'absolute')
963
+ * dropdown.setStyle('top', '100px')
964
+ * dropdown.setStyle('left', '50px')
965
+ * ```
966
+ *
967
+ * @param selector - CSS selector string or HTMLElement reference for the portal target
968
+ * @returns A new DOMContext focused on the portal target element
969
+ * @throws {Error} When the selector doesn't match any element in the document
844
970
  */
845
971
  i(this, "makePortal", (e) => {
846
972
  const t = typeof e == "string" ? this.document.querySelector(e) : e;
@@ -854,7 +980,7 @@ class L {
854
980
  * @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
855
981
  * @returns A new `DOMContext` instance with the specified reference.
856
982
  */
857
- i(this, "withReference", (e) => new L(this.document, this.element, e, this.providers));
983
+ i(this, "withReference", (e) => new P(this.document, this.element, e, this.providers));
858
984
  /**
859
985
  * Sets a provider for the given provider mark.
860
986
  *
@@ -862,7 +988,7 @@ class L {
862
988
  * @param value - The provider to set for the given mark.
863
989
  * @returns A new `DOMContext` instance with the specified provider.
864
990
  */
865
- i(this, "setProvider", (e, t, r) => new L(this.document, this.element, this.reference, {
991
+ i(this, "setProvider", (e, t, r) => new P(this.document, this.element, this.reference, {
866
992
  ...this.providers,
867
993
  [e]: [t, r]
868
994
  }));
@@ -965,25 +1091,25 @@ class L {
965
1091
  * @returns A new `DOMContext` instance.
966
1092
  */
967
1093
  static of(e, t, r) {
968
- return new L(e.ownerDocument, e, t, r);
1094
+ return new P(e.ownerDocument, e, t, r);
969
1095
  }
970
1096
  }
971
1097
  const Je = (s) => Symbol(s), Q = (s, e) => {
972
1098
  const t = s(e);
973
1099
  return (r = !0) => t(r);
974
- }, Nt = (s, e, { doc: t, clear: r, disposeWithParent: n = !0, providers: o = {} } = {}) => {
1100
+ }, $t = (s, e, { doc: t, clear: r, disposeWithParent: n = !0, providers: o = {} } = {}) => {
975
1101
  const l = typeof e == "string" ? (t ?? document).querySelector(e) : e;
976
1102
  if (l === null)
977
1103
  throw new Ge(
978
1104
  `Cannot find element by selector for render: ${e}`
979
1105
  );
980
1106
  r !== !1 && (t ?? l.ownerDocument) != null && l.nodeType === 1 && (l.innerHTML = "");
981
- const c = Ue(l), a = ge(l) ? void 0 : l, u = L.of(c, a, o), h = Q(s, u);
1107
+ const c = Ue(l), a = ge(l) ? void 0 : l, u = P.of(c, a, o), h = Q(s, u);
982
1108
  let g;
983
1109
  return n && (g = new MutationObserver((y) => {
984
1110
  var p;
985
1111
  (p = y[0]) == null || p.removedNodes.forEach((m) => {
986
- m === l && (g == null || g.disconnect(), h(l.nodeType !== Node.ELEMENT_NODE));
1112
+ m === l && (g == null || g.disconnect(), h(l.nodeType !== 1));
987
1113
  });
988
1114
  }), g.observe(l.parentElement, {
989
1115
  childList: !0,
@@ -992,14 +1118,14 @@ const Je = (s) => Symbol(s), Q = (s, e) => {
992
1118
  })), () => {
993
1119
  g == null || g.disconnect(), h(!0);
994
1120
  };
995
- }, $t = (s, {
1121
+ }, kt = (s, {
996
1122
  startUrl: e = "https://example.com",
997
1123
  selector: t,
998
1124
  providers: r = {}
999
1125
  } = {
1000
1126
  selector: "body"
1001
1127
  }) => {
1002
- const n = T.toSignal(e).deriveProp(), o = new Se(t, void 0), l = new P(o, void 0, { currentURL: n }, r);
1128
+ const n = T.toSignal(e).deriveProp(), o = new Se(t, void 0), l = new L(o, void 0, { currentURL: n }, r);
1003
1129
  return {
1004
1130
  clear: Q(s(), l),
1005
1131
  root: o,
@@ -1012,7 +1138,7 @@ class Ge extends Error {
1012
1138
  }
1013
1139
  }
1014
1140
  const ye = "data-tts-node", V = "data-tts-class", j = "data-tts-style", q = "data-tts-html", F = "data-tts-text", B = "data-tts-attrs";
1015
- class kt {
1141
+ class Nt {
1016
1142
  constructor({
1017
1143
  select: e,
1018
1144
  getAttribute: t,
@@ -1210,7 +1336,7 @@ const Xe = () => {
1210
1336
  document.querySelectorAll(`[${B}]`).forEach((e) => rt(e));
1211
1337
  }, It = () => {
1212
1338
  Xe(), ze(), et(), Ze(), st(), nt();
1213
- }, b = Symbol("class"), E = Symbol("style"), v = Symbol("handler"), be = () => Math.random().toString(36).substring(2, 15), it = (s) => s.replace(/<[^>]*>?/g, "");
1339
+ }, b = Symbol("class"), w = Symbol("style"), v = Symbol("handler"), be = () => Math.random().toString(36).substring(2, 15), it = (s) => s.replace(/<[^>]*>?/g, "");
1214
1340
  class Ae {
1215
1341
  constructor(e) {
1216
1342
  i(this, "id", be());
@@ -1240,7 +1366,7 @@ class Ae {
1240
1366
  i(this, "hasInnerText", () => this.properties.innerText != null);
1241
1367
  i(this, "hasChildren", () => this.children.length > 0);
1242
1368
  i(this, "hasClasses", () => this.properties[b] != null);
1243
- i(this, "hasStyles", () => this.properties[E] != null);
1369
+ i(this, "hasStyles", () => this.properties[w] != null);
1244
1370
  i(this, "hasAttributes", () => Object.keys(this.properties).length > 0);
1245
1371
  i(this, "hasHandlers", () => this.properties[v] != null);
1246
1372
  i(this, "hasRenderableProperties", () => this.hasClasses() || this.hasAttributes() || this.hasStyles());
@@ -1295,18 +1421,18 @@ class Ae {
1295
1421
  ([e]) => !["innerText", "innerHTML"].includes(e)
1296
1422
  ));
1297
1423
  i(this, "getVisibleAttributes", () => Reflect.ownKeys(this.properties).flatMap(
1298
- (e) => e === b ? [["class", this.getClasses()]] : e === E ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
1424
+ (e) => e === b ? [["class", this.getClasses()]] : e === w ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
1299
1425
  ));
1300
1426
  i(this, "setStyle", (e, t) => {
1301
1427
  var n;
1302
- const r = (n = this.properties)[E] ?? (n[E] = {});
1303
- r[e] = t, t === "" && (delete r[e], Object.keys(r).length === 0 && delete this.properties[E]);
1428
+ const r = (n = this.properties)[w] ?? (n[w] = {});
1429
+ r[e] = t, t === "" && (delete r[e], Object.keys(r).length === 0 && delete this.properties[w]);
1304
1430
  });
1305
1431
  i(this, "getStyle", (e) => {
1306
1432
  var t;
1307
- return ((t = this.properties[E]) == null ? void 0 : t[e]) ?? "";
1433
+ return ((t = this.properties[w]) == null ? void 0 : t[e]) ?? "";
1308
1434
  });
1309
- i(this, "getStyles", () => this.properties[E] ?? {});
1435
+ i(this, "getStyles", () => this.properties[w] ?? {});
1310
1436
  i(this, "makeAccessors", (e) => {
1311
1437
  const t = this.properties;
1312
1438
  return {
@@ -1350,7 +1476,7 @@ class at {
1350
1476
  this.text = e;
1351
1477
  }
1352
1478
  }
1353
- class P {
1479
+ class L {
1354
1480
  constructor(e, t, r, n) {
1355
1481
  i(this, "appendOrInsert", (e) => {
1356
1482
  if (this.reference != null) {
@@ -1361,7 +1487,7 @@ class P {
1361
1487
  });
1362
1488
  i(this, "makeChildElement", (e, t) => {
1363
1489
  const r = new ct(e, t, this.element);
1364
- return this.appendOrInsert(r), new P(
1490
+ return this.appendOrInsert(r), new L(
1365
1491
  r,
1366
1492
  void 0,
1367
1493
  this.container,
@@ -1370,7 +1496,7 @@ class P {
1370
1496
  });
1371
1497
  i(this, "makeChildText", (e) => {
1372
1498
  const t = new at(e);
1373
- return this.appendOrInsert(t), new P(
1499
+ return this.appendOrInsert(t), new L(
1374
1500
  this.element,
1375
1501
  t,
1376
1502
  this.container,
@@ -1387,7 +1513,7 @@ class P {
1387
1513
  i(this, "makeRef", () => this.makeChildText(""));
1388
1514
  i(this, "makePortal", (e) => {
1389
1515
  const t = new Se(e, this.element);
1390
- return this.appendOrInsert(t), new P(
1516
+ return this.appendOrInsert(t), new L(
1391
1517
  t,
1392
1518
  void 0,
1393
1519
  this.container,
@@ -1401,7 +1527,7 @@ class P {
1401
1527
  * @param value - The provider to set for the given mark.
1402
1528
  * @returns A new `DOMContext` instance with the specified provider.
1403
1529
  */
1404
- i(this, "setProvider", (e, t, r) => new P(this.element, this.reference, this.container, {
1530
+ i(this, "setProvider", (e, t, r) => new L(this.element, this.reference, this.container, {
1405
1531
  ...this.providers,
1406
1532
  [e]: [t, r]
1407
1533
  }));
@@ -1435,12 +1561,12 @@ const ut = /* @__PURE__ */ new Set([
1435
1561
  "readonly",
1436
1562
  "required",
1437
1563
  "selected"
1438
- ]), ht = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), _e = (s) => (e) => e.makeChildText(s).clear, Ee = (s) => (e) => {
1564
+ ]), ht = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), _e = (s) => (e) => e.makeChildText(s).clear, we = (s) => (e) => {
1439
1565
  const t = e.makeChildText(s.value), r = s.on(t.setText);
1440
1566
  return (n) => {
1441
1567
  r(), t.clear(n);
1442
1568
  };
1443
- }, Rt = (s) => d.is(s) ? Ee(s) : _e(s), A = (...s) => (e) => {
1569
+ }, Rt = (s) => d.is(s) ? we(s) : _e(s), A = (...s) => (e) => {
1444
1570
  const t = s.map((r) => f(r)(e));
1445
1571
  return (r) => {
1446
1572
  t.forEach((n) => n(r));
@@ -1461,7 +1587,7 @@ const ut = /* @__PURE__ */ new Set([
1461
1587
  return n(e), (l) => {
1462
1588
  l && n(o);
1463
1589
  };
1464
- }, N = (s, e) => (t) => {
1590
+ }, $ = (s, e) => (t) => {
1465
1591
  const { get: r, set: n } = t.makeAccessors(s), o = r(), l = e.on(n);
1466
1592
  return (c) => {
1467
1593
  l(), c && n(o);
@@ -1482,7 +1608,7 @@ const ut = /* @__PURE__ */ new Set([
1482
1608
  */
1483
1609
  get: (s, e) => e === "class" ? (t) => d.is(t) ? dt(t) : ft(
1484
1610
  (t ?? "").split(" ").filter((r) => r.length > 0)
1485
- ) : (t) => d.is(t) ? N(
1611
+ ) : (t) => d.is(t) ? $(
1486
1612
  e,
1487
1613
  t
1488
1614
  ) : H(
@@ -1501,7 +1627,7 @@ const ut = /* @__PURE__ */ new Set([
1501
1627
  * @returns The renderable component for the specified attribute.
1502
1628
  *
1503
1629
  */
1504
- get: (s, e) => (t) => d.is(t) ? N(
1630
+ get: (s, e) => (t) => d.is(t) ? $(
1505
1631
  `data-${e}`,
1506
1632
  t
1507
1633
  ) : H(`data-${e}`, t)
@@ -1517,7 +1643,7 @@ const ut = /* @__PURE__ */ new Set([
1517
1643
  * @returns The renderable component for the specified attribute.
1518
1644
  *
1519
1645
  */
1520
- get: (s, e) => (t) => d.is(t) ? N(
1646
+ get: (s, e) => (t) => d.is(t) ? $(
1521
1647
  `aria-${e}`,
1522
1648
  t
1523
1649
  ) : H(
@@ -1536,7 +1662,7 @@ const ut = /* @__PURE__ */ new Set([
1536
1662
  * @returns The renderable component for the specified attribute.
1537
1663
  *
1538
1664
  */
1539
- get: (s, e) => (t) => d.is(t) ? N(
1665
+ get: (s, e) => (t) => d.is(t) ? $(
1540
1666
  e,
1541
1667
  t
1542
1668
  ) : H(
@@ -1554,7 +1680,7 @@ const ut = /* @__PURE__ */ new Set([
1554
1680
  * @returns The renderable component for the specified attribute.
1555
1681
  *
1556
1682
  */
1557
- get: (s, e) => (t) => d.is(t) ? N(
1683
+ get: (s, e) => (t) => d.is(t) ? $(
1558
1684
  e,
1559
1685
  t
1560
1686
  ) : H(
@@ -1570,11 +1696,11 @@ const ut = /* @__PURE__ */ new Set([
1570
1696
  if (typeof s == "string")
1571
1697
  return _e(s);
1572
1698
  if (d.is(s))
1573
- return Ee(s);
1699
+ return we(s);
1574
1700
  if (typeof s == "function")
1575
1701
  return s;
1576
1702
  throw new Error(`Unknown type: '${typeof s}' for child: ${s}`);
1577
- }, we = (s, ...e) => (t) => {
1703
+ }, Ee = (s, ...e) => (t) => {
1578
1704
  const r = t.makeChildElement(s, void 0), n = e.map((o) => f(o)(r));
1579
1705
  return (o) => {
1580
1706
  n.forEach((l) => l(!1)), r.clear(o);
@@ -1592,7 +1718,7 @@ const ut = /* @__PURE__ */ new Set([
1592
1718
  * @param tagName - The HTML tag name.
1593
1719
  * @returns A renderable function that creates and appends the HTML element to the DOM.
1594
1720
  */
1595
- get: (s, e) => (...t) => we(e, t.flatMap(f))
1721
+ get: (s, e) => (...t) => Ee(e, t.flatMap(f))
1596
1722
  }
1597
1723
  ), Wt = new Proxy(
1598
1724
  {},
@@ -1602,7 +1728,7 @@ const ut = /* @__PURE__ */ new Set([
1602
1728
  * @param type - The input type name.
1603
1729
  * @returns A renderable function that creates and appends the HTMLInput element to the DOM.
1604
1730
  */
1605
- get: (s, e) => (...t) => we("input", M.type(e), ...t)
1731
+ get: (s, e) => (...t) => Ee("input", M.type(e), ...t)
1606
1732
  }
1607
1733
  ), pt = "http://www.w3.org/2000/svg", Ut = new Proxy(
1608
1734
  {},
@@ -1744,14 +1870,14 @@ const ut = /* @__PURE__ */ new Set([
1744
1870
  };
1745
1871
  const t = Object.keys(s)[0];
1746
1872
  return f(e[t](U(s[t])));
1747
- }, Le = (s, e, t) => G(
1873
+ }, Pe = (s, e, t) => G(
1748
1874
  T.map(s, (r) => ({ [r[e]]: r })),
1749
1875
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1750
1876
  t
1751
- ), is = (s, e) => Le(s, "kind", e), os = (s, e) => {
1877
+ ), is = (s, e) => Pe(s, "kind", e), os = (s, e) => {
1752
1878
  const t = T.map(s, ([r, n]) => ({ [r]: n }));
1753
1879
  return G(t, e);
1754
- }, ls = (s, e) => Le(s, "type", e), St = (s, e) => G(
1880
+ }, ls = (s, e) => Pe(s, "type", e), St = (s, e) => G(
1755
1881
  T.map(s, (t) => ({ [t]: !0 })),
1756
1882
  e
1757
1883
  ), cs = (s, e = {}) => (t) => {
@@ -1774,7 +1900,7 @@ const ut = /* @__PURE__ */ new Set([
1774
1900
  let l = () => {
1775
1901
  }, c = !1, a = null;
1776
1902
  const u = r.on((h) => {
1777
- h == null ? (l(!0), l = f((t == null ? void 0 : t()) ?? _)(o), c = !1, a == null || a.dispose(), a = null) : (a == null ? a = w(h) : a.value = h, c || (l(!0), l = f(e(a))(
1903
+ h == null ? (l(!0), l = f((t == null ? void 0 : t()) ?? _)(o), c = !1, a == null || a.dispose(), a = null) : (a == null ? a = E(h) : a.value = h, c || (l(!0), l = f(e(a))(
1778
1904
  o
1779
1905
  ), c = !0));
1780
1906
  });
@@ -1802,10 +1928,10 @@ const ut = /* @__PURE__ */ new Set([
1802
1928
  (p) => d.is(p) ? p.value != null : p != null
1803
1929
  );
1804
1930
  let a = null;
1805
- const u = w(c.every((p) => p)), h = (p, m) => {
1931
+ const u = E(c.every((p) => p)), h = (p, m) => {
1806
1932
  if (p.value != null) {
1807
1933
  if (l[m] == null) {
1808
- const C = w(p.value);
1934
+ const C = E(p.value);
1809
1935
  l[m] = C;
1810
1936
  } else
1811
1937
  l[m].value = p.value;
@@ -1816,7 +1942,7 @@ const ut = /* @__PURE__ */ new Set([
1816
1942
  let g = s.length - 1;
1817
1943
  const y = s.map((p, m) => {
1818
1944
  if (!d.is(p)) {
1819
- const C = w(p);
1945
+ const C = E(p);
1820
1946
  return l[m] = C, () => {
1821
1947
  };
1822
1948
  }
@@ -1829,11 +1955,11 @@ const ut = /* @__PURE__ */ new Set([
1829
1955
  }), (p) => {
1830
1956
  l.forEach((m) => m == null ? void 0 : m.dispose()), u.dispose(), y.forEach((m) => m()), a == null || a(p), n.clear(p);
1831
1957
  };
1832
- }, Z = (...s) => (e) => (t) => s.forEach((r) => r(t, e)), Pe = (s, e, t) => _t(
1958
+ }, Z = (...s) => (e) => (t) => s.forEach((r) => r(t, e)), Le = (s, e, t) => _t(
1833
1959
  T.map(s, (r) => r ? !0 : null),
1834
1960
  e,
1835
1961
  t ?? void 0
1836
- ), hs = (s, e, t) => Pe(
1962
+ ), hs = (s, e, t) => Le(
1837
1963
  T.map(s, (r) => !r),
1838
1964
  e,
1839
1965
  t
@@ -1845,7 +1971,7 @@ const ut = /* @__PURE__ */ new Set([
1845
1971
  return A(
1846
1972
  Z(n.dispose),
1847
1973
  f(e(r)),
1848
- Pe(
1974
+ Le(
1849
1975
  r.isLast,
1850
1976
  () => _,
1851
1977
  () => t(n)
@@ -1913,27 +2039,27 @@ const ut = /* @__PURE__ */ new Set([
1913
2039
  ), gs = (s, e) => (t) => {
1914
2040
  const r = t.makePortal(s);
1915
2041
  return Q(f(e), r);
1916
- }, k = /* @__PURE__ */ new Map(), Et = (s) => ({
2042
+ }, N = /* @__PURE__ */ new Map(), wt = (s) => ({
1917
2043
  mark: Je(`Probe(${s.description})`),
1918
2044
  create: ({ callback: e = () => {
1919
2045
  }, timeout: t = 10 } = {}) => {
1920
2046
  const r = (c) => {
1921
- clearTimeout(n), k.delete(s), e(c);
2047
+ clearTimeout(n), N.delete(s), e(c);
1922
2048
  };
1923
- if (k.has(s))
2049
+ if (N.has(s))
1924
2050
  throw new Error(`Probe already exists: ${s.description}`);
1925
2051
  const n = setTimeout(() => r("timeout"), t), o = { counter: 0, timeoutId: n };
1926
- return k.set(s, o), {
2052
+ return N.set(s, o), {
1927
2053
  value: () => {
1928
2054
  clearTimeout(n);
1929
- const c = k.get(s);
2055
+ const c = N.get(s);
1930
2056
  c != null && --c.counter === 0 && r("resolved");
1931
2057
  },
1932
2058
  dispose: () => r("disposed"),
1933
2059
  onUse: () => o.counter++
1934
2060
  };
1935
2061
  }
1936
- }), ms = Et(Symbol("GlobalProbe")), wt = (s, e) => (t) => {
2062
+ }), ms = wt(Symbol("GlobalProbe")), Et = (s, e) => (t) => {
1937
2063
  const r = t.getStyle(s);
1938
2064
  return t.setStyle(s, e), (n) => {
1939
2065
  n && t.setStyle(s, r);
@@ -1954,7 +2080,7 @@ const ut = /* @__PURE__ */ new Set([
1954
2080
  * @returns The renderable component for the specified attribute.
1955
2081
  *
1956
2082
  */
1957
- get: (s, e) => (t) => d.is(t) ? Ct(e, t) : wt(e, t)
2083
+ get: (s, e) => (t) => d.is(t) ? Ct(e, t) : Et(e, t)
1958
2084
  }
1959
2085
  ), vt = (s) => (e) => {
1960
2086
  if (e.isBrowser()) {
@@ -1999,7 +2125,7 @@ const ut = /* @__PURE__ */ new Set([
1999
2125
  f(l),
2000
2126
  Z(() => o.forEach((c) => c()))
2001
2127
  )(r());
2002
- }, Ss = (s, e, t) => K(({ set: r }) => (r(s, e), t())), _s = (s, e) => K(({ use: t }) => e(t(s))), Es = (...s) => (e) => K(({ use: t }) => {
2128
+ }, Ss = (s, e, t) => K(({ set: r }) => (r(s, e), t())), _s = (s, e) => K(({ use: t }) => e(t(s))), ws = (...s) => (e) => K(({ use: t }) => {
2003
2129
  const r = s.map(t);
2004
2130
  return e(...r);
2005
2131
  });
@@ -2010,12 +2136,12 @@ export {
2010
2136
  ts as BindDateTime,
2011
2137
  ss as BindNumber,
2012
2138
  rs as BindText,
2013
- L as BrowserContext,
2139
+ P as BrowserContext,
2014
2140
  V as CLASS_PLACEHOLDER_ATTR,
2015
2141
  x as Computed,
2016
2142
  cs as Conjunction,
2017
2143
  as as DOMNode,
2018
- we as El,
2144
+ Ee as El,
2019
2145
  Ce as ElNS,
2020
2146
  Y as ElementPosition,
2021
2147
  _ as Empty,
@@ -2024,8 +2150,8 @@ export {
2024
2150
  fs as ForEach,
2025
2151
  A as Fragment,
2026
2152
  ms as GlobalProbe,
2027
- kt as HeadlessAdapter,
2028
- P as HeadlessContext,
2153
+ Nt as HeadlessAdapter,
2154
+ L as HeadlessContext,
2029
2155
  ct as HeadlessElement,
2030
2156
  Se as HeadlessPortal,
2031
2157
  at as HeadlessText,
@@ -2035,7 +2161,7 @@ export {
2035
2161
  mt as OnChecked,
2036
2162
  Z as OnDispose,
2037
2163
  G as OneOf,
2038
- Le as OneOfField,
2164
+ Pe as OneOfField,
2039
2165
  is as OneOfKind,
2040
2166
  os as OneOfTuple,
2041
2167
  ls as OneOfType,
@@ -2051,9 +2177,9 @@ export {
2051
2177
  Rt as TextNode,
2052
2178
  hs as Unless,
2053
2179
  _s as Use,
2054
- Es as UseMany,
2180
+ ws as UseMany,
2055
2181
  T as Value,
2056
- Pe as When,
2182
+ Le as When,
2057
2183
  vt as WithBrowserCtx,
2058
2184
  Ts as WithCtx,
2059
2185
  bs as WithElement,
@@ -2065,7 +2191,7 @@ export {
2065
2191
  We as _makeGetter,
2066
2192
  Be as _makeSetter,
2067
2193
  R as _removeDOMNode,
2068
- Ee as _signalText,
2194
+ we as _signalText,
2069
2195
  _e as _staticText,
2070
2196
  Ot as animateSignal,
2071
2197
  Fe as animateSignals,
@@ -2076,7 +2202,7 @@ export {
2076
2202
  Ht as computedRecord,
2077
2203
  Vt as dataAttr,
2078
2204
  je as effect,
2079
- Pt as effectOf,
2205
+ Lt as effectOf,
2080
2206
  zt as emitChecked,
2081
2207
  Qt as emitPreventDefault,
2082
2208
  Kt as emitStopImmediatePropagation,
@@ -2092,22 +2218,22 @@ export {
2092
2218
  Re as guessInterpolate,
2093
2219
  Bt as html,
2094
2220
  Wt as input,
2095
- ke as interpolateDate,
2096
- Ne as interpolateNumber,
2097
- $e as interpolateString,
2098
- Lt as joinSignals,
2221
+ Ne as interpolateDate,
2222
+ $e as interpolateNumber,
2223
+ ke as interpolateString,
2224
+ Pt as joinSignals,
2099
2225
  Dt as localStorageProp,
2100
- Et as makeProbe,
2226
+ wt as makeProbe,
2101
2227
  Je as makeProviderMark,
2102
2228
  Jt as math,
2103
2229
  Ft as mathAttr,
2104
2230
  J as on,
2105
- w as prop,
2106
- Nt as render,
2231
+ E as prop,
2232
+ $t as render,
2107
2233
  Q as renderWithContext,
2108
2234
  f as renderableOfTNode,
2109
2235
  It as restoreTempoPlaceholders,
2110
- $t as runHeadless,
2236
+ kt as runHeadless,
2111
2237
  Mt as sessionStorageProp,
2112
2238
  U as signal,
2113
2239
  ae as storedProp,