docthub-core-components 3.3.10 → 3.3.12

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,28 +1,28 @@
1
1
  "use client";
2
- import { jsx as c, jsxs as T, Fragment as $e } from "react/jsx-runtime";
3
- import { c as he } from "react-compiler-runtime";
4
- import { ChevronsUpDown as Pe, CheckIcon as Te } from "lucide-react";
5
- import * as R from "react";
2
+ import { jsx as a, jsxs as B, Fragment as De } from "react/jsx-runtime";
3
+ import { c as ge } from "react-compiler-runtime";
4
+ import { ChevronsUpDown as Te, CheckIcon as Ae } from "lucide-react";
5
+ import * as P from "react";
6
6
  import * as ke from "react-phone-number-input";
7
- import { isPossiblePhoneNumber as ut, isValidPhoneNumber as pt } from "react-phone-number-input";
8
- import Ae from "react-phone-number-input/flags";
9
- import { CommandInput as Be, CommandEmpty as Le, CommandList as Ve, CommandGroup as ze, Command as Ge, CommandItem as Ue } from "../../../ui/command.js";
10
- import { Input as qe } from "../../../ui/input.js";
11
- import { Label as Me } from "../../../ui/label.js";
12
- import { PopoverTrigger as Xe, PopoverContent as He, Popover as Je } from "../../../ui/popover.js";
7
+ import { isPossiblePhoneNumber as pt, isValidPhoneNumber as yt } from "react-phone-number-input";
8
+ import Be from "react-phone-number-input/flags";
9
+ import { CommandInput as Le, CommandEmpty as Ve, CommandList as ze, CommandGroup as Ge, Command as Ue, CommandItem as qe } from "../../../ui/command.js";
10
+ import { Input as Me } from "../../../ui/input.js";
11
+ import { Label as Xe } from "../../../ui/label.js";
12
+ import { PopoverTrigger as He, PopoverContent as Je, Popover as Ke } from "../../../ui/popover.js";
13
13
  import { cn as ee } from "../../../../lib/utils.js";
