@tempots/beatui 1.4.0 → 1.5.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 (66) hide show
  1. package/dist/auth/index.cjs.js +1 -1
  2. package/dist/auth/index.es.js +1 -1
  3. package/dist/{auth-divider-D_3gKZ6g.js → auth-divider-BIATan1F.js} +3 -3
  4. package/dist/{auth-divider-itm5-j5G.cjs → auth-divider-CVKfA8Cp.cjs} +1 -1
  5. package/dist/beatui.css +393 -36
  6. package/dist/beatui.tailwind.css +393 -36
  7. package/dist/better-auth/index.cjs.js +1 -1
  8. package/dist/better-auth/index.es.js +2 -2
  9. package/dist/deep-merge-B33Qtlmw.cjs +1 -0
  10. package/dist/{deep-merge-CzZVsVF-.js → deep-merge-BUsrE2v4.js} +130 -130
  11. package/dist/{duration-input-BrYLC1js.cjs → duration-input-C5il_E0F.cjs} +1 -1
  12. package/dist/{duration-input-CFu6vq-y.js → duration-input-DoCCrqOG.js} +1 -1
  13. package/dist/index.cjs.js +4 -4
  14. package/dist/index.es.js +5609 -5130
  15. package/dist/json-schema/index.cjs.js +1 -1
  16. package/dist/json-schema/index.es.js +107 -107
  17. package/dist/json-structure/index.cjs.js +1 -1
  18. package/dist/json-structure/index.es.js +3 -3
  19. package/dist/{modal-YKqlh4Dk.js → modal-BHlp4QeT.js} +1 -1
  20. package/dist/{modal-DCxNGrzk.cjs → modal-BmpfNL48.cjs} +1 -1
  21. package/dist/{notice-Q0A1gIho.cjs → notice-BBnSXYUc.cjs} +1 -1
  22. package/dist/{notice-Du3tWJTW.js → notice-BXKtBEiC.js} +1 -1
  23. package/dist/types/components/data/data-table-context.d.ts +9 -1
  24. package/dist/types/components/data/data-table-row-details.d.ts +21 -0
  25. package/dist/types/components/data/data-table-types.d.ts +23 -0
  26. package/dist/types/components/data/index.d.ts +1 -0
  27. package/dist/types/components/form/control/control.d.ts +5 -5
  28. package/dist/types/components/form/control/list-control.d.ts +11 -11
  29. package/dist/types/components/form/fieldset/fieldset.d.ts +60 -0
  30. package/dist/types/components/form/fieldset/index.d.ts +1 -0
  31. package/dist/types/components/form/index.d.ts +1 -0
  32. package/dist/types/components/form/input/combobox-input.d.ts +2 -2
  33. package/dist/types/components/form/input/combobox-tags-input.d.ts +1 -1
  34. package/dist/types/components/form/input/date-time-input.d.ts +1 -1
  35. package/dist/types/components/form/input/dropdown-input.d.ts +2 -2
  36. package/dist/types/components/form/input/field-layout.d.ts +64 -0
  37. package/dist/types/components/form/input/{input-wrapper.d.ts → field.d.ts} +23 -14
  38. package/dist/types/components/form/input/index.d.ts +2 -1
  39. package/dist/types/components/form/input/multi-select.d.ts +2 -2
  40. package/dist/types/components/form/input/native-select.d.ts +1 -1
  41. package/dist/types/components/form/input/range-slider.d.ts +19 -2
  42. package/dist/types/components/form/input/select-tags-input.d.ts +1 -1
  43. package/dist/types/components/format/format-bigint.d.ts +64 -0
  44. package/dist/types/components/format/format-date-time.d.ts +54 -0
  45. package/dist/types/components/format/format-date.d.ts +82 -0
  46. package/dist/types/components/format/format-display-name.d.ts +70 -0
  47. package/dist/types/components/format/format-file-size.d.ts +30 -0
  48. package/dist/types/components/format/format-list.d.ts +61 -0
  49. package/dist/types/components/format/format-number.d.ts +88 -0
  50. package/dist/types/components/format/format-plural.d.ts +96 -0
  51. package/dist/types/components/format/format-relative-time.d.ts +62 -0
  52. package/dist/types/components/format/format-time.d.ts +66 -0
  53. package/dist/types/components/format/index.d.ts +11 -0
  54. package/dist/types/components/i18n/locale-selector.d.ts +1 -1
  55. package/dist/types/components/json-schema/controls/composition-shared.d.ts +1 -1
  56. package/dist/types/components/json-schema/controls/shared-utils.d.ts +3 -3
  57. package/dist/types/components/json-schema/widgets/string-controls.d.ts +2 -2
  58. package/dist/types/components/json-schema-display/display-wrapper.d.ts +1 -1
  59. package/dist/types/index.d.ts +1 -0
  60. package/dist/use-form-CP6nftVl.cjs +2 -0
  61. package/dist/{use-form-D_TJyZhP.js → use-form-CmQdxpOi.js} +474 -434
  62. package/dist/{widget-customization-DELy3SMQ.cjs → widget-customization-B0y-eesp.cjs} +1 -1
  63. package/dist/{widget-customization-BAchyOUo.js → widget-customization-CKbR4Dsg.js} +2 -2
  64. package/package.json +1 -1
  65. package/dist/deep-merge-Bydz6jLt.cjs +0 -1
  66. package/dist/use-form-BvBkVEKi.cjs +0 -2
