@tempots/beatui 0.69.0 → 0.71.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 (93) hide show
  1. package/dist/{ar-aMLQTGVh.js → ar-BbgpGwJp.js} +1 -1
  2. package/dist/auth/index.cjs.js +1 -1
  3. package/dist/auth/index.es.js +106 -105
  4. package/dist/beatui.css +401 -0
  5. package/dist/beatui.tailwind.css +401 -0
  6. package/dist/{de-DBFOC44R.js → de-R7lPfyZ4.js} +1 -1
  7. package/dist/deep-merge-CQQCMLwG.js +1636 -0
  8. package/dist/deep-merge-DZxfgKqX.cjs +1 -0
  9. package/dist/duration-input-D-SIoDoo.cjs +1 -0
  10. package/dist/duration-input-DKxZ6OCa.js +277 -0
  11. package/dist/{es-C4xOThaT.js → es-DV0Jr_BZ.js} +1 -1
  12. package/dist/{fa-B7X_xydY.js → fa-DXvHejs9.js} +1 -1
  13. package/dist/{fr-AmjzbxN_.js → fr-D8FOMX0o.js} +1 -1
  14. package/dist/{he-DY-9yiOC.js → he-B19Qsx-u.js} +1 -1
  15. package/dist/{hi-Clkyp5Fu.js → hi-DozFnE3b.js} +1 -1
  16. package/dist/{index-GLoRnI6r.js → index-CYb1YxDX.js} +1 -1
  17. package/dist/{index-CzuXAuLZ.js → index-DdpYvBeh.js} +3 -3
  18. package/dist/index.cjs.js +4 -4
  19. package/dist/index.es.js +2852 -3104
  20. package/dist/{it-BC32WmGF.js → it-But8uzNi.js} +1 -1
  21. package/dist/{ja-JNSZS_Hv.js → ja-DkwTnFdU.js} +1 -1
  22. package/dist/json-schema/index.cjs.js +6 -6
  23. package/dist/json-schema/index.es.js +3099 -2961
  24. package/dist/json-structure/index.cjs.js +1 -0
  25. package/dist/json-structure/index.es.js +3157 -0
  26. package/dist/{ko-B8l0TJp0.js → ko-Cqv-IjhX.js} +1 -1
  27. package/dist/modal-5P9mU_a4.cjs +1 -0
  28. package/dist/{modal-DJWj5M5e.js → modal-MofsfmAe.js} +2 -2
  29. package/dist/{nl-BpYESHP8.js → nl-YSiU3rFI.js} +1 -1
  30. package/dist/notice-Cqq8g17n.js +209 -0
  31. package/dist/notice-DP209Ed8.cjs +1 -0
  32. package/dist/{pl-_sWhGdrs.js → pl-DXmHc2Nh.js} +1 -1
  33. package/dist/prosemirror/index.es.js +1 -1
  34. package/dist/{pt-BmiQvHUz.js → pt-Bf3z_-26.js} +1 -1
  35. package/dist/{ru-DacnqexG.js → ru-Sy00qUeG.js} +1 -1
  36. package/dist/tailwind/vite-plugin.es.js +1 -0
  37. package/dist/{toolbar-Bk5-22ln.js → toolbar-C_Ec0_XC.js} +1 -1
  38. package/dist/{tr-BSS5b_v6.js → tr-BDxG3qd6.js} +1 -1
  39. package/dist/{translations-zGwuSQWQ.js → translations-BmsRhth7.js} +1 -1
  40. package/dist/{translations-BUTBIDsS.js → translations-DQxouiBG.js} +24 -24
  41. package/dist/types/components/form/index.d.ts +1 -0
  42. package/dist/types/components/form/utils/deep-merge.d.ts +27 -0
  43. package/dist/types/components/form/utils/index.d.ts +1 -0
  44. package/dist/types/components/json-schema/index.d.ts +1 -0
  45. package/dist/types/components/json-schema/json-schema-form.d.ts +22 -3
  46. package/dist/types/components/json-schema/schema-defaults.d.ts +39 -0
  47. package/dist/types/components/json-structure/controls/any-control.d.ts +15 -0
  48. package/dist/types/components/json-structure/controls/array-control.d.ts +15 -0
  49. package/dist/types/components/json-structure/controls/binary-control.d.ts +15 -0
  50. package/dist/types/components/json-structure/controls/boolean-control.d.ts +15 -0
  51. package/dist/types/components/json-structure/controls/choice-control.d.ts +19 -0
  52. package/dist/types/components/json-structure/controls/decimal-control.d.ts +17 -0
  53. package/dist/types/components/json-structure/controls/deprecation-utils.d.ts +14 -0
  54. package/dist/types/components/json-structure/controls/enum-const-controls.d.ts +22 -0
  55. package/dist/types/components/json-structure/controls/generic-control.d.ts +31 -0
  56. package/dist/types/components/json-structure/controls/index.d.ts +21 -0
  57. package/dist/types/components/json-structure/controls/integer-control.d.ts +18 -0
  58. package/dist/types/components/json-structure/controls/map-control.d.ts +17 -0
  59. package/dist/types/components/json-structure/controls/object-control.d.ts +17 -0
  60. package/dist/types/components/json-structure/controls/set-control.d.ts +15 -0
  61. package/dist/types/components/json-structure/controls/string-control.d.ts +15 -0
  62. package/dist/types/components/json-structure/controls/temporal-control.d.ts +18 -0
  63. package/dist/types/components/json-structure/controls/tuple-control.d.ts +19 -0
  64. package/dist/types/components/json-structure/controls/union-control.d.ts +15 -0
  65. package/dist/types/components/json-structure/controls/uri-control.d.ts +15 -0
  66. package/dist/types/components/json-structure/controls/uuid-control.d.ts +15 -0
  67. package/dist/types/components/json-structure/extends-utils.d.ts +36 -0
  68. package/dist/types/components/json-structure/index.d.ts +25 -0
  69. package/dist/types/components/json-structure/json-structure-form.d.ts +96 -0
  70. package/dist/types/components/json-structure/ref-utils.d.ts +55 -0
  71. package/dist/types/components/json-structure/structure-context.d.ts +176 -0
  72. package/dist/types/components/json-structure/structure-defaults.d.ts +46 -0
  73. package/dist/types/components/json-structure/structure-types.d.ts +173 -0
  74. package/dist/types/components/json-structure/validation/error-transform.d.ts +56 -0
  75. package/dist/types/components/json-structure/validation/index.d.ts +5 -0
  76. package/dist/types/components/json-structure/validation/sdk-validator.d.ts +46 -0
  77. package/dist/types/components/json-structure/widgets/default-widgets.d.ts +27 -0
  78. package/dist/types/components/json-structure/widgets/index.d.ts +6 -0
  79. package/dist/types/components/json-structure/widgets/widget-registry.d.ts +143 -0
  80. package/dist/types/components/json-structure/widgets/widget-utils.d.ts +79 -0
  81. package/dist/types/json-structure/index.d.ts +9 -0
  82. package/dist/{ur-C6Ky6OCl.js → ur-55zdT2TQ.js} +1 -1
  83. package/dist/{notice-Um1LwKBF.js → use-form-B7A865EM.js} +329 -532
  84. package/dist/use-form-DVJXMMoN.cjs +2 -0
  85. package/dist/{vi-Bx2gx2S0.js → vi-C7K7W0hM.js} +1 -1
  86. package/dist/widget-customization-29Hl2gKT.js +1171 -0
  87. package/dist/widget-customization-BXiewbt-.cjs +1 -0
  88. package/dist/{zh-eixtg-Ce.js → zh-DvJBV9D8.js} +1 -1
  89. package/package.json +10 -2
  90. package/dist/modal-D_paG9Sr.cjs +0 -1
  91. package/dist/notice-CgT9ma2m.cjs +0 -2
  92. package/dist/widget-customization-BcbRhAAR.cjs +0 -1
  93. package/dist/widget-customization-D6Y_Qm7o.js +0 -2788
