@mci-ui/mci-ui 0.0.78 → 0.0.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +261 -2
  2. package/dist/index.css +1 -1
  3. package/dist/index.es.js +1880 -1808
  4. package/dist/index.umd.js +2 -2
  5. package/dist/types/index.d.ts +1 -0
  6. package/dist/types/shared/types/mci-ui.types.d.ts +1 -0
  7. package/dist/types/shared/types/ui/breadcrumb.types.d.ts +13 -0
  8. package/dist/types/shared/types/ui/button.types.d.ts +15 -0
  9. package/dist/types/shared/types/ui/check.types.d.ts +15 -0
  10. package/dist/types/shared/types/ui/collapse.types.d.ts +9 -0
  11. package/dist/types/shared/types/ui/drawer.types.d.ts +16 -0
  12. package/dist/types/shared/types/ui/identity-input.types.d.ts +6 -0
  13. package/dist/types/shared/types/ui/index.d.ts +21 -0
  14. package/dist/types/shared/types/ui/input.types.d.ts +25 -0
  15. package/dist/types/shared/types/ui/loader.types.d.ts +8 -0
  16. package/dist/types/shared/types/ui/modal.types.d.ts +17 -0
  17. package/dist/types/shared/types/ui/pagination.types.d.ts +13 -0
  18. package/dist/types/shared/types/ui/phone.types.d.ts +15 -0
  19. package/dist/types/shared/types/ui/picker.types.d.ts +24 -0
  20. package/dist/types/shared/types/ui/select.types.d.ts +25 -0
  21. package/dist/types/shared/types/ui/skeleton.types.d.ts +6 -0
  22. package/dist/types/shared/types/ui/tabs.types.d.ts +18 -0
  23. package/dist/types/shared/types/ui/tag.types.d.ts +10 -0
  24. package/dist/types/shared/types/ui/textarea.types.d.ts +12 -0
  25. package/dist/types/shared/types/ui/toast.types.d.ts +10 -0
  26. package/dist/types/shared/types/ui/toggle.types.d.ts +9 -0
  27. package/dist/types/shared/types/ui/tooltip.types.d.ts +8 -0
  28. package/dist/types/shared/types/ui/upload.types.d.ts +27 -0
  29. package/dist/types/shared/ui/MciModal/MciModal.d.ts +1 -18
  30. package/dist/types/shared/ui/mciBreadcrumb/MciBreadcrumb.d.ts +1 -14
  31. package/dist/types/shared/ui/mciButton/MciButton.d.ts +1 -16
  32. package/dist/types/shared/ui/mciCheck/MciCheck.d.ts +1 -14
  33. package/dist/types/shared/ui/mciCollapse/MciCollapse.d.ts +1 -10
  34. package/dist/types/shared/ui/mciDrawer/MciDrawer.d.ts +1 -17
  35. package/dist/types/shared/ui/mciIdentityInput/MciIdentityInput.d.ts +3 -8
  36. package/dist/types/shared/ui/mciIdentityInput/mci-identity-input.utils.d.ts +9 -0
  37. package/dist/types/shared/ui/mciInput/MciInput.d.ts +1 -24
  38. package/dist/types/shared/ui/mciInput/mci-input.utils.d.ts +19 -0
  39. package/dist/types/shared/ui/mciLoader/MciLoader.d.ts +1 -9
  40. package/dist/types/shared/ui/mciPagination/MciPagination.d.ts +1 -14
  41. package/dist/types/shared/ui/mciPagination/mci-pagination.utils.d.ts +1 -0
  42. package/dist/types/shared/ui/mciPhone/MciPhone.d.ts +1 -15
  43. package/dist/types/shared/ui/mciPhone/mci-phone.utils.d.ts +32 -0
  44. package/dist/types/shared/ui/mciPicker/MciPicker.d.ts +1 -23
  45. package/dist/types/shared/ui/mciPicker/mci-picker.utils.d.ts +14 -0
  46. package/dist/types/shared/ui/mciSelect/MciSelect.d.ts +1 -24
  47. package/dist/types/shared/ui/mciSelect/mci-select.utils.d.ts +39 -0
  48. package/dist/types/shared/ui/mciSkeleton/MciSkeleton.d.ts +1 -7
  49. package/dist/types/shared/ui/mciTable/MciTableClamp2.d.ts +7 -0
  50. package/dist/types/shared/ui/mciTable/mci-table.utils.d.ts +3 -0
  51. package/dist/types/shared/ui/mciTabs/MciTabs.d.ts +1 -19
  52. package/dist/types/shared/ui/mciTag/MciTag.d.ts +1 -11
  53. package/dist/types/shared/ui/mciTextarea/MciTextarea.d.ts +1 -12
  54. package/dist/types/shared/ui/mciToast/MciToast.d.ts +1 -9
  55. package/dist/types/shared/ui/mciToast/mci-toast.utils.d.ts +34 -0
  56. package/dist/types/shared/ui/mciToggle/MciToggle.d.ts +1 -10
  57. package/dist/types/shared/ui/mciTooltip/MciTooltip.d.ts +1 -9
  58. package/dist/types/shared/ui/mciUpload/MciUpload.d.ts +1 -27
  59. package/dist/types/shared/ui/mciUpload/mci-upload.utils.d.ts +5 -0
  60. package/package.json +1 -1
  61. package/dist/types/App.d.ts +0 -2
  62. package/dist/types/main.d.ts +0 -0
