@mci-ui/mci-ui 0.0.75 → 0.0.77

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