suprform 1.1.5 → 1.2.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.
@@ -1,39 +1,39 @@
1
- import { jsx as se, jsxs as ft, Fragment as Gt } from "react/jsx-runtime";
2
- import F, { createContext as zt, useContext as Kt, useMemo as he, cloneElement as Ae, useImperativeHandle as At, Children as Yt, isValidElement as Jt, useEffect as Xt } from "react";
3
- var ve = (t) => t.type === "checkbox", oe = (t) => t instanceof Date, G = (t) => t == null;
1
+ import { jsx as te, jsxs as Le, Fragment as Qt } from "react/jsx-runtime";
2
+ import F, { createContext as zt, useContext as Kt, useMemo as ye, cloneElement as Ae, useImperativeHandle as At, Children as Yt, isValidElement as Jt, useEffect as Xt } from "react";
3
+ var ve = (t) => t.type === "checkbox", oe = (t) => t instanceof Date, Q = (t) => t == null;
4
4
  const pt = (t) => typeof t == "object";
5
- var W = (t) => !G(t) && !Array.isArray(t) && pt(t) && !oe(t), xt = (t) => W(t) && t.target ? ve(t.target) ? t.target.checked : t.target.value : t, Zt = (t) => t.substring(0, t.search(/\.\d+(\.|$)/)) || t, St = (t, r) => t.has(Zt(r)), er = (t) => {
5
+ var H = (t) => !Q(t) && !Array.isArray(t) && pt(t) && !oe(t), xt = (t) => H(t) && t.target ? ve(t.target) ? t.target.checked : t.target.value : t, Zt = (t) => t.substring(0, t.search(/\.\d+(\.|$)/)) || t, St = (t, r) => t.has(Zt(r)), er = (t) => {
6
6
  const r = t.constructor && t.constructor.prototype;
7
- return W(r) && r.hasOwnProperty("isPrototypeOf");
8
- }, ze = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
9
- function L(t) {
7
+ return H(r) && r.hasOwnProperty("isPrototypeOf");
8
+ }, Ke = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
9
+ function M(t) {
10
10
  if (t instanceof Date)
11
11
  return new Date(t);
12
12
  const r = typeof FileList < "u" && t instanceof FileList;
13
- if (ze && (t instanceof Blob || r))
13
+ if (Ke && (t instanceof Blob || r))
14
14
  return t;
15
15
  const e = Array.isArray(t);
16
- if (!e && !(W(t) && er(t)))
16
+ if (!e && !(H(t) && er(t)))
17
17
  return t;
18
18
  const s = e ? [] : Object.create(Object.getPrototypeOf(t));
19
19
  for (const u in t)
20
- Object.prototype.hasOwnProperty.call(t, u) && (s[u] = L(t[u]));
20
+ Object.prototype.hasOwnProperty.call(t, u) && (s[u] = M(t[u]));
21
21
  return s;
22
22
  }
23
- var Ee = (t) => /^\w*$/.test(t), U = (t) => t === void 0, we = (t) => Array.isArray(t) ? t.filter(Boolean) : [], Ke = (t) => we(t.replace(/["|']|\]/g, "").split(/\.|\[/)), m = (t, r, e) => {
24
- if (!r || !W(t))
23
+ var Ee = (t) => /^\w*$/.test(t), N = (t) => t === void 0, we = (t) => Array.isArray(t) ? t.filter(Boolean) : [], Ye = (t) => we(t.replace(/["|']|\]/g, "").split(/\.|\[/)), m = (t, r, e) => {
24
+ if (!r || !H(t))
25
25
  return e;
26
- const s = (Ee(r) ? [r] : Ke(r)).reduce((u, i) => G(u) ? u : u[i], t);
27
- return U(s) || s === t ? U(t[r]) ? e : t[r] : s;
28
- }, J = (t) => typeof t == "boolean", Q = (t) => typeof t == "function", R = (t, r, e) => {
26
+ const s = (Ee(r) ? [r] : Ye(r)).reduce((u, i) => Q(u) ? u : u[i], t);
27
+ return N(s) || s === t ? N(t[r]) ? e : t[r] : s;
28
+ }, J = (t) => typeof t == "boolean", G = (t) => typeof t == "function", O = (t, r, e) => {
29
29
  let s = -1;
30
- const u = Ee(r) ? [r] : Ke(r), i = u.length, c = i - 1;
30
+ const u = Ee(r) ? [r] : Ye(r), i = u.length, c = i - 1;
31
31
  for (; ++s < i; ) {
32
32
  const l = u[s];
33
33
  let V = e;
34
34
  if (s !== c) {
35
- const v = t[l];
36
- V = W(v) || Array.isArray(v) ? v : isNaN(+u[s + 1]) ? {} : [];
35
+ const h = t[l];
36
+ V = H(h) || Array.isArray(h) ? h : isNaN(+u[s + 1]) ? {} : [];
37
37
  }
38
38
  if (l === "__proto__" || l === "constructor" || l === "prototype")
39
39
  return;
@@ -44,7 +44,7 @@ const pe = {
44
44
  BLUR: "blur",
45
45
  FOCUS_OUT: "focusout",
46
46
  CHANGE: "change"
47
- }, te = {
47
+ }, re = {
48
48
  onBlur: "onBlur",
49
49
  onChange: "onChange",
50
50
  onSubmit: "onSubmit",
@@ -58,11 +58,11 @@ const pe = {
58
58
  pattern: "pattern",
59
59
  required: "required",
60
60
  validate: "validate"
61
- }, Ye = F.createContext(null);
62
- Ye.displayName = "HookFormContext";
63
- const Ve = () => F.useContext(Ye), tr = (t) => {
61
+ }, Je = F.createContext(null);
62
+ Je.displayName = "HookFormContext";
63
+ const Ve = () => F.useContext(Je), tr = (t) => {
64
64
  const { children: r, ...e } = t;
65
- return F.createElement(Ye.Provider, { value: e }, r);
65
+ return F.createElement(Je.Provider, { value: e }, r);
66
66
  };
67
67
  var Et = (t, r, e, s = !0) => {
68
68
  const u = {
@@ -72,7 +72,7 @@ var Et = (t, r, e, s = !0) => {
72
72
  Object.defineProperty(u, i, {
73
73
  get: () => {
74
74
  const c = i;
75
- return r._proxyFormState[c] !== te.all && (r._proxyFormState[c] = !s || te.all), e && (e[c] = !0), t[c];
75
+ return r._proxyFormState[c] !== re.all && (r._proxyFormState[c] = !s || re.all), e && (e[c] = !0), t[c];
76
76
  }
77
77
  });
78
78
  return u;
@@ -93,19 +93,19 @@ function rr(t) {
93
93
  name: u,
94
94
  formState: V.current,
95
95
  exact: i,
96
- callback: (v) => {
96
+ callback: (h) => {
97
97
  !s && l({
98
98
  ...e._formState,
99
- ...v
99
+ ...h
100
100
  });
101
101
  }
102
102
  }), [u, s, i]), F.useEffect(() => {
103
103
  V.current.isValid && e._setValid(!0);
104
104
  }, [e]), F.useMemo(() => Et(c, e, V.current, !1), [c, e]);
105
105
  }
106
- var X = (t) => typeof t == "string", He = (t, r, e, s, u) => X(t) ? (s && r.watch.add(t), m(e, t, u)) : Array.isArray(t) ? t.map((i) => (s && r.watch.add(i), m(e, i))) : (s && (r.watchAll = !0), e), qe = (t) => G(t) || !pt(t);
106
+ var X = (t) => typeof t == "string", qe = (t, r, e, s, u) => X(t) ? (s && r.watch.add(t), m(e, t, u)) : Array.isArray(t) ? t.map((i) => (s && r.watch.add(i), m(e, i))) : (s && (r.watchAll = !0), e), je = (t) => Q(t) || !pt(t);
107
107
  function ae(t, r, e = /* @__PURE__ */ new WeakSet()) {
108
- if (qe(t) || qe(r))
108
+ if (je(t) || je(r))
109
109
  return Object.is(t, r);
110
110
  if (oe(t) && oe(r))
111
111
  return t.getTime() === r.getTime();
@@ -121,54 +121,54 @@ function ae(t, r, e = /* @__PURE__ */ new WeakSet()) {
121
121
  return !1;
122
122
  if (i !== "ref") {
123
123
  const l = r[i];
124
- if (oe(c) && oe(l) || W(c) && W(l) || Array.isArray(c) && Array.isArray(l) ? !ae(c, l, e) : !Object.is(c, l))
124
+ if (oe(c) && oe(l) || H(c) && H(l) || Array.isArray(c) && Array.isArray(l) ? !ae(c, l, e) : !Object.is(c, l))
125
125
  return !1;
126
126
  }
127
127
  }
128
128
  return !0;
129
129
  }
130
- function Je(t) {
131
- const r = Ve(), { control: e = r.control, name: s, defaultValue: u, disabled: i, exact: c, compute: l } = t || {}, V = F.useRef(u), v = F.useRef(l), w = F.useRef(void 0), g = F.useRef(e), S = F.useRef(s);
132
- v.current = l;
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;
133
133
  const [p, I] = F.useState(() => {
134
134
  const f = e._getWatch(s, V.current);
135
- return v.current ? v.current(f) : f;
136
- }), T = F.useCallback((f) => {
137
- const d = He(s, e._names, f || e._formValues, !1, V.current);
138
- return v.current ? v.current(d) : d;
139
- }, [e._formValues, e._names, s]), M = F.useCallback((f) => {
135
+ return h.current ? h.current(f) : f;
136
+ }), R = F.useCallback((f) => {
137
+ const d = qe(s, e._names, f || e._formValues, !1, V.current);
138
+ return h.current ? h.current(d) : d;
139
+ }, [e._formValues, e._names, s]), T = F.useCallback((f) => {
140
140
  if (!i) {
141
- const d = He(s, e._names, f || e._formValues, !1, V.current);
142
- if (v.current) {
143
- const A = v.current(d);
144
- ae(A, w.current) || (I(A), w.current = A);
141
+ const d = qe(s, e._names, f || e._formValues, !1, V.current);
142
+ if (h.current) {
143
+ const A = h.current(d);
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, M()), e._subscribe({
149
+ ke(() => ((g.current !== e || !ae(S.current, s)) && (g.current = e, S.current = s, T()), e._subscribe({
150
150
  name: s,
151
151
  formState: {
152
152
  values: !0
153
153
  },
154
154
  exact: c,
155
155
  callback: (f) => {
156
- M(f.values);
156
+ T(f.values);
157
157
  }
158
- })), [e, c, s, M]), F.useEffect(() => e._removeUnmounted());
159
- const N = g.current !== e, x = S.current, P = F.useMemo(() => {
158
+ })), [e, c, s, T]), F.useEffect(() => e._removeUnmounted());
159
+ const U = g.current !== e, x = S.current, B = F.useMemo(() => {
160
160
  if (i)
161
161
  return null;
162
- const f = !N && !ae(x, s);
163
- return N || f ? T() : null;
164
- }, [i, N, s, x, T]);
165
- return P !== null ? P : p;
162
+ const f = !U && !ae(x, s);
163
+ return U || f ? R() : null;
164
+ }, [i, U, s, x, R]);
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), v = F.useMemo(() => m(u._formValues, e, m(u._defaultValues, e, c)), [u, e, c]), w = Je({
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({
169
169
  control: u,
170
170
  name: e,
171
- defaultValue: v,
171
+ defaultValue: h,
172
172
  exact: l
173
173
  }), g = rr({
174
174
  control: u,
@@ -176,11 +176,11 @@ function sr(t) {
176
176
  exact: l
177
177
  }), S = F.useRef(t), p = F.useRef(void 0), I = F.useRef(u.register(e, {
178
178
  ...t.rules,
179
- value: w,
179
+ value: k,
180
180
  ...J(t.disabled) ? { disabled: t.disabled } : {}
181
181
  }));
182
182
  S.current = t;
183
- const T = F.useMemo(() => Object.defineProperties({}, {
183
+ const R = F.useMemo(() => Object.defineProperties({}, {
184
184
  invalid: {
185
185
  enumerable: !0,
186
186
  get: () => !!m(g.errors, e)
@@ -201,13 +201,13 @@ function sr(t) {
201
201
  enumerable: !0,
202
202
  get: () => m(g.errors, e)
203
203
  }
204
- }), [g, e]), M = F.useCallback((f) => I.current.onChange({
204
+ }), [g, e]), T = F.useCallback((f) => I.current.onChange({
205
205
  target: {
206
206
  value: xt(f),
207
207
  name: e
208
208
  },
209
209
  type: pe.CHANGE
210
- }), [e]), N = F.useCallback(() => I.current.onBlur({
210
+ }), [e]), U = F.useCallback(() => I.current.onBlur({
211
211
  target: {
212
212
  value: m(u._formValues, e),
213
213
  name: e
@@ -216,32 +216,32 @@ function sr(t) {
216
216
  }), [e, u._formValues]), x = F.useCallback((f) => {
217
217
  const d = m(u._fields, e);
218
218
  d && d._f && f && (d._f.ref = {
219
- focus: () => Q(f.focus) && f.focus(),
220
- select: () => Q(f.select) && f.select(),
221
- setCustomValidity: (A) => Q(f.setCustomValidity) && f.setCustomValidity(A),
222
- reportValidity: () => Q(f.reportValidity) && f.reportValidity()
219
+ focus: () => G(f.focus) && f.focus(),
220
+ select: () => G(f.select) && f.select(),
221
+ setCustomValidity: (A) => G(f.setCustomValidity) && f.setCustomValidity(A),
222
+ reportValidity: () => G(f.reportValidity) && f.reportValidity()
223
223
  });
224
- }, [u._fields, e]), P = F.useMemo(() => ({
224
+ }, [u._fields, e]), B = F.useMemo(() => ({
225
225
  name: e,
226
- value: w,
226
+ value: k,
227
227
  ...J(s) || g.disabled ? { disabled: g.disabled || s } : {},
228
- onChange: M,
229
- onBlur: N,
228
+ onChange: T,
229
+ onBlur: U,
230
230
  ref: x
231
- }), [e, s, g.disabled, M, N, x, w]);
231
+ }), [e, s, g.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, {
235
235
  ...S.current.rules,
236
236
  ...J(S.current.disabled) ? { disabled: S.current.disabled } : {}
237
237
  });
238
- const A = (k, j) => {
239
- const K = m(u._fields, k);
240
- K && K._f && (K._f.mount = j);
238
+ const A = (w, W) => {
239
+ const K = m(u._fields, w);
240
+ K && K._f && (K._f.mount = W);
241
241
  };
242
242
  if (A(e, !0), f) {
243
- const k = L(m(u._options.defaultValues, e, S.current.defaultValue));
244
- R(u._defaultValues, e, k), U(m(u._formValues, e)) && R(u._formValues, e, k);
243
+ const w = M(m(u._options.defaultValues, e, S.current.defaultValue));
244
+ O(u._defaultValues, e, w), N(m(u._formValues, e)) && O(u._formValues, e, w);
245
245
  }
246
246
  return !V && u.register(e), p.current = e, () => {
247
247
  (V ? f && !u._state.action : f) ? u.unregister(e) : A(e, !1);
@@ -252,10 +252,10 @@ function sr(t) {
252
252
  name: e
253
253
  });
254
254
  }, [s, e, u]), F.useMemo(() => ({
255
- field: P,
255
+ field: B,
256
256
  formState: g,
257
- fieldState: T
258
- }), [P, g, T]);
257
+ fieldState: R
258
+ }), [B, g, R]);
259
259
  }
260
260
  const ar = (t) => t.render(sr(t));
261
261
  var nr = (t, r, e, s, u) => r ? {
@@ -289,58 +289,58 @@ function wt(t, r) {
289
289
  for (const s in t)
290
290
  if (t.hasOwnProperty(s)) {
291
291
  const u = t[s], i = r[s];
292
- if (u && W(u) && i) {
292
+ if (u && H(u) && i) {
293
293
  const c = wt(u, i);
294
- W(c) && (e[s] = c);
294
+ H(c) && (e[s] = c);
295
295
  } else t[s] && (e[s] = i);
296
296
  }
297
297
  return e;
298
298
  }
299
- var q = (t) => W(t) && !Object.keys(t).length, Xe = (t) => t.type === "file", xe = (t) => {
300
- if (!ze)
299
+ var j = (t) => H(t) && !Object.keys(t).length, Ze = (t) => t.type === "file", xe = (t) => {
300
+ if (!Ke)
301
301
  return !1;
302
302
  const r = t ? t.ownerDocument : 0;
303
303
  return t instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
304
- }, kt = (t) => t.type === "select-multiple", Ze = (t) => t.type === "radio", ir = (t) => Ze(t) || ve(t), Ue = (t) => xe(t) && t.isConnected;
304
+ }, kt = (t) => t.type === "select-multiple", et = (t) => t.type === "radio", ir = (t) => et(t) || ve(t), Ne = (t) => xe(t) && t.isConnected;
305
305
  function ur(t, r) {
306
306
  const e = r.slice(0, -1).length;
307
307
  let s = 0;
308
308
  for (; s < e; )
309
- t = U(t) ? s++ : t[r[s++]];
309
+ t = N(t) ? s++ : t[r[s++]];
310
310
  return t;
311
311
  }
312
312
  function or(t) {
313
313
  for (const r in t)
314
- if (t.hasOwnProperty(r) && !U(t[r]))
314
+ if (t.hasOwnProperty(r) && !N(t[r]))
315
315
  return !1;
316
316
  return !0;
317
317
  }
318
- function B(t, r) {
319
- const e = Array.isArray(r) ? r : Ee(r) ? [r] : Ke(r), s = e.length === 1 ? t : ur(t, e), u = e.length - 1, i = e[u];
320
- return s && delete s[i], u !== 0 && (W(s) && q(s) || Array.isArray(s) && or(s)) && B(t, e.slice(0, -1)), t;
318
+ function P(t, r) {
319
+ const e = Array.isArray(r) ? r : Ee(r) ? [r] : Ye(r), s = e.length === 1 ? t : ur(t, e), u = e.length - 1, i = e[u];
320
+ return s && delete s[i], u !== 0 && (H(s) && j(s) || Array.isArray(s) && or(s)) && P(t, e.slice(0, -1)), t;
321
321
  }
322
322
  var lr = (t) => {
323
323
  for (const r in t)
324
- if (Q(t[r]))
324
+ if (G(t[r]))
325
325
  return !0;
326
326
  return !1;
327
327
  };
328
328
  function Ct(t) {
329
- return Array.isArray(t) || W(t) && !lr(t);
329
+ return Array.isArray(t) || H(t) && !lr(t);
330
330
  }
331
- function je(t, r = {}) {
331
+ function Ge(t, r = {}) {
332
332
  for (const e in t) {
333
333
  const s = t[e];
334
- Ct(s) ? (r[e] = Array.isArray(s) ? [] : {}, je(s, r[e])) : U(s) || (r[e] = !0);
334
+ Ct(s) ? (r[e] = Array.isArray(s) ? [] : {}, Ge(s, r[e])) : N(s) || (r[e] = !0);
335
335
  }
336
336
  return r;
337
337
  }
338
338
  function ce(t, r, e) {
339
- e || (e = je(r));
339
+ e || (e = Ge(r));
340
340
  for (const s in t) {
341
341
  const u = t[s];
342
342
  if (Ct(u))
343
- U(r) || qe(e[s]) ? e[s] = je(u, Array.isArray(u) ? [] : {}) : ce(u, G(r) ? {} : r[s], e[s]);
343
+ N(r) || je(e[s]) ? e[s] = Ge(u, Array.isArray(u) ? [] : {}) : ce(u, Q(r) ? {} : r[s], e[s]);
344
344
  else {
345
345
  const i = r[s];
346
346
  e[s] = !ae(u, i);
@@ -360,28 +360,28 @@ var Dt = (t) => {
360
360
  }
361
361
  return t[0].checked && !t[0].disabled ? (
362
362
  // @ts-expect-error expected to work in the browser
363
- t[0].attributes && !U(t[0].attributes.value) ? U(t[0].value) || t[0].value === "" ? _t : { value: t[0].value, isValid: !0 } : _t
363
+ t[0].attributes && !N(t[0].attributes.value) ? N(t[0].value) || t[0].value === "" ? _t : { value: t[0].value, isValid: !0 } : _t
364
364
  ) : mt;
365
365
  }
366
366
  return mt;
367
- }, Rt = (t, { valueAsNumber: r, valueAsDate: e, setValueAs: s }) => U(t) ? t : r ? t === "" ? NaN : t && +t : e && X(t) ? new Date(t) : s ? s(t) : t;
367
+ }, Tt = (t, { valueAsNumber: r, valueAsDate: e, setValueAs: s }) => N(t) ? t : r ? t === "" ? NaN : t && +t : e && X(t) ? new Date(t) : s ? s(t) : t;
368
368
  const gt = {
369
369
  isValid: !1,
370
370
  value: null
371
371
  };
372
- var Tt = (t) => Array.isArray(t) ? t.reduce((r, e) => e && e.checked && !e.disabled ? {
372
+ var Ot = (t) => Array.isArray(t) ? t.reduce((r, e) => e && e.checked && !e.disabled ? {
373
373
  isValid: !0,
374
374
  value: e.value
375
375
  } : r, gt) : gt;
376
376
  function ht(t) {
377
377
  const r = t.ref;
378
- return Xe(r) ? r.files : Ze(r) ? Tt(t.refs).value : kt(r) ? [...r.selectedOptions].map(({ value: e }) => e) : ve(r) ? Dt(t.refs).value : Rt(U(r.value) ? t.ref.value : r.value, t);
378
+ return Ze(r) ? r.files : et(r) ? Ot(t.refs).value : kt(r) ? [...r.selectedOptions].map(({ value: e }) => e) : ve(r) ? Dt(t.refs).value : Tt(N(r.value) ? t.ref.value : r.value, t);
379
379
  }
380
380
  var cr = (t, r, e, s) => {
381
381
  const u = {};
382
382
  for (const i of t) {
383
383
  const c = m(r, i);
384
- c && R(u, i, c._f);
384
+ c && O(u, i, c._f);
385
385
  }
386
386
  return {
387
387
  criteriaMode: e,
@@ -389,15 +389,15 @@ var cr = (t, r, e, s) => {
389
389
  fields: u,
390
390
  shouldUseNativeValidation: s
391
391
  };
392
- }, Se = (t) => t instanceof RegExp, ge = (t) => U(t) ? t : Se(t) ? t.source : W(t) ? Se(t.value) ? t.value.source : t.value : t, de = (t) => ({
393
- isOnSubmit: !t || t === te.onSubmit,
394
- isOnBlur: t === te.onBlur,
395
- isOnChange: t === te.onChange,
396
- isOnAll: t === te.all,
397
- isOnTouch: t === te.onTouched
392
+ }, Se = (t) => t instanceof RegExp, he = (t) => N(t) ? t : Se(t) ? t.source : H(t) ? Se(t.value) ? t.value.source : t.value : t, de = (t) => ({
393
+ isOnSubmit: !t || t === re.onSubmit,
394
+ isOnBlur: t === re.onBlur,
395
+ isOnChange: t === re.onChange,
396
+ isOnAll: t === re.all,
397
+ isOnTouch: t === re.onTouched
398
398
  });
399
399
  const vt = "AsyncFunction";
400
- var dr = (t) => !!t && !!t.validate && !!(Q(t.validate) && t.validate.constructor.name === vt || W(t.validate) && Object.values(t.validate).find((r) => r.constructor.name === vt)), fr = (t) => t.mount && (t.required || t.min || t.max || t.maxLength || t.minLength || t.pattern || t.validate), Qe = (t, r, e) => !e && (r.watchAll || r.watch.has(t) || [...r.watch].some((s) => t.startsWith(s) && /^\.\w+/.test(t.slice(s.length))));
400
+ var dr = (t) => !!t && !!t.validate && !!(G(t.validate) && t.validate.constructor.name === vt || H(t.validate) && Object.values(t.validate).find((r) => r.constructor.name === vt)), fr = (t) => t.mount && (t.required || t.min || t.max || t.maxLength || t.minLength || t.pattern || t.validate), Qe = (t, r, e) => !e && (r.watchAll || r.watch.has(t) || [...r.watch].some((s) => t.startsWith(s) && /^\.\w+/.test(t.slice(s.length))));
401
401
  const fe = (t, r, e, s) => {
402
402
  for (const u of e || Object.keys(t)) {
403
403
  const i = m(t, u);
@@ -410,7 +410,7 @@ const fe = (t, r, e, s) => {
410
410
  return !0;
411
411
  if (fe(l, r))
412
412
  break;
413
- } else if (W(l) && fe(l, r))
413
+ } else if (H(l) && fe(l, r))
414
414
  break;
415
415
  }
416
416
  }
@@ -446,10 +446,10 @@ function Vt(t, r, e) {
446
446
  var yr = (t, r, e, s) => {
447
447
  e(t);
448
448
  const { name: u, ...i } = t;
449
- return q(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((c) => r[c] === (!s || te.all));
450
- }, mr = (t, r, e) => !t || !r || t === r || z(t).some((s) => s && (e ? s === r : s.startsWith(r) || r.startsWith(s))), _r = (t, r, e, s, u) => u.isOnAll ? !1 : !e && u.isOnTouch ? !(r || t) : (e ? s.isOnBlur : u.isOnBlur) ? !t : (e ? s.isOnChange : u.isOnChange) ? t : !0, gr = (t, r) => !we(m(t, r)).length && B(t, r), Ot = (t, r, e) => {
449
+ return j(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((c) => r[c] === (!s || re.all));
450
+ }, mr = (t, r, e) => !t || !r || t === r || z(t).some((s) => s && (e ? s === r : s.startsWith(r) || r.startsWith(s))), _r = (t, r, e, s, u) => u.isOnAll ? !1 : !e && u.isOnTouch ? !(r || t) : (e ? s.isOnBlur : u.isOnBlur) ? !t : (e ? s.isOnChange : u.isOnChange) ? t : !0, gr = (t, r) => !we(m(t, r)).length && P(t, r), Rt = (t, r, e) => {
451
451
  const s = z(m(t, e));
452
- return R(s, "root", r[e]), R(t, e, s), t;
452
+ return O(s, "root", r[e]), O(t, e, s), t;
453
453
  };
454
454
  function Ft(t, r, e = "validate") {
455
455
  if (X(t) || Array.isArray(t) && t.every(X) || J(t) && !t)
@@ -459,55 +459,55 @@ function Ft(t, r, e = "validate") {
459
459
  ref: r
460
460
  };
461
461
  }
462
- var le = (t) => W(t) && !Se(t) ? t : {
462
+ var le = (t) => H(t) && !Se(t) ? t : {
463
463
  value: t,
464
464
  message: ""
465
- }, Ge = async (t, r, e, s, u, i) => {
466
- const { ref: c, refs: l, required: V, maxLength: v, minLength: w, min: g, max: S, pattern: p, validate: I, name: T, valueAsNumber: M, mount: N } = t._f, x = m(e, T);
467
- if (!N || r.has(T))
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);
467
+ if (!U || r.has(R))
468
468
  return {};
469
- const P = l ? l[0] : c, f = (E) => {
470
- u && P.reportValidity && (P.setCustomValidity(J(E) ? "" : E || ""), P.reportValidity());
471
- }, d = {}, A = Ze(c), k = ve(c), j = A || k, K = (M || Xe(c)) && U(c.value) && U(x) || xe(c) && c.value === "" || x === "" || Array.isArray(x) && !x.length, Z = nr.bind(null, T, s, d), Fe = (E, C, $, H = ne.maxLength, re = ne.minLength) => {
469
+ const B = l ? l[0] : c, f = (E) => {
470
+ u && B.reportValidity && (B.setCustomValidity(J(E) ? "" : E || ""), B.reportValidity());
471
+ }, d = {}, A = et(c), w = ve(c), W = A || w, K = (T || Ze(c)) && N(c.value) && N(x) || xe(c) && c.value === "" || x === "" || Array.isArray(x) && !x.length, Z = nr.bind(null, R, s, d), Fe = (E, C, $, q = ne.maxLength, se = ne.minLength) => {
472
472
  const Y = E ? C : $;
473
- d[T] = {
474
- type: E ? H : re,
473
+ d[R] = {
474
+ type: E ? q : se,
475
475
  message: Y,
476
476
  ref: c,
477
- ...Z(E ? H : re, Y)
477
+ ...Z(E ? q : se, Y)
478
478
  };
479
479
  };
480
- if (i ? !Array.isArray(x) || !x.length : V && (!j && (K || G(x)) || J(x) && !x || k && !Dt(l).isValid || A && !Tt(l).isValid)) {
480
+ if (i ? !Array.isArray(x) || !x.length : V && (!W && (K || Q(x)) || J(x) && !x || w && !Dt(l).isValid || A && !Ot(l).isValid)) {
481
481
  const { value: E, message: C } = X(V) ? { value: !!V, message: V } : le(V);
482
- if (E && (d[T] = {
482
+ if (E && (d[R] = {
483
483
  type: ne.required,
484
484
  message: C,
485
- ref: P,
485
+ ref: B,
486
486
  ...Z(ne.required, C)
487
487
  }, !s))
488
488
  return f(C), d;
489
489
  }
490
- if (!K && (!G(g) || !G(S))) {
490
+ if (!K && (!Q(g) || !Q(S))) {
491
491
  let E, C;
492
- const $ = le(S), H = le(g);
493
- if (!G(x) && !isNaN(x)) {
494
- const re = c.valueAsNumber || x && +x;
495
- G($.value) || (E = re > $.value), G(H.value) || (C = re < H.value);
492
+ const $ = le(S), q = le(g);
493
+ if (!Q(x) && !isNaN(x)) {
494
+ const se = c.valueAsNumber || x && +x;
495
+ Q($.value) || (E = se > $.value), Q(q.value) || (C = se < q.value);
496
496
  } else {
497
- const re = c.valueAsDate || new Date(x), Y = (_e) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + _e), ye = c.type == "time", me = c.type == "week";
498
- X($.value) && x && (E = ye ? Y(x) > Y($.value) : me ? x > $.value : re > new Date($.value)), X(H.value) && x && (C = ye ? Y(x) < Y(H.value) : me ? x < H.value : re < new Date(H.value));
497
+ const se = c.valueAsDate || new Date(x), Y = (ge) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ge), me = c.type == "time", _e = c.type == "week";
498
+ X($.value) && x && (E = me ? Y(x) > Y($.value) : _e ? x > $.value : se > new Date($.value)), X(q.value) && x && (C = me ? Y(x) < Y(q.value) : _e ? x < q.value : se < new Date(q.value));
499
499
  }
500
- if ((E || C) && (Fe(!!E, $.message, H.message, ne.max, ne.min), !s))
501
- return f(d[T].message), d;
500
+ if ((E || C) && (Fe(!!E, $.message, q.message, ne.max, ne.min), !s))
501
+ return f(d[R].message), d;
502
502
  }
503
- if ((v || w) && !K && (X(x) || i && Array.isArray(x))) {
504
- const E = le(v), C = le(w), $ = !G(E.value) && x.length > +E.value, H = !G(C.value) && x.length < +C.value;
505
- if (($ || H) && (Fe($, E.message, C.message), !s))
506
- return f(d[T].message), d;
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;
505
+ if (($ || q) && (Fe($, E.message, C.message), !s))
506
+ return f(d[R].message), d;
507
507
  }
508
508
  if (p && !K && X(x)) {
509
509
  const { value: E, message: C } = le(p);
510
- if (Se(E) && !x.match(E) && (d[T] = {
510
+ if (Se(E) && !x.match(E) && (d[R] = {
511
511
  type: ne.pattern,
512
512
  message: C,
513
513
  ref: c,
@@ -516,26 +516,26 @@ var le = (t) => W(t) && !Se(t) ? t : {
516
516
  return f(C), d;
517
517
  }
518
518
  if (I) {
519
- if (Q(I)) {
520
- const E = await I(x, e), C = Ft(E, P);
521
- if (C && (d[T] = {
519
+ if (G(I)) {
520
+ const E = await I(x, e), C = Ft(E, B);
521
+ if (C && (d[R] = {
522
522
  ...C,
523
523
  ...Z(ne.validate, C.message)
524
524
  }, !s))
525
525
  return f(C.message), d;
526
- } else if (W(I)) {
526
+ } else if (H(I)) {
527
527
  let E = {};
528
528
  for (const C in I) {
529
- if (!q(E) && !s)
529
+ if (!j(E) && !s)
530
530
  break;
531
- const $ = Ft(await I[C](x, e), P, C);
531
+ const $ = Ft(await I[C](x, e), B, C);
532
532
  $ && (E = {
533
533
  ...$,
534
534
  ...Z(C, $.message)
535
- }, f($.message), s && (d[T] = E));
535
+ }, f($.message), s && (d[R] = E));
536
536
  }
537
- if (!q(E) && (d[T] = {
538
- ref: P,
537
+ if (!j(E) && (d[R] = {
538
+ ref: B,
539
539
  ...E
540
540
  }, !s))
541
541
  return d;
@@ -544,8 +544,8 @@ var le = (t) => W(t) && !Se(t) ? t : {
544
544
  return f(!0), d;
545
545
  };
546
546
  const hr = {
547
- mode: te.onSubmit,
548
- reValidateMode: te.onChange,
547
+ mode: re.onSubmit,
548
+ reValidateMode: re.onChange,
549
549
  shouldFocusError: !0
550
550
  };
551
551
  function vr(t = {}) {
@@ -556,7 +556,7 @@ function vr(t = {}) {
556
556
  submitCount: 0,
557
557
  isDirty: !1,
558
558
  isReady: !1,
559
- isLoading: Q(r.defaultValues),
559
+ isLoading: G(r.defaultValues),
560
560
  isValidating: !1,
561
561
  isSubmitted: !1,
562
562
  isSubmitting: !1,
@@ -567,7 +567,7 @@ function vr(t = {}) {
567
567
  validatingFields: {},
568
568
  errors: r.errors || {},
569
569
  disabled: r.disabled || !1
570
- }, s = {}, u = W(r.defaultValues) || W(r.values) ? L(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : L(u), c = {
570
+ }, s = {}, u = H(r.defaultValues) || H(r.values) ? M(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : M(u), c = {
571
571
  action: !1,
572
572
  mount: !1,
573
573
  watch: !1,
@@ -578,8 +578,8 @@ function vr(t = {}) {
578
578
  unMount: /* @__PURE__ */ new Set(),
579
579
  array: /* @__PURE__ */ new Set(),
580
580
  watch: /* @__PURE__ */ new Set()
581
- }, V, v = 0;
582
- const w = {
581
+ }, V, h = 0;
582
+ const k = {
583
583
  isDirty: !1,
584
584
  dirtyFields: !1,
585
585
  validatingFields: !1,
@@ -588,7 +588,7 @@ function vr(t = {}) {
588
588
  isValid: !1,
589
589
  errors: !1
590
590
  }, g = {
591
- ...w
591
+ ...k
592
592
  };
593
593
  let S = {
594
594
  ...g
@@ -596,35 +596,35 @@ function vr(t = {}) {
596
596
  const p = {
597
597
  array: yt(),
598
598
  state: yt()
599
- }, I = r.criteriaMode === te.all, T = (a) => (n) => {
600
- clearTimeout(v), v = setTimeout(a, n);
601
- }, M = async (a) => {
599
+ }, I = r.criteriaMode === re.all, R = (a) => (n) => {
600
+ clearTimeout(h), h = setTimeout(a, n);
601
+ }, T = async (a) => {
602
602
  if (!c.keepIsValid && !r.disabled && (g.isValid || S.isValid || a)) {
603
603
  let n;
604
- r.resolver ? (n = q((await j()).errors), N()) : n = await Z(s, !0), n !== e.isValid && p.state.next({
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
- }, N = (a, n) => {
608
+ }, U = (a, n) => {
609
609
  !r.disabled && (g.isValidating || g.validatingFields || S.isValidating || S.validatingFields) && ((a || Array.from(l.mount)).forEach((o) => {
610
- o && (n ? R(e.validatingFields, o, n) : B(e.validatingFields, o));
610
+ o && (n ? O(e.validatingFields, o, n) : P(e.validatingFields, o));
611
611
  }), p.state.next({
612
612
  validatingFields: e.validatingFields,
613
- isValidating: !q(e.validatingFields)
613
+ isValidating: !j(e.validatingFields)
614
614
  }));
615
- }, x = (a, n = [], o, h, _ = !0, y = !0) => {
616
- if (h && o && !r.disabled) {
615
+ }, x = (a, n = [], o, v, _ = !0, y = !0) => {
616
+ if (v && o && !r.disabled) {
617
617
  if (c.action = !0, y && Array.isArray(m(s, a))) {
618
- const b = o(m(s, a), h.argA, h.argB);
619
- _ && R(s, a, b);
618
+ const b = o(m(s, a), v.argA, v.argB);
619
+ _ && O(s, a, b);
620
620
  }
621
621
  if (y && Array.isArray(m(e.errors, a))) {
622
- const b = o(m(e.errors, a), h.argA, h.argB);
623
- _ && R(e.errors, a, b), gr(e.errors, a);
622
+ const b = o(m(e.errors, a), v.argA, v.argB);
623
+ _ && O(e.errors, a, b), gr(e.errors, a);
624
624
  }
625
625
  if ((g.touchedFields || S.touchedFields) && y && Array.isArray(m(e.touchedFields, a))) {
626
- const b = o(m(e.touchedFields, a), h.argA, h.argB);
627
- _ && R(e.touchedFields, a, b);
626
+ const b = o(m(e.touchedFields, a), v.argA, v.argB);
627
+ _ && O(e.touchedFields, a, b);
628
628
  }
629
629
  (g.dirtyFields || S.dirtyFields) && (e.dirtyFields = ce(u, i)), p.state.next({
630
630
  name: a,
@@ -634,9 +634,9 @@ function vr(t = {}) {
634
634
  isValid: e.isValid
635
635
  });
636
636
  } else
637
- R(i, a, n);
638
- }, P = (a, n) => {
639
- R(e.errors, a, n), p.state.next({
637
+ O(i, a, n);
638
+ }, B = (a, n) => {
639
+ O(e.errors, a, n), p.state.next({
640
640
  errors: e.errors
641
641
  });
642
642
  }, f = (a) => {
@@ -644,35 +644,35 @@ function vr(t = {}) {
644
644
  errors: e.errors,
645
645
  isValid: !1
646
646
  });
647
- }, d = (a, n, o, h) => {
647
+ }, d = (a, n, o, v) => {
648
648
  const _ = m(s, a);
649
649
  if (_) {
650
- const y = m(i, a, U(o) ? m(u, a) : o);
651
- U(y) || h && h.defaultChecked || n ? R(i, a, n ? y : ht(_._f)) : H(a, y), c.mount && !c.action && M();
650
+ const y = m(i, a, N(o) ? m(u, a) : o);
651
+ N(y) || v && v.defaultChecked || n ? O(i, a, n ? y : ht(_._f)) : q(a, y), c.mount && !c.action && T();
652
652
  }
653
- }, A = (a, n, o, h, _) => {
653
+ }, A = (a, n, o, v, _) => {
654
654
  let y = !1, b = !1;
655
655
  const D = {
656
656
  name: a
657
657
  };
658
658
  if (!r.disabled) {
659
- if (!o || h) {
659
+ if (!o || v) {
660
660
  (g.isDirty || S.isDirty) && (b = e.isDirty, e.isDirty = D.isDirty = E(), y = b !== D.isDirty);
661
- const O = ae(m(u, a), n);
662
- b = !!m(e.dirtyFields, a), O ? B(e.dirtyFields, a) : R(e.dirtyFields, a, !0), D.dirtyFields = e.dirtyFields, y = y || (g.dirtyFields || S.dirtyFields) && b !== !O;
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;
663
663
  }
664
664
  if (o) {
665
- const O = m(e.touchedFields, a);
666
- O || (R(e.touchedFields, a, o), D.touchedFields = e.touchedFields, y = y || (g.touchedFields || S.touchedFields) && O !== o);
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);
667
667
  }
668
668
  y && _ && p.state.next(D);
669
669
  }
670
670
  return y ? D : {};
671
- }, k = (a, n, o, h) => {
671
+ }, w = (a, n, o, v) => {
672
672
  const _ = m(e.errors, a), y = (g.isValid || S.isValid) && J(n) && e.isValid !== n;
673
- if (r.delayError && o ? (V = T(() => P(a, o)), V(r.delayError)) : (clearTimeout(v), V = null, o ? R(e.errors, a, o) : B(e.errors, a)), (o ? !ae(_, o) : _) || !q(h) || y) {
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) {
674
674
  const b = {
675
- ...h,
675
+ ...v,
676
676
  ...y && J(n) ? { isValid: n } : {},
677
677
  errors: e.errors,
678
678
  name: a
@@ -682,12 +682,12 @@ function vr(t = {}) {
682
682
  ...b
683
683
  }, p.state.next(b);
684
684
  }
685
- }, j = async (a) => (N(a, !0), await r.resolver(i, r.context, cr(a || l.mount, s, r.criteriaMode, r.shouldUseNativeValidation))), K = async (a) => {
686
- const { errors: n } = await j(a);
687
- if (N(a), a)
685
+ }, W = async (a) => (U(a, !0), await r.resolver(i, r.context, cr(a || l.mount, s, r.criteriaMode, r.shouldUseNativeValidation))), K = async (a) => {
686
+ const { errors: n } = await W(a);
687
+ if (U(a), a)
688
688
  for (const o of a) {
689
- const h = m(n, o);
690
- h ? R(e.errors, o, h) : B(e.errors, o);
689
+ const v = m(n, o);
690
+ v ? O(e.errors, o, v) : P(e.errors, o);
691
691
  }
692
692
  else
693
693
  e.errors = n;
@@ -695,170 +695,170 @@ function vr(t = {}) {
695
695
  }, Z = async (a, n, o = {
696
696
  valid: !0
697
697
  }) => {
698
- for (const h in a) {
699
- const _ = a[h];
698
+ for (const v in a) {
699
+ const _ = a[v];
700
700
  if (_) {
701
701
  const { _f: y, ...b } = _;
702
702
  if (y) {
703
- const D = l.array.has(y.name), O = _._f && dr(_._f);
704
- O && g.validatingFields && N([y.name], !0);
705
- const ee = await Ge(_, l.disabled, i, I, r.shouldUseNativeValidation && !n, D);
706
- if (O && g.validatingFields && N([y.name]), ee[y.name] && (o.valid = !1, n))
703
+ const D = l.array.has(y.name), L = _._f && dr(_._f);
704
+ L && g.validatingFields && U([y.name], !0);
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))
707
707
  break;
708
- !n && (m(ee, y.name) ? D ? Ot(e.errors, ee, y.name) : R(e.errors, y.name, ee[y.name]) : B(e.errors, y.name));
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
  }
710
- !q(b) && await Z(b, n, o);
710
+ !j(b) && await Z(b, n, o);
711
711
  }
712
712
  }
713
713
  return o.valid;
714
714
  }, Fe = () => {
715
715
  for (const a of l.unMount) {
716
716
  const n = m(s, a);
717
- n && (n._f.refs ? n._f.refs.every((o) => !Ue(o)) : !Ue(n._f.ref)) && Ce(a);
717
+ n && (n._f.refs ? n._f.refs.every((o) => !Ne(o)) : !Ne(n._f.ref)) && Ce(a);
718
718
  }
719
719
  l.unMount = /* @__PURE__ */ new Set();
720
- }, E = (a, n) => !r.disabled && (a && n && R(i, a, n), !ae(tt(), u)), C = (a, n, o) => He(a, l, {
721
- ...c.mount ? i : U(n) ? u : X(a) ? { [a]: n } : n
722
- }, o, n), $ = (a) => we(m(c.mount ? i : u, a, r.shouldUnregister ? m(u, a, []) : [])), H = (a, n, o = {}) => {
723
- const h = m(s, a);
720
+ }, E = (a, n) => !r.disabled && (a && n && O(i, a, n), !ae(rt(), u)), C = (a, n, o) => qe(a, l, {
721
+ ...c.mount ? i : N(n) ? u : X(a) ? { [a]: n } : n
722
+ }, o, n), $ = (a) => we(m(c.mount ? i : u, a, r.shouldUnregister ? m(u, a, []) : [])), q = (a, n, o = {}) => {
723
+ const v = m(s, a);
724
724
  let _ = n;
725
- if (h) {
726
- const y = h._f;
727
- y && (!y.disabled && R(i, a, Rt(n, y)), _ = xe(y.ref) && G(n) ? "" : n, kt(y.ref) ? [...y.ref.options].forEach((b) => b.selected = _.includes(b.value)) : y.refs ? ve(y.ref) ? y.refs.forEach((b) => {
725
+ if (v) {
726
+ const y = v._f;
727
+ y && (!y.disabled && O(i, a, Tt(n, y)), _ = xe(y.ref) && Q(n) ? "" : n, kt(y.ref) ? [...y.ref.options].forEach((b) => b.selected = _.includes(b.value)) : y.refs ? ve(y.ref) ? y.refs.forEach((b) => {
728
728
  (!b.defaultChecked || !b.disabled) && (Array.isArray(_) ? b.checked = !!_.find((D) => D === b.value) : b.checked = _ === b.value || !!_);
729
- }) : y.refs.forEach((b) => b.checked = b.value === _) : Xe(y.ref) ? y.ref.value = "" : (y.ref.value = _, y.ref.type || p.state.next({
729
+ }) : y.refs.forEach((b) => b.checked = b.value === _) : Ze(y.ref) ? y.ref.value = "" : (y.ref.value = _, y.ref.type || p.state.next({
730
730
  name: a,
731
- values: L(i)
731
+ values: M(i)
732
732
  })));
733
733
  }
734
- (o.shouldDirty || o.shouldTouch) && A(a, _, o.shouldTouch, o.shouldDirty, !0), o.shouldValidate && _e(a);
735
- }, re = (a, n, o) => {
736
- for (const h in n) {
737
- if (!n.hasOwnProperty(h))
734
+ (o.shouldDirty || o.shouldTouch) && A(a, _, o.shouldTouch, o.shouldDirty, !0), o.shouldValidate && ge(a);
735
+ }, se = (a, n, o) => {
736
+ for (const v in n) {
737
+ if (!n.hasOwnProperty(v))
738
738
  return;
739
- const _ = n[h], y = a + "." + h, b = m(s, y);
740
- (l.array.has(a) || W(_) || b && !b._f) && !oe(_) ? re(y, _, o) : H(y, _, o);
739
+ const _ = n[v], y = a + "." + v, b = m(s, y);
740
+ (l.array.has(a) || H(_) || b && !b._f) && !oe(_) ? se(y, _, o) : q(y, _, o);
741
741
  }
742
742
  }, Y = (a, n, o = {}) => {
743
- const h = m(s, a), _ = l.array.has(a), y = L(n);
744
- R(i, a, y), _ ? (p.array.next({
743
+ const v = m(s, a), _ = l.array.has(a), y = M(n);
744
+ O(i, a, y), _ ? (p.array.next({
745
745
  name: a,
746
- values: L(i)
746
+ values: M(i)
747
747
  }), (g.isDirty || g.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)
751
- })) : h && !h._f && !G(y) ? re(a, y, o) : H(a, y, o), Qe(a, l) && p.state.next({ ...e, name: a }), p.state.next({
751
+ })) : v && !v._f && !Q(y) ? se(a, y, o) : q(a, y, o), Qe(a, l) && p.state.next({ ...e, name: a }), p.state.next({
752
752
  name: c.mount ? a : void 0,
753
- values: L(i)
753
+ values: M(i)
754
754
  });
755
- }, ye = async (a) => {
755
+ }, me = async (a) => {
756
756
  c.mount = !0;
757
757
  const n = a.target;
758
- let o = n.name, h = !0;
759
- const _ = m(s, o), y = (O) => {
760
- h = Number.isNaN(O) || oe(O) && isNaN(O.getTime()) || ae(O, m(i, o, O));
758
+ let o = n.name, v = !0;
759
+ const _ = m(s, o), y = (L) => {
760
+ v = Number.isNaN(L) || oe(L) && isNaN(L.getTime()) || ae(L, m(i, o, L));
761
761
  }, b = de(r.mode), D = de(r.reValidateMode);
762
762
  if (_) {
763
- let O, ee;
764
- const be = n.type ? ht(_._f) : xt(a), ie = a.type === pe.BLUR || a.type === pe.FOCUS_OUT, qt = !fr(_._f) && !r.resolver && !m(e.errors, o) && !_._f.deps || _r(ie, m(e.touchedFields, o), e.isSubmitted, D, b), Te = Qe(o, l, ie);
765
- R(i, o, be), ie ? (!n || !n.readOnly) && (_._f.onBlur && _._f.onBlur(a), V && V(0)) : _._f.onChange && _._f.onChange(a);
766
- const Oe = A(o, be, ie), jt = !q(Oe) || Te;
763
+ let L, ee;
764
+ const be = n.type ? ht(_._f) : xt(a), ie = a.type === pe.BLUR || a.type === pe.FOCUS_OUT, qt = !fr(_._f) && !r.resolver && !m(e.errors, o) && !_._f.deps || _r(ie, m(e.touchedFields, o), e.isSubmitted, D, b), Oe = Qe(o, l, ie);
765
+ O(i, o, be), ie ? (!n || !n.readOnly) && (_._f.onBlur && _._f.onBlur(a), V && V(0)) : _._f.onChange && _._f.onChange(a);
766
+ const Re = A(o, be, ie), jt = !j(Re) || Oe;
767
767
  if (!ie && p.state.next({
768
768
  name: o,
769
769
  type: a.type,
770
- values: L(i)
770
+ values: M(i)
771
771
  }), qt)
772
- return (g.isValid || S.isValid) && (r.mode === "onBlur" ? ie && M() : ie || M()), jt && p.state.next({ name: o, ...Te ? {} : Oe });
773
- if (!ie && Te && p.state.next({ ...e }), r.resolver) {
774
- const { errors: ct } = await j([o]);
775
- if (N([o]), y(be), h) {
776
- const Qt = Vt(e.errors, s, o), dt = Vt(ct, s, Qt.name || o);
777
- O = dt.error, o = dt.name, ee = q(ct);
772
+ return (g.isValid || S.isValid) && (r.mode === "onBlur" ? ie && T() : ie || T()), jt && p.state.next({ name: o, ...Oe ? {} : Re });
773
+ if (!ie && Oe && p.state.next({ ...e }), r.resolver) {
774
+ const { errors: dt } = await W([o]);
775
+ if (U([o]), y(be), v) {
776
+ const Gt = Vt(e.errors, s, o), ft = Vt(dt, s, Gt.name || o);
777
+ L = ft.error, o = ft.name, ee = j(dt);
778
778
  }
779
779
  } else
780
- N([o], !0), O = (await Ge(_, l.disabled, i, I, r.shouldUseNativeValidation))[o], N([o]), y(be), h && (O ? ee = !1 : (g.isValid || S.isValid) && (ee = await Z(s, !0)));
781
- h && (_._f.deps && (!Array.isArray(_._f.deps) || _._f.deps.length > 0) && _e(_._f.deps), k(o, ee, O, Oe));
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)));
781
+ v && (_._f.deps && (!Array.isArray(_._f.deps) || _._f.deps.length > 0) && ge(_._f.deps), w(o, ee, L, Re));
782
782
  }
783
- }, me = (a, n) => {
783
+ }, _e = (a, n) => {
784
784
  if (m(e.errors, n) && a.focus)
785
785
  return a.focus(), 1;
786
- }, _e = async (a, n = {}) => {
787
- let o, h;
786
+ }, ge = async (a, n = {}) => {
787
+ let o, v;
788
788
  const _ = z(a);
789
789
  if (r.resolver) {
790
- const y = await K(U(a) ? a : _);
791
- o = q(y), h = a ? !_.some((b) => m(y, b)) : o;
792
- } else a ? (h = (await Promise.all(_.map(async (y) => {
790
+ const y = await K(N(a) ? a : _);
791
+ o = j(y), v = a ? !_.some((b) => m(y, b)) : o;
792
+ } else a ? (v = (await Promise.all(_.map(async (y) => {
793
793
  const b = m(s, y);
794
794
  return await Z(b && b._f ? { [y]: b } : b);
795
- }))).every(Boolean), !(!h && !e.isValid) && M()) : h = o = await Z(s);
795
+ }))).every(Boolean), !(!v && !e.isValid) && T()) : v = o = await Z(s);
796
796
  return p.state.next({
797
797
  ...!X(a) || (g.isValid || S.isValid) && o !== e.isValid ? {} : { name: a },
798
798
  ...r.resolver || !a ? { isValid: o } : {},
799
799
  errors: e.errors
800
- }), n.shouldFocus && !h && fe(s, me, a ? _ : l.mount), h;
801
- }, tt = (a, n) => {
800
+ }), n.shouldFocus && !v && fe(s, _e, a ? _ : l.mount), v;
801
+ }, rt = (a, n) => {
802
802
  let o = {
803
803
  ...c.mount ? i : u
804
804
  };
805
- return n && (o = wt(n.dirtyFields ? e.dirtyFields : e.touchedFields, o)), U(a) ? o : X(a) ? m(o, a) : a.map((h) => m(o, h));
806
- }, rt = (a, n) => ({
805
+ return n && (o = wt(n.dirtyFields ? e.dirtyFields : e.touchedFields, o)), N(a) ? o : X(a) ? m(o, a) : a.map((v) => m(o, v));
806
+ }, st = (a, n) => ({
807
807
  invalid: !!m((n || e).errors, a),
808
808
  isDirty: !!m((n || e).dirtyFields, a),
809
809
  error: m((n || e).errors, a),
810
810
  isValidating: !!m(e.validatingFields, a),
811
811
  isTouched: !!m((n || e).touchedFields, a)
812
812
  }), Mt = (a) => {
813
- a && z(a).forEach((n) => B(e.errors, n)), p.state.next({
813
+ a && z(a).forEach((n) => P(e.errors, n)), p.state.next({
814
814
  errors: a ? e.errors : {}
815
815
  });
816
- }, st = (a, n, o) => {
817
- const h = (m(s, a, { _f: {} })._f || {}).ref, _ = m(e.errors, a) || {}, { ref: y, message: b, type: D, ...O } = _;
818
- R(e.errors, a, {
819
- ...O,
816
+ }, at = (a, n, o) => {
817
+ const v = (m(s, a, { _f: {} })._f || {}).ref, _ = m(e.errors, a) || {}, { ref: y, message: b, type: D, ...L } = _;
818
+ O(e.errors, a, {
819
+ ...L,
820
820
  ...n,
821
- ref: h
821
+ ref: v
822
822
  }), p.state.next({
823
823
  name: a,
824
824
  errors: e.errors,
825
825
  isValid: !1
826
- }), o && o.shouldFocus && h && h.focus && h.focus();
827
- }, It = (a, n) => Q(a) ? p.state.subscribe({
826
+ }), o && o.shouldFocus && v && v.focus && v.focus();
827
+ }, It = (a, n) => G(a) ? p.state.subscribe({
828
828
  next: (o) => "values" in o && a(C(void 0, n), o)
829
- }) : C(a, n, !0), at = (a) => p.state.subscribe({
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, Ht, a.reRenderRoot) && a.callback({
831
+ mr(a.name, n.name, a.exact) && yr(n, a.formState || g, $t, a.reRenderRoot) && a.callback({
832
832
  values: { ...i },
833
833
  ...e,
834
834
  ...n,
835
835
  defaultValues: u
836
836
  });
837
837
  }
838
- }).unsubscribe, Pt = (a) => (c.mount = !0, S = {
838
+ }).unsubscribe, Bt = (a) => (c.mount = !0, S = {
839
839
  ...S,
840
840
  ...a.formState
841
- }, at({
841
+ }, nt({
842
842
  ...a,
843
843
  formState: {
844
- ...w,
844
+ ...k,
845
845
  ...a.formState
846
846
  }
847
847
  })), Ce = (a, n = {}) => {
848
848
  for (const o of a ? z(a) : l.mount)
849
- l.mount.delete(o), l.array.delete(o), n.keepValue || (B(s, o), B(i, o)), !n.keepError && B(e.errors, o), !n.keepDirty && B(e.dirtyFields, o), !n.keepTouched && B(e.touchedFields, o), !n.keepIsValidating && B(e.validatingFields, o), !r.shouldUnregister && !n.keepDefaultValue && B(u, o);
849
+ l.mount.delete(o), l.array.delete(o), n.keepValue || (P(s, o), P(i, o)), !n.keepError && P(e.errors, o), !n.keepDirty && P(e.dirtyFields, o), !n.keepTouched && P(e.touchedFields, o), !n.keepIsValidating && P(e.validatingFields, o), !r.shouldUnregister && !n.keepDefaultValue && P(u, o);
850
850
  p.state.next({
851
- values: L(i)
851
+ values: M(i)
852
852
  }), p.state.next({
853
853
  ...e,
854
854
  ...n.keepDirty ? { isDirty: E() } : {}
855
- }), !n.keepIsValid && M();
856
- }, nt = ({ disabled: a, name: n }) => {
855
+ }), !n.keepIsValid && T();
856
+ }, it = ({ disabled: a, name: n }) => {
857
857
  (J(a) && c.mount || a || l.disabled.has(n)) && (a ? l.disabled.add(n) : l.disabled.delete(n));
858
858
  }, De = (a, n = {}) => {
859
859
  let o = m(s, a);
860
- const h = J(n.disabled) || J(r.disabled);
861
- return R(s, a, {
860
+ const v = J(n.disabled) || J(r.disabled);
861
+ return O(s, a, {
862
862
  ...o || {},
863
863
  _f: {
864
864
  ...o && o._f ? o._f : { ref: { name: a } },
@@ -866,34 +866,34 @@ function vr(t = {}) {
866
866
  mount: !0,
867
867
  ...n
868
868
  }
869
- }), l.mount.add(a), o ? nt({
869
+ }), l.mount.add(a), o ? it({
870
870
  disabled: J(n.disabled) ? n.disabled : r.disabled,
871
871
  name: a
872
872
  }) : d(a, !0, n.value), {
873
- ...h ? { disabled: n.disabled || r.disabled } : {},
873
+ ...v ? { disabled: n.disabled || r.disabled } : {},
874
874
  ...r.progressive ? {
875
875
  required: !!n.required,
876
- min: ge(n.min),
877
- max: ge(n.max),
878
- minLength: ge(n.minLength),
879
- maxLength: ge(n.maxLength),
880
- pattern: ge(n.pattern)
876
+ min: he(n.min),
877
+ max: he(n.max),
878
+ minLength: he(n.minLength),
879
+ maxLength: he(n.maxLength),
880
+ pattern: he(n.pattern)
881
881
  } : {},
882
882
  name: a,
883
- onChange: ye,
884
- onBlur: ye,
883
+ onChange: me,
884
+ onBlur: me,
885
885
  ref: (_) => {
886
886
  if (_) {
887
887
  De(a, n), o = m(s, a);
888
- const y = U(_.value) && _.querySelectorAll && _.querySelectorAll("input,select,textarea")[0] || _, b = ir(y), D = o._f.refs || [];
889
- if (b ? D.find((O) => O === y) : y === o._f.ref)
888
+ const y = N(_.value) && _.querySelectorAll && _.querySelectorAll("input,select,textarea")[0] || _, b = ir(y), D = o._f.refs || [];
889
+ if (b ? D.find((L) => L === y) : y === o._f.ref)
890
890
  return;
891
- R(s, a, {
891
+ O(s, a, {
892
892
  _f: {
893
893
  ...o._f,
894
894
  ...b ? {
895
895
  refs: [
896
- ...D.filter(Ue),
896
+ ...D.filter(Ne),
897
897
  y,
898
898
  ...Array.isArray(m(u, a)) ? [{}] : []
899
899
  ],
@@ -905,50 +905,50 @@ function vr(t = {}) {
905
905
  o = m(s, a, {}), o._f && (o._f.mount = !1), (r.shouldUnregister || n.shouldUnregister) && !(St(l.array, a) && c.action) && l.unMount.add(a);
906
906
  }
907
907
  };
908
- }, Re = () => r.shouldFocusError && fe(s, me, l.mount), Bt = (a) => {
908
+ }, Te = () => r.shouldFocusError && fe(s, _e, l.mount), Pt = (a) => {
909
909
  J(a) && (p.state.next({ disabled: a }), fe(s, (n, o) => {
910
- const h = m(s, o);
911
- h && (n.disabled = h._f.disabled || a, Array.isArray(h._f.refs) && h._f.refs.forEach((_) => {
912
- _.disabled = h._f.disabled || a;
910
+ const v = m(s, o);
911
+ v && (n.disabled = v._f.disabled || a, Array.isArray(v._f.refs) && v._f.refs.forEach((_) => {
912
+ _.disabled = v._f.disabled || a;
913
913
  }));
914
914
  }, 0, !1));
915
- }, it = (a, n) => async (o) => {
916
- let h;
915
+ }, ut = (a, n) => async (o) => {
916
+ let v;
917
917
  o && (o.preventDefault && o.preventDefault(), o.persist && o.persist());
918
- let _ = L(i);
918
+ let _ = M(i);
919
919
  if (p.state.next({
920
920
  isSubmitting: !0
921
921
  }), r.resolver) {
922
- const { errors: y, values: b } = await j();
923
- N(), e.errors = y, _ = L(b);
922
+ const { errors: y, values: b } = await W();
923
+ U(), e.errors = y, _ = M(b);
924
924
  } else
925
925
  await Z(s);
926
926
  if (l.disabled.size)
927
927
  for (const y of l.disabled)
928
- B(_, y);
929
- if (B(e.errors, "root"), q(e.errors)) {
928
+ P(_, y);
929
+ if (P(e.errors, "root"), j(e.errors)) {
930
930
  p.state.next({
931
931
  errors: {}
932
932
  });
933
933
  try {
934
934
  await a(_, o);
935
935
  } catch (y) {
936
- h = y;
936
+ v = y;
937
937
  }
938
938
  } else
939
- n && await n({ ...e.errors }, o), Re(), setTimeout(Re);
939
+ n && await n({ ...e.errors }, o), Te(), setTimeout(Te);
940
940
  if (p.state.next({
941
941
  isSubmitted: !0,
942
942
  isSubmitting: !1,
943
- isSubmitSuccessful: q(e.errors) && !h,
943
+ isSubmitSuccessful: j(e.errors) && !v,
944
944
  submitCount: e.submitCount + 1,
945
945
  errors: e.errors
946
- }), h)
947
- throw h;
946
+ }), v)
947
+ throw v;
948
948
  }, Wt = (a, n = {}) => {
949
- m(s, a) && (U(n.defaultValue) ? Y(a, L(m(u, a))) : (Y(a, n.defaultValue), R(u, a, L(n.defaultValue))), n.keepTouched || B(e.touchedFields, a), n.keepDirty || (B(e.dirtyFields, a), e.isDirty = n.defaultValue ? E(a, L(m(u, a))) : E()), n.keepError || (B(e.errors, a), g.isValid && M()), p.state.next({ ...e }));
950
- }, ut = (a, n = {}) => {
951
- const o = a ? L(a) : u, h = L(o), _ = q(a), y = _ ? u : h;
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 }));
950
+ }, ot = (a, n = {}) => {
951
+ const o = a ? M(a) : u, v = M(o), _ = j(a), y = _ ? u : v;
952
952
  if (n.keepDefaultValues || (u = o), !n.keepValues) {
953
953
  if (n.keepDirtyValues) {
954
954
  const b = /* @__PURE__ */ new Set([
@@ -956,15 +956,15 @@ function vr(t = {}) {
956
956
  ...Object.keys(ce(u, i))
957
957
  ]);
958
958
  for (const D of Array.from(b))
959
- m(e.dirtyFields, D) ? R(y, D, m(i, D)) : Y(D, m(y, D));
959
+ m(e.dirtyFields, D) ? O(y, D, m(i, D)) : Y(D, m(y, D));
960
960
  } else {
961
- if (ze && U(a))
961
+ if (Ke && N(a))
962
962
  for (const b of l.mount) {
963
963
  const D = m(s, b);
964
964
  if (D && D._f) {
965
- const O = Array.isArray(D._f.refs) ? D._f.refs[0] : D._f.ref;
966
- if (xe(O)) {
967
- const ee = O.closest("form");
965
+ const L = Array.isArray(D._f.refs) ? D._f.refs[0] : D._f.ref;
966
+ if (xe(L)) {
967
+ const ee = L.closest("form");
968
968
  if (ee) {
969
969
  ee.reset();
970
970
  break;
@@ -978,7 +978,7 @@ function vr(t = {}) {
978
978
  else
979
979
  s = {};
980
980
  }
981
- i = r.shouldUnregister ? n.keepDefaultValues ? L(u) : {} : L(y), p.array.next({
981
+ i = r.shouldUnregister ? n.keepDefaultValues ? M(u) : {} : M(y), p.array.next({
982
982
  values: { ...y }
983
983
  }), p.state.next({
984
984
  values: { ...y }
@@ -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 && !q(y), c.watch = !!r.shouldUnregister, c.keepIsValid = !!n.keepIsValid, c.action = !1, n.keepErrors || (e.errors = {}), p.state.next({
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({
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,
@@ -1003,45 +1003,45 @@ function vr(t = {}) {
1003
1003
  isSubmitting: !1,
1004
1004
  defaultValues: u
1005
1005
  });
1006
- }, ot = (a, n) => ut(Q(a) ? a(i) : a, { ...r.resetOptions, ...n }), $t = (a, n = {}) => {
1007
- const o = m(s, a), h = o && o._f;
1008
- if (h) {
1009
- const _ = h.refs ? h.refs[0] : h.ref;
1006
+ }, lt = (a, n) => ot(G(a) ? a(i) : a, { ...r.resetOptions, ...n }), Ht = (a, n = {}) => {
1007
+ const o = m(s, a), v = o && o._f;
1008
+ if (v) {
1009
+ const _ = v.refs ? v.refs[0] : v.ref;
1010
1010
  _.focus && setTimeout(() => {
1011
- _.focus(), n.shouldSelect && Q(_.select) && _.select();
1011
+ _.focus(), n.shouldSelect && G(_.select) && _.select();
1012
1012
  });
1013
1013
  }
1014
- }, Ht = (a) => {
1014
+ }, $t = (a) => {
1015
1015
  e = {
1016
1016
  ...e,
1017
1017
  ...a
1018
1018
  };
1019
- }, lt = {
1019
+ }, ct = {
1020
1020
  control: {
1021
1021
  register: De,
1022
1022
  unregister: Ce,
1023
- getFieldState: rt,
1024
- handleSubmit: it,
1025
- setError: st,
1026
- _subscribe: at,
1027
- _runSchema: j,
1028
- _updateIsValidating: N,
1029
- _focusError: Re,
1023
+ getFieldState: st,
1024
+ handleSubmit: ut,
1025
+ setError: at,
1026
+ _subscribe: nt,
1027
+ _runSchema: W,
1028
+ _updateIsValidating: U,
1029
+ _focusError: Te,
1030
1030
  _getWatch: C,
1031
1031
  _getDirty: E,
1032
- _setValid: M,
1032
+ _setValid: T,
1033
1033
  _setFieldArray: x,
1034
- _setDisabledField: nt,
1034
+ _setDisabledField: it,
1035
1035
  _setErrors: f,
1036
1036
  _getFieldArray: $,
1037
- _reset: ut,
1038
- _resetDefaultValues: () => Q(r.defaultValues) && r.defaultValues().then((a) => {
1039
- ot(a, r.resetOptions), p.state.next({
1037
+ _reset: ot,
1038
+ _resetDefaultValues: () => G(r.defaultValues) && r.defaultValues().then((a) => {
1039
+ lt(a, r.resetOptions), p.state.next({
1040
1040
  isLoading: !1
1041
1041
  });
1042
1042
  }),
1043
1043
  _removeUnmounted: Fe,
1044
- _disableForm: Bt,
1044
+ _disableForm: Pt,
1045
1045
  _subjects: p,
1046
1046
  _proxyFormState: g,
1047
1047
  get _fields() {
@@ -1078,24 +1078,24 @@ function vr(t = {}) {
1078
1078
  };
1079
1079
  }
1080
1080
  },
1081
- subscribe: Pt,
1082
- trigger: _e,
1081
+ subscribe: Bt,
1082
+ trigger: ge,
1083
1083
  register: De,
1084
- handleSubmit: it,
1084
+ handleSubmit: ut,
1085
1085
  watch: It,
1086
1086
  setValue: Y,
1087
- getValues: tt,
1088
- reset: ot,
1087
+ getValues: rt,
1088
+ reset: lt,
1089
1089
  resetField: Wt,
1090
1090
  clearErrors: Mt,
1091
1091
  unregister: Ce,
1092
- setError: st,
1093
- setFocus: $t,
1094
- getFieldState: rt
1092
+ setError: at,
1093
+ setFocus: Ht,
1094
+ getFieldState: st
1095
1095
  };
1096
1096
  return {
1097
- ...lt,
1098
- formControl: lt
1097
+ ...ct,
1098
+ formControl: ct
1099
1099
  };
1100
1100
  }
1101
1101
  var ue = () => {
@@ -1106,19 +1106,19 @@ var ue = () => {
1106
1106
  const e = (Math.random() * 16 + t) % 16 | 0;
1107
1107
  return (r == "x" ? e : e & 3 | 8).toString(16);
1108
1108
  });
1109
- }, Ne = (t, r, e = {}) => e.shouldFocus || U(e.shouldFocus) ? e.focusName || `${t}.${U(e.focusIndex) ? r : e.focusIndex}.` : "", Le = (t, r) => [
1109
+ }, Ue = (t, r, e = {}) => e.shouldFocus || N(e.shouldFocus) ? e.focusName || `${t}.${N(e.focusIndex) ? r : e.focusIndex}.` : "", Me = (t, r) => [
1110
1110
  ...t,
1111
1111
  ...z(r)
1112
- ], Me = (t) => Array.isArray(t) ? t.map(() => {
1112
+ ], Ie = (t) => Array.isArray(t) ? t.map(() => {
1113
1113
  }) : void 0;
1114
- function Ie(t, r, e) {
1114
+ function Be(t, r, e) {
1115
1115
  return [
1116
1116
  ...t.slice(0, r),
1117
1117
  ...z(e),
1118
1118
  ...t.slice(r)
1119
1119
  ];
1120
1120
  }
1121
- var Pe = (t, r, e) => Array.isArray(t) ? (U(t[e]) && (t[e] = void 0), t.splice(e, 0, t.splice(r, 1)[0]), t) : [], Be = (t, r) => [
1121
+ var Pe = (t, r, e) => Array.isArray(t) ? (N(t[e]) && (t[e] = void 0), t.splice(e, 0, t.splice(r, 1)[0]), t) : [], We = (t, r) => [
1122
1122
  ...z(r),
1123
1123
  ...z(t)
1124
1124
  ];
@@ -1129,107 +1129,107 @@ function Vr(t, r) {
1129
1129
  s.splice(u - e, 1), e++;
1130
1130
  return we(s).length ? s : [];
1131
1131
  }
1132
- var We = (t, r) => U(r) ? [] : Vr(t, z(r).sort((e, s) => e - s)), $e = (t, r, e) => {
1132
+ 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)), v = F.useRef(e._getFieldArray(s).map(ue)), w = 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)), h = 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), v.current = A.map(ue));
1141
+ Array.isArray(A) && (V(A), h.current = A.map(ue));
1142
1142
  }
1143
1143
  }
1144
1144
  }).unsubscribe, [e, s]);
1145
1145
  const g = F.useCallback((f) => {
1146
- w.current = !0, e._setFieldArray(s, f);
1146
+ k.current = !0, e._setFieldArray(s, f);
1147
1147
  }, [e, s]), S = (f, d) => {
1148
- const A = z(L(f)), k = Le(e._getFieldArray(s), A);
1149
- e._names.focus = Ne(s, k.length - 1, d), v.current = Le(v.current, A.map(ue)), g(k), V(k), e._setFieldArray(s, k, Le, {
1150
- argA: Me(f)
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, {
1150
+ argA: Ie(f)
1151
1151
  });
1152
1152
  }, p = (f, d) => {
1153
- const A = z(L(f)), k = Be(e._getFieldArray(s), A);
1154
- e._names.focus = Ne(s, 0, d), v.current = Be(v.current, A.map(ue)), g(k), V(k), e._setFieldArray(s, k, Be, {
1155
- argA: Me(f)
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, {
1155
+ argA: Ie(f)
1156
1156
  });
1157
1157
  }, I = (f) => {
1158
- const d = We(e._getFieldArray(s), f);
1159
- v.current = We(v.current, f), g(d), V(d), !Array.isArray(m(e._fields, s)) && R(e._fields, s, void 0), e._setFieldArray(s, d, We, {
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, {
1160
1160
  argA: f
1161
1161
  });
1162
- }, T = (f, d, A) => {
1163
- const k = z(L(d)), j = Ie(e._getFieldArray(s), f, k);
1164
- e._names.focus = Ne(s, f, A), v.current = Ie(v.current, f, k.map(ue)), g(j), V(j), e._setFieldArray(s, j, Ie, {
1162
+ }, R = (f, d, A) => {
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, {
1165
1165
  argA: f,
1166
- argB: Me(d)
1166
+ argB: Ie(d)
1167
1167
  });
1168
- }, M = (f, d) => {
1168
+ }, T = (f, d) => {
1169
1169
  const A = e._getFieldArray(s);
1170
- $e(A, f, d), $e(v.current, f, d), g(A), V(A), e._setFieldArray(s, A, $e, {
1170
+ $e(A, f, d), $e(h.current, f, d), g(A), V(A), e._setFieldArray(s, A, $e, {
1171
1171
  argA: f,
1172
1172
  argB: d
1173
1173
  }, !1);
1174
- }, N = (f, d) => {
1174
+ }, U = (f, d) => {
1175
1175
  const A = e._getFieldArray(s);
1176
- Pe(A, f, d), Pe(v.current, f, d), g(A), V(A), e._setFieldArray(s, A, Pe, {
1176
+ Pe(A, f, d), Pe(h.current, f, d), g(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
- const A = L(d), k = bt(e._getFieldArray(s), f, A);
1182
- v.current = [...k].map((j, K) => !j || K === f ? ue() : v.current[K]), g(k), V([...k]), e._setFieldArray(s, k, bt, {
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, {
1183
1183
  argA: f,
1184
1184
  argB: A
1185
1185
  }, !0, !1);
1186
- }, P = (f) => {
1187
- const d = z(L(f));
1188
- v.current = d.map(ue), g([...d]), V([...d]), e._setFieldArray(s, [...d], (A) => A, {}, !0, !1);
1186
+ }, B = (f) => {
1187
+ const d = z(M(f));
1188
+ h.current = d.map(ue), g([...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({
1192
1192
  ...e._formState
1193
- }), w.current && (!de(e._options.mode).isOnSubmit || e._formState.isSubmitted) && !de(e._options.reValidateMode).isOnSubmit)
1193
+ }), k.current && (!de(e._options.mode).isOnSubmit || e._formState.isSubmitted) && !de(e._options.reValidateMode).isOnSubmit)
1194
1194
  if (e._options.resolver)
1195
1195
  e._runSchema([s]).then((f) => {
1196
1196
  e._updateIsValidating([s]);
1197
1197
  const d = m(f.errors, s), A = m(e._formState.errors, s);
1198
- (A ? !d && A.type || d && (A.type !== d.type || A.message !== d.message) : d && d.type) && (d ? R(e._formState.errors, s, d) : B(e._formState.errors, s), e._subjects.state.next({
1198
+ (A ? !d && A.type || d && (A.type !== d.type || A.message !== d.message) : d && d.type) && (d ? O(e._formState.errors, s, d) : P(e._formState.errors, s), e._subjects.state.next({
1199
1199
  errors: e._formState.errors
1200
1200
  }));
1201
1201
  });
1202
1202
  else {
1203
1203
  const f = m(e._fields, s);
1204
- f && f._f && !(de(e._options.reValidateMode).isOnSubmit && de(e._options.mode).isOnSubmit) && Ge(f, e._names.disabled, e._formValues, e._options.criteriaMode === te.all, e._options.shouldUseNativeValidation, !0).then((d) => !q(d) && e._subjects.state.next({
1205
- errors: Ot(e._formState.errors, d, s)
1204
+ f && f._f && !(de(e._options.reValidateMode).isOnSubmit && de(e._options.mode).isOnSubmit) && ze(f, e._names.disabled, e._formValues, e._options.criteriaMode === re.all, e._options.shouldUseNativeValidation, !0).then((d) => !j(d) && e._subjects.state.next({
1205
+ errors: Rt(e._formState.errors, d, s)
1206
1206
  }));
1207
1207
  }
1208
1208
  e._subjects.state.next({
1209
1209
  name: s,
1210
- values: L(e._formValues)
1210
+ values: M(e._formValues)
1211
1211
  }), e._names.focus && fe(e._fields, (f, d) => {
1212
1212
  if (e._names.focus && d.startsWith(e._names.focus) && f.focus)
1213
1213
  return f.focus(), 1;
1214
- }), e._names.focus = "", e._setValid(), w.current = !1;
1214
+ }), e._names.focus = "", e._setValid(), k.current = !1;
1215
1215
  }, [l, s, e]), F.useEffect(() => (!m(e._formValues, s) && e._setFieldArray(s), () => {
1216
1216
  const f = (d, A) => {
1217
- const k = m(e._fields, d);
1218
- k && k._f && (k._f.mount = A);
1217
+ const w = m(e._fields, d);
1218
+ w && w._f && (w._f.mount = A);
1219
1219
  };
1220
1220
  e._options.shouldUnregister || i ? e.unregister(s) : f(s, !1);
1221
1221
  }), [s, e, u, i]), {
1222
- swap: F.useCallback(M, [g, s, e]),
1223
- move: F.useCallback(N, [g, s, e]),
1222
+ swap: F.useCallback(T, [g, s, e]),
1223
+ move: F.useCallback(U, [g, s, e]),
1224
1224
  prepend: F.useCallback(p, [g, s, e]),
1225
1225
  append: F.useCallback(S, [g, s, e]),
1226
1226
  remove: F.useCallback(I, [g, s, e]),
1227
- insert: F.useCallback(T, [g, s, e]),
1227
+ insert: F.useCallback(R, [g, s, e]),
1228
1228
  update: F.useCallback(x, [g, s, e]),
1229
- replace: F.useCallback(P, [g, s, e]),
1229
+ replace: F.useCallback(B, [g, s, e]),
1230
1230
  fields: F.useMemo(() => l.map((f, d) => ({
1231
1231
  ...f,
1232
- [u]: v.current[d] || ue()
1232
+ [u]: h.current[d] || ue()
1233
1233
  })), [l, u])
1234
1234
  };
1235
1235
  }
@@ -1237,7 +1237,7 @@ function br(t = {}) {
1237
1237
  const r = F.useRef(void 0), e = F.useRef(void 0), [s, u] = F.useState({
1238
1238
  isDirty: !1,
1239
1239
  isValidating: !1,
1240
- isLoading: Q(t.defaultValues),
1240
+ isLoading: G(t.defaultValues),
1241
1241
  isSubmitted: !1,
1242
1242
  isSubmitting: !1,
1243
1243
  isSubmitSuccessful: !1,
@@ -1249,14 +1249,14 @@ function br(t = {}) {
1249
1249
  errors: t.errors || {},
1250
1250
  disabled: t.disabled || !1,
1251
1251
  isReady: !1,
1252
- defaultValues: Q(t.defaultValues) ? void 0 : t.defaultValues
1252
+ defaultValues: G(t.defaultValues) ? void 0 : t.defaultValues
1253
1253
  });
1254
1254
  if (!r.current)
1255
1255
  if (t.formControl)
1256
1256
  r.current = {
1257
1257
  ...t.formControl,
1258
1258
  formState: s
1259
- }, t.defaultValues && !Q(t.defaultValues) && t.formControl.reset(t.defaultValues, t.resetOptions);
1259
+ }, t.defaultValues && !G(t.defaultValues) && t.formControl.reset(t.defaultValues, t.resetOptions);
1260
1260
  else {
1261
1261
  const { formControl: c, ...l } = vr(t);
1262
1262
  r.current = {
@@ -1300,14 +1300,14 @@ function br(t = {}) {
1300
1300
  i._state.mount || (i._setValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState })), i._removeUnmounted();
1301
1301
  }), r.current.formState = Et(s, i), r.current;
1302
1302
  }
1303
- const Ut = zt(void 0), Ar = ({ showAsterisk: t, children: r }) => /* @__PURE__ */ se(Ut.Provider, { value: { showAsterisk: t }, children: r }), pr = () => {
1304
- const t = Kt(Ut);
1303
+ const Lt = zt(void 0), Ar = ({ showAsterisk: t, children: r }) => /* @__PURE__ */ te(Lt.Provider, { value: { showAsterisk: t }, children: r }), pr = () => {
1304
+ const t = Kt(Lt);
1305
1305
  if (!t)
1306
1306
  throw new Error("useSuprFormContext must be used within a SuprFormProvider");
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, v) => (l[V] = r[v], l), {}), c = s.map((l) => {
1310
+ const { conditions: s, operator: u } = e, i = t.reduce((l, V, h) => (l[V] = r[h], l), {}), c = s.map((l) => {
1311
1311
  const V = i[l.name];
1312
1312
  switch (l.operator) {
1313
1313
  case "EQUALS":
@@ -1340,15 +1340,15 @@ const xr = ({
1340
1340
  children: t,
1341
1341
  visibility: r
1342
1342
  }) => {
1343
- const e = he(() => typeof r == "boolean" ? [] : (r == null ? void 0 : r.conditions.map((i) => i.name)) || [], [r]), s = Je({ name: e });
1344
- return he(() => typeof r == "boolean" ? r : !r || (r == null ? void 0 : r.conditions.length) === 0 ? !0 : Nt(e, s, r), [r, e, s]) ? t : null;
1343
+ const e = ye(() => typeof r == "boolean" ? [] : (r == null ? void 0 : r.conditions.map((i) => i.name)) || [], [r]), s = Xe({ name: e });
1344
+ return ye(() => typeof r == "boolean" ? r : !r || (r == null ? void 0 : r.conditions.length) === 0 ? !0 : Nt(e, s, r), [r, e, s]) ? t : null;
1345
1345
  }, Sr = ({
1346
1346
  children: t,
1347
1347
  disabled: r
1348
1348
  }) => {
1349
- const e = he(() => typeof r == "boolean" ? [] : (r == null ? void 0 : r.conditions.map((i) => i.name)) || [], [r]), s = Je({ name: e }), u = he(() => typeof r == "boolean" ? r : !r || (r == null ? void 0 : r.conditions.length) === 0 ? !1 : Nt(e, s, r), [r, e, s]);
1349
+ const e = ye(() => typeof r == "boolean" ? [] : (r == null ? void 0 : r.conditions.map((i) => i.name)) || [], [r]), s = Xe({ name: e }), u = ye(() => typeof r == "boolean" ? r : !r || (r == null ? void 0 : r.conditions.length) === 0 ? !1 : Nt(e, s, r), [r, e, s]);
1350
1350
  return Ae(t, { ...t.props, disabled: u });
1351
- }, et = ({
1351
+ }, tt = ({
1352
1352
  children: t,
1353
1353
  name: r,
1354
1354
  rules: e,
@@ -1357,52 +1357,73 @@ const xr = ({
1357
1357
  id: i,
1358
1358
  disabled: c,
1359
1359
  shouldUnregister: l,
1360
- visibility: V
1360
+ visibility: V,
1361
+ description: h
1361
1362
  }) => {
1362
- const { control: v } = Ve(), w = t.props.value ?? "", { showAsterisk: g } = pr(), S = t.props.onChange, p = t.props.onBlur, I = he(() => i || crypto.randomUUID(), []);
1363
- return /* @__PURE__ */ se(xr, { visibility: V, children: /* @__PURE__ */ se(Sr, { disabled: c, children: /* @__PURE__ */ se(
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]);
1367
+ return /* @__PURE__ */ te(xr, { visibility: V, children: /* @__PURE__ */ te(Sr, { disabled: c, children: /* @__PURE__ */ te(
1364
1368
  ar,
1365
1369
  {
1366
- control: v,
1370
+ control: k,
1367
1371
  name: r,
1368
1372
  rules: e,
1369
- defaultValue: w,
1373
+ defaultValue: g,
1370
1374
  shouldUnregister: l,
1371
1375
  render: ({
1372
- field: { name: T, onBlur: M, value: N, onChange: x, ref: P, disabled: f },
1373
- fieldState: { error: d }
1374
- }) => /* @__PURE__ */ ft(
1376
+ field: { name: U, onBlur: x, value: B, onChange: f, ref: d, disabled: A },
1377
+ fieldState: { error: w }
1378
+ }) => /* @__PURE__ */ Le(
1375
1379
  "div",
1376
1380
  {
1377
1381
  className: `controlled-field ${s}`,
1378
1382
  style: { display: "flex", flexDirection: "column", gap: "5px" },
1379
1383
  children: [
1380
- u && /* @__PURE__ */ ft("label", { htmlFor: I, className: "controlled-field-label", children: [
1381
- u,
1382
- g && !!e && /* @__PURE__ */ se("span", { style: { color: "red" }, children: " *" })
1383
- ] }),
1384
+ /* @__PURE__ */ Le(
1385
+ "div",
1386
+ {
1387
+ className: "controlled-field-description",
1388
+ style: {
1389
+ display: "inline-flex",
1390
+ ...T && {
1391
+ gap: "2px",
1392
+ alignItems: "center",
1393
+ flexDirection: T.position === "LABEL_RIGHT" ? "row" : "column"
1394
+ }
1395
+ },
1396
+ children: [
1397
+ u && /* @__PURE__ */ Le("label", { htmlFor: R, className: "controlled-field-label", children: [
1398
+ u,
1399
+ S && !!e && /* @__PURE__ */ te("span", { style: { color: "red" }, children: " *" })
1400
+ ] }),
1401
+ T && T.position !== "CONTROL_BOTTOM" && /* @__PURE__ */ te("span", { style: { color: "#a1a1a1", fontSize: 12 }, children: T.text })
1402
+ ]
1403
+ }
1404
+ ),
1384
1405
  Ae(t, {
1385
1406
  ...t.props,
1386
- id: I,
1387
- name: T,
1388
- disabled: f,
1389
- onChange: (...A) => {
1390
- x(...A), S == null || S(...A);
1407
+ id: R,
1408
+ name: U,
1409
+ disabled: A,
1410
+ onChange: (...W) => {
1411
+ f(...W), p == null || p(...W);
1391
1412
  },
1392
- value: N,
1393
- onBlur: (...A) => {
1394
- M(), p == null || p(...A);
1413
+ value: B,
1414
+ onBlur: (...W) => {
1415
+ x(), I == null || I(...W);
1395
1416
  },
1396
- ref: P
1417
+ ref: d
1397
1418
  }),
1398
- d && /* @__PURE__ */ se("div", { style: { color: "red", fontSize: 13 }, className: "controlled-field-error", children: d.message })
1419
+ w && /* @__PURE__ */ te("div", { style: { color: "red", fontSize: 13 }, className: "controlled-field-error", children: w.message })
1399
1420
  ]
1400
1421
  }
1401
1422
  )
1402
1423
  }
1403
1424
  ) }) });
1404
1425
  };
1405
- et.displayName = "SuprFormControl";
1426
+ tt.displayName = "SuprFormControl";
1406
1427
  const Er = ({
1407
1428
  name: t,
1408
1429
  rules: r,
@@ -1416,51 +1437,51 @@ const Er = ({
1416
1437
  rules: r
1417
1438
  });
1418
1439
  At(e, () => c, [c]);
1419
- const l = (V, v) => Yt.map(V, (w) => {
1420
- var I, T;
1421
- if (!Jt(w))
1422
- return w;
1423
- const g = w.props, S = w.type;
1424
- if (((S == null ? void 0 : S.displayName) === "SuprFormControl" || S === et || g.name !== void 0 && typeof S != "string") && g.name !== void 0) {
1425
- const M = u ? u[g.name] : void 0, N = M ? {
1426
- ...M,
1427
- conditions: ((I = M.conditions) == null ? void 0 : I.map((d) => ({
1440
+ const l = (V, h) => Yt.map(V, (k) => {
1441
+ var I, R;
1442
+ if (!Jt(k))
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 ? {
1447
+ ...T,
1448
+ conditions: ((I = T.conditions) == null ? void 0 : I.map((d) => ({
1428
1449
  ...d,
1429
- name: `${v}${d.name}`
1450
+ name: `${h}${d.name}`
1430
1451
  }))) || []
1431
- } : void 0, x = i ? i[g.name] : void 0, P = x ? {
1452
+ } : void 0, x = i ? i[g.name] : void 0, B = x ? {
1432
1453
  ...x,
1433
- conditions: ((T = x.conditions) == null ? void 0 : T.map((d) => ({
1454
+ conditions: ((R = x.conditions) == null ? void 0 : R.map((d) => ({
1434
1455
  ...d,
1435
- name: `${v}${d.name}`
1456
+ name: `${h}${d.name}`
1436
1457
  }))) || []
1437
1458
  } : void 0, f = {
1438
1459
  ...g,
1439
- name: `${v}${g.name}`,
1440
- visibility: N,
1441
- disabled: P
1460
+ name: `${h}${g.name}`,
1461
+ visibility: U,
1462
+ disabled: B
1442
1463
  };
1443
- return g.id !== void 0 && (f.id = `${v}${g.id}`), Ae(w, f);
1464
+ return g.id !== void 0 && (f.id = `${h}${g.id}`), Ae(k, f);
1444
1465
  }
1445
- return g.children ? Ae(w, {
1466
+ return g.children ? Ae(k, {
1446
1467
  ...g,
1447
- children: l(g.children, v)
1448
- }) : w;
1468
+ children: l(g.children, h)
1469
+ }) : k;
1449
1470
  });
1450
- return /* @__PURE__ */ se(Gt, { children: c.fields.map((V, v) => {
1451
- const w = `${t}.${v}.`;
1452
- return /* @__PURE__ */ se(
1471
+ return /* @__PURE__ */ te(Qt, { children: c.fields.map((V, h) => {
1472
+ const k = `${t}.${h}.`;
1473
+ return /* @__PURE__ */ te(
1453
1474
  "div",
1454
1475
  {
1455
- "data-index": v,
1476
+ "data-index": h,
1456
1477
  style: { display: "contents" },
1457
1478
  id: "field-array-item",
1458
- children: l(s, w)
1479
+ children: l(s, k)
1459
1480
  },
1460
- w
1481
+ k
1461
1482
  );
1462
1483
  }) });
1463
- }, Lt = ({
1484
+ }, Ut = ({
1464
1485
  children: t,
1465
1486
  onSubmit: r = () => {
1466
1487
  },
@@ -1473,7 +1494,7 @@ const Er = ({
1473
1494
  ref: l,
1474
1495
  onChange: V
1475
1496
  }) => {
1476
- const v = br({
1497
+ const h = br({
1477
1498
  mode: "onSubmit",
1478
1499
  reValidateMode: "onChange",
1479
1500
  shouldFocusError: !0,
@@ -1482,38 +1503,38 @@ const Er = ({
1482
1503
  return At(
1483
1504
  l,
1484
1505
  () => ({
1485
- setValue: v.setValue,
1486
- setError: v.setError,
1487
- clearErrors: v.clearErrors,
1488
- getValues: v.getValues,
1489
- reset: v.reset,
1490
- setFocus: v.setFocus,
1491
- resetField: v.resetField,
1492
- trigger: v.trigger,
1493
- unregister: v.unregister,
1494
- watch: v.watch,
1495
- handleSubmit: v.handleSubmit
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
1496
1517
  }),
1497
- [v]
1518
+ [h]
1498
1519
  ), Xt(() => {
1499
- const w = v.watch((g) => {
1520
+ const k = h.watch((g) => {
1500
1521
  V == null || V(g);
1501
1522
  });
1502
- return () => w.unsubscribe();
1503
- }, [v.watch]), /* @__PURE__ */ se(Ar, { showAsterisk: c, children: /* @__PURE__ */ se(tr, { ...v, children: /* @__PURE__ */ se(
1523
+ return () => k.unsubscribe();
1524
+ }, [h.watch]), /* @__PURE__ */ te(Ar, { showAsterisk: c, children: /* @__PURE__ */ te(tr, { ...h, children: /* @__PURE__ */ te(
1504
1525
  "form",
1505
1526
  {
1506
1527
  noValidate: !0,
1507
- onSubmit: v.handleSubmit(r, e),
1528
+ onSubmit: h.handleSubmit(r, e),
1508
1529
  style: s,
1509
1530
  className: u,
1510
1531
  children: t
1511
1532
  }
1512
1533
  ) }) });
1513
1534
  };
1514
- Lt.Control = et;
1515
- Lt.ControlArray = Er;
1535
+ Ut.Control = tt;
1536
+ Ut.ControlArray = Er;
1516
1537
  export {
1517
- Lt as SuprForm
1538
+ Ut as SuprForm
1518
1539
  };
1519
1540
  //# sourceMappingURL=suprform.es.js.map