suprform 1.2.0 → 1.2.1

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.
@@ -32,8 +32,8 @@ var Ee = (t) => /^\w*$/.test(t), N = (t) => t === void 0, we = (t) => Array.isAr
32
32
  const l = u[s];
33
33
  let V = e;
34
34
  if (s !== c) {
35
- const h = t[l];
36
- V = H(h) || Array.isArray(h) ? h : isNaN(+u[s + 1]) ? {} : [];
35
+ const g = t[l];
36
+ V = H(g) || Array.isArray(g) ? g : isNaN(+u[s + 1]) ? {} : [];
37
37
  }
38
38
  if (l === "__proto__" || l === "constructor" || l === "prototype")
39
39
  return;
@@ -93,10 +93,10 @@ function rr(t) {
93
93
  name: u,
94
94
  formState: V.current,
95
95
  exact: i,
96
- callback: (h) => {
96
+ callback: (g) => {
97
97
  !s && l({
98
98
  ...e._formState,
99
- ...h
99
+ ...g
100
100
  });
101
101
  }
102
102
  }), [u, s, i]), F.useEffect(() => {
@@ -128,25 +128,25 @@ function ae(t, r, e = /* @__PURE__ */ new WeakSet()) {
128
128
  return !0;
129
129
  }
130
130
  function Xe(t) {
131
- const r = Ve(), { control: e = r.control, name: s, defaultValue: u, disabled: i, exact: c, compute: l } = t || {}, V = F.useRef(u), h = F.useRef(l), k = F.useRef(void 0), g = F.useRef(e), S = F.useRef(s);
132
- h.current = l;
131
+ const r = Ve(), { control: e = r.control, name: s, defaultValue: u, disabled: i, exact: c, compute: l } = t || {}, V = F.useRef(u), g = F.useRef(l), k = F.useRef(void 0), h = F.useRef(e), S = F.useRef(s);
132
+ g.current = l;
133
133
  const [p, I] = F.useState(() => {
134
134
  const f = e._getWatch(s, V.current);
135
- return h.current ? h.current(f) : f;
135
+ return g.current ? g.current(f) : f;
136
136
  }), R = F.useCallback((f) => {
137
137
  const d = qe(s, e._names, f || e._formValues, !1, V.current);
138
- return h.current ? h.current(d) : d;
138
+ return g.current ? g.current(d) : d;
139
139
  }, [e._formValues, e._names, s]), T = F.useCallback((f) => {
140
140
  if (!i) {
141
141
  const d = qe(s, e._names, f || e._formValues, !1, V.current);
142
- if (h.current) {
143
- const A = h.current(d);
142
+ if (g.current) {
143
+ const A = g.current(d);
144
144
  ae(A, k.current) || (I(A), k.current = A);
145
145
  } else
146
146
  I(d);
147
147
  }
148
148
  }, [e._formValues, e._names, i, s]);
149
- ke(() => ((g.current !== e || !ae(S.current, s)) && (g.current = e, S.current = s, T()), e._subscribe({
149
+ ke(() => ((h.current !== e || !ae(S.current, s)) && (h.current = e, S.current = s, T()), e._subscribe({
150
150
  name: s,
151
151
  formState: {
152
152
  values: !0
@@ -156,7 +156,7 @@ function Xe(t) {
156
156
  T(f.values);
157
157
  }
158
158
  })), [e, c, s, T]), F.useEffect(() => e._removeUnmounted());
159
- const U = g.current !== e, x = S.current, B = F.useMemo(() => {
159
+ const U = h.current !== e, x = S.current, B = F.useMemo(() => {
160
160
  if (i)
161
161
  return null;
162
162
  const f = !U && !ae(x, s);
@@ -165,12 +165,12 @@ function Xe(t) {
165
165
  return B !== null ? B : p;
166
166
  }
167
167
  function sr(t) {
168
- const r = Ve(), { name: e, disabled: s, control: u = r.control, shouldUnregister: i, defaultValue: c, exact: l = !0 } = t, V = St(u._names.array, e), h = F.useMemo(() => m(u._formValues, e, m(u._defaultValues, e, c)), [u, e, c]), k = Xe({
168
+ const r = Ve(), { name: e, disabled: s, control: u = r.control, shouldUnregister: i, defaultValue: c, exact: l = !0 } = t, V = St(u._names.array, e), g = F.useMemo(() => m(u._formValues, e, m(u._defaultValues, e, c)), [u, e, c]), k = Xe({
169
169
  control: u,
170
170
  name: e,
171
- defaultValue: h,
171
+ defaultValue: g,
172
172
  exact: l
173
- }), g = rr({
173
+ }), h = rr({
174
174
  control: u,
175
175
  name: e,
176
176
  exact: l
@@ -183,25 +183,25 @@ function sr(t) {
183
183
  const R = F.useMemo(() => Object.defineProperties({}, {
184
184
  invalid: {
185
185
  enumerable: !0,
186
- get: () => !!m(g.errors, e)
186
+ get: () => !!m(h.errors, e)
187
187
  },
188
188
  isDirty: {
189
189
  enumerable: !0,
190
- get: () => !!m(g.dirtyFields, e)
190
+ get: () => !!m(h.dirtyFields, e)
191
191
  },
192
192
  isTouched: {
193
193
  enumerable: !0,
194
- get: () => !!m(g.touchedFields, e)
194
+ get: () => !!m(h.touchedFields, e)
195
195
  },
196
196
  isValidating: {
197
197
  enumerable: !0,
198
- get: () => !!m(g.validatingFields, e)
198
+ get: () => !!m(h.validatingFields, e)
199
199
  },
200
200
  error: {
201
201
  enumerable: !0,
202
- get: () => m(g.errors, e)
202
+ get: () => m(h.errors, e)
203
203
  }
204
- }), [g, e]), T = F.useCallback((f) => I.current.onChange({
204
+ }), [h, e]), T = F.useCallback((f) => I.current.onChange({
205
205
  target: {
206
206
  value: xt(f),
207
207
  name: e
@@ -224,11 +224,11 @@ function sr(t) {
224
224
  }, [u._fields, e]), B = F.useMemo(() => ({
225
225
  name: e,
226
226
  value: k,
227
- ...J(s) || g.disabled ? { disabled: g.disabled || s } : {},
227
+ ...J(s) || h.disabled ? { disabled: h.disabled || s } : {},
228
228
  onChange: T,
229
229
  onBlur: U,
230
230
  ref: x
231
- }), [e, s, g.disabled, T, U, x, k]);
231
+ }), [e, s, h.disabled, T, U, x, k]);
232
232
  return F.useEffect(() => {
233
233
  const f = u._options.shouldUnregister || i, d = p.current;
234
234
  d && d !== e && !V && u.unregister(d), u.register(e, {
@@ -253,9 +253,9 @@ function sr(t) {
253
253
  });
254
254
  }, [s, e, u]), F.useMemo(() => ({
255
255
  field: B,
256
- formState: g,
256
+ formState: h,
257
257
  fieldState: R
258
- }), [B, g, R]);
258
+ }), [B, h, R]);
259
259
  }
260
260
  const ar = (t) => t.render(sr(t));
261
261
  var nr = (t, r, e, s, u) => r ? {
@@ -463,7 +463,7 @@ var le = (t) => H(t) && !Se(t) ? t : {
463
463
  value: t,
464
464
  message: ""
465
465
  }, ze = async (t, r, e, s, u, i) => {
466
- const { ref: c, refs: l, required: V, maxLength: h, minLength: k, min: g, max: S, pattern: p, validate: I, name: R, valueAsNumber: T, mount: U } = t._f, x = m(e, R);
466
+ const { ref: c, refs: l, required: V, maxLength: g, minLength: k, min: h, max: S, pattern: p, validate: I, name: R, valueAsNumber: T, mount: U } = t._f, x = m(e, R);
467
467
  if (!U || r.has(R))
468
468
  return {};
469
469
  const B = l ? l[0] : c, f = (E) => {
@@ -487,9 +487,9 @@ var le = (t) => H(t) && !Se(t) ? t : {
487
487
  }, !s))
488
488
  return f(C), d;
489
489
  }
490
- if (!K && (!Q(g) || !Q(S))) {
490
+ if (!K && (!Q(h) || !Q(S))) {
491
491
  let E, C;
492
- const $ = le(S), q = le(g);
492
+ const $ = le(S), q = le(h);
493
493
  if (!Q(x) && !isNaN(x)) {
494
494
  const se = c.valueAsNumber || x && +x;
495
495
  Q($.value) || (E = se > $.value), Q(q.value) || (C = se < q.value);
@@ -500,8 +500,8 @@ var le = (t) => H(t) && !Se(t) ? t : {
500
500
  if ((E || C) && (Fe(!!E, $.message, q.message, ne.max, ne.min), !s))
501
501
  return f(d[R].message), d;
502
502
  }
503
- if ((h || k) && !K && (X(x) || i && Array.isArray(x))) {
504
- const E = le(h), C = le(k), $ = !Q(E.value) && x.length > +E.value, q = !Q(C.value) && x.length < +C.value;
503
+ if ((g || k) && !K && (X(x) || i && Array.isArray(x))) {
504
+ const E = le(g), C = le(k), $ = !Q(E.value) && x.length > +E.value, q = !Q(C.value) && x.length < +C.value;
505
505
  if (($ || q) && (Fe($, E.message, C.message), !s))
506
506
  return f(d[R].message), d;
507
507
  }
@@ -578,7 +578,7 @@ function vr(t = {}) {
578
578
  unMount: /* @__PURE__ */ new Set(),
579
579
  array: /* @__PURE__ */ new Set(),
580
580
  watch: /* @__PURE__ */ new Set()
581
- }, V, h = 0;
581
+ }, V, g = 0;
582
582
  const k = {
583
583
  isDirty: !1,
584
584
  dirtyFields: !1,
@@ -587,26 +587,26 @@ function vr(t = {}) {
587
587
  isValidating: !1,
588
588
  isValid: !1,
589
589
  errors: !1
590
- }, g = {
590
+ }, h = {
591
591
  ...k
592
592
  };
593
593
  let S = {
594
- ...g
594
+ ...h
595
595
  };
596
596
  const p = {
597
597
  array: yt(),
598
598
  state: yt()
599
599
  }, I = r.criteriaMode === re.all, R = (a) => (n) => {
600
- clearTimeout(h), h = setTimeout(a, n);
600
+ clearTimeout(g), g = setTimeout(a, n);
601
601
  }, T = async (a) => {
602
- if (!c.keepIsValid && !r.disabled && (g.isValid || S.isValid || a)) {
602
+ if (!c.keepIsValid && !r.disabled && (h.isValid || S.isValid || a)) {
603
603
  let n;
604
604
  r.resolver ? (n = j((await W()).errors), U()) : n = await Z(s, !0), n !== e.isValid && p.state.next({
605
605
  isValid: n
606
606
  });
607
607
  }
608
608
  }, U = (a, n) => {
609
- !r.disabled && (g.isValidating || g.validatingFields || S.isValidating || S.validatingFields) && ((a || Array.from(l.mount)).forEach((o) => {
609
+ !r.disabled && (h.isValidating || h.validatingFields || S.isValidating || S.validatingFields) && ((a || Array.from(l.mount)).forEach((o) => {
610
610
  o && (n ? O(e.validatingFields, o, n) : P(e.validatingFields, o));
611
611
  }), p.state.next({
612
612
  validatingFields: e.validatingFields,
@@ -622,11 +622,11 @@ function vr(t = {}) {
622
622
  const b = o(m(e.errors, a), v.argA, v.argB);
623
623
  _ && O(e.errors, a, b), gr(e.errors, a);
624
624
  }
625
- if ((g.touchedFields || S.touchedFields) && y && Array.isArray(m(e.touchedFields, a))) {
625
+ if ((h.touchedFields || S.touchedFields) && y && Array.isArray(m(e.touchedFields, a))) {
626
626
  const b = o(m(e.touchedFields, a), v.argA, v.argB);
627
627
  _ && O(e.touchedFields, a, b);
628
628
  }
629
- (g.dirtyFields || S.dirtyFields) && (e.dirtyFields = ce(u, i)), p.state.next({
629
+ (h.dirtyFields || S.dirtyFields) && (e.dirtyFields = ce(u, i)), p.state.next({
630
630
  name: a,
631
631
  isDirty: E(a, n),
632
632
  dirtyFields: e.dirtyFields,
@@ -657,20 +657,20 @@ function vr(t = {}) {
657
657
  };
658
658
  if (!r.disabled) {
659
659
  if (!o || v) {
660
- (g.isDirty || S.isDirty) && (b = e.isDirty, e.isDirty = D.isDirty = E(), y = b !== D.isDirty);
660
+ (h.isDirty || S.isDirty) && (b = e.isDirty, e.isDirty = D.isDirty = E(), y = b !== D.isDirty);
661
661
  const L = ae(m(u, a), n);
662
- b = !!m(e.dirtyFields, a), L ? P(e.dirtyFields, a) : O(e.dirtyFields, a, !0), D.dirtyFields = e.dirtyFields, y = y || (g.dirtyFields || S.dirtyFields) && b !== !L;
662
+ b = !!m(e.dirtyFields, a), L ? P(e.dirtyFields, a) : O(e.dirtyFields, a, !0), D.dirtyFields = e.dirtyFields, y = y || (h.dirtyFields || S.dirtyFields) && b !== !L;
663
663
  }
664
664
  if (o) {
665
665
  const L = m(e.touchedFields, a);
666
- L || (O(e.touchedFields, a, o), D.touchedFields = e.touchedFields, y = y || (g.touchedFields || S.touchedFields) && L !== o);
666
+ L || (O(e.touchedFields, a, o), D.touchedFields = e.touchedFields, y = y || (h.touchedFields || S.touchedFields) && L !== o);
667
667
  }
668
668
  y && _ && p.state.next(D);
669
669
  }
670
670
  return y ? D : {};
671
671
  }, w = (a, n, o, v) => {
672
- const _ = m(e.errors, a), y = (g.isValid || S.isValid) && J(n) && e.isValid !== n;
673
- if (r.delayError && o ? (V = R(() => B(a, o)), V(r.delayError)) : (clearTimeout(h), V = null, o ? O(e.errors, a, o) : P(e.errors, a)), (o ? !ae(_, o) : _) || !j(v) || y) {
672
+ const _ = m(e.errors, a), y = (h.isValid || S.isValid) && J(n) && e.isValid !== n;
673
+ if (r.delayError && o ? (V = R(() => B(a, o)), V(r.delayError)) : (clearTimeout(g), V = null, o ? O(e.errors, a, o) : P(e.errors, a)), (o ? !ae(_, o) : _) || !j(v) || y) {
674
674
  const b = {
675
675
  ...v,
676
676
  ...y && J(n) ? { isValid: n } : {},
@@ -701,9 +701,9 @@ function vr(t = {}) {
701
701
  const { _f: y, ...b } = _;
702
702
  if (y) {
703
703
  const D = l.array.has(y.name), L = _._f && dr(_._f);
704
- L && g.validatingFields && U([y.name], !0);
704
+ L && h.validatingFields && U([y.name], !0);
705
705
  const ee = await ze(_, l.disabled, i, I, r.shouldUseNativeValidation && !n, D);
706
- if (L && g.validatingFields && U([y.name]), ee[y.name] && (o.valid = !1, n))
706
+ if (L && h.validatingFields && U([y.name]), ee[y.name] && (o.valid = !1, n))
707
707
  break;
708
708
  !n && (m(ee, y.name) ? D ? Rt(e.errors, ee, y.name) : O(e.errors, y.name, ee[y.name]) : P(e.errors, y.name));
709
709
  }
@@ -744,7 +744,7 @@ function vr(t = {}) {
744
744
  O(i, a, y), _ ? (p.array.next({
745
745
  name: a,
746
746
  values: M(i)
747
- }), (g.isDirty || g.dirtyFields || S.isDirty || S.dirtyFields) && o.shouldDirty && p.state.next({
747
+ }), (h.isDirty || h.dirtyFields || S.isDirty || S.dirtyFields) && o.shouldDirty && p.state.next({
748
748
  name: a,
749
749
  dirtyFields: ce(u, i),
750
750
  isDirty: E(a, y)
@@ -769,7 +769,7 @@ function vr(t = {}) {
769
769
  type: a.type,
770
770
  values: M(i)
771
771
  }), qt)
772
- return (g.isValid || S.isValid) && (r.mode === "onBlur" ? ie && T() : ie || T()), jt && p.state.next({ name: o, ...Oe ? {} : Re });
772
+ return (h.isValid || S.isValid) && (r.mode === "onBlur" ? ie && T() : ie || T()), jt && p.state.next({ name: o, ...Oe ? {} : Re });
773
773
  if (!ie && Oe && p.state.next({ ...e }), r.resolver) {
774
774
  const { errors: dt } = await W([o]);
775
775
  if (U([o]), y(be), v) {
@@ -777,7 +777,7 @@ function vr(t = {}) {
777
777
  L = ft.error, o = ft.name, ee = j(dt);
778
778
  }
779
779
  } else
780
- U([o], !0), L = (await ze(_, l.disabled, i, I, r.shouldUseNativeValidation))[o], U([o]), y(be), v && (L ? ee = !1 : (g.isValid || S.isValid) && (ee = await Z(s, !0)));
780
+ U([o], !0), L = (await ze(_, l.disabled, i, I, r.shouldUseNativeValidation))[o], U([o]), y(be), v && (L ? ee = !1 : (h.isValid || S.isValid) && (ee = await Z(s, !0)));
781
781
  v && (_._f.deps && (!Array.isArray(_._f.deps) || _._f.deps.length > 0) && ge(_._f.deps), w(o, ee, L, Re));
782
782
  }
783
783
  }, _e = (a, n) => {
@@ -794,7 +794,7 @@ function vr(t = {}) {
794
794
  return await Z(b && b._f ? { [y]: b } : b);
795
795
  }))).every(Boolean), !(!v && !e.isValid) && T()) : v = o = await Z(s);
796
796
  return p.state.next({
797
- ...!X(a) || (g.isValid || S.isValid) && o !== e.isValid ? {} : { name: a },
797
+ ...!X(a) || (h.isValid || S.isValid) && o !== e.isValid ? {} : { name: a },
798
798
  ...r.resolver || !a ? { isValid: o } : {},
799
799
  errors: e.errors
800
800
  }), n.shouldFocus && !v && fe(s, _e, a ? _ : l.mount), v;
@@ -828,7 +828,7 @@ function vr(t = {}) {
828
828
  next: (o) => "values" in o && a(C(void 0, n), o)
829
829
  }) : C(a, n, !0), nt = (a) => p.state.subscribe({
830
830
  next: (n) => {
831
- mr(a.name, n.name, a.exact) && yr(n, a.formState || g, $t, a.reRenderRoot) && a.callback({
831
+ mr(a.name, n.name, a.exact) && yr(n, a.formState || h, $t, a.reRenderRoot) && a.callback({
832
832
  values: { ...i },
833
833
  ...e,
834
834
  ...n,
@@ -946,7 +946,7 @@ function vr(t = {}) {
946
946
  }), v)
947
947
  throw v;
948
948
  }, Wt = (a, n = {}) => {
949
- m(s, a) && (N(n.defaultValue) ? Y(a, M(m(u, a))) : (Y(a, n.defaultValue), O(u, a, M(n.defaultValue))), n.keepTouched || P(e.touchedFields, a), n.keepDirty || (P(e.dirtyFields, a), e.isDirty = n.defaultValue ? E(a, M(m(u, a))) : E()), n.keepError || (P(e.errors, a), g.isValid && T()), p.state.next({ ...e }));
949
+ m(s, a) && (N(n.defaultValue) ? Y(a, M(m(u, a))) : (Y(a, n.defaultValue), O(u, a, M(n.defaultValue))), n.keepTouched || P(e.touchedFields, a), n.keepDirty || (P(e.dirtyFields, a), e.isDirty = n.defaultValue ? E(a, M(m(u, a))) : E()), n.keepError || (P(e.errors, a), h.isValid && T()), p.state.next({ ...e }));
950
950
  }, ot = (a, n = {}) => {
951
951
  const o = a ? M(a) : u, v = M(o), _ = j(a), y = _ ? u : v;
952
952
  if (n.keepDefaultValues || (u = o), !n.keepValues) {
@@ -992,7 +992,7 @@ function vr(t = {}) {
992
992
  watch: /* @__PURE__ */ new Set(),
993
993
  watchAll: !1,
994
994
  focus: ""
995
- }, c.mount = !g.isValid || !!n.keepIsValid || !!n.keepDirtyValues || !r.shouldUnregister && !j(y), c.watch = !!r.shouldUnregister, c.keepIsValid = !!n.keepIsValid, c.action = !1, n.keepErrors || (e.errors = {}), p.state.next({
995
+ }, c.mount = !h.isValid || !!n.keepIsValid || !!n.keepDirtyValues || !r.shouldUnregister && !j(y), c.watch = !!r.shouldUnregister, c.keepIsValid = !!n.keepIsValid, c.action = !1, n.keepErrors || (e.errors = {}), p.state.next({
996
996
  submitCount: n.keepSubmitCount ? e.submitCount : 0,
997
997
  isDirty: _ ? !1 : n.keepDirty ? e.isDirty : !!(n.keepDefaultValues && !ae(a, u)),
998
998
  isSubmitted: n.keepIsSubmitted ? e.isSubmitted : !1,
@@ -1043,7 +1043,7 @@ function vr(t = {}) {
1043
1043
  _removeUnmounted: Fe,
1044
1044
  _disableForm: Pt,
1045
1045
  _subjects: p,
1046
- _proxyFormState: g,
1046
+ _proxyFormState: h,
1047
1047
  get _fields() {
1048
1048
  return s;
1049
1049
  },
@@ -1133,59 +1133,59 @@ var He = (t, r) => N(r) ? [] : Vr(t, z(r).sort((e, s) => e - s)), $e = (t, r, e)
1133
1133
  [t[r], t[e]] = [t[e], t[r]];
1134
1134
  }, bt = (t, r, e) => (t[r] = e, t);
1135
1135
  function Fr(t) {
1136
- const r = Ve(), { control: e = r.control, name: s, keyName: u = "id", shouldUnregister: i, rules: c } = t, [l, V] = F.useState(e._getFieldArray(s)), h = F.useRef(e._getFieldArray(s).map(ue)), k = F.useRef(!1);
1136
+ const r = Ve(), { control: e = r.control, name: s, keyName: u = "id", shouldUnregister: i, rules: c } = t, [l, V] = F.useState(e._getFieldArray(s)), g = F.useRef(e._getFieldArray(s).map(ue)), k = F.useRef(!1);
1137
1137
  e._names.array.add(s), F.useMemo(() => c && l.length >= 0 && e.register(s, c), [e, s, l.length, c]), ke(() => e._subjects.array.subscribe({
1138
1138
  next: ({ values: f, name: d }) => {
1139
1139
  if (d === s || !d) {
1140
1140
  const A = m(f, s);
1141
- Array.isArray(A) && (V(A), h.current = A.map(ue));
1141
+ Array.isArray(A) && (V(A), g.current = A.map(ue));
1142
1142
  }
1143
1143
  }
1144
1144
  }).unsubscribe, [e, s]);
1145
- const g = F.useCallback((f) => {
1145
+ const h = F.useCallback((f) => {
1146
1146
  k.current = !0, e._setFieldArray(s, f);
1147
1147
  }, [e, s]), S = (f, d) => {
1148
1148
  const A = z(M(f)), w = Me(e._getFieldArray(s), A);
1149
- e._names.focus = Ue(s, w.length - 1, d), h.current = Me(h.current, A.map(ue)), g(w), V(w), e._setFieldArray(s, w, Me, {
1149
+ e._names.focus = Ue(s, w.length - 1, d), g.current = Me(g.current, A.map(ue)), h(w), V(w), e._setFieldArray(s, w, Me, {
1150
1150
  argA: Ie(f)
1151
1151
  });
1152
1152
  }, p = (f, d) => {
1153
1153
  const A = z(M(f)), w = We(e._getFieldArray(s), A);
1154
- e._names.focus = Ue(s, 0, d), h.current = We(h.current, A.map(ue)), g(w), V(w), e._setFieldArray(s, w, We, {
1154
+ e._names.focus = Ue(s, 0, d), g.current = We(g.current, A.map(ue)), h(w), V(w), e._setFieldArray(s, w, We, {
1155
1155
  argA: Ie(f)
1156
1156
  });
1157
1157
  }, I = (f) => {
1158
1158
  const d = He(e._getFieldArray(s), f);
1159
- h.current = He(h.current, f), g(d), V(d), !Array.isArray(m(e._fields, s)) && O(e._fields, s, void 0), e._setFieldArray(s, d, He, {
1159
+ g.current = He(g.current, f), h(d), V(d), !Array.isArray(m(e._fields, s)) && O(e._fields, s, void 0), e._setFieldArray(s, d, He, {
1160
1160
  argA: f
1161
1161
  });
1162
1162
  }, R = (f, d, A) => {
1163
1163
  const w = z(M(d)), W = Be(e._getFieldArray(s), f, w);
1164
- e._names.focus = Ue(s, f, A), h.current = Be(h.current, f, w.map(ue)), g(W), V(W), e._setFieldArray(s, W, Be, {
1164
+ e._names.focus = Ue(s, f, A), g.current = Be(g.current, f, w.map(ue)), h(W), V(W), e._setFieldArray(s, W, Be, {
1165
1165
  argA: f,
1166
1166
  argB: Ie(d)
1167
1167
  });
1168
1168
  }, T = (f, d) => {
1169
1169
  const A = e._getFieldArray(s);
1170
- $e(A, f, d), $e(h.current, f, d), g(A), V(A), e._setFieldArray(s, A, $e, {
1170
+ $e(A, f, d), $e(g.current, f, d), h(A), V(A), e._setFieldArray(s, A, $e, {
1171
1171
  argA: f,
1172
1172
  argB: d
1173
1173
  }, !1);
1174
1174
  }, U = (f, d) => {
1175
1175
  const A = e._getFieldArray(s);
1176
- Pe(A, f, d), Pe(h.current, f, d), g(A), V(A), e._setFieldArray(s, A, Pe, {
1176
+ Pe(A, f, d), Pe(g.current, f, d), h(A), V(A), e._setFieldArray(s, A, Pe, {
1177
1177
  argA: f,
1178
1178
  argB: d
1179
1179
  }, !1);
1180
1180
  }, x = (f, d) => {
1181
1181
  const A = M(d), w = bt(e._getFieldArray(s), f, A);
1182
- h.current = [...w].map((W, K) => !W || K === f ? ue() : h.current[K]), g(w), V([...w]), e._setFieldArray(s, w, bt, {
1182
+ g.current = [...w].map((W, K) => !W || K === f ? ue() : g.current[K]), h(w), V([...w]), e._setFieldArray(s, w, bt, {
1183
1183
  argA: f,
1184
1184
  argB: A
1185
1185
  }, !0, !1);
1186
1186
  }, B = (f) => {
1187
1187
  const d = z(M(f));
1188
- h.current = d.map(ue), g([...d]), V([...d]), e._setFieldArray(s, [...d], (A) => A, {}, !0, !1);
1188
+ g.current = d.map(ue), h([...d]), V([...d]), e._setFieldArray(s, [...d], (A) => A, {}, !0, !1);
1189
1189
  };
1190
1190
  return F.useEffect(() => {
1191
1191
  if (e._state.action = !1, Qe(s, e._names) && e._subjects.state.next({
@@ -1219,17 +1219,17 @@ function Fr(t) {
1219
1219
  };
1220
1220
  e._options.shouldUnregister || i ? e.unregister(s) : f(s, !1);
1221
1221
  }), [s, e, u, i]), {
1222
- swap: F.useCallback(T, [g, s, e]),
1223
- move: F.useCallback(U, [g, s, e]),
1224
- prepend: F.useCallback(p, [g, s, e]),
1225
- append: F.useCallback(S, [g, s, e]),
1226
- remove: F.useCallback(I, [g, s, e]),
1227
- insert: F.useCallback(R, [g, s, e]),
1228
- update: F.useCallback(x, [g, s, e]),
1229
- replace: F.useCallback(B, [g, s, e]),
1222
+ swap: F.useCallback(T, [h, s, e]),
1223
+ move: F.useCallback(U, [h, s, e]),
1224
+ prepend: F.useCallback(p, [h, s, e]),
1225
+ append: F.useCallback(S, [h, s, e]),
1226
+ remove: F.useCallback(I, [h, s, e]),
1227
+ insert: F.useCallback(R, [h, s, e]),
1228
+ update: F.useCallback(x, [h, s, e]),
1229
+ replace: F.useCallback(B, [h, s, e]),
1230
1230
  fields: F.useMemo(() => l.map((f, d) => ({
1231
1231
  ...f,
1232
- [u]: h.current[d] || ue()
1232
+ [u]: g.current[d] || ue()
1233
1233
  })), [l, u])
1234
1234
  };
1235
1235
  }
@@ -1307,7 +1307,7 @@ const Lt = zt(void 0), Ar = ({ showAsterisk: t, children: r }) => /* @__PURE__ *
1307
1307
  return t;
1308
1308
  };
1309
1309
  function Nt(t, r, e) {
1310
- const { conditions: s, operator: u } = e, i = t.reduce((l, V, h) => (l[V] = r[h], l), {}), c = s.map((l) => {
1310
+ const { conditions: s, operator: u } = e, i = t.reduce((l, V, g) => (l[V] = r[g], l), {}), c = s.map((l) => {
1311
1311
  const V = i[l.name];
1312
1312
  switch (l.operator) {
1313
1313
  case "EQUALS":
@@ -1358,19 +1358,19 @@ const xr = ({
1358
1358
  disabled: c,
1359
1359
  shouldUnregister: l,
1360
1360
  visibility: V,
1361
- description: h
1361
+ description: g
1362
1362
  }) => {
1363
- const { control: k } = Ve(), g = t.props.value ?? "", { showAsterisk: S } = pr(), p = t.props.onChange, I = t.props.onBlur, R = ye(() => i || crypto.randomUUID(), []), T = ye(() => {
1364
- if (h)
1365
- return typeof h == "string" ? { position: "LABEL_BOTTOM", text: h } : h;
1366
- }, [h]);
1363
+ const { control: k } = Ve(), h = t.props.value ?? "", { showAsterisk: S } = pr(), p = t.props.onChange, I = t.props.onBlur, R = ye(() => i || crypto.randomUUID(), []), T = ye(() => {
1364
+ if (g)
1365
+ return typeof g == "string" ? { position: "LABEL_BOTTOM", text: g } : g;
1366
+ }, [g]);
1367
1367
  return /* @__PURE__ */ te(xr, { visibility: V, children: /* @__PURE__ */ te(Sr, { disabled: c, children: /* @__PURE__ */ te(
1368
1368
  ar,
1369
1369
  {
1370
1370
  control: k,
1371
1371
  name: r,
1372
1372
  rules: e,
1373
- defaultValue: g,
1373
+ defaultValue: h,
1374
1374
  shouldUnregister: l,
1375
1375
  render: ({
1376
1376
  field: { name: U, onBlur: x, value: B, onChange: f, ref: d, disabled: A },
@@ -1437,43 +1437,43 @@ const Er = ({
1437
1437
  rules: r
1438
1438
  });
1439
1439
  At(e, () => c, [c]);
1440
- const l = (V, h) => Yt.map(V, (k) => {
1440
+ const l = (V, g) => Yt.map(V, (k) => {
1441
1441
  var I, R;
1442
1442
  if (!Jt(k))
1443
1443
  return k;
1444
- const g = k.props, S = k.type;
1445
- if (((S == null ? void 0 : S.displayName) === "SuprFormControl" || S === tt || g.name !== void 0 && typeof S != "string") && g.name !== void 0) {
1446
- const T = u ? u[g.name] : void 0, U = T ? {
1444
+ const h = k.props, S = k.type;
1445
+ if (((S == null ? void 0 : S.displayName) === "SuprFormControl" || S === tt || h.name !== void 0 && typeof S != "string") && h.name !== void 0) {
1446
+ const T = u ? u[h.name] : void 0, U = T ? {
1447
1447
  ...T,
1448
1448
  conditions: ((I = T.conditions) == null ? void 0 : I.map((d) => ({
1449
1449
  ...d,
1450
- name: `${h}${d.name}`
1450
+ name: `${g}${d.name}`
1451
1451
  }))) || []
1452
- } : void 0, x = i ? i[g.name] : void 0, B = x ? {
1452
+ } : void 0, x = i ? i[h.name] : void 0, B = x ? {
1453
1453
  ...x,
1454
1454
  conditions: ((R = x.conditions) == null ? void 0 : R.map((d) => ({
1455
1455
  ...d,
1456
- name: `${h}${d.name}`
1456
+ name: `${g}${d.name}`
1457
1457
  }))) || []
1458
1458
  } : void 0, f = {
1459
- ...g,
1460
- name: `${h}${g.name}`,
1459
+ ...h,
1460
+ name: `${g}${h.name}`,
1461
1461
  visibility: U,
1462
1462
  disabled: B
1463
1463
  };
1464
- return g.id !== void 0 && (f.id = `${h}${g.id}`), Ae(k, f);
1464
+ return h.id !== void 0 && (f.id = `${g}${h.id}`), Ae(k, f);
1465
1465
  }
1466
- return g.children ? Ae(k, {
1467
- ...g,
1468
- children: l(g.children, h)
1466
+ return h.children ? Ae(k, {
1467
+ ...h,
1468
+ children: l(h.children, g)
1469
1469
  }) : k;
1470
1470
  });
1471
- return /* @__PURE__ */ te(Qt, { children: c.fields.map((V, h) => {
1472
- const k = `${t}.${h}.`;
1471
+ return /* @__PURE__ */ te(Qt, { children: c.fields.map((V, g) => {
1472
+ const k = `${t}.${g}.`;
1473
1473
  return /* @__PURE__ */ te(
1474
1474
  "div",
1475
1475
  {
1476
- "data-index": h,
1476
+ "data-index": g,
1477
1477
  style: { display: "contents" },
1478
1478
  id: "field-array-item",
1479
1479
  children: l(s, k)
@@ -1494,7 +1494,7 @@ const Er = ({
1494
1494
  ref: l,
1495
1495
  onChange: V
1496
1496
  }) => {
1497
- const h = br({
1497
+ const g = br({
1498
1498
  mode: "onSubmit",
1499
1499
  reValidateMode: "onChange",
1500
1500
  shouldFocusError: !0,
@@ -1503,29 +1503,30 @@ const Er = ({
1503
1503
  return At(
1504
1504
  l,
1505
1505
  () => ({
1506
- setValue: h.setValue,
1507
- setError: h.setError,
1508
- clearErrors: h.clearErrors,
1509
- getValues: h.getValues,
1510
- reset: h.reset,
1511
- setFocus: h.setFocus,
1512
- resetField: h.resetField,
1513
- trigger: h.trigger,
1514
- unregister: h.unregister,
1515
- watch: h.watch,
1516
- handleSubmit: h.handleSubmit
1506
+ setValue: g.setValue,
1507
+ setError: g.setError,
1508
+ clearErrors: g.clearErrors,
1509
+ getValues: g.getValues,
1510
+ reset: g.reset,
1511
+ setFocus: g.setFocus,
1512
+ resetField: g.resetField,
1513
+ trigger: g.trigger,
1514
+ unregister: g.unregister,
1515
+ watch: g.watch,
1516
+ handleSubmit: g.handleSubmit,
1517
+ formState: g.formState
1517
1518
  }),
1518
- [h]
1519
+ [g]
1519
1520
  ), Xt(() => {
1520
- const k = h.watch((g) => {
1521
- V == null || V(g);
1521
+ const k = g.watch((h) => {
1522
+ V == null || V(h);
1522
1523
  });
1523
1524
  return () => k.unsubscribe();
1524
- }, [h.watch]), /* @__PURE__ */ te(Ar, { showAsterisk: c, children: /* @__PURE__ */ te(tr, { ...h, children: /* @__PURE__ */ te(
1525
+ }, [g.watch]), /* @__PURE__ */ te(Ar, { showAsterisk: c, children: /* @__PURE__ */ te(tr, { ...g, children: /* @__PURE__ */ te(
1525
1526
  "form",
1526
1527
  {
1527
1528
  noValidate: !0,
1528
- onSubmit: h.handleSubmit(r, e),
1529
+ onSubmit: g.handleSubmit(r, e),
1529
1530
  style: s,
1530
1531
  className: u,
1531
1532
  children: t