14
- import { DoctTypography as Se } from "../../../ui/typography.js";
15
- const Ke = /\D/g, te = (r) => r.replace(Ke, ""), _e = (r) => {
14
+ import { DoctTypography as _e } from "../../../ui/typography.js";
15
+ const Qe = /\D/g, te = (r) => r.replace(Qe, ""), Fe = (r) => {
16
16
  const e = r.match(/^\+\s*(\d+)\s*-\s*(\d*)\s*$/);
17
17
  return e ? {
18
18
  callingCode: e[1],
19
19
  national: e[2]
20
20
  } : null;
21
- }, De = (r) => {
21
+ }, je = (r) => {
22
22
  if (r == null) return "";
23
- const e = String(r).trim(), t = _e(e);
23
+ const e = String(r).trim(), t = Fe(e);
24
24
  return t ? t.national : te(e);
25
- }, U = (r) => {
25
+ }, q = (r) => {
26
26
  if (!r) return "91";
27
27
  if (typeof r == "object" && "countryCode" in r)
28
28
  return te(r.countryCode) || "91";
@@ -31,7 +31,7 @@ const Ke = /\D/g, te = (r) => r.replace(Ke, ""), _e = (r) => {
31
31
  } catch {
32
32
  return "91";
33
33
  }
34
- }, je = (r, e) => {
34
+ }, Oe = (r, e) => {
35
35
  if (r == null)
36
36
  return e && e.length > 0 ? e[0] : "IN";
37
37
  if (typeof r == "number" && (e != null && e.length)) {
@@ -43,163 +43,163 @@ const Ke = /\D/g, te = (r) => r.replace(Ke, ""), _e = (r) => {
43
43
  return e[r];
44
44
  }
45
45
  return r;
46
- }, Oe = (r, e) => {
46
+ }, Re = (r, e) => {
47
47
  if (!e) return r ? `+${te(r)}` : "";
48
- const t = U(e);
48
+ const t = q(e);
49
49
  return r ? `+${t}-${r}` : `+${t}`;
50
- }, Fe = (r, e) => e ? typeof r == "object" && "countryId" in r && typeof e == "object" && "countryId" in e ? r.countryId === e.countryId : r === e : !1, Ie = (r, e, t) => {
51
- const o = te(e), n = r.map((l) => l.value).filter((l) => !!l).filter((l) => U(l) === o);
50
+ }, $e = (r, e) => e ? typeof r == "object" && "countryId" in r && typeof e == "object" && "countryId" in e ? r.countryId === e.countryId : r === e : !1, Se = (r, e, t) => {
51
+ const o = te(e), n = r.map((l) => l.value).filter((l) => !!l).filter((l) => q(l) === o);
52
52
  if (n.length !== 0)
53
- return t && n.some((l) => Fe(l, t)) ? t : n[0];
53
+ return t && n.some((l) => $e(l, t)) ? t : n[0];
54
54
  }, Ee = (r) => {
55
- const e = he(5), {
55
+ const e = ge(5), {
56
56
  country: t,
57
57
  countryName: o
58
- } = r, n = Ae[t];
58
+ } = r, n = Be[t];
59
59
  let l;
60
- e[0] !== n || e[1] !== o ? (l = n && /* @__PURE__ */ c(n, { title: o }), e[0] = n, e[1] = o, e[2] = l) : l = e[2];
60
+ e[0] !== n || e[1] !== o ? (l = n && /* @__PURE__ */ a(n, { title: o }), e[0] = n, e[1] = o, e[2] = l) : l = e[2];
61
61
  let s;
62
- return e[3] !== l ? (s = /* @__PURE__ */ c("span", { className: "flex h-4 w-6 overflow-hidden rounded-sm bg-foreground/20 [&_svg:not([class*='size-'])]:size-full", children: l }), e[3] = l, e[4] = s) : s = e[4], s;
63
- }, Qe = (r) => {
64
- const e = he(48), {
62
+ return e[3] !== l ? (s = /* @__PURE__ */ a("span", { className: "flex h-4 w-6 overflow-hidden rounded-sm bg-foreground/20 [&_svg:not([class*='size-'])]:size-full", children: l }), e[3] = l, e[4] = s) : s = e[4], s;
63
+ }, We = (r) => {
64
+ const e = ge(48), {
65
65
  disabled: t,
66
66
  value: o,
67
67
  options: n,
68
68
  onChange: l,
69
69
  showFlagVariant: s,
70
- hasError: x,
71
- popoverAnchorRef: f
72
- } = r, C = R.useRef(null), [$, w] = R.useState(""), [h, m] = R.useState(!1);
73
- let y;
74
- e[0] !== o ? (y = o ? `+${U(o)}` : "+91", e[0] = o, e[1] = y) : y = e[1];
75
- const d = y;
76
- let a;
77
- e[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (F) => {
78
- m(F), F && w("");
79
- }, e[2] = a) : a = e[2];
80
- const g = x ? "border-destructive" : "border-gray-300", v = h && "bg-gray-100";
70
+ hasError: b,
71
+ popoverAnchorRef: m
72
+ } = r, v = P.useRef(null), [$, N] = P.useState(""), [g, x] = P.useState(!1);
73
+ let c;
74
+ e[0] !== o ? (c = o ? `+${q(o)}` : "+91", e[0] = o, e[1] = c) : c = e[1];
75
+ const y = c;
76
+ let i;
77
+ e[2] === Symbol.for("react.memo_cache_sentinel") ? (i = (S) => {
78
+ x(S), S && N("");
79
+ }, e[2] = i) : i = e[2];
80
+ const d = b ? "border-destructive" : "border-gray-300", C = g && "bg-gray-100";
81
81
  let I;
82
- e[3] !== g || e[4] !== v ? (I = ee("flex h-[40px] items-center gap-1.5 rounded-l-md rounded-r-none border-l-[1px] border-t-[1px] border-b-[1px] bg-white px-3 py-[1px] text-sm font-medium text-gray-900 transition-colors", g, "hover:bg-gray-100 focus:z-10 focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-50", v), e[3] = g, e[4] = v, e[5] = I) : I = e[5];
82
+ e[3] !== d || e[4] !== C ? (I = ee("flex h-[40px] items-center gap-1.5 rounded-l-md rounded-r-none border-l-[1px] border-t-[1px] border-b-[1px] bg-white px-3 py-[1px] text-sm font-medium text-gray-900 transition-colors", d, "hover:bg-gray-100 focus:z-10 focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-50", C), e[3] = d, e[4] = C, e[5] = I) : I = e[5];
83
+ let _;
84
+ e[6] !== o || e[7] !== s ? (_ = s && o && typeof o == "string" && /* @__PURE__ */ a("span", { className: "mr-1 flex items-center", children: /* @__PURE__ */ a(Ee, { country: o, countryName: o }) }), e[6] = o, e[7] = s, e[8] = _) : _ = e[8];
83
85
  let D;
84
- e[6] !== o || e[7] !== s ? (D = s && o && typeof o == "string" && /* @__PURE__ */ c("span", { className: "mr-1 flex items-center", children: /* @__PURE__ */ c(Ee, { country: o, countryName: o }) }), e[6] = o, e[7] = s, e[8] = D) : D = e[8];
85
- let j;
86
- e[9] !== d ? (j = /* @__PURE__ */ c(Se, { variant: "body2", weight: "regular", className: "text-gray-900", children: d }), e[9] = d, e[10] = j) : j = e[10];
87
- const b = t && "hidden";
88
- let V;
89
- e[11] !== b ? (V = ee("h-4 w-4 text-gray-500 shrink-0", b), e[11] = b, e[12] = V) : V = e[12];
86
+ e[9] !== y ? (D = /* @__PURE__ */ a(_e, { variant: "body2", weight: "regular", className: "text-gray-900", children: y }), e[9] = y, e[10] = D) : D = e[10];
87
+ const L = t && "hidden";
88
+ let u;
89
+ e[11] !== L ? (u = ee("h-4 w-4 text-gray-500 shrink-0", L), e[11] = L, e[12] = u) : u = e[12];
90
90
  let z;
91
- e[13] !== V ? (z = /* @__PURE__ */ c(Pe, { className: V }), e[13] = V, e[14] = z) : z = e[14];
92
- let S;
93
- e[15] !== t || e[16] !== z || e[17] !== I || e[18] !== D || e[19] !== j ? (S = /* @__PURE__ */ c(Xe, { asChild: !0, children: /* @__PURE__ */ T("button", { type: "button", disabled: t, className: I, children: [
91
+ e[13] !== u ? (z = /* @__PURE__ */ a(Te, { className: u }), e[13] = u, e[14] = z) : z = e[14];
92
+ let G;
93
+ e[15] !== t || e[16] !== z || e[17] !== I || e[18] !== _ || e[19] !== D ? (G = /* @__PURE__ */ a(He, { asChild: !0, children: /* @__PURE__ */ B("button", { type: "button", disabled: t, className: I, children: [
94
+ _,
94
95
  D,
95
- j,
96
96
  z
97
- ] }) }), e[15] = t, e[16] = z, e[17] = I, e[18] = D, e[19] = j, e[20] = S) : S = e[20];
98
- let q;
99
- e[21] === Symbol.for("react.memo_cache_sentinel") ? (q = {
97
+ ] }) }), e[15] = t, e[16] = z, e[17] = I, e[18] = _, e[19] = D, e[20] = G) : G = e[20];
98
+ let O;
99
+ e[21] === Symbol.for("react.memo_cache_sentinel") ? (O = {
100
100
  side: "flip",
101
101
  align: "shift",
102
102
  fallbackAxisSide: "none"
103
- }, e[21] = q) : q = e[21];
104
- let k;
105
- e[22] === Symbol.for("react.memo_cache_sentinel") ? (k = (F) => {
106
- w(F), window.setTimeout(() => {
107
- const L = C.current;
108
- L && (L.scrollTop = 0);
103
+ }, e[21] = O) : O = e[21];
104
+ let M;
105
+ e[22] === Symbol.for("react.memo_cache_sentinel") ? (M = (S) => {
106
+ N(S), window.setTimeout(() => {
107
+ const U = v.current;
108
+ U && (U.scrollTop = 0);
109
109
  }, 0);
110
- }, e[22] = k) : k = e[22];
111
- let _;
112
- e[23] !== $ ? (_ = /* @__PURE__ */ c("div", { className: "mb-3 h-[32px] rounded-full border border-gray-300 bg-white overflow-hidden [&_[cmdk-input-wrapper]]:h-full [&_[cmdk-input-wrapper]]:px-3 [&_[cmdk-input-wrapper]_svg]:text-gray-500", children: /* @__PURE__ */ c(Be, { value: $, onValueChange: k, placeholder: "Search country..." }) }), e[23] = $, e[24] = _) : _ = e[24];
113
- let A, G;
114
- e[25] === Symbol.for("react.memo_cache_sentinel") ? (A = {
110
+ }, e[22] = M) : M = e[22];
111
+ let F;
112
+ e[23] !== $ ? (F = /* @__PURE__ */ a("div", { className: "mb-3 h-[32px] rounded-full border border-gray-300 bg-white overflow-hidden [&_[cmdk-input-wrapper]]:h-full [&_[cmdk-input-wrapper]]:px-3 [&_[cmdk-input-wrapper]_svg]:text-gray-500", children: /* @__PURE__ */ a(Le, { value: $, onValueChange: M, placeholder: "Search country..." }) }), e[23] = $, e[24] = F) : F = e[24];
113
+ let R, V;
114
+ e[25] === Symbol.for("react.memo_cache_sentinel") ? (R = {
115
115
  msOverflowStyle: "none"
116
- }, G = /* @__PURE__ */ c(Le, { children: "No country found." }), e[25] = A, e[26] = G) : (A = e[25], G = e[26]);
117
- let O;
116
+ }, V = /* @__PURE__ */ a(Ve, { children: "No country found." }), e[25] = R, e[26] = V) : (R = e[25], V = e[26]);
117
+ let T;
118
118
  if (e[27] !== n || e[28] !== l || e[29] !== o || e[30] !== s) {
119
- let F;
120
- e[32] !== l || e[33] !== o || e[34] !== s ? (F = (L) => {
119
+ let S;
120
+ e[32] !== l || e[33] !== o || e[34] !== s ? (S = (U) => {
121
121
  const {
122
- value: i,
123
- label: M,
122
+ value: E,
123
+ label: f,
124
124
  countryCode: X
125
- } = L;
126
- return i ? /* @__PURE__ */ c(We, { country: i, countryName: M, countryCode: X, selectedCountry: o, onChange: l, onSelectComplete: () => m(!1), showFlagVariant: s }, typeof i == "object" && "countryId" in i ? i.countryId : i) : null;
127
- }, e[32] = l, e[33] = o, e[34] = s, e[35] = F) : F = e[35], O = n.map(F), e[27] = n, e[28] = l, e[29] = o, e[30] = s, e[31] = O;
125
+ } = U;
126
+ return E ? /* @__PURE__ */ a(Ye, { country: E, countryName: f, countryCode: X, selectedCountry: o, onChange: l, onSelectComplete: () => x(!1), showFlagVariant: s }, typeof E == "object" && "countryId" in E ? E.countryId : E) : null;
127
+ }, e[32] = l, e[33] = o, e[34] = s, e[35] = S) : S = e[35], T = n.map(S), e[27] = n, e[28] = l, e[29] = o, e[30] = s, e[31] = T;
128
128
  } else
129
- O = e[31];
130
- let P;
131
- e[36] !== O ? (P = /* @__PURE__ */ c(Ve, { children: /* @__PURE__ */ T("div", { ref: C, className: "max-h-[min(288px,calc(100vh-12rem))] overflow-y-auto -mx-1 px-1 [&::-webkit-scrollbar]:hidden [scrollbar-width:none]", style: A, children: [
129
+ T = e[31];
130
+ let j;
131
+ e[36] !== T ? (j = /* @__PURE__ */ a(ze, { children: /* @__PURE__ */ B("div", { ref: v, className: "max-h-[min(288px,calc(100vh-12rem))] overflow-y-auto -mx-1 px-1 [&::-webkit-scrollbar]:hidden [scrollbar-width:none]", style: R, children: [
132
+ V,
133
+ /* @__PURE__ */ a(Ge, { children: T })
134
+ ] }) }), e[36] = T, e[37] = j) : j = e[37];
135
+ let A;
136
+ e[38] !== F || e[39] !== j ? (A = /* @__PURE__ */ B(Ue, { children: [
137
+ F,
138
+ j
139
+ ] }), e[38] = F, e[39] = j, e[40] = A) : A = e[40];
140
+ let k;
141
+ e[41] !== m || e[42] !== A ? (k = /* @__PURE__ */ a(Je, { anchor: m, side: "bottom", sideOffset: 6, collisionAvoidance: O, className: "w-[min(var(--anchor-width),calc(100vw-1rem))] max-w-[var(--available-width)] min-w-0 p-1 shadow-md border border-gray-300 rounded-md", align: "start", children: A }), e[41] = m, e[42] = A, e[43] = k) : k = e[43];
142
+ let h;
143
+ return e[44] !== g || e[45] !== G || e[46] !== k ? (h = /* @__PURE__ */ B(Ke, { open: g, modal: !0, onOpenChange: i, children: [
132
144
  G,
133
- /* @__PURE__ */ c(ze, { children: O })
134
- ] }) }), e[36] = O, e[37] = P) : P = e[37];
135
- let E;
136
- e[38] !== _ || e[39] !== P ? (E = /* @__PURE__ */ T(Ge, { children: [
137
- _,
138
- P
139
- ] }), e[38] = _, e[39] = P, e[40] = E) : E = e[40];
140
- let u;
141
- e[41] !== f || e[42] !== E ? (u = /* @__PURE__ */ c(He, { anchor: f, side: "bottom", sideOffset: 6, collisionAvoidance: q, className: "w-[min(var(--anchor-width),calc(100vw-1rem))] max-w-[var(--available-width)] min-w-0 p-1 shadow-md border border-gray-300 rounded-md", align: "start", children: E }), e[41] = f, e[42] = E, e[43] = u) : u = e[43];
142
- let B;
143
- return e[44] !== h || e[45] !== S || e[46] !== u ? (B = /* @__PURE__ */ T(Je, { open: h, modal: !0, onOpenChange: a, children: [
144
- S,
145
- u
146
- ] }), e[44] = h, e[45] = S, e[46] = u, e[47] = B) : B = e[47], B;
147
- }, We = (r) => {
148
- const e = he(21), {
145
+ k
146
+ ] }), e[44] = g, e[45] = G, e[46] = k, e[47] = h) : h = e[47], h;
147
+ }, Ye = (r) => {
148
+ const e = ge(21), {
149
149
  country: t,
150
150
  countryName: o,
151
151
  countryCode: n,
152
152
  selectedCountry: l,
153
153
  onChange: s,
154
- onSelectComplete: x,
155
- showFlagVariant: f
154
+ onSelectComplete: b,
155
+ showFlagVariant: m
156
156
  } = r;
157
- let C;
158
- e[0] !== t || e[1] !== s || e[2] !== x ? (C = () => {
159
- s(t), x();
160
- }, e[0] = t, e[1] = s, e[2] = x, e[3] = C) : C = e[3];
161
- const $ = C;
162
- let w;
157
+ let v;
158
+ e[0] !== t || e[1] !== s || e[2] !== b ? (v = () => {
159
+ s(t), b();
160
+ }, e[0] = t, e[1] = s, e[2] = b, e[3] = v) : v = e[3];
161
+ const $ = v;
162
+ let N;
163
163
  e: {
164
164
  if (!l) {
165
- w = !1;
165
+ N = !1;
166
166
  break e;
167
167
  }
168
168
  if (typeof t == "object" && "countryId" in t && typeof l == "object" && "countryId" in l) {
169
- w = t.countryId === l.countryId;
169
+ N = t.countryId === l.countryId;
170
170
  break e;
171
171
  }
172
- w = t === l;
172
+ N = t === l;
173
173
  }
174
- const h = w, m = typeof t == "object" && "countryId" in t ? `${t.countryName} ${t.countryCode}` : `${o} ${n}`;
174
+ const g = N, x = typeof t == "object" && "countryId" in t ? `${t.countryName} ${t.countryCode}` : `${o} ${n}`;
175
+ let c;
176
+ e[4] === Symbol.for("react.memo_cache_sentinel") ? (c = ee("flex items-center gap-3 px-3 py-2.5 text-sm cursor-pointer transition-colors", "data-[selected=true]:bg-[#F5F5F5] data-[selected=true]:text-gray-900", "hover:bg-[#F5F5F5]"), e[4] = c) : c = e[4];
175
177
  let y;
176
- e[4] === Symbol.for("react.memo_cache_sentinel") ? (y = ee("flex items-center gap-3 px-3 py-2.5 text-sm cursor-pointer transition-colors", "data-[selected=true]:bg-[#F5F5F5] data-[selected=true]:text-gray-900", "hover:bg-[#F5F5F5]"), e[4] = y) : y = e[4];
178
+ e[5] !== t || e[6] !== o || e[7] !== m ? (y = m && typeof t == "string" && /* @__PURE__ */ a("span", { className: "flex items-center", children: /* @__PURE__ */ a(Ee, { country: t, countryName: o }) }), e[5] = t, e[6] = o, e[7] = m, e[8] = y) : y = e[8];
179
+ let i;
180
+ e[9] !== n || e[10] !== o || e[11] !== m ? (i = m ? /* @__PURE__ */ B(De, { children: [
181
+ /* @__PURE__ */ a("span", { className: "flex-1 text-sm font-normal text-gray-700", children: o }),
182
+ /* @__PURE__ */ a(_e, { variant: "body2", weight: "regular", className: "text-gray-900 min-w-[50px] text-right", children: n })
183
+ ] }) : /* @__PURE__ */ B(De, { children: [
184
+ /* @__PURE__ */ a(_e, { variant: "body2", weight: "regular", className: "text-gray-900 min-w-[50px]", children: n }),
185
+ /* @__PURE__ */ a("span", { className: "flex-1 text-sm font-normal text-gray-700", children: o })
186
+ ] }), e[9] = n, e[10] = o, e[11] = m, e[12] = i) : i = e[12];
177
187
  let d;
178
- e[5] !== t || e[6] !== o || e[7] !== f ? (d = f && typeof t == "string" && /* @__PURE__ */ c("span", { className: "flex items-center", children: /* @__PURE__ */ c(Ee, { country: t, countryName: o }) }), e[5] = t, e[6] = o, e[7] = f, e[8] = d) : d = e[8];
179
- let a;
180
- e[9] !== n || e[10] !== o || e[11] !== f ? (a = f ? /* @__PURE__ */ T($e, { children: [
181
- /* @__PURE__ */ c("span", { className: "flex-1 text-sm font-normal text-gray-700", children: o }),
182
- /* @__PURE__ */ c(Se, { variant: "body2", weight: "regular", className: "text-gray-900 min-w-[50px] text-right", children: n })
183
- ] }) : /* @__PURE__ */ T($e, { children: [
184
- /* @__PURE__ */ c(Se, { variant: "body2", weight: "regular", className: "text-gray-900 min-w-[50px]", children: n }),
185
- /* @__PURE__ */ c("span", { className: "flex-1 text-sm font-normal text-gray-700", children: o })
186
- ] }), e[9] = n, e[10] = o, e[11] = f, e[12] = a) : a = e[12];
187
- let g;
188
- e[13] !== h ? (g = h && /* @__PURE__ */ c(Te, { className: "ml-auto h-4 w-4 text-gray-900 shrink-0" }), e[13] = h, e[14] = g) : g = e[14];
189
- let v;
190
- return e[15] !== $ || e[16] !== m || e[17] !== d || e[18] !== a || e[19] !== g ? (v = /* @__PURE__ */ T(Ue, { value: m, className: y, onSelect: $, children: [
191
- d,
192
- a,
193
- g
194
- ] }), e[15] = $, e[16] = m, e[17] = d, e[18] = a, e[19] = g, e[20] = v) : v = e[20], v;
195
- }, Ye = ke.getCountries(), Ze = (r) => {
188
+ e[13] !== g ? (d = g && /* @__PURE__ */ a(Ae, { className: "ml-auto h-4 w-4 text-gray-900 shrink-0" }), e[13] = g, e[14] = d) : d = e[14];
189
+ let C;
190
+ return e[15] !== $ || e[16] !== x || e[17] !== y || e[18] !== i || e[19] !== d ? (C = /* @__PURE__ */ B(qe, { value: x, className: c, onSelect: $, children: [
191
+ y,
192
+ i,
193
+ d
194
+ ] }), e[15] = $, e[16] = x, e[17] = y, e[18] = i, e[19] = d, e[20] = C) : C = e[20], C;
195
+ }, Ze = ke.getCountries(), et = (r) => {
196
196
  if (!r || r.length === 0)
197
- return Ye.map((t) => ({
197
+ return Ze.map((t) => ({
198
198
  value: t,
199
199
  label: new Intl.DisplayNames(["en"], {
200
200
  type: "region"
201
201
  }).of(t) ?? t,
202
- countryCode: `+${U(t)}`
202
+ countryCode: `+${q(t)}`
203
203
  }));
204
204
  const e = r[0];
205
205
  return e && typeof e == "object" && "countryId" in e ? r.map((t) => ({
@@ -211,139 +211,140 @@ const Ke = /\D/g, te = (r) => r.replace(Ke, ""), _e = (r) => {
211
211
  label: new Intl.DisplayNames(["en"], {
212
212
  type: "region"
213
213
  }).of(t) ?? t,
214
- countryCode: `+${U(t)}`
214
+ countryCode: `+${q(t)}`
215
215
  }));
216
216
  };
217
- function dt(r) {
218
- const e = he(108);
219
- let t, o, n, l, s, x, f, C, $, w, h, m, y, d, a, g, v, I, D, j;
217
+ function ft(r) {
218
+ const e = ge(110);
219
+ let t, o, n, l, s, b, m, v, $, N, g, x, c, y, i, d, C, I, _, D, L;
220
220
  e[0] !== r ? ({
221
- label: w,
222
- helperText: C,
223
- error: f,
224
- required: v,
221
+ label: g,
222
+ helperText: v,
223
+ error: m,
224
+ required: I,
225
225
  className: o,
226
226
  "aria-describedby": t,
227
227
  id: $,
228
228
  value: D,
229
229
  onPhoneChange: y,
230
230
  countryCode: l,
231
- onCountryCodeChange: m,
232
- onValuesChange: a,
233
- onCountryChange: h,
234
- onValueChange: d,
231
+ onCountryCodeChange: c,
232
+ onValuesChange: d,
233
+ onCountryChange: x,
234
+ onValueChange: i,
235
235
  countries: n,
236
236
  defaultCountry: s,
237
- variant: j,
238
- disabled: x,
239
- placeholder: g,
240
- ...I
241
- } = r, e[0] = r, e[1] = t, e[2] = o, e[3] = n, e[4] = l, e[5] = s, e[6] = x, e[7] = f, e[8] = C, e[9] = $, e[10] = w, e[11] = h, e[12] = m, e[13] = y, e[14] = d, e[15] = a, e[16] = g, e[17] = v, e[18] = I, e[19] = D, e[20] = j) : (t = e[1], o = e[2], n = e[3], l = e[4], s = e[5], x = e[6], f = e[7], C = e[8], $ = e[9], w = e[10], h = e[11], m = e[12], y = e[13], d = e[14], a = e[15], g = e[16], v = e[17], I = e[18], D = e[19], j = e[20]);
242
- const b = D === void 0 ? "" : D, V = j === void 0 ? "default" : j, z = R.useId(), S = R.useId(), q = R.useRef(null), k = $ ?? z, _ = !!(C || f);
243
- let A;
244
- e[21] !== t || e[22] !== _ || e[23] !== S ? (A = [t, _ ? S : void 0].filter(Boolean).join(" ") || void 0, e[21] = t, e[22] = _, e[23] = S, e[24] = A) : A = e[24];
245
- const G = A, O = !!f, P = V === "flag";
246
- let E;
247
- e[25] !== n ? (E = Ze(n), e[25] = n, e[26] = E) : E = e[26];
248
- const u = E;
249
- let B;
250
- e[27] !== n || e[28] !== u || e[29] !== s || e[30] !== b ? (B = () => {
251
- const p = _e(String(b ?? "").trim());
237
+ variant: L,
238
+ disabled: b,
239
+ placeholder: C,
240
+ inputRef: N,
241
+ ..._
242
+ } = r, e[0] = r, e[1] = t, e[2] = o, e[3] = n, e[4] = l, e[5] = s, e[6] = b, e[7] = m, e[8] = v, e[9] = $, e[10] = N, e[11] = g, e[12] = x, e[13] = c, e[14] = y, e[15] = i, e[16] = d, e[17] = C, e[18] = I, e[19] = _, e[20] = D, e[21] = L) : (t = e[1], o = e[2], n = e[3], l = e[4], s = e[5], b = e[6], m = e[7], v = e[8], $ = e[9], N = e[10], g = e[11], x = e[12], c = e[13], y = e[14], i = e[15], d = e[16], C = e[17], I = e[18], _ = e[19], D = e[20], L = e[21]);
243
+ const u = D === void 0 ? "" : D, z = L === void 0 ? "default" : L, G = P.useId(), O = P.useId(), M = P.useRef(null), F = $ ?? G, R = !!(v || m);
244
+ let V;
245
+ e[22] !== t || e[23] !== R || e[24] !== O ? (V = [t, R ? O : void 0].filter(Boolean).join(" ") || void 0, e[22] = t, e[23] = R, e[24] = O, e[25] = V) : V = e[25];
246
+ const T = V, j = !!m, A = z === "flag";
247
+ let k;
248
+ e[26] !== n ? (k = et(n), e[26] = n, e[27] = k) : k = e[27];
249
+ const h = k;
250
+ let S;
251
+ e[28] !== n || e[29] !== h || e[30] !== s || e[31] !== u ? (S = () => {
252
+ const p = Fe(String(u ?? "").trim());
252
253
  if (p) {
253
- const N = Ie(u, p.callingCode, void 0);
254
- if (N)
255
- return N;
254
+ const w = Se(h, p.callingCode, void 0);
255
+ if (w)
256
+ return w;
256
257
  }
257
- return je(s, n);
258
- }, e[27] = n, e[28] = u, e[29] = s, e[30] = b, e[31] = B) : B = e[31];
259
- const F = B;
260
- let L;
261
- e[32] !== F ? (L = () => F(), e[32] = F, e[33] = L) : L = e[33];
262
- const [i, M] = R.useState(L);
263
- let X, re;
264
- e[34] !== n || e[35] !== s ? (X = () => {
258
+ return Oe(s, n);
259
+ }, e[28] = n, e[29] = h, e[30] = s, e[31] = u, e[32] = S) : S = e[32];
260
+ const U = S;
261
+ let E;
262
+ e[33] !== U ? (E = () => U(), e[33] = U, e[34] = E) : E = e[34];
263
+ const [f, X] = P.useState(E);
264
+ let re, oe;
265
+ e[35] !== n || e[36] !== s ? (re = () => {
265
266
  if (s != null) {
266
- const p = je(s, n);
267
- p && M(p);
267
+ const p = Oe(s, n);
268
+ p && X(p);
268
269
  }
269
- }, re = [s, n], e[34] = n, e[35] = s, e[36] = X, e[37] = re) : (X = e[36], re = e[37]), R.useEffect(X, re);
270
- const oe = l !== void 0;
271
- let le, ne;
272
- e[38] !== m || e[39] !== i ? (ne = () => {
273
- if (!i)
270
+ }, oe = [s, n], e[35] = n, e[36] = s, e[37] = re, e[38] = oe) : (re = e[37], oe = e[38]), P.useEffect(re, oe);
271
+ const le = l !== void 0;
272
+ let ne, se;
273
+ e[39] !== c || e[40] !== f ? (se = () => {
274
+ if (!f)
274
275
  return;
275
- const p = U(i);
276
- m == null || m(p);
277
- }, le = [i, m], e[38] = m, e[39] = i, e[40] = le, e[41] = ne) : (le = e[40], ne = e[41]), R.useEffect(ne, le);
278
- let se, ie;
279
- e[42] !== l || e[43] !== u || e[44] !== oe || e[45] !== i ? (se = () => {
280
- if (!oe)
276
+ const p = q(f);
277
+ c == null || c(p);
278
+ }, ne = [f, c], e[39] = c, e[40] = f, e[41] = ne, e[42] = se) : (ne = e[41], se = e[42]), P.useEffect(se, ne);
279
+ let ie, ae;
280
+ e[43] !== l || e[44] !== h || e[45] !== le || e[46] !== f ? (ie = () => {
281
+ if (!le)
281
282
  return;
282
283
  const p = te(String(l ?? ""));
283
284
  if (p === "")
284
285
  return;
285
- const N = Ie(u, p, i);
286
- N && !Fe(N, i) && M(N);
287
- }, ie = [l, u, oe, i], e[42] = l, e[43] = u, e[44] = oe, e[45] = i, e[46] = se, e[47] = ie) : (se = e[46], ie = e[47]), R.useEffect(se, ie);
288
- let ae, ce;
289
- e[48] !== u || e[49] !== i || e[50] !== b ? (ae = () => {
290
- const p = _e(String(b ?? "").trim());
286
+ const w = Se(h, p, f);
287
+ w && !$e(w, f) && X(w);
288
+ }, ae = [l, h, le, f], e[43] = l, e[44] = h, e[45] = le, e[46] = f, e[47] = ie, e[48] = ae) : (ie = e[47], ae = e[48]), P.useEffect(ie, ae);
289
+ let ce, de;
290
+ e[49] !== h || e[50] !== f || e[51] !== u ? (ce = () => {
291
+ const p = Fe(String(u ?? "").trim());
291
292
  if (!p)
292
293
  return;
293
- const N = Ie(u, p.callingCode, i);
294
- N && !Fe(N, i) && M(N);
295
- }, ce = [b, u, i], e[48] = u, e[49] = i, e[50] = b, e[51] = ae, e[52] = ce) : (ae = e[51], ce = e[52]), R.useEffect(ae, ce);
296
- let de;
297
- e[53] !== b ? (de = De(b), e[53] = b, e[54] = de) : de = e[54];
298
- const fe = de;
299
- let me;
300
- e[55] !== fe || e[56] !== h || e[57] !== m || e[58] !== d || e[59] !== a ? (me = (p) => {
301
- M(p);
302
- const N = U(p);
303
- m == null || m(N), h == null || h(p), a == null || a([N, fe]), d == null || d(Oe(fe, p));
304
- }, e[55] = fe, e[56] = h, e[57] = m, e[58] = d, e[59] = a, e[60] = me) : me = e[60];
305
- const ge = me;
294
+ const w = Se(h, p.callingCode, f);
295
+ w && !$e(w, f) && X(w);
296
+ }, de = [u, h, f], e[49] = h, e[50] = f, e[51] = u, e[52] = ce, e[53] = de) : (ce = e[52], de = e[53]), P.useEffect(ce, de);
297
+ let fe;
298
+ e[54] !== u ? (fe = je(u), e[54] = u, e[55] = fe) : fe = e[55];
299
+ const me = fe;
306
300
  let ue;
307
- e[61] !== l || e[62] !== y || e[63] !== d || e[64] !== a || e[65] !== i ? (ue = (p) => {
308
- const N = p.target.value, Ne = te(N);
309
- y == null || y(Ne);
310
- const Re = l ?? U(i);
311
- a == null || a([Re, Ne]), d == null || d(Oe(Ne, i));
312
- }, e[61] = l, e[62] = y, e[63] = d, e[64] = a, e[65] = i, e[66] = ue) : ue = e[66];
301
+ e[56] !== me || e[57] !== x || e[58] !== c || e[59] !== i || e[60] !== d ? (ue = (p) => {
302
+ X(p);
303
+ const w = q(p);
304
+ c == null || c(w), x == null || x(p), d == null || d([w, me]), i == null || i(Re(me, p));
305
+ }, e[56] = me, e[57] = x, e[58] = c, e[59] = i, e[60] = d, e[61] = ue) : ue = e[61];
313
306
  const be = ue;
314
307
  let pe;
315
- e[67] !== b ? (pe = De(b), e[67] = b, e[68] = pe) : pe = e[68];
308
+ e[62] !== l || e[63] !== y || e[64] !== i || e[65] !== d || e[66] !== f ? (pe = (p) => {
309
+ const w = p.target.value, Ie = te(w);
310
+ y == null || y(Ie);
311
+ const Pe = l ?? q(f);
312
+ d == null || d([Pe, Ie]), i == null || i(Re(Ie, f));
313
+ }, e[62] = l, e[63] = y, e[64] = i, e[65] = d, e[66] = f, e[67] = pe) : pe = e[67];
316
314
  const ve = pe;
315
+ let ye;
316
+ e[68] !== u ? (ye = je(u), e[68] = u, e[69] = ye) : ye = e[69];
317
+ const xe = ye;
317
318
  let H;
318
- e[69] !== o ? (H = ee("space-y-1", o), e[69] = o, e[70] = H) : H = e[70];
319
+ e[70] !== o ? (H = ee("space-y-1", o), e[70] = o, e[71] = H) : H = e[71];
319
320
  let J;
320
- e[71] !== w || e[72] !== v || e[73] !== k ? (J = w && /* @__PURE__ */ T(Me, { htmlFor: k, className: "text-sm font-medium text-foreground", children: [
321
- w,
322
- v && /* @__PURE__ */ c("span", { className: "ml-1 text-destructive", "aria-hidden": "true", children: "*" })
323
- ] }), e[71] = w, e[72] = v, e[73] = k, e[74] = J) : J = e[74];
321
+ e[72] !== g || e[73] !== I || e[74] !== F ? (J = g && /* @__PURE__ */ B(Xe, { htmlFor: F, className: "text-sm font-medium text-foreground", children: [
322
+ g,
323
+ I && /* @__PURE__ */ a("span", { className: "ml-1 text-destructive", "aria-hidden": "true", children: "*" })
324
+ ] }), e[72] = g, e[73] = I, e[74] = F, e[75] = J) : J = e[75];
324
325
  let K;
325
- e[75] !== u || e[76] !== x || e[77] !== ge || e[78] !== O || e[79] !== i || e[80] !== P ? (K = /* @__PURE__ */ c(Qe, { disabled: x, value: i, options: u, onChange: ge, showFlagVariant: P, hasError: O, popoverAnchorRef: q }), e[75] = u, e[76] = x, e[77] = ge, e[78] = O, e[79] = i, e[80] = P, e[81] = K) : K = e[81];
326
- const xe = v || void 0, Ce = O || void 0, we = O ? "border-destructive" : "border-gray-300";
326
+ e[76] !== h || e[77] !== b || e[78] !== be || e[79] !== j || e[80] !== f || e[81] !== A ? (K = /* @__PURE__ */ a(We, { disabled: b, value: f, options: h, onChange: be, showFlagVariant: A, hasError: j, popoverAnchorRef: M }), e[76] = h, e[77] = b, e[78] = be, e[79] = j, e[80] = f, e[81] = A, e[82] = K) : K = e[82];
327
+ const Ce = I || void 0, we = j || void 0, Ne = j ? "border-destructive" : "border-gray-300";
327
328
  let Q;
328
- e[82] !== we ? (Q = ee("h-[40px] rounded-r-md rounded-l-none border-t-[1px] border-b-[1px] border-l-[1px] bg-white px-3 py-[1px] text-sm", we), e[82] = we, e[83] = Q) : Q = e[83];
329
+ e[83] !== Ne ? (Q = ee("h-[40px] rounded-r-md rounded-l-none border-t-[1px] border-b-[1px] border-l-[1px] bg-white px-3 py-[1px] text-sm", Ne), e[83] = Ne, e[84] = Q) : Q = e[84];
329
330
  let W;
330
- e[84] !== G || e[85] !== x || e[86] !== be || e[87] !== ve || e[88] !== g || e[89] !== k || e[90] !== I || e[91] !== xe || e[92] !== Ce || e[93] !== Q ? (W = /* @__PURE__ */ c(qe, { ...I, ref: void 0, id: k, type: "text", inputMode: "numeric", value: ve, onChange: be, disabled: x, placeholder: g, "aria-required": xe, "aria-invalid": Ce, "aria-describedby": G, className: Q }), e[84] = G, e[85] = x, e[86] = be, e[87] = ve, e[88] = g, e[89] = k, e[90] = I, e[91] = xe, e[92] = Ce, e[93] = Q, e[94] = W) : W = e[94];
331
+ e[85] !== T || e[86] !== b || e[87] !== ve || e[88] !== N || e[89] !== xe || e[90] !== C || e[91] !== F || e[92] !== _ || e[93] !== Ce || e[94] !== we || e[95] !== Q ? (W = /* @__PURE__ */ a(Me, { ..._, ref: N, id: F, type: "text", inputMode: "numeric", value: xe, onChange: ve, disabled: b, placeholder: C, "aria-required": Ce, "aria-invalid": we, "aria-describedby": T, className: Q }), e[85] = T, e[86] = b, e[87] = ve, e[88] = N, e[89] = xe, e[90] = C, e[91] = F, e[92] = _, e[93] = Ce, e[94] = we, e[95] = Q, e[96] = W) : W = e[96];
331
332
  let Y;
332
- e[95] !== K || e[96] !== W ? (Y = /* @__PURE__ */ T("div", { ref: q, className: "flex w-full min-w-0 items-center", children: [
333
+ e[97] !== K || e[98] !== W ? (Y = /* @__PURE__ */ B("div", { ref: M, className: "flex w-full min-w-0 items-center", children: [
333
334
  K,
334
335
  W
335
- ] }), e[95] = K, e[96] = W, e[97] = Y) : Y = e[97];
336
+ ] }), e[97] = K, e[98] = W, e[99] = Y) : Y = e[99];
336
337
  let Z;
337
- e[98] !== f || e[99] !== _ || e[100] !== S || e[101] !== C ? (Z = _ && /* @__PURE__ */ c("p", { id: S, className: ee("text-xs", f ? "text-destructive" : "text-muted-foreground"), role: f ? "alert" : void 0, children: f || C }), e[98] = f, e[99] = _, e[100] = S, e[101] = C, e[102] = Z) : Z = e[102];
338
- let ye;
339
- return e[103] !== H || e[104] !== J || e[105] !== Y || e[106] !== Z ? (ye = /* @__PURE__ */ T("div", { className: H, children: [
338
+ e[100] !== m || e[101] !== R || e[102] !== O || e[103] !== v ? (Z = R && /* @__PURE__ */ a("p", { id: O, className: ee("text-xs", m ? "text-destructive" : "text-muted-foreground"), role: m ? "alert" : void 0, children: m || v }), e[100] = m, e[101] = R, e[102] = O, e[103] = v, e[104] = Z) : Z = e[104];
339
+ let he;
340
+ return e[105] !== H || e[106] !== J || e[107] !== Y || e[108] !== Z ? (he = /* @__PURE__ */ B("div", { className: H, children: [
340
341
  J,
341
342
  Y,
342
343
  Z
343
- ] }), e[103] = H, e[104] = J, e[105] = Y, e[106] = Z, e[107] = ye) : ye = e[107], ye;
344
+ ] }), e[105] = H, e[106] = J, e[107] = Y, e[108] = Z, e[109] = he) : he = e[109], he;
344
345
  }
345
346
  export {
346
- dt as DoctPhoneInput,
347
- ut as isPossiblePhoneNumber,
348
- pt as isValidPhoneNumber
347
+ ft as DoctPhoneInput,
348
+ pt as isPossiblePhoneNumber,
349
+ yt as isValidPhoneNumber
349
350
  };