@scbt-ecom/ui 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.js CHANGED
@@ -3448,7 +3448,29 @@ function LO(t) {
3448
3448
  return n.pop(), e.length === 1 && n.length === 1 && e[0].x === n[0].x && e[0].y === n[0].y ? e : e.concat(n);
3449
3449
  }
3450
3450
  var BO = Bx, jO = jx, GO = Gx, _O = _x, zO = Wx;
3451
- const Cu = (t = !1) => {
3451
+ const sg = () => !1, HO = () => {
3452
+ const t = "(max-width: 1187px)", e = "(min-width: 1188px)", n = pe(
3453
+ (s) => {
3454
+ const a = globalThis.matchMedia(t);
3455
+ return a.addEventListener("change", s), () => {
3456
+ a.removeEventListener("change", s);
3457
+ };
3458
+ },
3459
+ [t]
3460
+ ), r = pe(
3461
+ (s) => {
3462
+ const a = globalThis.matchMedia(e);
3463
+ return a.addEventListener("change", s), () => {
3464
+ a.removeEventListener("change", s);
3465
+ };
3466
+ },
3467
+ [e]
3468
+ ), i = () => globalThis.matchMedia(t).matches, o = () => globalThis.matchMedia(e).matches;
3469
+ return {
3470
+ isMobile: Xd(n, i, sg),
3471
+ isDesktop: Xd(r, o, sg)
3472
+ };
3473
+ }, Cu = (t = !1) => {
3452
3474
  const [e, n] = w.useState(t);
3453
3475
  return [e, (i) => n((o) => i ?? !o)];
3454
3476
  }, Up = (t, e) => {
@@ -3465,7 +3487,7 @@ const Cu = (t = !1) => {
3465
3487
  };
3466
3488
  var Us = (t) => t.type === "checkbox", ii = (t) => t instanceof Date, Ft = (t) => t == null;
3467
3489
  const $x = (t) => typeof t == "object";
3468
- var ot = (t) => !Ft(t) && !Array.isArray(t) && $x(t) && !ii(t), Xx = (t) => ot(t) && t.target ? Us(t.target) ? t.target.checked : t.target.value : t, HO = (t) => t.substring(0, t.search(/\.\d+(\.|$)/)) || t, Yx = (t, e) => t.has(HO(e)), WO = (t) => {
3490
+ var ot = (t) => !Ft(t) && !Array.isArray(t) && $x(t) && !ii(t), Xx = (t) => ot(t) && t.target ? Us(t.target) ? t.target.checked : t.target.value : t, WO = (t) => t.substring(0, t.search(/\.\d+(\.|$)/)) || t, Yx = (t, e) => t.has(WO(e)), $O = (t) => {
3469
3491
  const e = t.constructor && t.constructor.prototype;
3470
3492
  return ot(e) && e.hasOwnProperty("isPrototypeOf");
3471
3493
  }, Jp = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
@@ -3477,7 +3499,7 @@ function jt(t) {
3477
3499
  else if (t instanceof Set)
3478
3500
  e = new Set(t);
3479
3501
  else if (!(Jp && (t instanceof Blob || t instanceof FileList)) && (n || ot(t)))
3480
- if (e = n ? [] : {}, !n && !WO(t))
3502
+ if (e = n ? [] : {}, !n && !$O(t))
3481
3503
  e = t;
3482
3504
  else
3483
3505
  for (const r in t)
@@ -3525,7 +3547,7 @@ const sl = {
3525
3547
  pattern: "pattern",
3526
3548
  required: "required",
3527
3549
  validate: "validate"
3528
- }, $O = U.createContext(null), qp = () => U.useContext($O);
3550
+ }, XO = U.createContext(null), qp = () => U.useContext(XO);
3529
3551
  var Ux = (t, e, n, r = !0) => {
3530
3552
  const i = {
3531
3553
  defaultValues: e._defaultValues
@@ -3554,7 +3576,7 @@ function Qp(t) {
3554
3576
  };
3555
3577
  }, [t.disabled]);
3556
3578
  }
3557
- function XO(t) {
3579
+ function YO(t) {
3558
3580
  const e = qp(), { control: n = e.control, disabled: r, name: i, exact: o } = t || {}, [s, a] = U.useState(n._formState), l = U.useRef(!0), c = U.useRef({
3559
3581
  isDirty: !1,
3560
3582
  isLoading: !1,
@@ -3577,7 +3599,7 @@ function XO(t) {
3577
3599
  }), [n]), Ux(s, n, c.current, !1);
3578
3600
  }
3579
3601
  var Pn = (t) => typeof t == "string", qx = (t, e, n, r, i) => Pn(t) ? (r && e.watch.add(t), ne(n, t, i)) : Array.isArray(t) ? t.map((o) => (r && e.watch.add(o), ne(n, o))) : (r && (e.watchAll = !0), n);
3580
- function YO(t) {
3602
+ function ZO(t) {
3581
3603
  const e = qp(), { control: n = e.control, name: r, defaultValue: i, disabled: o, exact: s } = t || {}, a = U.useRef(r);
3582
3604
  a.current = r, Qp({
3583
3605
  disabled: o,
@@ -3589,13 +3611,13 @@ function YO(t) {
3589
3611
  const [l, c] = U.useState(n._getWatch(r, i));
3590
3612
  return U.useEffect(() => n._removeUnmounted()), l;
3591
3613
  }
3592
- function ZO(t) {
3593
- const e = qp(), { name: n, disabled: r, control: i = e.control, shouldUnregister: o } = t, s = Yx(i._names.array, n), a = YO({
3614
+ function UO(t) {
3615
+ const e = qp(), { name: n, disabled: r, control: i = e.control, shouldUnregister: o } = t, s = Yx(i._names.array, n), a = ZO({
3594
3616
  control: i,
3595
3617
  name: n,
3596
3618
  defaultValue: ne(i._formValues, n, ne(i._defaultValues, n, t.defaultValue)),
3597
3619
  exact: !0
3598
- }), l = XO({
3620
+ }), l = YO({
3599
3621
  control: i,
3600
3622
  name: n,
3601
3623
  exact: !0
@@ -3677,20 +3699,20 @@ function ZO(t) {
3677
3699
  })
3678
3700
  };
3679
3701
  }
3680
- const Ut = (t) => t.render(ZO(t));
3702
+ const Ut = (t) => t.render(UO(t));
3681
3703
  var Qx = (t, e, n, r, i) => e ? {
3682
3704
  ...n[t],
3683
3705
  types: {
3684
3706
  ...n[t] && n[t].types ? n[t].types : {},
3685
3707
  [r]: i || !0
3686
3708
  }
3687
- } : {}, sg = (t) => ({
3709
+ } : {}, ag = (t) => ({
3688
3710
  isOnSubmit: !t || t === dn.onSubmit,
3689
3711
  isOnBlur: t === dn.onBlur,
3690
3712
  isOnChange: t === dn.onChange,
3691
3713
  isOnAll: t === dn.all,
3692
3714
  isOnTouch: t === dn.onTouched
3693
- }), ag = (t, e, n) => !n && (e.watchAll || e.watch.has(t) || [...e.watch].some((r) => t.startsWith(r) && /^\.\w+/.test(t.slice(r.length))));
3715
+ }), lg = (t, e, n) => !n && (e.watchAll || e.watch.has(t) || [...e.watch].some((r) => t.startsWith(r) && /^\.\w+/.test(t.slice(r.length))));
3694
3716
  const ss = (t, e, n, r) => {
3695
3717
  for (const i of n || Object.keys(t)) {
3696
3718
  const o = ne(t, i);
@@ -3708,7 +3730,7 @@ const ss = (t, e, n, r) => {
3708
3730
  }
3709
3731
  }
3710
3732
  };
3711
- var UO = (t, e, n) => {
3733
+ var JO = (t, e, n) => {
3712
3734
  const r = is(ne(t, n));
3713
3735
  return He(r, "root", e[n]), He(t, n, r), t;
3714
3736
  }, eh = (t) => t.type === "file", On = (t) => typeof t == "function", al = (t) => {
@@ -3717,10 +3739,10 @@ var UO = (t, e, n) => {
3717
3739
  const e = t ? t.ownerDocument : 0;
3718
3740
  return t instanceof (e && e.defaultView ? e.defaultView.HTMLElement : HTMLElement);
3719
3741
  }, ja = (t) => Pn(t), th = (t) => t.type === "radio", ll = (t) => t instanceof RegExp;
3720
- const lg = {
3742
+ const cg = {
3721
3743
  value: !1,
3722
3744
  isValid: !1
3723
- }, cg = { value: !0, isValid: !0 };
3745
+ }, ug = { value: !0, isValid: !0 };
3724
3746
  var e1 = (t) => {
3725
3747
  if (Array.isArray(t)) {
3726
3748
  if (t.length > 1) {
@@ -3729,20 +3751,20 @@ var e1 = (t) => {
3729
3751
  }
3730
3752
  return t[0].checked && !t[0].disabled ? (
3731
3753
  // @ts-expect-error expected to work in the browser
3732
- t[0].attributes && !et(t[0].attributes.value) ? et(t[0].value) || t[0].value === "" ? cg : { value: t[0].value, isValid: !0 } : cg
3733
- ) : lg;
3754
+ t[0].attributes && !et(t[0].attributes.value) ? et(t[0].value) || t[0].value === "" ? ug : { value: t[0].value, isValid: !0 } : ug
3755
+ ) : cg;
3734
3756
  }
3735
- return lg;
3757
+ return cg;
3736
3758
  };
3737
- const ug = {
3759
+ const dg = {
3738
3760
  isValid: !1,
3739
3761
  value: null
3740
3762
  };
3741
3763
  var t1 = (t) => Array.isArray(t) ? t.reduce((e, n) => n && n.checked && !n.disabled ? {
3742
3764
  isValid: !0,
3743
3765
  value: n.value
3744
- } : e, ug) : ug;
3745
- function dg(t, e, n = "validate") {
3766
+ } : e, dg) : dg;
3767
+ function fg(t, e, n = "validate") {
3746
3768
  if (ja(t) || Array.isArray(t) && t.every(ja) || nn(t) && !t)
3747
3769
  return {
3748
3770
  type: n,
@@ -3753,7 +3775,7 @@ function dg(t, e, n = "validate") {
3753
3775
  var ji = (t) => ot(t) && !ll(t) ? t : {
3754
3776
  value: t,
3755
3777
  message: ""
3756
- }, fg = async (t, e, n, r, i) => {
3778
+ }, pg = async (t, e, n, r, i) => {
3757
3779
  const { ref: o, refs: s, required: a, maxLength: l, minLength: c, min: u, max: d, pattern: f, validate: p, name: h, valueAsNumber: m, mount: g, disabled: v } = t._f, b = ne(e, h);
3758
3780
  if (!g || v)
3759
3781
  return {};
@@ -3808,7 +3830,7 @@ var ji = (t) => ot(t) && !ll(t) ? t : {
3808
3830
  }
3809
3831
  if (p) {
3810
3832
  if (On(p)) {
3811
- const j = await p(b, e), W = dg(j, y);
3833
+ const j = await p(b, e), W = fg(j, y);
3812
3834
  if (W && (x[h] = {
3813
3835
  ...W,
3814
3836
  ...L(Xn.validate, W.message)
@@ -3819,7 +3841,7 @@ var ji = (t) => ot(t) && !ll(t) ? t : {
3819
3841
  for (const W in p) {
3820
3842
  if (!Gt(j) && !n)
3821
3843
  break;
3822
- const F = dg(await p[W](b, e), y, W);
3844
+ const F = fg(await p[W](b, e), y, W);
3823
3845
  F && (j = {
3824
3846
  ...F,
3825
3847
  ...L(W, F.message)
@@ -3834,22 +3856,22 @@ var ji = (t) => ot(t) && !ll(t) ? t : {
3834
3856
  }
3835
3857
  return S(!0), x;
3836
3858
  };
3837
- function JO(t, e) {
3859
+ function KO(t, e) {
3838
3860
  const n = e.slice(0, -1).length;
3839
3861
  let r = 0;
3840
3862
  for (; r < n; )
3841
3863
  t = et(t) ? r++ : t[e[r++]];
3842
3864
  return t;
3843
3865
  }
3844
- function KO(t) {
3866
+ function qO(t) {
3845
3867
  for (const e in t)
3846
3868
  if (t.hasOwnProperty(e) && !et(t[e]))
3847
3869
  return !1;
3848
3870
  return !0;
3849
3871
  }
3850
3872
  function ut(t, e) {
3851
- const n = Array.isArray(e) ? e : Kp(e) ? [e] : Zx(e), r = n.length === 1 ? t : JO(t, n), i = n.length - 1, o = n[i];
3852
- return r && delete r[o], i !== 0 && (ot(r) && Gt(r) || Array.isArray(r) && KO(r)) && ut(t, n.slice(0, -1)), t;
3873
+ const n = Array.isArray(e) ? e : Kp(e) ? [e] : Zx(e), r = n.length === 1 ? t : KO(t, n), i = n.length - 1, o = n[i];
3874
+ return r && delete r[o], i !== 0 && (ot(r) && Gt(r) || Array.isArray(r) && qO(r)) && ut(t, n.slice(0, -1)), t;
3853
3875
  }
3854
3876
  var wu = () => {
3855
3877
  let t = [];
@@ -3891,7 +3913,7 @@ function xr(t, e) {
3891
3913
  }
3892
3914
  return !0;
3893
3915
  }
3894
- var n1 = (t) => t.type === "select-multiple", qO = (t) => th(t) || Us(t), Su = (t) => al(t) && t.isConnected, r1 = (t) => {
3916
+ var n1 = (t) => t.type === "select-multiple", QO = (t) => th(t) || Us(t), Su = (t) => al(t) && t.isConnected, r1 = (t) => {
3895
3917
  for (const e in t)
3896
3918
  if (On(t[e]))
3897
3919
  return !0;
@@ -3917,7 +3939,7 @@ function Eu(t) {
3917
3939
  if (!(t.refs ? t.refs.every((n) => n.disabled) : e.disabled))
3918
3940
  return eh(e) ? e.files : th(e) ? t1(t.refs).value : n1(e) ? [...e.selectedOptions].map(({ value: n }) => n) : Us(e) ? e1(t.refs).value : o1(et(e.value) ? t.ref.value : e.value, t);
3919
3941
  }
3920
- var QO = (t, e, n, r) => {
3942
+ var eM = (t, e, n, r) => {
3921
3943
  const i = {};
3922
3944
  for (const o of t) {
3923
3945
  const s = ne(e, o);
@@ -3930,9 +3952,9 @@ var QO = (t, e, n, r) => {
3930
3952
  shouldUseNativeValidation: r
3931
3953
  };
3932
3954
  }, Ho = (t) => et(t) ? t : ll(t) ? t.source : ot(t) ? ll(t.value) ? t.value.source : t.value : t;
3933
- const pg = "AsyncFunction";
3934
- var eM = (t) => (!t || !t.validate) && !!(On(t.validate) && t.validate.constructor.name === pg || ot(t.validate) && Object.values(t.validate).find((e) => e.constructor.name === pg)), tM = (t) => t.mount && (t.required || t.min || t.max || t.maxLength || t.minLength || t.pattern || t.validate);
3935
- function hg(t, e, n) {
3955
+ const hg = "AsyncFunction";
3956
+ var tM = (t) => (!t || !t.validate) && !!(On(t.validate) && t.validate.constructor.name === hg || ot(t.validate) && Object.values(t.validate).find((e) => e.constructor.name === hg)), nM = (t) => t.mount && (t.required || t.min || t.max || t.maxLength || t.minLength || t.pattern || t.validate);
3957
+ function mg(t, e, n) {
3936
3958
  const r = ne(t, n);
3937
3959
  if (r || Kp(n))
3938
3960
  return {
@@ -3955,15 +3977,15 @@ function hg(t, e, n) {
3955
3977
  name: n
3956
3978
  };
3957
3979
  }
3958
- var nM = (t, e, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(e || t) : (n ? r.isOnBlur : i.isOnBlur) ? !t : (n ? r.isOnChange : i.isOnChange) ? t : !0, rM = (t, e) => !Mc(ne(t, e)).length && ut(t, e);
3959
- const iM = {
3980
+ var rM = (t, e, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(e || t) : (n ? r.isOnBlur : i.isOnBlur) ? !t : (n ? r.isOnChange : i.isOnChange) ? t : !0, iM = (t, e) => !Mc(ne(t, e)).length && ut(t, e);
3981
+ const oM = {
3960
3982
  mode: dn.onSubmit,
3961
3983
  reValidateMode: dn.onChange,
3962
3984
  shouldFocusError: !0
3963
3985
  };
3964
- function oM(t = {}) {
3986
+ function sM(t = {}) {
3965
3987
  let e = {
3966
- ...iM,
3988
+ ...oM,
3967
3989
  ...t
3968
3990
  }, n = {
3969
3991
  submitCount: 0,
@@ -4001,7 +4023,7 @@ function oM(t = {}) {
4001
4023
  values: wu(),
4002
4024
  array: wu(),
4003
4025
  state: wu()
4004
- }, f = sg(e.mode), p = sg(e.reValidateMode), h = e.criteriaMode === dn.all, m = (I) => (k) => {
4026
+ }, f = ag(e.mode), p = ag(e.reValidateMode), h = e.criteriaMode === dn.all, m = (I) => (k) => {
4005
4027
  clearTimeout(c), c = setTimeout(I, k);
4006
4028
  }, g = async (I) => {
4007
4029
  if (!e.disabled && (u.isValid || I)) {
@@ -4025,7 +4047,7 @@ function oM(t = {}) {
4025
4047
  }
4026
4048
  if ($ && Array.isArray(ne(n.errors, I))) {
4027
4049
  const B = R(ne(n.errors, I), ee.argA, ee.argB);
4028
- Z && He(n.errors, I, B), rM(n.errors, I);
4050
+ Z && He(n.errors, I, B), iM(n.errors, I);
4029
4051
  }
4030
4052
  if (u.touchedFields && $ && Array.isArray(ne(n.touchedFields, I))) {
4031
4053
  const B = R(ne(n.touchedFields, I), ee.argA, ee.argB);
@@ -4090,7 +4112,7 @@ function oM(t = {}) {
4090
4112
  }
4091
4113
  }, T = async (I) => {
4092
4114
  v(I, !0);
4093
- const k = await e.resolver(o, e.context, QO(I || a.mount, r, e.criteriaMode, e.shouldUseNativeValidation));
4115
+ const k = await e.resolver(o, e.context, eM(I || a.mount, r, e.criteriaMode, e.shouldUseNativeValidation));
4094
4116
  return v(I), k;
4095
4117
  }, O = async (I) => {
4096
4118
  const { errors: k } = await T(I);
@@ -4110,12 +4132,12 @@ function oM(t = {}) {
4110
4132
  if (Z) {
4111
4133
  const { _f: $, ...B } = Z;
4112
4134
  if ($) {
4113
- const K = a.array.has($.name), xe = Z._f && eM(Z._f);
4135
+ const K = a.array.has($.name), xe = Z._f && tM(Z._f);
4114
4136
  xe && u.validatingFields && v([ee], !0);
4115
- const Ee = await fg(Z, o, h, e.shouldUseNativeValidation && !k, K);
4137
+ const Ee = await pg(Z, o, h, e.shouldUseNativeValidation && !k, K);
4116
4138
  if (xe && u.validatingFields && v([ee]), Ee[$.name] && (R.valid = !1, k))
4117
4139
  break;
4118
- !k && (ne(Ee, $.name) ? K ? UO(n.errors, Ee, $.name) : He(n.errors, $.name, Ee[$.name]) : ut(n.errors, $.name));
4140
+ !k && (ne(Ee, $.name) ? K ? JO(n.errors, Ee, $.name) : He(n.errors, $.name, Ee[$.name]) : ut(n.errors, $.name));
4119
4141
  }
4120
4142
  !Gt(B) && await L(B, k, R);
4121
4143
  }
@@ -4154,7 +4176,7 @@ function oM(t = {}) {
4154
4176
  name: I,
4155
4177
  dirtyFields: zo(i, o),
4156
4178
  isDirty: j(I, $)
4157
- })) : ee && !ee._f && !Ft($) ? D(I, $, R) : X(I, $, R), ag(I, a) && d.state.next({ ...n }), d.values.next({
4179
+ })) : ee && !ee._f && !Ft($) ? D(I, $, R) : X(I, $, R), lg(I, a) && d.state.next({ ...n }), d.values.next({
4158
4180
  name: s.mount ? I : void 0,
4159
4181
  values: { ...o }
4160
4182
  });
@@ -4167,7 +4189,7 @@ function oM(t = {}) {
4167
4189
  };
4168
4190
  if (Z) {
4169
4191
  let K, xe;
4170
- const Ee = $(), rt = I.type === sl.BLUR || I.type === sl.FOCUS_OUT, Xr = !tM(Z._f) && !e.resolver && !ne(n.errors, R) && !Z._f.deps || nM(rt, ne(n.touchedFields, R), n.isSubmitted, p, f), Cn = ag(R, a, rt);
4192
+ const Ee = $(), rt = I.type === sl.BLUR || I.type === sl.FOCUS_OUT, Xr = !nM(Z._f) && !e.resolver && !ne(n.errors, R) && !Z._f.deps || rM(rt, ne(n.touchedFields, R), n.isSubmitted, p, f), Cn = lg(R, a, rt);
4171
4193
  He(o, R, Ee), rt ? (Z._f.onBlur && Z._f.onBlur(I), l && l(0)) : Z._f.onChange && Z._f.onChange(I);
4172
4194
  const Yr = E(R, Ee, rt, !1), jo = !Gt(Yr) || Cn;
4173
4195
  if (!rt && d.values.next({
@@ -4179,11 +4201,11 @@ function oM(t = {}) {
4179
4201
  if (!rt && Cn && d.state.next({ ...n }), e.resolver) {
4180
4202
  const { errors: Fi } = await T([R]);
4181
4203
  if (B(Ee), ee) {
4182
- const Vi = hg(n.errors, r, R), Li = hg(Fi, r, Vi.name || R);
4204
+ const Vi = mg(n.errors, r, R), Li = mg(Fi, r, Vi.name || R);
4183
4205
  K = Li.error, R = Li.name, xe = Gt(Fi);
4184
4206
  }
4185
4207
  } else
4186
- v([R], !0), K = (await fg(Z, o, h, e.shouldUseNativeValidation))[R], v([R]), B(Ee), ee && (K ? xe = !1 : u.isValid && (xe = await L(r, !0)));
4208
+ v([R], !0), K = (await pg(Z, o, h, e.shouldUseNativeValidation))[R], v([R]), B(Ee), ee && (K ? xe = !1 : u.isValid && (xe = await L(r, !0)));
4187
4209
  ee && (Z._f.deps && P(Z._f.deps), A(R, xe, K, Yr));
4188
4210
  }
4189
4211
  }, Q = (I, k) => {
@@ -4278,7 +4300,7 @@ function oM(t = {}) {
4278
4300
  ref: (Z) => {
4279
4301
  if (Z) {
4280
4302
  ae(I, k), R = ne(r, I);
4281
- const $ = et(Z.value) && Z.querySelectorAll && Z.querySelectorAll("input,select,textarea")[0] || Z, B = qO($), K = R._f.refs || [];
4303
+ const $ = et(Z.value) && Z.querySelectorAll && Z.querySelectorAll("input,select,textarea")[0] || Z, B = QO($), K = R._f.refs || [];
4282
4304
  if (B ? K.find((xe) => xe === $) : $ === R._f.ref)
4283
4305
  return;
4284
4306
  He(r, I, {
@@ -4480,7 +4502,7 @@ function oM(t = {}) {
4480
4502
  getFieldState: Y
4481
4503
  };
4482
4504
  }
4483
- function sM(t = {}) {
4505
+ function aM(t = {}) {
4484
4506
  const e = U.useRef(), n = U.useRef(), [r, i] = U.useState({
4485
4507
  isDirty: !1,
4486
4508
  isValidating: !1,
@@ -4498,7 +4520,7 @@ function sM(t = {}) {
4498
4520
  defaultValues: On(t.defaultValues) ? void 0 : t.defaultValues
4499
4521
  });
4500
4522
  e.current || (e.current = {
4501
- ...oM(t),
4523
+ ...sM(t),
4502
4524
  formState: r
4503
4525
  });
4504
4526
  const o = e.current.control;
@@ -4526,7 +4548,7 @@ function sM(t = {}) {
4526
4548
  });
4527
4549
  }, [t.shouldUnregister, o]), e.current.formState = Ux(r, o), e.current;
4528
4550
  }
4529
- const mg = (t, e, n) => {
4551
+ const gg = (t, e, n) => {
4530
4552
  if (t && "reportValidity" in t) {
4531
4553
  const r = ne(n, e);
4532
4554
  t.setCustomValidity(r && r.message || ""), t.reportValidity();
@@ -4534,21 +4556,21 @@ const mg = (t, e, n) => {
4534
4556
  }, s1 = (t, e) => {
4535
4557
  for (const n in e.fields) {
4536
4558
  const r = e.fields[n];
4537
- r && r.ref && "reportValidity" in r.ref ? mg(r.ref, n, t) : r.refs && r.refs.forEach((i) => mg(i, n, t));
4559
+ r && r.ref && "reportValidity" in r.ref ? gg(r.ref, n, t) : r.refs && r.refs.forEach((i) => gg(i, n, t));
4538
4560
  }
4539
- }, aM = (t, e) => {
4561
+ }, lM = (t, e) => {
4540
4562
  e.shouldUseNativeValidation && s1(t, e);
4541
4563
  const n = {};
4542
4564
  for (const r in t) {
4543
4565
  const i = ne(e.fields, r), o = Object.assign(t[r] || {}, { ref: i && i.ref });
4544
- if (lM(e.names || Object.keys(t), r)) {
4566
+ if (cM(e.names || Object.keys(t), r)) {
4545
4567
  const s = Object.assign({}, ne(n, r));
4546
4568
  He(s, "root", o), He(n, r, s);
4547
4569
  } else He(n, r, o);
4548
4570
  }
4549
4571
  return n;
4550
- }, lM = (t, e) => t.some((n) => n.startsWith(e + "."));
4551
- var cM = function(t, e) {
4572
+ }, cM = (t, e) => t.some((n) => n.startsWith(e + "."));
4573
+ var uM = function(t, e) {
4552
4574
  for (var n = {}; t.length; ) {
4553
4575
  var r = t[0], i = r.code, o = r.message, s = r.path.join(".");
4554
4576
  if (!n[s]) if ("unionErrors" in r) {
@@ -4566,7 +4588,7 @@ var cM = function(t, e) {
4566
4588
  t.shift();
4567
4589
  }
4568
4590
  return n;
4569
- }, uM = function(t, e, n) {
4591
+ }, dM = function(t, e, n) {
4570
4592
  return n === void 0 && (n = {}), function(r, i, o) {
4571
4593
  try {
4572
4594
  return Promise.resolve(function(s, a) {
@@ -4581,7 +4603,7 @@ var cM = function(t, e) {
4581
4603
  }(0, function(s) {
4582
4604
  if (function(a) {
4583
4605
  return Array.isArray(a == null ? void 0 : a.errors);
4584
- }(s)) return { values: {}, errors: aM(cM(s.errors, !o.shouldUseNativeValidation && o.criteriaMode === "all"), o) };
4606
+ }(s)) return { values: {}, errors: lM(uM(s.errors, !o.shouldUseNativeValidation && o.criteriaMode === "all"), o) };
4585
4607
  throw s;
4586
4608
  }));
4587
4609
  } catch (s) {
@@ -4589,16 +4611,16 @@ var cM = function(t, e) {
4589
4611
  }
4590
4612
  };
4591
4613
  };
4592
- const QZ = ({ schema: t, ...e }) => sM({
4614
+ const QZ = ({ schema: t, ...e }) => aM({
4593
4615
  ...e,
4594
- resolver: uM(t)
4595
- }), dM = (t, e) => {
4616
+ resolver: dM(t)
4617
+ }), fM = (t, e) => {
4596
4618
  let n;
4597
4619
  return function(...r) {
4598
4620
  clearTimeout(n), n = setTimeout(() => t(...r), e);
4599
4621
  };
4600
- }, fM = (t, e) => w.useMemo(() => dM(t, e), [e]), pM = (t, e) => {
4601
- const n = w.useRef(t), [r, i] = w.useState(t), o = fM(i, e);
4622
+ }, pM = (t, e) => w.useMemo(() => fM(t, e), [e]), hM = (t, e) => {
4623
+ const n = w.useRef(t), [r, i] = w.useState(t), o = pM(i, e);
4602
4624
  return w.useEffect(() => {
4603
4625
  n.current !== t && (o(t), n.current = t);
4604
4626
  }, [t]), r;
@@ -4609,29 +4631,7 @@ const QZ = ({ schema: t, ...e }) => sM({
4609
4631
  });
4610
4632
  },
4611
4633
  [t]
4612
- ), gg = () => !1, hM = () => {
4613
- const t = "(max-width: 1187px)", e = "(min-width: 1188px)", n = pe(
4614
- (s) => {
4615
- const a = globalThis.matchMedia(t);
4616
- return a.addEventListener("change", s), () => {
4617
- a.removeEventListener("change", s);
4618
- };
4619
- },
4620
- [t]
4621
- ), r = pe(
4622
- (s) => {
4623
- const a = globalThis.matchMedia(e);
4624
- return a.addEventListener("change", s), () => {
4625
- a.removeEventListener("change", s);
4626
- };
4627
- },
4628
- [e]
4629
- ), i = () => globalThis.matchMedia(t).matches, o = () => globalThis.matchMedia(e).matches;
4630
- return {
4631
- isMobile: Xd(n, i, gg),
4632
- isDesktop: Xd(r, o, gg)
4633
- };
4634
- }, a1 = ({
4634
+ ), a1 = ({
4635
4635
  triggerElement: t,
4636
4636
  children: e,
4637
4637
  delayDuration: n = 250,
@@ -4642,7 +4642,7 @@ const QZ = ({ schema: t, ...e }) => sM({
4642
4642
  classes: a,
4643
4643
  ...l
4644
4644
  }) => {
4645
- const [c, u] = w.useState(!1), d = w.useRef(null), { isMobile: f } = hM();
4645
+ const [c, u] = w.useState(!1), d = w.useRef(null), { isMobile: f } = HO();
4646
4646
  return Up(d, () => u(!1)), /* @__PURE__ */ C.jsx(BO, { children: /* @__PURE__ */ C.jsx(jO, { open: c, onOpenChange: u, defaultOpen: s, delayDuration: n, children: /* @__PURE__ */ C.jsxs("div", { onClick: () => u(!!f), children: [
4647
4647
  /* @__PURE__ */ C.jsx(GO, { asChild: !0, className: M("cursor-pointer", a == null ? void 0 : a.trigger), children: t }),
4648
4648
  /* @__PURE__ */ C.jsxs(
@@ -14395,7 +14395,7 @@ const XB = (t) => {
14395
14395
  return console.error(r), [];
14396
14396
  }
14397
14397
  }, JB = (t, e) => {
14398
- const [n, r] = w.useState(""), [i, o] = w.useState(null), s = pM(n, 300);
14398
+ const [n, r] = w.useState(""), [i, o] = w.useState(null), s = hM(n, 300);
14399
14399
  return w.useEffect(() => {
14400
14400
  s && (async () => {
14401
14401
  const l = await UB(s, t, e);
@@ -39232,12 +39232,13 @@ export {
39232
39232
  yU as SwitchControl,
39233
39233
  rU as TabsSwitcher,
39234
39234
  wU as TextareaControl,
39235
- dM as debounce,
39235
+ fM as debounce,
39236
39236
  Cu as useBoolean,
39237
39237
  Up as useClickOutside,
39238
39238
  eU as useCombineRef,
39239
39239
  QZ as useControlledForm,
39240
- fM as useDebounceCallback,
39241
- pM as useDebounceValue
39240
+ pM as useDebounceCallback,
39241
+ hM as useDebounceValue,
39242
+ HO as useDevice
39242
39243
  };
39243
39244
  //# sourceMappingURL=client.js.map