@@ -1,11 +1,11 @@
1
- import { Use as q, coalesce as Q, aria as x, attr as c, html as f, on as D, Value as S, Empty as C, computedOf as w, When as V, dataAttr as R, input as ne, emitValue as F, prop as E, Fragment as N, TextNode as re, emitValueAsNumber as ie, Unless as ae, Ensure as le } from "@tempots/dom";
2
- import { a as z, B as oe, I as B, b as W, c as ce, C as X } from "./translations-BUTBIDsS.js";
3
- const K = /* @__PURE__ */ new Map();
4
- function H(e) {
5
- const s = K.get(e) ?? 0;
6
- return K.set(e, s + 1), `${e}-${s}`;
1
+ import { Use as X, coalesce as Y, aria as F, attr as o, html as f, on as I, Value as E, Empty as T, computedOf as w, When as x, dataAttr as j, TextNode as Z, prop as S, Fragment as q, emitValue as ee, emitValueAsNumber as se } from "@tempots/dom";
2
+ import { a as te, B as ne, c as R, b as re } from "./translations-DQxouiBG.js";
3
+ const H = /* @__PURE__ */ new Map();
4
+ function N(e) {
5
+ const s = H.get(e) ?? 0;
6
+ return H.set(e, s + 1), `${e}-${s}`;
7
7
  }
8
- const y = {
8
+ const b = {
9
9
  /**
10
10
  * Creates a loading state.
11
11
  * @param previousValue - The previous value.
@@ -84,7 +84,7 @@ const y = {
84
84
  * @public
85
85
  */
86
86
  getOrElse(e, s) {
87
- return y.isSuccess(e) ? e.value : s;
87
+ return b.isSuccess(e) ? e.value : s;
88
88
  },
89
89
  /**
90
90
  * Gets the value if the result is a success; otherwise, returns the value from the alternative function.
@@ -95,7 +95,7 @@ const y = {
95
95
  * function.
96
96
  */
97
97
  getOrElseLazy(e, s) {
98
- return y.isSuccess(e) ? e.value : s();
98
+ return b.isSuccess(e) ? e.value : s();
99
99
  },
100
100
  /**
101
101
  * Gets the value if the result is a success; otherwise, returns `null`.
@@ -104,7 +104,7 @@ const y = {
104
104
  * @public
105
105
  */
106
106
  getOrNull(e) {
107
- return y.isSuccess(e) ? e.value : null;
107
+ return b.isSuccess(e) ? e.value : null;
108
108
  },
109
109
  /**
110
110
  * Gets the value if the result is a success; otherwise, returns `undefined`.
@@ -113,7 +113,7 @@ const y = {
113
113
  * @public
114
114
  */
115
115
  getOrUndefined(e) {
116
- return y.isSuccess(e) ? e.value : void 0;
116
+ return b.isSuccess(e) ? e.value : void 0;
117
117
  },
118
118
  /**
119
119
  * Gets the value of a `AsyncResult` if it is a `Success`, otherwise it throws the error contained in the `Failure`.
@@ -121,9 +121,9 @@ const y = {
121
121
  * @returns The value of the `AsyncResult` if it is a `Success`.
122
122
  */
123
123
  getUnsafe: (e) => {
124
- if (y.isSuccess(e))
124
+ if (b.isSuccess(e))
125
125
  return e.value;
126
- throw y.isFailure(e) ? e.error : new Error("Cannot get value from a not-asked or loading result");
126
+ throw b.isFailure(e) ? e.error : new Error("Cannot get value from a not-asked or loading result");
127
127
  },
128
128
  /**
129
129
  * Based on the state of the result, it picks the appropriate function to call and returns the result.
@@ -139,7 +139,7 @@ const y = {
139
139
  failure: t,
140
140
  loading: n,
141
141
  notAsked: r = n
142
- }) => y.isSuccess(e) ? s(e.value) : y.isFailure(e) ? t(e.error) : y.isNotAsked(e) ? r() : n(e.previousValue),
142
+ }) => b.isSuccess(e) ? s(e.value) : b.isFailure(e) ? t(e.error) : b.isNotAsked(e) ? r() : n(e.previousValue),
143
143
  /**
144
144
  * When the result is a success, it applies the function to the value.
145
145
  *
@@ -148,7 +148,7 @@ const y = {
148
148
  * @returns The result that was passed in.
149
149
  * @public
150
150
  */
151
- whenSuccess: (e, s) => (y.isSuccess(e) && s(e.value), e),
151
+ whenSuccess: (e, s) => (b.isSuccess(e) && s(e.value), e),
152
152
  /**
153
153
  * When the result is a failure, it applies the function to the error.
154
154
  *
@@ -157,7 +157,7 @@ const y = {
157
157
  * @returns The result that was passed in.
158
158
  * @public
159
159
  */
160
- whenFailure: (e, s) => (y.isFailure(e) && s(e.error), e),
160
+ whenFailure: (e, s) => (b.isFailure(e) && s(e.error), e),
161
161
  /**
162
162
  * Compares two results for equality.
163
163
  * @param r1 - The first result.
@@ -177,11 +177,11 @@ const y = {
177
177
  all: (e) => {
178
178
  const s = [];
179
179
  for (const t of e)
180
- if (y.isSuccess(t))
180
+ if (b.isSuccess(t))
181
181
  s.push(t.value);
182
182
  else
183
183
  return t;
184
- return y.success(s);
184
+ return b.success(s);
185
185
  },
186
186
  /**
187
187
  * Converts a Promise to an AsyncResult.
@@ -191,12 +191,12 @@ const y = {
191
191
  ofPromise: async (e) => {
192
192
  try {
193
193
  const s = await e;
194
- return y.success(s);
194
+ return b.success(s);
195
195
  } catch (s) {
196
- return y.failure(s instanceof Error ? s : new Error(String(s)));
196
+ return b.failure(s instanceof Error ? s : new Error(String(s)));
197
197
  }
198
198
  }
199
- }, $ = (e, s) => e === s || e !== e && s !== s, _ = {
199
+ }, V = (e, s) => e === s || e !== e && s !== s, g = {
200
200
  /**
201
201
  * Creates a valid `Validation`.
202
202
  * @returns A `Validation` that is `Valid`.
@@ -234,17 +234,17 @@ const y = {
234
234
  * @param invalid - The mapping function for an invalid value.
235
235
  * @returns The mapped value.
236
236
  */
237
- match: (e, s, t) => _.isValid(e) ? s() : t(e.error),
237
+ match: (e, s, t) => g.isValid(e) ? s() : t(e.error),
238
238
  /**
239
239
  * Maps the value of a `Validation` to a new `Validation`.
240
240
  * @param validation - The `Validation` to map.
241
241
  * @param value - The value to map.
242
242
  * @returns A new `Validation` with the mapped value.
243
243
  */
244
- toResult: (e, s) => _.match(
244
+ toResult: (e, s) => g.match(
245
245
  e,
246
- () => m.success(s),
247
- (t) => m.failure(t)
246
+ () => d.success(s),
247
+ (t) => d.failure(t)
248
248
  ),
249
249
  /**
250
250
  * Execute a function when the `Validation` is valid.
@@ -253,7 +253,7 @@ const y = {
253
253
  * @param apply - The function to execute when the `Validation` is valid.
254
254
  * @returns The `Validation` object.
255
255
  */
256
- whenValid: (e, s) => (_.isValid(e) && s(), e),
256
+ whenValid: (e, s) => (g.isValid(e) && s(), e),
257
257
  /**
258
258
  * Execute a function when the `Validation` is invalid.
259
259
  *
@@ -261,8 +261,8 @@ const y = {
261
261
  * @param apply - The function to execute when the `Validation` is invalid.
262
262
  * @returns The `Validation` object.
263
263
  */
264
- whenInvalid: (e, s) => (_.isInvalid(e) && s(e.error), e)
265
- }, m = {
264
+ whenInvalid: (e, s) => (g.isInvalid(e) && s(e.error), e)
265
+ }, d = {
266
266
  /**
267
267
  * Creates a successful `Result`.
268
268
  * @param value - The value to wrap in a `Success` type.
@@ -290,7 +290,7 @@ const y = {
290
290
  * @returns A new `Result` with the mapped value.
291
291
  * @public
292
292
  */
293
- map: (e, s) => e.type === "Success" ? m.success(s(e.value)) : e,
293
+ map: (e, s) => e.type === "Success" ? d.success(s(e.value)) : e,
294
294
  /**
295
295
  * Maps the value of a `Result` to a new `Result`.
296
296
  * @param r - The `Result` to map.
@@ -306,10 +306,10 @@ const y = {
306
306
  * @public
307
307
  */
308
308
  toAsync(e) {
309
- return m.match(
309
+ return d.match(
310
310
  e,
311
- (s) => y.success(s),
312
- (s) => y.failure(s)
311
+ (s) => b.success(s),
312
+ (s) => b.failure(s)
313
313
  );
314
314
  },
315
315
  /**
@@ -319,10 +319,10 @@ const y = {
319
319
  * @public
320
320
  */
321
321
  toValidation(e) {
322
- return m.match(
322
+ return d.match(
323
323
  e,
324
- () => _.valid,
325
- (s) => _.invalid(s)
324
+ () => g.valid,
325
+ (s) => g.invalid(s)
326
326
  );
327
327
  },
328
328
  /**
@@ -351,7 +351,7 @@ const y = {
351
351
  * @public
352
352
  */
353
353
  getOrElse(e, s) {
354
- return m.isSuccess(e) ? e.value : s;
354
+ return d.isSuccess(e) ? e.value : s;
355
355
  },
356
356
  /**
357
357
  * Gets the value of a `Result` if it is a `Success`, otherwise returns the result of the provided function.
@@ -361,7 +361,7 @@ const y = {
361
361
  * @public
362
362
  */
363
363
  getOrElseLazy(e, s) {
364
- return m.isSuccess(e) ? e.value : s();
364
+ return d.isSuccess(e) ? e.value : s();
365
365
  },
366
366
  /**
367
367
  * Gets the value of a `Result` if it is a `Success`, otherwise returns `null`.
@@ -370,7 +370,7 @@ const y = {
370
370
  * @public
371
371
  */
372
372
  getOrNull(e) {
373
- return m.isSuccess(e) ? e.value : null;
373
+ return d.isSuccess(e) ? e.value : null;
374
374
  },
375
375
  /**
376
376
  * Gets the value of a `Result` if it is a `Success`, otherwise returns `undefined`.
@@ -379,7 +379,7 @@ const y = {
379
379
  * @public
380
380
  */
381
381
  getOrUndefined(e) {
382
- return m.isSuccess(e) ? e.value : void 0;
382
+ return d.isSuccess(e) ? e.value : void 0;
383
383
  },
384
384
  /**
385
385
  * Gets the value of a `Result` if it is a `Success`, otherwise it throws the error contained in the `Failure`.
@@ -387,7 +387,7 @@ const y = {
387
387
  * @returns The value of the `Result` if it is a `Success`.
388
388
  */
389
389
  getUnsafe: (e) => {
390
- if (m.isSuccess(e))
390
+ if (d.isSuccess(e))
391
391
  return e.value;
392
392
  throw e.error;
393
393
  },
@@ -398,15 +398,15 @@ const y = {
398
398
  * @returns The result of calling the appropriate function based on the state of the result.
399
399
  * @public
400
400
  */
401
- match: (e, s, t) => m.isSuccess(e) ? s(e.value) : t(e.error),
401
+ match: (e, s, t) => d.isSuccess(e) ? s(e.value) : t(e.error),
402
402
  /**
403
403
  * Calls the provided function if the result is a success.
404
404
  * @param apply - The function to call if the result is a success.
405
405
  * @returns A function that takes a `Result` and calls the provided function if the result is a success.
406
406
  * @public
407
407
  */
408
- whenSuccess: (e, s) => (m.isSuccess(e) && s(e.value), e),
409
- whenFailure: (e, s) => (m.isFailure(e) && s(e.error), e),
408
+ whenSuccess: (e, s) => (d.isSuccess(e) && s(e.value), e),
409
+ whenFailure: (e, s) => (d.isFailure(e) && s(e.error), e),
410
410
  /**
411
411
  * Combines two results into a single result.
412
412
  * @param r1 - The first result.
@@ -416,18 +416,18 @@ const y = {
416
416
  * @returns The combined result.
417
417
  * @public
418
418
  */
419
- combine: (e, s, t, n) => m.match(
419
+ combine: (e, s, t, n) => d.match(
420
420
  e,
421
- (r) => m.match(
421
+ (r) => d.match(
422
422
  s,
423
- (i) => m.success(t(r, i)),
424
- (i) => m.failure(i)
423
+ (i) => d.success(t(r, i)),
424
+ (i) => d.failure(i)
425
425
  ),
426
- (r) => m.match(
426
+ (r) => d.match(
427
427
  s,
428
428
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
429
- (i) => m.failure(r),
430
- (i) => m.failure(n(r, i))
429
+ (i) => d.failure(r),
430
+ (i) => d.failure(n(r, i))
431
431
  )
432
432
  ),
433
433
  /**
@@ -449,14 +449,14 @@ const y = {
449
449
  all: (e) => {
450
450
  const s = [];
451
451
  for (const t of e)
452
- if (m.isSuccess(t))
452
+ if (d.isSuccess(t))
453
453
  s.push(t.value);
454
454
  else
455
455
  return t;
456
- return m.success(s);
456
+ return d.success(s);
457
457
  }
458
458
  };
459
- function ue({
459
+ function Se({
460
460
  size: e = "sm",
461
461
  icon: s = "line-md:close",
462
462
  disabled: t,
@@ -465,9 +465,9 @@ function ue({
465
465
  onClick: i,
466
466
  label: l
467
467
  }, ...a) {
468
- return q(z, (o) => {
469
- const p = Q(l, o.$.closeModal);
470
- return oe(
468
+ return X(te, (c) => {
469
+ const p = Y(l, c.$.closeModal);
470
+ return ne(
471
471
  {
472
472
  variant: "text",
473
473
  size: e,
@@ -476,17 +476,17 @@ function ue({
476
476
  color: r,
477
477
  onClick: i
478
478
  },
479
- c.title(p),
480
- x.label(p),
479
+ o.title(p),
480
+ F.label(p),
481
481
  ...a,
482
- B({ icon: s, size: e ?? "sm" })
482
+ R({ icon: s, size: e ?? "sm" })
483
483
  );
484
484
  });
485
485
  }
486
- function U(e) {
486
+ function $(e) {
487
487
  return `bc-label bc-label--${e}`;
488
488
  }
489
- const Me = (...e) => f.span(c.class(U("emphasis")), ...e), he = (...e) => f.span(c.class(U("default")), ...e), de = (...e) => f.span(c.class(U("muted")), ...e), Oe = (...e) => f.span(c.class(U("danger")), ...e), Fe = (e) => {
489
+ const De = (...e) => f.span(o.class($("emphasis")), ...e), ie = (...e) => f.span(o.class($("default")), ...e), ae = (...e) => f.span(o.class($("muted")), ...e), Ce = (...e) => f.span(o.class($("danger")), ...e), Ee = (e) => {
490
490
  const {
491
491
  value: s,
492
492
  onBlur: t,
@@ -495,88 +495,88 @@ const Me = (...e) => f.span(c.class(U("emphasis")), ...e), he = (...e) => f.span
495
495
  disabled: i,
496
496
  id: l,
497
497
  checkedIcon: a,
498
- uncheckedIcon: o,
498
+ uncheckedIcon: c,
499
499
  iconSize: p = "lg"
500
- } = e, h = l ?? H("checkbox"), b = `${h}-label`, k = () => {
501
- if (S.get(i ?? !1)) return;
502
- const u = S.get(s);
503
- n?.(!u);
504
- }, g = (u) => {
505
- S.get(i ?? !1) || (u.key === " " || u.key === "Enter") && (u.preventDefault(), k());
500
+ } = e, u = l ?? N("checkbox"), m = `${u}-label`, k = () => {
501
+ if (E.get(i ?? !1)) return;
502
+ const h = E.get(s);
503
+ n?.(!h);
504
+ }, D = (h) => {
505
+ E.get(i ?? !1) || (h.key === " " || h.key === "Enter") && (h.preventDefault(), k());
506
506
  };
507
- return W(
507
+ return re(
508
508
  {
509
509
  baseContainer: !0,
510
510
  growInput: !1,
511
511
  ...e,
512
512
  input: f.span(
513
- c.class("bc-checkbox-input"),
513
+ o.class("bc-checkbox-input"),
514
514
  f.span(
515
- c.class("bc-checkbox-input__checkbox"),
516
- c.class(
517
- S.map(
515
+ o.class("bc-checkbox-input__checkbox"),
516
+ o.class(
517
+ E.map(
518
518
  s,
519
- (u) => u ? "bc-checkbox-input__checkbox--checked" : "bc-checkbox-input__checkbox--unchecked"
519
+ (h) => h ? "bc-checkbox-input__checkbox--checked" : "bc-checkbox-input__checkbox--unchecked"
520
520
  )
521
521
  ),
522
- c.class(
523
- S.map(
522
+ o.class(
523
+ E.map(
524
524
  i ?? !1,
525
- (u) => u ? "bc-checkbox-input__checkbox--disabled" : ""
525
+ (h) => h ? "bc-checkbox-input__checkbox--disabled" : ""
526
526
  )
527
527
  ),
528
- c.id(h),
529
- c.role("checkbox"),
530
- c.tabindex(
531
- S.map(
528
+ o.id(u),
529
+ o.role("checkbox"),
530
+ o.tabindex(
531
+ E.map(
532
532
  i ?? !1,
533
- (u) => u ? -1 : 0
533
+ (h) => h ? -1 : 0
534
534
  )
535
535
  ),
536
- x.checked(s),
537
- x.disabled(i),
538
- r != null ? x.labelledby(b) : C,
539
- D.keydown(g),
540
- t != null ? D.blur(t) : C,
541
- B({
536
+ F.checked(s),
537
+ F.disabled(i),
538
+ r != null ? F.labelledby(m) : T,
539
+ I.keydown(D),
540
+ t != null ? I.blur(t) : T,
541
+ R({
542
542
  icon: w(
543
543
  s,
544
544
  a,
545
- o
545
+ c
546
546
  )(
547
- (u, d, v) => u ? d ?? "akar-icons/check-box-fill" : v ?? "akar-icons/box"
547
+ (h, v, C) => h ? v ?? "akar-icons/check-box-fill" : C ?? "akar-icons/box"
548
548
  ),
549
549
  accessibility: "decorative",
550
550
  size: p
551
551
  })
552
552
  ),
553
553
  r != null ? f.label(
554
- c.class("bc-checkbox-input__label"),
555
- c.id(b),
556
- c.for(h),
557
- de(r)
558
- ) : C
554
+ o.class("bc-checkbox-input__label"),
555
+ o.id(m),
556
+ o.for(u),
557
+ ae(r)
558
+ ) : T
559
559
  )
560
560
  },
561
- D.click(k)
561
+ I.click(k)
562
562
  );
563
- }, pe = f.span(
564
- c.class("bc-input-wrapper__required"),
563
+ }, le = f.span(
564
+ o.class("bc-input-wrapper__required"),
565
565
  " *"
566
566
  );
567
- function fe(e) {
567
+ function ce(e) {
568
568
  const s = ["bc-input-wrapper"];
569
569
  return e !== "vertical" && s.push(`bc-input-wrapper--${e}`), s.join(" ");
570
570
  }
571
- function be(e, s) {
571
+ function oe(e, s) {
572
572
  const t = ["bc-input-wrapper__label-text"];
573
573
  return e ? t.push("bc-input-wrapper__label-text--error") : s ? t.push("bc-input-wrapper__label-text--disabled") : t.push("bc-input-wrapper__label-text--default"), t.join(" ");
574
574
  }
575
- function me(e, s) {
575
+ function ue(e, s) {
576
576
  if (e === "horizontal-fixed" && s != null)
577
577
  return `--input-wrapper-label-width: ${s}`;
578
578
  }
579
- const Y = ({
579
+ const W = ({
580
580
  fullWidth: e = !1,
581
581
  required: s,
582
582
  label: t,
@@ -585,206 +585,112 @@ const Y = ({
585
585
  description: i,
586
586
  content: l,
587
587
  error: a,
588
- labelFor: o,
588
+ labelFor: c,
589
589
  hasError: p,
590
- disabled: h,
591
- layout: b,
590
+ disabled: u,
591
+ layout: m,
592
592
  labelWidth: k
593
- }, ...g) => {
594
- const u = p ?? a != null, d = h ?? !1, v = b ?? "vertical", I = H("input-wrapper"), A = i ? `${I}-description` : void 0, P = a != null ? `${I}-error` : void 0, L = w(v)((T) => T !== "vertical"), te = w(
595
- v,
593
+ }, ...D) => {
594
+ const h = p ?? a != null, v = u ?? !1, C = m ?? "vertical", M = N("input-wrapper"), O = i ? `${M}-description` : void 0, B = a != null ? `${M}-error` : void 0, P = w(C)((y) => y !== "vertical"), Q = w(
595
+ C,
596
596
  k ?? void 0
597
- )((T, O) => me(T, O));
597
+ )((y, A) => ue(y, A));
598
598
  return f.div(
599
- c.class(S.map(v, (T) => fe(T))),
600
- c.class(
601
- S.map(
599
+ o.class(E.map(C, (y) => ce(y))),
600
+ o.class(
601
+ E.map(
602
602
  e,
603
- (T) => T ? "bc-input-wrapper--full-width" : ""
603
+ (y) => y ? "bc-input-wrapper--full-width" : ""
604
604
  )
605
605
  ),
606
- c.style(te),
606
+ o.style(Q),
607
607
  t != null || r != null ? f.div(
608
- c.class("bc-input-wrapper__header"),
608
+ o.class("bc-input-wrapper__header"),
609
609
  f.div(
610
- c.class("bc-input-wrapper__label-section"),
610
+ o.class("bc-input-wrapper__label-section"),
611
611
  f.label(
612
- c.class("bc-input-wrapper__label"),
613
- o != null ? c.for(o) : C,
612
+ o.class("bc-input-wrapper__label"),
613
+ c != null ? o.for(c) : T,
614
614
  f.span(
615
- c.class(
615
+ o.class(
616
616
  w(
617
- u,
618
- d
617
+ h,
618
+ v
619
619
  )(
620
- (T, O) => be(
621
- T ?? !1,
622
- O ?? !1
620
+ (y, A) => oe(
621
+ y ?? !1,
622
+ A ?? !1
623
623
  )
624
624
  )
625
625
  ),
626
626
  t
627
627
  ),
628
- t != null && s ? pe : C
628
+ t != null && s ? le : T
629
629
  ),
630
630
  // Show description under label when horizontal
631
- V(
631
+ x(
632
632
  w(
633
- L,
633
+ P,
634
634
  i
635
- )((T, O) => T && O != null),
635
+ )((y, A) => y && A != null),
636
636
  () => f.div(
637
- c.class(
637
+ o.class(
638
638
  "bc-input-wrapper__description bc-input-wrapper__description--under-label"
639
639
  ),
640
- c.id(A),
640
+ o.id(O),
641
641
  i
642
642
  )
643
643
  )
644
644
  ),
645
- r != null ? he(r) : C,
645
+ r != null ? ie(r) : T,
646
646
  n
647
- ) : C,
647
+ ) : T,
648
648
  f.div(
649
- c.class("bc-input-wrapper__content"),
649
+ o.class("bc-input-wrapper__content"),
650
650
  // Add data attributes to help inputs inherit accessibility information
651
- [A, P].filter(Boolean).length > 0 ? R.describedby(
652
- [A, P].filter(Boolean).join(" ")
653
- ) : C,
654
- s ? R.required("true") : C,
655
- V(u, () => R.invalid("true")),
651
+ [O, B].filter(Boolean).length > 0 ? j.describedby(
652
+ [O, B].filter(Boolean).join(" ")
653
+ ) : T,
654
+ s ? j.required("true") : T,
655
+ x(h, () => j.invalid("true")),
656
656
  l
657
657
  ),
658
658
  // Show description at bottom only when not horizontal
659
- V(
660
- w(L, i)((T, O) => !T && O != null),
659
+ x(
660
+ w(P, i)((y, A) => !y && A != null),
661
661
  () => f.div(
662
- c.class("bc-input-wrapper__description"),
663
- c.id(A),
662
+ o.class("bc-input-wrapper__description"),
663
+ o.id(O),
664
664
  i
665
665
  )
666
666
  ),
667
- V(
668
- u,
667
+ x(
668
+ h,
669
669
  () => f.div(
670
- c.class("bc-input-wrapper__error"),
671
- c.id(P),
672
- x.live("polite"),
670
+ o.class("bc-input-wrapper__error"),
671
+ o.id(B),
672
+ F.live("polite"),
673
673
  // Announce errors to screen readers
674
- c.role("alert"),
674
+ o.role("alert"),
675
675
  // Mark as alert for immediate attention
676
676
  a
677
677
  )
678
678
  ),
679
- ...g
679
+ ...D
680
680
  );
681
681
  };
682
- function $e(...e) {
683
- return f.div(c.class("bc-stack"), ...e);
682
+ function Te(...e) {
683
+ return f.div(o.class("bc-stack"), ...e);
684
684
  }
685
- const xe = (e) => {
686
- const s = {
687
- name: "email",
688
- autocomplete: "email",
689
- ...e
690
- }, {
691
- value: t,
692
- before: n,
693
- onBlur: r,
694
- onChange: i,
695
- onInput: l,
696
- placeholder: a
697
- } = s, o = n ?? ce({
698
- icon: "line-md:email",
699
- size: e.size,
700
- color: "neutral"
701
- });
702
- return q(
703
- z,
704
- (p) => W({
705
- ...e,
706
- before: o,
707
- input: ne.email(
708
- X(s),
709
- c.placeholder(Q(a, p.$.emailPlaceholderText)),
710
- c.value(t),
711
- c.class("bc-input"),
712
- r != null ? D.blur(F(r)) : C,
713
- i != null ? D.change(F(i)) : C,
714
- l != null ? D.input(F(l)) : C
715
- )
716
- })
717
- );
718
- }, Ne = (e) => {
719
- const {
720
- value: s,
721
- onBlur: t,
722
- onChange: n,
723
- onInput: r,
724
- before: i,
725
- after: l,
726
- hasError: a,
727
- disabled: o,
728
- autocomplete: p,
729
- placeholder: h,
730
- ...b
731
- } = e, k = {
732
- name: "password",
733
- disabled: o,
734
- ...b
735
- }, g = E(!0), u = w(
736
- g,
737
- p
738
- )((d, v) => d ? v ?? "current-password" : "off");
739
- return q(z, (d) => {
740
- const v = w(
741
- d.$.passwordPlaceholderText,
742
- g,
743
- h
744
- )((A, P, L) => P ? "•••••••••••••••" : L ?? A), I = f.button(
745
- c.type("button"),
746
- c.class("bc-input-container__password-toggle"),
747
- x.label(d.$.togglePasswordVisibility),
748
- D.click(() => g.update((A) => !A)),
749
- V(
750
- g,
751
- () => B({ icon: "line-md:watch" }),
752
- () => B({ icon: "line-md:watch-off" })
753
- )
754
- );
755
- return W({
756
- before: i,
757
- disabled: o,
758
- hasError: a,
759
- input: f.input(
760
- X({
761
- ...k,
762
- autocomplete: u,
763
- placeholder: v
764
- }),
765
- V(
766
- g,
767
- () => N(c.type("password")),
768
- () => N(c.type("text"))
769
- ),
770
- c.class("bc-input"),
771
- c.value(s),
772
- t != null ? D.blur(F(t)) : C,
773
- n != null ? D.change(F(n)) : C,
774
- r != null ? D.input(F(r)) : C
775
- ),
776
- after: l != null ? N(I, l) : I
777
- });
778
- });
779
- }, ge = (
685
+ const he = (
780
686
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
781
687
  (e, s) => () => {
782
688
  e.markTouched(), s?.();
783
689
  }
784
- ), G = (e, s) => (t) => {
690
+ ), z = (e, s) => (t) => {
785
691
  e.change(t), s?.(t);
786
692
  };
787
- function Z(e, s) {
693
+ function K(e, s) {
788
694
  const { controller: t, onBlur: n, onChange: r, id: i, triggerOn: l, ...a } = s;
789
695
  return e({
790
696
  id: i ?? t.name,
@@ -793,20 +699,20 @@ function Z(e, s) {
793
699
  hasError: t.errorVisible,
794
700
  name: t.name,
795
701
  ...a,
796
- onInput: l === "input" ? G(t, r) : void 0,
797
- onChange: l !== "input" ? G(t, r) : void 0,
798
- onBlur: ge(t, n)
702
+ onInput: l === "input" ? z(t, r) : void 0,
703
+ onChange: l !== "input" ? z(t, r) : void 0,
704
+ onBlur: he(t, n)
799
705
  });
800
706
  }
801
- function Pe(e, { id: s, labelFor: t, ...n }, ...r) {
802
- const i = s ?? n.controller.name ?? H("control"), l = t ?? i;
803
- return Y(
707
+ function _e(e, { id: s, labelFor: t, ...n }, ...r) {
708
+ const i = s ?? n.controller.name ?? N("control"), l = t ?? i;
709
+ return W(
804
710
  {
805
711
  ...n,
806
712
  hasError: n.controller.errorVisible,
807
- error: re(n.controller.error.map((a) => a ?? "")),
713
+ error: Z(n.controller.error.map((a) => a ?? "")),
808
714
  labelFor: l,
809
- content: Z(
715
+ content: K(
810
716
  (a) => e({ ...a, id: i }),
811
717
  n
812
718
  )
@@ -814,24 +720,24 @@ function Pe(e, { id: s, labelFor: t, ...n }, ...r) {
814
720
  ...r
815
721
  );
816
722
  }
817
- function ve(e, s) {
723
+ function de(e, s) {
818
724
  const { toInput: t, fromInput: n, controller: r, ...i } = s, l = r.transform(t, n);
819
- return Z(e, {
725
+ return K(e, {
820
726
  ...i,
821
727
  controller: l
822
728
  });
823
729
  }
824
- function Be(e, {
730
+ function Ae(e, {
825
731
  id: s,
826
732
  labelFor: t,
827
733
  ...n
828
734
  }, ...r) {
829
- const i = s ?? n.controller.name ?? H("control");
830
- return Y(
735
+ const i = s ?? n.controller.name ?? N("control");
736
+ return W(
831
737
  {
832
738
  ...n,
833
739
  labelFor: t ?? i,
834
- content: ve(e, {
740
+ content: de(e, {
835
741
  ...n,
836
742
  id: i
837
743
  })
@@ -839,33 +745,33 @@ function Be(e, {
839
745
  ...r
840
746
  );
841
747
  }
842
- function Le(e) {
748
+ function Ie(e) {
843
749
  return e.split(".").map((t) => {
844
750
  const n = t.match(/^\[(\d+)\]$/);
845
751
  return n ? Number(n[1]) : t;
846
752
  });
847
753
  }
848
- function ye(e) {
754
+ function pe(e) {
849
755
  return typeof e == "number" ? `[${e}]` : `.${e}`;
850
756
  }
851
- function we(e) {
757
+ function fe(e) {
852
758
  if (e.length === 0) return "";
853
759
  const [s, ...t] = e;
854
760
  return [
855
761
  typeof s == "number" ? `[${s}]` : s,
856
- ...t.map(ye)
762
+ ...t.map(pe)
857
763
  ].join("");
858
764
  }
859
- function j(e) {
765
+ function L(e) {
860
766
  return function(t) {
861
767
  if (t.type === "valid") return t;
862
768
  let n = t.error;
863
769
  for (const r of e)
864
- if (n = n?.dependencies?.[r], n == null) return _.valid;
865
- return _.invalid(n);
770
+ if (n = n?.dependencies?.[r], n == null) return g.valid;
771
+ return g.invalid(n);
866
772
  };
867
773
  }
868
- class M {
774
+ class _ {
869
775
  path;
870
776
  change;
871
777
  signal;
@@ -877,42 +783,42 @@ class M {
877
783
  dirty;
878
784
  dependencyErrors;
879
785
  #e = {
880
- disabled: E(!1),
881
- touched: E(!1)
786
+ disabled: S(!1),
787
+ touched: S(!1)
882
788
  };
883
789
  #t;
884
- #s = E(void 0);
790
+ #s = S(void 0);
885
791
  parent;
886
792
  disabled;
887
793
  #n = [];
888
794
  disabledOrHasErrors;
889
- constructor(s, t, n, r, i, l = $) {
795
+ constructor(s, t, n, r, i, l = V) {
890
796
  this.path = s, this.change = t, this.signal = n, this.status = r, this.#t = l, this.#s.set(n.value), this.error = r.map(
891
797
  (a) => a?.type === "invalid" ? a.error?.message : void 0
892
798
  ), this.hasError = this.error.map((a) => a != null), this.touched = this.#e.touched, i.validationMode ? this.errorVisible = w(
893
799
  this.hasError,
894
800
  this.touched,
895
801
  i.validationMode
896
- )((a, o, p) => p === "eager" ? !!a : !!a && !!o) : this.errorVisible = w(
802
+ )((a, c, p) => p === "eager" ? !!a : !!a && !!c) : this.errorVisible = w(
897
803
  this.hasError,
898
804
  this.touched
899
- )((a, o) => !!a && !!o), this.dirty = w(
805
+ )((a, c) => !!a && !!c), this.dirty = w(
900
806
  this.signal,
901
807
  this.#s
902
- )((a, o) => !this.#t(a, o)), this.dependencyErrors = r.map(
808
+ )((a, c) => !this.#t(a, c)), this.dependencyErrors = r.map(
903
809
  (a) => a?.type === "invalid" ? a.error?.dependencies : void 0
904
810
  ), this.parent = i, this.disabled = w(
905
811
  this.#e.disabled,
906
812
  i.disabled
907
- )((a, o) => a || o), this.disabledOrHasErrors = w(
813
+ )((a, c) => a || c), this.disabledOrHasErrors = w(
908
814
  this.disabled,
909
815
  this.hasError
910
- )((a, o) => a || o), this.onDispose(() => {
816
+ )((a, c) => a || c), this.onDispose(() => {
911
817
  this.#e.disabled.dispose(), this.#e.touched.dispose(), this.disabled.dispose(), this.error.dispose(), this.errorVisible.dispose(), this.dirty.dispose(), this.#s.dispose(), this.dependencyErrors.dispose(), this.disabledOrHasErrors.dispose();
912
818
  });
913
819
  }
914
820
  get name() {
915
- return we(this.path);
821
+ return fe(this.path);
916
822
  }
917
823
  onDispose = (s) => {
918
824
  this.#n.push(s);
@@ -943,7 +849,7 @@ class M {
943
849
  reset = () => {
944
850
  this.change(this.#s.value);
945
851
  };
946
- array = (s = $) => new Se(
852
+ array = (s = V) => new me(
947
853
  this.path,
948
854
  this.change,
949
855
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -952,7 +858,7 @@ class M {
952
858
  this.parent,
953
859
  s
954
860
  );
955
- object = (s = $) => new ke(
861
+ object = (s = V) => new be(
956
862
  this.path,
957
863
  this.change,
958
864
  this.signal,
@@ -960,38 +866,38 @@ class M {
960
866
  this.parent,
961
867
  s
962
868
  );
963
- transform = (s, t, n = [], r = $) => new M(
869
+ transform = (s, t, n = [], r = V) => new _(
964
870
  [...this.path, ...n],
965
871
  (i) => this.change(t(i)),
966
872
  this.signal.map(s, r),
967
- this.status.map(j(n)),
873
+ this.status.map(L(n)),
968
874
  this.parent,
969
875
  r
970
876
  );
971
- asyncTransform = (s, t, n, r = [], i = $) => new M(
877
+ asyncTransform = (s, t, n, r = [], i = V) => new _(
972
878
  [...this.path, ...r],
973
879
  (l) => {
974
880
  t(l).then((a) => this.change(a));
975
881
  },
976
882
  this.signal.mapAsync(s, n, void 0, i),
977
- this.status.map(j(r)),
883
+ this.status.map(L(r)),
978
884
  this.parent,
979
885
  i
980
886
  );
981
887
  }
982
- class ke extends M {
888
+ class be extends _ {
983
889
  #e = /* @__PURE__ */ new Map();
984
890
  #t = /* @__PURE__ */ new Map();
985
891
  #s = /* @__PURE__ */ new Map();
986
- #n = E(!1);
892
+ #n = S(!1);
987
893
  touchedDeep = this.#n;
988
894
  #i = /* @__PURE__ */ new Map();
989
895
  #r = /* @__PURE__ */ new Map();
990
- #l = E(!1);
896
+ #l = S(!1);
991
897
  dirtyDeep = this.#l;
992
- #c;
898
+ #o;
993
899
  #u;
994
- #o = () => {
900
+ #c = () => {
995
901
  let s = !1;
996
902
  for (const t of this.#t.values())
997
903
  if (t) {
@@ -1004,24 +910,24 @@ class ke extends M {
1004
910
  super(
1005
911
  s,
1006
912
  t,
1007
- n.map((o) => o ?? {}, l),
913
+ n.map((c) => c ?? {}, l),
1008
914
  r,
1009
915
  i,
1010
916
  l
1011
- ), this.#c = this.touched.on(() => {
1012
- this.#o();
917
+ ), this.#o = this.touched.on(() => {
918
+ this.#c();
1013
919
  }), this.#u = this.dirty.on(() => {
1014
920
  this.#a();
1015
921
  });
1016
922
  const a = this.signal.on(() => this.#a());
1017
923
  this.onDispose(() => {
1018
- for (const o of this.#e.values())
1019
- o.dispose();
924
+ for (const c of this.#e.values())
925
+ c.dispose();
1020
926
  this.#e.clear();
1021
- for (const o of this.#s.values()) o();
927
+ for (const c of this.#s.values()) c();
1022
928
  this.#s.clear(), this.#t.clear(), this.#n.dispose();
1023
- for (const o of this.#r.values()) o();
1024
- this.#r.clear(), this.#i.clear(), this.#l.dispose(), this.#c(), this.#u(), a();
929
+ for (const c of this.#r.values()) c();
930
+ this.#r.clear(), this.#i.clear(), this.#l.dispose(), this.#o(), this.#u(), a();
1025
931
  });
1026
932
  }
1027
933
  field = (s) => {
@@ -1032,11 +938,11 @@ class ke extends M {
1032
938
  ...this.signal.value,
1033
939
  [s]: l
1034
940
  });
1035
- }, n = new M(
941
+ }, n = new _(
1036
942
  [...this.path, s],
1037
943
  t,
1038
944
  this.signal.map((l) => l[s]),
1039
- this.status.map(j([s])),
945
+ this.status.map(L([s])),
1040
946
  {
1041
947
  disabled: this.disabled,
1042
948
  // propagate validationMode to children if present
@@ -1045,7 +951,7 @@ class ke extends M {
1045
951
  );
1046
952
  this.#e.set(s, n);
1047
953
  const r = n.touched.on((l) => {
1048
- this.#t.set(s, l), this.#o();
954
+ this.#t.set(s, l), this.#c();
1049
955
  });
1050
956
  this.#s.set(s, r);
1051
957
  const i = n.dirty.on((l) => {
@@ -1079,20 +985,20 @@ class ke extends M {
1079
985
  this.#l.set(this.dirty.value || s);
1080
986
  };
1081
987
  }
1082
- class Se extends M {
988
+ class me extends _ {
1083
989
  #e = new Array();
1084
990
  length;
1085
991
  #t = /* @__PURE__ */ new Map();
1086
992
  #s = /* @__PURE__ */ new Map();
1087
- #n = E(!1);
993
+ #n = S(!1);
1088
994
  touchedDeep = this.#n;
1089
995
  #i = /* @__PURE__ */ new Map();
1090
996
  #r = /* @__PURE__ */ new Map();
1091
- #l = E(!1);
997
+ #l = S(!1);
1092
998
  dirtyDeep = this.#l;
1093
- #c;
999
+ #o;
1094
1000
  #u;
1095
- #o = () => {
1001
+ #c = () => {
1096
1002
  let s = !1;
1097
1003
  for (const t of this.#t.values())
1098
1004
  if (t) {
@@ -1102,29 +1008,29 @@ class Se extends M {
1102
1008
  this.#n.set(this.touched.value || s);
1103
1009
  };
1104
1010
  constructor(s, t, n, r, i, l) {
1105
- const a = n.map((h) => h ?? [], l);
1011
+ const a = n.map((u) => u ?? [], l);
1106
1012
  super(s, t, a, r, i, l);
1107
- const o = a.on((h) => {
1108
- const b = this.#e.length - h.length;
1109
- b > 0 && (this.#e.splice(h.length, b).forEach((k, g) => {
1110
- const u = h.length + g;
1111
- k.dispose(), this.#s.get(u)?.(), this.#s.delete(u), this.#t.delete(u), this.#r.get(u)?.(), this.#r.delete(u), this.#i.delete(u);
1112
- }), this.#o(), this.#a());
1013
+ const c = a.on((u) => {
1014
+ const m = this.#e.length - u.length;
1015
+ m > 0 && (this.#e.splice(u.length, m).forEach((k, D) => {
1016
+ const h = u.length + D;
1017
+ k.dispose(), this.#s.get(h)?.(), this.#s.delete(h), this.#t.delete(h), this.#r.get(h)?.(), this.#r.delete(h), this.#i.delete(h);
1018
+ }), this.#c(), this.#a());
1113
1019
  });
1114
- this.length = a.map((h) => h.length), this.#c = this.touched.on(() => {
1115
- this.#o();
1020
+ this.length = a.map((u) => u.length), this.#o = this.touched.on(() => {
1021
+ this.#c();
1116
1022
  }), this.#u = this.dirty.on(() => {
1117
1023
  this.#a();
1118
1024
  });
1119
1025
  const p = this.signal.on(() => this.#a());
1120
1026
  this.onDispose(() => {
1121
- for (const h of this.#e)
1122
- h.dispose();
1123
- this.length.dispose(), this.#e.length = 0, o(), a.dispose();
1124
- for (const h of this.#s.values()) h();
1027
+ for (const u of this.#e)
1028
+ u.dispose();
1029
+ this.length.dispose(), this.#e.length = 0, c(), a.dispose();
1030
+ for (const u of this.#s.values()) u();
1125
1031
  this.#s.clear(), this.#t.clear(), this.#n.dispose();
1126
- for (const h of this.#r.values()) h();
1127
- this.#r.clear(), this.#i.clear(), this.#l.dispose(), this.#c(), this.#u(), p();
1032
+ for (const u of this.#r.values()) u();
1033
+ this.#r.clear(), this.#i.clear(), this.#l.dispose(), this.#o(), this.#u(), p();
1128
1034
  });
1129
1035
  }
1130
1036
  item = (s) => {
@@ -1133,11 +1039,11 @@ class Se extends M {
1133
1039
  const t = async (l) => {
1134
1040
  const a = this.signal.value.slice();
1135
1041
  a[s] = l, this.change(a);
1136
- }, n = new M(
1042
+ }, n = new _(
1137
1043
  [...this.path, s],
1138
1044
  t,
1139
1045
  this.signal.map((l) => l[s]),
1140
- this.status.map(j([s])),
1046
+ this.status.map(L([s])),
1141
1047
  {
1142
1048
  disabled: this.disabled,
1143
1049
  validationMode: this.parent.validationMode
@@ -1145,7 +1051,7 @@ class Se extends M {
1145
1051
  );
1146
1052
  this.#e[s] = n;
1147
1053
  const r = n.touched.on((l) => {
1148
- this.#t.set(s, l), this.#o();
1054
+ this.#t.set(s, l), this.#c();
1149
1055
  });
1150
1056
  this.#s.set(s, r);
1151
1057
  const i = n.dirty.on((l) => {
@@ -1199,7 +1105,7 @@ class Se extends M {
1199
1105
  this.#l.set(this.dirty.value || s);
1200
1106
  };
1201
1107
  }
1202
- function Ce(e) {
1108
+ function ge(e) {
1203
1109
  function s(t) {
1204
1110
  return typeof t == "number" ? t : t.toString();
1205
1111
  }
@@ -1207,13 +1113,13 @@ function Ce(e) {
1207
1113
  (t) => typeof t == "object" && t.key != null ? s(t.key) : s(t)
1208
1114
  );
1209
1115
  }
1210
- function _e(e) {
1116
+ function ve(e) {
1211
1117
  const s = e.filter((r) => r.path == null || r.path.length === 0).map((r) => r.message), t = e.filter((r) => r.path != null && r.path.length > 0).reduce((r, i) => {
1212
- const l = Ce(i.path), a = l.pop();
1213
- let o = r;
1118
+ const l = ge(i.path), a = l.pop();
1119
+ let c = r;
1214
1120
  for (const p of l)
1215
- o.dependencies == null && (o.dependencies = {}), o.dependencies[p] == null && (o.dependencies[p] = {}), o = o.dependencies[p];
1216
- return o.dependencies == null && (o.dependencies = {}), o.dependencies[a] = { message: i.message }, r;
1121
+ c.dependencies == null && (c.dependencies = {}), c.dependencies[p] == null && (c.dependencies[p] = {}), c = c.dependencies[p];
1122
+ return c.dependencies == null && (c.dependencies = {}), c.dependencies[a] = { message: i.message }, r;
1217
1123
  }, {}), n = s.join(`
1218
1124
  `);
1219
1125
  return {
@@ -1221,7 +1127,7 @@ function _e(e) {
1221
1127
  message: n != "" ? n : void 0
1222
1128
  };
1223
1129
  }
1224
- function De({
1130
+ function ye({
1225
1131
  initialValue: e,
1226
1132
  onChange: s,
1227
1133
  validate: t,
@@ -1229,68 +1135,68 @@ function De({
1229
1135
  validationMode: r,
1230
1136
  validateDebounceMs: i
1231
1137
  }) {
1232
- const l = S.deriveProp(e), a = E(_.valid), o = E(!1), p = E(r ?? "onTouched"), h = (d) => {
1233
- a.set(d);
1138
+ const l = E.deriveProp(e), a = S(g.valid), c = S(!1), p = S(r ?? "onTouched"), u = (v) => {
1139
+ a.set(v);
1234
1140
  };
1235
- let b;
1236
- const k = async (d) => {
1141
+ let m;
1142
+ const k = async (v) => {
1237
1143
  if (t != null) {
1238
- const v = await t(d);
1239
- h(v);
1144
+ const C = await t(v);
1145
+ u(C);
1240
1146
  }
1241
- }, g = async (d) => {
1242
- l.set(d), s?.(d);
1243
- const v = p.value;
1147
+ }, D = async (v) => {
1148
+ l.set(v), s?.(v);
1149
+ const C = p.value;
1244
1150
  if (t != null) {
1245
- if (v === "onSubmit")
1151
+ if (C === "onSubmit")
1246
1152
  return;
1247
- const I = i ?? 0;
1248
- I > 0 ? (b && clearTimeout(b), b = setTimeout(() => {
1249
- k(d);
1250
- }, I)) : await k(d);
1153
+ const M = i ?? 0;
1154
+ M > 0 ? (m && clearTimeout(m), m = setTimeout(() => {
1155
+ k(v);
1156
+ }, M)) : await k(v);
1251
1157
  }
1252
- }, u = new M(
1158
+ }, h = new _(
1253
1159
  [],
1254
- g,
1160
+ D,
1255
1161
  l,
1256
1162
  a,
1257
1163
  {
1258
- disabled: o,
1164
+ disabled: c,
1259
1165
  validationMode: p
1260
1166
  },
1261
- n ?? $
1167
+ n ?? V
1262
1168
  );
1263
- return u.onDispose(() => {
1264
- o.dispose(), l.dispose(), a.dispose(), p.dispose(), b && clearTimeout(b);
1265
- }), { controller: u, setStatus: h };
1169
+ return h.onDispose(() => {
1170
+ c.dispose(), l.dispose(), a.dispose(), p.dispose(), m && clearTimeout(m);
1171
+ }), { controller: h, setStatus: u };
1266
1172
  }
1267
- function ee(e) {
1268
- return N(c.disabled(e.disabled), c.name(e.name));
1173
+ function G(e) {
1174
+ return q(o.disabled(e.disabled), o.name(e.name));
1269
1175
  }
1270
- function je(e, {
1176
+ function Ve(e, {
1271
1177
  triggerOn: s = "change"
1272
1178
  } = {}) {
1273
- return N(
1274
- ee(e),
1275
- c.value(e.signal),
1276
- (s === "input" ? D.input : D.change)(F(e.change))
1179
+ return q(
1180
+ G(e),
1181
+ o.value(e.signal),
1182
+ (s === "input" ? I.input : I.change)(ee(e.change))
1277
1183
  );
1278
1184
  }
1279
- function qe(e, {
1185
+ function Me(e, {
1280
1186
  triggerOn: s = "change"
1281
1187
  } = {}) {
1282
- return N(
1283
- ee(e),
1284
- c.valueAsNumber(e.signal),
1285
- (s === "input" ? D.input : D.change)(
1286
- ie(e.change)
1188
+ return q(
1189
+ G(e),
1190
+ o.valueAsNumber(e.signal),
1191
+ (s === "input" ? I.input : I.change)(
1192
+ se(e.change)
1287
1193
  )
1288
1194
  );
1289
1195
  }
1290
- function J(e) {
1291
- return e.issues != null ? _.invalid(_e(e.issues)) : _.valid;
1196
+ function U(e) {
1197
+ return e.issues != null ? g.invalid(ve(e.issues)) : g.valid;
1292
1198
  }
1293
- async function ze({
1199
+ async function Fe({
1294
1200
  task: e,
1295
1201
  errorMessage: s,
1296
1202
  errorPath: t = ["root"],
@@ -1298,17 +1204,17 @@ async function ze({
1298
1204
  }) {
1299
1205
  try {
1300
1206
  const r = await e();
1301
- return n != null ? n(r) : _.valid;
1207
+ return n != null ? n(r) : g.valid;
1302
1208
  } catch (r) {
1303
1209
  const i = s ?? (r instanceof Error ? r.message : "Operation failed");
1304
- return t.length === 1 && t[0] === "root" ? _.invalid({
1210
+ return t.length === 1 && t[0] === "root" ? g.invalid({
1305
1211
  message: i
1306
- }) : _.invalid({
1307
- dependencies: se(t, i)
1212
+ }) : g.invalid({
1213
+ dependencies: J(t, i)
1308
1214
  });
1309
1215
  }
1310
1216
  }
1311
- function se(e, s) {
1217
+ function J(e, s) {
1312
1218
  if (e.length === 1)
1313
1219
  return {
1314
1220
  [e[0]]: { message: s }
@@ -1316,186 +1222,77 @@ function se(e, s) {
1316
1222
  const [t, ...n] = e;
1317
1223
  return {
1318
1224
  [t]: {
1319
- dependencies: se(n, s)
1225
+ dependencies: J(n, s)
1320
1226
  }
1321
1227
  };
1322
1228
  }
1323
- function He({
1229
+ function Oe({
1324
1230
  initialValue: e = {},
1325
1231
  schema: s,
1326
- onSubmit: t = async () => _.valid,
1232
+ onSubmit: t = async () => g.valid,
1327
1233
  validationMode: n,
1328
1234
  validateDebounceMs: r
1329
1235
  }) {
1330
- const { controller: i, setStatus: l } = De({
1236
+ const { controller: i, setStatus: l } = ye({
1331
1237
  initialValue: e,
1332
1238
  validationMode: n ?? "onTouched",
1333
1239
  validateDebounceMs: r,
1334
- validate: (n ?? "onTouched") === "onSubmit" || s == null ? void 0 : async (h) => J(
1335
- await s["~standard"].validate(h)
1240
+ validate: (n ?? "onTouched") === "onSubmit" || s == null ? void 0 : async (u) => U(
1241
+ await s["~standard"].validate(u)
1336
1242
  )
1337
- }), a = E(!1), o = i.object();
1338
- return o.onDispose(a.dispose), {
1339
- controller: o,
1243
+ }), a = S(!1), c = i.object();
1244
+ return c.onDispose(a.dispose), {
1245
+ controller: c,
1340
1246
  setStatus: l,
1341
- submit: async (h) => {
1342
- if (a.set(!0), h?.preventDefault(), o.markAllTouched(), s != null) {
1343
- const k = o.signal.value, g = J(
1247
+ submit: async (u) => {
1248
+ if (a.set(!0), u?.preventDefault(), c.markAllTouched(), s != null) {
1249
+ const k = c.signal.value, D = U(
1344
1250
  await s["~standard"].validate(k)
1345
1251
  );
1346
- if (l(g), g.type === "invalid") {
1252
+ if (l(D), D.type === "invalid") {
1347
1253
  a.set(!1);
1348
1254
  return;
1349
1255
  }
1350
1256
  }
1351
- const b = await t(o.signal.value);
1352
- a.set(!1), b.type === "invalid" && l(b);
1257
+ const m = await t(c.signal.value);
1258
+ a.set(!1), m.type === "invalid" && l(m);
1353
1259
  },
1354
1260
  submitting: a
1355
1261
  };
1356
1262
  }
1357
- function Te(e) {
1358
- switch (e) {
1359
- case "success":
1360
- return "material-symbols:check-circle-outline";
1361
- case "warning":
1362
- return "material-symbols:warning-outline";
1363
- case "danger":
1364
- return "material-symbols:error-outline";
1365
- case "info":
1366
- default:
1367
- return "material-symbols:info-outline";
1368
- }
1369
- }
1370
- function Ee(e) {
1371
- switch (e) {
1372
- case "success":
1373
- return "success";
1374
- case "warning":
1375
- return "warning";
1376
- case "danger":
1377
- return "danger";
1378
- case "info":
1379
- default:
1380
- return "info";
1381
- }
1382
- }
1383
- function Ie(e, s, t, n) {
1384
- const r = [
1385
- "bc-notice",
1386
- `bc-notice--${e}`,
1387
- `bc-notice--tone-${s}`
1388
- ];
1389
- return t && r.push("bc-notice--dismissible"), n && n.length > 0 && r.push(n), r.join(" ");
1390
- }
1391
- function Ue({
1392
- variant: e = "info",
1393
- tone: s = "subtle",
1394
- role: t,
1395
- title: n,
1396
- icon: r,
1397
- closable: i = !1,
1398
- onDismiss: l,
1399
- class: a
1400
- }, ...o) {
1401
- const p = E(!0);
1402
- return V(p, () => {
1403
- const h = S.map(
1404
- i,
1405
- (u) => !!u || l != null
1406
- ), b = S.map(e, (u) => u ?? "info"), k = S.map(s, (u) => u ?? "subtle"), g = w(
1407
- t,
1408
- b
1409
- )(
1410
- (u, d) => u ?? (d === "danger" ? "alert" : "status")
1411
- );
1412
- return q(
1413
- z,
1414
- (u) => f.div(
1415
- c.class(
1416
- w(
1417
- b,
1418
- k,
1419
- h,
1420
- a
1421
- )((d, v, I, A) => Ie(d, v, I, A))
1422
- ),
1423
- // Accessibility role mapping (always defined)
1424
- c.role(S.map(g, (d) => d)),
1425
- ae(
1426
- S.map(r, (d) => d === !1),
1427
- () => f.div(
1428
- c.class("bc-notice__icon"),
1429
- B({
1430
- icon: w(
1431
- r,
1432
- b
1433
- )(
1434
- (d, v) => d === void 0 ? Te(v) : String(d)
1435
- ),
1436
- size: "md",
1437
- color: S.map(b, Ee)
1438
- })
1439
- )
1440
- ),
1441
- f.div(
1442
- c.class("bc-notice__body"),
1443
- le(
1444
- n,
1445
- (d) => f.div(c.class("bc-notice__title"), d)
1446
- ),
1447
- f.div(c.class("bc-notice__content"), ...o)
1448
- ),
1449
- V(
1450
- h,
1451
- () => ue({
1452
- size: "xs",
1453
- label: u.$.closeModal,
1454
- onClick: () => {
1455
- p.set(!1), l?.();
1456
- }
1457
- })
1458
- )
1459
- )
1460
- );
1461
- });
1462
- }
1463
1263
  export {
1464
- Se as A,
1465
- Z as B,
1466
- ue as C,
1467
- Oe as D,
1468
- xe as E,
1469
- Y as I,
1470
- he as L,
1471
- Be as M,
1472
- Ue as N,
1473
- $ as O,
1474
- Ne as P,
1475
- pe as R,
1476
- $e as S,
1477
- _ as a,
1478
- Fe as b,
1479
- Pe as c,
1480
- G as d,
1481
- M as e,
1482
- j as f,
1483
- ve as g,
1484
- we as h,
1485
- ke as i,
1486
- Ce as j,
1487
- _e as k,
1488
- De as l,
1489
- ge as m,
1490
- ee as n,
1491
- je as o,
1492
- Le as p,
1493
- qe as q,
1494
- J as r,
1495
- H as s,
1496
- ze as t,
1497
- He as u,
1498
- Me as v,
1499
- ye as w,
1500
- de as x
1264
+ me as A,
1265
+ K as B,
1266
+ Se as C,
1267
+ Ce as D,
1268
+ De as E,
1269
+ W as I,
1270
+ ie as L,
1271
+ ae as M,
1272
+ V as O,
1273
+ le as R,
1274
+ Te as S,
1275
+ g as a,
1276
+ Ee as b,
1277
+ _e as c,
1278
+ z as d,
1279
+ _ as e,
1280
+ L as f,
1281
+ be as g,
1282
+ ye as h,
1283
+ de as i,
1284
+ Ae as j,
1285
+ fe as k,
1286
+ ge as l,
1287
+ he as m,
1288
+ ve as n,
1289
+ G as o,
1290
+ Ie as p,
1291
+ Ve as q,
1292
+ Me as r,
1293
+ N as s,
1294
+ Fe as t,
1295
+ Oe as u,
1296
+ U as v,
1297
+ pe as w
1501
1298
  };