@reformer/core 1.0.0-beta.1 → 1.0.0-beta.2

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 (79) hide show
  1. package/dist/behaviors/compute-from.js +3 -3
  2. package/dist/behaviors/enable-when.js +5 -5
  3. package/dist/behaviors/reset-when.js +1 -1
  4. package/dist/behaviors/revalidate-when.js +1 -1
  5. package/dist/behaviors/sync-fields.js +5 -5
  6. package/dist/behaviors/watch-field.js +3 -3
  7. package/dist/behaviors.js +2 -2
  8. package/dist/core/types/field-path.d.ts +2 -2
  9. package/dist/core/types/index.d.ts +1 -1
  10. package/dist/core/types/validation-schema.d.ts +21 -50
  11. package/dist/core/validation/core/index.d.ts +0 -1
  12. package/dist/core/validation/core/validate-async.d.ts +9 -15
  13. package/dist/core/validation/core/validate.d.ts +15 -15
  14. package/dist/core/validation/index.d.ts +5 -3
  15. package/dist/core/validation/validation-applicator.d.ts +2 -56
  16. package/dist/core/validation/validation-registry.d.ts +18 -16
  17. package/dist/core/validation/validators/array-validators.d.ts +6 -31
  18. package/dist/core/validation/validators/email.d.ts +5 -29
  19. package/dist/core/validation/validators/future-date.d.ts +6 -28
  20. package/dist/core/validation/validators/index.d.ts +12 -4
  21. package/dist/core/validation/validators/integer.d.ts +13 -0
  22. package/dist/core/validation/validators/is-date.d.ts +5 -28
  23. package/dist/core/validation/validators/is-number.d.ts +14 -0
  24. package/dist/core/validation/validators/max-age.d.ts +6 -29
  25. package/dist/core/validation/validators/max-date.d.ts +6 -29
  26. package/dist/core/validation/validators/max-length.d.ts +5 -30
  27. package/dist/core/validation/validators/max.d.ts +7 -29
  28. package/dist/core/validation/validators/min-age.d.ts +6 -29
  29. package/dist/core/validation/validators/min-date.d.ts +6 -29
  30. package/dist/core/validation/validators/min-length.d.ts +5 -30
  31. package/dist/core/validation/validators/min.d.ts +7 -29
  32. package/dist/core/validation/validators/multiple-of.d.ts +13 -0
  33. package/dist/core/validation/validators/non-negative.d.ts +13 -0
  34. package/dist/core/validation/validators/non-zero.d.ts +13 -0
  35. package/dist/core/validation/validators/past-date.d.ts +5 -28
  36. package/dist/core/validation/validators/pattern.d.ts +5 -32
  37. package/dist/core/validation/validators/phone.d.ts +9 -19
  38. package/dist/core/validation/validators/required.d.ts +10 -31
  39. package/dist/core/validation/validators/url.d.ts +13 -15
  40. package/dist/{index-D25LsbRm.js → index-DLh_Ryb2.js} +1 -1
  41. package/dist/index.js +465 -397
  42. package/dist/{registry-helpers-Bv_BJ1s-.js → registry-helpers-CLPXad2B.js} +152 -292
  43. package/dist/validators/email.js +7 -9
  44. package/dist/validators/future-date.js +11 -12
  45. package/dist/validators/integer.d.ts +2 -0
  46. package/dist/validators/integer.js +10 -0
  47. package/dist/validators/is-date.js +6 -7
  48. package/dist/validators/is-number.d.ts +2 -0
  49. package/dist/validators/is-number.js +10 -0
  50. package/dist/validators/max-age.js +11 -12
  51. package/dist/validators/max-date.js +11 -12
  52. package/dist/validators/max-length.js +12 -8
  53. package/dist/validators/max.js +5 -6
  54. package/dist/validators/min-age.js +10 -11
  55. package/dist/validators/min-date.js +12 -13
  56. package/dist/validators/min-length.js +12 -8
  57. package/dist/validators/min.js +6 -7
  58. package/dist/validators/multiple-of.d.ts +2 -0
  59. package/dist/validators/multiple-of.js +10 -0
  60. package/dist/validators/non-negative.d.ts +2 -0
  61. package/dist/validators/non-negative.js +10 -0
  62. package/dist/validators/non-zero.d.ts +2 -0
  63. package/dist/validators/non-zero.js +10 -0
  64. package/dist/validators/past-date.js +11 -12
  65. package/dist/validators/pattern.js +6 -7
  66. package/dist/validators/phone.js +14 -32
  67. package/dist/validators/required.js +9 -10
  68. package/dist/validators/url.js +19 -16
  69. package/dist/validators-xJyP-jLZ.js +169 -0
  70. package/dist/validators.js +54 -50
  71. package/llms.txt +505 -790
  72. package/package.json +20 -4
  73. package/dist/core/validation/core/validate-tree.d.ts +0 -35
  74. package/dist/core/validation/validation-context.d.ts +0 -86
  75. package/dist/core/validation/validators/number.d.ts +0 -31
  76. package/dist/validate-C3XiA_zf.js +0 -10
  77. package/dist/validators/number.d.ts +0 -2
  78. package/dist/validators/number.js +0 -35
  79. package/dist/validators-BGsNOgT1.js +0 -207
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { signal as g, computed as d, effect as m, batch as j } from "@preact/signals-core";
2
- import { F as S, E as V, V as K, B as H } from "./registry-helpers-Bv_BJ1s-.js";
3
- import { A as ke, R as xe, b as Fe, g as Te } from "./registry-helpers-Bv_BJ1s-.js";
4
- import { i as M, a as N, A as z, V as J, T as Y } from "./validators-BGsNOgT1.js";
5
- import { g as Pe, c as Ce, d as De, v as Re, b as Me } from "./validators-BGsNOgT1.js";
6
- import { c as I } from "./field-path-DuKdGcIE.js";
7
- import { a as Ie, e as Le, t as Be } from "./field-path-DuKdGcIE.js";
8
- import U, { useRef as P, useCallback as b, useSyncExternalStore as Q } from "react";
9
- import { i as $e } from "./index-D25LsbRm.js";
10
- import { r as We, s as qe, a as je } from "./safe-effect-Dh8uw81c.js";
2
+ import { i as q, a as M } from "./validators-xJyP-jLZ.js";
3
+ import { g as Ve, c as Ae, d as ke, v as xe, b as Fe } from "./validators-xJyP-jLZ.js";
4
+ import { V as K, B as H } from "./registry-helpers-CLPXad2B.js";
5
+ import { A as Oe, R as Te, g as Ce, b as De } from "./registry-helpers-CLPXad2B.js";
6
+ import { c as N } from "./field-path-DuKdGcIE.js";
7
+ import { a as Me, e as Ne, t as Ie } from "./field-path-DuKdGcIE.js";
8
+ import $, { useRef as T, useCallback as b, useSyncExternalStore as z } from "react";
9
+ import { i as Be } from "./index-DLh_Ryb2.js";
10
+ import { r as $e, s as Ue, a as We } from "./safe-effect-Dh8uw81c.js";
11
11
  class C {
12
12
  // ============================================================================
13
13
  // Protected состояние (для Template Method паттерна)
@@ -108,8 +108,8 @@ class C {
108
108
  if (e.params !== void 0) {
109
109
  if (!s.params)
110
110
  return !1;
111
- for (const [i, r] of Object.entries(e.params))
112
- if (s.params[i] !== r)
111
+ for (const [i, a] of Object.entries(e.params))
112
+ if (s.params[i] !== a)
113
113
  return !1;
114
114
  }
115
115
  return !(e.predicate !== void 0 && !e.predicate(s));
@@ -467,11 +467,144 @@ const w = {
467
467
  /** ArrayNode.watchLength() */
468
468
  WatchLength: "watchLength"
469
469
  };
470
- let X = 0;
471
- function A(a) {
472
- return `${a}-${++X}`;
470
+ let J = 0;
471
+ function V(r) {
472
+ return `${r}-${++J}`;
473
473
  }
474
- class Z {
474
+ var S = /* @__PURE__ */ ((r) => (r.THROW = "throw", r.LOG = "log", r.CONVERT = "convert", r))(S || {});
475
+ class k {
476
+ /**
477
+ * Обработать ошибку согласно заданной стратегии
478
+ *
479
+ * @param error Ошибка для обработки (Error | string | unknown)
480
+ * @param context Контекст ошибки для логирования (например, 'AsyncValidator', 'BehaviorRegistry')
481
+ * @param strategy Стратегия обработки (THROW | LOG | CONVERT)
482
+ * @returns ValidationError если strategy = CONVERT, undefined если strategy = LOG, никогда не возвращается если strategy = THROW
483
+ *
484
+ * @example
485
+ * ```typescript
486
+ * // THROW - пробросить ошибку
487
+ * try {
488
+ * riskyOperation();
489
+ * } catch (error) {
490
+ * FormErrorHandler.handle(error, 'RiskyOperation', ErrorStrategy.THROW);
491
+ * // Этот код никогда не выполнится
492
+ * }
493
+ *
494
+ * // LOG - залогировать и продолжить
495
+ * try {
496
+ * nonCriticalOperation();
497
+ * } catch (error) {
498
+ * FormErrorHandler.handle(error, 'NonCritical', ErrorStrategy.LOG);
499
+ * // Продолжаем выполнение
500
+ * }
501
+ *
502
+ * // CONVERT - конвертировать в ValidationError
503
+ * try {
504
+ * await validator(value);
505
+ * } catch (error) {
506
+ * const validationError = FormErrorHandler.handle(
507
+ * error,
508
+ * 'AsyncValidator',
509
+ * ErrorStrategy.CONVERT
510
+ * );
511
+ * return validationError;
512
+ * }
513
+ * ```
514
+ */
515
+ static handle(e, t, s = "throw") {
516
+ const i = this.extractMessage(e);
517
+ switch (s) {
518
+ case "throw":
519
+ throw e;
520
+ case "log":
521
+ return;
522
+ case "convert":
523
+ return {
524
+ code: "validator_error",
525
+ message: i,
526
+ params: { field: t }
527
+ };
528
+ }
529
+ }
530
+ /**
531
+ * Извлечь сообщение из ошибки
532
+ *
533
+ * Обрабатывает различные типы ошибок:
534
+ * - Error объекты → error.message
535
+ * - Строки → возвращает как есть
536
+ * - Объекты с message → извлекает message
537
+ * - Другое → String(error)
538
+ *
539
+ * @param error Ошибка для извлечения сообщения
540
+ * @returns Сообщение ошибки
541
+ * @private
542
+ *
543
+ * @example
544
+ * ```typescript
545
+ * FormErrorHandler.extractMessage(new Error('Test'));
546
+ * // 'Test'
547
+ *
548
+ * FormErrorHandler.extractMessage('String error');
549
+ * // 'String error'
550
+ *
551
+ * FormErrorHandler.extractMessage({ message: 'Object error' });
552
+ * // 'Object error'
553
+ *
554
+ * FormErrorHandler.extractMessage(null);
555
+ * // 'null'
556
+ * ```
557
+ */
558
+ static extractMessage(e) {
559
+ return e instanceof Error ? e.message : typeof e == "string" ? e : typeof e == "object" && e !== null && "message" in e ? String(e.message) : String(e);
560
+ }
561
+ /**
562
+ * Создать ValidationError с заданными параметрами
563
+ *
564
+ * Утилитная функция для создания ValidationError объектов
565
+ *
566
+ * @param code Код ошибки
567
+ * @param message Сообщение ошибки
568
+ * @param field Поле (опционально)
569
+ * @returns ValidationError объект
570
+ *
571
+ * @example
572
+ * ```typescript
573
+ * const error = FormErrorHandler.createValidationError(
574
+ * 'required',
575
+ * 'This field is required',
576
+ * 'email'
577
+ * );
578
+ * // { code: 'required', message: 'This field is required', field: 'email' }
579
+ * ```
580
+ */
581
+ static createValidationError(e, t, s) {
582
+ return {
583
+ code: e,
584
+ message: t,
585
+ params: s ? { field: s } : void 0
586
+ };
587
+ }
588
+ /**
589
+ * Проверить, является ли объект ValidationError
590
+ *
591
+ * Type guard для ValidationError
592
+ *
593
+ * @param value Значение для проверки
594
+ * @returns true если value является ValidationError
595
+ *
596
+ * @example
597
+ * ```typescript
598
+ * if (FormErrorHandler.isValidationError(result)) {
599
+ * console.log(result.code); // OK, типобезопасно
600
+ * }
601
+ * ```
602
+ */
603
+ static isValidationError(e) {
604
+ return typeof e == "object" && e !== null && "code" in e && "message" in e && typeof e.code == "string" && typeof e.message == "string";
605
+ }
606
+ }
607
+ class Y {
475
608
  /** Внутренний сигнал статуса */
476
609
  _status;
477
610
  /** Публичный read-only сигнал статуса */
@@ -616,7 +749,7 @@ class Z {
616
749
  return this._status.value !== "disabled";
617
750
  }
618
751
  }
619
- class ee extends C {
752
+ class Q extends C {
620
753
  // ============================================================================
621
754
  // Приватные сигналы
622
755
  // ============================================================================
@@ -676,7 +809,7 @@ class ee extends C {
676
809
  // Конструктор
677
810
  // ============================================================================
678
811
  constructor(e) {
679
- super(), this.initialValue = e.value, this.validators = e.validators || [], this.asyncValidators = e.asyncValidators || [], this.updateOn = e.updateOn || "blur", this.debounceMs = e.debounce || 0, this.component = e.component, this._value = g(e.value), this._errors = g([]), this._componentProps = g(e.componentProps || {}), this.statusMachine = new Z(e.disabled ? "disabled" : "valid"), this.value = d(() => this._value.value), this.valid = d(() => this.statusMachine.valid.value), this.invalid = d(() => this.statusMachine.invalid.value), this.pending = d(() => this.statusMachine.pending.value), this.status = d(() => this.statusMachine.status.value), this.disabled = d(() => this.statusMachine.disabled.value), this.errors = d(() => this._errors.value), this.componentProps = d(() => this._componentProps.value), this.shouldShowError = d(
812
+ super(), this.initialValue = e.value, this.validators = e.validators || [], this.asyncValidators = e.asyncValidators || [], this.updateOn = e.updateOn || "blur", this.debounceMs = e.debounce || 0, this.component = e.component, this._value = g(e.value), this._errors = g([]), this._componentProps = g(e.componentProps || {}), this.statusMachine = new Y(e.disabled ? "disabled" : "valid"), this.value = d(() => this._value.value), this.valid = d(() => this.statusMachine.valid.value), this.invalid = d(() => this.statusMachine.invalid.value), this.pending = d(() => this.statusMachine.pending.value), this.status = d(() => this.statusMachine.status.value), this.disabled = d(() => this.statusMachine.disabled.value), this.errors = d(() => this._errors.value), this.componentProps = d(() => this._componentProps.value), this.shouldShowError = d(
680
813
  () => this.statusMachine.invalid.value && (this._touched.value || this._dirty.value)
681
814
  );
682
815
  }
@@ -795,8 +928,8 @@ class ee extends C {
795
928
  return;
796
929
  }
797
930
  this.pendingValidation = void 0;
798
- const r = await this.validateImmediate(s);
799
- i(r);
931
+ const a = await this.validateImmediate(s);
932
+ i(a);
800
933
  }, t), s.signal.addEventListener(
801
934
  "abort",
802
935
  () => {
@@ -838,21 +971,21 @@ class ee extends C {
838
971
  this.statusMachine.startValidation();
839
972
  try {
840
973
  const n = await Promise.all(
841
- this.asyncValidators.map(async (l) => {
974
+ this.asyncValidators.map(async (u) => {
842
975
  if (s.aborted)
843
976
  throw new DOMException("Validation aborted", "AbortError");
844
977
  try {
845
- const u = await l(this._value.value, { signal: s });
978
+ const l = await u(this._value.value, { signal: s });
846
979
  if (s.aborted)
847
980
  throw new DOMException("Validation aborted", "AbortError");
848
- return u;
849
- } catch (u) {
850
- if (u instanceof DOMException && u.name === "AbortError")
851
- throw u;
852
- return S.handle(
853
- u,
981
+ return l;
982
+ } catch (l) {
983
+ if (l instanceof DOMException && l.name === "AbortError")
984
+ throw l;
985
+ return k.handle(
986
+ l,
854
987
  "FieldNode AsyncValidator",
855
- V.CONVERT
988
+ S.CONVERT
856
989
  );
857
990
  }
858
991
  })
@@ -862,8 +995,8 @@ class ee extends C {
862
995
  const o = n.filter(Boolean);
863
996
  if (o.length > 0) {
864
997
  this._errors.value = o;
865
- const l = o.some((u) => u.severity !== "warning");
866
- if (this.statusMachine.completeValidation(l), l)
998
+ const u = o.some((l) => l.severity !== "warning");
999
+ if (this.statusMachine.completeValidation(u), u)
867
1000
  return !1;
868
1001
  }
869
1002
  } catch (n) {
@@ -995,9 +1128,9 @@ class ee extends C {
995
1128
  */
996
1129
  watch(e) {
997
1130
  const t = new AbortController(), s = m(() => {
998
- const r = this.value.value;
999
- e(r, t.signal);
1000
- }), i = A(w.Watch);
1131
+ const a = this.value.value;
1132
+ e(a, t.signal);
1133
+ }), i = V(w.Watch);
1001
1134
  return this.disposers.add(i, () => {
1002
1135
  t.abort(), s();
1003
1136
  });
@@ -1026,9 +1159,9 @@ class ee extends C {
1026
1159
  */
1027
1160
  computeFrom(e, t) {
1028
1161
  const s = m(() => {
1029
- const r = e.map((o) => o.value), n = t(...r);
1162
+ const a = e.map((o) => o.value), n = t(...a);
1030
1163
  this.setValue(n, { emitEvent: !1 });
1031
- }), i = A(w.ComputeFrom);
1164
+ }), i = V(w.ComputeFrom);
1032
1165
  return this.disposers.add(i, s);
1033
1166
  }
1034
1167
  /**
@@ -1059,138 +1192,73 @@ class ee extends C {
1059
1192
  }
1060
1193
  }
1061
1194
  }
1062
- class te {
1195
+ function X(r) {
1196
+ const e = r;
1197
+ return typeof e.getProxy == "function" ? e.getProxy() : r;
1198
+ }
1199
+ class Z {
1063
1200
  form;
1064
1201
  constructor(e) {
1065
1202
  this.form = e;
1066
1203
  }
1067
1204
  /**
1068
- * Применить валидаторы к полям формы
1069
- *
1070
- * Этапы применения:
1071
- * 1. Разделение валидаторов на field и tree
1072
- * 2. Применение field валидаторов (sync/async)
1073
- * 3. Применение tree валидаторов (кросс-полевая валидация)
1074
- *
1075
- * @param validators Зарегистрированные валидаторы
1205
+ * Применить валидаторы к полям формы.
1076
1206
  */
1077
1207
  async apply(e) {
1078
- const { validatorsByField: t, treeValidators: s } = this.groupValidators(e);
1079
- await this.applyFieldValidators(t), this.applyTreeValidators(s);
1208
+ const t = this.groupValidators(e);
1209
+ await this.applyFieldValidators(t);
1080
1210
  }
1081
- /**
1082
- * Группировка валидаторов по типам
1083
- *
1084
- * Разделяет валидаторы на:
1085
- * - Field validators (sync/async) - группируются по fieldPath
1086
- * - Tree validators - применяются ко всей форме
1087
- *
1088
- * @param validators Все зарегистрированные валидаторы
1089
- * @returns Сгруппированные валидаторы
1090
- */
1091
1211
  groupValidators(e) {
1092
- const t = /* @__PURE__ */ new Map(), s = [];
1093
- for (const i of e)
1094
- if (i.type === "tree")
1095
- s.push(i);
1096
- else {
1097
- const r = t.get(i.fieldPath) || [];
1098
- r.push(i), t.set(i.fieldPath, r);
1099
- }
1100
- return { validatorsByField: t, treeValidators: s };
1212
+ const t = /* @__PURE__ */ new Map();
1213
+ for (const s of e) {
1214
+ if (s.type === "array-items")
1215
+ continue;
1216
+ const i = t.get(s.fieldPath) || [];
1217
+ i.push(s), t.set(s.fieldPath, i);
1218
+ }
1219
+ return t;
1101
1220
  }
1102
1221
  /**
1103
- * Применение field валидаторов к полям
1104
- *
1105
- * Для каждого поля:
1106
- * 1. Найти FieldNode по пути
1107
- * 2. Проверить условия (condition)
1108
- * 3. Выполнить sync/async валидаторы
1109
- * 4. Установить ошибки на поле
1110
- *
1111
- * @param validatorsByField Валидаторы, сгруппированные по полям
1222
+ * Применение sync/async валидаторов к полям.
1112
1223
  */
1113
1224
  async applyFieldValidators(e) {
1114
- for (const [t, s] of e) {
1115
- const i = this.form.getFieldByPath(t);
1116
- if (!i) {
1117
- console.warn(`Field ${t} not found in GroupNode`);
1225
+ const t = this.form.getProxy();
1226
+ for (const [s, i] of e) {
1227
+ const a = this.form.getFieldByPath(s);
1228
+ if (!a) {
1229
+ console.warn(`Field ${s} not found in GroupNode`);
1118
1230
  continue;
1119
1231
  }
1120
- if (!M(i) && !N(i)) {
1121
- process.env.NODE_ENV !== "production" && console.warn(`Validation can only run on FieldNode or ArrayNode, skipping ${t}`);
1232
+ if (!q(a) && !M(a)) {
1233
+ process.env.NODE_ENV !== "production" && console.warn(`Validation can only run on FieldNode or ArrayNode, skipping ${s}`);
1122
1234
  continue;
1123
1235
  }
1124
- const r = [];
1125
- let n;
1126
- if (N(i)) {
1127
- const o = i.getValue();
1128
- n = new z(this.form, t, o);
1129
- } else
1130
- n = new J(this.form, t, i);
1131
- for (const o of s)
1132
- if (!(o.condition && !this.checkCondition(o.condition)))
1236
+ const n = [];
1237
+ let o;
1238
+ M(a) ? o = a.getValue() : o = a.value.value;
1239
+ const u = X(a);
1240
+ for (const l of i)
1241
+ if (!(l.condition && !this.checkCondition(l.condition)))
1133
1242
  try {
1134
- let l = null;
1135
- const u = n.value();
1136
- if (o.type === "sync") {
1137
- const v = o.validator;
1138
- l = v(u, n);
1139
- } else if (o.type === "async") {
1140
- const v = o.validator;
1141
- l = await v(u, n);
1243
+ let f = null;
1244
+ if (l.type === "sync") {
1245
+ const h = l.validator;
1246
+ f = h(o, u, t);
1247
+ } else if (l.type === "async") {
1248
+ const h = l.validator;
1249
+ f = await h(o, u, t);
1142
1250
  }
1143
- l && r.push(l);
1144
- } catch (l) {
1145
- S.handle(
1146
- l,
1147
- `ValidationApplicator: validator for ${t}`,
1148
- V.LOG
1251
+ f && n.push(f);
1252
+ } catch (f) {
1253
+ k.handle(
1254
+ f,
1255
+ `ValidationApplicator: validator for ${s}`,
1256
+ S.LOG
1149
1257
  );
1150
1258
  }
1151
- r.length > 0 ? i.setErrors(r) : i.clearErrors();
1152
- }
1153
- }
1154
- /**
1155
- * Применение tree валидаторов (кросс-полевая валидация)
1156
- *
1157
- * Tree валидаторы имеют доступ ко всей форме через TreeValidationContext.
1158
- * Ошибки устанавливаются на targetField (если указано).
1159
- *
1160
- * @param treeValidators Список tree валидаторов
1161
- */
1162
- applyTreeValidators(e) {
1163
- for (const t of e) {
1164
- const s = new Y(this.form);
1165
- if (!(t.condition && !this.checkCondition(t.condition)))
1166
- try {
1167
- if (t.type !== "tree")
1168
- continue;
1169
- const i = t.validator, r = i(s);
1170
- if (r && t.options && "targetField" in t.options) {
1171
- const n = t.options.targetField;
1172
- if (n) {
1173
- const o = this.form.getFieldByPath(String(n));
1174
- if (o && M(o)) {
1175
- const l = o.errors.value;
1176
- o.setErrors([...l, r]);
1177
- }
1178
- }
1179
- }
1180
- } catch (i) {
1181
- S.handle(i, "ValidationApplicator: tree validator", V.LOG);
1182
- }
1259
+ n.length > 0 ? a.setErrors(n) : a.errors.value.length > 0 && !a.errors.value.some((l) => l.code !== "contextual") && a.clearErrors();
1183
1260
  }
1184
1261
  }
1185
- /**
1186
- * Проверка условия (condition) для валидатора
1187
- *
1188
- * Условие определяет, должен ли валидатор выполняться.
1189
- * Использует getFieldByPath для поддержки вложенных путей.
1190
- *
1191
- * @param condition Условие валидатора
1192
- * @returns true, если условие выполнено
1193
- */
1194
1262
  checkCondition(e) {
1195
1263
  const t = this.form.getFieldByPath(e.fieldPath);
1196
1264
  if (!t)
@@ -1199,7 +1267,7 @@ class te {
1199
1267
  return e.conditionFn(s);
1200
1268
  }
1201
1269
  }
1202
- class se {
1270
+ class ee {
1203
1271
  /**
1204
1272
  * Парсит путь в массив сегментов
1205
1273
  *
@@ -1227,8 +1295,8 @@ class se {
1227
1295
  parsePath(e) {
1228
1296
  const t = [];
1229
1297
  let s = "", i = !1;
1230
- for (let r = 0; r < e.length; r++) {
1231
- const n = e[r];
1298
+ for (let a = 0; a < e.length; a++) {
1299
+ const n = e[a];
1232
1300
  n === "[" ? (i = !0, s += n) : n === "]" ? (i = !1, s += n) : n === "." && !i ? s && (this.addSegment(t, s), s = "") : s += n;
1233
1301
  }
1234
1302
  return s && this.addSegment(t, s), t;
@@ -1278,11 +1346,11 @@ class se {
1278
1346
  getValueByPath(e, t) {
1279
1347
  const s = this.parsePath(t);
1280
1348
  let i = e;
1281
- for (const r of s) {
1349
+ for (const a of s) {
1282
1350
  if (i == null) return;
1283
- if (i = i[r.key], r.index !== void 0) {
1351
+ if (i = i[a.key], a.index !== void 0) {
1284
1352
  if (!Array.isArray(i)) return;
1285
- i = i[r.index];
1353
+ i = i[a.index];
1286
1354
  }
1287
1355
  }
1288
1356
  return i;
@@ -1318,27 +1386,27 @@ class se {
1318
1386
  const i = this.parsePath(t);
1319
1387
  if (i.length === 0)
1320
1388
  throw new Error("Cannot set value: empty path");
1321
- let r = e;
1389
+ let a = e;
1322
1390
  for (let o = 0; o < i.length - 1; o++) {
1323
- const l = i[o];
1324
- let u = r[l.key];
1325
- if (l.index !== void 0) {
1326
- if (!Array.isArray(u))
1327
- throw new Error(`Expected array at path segment: ${l.key}, but got ${typeof u}`);
1328
- r = u[l.index];
1391
+ const u = i[o];
1392
+ let l = a[u.key];
1393
+ if (u.index !== void 0) {
1394
+ if (!Array.isArray(l))
1395
+ throw new Error(`Expected array at path segment: ${u.key}, but got ${typeof l}`);
1396
+ a = l[u.index];
1329
1397
  } else
1330
- u == null && (r[l.key] = {}, u = r[l.key]), r = u;
1398
+ l == null && (a[u.key] = {}, l = a[u.key]), a = l;
1331
1399
  }
1332
1400
  const n = i[i.length - 1];
1333
1401
  if (n.index !== void 0) {
1334
- const o = r[n.key];
1402
+ const o = a[n.key];
1335
1403
  if (!Array.isArray(o))
1336
1404
  throw new Error(
1337
1405
  `Expected array at path segment: ${n.key}, but got ${typeof o}`
1338
1406
  );
1339
1407
  o[n.index] = s;
1340
1408
  } else
1341
- r[n.key] = s;
1409
+ a[n.key] = s;
1342
1410
  }
1343
1411
  /**
1344
1412
  * Получить значение из FormNode по пути
@@ -1437,61 +1505,61 @@ class se {
1437
1505
  getNodeByPath(e, t) {
1438
1506
  const s = this.parsePath(t);
1439
1507
  let i = e;
1440
- for (const r of s) {
1508
+ for (const a of s) {
1441
1509
  if (i == null) return null;
1442
1510
  const n = i;
1443
1511
  if (n.fields && n.fields instanceof Map) {
1444
- if (i = n.fields.get(r.key), r.index === void 0) {
1512
+ if (i = n.fields.get(a.key), a.index === void 0) {
1445
1513
  if (i == null) return null;
1446
1514
  continue;
1447
1515
  }
1448
- } else if (r.index !== void 0 && n.items) {
1516
+ } else if (a.index !== void 0 && n.items) {
1449
1517
  const o = n.items.value || n.items;
1450
- if (!Array.isArray(o) || (i = o[r.index], i == null)) return null;
1518
+ if (!Array.isArray(o) || (i = o[a.index], i == null)) return null;
1451
1519
  continue;
1452
- } else if (r.index === void 0) {
1453
- if (i = n[r.key], i == null) return null;
1520
+ } else if (a.index === void 0) {
1521
+ if (i = n[a.key], i == null) return null;
1454
1522
  continue;
1455
1523
  }
1456
- if (i && r.index !== void 0 && i.items) {
1524
+ if (i && a.index !== void 0 && i.items) {
1457
1525
  const o = i.items.value || i.items;
1458
1526
  if (!Array.isArray(o)) return null;
1459
- i = o[r.index];
1460
- } else if (i && r.index !== void 0 && !i.items)
1527
+ i = o[a.index];
1528
+ } else if (i && a.index !== void 0 && !i.items)
1461
1529
  return null;
1462
1530
  if (i == null) return null;
1463
1531
  }
1464
1532
  return i;
1465
1533
  }
1466
1534
  }
1467
- function W(a) {
1468
- const { getChildren: e, ownErrors: t, disabled: s } = a, i = d(() => t.value.length > 0 ? !1 : e().every((h) => h.disabled.value || h.valid.value)), r = d(() => !i.value), n = d(() => e().some((h) => h.pending.value)), o = d(() => e().some((h) => h.touched.value)), l = d(() => e().some((h) => h.dirty.value)), u = d(() => {
1535
+ function U(r) {
1536
+ const { getChildren: e, ownErrors: t, disabled: s } = r, i = d(() => t.value.length > 0 ? !1 : e().every((h) => h.disabled.value || h.valid.value)), a = d(() => !i.value), n = d(() => e().some((h) => h.pending.value)), o = d(() => e().some((h) => h.touched.value)), u = d(() => e().some((h) => h.dirty.value)), l = d(() => {
1469
1537
  const h = [...t.value];
1470
- for (const f of e())
1471
- h.push(...f.errors.value);
1538
+ for (const v of e())
1539
+ h.push(...v.errors.value);
1472
1540
  return h;
1473
- }), v = d(() => s?.value ? "disabled" : n.value ? "pending" : r.value ? "invalid" : "valid");
1541
+ }), f = d(() => s?.value ? "disabled" : n.value ? "pending" : a.value ? "invalid" : "valid");
1474
1542
  return {
1475
1543
  valid: i,
1476
- invalid: r,
1544
+ invalid: a,
1477
1545
  pending: n,
1478
1546
  touched: o,
1479
- dirty: l,
1480
- errors: u,
1481
- status: v
1547
+ dirty: u,
1548
+ errors: l,
1549
+ status: f
1482
1550
  };
1483
1551
  }
1484
- function ie(a) {
1485
- return typeof a == "object" && a !== null && "getProxy" in a && typeof a.getProxy == "function";
1552
+ function te(r) {
1553
+ return typeof r == "object" && r !== null && "getProxy" in r && typeof r.getProxy == "function";
1486
1554
  }
1487
- function re(a, e) {
1488
- return new Proxy(a, {
1555
+ function se(r, e) {
1556
+ return new Proxy(r, {
1489
1557
  get: (t, s) => {
1490
1558
  if (s in t)
1491
1559
  return t[s];
1492
1560
  if (typeof s == "string" && e.has(s)) {
1493
1561
  const i = e.get(s);
1494
- return i && ie(i) ? i.getProxy() : i;
1562
+ return i && te(i) ? i.getProxy() : i;
1495
1563
  }
1496
1564
  },
1497
1565
  set: (t, s, i) => typeof s == "string" && e.has(s) ? !1 : (t[s] = i, !0),
@@ -1503,7 +1571,7 @@ function re(a, e) {
1503
1571
  getOwnPropertyDescriptor: (t, s) => typeof s == "string" && e.has(s) ? { enumerable: !0, configurable: !0 } : Reflect.getOwnPropertyDescriptor(t, s)
1504
1572
  });
1505
1573
  }
1506
- class ae {
1574
+ class ie {
1507
1575
  /**
1508
1576
  * @param form - Форма для отправки
1509
1577
  */
@@ -1584,11 +1652,11 @@ class ae {
1584
1652
  this._submitting.value = !0;
1585
1653
  try {
1586
1654
  return { success: !0, data: await e(this.form.getValue()) };
1587
- } catch (r) {
1655
+ } catch (a) {
1588
1656
  return {
1589
1657
  success: !1,
1590
1658
  data: null,
1591
- error: r instanceof Error ? r : new Error(String(r))
1659
+ error: a instanceof Error ? a : new Error(String(a))
1592
1660
  };
1593
1661
  } finally {
1594
1662
  this._submitting.value = !1;
@@ -1601,7 +1669,7 @@ class ae {
1601
1669
  return this._submitting.value;
1602
1670
  }
1603
1671
  }
1604
- class k extends C {
1672
+ class A extends C {
1605
1673
  // ============================================================================
1606
1674
  // Приватные поля
1607
1675
  // ============================================================================
@@ -1622,11 +1690,11 @@ class k extends C {
1622
1690
  /**
1623
1691
  * Навигатор для работы с путями к полям
1624
1692
  */
1625
- pathNavigator = new se();
1693
+ pathNavigator = new ee();
1626
1694
  /**
1627
1695
  * Фабрика для создания узлов формы
1628
1696
  */
1629
- nodeFactory = new ne();
1697
+ nodeFactory = new re();
1630
1698
  /**
1631
1699
  * Реестр валидаторов для этой формы
1632
1700
  * Может быть инжектирован через config._validationRegistry для тестирования
@@ -1640,7 +1708,7 @@ class k extends C {
1640
1708
  /**
1641
1709
  * Аппликатор для применения валидаторов к форме
1642
1710
  */
1643
- validationApplicator = new te(this);
1711
+ validationApplicator = new Z(this);
1644
1712
  // ============================================================================
1645
1713
  // Приватные сигналы состояния (inline из StateManager)
1646
1714
  // ============================================================================
@@ -1664,25 +1732,25 @@ class k extends C {
1664
1732
  status;
1665
1733
  submitting;
1666
1734
  constructor(e) {
1667
- super(), this.formSubmitter = new ae(this);
1668
- const t = "form" in e, s = t ? e : void 0, i = t ? e.form : e, r = t ? e.behavior : void 0, n = t ? e.validation : void 0;
1735
+ super(), this.formSubmitter = new ie(this);
1736
+ const t = "form" in e, s = t ? e : void 0, i = t ? e.form : e, a = t ? e.behavior : void 0, n = t ? e.validation : void 0;
1669
1737
  this.validationRegistry = s?._validationRegistry ?? new K(), this.behaviorRegistry = s?._behaviorRegistry ?? new H();
1670
- for (const [l, u] of Object.entries(i)) {
1671
- const v = this.createNode(u);
1672
- this._fields.set(l, v);
1738
+ for (const [u, l] of Object.entries(i)) {
1739
+ const f = this.createNode(l);
1740
+ this._fields.set(u, f);
1673
1741
  }
1674
1742
  this.value = d(() => {
1675
- const l = {};
1676
- return this._fields.forEach((u, v) => {
1677
- l[v] = u.value.value;
1678
- }), l;
1743
+ const u = {};
1744
+ return this._fields.forEach((l, f) => {
1745
+ u[f] = l.value.value;
1746
+ }), u;
1679
1747
  });
1680
- const o = W({
1748
+ const o = U({
1681
1749
  getChildren: () => Array.from(this._fields.values()),
1682
1750
  ownErrors: this._formErrors,
1683
1751
  disabled: this._disabled
1684
1752
  });
1685
- this.valid = o.valid, this.invalid = o.invalid, this.pending = o.pending, this.touched = o.touched, this.dirty = o.dirty, this.errors = o.errors, this.status = o.status, this.submitting = this.formSubmitter.submitting, r && this.applyBehaviorSchema(r), n && this.applyValidationSchema(n);
1753
+ this.valid = o.valid, this.invalid = o.invalid, this.pending = o.pending, this.touched = o.touched, this.dirty = o.dirty, this.errors = o.errors, this.status = o.status, this.submitting = this.formSubmitter.submitting, a && this.applyBehaviorSchema(a), n && this.applyValidationSchema(n);
1686
1754
  }
1687
1755
  // ============================================================================
1688
1756
  // Приватный метод для создания Proxy
@@ -1692,7 +1760,7 @@ class k extends C {
1692
1760
  * @see buildFormProxy
1693
1761
  */
1694
1762
  buildProxy() {
1695
- return re(this, this._fields);
1763
+ return se(this, this._fields);
1696
1764
  }
1697
1765
  // ============================================================================
1698
1766
  // Реализация абстрактных методов FormNode
@@ -1705,8 +1773,8 @@ class k extends C {
1705
1773
  }
1706
1774
  setValue(e, t) {
1707
1775
  for (const [s, i] of Object.entries(e)) {
1708
- const r = this._fields.get(s);
1709
- r && r.setValue(i, t);
1776
+ const a = this._fields.get(s);
1777
+ a && a.setValue(i, t);
1710
1778
  }
1711
1779
  }
1712
1780
  patchValue(e) {
@@ -1861,7 +1929,7 @@ class k extends C {
1861
1929
  applyValidationSchema(e) {
1862
1930
  this.validationRegistry.beginRegistration();
1863
1931
  try {
1864
- const t = I();
1932
+ const t = N();
1865
1933
  e(t);
1866
1934
  const s = this.getProxy();
1867
1935
  this.validationRegistry.endRegistration(s);
@@ -1876,7 +1944,7 @@ class k extends C {
1876
1944
  applyBehaviorSchema(e) {
1877
1945
  this.behaviorRegistry.beginRegistration();
1878
1946
  try {
1879
- const t = I();
1947
+ const t = N();
1880
1948
  return e(t), this.behaviorRegistry.endRegistration(this.getProxy()).cleanup;
1881
1949
  } catch (t) {
1882
1950
  throw console.error("Error applying behavior schema:", t), t;
@@ -1919,12 +1987,12 @@ class k extends C {
1919
1987
  return;
1920
1988
  let s = this;
1921
1989
  for (const i of t) {
1922
- if (!(s instanceof k) || (s = s.getField(i.key), !s)) return;
1990
+ if (!(s instanceof A) || (s = s.getField(i.key), !s)) return;
1923
1991
  if (i.index !== void 0)
1924
1992
  if ("at" in s && "length" in s && typeof s.at == "function") {
1925
- const r = s.at(i.index);
1926
- if (!r) return;
1927
- s = r;
1993
+ const a = s.at(i.index);
1994
+ if (!a) return;
1995
+ s = a;
1928
1996
  } else
1929
1997
  return;
1930
1998
  }
@@ -1973,15 +2041,15 @@ class k extends C {
1973
2041
  * Связывает два поля: при изменении source автоматически обновляется target
1974
2042
  */
1975
2043
  linkFields(e, t, s) {
1976
- const i = this._fields.get(e), r = this._fields.get(t);
1977
- if (!i || !r) {
1978
- const l = i ? t : e;
1979
- throw new Error(`GroupNode.linkFields: field "${String(l)}" not found`);
2044
+ const i = this._fields.get(e), a = this._fields.get(t);
2045
+ if (!i || !a) {
2046
+ const u = i ? t : e;
2047
+ throw new Error(`GroupNode.linkFields: field "${String(u)}" not found`);
1980
2048
  }
1981
2049
  const n = m(() => {
1982
- const l = i.value.value, u = s ? s(l) : l;
1983
- r.setValue(u, { emitEvent: !1 });
1984
- }), o = A(w.LinkFields);
2050
+ const u = i.value.value, l = s ? s(u) : u;
2051
+ a.setValue(l, { emitEvent: !1 });
2052
+ }), o = V(w.LinkFields);
1985
2053
  return this.disposers.add(o, n);
1986
2054
  }
1987
2055
  /**
@@ -2018,8 +2086,8 @@ class k extends C {
2018
2086
  const i = m(() => {
2019
2087
  const n = s.value.value;
2020
2088
  t(n);
2021
- }), r = A(w.WatchField);
2022
- return this.disposers.add(r, i);
2089
+ }), a = V(w.WatchField);
2090
+ return this.disposers.add(a, i);
2023
2091
  }
2024
2092
  /**
2025
2093
  * Hook: вызывается после disable()
@@ -2042,7 +2110,7 @@ class k extends C {
2042
2110
  });
2043
2111
  }
2044
2112
  }
2045
- class L extends C {
2113
+ class I extends C {
2046
2114
  // ============================================================================
2047
2115
  // Приватные поля
2048
2116
  // ============================================================================
@@ -2081,7 +2149,7 @@ class L extends C {
2081
2149
  for (const i of t)
2082
2150
  this.push(i);
2083
2151
  this.length = d(() => this.items.value.length), this.value = d(() => this.items.value.map((i) => i.value.value));
2084
- const s = W({
2152
+ const s = U({
2085
2153
  getChildren: () => this.items.value,
2086
2154
  ownErrors: this._arrayErrors
2087
2155
  });
@@ -2107,12 +2175,12 @@ class L extends C {
2107
2175
  */
2108
2176
  removeAt(e) {
2109
2177
  if (e < 0 || e >= this.items.value.length) {
2110
- S.handle(
2178
+ k.handle(
2111
2179
  new Error(
2112
2180
  `ArrayNode.removeAt: index ${e} out of bounds (length: ${this.items.value.length})`
2113
2181
  ),
2114
2182
  "ArrayNode.removeAt",
2115
- V.LOG
2183
+ S.LOG
2116
2184
  );
2117
2185
  return;
2118
2186
  }
@@ -2126,12 +2194,12 @@ class L extends C {
2126
2194
  */
2127
2195
  insert(e, t) {
2128
2196
  if (e < 0 || e > this.items.value.length) {
2129
- S.handle(
2197
+ k.handle(
2130
2198
  new Error(
2131
2199
  `ArrayNode.insert: index ${e} out of bounds (length: ${this.items.value.length})`
2132
2200
  ),
2133
2201
  "ArrayNode.insert",
2134
- V.LOG
2202
+ S.LOG
2135
2203
  );
2136
2204
  return;
2137
2205
  }
@@ -2168,7 +2236,7 @@ class L extends C {
2168
2236
  }
2169
2237
  setValue(e, t) {
2170
2238
  this.clear(), e.forEach((s) => this.push(s)), t?.emitEvent !== !1 && this.validate().catch((s) => {
2171
- S.handle(s, "ArrayNode.setValue", V.LOG);
2239
+ k.handle(s, "ArrayNode.setValue", S.LOG);
2172
2240
  });
2173
2241
  }
2174
2242
  patchValue(e) {
@@ -2326,7 +2394,7 @@ class L extends C {
2326
2394
  */
2327
2395
  createItem(e) {
2328
2396
  if (this.isGroupSchema(this.itemSchema)) {
2329
- const t = new k(this.itemSchema);
2397
+ const t = new A(this.itemSchema);
2330
2398
  return e && t.patchValue(e), this.validationSchemaFn && "applyValidationSchema" in t && t.applyValidationSchema(this.validationSchemaFn), this.behaviorSchemaFn && "applyBehaviorSchema" in t && t.applyBehaviorSchema(this.behaviorSchemaFn), t;
2331
2399
  }
2332
2400
  throw new Error(
@@ -2414,12 +2482,12 @@ class L extends C {
2414
2482
  */
2415
2483
  watchItems(e, t) {
2416
2484
  const s = m(() => {
2417
- const r = this.items.value.map((n) => {
2418
- if (n instanceof k)
2485
+ const a = this.items.value.map((n) => {
2486
+ if (n instanceof A)
2419
2487
  return n.getFieldByPath(e)?.value.value;
2420
2488
  });
2421
- t(r);
2422
- }), i = A(w.WatchItems);
2489
+ t(a);
2490
+ }), i = V(w.WatchItems);
2423
2491
  return this.disposers.add(i, s);
2424
2492
  }
2425
2493
  /**
@@ -2448,7 +2516,7 @@ class L extends C {
2448
2516
  const t = m(() => {
2449
2517
  const i = this.length.value;
2450
2518
  e(i);
2451
- }), s = A(w.WatchLength);
2519
+ }), s = V(w.WatchLength);
2452
2520
  return this.disposers.add(s, t);
2453
2521
  }
2454
2522
  /**
@@ -2512,7 +2580,7 @@ class L extends C {
2512
2580
  });
2513
2581
  }
2514
2582
  }
2515
- class ne {
2583
+ class re {
2516
2584
  /**
2517
2585
  * Создает узел формы на основе конфигурации
2518
2586
  *
@@ -2562,16 +2630,16 @@ class ne {
2562
2630
  if (Array.isArray(e) && e.length >= 1)
2563
2631
  return this.createArrayNodeFromArray(e);
2564
2632
  if (this.isFieldConfig(e))
2565
- return new ee(e);
2633
+ return new Q(e);
2566
2634
  if (this.isArrayConfig(e)) {
2567
2635
  const t = e;
2568
- return new L(
2636
+ return new I(
2569
2637
  t.schema,
2570
2638
  t.initialItems
2571
2639
  );
2572
2640
  }
2573
2641
  if (this.isGroupConfig(e))
2574
- return new k(e);
2642
+ return new A(e);
2575
2643
  throw new Error(
2576
2644
  `NodeFactory: Unknown node config. Expected FieldConfig, GroupConfig, or ArrayConfig, but got: ${JSON.stringify(
2577
2645
  e
@@ -2607,9 +2675,9 @@ class ne {
2607
2675
  createArrayNodeFromArray(e) {
2608
2676
  const [t, ...s] = e, i = [];
2609
2677
  this.isGroupConfig(t) && i.push(this.extractValues(t));
2610
- for (const r of s)
2611
- this.isGroupConfig(r) ? i.push(this.extractValues(r)) : i.push(r);
2612
- return new L(t, i);
2678
+ for (const a of s)
2679
+ this.isGroupConfig(a) ? i.push(this.extractValues(a)) : i.push(a);
2680
+ return new I(t, i);
2613
2681
  }
2614
2682
  /**
2615
2683
  * Извлечь значения из схемы (рекурсивно)
@@ -2728,10 +2796,10 @@ class ne {
2728
2796
  return e != null && typeof e == "object" && !this.isFieldConfig(e) && !this.isArrayConfig(e);
2729
2797
  }
2730
2798
  }
2731
- function ge(a) {
2732
- return new k(a).getProxy();
2799
+ function ye(r) {
2800
+ return new A(r).getProxy();
2733
2801
  }
2734
- class be {
2802
+ class me {
2735
2803
  /**
2736
2804
  * @param form - Форма для наблюдения
2737
2805
  * @param options - Опции observer
@@ -2875,7 +2943,7 @@ class be {
2875
2943
  const s = [];
2876
2944
  if (this.shouldTrack("value")) {
2877
2945
  let i = t.value.value;
2878
- const r = m(() => {
2946
+ const a = m(() => {
2879
2947
  const n = t.value.value;
2880
2948
  n !== i && (this.emit({
2881
2949
  type: "value",
@@ -2885,11 +2953,11 @@ class be {
2885
2953
  newValue: n
2886
2954
  }), i = n);
2887
2955
  });
2888
- s.push(r);
2956
+ s.push(a);
2889
2957
  }
2890
2958
  if (this.shouldTrack("status")) {
2891
2959
  let i = t.status.value;
2892
- const r = m(() => {
2960
+ const a = m(() => {
2893
2961
  const n = t.status.value;
2894
2962
  n !== i && (this.emit({
2895
2963
  type: "status",
@@ -2899,7 +2967,7 @@ class be {
2899
2967
  newValue: n
2900
2968
  }), i = n);
2901
2969
  });
2902
- s.push(r);
2970
+ s.push(a);
2903
2971
  }
2904
2972
  return () => s.forEach((i) => i());
2905
2973
  }
@@ -2934,63 +3002,63 @@ class be {
2934
3002
  this.disposers.forEach((e) => e()), this.disposers = [], this.listeners.clear();
2935
3003
  }
2936
3004
  }
2937
- var x = { exports: {} }, T = {};
2938
- var B;
2939
- function oe() {
2940
- if (B) return T;
2941
- B = 1;
2942
- var a = U;
2943
- function e(h, f) {
2944
- return h === f && (h !== 0 || 1 / h === 1 / f) || h !== h && f !== f;
2945
- }
2946
- var t = typeof Object.is == "function" ? Object.is : e, s = a.useState, i = a.useEffect, r = a.useLayoutEffect, n = a.useDebugValue;
2947
- function o(h, f) {
2948
- var c = f(), p = s({ inst: { value: c, getSnapshot: f } }), y = p[0].inst, E = p[1];
2949
- return r(
3005
+ var x = { exports: {} }, P = {};
3006
+ var L;
3007
+ function ae() {
3008
+ if (L) return P;
3009
+ L = 1;
3010
+ var r = $;
3011
+ function e(h, v) {
3012
+ return h === v && (h !== 0 || 1 / h === 1 / v) || h !== h && v !== v;
3013
+ }
3014
+ var t = typeof Object.is == "function" ? Object.is : e, s = r.useState, i = r.useEffect, a = r.useLayoutEffect, n = r.useDebugValue;
3015
+ function o(h, v) {
3016
+ var c = v(), p = s({ inst: { value: c, getSnapshot: v } }), y = p[0].inst, E = p[1];
3017
+ return a(
2950
3018
  function() {
2951
- y.value = c, y.getSnapshot = f, l(y) && E({ inst: y });
3019
+ y.value = c, y.getSnapshot = v, u(y) && E({ inst: y });
2952
3020
  },
2953
- [h, c, f]
3021
+ [h, c, v]
2954
3022
  ), i(
2955
3023
  function() {
2956
- return l(y) && E({ inst: y }), h(function() {
2957
- l(y) && E({ inst: y });
3024
+ return u(y) && E({ inst: y }), h(function() {
3025
+ u(y) && E({ inst: y });
2958
3026
  });
2959
3027
  },
2960
3028
  [h]
2961
3029
  ), n(c), c;
2962
3030
  }
2963
- function l(h) {
2964
- var f = h.getSnapshot;
3031
+ function u(h) {
3032
+ var v = h.getSnapshot;
2965
3033
  h = h.value;
2966
3034
  try {
2967
- var c = f();
3035
+ var c = v();
2968
3036
  return !t(h, c);
2969
3037
  } catch {
2970
3038
  return !0;
2971
3039
  }
2972
3040
  }
2973
- function u(h, f) {
2974
- return f();
3041
+ function l(h, v) {
3042
+ return v();
2975
3043
  }
2976
- var v = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? u : o;
2977
- return T.useSyncExternalStore = a.useSyncExternalStore !== void 0 ? a.useSyncExternalStore : v, T;
3044
+ var f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? l : o;
3045
+ return P.useSyncExternalStore = r.useSyncExternalStore !== void 0 ? r.useSyncExternalStore : f, P;
2978
3046
  }
2979
3047
  var O = {};
2980
- var G;
2981
- function le() {
2982
- return G || (G = 1, process.env.NODE_ENV !== "production" && (function() {
2983
- function a(c, p) {
3048
+ var B;
3049
+ function ne() {
3050
+ return B || (B = 1, process.env.NODE_ENV !== "production" && (function() {
3051
+ function r(c, p) {
2984
3052
  return c === p && (c !== 0 || 1 / c === 1 / p) || c !== c && p !== p;
2985
3053
  }
2986
3054
  function e(c, p) {
2987
- v || i.startTransition === void 0 || (v = !0, console.error(
3055
+ f || i.startTransition === void 0 || (f = !0, console.error(
2988
3056
  "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
2989
3057
  ));
2990
3058
  var y = p();
2991
3059
  if (!h) {
2992
3060
  var E = p();
2993
- r(y, E) || (console.error(
3061
+ a(y, E) || (console.error(
2994
3062
  "The result of getSnapshot should be cached to avoid an infinite loop"
2995
3063
  ), h = !0);
2996
3064
  }
@@ -2998,7 +3066,7 @@ function le() {
2998
3066
  inst: { value: y, getSnapshot: p }
2999
3067
  });
3000
3068
  var _ = E[0].inst, F = E[1];
3001
- return l(
3069
+ return u(
3002
3070
  function() {
3003
3071
  _.value = y, _.getSnapshot = p, t(_) && F({ inst: _ });
3004
3072
  },
@@ -3010,14 +3078,14 @@ function le() {
3010
3078
  });
3011
3079
  },
3012
3080
  [c]
3013
- ), u(y), y;
3081
+ ), l(y), y;
3014
3082
  }
3015
3083
  function t(c) {
3016
3084
  var p = c.getSnapshot;
3017
3085
  c = c.value;
3018
3086
  try {
3019
3087
  var y = p();
3020
- return !r(c, y);
3088
+ return !a(c, y);
3021
3089
  } catch {
3022
3090
  return !0;
3023
3091
  }
@@ -3026,36 +3094,36 @@ function le() {
3026
3094
  return p();
3027
3095
  }
3028
3096
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
3029
- var i = U, r = typeof Object.is == "function" ? Object.is : a, n = i.useState, o = i.useEffect, l = i.useLayoutEffect, u = i.useDebugValue, v = !1, h = !1, f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? s : e;
3030
- O.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : f, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
3097
+ var i = $, a = typeof Object.is == "function" ? Object.is : r, n = i.useState, o = i.useEffect, u = i.useLayoutEffect, l = i.useDebugValue, f = !1, h = !1, v = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? s : e;
3098
+ O.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : v, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
3031
3099
  })()), O;
3032
3100
  }
3033
- var $;
3034
- function ue() {
3035
- return $ || ($ = 1, process.env.NODE_ENV === "production" ? x.exports = oe() : x.exports = le()), x.exports;
3101
+ var G;
3102
+ function oe() {
3103
+ return G || (G = 1, process.env.NODE_ENV === "production" ? x.exports = ae() : x.exports = ne()), x.exports;
3036
3104
  }
3037
- var R = ue();
3038
- function he(a, e) {
3039
- if (a === e) return !0;
3040
- if (a.length !== e.length) return !1;
3041
- for (let t = 0; t < a.length; t++)
3042
- if (a[t] !== e[t]) return !1;
3105
+ var R = oe();
3106
+ function le(r, e) {
3107
+ if (r === e) return !0;
3108
+ if (r.length !== e.length) return !1;
3109
+ for (let t = 0; t < r.length; t++)
3110
+ if (r[t] !== e[t]) return !1;
3043
3111
  return !0;
3044
3112
  }
3045
- function q(a, e, t) {
3046
- const s = P(null);
3113
+ function W(r, e, t) {
3114
+ const s = T(null);
3047
3115
  if (s.current === null) {
3048
3116
  const n = {};
3049
- for (const o in a)
3050
- n[o] = a[o].value;
3117
+ for (const o in r)
3118
+ n[o] = r[o].value;
3051
3119
  s.current = { ...n, __snapshot: null };
3052
3120
  }
3053
3121
  const i = b(
3054
3122
  (n) => {
3055
3123
  let o = !0;
3056
3124
  return m(() => {
3057
- for (const u in a)
3058
- a[u].value;
3125
+ for (const l in r)
3126
+ r[l].value;
3059
3127
  if (o) {
3060
3128
  o = !1;
3061
3129
  return;
@@ -3063,43 +3131,43 @@ function q(a, e, t) {
3063
3131
  n();
3064
3132
  });
3065
3133
  },
3066
- [a]
3067
- ), r = b(() => {
3134
+ [r]
3135
+ ), a = b(() => {
3068
3136
  const n = s.current, o = {};
3069
- for (const u in a)
3070
- o[u] = a[u].value;
3071
- let l = !1;
3072
- for (const u of e) {
3073
- const { key: v, useShallowArrayEqual: h } = u, f = o[v], c = n[v];
3137
+ for (const l in r)
3138
+ o[l] = r[l].value;
3139
+ let u = !1;
3140
+ for (const l of e) {
3141
+ const { key: f, useShallowArrayEqual: h } = l, v = o[f], c = n[f];
3074
3142
  if (h) {
3075
- if (!he(c, f)) {
3076
- l = !0;
3143
+ if (!le(c, v)) {
3144
+ u = !0;
3077
3145
  break;
3078
3146
  }
3079
- } else if (c !== f) {
3080
- l = !0;
3147
+ } else if (c !== v) {
3148
+ u = !0;
3081
3149
  break;
3082
3150
  }
3083
3151
  }
3084
- if (!l && n.__snapshot)
3152
+ if (!u && n.__snapshot)
3085
3153
  return n.__snapshot;
3086
- for (const u in a)
3087
- n[u] = o[u];
3154
+ for (const l in r)
3155
+ n[l] = o[l];
3088
3156
  return n.__snapshot = t(o), n.__snapshot;
3089
- }, [a, t]);
3090
- return R.useSyncExternalStore(i, r, r);
3157
+ }, [r, t]);
3158
+ return R.useSyncExternalStore(i, a, a);
3091
3159
  }
3092
- function de(a) {
3160
+ function ue(r) {
3093
3161
  const e = {
3094
- value: a.value,
3095
- disabled: a.disabled,
3096
- errors: a.errors,
3097
- pending: a.pending,
3098
- valid: a.valid,
3099
- invalid: a.invalid,
3100
- touched: a.touched,
3101
- shouldShowError: a.shouldShowError,
3102
- componentProps: a.componentProps
3162
+ value: r.value,
3163
+ disabled: r.disabled,
3164
+ errors: r.errors,
3165
+ pending: r.pending,
3166
+ valid: r.valid,
3167
+ invalid: r.invalid,
3168
+ touched: r.touched,
3169
+ shouldShowError: r.shouldShowError,
3170
+ componentProps: r.componentProps
3103
3171
  }, t = [
3104
3172
  { key: "value" },
3105
3173
  { key: "disabled" },
@@ -3124,18 +3192,18 @@ function de(a) {
3124
3192
  }),
3125
3193
  []
3126
3194
  );
3127
- return q(e, t, s);
3195
+ return W(e, t, s);
3128
3196
  }
3129
- function ce(a) {
3197
+ function he(r) {
3130
3198
  const e = {
3131
- value: a.value,
3132
- length: a.length,
3133
- errors: a.errors,
3134
- pending: a.pending,
3135
- valid: a.valid,
3136
- invalid: a.invalid,
3137
- touched: a.touched,
3138
- dirty: a.dirty
3199
+ value: r.value,
3200
+ length: r.length,
3201
+ errors: r.errors,
3202
+ pending: r.pending,
3203
+ valid: r.valid,
3204
+ invalid: r.invalid,
3205
+ touched: r.touched,
3206
+ dirty: r.dirty
3139
3207
  }, t = [
3140
3208
  { key: "value" },
3141
3209
  { key: "length" },
@@ -3158,11 +3226,11 @@ function ce(a) {
3158
3226
  }),
3159
3227
  []
3160
3228
  );
3161
- return q(e, t, s);
3229
+ return W(e, t, s);
3162
3230
  }
3163
- function Ee(a) {
3164
- const e = a && "length" in a && "map" in a;
3165
- return a ? e ? ce(a) : de(a) : {
3231
+ function ge(r) {
3232
+ const e = r && "length" in r && "map" in r;
3233
+ return r ? e ? he(r) : ue(r) : {
3166
3234
  value: [],
3167
3235
  length: 0,
3168
3236
  pending: !1,
@@ -3173,99 +3241,99 @@ function Ee(a) {
3173
3241
  dirty: !1
3174
3242
  };
3175
3243
  }
3176
- function _e(a) {
3177
- const e = P({ value: a.value.value }), t = b(
3244
+ function be(r) {
3245
+ const e = T({ value: r.value.value }), t = b(
3178
3246
  (i) => {
3179
- let r = !0;
3247
+ let a = !0;
3180
3248
  return m(() => {
3181
- if (a.value.value, r) {
3182
- r = !1;
3249
+ if (r.value.value, a) {
3250
+ a = !1;
3183
3251
  return;
3184
3252
  }
3185
3253
  i();
3186
3254
  });
3187
3255
  },
3188
- [a]
3256
+ [r]
3189
3257
  ), s = b(() => {
3190
- const i = a.value.value;
3258
+ const i = r.value.value;
3191
3259
  return e.current.value === i ? e.current.value : (e.current.value = i, i);
3192
- }, [a]);
3260
+ }, [r]);
3193
3261
  return R.useSyncExternalStore(t, s, s);
3194
3262
  }
3195
- function Se(a) {
3196
- const e = P({ length: a.length.value }), t = b(
3263
+ function Ee(r) {
3264
+ const e = T({ length: r.length.value }), t = b(
3197
3265
  (i) => {
3198
- let r = !0;
3266
+ let a = !0;
3199
3267
  return m(() => {
3200
- if (a.length.value, r) {
3201
- r = !1;
3268
+ if (r.length.value, a) {
3269
+ a = !1;
3202
3270
  return;
3203
3271
  }
3204
3272
  i();
3205
3273
  });
3206
3274
  },
3207
- [a]
3275
+ [r]
3208
3276
  ), s = b(() => {
3209
- const i = a.length.value;
3277
+ const i = r.length.value;
3210
3278
  return e.current.length === i ? e.current.length : (e.current.length = i, i);
3211
- }, [a]);
3279
+ }, [r]);
3212
3280
  return R.useSyncExternalStore(t, s, s);
3213
3281
  }
3214
- function Ve(a, e, t) {
3282
+ function _e(r, e, t) {
3215
3283
  const s = b(
3216
- (r) => {
3284
+ (a) => {
3217
3285
  const n = e, o = [];
3218
- for (const l of Object.keys(n)) {
3219
- const u = n[l];
3220
- if (u && typeof u == "object" && u.value && typeof u.value.subscribe == "function") {
3221
- const v = u.value.subscribe(r);
3222
- o.push(v);
3286
+ for (const u of Object.keys(n)) {
3287
+ const l = n[u];
3288
+ if (l && typeof l == "object" && l.value && typeof l.value.subscribe == "function") {
3289
+ const f = l.value.subscribe(a);
3290
+ o.push(f);
3223
3291
  }
3224
3292
  }
3225
3293
  return () => {
3226
- o.forEach((l) => l());
3294
+ o.forEach((u) => u());
3227
3295
  };
3228
3296
  },
3229
3297
  [e]
3230
- ), i = b(() => a ? a(e, t) : !1, [a, e, t]);
3231
- return Q(s, i, i);
3298
+ ), i = b(() => r ? r(e, t) : !1, [r, e, t]);
3299
+ return z(s, i, i);
3232
3300
  }
3233
3301
  export {
3234
- ke as AbstractRegistry,
3235
- L as ArrayNode,
3236
- V as ErrorStrategy,
3237
- ee as FieldNode,
3238
- se as FieldPathNavigator,
3239
- S as FormErrorHandler,
3302
+ Oe as AbstractRegistry,
3303
+ I as ArrayNode,
3304
+ S as ErrorStrategy,
3305
+ Q as FieldNode,
3306
+ ee as FieldPathNavigator,
3307
+ k as FormErrorHandler,
3240
3308
  C as FormNode,
3241
- be as FormObserver,
3242
- Z as FormStatusMachine,
3243
- ae as FormSubmitter,
3244
- k as GroupNode,
3245
- ne as NodeFactory,
3246
- xe as RegistryStack,
3309
+ me as FormObserver,
3310
+ Y as FormStatusMachine,
3311
+ ie as FormSubmitter,
3312
+ A as GroupNode,
3313
+ re as NodeFactory,
3314
+ Te as RegistryStack,
3247
3315
  D as SubscriptionManager,
3248
- $e as behaviors,
3249
- I as createFieldPath,
3250
- ge as createForm,
3251
- Ie as extractKey,
3252
- Le as extractPath,
3253
- Fe as getCurrentBehaviorRegistry,
3254
- Te as getCurrentValidationRegistry,
3255
- Pe as getNodeType,
3256
- N as isArrayNode,
3257
- M as isFieldNode,
3258
- Ce as isFormNode,
3259
- De as isGroupNode,
3260
- We as runOutsideEffect,
3261
- qe as safeCallback,
3262
- je as safeDebouncedCallback,
3263
- Be as toFieldPath,
3264
- A as uniqueId,
3265
- Se as useArrayLength,
3266
- Ee as useFormControl,
3267
- _e as useFormControlValue,
3268
- Ve as useHiddenCondition,
3269
- Re as validateForm,
3270
- Me as validators
3316
+ Be as behaviors,
3317
+ N as createFieldPath,
3318
+ ye as createForm,
3319
+ Me as extractKey,
3320
+ Ne as extractPath,
3321
+ Ce as getCurrentBehaviorRegistry,
3322
+ De as getCurrentValidationRegistry,
3323
+ Ve as getNodeType,
3324
+ M as isArrayNode,
3325
+ q as isFieldNode,
3326
+ Ae as isFormNode,
3327
+ ke as isGroupNode,
3328
+ $e as runOutsideEffect,
3329
+ Ue as safeCallback,
3330
+ We as safeDebouncedCallback,
3331
+ Ie as toFieldPath,
3332
+ V as uniqueId,
3333
+ Ee as useArrayLength,
3334
+ ge as useFormControl,
3335
+ be as useFormControlValue,
3336
+ _e as useHiddenCondition,
3337
+ xe as validateForm,
3338
+ Fe as validators
3271
3339
  };