@@ -1,313 +1,351 @@
1
- import { computedOf as k, html as m, attr as c, Value as C, Empty as T, When as A, dataAttr as P, aria as x, Use as q, coalesce as G, on as E, TextNode as J, prop as w, Fragment as $, emitValueAsNumber as Q, emitValue as X } from "@tempots/dom";
2
- import { B as Y, I as L } from "./translations-DT5QQ4WO.js";
3
- import { B as Z, I as ee } from "./input-container-CO3DNqpp.js";
4
- import { L as te, M as se } from "./stack-BLMteGTn.js";
5
- import { s as j } from "./session-id-3KiilioY.js";
6
- import { Validation as g, strictEqual as V } from "@tempots/std";
7
- const ne = m.span(
8
- c.class("bc-input-wrapper__required"),
9
- " *"
10
- );
11
- function ie(s) {
12
- const e = ["bc-input-wrapper"];
13
- return s !== "vertical" && e.push(`bc-input-wrapper--${s}`), e.join(" ");
1
+ import { ProviderNotFoundError as ee, makeProviderMark as te, Provide as se, Use as N, html as b, attr as c, computedOf as v, Value as T, Empty as _, When as x, dataAttr as W, aria as S, coalesce as ie, on as F, TextNode as ne, prop as D, Fragment as P, emitValueAsNumber as ae, emitValue as le } from "@tempots/dom";
2
+ import { B as re, I as U } from "./translations-DT5QQ4WO.js";
3
+ import { B as oe, I as ce } from "./input-container-CO3DNqpp.js";
4
+ import { L as de, M as he } from "./stack-BLMteGTn.js";
5
+ import { s as B } from "./session-id-3KiilioY.js";
6
+ import { Validation as g, strictEqual as M } from "@tempots/std";
7
+ const ue = {
8
+ layout: "vertical",
9
+ labelWidth: "7.5rem",
10
+ size: "md",
11
+ gap: "md",
12
+ columns: 1,
13
+ minFieldWidth: "15rem",
14
+ compact: !1
15
+ }, j = {
16
+ mark: te("FieldLayout"),
17
+ create: (s = {}, e) => {
18
+ let t = ue;
19
+ try {
20
+ t = e.getProvider(j.mark).value;
21
+ } catch (n) {
22
+ if (!(n instanceof ee))
23
+ throw n;
24
+ }
25
+ return { value: {
26
+ layout: s.layout ?? t.layout,
27
+ labelWidth: s.labelWidth ?? t.labelWidth,
28
+ size: s.size ?? t.size,
29
+ gap: s.gap ?? t.gap,
30
+ columns: s.columns ?? t.columns,
31
+ minFieldWidth: s.minFieldWidth ?? t.minFieldWidth,
32
+ compact: s.compact ?? t.compact
33
+ }, dispose: () => {
34
+ } };
35
+ }
36
+ }, pe = b.span(c.class("bc-field__required"), " *");
37
+ function fe(s, e) {
38
+ const t = ["bc-field"];
39
+ return s !== "vertical" && t.push(`bc-field--${s}`), e && t.push("bc-field--compact"), t.join(" ");
14
40
  }
15
- function re(s, e) {
16
- const t = ["bc-input-wrapper__label-text"];
17
- return s ? t.push("bc-input-wrapper__label-text--error") : e ? t.push("bc-input-wrapper__label-text--disabled") : t.push("bc-input-wrapper__label-text--default"), t.join(" ");
41
+ function me(s, e) {
42
+ const t = ["bc-field__label-text"];
43
+ return s ? t.push("bc-field__label-text--error") : e ? t.push("bc-field__label-text--disabled") : t.push("bc-field__label-text--default"), t.join(" ");
18
44
  }
19
- function ae(s, e) {
20
- if (s === "horizontal-fixed" && e != null)
21
- return `--input-wrapper-label-width: ${e}`;
45
+ function be(s, e, t) {
46
+ const i = [];
47
+ return (s === "horizontal-fixed" || s === "horizontal-end" || s === "responsive") && e != null && i.push(`--field-label-width: ${e}`), t != null && t > 0 && i.push(`grid-column: span ${t}`), i.length > 0 ? i.join("; ") : void 0;
22
48
  }
23
- const z = ({
24
- fullWidth: s = !1,
25
- required: e,
26
- label: t,
27
- labelChildren: n,
28
- context: i,
29
- description: o,
30
- content: a,
31
- error: r,
32
- labelFor: l,
33
- hasError: d,
34
- disabled: u,
35
- layout: p,
36
- labelWidth: v
37
- }, ...y) => {
38
- const f = d ?? r != null, h = u ?? !1, D = p ?? "vertical", I = j("input-wrapper"), S = o ? `${I}-description` : void 0, O = r != null ? `${I}-error` : void 0, H = k(D)((b) => b !== "vertical"), K = k(
39
- D,
40
- v ?? void 0
41
- )((b, M) => ae(b, M));
42
- return m.div(
43
- c.class(C.map(D, (b) => ie(b))),
49
+ function ge(s, e, t) {
50
+ const {
51
+ fullWidth: i = !1,
52
+ required: n,
53
+ label: r,
54
+ labelChildren: l,
55
+ context: a,
56
+ description: o,
57
+ content: u,
58
+ error: h,
59
+ labelFor: p,
60
+ hasError: y,
61
+ disabled: k,
62
+ span: m
63
+ } = e, d = y ?? h != null, w = k ?? !1, I = e.layout ?? s.layout, G = e.labelWidth ?? s.labelWidth, J = e.compact ?? s.compact, L = B("input-wrapper"), V = o ? `${L}-description` : void 0, O = h != null ? `${L}-error` : void 0, $ = v(I)(
64
+ (f) => f !== "vertical" && f !== "responsive"
65
+ ), Q = v(
66
+ I,
67
+ G,
68
+ m ?? void 0
69
+ )(
70
+ (f, C, Z) => be(f, T.get(C), Z)
71
+ ), X = v(
72
+ I,
73
+ J
74
+ )((f, C) => fe(f, C ?? !1));
75
+ return b.div(
76
+ c.class(X),
44
77
  c.class(
45
- C.map(
46
- s,
47
- (b) => b ? "bc-input-wrapper--full-width" : ""
48
- )
78
+ T.map(i, (f) => f ? "bc-field--full-width" : "")
49
79
  ),
50
- c.style(K),
51
- t != null || i != null ? m.div(
52
- c.class("bc-input-wrapper__header"),
53
- m.div(
54
- c.class("bc-input-wrapper__label-section"),
55
- m.label(
56
- c.class("bc-input-wrapper__label"),
57
- l != null ? c.for(l) : T,
58
- m.span(
80
+ c.style(Q),
81
+ r != null || a != null ? b.div(
82
+ c.class("bc-field__header"),
83
+ b.div(
84
+ c.class("bc-field__label-section"),
85
+ b.label(
86
+ c.class("bc-field__label"),
87
+ p != null ? c.for(p) : _,
88
+ b.span(
59
89
  c.class(
60
- k(
61
- f,
62
- h
90
+ v(
91
+ d,
92
+ w
63
93
  )(
64
- (b, M) => re(
65
- b ?? !1,
66
- M ?? !1
94
+ (f, C) => me(
95
+ f ?? !1,
96
+ C ?? !1
67
97
  )
68
98
  )
69
99
  ),
70
- t
100
+ r
71
101
  ),
72
- t != null && e ? ne : T
102
+ r != null && n ? pe : _
73
103
  ),
74
104
  // Show description under label when horizontal
75
- A(
76
- k(
77
- H,
105
+ x(
106
+ v(
107
+ $,
78
108
  o
79
- )((b, M) => b && M != null),
80
- () => m.div(
109
+ )((f, C) => f && C != null),
110
+ () => b.div(
81
111
  c.class(
82
- "bc-input-wrapper__description bc-input-wrapper__description--under-label"
112
+ "bc-field__description bc-field__description--under-label"
83
113
  ),
84
- c.id(S),
114
+ c.id(V),
85
115
  o
86
116
  )
87
117
  )
88
118
  ),
89
- i != null ? te(i) : T,
90
- n
91
- ) : T,
92
- m.div(
93
- c.class("bc-input-wrapper__content"),
119
+ a != null ? de(a) : _,
120
+ l
121
+ ) : _,
122
+ b.div(
123
+ c.class("bc-field__content"),
94
124
  // Add data attributes to help inputs inherit accessibility information
95
- [S, O].filter(Boolean).length > 0 ? P(
125
+ [V, O].filter(Boolean).length > 0 ? W(
96
126
  "describedby",
97
- [S, O].filter(Boolean).join(" ")
98
- ) : T,
99
- e ? P("required", "true") : T,
100
- A(f, () => P("invalid", "true")),
101
- a
127
+ [V, O].filter(Boolean).join(" ")
128
+ ) : _,
129
+ n ? W("required", "true") : _,
130
+ x(d, () => W("invalid", "true")),
131
+ u
102
132
  ),
103
133
  // Show description at bottom only when not horizontal
104
- A(
105
- k(H, o)((b, M) => !b && M != null),
106
- () => m.div(
107
- c.class("bc-input-wrapper__description"),
108
- c.id(S),
134
+ x(
135
+ v($, o)((f, C) => !f && C != null),
136
+ () => b.div(
137
+ c.class("bc-field__description"),
138
+ c.id(V),
109
139
  o
110
140
  )
111
141
  ),
112
- A(
113
- f,
114
- () => m.div(
115
- c.class("bc-input-wrapper__error"),
142
+ x(
143
+ d,
144
+ () => b.div(
145
+ c.class("bc-field__error"),
116
146
  c.id(O),
117
- x.live("polite"),
147
+ S.live("polite"),
118
148
  // Announce errors to screen readers
119
149
  c.role("alert"),
120
150
  // Mark as alert for immediate attention
121
- r
151
+ h
122
152
  )
123
153
  ),
124
- ...y
154
+ ...t
155
+ );
156
+ }
157
+ const q = (s, ...e) => {
158
+ const t = {};
159
+ return s.layout !== void 0 && (t.layout = s.layout), s.labelWidth !== void 0 && (t.labelWidth = s.labelWidth), s.compact !== void 0 && (t.compact = s.compact), se(
160
+ j,
161
+ t,
162
+ () => N(j, (i) => ge(i, s, e))
125
163
  );
126
164
  };
127
- function De({
165
+ function Ae({
128
166
  size: s = "sm",
129
167
  icon: e = "line-md:close",
130
168
  disabled: t,
131
- roundedness: n = "full",
132
- color: i = "base",
133
- onClick: o,
134
- label: a
135
- }, ...r) {
136
- return q(Y, (l) => {
137
- const d = G(a, l.$.closeModal);
138
- return Z(
169
+ roundedness: i = "full",
170
+ color: n = "base",
171
+ onClick: r,
172
+ label: l
173
+ }, ...a) {
174
+ return N(re, (o) => {
175
+ const u = ie(l, o.$.closeModal);
176
+ return oe(
139
177
  {
140
178
  variant: "text",
141
179
  size: s,
142
- roundedness: n,
180
+ roundedness: i,
143
181
  disabled: t,
144
- color: i,
145
- onClick: o
182
+ color: n,
183
+ onClick: r
146
184
  },
147
- c.title(d),
148
- x.label(d),
149
- ...r,
150
- L({ icon: e, size: s ?? "sm" })
185
+ c.title(u),
186
+ S.label(u),
187
+ ...a,
188
+ U({ icon: e, size: s ?? "sm" })
151
189
  );
152
190
  });
153
191
  }
154
- const Ce = (s) => {
192
+ const Be = (s) => {
155
193
  const {
156
194
  value: e,
157
195
  onBlur: t,
158
- onChange: n,
159
- onInput: i,
160
- placeholder: o,
161
- disabled: a,
162
- id: r,
163
- activeIcon: l,
164
- inactiveIcon: d,
165
- size: u = "md"
166
- } = s, p = r ?? j("checkbox"), v = `${p}-label`, y = () => {
167
- if (C.get(a ?? !1)) return;
168
- const h = C.get(e);
169
- n?.(!h), i?.(!h);
170
- }, f = (h) => {
171
- C.get(a ?? !1) || (h.key === " " || h.key === "Enter") && (h.preventDefault(), y());
196
+ onChange: i,
197
+ onInput: n,
198
+ placeholder: r,
199
+ disabled: l,
200
+ id: a,
201
+ activeIcon: o,
202
+ inactiveIcon: u,
203
+ size: h = "md"
204
+ } = s, p = a ?? B("checkbox"), y = `${p}-label`, k = () => {
205
+ if (T.get(l ?? !1)) return;
206
+ const d = T.get(e);
207
+ i?.(!d), n?.(!d);
208
+ }, m = (d) => {
209
+ T.get(l ?? !1) || (d.key === " " || d.key === "Enter") && (d.preventDefault(), k());
172
210
  };
173
- return ee(
211
+ return ce(
174
212
  {
175
213
  baseContainer: !0,
176
214
  growInput: !1,
177
215
  ...s,
178
- input: m.span(
216
+ input: b.span(
179
217
  c.class("bc-checkbox-input"),
180
- m.span(
218
+ b.span(
181
219
  c.class("bc-checkbox-input__checkbox"),
182
220
  c.class(
183
- C.map(
221
+ T.map(
184
222
  e,
185
- (h) => h ? "bc-checkbox-input__checkbox--checked" : "bc-checkbox-input__checkbox--unchecked"
223
+ (d) => d ? "bc-checkbox-input__checkbox--checked" : "bc-checkbox-input__checkbox--unchecked"
186
224
  )
187
225
  ),
188
226
  c.class(
189
- C.map(
190
- a ?? !1,
191
- (h) => h ? "bc-checkbox-input__checkbox--disabled" : ""
227
+ T.map(
228
+ l ?? !1,
229
+ (d) => d ? "bc-checkbox-input__checkbox--disabled" : ""
192
230
  )
193
231
  ),
194
232
  c.id(p),
195
233
  c.role("checkbox"),
196
234
  c.tabindex(
197
- C.map(
198
- a ?? !1,
199
- (h) => h ? -1 : 0
235
+ T.map(
236
+ l ?? !1,
237
+ (d) => d ? -1 : 0
200
238
  )
201
239
  ),
202
- x.checked(e),
203
- x.disabled(a),
204
- o != null ? x.labelledby(v) : T,
205
- E.keydown(f),
206
- t != null ? E.blur(t) : T,
207
- L({
208
- icon: k(
240
+ S.checked(e),
241
+ S.disabled(l),
242
+ r != null ? S.labelledby(y) : _,
243
+ F.keydown(m),
244
+ t != null ? F.blur(t) : _,
245
+ U({
246
+ icon: v(
209
247
  e,
210
- l,
211
- d
248
+ o,
249
+ u
212
250
  )(
213
- (h, D, I) => h ? D ?? "ri:checkbox-fill" : I ?? "mdi:checkbox-blank-outline"
251
+ (d, w, I) => d ? w ?? "ri:checkbox-fill" : I ?? "mdi:checkbox-blank-outline"
214
252
  ),
215
253
  accessibility: "decorative",
216
- size: u
254
+ size: h
217
255
  })
218
256
  ),
219
- o != null ? m.label(
257
+ r != null ? b.label(
220
258
  c.class("bc-checkbox-input__label"),
221
- c.id(v),
259
+ c.id(y),
222
260
  c.for(p),
223
- se(o)
224
- ) : T
261
+ he(r)
262
+ ) : _
225
263
  )
226
264
  },
227
- E.click(y)
265
+ F.click(k)
228
266
  );
229
- }, oe = (
267
+ }, ve = (
230
268
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
231
269
  ((s, e) => () => {
232
270
  s.markTouched(), e?.();
233
271
  })
234
- ), F = (s, e) => (t) => {
272
+ ), z = (s, e) => (t) => {
235
273
  s.change(t), e?.(t);
236
274
  };
237
- function W(s, e) {
238
- const { controller: t, onBlur: n, onChange: i, id: o, triggerOn: a, ...r } = e;
275
+ function R(s, e) {
276
+ const { controller: t, onBlur: i, onChange: n, id: r, triggerOn: l, ...a } = e;
239
277
  return s({
240
- id: o ?? t.name,
278
+ id: r ?? t.name,
241
279
  disabled: t.disabled,
242
280
  value: t.signal,
243
281
  hasError: t.errorVisible,
244
282
  name: t.name,
245
- ...r,
246
- onInput: a === "input" ? F(t, i) : void 0,
247
- onChange: a !== "input" ? F(t, i) : void 0,
248
- onBlur: oe(t, n)
283
+ ...a,
284
+ onInput: l === "input" ? z(t, n) : void 0,
285
+ onChange: l !== "input" ? z(t, n) : void 0,
286
+ onBlur: ve(t, i)
249
287
  });
250
288
  }
251
- function Te(s, { id: e, labelFor: t, ...n }, ...i) {
252
- const o = e ?? n.controller.name ?? j("control"), a = t ?? o;
253
- return z(
289
+ function Oe(s, { id: e, labelFor: t, ...i }, ...n) {
290
+ const r = e ?? i.controller.name ?? B("control"), l = t ?? r;
291
+ return q(
254
292
  {
255
- ...n,
256
- hasError: n.controller.errorVisible,
293
+ ...i,
294
+ hasError: i.controller.errorVisible,
257
295
  // TODO: Remove Primitive annotation once @tempots/dom TextNode is generic
258
- error: J(n.controller.error.map((r) => r ?? "")),
259
- labelFor: a,
260
- content: W(
261
- (r) => s({ ...r, id: o }),
262
- n
296
+ error: ne(i.controller.error.map((a) => a ?? "")),
297
+ labelFor: l,
298
+ content: R(
299
+ (a) => s({ ...a, id: r }),
300
+ i
263
301
  )
264
302
  },
265
- ...i
303
+ ...n
266
304
  );
267
305
  }
268
- function le(s, e) {
269
- const { toInput: t, fromInput: n, controller: i, ...o } = e, a = i.transform(t, n);
270
- return W(s, {
271
- ...o,
272
- controller: a
306
+ function ye(s, e) {
307
+ const { toInput: t, fromInput: i, controller: n, ...r } = e, l = n.transform(t, i);
308
+ return R(s, {
309
+ ...r,
310
+ controller: l
273
311
  });
274
312
  }
275
- function _e(s, {
313
+ function We(s, {
276
314
  id: e,
277
315
  labelFor: t,
278
- ...n
279
- }, ...i) {
280
- const o = e ?? n.controller.name ?? j("control");
281
- return z(
316
+ ...i
317
+ }, ...n) {
318
+ const r = e ?? i.controller.name ?? B("control");
319
+ return q(
282
320
  {
283
- ...n,
284
- labelFor: t ?? o,
285
- content: le(s, {
286
- ...n,
287
- id: o
321
+ ...i,
322
+ labelFor: t ?? r,
323
+ content: ye(s, {
324
+ ...i,
325
+ id: r
288
326
  })
289
327
  },
290
- ...i
328
+ ...n
291
329
  );
292
330
  }
293
- function Ie(s) {
331
+ function je(s) {
294
332
  return s.split(".").map((t) => {
295
- const n = t.match(/^\[(\d+)\]$/);
296
- return n ? Number(n[1]) : t;
333
+ const i = t.match(/^\[(\d+)\]$/);
334
+ return i ? Number(i[1]) : t;
297
335
  });
298
336
  }
299
- function ce(s) {
337
+ function ke(s) {
300
338
  return typeof s == "number" ? `[${s}]` : `.${s}`;
301
339
  }
302
- function he(s) {
340
+ function De(s) {
303
341
  if (s.length === 0) return "";
304
342
  const [e, ...t] = s;
305
343
  return [
306
344
  typeof e == "number" ? `[${e}]` : e,
307
- ...t.map(ce)
345
+ ...t.map(ke)
308
346
  ].join("");
309
347
  }
310
- const Me = {
348
+ const Pe = {
311
349
  /** A valid validation result */
312
350
  valid: g.valid,
313
351
  /**
@@ -322,8 +360,8 @@ const Me = {
322
360
  */
323
361
  invalidFields(s) {
324
362
  const e = {};
325
- for (const [t, n] of Object.entries(s))
326
- e[t] = typeof n == "string" ? { message: n } : n;
363
+ for (const [t, i] of Object.entries(s))
364
+ e[t] = typeof i == "string" ? { message: i } : i;
327
365
  return g.invalid({ dependencies: e });
328
366
  },
329
367
  /**
@@ -333,16 +371,16 @@ const Me = {
333
371
  return g.invalid(s);
334
372
  }
335
373
  };
336
- function B(s) {
374
+ function A(s) {
337
375
  return function(t) {
338
376
  if (t.type === "valid") return t;
339
- let n = t.error;
340
- for (const i of s)
341
- if (n = n?.dependencies?.[i], n == null) return g.valid;
342
- return g.invalid(n);
377
+ let i = t.error;
378
+ for (const n of s)
379
+ if (i = i?.dependencies?.[n], i == null) return g.valid;
380
+ return g.invalid(i);
343
381
  };
344
382
  }
345
- class _ {
383
+ class E {
346
384
  /** The path segments identifying this controller's position in the form hierarchy (e.g., ['user', 'email']). */
347
385
  path;
348
386
  /** Callback to propagate value changes up to the parent form. */
@@ -364,16 +402,16 @@ class _ {
364
402
  /** Reactive signal containing nested field errors for child controllers. */
365
403
  dependencyErrors;
366
404
  #e = {
367
- disabled: w(!1),
368
- touched: w(!1)
405
+ disabled: D(!1),
406
+ touched: D(!1)
369
407
  };
370
408
  #s;
371
- #t = w(void 0);
409
+ #t = D(void 0);
372
410
  /** Parent controller context providing disabled state and optional validation mode. */
373
411
  parent;
374
412
  /** Reactive signal indicating whether this field is disabled (combines local and parent disabled state). */
375
413
  disabled;
376
- #n = [];
414
+ #i = [];
377
415
  /** Reactive signal indicating whether this field is disabled OR has errors (useful for submit button state). */
378
416
  disabledOrHasErrors;
379
417
  /**
@@ -386,28 +424,28 @@ class _ {
386
424
  * @param parent - Parent context with disabled state and optional validation mode
387
425
  * @param equals - Equality function for dirty tracking (defaults to strictEqual)
388
426
  */
389
- constructor(e, t, n, i, o, a = V) {
390
- this.path = e, this.change = t, this.signal = n, this.status = i, this.#s = a, this.#t.set(n.value), this.error = i.map(
391
- (r) => r?.type === "invalid" ? r.error?.message : void 0
392
- ), this.hasError = this.error.map((r) => r != null), this.touched = this.#e.touched, o.validationMode ? this.errorVisible = k(
427
+ constructor(e, t, i, n, r, l = M) {
428
+ this.path = e, this.change = t, this.signal = i, this.status = n, this.#s = l, this.#t.set(i.value), this.error = n.map(
429
+ (a) => a?.type === "invalid" ? a.error?.message : void 0
430
+ ), this.hasError = this.error.map((a) => a != null), this.touched = this.#e.touched, r.validationMode ? this.errorVisible = v(
393
431
  this.hasError,
394
432
  this.touched,
395
- o.validationMode
396
- )((r, l, d) => d === "eager" ? !!r : !!r && !!l) : this.errorVisible = k(
433
+ r.validationMode
434
+ )((a, o, u) => u === "eager" ? !!a : !!a && !!o) : this.errorVisible = v(
397
435
  this.hasError,
398
436
  this.touched
399
- )((r, l) => !!r && !!l), this.dirty = k(
437
+ )((a, o) => !!a && !!o), this.dirty = v(
400
438
  this.signal,
401
439
  this.#t
402
- )((r, l) => !this.#s(r, l)), this.dependencyErrors = i.map(
403
- (r) => r?.type === "invalid" ? r.error?.dependencies : void 0
404
- ), this.parent = o, this.disabled = k(
440
+ )((a, o) => !this.#s(a, o)), this.dependencyErrors = n.map(
441
+ (a) => a?.type === "invalid" ? a.error?.dependencies : void 0
442
+ ), this.parent = r, this.disabled = v(
405
443
  this.#e.disabled,
406
- o.disabled
407
- )((r, l) => r || l), this.disabledOrHasErrors = k(
444
+ r.disabled
445
+ )((a, o) => a || o), this.disabledOrHasErrors = v(
408
446
  this.disabled,
409
447
  this.hasError
410
- )((r, l) => r || l), this.onDispose(() => {
448
+ )((a, o) => a || o), this.onDispose(() => {
411
449
  this.#e.disabled.dispose(), this.#e.touched.dispose(), this.disabled.dispose(), this.error.dispose(), this.errorVisible.dispose(), this.dirty.dispose(), this.#t.dispose(), this.dependencyErrors.dispose(), this.disabledOrHasErrors.dispose();
412
450
  });
413
451
  }
@@ -415,7 +453,7 @@ class _ {
415
453
  * Returns the field name as a dot-separated string (e.g., "user.email").
416
454
  */
417
455
  get name() {
418
- return he(this.path);
456
+ return De(this.path);
419
457
  }
420
458
  /**
421
459
  * Registers a callback to be executed when this controller is disposed.
@@ -423,20 +461,20 @@ class _ {
423
461
  * @param callback - Function to execute on disposal
424
462
  */
425
463
  onDispose = (e) => {
426
- this.#n.push(e);
464
+ this.#i.push(e);
427
465
  };
428
466
  /**
429
467
  * Disposes all internal resources and registered callbacks.
430
468
  * Should be called when the controller is no longer needed to prevent memory leaks.
431
469
  */
432
470
  dispose = () => {
433
- for (const e of this.#n)
471
+ for (const e of this.#i)
434
472
  try {
435
473
  e();
436
474
  } catch (t) {
437
475
  console.error("Error in dispose callback:", t);
438
476
  }
439
- this.#n.length = 0;
477
+ this.#i.length = 0;
440
478
  };
441
479
  /**
442
480
  * Sets the disabled state for this field.
@@ -484,7 +522,7 @@ class _ {
484
522
  * @param equals - Equality function for array comparison (defaults to strictEqual)
485
523
  * @returns An ArrayController instance
486
524
  */
487
- array = (e = V) => new de(
525
+ array = (e = M) => new Te(
488
526
  this.path,
489
527
  this.change,
490
528
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -499,7 +537,7 @@ class _ {
499
537
  * @param equals - Equality function for object comparison (defaults to strictEqual)
500
538
  * @returns An ObjectController instance
501
539
  */
502
- object = (e = V) => new ue(
540
+ object = (e = M) => new Ce(
503
541
  this.path,
504
542
  this.change,
505
543
  this.signal,
@@ -527,13 +565,13 @@ class _ {
527
565
  * )
528
566
  * ```
529
567
  */
530
- transform = (e, t, n = [], i = V) => new _(
531
- [...this.path, ...n],
532
- (o) => this.change(t(o)),
533
- this.signal.map(e, i),
534
- this.status.map(B(n)),
568
+ transform = (e, t, i = [], n = M) => new E(
569
+ [...this.path, ...i],
570
+ (r) => this.change(t(r)),
571
+ this.signal.map(e, n),
572
+ this.status.map(A(i)),
535
573
  this.parent,
536
- i
574
+ n
537
575
  );
538
576
  /**
539
577
  * Creates a transformed controller with async bidirectional mapping.
@@ -547,62 +585,62 @@ class _ {
547
585
  * @param equals - Equality function for the transformed type
548
586
  * @returns A new Controller instance managing the async-transformed value
549
587
  */
550
- asyncTransform = (e, t, n, i = [], o = V) => new _(
551
- [...this.path, ...i],
552
- (a) => {
553
- t(a).then((r) => this.change(r));
588
+ asyncTransform = (e, t, i, n = [], r = M) => new E(
589
+ [...this.path, ...n],
590
+ (l) => {
591
+ t(l).then((a) => this.change(a));
554
592
  },
555
- this.signal.mapAsync(e, n, void 0, o),
556
- this.status.map(B(i)),
593
+ this.signal.mapAsync(e, i, void 0, r),
594
+ this.status.map(A(n)),
557
595
  this.parent,
558
- o
596
+ r
559
597
  );
560
598
  }
561
- class ue extends _ {
599
+ class Ce extends E {
562
600
  #e = /* @__PURE__ */ new Map();
563
601
  #s = /* @__PURE__ */ new Map();
564
602
  #t = /* @__PURE__ */ new Map();
565
- #n = w(!1);
603
+ #i = D(!1);
566
604
  /** Reactive signal indicating whether this field or any child field is touched. */
567
- touchedDeep = this.#n;
568
- #r = /* @__PURE__ */ new Map();
569
- #i = /* @__PURE__ */ new Map();
570
- #o = w(!1);
605
+ touchedDeep = this.#i;
606
+ #a = /* @__PURE__ */ new Map();
607
+ #n = /* @__PURE__ */ new Map();
608
+ #r = D(!1);
571
609
  /** Reactive signal indicating whether this field or any child field is dirty. */
572
- dirtyDeep = this.#o;
610
+ dirtyDeep = this.#r;
573
611
  #c;
574
- #h;
575
- #l = () => {
612
+ #d;
613
+ #o = () => {
576
614
  let e = !1;
577
615
  for (const t of this.#s.values())
578
616
  if (t) {
579
617
  e = !0;
580
618
  break;
581
619
  }
582
- this.#n.set(this.touched.value || e);
620
+ this.#i.set(this.touched.value || e);
583
621
  };
584
- constructor(e, t, n, i, o, a) {
622
+ constructor(e, t, i, n, r, l) {
585
623
  super(
586
624
  e,
587
625
  t,
588
- n.map((l) => l ?? {}, a),
589
- i,
590
- o,
591
- a
626
+ i.map((o) => o ?? {}, l),
627
+ n,
628
+ r,
629
+ l
592
630
  ), this.#c = this.touched.on(() => {
631
+ this.#o();
632
+ }), this.#d = this.dirty.on(() => {
593
633
  this.#l();
594
- }), this.#h = this.dirty.on(() => {
595
- this.#a();
596
634
  });
597
- const r = this.signal.on(() => this.#a());
635
+ const a = this.signal.on(() => this.#l());
598
636
  this.onDispose(() => {
599
- for (const l of this.#e.values())
600
- l.dispose();
637
+ for (const o of this.#e.values())
638
+ o.dispose();
601
639
  this.#e.clear();
602
- for (const l of this.#t.values()) l();
603
- this.#t.clear(), this.#s.clear(), this.#n.dispose();
604
- for (const l of this.#i.values()) l();
605
- this.#i.clear(), this.#r.clear(), this.#o.dispose(), this.#c(), this.#h(), r();
640
+ for (const o of this.#t.values()) o();
641
+ this.#t.clear(), this.#s.clear(), this.#i.dispose();
642
+ for (const o of this.#n.values()) o();
643
+ this.#n.clear(), this.#a.clear(), this.#r.dispose(), this.#c(), this.#d(), a();
606
644
  });
607
645
  }
608
646
  /**
@@ -622,31 +660,31 @@ class ue extends _ {
622
660
  field = (e) => {
623
661
  if (this.#e.has(e))
624
662
  return this.#e.get(e);
625
- const t = async (a) => {
663
+ const t = async (l) => {
626
664
  this.change({
627
665
  ...this.signal.value,
628
- [e]: a
666
+ [e]: l
629
667
  });
630
- }, n = new _(
668
+ }, i = new E(
631
669
  [...this.path, e],
632
670
  t,
633
- this.signal.map((a) => a[e]),
634
- this.status.map(B([e])),
671
+ this.signal.map((l) => l[e]),
672
+ this.status.map(A([e])),
635
673
  {
636
674
  disabled: this.disabled,
637
675
  // propagate validationMode to children if present
638
676
  validationMode: this.parent.validationMode
639
677
  }
640
678
  );
641
- this.#e.set(e, n);
642
- const i = n.touched.on((a) => {
643
- this.#s.set(e, a), this.#l();
679
+ this.#e.set(e, i);
680
+ const n = i.touched.on((l) => {
681
+ this.#s.set(e, l), this.#o();
644
682
  });
645
- this.#t.set(e, i);
646
- const o = n.dirty.on((a) => {
647
- this.#r.set(e, a), this.#a();
683
+ this.#t.set(e, n);
684
+ const r = i.dirty.on((l) => {
685
+ this.#a.set(e, l), this.#l();
648
686
  });
649
- return this.#i.set(e, o), n;
687
+ return this.#n.set(e, r), i;
650
688
  };
651
689
  /**
652
690
  * Marks this field and all child fields as touched recursively.
@@ -671,65 +709,65 @@ class ue extends _ {
671
709
  for (const t of this.#e.values())
672
710
  t.markPristine?.();
673
711
  };
674
- #a = () => {
712
+ #l = () => {
675
713
  let e = !1;
676
- for (const t of this.#r.values())
714
+ for (const t of this.#a.values())
677
715
  if (t) {
678
716
  e = !0;
679
717
  break;
680
718
  }
681
- this.#o.set(this.dirty.value || e);
719
+ this.#r.set(this.dirty.value || e);
682
720
  };
683
721
  }
684
- class de extends _ {
722
+ class Te extends E {
685
723
  #e = new Array();
686
724
  /** Reactive signal containing the current array length. */
687
725
  length;
688
726
  #s = /* @__PURE__ */ new Map();
689
727
  #t = /* @__PURE__ */ new Map();
690
- #n = w(!1);
728
+ #i = D(!1);
691
729
  /** Reactive signal indicating whether this array or any item is touched. */
692
- touchedDeep = this.#n;
693
- #r = /* @__PURE__ */ new Map();
694
- #i = /* @__PURE__ */ new Map();
695
- #o = w(!1);
730
+ touchedDeep = this.#i;
731
+ #a = /* @__PURE__ */ new Map();
732
+ #n = /* @__PURE__ */ new Map();
733
+ #r = D(!1);
696
734
  /** Reactive signal indicating whether this array or any item is dirty. */
697
- dirtyDeep = this.#o;
735
+ dirtyDeep = this.#r;
698
736
  #c;
699
- #h;
700
- #l = () => {
737
+ #d;
738
+ #o = () => {
701
739
  let e = !1;
702
740
  for (const t of this.#s.values())
703
741
  if (t) {
704
742
  e = !0;
705
743
  break;
706
744
  }
707
- this.#n.set(this.touched.value || e);
745
+ this.#i.set(this.touched.value || e);
708
746
  };
709
- constructor(e, t, n, i, o, a) {
710
- const r = n.map((u) => u ?? [], a);
711
- super(e, t, r, i, o, a);
712
- const l = r.on((u) => {
713
- const p = this.#e.length - u.length;
714
- p > 0 && (this.#e.splice(u.length, p).forEach((v, y) => {
715
- const f = u.length + y;
716
- v.dispose(), this.#t.get(f)?.(), this.#t.delete(f), this.#s.delete(f), this.#i.get(f)?.(), this.#i.delete(f), this.#r.delete(f);
717
- }), this.#l(), this.#a());
747
+ constructor(e, t, i, n, r, l) {
748
+ const a = i.map((h) => h ?? [], l);
749
+ super(e, t, a, n, r, l);
750
+ const o = a.on((h) => {
751
+ const p = this.#e.length - h.length;
752
+ p > 0 && (this.#e.splice(h.length, p).forEach((y, k) => {
753
+ const m = h.length + k;
754
+ y.dispose(), this.#t.get(m)?.(), this.#t.delete(m), this.#s.delete(m), this.#n.get(m)?.(), this.#n.delete(m), this.#a.delete(m);
755
+ }), this.#o(), this.#l());
718
756
  });
719
- this.length = r.map((u) => u.length), this.#c = this.touched.on(() => {
757
+ this.length = a.map((h) => h.length), this.#c = this.touched.on(() => {
758
+ this.#o();
759
+ }), this.#d = this.dirty.on(() => {
720
760
  this.#l();
721
- }), this.#h = this.dirty.on(() => {
722
- this.#a();
723
761
  });
724
- const d = this.signal.on(() => this.#a());
762
+ const u = this.signal.on(() => this.#l());
725
763
  this.onDispose(() => {
726
- for (const u of this.#e)
727
- u.dispose();
728
- this.length.dispose(), this.#e.length = 0, l(), r.dispose();
729
- for (const u of this.#t.values()) u();
730
- this.#t.clear(), this.#s.clear(), this.#n.dispose();
731
- for (const u of this.#i.values()) u();
732
- this.#i.clear(), this.#r.clear(), this.#o.dispose(), this.#c(), this.#h(), d();
764
+ for (const h of this.#e)
765
+ h.dispose();
766
+ this.length.dispose(), this.#e.length = 0, o(), a.dispose();
767
+ for (const h of this.#t.values()) h();
768
+ this.#t.clear(), this.#s.clear(), this.#i.dispose();
769
+ for (const h of this.#n.values()) h();
770
+ this.#n.clear(), this.#a.clear(), this.#r.dispose(), this.#c(), this.#d(), u();
733
771
  });
734
772
  }
735
773
  /**
@@ -748,28 +786,28 @@ class de extends _ {
748
786
  item = (e) => {
749
787
  if (this.#e[e])
750
788
  return this.#e[e];
751
- const t = async (a) => {
752
- const r = this.signal.value.slice();
753
- r[e] = a, this.change(r);
754
- }, n = new _(
789
+ const t = async (l) => {
790
+ const a = this.signal.value.slice();
791
+ a[e] = l, this.change(a);
792
+ }, i = new E(
755
793
  [...this.path, e],
756
794
  t,
757
- this.signal.map((a) => a[e]),
758
- this.status.map(B([e])),
795
+ this.signal.map((l) => l[e]),
796
+ this.status.map(A([e])),
759
797
  {
760
798
  disabled: this.disabled,
761
799
  validationMode: this.parent.validationMode
762
800
  }
763
801
  );
764
- this.#e[e] = n;
765
- const i = n.touched.on((a) => {
766
- this.#s.set(e, a), this.#l();
802
+ this.#e[e] = i;
803
+ const n = i.touched.on((l) => {
804
+ this.#s.set(e, l), this.#o();
767
805
  });
768
- this.#t.set(e, i);
769
- const o = n.dirty.on((a) => {
770
- this.#r.set(e, a), this.#a();
806
+ this.#t.set(e, n);
807
+ const r = i.dirty.on((l) => {
808
+ this.#a.set(e, l), this.#l();
771
809
  });
772
- return this.#i.set(e, o), n;
810
+ return this.#n.set(e, r), i;
773
811
  };
774
812
  /**
775
813
  * Appends one or more items to the end of the array.
@@ -814,8 +852,8 @@ class de extends _ {
814
852
  * @param deleteCount - Number of items to remove (optional)
815
853
  */
816
854
  splice = (e, t) => {
817
- const n = this.signal.value.slice();
818
- n.splice(e, t), this.change(n);
855
+ const i = this.signal.value.slice();
856
+ i.splice(e, t), this.change(i);
819
857
  };
820
858
  /**
821
859
  * Moves one or more items from one index to another within the array.
@@ -830,10 +868,10 @@ class de extends _ {
830
868
  * controller.move(2, 0, 2) // Move items at index 2-3 to the beginning
831
869
  * ```
832
870
  */
833
- move = (e, t, n = 1) => {
834
- if (n < 1 || e === t) return;
835
- const i = this.signal.value.slice(), o = i.splice(e, n);
836
- i.splice(t, 0, ...o), this.change(i);
871
+ move = (e, t, i = 1) => {
872
+ if (i < 1 || e === t) return;
873
+ const n = this.signal.value.slice(), r = n.splice(e, i);
874
+ n.splice(t, 0, ...r), this.change(n);
837
875
  };
838
876
  /**
839
877
  * Marks this array and all item controllers as touched recursively.
@@ -854,17 +892,17 @@ class de extends _ {
854
892
  for (let t = 0; t < e; t++)
855
893
  this.item(t).markPristine?.();
856
894
  };
857
- #a = () => {
895
+ #l = () => {
858
896
  let e = !1;
859
- for (const t of this.#r.values())
897
+ for (const t of this.#a.values())
860
898
  if (t) {
861
899
  e = !0;
862
900
  break;
863
901
  }
864
- this.#o.set(this.dirty.value || e);
902
+ this.#r.set(this.dirty.value || e);
865
903
  };
866
904
  }
867
- function pe(s) {
905
+ function _e(s) {
868
906
  function e(t) {
869
907
  return typeof t == "number" ? t : t.toString();
870
908
  }
@@ -872,179 +910,181 @@ function pe(s) {
872
910
  (t) => typeof t == "object" && t.key != null ? e(t.key) : e(t)
873
911
  );
874
912
  }
875
- function fe(s) {
876
- const e = s.filter((i) => i.path == null || i.path.length === 0).map((i) => i.message), t = s.filter((i) => i.path != null && i.path.length > 0).reduce((i, o) => {
877
- const a = pe(o.path), r = a.pop();
878
- let l = i;
879
- for (const d of a)
880
- l.dependencies == null && (l.dependencies = {}), l.dependencies[d] == null && (l.dependencies[d] = {}), l = l.dependencies[d];
881
- return l.dependencies == null && (l.dependencies = {}), l.dependencies[r] = { message: o.message }, i;
882
- }, {}), n = e.join(`
913
+ function we(s) {
914
+ const e = s.filter((n) => n.path == null || n.path.length === 0).map((n) => n.message), t = s.filter((n) => n.path != null && n.path.length > 0).reduce((n, r) => {
915
+ const l = _e(r.path), a = l.pop();
916
+ let o = n;
917
+ for (const u of l)
918
+ o.dependencies == null && (o.dependencies = {}), o.dependencies[u] == null && (o.dependencies[u] = {}), o = o.dependencies[u];
919
+ return o.dependencies == null && (o.dependencies = {}), o.dependencies[a] = { message: r.message }, n;
920
+ }, {}), i = e.join(`
883
921
  `);
884
922
  return {
885
923
  ...t,
886
- message: n != "" ? n : void 0
924
+ message: i != "" ? i : void 0
887
925
  };
888
926
  }
889
- function be({
927
+ function Ie({
890
928
  initialValue: s,
891
929
  onChange: e,
892
930
  validate: t,
893
- equals: n,
894
- validationMode: i,
895
- validateDebounceMs: o
931
+ equals: i,
932
+ validationMode: n,
933
+ validateDebounceMs: r
896
934
  }) {
897
- const a = C.deriveProp(s), r = w(g.valid), l = w(!1), d = w(i ?? "onTouched"), u = (h) => {
898
- r.set(h);
935
+ const l = T.deriveProp(s), a = D(g.valid), o = D(!1), u = D(n ?? "onTouched"), h = (d) => {
936
+ a.set(d);
899
937
  };
900
938
  let p;
901
- const v = async (h) => {
939
+ const y = async (d) => {
902
940
  if (t != null) {
903
- const D = await t(h);
904
- u(D);
941
+ const w = await t(d);
942
+ h(w);
905
943
  }
906
- }, y = async (h) => {
907
- a.set(h), e?.(h);
908
- const D = d.value;
944
+ }, k = async (d) => {
945
+ l.set(d), e?.(d);
946
+ const w = u.value;
909
947
  if (t != null) {
910
- if (D === "onSubmit")
948
+ if (w === "onSubmit")
911
949
  return;
912
- const I = o ?? 0;
950
+ const I = r ?? 0;
913
951
  I > 0 ? (p && clearTimeout(p), p = setTimeout(() => {
914
- v(h);
915
- }, I)) : await v(h);
952
+ y(d);
953
+ }, I)) : await y(d);
916
954
  }
917
- }, f = new _(
955
+ }, m = new E(
918
956
  [],
919
- y,
957
+ k,
958
+ l,
920
959
  a,
921
- r,
922
960
  {
923
- disabled: l,
924
- validationMode: d
961
+ disabled: o,
962
+ validationMode: u
925
963
  },
926
- n ?? V
964
+ i ?? M
927
965
  );
928
- return f.onDispose(() => {
929
- l.dispose(), a.dispose(), r.dispose(), d.dispose(), p && clearTimeout(p);
930
- }), { controller: f, setStatus: u };
966
+ return m.onDispose(() => {
967
+ o.dispose(), l.dispose(), a.dispose(), u.dispose(), p && clearTimeout(p);
968
+ }), { controller: m, setStatus: h };
931
969
  }
932
- function R(s) {
933
- return $(c.disabled(s.disabled), c.name(s.name));
970
+ function K(s) {
971
+ return P(c.disabled(s.disabled), c.name(s.name));
934
972
  }
935
- function Ee(s, {
973
+ function Le(s, {
936
974
  triggerOn: e = "change"
937
975
  } = {}) {
938
- return $(
939
- R(s),
976
+ return P(
977
+ K(s),
940
978
  c.value(s.signal),
941
- (e === "input" ? E.input : E.change)(X(s.change))
979
+ (e === "input" ? F.input : F.change)(le(s.change))
942
980
  );
943
981
  }
944
- function Ve(s, {
982
+ function $e(s, {
945
983
  triggerOn: e = "change"
946
984
  } = {}) {
947
- return $(
948
- R(s),
985
+ return P(
986
+ K(s),
949
987
  c.valueAsNumber(s.signal),
950
- (e === "input" ? E.input : E.change)(
951
- Q(s.change)
988
+ (e === "input" ? F.input : F.change)(
989
+ ae(s.change)
952
990
  )
953
991
  );
954
992
  }
955
- function N(s) {
956
- return s.issues != null ? g.invalid(fe(s.issues)) : g.valid;
993
+ function H(s) {
994
+ return s.issues != null ? g.invalid(we(s.issues)) : g.valid;
957
995
  }
958
- async function xe({
996
+ async function ze({
959
997
  task: s,
960
998
  errorMessage: e,
961
999
  errorPath: t = ["root"],
962
- validation: n
1000
+ validation: i
963
1001
  }) {
964
1002
  try {
965
- const i = await s();
966
- return n != null ? n(i) : g.valid;
967
- } catch (i) {
968
- const o = e ?? (i instanceof Error ? i.message : "Operation failed");
1003
+ const n = await s();
1004
+ return i != null ? i(n) : g.valid;
1005
+ } catch (n) {
1006
+ const r = e ?? (n instanceof Error ? n.message : "Operation failed");
969
1007
  return t.length === 1 && t[0] === "root" ? g.invalid({
970
- message: o
1008
+ message: r
971
1009
  }) : g.invalid({
972
- dependencies: U(t, o)
1010
+ dependencies: Y(t, r)
973
1011
  });
974
1012
  }
975
1013
  }
976
- function U(s, e) {
1014
+ function Y(s, e) {
977
1015
  if (s.length === 1)
978
1016
  return {
979
1017
  [s[0]]: { message: e }
980
1018
  };
981
- const [t, ...n] = s;
1019
+ const [t, ...i] = s;
982
1020
  return {
983
1021
  [t]: {
984
- dependencies: U(n, e)
1022
+ dependencies: Y(i, e)
985
1023
  }
986
1024
  };
987
1025
  }
988
- function Se({
1026
+ function He({
989
1027
  initialValue: s = {},
990
1028
  schema: e,
991
1029
  onSubmit: t = async () => g.valid,
992
- validationMode: n,
993
- validateDebounceMs: i
1030
+ validationMode: i,
1031
+ validateDebounceMs: n
994
1032
  }) {
995
- const { controller: o, setStatus: a } = be({
1033
+ const { controller: r, setStatus: l } = Ie({
996
1034
  initialValue: s,
997
- validationMode: n ?? "onTouched",
998
- validateDebounceMs: i,
999
- validate: (n ?? "onTouched") === "onSubmit" || e == null ? void 0 : async (u) => N(
1000
- await e["~standard"].validate(u)
1035
+ validationMode: i ?? "onTouched",
1036
+ validateDebounceMs: n,
1037
+ validate: (i ?? "onTouched") === "onSubmit" || e == null ? void 0 : async (h) => H(
1038
+ await e["~standard"].validate(h)
1001
1039
  )
1002
- }), r = w(!1), l = o.object();
1003
- return l.onDispose(() => r.dispose()), {
1004
- controller: l,
1005
- setStatus: a,
1006
- submit: async (u) => {
1007
- if (r.set(!0), u?.preventDefault(), l.markAllTouched(), e != null) {
1008
- const v = l.signal.value, y = N(
1009
- await e["~standard"].validate(v)
1040
+ }), a = D(!1), o = r.object();
1041
+ return o.onDispose(() => a.dispose()), {
1042
+ controller: o,
1043
+ setStatus: l,
1044
+ submit: async (h) => {
1045
+ if (a.set(!0), h?.preventDefault(), o.markAllTouched(), e != null) {
1046
+ const y = o.signal.value, k = H(
1047
+ await e["~standard"].validate(y)
1010
1048
  );
1011
- if (a(y), y.type === "invalid") {
1012
- r.set(!1);
1049
+ if (l(k), k.type === "invalid") {
1050
+ a.set(!1);
1013
1051
  return;
1014
1052
  }
1015
1053
  }
1016
- const p = await t(l.signal.value);
1017
- r.set(!1), p.type === "invalid" && a(p);
1054
+ const p = await t(o.signal.value);
1055
+ a.set(!1), p.type === "invalid" && l(p);
1018
1056
  },
1019
- submitting: r
1057
+ submitting: a
1020
1058
  };
1021
1059
  }
1022
1060
  export {
1023
- de as A,
1024
- W as B,
1025
- De as C,
1026
- z as I,
1027
- _e as M,
1028
- ue as O,
1029
- ne as R,
1030
- Ce as a,
1031
- Te as b,
1032
- F as c,
1033
- _ as d,
1034
- B as e,
1035
- be as f,
1036
- le as g,
1037
- Me as h,
1038
- R as i,
1039
- Ve as j,
1040
- Ee as k,
1041
- fe as l,
1042
- oe as m,
1043
- pe as n,
1044
- he as o,
1045
- Ie as p,
1046
- N as s,
1047
- xe as t,
1048
- Se as u,
1049
- ce as w
1061
+ Te as A,
1062
+ R as B,
1063
+ Ae as C,
1064
+ q as F,
1065
+ We as M,
1066
+ Ce as O,
1067
+ pe as R,
1068
+ Be as a,
1069
+ Oe as b,
1070
+ z as c,
1071
+ E as d,
1072
+ A as e,
1073
+ Ie as f,
1074
+ j as g,
1075
+ ye as h,
1076
+ Pe as i,
1077
+ ue as j,
1078
+ K as k,
1079
+ $e as l,
1080
+ ve as m,
1081
+ Le as n,
1082
+ we as o,
1083
+ _e as p,
1084
+ je as q,
1085
+ De as r,
1086
+ H as s,
1087
+ ze as t,
1088
+ He as u,
1089
+ ke as w
1050
1090
  };