package/dist/index.es.js CHANGED
@@ -1,113 +1,114 @@
1
- import { jsx as e, jsxs as o, Fragment as me } from "react/jsx-runtime";
2
- import { AltArrowRight as xe, Star2 as Ve, AltArrowDown as Ee, EyeClosed as rt, Eye as He, Calendar as nt, AltArrowLeft as Ce, DoubleAltArrowLeft as lt, DoubleAltArrowRight as st, ConfoundedSquare as at, SortVertical as ot, SortFromTopToBottom as it, SortFromBottomToTop as ct, Upload as dt, File as $e, FileText as Ae, MusicNote as ut, VideoFramePlayHorizontal as ht, Gallery as mt, MenuDots as ft, Refresh as pt, InfoCircle as gt, DangerCircle as bt, CloseCircle as xt, CheckCircle as wt, Phone as vt, TransferVertical as yt } from "@solar-icons/react";
3
- import { clsx as Nt } from "clsx";
4
- import { twMerge as kt } from "tailwind-merge";
5
- import * as ne from "react";
6
- import { memo as Ct, useState as H, useMemo as U, useCallback as P, useRef as de, useEffect as ee, forwardRef as fe } from "react";
7
- import { createRoot as Mt } from "react-dom/client";
8
- function n(...t) {
9
- return kt(Nt(t));
1
+ import { jsx as t, jsxs as d, Fragment as fe } from "react/jsx-runtime";
2
+ import { AltArrowRight as be, Star2 as Ue, AltArrowDown as Fe, EyeClosed as nt, Eye as Ve, Calendar as lt, AltArrowLeft as Ce, DoubleAltArrowLeft as st, DoubleAltArrowRight as at, ConfoundedSquare as ot, SortVertical as it, SortFromTopToBottom as ct, SortFromBottomToTop as dt, FileText as Ae, File as Ze, MusicNote as ut, VideoFramePlayHorizontal as ft, Gallery as mt, Upload as ht, MenuDots as pt, Refresh as gt, InfoCircle as bt, DangerCircle as xt, CloseCircle as wt, CheckCircle as yt, Phone as vt, TransferVertical as Nt } from "@solar-icons/react";
3
+ import { clsx as kt } from "clsx";
4
+ import { twMerge as Ct } from "tailwind-merge";
5
+ import * as K from "react";
6
+ import { memo as St, useState as z, useMemo as U, useCallback as O, useRef as se, useEffect as G, forwardRef as me } from "react";
7
+ import { createRoot as Dt } from "react-dom/client";
8
+ function s(...e) {
9
+ return Ct(kt(e));
10
10
  }
11
- function Le(t) {
12
- return { handleEscape: (r) => {
13
- r.key === "Escape" && t();
11
+ function Le(e) {
12
+ return { handleEscape: (n) => {
13
+ n.key === "Escape" && e();
14
14
  } };
15
15
  }
16
- function Se(t, l) {
17
- return { handleClick: (s) => {
18
- t.current && !t.current.contains(s.target) && l();
16
+ function Me(e, r) {
17
+ return { handleClick: (l) => {
18
+ e.current && !e.current.contains(l.target) && r();
19
19
  } };
20
20
  }
21
- function Qt({
22
- items: t,
23
- variant: l = "blue",
24
- className: r
21
+ function Hr({
22
+ items: e,
23
+ variant: r = "blue",
24
+ className: n
25
25
  }) {
26
- const s = l === "blue", m = s ? "hover:text-blue-600" : "hover:text-yellow-500", u = s ? "text-blue-600" : "text-yellow-500";
27
- return /* @__PURE__ */ e("nav", { className: n("flex items-center", r), "aria-label": "Breadcrumb", children: t.map((a, c) => {
28
- const N = c === t.length - 1;
29
- return /* @__PURE__ */ o("div", { className: "flex items-center", children: [
30
- N ? /* @__PURE__ */ o("span", { className: n("flex items-center gap-x-2 font-medium", u), children: [
26
+ const l = r === "blue", c = l ? "hover:text-blue-600" : "hover:text-yellow-500", i = l ? "text-blue-600" : "text-yellow-500";
27
+ return /* @__PURE__ */ t("nav", { className: s("flex items-center", n), "aria-label": "Breadcrumb", children: e.map((a, o) => {
28
+ const g = o === e.length - 1;
29
+ return /* @__PURE__ */ d("div", { className: "flex items-center", children: [
30
+ g ? /* @__PURE__ */ d("span", { className: s("flex items-center gap-x-2 font-medium", i), children: [
31
31
  a.icon,
32
- /* @__PURE__ */ e("span", { children: a.label })
33
- ] }) : /* @__PURE__ */ o(
32
+ /* @__PURE__ */ t("span", { children: a.label })
33
+ ] }) : /* @__PURE__ */ d(
34
34
  "a",
35
35
  {
36
36
  href: a.href ?? "#",
37
- onClick: (y) => {
38
- a.onClick && (y.preventDefault(), a.onClick());
37
+ onClick: (b) => {
38
+ a.onClick && (b.preventDefault(), a.onClick());
39
39
  },
40
- className: n(
40
+ className: s(
41
41
  "flex items-center gap-x-2 transition-all text-sm font-normal text-slate-500",
42
- m
42
+ c
43
43
  ),
44
44
  children: [
45
45
  a.icon,
46
- /* @__PURE__ */ e("span", { children: a.label })
46
+ /* @__PURE__ */ t("span", { children: a.label })
47
47
  ]
48
48
  }
49
49
  ),
50
- !N && /* @__PURE__ */ e("span", { className: "mx-2 flex items-center", children: /* @__PURE__ */ e(xe, { weight: "Linear", size: 20, className: "text-slate-500" }) })
51
- ] }, c);
50
+ !g && /* @__PURE__ */ t("span", { className: "mx-2 flex items-center", children: /* @__PURE__ */ t(be, { weight: "Linear", size: 20, className: "text-slate-500" }) })
51
+ ] }, o);
52
52
  }) });
53
53
  }
54
- function er({
55
- children: t,
56
- text: l,
57
- icon: r,
58
- iconPosition: s = "left",
59
- size: m = "base",
60
- variant: u = "primary",
54
+ const Mt = {
55
+ sm: "h-9 px-2 text-sm gap-1.5 rounded-lg leading-9 min-w-9",
56
+ md: "h-10 px-2 text-base gap-2 rounded-lg leading-10 min-w-10",
57
+ base: "h-12 px-4 text-base gap-2 rounded-xl leading-12 min-w-12"
58
+ }, At = {
59
+ blue: {
60
+ primary: "bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 focus:ring-2 focus:ring-[rgba(21,93,252,0.25)]",
61
+ secondary: "bg-blue-100 text-blue-600 hover:bg-blue-200 active:bg-blue-200 active:border active:border-blue-600 focus:ring-2 focus:ring-[rgba(21,93,252,0.25)]",
62
+ outline: "border border-blue-600 text-blue-600 hover:border-blue-700 hover:text-blue-700 active:border-blue-800 active:text-blue-800 focus:ring-2 focus:ring-blue-200"
63
+ },
64
+ yellow: {
65
+ primary: "bg-yellow-500 text-white hover:bg-yellow-600 active:bg-yellow-700 focus:ring-2 focus:ring-yellow-300",
66
+ secondary: "bg-yellow-50 text-yellow-500 hover:bg-yellow-100 active:bg-yellow-100 active:border active:border-yellow-500 focus:ring-2 focus:ring-yellow-200",
67
+ outline: "border border-yellow-500 text-yellow-500 hover:border-yellow-600 hover:text-yellow-600 active:border-yellow-700 active:text-yellow-700 focus:ring-2 focus:ring-yellow-200"
68
+ }
69
+ }, Et = {
70
+ danger: "bg-red-600 text-white hover:bg-red-700 active:bg-red-800 focus:ring-2 focus:shadow-red",
71
+ tertiary: "bg-slate-100 text-black hover:bg-slate-200 active:bg-slate-300 focus:ring-2 focus:shadow-slate"
72
+ };
73
+ function Ur({
74
+ children: e,
75
+ text: r,
76
+ icon: n,
77
+ iconPosition: l = "left",
78
+ size: c = "base",
79
+ variant: i = "primary",
61
80
  color: a = "yellow",
62
- loading: c = !1,
63
- disabled: N = !1,
64
- onClick: y,
65
- className: C,
66
- type: F = "button"
81
+ loading: o = !1,
82
+ disabled: g = !1,
83
+ onClick: b,
84
+ className: y,
85
+ type: k = "button"
67
86
  }) {
68
- const I = t ?? l, R = {
69
- sm: "h-9 px-2 text-sm gap-1.5 rounded-lg leading-9 min-w-9",
70
- md: "h-10 px-2 text-base gap-2 rounded-lg leading-10 min-w-10",
71
- base: "h-12 px-4 text-base gap-2 rounded-xl leading-12 min-w-12"
72
- }, b = u === "primary" || u === "secondary" || u === "outline" ? {
73
- blue: {
74
- primary: "bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 focus:ring-2 focus:ring-[rgba(21,93,252,0.25)]",
75
- secondary: "bg-blue-100 text-blue-600 hover:bg-blue-200 active:bg-blue-200 active:border active:border-blue-600 focus:ring-2 focus:ring-[rgba(21,93,252,0.25)]",
76
- outline: "border border-blue-600 text-blue-600 hover:border-blue-700 hover:text-blue-700 active:border-blue-800 active:text-blue-800 focus:ring-2 focus:ring-blue-200"
77
- },
78
- yellow: {
79
- primary: "bg-yellow-500 text-white hover:bg-yellow-600 active:bg-yellow-700 focus:ring-2 focus:ring-yellow-300",
80
- secondary: "bg-yellow-50 text-yellow-500 hover:bg-yellow-100 active:bg-yellow-100 active:border active:border-yellow-500 focus:ring-2 focus:ring-yellow-200",
81
- outline: "border border-yellow-500 text-yellow-500 hover:border-yellow-600 hover:text-yellow-600 active:border-yellow-700 active:text-yellow-700 focus:ring-2 focus:ring-yellow-200"
82
- }
83
- }[a][u] : {
84
- danger: "bg-red-600 text-white hover:bg-red-700 active:bg-red-800 focus:ring-2 focus:shadow-red",
85
- tertiary: "bg-slate-100 text-black hover:bg-slate-200 active:bg-slate-300 focus:ring-2 focus:shadow-slate"
86
- }[u], j = N || c, S = j ? u === "outline" ? "border-slate-200 bg-white text-slate-400 cursor-not-allowed hover:bg-transparent hover:border-slate-200 hover:text-slate-400 active:border-slate-200 active:text-slate-400 active:bg-transparent focus:bg-transparent focus:ring-0" : "bg-slate-200 text-slate-400 cursor-not-allowed hover:bg-slate-200 active:bg-slate-200 focus:ring-0" : "";
87
- return /* @__PURE__ */ o(
87
+ const T = e ?? r, E = i === "primary" || i === "secondary" || i === "outline" ? At[a][i] : Et[i], S = g || o, h = S ? i === "outline" ? "border-slate-200 bg-white text-slate-400 cursor-not-allowed hover:bg-transparent hover:border-slate-200 hover:text-slate-400 active:border-slate-200 active:text-slate-400 active:bg-transparent focus:bg-transparent focus:ring-0" : "bg-slate-200 text-slate-400 cursor-not-allowed hover:bg-slate-200 active:bg-slate-200 focus:ring-0" : "";
88
+ return /* @__PURE__ */ d(
88
89
  "button",
89
90
  {
90
- type: F,
91
- onClick: y,
92
- disabled: j,
93
- className: n(
91
+ type: k,
92
+ onClick: b,
93
+ disabled: S,
94
+ className: s(
94
95
  "inline-flex w-fit shrink-0 items-center justify-center whitespace-nowrap text-center font-medium transition-all duration-200 cursor-pointer",
95
- R[m],
96
- b,
97
- !j && b,
98
- S,
99
- C
96
+ Mt[c],
97
+ E,
98
+ !S && E,
99
+ h,
100
+ y
100
101
  ),
101
102
  children: [
102
- r && s === "left" && !c && /* @__PURE__ */ e("span", { className: "flex items-center", children: r }),
103
- I && /* @__PURE__ */ e("span", { className: "whitespace-nowrap", children: I }),
104
- r && s === "right" && !c && /* @__PURE__ */ e("span", { className: "flex items-center", children: r }),
105
- c && /* @__PURE__ */ e(Ve, { weight: "Linear", size: 20, className: "animate-spin" })
103
+ n && l === "left" && !o && /* @__PURE__ */ t("span", { className: "flex items-center", children: n }),
104
+ T && /* @__PURE__ */ t("span", { className: "whitespace-nowrap", children: T }),
105
+ n && l === "right" && !o && /* @__PURE__ */ t("span", { className: "flex items-center", children: n }),
106
+ o && /* @__PURE__ */ t(Ue, { weight: "Linear", size: 20, className: "animate-spin" })
106
107
  ]
107
108
  }
108
109
  );
109
110
  }
110
- const Dt = (t) => /* @__PURE__ */ ne.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 11, height: 8, viewBox: "0 0 11 8", fill: "none", ...t }, /* @__PURE__ */ ne.createElement("path", { d: "M0.625 3.76944L3.76944 6.91389L10.0694 0.625", stroke: "currentColor", strokeWidth: 1.25, strokeLinecap: "round", strokeLinejoin: "round" })), St = {
111
+ const Tt = (e) => /* @__PURE__ */ K.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 11, height: 8, viewBox: "0 0 11 8", fill: "none", ...e }, /* @__PURE__ */ K.createElement("path", { d: "M0.625 3.76944L3.76944 6.91389L10.0694 0.625", stroke: "currentColor", strokeWidth: 1.25, strokeLinecap: "round", strokeLinejoin: "round" })), It = {
111
112
  blue: {
112
113
  border: "border-blue-600",
113
114
  bg: "bg-blue-600",
@@ -120,187 +121,187 @@ const Dt = (t) => /* @__PURE__ */ ne.createElement("svg", { xmlns: "http://www.w
120
121
  hover: "hover:border-yellow-500 hover:bg-yello-100",
121
122
  focus: "focus:ring-2 focus:ring-yellow-300"
122
123
  }
123
- }, De = Ct(function({
124
- type: l = "checkbox",
125
- label: r,
126
- supportText: s,
127
- checked: m,
128
- onChange: u,
124
+ }, De = St(function({
125
+ type: r = "checkbox",
126
+ label: n,
127
+ supportText: l,
128
+ checked: c,
129
+ onChange: i,
129
130
  error: a,
130
- disabled: c = !1,
131
- required: N = !1,
132
- className: y,
133
- variant: C = "yellow",
134
- name: F,
135
- value: I
131
+ disabled: o = !1,
132
+ required: g = !1,
133
+ className: b,
134
+ variant: y = "yellow",
135
+ name: k,
136
+ value: T
136
137
  }) {
137
- const [R, w] = H(!1), k = l === "radio", b = U(
138
- () => m ?? R,
139
- [m, R]
140
- ), j = P(
141
- (h) => {
142
- c || (m === void 0 && w(h.target.checked), u?.(h));
138
+ const [E, S] = z(!1), h = r === "radio", w = U(
139
+ () => c ?? E,
140
+ [c, E]
141
+ ), A = O(
142
+ (f) => {
143
+ o || (c === void 0 && S(f.target.checked), i?.(f));
143
144
  },
144
- [m, u, c]
145
- ), S = U(() => {
146
- if (c) {
147
- const M = "border-slate-200 bg-slate-100";
148
- return k ? {
149
- container: M,
150
- dot: b ? "bg-slate-300" : "bg-transparent",
145
+ [c, i, o]
146
+ ), L = U(() => {
147
+ if (o) {
148
+ const N = "border-slate-200 bg-slate-100";
149
+ return h ? {
150
+ container: N,
151
+ dot: w ? "bg-slate-300" : "bg-transparent",
151
152
  check: "text-slate-400"
152
153
  } : {
153
- container: M,
154
+ container: N,
154
155
  dot: "",
155
- check: b ? "text-slate-400" : "text-transparent"
156
+ check: w ? "text-slate-400" : "text-transparent"
156
157
  };
157
158
  }
158
- const h = St[C];
159
- if (k) {
160
- const M = n(
159
+ const f = It[y];
160
+ if (h) {
161
+ const N = s(
161
162
  "border transition-all duration-200",
162
- b ? h.border : "border-slate-400",
163
- !b && h.hover,
164
- h.focus,
165
- b && ""
166
- ), D = n(
163
+ w ? f.border : "border-slate-400",
164
+ !w && f.hover,
165
+ f.focus,
166
+ w && ""
167
+ ), M = s(
167
168
  "transition-all duration-200 rounded-full",
168
- b ? h.bg : "bg-transparent"
169
+ w ? f.bg : "bg-transparent"
169
170
  );
170
171
  return {
171
- container: M,
172
- dot: D,
172
+ container: N,
173
+ dot: M,
173
174
  check: ""
174
175
  };
175
176
  }
176
177
  return {
177
- container: n(
178
+ container: s(
178
179
  "border transition-all duration-200",
179
- b ? n(h.bg, h.border) : "border-slate-400",
180
- !b && h.hover,
181
- h.focus
180
+ w ? s(f.bg, f.border) : "border-slate-400",
181
+ !w && f.hover,
182
+ f.focus
182
183
  ),
183
184
  dot: "",
184
- check: b ? "text-white" : "text-transparent"
185
+ check: w ? "text-white" : "text-transparent"
185
186
  };
186
- }, [k, b, c, C]), x = U(() => !r && !s ? null : /* @__PURE__ */ o("div", { className: "flex flex-col", children: [
187
- r && /* @__PURE__ */ o(
187
+ }, [h, w, o, y]), v = U(() => !n && !l ? null : /* @__PURE__ */ d("div", { className: "flex flex-col", children: [
188
+ n && /* @__PURE__ */ d(
188
189
  "span",
189
190
  {
190
- className: n(
191
+ className: s(
191
192
  "text-base font-medium text-slate-700",
192
193
  a && "text-red-600",
193
- c && "text-slate-400"
194
+ o && "text-slate-400"
194
195
  ),
195
196
  children: [
196
- r,
197
- N && /* @__PURE__ */ e("span", { className: "text-extra-small text-red-600 ml-1", children: "*" })
197
+ n,
198
+ g && /* @__PURE__ */ t("span", { className: "text-extra-small text-red-600 ml-1", children: "*" })
198
199
  ]
199
200
  }
200
201
  ),
201
- s && /* @__PURE__ */ e(
202
+ l && /* @__PURE__ */ t(
202
203
  "span",
203
204
  {
204
- className: n(
205
+ className: s(
205
206
  "text-slate-500 text-base font-normal",
206
- c && "text-slate-400"
207
+ o && "text-slate-400"
207
208
  ),
208
- children: s
209
+ children: l
209
210
  }
210
211
  )
211
- ] }), [r, s, a, c, N]);
212
- return /* @__PURE__ */ o("div", { className: n("flex items-start", y), children: [
213
- /* @__PURE__ */ o(
212
+ ] }), [n, l, a, o, g]);
213
+ return /* @__PURE__ */ d("div", { className: s("flex items-start", b), children: [
214
+ /* @__PURE__ */ d(
214
215
  "label",
215
216
  {
216
- className: n(
217
+ className: s(
217
218
  "flex items-start gap-2 select-none",
218
- c ? "cursor-not-allowed" : "cursor-pointer"
219
+ o ? "cursor-not-allowed" : "cursor-pointer"
219
220
  ),
220
221
  children: [
221
- /* @__PURE__ */ e(
222
+ /* @__PURE__ */ t(
222
223
  "input",
223
224
  {
224
- type: l,
225
- checked: b,
226
- onChange: j,
227
- disabled: c,
228
- required: N,
225
+ type: r,
226
+ checked: w,
227
+ onChange: A,
228
+ disabled: o,
229
+ required: g,
229
230
  className: "sr-only",
230
231
  "aria-invalid": !!a,
231
- "aria-describedby": a ? `${F}-error` : void 0,
232
- name: F,
233
- value: I
232
+ "aria-describedby": a ? `${k}-error` : void 0,
233
+ name: k,
234
+ value: T
234
235
  }
235
236
  ),
236
- /* @__PURE__ */ e(
237
+ /* @__PURE__ */ t(
237
238
  "div",
238
239
  {
239
- className: n(
240
+ className: s(
240
241
  "relative flex items-center justify-center",
241
- k ? "w-5 h-5 rounded-full" : "w-5 h-5 rounded",
242
- S.container
242
+ h ? "w-5 h-5 rounded-full" : "w-5 h-5 rounded",
243
+ L.container
243
244
  ),
244
- children: k ? /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e(
245
+ children: h ? /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ t(
245
246
  "span",
246
247
  {
247
- className: n(
248
+ className: s(
248
249
  "w-3 h-3 rounded-full transition-all duration-200",
249
- S.dot,
250
- b ? "opacity-100 scale-100" : "opacity-0 scale-50"
250
+ L.dot,
251
+ w ? "opacity-100 scale-100" : "opacity-0 scale-50"
251
252
  )
252
253
  }
253
- ) }) : /* @__PURE__ */ e(
254
- Dt,
254
+ ) }) : /* @__PURE__ */ t(
255
+ Tt,
255
256
  {
256
- className: n(
257
+ className: s(
257
258
  "w-4 h-4 stroke-[2.5px] transition-opacity duration-200",
258
- S.check,
259
- b ? "opacity-100" : "opacity-0"
259
+ L.check,
260
+ w ? "opacity-100" : "opacity-0"
260
261
  )
261
262
  }
262
263
  )
263
264
  }
264
265
  ),
265
- x
266
+ v
266
267
  ]
267
268
  }
268
269
  ),
269
- a && /* @__PURE__ */ e("p", { id: `${F}-error`, className: "mt-1 text-extra-small text-red-600", children: a })
270
+ a && /* @__PURE__ */ t("p", { id: `${k}-error`, className: "mt-1 text-extra-small text-red-600", children: a })
270
271
  ] });
271
272
  });
272
273
  De.displayName = "MciCheck";
273
- function tr({
274
- title: t,
275
- children: l,
276
- defaultOpen: r = !1,
277
- icon: s,
278
- className: m,
279
- contentClassName: u
274
+ function Vr({
275
+ title: e,
276
+ children: r,
277
+ defaultOpen: n = !1,
278
+ icon: l,
279
+ className: c,
280
+ contentClassName: i
280
281
  }) {
281
- const [a, c] = H(r), [N, y] = H(0), C = de(null);
282
- return ee(() => {
283
- C.current && y(a ? C.current.scrollHeight : 0);
284
- }, [a]), /* @__PURE__ */ o("div", { className: n("overflow-hidden rounded-xl border border-slate-200", m), children: [
285
- /* @__PURE__ */ o(
282
+ const [a, o] = z(n), [g, b] = z(0), y = se(null);
283
+ return G(() => {
284
+ y.current && b(a ? y.current.scrollHeight : 0);
285
+ }, [a]), /* @__PURE__ */ d("div", { className: s("overflow-hidden rounded-xl border border-slate-200", c), children: [
286
+ /* @__PURE__ */ d(
286
287
  "button",
287
288
  {
288
- onClick: () => c(!a),
289
- className: n(
289
+ onClick: () => o(!a),
290
+ className: s(
290
291
  "flex w-full items-center justify-between p-5 transition-all duration-300 hover:cursor-pointer",
291
292
  a ? "border-b border-slate-200" : "border-b border-transparent"
292
293
  ),
293
294
  children: [
294
- /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
295
- s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s }),
296
- /* @__PURE__ */ e("div", { className: n("text-base font-medium text-black"), children: t })
295
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
296
+ l && /* @__PURE__ */ t("span", { className: "shrink-0", children: l }),
297
+ /* @__PURE__ */ t("div", { className: s("text-base font-medium text-black"), children: e })
297
298
  ] }),
298
- /* @__PURE__ */ e(
299
- Ee,
299
+ /* @__PURE__ */ t(
300
+ Fe,
300
301
  {
301
302
  weight: "Linear",
302
303
  size: 20,
303
- className: n(
304
+ className: s(
304
305
  "shrink-0 transition-transform duration-300 text-slate-400",
305
306
  a && "rotate-180"
306
307
  )
@@ -309,343 +310,358 @@ function tr({
309
310
  ]
310
311
  }
311
312
  ),
312
- /* @__PURE__ */ e(
313
+ /* @__PURE__ */ t(
313
314
  "div",
314
315
  {
315
- className: n(
316
+ className: s(
316
317
  "overflow-hidden transition-all duration-300 ease-out"
317
318
  ),
318
319
  style: {
319
- height: `${N}px`
320
+ height: `${g}px`
320
321
  },
321
- children: /* @__PURE__ */ e("div", { ref: C, className: n("p-5", u), children: l })
322
+ children: /* @__PURE__ */ t("div", { ref: y, className: s("p-5", i), children: r })
322
323
  }
323
324
  )
324
325
  ] });
325
326
  }
326
- const pe = (t) => /* @__PURE__ */ ne.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", ...t }, /* @__PURE__ */ ne.createElement("path", { d: "M7.75739 7.75735L16.2427 16.2426", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ ne.createElement("path", { d: "M7.75733 16.2426L16.2426 7.75735", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }));
327
- function rr({
328
- isOpen: t,
329
- onClose: l,
330
- position: r = "right",
331
- children: s,
332
- footer: m,
333
- title: u,
327
+ const he = (e) => /* @__PURE__ */ K.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", ...e }, /* @__PURE__ */ K.createElement("path", { d: "M7.75739 7.75735L16.2427 16.2426", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ K.createElement("path", { d: "M7.75733 16.2426L16.2426 7.75735", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }));
328
+ function Zr({
329
+ isOpen: e,
330
+ onClose: r,
331
+ position: n = "right",
332
+ children: l,
333
+ footer: c,
334
+ title: i,
334
335
  description: a,
335
- showCloseButton: c = !0,
336
- drawerClassName: N,
337
- contentClassName: y,
338
- closeOnOverlayClick: C = !0,
339
- closeOnEscape: F = !0,
340
- width: I = 572
336
+ showCloseButton: o = !0,
337
+ drawerClassName: g,
338
+ contentClassName: b,
339
+ closeOnOverlayClick: y = !0,
340
+ closeOnEscape: k = !0,
341
+ width: T = 572
341
342
  }) {
342
- const R = de(null), w = de(null), k = P(() => l(), [l]);
343
- ee(() => {
344
- t ? (w.current = document.activeElement, R.current?.focus()) : w.current?.focus();
345
- }, [t]), ee(() => (t && (document.body.style.overflow = "hidden"), () => {
343
+ const E = se(null), S = se(null), h = O(() => r(), [r]);
344
+ G(() => {
345
+ e ? (S.current = document.activeElement, E.current?.focus()) : S.current?.focus();
346
+ }, [e]), G(() => (e && (document.body.style.overflow = "hidden"), () => {
346
347
  document.body.style.overflow = "unset";
347
- }), [t]);
348
- const b = U(
348
+ }), [e]);
349
+ const w = U(
349
350
  () => ({
350
- "--drawer-w": typeof I == "number" ? `${I}px` : I,
351
- transform: t ? "translateX(0)" : r === "right" ? "translateX(calc(100% + 48px))" : "translateX(calc(-100% - 48px))"
351
+ "--drawer-w": typeof T == "number" ? `${T}px` : T,
352
+ transform: e ? "translateX(0)" : n === "right" ? "translateX(calc(100% + 48px))" : "translateX(calc(-100% - 48px))"
352
353
  }),
353
- [t, I, r]
354
- ), j = !!(u || a || c), S = r === "right" ? "top-0 bottom-0 right-0 left-3 rounded-l-3xl rounded-r-none" : "top-0 bottom-0 left-0 right-3 rounded-r-3xl rounded-l-none", x = r === "right" ? "sm:top-6 sm:bottom-6 sm:right-6 sm:left-auto" : "sm:top-6 sm:bottom-6 sm:left-6 sm:right-auto";
355
- return /* @__PURE__ */ o(me, { children: [
356
- /* @__PURE__ */ e(
354
+ [e, T, n]
355
+ ), A = !!(i || a || o), L = n === "right" ? "top-0 bottom-0 right-0 left-3 rounded-l-3xl rounded-r-none" : "top-0 bottom-0 left-0 right-3 rounded-r-3xl rounded-l-none", v = n === "right" ? "sm:top-6 sm:bottom-6 sm:right-6 sm:left-auto" : "sm:top-6 sm:bottom-6 sm:left-6 sm:right-auto";
356
+ return /* @__PURE__ */ d(fe, { children: [
357
+ /* @__PURE__ */ t(
357
358
  "div",
358
359
  {
359
- className: n(
360
+ className: s(
360
361
  "fixed inset-0 z-50 bg-black/40 transition-opacity duration-300",
361
- t ? "opacity-100 visible cursor-pointer" : "opacity-0 invisible pointer-events-none"
362
+ e ? "opacity-100 visible cursor-pointer" : "opacity-0 invisible pointer-events-none"
362
363
  ),
363
- onClick: C ? k : void 0,
364
+ onClick: y ? h : void 0,
364
365
  "aria-hidden": "true"
365
366
  }
366
367
  ),
367
- /* @__PURE__ */ o(
368
+ /* @__PURE__ */ d(
368
369
  "div",
369
370
  {
370
- ref: R,
371
+ ref: E,
371
372
  tabIndex: -1,
372
- style: b,
373
- className: n(
373
+ style: w,
374
+ className: s(
374
375
  "fixed z-50 flex flex-col bg-white outline-none min-h-0",
375
376
  "transition-[transform,opacity,visibility] duration-300 ease-in-out",
376
- t ? "opacity-100 visible pointer-events-auto shadow-2xl" : "opacity-0 invisible pointer-events-none shadow-none",
377
- S,
377
+ e ? "opacity-100 visible pointer-events-auto shadow-2xl" : "opacity-0 invisible pointer-events-none shadow-none",
378
+ L,
378
379
  "h-[100dvh]",
379
380
  "pb-[env(safe-area-inset-bottom)]",
380
- x,
381
+ v,
381
382
  "sm:h-auto sm:rounded-2xl sm:pb-0",
382
383
  "sm:w-[var(--drawer-w)]",
383
- N
384
+ g
384
385
  ),
385
386
  role: "dialog",
386
387
  "aria-modal": "true",
387
- "aria-hidden": !t,
388
- "aria-labelledby": u ? "drawer-title" : void 0,
388
+ "aria-hidden": !e,
389
+ "aria-labelledby": i ? "drawer-title" : void 0,
389
390
  children: [
390
- j && /* @__PURE__ */ o("div", { className: "flex items-start justify-between border-b border-slate-200 shrink-0 px-4 py-4 sm:p-6", children: [
391
- (u || a) && /* @__PURE__ */ o("div", { className: "block pr-3", children: [
392
- u && /* @__PURE__ */ e(
391
+ A && /* @__PURE__ */ d("div", { className: "flex items-start justify-between border-b border-slate-200 shrink-0 px-4 py-4 sm:p-6", children: [
392
+ (i || a) && /* @__PURE__ */ d("div", { className: "block pr-3", children: [
393
+ i && /* @__PURE__ */ t(
393
394
  "h2",
394
395
  {
395
396
  id: "drawer-title",
396
397
  className: "font-semibold text-black text-xl leading-tight sm:text-h3",
397
- children: u
398
+ children: i
398
399
  }
399
400
  ),
400
- a && /* @__PURE__ */ e("p", { className: "text-sm sm:text-base text-slate-base font-normal mt-2", children: a })
401
+ a && /* @__PURE__ */ t("p", { className: "text-sm sm:text-base text-slate-base font-normal mt-2", children: a })
401
402
  ] }),
402
- c && /* @__PURE__ */ e(
403
+ o && /* @__PURE__ */ t(
403
404
  "button",
404
405
  {
405
406
  type: "button",
406
- onClick: k,
407
+ onClick: h,
407
408
  className: "bg-slate-100 rounded-xl w-11 h-11 sm:w-12 sm:h-12 hover:cursor-pointer text-black transition flex items-center justify-center group active:scale-95",
408
- children: /* @__PURE__ */ e(pe, { className: "h-5 w-5 sm:h-6 sm:w-6 transition-transform duration-300 group-hover:rotate-180" })
409
+ children: /* @__PURE__ */ t(he, { className: "h-5 w-5 sm:h-6 sm:w-6 transition-transform duration-300 group-hover:rotate-180" })
409
410
  }
410
411
  )
411
412
  ] }),
412
- /* @__PURE__ */ e(
413
+ /* @__PURE__ */ t(
413
414
  "div",
414
415
  {
415
- className: n(
416
+ className: s(
416
417
  "flex-1 min-h-0 overflow-y-auto scrollbar-thin scrollbar-thumb-slate-200 px-4 py-4 sm:p-6",
417
- y
418
+ b
418
419
  ),
419
- children: s
420
+ children: l
420
421
  }
421
422
  ),
422
- m && /* @__PURE__ */ e("div", { className: "shrink-0 flex items-center justify-end border-t border-slate-200 px-4 py-4 sm:p-6 gap-3 [&>*]:w-fit [&>*]:shrink-0 [&>*]:whitespace-nowrap", children: m })
423
+ c && /* @__PURE__ */ t("div", { className: "shrink-0 flex items-center justify-end border-t border-slate-200 px-4 py-4 sm:p-6 gap-3 [&>*]:w-fit [&>*]:shrink-0 [&>*]:whitespace-nowrap", children: c })
423
424
  ]
424
425
  }
425
426
  )
426
427
  ] });
427
428
  }
428
- const Ie = fe(
429
+ const Ee = {
430
+ sm: {
431
+ input: "h-9 text-sm",
432
+ icon: "w-4 h-4",
433
+ leftIcon: "left-2",
434
+ rightIcon: "right-2",
435
+ labelFont: "text-sm",
436
+ iconWrapper: "h-4"
437
+ },
438
+ md: {
439
+ input: "h-10 text-sm",
440
+ icon: "w-4 h-4",
441
+ leftIcon: "left-2",
442
+ rightIcon: "right-2",
443
+ labelFont: "text-base",
444
+ iconWrapper: "h-4"
445
+ },
446
+ base: {
447
+ input: "h-12 text-base",
448
+ icon: "w-5 h-5",
449
+ leftIcon: "left-3",
450
+ rightIcon: "right-3",
451
+ labelFont: "text-base",
452
+ iconWrapper: "h-5"
453
+ }
454
+ };
455
+ function Ft(e, r) {
456
+ const n = (l) => l === "sm" ? e && r ? "pl-7 pr-7" : e ? "pl-7 pr-2" : r ? "pl-2 pr-7" : "px-2" : l === "md" ? e && r ? "pl-8 pr-8" : e ? "pl-8 pr-2" : r ? "pl-2 pr-8" : "px-4" : e && r ? "pl-9 pr-9" : e ? "pl-9 pr-3" : r ? "pl-3 pr-9" : "px-4";
457
+ return {
458
+ sm: { ...Ee.sm, padding: n("sm") },
459
+ md: { ...Ee.md, padding: n("md") },
460
+ base: { ...Ee.base, padding: n("base") }
461
+ };
462
+ }
463
+ function Lt(e) {
464
+ return e ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600";
465
+ }
466
+ function jt(e, r, n) {
467
+ return e ? "text-slate-400" : r ? "text-red-600" : n ? "text-black" : "text-slate-400";
468
+ }
469
+ const je = me(
429
470
  ({
430
- label: t,
431
- placeholder: l,
432
- type: r = "text",
433
- icon: s,
434
- rightIcon: m,
435
- iconPosition: u = "left",
471
+ label: e,
472
+ placeholder: r,
473
+ type: n = "text",
474
+ icon: l,
475
+ rightIcon: c,
476
+ iconPosition: i = "left",
436
477
  size: a = "base",
437
- error: c,
438
- disabled: N = !1,
439
- required: y = !1,
440
- value: C,
441
- onChange: F,
442
- onFocus: I,
443
- onBlur: R,
444
- className: w,
445
- name: k,
446
- maxLength: b = 250,
447
- onClear: j,
448
- showClearButton: S = !1,
449
- step: x,
450
- autoComplete: h = "off"
451
- }, A) => {
452
- const [M, D] = H(!1), [i, d] = H(""), [v, E] = H(!1), B = C ?? i, z = r === "password", O = S && !!B && !N, W = s && u === "left", J = s && u === "right" || m || z, G = J || O, K = () => {
453
- D(!0), I?.();
454
- }, le = () => {
455
- D(!1), R?.();
456
- }, oe = (p) => {
457
- let $ = p.target.value;
458
- r === "number" && b && $.length > b && ($ = $.slice(0, b), p.target.value = $), C === void 0 && d($), F?.(p);
459
- }, te = () => E((p) => !p), ie = () => {
460
- C === void 0 && d(""), j?.();
461
- }, Y = U(
462
- () => ({
463
- sm: {
464
- input: "h-9 text-sm",
465
- padding: W && J ? "pl-7 pr-7" : W ? "pl-7 pr-2" : J ? "pl-2 pr-7" : "px-2",
466
- icon: "w-4 h-4",
467
- leftIcon: "left-2",
468
- rightIcon: "right-2",
469
- labelFont: "text-sm",
470
- iconWrapper: "h-4"
471
- },
472
- md: {
473
- input: "h-10 text-sm",
474
- padding: W && J ? "pl-8 pr-8" : W ? "pl-8 pr-2" : J ? "pl-2 pr-8" : "px-4",
475
- icon: "w-4 h-4",
476
- leftIcon: "left-2",
477
- rightIcon: "right-2",
478
- labelFont: "text-base",
479
- iconWrapper: "h-4"
480
- },
481
- base: {
482
- input: "h-12 text-base",
483
- padding: W && J ? "pl-9 pr-9" : W ? "pl-9 pr-3" : J ? "pl-3 pr-9" : "px-4",
484
- icon: "w-5 h-5",
485
- leftIcon: "left-3",
486
- rightIcon: "right-3",
487
- labelFont: "text-base",
488
- iconWrapper: "h-5"
489
- }
490
- }),
491
- [W, J]
492
- ), X = U(() => c ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [c]), ae = U(() => N ? "text-slate-400" : c ? "text-red-600" : M ? "text-black" : "text-slate-400", [c, M, N]);
493
- return /* @__PURE__ */ o("div", { className: n("w-full", w), children: [
494
- t && /* @__PURE__ */ o(
478
+ error: o,
479
+ disabled: g = !1,
480
+ required: b = !1,
481
+ value: y,
482
+ onChange: k,
483
+ onFocus: T,
484
+ onBlur: E,
485
+ className: S,
486
+ name: h,
487
+ maxLength: w = 250,
488
+ onClear: A,
489
+ showClearButton: L = !1,
490
+ step: v,
491
+ autoComplete: f = "off"
492
+ }, I) => {
493
+ const [N, M] = z(!1), [m, u] = z(""), [p, j] = z(!1), F = y ?? m, $ = n === "password", _ = L && !!F && !g, V = l && i === "left", Z = l && i === "right" || c || $, ne = Z || _, X = () => {
494
+ M(!0), T?.();
495
+ }, ee = () => {
496
+ M(!1), E?.();
497
+ }, J = (Q) => {
498
+ let q = Q.target.value;
499
+ n === "number" && w && q.length > w && (q = q.slice(0, w), Q.target.value = q), y === void 0 && u(q), k?.(Q);
500
+ }, D = () => j((Q) => !Q), R = () => {
501
+ y === void 0 && u(""), A?.();
502
+ }, P = U(
503
+ () => Ft(!!V, !!Z),
504
+ [V, Z]
505
+ ), W = U(() => Lt(o), [o]), H = U(
506
+ () => jt(g, o, N),
507
+ [o, N, g]
508
+ );
509
+ return /* @__PURE__ */ d("div", { className: s("w-full", S), children: [
510
+ e && /* @__PURE__ */ d(
495
511
  "label",
496
512
  {
497
- htmlFor: k,
498
- className: n(
513
+ htmlFor: h,
514
+ className: s(
499
515
  "mb-2 block text-base font-medium",
500
- c ? "text-red-600" : "text-slate-700",
501
- Y[a].labelFont
516
+ o ? "text-red-600" : "text-slate-700",
517
+ P[a].labelFont
502
518
  ),
503
519
  children: [
504
- t,
505
- y && /* @__PURE__ */ e("span", { className: "text-extra-small text-red-600 ml-1", children: "*" })
520
+ e,
521
+ b && /* @__PURE__ */ t("span", { className: "text-extra-small text-red-600 ml-1", children: "*" })
506
522
  ]
507
523
  }
508
524
  ),
509
- /* @__PURE__ */ o("div", { className: "relative flex items-center", children: [
510
- /* @__PURE__ */ e(
525
+ /* @__PURE__ */ d("div", { className: "relative flex items-center", children: [
526
+ /* @__PURE__ */ t(
511
527
  "input",
512
528
  {
513
- ref: A,
514
- name: k,
515
- type: z && v ? "text" : r,
516
- value: B,
517
- onChange: oe,
518
- onFocus: K,
519
- onBlur: le,
520
- disabled: N,
521
- required: y,
522
- autoComplete: h,
523
- placeholder: l,
524
- step: x,
525
- className: n(
529
+ ref: I,
530
+ name: h,
531
+ type: $ && p ? "text" : n,
532
+ value: F,
533
+ onChange: J,
534
+ onFocus: X,
535
+ onBlur: ee,
536
+ disabled: g,
537
+ required: b,
538
+ autoComplete: f,
539
+ placeholder: r,
540
+ step: v,
541
+ className: s(
526
542
  "w-full border bg-white font-normal transition-all duration-300 ease-in-out outline-none",
527
543
  a === "base" ? "rounded-xl" : "rounded-lg",
528
544
  "disabled:cursor-not-allowed disabled:border-slate-200 disabled:bg-slate-100 disabled:text-slate-400",
529
545
  "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
530
- Y[a].input,
531
- Y[a].padding,
532
- X
546
+ P[a].input,
547
+ P[a].padding,
548
+ W
533
549
  ),
534
- maxLength: b
550
+ maxLength: w
535
551
  }
536
552
  ),
537
- W && /* @__PURE__ */ e(
553
+ V && /* @__PURE__ */ t(
538
554
  "div",
539
555
  {
540
- className: n(
556
+ className: s(
541
557
  "absolute top-1/2 flex -translate-y-1/2 items-center justify-center",
542
558
  "transition-all duration-300",
543
- Y[a].leftIcon,
544
- ae
559
+ P[a].leftIcon,
560
+ H
545
561
  ),
546
- children: /* @__PURE__ */ e(
562
+ children: /* @__PURE__ */ t(
547
563
  "div",
548
564
  {
549
- className: n("flex items-center justify-center", Y[a].iconWrapper),
550
- children: /* @__PURE__ */ e("span", { className: n("flex items-center justify-center", Y[a].icon), children: s })
565
+ className: s("flex items-center justify-center", P[a].iconWrapper),
566
+ children: /* @__PURE__ */ t("span", { className: s("flex items-center justify-center", P[a].icon), children: l })
551
567
  }
552
568
  )
553
569
  }
554
570
  ),
555
- G && /* @__PURE__ */ o(
571
+ ne && /* @__PURE__ */ d(
556
572
  "div",
557
573
  {
558
- className: n(
574
+ className: s(
559
575
  "absolute top-1/2 flex -translate-y-1/2 items-center justify-center gap-2",
560
576
  "transition-all duration-300",
561
- Y[a].rightIcon
577
+ P[a].rightIcon
562
578
  ),
563
579
  children: [
564
- O && /* @__PURE__ */ e(
580
+ _ && /* @__PURE__ */ t(
565
581
  "button",
566
582
  {
567
583
  type: "button",
568
- onClick: ie,
569
- className: n(
584
+ onClick: R,
585
+ className: s(
570
586
  "flex items-center justify-center",
571
- Y[a].iconWrapper,
587
+ P[a].iconWrapper,
572
588
  "text-slate-base hover:text-black"
573
589
  ),
574
590
  style: { cursor: "pointer" },
575
- children: /* @__PURE__ */ e("span", { className: n("flex items-center justify-center", Y[a].icon), children: /* @__PURE__ */ e(pe, { className: n("h-full w-full") }) })
591
+ children: /* @__PURE__ */ t("span", { className: s("flex items-center justify-center", P[a].icon), children: /* @__PURE__ */ t(he, { className: s("h-full w-full") }) })
576
592
  }
577
593
  ),
578
- m && !z && /* @__PURE__ */ e(
594
+ c && !$ && /* @__PURE__ */ t(
579
595
  "div",
580
596
  {
581
- className: n("flex items-center justify-center", Y[a].iconWrapper),
582
- children: /* @__PURE__ */ e(
597
+ className: s("flex items-center justify-center", P[a].iconWrapper),
598
+ children: /* @__PURE__ */ t(
583
599
  "span",
584
600
  {
585
- className: n(
601
+ className: s(
586
602
  "flex items-center justify-center",
587
- Y[a].icon,
588
- ae
603
+ P[a].icon,
604
+ H
589
605
  ),
590
- children: m
606
+ children: c
591
607
  }
592
608
  )
593
609
  }
594
610
  ),
595
- z && /* @__PURE__ */ o(me, { children: [
596
- m && /* @__PURE__ */ e(
611
+ $ && /* @__PURE__ */ d(fe, { children: [
612
+ c && /* @__PURE__ */ t(
597
613
  "div",
598
614
  {
599
- className: n(
615
+ className: s(
600
616
  "flex items-center justify-center",
601
- Y[a].iconWrapper
617
+ P[a].iconWrapper
602
618
  ),
603
- children: /* @__PURE__ */ e(
619
+ children: /* @__PURE__ */ t(
604
620
  "span",
605
621
  {
606
- className: n(
622
+ className: s(
607
623
  "flex items-center justify-center",
608
- Y[a].icon,
609
- ae
624
+ P[a].icon,
625
+ H
610
626
  ),
611
- children: m
627
+ children: c
612
628
  }
613
629
  )
614
630
  }
615
631
  ),
616
- /* @__PURE__ */ e(
632
+ /* @__PURE__ */ t(
617
633
  "button",
618
634
  {
619
635
  type: "button",
620
- onClick: te,
621
- className: n(
636
+ onClick: D,
637
+ className: s(
622
638
  "flex items-center justify-center",
623
- Y[a].iconWrapper,
624
- ae
639
+ P[a].iconWrapper,
640
+ H
625
641
  ),
626
- children: /* @__PURE__ */ e(
642
+ children: /* @__PURE__ */ t(
627
643
  "span",
628
644
  {
629
- className: n("flex items-center justify-center cursor-pointer", Y[a].icon),
630
- children: v ? /* @__PURE__ */ e(rt, { weight: "Linear", className: n("h-full w-full") }) : /* @__PURE__ */ e(He, { weight: "Linear", className: n("h-full w-full") })
645
+ className: s("flex items-center justify-center cursor-pointer", P[a].icon),
646
+ children: p ? /* @__PURE__ */ t(nt, { weight: "Linear", className: s("h-full w-full") }) : /* @__PURE__ */ t(Ve, { weight: "Linear", className: s("h-full w-full") })
631
647
  }
632
648
  )
633
649
  }
634
650
  )
635
651
  ] }),
636
- s && u === "right" && !z && /* @__PURE__ */ e(
652
+ l && i === "right" && !$ && /* @__PURE__ */ t(
637
653
  "div",
638
654
  {
639
- className: n("flex items-center justify-center", Y[a].iconWrapper),
640
- children: /* @__PURE__ */ e(
655
+ className: s("flex items-center justify-center", P[a].iconWrapper),
656
+ children: /* @__PURE__ */ t(
641
657
  "span",
642
658
  {
643
- className: n(
659
+ className: s(
644
660
  "flex items-center justify-center",
645
- Y[a].icon,
646
- ae
661
+ P[a].icon,
662
+ H
647
663
  ),
648
- children: s
664
+ children: l
649
665
  }
650
666
  )
651
667
  }
@@ -654,12 +670,12 @@ const Ie = fe(
654
670
  }
655
671
  )
656
672
  ] }),
657
- c && /* @__PURE__ */ e("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: c })
673
+ o && /* @__PURE__ */ t("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: o })
658
674
  ] });
659
675
  }
660
676
  );
661
- Ie.displayName = "MciInput";
662
- const At = {
677
+ je.displayName = "MciInput";
678
+ const $t = {
663
679
  uz: {
664
680
  months: [
665
681
  "Yanvar",
@@ -756,253 +772,276 @@ const At = {
756
772
  weekdays: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
757
773
  weekdaysShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
758
774
  }
759
- }, Ft = fe(
775
+ };
776
+ function oe(e) {
777
+ if (!e) return null;
778
+ const r = new Date(e);
779
+ return Number.isNaN(r.getTime()) ? null : r;
780
+ }
781
+ function le(e) {
782
+ return new Date(e.getFullYear(), e.getMonth(), e.getDate());
783
+ }
784
+ function Rt(e, r) {
785
+ if (!e) return "";
786
+ const n = e.getDate().toString().padStart(2, "0"), l = (e.getMonth() + 1).toString().padStart(2, "0"), c = e.getFullYear().toString();
787
+ return r.replace("DD", n).replace("MM", l).replace("YYYY", c);
788
+ }
789
+ function Ot(e) {
790
+ if (!e || e.length !== 10) return null;
791
+ const r = e.replace(/\D/g, "");
792
+ if (r.length !== 8) return null;
793
+ const n = parseInt(r.slice(0, 2), 10), l = parseInt(r.slice(2, 4), 10), c = parseInt(r.slice(4, 8), 10);
794
+ if (c < 1e3 || l < 1 || l > 12 || n < 1 || n > 31) return null;
795
+ const i = new Date(c, l - 1, n);
796
+ return i.getFullYear() !== c || i.getMonth() !== l - 1 || i.getDate() !== n ? null : i;
797
+ }
798
+ function Pt(e) {
799
+ let r = e.replace(/\D/g, "");
800
+ return r.length > 8 && (r = r.slice(0, 8)), r.length > 4 ? `${r.slice(0, 2)}.${r.slice(2, 4)}.${r.slice(4)}` : r.length > 2 ? `${r.slice(0, 2)}.${r.slice(2)}` : r;
801
+ }
802
+ function Bt(e, r, n) {
803
+ const l = le(e);
804
+ return !!(r && l < le(r) || n && l > le(n));
805
+ }
806
+ function zt(e, r) {
807
+ return new Date(e.getFullYear(), e.getMonth() + r, 1);
808
+ }
809
+ function _t(e, r) {
810
+ return new Date(e.getFullYear() + r, e.getMonth(), 1);
811
+ }
812
+ function Wt(e) {
813
+ const r = e.getFullYear(), n = e.getMonth(), l = new Date(r, n, 1).getDay(), c = new Date(r, n + 1, 0).getDate(), i = [];
814
+ for (let o = l; o > 0; o -= 1)
815
+ i.push({ date: new Date(r, n, 1 - o), isCurrentMonth: !1 });
816
+ for (let o = 1; o <= c; o += 1)
817
+ i.push({ date: new Date(r, n, o), isCurrentMonth: !0 });
818
+ const a = 42 - i.length;
819
+ for (let o = 1; o <= a; o += 1)
820
+ i.push({ date: new Date(r, n + 1, o), isCurrentMonth: !1 });
821
+ return i;
822
+ }
823
+ function Yt(e, r) {
824
+ return le(e).getTime() === le(r).getTime();
825
+ }
826
+ const Ht = me(
760
827
  ({
761
- type: t = "date",
762
- value: l,
763
- onChange: r,
764
- placeholder: s,
765
- label: m,
766
- disabled: u = !1,
828
+ type: e = "date",
829
+ value: r,
830
+ onChange: n,
831
+ placeholder: l,
832
+ label: c,
833
+ disabled: i = !1,
767
834
  required: a = !1,
768
- className: c,
769
- format: N = "DD.MM.YYYY",
770
- minDate: y,
771
- maxDate: C,
772
- error: F,
773
- showClear: I = !0,
774
- allowManualInput: R = !0,
775
- locale: w = "uz",
776
- startView: k = "day",
777
- iconPosition: b = "left",
778
- align: j = "auto"
779
- }, S) => {
780
- const [x, h] = H(!1), [A, M] = H(
781
- t === "range" ? [null, null] : null
782
- ), [D, i] = H([null, null]), d = P((f) => {
783
- if (!f) return null;
784
- const g = new Date(f);
785
- return isNaN(g.getTime()) ? null : g;
786
- }, []), [v, E] = H(/* @__PURE__ */ new Date()), [B, z] = H(k), [O, W] = H(0), [J, G] = H(""), [K, le] = H(j), oe = de(null), te = U(() => {
787
- const f = l !== void 0 ? l : A;
788
- if (t === "date") return d(f);
789
- const g = f;
790
- return [d(g[0]), d(g[1])];
791
- }, [l, A, t, d]), ie = At[w], Y = P((f) => new Date(f.getFullYear(), f.getMonth(), f.getDate()), []), X = P(
792
- (f) => {
793
- if (!f) return "";
794
- const g = f.getDate().toString().padStart(2, "0"), L = (f.getMonth() + 1).toString().padStart(2, "0"), Z = f.getFullYear();
795
- return N.replace("DD", g).replace("MM", L).replace("YYYY", Z.toString());
796
- },
797
- [N]
798
- ), ae = P((f) => {
799
- if (!f || f.length !== 10) return null;
800
- const g = f.replace(/\D/g, "");
801
- if (g.length !== 8) return null;
802
- const L = parseInt(g.slice(0, 2), 10), Z = parseInt(g.slice(2, 4), 10), q = parseInt(g.slice(4, 8), 10);
803
- if (q < 1e3 || Z < 1 || Z > 12 || L < 1 || L > 31) return null;
804
- const re = new Date(q, Z - 1, L);
805
- return re.getFullYear() !== q || re.getMonth() !== Z - 1 || re.getDate() !== L ? null : re;
806
- }, []), p = P(
807
- (f) => {
808
- const g = Y(f);
809
- return !!(y && g < Y(y) || C && g > Y(C));
810
- },
811
- [y, C, Y]
812
- ), $ = U(() => {
813
- if (t === "date") return X(te);
814
- const [f, g] = te;
815
- return !f && !g ? "" : f && g ? `${X(f)} - ${X(g)}` : f ? `${X(f)} - ...` : "...";
816
- }, [t, te, X]);
817
- ee(() => {
818
- x ? J === "" && $ !== "" && G($) : G($);
819
- }, [$, x]), ee(() => {
820
- if (x)
821
- if (t === "range") {
822
- const f = te;
823
- i(f), f[0] ? E(f[0]) : f[1] ? E(f[1]) : E(/* @__PURE__ */ new Date());
835
+ className: o,
836
+ format: g = "DD.MM.YYYY",
837
+ minDate: b,
838
+ maxDate: y,
839
+ error: k,
840
+ showClear: T = !0,
841
+ allowManualInput: E = !0,
842
+ locale: S = "uz",
843
+ startView: h = "day",
844
+ iconPosition: w = "left",
845
+ align: A = "auto"
846
+ }, L) => {
847
+ const [v, f] = z(!1), [I, N] = z(
848
+ e === "range" ? [null, null] : null
849
+ ), [M, m] = z([null, null]), [u, p] = z(/* @__PURE__ */ new Date()), [j, F] = z(h), [$, _] = z(0), [V, Z] = z(""), [ne, X] = z(A), ee = se(null), J = U(() => {
850
+ const x = r !== void 0 ? r : I;
851
+ if (e === "date") return oe(x);
852
+ const C = x;
853
+ return [oe(C[0]), oe(C[1])];
854
+ }, [r, I, e]), D = $t[S], R = O(
855
+ (x) => Rt(x, g),
856
+ [g]
857
+ ), P = O(
858
+ (x) => Bt(x, b, y),
859
+ [b, y]
860
+ ), W = U(() => {
861
+ if (e === "date") return R(J);
862
+ const [x, C] = J;
863
+ return !x && !C ? "" : x && C ? `${R(x)} - ${R(C)}` : x ? `${R(x)} - ...` : "...";
864
+ }, [e, J, R]);
865
+ G(() => {
866
+ v ? V === "" && W !== "" && Z(W) : Z(W);
867
+ }, [W, v, V]), G(() => {
868
+ if (v)
869
+ if (e === "range") {
870
+ const x = J;
871
+ m(x), x[0] ? p(x[0]) : x[1] ? p(x[1]) : p(/* @__PURE__ */ new Date());
824
872
  } else {
825
- const f = te;
826
- E(f || /* @__PURE__ */ new Date());
873
+ const x = J;
874
+ p(x || /* @__PURE__ */ new Date());
827
875
  }
828
- }, [x]), ee(() => {
829
- if (x && j === "auto" && oe.current) {
830
- const f = oe.current.getBoundingClientRect(), g = window.innerWidth - f.right, L = f.left;
831
- g < 300 && L > 300 ? le("right") : le("left");
876
+ }, [v, e, J]), G(() => {
877
+ if (v && A === "auto" && ee.current) {
878
+ const x = ee.current.getBoundingClientRect(), C = window.innerWidth - x.right, B = x.left;
879
+ C < 300 && B > 300 ? X("right") : X("left");
832
880
  }
833
- }, [x, j]);
834
- const V = P(() => {
835
- h(!1), z(k), W(0), G($);
836
- }, [k, $]), _ = P((f) => {
837
- u || (f.preventDefault(), f.stopPropagation(), h((g) => !g));
838
- }, [u]), { handleClick: T } = Se(oe, V), { handleEscape: Q } = Le(V);
839
- ee(() => {
840
- if (x)
841
- return document.addEventListener("mousedown", T), document.addEventListener("keydown", Q), () => {
842
- document.removeEventListener("mousedown", T), document.removeEventListener("keydown", Q);
881
+ }, [v, A]);
882
+ const H = O(() => {
883
+ f(!1), F(h), _(0), Z(W);
884
+ }, [h, W]), Q = O((x) => {
885
+ i || (x.preventDefault(), x.stopPropagation(), f((C) => !C));
886
+ }, [i]), { handleClick: q } = Me(ee, H), { handleEscape: ie } = Le(H);
887
+ G(() => {
888
+ if (v)
889
+ return document.addEventListener("mousedown", q), document.addEventListener("keydown", ie), () => {
890
+ document.removeEventListener("mousedown", q), document.removeEventListener("keydown", ie);
843
891
  };
844
- }, [x, T, Q]);
845
- const ue = () => {
846
- u || x || (t === "range" || !R) && (h(!0), z(k));
847
- }, we = (f) => {
848
- if (t !== "date") return;
849
- let L = f.target.value.replace(/\D/g, "");
850
- L.length > 8 && (L = L.slice(0, 8));
851
- let Z = "";
852
- if (L.length > 4 ? Z = `${L.slice(0, 2)}.${L.slice(2, 4)}.${L.slice(4)}` : L.length > 2 ? Z = `${L.slice(0, 2)}.${L.slice(2)}` : Z = L, G(Z), Z.length === 10) {
853
- const q = ae(Z);
854
- q && !p(q) && (M(q), r?.(q), E(q));
855
- } else Z === "" && (M(null), r?.(null));
856
- }, _e = P(() => {
857
- const f = t === "range" ? [null, null] : null;
858
- M(f), i([null, null]), r?.(f), G("");
859
- }, [t, r]), Ue = P(
860
- (f) => {
861
- if (p(f)) return;
862
- const g = Y(f);
863
- if (t === "date")
864
- M(g), r?.(g), G(X(g)), V();
892
+ }, [v, q, ie]);
893
+ const xe = () => {
894
+ i || v || (e === "range" || !E) && (f(!0), F(h));
895
+ }, Y = (x) => {
896
+ if (e !== "date") return;
897
+ const C = x.target.value, B = Pt(C);
898
+ if (Z(B), B.length === 10) {
899
+ const te = Ot(B);
900
+ te && !P(te) && (N(te), n?.(te), p(te));
901
+ } else B === "" && (N(null), n?.(null));
902
+ }, ce = O(() => {
903
+ const x = e === "range" ? [null, null] : null;
904
+ N(x), m([null, null]), n?.(x), Z("");
905
+ }, [e, n]), qe = O(
906
+ (x) => {
907
+ if (P(x)) return;
908
+ const C = le(x);
909
+ if (e === "date")
910
+ N(C), n?.(C), Z(R(C)), H();
865
911
  else {
866
- const [L, Z] = D;
867
- if (!L && !Z || L && Z)
868
- i([g, null]), G(`${X(g)} - ...`);
869
- else if (L && !Z) {
870
- const q = g < L ? [g, L] : [L, g];
871
- i(q), M(q), r?.(q);
872
- const [re, ce] = q;
873
- G(`${X(re)} - ${X(ce)}`), V();
912
+ const [B, te] = M;
913
+ if (!B && !te || B && te)
914
+ m([C, null]), Z(`${R(C)} - ...`);
915
+ else if (B && !te) {
916
+ const re = C < B ? [C, B] : [B, C];
917
+ m(re), N(re), n?.(re);
918
+ const [de, ae] = re;
919
+ Z(`${R(de)} - ${R(ae)}`), H();
874
920
  }
875
921
  }
876
922
  },
877
- [t, D, p, Y, r, V, X]
878
- ), Ze = P((f) => {
879
- const g = new Date(v.getFullYear(), f, 1);
880
- E(g), k === "month" && t === "date" ? (M(g), r?.(g), G(X(g)), V()) : z("day");
881
- }, [v, k, r, V, t, X]), qe = P((f) => {
882
- const g = new Date(f, v.getMonth(), 1);
883
- E(g), k === "year" && t === "date" ? (M(g), r?.(g), G(X(g)), V()) : z("month");
884
- }, [v, k, r, V, t, X]), je = (f) => {
885
- E((g) => new Date(g.getFullYear(), g.getMonth() + f, 1));
886
- }, ve = (f) => {
887
- E((g) => new Date(g.getFullYear() + f, g.getMonth(), 1));
888
- }, Je = P((f) => {
889
- const g = f.getFullYear(), L = f.getMonth(), Z = new Date(g, L, 1).getDay(), q = new Date(g, L + 1, 0).getDate(), re = [];
890
- for (let se = Z; se > 0; se--) re.push({ date: new Date(g, L, 1 - se), isCurrentMonth: !1 });
891
- for (let se = 1; se <= q; se++) re.push({ date: new Date(g, L, se), isCurrentMonth: !0 });
892
- const ce = 42 - re.length;
893
- for (let se = 1; se <= ce; se++) re.push({ date: new Date(g, L + 1, se), isCurrentMonth: !1 });
894
- return re;
895
- }, []), ye = P((f, g) => Y(f).getTime() === Y(g).getTime(), [Y]), Ke = (f) => {
896
- const g = Y(f);
897
- if (t === "date") return te && ye(g, te);
898
- const [L] = D[0] ? D : te;
899
- return d(L) && ye(g, d(L));
900
- }, Ge = (f) => {
901
- if (t !== "range") return !1;
902
- const g = Y(f), [, L] = D[1] ? D : te;
903
- return d(L) && ye(g, d(L));
904
- }, Xe = (f) => {
905
- if (t !== "range") return !1;
906
- const g = Y(f), [L, Z] = D[0] ? D : te, q = d(L), re = d(Z);
907
- return q && !re ? !1 : q && re && g > Y(q) && g < Y(re);
908
- }, Te = (f, g, L) => {
909
- const Z = Je(f);
910
- return /* @__PURE__ */ o("div", { className: "w-[300px] p-2 select-none", children: [
911
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4 py-1", children: [
912
- /* @__PURE__ */ e("div", { className: "flex gap-2 w-16", children: g && /* @__PURE__ */ o(me, { children: [
913
- /* @__PURE__ */ e("button", { onClick: () => ve(-1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(lt, { size: 18 }) }),
914
- /* @__PURE__ */ e("button", { onClick: () => je(-1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(Ce, { size: 18 }) })
923
+ [e, M, P, n, H, R]
924
+ ), Ge = O((x) => {
925
+ const C = new Date(u.getFullYear(), x, 1);
926
+ p(C), h === "month" && e === "date" ? (N(C), n?.(C), Z(R(C)), H()) : F("day");
927
+ }, [u, h, n, H, e, R]), Je = O((x) => {
928
+ const C = new Date(x, u.getMonth(), 1);
929
+ p(C), h === "year" && e === "date" ? (N(C), n?.(C), Z(R(C)), H()) : F("month");
930
+ }, [u, h, n, H, e, R]), $e = (x) => {
931
+ p((C) => zt(C, x));
932
+ }, we = (x) => {
933
+ p((C) => _t(C, x));
934
+ }, ye = O((x, C) => Yt(x, C), []), Ke = (x) => {
935
+ const C = le(x);
936
+ if (e === "date") return J && ye(C, J);
937
+ const [B] = M[0] ? M : J;
938
+ return oe(B) && ye(C, oe(B));
939
+ }, Xe = (x) => {
940
+ if (e !== "range") return !1;
941
+ const C = le(x), [, B] = M[1] ? M : J;
942
+ return oe(B) && ye(C, oe(B));
943
+ }, Qe = (x) => {
944
+ if (e !== "range") return !1;
945
+ const C = le(x), [B, te] = M[0] ? M : J, re = oe(B), de = oe(te);
946
+ return re && !de ? !1 : re && de && C > le(re) && C < le(de);
947
+ }, Re = (x, C, B) => {
948
+ const te = Wt(x);
949
+ return /* @__PURE__ */ d("div", { className: "w-[300px] p-2 select-none", children: [
950
+ /* @__PURE__ */ d("div", { className: "flex items-center justify-between mb-4 py-1", children: [
951
+ /* @__PURE__ */ t("div", { className: "flex gap-2 w-16", children: C && /* @__PURE__ */ d(fe, { children: [
952
+ /* @__PURE__ */ t("button", { onClick: () => we(-1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ t(st, { size: 18 }) }),
953
+ /* @__PURE__ */ t("button", { onClick: () => $e(-1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ t(Ce, { size: 18 }) })
915
954
  ] }) }),
916
- /* @__PURE__ */ o("div", { className: "flex gap-1 font-semibold text-slate-700 text-sm whitespace-nowrap", children: [
917
- /* @__PURE__ */ e("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => z("month"), children: ie.months[f.getMonth()] }),
918
- /* @__PURE__ */ e("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => z("year"), children: f.getFullYear() })
955
+ /* @__PURE__ */ d("div", { className: "flex gap-1 font-semibold text-slate-700 text-sm whitespace-nowrap", children: [
956
+ /* @__PURE__ */ t("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => F("month"), children: D.months[x.getMonth()] }),
957
+ /* @__PURE__ */ t("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => F("year"), children: x.getFullYear() })
919
958
  ] }),
920
- /* @__PURE__ */ e("div", { className: "flex gap-2 w-16 justify-end", children: L && /* @__PURE__ */ o(me, { children: [
921
- /* @__PURE__ */ e("button", { onClick: () => je(1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(xe, { size: 18 }) }),
922
- /* @__PURE__ */ e("button", { onClick: () => ve(1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(st, { size: 18 }) })
959
+ /* @__PURE__ */ t("div", { className: "flex gap-2 w-16 justify-end", children: B && /* @__PURE__ */ d(fe, { children: [
960
+ /* @__PURE__ */ t("button", { onClick: () => $e(1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ t(be, { size: 18 }) }),
961
+ /* @__PURE__ */ t("button", { onClick: () => we(1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ t(at, { size: 18 }) })
923
962
  ] }) })
924
963
  ] }),
925
- /* @__PURE__ */ e("div", { className: "grid grid-cols-7 mb-1 text-center text-[11px] font-bold text-blue-600 uppercase", children: ie.weekdaysShort.map((q) => /* @__PURE__ */ e("div", { className: "py-1", children: q }, q)) }),
926
- /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-y-1 relative", children: Z.map((q, re) => {
927
- const ce = q.date, se = p(ce), Ne = Ke(ce), ke = Ge(ce), tt = Xe(ce);
928
- return /* @__PURE__ */ e("div", { className: n("h-10 flex items-center justify-center relative", tt && "bg-blue-50", Ne && t === "range" && ke ? "bg-blue-50 rounded-full" : Ne && t === "range" ? "bg-gradient-to-r from-transparent to-blue-50 rounded-l-full" : "", ke && t === "range" ? "bg-gradient-to-l from-transparent to-blue-50 rounded-r-full" : ""), children: /* @__PURE__ */ e("button", { type: "button", onClick: () => Ue(ce), disabled: se, className: n("w-9 h-9 cursor-pointer rounded-full flex items-center justify-center text-sm font-medium transition-all z-10", q.isCurrentMonth ? "text-slate-700" : "text-slate-300", se && "opacity-20 cursor-not-allowed", Ne || ke ? "bg-blue-600 text-white shadow-md shadow-blue-200 hover:bg-blue-700" : "hover:bg-blue-50", ye(ce, /* @__PURE__ */ new Date()) && !Ne && !ke && "text-blue-600 border border-blue-600"), children: ce.getDate() }) }, re);
964
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-7 mb-1 text-center text-[11px] font-bold text-blue-600 uppercase", children: D.weekdaysShort.map((re) => /* @__PURE__ */ t("div", { className: "py-1", children: re }, re)) }),
965
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-7 gap-y-1 relative", children: te.map((re, de) => {
966
+ const ae = re.date, Pe = P(ae), ve = Ke(ae), Ne = Xe(ae), rt = Qe(ae);
967
+ return /* @__PURE__ */ t("div", { className: s("h-10 flex items-center justify-center relative", rt && "bg-blue-50", ve && e === "range" && Ne ? "bg-blue-50 rounded-full" : ve && e === "range" ? "bg-gradient-to-r from-transparent to-blue-50 rounded-l-full" : "", Ne && e === "range" ? "bg-gradient-to-l from-transparent to-blue-50 rounded-r-full" : ""), children: /* @__PURE__ */ t("button", { type: "button", onClick: () => qe(ae), disabled: Pe, className: s("w-9 h-9 cursor-pointer rounded-full flex items-center justify-center text-sm font-medium transition-all z-10", re.isCurrentMonth ? "text-slate-700" : "text-slate-300", Pe && "opacity-20 cursor-not-allowed", ve || Ne ? "bg-blue-600 text-white shadow-md shadow-blue-200 hover:bg-blue-700" : "hover:bg-blue-50", ye(ae, /* @__PURE__ */ new Date()) && !ve && !Ne && "text-blue-600 border border-blue-600"), children: ae.getDate() }) }, de);
929
968
  }) })
930
969
  ] });
931
- }, Qe = () => /* @__PURE__ */ o("div", { className: "w-[300px] p-3", children: [
932
- /* @__PURE__ */ o("div", { className: "flex justify-between items-center mb-4 px-2", children: [
933
- /* @__PURE__ */ e("button", { type: "button", onClick: () => ve(-1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(Ce, { size: 20 }) }),
934
- /* @__PURE__ */ e("span", { className: "font-bold text-slate-800", children: v.getFullYear() }),
935
- /* @__PURE__ */ e("button", { type: "button", onClick: () => ve(1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(xe, { size: 20 }) })
970
+ }, et = () => /* @__PURE__ */ d("div", { className: "w-[300px] p-3", children: [
971
+ /* @__PURE__ */ d("div", { className: "flex justify-between items-center mb-4 px-2", children: [
972
+ /* @__PURE__ */ t("button", { type: "button", onClick: () => we(-1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ t(Ce, { size: 20 }) }),
973
+ /* @__PURE__ */ t("span", { className: "font-bold text-slate-800", children: u.getFullYear() }),
974
+ /* @__PURE__ */ t("button", { type: "button", onClick: () => we(1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ t(be, { size: 20 }) })
936
975
  ] }),
937
- /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: ie.monthsShort.map((f, g) => /* @__PURE__ */ e("button", { type: "button", onClick: () => Ze(g), className: n("hover:cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors", v.getMonth() === g ? "bg-blue-600 text-white" : "hover:bg-blue-50 text-slate-600"), children: f }, f)) })
938
- ] }), et = () => {
939
- const f = Math.floor(v.getFullYear() / 12) * 12 + O * 12, g = Array.from({ length: 12 }, (L, Z) => f + Z);
940
- return /* @__PURE__ */ o("div", { className: "w-[300px] p-3", children: [
941
- /* @__PURE__ */ o("div", { className: "flex justify-between items-center mb-4 px-2", children: [
942
- /* @__PURE__ */ e("button", { type: "button", onClick: () => W((L) => L - 1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(Ce, { size: 20 }) }),
943
- /* @__PURE__ */ o("span", { className: "font-bold text-slate-800", children: [
944
- g[0],
976
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-3 gap-2", children: D.monthsShort.map((x, C) => /* @__PURE__ */ t("button", { type: "button", onClick: () => Ge(C), className: s("hover:cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors", u.getMonth() === C ? "bg-blue-600 text-white" : "hover:bg-blue-50 text-slate-600"), children: x }, x)) })
977
+ ] }), tt = () => {
978
+ const x = Math.floor(u.getFullYear() / 12) * 12 + $ * 12, C = Array.from({ length: 12 }, (B, te) => x + te);
979
+ return /* @__PURE__ */ d("div", { className: "w-[300px] p-3", children: [
980
+ /* @__PURE__ */ d("div", { className: "flex justify-between items-center mb-4 px-2", children: [
981
+ /* @__PURE__ */ t("button", { type: "button", onClick: () => _((B) => B - 1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ t(Ce, { size: 20 }) }),
982
+ /* @__PURE__ */ d("span", { className: "font-bold text-slate-800", children: [
983
+ C[0],
945
984
  " - ",
946
- g[11]
985
+ C[11]
947
986
  ] }),
948
- /* @__PURE__ */ e("button", { type: "button", onClick: () => W((L) => L + 1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(xe, { size: 20 }) })
987
+ /* @__PURE__ */ t("button", { type: "button", onClick: () => _((B) => B + 1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ t(be, { size: 20 }) })
949
988
  ] }),
950
- /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: g.map((L) => /* @__PURE__ */ e("button", { type: "button", onClick: () => qe(L), className: n("hover:cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors", v.getFullYear() === L ? "bg-blue-600 text-white" : "hover:bg-blue-50 text-slate-600"), children: L }, L)) })
989
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-3 gap-2", children: C.map((B) => /* @__PURE__ */ t("button", { type: "button", onClick: () => Je(B), className: s("hover:cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors", u.getFullYear() === B ? "bg-blue-600 text-white" : "hover:bg-blue-50 text-slate-600"), children: B }, B)) })
951
990
  ] });
952
- }, Re = /* @__PURE__ */ e(
991
+ }, Oe = /* @__PURE__ */ t(
953
992
  "div",
954
993
  {
955
- onClick: _,
956
- className: n(
994
+ onClick: Q,
995
+ className: s(
957
996
  "cursor-pointer flex items-center justify-center p-1 rounded-md transition-colors",
958
- u ? "pointer-events-none opacity-50" : "hover:bg-slate-100 active:bg-slate-200"
997
+ i ? "pointer-events-none opacity-50" : "hover:bg-slate-100 active:bg-slate-200"
959
998
  ),
960
- children: /* @__PURE__ */ e(nt, { weight: "Linear", size: 20, className: "text-slate-400" })
999
+ children: /* @__PURE__ */ t(lt, { weight: "Linear", size: 20, className: "text-slate-400" })
961
1000
  }
962
1001
  );
963
- return /* @__PURE__ */ o("div", { ref: oe, className: n("relative w-full group", c), children: [
964
- /* @__PURE__ */ e("div", { ref: S, children: /* @__PURE__ */ e(
965
- Ie,
1002
+ return /* @__PURE__ */ d("div", { ref: ee, className: s("relative w-full group", o), children: [
1003
+ /* @__PURE__ */ t("div", { ref: L, children: /* @__PURE__ */ t(
1004
+ je,
966
1005
  {
967
- label: m,
968
- placeholder: Array.isArray(s) ? s[0] : s,
969
- value: J,
970
- onChange: we,
971
- icon: b === "left" ? Re : void 0,
972
- rightIcon: b === "right" ? Re : void 0,
973
- disabled: u,
1006
+ label: c,
1007
+ placeholder: Array.isArray(l) ? l[0] : l,
1008
+ value: V,
1009
+ onChange: Y,
1010
+ icon: w === "left" ? Oe : void 0,
1011
+ rightIcon: w === "right" ? Oe : void 0,
1012
+ disabled: i,
974
1013
  required: a,
975
- error: F,
976
- maxLength: t === "date" ? 10 : void 0,
977
- onFocus: ue,
978
- readOnly: !R || t === "range",
979
- showClearButton: I,
980
- onClear: _e
1014
+ error: k,
1015
+ maxLength: e === "date" ? 10 : void 0,
1016
+ onFocus: xe,
1017
+ readOnly: !E || e === "range",
1018
+ showClearButton: T,
1019
+ onClear: ce
981
1020
  }
982
1021
  ) }),
983
- x && /* @__PURE__ */ e(
1022
+ v && /* @__PURE__ */ t(
984
1023
  "div",
985
1024
  {
986
- className: n(
1025
+ className: s(
987
1026
  "absolute top-[calc(100%+4px)] z-[100] bg-white rounded-xl shadow-xl border border-slate-200",
988
1027
  "flex flex-col md:flex-row overflow-hidden animate-in fade-in zoom-in-95 duration-200",
989
- K === "right" && "right-0 origin-top-right",
990
- K === "left" && "left-0 origin-top-left",
991
- K === "center" && "left-1/2 -translate-x-1/2 origin-top"
1028
+ ne === "right" && "right-0 origin-top-right",
1029
+ ne === "left" && "left-0 origin-top-left",
1030
+ ne === "center" && "left-1/2 -translate-x-1/2 origin-top"
992
1031
  ),
993
1032
  style: { width: "max-content" },
994
- onMouseDown: (f) => f.stopPropagation(),
995
- children: B === "day" ? /* @__PURE__ */ o(me, { children: [
996
- Te(v, !0, t !== "range"),
997
- t === "range" && /* @__PURE__ */ e("div", { className: "hidden md:block border-l border-slate-100", children: Te(new Date(v.getFullYear(), v.getMonth() + 1, 1), !1, !0) })
998
- ] }) : B === "month" ? Qe() : et()
1033
+ onMouseDown: (x) => x.stopPropagation(),
1034
+ children: j === "day" ? /* @__PURE__ */ d(fe, { children: [
1035
+ Re(u, !0, e !== "range"),
1036
+ e === "range" && /* @__PURE__ */ t("div", { className: "hidden md:block border-l border-slate-100", children: Re(new Date(u.getFullYear(), u.getMonth() + 1, 1), !1, !0) })
1037
+ ] }) : j === "month" ? et() : tt()
999
1038
  }
1000
1039
  )
1001
1040
  ] });
1002
1041
  }
1003
1042
  );
1004
- Ft.displayName = "MciPicker";
1005
- const Et = {
1043
+ Ht.displayName = "MciPicker";
1044
+ const Ut = {
1006
1045
  sm: {
1007
1046
  container: "h-9 text-sm",
1008
1047
  padding: "px-2",
@@ -1036,379 +1075,392 @@ const Et = {
1036
1075
  label: "text-base",
1037
1076
  dropdown: "text-base"
1038
1077
  }
1039
- }, Lt = fe(
1078
+ };
1079
+ function Vt(e, r, n, l) {
1080
+ if (!n || l) return e;
1081
+ const c = r.toLowerCase();
1082
+ return e.filter((i) => i.label.toLowerCase().includes(c));
1083
+ }
1084
+ function Zt(e, r) {
1085
+ return e ? "border-slate-200 bg-slate-100 text-slate-400 cursor-not-allowed" : r ? "border-red-600 focus:border-red-600 shadow-red bg-white" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600 bg-white";
1086
+ }
1087
+ function qt(e, r, n, l) {
1088
+ return e ? "text-slate-400" : r ? "text-red-600" : n || l ? "text-black" : "text-slate-400";
1089
+ }
1090
+ const Gt = me(
1040
1091
  ({
1041
- label: t,
1042
- placeholder: l = "Выберите...",
1043
- options: r = [],
1044
- icon: s,
1045
- iconPosition: m = "left",
1046
- size: u = "base",
1092
+ label: e,
1093
+ placeholder: r = "Выберите...",
1094
+ options: n = [],
1095
+ icon: l,
1096
+ iconPosition: c = "left",
1097
+ size: i = "base",
1047
1098
  error: a,
1048
- disabled: c = !1,
1049
- required: N = !1,
1050
- value: y,
1051
- onChange: C,
1052
- onFocus: F,
1053
- onBlur: I,
1054
- className: R,
1055
- clearable: w = !1,
1056
- searchable: k = !1,
1057
- onSearch: b,
1058
- name: j
1059
- }, S) => {
1060
- const [x, h] = H(!1), [A, M] = H(!1), [D, i] = H(""), [d, v] = H(""), [E, B] = H(-1), z = de(null), O = de(null), W = y !== void 0 ? y : D, J = r.find((T) => T.value === W), G = W !== "" && W !== void 0, K = Et[u], le = U(() => {
1061
- if (!k || b) return r;
1062
- const T = d.toLowerCase();
1063
- return r.filter(
1064
- (Q) => Q.label.toLowerCase().includes(T)
1065
- );
1066
- }, [r, d, k, b]), oe = P(() => {
1067
- h(!1), M(!1), v(""), B(-1), I?.();
1068
- }, [I]), { handleClick: te } = Se(z, oe), { handleEscape: ie } = Le(oe);
1069
- ee(() => {
1070
- if (x)
1071
- return document.addEventListener("mousedown", te), document.addEventListener("keydown", ie), () => {
1072
- document.removeEventListener("mousedown", te), document.removeEventListener("keydown", ie);
1099
+ disabled: o = !1,
1100
+ required: g = !1,
1101
+ value: b,
1102
+ onChange: y,
1103
+ onFocus: k,
1104
+ onBlur: T,
1105
+ className: E,
1106
+ clearable: S = !1,
1107
+ searchable: h = !1,
1108
+ onSearch: w,
1109
+ name: A
1110
+ }, L) => {
1111
+ const [v, f] = z(!1), [I, N] = z(!1), [M, m] = z(""), [u, p] = z(""), [j, F] = z(-1), $ = se(null), _ = se(null), V = b !== void 0 ? b : M, Z = n.find((Y) => Y.value === V), ne = V !== "" && V !== void 0, X = Ut[i], ee = U(() => Vt(n, u, h, !!w), [n, u, h, w]), J = O(() => {
1112
+ f(!1), N(!1), p(""), F(-1), T?.();
1113
+ }, [T]), { handleClick: D } = Me($, J), { handleEscape: R } = Le(J);
1114
+ G(() => {
1115
+ if (v)
1116
+ return document.addEventListener("mousedown", D), document.addEventListener("keydown", R), () => {
1117
+ document.removeEventListener("mousedown", D), document.removeEventListener("keydown", R);
1073
1118
  };
1074
- }, [x, te, ie]), ee(() => {
1075
- x && k && O.current && O.current.focus();
1076
- }, [x, k]);
1077
- const Y = P(
1078
- (T) => {
1079
- if (!c) {
1080
- if (!x && (T.key === "ArrowDown" || T.key === "ArrowUp" || T.key === "Enter")) {
1081
- T.preventDefault(), h(!0);
1119
+ }, [v, D, R]), G(() => {
1120
+ v && h && _.current && _.current.focus();
1121
+ }, [v, h]);
1122
+ const P = O(() => {
1123
+ o || (f((Y) => !Y), v ? (p(""), F(-1)) : (N(!0), k?.()));
1124
+ }, [o, v, k]), W = O(
1125
+ (Y) => {
1126
+ b === void 0 && m(Y), y?.(Y), f(!1), N(!1), p(""), F(-1), T?.();
1127
+ },
1128
+ [b, y, T]
1129
+ ), H = O(
1130
+ (Y) => {
1131
+ if (!o) {
1132
+ if (!v && (Y.key === "ArrowDown" || Y.key === "ArrowUp" || Y.key === "Enter")) {
1133
+ Y.preventDefault(), f(!0);
1082
1134
  return;
1083
1135
  }
1084
- if (x)
1085
- switch (T.key) {
1136
+ if (v)
1137
+ switch (Y.key) {
1086
1138
  case "ArrowDown":
1087
- T.preventDefault(), B(
1088
- (Q) => Q < le.length - 1 ? Q + 1 : 0
1139
+ Y.preventDefault(), F(
1140
+ (ce) => ce < ee.length - 1 ? ce + 1 : 0
1089
1141
  );
1090
1142
  break;
1091
1143
  case "ArrowUp":
1092
- T.preventDefault(), B(
1093
- (Q) => Q > 0 ? Q - 1 : le.length - 1
1144
+ Y.preventDefault(), F(
1145
+ (ce) => ce > 0 ? ce - 1 : ee.length - 1
1094
1146
  );
1095
1147
  break;
1096
1148
  case "Enter":
1097
- T.preventDefault(), E >= 0 && le[E] && ae(le[E].value);
1149
+ Y.preventDefault(), j >= 0 && ee[j] && W(ee[j].value);
1098
1150
  break;
1099
1151
  }
1100
1152
  }
1101
1153
  },
1102
- [x, le, E, c]
1103
- ), X = P(() => {
1104
- c || (h((T) => !T), x ? (v(""), B(-1)) : (M(!0), F?.()));
1105
- }, [c, x, F]), ae = P(
1106
- (T) => {
1107
- y === void 0 && i(T), C?.(T), h(!1), M(!1), v(""), B(-1), I?.();
1154
+ [v, ee, j, o, W]
1155
+ ), Q = O(
1156
+ (Y) => {
1157
+ Y.stopPropagation(), !o && (b === void 0 && m(""), y?.(""), p(""), F(-1));
1108
1158
  },
1109
- [y, C, I]
1110
- ), p = P(
1111
- (T) => {
1112
- T.stopPropagation(), !c && (y === void 0 && i(""), C?.(""), v(""), B(-1));
1159
+ [b, y, o]
1160
+ ), q = O(
1161
+ (Y) => {
1162
+ p(Y), w?.(Y), F(0);
1113
1163
  },
1114
- [y, C, c]
1115
- ), $ = P(
1116
- (T) => {
1117
- v(T), b?.(T), B(0);
1118
- },
1119
- [b]
1120
- ), V = U(() => c ? "border-slate-200 bg-slate-100 text-slate-400 cursor-not-allowed" : a ? "border-red-600 focus:border-red-600 shadow-red bg-white" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600 bg-white", [a, c]), _ = U(() => c ? "text-slate-400" : a ? "text-red-600" : x || A ? "text-black" : "text-slate-400", [c, a, x, A]);
1121
- return /* @__PURE__ */ o("div", { className: n("w-full", R), ref: S, children: [
1122
- t && /* @__PURE__ */ o(
1164
+ [w]
1165
+ ), ie = U(() => Zt(o, a), [a, o]), xe = U(
1166
+ () => qt(o, a, v, I),
1167
+ [o, a, v, I]
1168
+ );
1169
+ return /* @__PURE__ */ d("div", { className: s("w-full", E), ref: L, children: [
1170
+ e && /* @__PURE__ */ d(
1123
1171
  "label",
1124
1172
  {
1125
- htmlFor: j,
1126
- className: n(
1173
+ htmlFor: A,
1174
+ className: s(
1127
1175
  "mb-2 block text-base font-medium",
1128
1176
  a ? "text-red-600" : "text-slate-700",
1129
- K.label
1177
+ X.label
1130
1178
  ),
1131
1179
  children: [
1132
- t,
1133
- N && /* @__PURE__ */ e("span", { className: "ml-1 text-red-600", children: "*" })
1180
+ e,
1181
+ g && /* @__PURE__ */ t("span", { className: "ml-1 text-red-600", children: "*" })
1134
1182
  ]
1135
1183
  }
1136
1184
  ),
1137
- /* @__PURE__ */ o(
1185
+ /* @__PURE__ */ d(
1138
1186
  "div",
1139
1187
  {
1140
- ref: z,
1188
+ ref: $,
1141
1189
  className: "relative",
1142
- onKeyDown: Y,
1190
+ onKeyDown: H,
1143
1191
  children: [
1144
- /* @__PURE__ */ o(
1192
+ /* @__PURE__ */ d(
1145
1193
  "div",
1146
1194
  {
1147
1195
  role: "combobox",
1148
- "aria-expanded": x,
1196
+ "aria-expanded": v,
1149
1197
  "aria-haspopup": "listbox",
1150
- "aria-controls": `${j}-listbox`,
1151
- "aria-disabled": c,
1152
- tabIndex: c ? -1 : 0,
1153
- onClick: X,
1154
- className: n(
1198
+ "aria-controls": `${A}-listbox`,
1199
+ "aria-disabled": o,
1200
+ tabIndex: o ? -1 : 0,
1201
+ onClick: P,
1202
+ className: s(
1155
1203
  "flex w-full items-center border font-normal transition-all duration-300 ease-in-out",
1156
- u === "base" ? "rounded-xl" : "rounded-lg",
1157
- K.container,
1158
- s ? m === "left" ? K.iconPaddingLeft : K.iconPaddingRight : K.padding,
1159
- V,
1160
- !c && A && "shadow-blue border-blue-600"
1204
+ i === "base" ? "rounded-xl" : "rounded-lg",
1205
+ X.container,
1206
+ l ? c === "left" ? X.iconPaddingLeft : X.iconPaddingRight : X.padding,
1207
+ ie,
1208
+ !o && I && "shadow-blue border-blue-600"
1161
1209
  ),
1162
1210
  children: [
1163
- s && /* @__PURE__ */ e(
1211
+ l && /* @__PURE__ */ t(
1164
1212
  "div",
1165
1213
  {
1166
- className: n(
1214
+ className: s(
1167
1215
  "absolute top-1/2 -translate-y-1/2 pointer-events-none transition-colors duration-300",
1168
- m === "left" ? K.iconWrapper : K.rightIconWrapper,
1169
- _
1216
+ c === "left" ? X.iconWrapper : X.rightIconWrapper,
1217
+ xe
1170
1218
  ),
1171
- children: s
1219
+ children: l
1172
1220
  }
1173
1221
  ),
1174
- k && x ? /* @__PURE__ */ e(
1222
+ h && v ? /* @__PURE__ */ t(
1175
1223
  "input",
1176
1224
  {
1177
- ref: O,
1225
+ ref: _,
1178
1226
  type: "text",
1179
- value: d,
1180
- onChange: (T) => $(T.target.value),
1181
- placeholder: l,
1227
+ value: u,
1228
+ onChange: (Y) => q(Y.target.value),
1229
+ placeholder: r,
1182
1230
  className: "w-full bg-transparent outline-none",
1183
- onClick: (T) => T.stopPropagation()
1231
+ onClick: (Y) => Y.stopPropagation()
1184
1232
  }
1185
- ) : /* @__PURE__ */ e(
1233
+ ) : /* @__PURE__ */ t(
1186
1234
  "span",
1187
1235
  {
1188
- className: n(
1236
+ className: s(
1189
1237
  "block truncate select-none",
1190
- !G && !c && "text-slate-400"
1238
+ !ne && !o && "text-slate-400"
1191
1239
  ),
1192
- children: J?.label || l
1240
+ children: Z?.label || r
1193
1241
  }
1194
1242
  ),
1195
- w && G && !c && /* @__PURE__ */ e(
1243
+ S && ne && !o && /* @__PURE__ */ t(
1196
1244
  "button",
1197
1245
  {
1198
1246
  type: "button",
1199
- onClick: p,
1200
- className: n(
1247
+ onClick: Q,
1248
+ className: s(
1201
1249
  "absolute top-1/2 -translate-y-1/2 text-slate-400 hover:text-black transition-colors cursor-pointer",
1202
- s && m === "left" ? "right-8" : "right-10"
1250
+ l && c === "left" ? "right-8" : "right-10"
1203
1251
  ),
1204
1252
  "aria-label": "Очистить",
1205
- children: /* @__PURE__ */ e(pe, { className: K.iconSize })
1253
+ children: /* @__PURE__ */ t(he, { className: X.iconSize })
1206
1254
  }
1207
1255
  ),
1208
- /* @__PURE__ */ e(
1256
+ /* @__PURE__ */ t(
1209
1257
  "div",
1210
1258
  {
1211
- className: n(
1259
+ className: s(
1212
1260
  "absolute top-1/2 right-3 -translate-y-1/2 pointer-events-none transition-all duration-300",
1213
- x && "rotate-180",
1214
- _
1261
+ v && "rotate-180",
1262
+ xe
1215
1263
  ),
1216
- children: /* @__PURE__ */ e(Ee, { className: K.iconSize })
1264
+ children: /* @__PURE__ */ t(Fe, { className: X.iconSize })
1217
1265
  }
1218
1266
  )
1219
1267
  ]
1220
1268
  }
1221
1269
  ),
1222
- x && !c && /* @__PURE__ */ e(
1270
+ v && !o && /* @__PURE__ */ t(
1223
1271
  "div",
1224
1272
  {
1225
- id: `${j}-listbox`,
1273
+ id: `${A}-listbox`,
1226
1274
  role: "listbox",
1227
- className: n(
1275
+ className: s(
1228
1276
  "absolute z-50 mt-1 max-h-60 w-full overflow-y-auto rounded-lg border border-slate-200 bg-white shadow-md p-1 text-black",
1229
- K.dropdown
1277
+ X.dropdown
1230
1278
  ),
1231
- children: le.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-center text-base font-normal text-slate-500", children: "Ничего не найдено" }) : le.map((T) => /* @__PURE__ */ e(
1279
+ children: ee.length === 0 ? /* @__PURE__ */ t("div", { className: "px-3 py-2 text-center text-base font-normal text-slate-500", children: "Ничего не найдено" }) : ee.map((Y) => /* @__PURE__ */ t(
1232
1280
  "div",
1233
1281
  {
1234
1282
  role: "option",
1235
- "aria-selected": W === T.value,
1236
- onClick: () => ae(T.value),
1237
- className: n(
1283
+ "aria-selected": V === Y.value,
1284
+ onClick: () => W(Y.value),
1285
+ className: s(
1238
1286
  "cursor-pointer px-3 py-2 font-normal transition-colors hover:bg-slate-100 rounded-sm",
1239
- W === T.value ? "bg-slate-100" : ""
1287
+ V === Y.value ? "bg-slate-100" : ""
1240
1288
  ),
1241
- children: T.label
1289
+ children: Y.label
1242
1290
  },
1243
- T.value
1291
+ Y.value
1244
1292
  ))
1245
1293
  }
1246
1294
  )
1247
1295
  ]
1248
1296
  }
1249
1297
  ),
1250
- a && /* @__PURE__ */ e("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: a })
1298
+ a && /* @__PURE__ */ t("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: a })
1251
1299
  ] });
1252
1300
  }
1253
1301
  );
1254
- Lt.displayName = "MciSelect";
1255
- function It(t) {
1256
- if (t != null)
1257
- return typeof t == "number" ? `${t}px` : t;
1302
+ Gt.displayName = "MciSelect";
1303
+ function Jt({ children: e, title: r }) {
1304
+ return /* @__PURE__ */ t("div", { className: "min-w-0", children: /* @__PURE__ */ t("div", { className: "clamp-2 break-words", title: r ?? (typeof e == "string" ? e : void 0), children: e }) });
1258
1305
  }
1259
- function jt({ children: t, title: l }) {
1260
- return /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("div", { className: "clamp-2 break-words", title: l ?? (typeof t == "string" ? t : void 0), children: t }) });
1306
+ function Kt(e) {
1307
+ if (e != null)
1308
+ return typeof e == "number" ? `${e}px` : e;
1261
1309
  }
1262
- function nr({
1263
- columns: t,
1264
- data: l = [],
1265
- loading: r = !1,
1266
- skeletonRows: s = 5,
1267
- noDataText: m = "",
1268
- sort: u,
1310
+ function Xt(e, r, n) {
1311
+ return !r || n ? e : [...e].sort((l, c) => {
1312
+ const i = l[r.key], a = c[r.key];
1313
+ return i == null ? 1 : a == null ? -1 : i < a ? r.direction === "asc" ? -1 : 1 : i > a ? r.direction === "asc" ? 1 : -1 : 0;
1314
+ });
1315
+ }
1316
+ function qr({
1317
+ columns: e,
1318
+ data: r = [],
1319
+ loading: n = !1,
1320
+ skeletonRows: l = 5,
1321
+ noDataText: c = "",
1322
+ sort: i,
1269
1323
  onSortChange: a,
1270
- className: c,
1271
- headerClassName: N,
1272
- bodyClassName: y,
1273
- rowKey: C = "id",
1274
- rowSelection: F
1324
+ className: o,
1325
+ headerClassName: g,
1326
+ bodyClassName: b,
1327
+ rowKey: y = "id",
1328
+ rowSelection: k
1275
1329
  }) {
1276
- const [I, R] = H(
1277
- null
1278
- ), w = u ?? I, k = U(() => Array.isArray(l) ? l : [], [l]), b = U(() => !w || u ? k : [...k].sort((i, d) => {
1279
- const v = i[w.key], E = d[w.key];
1280
- return v == null ? 1 : E == null ? -1 : v < E ? w.direction === "asc" ? -1 : 1 : v > E ? w.direction === "asc" ? 1 : -1 : 0;
1281
- }), [k, w, u]);
1282
- ee(() => {
1283
- u !== void 0 && R(null);
1284
- }, [u]);
1285
- const j = r ? [] : u ? k : b, S = P(
1286
- (i) => {
1287
- if (!i.sortable) return;
1288
- let d = null;
1289
- w?.key !== i.key ? d = { key: i.key, direction: "asc" } : w.direction === "asc" && (d = { key: i.key, direction: "desc" }), u !== void 0 ? a?.(d) : R(d);
1330
+ const [T, E] = z(null), S = i ?? T, h = U(() => Array.isArray(r) ? r : [], [r]), w = U(() => Xt(h, S, !!i), [h, S, i]);
1331
+ G(() => {
1332
+ i !== void 0 && E(null);
1333
+ }, [i]);
1334
+ const A = U(
1335
+ () => n ? [] : i ? h : w,
1336
+ [n, i, h, w]
1337
+ ), L = O(
1338
+ (m) => {
1339
+ if (!m.sortable) return;
1340
+ let u = null;
1341
+ S?.key !== m.key ? u = { key: m.key, direction: "asc" } : S.direction === "asc" && (u = { key: m.key, direction: "desc" }), i !== void 0 ? a?.(u) : E(u);
1290
1342
  },
1291
- [w, u, a]
1292
- ), x = (i) => {
1293
- if (!F) return;
1294
- const { onChange: d, getCheckboxProps: v } = F;
1295
- if (i.target.checked) {
1296
- const z = j.filter((O) => !v?.(O)?.disabled).map((O) => O[C]);
1297
- d(z);
1343
+ [S, i, a]
1344
+ ), v = (m) => {
1345
+ if (!k) return;
1346
+ const { onChange: u, getCheckboxProps: p } = k;
1347
+ if (m.target.checked) {
1348
+ const $ = A.filter((_) => !p?.(_)?.disabled).map((_) => _[y]);
1349
+ u($);
1298
1350
  } else
1299
- d([]);
1300
- }, h = (i, d) => {
1301
- if (!F) return;
1302
- const { selectedRowKeys: v, onChange: E } = F, B = i[C], z = d ? [...v, B] : v.filter((O) => O !== B);
1303
- E(z);
1304
- }, A = U(() => {
1305
- if (!F || j.length === 0) return !1;
1306
- const i = j.filter((d) => !F.getCheckboxProps?.(d)?.disabled);
1307
- return i.length === 0 ? !1 : i.every(
1308
- (d) => F.selectedRowKeys.includes(d[C])
1351
+ u([]);
1352
+ }, f = (m, u) => {
1353
+ if (!k) return;
1354
+ const { selectedRowKeys: p, onChange: j } = k, F = m[y], $ = u ? [...p, F] : p.filter((_) => _ !== F);
1355
+ j($);
1356
+ }, I = U(() => {
1357
+ if (!k || A.length === 0) return !1;
1358
+ const m = A.filter((u) => !k.getCheckboxProps?.(u)?.disabled);
1359
+ return m.length === 0 ? !1 : m.every(
1360
+ (u) => k.selectedRowKeys.includes(u[y])
1309
1361
  );
1310
- }, [F, j, C]), M = (i) => i.sortable ? !w || w.key !== i.key ? /* @__PURE__ */ e(ot, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : w.direction === "asc" ? /* @__PURE__ */ e(it, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : /* @__PURE__ */ e(ct, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : null, D = () => /* @__PURE__ */ o("colgroup", { children: [
1311
- F && /* @__PURE__ */ e("col", { style: { width: 48 } }),
1312
- t.map((i) => /* @__PURE__ */ e("col", { style: { width: It(i.width) ?? "auto" } }, i.key))
1362
+ }, [k, A, y]), N = (m) => m.sortable ? !S || S.key !== m.key ? /* @__PURE__ */ t(it, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : S.direction === "asc" ? /* @__PURE__ */ t(ct, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : /* @__PURE__ */ t(dt, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : null, M = () => /* @__PURE__ */ d("colgroup", { children: [
1363
+ k && /* @__PURE__ */ t("col", { style: { width: 48 } }),
1364
+ e.map((m) => /* @__PURE__ */ t("col", { style: { width: Kt(m.width) ?? "auto" } }, m.key))
1313
1365
  ] });
1314
- return /* @__PURE__ */ e(
1366
+ return /* @__PURE__ */ t(
1315
1367
  "div",
1316
1368
  {
1317
- className: n(
1369
+ className: s(
1318
1370
  "w-full overflow-x-auto pb-0.5",
1319
1371
  "[&::-webkit-scrollbar]:h-1",
1320
1372
  "[&::-webkit-scrollbar-track]:bg-transparent",
1321
1373
  "[&::-webkit-scrollbar-thumb]:bg-slate-200",
1322
1374
  "[&::-webkit-scrollbar-thumb]:rounded-full",
1323
1375
  "hover:[&::-webkit-scrollbar-thumb]:bg-slate-300",
1324
- c
1376
+ o
1325
1377
  ),
1326
- children: /* @__PURE__ */ o("div", { className: "inline-block min-w-full align-middle", children: [
1327
- /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-slate-100", children: /* @__PURE__ */ o("table", { className: "w-full table-fixed", children: [
1328
- D(),
1329
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { children: [
1330
- F && /* @__PURE__ */ e("th", { className: n("w-12 px-4 py-3", N), children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ e(
1378
+ children: /* @__PURE__ */ d("div", { className: "inline-block min-w-full align-middle", children: [
1379
+ /* @__PURE__ */ t("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-slate-100", children: /* @__PURE__ */ d("table", { className: "w-full table-fixed", children: [
1380
+ M(),
1381
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ d("tr", { children: [
1382
+ k && /* @__PURE__ */ t("th", { className: s("w-12 px-4 py-3", g), children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ t(
1331
1383
  De,
1332
1384
  {
1333
- checked: A,
1334
- onChange: x,
1385
+ checked: I,
1386
+ onChange: v,
1335
1387
  variant: "yellow",
1336
- disabled: r || j.length === 0
1388
+ disabled: n || A.length === 0
1337
1389
  }
1338
1390
  ) }) }),
1339
- t.map((i) => /* @__PURE__ */ e(
1391
+ e.map((m) => /* @__PURE__ */ t(
1340
1392
  "th",
1341
1393
  {
1342
- onClick: () => S(i),
1343
- className: n(
1394
+ onClick: () => L(m),
1395
+ className: s(
1344
1396
  "px-4 py-3 text-left text-sm font-medium text-slate-700 transition-colors",
1345
1397
  "whitespace-nowrap overflow-hidden text-ellipsis",
1346
- i.align === "center" && "text-center",
1347
- i.align === "right" && "text-right",
1348
- i.sortable && "cursor-pointer hover:bg-slate-200",
1349
- N
1398
+ m.align === "center" && "text-center",
1399
+ m.align === "right" && "text-right",
1400
+ m.sortable && "cursor-pointer hover:bg-slate-200",
1401
+ g
1350
1402
  ),
1351
- children: /* @__PURE__ */ o("div", { className: n("flex items-center gap-2 min-w-0", i.align === "right" && "justify-end"), children: [
1352
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", title: i.title, children: i.title }),
1353
- M(i)
1403
+ children: /* @__PURE__ */ d("div", { className: s("flex items-center gap-2 min-w-0", m.align === "right" && "justify-end"), children: [
1404
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate", title: m.title, children: m.title }),
1405
+ N(m)
1354
1406
  ] })
1355
1407
  },
1356
- i.key
1408
+ m.key
1357
1409
  ))
1358
1410
  ] }) })
1359
1411
  ] }) }),
1360
- /* @__PURE__ */ e("div", { className: "rounded-xl border border-t-0 border-slate-200 bg-white overflow-hidden", children: /* @__PURE__ */ o("table", { className: "w-full table-fixed", children: [
1361
- D(),
1362
- /* @__PURE__ */ e("tbody", { className: "divide-y divide-slate-200", children: r ? Array.from({ length: s }).map((i, d) => /* @__PURE__ */ o("tr", { children: [
1363
- F && /* @__PURE__ */ e("td", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ e(Pe, { height: 20, width: 20, variant: "rounded" }) }),
1364
- t.map((v) => /* @__PURE__ */ e("td", { className: "px-4 py-3", children: /* @__PURE__ */ e(Pe, { height: 30, variant: "rounded" }) }, v.key))
1365
- ] }, d)) : j.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: t.length + (F ? 1 : 0), className: "py-20", children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center", children: [
1366
- /* @__PURE__ */ e("div", { className: "relative mb-4", children: /* @__PURE__ */ e(at, { weight: "Bold", size: 64, className: "animate-float text-slate-400" }) }),
1367
- /* @__PURE__ */ e("p", { className: "text-sm font-medium text-slate-400", children: m })
1368
- ] }) }) }) : j.map((i, d) => {
1369
- const v = i[C], E = F?.selectedRowKeys.includes(v), B = F?.getCheckboxProps?.(i)?.disabled;
1370
- return /* @__PURE__ */ o("tr", { className: "group transition-colors hover:bg-slate-50", children: [
1371
- F && /* @__PURE__ */ e("td", { className: n("w-12 px-4 py-3 align-top", y), children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center pt-1", children: /* @__PURE__ */ e(
1412
+ /* @__PURE__ */ t("div", { className: "rounded-xl border border-t-0 border-slate-200 bg-white overflow-hidden", children: /* @__PURE__ */ d("table", { className: "w-full table-fixed", children: [
1413
+ M(),
1414
+ /* @__PURE__ */ t("tbody", { className: "divide-y divide-slate-200", children: n ? Array.from({ length: l }).map((m, u) => /* @__PURE__ */ d("tr", { children: [
1415
+ k && /* @__PURE__ */ t("td", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ t(Be, { height: 20, width: 20, variant: "rounded" }) }),
1416
+ e.map((p) => /* @__PURE__ */ t("td", { className: "px-4 py-3", children: /* @__PURE__ */ t(Be, { height: 30, variant: "rounded" }) }, p.key))
1417
+ ] }, u)) : A.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: e.length + (k ? 1 : 0), className: "py-20", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center", children: [
1418
+ /* @__PURE__ */ t("div", { className: "relative mb-4", children: /* @__PURE__ */ t(ot, { weight: "Bold", size: 64, className: "animate-float text-slate-400" }) }),
1419
+ /* @__PURE__ */ t("p", { className: "text-sm font-medium text-slate-400", children: c })
1420
+ ] }) }) }) : A.map((m, u) => {
1421
+ const p = m[y], j = k?.selectedRowKeys.includes(p), F = k?.getCheckboxProps?.(m)?.disabled;
1422
+ return /* @__PURE__ */ d("tr", { className: "group transition-colors hover:bg-slate-50", children: [
1423
+ k && /* @__PURE__ */ t("td", { className: s("w-12 px-4 py-3 align-top", b), children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center pt-1", children: /* @__PURE__ */ t(
1372
1424
  De,
1373
1425
  {
1374
- checked: E,
1375
- disabled: B,
1426
+ checked: j,
1427
+ disabled: F,
1376
1428
  variant: "yellow",
1377
- onChange: (z) => h(i, z.target.checked)
1429
+ onChange: ($) => f(m, $.target.checked)
1378
1430
  }
1379
1431
  ) }) }),
1380
- t.map((z) => {
1381
- const O = i[z.key], W = z.render ? z.render(O, i) : String(O ?? "-");
1382
- return /* @__PURE__ */ e(
1432
+ e.map(($) => {
1433
+ const _ = m[$.key], V = $.render ? $.render(_, m) : String(_ ?? "-");
1434
+ return /* @__PURE__ */ t(
1383
1435
  "td",
1384
1436
  {
1385
- className: n(
1437
+ className: s(
1386
1438
  "align-top px-4 py-3 text-sm font-normal text-black",
1387
1439
  "min-w-0 whitespace-normal",
1388
- z.align === "center" && "text-center",
1389
- z.align === "right" && "text-right",
1390
- y,
1391
- z.className
1440
+ $.align === "center" && "text-center",
1441
+ $.align === "right" && "text-right",
1442
+ b,
1443
+ $.className
1392
1444
  ),
1393
- children: /* @__PURE__ */ e(jt, { title: typeof W == "string" ? W : void 0, children: W })
1445
+ children: /* @__PURE__ */ t(Jt, { title: typeof V == "string" ? V : void 0, children: V })
1394
1446
  },
1395
- z.key
1447
+ $.key
1396
1448
  );
1397
1449
  })
1398
- ] }, d);
1450
+ ] }, u);
1399
1451
  }) })
1400
1452
  ] }) })
1401
1453
  ] })
1402
1454
  }
1403
1455
  );
1404
1456
  }
1405
- const Tt = {
1457
+ const Qt = {
1406
1458
  uz: {
1407
1459
  dragAndDrop: "Faylni bu yerga torting",
1408
1460
  clickToUpload: "yoki bosib tanlang",
1409
1461
  or: "yoki",
1410
1462
  dropHereTitle: "Faylni shu yerga yuklang",
1411
- fileRequirements: (t, l, r, s) => `${t ? `Maksimum ${l} ta fayl` : "1 ta fayl"} • ${r}MB gacha • ${s !== "*/*" ? `Format: ${s}` : "Barcha formatlar"}`,
1463
+ fileRequirements: (e, r, n, l) => `${e ? `Maksimum ${r} ta fayl` : "1 ta fayl"} • ${n}MB gacha • ${l !== "*/*" ? `Format: ${l}` : "Barcha formatlar"}`,
1412
1464
  selectedFiles: "Tanlangan fayllar",
1413
1465
  clearAll: "Barchasini o‘chirish",
1414
1466
  uploading: "Yuklanmoqda...",
@@ -1417,9 +1469,9 @@ const Tt = {
1417
1469
  preview: "Ko‘rish",
1418
1470
  download: "Yuklab olish",
1419
1471
  remove: "O‘chirish",
1420
- maxFilesError: (t) => `Maksimum ${t} ta fayl yuklash mumkin`,
1421
- fileSizeError: (t, l) => `"${t}" fayl hajmi ${l}MB dan kichik bo‘lishi kerak`,
1422
- fileTypeError: (t) => `"${t}" fayl turi qabul qilinmaydi`,
1472
+ maxFilesError: (e) => `Maksimum ${e} ta fayl yuklash mumkin`,
1473
+ fileSizeError: (e, r) => `"${e}" fayl hajmi ${r}MB dan kichik bo‘lishi kerak`,
1474
+ fileTypeError: (e) => `"${e}" fayl turi qabul qilinmaydi`,
1423
1475
  uploadFailed: "Yuklash muvaffaqiyatsiz tugadi",
1424
1476
  file: "Fayl",
1425
1477
  image: "Rasm",
@@ -1432,7 +1484,7 @@ const Tt = {
1432
1484
  clickToUpload: "или выберите нажатием",
1433
1485
  or: "или",
1434
1486
  dropHereTitle: "Загрузите свой файл сюда",
1435
- fileRequirements: (t, l, r, s) => `${t ? `Максимум ${l} файлов` : "1 файл"} • До ${r}MB • ${s !== "*/*" ? `Формат: ${s}` : "Все форматы"}`,
1487
+ fileRequirements: (e, r, n, l) => `${e ? `Максимум ${r} файлов` : "1 файл"} • До ${n}MB • ${l !== "*/*" ? `Формат: ${l}` : "Все форматы"}`,
1436
1488
  selectedFiles: "Выбранные файлы",
1437
1489
  clearAll: "Очистить все",
1438
1490
  uploading: "Загружается...",
@@ -1441,9 +1493,9 @@ const Tt = {
1441
1493
  preview: "Просмотр",
1442
1494
  download: "Скачать",
1443
1495
  remove: "Удалить",
1444
- maxFilesError: (t) => `Можно загрузить максимум ${t} файлов`,
1445
- fileSizeError: (t, l) => `Размер файла "${t}" должен быть меньше ${l}MB`,
1446
- fileTypeError: (t) => `Тип файла "${t}" не поддерживается`,
1496
+ maxFilesError: (e) => `Можно загрузить максимум ${e} файлов`,
1497
+ fileSizeError: (e, r) => `Размер файла "${e}" должен быть меньше ${r}MB`,
1498
+ fileTypeError: (e) => `Тип файла "${e}" не поддерживается`,
1447
1499
  uploadFailed: "Не удалось загрузить файл",
1448
1500
  file: "Файл",
1449
1501
  image: "Изображение",
@@ -1456,7 +1508,7 @@ const Tt = {
1456
1508
  clickToUpload: "or click to select",
1457
1509
  or: "or",
1458
1510
  dropHereTitle: "Upload your file here",
1459
- fileRequirements: (t, l, r, s) => `${t ? `Up to ${l} files` : "1 file"} • Up to ${r}MB • ${s !== "*/*" ? `Format: ${s}` : "All formats"}`,
1511
+ fileRequirements: (e, r, n, l) => `${e ? `Up to ${r} files` : "1 file"} • Up to ${n}MB • ${l !== "*/*" ? `Format: ${l}` : "All formats"}`,
1460
1512
  selectedFiles: "Selected files",
1461
1513
  clearAll: "Clear all",
1462
1514
  uploading: "Uploading...",
@@ -1465,9 +1517,9 @@ const Tt = {
1465
1517
  preview: "Preview",
1466
1518
  download: "Download",
1467
1519
  remove: "Remove",
1468
- maxFilesError: (t) => `You can upload up to ${t} files`,
1469
- fileSizeError: (t, l) => `File "${t}" must be smaller than ${l}MB`,
1470
- fileTypeError: (t) => `File type "${t}" is not supported`,
1520
+ maxFilesError: (e) => `You can upload up to ${e} files`,
1521
+ fileSizeError: (e, r) => `File "${e}" must be smaller than ${r}MB`,
1522
+ fileTypeError: (e) => `File type "${e}" is not supported`,
1471
1523
  uploadFailed: "Upload failed",
1472
1524
  file: "File",
1473
1525
  image: "Image",
@@ -1475,438 +1527,452 @@ const Tt = {
1475
1527
  audio: "Audio",
1476
1528
  document: "Document"
1477
1529
  }
1478
- }, lr = ({
1479
- multiple: t = !1,
1480
- accept: l = "*/*",
1481
- maxSize: r = 10,
1482
- maxFiles: s = 5,
1483
- disabled: m = !1,
1484
- label: u,
1485
- required: a = !1,
1486
- error: c,
1487
- className: N,
1488
- onFilesChange: y,
1489
- onUpload: C,
1490
- showPreview: F = !0,
1491
- locale: I = "uz",
1492
- showFileTypeIcon: R = !0,
1493
- variant: w = "yellow",
1494
- customValidator: k
1495
- }) => {
1496
- const [b, j] = H([]), [S, x] = H(!1), [h, A] = H(!1), M = de(null), D = Tt[I], i = w === "blue" ? {
1530
+ };
1531
+ function er(e) {
1532
+ switch (e.type.split("/")[0]) {
1533
+ case "image":
1534
+ return /* @__PURE__ */ t(mt, { className: "h-5 w-5 text-blue-500" });
1535
+ case "video":
1536
+ return /* @__PURE__ */ t(ft, { className: "h-5 w-5 text-purple-500" });
1537
+ case "audio":
1538
+ return /* @__PURE__ */ t(ut, { className: "h-5 w-5 text-green-500" });
1539
+ default:
1540
+ return e.type.includes("pdf") ? /* @__PURE__ */ t(Ae, { className: "h-5 w-5 text-red-500" }) : e.type.includes("word") || e.type.includes("document") ? /* @__PURE__ */ t(Ae, { className: "h-5 w-5 text-blue-600" }) : e.type.includes("excel") || e.type.includes("spreadsheet") ? /* @__PURE__ */ t(Ae, { className: "h-5 w-5 text-green-600" }) : /* @__PURE__ */ t(Ze, { className: "h-5 w-5 text-gray-500" });
1541
+ }
1542
+ }
1543
+ function tr(e) {
1544
+ if (e === 0) return "0 Bytes";
1545
+ const r = 1024, n = ["Bytes", "KB", "MB", "GB"], l = Math.floor(Math.log(e) / Math.log(r));
1546
+ return parseFloat((e / Math.pow(r, l)).toFixed(2)) + " " + n[l];
1547
+ }
1548
+ function rr(e, r) {
1549
+ const n = r * 1024 * 1024;
1550
+ return e.size <= n;
1551
+ }
1552
+ function nr(e, r) {
1553
+ return r === "*/*" ? !0 : r.split(",").map((l) => l.trim()).some((l) => {
1554
+ if (l.endsWith("/*")) {
1555
+ const c = l.replace("/*", "");
1556
+ return e.type.startsWith(c);
1557
+ }
1558
+ return e.type === l || e.name.toLowerCase().endsWith(l.replace("*.", "."));
1559
+ });
1560
+ }
1561
+ function lr(e) {
1562
+ return new Promise((r) => {
1563
+ if (e.type.startsWith("image/")) {
1564
+ const n = new FileReader();
1565
+ n.onload = (l) => r(l.target?.result ?? ""), n.readAsDataURL(e);
1566
+ } else
1567
+ r("");
1568
+ });
1569
+ }
1570
+ const sr = {
1571
+ blue: {
1497
1572
  dropBorder: "border-blue-200 hover:border-blue-300",
1498
1573
  dropBg: "bg-blue-50/40 hover:bg-blue-50/60",
1499
1574
  dropActive: "border-blue-600 bg-blue-50",
1500
1575
  iconWrap: "text-blue-600",
1501
1576
  title: "text-blue-600",
1502
1577
  hint: "text-slate-500",
1578
+ progress: "bg-blue-600/30",
1503
1579
  progressFill: "bg-blue-600",
1504
1580
  fileIconImg: "bg-blue-50 text-blue-600",
1505
1581
  fileIconDoc: "bg-green-50 text-green-600"
1506
- } : {
1582
+ },
1583
+ yellow: {
1507
1584
  dropBorder: "border-yellow-200 hover:border-yellow-300",
1508
1585
  dropBg: "bg-yellow-50/40 hover:bg-yellow-50/60",
1509
1586
  dropActive: "border-yellow-500 bg-yellow-50",
1510
1587
  iconWrap: "text-yellow-700",
1511
1588
  title: "text-yellow-700",
1512
1589
  hint: "text-slate-500",
1590
+ progress: "bg-yellow-600/25",
1513
1591
  progressFill: "bg-yellow-600",
1514
1592
  fileIconImg: "bg-blue-50 text-blue-600",
1515
1593
  fileIconDoc: "bg-green-50 text-green-600"
1516
- }, d = (p) => {
1517
- switch (p.type.split("/")[0]) {
1518
- case "image":
1519
- return /* @__PURE__ */ e(mt, { className: "h-5 w-5 text-blue-500" });
1520
- case "video":
1521
- return /* @__PURE__ */ e(ht, { className: "h-5 w-5 text-purple-500" });
1522
- case "audio":
1523
- return /* @__PURE__ */ e(ut, { className: "h-5 w-5 text-green-500" });
1524
- default:
1525
- return p.type.includes("pdf") ? /* @__PURE__ */ e(Ae, { className: "h-5 w-5 text-red-500" }) : p.type.includes("word") || p.type.includes("document") ? /* @__PURE__ */ e(Ae, { className: "h-5 w-5 text-blue-600" }) : p.type.includes("excel") || p.type.includes("spreadsheet") ? /* @__PURE__ */ e(Ae, { className: "h-5 w-5 text-green-600" }) : /* @__PURE__ */ e($e, { className: "h-5 w-5 text-gray-500" });
1526
- }
1527
- }, v = (p) => {
1528
- if (p === 0) return "0 Bytes";
1529
- const $ = 1024, V = ["Bytes", "KB", "MB", "GB"], _ = Math.floor(Math.log(p) / Math.log($));
1530
- return parseFloat((p / Math.pow($, _)).toFixed(2)) + " " + V[_];
1531
- }, E = (p) => {
1532
- const $ = r * 1024 * 1024;
1533
- return p.size <= $;
1534
- }, B = (p) => l === "*/*" ? !0 : l.split(",").map((V) => V.trim()).some((V) => {
1535
- if (V.endsWith("/*")) {
1536
- const _ = V.replace("/*", "");
1537
- return p.type.startsWith(_);
1538
- }
1539
- return p.type === V || p.name.toLowerCase().endsWith(V.replace("*.", "."));
1540
- }), z = (p) => new Promise(($) => {
1541
- if (p.type.startsWith("image/")) {
1542
- const V = new FileReader();
1543
- V.onload = (_) => $(_.target?.result), V.readAsDataURL(p);
1544
- } else
1545
- $("");
1546
- }), O = de(/* @__PURE__ */ new Map()), W = P((p) => {
1547
- const $ = O.current.get(p);
1548
- $ && (URL.revokeObjectURL($), O.current.delete(p));
1549
- }, []), J = P(() => {
1550
- for (const p of O.current.values())
1551
- URL.revokeObjectURL(p);
1552
- O.current.clear();
1594
+ }
1595
+ }, Gr = ({
1596
+ multiple: e = !1,
1597
+ accept: r = "*/*",
1598
+ maxSize: n = 10,
1599
+ maxFiles: l = 5,
1600
+ disabled: c = !1,
1601
+ label: i,
1602
+ required: a = !1,
1603
+ error: o,
1604
+ className: g,
1605
+ onFilesChange: b,
1606
+ onUpload: y,
1607
+ showPreview: k = !0,
1608
+ locale: T = "uz",
1609
+ showFileTypeIcon: E = !0,
1610
+ variant: S = "yellow",
1611
+ customValidator: h
1612
+ }) => {
1613
+ const [w, A] = z([]), [L, v] = z(!1), [f, I] = z(!1), N = se(null), M = Qt[T], m = U(() => sr[S], [S]), u = se(/* @__PURE__ */ new Map()), p = O((D) => {
1614
+ const R = u.current.get(D);
1615
+ R && (URL.revokeObjectURL(R), u.current.delete(D));
1616
+ }, []), j = O(() => {
1617
+ for (const D of u.current.values())
1618
+ URL.revokeObjectURL(D);
1619
+ u.current.clear();
1553
1620
  }, []);
1554
- ee(() => () => {
1555
- J();
1556
- }, [J]);
1557
- const G = P((p) => {
1558
- let $ = O.current.get(p.id);
1559
- $ || ($ = URL.createObjectURL(p.file), O.current.set(p.id, $), setTimeout(() => W(p.id), 5 * 6e4)), window.open($, "_blank", "noopener,noreferrer");
1560
- }, [W]), K = P(
1561
- async (p) => {
1562
- const $ = Array.from(p), V = [];
1563
- for (const _ of $) {
1564
- if (b.length + V.length >= s) {
1565
- alert(D.maxFilesError(s));
1621
+ G(() => () => {
1622
+ j();
1623
+ }, [j]);
1624
+ const F = O((D) => {
1625
+ let R = u.current.get(D.id);
1626
+ R || (R = URL.createObjectURL(D.file), u.current.set(D.id, R), setTimeout(() => p(D.id), 5 * 6e4)), window.open(R, "_blank", "noopener,noreferrer");
1627
+ }, [p]), $ = O(
1628
+ async (D) => {
1629
+ const R = Array.from(D), P = [];
1630
+ for (const W of R) {
1631
+ if (w.length + P.length >= l) {
1632
+ alert(M.maxFilesError(l));
1566
1633
  break;
1567
1634
  }
1568
- if (!E(_)) {
1569
- alert(D.fileSizeError(_.name, r));
1635
+ if (!rr(W, n)) {
1636
+ alert(M.fileSizeError(W.name, n));
1570
1637
  continue;
1571
1638
  }
1572
- if (!B(_)) {
1573
- alert(D.fileTypeError(_.name));
1639
+ if (!nr(W, r)) {
1640
+ alert(M.fileTypeError(W.name));
1574
1641
  continue;
1575
1642
  }
1576
- if (k) {
1577
- const we = k(_);
1578
- if (we) {
1579
- alert(we);
1643
+ if (h) {
1644
+ const ie = h(W);
1645
+ if (ie) {
1646
+ alert(ie);
1580
1647
  continue;
1581
1648
  }
1582
1649
  }
1583
- const T = await z(_), Q = C ? "uploading" : "success", ue = C ? 0 : 100;
1584
- V.push({
1650
+ const H = await lr(W), Q = y ? "uploading" : "success", q = y ? 0 : 100;
1651
+ P.push({
1585
1652
  id: Math.random().toString(36).substr(2, 9),
1586
- file: _,
1587
- preview: T,
1588
- progress: ue,
1653
+ file: W,
1654
+ preview: H,
1655
+ progress: q,
1589
1656
  status: Q
1590
1657
  });
1591
1658
  }
1592
- if (V.length > 0) {
1593
- const _ = t ? [...b, ...V] : V;
1594
- if (j(_), y?.(_.map((T) => T.file)), C) {
1595
- A(!0);
1659
+ if (P.length > 0) {
1660
+ const W = e ? [...w, ...P] : P;
1661
+ if (A(W), b?.(W.map((H) => H.file)), y) {
1662
+ I(!0);
1596
1663
  try {
1597
- const T = _.map((Q, ue) => ({
1664
+ const H = W.map((Q, q) => ({
1598
1665
  ...Q,
1599
- progress: Math.min(100, (ue + 1) / _.length * 100)
1666
+ progress: Math.min(100, (q + 1) / W.length * 100)
1600
1667
  }));
1601
- j(T), await C(T), j(
1602
- (Q) => Q.map((ue) => ({
1603
- ...ue,
1668
+ A(H), await y(H), A(
1669
+ (Q) => Q.map((q) => ({
1670
+ ...q,
1604
1671
  status: "success",
1605
1672
  progress: 100
1606
1673
  }))
1607
1674
  );
1608
- } catch (T) {
1609
- j(
1610
- (Q) => Q.map((ue) => ({
1611
- ...ue,
1675
+ } catch (H) {
1676
+ A(
1677
+ (Q) => Q.map((q) => ({
1678
+ ...q,
1612
1679
  status: "error",
1613
- error: T instanceof Error ? T.message : D.uploadFailed
1680
+ error: H instanceof Error ? H.message : M.uploadFailed
1614
1681
  }))
1615
1682
  );
1616
1683
  } finally {
1617
- A(!1);
1684
+ I(!1);
1618
1685
  }
1619
1686
  }
1620
1687
  }
1621
1688
  },
1622
1689
  [
1623
- b,
1624
- s,
1625
- E,
1626
- B,
1627
- k,
1628
- D,
1690
+ w,
1691
+ l,
1692
+ h,
1693
+ M,
1629
1694
  r,
1630
- t,
1631
- y,
1632
- C
1695
+ n,
1696
+ e,
1697
+ b,
1698
+ y
1633
1699
  ]
1634
- ), le = P(
1635
- (p) => {
1636
- p.preventDefault(), m || x(!0);
1700
+ ), _ = O(
1701
+ (D) => {
1702
+ D.preventDefault(), c || v(!0);
1637
1703
  },
1638
- [m]
1639
- ), oe = P((p) => {
1640
- p.preventDefault(), x(!1);
1641
- }, []), te = P(
1642
- (p) => {
1643
- if (p.preventDefault(), x(!1), m) return;
1644
- const $ = p.dataTransfer.files;
1645
- $.length > 0 && K($);
1704
+ [c]
1705
+ ), V = O((D) => {
1706
+ D.preventDefault(), v(!1);
1707
+ }, []), Z = O(
1708
+ (D) => {
1709
+ if (D.preventDefault(), v(!1), c) return;
1710
+ const R = D.dataTransfer.files;
1711
+ R.length > 0 && $(R);
1646
1712
  },
1647
- [m, K]
1648
- ), ie = P(
1649
- (p) => {
1650
- const $ = p.target.files;
1651
- $ && $.length > 0 && (K($), M.current && (M.current.value = ""));
1713
+ [c, $]
1714
+ ), ne = O(
1715
+ (D) => {
1716
+ const R = D.target.files;
1717
+ R && R.length > 0 && ($(R), N.current && (N.current.value = ""));
1652
1718
  },
1653
- [K]
1654
- ), Y = P(
1655
- (p) => {
1656
- W(p), j(($) => {
1657
- const V = $.filter((_) => _.id !== p);
1658
- return y?.(V.map((_) => _.file)), V;
1719
+ [$]
1720
+ ), X = O(
1721
+ (D) => {
1722
+ p(D), A((R) => {
1723
+ const P = R.filter((W) => W.id !== D);
1724
+ return b?.(P.map((W) => W.file)), P;
1659
1725
  });
1660
1726
  },
1661
- [y, W]
1662
- ), X = P(() => {
1663
- J(), j([]), y?.([]);
1664
- }, [y, J]), ae = P(() => {
1665
- M.current?.click();
1727
+ [b, p]
1728
+ ), ee = O(() => {
1729
+ j(), A([]), b?.([]);
1730
+ }, [b, j]), J = O(() => {
1731
+ N.current?.click();
1666
1732
  }, []);
1667
- return /* @__PURE__ */ o("div", { className: n("w-full", N), children: [
1668
- u && /* @__PURE__ */ o(
1733
+ return /* @__PURE__ */ d("div", { className: s("w-full", g), children: [
1734
+ i && /* @__PURE__ */ d(
1669
1735
  "label",
1670
1736
  {
1671
- className: n(
1737
+ className: s(
1672
1738
  "mb-2 block text-base font-medium",
1673
- c ? "text-red-600" : "text-slate-700"
1739
+ o ? "text-red-600" : "text-slate-700"
1674
1740
  ),
1675
1741
  children: [
1676
- u,
1677
- a && /* @__PURE__ */ e("span", { className: "ml-1 text-extra-small text-red-600", children: "*" })
1742
+ i,
1743
+ a && /* @__PURE__ */ t("span", { className: "ml-1 text-extra-small text-red-600", children: "*" })
1678
1744
  ]
1679
1745
  }
1680
1746
  ),
1681
- /* @__PURE__ */ o(
1747
+ /* @__PURE__ */ d(
1682
1748
  "div",
1683
1749
  {
1684
- className: n(
1750
+ className: s(
1685
1751
  "group relative flex min-h-[180px] w-full cursor-pointer items-center justify-center rounded-2xl border border-dashed p-6 text-center transition-all duration-300",
1686
- i.dropBorder,
1687
- i.dropBg,
1688
- S && i.dropActive,
1689
- m && "cursor-not-allowed opacity-60",
1690
- c && "border-red-600 bg-red-50/30"
1752
+ m.dropBorder,
1753
+ m.dropBg,
1754
+ L && m.dropActive,
1755
+ c && "cursor-not-allowed opacity-60",
1756
+ o && "border-red-600 bg-red-50/30"
1691
1757
  ),
1692
- onDragOver: le,
1693
- onDragLeave: oe,
1694
- onDrop: te,
1695
- onClick: ae,
1758
+ onDragOver: _,
1759
+ onDragLeave: V,
1760
+ onDrop: Z,
1761
+ onClick: J,
1696
1762
  children: [
1697
- /* @__PURE__ */ e(
1763
+ /* @__PURE__ */ t(
1698
1764
  "input",
1699
1765
  {
1700
- ref: M,
1766
+ ref: N,
1701
1767
  type: "file",
1702
- multiple: t,
1703
- accept: l,
1704
- onChange: ie,
1705
- disabled: m,
1768
+ multiple: e,
1769
+ accept: r,
1770
+ onChange: ne,
1771
+ disabled: c,
1706
1772
  className: "hidden"
1707
1773
  }
1708
1774
  ),
1709
- /* @__PURE__ */ o("div", { className: "flex flex-col items-center gap-3", children: [
1710
- /* @__PURE__ */ e("div", { className: n("flex h-12 w-12 items-center justify-center rounded-xl", i.iconWrap), children: /* @__PURE__ */ e(dt, { size: 20 }) }),
1711
- /* @__PURE__ */ e("p", { className: n("text-base font-medium", i.title), children: D.dropHereTitle }),
1712
- /* @__PURE__ */ e("p", { className: n("text-sm font-normal", i.hint), children: D.fileRequirements(t, s, r, l) })
1775
+ /* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-3", children: [
1776
+ /* @__PURE__ */ t("div", { className: s("flex h-12 w-12 items-center justify-center rounded-xl", m.iconWrap), children: /* @__PURE__ */ t(ht, { size: 20 }) }),
1777
+ /* @__PURE__ */ t("p", { className: s("text-base font-medium", m.title), children: M.dropHereTitle }),
1778
+ /* @__PURE__ */ t("p", { className: s("text-sm font-normal", m.hint), children: M.fileRequirements(e, l, n, r) })
1713
1779
  ] })
1714
1780
  ]
1715
1781
  }
1716
1782
  ),
1717
- b.length > 0 && /* @__PURE__ */ o("div", { className: "mt-4 space-y-3", children: [
1718
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
1719
- /* @__PURE__ */ o("span", { className: "text-sm font-medium text-slate-700", children: [
1720
- D.selectedFiles,
1783
+ w.length > 0 && /* @__PURE__ */ d("div", { className: "mt-4 space-y-3", children: [
1784
+ /* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
1785
+ /* @__PURE__ */ d("span", { className: "text-sm font-medium text-slate-700", children: [
1786
+ M.selectedFiles,
1721
1787
  " (",
1722
- b.length,
1788
+ w.length,
1723
1789
  ")"
1724
1790
  ] }),
1725
- b.length > 1 && /* @__PURE__ */ e(
1791
+ w.length > 1 && /* @__PURE__ */ t(
1726
1792
  "button",
1727
1793
  {
1728
1794
  type: "button",
1729
- onClick: X,
1730
- disabled: m || h,
1795
+ onClick: ee,
1796
+ disabled: c || f,
1731
1797
  className: "text-sm font-medium text-red-600 disabled:opacity-50",
1732
- children: D.clearAll
1798
+ children: M.clearAll
1733
1799
  }
1734
1800
  )
1735
1801
  ] }),
1736
- /* @__PURE__ */ e("div", { className: "space-y-3", children: b.map((p) => {
1737
- const V = !!p.preview ? i.fileIconImg : i.fileIconDoc, _ = m || h || p.status === "uploading";
1738
- return /* @__PURE__ */ o(
1802
+ /* @__PURE__ */ t("div", { className: "space-y-3", children: w.map((D) => {
1803
+ const P = !!D.preview ? m.fileIconImg : m.fileIconDoc, W = c || f || D.status === "uploading";
1804
+ return /* @__PURE__ */ d(
1739
1805
  "div",
1740
1806
  {
1741
- className: n(
1807
+ className: s(
1742
1808
  "flex items-center justify-between rounded-2xl border border-slate-200 p-4",
1743
- p.status === "error" && "border-red-600"
1809
+ D.status === "error" && "border-red-600"
1744
1810
  ),
1745
1811
  children: [
1746
- /* @__PURE__ */ o("div", { className: "flex min-w-0 items-center gap-4", children: [
1747
- /* @__PURE__ */ e(
1812
+ /* @__PURE__ */ d("div", { className: "flex min-w-0 items-center gap-4", children: [
1813
+ /* @__PURE__ */ t(
1748
1814
  "div",
1749
1815
  {
1750
- className: n(
1816
+ className: s(
1751
1817
  "flex h-14 w-14 items-center justify-center rounded-2xl",
1752
- V
1818
+ P
1753
1819
  ),
1754
- children: F && p.preview ? /* @__PURE__ */ e(
1820
+ children: k && D.preview ? /* @__PURE__ */ t(
1755
1821
  "img",
1756
1822
  {
1757
- src: p.preview,
1758
- alt: p.file.name,
1823
+ src: D.preview,
1824
+ alt: D.file.name,
1759
1825
  className: "h-10 w-10 rounded-xl object-cover"
1760
1826
  }
1761
- ) : R ? d(p.file) : /* @__PURE__ */ e($e, { className: "h-6 w-6 text-slate-500" })
1827
+ ) : E ? er(D.file) : /* @__PURE__ */ t(Ze, { className: "h-6 w-6 text-slate-500" })
1762
1828
  }
1763
1829
  ),
1764
- /* @__PURE__ */ o("div", { className: "min-w-0", children: [
1765
- /* @__PURE__ */ e("p", { className: "truncate text-lg font-semibold text-primary", children: p.file.name }),
1766
- /* @__PURE__ */ o("div", { className: "mt-1 flex flex-wrap items-center gap-2 text-sm text-slate-500", children: [
1767
- /* @__PURE__ */ e("span", { children: v(p.file.size) }),
1768
- p.status === "uploading" && /* @__PURE__ */ o(me, { children: [
1769
- /* @__PURE__ */ e("span", { children: "•" }),
1770
- /* @__PURE__ */ o("span", { className: "inline-flex items-center", children: [
1771
- /* @__PURE__ */ e(Ve, { className: "mr-1 h-5 w-5 animate-spin" }),
1772
- D.uploading
1830
+ /* @__PURE__ */ d("div", { className: "min-w-0", children: [
1831
+ /* @__PURE__ */ t("p", { className: "truncate text-lg font-semibold text-primary", children: D.file.name }),
1832
+ /* @__PURE__ */ d("div", { className: "mt-1 flex flex-wrap items-center gap-2 text-sm text-slate-500", children: [
1833
+ /* @__PURE__ */ t("span", { children: tr(D.file.size) }),
1834
+ D.status === "uploading" && /* @__PURE__ */ d(fe, { children: [
1835
+ /* @__PURE__ */ t("span", { children: "•" }),
1836
+ /* @__PURE__ */ d("span", { className: "inline-flex items-center", children: [
1837
+ /* @__PURE__ */ t(Ue, { className: "mr-1 h-5 w-5 animate-spin" }),
1838
+ M.uploading
1773
1839
  ] })
1774
1840
  ] }),
1775
- p.status === "success" && /* @__PURE__ */ o(me, { children: [
1776
- /* @__PURE__ */ e("span", { children: "•" }),
1777
- /* @__PURE__ */ e("span", { className: "font-normal text-green-600", children: D.success })
1841
+ D.status === "success" && /* @__PURE__ */ d(fe, { children: [
1842
+ /* @__PURE__ */ t("span", { children: "•" }),
1843
+ /* @__PURE__ */ t("span", { className: "font-normal text-green-600", children: M.success })
1778
1844
  ] })
1779
1845
  ] }),
1780
- p.status === "uploading" && /* @__PURE__ */ e("div", { className: n("mt-2 h-1.5 w-full rounded-full bg-slate-200"), children: /* @__PURE__ */ e(
1846
+ D.status === "uploading" && /* @__PURE__ */ t("div", { className: s("mt-2 h-1.5 w-full rounded-full bg-slate-200"), children: /* @__PURE__ */ t(
1781
1847
  "div",
1782
1848
  {
1783
- className: n(
1849
+ className: s(
1784
1850
  "h-1.5 rounded-full transition-all duration-300",
1785
- i.progressFill
1851
+ m.progressFill
1786
1852
  ),
1787
- style: { width: `${p.progress}%` }
1853
+ style: { width: `${D.progress}%` }
1788
1854
  }
1789
1855
  ) }),
1790
- p.status === "error" && p.error && /* @__PURE__ */ e("p", { className: "mt-2 text-sm font-normal text-red-600", children: p.error })
1856
+ D.status === "error" && D.error && /* @__PURE__ */ t("p", { className: "mt-2 text-sm font-normal text-red-600", children: D.error })
1791
1857
  ] })
1792
1858
  ] }),
1793
- /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
1794
- /* @__PURE__ */ e(
1859
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1860
+ /* @__PURE__ */ t(
1795
1861
  "button",
1796
1862
  {
1797
1863
  type: "button",
1798
- onClick: (T) => {
1799
- T.stopPropagation(), _ || G(p);
1864
+ onClick: (H) => {
1865
+ H.stopPropagation(), W || F(D);
1800
1866
  },
1801
- disabled: _,
1867
+ disabled: W,
1802
1868
  className: "rounded-xl p-2 hover:bg-slate-100 hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
1803
- title: D.preview,
1804
- children: /* @__PURE__ */ e(He, { size: 20, className: "text-slate-400" })
1869
+ title: M.preview,
1870
+ children: /* @__PURE__ */ t(Ve, { size: 20, className: "text-slate-400" })
1805
1871
  }
1806
1872
  ),
1807
- /* @__PURE__ */ e(
1873
+ /* @__PURE__ */ t(
1808
1874
  "button",
1809
1875
  {
1810
1876
  type: "button",
1811
- onClick: (T) => {
1812
- T.stopPropagation(), Y(p.id);
1877
+ onClick: (H) => {
1878
+ H.stopPropagation(), X(D.id);
1813
1879
  },
1814
- disabled: m || h,
1880
+ disabled: c || f,
1815
1881
  className: "rounded-xl p-2 text-slate-base hover:bg-slate-100 disabled:opacity-50 hover:cursor-pointer",
1816
- title: D.remove,
1817
- children: /* @__PURE__ */ e(pe, { className: "h-6 w-6" })
1882
+ title: M.remove,
1883
+ children: /* @__PURE__ */ t(he, { className: "h-6 w-6" })
1818
1884
  }
1819
1885
  )
1820
1886
  ] })
1821
1887
  ]
1822
1888
  },
1823
- p.id
1889
+ D.id
1824
1890
  );
1825
1891
  }) })
1826
1892
  ] }),
1827
- c && /* @__PURE__ */ e("p", { className: "mt-2 text-sm font-normal text-red-600", children: c })
1893
+ o && /* @__PURE__ */ t("p", { className: "mt-2 text-sm font-normal text-red-600", children: o })
1828
1894
  ] });
1829
1895
  };
1830
- function sr({
1831
- show: t,
1832
- setShow: l,
1833
- title: r,
1834
- description: s,
1835
- Header: m,
1836
- Body: u,
1896
+ function Jr({
1897
+ show: e,
1898
+ setShow: r,
1899
+ title: n,
1900
+ description: l,
1901
+ Header: c,
1902
+ Body: i,
1837
1903
  footer: a,
1838
- handleClickOutside: c = !1,
1839
- showCloseIcon: N = !0,
1840
- showHeader: y = !0,
1841
- overlayClassName: C,
1842
- containerClassName: F,
1843
- bodyClassName: I,
1844
- footerClassName: R
1904
+ handleClickOutside: o = !1,
1905
+ showCloseIcon: g = !0,
1906
+ showHeader: b = !0,
1907
+ overlayClassName: y,
1908
+ containerClassName: k,
1909
+ bodyClassName: T,
1910
+ footerClassName: E
1845
1911
  }) {
1846
- const w = de(null), { handleEscape: k } = Le(() => l(!1));
1847
- ee(() => (t ? (document.addEventListener("keydown", k), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => document.removeEventListener("keydown", k)), [t, k]);
1848
- const { handleClick: b } = Se(w, () => {
1849
- c && l(!1);
1912
+ const S = se(null), { handleEscape: h } = Le(() => r(!1));
1913
+ G(() => (e ? (document.addEventListener("keydown", h), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => document.removeEventListener("keydown", h)), [e, h]);
1914
+ const { handleClick: w } = Me(S, () => {
1915
+ o && r(!1);
1850
1916
  });
1851
- ee(() => (t && c && document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b)), [t, b, c]);
1852
- const S = y && !!(m || r || s);
1853
- return /* @__PURE__ */ e(
1917
+ G(() => (e && o && document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w)), [e, w, o]);
1918
+ const L = b && !!(c || n || l);
1919
+ return /* @__PURE__ */ t(
1854
1920
  "div",
1855
1921
  {
1856
- className: n(
1922
+ className: s(
1857
1923
  "bg-black/40 fixed inset-0 z-50 flex justify-center transition-all duration-500 ease-in-out",
1858
1924
  "items-end sm:items-center",
1859
- t ? "opacity-100" : "pointer-events-none opacity-0",
1860
- C
1925
+ e ? "opacity-100" : "pointer-events-none opacity-0",
1926
+ y
1861
1927
  ),
1862
- children: /* @__PURE__ */ o(
1928
+ children: /* @__PURE__ */ d(
1863
1929
  "div",
1864
1930
  {
1865
- ref: w,
1866
- className: n(
1931
+ ref: S,
1932
+ className: s(
1867
1933
  "relative bg-white w-full",
1868
1934
  "sm:max-w-[720px]",
1869
1935
  "rounded-t-2xl sm:rounded-2xl",
1870
1936
  "transition-all duration-500 ease-out",
1871
- t ? "scale-100 opacity-100" : "scale-95 opacity-0",
1872
- F
1937
+ e ? "scale-100 opacity-100" : "scale-95 opacity-0",
1938
+ k
1873
1939
  ),
1874
1940
  children: [
1875
- S && /* @__PURE__ */ o("div", { className: "border-b border-slate-200 flex items-start justify-between p-4 sm:p-6 mb-4", children: [
1876
- m || /* @__PURE__ */ o("div", { className: "block", children: [
1877
- /* @__PURE__ */ e("h2", { className: "text-h3 font-semibold text-black", children: r }),
1878
- s && /* @__PURE__ */ e("p", { className: "text-base text-slate-base font-normal mt-2", children: s })
1941
+ L && /* @__PURE__ */ d("div", { className: "border-b border-slate-200 flex items-start justify-between p-4 sm:p-6 mb-4", children: [
1942
+ c || /* @__PURE__ */ d("div", { className: "block", children: [
1943
+ /* @__PURE__ */ t("h2", { className: "text-h3 font-semibold text-black", children: n }),
1944
+ l && /* @__PURE__ */ t("p", { className: "text-base text-slate-base font-normal mt-2", children: l })
1879
1945
  ] }),
1880
- N && /* @__PURE__ */ e(
1946
+ g && /* @__PURE__ */ t(
1881
1947
  "button",
1882
1948
  {
1883
- onClick: () => l(!1),
1949
+ onClick: () => r(!1),
1884
1950
  className: "bg-slate-100 rounded-xl w-12 h-12 hover:cursor-pointer text-black transition flex items-center justify-center group",
1885
1951
  "aria-label": "Close modal",
1886
1952
  type: "button",
1887
- children: /* @__PURE__ */ e(pe, { className: "h-6 w-6 transition-transform duration-300 group-hover:rotate-180" })
1953
+ children: /* @__PURE__ */ t(he, { className: "h-6 w-6 transition-transform duration-300 group-hover:rotate-180" })
1888
1954
  }
1889
1955
  )
1890
1956
  ] }),
1891
- u && /* @__PURE__ */ e(
1957
+ i && /* @__PURE__ */ t(
1892
1958
  "div",
1893
1959
  {
1894
- className: n(
1960
+ className: s(
1895
1961
  "scrollbar-thin scrollbar-thumb-slate-200 overflow-y-auto",
1896
1962
  "max-h-[70dvh] sm:max-h-96",
1897
1963
  "px-4 sm:px-6 mb-2",
1898
- I
1964
+ T
1899
1965
  ),
1900
- children: u
1966
+ children: i
1901
1967
  }
1902
1968
  ),
1903
- a && /* @__PURE__ */ e(
1969
+ a && /* @__PURE__ */ t(
1904
1970
  "div",
1905
1971
  {
1906
- className: n(
1972
+ className: s(
1907
1973
  "flex items-center justify-end gap-3 border-t border-slate-200",
1908
1974
  "p-4 sm:p-6",
1909
- R
1975
+ E
1910
1976
  ),
1911
1977
  children: a
1912
1978
  }
@@ -1917,74 +1983,74 @@ function sr({
1917
1983
  }
1918
1984
  );
1919
1985
  }
1920
- function ar({
1921
- totalItems: t,
1922
- currentPage: l,
1923
- perPage: r,
1924
- onPageChange: s,
1925
- onPerPageChange: m,
1926
- siblingCount: u = 1,
1986
+ function ar(e, r, n) {
1987
+ const l = [], c = r * 2 + 5;
1988
+ if (n <= c)
1989
+ return Array.from({ length: n }, (o, g) => g + 1);
1990
+ const i = Math.max(e - r, 2), a = Math.min(e + r, n - 1);
1991
+ l.push(1), i > 2 && l.push("...");
1992
+ for (let o = i; o <= a; o += 1) l.push(o);
1993
+ return a < n - 1 && l.push("..."), n > 1 && l.push(n), l;
1994
+ }
1995
+ const or = {
1996
+ medium: "h-9 text-sm",
1997
+ large: "h-10 text-base"
1998
+ }, ir = {
1999
+ yellow: {
2000
+ active: "bg-yellow-500 text-white border-yellow-500",
2001
+ inactive: "bg-slate-100 border-slate-200 text-black hover:bg-slate-200",
2002
+ disabled: "text-slate-400 border-slate-200",
2003
+ arrow: "text-black"
2004
+ },
2005
+ blue: {
2006
+ active: "bg-blue-600 text-white border-blue-600",
2007
+ inactive: "bg-slate-100 border-slate-200 text-black hover:bg-slate-200",
2008
+ disabled: "text-slate-400 border-slate-300",
2009
+ arrow: "text-black"
2010
+ }
2011
+ };
2012
+ function Kr({
2013
+ totalItems: e,
2014
+ currentPage: r,
2015
+ perPage: n,
2016
+ onPageChange: l,
2017
+ onPerPageChange: c,
2018
+ siblingCount: i = 1,
1927
2019
  perPageOptions: a = [10, 30, 50, 100],
1928
- showPerPage: c = !0,
1929
- variant: N = "yellow",
1930
- size: y = "large",
1931
- paginationClassName: C
2020
+ showPerPage: o = !0,
2021
+ variant: g = "yellow",
2022
+ size: b = "large",
2023
+ paginationClassName: y
1932
2024
  }) {
1933
- const F = Number.isFinite(t) && t > 0 ? t : 0, I = Number.isFinite(r) && r > 0 ? r : 10, R = Math.max(1, Number.isFinite(l) ? l : 1), w = Math.ceil(F / I);
1934
- if (w <= 1 || F === 0) return null;
1935
- const b = (() => {
1936
- const x = [], h = u * 2 + 5;
1937
- if (w <= h)
1938
- return Array.from({ length: w }, (D, i) => i + 1);
1939
- const A = Math.max(R - u, 2), M = Math.min(R + u, w - 1);
1940
- x.push(1), A > 2 && x.push("...");
1941
- for (let D = A; D <= M; D++) x.push(D);
1942
- return M < w - 1 && x.push("..."), w > 1 && x.push(w), x;
1943
- })(), j = {
1944
- medium: "h-9 text-sm",
1945
- large: "h-10 text-base"
1946
- }[y], S = {
1947
- yellow: {
1948
- active: "bg-yellow-500 text-white border-yellow-500",
1949
- inactive: "bg-slate-100 border-slate-200 text-black hover:bg-slate-200",
1950
- disabled: "text-slate-400 border-slate-200",
1951
- arrow: "text-black"
1952
- },
1953
- blue: {
1954
- active: "bg-blue-600 text-white border-blue-600",
1955
- inactive: "bg-slate-100 border-slate-200 text-black hover:bg-slate-200",
1956
- disabled: "text-slate-400 border-slate-300",
1957
- arrow: "text-black"
1958
- }
1959
- }[N ?? "yellow"];
1960
- return /* @__PURE__ */ o("div", { className: n(
2025
+ const k = Number.isFinite(e) && e > 0 ? e : 0, T = Number.isFinite(n) && n > 0 ? n : 10, E = Math.max(1, Number.isFinite(r) ? r : 1), S = Math.ceil(k / T), h = U(() => ar(E, i, S), [E, i, S]), w = or[b], A = ir[g ?? "yellow"];
2026
+ return S <= 1 || k === 0 ? null : /* @__PURE__ */ d("div", { className: s(
1961
2027
  "flex items-center justify-between gap-4 w-full",
1962
- C
2028
+ y
1963
2029
  ), children: [
1964
- c && m && /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
1965
- /* @__PURE__ */ e(
2030
+ o && c && /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
2031
+ /* @__PURE__ */ t(
1966
2032
  "span",
1967
2033
  {
1968
2034
  className: "whitespace-nowrap text-extra-small text-slate-base font-normal",
1969
2035
  children: "Строк на странице:"
1970
2036
  }
1971
2037
  ),
1972
- /* @__PURE__ */ o("div", { className: "relative", children: [
1973
- /* @__PURE__ */ e(
2038
+ /* @__PURE__ */ d("div", { className: "relative", children: [
2039
+ /* @__PURE__ */ t(
1974
2040
  "select",
1975
2041
  {
1976
- value: I,
1977
- onChange: (x) => m(Number(x.target.value)),
1978
- className: n(
2042
+ value: T,
2043
+ onChange: (L) => c(Number(L.target.value)),
2044
+ className: s(
1979
2045
  "appearance-none bg-white border border-slate-200 rounded-lg pl-3 pr-8 text-base text-black font-medium focus:outline-none cursor-pointer",
1980
- y === "large" ? "h-10" : "h-9"
2046
+ b === "large" ? "h-10" : "h-9"
1981
2047
  ),
1982
2048
  "aria-label": "Количество строк на странице",
1983
- children: a.map((x) => /* @__PURE__ */ e("option", { value: x, children: x }, x))
2049
+ children: a.map((L) => /* @__PURE__ */ t("option", { value: L, children: L }, L))
1984
2050
  }
1985
2051
  ),
1986
- /* @__PURE__ */ e(
1987
- Ee,
2052
+ /* @__PURE__ */ t(
2053
+ Fe,
1988
2054
  {
1989
2055
  className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-slate-400",
1990
2056
  weight: "Linear",
@@ -1993,191 +2059,192 @@ function ar({
1993
2059
  )
1994
2060
  ] })
1995
2061
  ] }),
1996
- /* @__PURE__ */ o("nav", { "aria-label": "Пагинация", className: "flex items-center gap-1 shrink-0 whitespace-nowrap", children: [
1997
- /* @__PURE__ */ e(
2062
+ /* @__PURE__ */ d("nav", { "aria-label": "Пагинация", className: "flex items-center gap-1 shrink-0 whitespace-nowrap", children: [
2063
+ /* @__PURE__ */ t(
1998
2064
  "button",
1999
2065
  {
2000
- onClick: () => s(R - 1),
2001
- disabled: R === 1,
2066
+ onClick: () => l(E - 1),
2067
+ disabled: E === 1,
2002
2068
  "aria-label": "Предыдущая страница",
2003
- className: n(
2069
+ className: s(
2004
2070
  "flex items-center justify-center rounded-lg border transition-all bg-slate-100 min-w-10",
2005
- j,
2006
- R === 1 ? n("cursor-not-allowed opacity-50", S.disabled) : n("hover:cursor-pointer", S.arrow, "border-slate-200")
2071
+ w,
2072
+ E === 1 ? s("cursor-not-allowed opacity-50", A.disabled) : s("hover:cursor-pointer", A.arrow, "border-slate-200")
2007
2073
  ),
2008
- children: /* @__PURE__ */ e(Ce, { weight: "Linear", size: 20 })
2074
+ children: /* @__PURE__ */ t(Ce, { weight: "Linear", size: 20 })
2009
2075
  }
2010
2076
  ),
2011
- /* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: b.map((x, h) => {
2012
- if (x === "...")
2013
- return /* @__PURE__ */ e(
2077
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: h.map((L, v) => {
2078
+ if (L === "...")
2079
+ return /* @__PURE__ */ t(
2014
2080
  "span",
2015
2081
  {
2016
- className: n("flex items-center justify-center text-black font-medium min-w-10", j),
2082
+ className: s("flex items-center justify-center text-black font-medium min-w-10", w),
2017
2083
  "aria-hidden": "true",
2018
- children: /* @__PURE__ */ e(ft, { weight: "Bold", size: 20 })
2084
+ children: /* @__PURE__ */ t(pt, { weight: "Bold", size: 20 })
2019
2085
  },
2020
- h
2086
+ v
2021
2087
  );
2022
- const A = x === R;
2023
- return /* @__PURE__ */ e(
2088
+ const f = L === E;
2089
+ return /* @__PURE__ */ t(
2024
2090
  "button",
2025
2091
  {
2026
- onClick: () => s(x),
2027
- "aria-label": `Страница ${x}${A ? ", текущая" : ""}`,
2028
- "aria-current": A ? "page" : void 0,
2029
- className: n(
2092
+ onClick: () => l(L),
2093
+ "aria-label": `Страница ${L}${f ? ", текущая" : ""}`,
2094
+ "aria-current": f ? "page" : void 0,
2095
+ className: s(
2030
2096
  "flex items-center justify-center rounded-lg border font-medium transition-all hover:cursor-pointer min-w-10 px-2",
2031
- j,
2032
- A ? S.active : S.inactive
2097
+ w,
2098
+ f ? A.active : A.inactive
2033
2099
  ),
2034
- children: x
2100
+ children: L
2035
2101
  },
2036
- h
2102
+ v
2037
2103
  );
2038
2104
  }) }),
2039
- /* @__PURE__ */ e(
2105
+ /* @__PURE__ */ t(
2040
2106
  "button",
2041
2107
  {
2042
- onClick: () => s(R + 1),
2043
- disabled: R === w,
2108
+ onClick: () => l(E + 1),
2109
+ disabled: E === S,
2044
2110
  "aria-label": "Следующая страница",
2045
- className: n(
2111
+ className: s(
2046
2112
  "flex items-center justify-center rounded-lg border transition-all bg-slate-100 min-w-10",
2047
- j,
2048
- R === w ? n("cursor-not-allowed opacity-50", S.disabled) : n("hover:cursor-pointer", S.arrow, "border-slate-200")
2113
+ w,
2114
+ E === S ? s("cursor-not-allowed opacity-50", A.disabled) : s("hover:cursor-pointer", A.arrow, "border-slate-200")
2049
2115
  ),
2050
- children: /* @__PURE__ */ e(xe, { size: 20, weight: "Linear" })
2116
+ children: /* @__PURE__ */ t(be, { size: 20, weight: "Linear" })
2051
2117
  }
2052
2118
  )
2053
2119
  ] })
2054
2120
  ] });
2055
2121
  }
2056
- function Pe({
2057
- className: t,
2058
- variant: l = "default",
2059
- width: r = "100%",
2060
- height: s = "1rem"
2122
+ function Be({
2123
+ className: e,
2124
+ variant: r = "default",
2125
+ width: n = "100%",
2126
+ height: l = "1rem"
2061
2127
  }) {
2062
- return /* @__PURE__ */ e(
2128
+ return /* @__PURE__ */ t(
2063
2129
  "div",
2064
2130
  {
2065
- className: n(
2131
+ className: s(
2066
2132
  "relative overflow-hidden bg-slate-200",
2067
2133
  "rounded-lg",
2068
- l === "circle" && "rounded-full",
2069
- l === "rounded" && "rounded-md",
2070
- t
2134
+ r === "circle" && "rounded-full",
2135
+ r === "rounded" && "rounded-md",
2136
+ e
2071
2137
  ),
2072
2138
  style: {
2073
- width: typeof r == "number" ? `${r}px` : r,
2074
- height: typeof s == "number" ? `${s}px` : s
2139
+ width: typeof n == "number" ? `${n}px` : n,
2140
+ height: typeof l == "number" ? `${l}px` : l
2075
2141
  },
2076
- children: /* @__PURE__ */ e("div", { className: "shimmer-mask absolute inset-0" })
2142
+ children: /* @__PURE__ */ t("div", { className: "shimmer-mask absolute inset-0" })
2077
2143
  }
2078
2144
  );
2079
2145
  }
2080
- function or({
2081
- tabs: t,
2082
- defaultTab: l,
2083
- position: r = "top",
2084
- className: s,
2085
- tabListClassName: m,
2086
- contentClassName: u,
2146
+ const cr = {
2147
+ top: "flex-col",
2148
+ bottom: "flex-col-reverse",
2149
+ left: "flex-row",
2150
+ right: "flex-row-reverse"
2151
+ }, dr = {
2152
+ top: "flex-row",
2153
+ bottom: "flex-row",
2154
+ left: "flex-col",
2155
+ right: "flex-col"
2156
+ }, ur = {
2157
+ top: "mt-4",
2158
+ bottom: "mb-4",
2159
+ left: "ml-4",
2160
+ right: "mr-4"
2161
+ };
2162
+ function Xr({
2163
+ tabs: e,
2164
+ defaultTab: r,
2165
+ position: n = "top",
2166
+ className: l,
2167
+ tabListClassName: c,
2168
+ contentClassName: i,
2087
2169
  extra: a,
2088
- onChange: c
2170
+ onChange: o
2089
2171
  }) {
2090
- const [N, y] = H(l || t[0]?.id), [C, F] = H({}), I = de([]), R = () => {
2172
+ const [g, b] = z(r || e[0]?.id), [y, k] = z({}), T = se([]), E = O(() => {
2091
2173
  requestAnimationFrame(() => {
2092
- const S = t.findIndex((h) => h?.id === N), x = I.current[S];
2093
- if (x) {
2094
- const { offsetLeft: h, offsetTop: A, offsetWidth: M, offsetHeight: D } = x;
2095
- F({
2096
- left: `${h}px`,
2097
- top: `${A}px`,
2098
- width: `${M}px`,
2099
- height: `${D}px`,
2174
+ const h = e.findIndex((A) => A?.id === g), w = T.current[h];
2175
+ if (w) {
2176
+ const { offsetLeft: A, offsetTop: L, offsetWidth: v, offsetHeight: f } = w;
2177
+ k({
2178
+ left: `${A}px`,
2179
+ top: `${L}px`,
2180
+ width: `${v}px`,
2181
+ height: `${f}px`,
2100
2182
  transition: "all 0.35s cubic-bezier(0.25, 1, 0.5, 1)"
2101
2183
  });
2102
2184
  }
2103
2185
  });
2104
- };
2105
- ee(() => (R(), window.addEventListener("resize", R), "fonts" in document && document.fonts.ready.then(R), () => window.removeEventListener("resize", R)), [N, r, t]), ee(() => {
2106
- I.current = I.current.slice(0, t.length);
2107
- }, [t]);
2108
- const w = r === "left" || r === "right", k = {
2109
- top: "flex-col",
2110
- bottom: "flex-col-reverse",
2111
- left: "flex-row",
2112
- right: "flex-row-reverse"
2113
- }, b = {
2114
- top: "flex-row",
2115
- bottom: "flex-row",
2116
- left: "flex-col",
2117
- right: "flex-col"
2118
- }, j = {
2119
- top: "mt-4",
2120
- bottom: "mb-4",
2121
- left: "ml-4",
2122
- right: "mr-4"
2123
- };
2124
- return /* @__PURE__ */ o("div", { className: n("flex w-full", k[r], s), children: [
2125
- /* @__PURE__ */ o(
2186
+ }, [g, e]);
2187
+ G(() => (E(), window.addEventListener("resize", E), "fonts" in document && document.fonts.ready.then(E), () => window.removeEventListener("resize", E)), [n, E]), G(() => {
2188
+ T.current = T.current.slice(0, e.length);
2189
+ }, [e]);
2190
+ const S = n === "left" || n === "right";
2191
+ return /* @__PURE__ */ d("div", { className: s("flex w-full", cr[n], l), children: [
2192
+ /* @__PURE__ */ d(
2126
2193
  "div",
2127
2194
  {
2128
- className: n(
2195
+ className: s(
2129
2196
  "flex w-full gap-4",
2130
- w ? "flex-col items-start" : "flex-row flex-wrap items-center"
2197
+ S ? "flex-col items-start" : "flex-row flex-wrap items-center"
2131
2198
  ),
2132
2199
  children: [
2133
- /* @__PURE__ */ e(
2200
+ /* @__PURE__ */ t(
2134
2201
  "div",
2135
2202
  {
2136
- className: n(
2203
+ className: s(
2137
2204
  "flex-1",
2138
- w ? "w-full" : "min-w-[520px]"
2205
+ S ? "w-full" : "min-w-[520px]"
2139
2206
  ),
2140
- children: /* @__PURE__ */ o(
2207
+ children: /* @__PURE__ */ d(
2141
2208
  "div",
2142
2209
  {
2143
- className: n(
2210
+ className: s(
2144
2211
  "relative flex rounded-xl bg-slate-100 p-1",
2145
- b[r],
2146
- !w && "w-full overflow-hidden",
2147
- w ? "min-w-48" : "",
2148
- m
2212
+ dr[n],
2213
+ !S && "w-full overflow-hidden",
2214
+ S ? "min-w-48" : "",
2215
+ c
2149
2216
  ),
2150
2217
  children: [
2151
- /* @__PURE__ */ e(
2218
+ /* @__PURE__ */ t(
2152
2219
  "div",
2153
2220
  {
2154
- className: n("absolute rounded-lg bg-white", w ? "w-full" : "h-full"),
2155
- style: C
2221
+ className: s("absolute rounded-lg bg-white", S ? "w-full" : "h-full"),
2222
+ style: y
2156
2223
  }
2157
2224
  ),
2158
- t?.map((S, x) => {
2159
- const h = N === S.id;
2160
- return /* @__PURE__ */ o(
2225
+ e?.map((h, w) => {
2226
+ const A = g === h.id;
2227
+ return /* @__PURE__ */ d(
2161
2228
  "button",
2162
2229
  {
2163
- ref: (A) => {
2164
- I.current[x] = A;
2230
+ ref: (L) => {
2231
+ T.current[w] = L;
2165
2232
  },
2166
2233
  onClick: () => {
2167
- S?.disabled || (y(S?.id), c?.(S?.id));
2234
+ h?.disabled || (b(h?.id), o?.(h?.id));
2168
2235
  },
2169
- disabled: S?.disabled,
2170
- className: n(
2236
+ disabled: h?.disabled,
2237
+ className: s(
2171
2238
  "relative z-10 flex items-center justify-center whitespace-nowrap px-3 py-2 text-base font-normal text-black transition-colors duration-300 hover:cursor-pointer",
2172
- S?.disabled && "cursor-not-allowed opacity-50",
2173
- w ? "w-full justify-start" : "flex-1 min-w-0"
2239
+ h?.disabled && "cursor-not-allowed opacity-50",
2240
+ S ? "w-full justify-start" : "flex-1 min-w-0"
2174
2241
  ),
2175
2242
  children: [
2176
- S?.icon && /* @__PURE__ */ e("span", { className: n("shrink-0 transition-transform duration-200", h && "scale-110"), children: S?.icon }),
2177
- /* @__PURE__ */ e("span", { className: "relative z-10 truncate", title: S?.label, children: S?.label })
2243
+ h?.icon && /* @__PURE__ */ t("span", { className: s("shrink-0 transition-transform duration-200", A && "scale-110"), children: h?.icon }),
2244
+ /* @__PURE__ */ t("span", { className: "relative z-10 truncate", title: h?.label, children: h?.label })
2178
2245
  ]
2179
2246
  },
2180
- S?.id
2247
+ h?.id
2181
2248
  );
2182
2249
  })
2183
2250
  ]
@@ -2185,23 +2252,23 @@ function or({
2185
2252
  )
2186
2253
  }
2187
2254
  ),
2188
- a && /* @__PURE__ */ e(
2255
+ a && /* @__PURE__ */ t(
2189
2256
  "div",
2190
2257
  {
2191
- className: n(
2258
+ className: s(
2192
2259
  "shrink-0 ml-auto",
2193
- w ? "w-full" : "max-w-full"
2260
+ S ? "w-full" : "max-w-full"
2194
2261
  ),
2195
- children: /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center justify-end gap-2", children: a })
2262
+ children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center justify-end gap-2", children: a })
2196
2263
  }
2197
2264
  )
2198
2265
  ]
2199
2266
  }
2200
2267
  ),
2201
- /* @__PURE__ */ e("div", { className: n("w-full flex-1 overflow-hidden", j[r], u), children: /* @__PURE__ */ e("div", { className: "animate-fade-in w-full", style: { animationDuration: "0.35s" }, children: t?.find((S) => S.id === N)?.content }, N) })
2268
+ /* @__PURE__ */ t("div", { className: s("w-full flex-1 overflow-hidden", ur[n], i), children: /* @__PURE__ */ t("div", { className: "animate-fade-in w-full", style: { animationDuration: "0.35s" }, children: e?.find((h) => h.id === g)?.content }, g) })
2202
2269
  ] });
2203
2270
  }
2204
- const Rt = {
2271
+ const fr = {
2205
2272
  sm: "px-2 py-0.5",
2206
2273
  md: "px-2 py-1",
2207
2274
  lg: "px-3 py-2"
@@ -2209,189 +2276,189 @@ const Rt = {
2209
2276
  sm: "w-3 h-3",
2210
2277
  md: "w-3 h-3",
2211
2278
  lg: "w-3 h-3"
2212
- }, $t = {
2279
+ }, mr = {
2213
2280
  success: "bg-green-50 text-green-600",
2214
2281
  warning: "bg-orange-50 text-orange-600",
2215
2282
  error: "bg-red-50 text-red-600",
2216
2283
  gray: "bg-slate-200 text-slate-700",
2217
2284
  blue: "bg-blue-50 text-blue-600"
2218
2285
  };
2219
- function ir({
2220
- children: t,
2221
- variant: l = "success",
2222
- size: r = "lg",
2223
- icon: s,
2224
- iconPosition: m = "left",
2225
- className: u
2286
+ function Qr({
2287
+ children: e,
2288
+ variant: r = "success",
2289
+ size: n = "lg",
2290
+ icon: l,
2291
+ iconPosition: c = "left",
2292
+ className: i
2226
2293
  }) {
2227
- return /* @__PURE__ */ o(
2294
+ return /* @__PURE__ */ d(
2228
2295
  "span",
2229
2296
  {
2230
- className: n(
2297
+ className: s(
2231
2298
  "inline-flex animate-[fadeIn_0.3s_ease-out] items-center rounded-lg text-extra-small font-medium",
2232
- Rt[r],
2233
- $t[l],
2234
- s && "gap-[2px]",
2235
- u
2299
+ fr[n],
2300
+ mr[r],
2301
+ l && "gap-[2px]",
2302
+ i
2236
2303
  ),
2237
2304
  children: [
2238
- s && m === "left" && /* @__PURE__ */ e("span", { className: `flex items-center ${n(ze[r])}`, children: s }),
2239
- /* @__PURE__ */ e("span", { children: t }),
2240
- s && m === "right" && /* @__PURE__ */ e("span", { className: `flex items-center ${n(ze[r])}`, children: s })
2305
+ l && c === "left" && /* @__PURE__ */ t("span", { className: `flex items-center ${s(ze[n])}`, children: l }),
2306
+ /* @__PURE__ */ t("span", { children: e }),
2307
+ l && c === "right" && /* @__PURE__ */ t("span", { className: `flex items-center ${s(ze[n])}`, children: l })
2241
2308
  ]
2242
2309
  }
2243
2310
  );
2244
2311
  }
2245
- const Pt = fe(
2312
+ const hr = me(
2246
2313
  ({
2247
- label: t,
2248
- placeholder: l,
2249
- value: r = "",
2250
- onChange: s,
2251
- required: m = !1,
2252
- disabled: u = !1,
2314
+ label: e,
2315
+ placeholder: r,
2316
+ value: n = "",
2317
+ onChange: l,
2318
+ required: c = !1,
2319
+ disabled: i = !1,
2253
2320
  error: a,
2254
- className: c,
2255
- rows: N = 4,
2256
- name: y
2257
- }, C) => {
2258
- const F = U(() => a ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [a]);
2259
- return /* @__PURE__ */ o("div", { className: n("relative w-full", c), children: [
2260
- t && /* @__PURE__ */ o(
2321
+ className: o,
2322
+ rows: g = 4,
2323
+ name: b
2324
+ }, y) => {
2325
+ const k = U(() => a ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [a]);
2326
+ return /* @__PURE__ */ d("div", { className: s("relative w-full", o), children: [
2327
+ e && /* @__PURE__ */ d(
2261
2328
  "label",
2262
2329
  {
2263
- className: n(
2330
+ className: s(
2264
2331
  "mb-2 block text-base font-medium",
2265
2332
  a ? "text-red-600" : "text-slate-700"
2266
2333
  ),
2267
2334
  children: [
2268
- t,
2269
- m && /* @__PURE__ */ e("span", { className: "ml-1 text-red-600", children: "*" })
2335
+ e,
2336
+ c && /* @__PURE__ */ t("span", { className: "ml-1 text-red-600", children: "*" })
2270
2337
  ]
2271
2338
  }
2272
2339
  ),
2273
- /* @__PURE__ */ e(
2340
+ /* @__PURE__ */ t(
2274
2341
  "textarea",
2275
2342
  {
2276
- ref: C,
2277
- name: y,
2278
- rows: N,
2279
- value: r,
2280
- onChange: (I) => s?.(I.target.value),
2281
- disabled: u,
2282
- placeholder: l,
2283
- className: n(
2343
+ ref: y,
2344
+ name: b,
2345
+ rows: g,
2346
+ value: n,
2347
+ onChange: (T) => l?.(T.target.value),
2348
+ disabled: i,
2349
+ placeholder: r,
2350
+ className: s(
2284
2351
  "w-full resize-none rounded-xl border bg-white text-base font-normal transition-all duration-300 ease-in-out outline-none",
2285
2352
  "p-3 disabled:cursor-not-allowed disabled:border-slate-200 disabled:bg-slate-100 disabled:text-slate-400",
2286
- F
2353
+ k
2287
2354
  )
2288
2355
  }
2289
2356
  ),
2290
- a && /* @__PURE__ */ e("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: a })
2357
+ a && /* @__PURE__ */ t("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: a })
2291
2358
  ] });
2292
2359
  }
2293
2360
  );
2294
- Pt.displayName = "MciTextarea";
2295
- const zt = (() => {
2296
- let t = document.getElementById("mci-toast-container");
2297
- return t || (t = document.createElement("div"), t.id = "mci-toast-container", t.className = "fixed top-4 right-4 z-[9999] flex flex-col gap-3 pointer-events-none", document.body.appendChild(t)), t;
2298
- })();
2299
- let Fe = null, Bt = 0;
2300
- const Me = [], Be = () => {
2301
- Fe || (Fe = Mt(zt)), Fe.render(
2302
- /* @__PURE__ */ e("div", { className: "flex flex-col gap-3", children: Me.map(({ id: t, element: l }) => /* @__PURE__ */ e("div", { className: "pointer-events-auto", children: l }, t)) })
2361
+ hr.displayName = "MciTextarea";
2362
+ const pr = {
2363
+ success: /* @__PURE__ */ t(yt, { weight: "Bold", className: "w-5 h-5" }),
2364
+ error: /* @__PURE__ */ t(wt, { weight: "Bold", className: "w-5 h-5" }),
2365
+ warning: /* @__PURE__ */ t(xt, { weight: "Bold", className: "w-5 h-5" }),
2366
+ info: /* @__PURE__ */ t(bt, { weight: "Bold", className: "w-5 h-5" }),
2367
+ loading: /* @__PURE__ */ t(gt, { weight: "Bold", className: "w-5 h-5 animate-spin" })
2368
+ }, ke = {
2369
+ bg: {
2370
+ success: "bg-green-50",
2371
+ error: "bg-red-50",
2372
+ warning: "bg-orange-50",
2373
+ info: "bg-blue-50",
2374
+ loading: "bg-slate-50"
2375
+ },
2376
+ line: {
2377
+ success: "bg-green-600",
2378
+ error: "bg-red-600",
2379
+ warning: "bg-orange-600",
2380
+ info: "bg-blue-600",
2381
+ loading: "bg-slate-600"
2382
+ },
2383
+ text: {
2384
+ success: "text-green-600",
2385
+ error: "text-red-600",
2386
+ warning: "text-orange-600",
2387
+ info: "text-blue-600",
2388
+ loading: "text-slate-600"
2389
+ },
2390
+ action: {
2391
+ success: "text-green-600",
2392
+ error: "text-red-600",
2393
+ warning: "text-orange-600",
2394
+ info: "text-blue-600",
2395
+ loading: "text-slate-600"
2396
+ }
2397
+ };
2398
+ function gr() {
2399
+ let e = document.getElementById("mci-toast-container");
2400
+ return e || (e = document.createElement("div"), e.id = "mci-toast-container", e.className = "fixed top-4 right-4 z-[9999] flex flex-col gap-3 pointer-events-none", document.body.appendChild(e)), e;
2401
+ }
2402
+ const br = gr();
2403
+ let Te = null, xr = 0;
2404
+ const Se = [], _e = () => {
2405
+ Te || (Te = Dt(br)), Te.render(
2406
+ /* @__PURE__ */ t("div", { className: "flex flex-col gap-3", children: Se.map(({ id: e, element: r }) => /* @__PURE__ */ t("div", { className: "pointer-events-auto", children: r }, e)) })
2303
2407
  );
2304
2408
  };
2305
- function Wt({
2306
- title: t,
2307
- description: l,
2308
- type: r = "info",
2309
- duration: s = 3e3,
2310
- action: m,
2311
- onClose: u
2409
+ function wr({
2410
+ title: e,
2411
+ description: r,
2412
+ type: n = "info",
2413
+ duration: l = 3e3,
2414
+ action: c,
2415
+ onClose: i
2312
2416
  }) {
2313
- const [a, c] = H(100);
2314
- ee(() => {
2315
- if (s === 1 / 0) {
2316
- c(100);
2417
+ const [a, o] = z(100);
2418
+ return G(() => {
2419
+ if (l === 1 / 0) {
2420
+ o(100);
2317
2421
  return;
2318
2422
  }
2319
- let C = null;
2320
- const F = (R) => {
2321
- C || (C = R);
2322
- const w = R - C, k = Math.max(0, (s - w) / s * 100);
2323
- c(k), k > 0 ? requestAnimationFrame(F) : u?.();
2324
- }, I = requestAnimationFrame(F);
2325
- return () => cancelAnimationFrame(I);
2326
- }, [s, u]);
2327
- const N = {
2328
- success: /* @__PURE__ */ e(wt, { weight: "Bold", className: "w-5 h-5" }),
2329
- error: /* @__PURE__ */ e(xt, { weight: "Bold", className: "w-5 h-5" }),
2330
- warning: /* @__PURE__ */ e(bt, { weight: "Bold", className: "w-5 h-5" }),
2331
- info: /* @__PURE__ */ e(gt, { weight: "Bold", className: "w-5 h-5" }),
2332
- loading: /* @__PURE__ */ e(pt, { weight: "Bold", className: "w-5 h-5 animate-spin" })
2333
- }, y = {
2334
- bg: {
2335
- success: "bg-green-50",
2336
- error: "bg-red-50",
2337
- warning: "bg-orange-50",
2338
- info: "bg-blue-50",
2339
- loading: "bg-slate-50"
2340
- },
2341
- line: {
2342
- success: "bg-green-600",
2343
- error: "bg-red-600",
2344
- warning: "bg-orange-600",
2345
- info: "bg-blue-600",
2346
- loading: "bg-slate-600"
2347
- },
2348
- text: {
2349
- success: "text-green-600",
2350
- error: "text-red-600",
2351
- warning: "text-orange-600",
2352
- info: "text-blue-600",
2353
- loading: "text-slate-600"
2354
- },
2355
- action: {
2356
- success: "text-green-600",
2357
- error: "text-red-600",
2358
- warning: "text-orange-600",
2359
- info: "text-blue-600",
2360
- loading: "text-slate-600"
2361
- }
2362
- };
2363
- return /* @__PURE__ */ o(
2423
+ let g = null;
2424
+ const b = (k) => {
2425
+ g || (g = k);
2426
+ const T = k - g, E = Math.max(0, (l - T) / l * 100);
2427
+ o(E), E > 0 ? requestAnimationFrame(b) : i?.();
2428
+ }, y = requestAnimationFrame(b);
2429
+ return () => cancelAnimationFrame(y);
2430
+ }, [l, i]), /* @__PURE__ */ d(
2364
2431
  "div",
2365
2432
  {
2366
- className: n(
2433
+ className: s(
2367
2434
  "relative w-[300px] max-w-full overflow-hidden shadow-md rounded-lg",
2368
2435
  "animate-in fade-in slide-in-from-top-2 duration-300",
2369
- y.bg[r]
2436
+ ke.bg[n]
2370
2437
  ),
2371
2438
  children: [
2372
- /* @__PURE__ */ e(
2439
+ /* @__PURE__ */ t(
2373
2440
  "div",
2374
2441
  {
2375
- className: n("absolute bottom-0 left-0 h-1", y.line[r]),
2442
+ className: s("absolute bottom-0 left-0 h-1", ke.line[n]),
2376
2443
  style: {
2377
2444
  width: `${a}%`,
2378
2445
  transition: "none"
2379
2446
  }
2380
2447
  }
2381
2448
  ),
2382
- /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ o("div", { className: "flex items-start gap-2", children: [
2383
- /* @__PURE__ */ e("div", { className: n("flex-shrink-0", y.text[r]), children: N[r] }),
2384
- /* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: [
2385
- /* @__PURE__ */ e("h4", { className: "text-base font-medium mb-1", children: t }),
2386
- l && /* @__PURE__ */ e("p", { className: "text-sm text-[#82828C]", children: l }),
2387
- m && /* @__PURE__ */ e("div", { className: "mt-3", children: /* @__PURE__ */ e("div", { className: n("underline font-medium text-sm", y.action[r]), children: m }) })
2449
+ /* @__PURE__ */ t("div", { className: "p-4", children: /* @__PURE__ */ d("div", { className: "flex items-start gap-2", children: [
2450
+ /* @__PURE__ */ t("div", { className: s("flex-shrink-0", ke.text[n]), children: pr[n] }),
2451
+ /* @__PURE__ */ d("div", { className: "flex-1 min-w-0", children: [
2452
+ /* @__PURE__ */ t("h4", { className: "text-base font-medium mb-1", children: e }),
2453
+ r && /* @__PURE__ */ t("p", { className: "text-sm text-[#82828C]", children: r }),
2454
+ c && /* @__PURE__ */ t("div", { className: "mt-3", children: /* @__PURE__ */ t("div", { className: s("underline font-medium text-sm", ke.action[n]), children: c }) })
2388
2455
  ] }),
2389
- /* @__PURE__ */ e(
2456
+ /* @__PURE__ */ t(
2390
2457
  "button",
2391
2458
  {
2392
- onClick: u,
2459
+ onClick: i,
2393
2460
  className: "flex-shrink-0 rounded-full transition cursor-pointer active:animate-spin",
2394
- children: /* @__PURE__ */ e(pe, { className: "w-6 h-6 text-slate-base" })
2461
+ children: /* @__PURE__ */ t(he, { className: "w-6 h-6 text-slate-base" })
2395
2462
  }
2396
2463
  )
2397
2464
  ] }) })
@@ -2399,75 +2466,74 @@ function Wt({
2399
2466
  }
2400
2467
  );
2401
2468
  }
2402
- const ge = (t) => {
2403
- const l = Bt++, r = () => {
2404
- const m = Me.findIndex((u) => u?.id === l);
2405
- m !== -1 && (Me.splice(m, 1), Be());
2406
- }, s = /* @__PURE__ */ e(Wt, { ...t, onClose: r });
2407
- return Me.push({ id: l, element: s }), Be(), t.duration !== 1 / 0 && setTimeout(r, (t.duration || 3e3) + 300), { close: r };
2408
- }, cr = {
2409
- success: (t, l, r) => ge(typeof t == "string" ? { title: t, description: l, type: "success", action: r } : {
2410
- ...t,
2469
+ const pe = (e) => {
2470
+ const r = xr++, n = () => {
2471
+ const c = Se.findIndex((i) => i?.id === r);
2472
+ c !== -1 && (Se.splice(c, 1), _e());
2473
+ }, l = /* @__PURE__ */ t(wr, { ...e, onClose: n });
2474
+ return Se.push({ id: r, element: l }), _e(), e.duration !== 1 / 0 && setTimeout(n, (e.duration || 3e3) + 300), { close: n };
2475
+ }, en = {
2476
+ success: (e, r, n) => pe(typeof e == "string" ? { title: e, description: r, type: "success", action: n } : {
2477
+ ...e,
2411
2478
  type: "success"
2412
2479
  }),
2413
- error: (t, l, r) => ge(typeof t == "string" ? { title: t, description: l, type: "error", action: r } : {
2414
- ...t,
2480
+ error: (e, r, n) => pe(typeof e == "string" ? { title: e, description: r, type: "error", action: n } : {
2481
+ ...e,
2415
2482
  type: "error"
2416
2483
  }),
2417
- warning: (t, l, r) => ge(typeof t == "string" ? { title: t, description: l, type: "warning", action: r } : {
2418
- ...t,
2484
+ warning: (e, r, n) => pe(typeof e == "string" ? { title: e, description: r, type: "warning", action: n } : {
2485
+ ...e,
2419
2486
  type: "warning"
2420
2487
  }),
2421
- info: (t, l, r) => ge(typeof t == "string" ? { title: t, description: l, type: "info", action: r } : {
2422
- ...t,
2488
+ info: (e, r, n) => pe(typeof e == "string" ? { title: e, description: r, type: "info", action: n } : {
2489
+ ...e,
2423
2490
  type: "info"
2424
2491
  }),
2425
- loading: (t, l) => ge(typeof t == "string" ? {
2426
- title: t,
2427
- description: l,
2492
+ loading: (e, r) => pe(typeof e == "string" ? {
2493
+ title: e,
2494
+ description: r,
2428
2495
  type: "loading",
2429
2496
  duration: 1 / 0
2430
- } : { ...t, type: "loading", duration: 1 / 0 })
2497
+ } : { ...e, type: "loading", duration: 1 / 0 })
2498
+ }, yr = {
2499
+ top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
2500
+ bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
2501
+ left: "right-full top-1/2 -translate-y-1/2 mr-2",
2502
+ right: "left-full top-1/2 -translate-y-1/2 ml-2"
2503
+ }, vr = {
2504
+ top: "left-1/2 -translate-x-1/2 top-full",
2505
+ bottom: "left-1/2 -translate-x-1/2 bottom-full",
2506
+ left: "top-1/2 -translate-y-1/2 left-full",
2507
+ right: "top-1/2 -translate-y-1/2 right-full"
2431
2508
  };
2432
- function dr({
2433
- content: t,
2434
- children: l,
2435
- position: r = "top",
2436
- delay: s = 200,
2437
- className: m
2509
+ function tn({
2510
+ content: e,
2511
+ children: r,
2512
+ position: n = "top",
2513
+ delay: l = 200,
2514
+ className: c
2438
2515
  }) {
2439
- const u = {
2440
- top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
2441
- bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
2442
- left: "right-full top-1/2 -translate-y-1/2 mr-2",
2443
- right: "left-full top-1/2 -translate-y-1/2 ml-2"
2444
- }, a = {
2445
- top: "left-1/2 -translate-x-1/2 top-full",
2446
- bottom: "left-1/2 -translate-x-1/2 bottom-full",
2447
- left: "top-1/2 -translate-y-1/2 left-full",
2448
- right: "top-1/2 -translate-y-1/2 right-full"
2449
- };
2450
- return /* @__PURE__ */ o("div", { className: "group relative inline-block", children: [
2451
- l,
2452
- /* @__PURE__ */ o(
2516
+ return /* @__PURE__ */ d("div", { className: "group relative inline-block", children: [
2517
+ r,
2518
+ /* @__PURE__ */ d(
2453
2519
  "div",
2454
2520
  {
2455
- className: n(
2521
+ className: s(
2456
2522
  "absolute z-50 rounded-md bg-slate-400 px-2 py-1 text-xs whitespace-nowrap text-white shadow-md",
2457
2523
  "scale-95 opacity-0 transition-all group-hover:scale-100 group-hover:opacity-100",
2458
2524
  "duration-200 ease-out group-hover:delay-200",
2459
- u[r],
2460
- m
2525
+ yr[n],
2526
+ c
2461
2527
  ),
2462
- style: { transitionDelay: `${s}ms` },
2528
+ style: { transitionDelay: `${l}ms` },
2463
2529
  children: [
2464
- t,
2465
- /* @__PURE__ */ e(
2530
+ e,
2531
+ /* @__PURE__ */ t(
2466
2532
  "span",
2467
2533
  {
2468
- className: n(
2534
+ className: s(
2469
2535
  "absolute h-2 w-2 rotate-45 bg-slate-400",
2470
- a[r]
2536
+ vr[n]
2471
2537
  )
2472
2538
  }
2473
2539
  )
@@ -2476,103 +2542,104 @@ function dr({
2476
2542
  )
2477
2543
  ] });
2478
2544
  }
2479
- function ur({
2480
- checked: t = !1,
2481
- onChange: l,
2482
- disabled: r = !1,
2483
- variant: s = "yellow",
2484
- label: m,
2485
- supportText: u,
2545
+ const Ie = {
2546
+ blue: {
2547
+ active: "bg-blue-600",
2548
+ hover: "hover:bg-blue-600",
2549
+ focus: "focus:shadow-blue"
2550
+ },
2551
+ yellow: {
2552
+ active: "bg-yellow-500",
2553
+ hover: "hover:bg-yellow-500",
2554
+ focus: "focus:ring-2 focus:ring-yellow-200"
2555
+ }
2556
+ };
2557
+ function rn({
2558
+ checked: e = !1,
2559
+ onChange: r,
2560
+ disabled: n = !1,
2561
+ variant: l = "yellow",
2562
+ label: c,
2563
+ supportText: i,
2486
2564
  className: a
2487
2565
  }) {
2488
- const c = () => {
2489
- r || l?.(!t);
2490
- }, N = {
2491
- blue: {
2492
- active: "bg-blue-600",
2493
- hover: "hover:bg-blue-600",
2494
- focus: "focus:shadow-blue"
2495
- },
2496
- yellow: {
2497
- active: "bg-yellow-500",
2498
- hover: "hover:bg-yellow-500",
2499
- focus: "focus:ring-2 focus:ring-yellow-200"
2500
- }
2566
+ const o = () => {
2567
+ n || r?.(!e);
2501
2568
  };
2502
- return /* @__PURE__ */ o(
2569
+ return /* @__PURE__ */ d(
2503
2570
  "div",
2504
2571
  {
2505
- className: n(
2572
+ className: s(
2506
2573
  "flex items-start gap-3 select-none",
2507
2574
  a
2508
2575
  ),
2509
2576
  children: [
2510
- /* @__PURE__ */ e(
2577
+ /* @__PURE__ */ t(
2511
2578
  "button",
2512
2579
  {
2513
2580
  type: "button",
2514
- disabled: r,
2515
- className: n(
2581
+ disabled: n,
2582
+ className: s(
2516
2583
  "relative h-6 w-11 rounded-xl transition-all duration-300 outline-none cursor-pointer",
2517
- t ? N[s].active : "bg-slate-200",
2518
- !r && N[s].hover,
2519
- !r && N[s].focus,
2520
- r && "bg-slate-100 cursor-not-allowed"
2584
+ e ? Ie[l].active : "bg-slate-200",
2585
+ !n && Ie[l].hover,
2586
+ !n && Ie[l].focus,
2587
+ n && "bg-slate-100 cursor-not-allowed"
2521
2588
  ),
2522
- onClick: c,
2523
- children: /* @__PURE__ */ e(
2589
+ onClick: o,
2590
+ children: /* @__PURE__ */ t(
2524
2591
  "span",
2525
2592
  {
2526
- className: n(
2593
+ className: s(
2527
2594
  "absolute top-1/2 left-0.5 h-5 w-5 -translate-y-1/2 rounded-full transition-all duration-300 bg-white",
2528
- t && "translate-x-5"
2595
+ e && "translate-x-5"
2529
2596
  )
2530
2597
  }
2531
2598
  )
2532
2599
  }
2533
2600
  ),
2534
- (m || u) && /* @__PURE__ */ o("div", { className: "flex flex-col leading-tight", children: [
2535
- m && /* @__PURE__ */ e(
2601
+ (c || i) && /* @__PURE__ */ d("div", { className: "flex flex-col leading-tight", children: [
2602
+ c && /* @__PURE__ */ t(
2536
2603
  "span",
2537
2604
  {
2538
- className: n(
2605
+ className: s(
2539
2606
  "text-base font-medium text-black"
2540
2607
  ),
2541
- children: m
2608
+ children: c
2542
2609
  }
2543
2610
  ),
2544
- u && /* @__PURE__ */ e("span", { className: "text-sm font-normal text-slate-500", children: u })
2611
+ i && /* @__PURE__ */ t("span", { className: "text-sm font-normal text-slate-500", children: i })
2545
2612
  ] })
2546
2613
  ]
2547
2614
  }
2548
2615
  );
2549
2616
  }
2550
- const Yt = (t) => /* @__PURE__ */ ne.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 177 177", fill: "none", ...t }, /* @__PURE__ */ ne.createElement("path", { opacity: 0.083334, d: "M94.5 48.5C94.5 41.8726 91.8137 36.5 88.5 36.5C85.1863 36.5 82.5 41.8726 82.5 48.5C82.5 55.1274 85.1863 60.5 88.5 60.5C91.8137 60.5 94.5 55.1274 94.5 48.5Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.166667, d: "M113.697 56.8591C117.011 51.1196 117.371 45.1237 114.501 43.4668C111.631 41.8099 106.618 45.1196 103.305 50.8591C99.991 56.5986 99.6311 62.5946 102.501 64.2514C105.371 65.9083 110.383 62.5986 113.697 56.8591Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.25, d: "M126.141 73.696C131.88 70.3823 135.19 65.3696 133.533 62.4999C131.876 59.6301 125.88 59.99 120.141 63.3037C114.401 66.6174 111.092 71.6301 112.749 74.4999C114.405 77.3696 120.401 77.0097 126.141 73.696Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.333334, d: "M128.5 94.5C135.127 94.5 140.5 91.8137 140.5 88.5C140.5 85.1863 135.127 82.5 128.5 82.5C121.873 82.5 116.5 85.1863 116.5 88.5C116.5 91.8137 121.873 94.5 128.5 94.5Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.416667, d: "M120.141 113.696C125.88 117.01 131.876 117.37 133.533 114.5C135.19 111.63 131.88 106.617 126.141 103.304C120.401 99.99 114.405 99.6301 112.749 102.5C111.092 105.37 114.401 110.382 120.141 113.696Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.5, d: "M103.303 126.141C106.617 131.88 111.629 135.19 114.499 133.533C117.369 131.876 117.009 125.88 113.695 120.141C110.382 114.401 105.369 111.092 102.499 112.749C99.6294 114.405 99.9893 120.401 103.303 126.141Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.583334, d: "M82.5 128.5C82.5 135.127 85.1863 140.5 88.5 140.5C91.8137 140.5 94.5 135.127 94.5 128.5C94.5 121.873 91.8137 116.5 88.5 116.5C85.1863 116.5 82.5 121.873 82.5 128.5Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.666667, d: "M63.303 120.141C59.9893 125.88 59.6294 131.876 62.4992 133.533C65.3689 135.19 70.3816 131.88 73.6953 126.141C77.009 120.401 77.3689 114.405 74.4992 112.749C71.6294 111.092 66.6167 114.401 63.303 120.141Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.75, d: "M50.8591 103.304C45.1196 106.618 41.8099 111.63 43.4668 114.5C45.1237 117.37 51.1196 117.01 56.8591 113.696C62.5986 110.383 65.9083 105.37 64.2514 102.5C62.5946 99.6304 56.5986 99.9903 50.8591 103.304Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.833334, d: "M48.5 82.5C41.8726 82.5 36.5 85.1863 36.5 88.5C36.5 91.8137 41.8726 94.5 48.5 94.5C55.1274 94.5 60.5 91.8137 60.5 88.5C60.5 85.1863 55.1274 82.5 48.5 82.5Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.916667, d: "M56.8591 63.304C51.1196 59.9903 45.1237 59.6304 43.4668 62.5001C41.8099 65.3699 45.1196 70.3826 50.8591 73.6963C56.5986 77.01 62.5946 77.3699 64.2514 74.5001C65.9083 71.6304 62.5986 66.6177 56.8591 63.304Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { d: "M73.697 50.8591C70.3833 45.1196 65.3706 41.8099 62.5008 43.4668C59.6311 45.1237 59.991 51.1196 63.3047 56.8591C66.6184 62.5986 71.6311 65.9083 74.5008 64.2514C77.3706 62.5946 77.0107 56.5986 73.697 50.8591Z", fill: "currentColor" }));
2551
- function hr({
2552
- className: t,
2553
- size: l = 150,
2554
- iconClassName: r,
2555
- isLoading: s = !1,
2556
- isFullPage: m = !0,
2557
- variant: u = "yellow"
2617
+ const Nr = (e) => /* @__PURE__ */ K.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 177 177", fill: "none", ...e }, /* @__PURE__ */ K.createElement("path", { opacity: 0.083334, d: "M94.5 48.5C94.5 41.8726 91.8137 36.5 88.5 36.5C85.1863 36.5 82.5 41.8726 82.5 48.5C82.5 55.1274 85.1863 60.5 88.5 60.5C91.8137 60.5 94.5 55.1274 94.5 48.5Z", fill: "currentColor" }), /* @__PURE__ */ K.createElement("path", { opacity: 0.166667, d: "M113.697 56.8591C117.011 51.1196 117.371 45.1237 114.501 43.4668C111.631 41.8099 106.618 45.1196 103.305 50.8591C99.991 56.5986 99.6311 62.5946 102.501 64.2514C105.371 65.9083 110.383 62.5986 113.697 56.8591Z", fill: "currentColor" }), /* @__PURE__ */ K.createElement("path", { opacity: 0.25, d: "M126.141 73.696C131.88 70.3823 135.19 65.3696 133.533 62.4999C131.876 59.6301 125.88 59.99 120.141 63.3037C114.401 66.6174 111.092 71.6301 112.749 74.4999C114.405 77.3696 120.401 77.0097 126.141 73.696Z", fill: "currentColor" }), /* @__PURE__ */ K.createElement("path", { opacity: 0.333334, d: "M128.5 94.5C135.127 94.5 140.5 91.8137 140.5 88.5C140.5 85.1863 135.127 82.5 128.5 82.5C121.873 82.5 116.5 85.1863 116.5 88.5C116.5 91.8137 121.873 94.5 128.5 94.5Z", fill: "currentColor" }), /* @__PURE__ */ K.createElement("path", { opacity: 0.416667, d: "M120.141 113.696C125.88 117.01 131.876 117.37 133.533 114.5C135.19 111.63 131.88 106.617 126.141 103.304C120.401 99.99 114.405 99.6301 112.749 102.5C111.092 105.37 114.401 110.382 120.141 113.696Z", fill: "currentColor" }), /* @__PURE__ */ K.createElement("path", { opacity: 0.5, d: "M103.303 126.141C106.617 131.88 111.629 135.19 114.499 133.533C117.369 131.876 117.009 125.88 113.695 120.141C110.382 114.401 105.369 111.092 102.499 112.749C99.6294 114.405 99.9893 120.401 103.303 126.141Z", fill: "currentColor" }), /* @__PURE__ */ K.createElement("path", { opacity: 0.583334, d: "M82.5 128.5C82.5 135.127 85.1863 140.5 88.5 140.5C91.8137 140.5 94.5 135.127 94.5 128.5C94.5 121.873 91.8137 116.5 88.5 116.5C85.1863 116.5 82.5 121.873 82.5 128.5Z", fill: "currentColor" }), /* @__PURE__ */ K.createElement("path", { opacity: 0.666667, d: "M63.303 120.141C59.9893 125.88 59.6294 131.876 62.4992 133.533C65.3689 135.19 70.3816 131.88 73.6953 126.141C77.009 120.401 77.3689 114.405 74.4992 112.749C71.6294 111.092 66.6167 114.401 63.303 120.141Z", fill: "currentColor" }), /* @__PURE__ */ K.createElement("path", { opacity: 0.75, d: "M50.8591 103.304C45.1196 106.618 41.8099 111.63 43.4668 114.5C45.1237 117.37 51.1196 117.01 56.8591 113.696C62.5986 110.383 65.9083 105.37 64.2514 102.5C62.5946 99.6304 56.5986 99.9903 50.8591 103.304Z", fill: "currentColor" }), /* @__PURE__ */ K.createElement("path", { opacity: 0.833334, d: "M48.5 82.5C41.8726 82.5 36.5 85.1863 36.5 88.5C36.5 91.8137 41.8726 94.5 48.5 94.5C55.1274 94.5 60.5 91.8137 60.5 88.5C60.5 85.1863 55.1274 82.5 48.5 82.5Z", fill: "currentColor" }), /* @__PURE__ */ K.createElement("path", { opacity: 0.916667, d: "M56.8591 63.304C51.1196 59.9903 45.1237 59.6304 43.4668 62.5001C41.8099 65.3699 45.1196 70.3826 50.8591 73.6963C56.5986 77.01 62.5946 77.3699 64.2514 74.5001C65.9083 71.6304 62.5986 66.6177 56.8591 63.304Z", fill: "currentColor" }), /* @__PURE__ */ K.createElement("path", { d: "M73.697 50.8591C70.3833 45.1196 65.3706 41.8099 62.5008 43.4668C59.6311 45.1237 59.991 51.1196 63.3047 56.8591C66.6184 62.5986 71.6311 65.9083 74.5008 64.2514C77.3706 62.5946 77.0107 56.5986 73.697 50.8591Z", fill: "currentColor" }));
2618
+ function nn({
2619
+ className: e,
2620
+ size: r = 150,
2621
+ iconClassName: n,
2622
+ isLoading: l = !1,
2623
+ isFullPage: c = !0,
2624
+ variant: i = "yellow"
2558
2625
  }) {
2559
- return s ? /* @__PURE__ */ e(
2626
+ return l ? /* @__PURE__ */ t(
2560
2627
  "div",
2561
2628
  {
2562
- className: n(
2629
+ className: s(
2563
2630
  "z-[99px] flex flex-col items-center justify-center transition-all duration-300",
2564
- m ? "fixed inset-0 backdrop-blur-[2px]" : "absolute inset-0 w-full h-full rounded-[inherit]",
2565
- t
2631
+ c ? "fixed inset-0 backdrop-blur-[2px]" : "absolute inset-0 w-full h-full rounded-[inherit]",
2632
+ e
2566
2633
  ),
2567
- children: /* @__PURE__ */ e(
2568
- Yt,
2634
+ children: /* @__PURE__ */ t(
2635
+ Nr,
2569
2636
  {
2570
- width: l,
2571
- height: l,
2572
- className: n(
2637
+ width: r,
2638
+ height: r,
2639
+ className: s(
2573
2640
  "animate-spin",
2574
- !r && (u === "blue" ? "text-blue-600" : "text-yellow-500"),
2575
- r
2641
+ !n && (i === "blue" ? "text-blue-600" : "text-yellow-500"),
2642
+ n
2576
2643
  ),
2577
2644
  style: { fill: "currentColor", stroke: "currentColor" }
2578
2645
  }
@@ -2580,255 +2647,260 @@ function hr({
2580
2647
  }
2581
2648
  ) : null;
2582
2649
  }
2583
- const Ot = fe(
2650
+ const kr = {
2651
+ sm: {
2652
+ input: "h-9 text-sm",
2653
+ iconPadding: "pl-8 pr-2",
2654
+ defaultPadding: "px-2",
2655
+ iconSize: "w-4 h-4",
2656
+ iconLeft: "left-2",
2657
+ labelFont: "text-sm",
2658
+ iconWrapper: "h-4"
2659
+ },
2660
+ md: {
2661
+ input: "h-10 text-sm",
2662
+ iconPadding: "pl-10 pr-4",
2663
+ defaultPadding: "px-4",
2664
+ iconSize: "w-4 h-4",
2665
+ iconLeft: "left-3",
2666
+ labelFont: "text-base",
2667
+ iconWrapper: "h-4"
2668
+ },
2669
+ base: {
2670
+ input: "h-12 text-base",
2671
+ iconPadding: "pl-11 pr-4",
2672
+ defaultPadding: "px-4",
2673
+ iconSize: "w-5 h-5",
2674
+ iconLeft: "left-3",
2675
+ labelFont: "text-base",
2676
+ iconWrapper: "h-5"
2677
+ }
2678
+ };
2679
+ function Cr(e) {
2680
+ let r = e.replace(/\D/g, "");
2681
+ r.startsWith("998") || (r = `998${r}`), r = r.substring(0, 12);
2682
+ let n = "+998";
2683
+ return r.length > 3 && (n += ` (${r.substring(3, 5)}`), r.length > 5 && (n += `) ${r.substring(5, 8)}`), r.length > 8 && (n += ` ${r.substring(8, 10)}`), r.length > 10 && (n += ` ${r.substring(10, 12)}`), n;
2684
+ }
2685
+ function Sr(e) {
2686
+ return e ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600";
2687
+ }
2688
+ function Dr(e, r, n) {
2689
+ return e ? "text-slate-400" : r ? "text-red-600" : n ? "text-black" : "text-slate-400";
2690
+ }
2691
+ const Mr = me(
2584
2692
  ({
2585
- label: t,
2586
- placeholder: l = "+998 (__) ___ __ __",
2587
- size: r = "base",
2588
- error: s,
2589
- disabled: m = !1,
2590
- required: u = !1,
2693
+ label: e,
2694
+ placeholder: r = "+998 (__) ___ __ __",
2695
+ size: n = "base",
2696
+ error: l,
2697
+ disabled: c = !1,
2698
+ required: i = !1,
2591
2699
  value: a = "",
2592
- onChange: c,
2593
- onFocus: N,
2594
- onBlur: y,
2595
- className: C,
2596
- name: F,
2597
- showIcon: I = !1
2598
- }, R) => {
2599
- const [w, k] = H(!1), b = P((D) => {
2600
- let i = D.replace(/\D/g, "");
2601
- i.startsWith("998") || (i = "998" + i), i = i.substring(0, 12);
2602
- let d = "+998";
2603
- return i.length > 3 && (d += " (" + i.substring(3, 5)), i.length > 5 && (d += ") " + i.substring(5, 8)), i.length > 8 && (d += " " + i.substring(8, 10)), i.length > 10 && (d += " " + i.substring(10, 12)), d;
2604
- }, []), j = (D) => {
2605
- const i = D.target.value;
2606
- if (i.length < 5) {
2607
- c?.("+998");
2700
+ onChange: o,
2701
+ onFocus: g,
2702
+ onBlur: b,
2703
+ className: y,
2704
+ name: k,
2705
+ showIcon: T = !1
2706
+ }, E) => {
2707
+ const [S, h] = z(!1), w = (M) => {
2708
+ const m = M.target.value;
2709
+ if (m.length < 5) {
2710
+ o?.("+998");
2608
2711
  return;
2609
2712
  }
2610
- const d = b(i);
2611
- c?.(d);
2612
- }, S = () => {
2613
- k(!0), (!a || a === "") && c?.("+998"), N?.();
2614
- }, x = () => {
2615
- k(!1), y?.();
2616
- }, h = U(() => ({
2617
- sm: {
2618
- input: "h-9 text-sm",
2619
- padding: I ? "pl-8 pr-2" : "px-2",
2620
- iconSize: "w-4 h-4",
2621
- iconLeft: "left-2",
2622
- labelFont: "text-sm",
2623
- iconWrapper: "h-4"
2624
- },
2625
- md: {
2626
- input: "h-10 text-sm",
2627
- padding: I ? "pl-10 pr-4" : "px-4",
2628
- iconSize: "w-4 h-4",
2629
- iconLeft: "left-3",
2630
- labelFont: "text-base",
2631
- iconWrapper: "h-4"
2632
- },
2633
- base: {
2634
- input: "h-12 text-base",
2635
- padding: I ? "pl-11 pr-4" : "px-4",
2636
- iconSize: "w-5 h-5",
2637
- iconLeft: "left-3",
2638
- labelFont: "text-base",
2639
- iconWrapper: "h-5"
2640
- }
2641
- }), [I]), A = U(() => s ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [s]), M = U(() => m ? "text-slate-400" : s ? "text-red-600" : w ? "text-black" : "text-slate-400", [s, w, m]);
2642
- return /* @__PURE__ */ o("div", { className: n("w-full", C), children: [
2643
- t && /* @__PURE__ */ o("label", { className: n(
2713
+ const u = Cr(m);
2714
+ o?.(u);
2715
+ }, A = () => {
2716
+ h(!0), (!a || a === "") && o?.("+998"), g?.();
2717
+ }, L = () => {
2718
+ h(!1), b?.();
2719
+ }, v = kr[n], f = T ? v.iconPadding : v.defaultPadding, I = U(() => Sr(l), [l]), N = U(
2720
+ () => Dr(c, l, S),
2721
+ [l, S, c]
2722
+ );
2723
+ return /* @__PURE__ */ d("div", { className: s("w-full", y), children: [
2724
+ e && /* @__PURE__ */ d("label", { className: s(
2644
2725
  "mb-2 block font-medium transition-colors duration-200",
2645
- s ? "text-red-600" : w ? "text-blue-600" : "text-slate-700",
2646
- h[r].labelFont
2726
+ l ? "text-red-600" : S ? "text-blue-600" : "text-slate-700",
2727
+ v.labelFont
2647
2728
  ), children: [
2648
- t,
2649
- u && /* @__PURE__ */ e("span", { className: "text-red-600 ml-1", children: "*" })
2729
+ e,
2730
+ i && /* @__PURE__ */ t("span", { className: "text-red-600 ml-1", children: "*" })
2650
2731
  ] }),
2651
- /* @__PURE__ */ o("div", { className: "relative flex items-center", children: [
2652
- I && /* @__PURE__ */ e("div", { className: n(
2732
+ /* @__PURE__ */ d("div", { className: "relative flex items-center", children: [
2733
+ T && /* @__PURE__ */ t("div", { className: s(
2653
2734
  "absolute top-1/2 flex -translate-y-1/2 items-center justify-center transition-all duration-300",
2654
- h[r].iconLeft,
2655
- M
2656
- ), children: /* @__PURE__ */ e("div", { className: n("flex items-center justify-center", h[r].iconWrapper), children: /* @__PURE__ */ e(vt, { className: n(h[r].iconSize), weight: "Linear" }) }) }),
2657
- /* @__PURE__ */ e(
2735
+ v.iconLeft,
2736
+ N
2737
+ ), children: /* @__PURE__ */ t("div", { className: s("flex items-center justify-center", v.iconWrapper), children: /* @__PURE__ */ t(vt, { className: s(v.iconSize), weight: "Linear" }) }) }),
2738
+ /* @__PURE__ */ t(
2658
2739
  "input",
2659
2740
  {
2660
- ref: R,
2661
- name: F,
2741
+ ref: E,
2742
+ name: k,
2662
2743
  type: "tel",
2663
2744
  value: a,
2664
- onChange: j,
2665
- onFocus: S,
2666
- onBlur: x,
2667
- disabled: m,
2668
- placeholder: l,
2669
- className: n(
2745
+ onChange: w,
2746
+ onFocus: A,
2747
+ onBlur: L,
2748
+ disabled: c,
2749
+ placeholder: r,
2750
+ className: s(
2670
2751
  "w-full border bg-white font-normal transition-all duration-300 outline-none",
2671
- r === "base" ? "rounded-xl" : "rounded-lg",
2752
+ n === "base" ? "rounded-xl" : "rounded-lg",
2672
2753
  "disabled:bg-slate-100 disabled:text-slate-400 disabled:cursor-not-allowed",
2673
- h[r].input,
2674
- h[r].padding,
2675
- A
2754
+ v.input,
2755
+ f,
2756
+ I
2676
2757
  )
2677
2758
  }
2678
2759
  )
2679
2760
  ] }),
2680
- s && /* @__PURE__ */ e("p", { className: "mt-2 animate-slide-up text-sm font-normal text-red-600", children: s })
2761
+ l && /* @__PURE__ */ t("p", { className: "mt-2 animate-slide-up text-sm font-normal text-red-600", children: l })
2681
2762
  ] });
2682
2763
  }
2683
2764
  );
2684
- Ot.displayName = "MciPhone";
2685
- const Vt = fe(
2686
- ({ mode: t, onChange: l, value: r, ...s }, m) => {
2687
- const [u, a] = H(""), c = r !== void 0 ? r : u, N = (w) => {
2688
- const k = w.replace(/\s/g, "").toUpperCase();
2689
- let b = "";
2690
- for (let j = 0; j < k.length; j++) {
2691
- const S = k[j];
2692
- if (b.length < 2 ? /[A-Z]/.test(S) && (b += S) : /[0-9]/.test(S) && (b += S), b.length >= 9) break;
2693
- }
2694
- return b.length > 2 ? b.slice(0, 2) + " " + b.slice(2) : b;
2695
- }, y = (w) => w.replace(/\D/g, "").slice(0, 14), C = (w) => w.toUpperCase().replace(/[^A-Z0-9\-\s]/g, "").replace(/\s+/g, " ").slice(0, 15), F = P(
2696
- (w) => {
2697
- const k = w.target.value;
2698
- let b = "";
2699
- t === "passport" ? b = N(k) : t === "pinfl" ? b = y(k) : t === "metirka" && (b = C(k)), r === void 0 && a(b), w.target.value = b, l?.(b, w);
2765
+ Mr.displayName = "MciPhone";
2766
+ function Ar(e) {
2767
+ const r = e.replace(/\s/g, "").toUpperCase();
2768
+ let n = "";
2769
+ for (let l = 0; l < r.length; l += 1) {
2770
+ const c = r[l];
2771
+ if (n.length < 2 ? /[A-Z]/.test(c) && (n += c) : /[0-9]/.test(c) && (n += c), n.length >= 9) break;
2772
+ }
2773
+ return n.length > 2 ? `${n.slice(0, 2)} ${n.slice(2)}` : n;
2774
+ }
2775
+ function Er(e) {
2776
+ return e.replace(/\D/g, "").slice(0, 14);
2777
+ }
2778
+ function Tr(e) {
2779
+ return e.toUpperCase().replace(/[^A-Z0-9\-\s]/g, "").replace(/\s+/g, " ").slice(0, 15);
2780
+ }
2781
+ function Ir(e, r) {
2782
+ return e === "passport" ? Ar(r) : e === "pinfl" ? Er(r) : Tr(r);
2783
+ }
2784
+ function Fr(e, r) {
2785
+ return r || (e === "passport" ? "AA 1234567" : e === "pinfl" ? "12345678901234" : e === "metirka" ? "I-TN 1234567" : "");
2786
+ }
2787
+ function Lr(e, r) {
2788
+ return r || (e === "passport" ? 10 : e === "pinfl" ? 14 : e === "metirka" ? 15 : 255);
2789
+ }
2790
+ const jr = me(
2791
+ ({ mode: e, onChange: r, value: n, ...l }, c) => {
2792
+ const [i, a] = z(""), o = n !== void 0 ? n : i, g = O(
2793
+ (b) => {
2794
+ const y = b.target.value, k = Ir(e, y);
2795
+ n === void 0 && a(k), b.target.value = k, r?.(k, b);
2700
2796
  },
2701
- [t, l, r]
2702
- ), I = () => {
2703
- if (s.placeholder) return s.placeholder;
2704
- switch (t) {
2705
- case "passport":
2706
- return "AA 1234567";
2707
- case "pinfl":
2708
- return "12345678901234";
2709
- case "metirka":
2710
- return "I-TN 1234567";
2711
- default:
2712
- return "";
2713
- }
2714
- };
2715
- return /* @__PURE__ */ e(
2716
- Ie,
2797
+ [e, r, n]
2798
+ );
2799
+ return /* @__PURE__ */ t(
2800
+ je,
2717
2801
  {
2718
- ref: m,
2719
- ...s,
2720
- value: c,
2721
- onChange: F,
2722
- maxLength: (() => {
2723
- if (s.maxLength) return s.maxLength;
2724
- switch (t) {
2725
- case "passport":
2726
- return 10;
2727
- case "pinfl":
2728
- return 14;
2729
- case "metirka":
2730
- return 15;
2731
- default:
2732
- return 255;
2733
- }
2734
- })(),
2735
- placeholder: I()
2802
+ ref: c,
2803
+ ...l,
2804
+ value: o,
2805
+ onChange: g,
2806
+ maxLength: Lr(e, l.maxLength),
2807
+ placeholder: Fr(e, l.placeholder)
2736
2808
  }
2737
2809
  );
2738
2810
  }
2739
2811
  );
2740
- Vt.displayName = "MciIdentityInput";
2741
- function mr({
2742
- open: t,
2743
- onClose: l,
2744
- columns: r,
2745
- hidden: s,
2746
- onToggle: m,
2747
- onMove: u,
2812
+ jr.displayName = "MciIdentityInput";
2813
+ function ln({
2814
+ open: e,
2815
+ onClose: r,
2816
+ columns: n,
2817
+ hidden: l,
2818
+ onToggle: c,
2819
+ onMove: i,
2748
2820
  onMoveByKey: a,
2749
- minVisible: c = 5
2821
+ minVisible: o = 5
2750
2822
  }) {
2751
- const N = de(null), { handleClick: y } = Se(N, l);
2752
- ee(() => {
2753
- if (t)
2754
- return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
2755
- }, [t, y]);
2756
- const C = U(() => new Set(s), [s]), F = U(() => {
2757
- let d = 0;
2758
- for (const v of r) C.has(v.key) || d++;
2759
- return d;
2760
- }, [r, C]), [I, R] = H(null), [w, k] = H(null), [b, j] = H(null), [S, x] = H("before"), h = P(
2761
- (d, v, E) => {
2762
- let B = E === "after" ? v + 1 : v;
2763
- return d < B && (B -= 1), B;
2823
+ const g = se(null), { handleClick: b } = Me(g, r);
2824
+ G(() => {
2825
+ if (e)
2826
+ return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
2827
+ }, [e, b]);
2828
+ const y = U(() => new Set(l), [l]), k = U(() => {
2829
+ let u = 0;
2830
+ for (const p of n) y.has(p.key) || u++;
2831
+ return u;
2832
+ }, [n, y]), [T, E] = z(null), [S, h] = z(null), [w, A] = z(null), [L, v] = z("before"), f = O(
2833
+ (u, p, j) => {
2834
+ let F = j === "after" ? p + 1 : p;
2835
+ return u < F && (F -= 1), F;
2764
2836
  },
2765
2837
  []
2766
- ), A = P(() => {
2767
- R(null), j(null), k(null), x("before");
2768
- }, []), M = P(
2769
- (d, v, E) => {
2770
- R(v), j(String(E)), k(null), x("before"), d.dataTransfer.effectAllowed = "move", d.dataTransfer.setData("text/plain", String(v));
2771
- const B = new Image();
2772
- B.src = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=", d.dataTransfer.setDragImage(B, 0, 0);
2838
+ ), I = O(() => {
2839
+ E(null), A(null), h(null), v("before");
2840
+ }, []), N = O(
2841
+ (u, p, j) => {
2842
+ E(p), A(String(j)), h(null), v("before"), u.dataTransfer.effectAllowed = "move", u.dataTransfer.setData("text/plain", String(p));
2843
+ const F = new Image();
2844
+ F.src = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=", u.dataTransfer.setDragImage(F, 0, 0);
2773
2845
  },
2774
2846
  []
2775
- ), D = P(
2776
- (d, v) => {
2777
- d.preventDefault();
2778
- const E = I ?? Number.parseInt(d.dataTransfer.getData("text/plain") || "-1", 10);
2779
- if (!Number.isFinite(E) || E < 0) {
2780
- A();
2847
+ ), M = O(
2848
+ (u, p) => {
2849
+ u.preventDefault();
2850
+ const j = T ?? Number.parseInt(u.dataTransfer.getData("text/plain") || "-1", 10);
2851
+ if (!Number.isFinite(j) || j < 0) {
2852
+ I();
2781
2853
  return;
2782
2854
  }
2783
- const B = r[E], z = r[v];
2784
- if (!B || !z) {
2785
- A();
2855
+ const F = n[j], $ = n[p];
2856
+ if (!F || !$) {
2857
+ I();
2786
2858
  return;
2787
2859
  }
2788
- const O = h(E, v, S);
2789
- O !== E && (a ? a(B.key, z.key, S) : u(E, O)), A();
2860
+ const _ = f(j, p, L);
2861
+ _ !== j && (a ? a(F.key, $.key, L) : i(j, _)), I();
2790
2862
  },
2791
- [r, h, I, S, u, a, A]
2792
- ), i = P(
2793
- (d, v) => {
2794
- v || m(d);
2863
+ [n, f, T, L, i, a, I]
2864
+ ), m = O(
2865
+ (u, p) => {
2866
+ p || c(u);
2795
2867
  },
2796
- [m]
2868
+ [c]
2797
2869
  );
2798
- return t ? /* @__PURE__ */ o(
2870
+ return e ? /* @__PURE__ */ d(
2799
2871
  "div",
2800
2872
  {
2801
- ref: N,
2802
- className: n(
2873
+ ref: g,
2874
+ className: s(
2803
2875
  "absolute right-0 top-full z-50 mt-2 w-[320px]",
2804
2876
  "rounded-2xl p-4 bg-white",
2805
2877
  "border border-slate-200"
2806
2878
  ),
2807
2879
  children: [
2808
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between gap-4", children: [
2809
- /* @__PURE__ */ e("h4", { className: "text-slate-600 text-large font-normal", children: "Settings" }),
2810
- /* @__PURE__ */ e(
2880
+ /* @__PURE__ */ d("div", { className: "flex items-center justify-between gap-4", children: [
2881
+ /* @__PURE__ */ t("h4", { className: "text-slate-600 text-large font-normal", children: "Settings" }),
2882
+ /* @__PURE__ */ t(
2811
2883
  "button",
2812
2884
  {
2813
2885
  type: "button",
2814
- onClick: l,
2886
+ onClick: r,
2815
2887
  className: "rounded-lg px-2 py-1 text-slate-500 hover:bg-slate-100",
2816
2888
  "aria-label": "Close",
2817
2889
  children: "✕"
2818
2890
  }
2819
2891
  )
2820
2892
  ] }),
2821
- /* @__PURE__ */ e("div", { className: "my-4 h-px bg-slate-100" }),
2822
- /* @__PURE__ */ o("p", { className: "mb-3 text-xs text-slate-500", children: [
2893
+ /* @__PURE__ */ t("div", { className: "my-4 h-px bg-slate-100" }),
2894
+ /* @__PURE__ */ d("p", { className: "mb-3 text-xs text-slate-500", children: [
2823
2895
  "Active columns: ",
2824
- F,
2896
+ k,
2825
2897
  "/",
2826
- r.length
2898
+ n.length
2827
2899
  ] }),
2828
- /* @__PURE__ */ e(
2900
+ /* @__PURE__ */ t(
2829
2901
  "div",
2830
2902
  {
2831
- className: n(
2903
+ className: s(
2832
2904
  "max-h-[275px] overflow-auto",
2833
2905
  "[&::-webkit-scrollbar]:w-1.5",
2834
2906
  "[&::-webkit-scrollbar-track]:bg-transparent",
@@ -2836,76 +2908,76 @@ function mr({
2836
2908
  "[&::-webkit-scrollbar-thumb]:rounded-full",
2837
2909
  "hover:[&::-webkit-scrollbar-thumb]:bg-slate-300"
2838
2910
  ),
2839
- children: r.map((d, v) => {
2840
- const E = !C.has(d.key), B = E && F <= c, z = w === v, O = b === d.key;
2841
- return /* @__PURE__ */ o("div", { className: "relative", children: [
2842
- z && !O && /* @__PURE__ */ e(
2911
+ children: n.map((u, p) => {
2912
+ const j = !y.has(u.key), F = j && k <= o, $ = S === p, _ = w === u.key;
2913
+ return /* @__PURE__ */ d("div", { className: "relative", children: [
2914
+ $ && !_ && /* @__PURE__ */ t(
2843
2915
  "div",
2844
2916
  {
2845
- className: n(
2917
+ className: s(
2846
2918
  "pointer-events-none absolute left-2 right-2 z-10 h-0.5 rounded-full bg-blue-300",
2847
- S === "before" ? "top-0" : "bottom-0"
2919
+ L === "before" ? "top-0" : "bottom-0"
2848
2920
  )
2849
2921
  }
2850
2922
  ),
2851
- /* @__PURE__ */ o(
2923
+ /* @__PURE__ */ d(
2852
2924
  "div",
2853
2925
  {
2854
2926
  draggable: !0,
2855
- onDragStart: (W) => M(W, v, d.key),
2856
- onDragOver: (W) => {
2857
- if (I == null) return;
2858
- W.preventDefault(), W.dataTransfer.dropEffect = "move";
2859
- const J = W.currentTarget.getBoundingClientRect(), G = W.clientY - J.top > J.height / 2 ? "after" : "before";
2860
- w !== v && k(v), S !== G && x(G);
2927
+ onDragStart: (V) => N(V, p, u.key),
2928
+ onDragOver: (V) => {
2929
+ if (T == null) return;
2930
+ V.preventDefault(), V.dataTransfer.dropEffect = "move";
2931
+ const Z = V.currentTarget.getBoundingClientRect(), ne = V.clientY - Z.top > Z.height / 2 ? "after" : "before";
2932
+ S !== p && h(p), L !== ne && v(ne);
2861
2933
  },
2862
- onDrop: (W) => D(W, v),
2863
- onDragEnd: A,
2864
- className: n(
2934
+ onDrop: (V) => M(V, p),
2935
+ onDragEnd: I,
2936
+ className: s(
2865
2937
  "group flex items-center py-2 px-1 gap-4",
2866
2938
  "rounded-md box-border overflow-visible",
2867
2939
  "transition-[background,transform] duration-150",
2868
- !O && !z && "hover:bg-slate-50",
2869
- z && !O && "bg-slate-50",
2870
- O && "bg-slate-50 opacity-100 scale-[0.99] cursor-grabbing"
2940
+ !_ && !$ && "hover:bg-slate-50",
2941
+ $ && !_ && "bg-slate-50",
2942
+ _ && "bg-slate-50 opacity-100 scale-[0.99] cursor-grabbing"
2871
2943
  ),
2872
2944
  children: [
2873
- /* @__PURE__ */ e(
2945
+ /* @__PURE__ */ t(
2874
2946
  "button",
2875
2947
  {
2876
2948
  type: "button",
2877
- className: n(
2949
+ className: s(
2878
2950
  "shrink-0 text-slate-400",
2879
2951
  "cursor-grab active:cursor-grabbing",
2880
2952
  "rounded-lg p-1 hover:bg-slate-100",
2881
- O && "cursor-grabbing"
2953
+ _ && "cursor-grabbing"
2882
2954
  ),
2883
2955
  "aria-label": "Drag",
2884
- children: /* @__PURE__ */ e(yt, { weight: "Linear", size: 20 })
2956
+ children: /* @__PURE__ */ t(Nt, { weight: "Linear", size: 20 })
2885
2957
  }
2886
2958
  ),
2887
- /* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(
2959
+ /* @__PURE__ */ t("div", { className: "shrink-0", children: /* @__PURE__ */ t(
2888
2960
  De,
2889
2961
  {
2890
- checked: E,
2891
- disabled: B,
2892
- onChange: () => i(d.key, B),
2962
+ checked: j,
2963
+ disabled: F,
2964
+ onChange: () => m(u.key, F),
2893
2965
  variant: "blue"
2894
2966
  }
2895
2967
  ) }),
2896
- /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
2897
- /* @__PURE__ */ e("h4", { className: "truncate text-slate-700 text-base font-medium", title: d.title, children: d.title }),
2898
- B && /* @__PURE__ */ o("p", { className: "text-xs text-slate-400 mt-0.5", children: [
2968
+ /* @__PURE__ */ d("div", { className: "min-w-0 flex-1", children: [
2969
+ /* @__PURE__ */ t("h4", { className: "truncate text-slate-700 text-base font-medium", title: u.title, children: u.title }),
2970
+ F && /* @__PURE__ */ d("p", { className: "text-xs text-slate-400 mt-0.5", children: [
2899
2971
  "Минимум ",
2900
- c,
2972
+ o,
2901
2973
  " колонок"
2902
2974
  ] })
2903
2975
  ] })
2904
2976
  ]
2905
2977
  }
2906
2978
  ),
2907
- v !== r.length - 1 && /* @__PURE__ */ e("div", { className: "mx-2 h-px bg-slate-100" })
2908
- ] }, d.key);
2979
+ p !== n.length - 1 && /* @__PURE__ */ t("div", { className: "mx-2 h-px bg-slate-100" })
2980
+ ] }, u.key);
2909
2981
  })
2910
2982
  }
2911
2983
  )
@@ -2913,157 +2985,157 @@ function mr({
2913
2985
  }
2914
2986
  ) : null;
2915
2987
  }
2916
- const We = (t) => Array.isArray(t) && t.every((l) => typeof l == "string"), Ht = (t) => {
2917
- if (!t) return null;
2988
+ const We = (e) => Array.isArray(e) && e.every((r) => typeof r == "string"), $r = (e) => {
2989
+ if (!e) return null;
2918
2990
  try {
2919
- const l = JSON.parse(t);
2920
- if (typeof l != "object" || l === null) return null;
2921
- const r = l;
2922
- return !We(r.order) || !We(r.hidden) ? null : { order: r.order, hidden: r.hidden };
2991
+ const r = JSON.parse(e);
2992
+ if (typeof r != "object" || r === null) return null;
2993
+ const n = r;
2994
+ return !We(n.order) || !We(n.hidden) ? null : { order: n.order, hidden: n.hidden };
2923
2995
  } catch {
2924
2996
  return null;
2925
2997
  }
2926
- }, he = (t) => {
2927
- const l = /* @__PURE__ */ new Set(), r = [];
2928
- for (const s of t)
2929
- l.has(s) || (l.add(s), r.push(s));
2930
- return r;
2931
- }, _t = (t) => new Set((t ?? []).map(String)), Ye = (t, l) => {
2932
- const r = l ? he(l.filter((s) => t.includes(s))) : [];
2933
- return he([...r, ...t]);
2934
- }, Oe = (t, l) => {
2935
- if (!l?.length) return [];
2936
- const r = _t(l);
2937
- return t.filter((s) => !r.has(s));
2938
- }, Ut = (t, l) => Math.max(0, Math.min(t, l)), be = (t, l, r) => {
2939
- const s = new Set(l), m = he(t.filter((a) => s.has(a))), u = Math.max(0, l.length - r);
2940
- return m.slice(0, u);
2998
+ }, ue = (e) => {
2999
+ const r = /* @__PURE__ */ new Set(), n = [];
3000
+ for (const l of e)
3001
+ r.has(l) || (r.add(l), n.push(l));
3002
+ return n;
3003
+ }, Rr = (e) => new Set((e ?? []).map(String)), Ye = (e, r) => {
3004
+ const n = r ? ue(r.filter((l) => e.includes(l))) : [];
3005
+ return ue([...n, ...e]);
3006
+ }, He = (e, r) => {
3007
+ if (!r?.length) return [];
3008
+ const n = Rr(r);
3009
+ return e.filter((l) => !n.has(l));
3010
+ }, Or = (e, r) => Math.max(0, Math.min(e, r)), ge = (e, r, n) => {
3011
+ const l = new Set(r), c = ue(e.filter((a) => l.has(a))), i = Math.max(0, r.length - n);
3012
+ return c.slice(0, i);
2941
3013
  };
2942
- function fr(t) {
2943
- const { storageKey: l, columns: r, defaultVisibleKeys: s, defaultOrder: m, minVisible: u = 5 } = t, a = U(() => r.map((h) => String(h.key)), [r]), c = U(() => new Set(a), [a]), N = U(
2944
- () => Ut(u, a.length),
2945
- [a.length, u]
2946
- ), [y, C] = H(() => {
2947
- const h = Ye(
3014
+ function sn(e) {
3015
+ const { storageKey: r, columns: n, defaultVisibleKeys: l, defaultOrder: c, minVisible: i = 5 } = e, a = U(() => n.map((f) => String(f.key)), [n]), o = U(() => new Set(a), [a]), g = U(
3016
+ () => Or(i, a.length),
3017
+ [a.length, i]
3018
+ ), [b, y] = z(() => {
3019
+ const f = Ye(
2948
3020
  a,
2949
- m?.map(String) ?? []
2950
- ), A = Oe(
3021
+ c?.map(String) ?? []
3022
+ ), I = He(
2951
3023
  a,
2952
- s?.map(String) ?? []
3024
+ l?.map(String) ?? []
2953
3025
  );
2954
3026
  if (typeof window > "u")
2955
3027
  return {
2956
- order: h,
2957
- hidden: be(A, a, N)
3028
+ order: f,
3029
+ hidden: ge(I, a, g)
2958
3030
  };
2959
- const M = Ht(window.localStorage.getItem(l)), D = he((M?.order ?? []).filter((E) => c.has(E))), i = he([...D, ...h, ...a]), d = he((M?.hidden ?? []).filter((E) => c.has(E)));
3031
+ const N = $r(window.localStorage.getItem(r)), M = ue((N?.order ?? []).filter((j) => o.has(j))), m = ue([...M, ...f, ...a]), u = ue((N?.hidden ?? []).filter((j) => o.has(j)));
2960
3032
  return {
2961
- order: i,
2962
- hidden: be(M ? d : A, a, N)
3033
+ order: m,
3034
+ hidden: ge(N ? u : I, a, g)
2963
3035
  };
2964
3036
  });
2965
- ee(() => {
3037
+ G(() => {
2966
3038
  if (!(typeof window > "u"))
2967
3039
  try {
2968
- window.localStorage.setItem(l, JSON.stringify(y));
3040
+ window.localStorage.setItem(r, JSON.stringify(b));
2969
3041
  } catch {
2970
3042
  }
2971
- }, [y, l]), ee(() => {
2972
- C((h) => {
2973
- const A = he([
2974
- ...h.order.filter((d) => c.has(d)),
2975
- ...a.filter((d) => !h.order.includes(d))
2976
- ]), M = be(h.hidden, a, N), D = A.length === h.order.length && A.every((d, v) => d === h.order[v]), i = M.length === h.hidden.length && M.every((d, v) => d === h.hidden[v]);
2977
- return D && i ? h : { order: A, hidden: M };
3043
+ }, [b, r]), G(() => {
3044
+ y((f) => {
3045
+ const I = ue([
3046
+ ...f.order.filter((u) => o.has(u)),
3047
+ ...a.filter((u) => !f.order.includes(u))
3048
+ ]), N = ge(f.hidden, a, g), M = I.length === f.order.length && I.every((u, p) => u === f.order[p]), m = N.length === f.hidden.length && N.every((u, p) => u === f.hidden[p]);
3049
+ return M && m ? f : { order: I, hidden: N };
2978
3050
  });
2979
- }, [a, c, N]);
2980
- const F = U(() => new Set(y.hidden), [y.hidden]), I = U(() => {
2981
- const h = /* @__PURE__ */ new Map();
2982
- return y.order.forEach((A, M) => h.set(A, M)), [...r].sort((A, M) => {
2983
- const D = h.get(String(A.key)) ?? Number.MAX_SAFE_INTEGER, i = h.get(String(M.key)) ?? Number.MAX_SAFE_INTEGER;
2984
- return D - i;
3051
+ }, [a, o, g]);
3052
+ const k = U(() => new Set(b.hidden), [b.hidden]), T = U(() => {
3053
+ const f = /* @__PURE__ */ new Map();
3054
+ return b.order.forEach((I, N) => f.set(I, N)), [...n].sort((I, N) => {
3055
+ const M = f.get(String(I.key)) ?? Number.MAX_SAFE_INTEGER, m = f.get(String(N.key)) ?? Number.MAX_SAFE_INTEGER;
3056
+ return M - m;
2985
3057
  });
2986
- }, [r, y.order]), R = U(
2987
- () => I.filter((h) => !F.has(String(h.key))),
2988
- [I, F]
2989
- ), w = U(
2990
- () => y.hidden.filter((h) => c.has(h)),
2991
- [y.hidden, c]
2992
- ), k = a.length - w.length, b = P((h) => {
2993
- const A = String(h);
2994
- C((M) => {
2995
- if (M.hidden.includes(A))
2996
- return { ...M, hidden: M.hidden.filter((v) => v !== A) };
2997
- if (a.length - M.hidden.length <= N) return M;
2998
- const d = be([...M.hidden, A], a, N);
2999
- return { ...M, hidden: d };
3058
+ }, [n, b.order]), E = U(
3059
+ () => T.filter((f) => !k.has(String(f.key))),
3060
+ [T, k]
3061
+ ), S = U(
3062
+ () => b.hidden.filter((f) => o.has(f)),
3063
+ [b.hidden, o]
3064
+ ), h = a.length - S.length, w = O((f) => {
3065
+ const I = String(f);
3066
+ y((N) => {
3067
+ if (N.hidden.includes(I))
3068
+ return { ...N, hidden: N.hidden.filter((p) => p !== I) };
3069
+ if (a.length - N.hidden.length <= g) return N;
3070
+ const u = ge([...N.hidden, I], a, g);
3071
+ return { ...N, hidden: u };
3000
3072
  });
3001
- }, [a, N]), j = P((h, A) => {
3002
- C((M) => {
3003
- const D = M.order.slice();
3004
- if (h < 0 || A < 0 || h >= D.length || A >= D.length) return M;
3005
- const [i] = D.splice(h, 1);
3006
- return D.splice(A, 0, i), { ...M, order: D };
3073
+ }, [a, g]), A = O((f, I) => {
3074
+ y((N) => {
3075
+ const M = N.order.slice();
3076
+ if (f < 0 || I < 0 || f >= M.length || I >= M.length) return N;
3077
+ const [m] = M.splice(f, 1);
3078
+ return M.splice(I, 0, m), { ...N, order: M };
3007
3079
  });
3008
- }, []), S = P((h, A, M = "before") => {
3009
- const D = String(h), i = String(A);
3010
- D !== i && C((d) => {
3011
- const v = d.order.slice(), E = v.indexOf(D), B = v.indexOf(i);
3012
- if (E < 0 || B < 0 || E === B) return d;
3013
- let z = M === "after" ? B + 1 : B;
3014
- if (E < z && (z -= 1), z === E) return d;
3015
- const [O] = v.splice(E, 1);
3016
- return v.splice(z, 0, O), { ...d, order: v };
3080
+ }, []), L = O((f, I, N = "before") => {
3081
+ const M = String(f), m = String(I);
3082
+ M !== m && y((u) => {
3083
+ const p = u.order.slice(), j = p.indexOf(M), F = p.indexOf(m);
3084
+ if (j < 0 || F < 0 || j === F) return u;
3085
+ let $ = N === "after" ? F + 1 : F;
3086
+ if (j < $ && ($ -= 1), $ === j) return u;
3087
+ const [_] = p.splice(j, 1);
3088
+ return p.splice($, 0, _), { ...u, order: p };
3017
3089
  });
3018
- }, []), x = P(() => {
3019
- C(() => {
3020
- const h = Ye(
3090
+ }, []), v = O(() => {
3091
+ y(() => {
3092
+ const f = Ye(
3021
3093
  a,
3022
- m?.map(String) ?? []
3023
- ), A = Oe(
3094
+ c?.map(String) ?? []
3095
+ ), I = He(
3024
3096
  a,
3025
- s?.map(String) ?? []
3097
+ l?.map(String) ?? []
3026
3098
  );
3027
3099
  return {
3028
- order: h,
3029
- hidden: be(A, a, N)
3100
+ order: f,
3101
+ hidden: ge(I, a, g)
3030
3102
  };
3031
3103
  });
3032
- }, [a, m, s, N]);
3104
+ }, [a, c, l, g]);
3033
3105
  return {
3034
- orderedAllColumns: I,
3035
- orderedColumns: R,
3036
- hiddenKeys: w,
3037
- visibleCount: k,
3038
- toggleColumn: b,
3039
- moveColumn: j,
3040
- moveColumnByKey: S,
3041
- reset: x
3106
+ orderedAllColumns: T,
3107
+ orderedColumns: E,
3108
+ hiddenKeys: S,
3109
+ visibleCount: h,
3110
+ toggleColumn: w,
3111
+ moveColumn: A,
3112
+ moveColumnByKey: L,
3113
+ reset: v
3042
3114
  };
3043
3115
  }
3044
3116
  export {
3045
- Qt as MciBreadcrumb,
3046
- er as MciButton,
3117
+ Hr as MciBreadcrumb,
3118
+ Ur as MciButton,
3047
3119
  De as MciCheck,
3048
- tr as MciCollapse,
3049
- rr as MciDrawer,
3050
- Vt as MciIdentityInput,
3051
- Ie as MciInput,
3052
- hr as MciLoader,
3053
- sr as MciModal,
3054
- ar as MciPagination,
3055
- Ot as MciPhone,
3056
- Ft as MciPicker,
3057
- Lt as MciSelect,
3058
- Pe as MciSkeleton,
3059
- nr as MciTable,
3060
- mr as MciTableColumnsPanel,
3061
- or as MciTabs,
3062
- ir as MciTag,
3063
- Pt as MciTextarea,
3064
- cr as MciToast,
3065
- ur as MciToggle,
3066
- dr as MciTooltip,
3067
- lr as MciUpload,
3068
- fr as useTableColumnSettings
3120
+ Vr as MciCollapse,
3121
+ Zr as MciDrawer,
3122
+ jr as MciIdentityInput,
3123
+ je as MciInput,
3124
+ nn as MciLoader,
3125
+ Jr as MciModal,
3126
+ Kr as MciPagination,
3127
+ Mr as MciPhone,
3128
+ Ht as MciPicker,
3129
+ Gt as MciSelect,
3130
+ Be as MciSkeleton,
3131
+ qr as MciTable,
3132
+ ln as MciTableColumnsPanel,
3133
+ Xr as MciTabs,
3134
+ Qr as MciTag,
3135
+ hr as MciTextarea,
3136
+ en as MciToast,
3137
+ rn as MciToggle,
3138
+ tn as MciTooltip,
3139
+ Gr as MciUpload,
3140
+ sn as useTableColumnSettings
3069
3141
  };