react-admin-crud-manager 1.0.21 → 1.0.23

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,65 +1,65 @@
1
- import { jsx as e, Fragment as E, jsxs as c } from "react/jsx-runtime";
2
- import Ce, { useState as M, useRef as ae, useEffect as z, useMemo as Me } from "react";
3
- import { ChevronDown as Te, Search as Re, Check as Ke, X as we, Plus as ze, Filter as He, ChevronLeft as Ye, ChevronRight as Ve, EllipsisVertical as We, User as Fe, Music as qe } from "lucide-react";
4
- import { createPortal as Ze } from "react-dom";
5
- import { Icon as te } from "@iconify/react";
6
- import { Editor as Je } from "@tinymce/tinymce-react";
7
- import { SnackbarProvider as Qe, enqueueSnackbar as ke } from "notistack";
8
- import a from "prop-types";
9
- const Pe = (u, l = "DD MMM YYYY") => {
10
- if (!u) return "N/A";
11
- const i = new Date(u);
12
- if (isNaN(i)) return "Invalid Date";
13
- const o = (t) => String(t).padStart(2, "0"), s = {
14
- YYYY: i.getFullYear(),
15
- YY: String(i.getFullYear()).slice(-2),
16
- MMMM: i.toLocaleString("en-US", { month: "long" }),
17
- MMM: i.toLocaleString("en-US", { month: "short" }),
18
- MM: o(i.getMonth() + 1),
19
- M: i.getMonth() + 1,
20
- DD: o(i.getDate()),
21
- D: i.getDate(),
22
- dddd: i.toLocaleString("en-US", { weekday: "long" }),
23
- ddd: i.toLocaleString("en-US", { weekday: "short" }),
24
- HH: o(i.getHours()),
25
- hh: o(i.getHours() % 12 || 12),
26
- mm: o(i.getMinutes()),
27
- ss: o(i.getSeconds()),
28
- A: i.getHours() >= 12 ? "PM" : "AM"
1
+ import { jsx as e, Fragment as j, jsxs as h } from "react/jsx-runtime";
2
+ import Le, { useState as R, useRef as ee, useEffect as K, useMemo as Re } from "react";
3
+ import { ChevronDown as Ie, Search as Oe, Check as Ye, X as Ne, Plus as Ve, Filter as We, ChevronLeft as qe, ChevronRight as Ze, EllipsisVertical as Je, User as Be, Music as Qe } from "lucide-react";
4
+ import { createPortal as Xe } from "react-dom";
5
+ import { Icon as re } from "@iconify/react";
6
+ import { Editor as ea } from "@tinymce/tinymce-react";
7
+ import { SnackbarProvider as aa, enqueueSnackbar as Se } from "notistack";
8
+ import r from "prop-types";
9
+ const Ue = (b, o = "DD MMM YYYY") => {
10
+ if (!b) return "N/A";
11
+ const s = new Date(b);
12
+ if (isNaN(s)) return "Invalid Date";
13
+ const i = (t) => String(t).padStart(2, "0"), d = {
14
+ YYYY: s.getFullYear(),
15
+ YY: String(s.getFullYear()).slice(-2),
16
+ MMMM: s.toLocaleString("en-US", { month: "long" }),
17
+ MMM: s.toLocaleString("en-US", { month: "short" }),
18
+ MM: i(s.getMonth() + 1),
19
+ M: s.getMonth() + 1,
20
+ DD: i(s.getDate()),
21
+ D: s.getDate(),
22
+ dddd: s.toLocaleString("en-US", { weekday: "long" }),
23
+ ddd: s.toLocaleString("en-US", { weekday: "short" }),
24
+ HH: i(s.getHours()),
25
+ hh: i(s.getHours() % 12 || 12),
26
+ mm: i(s.getMinutes()),
27
+ ss: i(s.getSeconds()),
28
+ A: s.getHours() >= 12 ? "PM" : "AM"
29
29
  };
30
- return l.replace(
30
+ return o.replace(
31
31
  /YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|HH|hh|mm|ss|A/g,
32
- (t) => s[t]
32
+ (t) => d[t]
33
33
  );
34
- }, Xe = (u, l, i = []) => {
35
- if (!(l != null && l.trim())) return u;
36
- const o = l.toLowerCase(), s = (t) => t == null ? [] : typeof t == "object" ? Object.values(t).flatMap(s) : [String(t)];
37
- return u.filter((t) => {
38
- let p = [];
39
- return i.length > 0 ? i.forEach((k) => {
40
- t[k] !== void 0 && p.push(...s(t[k]));
41
- }) : p = s(t), p.some(
42
- (k) => k.toLowerCase().includes(o)
34
+ }, ra = (b, o, s = []) => {
35
+ if (!(o != null && o.trim())) return b;
36
+ const i = o.toLowerCase(), d = (t) => t == null ? [] : typeof t == "object" ? Object.values(t).flatMap(d) : [String(t)];
37
+ return b.filter((t) => {
38
+ let g = [];
39
+ return s.length > 0 ? s.forEach((M) => {
40
+ t[M] !== void 0 && g.push(...d(t[M]));
41
+ }) : g = d(t), g.some(
42
+ (M) => M.toLowerCase().includes(i)
43
43
  );
44
44
  });
45
- }, ee = Ce.forwardRef(
45
+ }, Z = Le.forwardRef(
46
46
  ({
47
- className: u = "",
48
- variant: l = "contained",
49
- color: i = "default",
50
- size: o = "default",
51
- fullWidth: s = !1,
47
+ className: b = "",
48
+ variant: o = "contained",
49
+ color: s = "default",
50
+ size: i = "default",
51
+ fullWidth: d = !1,
52
52
  children: t,
53
- ...p
54
- }, k) => {
55
- var d;
56
- const w = "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", b = {
53
+ ...g
54
+ }, M) => {
55
+ var c;
56
+ const S = "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", p = {
57
57
  sm: "h-8 px-3 rounded-md text-sm",
58
58
  md: "h-9 px-4 rounded-md text-sm",
59
59
  lg: "h-11 px-6 rounded-md text-base",
60
60
  xl: "h-12 px-8 rounded-lg text-lg",
61
61
  default: "h-9 px-4 rounded-md text-sm"
62
- }, n = {
62
+ }, l = {
63
63
  primary: {
64
64
  contained: "bg-primary text-white hover:bg-primary-600 focus:ring-primary-500 shadow-sm",
65
65
  outlined: "border border-primary bg-transparent text-primary hover:bg-primary-50 focus:ring-primary-500",
@@ -80,129 +80,129 @@ const Pe = (u, l = "DD MMM YYYY") => {
80
80
  outlined: "border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-300 dark:border-gray-600 dark:text-gray-200 dark:hover:bg-gray-700 dark:focus:ring-gray-500",
81
81
  text: "bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-300 dark:text-gray-200 dark:hover:bg-gray-700 dark:focus:ring-gray-500"
82
82
  }
83
- }, h = ((d = n[i]) == null ? void 0 : d[l]) || n.default.contained, g = b[o], x = `
84
- ${w}
85
- ${h}
86
- ${g}
87
- ${s ? "w-full" : ""}
88
- ${u}
83
+ }, u = ((c = l[s]) == null ? void 0 : c[o]) || l.default.contained, m = p[i], v = `
84
+ ${S}
85
+ ${u}
86
+ ${m}
87
+ ${d ? "w-full" : ""}
88
+ ${b}
89
89
  `.trim();
90
90
  return /* @__PURE__ */ e(
91
91
  "button",
92
92
  {
93
- ref: k,
94
- type: p.type || "button",
95
- className: x,
96
- ...p,
93
+ ref: M,
94
+ type: g.type || "button",
95
+ className: v,
96
+ ...g,
97
97
  children: t
98
98
  }
99
99
  );
100
100
  }
101
101
  );
102
- ee.displayName = "Button";
103
- function Q({ label: u, required: l = !1 }) {
104
- return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ c("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
105
- u,
106
- l && /* @__PURE__ */ e("span", { className: "ml-1", children: "*" })
102
+ Z.displayName = "Button";
103
+ function q({ label: b, required: o = !1 }) {
104
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
105
+ b,
106
+ o && /* @__PURE__ */ e("span", { className: "ml-1", children: "*" })
107
107
  ] }) });
108
108
  }
109
- const ea = ({
110
- options: u = [],
111
- value: l = "",
112
- defaultValue: i = "",
113
- onChange: o,
114
- placeholder: s = "Select option",
109
+ const ta = ({
110
+ options: b = [],
111
+ value: o = "",
112
+ defaultValue: s = "",
113
+ onChange: i,
114
+ placeholder: d = "Select option",
115
115
  className: t = "",
116
- disabled: p = !1,
117
- search: k = !1,
118
- label: w = "",
119
- required: b = !1,
120
- name: n = "",
121
- parentClass: h = "",
122
- multiple: g = !1,
116
+ disabled: g = !1,
117
+ search: M = !1,
118
+ label: S = "",
119
+ required: p = !1,
120
+ name: l = "",
121
+ parentClass: u = "",
122
+ multiple: m = !1,
123
123
  // ✅ NEW
124
- dropdownMaxHeight: x = "",
125
- formData: d = {},
126
- dependencyKey: v = ""
124
+ dropdownMaxHeight: v = "",
125
+ formData: c = {},
126
+ dependencyKey: w = ""
127
127
  }) => {
128
- var q;
129
- const [y, S] = M(!1), [I, D] = M(""), [C, A] = M(!0), B = ae(null), F = ae(null), [R, U] = M([]);
130
- let $ = l || l === !1 ? l : i;
131
- const W = (N) => N == null || N === "" ? "" : String(typeof N == "boolean" ? N : N ?? "");
132
- z(
128
+ var V;
129
+ const [y, k] = R(!1), [I, A] = R(""), [C, O] = R(!0), F = ee(null), T = ee(null), [L, B] = R([]);
130
+ let E = o || o === !1 ? o : s;
131
+ const Y = (x) => x == null || x === "" ? "" : String(typeof x == "boolean" ? x : x ?? "");
132
+ K(
133
133
  () => {
134
134
  (async () => {
135
- if (typeof u == "function") {
136
- const H = await u(d);
137
- U(H);
135
+ if (typeof b == "function") {
136
+ const H = await b(c);
137
+ B(H);
138
138
  } else
139
- U(u || []);
139
+ B(b || []);
140
140
  })();
141
141
  },
142
- v ? [u, d == null ? void 0 : d[v]] : [u]
142
+ w ? [b, c == null ? void 0 : c[w]] : [b]
143
143
  );
144
- const G = g ? ($ || []).map(W) : W($), K = R.filter(
145
- (N) => N.label.toLowerCase().includes(I.toLowerCase())
146
- ), j = (N) => {
147
- const H = W(N);
148
- return g ? G.includes(H) : H === G;
144
+ const $ = m ? (E || []).map(Y) : Y(E), _ = L.filter(
145
+ (x) => x.label.toLowerCase().includes(I.toLowerCase())
146
+ ), z = (x) => {
147
+ const H = Y(x);
148
+ return m ? $.includes(H) : H === $;
149
149
  };
150
- z(() => {
151
- const N = (H) => {
152
- B.current && !B.current.contains(H.target) && (S(!1), D(""));
150
+ K(() => {
151
+ const x = (H) => {
152
+ F.current && !F.current.contains(H.target) && (k(!1), A(""));
153
153
  };
154
- return document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
155
- }, []), z(() => {
156
- if (y && B.current) {
157
- const N = B.current.getBoundingClientRect(), re = window.innerHeight - N.bottom;
158
- A(re < 200);
154
+ return document.addEventListener("mousedown", x), () => document.removeEventListener("mousedown", x);
155
+ }, []), K(() => {
156
+ if (y && F.current) {
157
+ const x = F.current.getBoundingClientRect(), J = window.innerHeight - x.bottom;
158
+ O(J < 200);
159
159
  }
160
- }, [y]), z(() => {
161
- y && F.current && F.current.focus();
160
+ }, [y]), K(() => {
161
+ y && T.current && T.current.focus();
162
162
  }, [y]);
163
- const O = (N) => {
164
- let H = N;
165
- if (N === "true" ? H = !0 : N === "false" && (H = !1), g) {
166
- const re = G.includes(W(N));
167
- let J;
168
- re ? J = l.filter(
169
- (X) => W(X) !== W(N)
170
- ) : J = [...l || [], H], o(J);
163
+ const D = (x) => {
164
+ let H = x;
165
+ if (x === "true" ? H = !0 : x === "false" && (H = !1), m) {
166
+ const J = $.includes(Y(x));
167
+ let Q;
168
+ J ? Q = o.filter(
169
+ (W) => Y(W) !== Y(x)
170
+ ) : Q = [...o || [], H], i(Q);
171
171
  } else
172
- o(H), S(!1);
173
- D("");
174
- }, Y = g ? R.filter((N) => j(N.value)).map((N) => N.label).join(", ") : (q = R.find((N) => j(N.value))) == null ? void 0 : q.label;
175
- return z(() => {
176
- ($ || $ === !1) && setTimeout(() => {
177
- o($);
172
+ i(H), k(!1);
173
+ A("");
174
+ }, U = m ? L.filter((x) => z(x.value)).map((x) => x.label).join(", ") : (V = L.find((x) => z(x.value))) == null ? void 0 : V.label;
175
+ return K(() => {
176
+ (E || E === !1) && setTimeout(() => {
177
+ i(E);
178
178
  }, 100);
179
- }, []), /* @__PURE__ */ c("div", { className: h || "col-span-12", children: [
180
- /* @__PURE__ */ e(Q, { label: w, required: b }),
181
- /* @__PURE__ */ c("div", { className: `relative ${t}`, ref: B, children: [
179
+ }, []), /* @__PURE__ */ h("div", { className: u || "col-span-12", children: [
180
+ /* @__PURE__ */ e(q, { label: S, required: p }),
181
+ /* @__PURE__ */ h("div", { className: `relative ${t}`, ref: F, children: [
182
182
  /* @__PURE__ */ e(
183
183
  "select",
184
184
  {
185
185
  name: "hidden_select_for_validation",
186
- value: Y || "",
187
- required: b,
188
- multiple: g,
186
+ value: U || "",
187
+ required: p,
188
+ multiple: m,
189
189
  className: "absolute opacity-0 right-1/2 top-[80%] -translate-x-1/2 -translate-y-1/2 pointer-events-none h-[10px]",
190
- children: /* @__PURE__ */ e("option", { hidden: !0, value: Y, children: Y })
190
+ children: /* @__PURE__ */ e("option", { hidden: !0, value: U, children: U })
191
191
  }
192
192
  ),
193
- /* @__PURE__ */ c(
193
+ /* @__PURE__ */ h(
194
194
  "button",
195
195
  {
196
196
  type: "button",
197
- onClick: () => !p && S(!y),
198
- disabled: p,
197
+ onClick: () => !g && k(!y),
198
+ disabled: g,
199
199
  className: `w-full h-10 px-3 border border-gray-300 dark:border-gray-600 rounded-md text-left text-sm flex items-center justify-between
200
- ${Y ? "dark:text-white" : "text-gray-500 dark:text-gray-400"}
201
- ${p ? "opacity-50 cursor-not-allowed" : "dark:bg-gray-700"}`,
200
+ ${U ? "dark:text-white" : "text-gray-500 dark:text-gray-400"}
201
+ ${g ? "opacity-50 cursor-not-allowed" : "dark:bg-gray-700"}`,
202
202
  children: [
203
- /* @__PURE__ */ e("span", { className: "truncate", children: Y || s }),
203
+ /* @__PURE__ */ e("span", { className: "truncate", children: U || d }),
204
204
  /* @__PURE__ */ e(
205
- Te,
205
+ Ie,
206
206
  {
207
207
  className: `w-4 h-4 transition-transform ${y ? "rotate-180" : ""}`
208
208
  }
@@ -210,21 +210,21 @@ const ea = ({
210
210
  ]
211
211
  }
212
212
  ),
213
- y && /* @__PURE__ */ c(
213
+ y && /* @__PURE__ */ h(
214
214
  "div",
215
215
  {
216
216
  className: `absolute z-50 w-full border rounded-md bg-white dark:bg-gray-700 shadow-lg
217
217
  ${C ? "bottom-full mb-1" : "top-full mt-1"}`,
218
218
  children: [
219
- k && /* @__PURE__ */ e("div", { className: "p-2 border-b border-gray-200 dark:border-gray-600", children: /* @__PURE__ */ c("div", { className: "relative", children: [
220
- /* @__PURE__ */ e(Re, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400" }),
219
+ M && /* @__PURE__ */ e("div", { className: "p-2 border-b border-gray-200 dark:border-gray-600", children: /* @__PURE__ */ h("div", { className: "relative", children: [
220
+ /* @__PURE__ */ e(Oe, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400" }),
221
221
  /* @__PURE__ */ e(
222
222
  "input",
223
223
  {
224
- ref: F,
224
+ ref: T,
225
225
  type: "text",
226
226
  value: I,
227
- onChange: (N) => D(N.target.value),
227
+ onChange: (x) => A(x.target.value),
228
228
  placeholder: "Search...",
229
229
  className: "w-full pl-9 pr-3 py-2 text-sm border rounded-md bg-white dark:bg-gray-800 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none"
230
230
  }
@@ -235,21 +235,21 @@ const ea = ({
235
235
  {
236
236
  className: "max-h-40 overflow-y-auto",
237
237
  style: {
238
- maxHeight: x || ""
238
+ maxHeight: v || ""
239
239
  },
240
- children: K.length > 0 ? K.map((N) => /* @__PURE__ */ c(
240
+ children: _.length > 0 ? _.map((x) => /* @__PURE__ */ h(
241
241
  "button",
242
242
  {
243
243
  type: "button",
244
- onClick: () => O(String(N.value)),
244
+ onClick: () => D(String(x.value)),
245
245
  className: `w-full px-3 py-2 text-left text-sm flex items-center justify-between hover:bg-gray-100 dark:hover:bg-gray-600
246
- ${j(N.value) ? "bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300" : ""}`,
246
+ ${z(x.value) ? "bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300" : ""}`,
247
247
  children: [
248
- /* @__PURE__ */ e("span", { children: N.label }),
249
- g && j(N.value) && /* @__PURE__ */ e(Ke, { className: "w-4 h-4" })
248
+ /* @__PURE__ */ e("span", { children: x.label }),
249
+ m && z(x.value) && /* @__PURE__ */ e(Ye, { className: "w-4 h-4" })
250
250
  ]
251
251
  },
252
- String(N.value)
252
+ String(x.value)
253
253
  )) : /* @__PURE__ */ e("div", { className: "px-3 py-2 text-sm text-gray-500 dark:text-gray-400", children: "No options found" })
254
254
  }
255
255
  )
@@ -257,27 +257,27 @@ const ea = ({
257
257
  }
258
258
  )
259
259
  ] })
260
- ] }, n);
261
- }, aa = ({
262
- value: u = !0,
263
- onChange: l,
264
- text: i,
265
- options: o = [],
266
- label: s,
260
+ ] }, l);
261
+ }, na = ({
262
+ value: b = !0,
263
+ onChange: o,
264
+ text: s,
265
+ options: i = [],
266
+ label: d,
267
267
  required: t,
268
- name: p = "",
269
- disabled: k = !1,
270
- parentClass: w = ""
268
+ name: g = "",
269
+ disabled: M = !1,
270
+ parentClass: S = ""
271
271
  }) => {
272
- const b = o.length > 0 ? o : [
272
+ const p = i.length > 0 ? i : [
273
273
  { label: "Active", value: !0 },
274
274
  { label: "Inactive", value: !1 }
275
275
  ];
276
- return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ c("div", { className: w || "col-span-12", children: [
277
- /* @__PURE__ */ e(Q, { label: s, required: t }),
278
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between h-10 gap-4 bg-gray-100 dark:bg-gray-700 px-3 rounded-md border border-gray-100 dark:border-gray-600", children: [
279
- i && /* @__PURE__ */ e("p", { className: "text-xs text-gray-600 dark:text-gray-400 flex-shrink overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]", children: i }),
280
- /* @__PURE__ */ e("div", { className: "flex items-center gap-6", children: b.map((n, h) => /* @__PURE__ */ c(
276
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: S || "col-span-12", children: [
277
+ /* @__PURE__ */ e(q, { label: d, required: t }),
278
+ /* @__PURE__ */ h("div", { className: "flex items-center justify-between h-10 gap-4 bg-gray-100 dark:bg-gray-700 px-3 rounded-md border border-gray-100 dark:border-gray-600", children: [
279
+ s && /* @__PURE__ */ e("p", { className: "text-xs text-gray-600 dark:text-gray-400 flex-shrink overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]", children: s }),
280
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-6", children: p.map((l, u) => /* @__PURE__ */ h(
281
281
  "label",
282
282
  {
283
283
  className: "flex items-center gap-2 cursor-pointer select-none",
@@ -287,22 +287,22 @@ const ea = ({
287
287
  {
288
288
  type: "radio",
289
289
  name: "switch-field",
290
- required: t && h === 0,
291
- value: n.value,
292
- disabled: k,
293
- checked: u === n.value,
294
- onChange: () => l(n.value),
290
+ required: t && u === 0,
291
+ value: l.value,
292
+ disabled: M,
293
+ checked: b === l.value,
294
+ onChange: () => o(l.value),
295
295
  className: "w-4 h-4 border-gray-300 cursor-pointer"
296
296
  }
297
297
  ),
298
- /* @__PURE__ */ e("span", { className: "text-sm text-gray-700 dark:text-white", children: n.label })
298
+ /* @__PURE__ */ e("span", { className: "text-sm text-gray-700 dark:text-white", children: l.label })
299
299
  ]
300
300
  },
301
- h
301
+ u
302
302
  )) })
303
303
  ] })
304
- ] }, p) });
305
- }, xe = [
304
+ ] }, g) });
305
+ }, we = [
306
306
  { label: "Afghanistan", code: "AF", phone: "93" },
307
307
  { label: "Aland Islands", code: "AX", phone: "358" },
308
308
  { label: "Albania", code: "AL", phone: "355" },
@@ -554,90 +554,90 @@ const ea = ({
554
554
  { label: "Zambia", code: "ZM", phone: "260" },
555
555
  { label: "Zimbabwe", code: "ZW", phone: "263" }
556
556
  ];
557
- function ra({
558
- label: u = "",
559
- value: l = "",
560
- name: i = "",
561
- parentClass: o = "",
562
- onChange: s,
557
+ function la({
558
+ label: b = "",
559
+ value: o = "",
560
+ name: s = "",
561
+ parentClass: i = "",
562
+ onChange: d,
563
563
  disabled: t = !1,
564
- required: p = !1,
565
- placeholder: k = "Phone number",
566
- search: w = !1,
567
- countriesList: b = !1,
568
- defaultCountry: n = ""
564
+ required: g = !1,
565
+ placeholder: M = "Phone number",
566
+ search: S = !1,
567
+ countriesList: p = !1,
568
+ defaultCountry: l = ""
569
569
  }) {
570
- const h = (R) => xe.find((U) => U.code == R), [g, x] = M(
571
- h(n) || xe[0]
572
- ), [d, v] = M(""), [y, S] = M(!1), [I, D] = M(""), C = ae();
573
- z(() => {
574
- if (typeof l == "string" && l.startsWith("+")) {
575
- const R = xe.filter((U) => l.startsWith("+" + U.phone)).sort((U, $) => $.phone.length - U.phone.length)[0];
576
- if (R) {
577
- x(R), v(l.replace("+" + R.phone, ""));
570
+ const u = (L) => we.find((B) => B.code == L), [m, v] = R(
571
+ u(l) || we[0]
572
+ ), [c, w] = R(""), [y, k] = R(!1), [I, A] = R(""), C = ee();
573
+ K(() => {
574
+ if (typeof o == "string" && o.startsWith("+")) {
575
+ const L = we.filter((B) => o.startsWith("+" + B.phone)).sort((B, E) => E.phone.length - B.phone.length)[0];
576
+ if (L) {
577
+ v(L), w(o.replace("+" + L.phone, ""));
578
578
  return;
579
579
  }
580
580
  }
581
- v(l);
582
- }, [l]);
583
- const A = (R) => {
584
- const U = R.target.value.replace(/\D/g, "");
585
- v(U), g && s && s("+" + g.phone + U);
586
- }, B = (R) => {
587
- x(R), s && s("+" + R.phone + d), S(!1), D("");
581
+ w(o);
582
+ }, [o]);
583
+ const O = (L) => {
584
+ const B = L.target.value.replace(/\D/g, "");
585
+ w(B), m && d && d("+" + m.phone + B);
586
+ }, F = (L) => {
587
+ v(L), d && d("+" + L.phone + c), k(!1), A("");
588
588
  };
589
- z(() => {
590
- const R = (U) => {
591
- C.current && !C.current.contains(U.target) && S(!1);
589
+ K(() => {
590
+ const L = (B) => {
591
+ C.current && !C.current.contains(B.target) && k(!1);
592
592
  };
593
- return document.addEventListener("mousedown", R), () => document.removeEventListener("mousedown", R);
593
+ return document.addEventListener("mousedown", L), () => document.removeEventListener("mousedown", L);
594
594
  }, []);
595
- const F = xe.filter(
596
- (R) => R.label.toLowerCase().includes(I.toLowerCase()) || R.phone.includes(I)
595
+ const T = we.filter(
596
+ (L) => L.label.toLowerCase().includes(I.toLowerCase()) || L.phone.includes(I)
597
597
  );
598
- return b ? /* @__PURE__ */ e(E, { children: /* @__PURE__ */ c("div", { className: o || "col-span-12", children: [
599
- /* @__PURE__ */ e(Q, { label: u, required: p }),
600
- /* @__PURE__ */ c("div", { className: "relative ", ref: C, children: [
601
- /* @__PURE__ */ c(
598
+ return p ? /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: i || "col-span-12", children: [
599
+ /* @__PURE__ */ e(q, { label: b, required: g }),
600
+ /* @__PURE__ */ h("div", { className: "relative ", ref: C, children: [
601
+ /* @__PURE__ */ h(
602
602
  "div",
603
603
  {
604
604
  className: `h-[40px] flex items-center border rounded-md px-2 bg-white dark:bg-gray-700 transition-all
605
605
  ${y ? "ring-0.5 ring-blue-100 border-blue-300" : "border-gray-300 dark:border-gray-600"}
606
606
  ${t ? "opacity-60 cursor-not-allowed" : ""}`,
607
607
  children: [
608
- /* @__PURE__ */ c(
608
+ /* @__PURE__ */ h(
609
609
  "button",
610
610
  {
611
611
  type: "button",
612
612
  disabled: t,
613
- onClick: () => S(!y),
613
+ onClick: () => k(!y),
614
614
  className: "flex items-center gap-1 pr-2 border-r border-gray-300 dark:border-gray-700 focus:outline-none",
615
615
  children: [
616
- g ? /* @__PURE__ */ e(
616
+ m ? /* @__PURE__ */ e(
617
617
  "img",
618
618
  {
619
- src: `https://flagcdn.com/w20/${g.code.toLowerCase()}.png`,
620
- alt: g.code,
619
+ src: `https://flagcdn.com/w20/${m.code.toLowerCase()}.png`,
620
+ alt: m.code,
621
621
  className: "w-5 h-3 object-cover"
622
622
  }
623
623
  ) : /* @__PURE__ */ e("span", { className: "text-gray-400 text-xs", children: "🌐" }),
624
- /* @__PURE__ */ e(Te, { className: "w-3 h-3 text-gray-500" })
624
+ /* @__PURE__ */ e(Ie, { className: "w-3 h-3 text-gray-500" })
625
625
  ]
626
626
  }
627
627
  ),
628
- g && /* @__PURE__ */ c("span", { className: "ml-2 text-sm text-gray-700 dark:text-gray-200 whitespace-nowrap", children: [
628
+ m && /* @__PURE__ */ h("span", { className: "ml-2 text-sm text-gray-700 dark:text-gray-200 whitespace-nowrap", children: [
629
629
  "+",
630
- g.phone
630
+ m.phone
631
631
  ] }),
632
632
  /* @__PURE__ */ e(
633
633
  "input",
634
634
  {
635
635
  type: "tel",
636
- value: d,
637
- onChange: A,
638
- required: p,
639
- disabled: t || !g,
640
- placeholder: g ? k : "Select a country",
636
+ value: c,
637
+ onChange: O,
638
+ required: g,
639
+ disabled: t || !m,
640
+ placeholder: m ? M : "Select a country",
641
641
  className: "flex-1 ml-2 bg-transparent outline-none text-sm text-gray-800 dark:text-gray-100 placeholder-gray-400"
642
642
  }
643
643
  ),
@@ -645,10 +645,10 @@ function ra({
645
645
  "input",
646
646
  {
647
647
  type: "tel",
648
- required: p,
648
+ required: g,
649
649
  tabIndex: -1,
650
650
  readOnly: !0,
651
- value: g && d ? "+" + g.phone + d : "",
651
+ value: m && c ? "+" + m.phone + c : "",
652
652
  style: {
653
653
  position: "absolute",
654
654
  opacity: 0,
@@ -660,61 +660,61 @@ function ra({
660
660
  ]
661
661
  }
662
662
  ),
663
- y && /* @__PURE__ */ c("div", { className: "absolute top-full left-0 w-full mt-1 border border-gray-300 dark:border-gray-700 rounded-md bg-white dark:bg-gray-700 shadow-lg z-50 max-h-60 overflow-y-auto", children: [
664
- w && /* @__PURE__ */ e("div", { className: "p-2 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ c("div", { className: "relative", children: [
665
- /* @__PURE__ */ e(Re, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400" }),
663
+ y && /* @__PURE__ */ h("div", { className: "absolute top-full left-0 w-full mt-1 border border-gray-300 dark:border-gray-700 rounded-md bg-white dark:bg-gray-700 shadow-lg z-50 max-h-60 overflow-y-auto", children: [
664
+ S && /* @__PURE__ */ e("div", { className: "p-2 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ h("div", { className: "relative", children: [
665
+ /* @__PURE__ */ e(Oe, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400" }),
666
666
  /* @__PURE__ */ e(
667
667
  "input",
668
668
  {
669
669
  type: "text",
670
670
  value: I,
671
- onChange: (R) => D(R.target.value),
671
+ onChange: (L) => A(L.target.value),
672
672
  placeholder: "Search country...",
673
673
  className: "w-full pl-9 pr-3 py-2 text-sm border rounded-md bg-white dark:bg-gray-800 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none "
674
674
  }
675
675
  )
676
676
  ] }) }),
677
- F.map((R) => /* @__PURE__ */ c(
677
+ T.map((L) => /* @__PURE__ */ h(
678
678
  "button",
679
679
  {
680
680
  type: "button",
681
- onClick: () => B(R),
681
+ onClick: () => F(L),
682
682
  className: "w-full flex items-center gap-2 px-2 py-1 text-sm hover:bg-blue-50 dark:hover:bg-gray-700 text-gray-800 dark:text-gray-100",
683
683
  children: [
684
684
  /* @__PURE__ */ e(
685
685
  "img",
686
686
  {
687
- src: `https://flagcdn.com/w20/${R.code.toLowerCase()}.png`,
688
- alt: R.code,
687
+ src: `https://flagcdn.com/w20/${L.code.toLowerCase()}.png`,
688
+ alt: L.code,
689
689
  className: "w-5 h-3 object-cover"
690
690
  }
691
691
  ),
692
- /* @__PURE__ */ c("span", { children: [
693
- R.label,
692
+ /* @__PURE__ */ h("span", { children: [
693
+ L.label,
694
694
  " (+",
695
- R.phone,
695
+ L.phone,
696
696
  ")"
697
697
  ] })
698
698
  ]
699
699
  },
700
- R.code
700
+ L.code
701
701
  ))
702
702
  ] })
703
703
  ] })
704
- ] }, i) }) : /* @__PURE__ */ e(E, { children: /* @__PURE__ */ c("div", { className: o || "col-span-12", children: [
705
- /* @__PURE__ */ e(Q, { label: u, required: p }),
704
+ ] }, s) }) : /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: i || "col-span-12", children: [
705
+ /* @__PURE__ */ e(q, { label: b, required: g }),
706
706
  /* @__PURE__ */ e(
707
707
  "input",
708
708
  {
709
709
  type: "text",
710
- value: l,
711
- onChange: (U) => {
712
- const $ = U.target.value.replace(/[^+\d]/g, ""), W = $.startsWith("+") ? "+" + $.replace(/[+]/g, "").slice(0) : $;
713
- s(W);
710
+ value: o,
711
+ onChange: (B) => {
712
+ const E = B.target.value.replace(/[^+\d]/g, ""), Y = E.startsWith("+") ? "+" + E.replace(/[+]/g, "").slice(0) : E;
713
+ d(Y);
714
714
  },
715
- placeholder: k,
715
+ placeholder: M,
716
716
  disabled: t,
717
- required: p,
717
+ required: g,
718
718
  className: `w-full h-10 px-3 text-sm border border-gray-300 dark:border-gray-600 rounded-md \r
719
719
  bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:outline-none \r
720
720
  focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-200`,
@@ -722,262 +722,262 @@ function ra({
722
722
  pattern: "^\\+\\d{1,15}$"
723
723
  }
724
724
  )
725
- ] }, i) });
725
+ ] }, s) });
726
726
  }
727
- const Ie = Ce.forwardRef(
728
- ({ className: u = "", label: l, required: i, ...o }, s) => {
727
+ const je = Le.forwardRef(
728
+ ({ className: b = "", label: o, required: s, ...i }, d) => {
729
729
  const t = `
730
730
  placeholder-gray-400 dark:placeholder-gray-400
731
- ${u}
731
+ ${b}
732
732
  `.trim();
733
- return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ c("div", { className: o.parentClass || "col-span-12", children: [
734
- /* @__PURE__ */ e(Q, { label: l, required: i }),
733
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: i.parentClass || "col-span-12", children: [
734
+ /* @__PURE__ */ e(q, { label: o, required: s }),
735
735
  /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e(
736
736
  "textarea",
737
737
  {
738
738
  className: t,
739
- ref: s,
740
- required: i,
741
- ...o
739
+ ref: d,
740
+ required: s,
741
+ ...i
742
742
  }
743
743
  ) })
744
- ] }, o.name) });
744
+ ] }, i.name) });
745
745
  }
746
746
  );
747
- Ie.displayName = "TextArea";
748
- const ta = ({
749
- label: u = "",
750
- value: l = null,
751
- onChange: i,
752
- required: o = !1,
753
- accept: s = "image/*",
747
+ je.displayName = "TextArea";
748
+ const oa = ({
749
+ label: b = "",
750
+ value: o = null,
751
+ onChange: s,
752
+ required: i = !1,
753
+ accept: d = "image/*",
754
754
  id: t,
755
- dragDrop: p = !1,
756
- name: k = "",
757
- parentClass: w = ""
755
+ dragDrop: g = !1,
756
+ name: M = "",
757
+ parentClass: S = ""
758
758
  }) => {
759
- const [b, n] = M(l), [h, g] = M(!1), x = ae(null);
760
- z(() => (l instanceof File ? n({ file: l, preview: URL.createObjectURL(l) }) : (l != null && l.preview, n(l)), () => {
761
- b != null && b.preview && b.preview.startsWith("blob:") && URL.revokeObjectURL(b.preview);
762
- }), [l]);
763
- const d = (C) => {
759
+ const [p, l] = R(o), [u, m] = R(!1), v = ee(null);
760
+ K(() => (o instanceof File ? l({ file: o, preview: URL.createObjectURL(o) }) : (o != null && o.preview, l(o)), () => {
761
+ p != null && p.preview && p.preview.startsWith("blob:") && URL.revokeObjectURL(p.preview);
762
+ }), [o]);
763
+ const c = (C) => {
764
764
  if (!C || C.length === 0)
765
765
  return;
766
- const A = C[0], B = URL.createObjectURL(A), F = { file: A, preview: B };
767
- b != null && b.preview && b.preview.startsWith("blob:") && URL.revokeObjectURL(b.preview), n(F), i == null || i(A);
768
- }, v = (C) => {
769
- C && C.stopPropagation(), b != null && b.preview && b.preview.startsWith("blob:") && URL.revokeObjectURL(b.preview), n(null), i == null || i(null), x.current && (x.current.value = "");
766
+ const O = C[0], F = URL.createObjectURL(O), T = { file: O, preview: F };
767
+ p != null && p.preview && p.preview.startsWith("blob:") && URL.revokeObjectURL(p.preview), l(T), s == null || s(O);
768
+ }, w = (C) => {
769
+ C && C.stopPropagation(), p != null && p.preview && p.preview.startsWith("blob:") && URL.revokeObjectURL(p.preview), l(null), s == null || s(null), v.current && (v.current.value = "");
770
770
  }, y = (C) => {
771
- p && (C.preventDefault(), g(!0));
772
- }, S = (C) => {
773
- p && (C.preventDefault(), g(!1));
771
+ g && (C.preventDefault(), m(!0));
772
+ }, k = (C) => {
773
+ g && (C.preventDefault(), m(!1));
774
774
  }, I = (C) => {
775
- p && (C.preventDefault(), g(!1), d(C.dataTransfer.files));
776
- }, D = () => {
777
- x.current.click();
775
+ g && (C.preventDefault(), m(!1), c(C.dataTransfer.files));
776
+ }, A = () => {
777
+ v.current.click();
778
778
  };
779
- return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ c("div", { className: w || "col-span-12", children: [
780
- /* @__PURE__ */ e(Q, { label: u, required: o }),
781
- /* @__PURE__ */ c(
779
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: S || "col-span-12", children: [
780
+ /* @__PURE__ */ e(q, { label: b, required: i }),
781
+ /* @__PURE__ */ h(
782
782
  "div",
783
783
  {
784
- className: `relative rounded-md p-2 transition-all ${h ? "border-2 border-dashed border-blue-500 bg-blue-50 dark:bg-blue-900/20" : "border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"}`,
784
+ className: `relative rounded-md p-2 transition-all ${u ? "border-2 border-dashed border-blue-500 bg-blue-50 dark:bg-blue-900/20" : "border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"}`,
785
785
  onDragOver: y,
786
- onDragLeave: S,
786
+ onDragLeave: k,
787
787
  onDrop: I,
788
788
  children: [
789
789
  /* @__PURE__ */ e(
790
790
  "input",
791
791
  {
792
- ref: x,
792
+ ref: v,
793
793
  id: t,
794
794
  type: "file",
795
- accept: s,
796
- onChange: (C) => d(C.target.files),
797
- required: o && !b,
795
+ accept: d,
796
+ onChange: (C) => c(C.target.files),
797
+ required: i && !p,
798
798
  className: "absolute opacity-0 right-[50%] top-[80%] -translate-y-1/2 pointer-events-none h-[10px]"
799
799
  }
800
800
  ),
801
- /* @__PURE__ */ c(
801
+ /* @__PURE__ */ h(
802
802
  "div",
803
803
  {
804
- className: `flex items-center space-x-4 transition-all ${h ? "opacity-50" : ""}`,
804
+ className: `flex items-center space-x-4 transition-all ${u ? "opacity-50" : ""}`,
805
805
  children: [
806
- b ? (
806
+ p ? (
807
807
  // Image preview with close button
808
- /* @__PURE__ */ c("div", { className: "relative group", children: [
808
+ /* @__PURE__ */ h("div", { className: "relative group", children: [
809
809
  /* @__PURE__ */ e(
810
810
  "img",
811
811
  {
812
- src: b.preview || b,
812
+ src: p.preview || p,
813
813
  alt: "preview",
814
814
  className: "object-cover w-20 h-20 rounded-full shadow-md"
815
815
  }
816
816
  ),
817
- !o && /* @__PURE__ */ e(
817
+ !i && /* @__PURE__ */ e(
818
818
  "button",
819
819
  {
820
820
  type: "button",
821
- onClick: v,
821
+ onClick: w,
822
822
  className: "absolute top-0 -right-2 bg-red-500 text-white rounded-full p-1 shadow-lg hover:bg-red-600 transition-colors focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2",
823
823
  "aria-label": "Remove image",
824
- children: /* @__PURE__ */ e(te, { icon: "mdi:close", className: "w-3 h-3" })
824
+ children: /* @__PURE__ */ e(re, { icon: "mdi:close", className: "w-3 h-3" })
825
825
  }
826
826
  )
827
827
  ] })
828
828
  ) : (
829
829
  // Placeholder icon
830
830
  /* @__PURE__ */ e("div", { className: "rounded-full bg-gray-100 dark:bg-gray-700 h-20 w-20 flex items-center justify-center", children: /* @__PURE__ */ e(
831
- te,
831
+ re,
832
832
  {
833
833
  icon: "ri:image-add-fill",
834
834
  className: "text-gray-400 w-10 h-10"
835
835
  }
836
836
  ) })
837
837
  ),
838
- /* @__PURE__ */ c("div", { className: "flex flex-col items-center space-y-1", children: [
838
+ /* @__PURE__ */ h("div", { className: "flex flex-col items-center space-y-1", children: [
839
839
  /* @__PURE__ */ e(
840
- ee,
840
+ Z,
841
841
  {
842
842
  type: "button",
843
- onClick: D,
843
+ onClick: A,
844
844
  variant: "outlined",
845
845
  color: "default",
846
- children: b ? "Change Image" : "Select Image"
846
+ children: p ? "Change Image" : "Select Image"
847
847
  }
848
848
  ),
849
- p && !b && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "or drag and drop" })
849
+ g && !p && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "or drag and drop" })
850
850
  ] })
851
851
  ]
852
852
  }
853
853
  ),
854
- p && h && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none bg-blue-500/10 rounded-md", children: /* @__PURE__ */ e("span", { className: "text-blue-600 dark:text-blue-400 font-semibold text-lg", children: "Drop image here" }) })
854
+ g && u && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none bg-blue-500/10 rounded-md", children: /* @__PURE__ */ e("span", { className: "text-blue-600 dark:text-blue-400 font-semibold text-lg", children: "Drop image here" }) })
855
855
  ]
856
856
  }
857
857
  )
858
- ] }, k) });
859
- }, Be = Ce.forwardRef(
858
+ ] }, M) });
859
+ }, Ee = Le.forwardRef(
860
860
  ({
861
- label: u,
862
- required: l,
863
- parentClass: i = "",
864
- className: o = "",
865
- type: s = "text",
861
+ label: b,
862
+ required: o,
863
+ parentClass: s = "",
864
+ className: i = "",
865
+ type: d = "text",
866
866
  onKeyDown: t,
867
- negativeNumberAllow: p = !0,
868
- defaultValue: k = "",
869
- ...w
870
- }, b) => {
871
- const [n, h] = M(!1), g = (d) => {
872
- if (s === "number") {
873
- if (["e", "E", "+"].includes(d.key)) {
874
- d.preventDefault();
867
+ negativeNumberAllow: g = !0,
868
+ defaultValue: M = "",
869
+ ...S
870
+ }, p) => {
871
+ const [l, u] = R(!1), m = (c) => {
872
+ if (d === "number") {
873
+ if (["e", "E", "+"].includes(c.key)) {
874
+ c.preventDefault();
875
875
  return;
876
876
  }
877
- if (p == !1 && d.key === "-") {
878
- d.preventDefault();
877
+ if (g == !1 && c.key === "-") {
878
+ c.preventDefault();
879
879
  return;
880
880
  }
881
- if (["ArrowUp", "ArrowDown"].includes(d.key)) {
882
- d.preventDefault();
881
+ if (["ArrowUp", "ArrowDown"].includes(c.key)) {
882
+ c.preventDefault();
883
883
  return;
884
884
  }
885
885
  }
886
- t == null || t(d);
887
- }, x = `
886
+ t == null || t(c);
887
+ }, v = `
888
888
  h-10 placeholder-gray-400 dark:placeholder-gray-400
889
- ${s === "password" ? "pr-10" : ""}
890
- ${s === "number" ? "no-spinner" : ""}
891
- ${o}
889
+ ${d === "password" ? "pr-10" : ""}
890
+ ${d === "number" ? "no-spinner" : ""}
891
+ ${i}
892
892
  `.trim();
893
- return z(() => {
894
- k && setTimeout(() => {
895
- var d;
896
- (d = w.onChange) == null || d.call(w, { target: { value: k } });
893
+ return K(() => {
894
+ M && setTimeout(() => {
895
+ var c;
896
+ (c = S.onChange) == null || c.call(S, { target: { value: M } });
897
897
  }, 100);
898
- }, [k]), /* @__PURE__ */ e(E, { children: /* @__PURE__ */ c("div", { className: i || "col-span-12", children: [
899
- /* @__PURE__ */ e(Q, { label: u, required: l }),
900
- /* @__PURE__ */ c("div", { className: "relative", children: [
898
+ }, [M]), /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: s || "col-span-12", children: [
899
+ /* @__PURE__ */ e(q, { label: b, required: o }),
900
+ /* @__PURE__ */ h("div", { className: "relative", children: [
901
901
  /* @__PURE__ */ e(
902
902
  "input",
903
903
  {
904
- type: s === "password" && n ? "text" : s,
905
- ref: b,
906
- required: l,
907
- onKeyDown: g,
908
- className: x,
909
- ...w
904
+ type: d === "password" && l ? "text" : d,
905
+ ref: p,
906
+ required: o,
907
+ onKeyDown: m,
908
+ className: v,
909
+ ...S
910
910
  }
911
911
  ),
912
- s === "password" && /* @__PURE__ */ e(
912
+ d === "password" && /* @__PURE__ */ e(
913
913
  "button",
914
914
  {
915
915
  type: "button",
916
916
  tabIndex: -1,
917
- onClick: () => h((d) => !d),
917
+ onClick: () => u((c) => !c),
918
918
  className: "absolute inset-y-0 right-3 flex items-center text-gray-400 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-200",
919
919
  children: /* @__PURE__ */ e(
920
- te,
920
+ re,
921
921
  {
922
- icon: n ? "mdi:eye-outline" : "mdi:eye-off-outline",
922
+ icon: l ? "mdi:eye-outline" : "mdi:eye-off-outline",
923
923
  className: "w-5 h-5"
924
924
  }
925
925
  )
926
926
  }
927
927
  )
928
928
  ] })
929
- ] }, w.name) });
929
+ ] }, S.name) });
930
930
  }
931
931
  );
932
- Be.displayName = "Input";
933
- const na = ({
934
- key: u,
935
- editorKey: l = "",
936
- value: i = "",
937
- onChange: o,
938
- label: s = "",
932
+ Ee.displayName = "Input";
933
+ const ia = ({
934
+ key: b,
935
+ editorKey: o = "",
936
+ value: s = "",
937
+ onChange: i,
938
+ label: d = "",
939
939
  required: t = !1,
940
- placeholder: p = "",
941
- parentClass: k = "col-span-12",
942
- height: w = 400,
943
- inline: b = !1,
944
- disabled: n = !1,
945
- plugins: h,
946
- toolbar: g,
947
- menubar: x = !1,
948
- fontFamily: d = "Inter, sans-serif",
949
- initConfig: v = {},
940
+ placeholder: g = "",
941
+ parentClass: M = "col-span-12",
942
+ height: S = 400,
943
+ inline: p = !1,
944
+ disabled: l = !1,
945
+ plugins: u,
946
+ toolbar: m,
947
+ menubar: v = !1,
948
+ fontFamily: c = "Inter, sans-serif",
949
+ initConfig: w = {},
950
950
  imageUploadHandler: y
951
951
  // ✅ Promise function passed from parent
952
- }) => /* @__PURE__ */ c("div", { className: k, children: [
953
- s && /* @__PURE__ */ e(Q, { label: s, required: t }),
952
+ }) => /* @__PURE__ */ h("div", { className: M, children: [
953
+ d && /* @__PURE__ */ e(q, { label: d, required: t }),
954
954
  /* @__PURE__ */ e(
955
- Je,
955
+ ea,
956
956
  {
957
- apiKey: l,
958
- value: i,
959
- disabled: n,
957
+ apiKey: o,
958
+ value: s,
959
+ disabled: l,
960
960
  init: {
961
- height: w,
962
- inline: b,
963
- menubar: x,
961
+ height: S,
962
+ inline: p,
963
+ menubar: v,
964
964
  branding: !1,
965
965
  statusbar: !0,
966
966
  automatic_uploads: !0,
967
- images_upload_handler: (C) => new Promise((A, B) => {
967
+ images_upload_handler: (C) => new Promise((O, F) => {
968
968
  if (!y) {
969
- A(`data:${C.blob().type};base64,${C.base64()}`);
969
+ O(`data:${C.blob().type};base64,${C.base64()}`);
970
970
  return;
971
971
  }
972
- y(C).then((F) => {
973
- F ? A(F) : B("Upload failed: No URL returned");
974
- }).catch((F) => {
975
- B(
976
- typeof F == "string" ? F : (F == null ? void 0 : F.message) || "Image upload failed"
972
+ y(C).then((T) => {
973
+ T ? O(T) : F("Upload failed: No URL returned");
974
+ }).catch((T) => {
975
+ F(
976
+ typeof T == "string" ? T : (T == null ? void 0 : T.message) || "Image upload failed"
977
977
  );
978
978
  });
979
979
  }),
980
- plugins: h ?? [
980
+ plugins: u ?? [
981
981
  "advlist",
982
982
  "autolink",
983
983
  "lists",
@@ -996,201 +996,201 @@ const na = ({
996
996
  "help",
997
997
  "wordcount"
998
998
  ],
999
- toolbar: g ?? "undo redo | blocks | bold italic underline forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media table | removeformat | code fullscreen preview",
1000
- placeholder: p,
999
+ toolbar: m ?? "undo redo | blocks | bold italic underline forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media table | removeformat | code fullscreen preview",
1000
+ placeholder: g,
1001
1001
  content_style: `
1002
1002
  body {
1003
- font-family: ${d};
1003
+ font-family: ${c};
1004
1004
  }
1005
1005
  `,
1006
- ...v
1006
+ ...w
1007
1007
  },
1008
1008
  onEditorChange: (C) => {
1009
- o && o(C);
1009
+ i && i(C);
1010
1010
  }
1011
1011
  }
1012
1012
  )
1013
- ] }, u), la = ({
1014
- name: u = "",
1015
- label: l = "",
1013
+ ] }, b), sa = ({
1014
+ name: b = "",
1015
+ label: o = "",
1016
1016
  // label for single checkbox
1017
- options: i = [],
1017
+ options: s = [],
1018
1018
  // array of { label, value } for multiple
1019
- value: o = null,
1019
+ value: i = null,
1020
1020
  // boolean for single, array for multiple, or string for single select
1021
- onChange: s,
1021
+ onChange: d,
1022
1022
  disabled: t = !1,
1023
- required: p = !1,
1024
- parentClass: k = "col-span-12",
1025
- className: w = "",
1026
- multiSelect: b = !1
1023
+ required: g = !1,
1024
+ parentClass: M = "col-span-12",
1025
+ className: S = "",
1026
+ multiSelect: p = !1
1027
1027
  // ✅ if true, only one option can be selected (like radio)
1028
1028
  }) => {
1029
- const n = Array.isArray(i) && i.length > 0, h = (d) => n ? b ? Array.isArray(o) && o.includes(d) : o === d : !!o, g = (d) => {
1030
- s == null || s(d.target.checked, u);
1031
- }, x = (d, v) => {
1032
- if (s)
1033
- if (!b)
1034
- s(v ? d : "", u);
1029
+ const l = Array.isArray(s) && s.length > 0, u = (c) => l ? p ? Array.isArray(i) && i.includes(c) : i === c : !!i, m = (c) => {
1030
+ d == null || d(c.target.checked, b);
1031
+ }, v = (c, w) => {
1032
+ if (d)
1033
+ if (!p)
1034
+ d(w ? c : "", b);
1035
1035
  else {
1036
- const y = Array.isArray(o) ? [...o] : [];
1037
- if (v)
1038
- y.includes(d) || y.push(d);
1036
+ const y = Array.isArray(i) ? [...i] : [];
1037
+ if (w)
1038
+ y.includes(c) || y.push(c);
1039
1039
  else {
1040
- const S = y.indexOf(d);
1041
- S > -1 && y.splice(S, 1);
1040
+ const k = y.indexOf(c);
1041
+ k > -1 && y.splice(k, 1);
1042
1042
  }
1043
- s(y, u);
1043
+ d(y, b);
1044
1044
  }
1045
1045
  };
1046
- return n ? /* @__PURE__ */ e(E, { children: /* @__PURE__ */ c("div", { className: `${k}`, children: [
1047
- /* @__PURE__ */ e(Q, { label: l, required: p }),
1048
- /* @__PURE__ */ e("div", { className: "flex flex-col space-y-2", children: i.map((d, v) => /* @__PURE__ */ c("div", { className: "flex items-center", children: [
1046
+ return l ? /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: `${M}`, children: [
1047
+ /* @__PURE__ */ e(q, { label: o, required: g }),
1048
+ /* @__PURE__ */ e("div", { className: "flex flex-col space-y-2", children: s.map((c, w) => /* @__PURE__ */ h("div", { className: "flex items-center", children: [
1049
1049
  /* @__PURE__ */ e(
1050
1050
  "input",
1051
1051
  {
1052
1052
  type: "checkbox",
1053
- name: u,
1054
- value: d.value,
1055
- checked: h(d.value),
1056
- disabled: t || d.disabled,
1057
- required: p && v === 0,
1058
- onChange: (y) => x(d.value, y.target.checked),
1059
- className: `h-4 w-4 cursor-pointer text-blue-600 border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${w}`
1053
+ name: b,
1054
+ value: c.value,
1055
+ checked: u(c.value),
1056
+ disabled: t || c.disabled,
1057
+ required: g && w === 0,
1058
+ onChange: (y) => v(c.value, y.target.checked),
1059
+ className: `h-4 w-4 cursor-pointer text-blue-600 border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${S}`
1060
1060
  },
1061
- u
1061
+ b
1062
1062
  ),
1063
- d.label && /* @__PURE__ */ e(
1063
+ c.label && /* @__PURE__ */ e(
1064
1064
  "label",
1065
1065
  {
1066
- htmlFor: u,
1066
+ htmlFor: b,
1067
1067
  className: "ml-2 text-sm text-gray-700 dark:text-gray-200 select-none",
1068
- children: d.label
1068
+ children: c.label
1069
1069
  }
1070
1070
  )
1071
- ] }, d.value || d.label)) })
1072
- ] }) }) : /* @__PURE__ */ c("div", { className: `flex items-center ${k}`, children: [
1071
+ ] }, c.value || c.label)) })
1072
+ ] }) }) : /* @__PURE__ */ h("div", { className: `flex items-center ${M}`, children: [
1073
1073
  /* @__PURE__ */ e(
1074
1074
  "input",
1075
1075
  {
1076
1076
  type: "checkbox",
1077
- name: u,
1078
- checked: h(),
1077
+ name: b,
1078
+ checked: u(),
1079
1079
  disabled: t,
1080
- required: p,
1081
- onChange: g,
1082
- className: `h-4 w-4 text-blue-600 cursor-pointer border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${w}`
1080
+ required: g,
1081
+ onChange: m,
1082
+ className: `h-4 w-4 text-blue-600 cursor-pointer border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${S}`
1083
1083
  }
1084
1084
  ),
1085
- l && /* @__PURE__ */ e(
1085
+ o && /* @__PURE__ */ e(
1086
1086
  "label",
1087
1087
  {
1088
- htmlFor: u,
1088
+ htmlFor: b,
1089
1089
  className: "ml-2 text-sm text-gray-700 dark:text-gray-200 select-none",
1090
- children: l
1090
+ children: o
1091
1091
  }
1092
1092
  )
1093
1093
  ] });
1094
- }, oa = ({
1095
- label: u = "",
1096
- value: l = null,
1097
- onChange: i,
1098
- required: o = !1,
1099
- accept: s = "audio/*",
1094
+ }, da = ({
1095
+ label: b = "",
1096
+ value: o = null,
1097
+ onChange: s,
1098
+ required: i = !1,
1099
+ accept: d = "audio/*",
1100
1100
  id: t,
1101
- dragDrop: p = !1,
1102
- name: k = "",
1103
- parentClass: w = ""
1101
+ dragDrop: g = !1,
1102
+ name: M = "",
1103
+ parentClass: S = ""
1104
1104
  }) => {
1105
- const [b, n] = M(null), [h, g] = M(!1), x = ae(null);
1106
- z(() => {
1107
- if (!l) {
1108
- d(), n(null);
1105
+ const [p, l] = R(null), [u, m] = R(!1), v = ee(null);
1106
+ K(() => {
1107
+ if (!o) {
1108
+ c(), l(null);
1109
1109
  return;
1110
1110
  }
1111
- if (l instanceof File) {
1112
- const A = URL.createObjectURL(l);
1113
- return n({ file: l, preview: A }), () => {
1114
- URL.revokeObjectURL(A);
1111
+ if (o instanceof File) {
1112
+ const O = URL.createObjectURL(o);
1113
+ return l({ file: o, preview: O }), () => {
1114
+ URL.revokeObjectURL(O);
1115
1115
  };
1116
- } else typeof l == "string" ? n({ preview: l }) : l != null && l.preview && n(l);
1117
- }, [l]);
1118
- const d = () => {
1119
- b != null && b.preview && b.preview.startsWith("blob:") && URL.revokeObjectURL(b.preview);
1120
- }, v = (A) => {
1121
- if (!A || A.length === 0)
1116
+ } else typeof o == "string" ? l({ preview: o }) : o != null && o.preview && l(o);
1117
+ }, [o]);
1118
+ const c = () => {
1119
+ p != null && p.preview && p.preview.startsWith("blob:") && URL.revokeObjectURL(p.preview);
1120
+ }, w = (O) => {
1121
+ if (!O || O.length === 0)
1122
1122
  return;
1123
- const B = A[0], F = URL.createObjectURL(B);
1124
- d(), n({ file: B, preview: F }), i == null || i(B);
1125
- }, y = (A) => {
1126
- A && A.stopPropagation(), d(), n(null), i == null || i(null), x.current && (x.current.value = "");
1127
- }, S = (A) => {
1128
- p && (A.preventDefault(), g(!0));
1129
- }, I = (A) => {
1130
- p && (A.preventDefault(), g(!1));
1131
- }, D = (A) => {
1132
- p && (A.preventDefault(), g(!1), v(A.dataTransfer.files));
1123
+ const F = O[0], T = URL.createObjectURL(F);
1124
+ c(), l({ file: F, preview: T }), s == null || s(F);
1125
+ }, y = (O) => {
1126
+ O && O.stopPropagation(), c(), l(null), s == null || s(null), v.current && (v.current.value = "");
1127
+ }, k = (O) => {
1128
+ g && (O.preventDefault(), m(!0));
1129
+ }, I = (O) => {
1130
+ g && (O.preventDefault(), m(!1));
1131
+ }, A = (O) => {
1132
+ g && (O.preventDefault(), m(!1), w(O.dataTransfer.files));
1133
1133
  }, C = () => {
1134
- x.current.click();
1134
+ v.current.click();
1135
1135
  };
1136
- return /* @__PURE__ */ c("div", { className: w || "col-span-12", children: [
1137
- /* @__PURE__ */ e(Q, { label: u, required: o }),
1138
- /* @__PURE__ */ c(
1136
+ return /* @__PURE__ */ h("div", { className: S || "col-span-12", children: [
1137
+ /* @__PURE__ */ e(q, { label: b, required: i }),
1138
+ /* @__PURE__ */ h(
1139
1139
  "div",
1140
1140
  {
1141
- className: `relative rounded-lg p-2 transition-all ${h ? "border-2 border-dashed border-blue-500 bg-blue-50 dark:bg-blue-900/20" : "border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"}`,
1142
- onDragOver: S,
1141
+ className: `relative rounded-lg p-2 transition-all ${u ? "border-2 border-dashed border-blue-500 bg-blue-50 dark:bg-blue-900/20" : "border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"}`,
1142
+ onDragOver: k,
1143
1143
  onDragLeave: I,
1144
- onDrop: D,
1144
+ onDrop: A,
1145
1145
  children: [
1146
1146
  /* @__PURE__ */ e(
1147
1147
  "input",
1148
1148
  {
1149
- ref: x,
1149
+ ref: v,
1150
1150
  id: t,
1151
1151
  type: "file",
1152
- accept: s,
1153
- onChange: (A) => v(A.target.files),
1154
- required: o && !b,
1152
+ accept: d,
1153
+ onChange: (O) => w(O.target.files),
1154
+ required: i && !p,
1155
1155
  className: "absolute opacity-0 right-[50%] top-[80%] -translate-y-1/2 pointer-events-none h-[10px]"
1156
1156
  }
1157
1157
  ),
1158
1158
  /* @__PURE__ */ e(
1159
1159
  "div",
1160
1160
  {
1161
- className: `flex items-center space-x-4 transition-all ${h ? "opacity-50" : ""}`,
1162
- children: b ? (
1161
+ className: `flex items-center space-x-4 transition-all ${u ? "opacity-50" : ""}`,
1162
+ children: p ? (
1163
1163
  // Audio player with close button and change button
1164
- /* @__PURE__ */ c("div", { className: "flex items-center space-x-4", children: [
1165
- /* @__PURE__ */ c("div", { className: "relative w-full", children: [
1166
- !o && /* @__PURE__ */ e(
1164
+ /* @__PURE__ */ h("div", { className: "flex items-center space-x-4", children: [
1165
+ /* @__PURE__ */ h("div", { className: "relative w-full", children: [
1166
+ !i && /* @__PURE__ */ e(
1167
1167
  "button",
1168
1168
  {
1169
1169
  type: "button",
1170
1170
  onClick: y,
1171
1171
  className: "absolute top-0 -right-2 bg-red-500 text-white rounded-full p-1 shadow-lg hover:bg-red-600 transition-colors z-10 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800",
1172
1172
  "aria-label": "Remove audio",
1173
- children: /* @__PURE__ */ e(te, { icon: "mdi:close", className: "w-3 h-3" })
1173
+ children: /* @__PURE__ */ e(re, { icon: "mdi:close", className: "w-3 h-3" })
1174
1174
  }
1175
1175
  ),
1176
1176
  /* @__PURE__ */ e(
1177
1177
  "audio",
1178
1178
  {
1179
- src: b.preview,
1179
+ src: p.preview,
1180
1180
  controls: !0,
1181
1181
  controlsList: "nodownload"
1182
1182
  },
1183
- b.preview
1183
+ p.preview
1184
1184
  )
1185
1185
  ] }),
1186
- /* @__PURE__ */ e(ee, { type: "button", onClick: C, children: /* @__PURE__ */ e("span", { children: "Change Audio File" }) })
1186
+ /* @__PURE__ */ e(Z, { type: "button", onClick: C, children: /* @__PURE__ */ e("span", { children: "Change Audio File" }) })
1187
1187
  ] })
1188
1188
  ) : (
1189
1189
  // Empty state with upload button
1190
- /* @__PURE__ */ c("div", { className: "flex items-center justify-center space-x-4", children: [
1191
- /* @__PURE__ */ e("div", { className: "rounded-full bg-gray-100 dark:bg-gray-700 h-20 w-20 flex items-center justify-center", children: /* @__PURE__ */ e(te, { icon: "mdi:music", className: "text-gray-400 w-10 h-10" }) }),
1190
+ /* @__PURE__ */ h("div", { className: "flex items-center justify-center space-x-4", children: [
1191
+ /* @__PURE__ */ e("div", { className: "rounded-full bg-gray-100 dark:bg-gray-700 h-20 w-20 flex items-center justify-center", children: /* @__PURE__ */ e(re, { icon: "mdi:music", className: "text-gray-400 w-10 h-10" }) }),
1192
1192
  /* @__PURE__ */ e(
1193
- ee,
1193
+ Z,
1194
1194
  {
1195
1195
  type: "button",
1196
1196
  onClick: C,
@@ -1198,252 +1198,252 @@ const na = ({
1198
1198
  children: /* @__PURE__ */ e("span", { children: "Choose Audio File" })
1199
1199
  }
1200
1200
  ),
1201
- p && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "or drag and drop your audio file here" })
1201
+ g && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "or drag and drop your audio file here" })
1202
1202
  ] })
1203
1203
  )
1204
1204
  }
1205
1205
  ),
1206
- p && h && !b && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none bg-blue-500/10 rounded-lg", children: /* @__PURE__ */ e("span", { className: "text-blue-600 dark:text-blue-400 font-semibold text-lg bg-white dark:bg-gray-800 px-4 py-2 rounded-lg shadow-lg", children: "Drop audio here" }) })
1206
+ g && u && !p && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none bg-blue-500/10 rounded-lg", children: /* @__PURE__ */ e("span", { className: "text-blue-600 dark:text-blue-400 font-semibold text-lg bg-white dark:bg-gray-800 px-4 py-2 rounded-lg shadow-lg", children: "Drop audio here" }) })
1207
1207
  ]
1208
1208
  }
1209
1209
  )
1210
- ] }, k);
1211
- }, Ue = ({ field: u, formData: l, handleChange: i }) => {
1210
+ ] }, M);
1211
+ }, $e = ({ field: b, formData: o, handleChange: s }) => {
1212
1212
  const {
1213
- key: o,
1214
- label: s,
1213
+ key: i,
1214
+ label: d,
1215
1215
  type: t,
1216
- options: p,
1217
- placeholder: k,
1218
- rows: w,
1219
- inputClass: b,
1220
- search: n,
1221
- accept: h,
1222
- text: g,
1223
- required: x = !1,
1224
- minLength: d,
1225
- dragDrop: v,
1216
+ options: g,
1217
+ placeholder: M,
1218
+ rows: S,
1219
+ inputClass: p,
1220
+ search: l,
1221
+ accept: u,
1222
+ text: m,
1223
+ required: v = !1,
1224
+ minLength: c,
1225
+ dragDrop: w,
1226
1226
  parentClass: y,
1227
- countriesList: S,
1227
+ countriesList: k,
1228
1228
  defaultCountry: I,
1229
- multiple: D,
1229
+ multiple: A,
1230
1230
  dropdownMaxHeight: C,
1231
- editorKey: A,
1232
- fontFamily: B,
1233
- disabled: F,
1234
- negativeNumberAllow: R,
1235
- defaultValue: U,
1236
- renderCondition: $,
1237
- optionDependencyKey: W
1238
- } = u;
1239
- let G = l == null ? void 0 : l[o];
1240
- G == null && (G = "");
1241
- const K = k || (t === "select" ? `Select ${s}` : `Enter ${s}`), j = "w-full px-3 py-2 rounded-md border border-gray-300 dark:border-gray-600 text-sm focus:outline-none focus:ring-1 focus:ring-blue-200 bg-white text-black dark:bg-gray-700 dark:text-white";
1242
- if ($ && typeof $ == "function" && !$(l))
1231
+ editorKey: O,
1232
+ fontFamily: F,
1233
+ disabled: T,
1234
+ negativeNumberAllow: L,
1235
+ defaultValue: B,
1236
+ renderCondition: E,
1237
+ optionDependencyKey: Y
1238
+ } = b;
1239
+ let $ = o == null ? void 0 : o[i];
1240
+ $ == null && ($ = "");
1241
+ const _ = M || (t === "select" ? `Select ${d}` : `Enter ${d}`), z = "w-full px-3 py-2 rounded-md border border-gray-300 dark:border-gray-600 text-sm focus:outline-none focus:ring-1 focus:ring-blue-200 bg-white text-black dark:bg-gray-700 dark:text-white";
1242
+ if (E && typeof E == "function" && !E(o))
1243
1243
  return null;
1244
1244
  switch (t) {
1245
1245
  case "select":
1246
1246
  return /* @__PURE__ */ e(
1247
- ea,
1247
+ ta,
1248
1248
  {
1249
- options: p || [],
1250
- value: G,
1251
- formData: l,
1252
- dependencyKey: W,
1253
- onChange: (O) => i(o, O),
1254
- placeholder: K,
1255
- className: b || "",
1256
- search: n,
1257
- required: x,
1258
- defaultValue: U,
1259
- label: s,
1260
- name: o,
1261
- disabled: F,
1249
+ options: g || [],
1250
+ value: $,
1251
+ formData: o,
1252
+ dependencyKey: Y,
1253
+ onChange: (D) => s(i, D),
1254
+ placeholder: _,
1255
+ className: p || "",
1256
+ search: l,
1257
+ required: v,
1258
+ defaultValue: B,
1259
+ label: d,
1260
+ name: i,
1261
+ disabled: T,
1262
1262
  parentClass: y,
1263
- multiple: D,
1263
+ multiple: A,
1264
1264
  dropdownMaxHeight: C
1265
1265
  }
1266
1266
  );
1267
1267
  case "checkbox":
1268
1268
  return /* @__PURE__ */ e(
1269
- la,
1269
+ sa,
1270
1270
  {
1271
- name: o,
1272
- label: s,
1273
- options: p || [],
1274
- value: G,
1275
- onChange: (O) => i(o, O),
1276
- required: x,
1271
+ name: i,
1272
+ label: d,
1273
+ options: g || [],
1274
+ value: $,
1275
+ onChange: (D) => s(i, D),
1276
+ required: v,
1277
1277
  parentClass: y,
1278
- className: b || "",
1279
- multiSelect: D,
1280
- disabled: F
1278
+ className: p || "",
1279
+ multiSelect: A,
1280
+ disabled: T
1281
1281
  }
1282
1282
  );
1283
1283
  case "switch":
1284
1284
  return /* @__PURE__ */ e(
1285
- aa,
1285
+ na,
1286
1286
  {
1287
- value: G,
1288
- onChange: (O) => i(o, O),
1289
- text: g,
1290
- options: p || [],
1291
- label: s,
1292
- required: x,
1293
- name: o,
1294
- disabled: F,
1287
+ value: $,
1288
+ onChange: (D) => s(i, D),
1289
+ text: m,
1290
+ options: g || [],
1291
+ label: d,
1292
+ required: v,
1293
+ name: i,
1294
+ disabled: T,
1295
1295
  parentClass: y
1296
1296
  }
1297
1297
  );
1298
1298
  case "phone":
1299
1299
  return /* @__PURE__ */ e(
1300
- ra,
1300
+ la,
1301
1301
  {
1302
- value: G,
1303
- onChange: (O) => i(o, O),
1304
- countriesList: S,
1302
+ value: $,
1303
+ onChange: (D) => s(i, D),
1304
+ countriesList: k,
1305
1305
  defaultCountry: I,
1306
- required: x,
1307
- placeholder: K,
1308
- search: n,
1309
- label: s,
1310
- name: o,
1311
- disabled: F,
1306
+ required: v,
1307
+ placeholder: _,
1308
+ search: l,
1309
+ label: d,
1310
+ name: i,
1311
+ disabled: T,
1312
1312
  parentClass: y
1313
1313
  }
1314
1314
  );
1315
1315
  case "textarea":
1316
1316
  return /* @__PURE__ */ e(
1317
- Ie,
1317
+ je,
1318
1318
  {
1319
- value: G,
1320
- onChange: (O) => i(o, O.target.value),
1321
- placeholder: K,
1322
- rows: w || 3,
1323
- className: `${j} ${b || ""}`,
1324
- required: x,
1325
- name: o,
1326
- label: s,
1327
- disabled: F,
1319
+ value: $,
1320
+ onChange: (D) => s(i, D.target.value),
1321
+ placeholder: _,
1322
+ rows: S || 3,
1323
+ className: `${z} ${p || ""}`,
1324
+ required: v,
1325
+ name: i,
1326
+ label: d,
1327
+ disabled: T,
1328
1328
  parentClass: y
1329
1329
  }
1330
1330
  );
1331
1331
  case "image":
1332
1332
  return /* @__PURE__ */ e(
1333
- ta,
1333
+ oa,
1334
1334
  {
1335
- value: G,
1336
- onChange: (O) => i(o, O),
1337
- required: x,
1338
- accept: h || "image/*",
1339
- id: `file-${o}`,
1340
- dragDrop: v,
1341
- label: s,
1342
- name: o,
1335
+ value: $,
1336
+ onChange: (D) => s(i, D),
1337
+ required: v,
1338
+ accept: u || "image/*",
1339
+ id: `file-${i}`,
1340
+ dragDrop: w,
1341
+ label: d,
1342
+ name: i,
1343
1343
  parentClass: y
1344
1344
  }
1345
1345
  );
1346
1346
  case "audio":
1347
1347
  return /* @__PURE__ */ e(
1348
- oa,
1348
+ da,
1349
1349
  {
1350
- value: G,
1351
- onChange: (O) => i(o, O),
1352
- required: x,
1353
- accept: h || "audio/*",
1354
- id: `file-${o}`,
1355
- dragDrop: v,
1356
- label: s,
1357
- name: o,
1350
+ value: $,
1351
+ onChange: (D) => s(i, D),
1352
+ required: v,
1353
+ accept: u || "audio/*",
1354
+ id: `file-${i}`,
1355
+ dragDrop: w,
1356
+ label: d,
1357
+ name: i,
1358
1358
  parentClass: y
1359
1359
  }
1360
1360
  );
1361
1361
  case "tinyEditor":
1362
1362
  return /* @__PURE__ */ e(
1363
- na,
1363
+ ia,
1364
1364
  {
1365
- value: G,
1366
- onChange: (O) => i(o, O),
1367
- required: x,
1368
- placeholder: K,
1369
- label: s,
1365
+ value: $,
1366
+ onChange: (D) => s(i, D),
1367
+ required: v,
1368
+ placeholder: _,
1369
+ label: d,
1370
1370
  parentClass: y,
1371
- fontFamily: B,
1372
- editorKey: A,
1373
- disabled: F
1371
+ fontFamily: F,
1372
+ editorKey: O,
1373
+ disabled: T
1374
1374
  },
1375
- `editor-${o}`
1375
+ `editor-${i}`
1376
1376
  );
1377
1377
  default:
1378
1378
  return /* @__PURE__ */ e(
1379
- Be,
1379
+ Ee,
1380
1380
  {
1381
1381
  type: t || "text",
1382
- defaultValue: U,
1383
- value: G,
1384
- onChange: (O) => i(o, O.target.value),
1385
- placeholder: K,
1386
- className: `${j} ${b || ""}`,
1387
- required: x,
1388
- name: o,
1389
- minLength: d,
1390
- label: s,
1391
- negativeNumberAllow: R,
1382
+ defaultValue: B,
1383
+ value: $,
1384
+ onChange: (D) => s(i, D.target.value),
1385
+ placeholder: _,
1386
+ className: `${z} ${p || ""}`,
1387
+ required: v,
1388
+ name: i,
1389
+ minLength: c,
1390
+ label: d,
1391
+ negativeNumberAllow: L,
1392
1392
  parentClass: y,
1393
- disabled: F
1393
+ disabled: T
1394
1394
  }
1395
1395
  );
1396
1396
  }
1397
- }, ia = ({ isOpen: u, onClose: l, config: i, onApply: o }) => {
1398
- var b;
1399
- const [s, t] = M({}), p = (n, h) => {
1400
- t((g) => ({ ...g, [n]: h }));
1401
- }, k = () => {
1402
- o == null || o(s), l();
1403
- }, w = () => {
1404
- t({}), o == null || o({}), l();
1397
+ }, ca = ({ isOpen: b, onClose: o, config: s, onApply: i }) => {
1398
+ var p;
1399
+ const [d, t] = R({}), g = (l, u) => {
1400
+ t((m) => ({ ...m, [l]: u }));
1401
+ }, M = () => {
1402
+ i == null || i(d), o();
1403
+ }, S = () => {
1404
+ t({}), i == null || i({}), o();
1405
1405
  };
1406
- return /* @__PURE__ */ c(E, { children: [
1406
+ return /* @__PURE__ */ h(j, { children: [
1407
1407
  /* @__PURE__ */ e(
1408
1408
  "div",
1409
1409
  {
1410
- className: `fixed inset-0 bg-black/50 z-40 transition-opacity duration-300 ${u ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`,
1411
- onClick: l
1410
+ className: `fixed inset-0 bg-black/50 z-40 transition-opacity duration-300 ${b ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`,
1411
+ onClick: o
1412
1412
  }
1413
1413
  ),
1414
- /* @__PURE__ */ c(
1414
+ /* @__PURE__ */ h(
1415
1415
  "div",
1416
1416
  {
1417
1417
  className: `fixed top-0 right-0 h-full w-[28rem] bg-white dark:bg-gray-900 shadow-2xl z-50 flex flex-col border-l border-gray-200 dark:border-gray-700
1418
1418
  transform transition-transform duration-300 ease-in-out
1419
- ${u ? "translate-x-0" : "translate-x-full"}
1419
+ ${b ? "translate-x-0" : "translate-x-full"}
1420
1420
  `,
1421
1421
  children: [
1422
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700", children: [
1422
+ /* @__PURE__ */ h("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700", children: [
1423
1423
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: "Filters" }),
1424
1424
  /* @__PURE__ */ e(
1425
1425
  "button",
1426
1426
  {
1427
- onClick: l,
1427
+ onClick: o,
1428
1428
  className: "p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition",
1429
- children: /* @__PURE__ */ e(we, { className: "w-5 h-5 text-gray-500 dark:text-gray-400" })
1429
+ children: /* @__PURE__ */ e(Ne, { className: "w-5 h-5 text-gray-500 dark:text-gray-400" })
1430
1430
  }
1431
1431
  )
1432
1432
  ] }),
1433
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-4 py-3", children: i != null && i.component ? /* @__PURE__ */ e(i.component, { filters: s, onFilterChange: p }) : /* @__PURE__ */ e("div", { className: "space-y-4", children: (b = i == null ? void 0 : i.fields) == null ? void 0 : b.map((n) => /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
1434
- Ue,
1433
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-4 py-3", children: s != null && s.component ? /* @__PURE__ */ e(s.component, { filters: d, onFilterChange: g }) : /* @__PURE__ */ e("div", { className: "space-y-4", children: (p = s == null ? void 0 : s.fields) == null ? void 0 : p.map((l) => /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(
1434
+ $e,
1435
1435
  {
1436
- field: n,
1437
- formData: s,
1438
- handleChange: p
1436
+ field: l,
1437
+ formData: d,
1438
+ handleChange: g
1439
1439
  },
1440
- n.key
1440
+ l.key
1441
1441
  ) })) }) }),
1442
- /* @__PURE__ */ c("div", { className: "flex gap-2 px-4 py-3 border-t border-gray-200 dark:border-gray-700", children: [
1442
+ /* @__PURE__ */ h("div", { className: "flex gap-2 px-4 py-3 border-t border-gray-200 dark:border-gray-700", children: [
1443
1443
  /* @__PURE__ */ e(
1444
- ee,
1444
+ Z,
1445
1445
  {
1446
- onClick: k,
1446
+ onClick: M,
1447
1447
  variant: "contained",
1448
1448
  color: "primary",
1449
1449
  fullWidth: !0,
@@ -1451,9 +1451,9 @@ const na = ({
1451
1451
  }
1452
1452
  ),
1453
1453
  /* @__PURE__ */ e(
1454
- ee,
1454
+ Z,
1455
1455
  {
1456
- onClick: w,
1456
+ onClick: S,
1457
1457
  variant: "contained",
1458
1458
  className: "min-w-[150px]",
1459
1459
  children: "Reset"
@@ -1464,7 +1464,7 @@ const na = ({
1464
1464
  }
1465
1465
  )
1466
1466
  ] });
1467
- }, Oe = {
1467
+ }, Te = {
1468
1468
  blue: {
1469
1469
  bg: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",
1470
1470
  border: "border border-blue-300 text-blue-700 dark:border-blue-700 dark:text-blue-300"
@@ -1493,64 +1493,64 @@ const na = ({
1493
1493
  bg: "bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300",
1494
1494
  border: "border border-gray-300 text-gray-700 dark:border-gray-700 dark:text-gray-300"
1495
1495
  }
1496
- }, Ae = {
1496
+ }, Pe = {
1497
1497
  contained: "bg",
1498
1498
  outline: "border !bg-transparent",
1499
1499
  soft: "bg opacity-90"
1500
- }, je = ({
1501
- label: u,
1502
- variant: l = "contained",
1500
+ }, Ge = ({
1501
+ label: b,
1502
+ variant: o = "contained",
1503
1503
  // contained | outline | soft
1504
- color: i = "green",
1505
- className: o = ""
1504
+ color: s = "green",
1505
+ className: i = ""
1506
1506
  }) => {
1507
- const s = Oe[i] || Oe.green, t = Ae[l] || Ae.contained, p = l === "outline" ? s.border : s.bg;
1507
+ const d = Te[s] || Te.green, t = Pe[o] || Pe.contained, g = o === "outline" ? d.border : d.bg;
1508
1508
  return /* @__PURE__ */ e(
1509
1509
  "span",
1510
1510
  {
1511
1511
  className: `inline-flex justify-center items-center rounded-sm text-xs font-semibold px-3 py-1 min-w-[78px]
1512
- ${p}
1512
+ ${g}
1513
1513
  ${t}
1514
- ${o}`,
1515
- children: u
1514
+ ${i}`,
1515
+ children: b
1516
1516
  }
1517
1517
  );
1518
- }, sa = ({ rows: u = 5, columns: l = 5 }) => /* @__PURE__ */ c(E, { children: [
1518
+ }, ha = ({ rows: b = 5, columns: o = 5 }) => /* @__PURE__ */ h(j, { children: [
1519
1519
  /* @__PURE__ */ e("div", { className: "w-full mb-6 inline-flex justify-end items-center", children: /* @__PURE__ */ e("div", { className: "h-8 w-80 bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }),
1520
- /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-md border border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ c("table", { className: "w-full border-collapse", children: [
1521
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { className: "bg-gray-50 dark:bg-gray-900", children: Array.from({ length: l }).map((i, o) => /* @__PURE__ */ e("th", { className: "px-4 py-3", children: /* @__PURE__ */ e("div", { className: "h-6 w-24 bg-gray-300 dark:bg-gray-700 rounded animate-pulse inline-flex justify-center items-center" }) }, o)) }) }),
1522
- /* @__PURE__ */ e("tbody", { children: Array.from({ length: u }).map((i, o) => /* @__PURE__ */ e(
1520
+ /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-md border border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ h("table", { className: "w-full border-collapse", children: [
1521
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { className: "bg-gray-50 dark:bg-gray-900", children: Array.from({ length: o }).map((s, i) => /* @__PURE__ */ e("th", { className: "px-4 py-3", children: /* @__PURE__ */ e("div", { className: "h-6 w-24 bg-gray-300 dark:bg-gray-700 rounded animate-pulse inline-flex justify-center items-center" }) }, i)) }) }),
1522
+ /* @__PURE__ */ e("tbody", { children: Array.from({ length: b }).map((s, i) => /* @__PURE__ */ e(
1523
1523
  "tr",
1524
1524
  {
1525
1525
  className: "border-t border-gray-200 dark:border-gray-800",
1526
- children: Array.from({ length: l }).map((s, t) => /* @__PURE__ */ e("td", { className: "px-4 py-6", children: /* @__PURE__ */ e("div", { className: "h-6 w-full bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }, t))
1526
+ children: Array.from({ length: o }).map((d, t) => /* @__PURE__ */ e("td", { className: "px-4 py-6", children: /* @__PURE__ */ e("div", { className: "h-6 w-full bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }, t))
1527
1527
  },
1528
- o
1528
+ i
1529
1529
  )) })
1530
1530
  ] }) })
1531
- ] }), Ee = ({ src: u, alt: l = "preview", isOpen: i, setIsOpen: o }) => {
1532
- const s = () => o(!1);
1533
- return z(() => {
1534
- const t = (p) => {
1535
- p.key === "Escape" && s();
1531
+ ] }), _e = ({ src: b, alt: o = "preview", isOpen: s, setIsOpen: i }) => {
1532
+ const d = () => i(!1);
1533
+ return K(() => {
1534
+ const t = (g) => {
1535
+ g.key === "Escape" && d();
1536
1536
  };
1537
- return i && (document.body.style.overflow = "hidden", document.addEventListener("keydown", t)), () => {
1537
+ return s && (document.body.style.overflow = "hidden", document.addEventListener("keydown", t)), () => {
1538
1538
  document.body.style.overflow = "", document.removeEventListener("keydown", t);
1539
1539
  };
1540
- }, [i]), /* @__PURE__ */ e(E, { children: /* @__PURE__ */ c(
1540
+ }, [s]), /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h(
1541
1541
  "div",
1542
1542
  {
1543
1543
  className: `fixed inset-0 z-50 flex items-center justify-center bg-black/70 dark:bg-black/80 \r
1544
1544
  backdrop-blur-sm animate-in fade-in duration-200`,
1545
- onClick: s,
1545
+ onClick: d,
1546
1546
  children: [
1547
1547
  /* @__PURE__ */ e(
1548
1548
  "button",
1549
1549
  {
1550
- onClick: s,
1550
+ onClick: d,
1551
1551
  className: `absolute top-4 right-4 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200\r
1552
1552
  hover:bg-gray-100 dark:hover:bg-gray-700 rounded-full p-2 shadow-lg transition`,
1553
- children: /* @__PURE__ */ e(we, { size: 20 })
1553
+ children: /* @__PURE__ */ e(Ne, { size: 20 })
1554
1554
  }
1555
1555
  ),
1556
1556
  /* @__PURE__ */ e(
@@ -1561,8 +1561,8 @@ const na = ({
1561
1561
  children: /* @__PURE__ */ e(
1562
1562
  "img",
1563
1563
  {
1564
- src: u,
1565
- alt: l,
1564
+ src: b,
1565
+ alt: o,
1566
1566
  className: "w-full max-h-[90vh] object-contain rounded-xl"
1567
1567
  }
1568
1568
  )
@@ -1571,386 +1571,397 @@ const na = ({
1571
1571
  ]
1572
1572
  }
1573
1573
  ) });
1574
- }, da = ({ config: u, setShowAdd: l, title: i, buttonText: o, description: s }) => {
1574
+ }, ua = ({ config: b, setShowAdd: o, title: s, buttonText: i, description: d }) => {
1575
1575
  const {
1576
1576
  data: t = [],
1577
- table_head: p = [],
1578
- loading: k = !1,
1579
- search: w = {
1577
+ table_head: g = [],
1578
+ loading: M = !1,
1579
+ search: S = {
1580
1580
  enabled: !1,
1581
1581
  placeholder: "Search...",
1582
1582
  useServerSideSearch: !1
1583
1583
  },
1584
- filter: b = {
1584
+ filter: p = {
1585
1585
  enabled: !1,
1586
1586
  useServerSideFilters: !1
1587
1587
  },
1588
- pagination: n = {
1588
+ pagination: l = {
1589
1589
  enabled: !1,
1590
1590
  rows_per_page: 10,
1591
1591
  useServerSidePagination: !1
1592
1592
  },
1593
- emptyMessage: h = "No data available",
1594
- onMenuAction: g,
1595
- setServerSidePaginationData: x = () => {
1593
+ emptyMessage: u = "No data available",
1594
+ onMenuAction: m,
1595
+ setServerSidePaginationData: v = () => {
1596
1596
  },
1597
- onFilterApply: d,
1598
- filterConfig: v = null
1599
- } = u, [y, S] = M(""), [I, D] = M(null), [C, A] = M([]), [B, F] = M({}), [R, U] = M(!1), [$, W] = M(null), [G, K] = M(!1), j = Me(() => !w.enabled || !y.trim() || w.useServerSideSearch ? t : Xe(t, y, w.searchKeys || []), [t, y, w]), [O, Y] = M(1), [q, N] = M((n == null ? void 0 : n.rows_per_page) || 50), [H, re] = M(j.length || 0), J = n != null && n.useServerSidePagination ? n.total_pages : Math.ceil(j.length / q), X = Me(() => {
1600
- if (n.useServerSidePagination) return j;
1601
- const r = (O - 1) * q;
1602
- return j.slice(r, r + q);
1603
- }, [j, O, q]), ne = ae(null), ie = ae({}), le = ae(null), se = (r) => {
1604
- S(r), Y(1), w.useServerSideSearch && (le.current && clearTimeout(le.current), le.current = setTimeout(async () => {
1597
+ onFilterApply: c,
1598
+ filterConfig: w = null,
1599
+ rowClick: y = null
1600
+ } = b, [k, I] = R(""), [A, C] = R(null), [O, F] = R([]), [T, L] = R({}), [B, E] = R(!1), [Y, $] = R(null), [_, z] = R(!1), D = Re(() => !S.enabled || !k.trim() || S.useServerSideSearch ? t : ra(t, k, S.searchKeys || []), [t, k, S]), [U, V] = R(1), [x, H] = R((l == null ? void 0 : l.rows_per_page) || 50), [J, Q] = R(D.length || 0), W = l != null && l.useServerSidePagination ? l.total_pages : Math.ceil(D.length / x), ie = Re(() => {
1601
+ if (l.useServerSidePagination) return D;
1602
+ const a = (U - 1) * x;
1603
+ return D.slice(a, a + x);
1604
+ }, [D, U, x]), te = ee(null), se = ee({}), ae = ee(null), de = (a) => {
1605
+ I(a), V(1), S.useServerSideSearch && (ae.current && clearTimeout(ae.current), ae.current = setTimeout(async () => {
1605
1606
  try {
1606
- await x((f) => ({
1607
- ...f,
1608
- search: r,
1607
+ await v((n) => ({
1608
+ ...n,
1609
+ search: a,
1609
1610
  current_page: 1
1610
1611
  }));
1611
- } catch (f) {
1612
- console.error("Search error:", f);
1612
+ } catch (n) {
1613
+ console.error("Search error:", n);
1613
1614
  }
1614
1615
  }, 800));
1615
- }, de = (r, f, P) => {
1616
- P.stopPropagation(), D(null), g == null || g(r.type, f);
1617
- }, ce = (r, f, P) => {
1618
- f.stopPropagation(), A(P);
1619
- const _ = f.currentTarget;
1620
- ie.current[r] = _;
1621
- const m = _.getBoundingClientRect(), L = 192, T = P.length * 40, Z = window.innerWidth, V = window.innerHeight, Ge = Z - m.right < L ? m.left - L + m.width : m.left, _e = V - m.bottom < T && m.top > T ? m.top - T - 2 : m.bottom + 2;
1622
- F({
1623
- top: Math.max(8, Math.min(_e, V - T - 8)),
1624
- left: Math.max(8, Math.min(Ge, Z - L - 8))
1625
- }), D(I === r ? null : r);
1626
- }, he = (r) => (O - 1) * q + r + 1, ue = (r) => {
1627
- r && r.src instanceof File && (r = { ...r, src: URL.createObjectURL(r.src) }), W(r), K(!0);
1628
- }, oe = (r, f, P, _ = null) => /* @__PURE__ */ e(E, { children: r ? /* @__PURE__ */ e(
1616
+ }, ce = (a, n, f) => {
1617
+ f.stopPropagation(), C(null), m == null || m(a.type, n);
1618
+ }, he = (a, n, f) => {
1619
+ n.stopPropagation(), F(f);
1620
+ const N = n.currentTarget;
1621
+ se.current[a] = N;
1622
+ const P = N.getBoundingClientRect(), G = 192, X = f.length * 40, ve = window.innerWidth, De = window.innerHeight, ze = ve - P.right < G ? P.left - G + P.width : P.left, He = De - P.bottom < X && P.top > X ? P.top - X - 2 : P.bottom + 2;
1623
+ L({
1624
+ top: Math.max(8, Math.min(He, De - X - 8)),
1625
+ left: Math.max(8, Math.min(ze, ve - G - 8))
1626
+ }), C(A === a ? null : a);
1627
+ }, ue = (a) => (U - 1) * x + a + 1, be = (a) => {
1628
+ a && a.src instanceof File && (a = { ...a, src: URL.createObjectURL(a.src) }), $(a), z(!0);
1629
+ }, ne = (a, n, f, N = null) => /* @__PURE__ */ e(j, { children: a ? /* @__PURE__ */ e(
1629
1630
  "img",
1630
1631
  {
1631
- src: r instanceof File ? URL.createObjectURL(r) : r,
1632
- alt: f || "Avatar",
1633
- onClick: (m) => {
1634
- m.stopPropagation(), m.preventDefault(), ue({ src: r, alt: f });
1632
+ src: a instanceof File ? URL.createObjectURL(a) : a,
1633
+ alt: n || "Avatar",
1634
+ onClick: (P) => {
1635
+ P.stopPropagation(), P.preventDefault(), be({ src: a, alt: n });
1635
1636
  },
1636
- className: `w-10 h-10 cursor-pointer shrink-0 rounded-full object-cover border border-gray-200 dark:border-gray-700 ${P || ""}`
1637
+ className: `w-10 h-10 cursor-pointer shrink-0 rounded-full object-cover border border-gray-200 dark:border-gray-700 ${f || ""}`
1637
1638
  }
1638
- ) : /* @__PURE__ */ e(E, { children: _ || /* @__PURE__ */ e(
1639
+ ) : /* @__PURE__ */ e(j, { children: N || /* @__PURE__ */ e(
1639
1640
  "div",
1640
1641
  {
1641
- className: `w-10 h-10 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${P || ""}`,
1642
- children: /* @__PURE__ */ e(Fe, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
1642
+ className: `w-10 h-10 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${f || ""}`,
1643
+ children: /* @__PURE__ */ e(Be, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
1643
1644
  }
1644
- ) }) }), be = (r, f) => /* @__PURE__ */ e(E, { children: r ? /* @__PURE__ */ e(
1645
+ ) }) }), pe = (a, n) => /* @__PURE__ */ e(j, { children: a ? /* @__PURE__ */ e(
1645
1646
  "audio",
1646
1647
  {
1647
1648
  controls: !0,
1648
- src: r instanceof File ? URL.createObjectURL(r) : r,
1649
- onClick: (P) => {
1650
- P.stopPropagation();
1649
+ src: a instanceof File ? URL.createObjectURL(a) : a,
1650
+ onClick: (f) => {
1651
+ f.stopPropagation();
1651
1652
  },
1652
- className: `w-64 cursor-pointer ${f || ""}`
1653
+ className: `w-64 cursor-pointer ${n || ""}`
1653
1654
  },
1654
- r instanceof File ? URL.createObjectURL(r) : r
1655
- ) : /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
1655
+ a instanceof File ? URL.createObjectURL(a) : a
1656
+ ) : /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(
1656
1657
  "div",
1657
1658
  {
1658
- className: `w-12 h-12 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${f || ""}`,
1659
- children: /* @__PURE__ */ e(qe, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
1659
+ className: `w-12 h-12 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${n || ""}`,
1660
+ children: /* @__PURE__ */ e(Qe, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
1660
1661
  }
1661
- ) }) }), pe = (r, f) => /* @__PURE__ */ c("div", { className: `flex items-center space-x-4 ${f.className || ""}`, children: [
1662
- f.imageKey ? oe(r[f.imageKey], r[f.titleKey], "group-avatar") : "",
1663
- /* @__PURE__ */ c("div", { children: [
1664
- /* @__PURE__ */ e("p", { className: "font-medium text-gray-900 dark:text-white group-title", children: r[f.titleKey] || "" }),
1665
- /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400 group-sub-title", children: r[f.subtitleKey] || "" })
1662
+ ) }) }), ge = (a, n) => /* @__PURE__ */ h("div", { className: `flex items-center space-x-4 ${n.className || ""}`, children: [
1663
+ n.imageKey ? ne(a[n.imageKey], a[n.titleKey], "group-avatar") : "",
1664
+ /* @__PURE__ */ h("div", { children: [
1665
+ /* @__PURE__ */ e("p", { className: "font-medium text-gray-900 dark:text-white group-title", children: a[n.titleKey] || "" }),
1666
+ /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400 group-sub-title", children: a[n.subtitleKey] || "" })
1666
1667
  ] })
1667
- ] }), ge = (r, f) => {
1668
- var L;
1669
- let P = String(r);
1670
- const _ = f.variant || "contained";
1671
- let m = f.defaultColor;
1672
- if (((L = f == null ? void 0 : f.chipOptions) == null ? void 0 : L.length) > 0) {
1673
- let T = f == null ? void 0 : f.chipOptions.find((Z) => Z.value == r);
1674
- T && (P = T.label, m = T.color);
1668
+ ] }), me = (a, n) => {
1669
+ var G;
1670
+ let f = String(a);
1671
+ const N = n.variant || "contained";
1672
+ let P = n.defaultColor;
1673
+ if (((G = n == null ? void 0 : n.chipOptions) == null ? void 0 : G.length) > 0) {
1674
+ let X = n == null ? void 0 : n.chipOptions.find((ve) => ve.value == a);
1675
+ X && (f = X.label, P = X.color);
1675
1676
  }
1676
1677
  return /* @__PURE__ */ e(
1677
- je,
1678
+ Ge,
1678
1679
  {
1679
- label: P,
1680
- variant: _,
1681
- color: m,
1682
- className: f.className || ""
1680
+ label: f,
1681
+ variant: N,
1682
+ color: P,
1683
+ className: n.className || ""
1683
1684
  }
1684
1685
  );
1685
- }, me = (r, f, P) => {
1686
- const _ = f[r.key];
1687
- return r.type === "menu_actions" ? /* @__PURE__ */ e("div", { className: `text-center ${r.className || ""}`, children: /* @__PURE__ */ e(
1686
+ }, fe = (a, n, f) => {
1687
+ const N = n[a.key];
1688
+ return a.type === "menu_actions" ? /* @__PURE__ */ e("div", { className: `text-center ${a.className || ""}`, children: /* @__PURE__ */ e(
1688
1689
  "button",
1689
1690
  {
1690
- ref: (m) => ie.current[f.id || f._id] = m,
1691
- onClick: (m) => ce(f.id || f._id, m, r.menuList),
1691
+ ref: (P) => se.current[n.id || n._id] = P,
1692
+ onClick: (P) => he(n.id || n._id, P, a.menuList),
1692
1693
  className: "p-2 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-full transition text-gray-700 dark:text-gray-300",
1693
- children: /* @__PURE__ */ e(We, { className: "h-4 w-4" })
1694
+ children: /* @__PURE__ */ e(Je, { className: "h-4 w-4" })
1694
1695
  }
1695
- ) }) : r.type === "index" ? /* @__PURE__ */ e("span", { className: r.className || "", children: he(P) }) : r.type === "group" ? pe(f, r) : r.type === "chip" ? /* @__PURE__ */ e(E, { children: ge(_, r) }) : r.type === "date" ? /* @__PURE__ */ e("span", { className: r.className || "", children: Pe(_, r.format || "DD MMM YYYY") }) : r.type === "avatar" ? /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e("div", { className: "min-w-[40px]", children: oe(_, r.alt, r.className, r.fallback_icon) }) }) : r.type === "audio" ? /* @__PURE__ */ e(E, { children: be(_, r.className) }) : /* @__PURE__ */ e("span", { className: r.className || "", children: _ || "N/A" });
1696
- }, fe = (r, f) => {
1697
- if (r.onClickDetails)
1698
- return g == null ? void 0 : g("view", f);
1699
- if (typeof r.handleClick == "function")
1700
- return r.handleClick(f);
1701
- }, ye = (r) => r.onClickDetails || typeof r.handleClick == "function";
1702
- return z(() => {
1703
- const r = () => {
1704
- I && D(null);
1696
+ ) }) : a.type === "index" ? /* @__PURE__ */ e("span", { className: a.className || "", children: ue(f) }) : a.type === "group" ? ge(n, a) : a.type === "chip" ? /* @__PURE__ */ e(j, { children: me(N, a) }) : a.type === "date" ? /* @__PURE__ */ e("span", { className: a.className || "", children: Ue(N, a.format || "DD MMM YYYY") }) : a.type === "avatar" ? /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e("div", { className: "min-w-[40px]", children: ne(N, a.alt, a.className, a.fallback_icon) }) }) : a.type === "audio" ? /* @__PURE__ */ e(j, { children: pe(N, a.className) }) : /* @__PURE__ */ e("span", { className: a.className || "", children: N || "N/A" });
1697
+ }, ye = (a) => {
1698
+ if (typeof y == "function")
1699
+ return y(a);
1700
+ if (y)
1701
+ return m == null ? void 0 : m("view", a);
1702
+ }, xe = (a, n) => {
1703
+ if (a.onClickDetails)
1704
+ return m == null ? void 0 : m("view", n);
1705
+ if (typeof a.handleClick == "function")
1706
+ return a.handleClick(n);
1707
+ }, le = () => y || typeof y == "function", oe = (a) => a.onClickDetails || typeof a.handleClick == "function";
1708
+ return K(() => {
1709
+ const a = () => {
1710
+ A && C(null);
1705
1711
  };
1706
- return window.addEventListener("scroll", r, !0), () => {
1707
- window.removeEventListener("scroll", r, !0);
1712
+ return window.addEventListener("scroll", a, !0), () => {
1713
+ window.removeEventListener("scroll", a, !0);
1708
1714
  };
1709
- }, [I]), z(() => {
1710
- const r = (f) => {
1711
- ne.current && !ne.current.contains(f.target) && D(null);
1715
+ }, [A]), K(() => {
1716
+ const a = (n) => {
1717
+ te.current && !te.current.contains(n.target) && C(null);
1712
1718
  };
1713
- return document.addEventListener("click", r), () => document.removeEventListener("click", r);
1714
- }, []), z(() => {
1715
- n != null && n.rows_per_page && (n != null && n.useServerSidePagination) && N((n == null ? void 0 : n.rows_per_page) || 50), n.current_page && Y(n.current_page);
1719
+ return document.addEventListener("click", a), () => document.removeEventListener("click", a);
1720
+ }, []), K(() => {
1721
+ l != null && l.rows_per_page && (l != null && l.useServerSidePagination) && H((l == null ? void 0 : l.rows_per_page) || 50), l.current_page && V(l.current_page);
1716
1722
  }, [
1717
- n.rows_per_page,
1718
- n == null ? void 0 : n.useServerSidePagination,
1719
- n.current_page
1720
- ]), z(() => {
1721
- re(
1722
- n != null && n.useServerSidePagination ? n.total_records : j.length
1723
- ), j.length <= q * (O - 1) && !(n != null && n.useServerSidePagination) && Y((r) => r - 1 || 1);
1723
+ l.rows_per_page,
1724
+ l == null ? void 0 : l.useServerSidePagination,
1725
+ l.current_page
1726
+ ]), K(() => {
1727
+ Q(
1728
+ l != null && l.useServerSidePagination ? l.total_records : D.length
1729
+ ), D.length <= x * (U - 1) && !(l != null && l.useServerSidePagination) && V((a) => a - 1 || 1);
1724
1730
  }, [
1725
- j.length,
1726
- n.total_records,
1727
- n == null ? void 0 : n.useServerSidePagination
1728
- ]), k ? /* @__PURE__ */ e(sa, { rows: 6, columns: 6 }) : /* @__PURE__ */ c(E, { children: [
1729
- /* @__PURE__ */ c("div", { className: "flex flex-col sm:flex-row sm:justify-between gap-4 mb-3", children: [
1730
- /* @__PURE__ */ c("div", { children: [
1731
- /* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: i }),
1732
- /* @__PURE__ */ e("p", { className: "text-md text-gray-600 dark:text-gray-400", children: s })
1731
+ D.length,
1732
+ l.total_records,
1733
+ l == null ? void 0 : l.useServerSidePagination
1734
+ ]), M ? /* @__PURE__ */ e(ha, { rows: 6, columns: 6 }) : /* @__PURE__ */ h(j, { children: [
1735
+ /* @__PURE__ */ h("div", { className: "flex flex-col sm:flex-row sm:justify-between gap-4 mb-3", children: [
1736
+ /* @__PURE__ */ h("div", { children: [
1737
+ /* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: s }),
1738
+ /* @__PURE__ */ e("p", { className: "text-md text-gray-600 dark:text-gray-400", children: d })
1733
1739
  ] }),
1734
- /* @__PURE__ */ c("div", { className: "flex flex-col justify-end items-end gap-2", children: [
1735
- /* @__PURE__ */ c(
1736
- ee,
1740
+ /* @__PURE__ */ h("div", { className: "flex flex-col justify-end items-end gap-2", children: [
1741
+ /* @__PURE__ */ h(
1742
+ Z,
1737
1743
  {
1738
- onClick: () => l(!0),
1744
+ onClick: () => o(!0),
1739
1745
  variant: "contained",
1740
1746
  color: "primary",
1741
1747
  children: [
1742
- /* @__PURE__ */ e(ze, { className: "w-4 h-4 mr-2" }),
1743
- o || "Add New"
1748
+ /* @__PURE__ */ e(Ve, { className: "w-4 h-4 mr-2" }),
1749
+ i || "Add New"
1744
1750
  ]
1745
1751
  }
1746
1752
  ),
1747
- /* @__PURE__ */ c("div", { className: "flex justify-end items-center gap-2", children: [
1748
- w.enabled && /* @__PURE__ */ e("div", { className: "", children: /* @__PURE__ */ c("div", { className: "relative min-w-[300px]", children: [
1749
- /* @__PURE__ */ e(Re, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-300" }),
1753
+ /* @__PURE__ */ h("div", { className: "flex justify-end items-center gap-2", children: [
1754
+ S.enabled && /* @__PURE__ */ e("div", { className: "", children: /* @__PURE__ */ h("div", { className: "relative min-w-[300px]", children: [
1755
+ /* @__PURE__ */ e(Oe, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-300" }),
1750
1756
  /* @__PURE__ */ e(
1751
1757
  "input",
1752
1758
  {
1753
1759
  type: "text",
1754
- placeholder: w.placeholder || "Search...",
1755
- value: y,
1756
- onChange: (r) => se(r.target.value),
1760
+ placeholder: S.placeholder || "Search...",
1761
+ value: k,
1762
+ onChange: (a) => de(a.target.value),
1757
1763
  className: "w-full h-[36px] pl-9 pr-4 py-3 text-sm border border-gray-300 dark:border-gray-600 rounded-md bg-gray-50 dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-300 dark:ring-blue-200 disabled:opacity-50"
1758
1764
  }
1759
1765
  )
1760
1766
  ] }) }),
1761
- v && b.enabled && /* @__PURE__ */ c(ee, { onClick: () => U(!0), variant: "contained", children: [
1762
- /* @__PURE__ */ e(He, { className: "w-4 h-4 mr-2" }),
1767
+ w && p.enabled && /* @__PURE__ */ h(Z, { onClick: () => E(!0), variant: "contained", children: [
1768
+ /* @__PURE__ */ e(We, { className: "w-4 h-4 mr-2" }),
1763
1769
  "Filters"
1764
1770
  ] })
1765
1771
  ] })
1766
1772
  ] })
1767
1773
  ] }),
1768
- /* @__PURE__ */ c("div", { className: "bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden border border-gray-200 dark:border-gray-700", children: [
1769
- /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ c("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [
1770
- /* @__PURE__ */ e("thead", { className: "bg-gray-50 dark:bg-gray-700/60", children: /* @__PURE__ */ e("tr", { children: p.map((r) => /* @__PURE__ */ e(
1774
+ /* @__PURE__ */ h("div", { className: "bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden border border-gray-200 dark:border-gray-700", children: [
1775
+ /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ h("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [
1776
+ /* @__PURE__ */ e("thead", { className: "bg-gray-50 dark:bg-gray-700/60", children: /* @__PURE__ */ e("tr", { children: g.map((a) => /* @__PURE__ */ e(
1771
1777
  "th",
1772
1778
  {
1773
- className: `px-6 py-4 text-left text-xs font-medium text-black dark:text-white uppercase tracking-wider min-w-max max-w-[180px] truncate ${r.headClass || ""}`,
1774
- children: r.title
1779
+ className: `px-6 py-4 text-left text-xs font-medium text-black dark:text-white uppercase tracking-wider min-w-max max-w-[180px] truncate ${a.headClass || ""}`,
1780
+ children: a.title
1775
1781
  },
1776
- r.key
1782
+ a.key
1777
1783
  )) }) }),
1778
- /* @__PURE__ */ e("tbody", { className: "bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700", children: X.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
1784
+ /* @__PURE__ */ e("tbody", { className: "bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700", children: ie.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
1779
1785
  "td",
1780
1786
  {
1781
- colSpan: p.length,
1787
+ colSpan: g.length,
1782
1788
  className: "text-center py-10 text-gray-500 dark:text-gray-400",
1783
- children: h
1789
+ children: u
1784
1790
  }
1785
- ) }) : X.map((r, f) => /* @__PURE__ */ e(
1791
+ ) }) : ie.map((a, n) => /* @__PURE__ */ e(
1786
1792
  "tr",
1787
1793
  {
1788
- className: "hover:bg-gray-50 dark:hover:bg-blue-800/10 transition",
1789
- children: p.map((P) => /* @__PURE__ */ e(
1794
+ className: `hover:bg-gray-50 dark:hover:bg-blue-800/10 transition ${le() ? "cursor-pointer" : ""}`,
1795
+ onClick: (f) => {
1796
+ le() && ye(a);
1797
+ },
1798
+ children: g.map((f) => /* @__PURE__ */ e(
1790
1799
  "td",
1791
1800
  {
1792
- className: `px-6 py-4 text-sm text-gray-900 dark:text-gray-100 min-w-max ${P.type == "audio" ? "" : "max-w-[300px]"} truncate ${ye(P) ? "cursor-pointer" : ""}`,
1793
- title: String(r[P.key] ?? ""),
1794
- onClick: () => fe(P, r),
1795
- children: P.render ? P.render(r, f) : me(P, r, f)
1801
+ className: `px-6 py-4 text-sm text-gray-900 dark:text-gray-100 min-w-max ${f.type == "audio" ? "" : "max-w-[300px]"} truncate ${oe(f) ? "cursor-pointer" : ""}`,
1802
+ title: String(a[f.key] ?? ""),
1803
+ onClick: (N) => {
1804
+ oe(f) && (N.stopPropagation(), N.preventDefault(), xe(f, a));
1805
+ },
1806
+ children: f.render ? f.render(a, n) : fe(f, a, n)
1796
1807
  },
1797
- P.key
1808
+ f.key
1798
1809
  ))
1799
1810
  },
1800
- r.id || r._id || f
1811
+ a.id || a._id || n
1801
1812
  )) })
1802
1813
  ] }) }),
1803
- (n == null ? void 0 : n.enabled) && j.length > 0 && /* @__PURE__ */ c("div", { className: " bg-gray-50 dark:bg-gray-700/60 px-6 py-3 flex flex-wrap items-center justify-between border-t border-gray-200 dark:border-gray-600 gap-3", children: [
1804
- /* @__PURE__ */ c("div", { className: "text-sm text-gray-700 dark:text-gray-300", children: [
1814
+ (l == null ? void 0 : l.enabled) && D.length > 0 && /* @__PURE__ */ h("div", { className: " bg-gray-50 dark:bg-gray-700/60 px-6 py-3 flex flex-wrap items-center justify-between border-t border-gray-200 dark:border-gray-600 gap-3", children: [
1815
+ /* @__PURE__ */ h("div", { className: "text-sm text-gray-700 dark:text-gray-300", children: [
1805
1816
  "Showing ",
1806
- (O - 1) * q + 1,
1817
+ (U - 1) * x + 1,
1807
1818
  " to",
1808
1819
  " ",
1809
- Math.min(O * q, H),
1820
+ Math.min(U * x, J),
1810
1821
  " of ",
1811
- H,
1822
+ J,
1812
1823
  " ",
1813
1824
  "results"
1814
1825
  ] }),
1815
- /* @__PURE__ */ c("div", { className: "flex items-center gap-4", children: [
1816
- /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
1826
+ /* @__PURE__ */ h("div", { className: "flex items-center gap-4", children: [
1827
+ /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1817
1828
  /* @__PURE__ */ e("span", { className: "text-sm text-gray-700 dark:text-gray-300", children: "Rows per page:" }),
1818
1829
  /* @__PURE__ */ e(
1819
1830
  "select",
1820
1831
  {
1821
- value: q,
1822
- onChange: (r) => {
1823
- const f = Number(r.target.value);
1824
- N(f), Y(1), n.useServerSidePagination && x((P) => ({
1825
- ...P,
1832
+ value: x,
1833
+ onChange: (a) => {
1834
+ const n = Number(a.target.value);
1835
+ H(n), V(1), l.useServerSidePagination && v((f) => ({
1836
+ ...f,
1826
1837
  current_page: 1,
1827
- rows_per_page: f
1838
+ rows_per_page: n
1828
1839
  }));
1829
1840
  },
1830
1841
  className: "border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-sm rounded-md px-2 py-1 focus:outline-none focus:ring-1 focus:ring-blue-500",
1831
- children: [2, 10, 25, 50, 100].map((r) => /* @__PURE__ */ e("option", { value: r, children: r }, r))
1842
+ children: [2, 10, 25, 50, 100].map((a) => /* @__PURE__ */ e("option", { value: a, children: a }, a))
1832
1843
  }
1833
1844
  )
1834
1845
  ] }),
1835
- /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
1846
+ /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1836
1847
  /* @__PURE__ */ e(
1837
1848
  "button",
1838
1849
  {
1839
1850
  onClick: () => {
1840
- if (O > 1) {
1841
- const r = O - 1;
1842
- Y(r), n.useServerSidePagination && x((f) => ({
1843
- ...f,
1844
- current_page: r
1851
+ if (U > 1) {
1852
+ const a = U - 1;
1853
+ V(a), l.useServerSidePagination && v((n) => ({
1854
+ ...n,
1855
+ current_page: a
1845
1856
  }));
1846
1857
  }
1847
1858
  },
1848
- disabled: O === 1,
1859
+ disabled: U === 1,
1849
1860
  className: "p-2 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-md transition text-gray-500 dark:text-gray-300 disabled:opacity-50",
1850
- children: /* @__PURE__ */ e(Ye, { className: "h-4 w-4" })
1861
+ children: /* @__PURE__ */ e(qe, { className: "h-4 w-4" })
1851
1862
  }
1852
1863
  ),
1853
- /* @__PURE__ */ c("span", { className: "text-sm text-gray-800 dark:text-gray-200", children: [
1864
+ /* @__PURE__ */ h("span", { className: "text-sm text-gray-800 dark:text-gray-200", children: [
1854
1865
  "Page ",
1855
- O,
1866
+ U,
1856
1867
  " of ",
1857
- J
1868
+ W
1858
1869
  ] }),
1859
1870
  /* @__PURE__ */ e(
1860
1871
  "button",
1861
1872
  {
1862
1873
  onClick: () => {
1863
- if (O < J) {
1864
- const r = O + 1;
1865
- Y(r), n.useServerSidePagination && x((f) => ({
1866
- ...f,
1867
- current_page: r
1874
+ if (U < W) {
1875
+ const a = U + 1;
1876
+ V(a), l.useServerSidePagination && v((n) => ({
1877
+ ...n,
1878
+ current_page: a
1868
1879
  }));
1869
1880
  }
1870
1881
  },
1871
- disabled: O === J,
1882
+ disabled: U === W,
1872
1883
  className: "p-2 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-md transition text-gray-500 dark:text-gray-300 disabled:opacity-50",
1873
- children: /* @__PURE__ */ e(Ve, { className: "h-4 w-4" })
1884
+ children: /* @__PURE__ */ e(Ze, { className: "h-4 w-4" })
1874
1885
  }
1875
1886
  )
1876
1887
  ] })
1877
1888
  ] })
1878
1889
  ] })
1879
1890
  ] }),
1880
- I && Ze(
1891
+ A && Xe(
1881
1892
  /* @__PURE__ */ e(
1882
1893
  "div",
1883
1894
  {
1884
- ref: ne,
1895
+ ref: te,
1885
1896
  style: {
1886
1897
  position: "fixed",
1887
- top: `${B.top}px`,
1888
- left: `${B.left}px`,
1898
+ top: `${T.top}px`,
1899
+ left: `${T.left}px`,
1889
1900
  zIndex: 9999
1890
1901
  },
1891
1902
  className: "w-48 bg-white dark:bg-gray-700 rounded-md shadow-lg border border-gray-200 dark:border-gray-600",
1892
- children: C.map((r, f) => /* @__PURE__ */ c(
1903
+ children: O.map((a, n) => /* @__PURE__ */ h(
1893
1904
  "button",
1894
1905
  {
1895
- onClick: (P) => de(
1896
- r,
1906
+ onClick: (f) => ce(
1907
+ a,
1897
1908
  t.find(
1898
- (_) => _.id === I || _._id == I
1909
+ (N) => N.id === A || N._id == A
1899
1910
  ),
1900
- P
1911
+ f
1901
1912
  ),
1902
- className: `w-full flex items-center gap-2 px-4 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-gray-600 ${r.variant === "danger" ? "text-red-600 dark:text-red-500" : "text-gray-700 dark:text-gray-200"}`,
1913
+ className: `w-full flex items-center gap-2 px-4 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-gray-600 ${a.variant === "danger" ? "text-red-600 dark:text-red-500" : "text-gray-700 dark:text-gray-200"}`,
1903
1914
  children: [
1904
- r.icon && /* @__PURE__ */ e("span", { className: "shrink-0", children: r.icon }),
1905
- r.title
1915
+ a.icon && /* @__PURE__ */ e("span", { className: "shrink-0", children: a.icon }),
1916
+ a.title
1906
1917
  ]
1907
1918
  },
1908
- f
1919
+ n
1909
1920
  ))
1910
1921
  }
1911
1922
  ),
1912
1923
  document.body
1913
1924
  ),
1914
- v && /* @__PURE__ */ e(
1915
- ia,
1925
+ w && /* @__PURE__ */ e(
1926
+ ca,
1916
1927
  {
1917
- isOpen: R,
1918
- onClose: () => U(!1),
1919
- config: v,
1920
- onApply: d
1928
+ isOpen: B,
1929
+ onClose: () => E(!1),
1930
+ config: w,
1931
+ onApply: c
1921
1932
  }
1922
1933
  ),
1923
- G && /* @__PURE__ */ e(
1924
- Ee,
1934
+ _ && /* @__PURE__ */ e(
1935
+ _e,
1925
1936
  {
1926
- src: $.src,
1927
- alt: $.alt,
1928
- isOpen: G,
1929
- setIsOpen: K
1937
+ src: Y.src,
1938
+ alt: Y.alt,
1939
+ isOpen: _,
1940
+ setIsOpen: z
1930
1941
  }
1931
1942
  )
1932
1943
  ] });
1933
- }, ve = ({
1934
- isOpen: u,
1935
- onClose: l,
1936
- icon: i,
1937
- title: o,
1938
- children: s,
1944
+ }, ke = ({
1945
+ isOpen: b,
1946
+ onClose: o,
1947
+ icon: s,
1948
+ title: i,
1949
+ children: d,
1939
1950
  size: t = "md",
1940
- actionButtons: p = [],
1941
- actions: k,
1942
- showDefaultClose: w = !0,
1943
- footerConfig: b = null,
1944
- hideFooter: n = !1,
1945
- onFormSubmit: h = () => {
1951
+ actionButtons: g = [],
1952
+ actions: M,
1953
+ showDefaultClose: S = !0,
1954
+ footerConfig: p = null,
1955
+ hideFooter: l = !1,
1956
+ onFormSubmit: u = () => {
1946
1957
  },
1947
- onCancel: g,
1948
- loadingBtn: x = !1,
1949
- executeFunction: d = () => {
1958
+ onCancel: m,
1959
+ loadingBtn: v = !1,
1960
+ executeFunction: c = () => {
1950
1961
  },
1951
- selectedItem: v = null
1962
+ selectedItem: w = null
1952
1963
  }) => {
1953
- if (!u) return null;
1964
+ if (!b) return null;
1954
1965
  const y = {
1955
1966
  sm: "max-w-md",
1956
1967
  md: "max-w-lg",
@@ -1958,288 +1969,288 @@ const na = ({
1958
1969
  xl: "max-w-4xl",
1959
1970
  full: "max-w-full"
1960
1971
  };
1961
- return /* @__PURE__ */ c("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
1972
+ return /* @__PURE__ */ h("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
1962
1973
  /* @__PURE__ */ e(
1963
1974
  "div",
1964
1975
  {
1965
1976
  className: "fixed inset-0 bg-gray-500 opacity-75",
1966
- onClick: () => l()
1977
+ onClick: () => o()
1967
1978
  }
1968
1979
  ),
1969
- /* @__PURE__ */ c(
1980
+ /* @__PURE__ */ h(
1970
1981
  "div",
1971
1982
  {
1972
1983
  className: `relative bg-white rounded-lg shadow-xl w-full ${y[t] || y.md} max-h-[90vh] flex flex-col dark:bg-gray-800`,
1973
1984
  children: [
1974
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0", children: [
1975
- /* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
1976
- i && /* @__PURE__ */ e("span", { children: i }),
1977
- /* @__PURE__ */ e("h3", { className: "text-lg font-medium text-gray-900 dark:text-white", children: o })
1985
+ /* @__PURE__ */ h("div", { className: "flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0", children: [
1986
+ /* @__PURE__ */ h("div", { className: "flex items-center gap-1", children: [
1987
+ s && /* @__PURE__ */ e("span", { children: s }),
1988
+ /* @__PURE__ */ e("h3", { className: "text-lg font-medium text-gray-900 dark:text-white", children: i })
1978
1989
  ] }),
1979
1990
  /* @__PURE__ */ e(
1980
1991
  "button",
1981
1992
  {
1982
- onClick: () => l(),
1993
+ onClick: () => o(),
1983
1994
  className: "text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",
1984
- children: /* @__PURE__ */ e(we, { className: "w-6 h-6" })
1995
+ children: /* @__PURE__ */ e(Ne, { className: "w-6 h-6" })
1985
1996
  }
1986
1997
  )
1987
1998
  ] }),
1988
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children: s }),
1989
- p.length > 0 && /* @__PURE__ */ e("div", { className: "px-4 py-3 flex justify-end gap-3 border-t border-gray-200 dark:border-gray-700 sm:px-6", children: p.map((S) => /* @__PURE__ */ e(
1990
- ee,
1999
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children: d }),
2000
+ g.length > 0 && /* @__PURE__ */ e("div", { className: "px-4 py-3 flex justify-end gap-3 border-t border-gray-200 dark:border-gray-700 sm:px-6", children: g.map((k) => /* @__PURE__ */ e(
2001
+ Z,
1991
2002
  {
1992
2003
  onClick: (I) => {
1993
- S.type == "submit" ? h(I) : d(
2004
+ k.type == "submit" ? u(I) : c(
1994
2005
  () => {
1995
- var D;
1996
- return (D = S == null ? void 0 : S.onClick) == null ? void 0 : D.call(S, I, v);
2006
+ var A;
2007
+ return (A = k == null ? void 0 : k.onClick) == null ? void 0 : A.call(k, I, w);
1997
2008
  },
1998
- (D) => l == null ? void 0 : l(D)
2009
+ (A) => o == null ? void 0 : o(A)
1999
2010
  );
2000
2011
  },
2001
- disabled: x || S.disabled,
2002
- variant: S.variant || "contained",
2003
- color: S.color || "primary",
2004
- className: `min-w-[100px] ${S.className}`,
2005
- type: S.type || "button",
2006
- children: x ? /* @__PURE__ */ c("div", { className: "flex items-center", children: [
2012
+ disabled: v || k.disabled,
2013
+ variant: k.variant || "contained",
2014
+ color: k.color || "primary",
2015
+ className: `min-w-[100px] ${k.className}`,
2016
+ type: k.type || "button",
2017
+ children: v ? /* @__PURE__ */ h("div", { className: "flex items-center", children: [
2007
2018
  /* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-white/30 border-t-2 border-t-white mr-2" }),
2008
- S.label || "Submit",
2019
+ k.label || "Submit",
2009
2020
  "..."
2010
- ] }) : S.label || "Submit"
2021
+ ] }) : k.label || "Submit"
2011
2022
  }
2012
2023
  )) })
2013
2024
  ]
2014
2025
  }
2015
2026
  )
2016
2027
  ] });
2017
- }, De = ({ config: u, onSubmit: l, initialData: i = {}, type: o = "add" }) => {
2018
- const { formClass: s = "grid grid-cols-12 gap-4", formFields: t = [] } = u || {}, [p, k] = M(i);
2019
- z(() => {
2020
- k(i);
2028
+ }, Fe = ({ config: b, onSubmit: o, initialData: s = {}, type: i = "add" }) => {
2029
+ const { formClass: d = "grid grid-cols-12 gap-4", formFields: t = [] } = b || {}, [g, M] = R(s);
2030
+ K(() => {
2031
+ M(s);
2021
2032
  }, []);
2022
- const w = (n, h) => {
2023
- k((g) => ({ ...g, [n]: h }));
2024
- }, b = (n) => {
2025
- n.preventDefault();
2026
- const h = n.target;
2027
- if (!h.checkValidity()) {
2028
- h.reportValidity();
2033
+ const S = (l, u) => {
2034
+ M((m) => ({ ...m, [l]: u }));
2035
+ }, p = (l) => {
2036
+ l.preventDefault();
2037
+ const u = l.target;
2038
+ if (!u.checkValidity()) {
2039
+ u.reportValidity();
2029
2040
  return;
2030
2041
  }
2031
- l(p);
2042
+ o(g);
2032
2043
  };
2033
2044
  return /* @__PURE__ */ e(
2034
2045
  "form",
2035
2046
  {
2036
- id: o == "add" ? "addForm" : o == "edit" ? "editForm" : "defaultForm",
2037
- onSubmit: b,
2038
- className: s,
2047
+ id: i == "add" ? "addForm" : i == "edit" ? "editForm" : "defaultForm",
2048
+ onSubmit: p,
2049
+ className: d,
2039
2050
  noValidate: !1,
2040
- children: t.map((n) => /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
2041
- Ue,
2051
+ children: t.map((l) => /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(
2052
+ $e,
2042
2053
  {
2043
- field: n,
2044
- formData: p,
2045
- handleChange: w
2054
+ field: l,
2055
+ formData: g,
2056
+ handleChange: S
2046
2057
  },
2047
- n.key
2058
+ l.key
2048
2059
  ) }))
2049
2060
  }
2050
2061
  );
2051
2062
  };
2052
- function ca({ data: u, config: l }) {
2053
- const { fields: i, containerClass: o } = l, [s, t] = M(null), [p, k] = M(!1), w = (h) => {
2054
- h && h.src instanceof File && (h = { ...h, src: URL.createObjectURL(h.src) }), t(h), k(!0);
2055
- }, b = ({ col: h }) => {
2063
+ function ba({ data: b, config: o }) {
2064
+ const { fields: s, containerClass: i } = o, [d, t] = R(null), [g, M] = R(!1), S = (u) => {
2065
+ u && u.src instanceof File && (u = { ...u, src: URL.createObjectURL(u.src) }), t(u), M(!0);
2066
+ }, p = ({ col: u }) => {
2056
2067
  var I;
2057
- let g = h == null ? void 0 : h.icon, x = h.label, d = u[h.key], v = h.type, y = h.variant || "outline", S = h.defaultColor;
2058
- if (v === "chip" && ((I = h.chipOptions) == null ? void 0 : I.length) > 0) {
2059
- let D = h == null ? void 0 : h.chipOptions.find((C) => C.value == d);
2060
- D && (d = D.label, S = D.color);
2068
+ let m = u == null ? void 0 : u.icon, v = u.label, c = b[u.key], w = u.type, y = u.variant || "outline", k = u.defaultColor;
2069
+ if (w === "chip" && ((I = u.chipOptions) == null ? void 0 : I.length) > 0) {
2070
+ let A = u == null ? void 0 : u.chipOptions.find((C) => C.value == c);
2071
+ A && (c = A.label, k = A.color);
2061
2072
  }
2062
- return /* @__PURE__ */ c(
2073
+ return /* @__PURE__ */ h(
2063
2074
  "div",
2064
2075
  {
2065
2076
  className: `col-span-12 flex items-center space-x-4 p-4 rounded-xl
2066
- bg-gray-100 dark:bg-gray-900 ${h.blockClass || ""}`,
2077
+ bg-gray-100 dark:bg-gray-900 ${u.blockClass || ""}`,
2067
2078
  children: [
2068
- g && /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: g }),
2069
- /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
2070
- /* @__PURE__ */ e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: x }),
2071
- v === "chip" ? /* @__PURE__ */ e(
2072
- je,
2079
+ m && /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: m }),
2080
+ /* @__PURE__ */ h("div", { className: "flex-1 min-w-0", children: [
2081
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: v }),
2082
+ w === "chip" ? /* @__PURE__ */ e(
2083
+ Ge,
2073
2084
  {
2074
- label: d,
2085
+ label: c,
2075
2086
  variant: y,
2076
- color: S,
2087
+ color: k,
2077
2088
  className: "mt-1"
2078
2089
  }
2079
2090
  ) : (
2080
2091
  /* TINY EDITOR */
2081
- v === "tinyEditor" ? /* @__PURE__ */ e(
2092
+ w === "tinyEditor" ? /* @__PURE__ */ e(
2082
2093
  "p",
2083
2094
  {
2084
2095
  className: "mt-1 text-sm text-gray-900 dark:text-white break-words",
2085
2096
  dangerouslySetInnerHTML: {
2086
- __html: d
2097
+ __html: c
2087
2098
  }
2088
2099
  }
2089
- ) : v === "audio" ? d ? /* @__PURE__ */ e(
2100
+ ) : w === "audio" ? c ? /* @__PURE__ */ e(
2090
2101
  "audio",
2091
2102
  {
2092
2103
  controls: !0,
2093
- src: d instanceof File ? URL.createObjectURL(d) : d,
2094
- onClick: (D) => D.stopPropagation(),
2104
+ src: c instanceof File ? URL.createObjectURL(c) : c,
2105
+ onClick: (A) => A.stopPropagation(),
2095
2106
  className: "shadow-md rounded-full"
2096
2107
  },
2097
- d instanceof File ? URL.createObjectURL(d) : d
2108
+ c instanceof File ? URL.createObjectURL(c) : c
2098
2109
  ) : /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-400", children: "N/A" }) : (
2099
2110
  /* DEFAULT */
2100
- /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-900 dark:text-white break-words", children: v == "date" ? /* @__PURE__ */ e("span", { children: Pe(d, h.format || "DD MMM YYYY") }) : d || "N/A" })
2111
+ /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-900 dark:text-white break-words", children: w == "date" ? /* @__PURE__ */ e("span", { children: Ue(c, u.format || "DD MMM YYYY") }) : c || "N/A" })
2101
2112
  )
2102
2113
  )
2103
2114
  ] })
2104
2115
  ]
2105
2116
  }
2106
2117
  );
2107
- }, n = ({ col: h }) => {
2108
- let g = u[h.titleKey], x = u[h.subtitleKey], d = u[h.imageKey], v = u[h.fallback_icon];
2109
- return /* @__PURE__ */ c(
2118
+ }, l = ({ col: u }) => {
2119
+ let m = b[u.titleKey], v = b[u.subtitleKey], c = b[u.imageKey], w = b[u.fallback_icon];
2120
+ return /* @__PURE__ */ h(
2110
2121
  "div",
2111
2122
  {
2112
2123
  className: `col-span-12 flex items-center space-x-4 p-4 rounded-xl
2113
2124
  bg-gray-100 dark:bg-gray-900
2114
- ${h.blockClass}`,
2125
+ ${u.blockClass}`,
2115
2126
  children: [
2116
- d ? /* @__PURE__ */ e(
2127
+ c ? /* @__PURE__ */ e(
2117
2128
  "img",
2118
2129
  {
2119
- src: d instanceof File ? URL.createObjectURL(d) : d,
2120
- alt: g,
2121
- onClick: () => w({ src: d, alt: g }),
2130
+ src: c instanceof File ? URL.createObjectURL(c) : c,
2131
+ alt: m,
2132
+ onClick: () => S({ src: c, alt: m }),
2122
2133
  className: "w-16 h-16 cursor-pointer rounded-full object-cover border-2 border-gray-200 dark:border-gray-700"
2123
2134
  }
2124
- ) : v || /* @__PURE__ */ e("div", { className: "w-16 h-16 flex items-center justify-center rounded-full border-2 border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600", children: /* @__PURE__ */ e(Fe, { className: "w-8 h-8 text-gray-400" }) }),
2125
- /* @__PURE__ */ c("div", { children: [
2126
- /* @__PURE__ */ e("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white", children: g }),
2127
- /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: x })
2135
+ ) : w || /* @__PURE__ */ e("div", { className: "w-16 h-16 flex items-center justify-center rounded-full border-2 border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600", children: /* @__PURE__ */ e(Be, { className: "w-8 h-8 text-gray-400" }) }),
2136
+ /* @__PURE__ */ h("div", { children: [
2137
+ /* @__PURE__ */ e("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white", children: m }),
2138
+ /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: v })
2128
2139
  ] })
2129
2140
  ]
2130
2141
  }
2131
2142
  );
2132
2143
  };
2133
- return /* @__PURE__ */ c(E, { children: [
2134
- p && /* @__PURE__ */ e(
2135
- Ee,
2144
+ return /* @__PURE__ */ h(j, { children: [
2145
+ g && /* @__PURE__ */ e(
2146
+ _e,
2136
2147
  {
2137
- src: s.src,
2138
- alt: s.alt,
2139
- isOpen: p,
2140
- setIsOpen: k
2148
+ src: d.src,
2149
+ alt: d.alt,
2150
+ isOpen: g,
2151
+ setIsOpen: M
2141
2152
  }
2142
2153
  ),
2143
- /* @__PURE__ */ e("div", { className: `grid grid-cols-12 gap-4 ${o || ""}`, children: i.map(
2144
- (h) => h.type == "group" ? /* @__PURE__ */ e(n, { col: h }) : /* @__PURE__ */ e(b, { col: h })
2154
+ /* @__PURE__ */ e("div", { className: `grid grid-cols-12 gap-4 ${i || ""}`, children: s.map(
2155
+ (u) => u.type == "group" ? /* @__PURE__ */ e(l, { col: u }) : /* @__PURE__ */ e(p, { col: u })
2145
2156
  ) })
2146
2157
  ] });
2147
2158
  }
2148
- const $e = ({ config: u }) => {
2149
- var se, de, ce, he, ue, oe, be, pe, ge, me, fe, ye, r, f, P, _;
2159
+ const Ke = ({ config: b }) => {
2160
+ var ae, de, ce, he, ue, be, ne, pe, ge, me, fe, ye, xe, le, oe, a;
2150
2161
  const {
2151
- title: l,
2152
- fetchData: i = async () => {
2162
+ title: o,
2163
+ fetchData: s = async () => {
2153
2164
  },
2154
- isStaticData: o = !1,
2155
- tableConfig: s = {},
2165
+ isStaticData: i = !1,
2166
+ tableConfig: d = {},
2156
2167
  modalConfig: t = {},
2157
- filterConfig: p
2158
- } = u, [k, w] = M(!0), [b, n] = M(!1), [h, g] = M([]), [x, d] = M(null), [v, y] = M({
2168
+ filterConfig: g
2169
+ } = b, [M, S] = R(!0), [p, l] = R(!1), [u, m] = R([]), [v, c] = R(null), [w, y] = R({
2159
2170
  search: "",
2160
2171
  rows_per_page: 50,
2161
2172
  current_page: 1
2162
- }), [S, I] = M({}), [D, C] = M(!1), [A, B] = M(!1), [F, R] = M(!1), [U, $] = M(!1), [W, G] = M(!1), [K, j] = M(null), O = (m, L) => {
2163
- m === "edit" ? (j(L), R(!0)) : m === "view" ? (j(L), G(!0)) : m === "delete" && (j(L), $(!0));
2164
- }, Y = async (m, L, T = "", Z = "") => {
2165
- n(!0);
2173
+ }), [k, I] = R({}), [A, C] = R(!1), [O, F] = R(!1), [T, L] = R(!1), [B, E] = R(!1), [Y, $] = R(!1), [_, z] = R(null), D = (n, f) => {
2174
+ n === "edit" ? (z(f), L(!0)) : n === "view" ? (z(f), $(!0)) : n === "delete" && (z(f), E(!0));
2175
+ }, U = async (n, f, N = "", P = "") => {
2176
+ l(!0);
2166
2177
  try {
2167
- const V = await (m == null ? void 0 : m());
2168
- (T || V.message) && ke(T || V.message, {
2178
+ const G = await (n == null ? void 0 : n());
2179
+ (N || G.message) && Se(N || G.message, {
2169
2180
  variant: "success"
2170
- }), L == null || L(V);
2171
- } catch (V) {
2172
- (Z || V.message) && ke(Z || V.message, { variant: "error" });
2181
+ }), f == null || f(G);
2182
+ } catch (G) {
2183
+ (P || G.message) && Se(P || G.message, { variant: "error" });
2173
2184
  } finally {
2174
- n(!1);
2185
+ l(!1);
2175
2186
  }
2176
- }, q = (m) => {
2177
- let L = m.newObject;
2178
- o ? (g((T) => [L, ...T]), d((T) => ({
2179
- ...T,
2187
+ }, V = (n) => {
2188
+ let f = n.newObject;
2189
+ i ? (m((N) => [f, ...N]), c((N) => ({
2190
+ ...N,
2180
2191
  current_page: 1
2181
- }))) : (y((T) => ({
2182
- ...T,
2192
+ }))) : (y((N) => ({
2193
+ ...N,
2183
2194
  current_page: 1
2184
- })), v.current_page == 1 && X()), B(!1);
2185
- }, N = (m) => {
2186
- let L = m.newObject, T = m.targetObject;
2187
- o ? g(
2188
- (Z) => Z.map(
2189
- (V) => V.id === T.id ? { ...V, ...L } : V
2195
+ })), w.current_page == 1 && W()), F(!1);
2196
+ }, x = (n) => {
2197
+ let f = n.newObject, N = n.targetObject;
2198
+ i ? m(
2199
+ (P) => P.map(
2200
+ (G) => G.id === N.id ? { ...G, ...f } : G
2190
2201
  )
2191
- ) : X(), R(!1);
2192
- }, H = (m) => {
2193
- if (!m) {
2194
- $(!1), j(null);
2202
+ ) : W(), L(!1);
2203
+ }, H = (n) => {
2204
+ if (!n) {
2205
+ E(!1), z(null);
2195
2206
  return;
2196
2207
  }
2197
- o ? g(
2198
- (L) => L.filter((T) => T.id !== m.targetObject.id)
2199
- ) : h.length == 1 && v.current_page > 1 ? y((L) => ({
2200
- ...L,
2201
- current_page: L.current_page - 1
2202
- })) : X(), $(!1), j(null);
2203
- }, re = (m) => Y(
2208
+ i ? m(
2209
+ (f) => f.filter((N) => N.id !== n.targetObject.id)
2210
+ ) : u.length == 1 && w.current_page > 1 ? y((f) => ({
2211
+ ...f,
2212
+ current_page: f.current_page - 1
2213
+ })) : W(), E(!1), z(null);
2214
+ }, J = (n) => U(
2204
2215
  () => {
2205
- var L, T;
2206
- return (T = (L = t == null ? void 0 : t.addModal) == null ? void 0 : L.handleSubmit) == null ? void 0 : T.call(L, m);
2216
+ var f, N;
2217
+ return (N = (f = t == null ? void 0 : t.addModal) == null ? void 0 : f.handleSubmit) == null ? void 0 : N.call(f, n);
2207
2218
  },
2208
- q
2209
- ), J = (m) => Y(
2219
+ V
2220
+ ), Q = (n) => U(
2210
2221
  () => {
2211
- var L, T;
2212
- return (T = (L = t == null ? void 0 : t.editModal) == null ? void 0 : L.handleSubmit) == null ? void 0 : T.call(L, m, K);
2222
+ var f, N;
2223
+ return (N = (f = t == null ? void 0 : t.editModal) == null ? void 0 : f.handleSubmit) == null ? void 0 : N.call(f, n, _);
2213
2224
  },
2214
- N
2215
- ), X = async () => {
2216
- w(!0), i == null || i({ ...v, ...S }).then((m) => {
2217
- g(m.data), d(m.pagination);
2218
- }).catch((m) => {
2219
- ke(m.message, { variant: "error" });
2225
+ x
2226
+ ), W = async () => {
2227
+ S(!0), s == null || s({ ...w, ...k }).then((n) => {
2228
+ m(n.data), c(n.pagination);
2229
+ }).catch((n) => {
2230
+ Se(n.message, { variant: "error" });
2220
2231
  }).finally(() => {
2221
- w(!1);
2232
+ S(!1);
2222
2233
  });
2223
- }, ne = (m) => {
2224
- var L;
2225
- I((T) => ({
2226
- ...m
2227
- })), (L = s == null ? void 0 : s.filter) != null && L.useServerSideFilters && C((T) => !T);
2228
- }, ie = (m, L) => m.filter(
2229
- (T) => Object.entries(L).every(([Z, V]) => T[Z] === V)
2230
- ), le = Me(() => {
2231
- var m;
2232
- return (m = s == null ? void 0 : s.filter) != null && m.useServerSideFilters ? h : ie(h, S);
2233
- }, [h, S]);
2234
- return z(() => {
2235
- X();
2234
+ }, ie = (n) => {
2235
+ var f;
2236
+ I((N) => ({
2237
+ ...n
2238
+ })), (f = d == null ? void 0 : d.filter) != null && f.useServerSideFilters && C((N) => !N);
2239
+ }, te = (n, f) => n.filter(
2240
+ (N) => Object.entries(f).every(([P, G]) => N[P] === G)
2241
+ ), se = Re(() => {
2242
+ var n;
2243
+ return (n = d == null ? void 0 : d.filter) != null && n.useServerSideFilters ? u : te(u, k);
2244
+ }, [u, k]);
2245
+ return K(() => {
2246
+ W();
2236
2247
  }, [
2237
- v.search,
2238
- v.rows_per_page,
2239
- v.current_page,
2240
- D
2248
+ w.search,
2249
+ w.rows_per_page,
2250
+ w.current_page,
2251
+ A
2241
2252
  ]), /* @__PURE__ */ e(
2242
- Qe,
2253
+ aa,
2243
2254
  {
2244
2255
  maxSnack: 3,
2245
2256
  anchorOrigin: {
@@ -2247,132 +2258,132 @@ const $e = ({ config: u }) => {
2247
2258
  horizontal: "right"
2248
2259
  },
2249
2260
  autoHideDuration: 3e3,
2250
- action: (m) => /* @__PURE__ */ e(
2261
+ action: (n) => /* @__PURE__ */ e(
2251
2262
  "button",
2252
2263
  {
2253
2264
  onClick: () => {
2254
2265
  window.dispatchEvent(
2255
- new CustomEvent("closeSnackbar", { detail: m })
2266
+ new CustomEvent("closeSnackbar", { detail: n })
2256
2267
  );
2257
2268
  },
2258
2269
  className: "p-1 hover:bg-white/20 rounded-full transition-colors duration-200 text-white flex items-center justify-center",
2259
- children: /* @__PURE__ */ e(we, { className: "h-4 w-4" })
2270
+ children: /* @__PURE__ */ e(Ne, { className: "h-4 w-4" })
2260
2271
  }
2261
2272
  ),
2262
- children: /* @__PURE__ */ c("div", { children: [
2273
+ children: /* @__PURE__ */ h("div", { children: [
2263
2274
  /* @__PURE__ */ e(
2264
- da,
2275
+ ua,
2265
2276
  {
2266
- title: l,
2267
- setShowAdd: B,
2268
- description: u.description,
2269
- buttonText: u.buttonText,
2277
+ title: o,
2278
+ setShowAdd: F,
2279
+ description: b.description,
2280
+ buttonText: b.buttonText,
2270
2281
  config: {
2271
- ...s,
2282
+ ...d,
2272
2283
  pagination: {
2273
- ...s.pagination,
2274
- ...x
2284
+ ...d.pagination,
2285
+ ...v
2275
2286
  },
2276
- data: le,
2287
+ data: se,
2277
2288
  setServerSidePaginationData: y,
2278
- onMenuAction: O,
2279
- filterConfig: p,
2280
- onFilterApply: ne,
2281
- loading: k
2289
+ onMenuAction: D,
2290
+ filterConfig: g,
2291
+ onFilterApply: ie,
2292
+ loading: M
2282
2293
  }
2283
2294
  }
2284
2295
  ),
2285
2296
  /* @__PURE__ */ e(
2286
- ve,
2297
+ ke,
2287
2298
  {
2288
- isOpen: A,
2299
+ isOpen: O,
2289
2300
  onClose: () => {
2290
- b || B(!1);
2301
+ p || F(!1);
2291
2302
  },
2292
- icon: (se = t.addModal) == null ? void 0 : se.icon,
2303
+ icon: (ae = t.addModal) == null ? void 0 : ae.icon,
2293
2304
  title: ((de = t.addModal) == null ? void 0 : de.title) || "Add New",
2294
2305
  size: ((ce = t.addModal) == null ? void 0 : ce.size) || "md",
2295
2306
  onFormSubmit: () => {
2296
- var m;
2297
- return (m = document.querySelector("#addForm")) == null ? void 0 : m.requestSubmit();
2307
+ var n;
2308
+ return (n = document.querySelector("#addForm")) == null ? void 0 : n.requestSubmit();
2298
2309
  },
2299
- loadingBtn: b,
2310
+ loadingBtn: p,
2300
2311
  actionButtons: t.addModal.actionButtons,
2301
2312
  children: /* @__PURE__ */ e(
2302
- De,
2313
+ Fe,
2303
2314
  {
2304
2315
  config: (t == null ? void 0 : t.addModal) || [],
2305
- onSubmit: re,
2316
+ onSubmit: J,
2306
2317
  initialData: {},
2307
2318
  type: "add",
2308
- loading: b
2319
+ loading: p
2309
2320
  }
2310
2321
  )
2311
2322
  }
2312
2323
  ),
2313
2324
  /* @__PURE__ */ e(
2314
- ve,
2325
+ ke,
2315
2326
  {
2316
- isOpen: F,
2327
+ isOpen: T,
2317
2328
  onClose: () => {
2318
- b || R(!1);
2329
+ p || L(!1);
2319
2330
  },
2320
2331
  icon: (he = t.editModal) == null ? void 0 : he.icon,
2321
2332
  title: ((ue = t.editModal) == null ? void 0 : ue.title) || "Edit",
2322
- size: ((oe = t.editModal) == null ? void 0 : oe.size) || "md",
2333
+ size: ((be = t.editModal) == null ? void 0 : be.size) || "md",
2323
2334
  onFormSubmit: () => {
2324
- var m;
2325
- return (m = document.querySelector("#editForm")) == null ? void 0 : m.requestSubmit();
2335
+ var n;
2336
+ return (n = document.querySelector("#editForm")) == null ? void 0 : n.requestSubmit();
2326
2337
  },
2327
2338
  actionButtons: t.editModal.actionButtons,
2328
- loadingBtn: b,
2339
+ loadingBtn: p,
2329
2340
  children: /* @__PURE__ */ e(
2330
- De,
2341
+ Fe,
2331
2342
  {
2332
2343
  config: t.editModal || [],
2333
- onSubmit: J,
2334
- initialData: K,
2344
+ onSubmit: Q,
2345
+ initialData: _,
2335
2346
  type: "edit",
2336
- loading: b
2347
+ loading: p
2337
2348
  }
2338
2349
  )
2339
2350
  }
2340
2351
  ),
2341
- U && /* @__PURE__ */ e(
2342
- ve,
2352
+ B && /* @__PURE__ */ e(
2353
+ ke,
2343
2354
  {
2344
- isOpen: U,
2345
- onClose: (m) => {
2346
- H(m);
2355
+ isOpen: B,
2356
+ onClose: (n) => {
2357
+ H(n);
2347
2358
  },
2348
- icon: ((be = t.deleteModal) == null ? void 0 : be.icon) || /* @__PURE__ */ e(te, { icon: "ph:warning-bold", className: "w-6 h-6 text-red-500" }),
2359
+ icon: ((ne = t.deleteModal) == null ? void 0 : ne.icon) || /* @__PURE__ */ e(re, { icon: "ph:warning-bold", className: "w-6 h-6 text-red-500" }),
2349
2360
  title: ((pe = t.deleteModal) == null ? void 0 : pe.title) || "Confirm Delete",
2350
2361
  size: ((ge = t.deleteModal) == null ? void 0 : ge.size) || "md",
2351
- loading: b,
2362
+ loading: p,
2352
2363
  actionButtons: t.deleteModal.actionButtons,
2353
- executeFunction: Y,
2354
- selectedItem: K,
2355
- children: /* @__PURE__ */ e("div", { className: "flex items-center space-x-2 py-3", children: /* @__PURE__ */ c("div", { children: [
2364
+ executeFunction: U,
2365
+ selectedItem: _,
2366
+ children: /* @__PURE__ */ e("div", { className: "flex items-center space-x-2 py-3", children: /* @__PURE__ */ h("div", { children: [
2356
2367
  /* @__PURE__ */ e("p", { className: "text-md text-gray-700 dark:text-white", children: ((me = t.deleteModal) == null ? void 0 : me.confirmText) || "Are you sure you want to delete this item?" }),
2357
- ((fe = t.deleteModal) == null ? void 0 : fe.referenceKey) && /* @__PURE__ */ e("p", { className: "text-md font-semibold text-gray-700 dark:text-white", children: K[(ye = t.deleteModal) == null ? void 0 : ye.referenceKey] })
2368
+ ((fe = t.deleteModal) == null ? void 0 : fe.referenceKey) && /* @__PURE__ */ e("p", { className: "text-md font-semibold text-gray-700 dark:text-white", children: _[(ye = t.deleteModal) == null ? void 0 : ye.referenceKey] })
2358
2369
  ] }) })
2359
2370
  }
2360
2371
  ),
2361
2372
  t.viewModal && /* @__PURE__ */ e(
2362
- ve,
2373
+ ke,
2363
2374
  {
2364
- isOpen: W,
2375
+ isOpen: Y,
2365
2376
  onClose: () => {
2366
- G(!1), j(null);
2377
+ $(!1), z(null);
2367
2378
  },
2368
- icon: (r = t.viewModal) == null ? void 0 : r.icon,
2369
- title: ((f = t.viewModal) == null ? void 0 : f.title) || "View Details",
2370
- size: ((P = t.viewModal) == null ? void 0 : P.size) || "lg",
2379
+ icon: (xe = t.viewModal) == null ? void 0 : xe.icon,
2380
+ title: ((le = t.viewModal) == null ? void 0 : le.title) || "View Details",
2381
+ size: ((oe = t.viewModal) == null ? void 0 : oe.size) || "lg",
2371
2382
  footerConfig: t == null ? void 0 : t.viewModal.footer,
2372
- children: (_ = t.viewModal) != null && _.component ? /* @__PURE__ */ e(t.viewModal.component, { data: K }) : /* @__PURE__ */ e(
2373
- ca,
2383
+ children: (a = t.viewModal) != null && a.component ? /* @__PURE__ */ e(t.viewModal.component, { data: _ }) : /* @__PURE__ */ e(
2384
+ ba,
2374
2385
  {
2375
- data: K,
2386
+ data: _,
2376
2387
  config: t.viewModal || {}
2377
2388
  }
2378
2389
  )
@@ -2381,145 +2392,145 @@ const $e = ({ config: u }) => {
2381
2392
  ] })
2382
2393
  }
2383
2394
  );
2384
- }, Le = a.shape({
2385
- value: a.oneOfType([
2386
- a.string,
2387
- a.number,
2388
- a.bool
2395
+ }, Ae = r.shape({
2396
+ value: r.oneOfType([
2397
+ r.string,
2398
+ r.number,
2399
+ r.bool
2389
2400
  ]).isRequired,
2390
- label: a.string.isRequired,
2391
- color: a.string
2392
- }), Ne = a.shape({
2393
- type: a.string.isRequired,
2394
- label: a.string.isRequired,
2395
- color: a.string,
2396
- variant: a.string,
2397
- onClick: a.func
2398
- }), ha = a.shape({
2399
- title: a.string.isRequired,
2400
- type: a.string.isRequired,
2401
- variant: a.string,
2402
- icon: a.node
2403
- }), ua = a.shape({
2404
- key: a.string.isRequired,
2405
- title: a.string,
2406
- type: a.string,
2407
- imageKey: a.string,
2408
- titleKey: a.string,
2409
- subtitleKey: a.string,
2410
- onClickDetails: a.bool,
2411
- variant: a.string,
2412
- chipOptions: a.arrayOf(Le),
2413
- defaultColor: a.string,
2414
- className: a.string,
2415
- format: a.string,
2416
- menuList: a.arrayOf(ha)
2417
- }), Se = a.shape({
2418
- key: a.string.isRequired,
2419
- label: a.string,
2420
- type: a.string.isRequired,
2421
- required: a.bool,
2422
- minLength: a.number,
2423
- parentClass: a.string,
2424
- search: a.bool,
2425
- multiple: a.bool,
2426
- dropdownMaxHeight: a.string,
2427
- dragDrop: a.bool,
2428
- countriesList: a.bool,
2429
- defaultCountry: a.string,
2430
- placeholder: a.string,
2431
- rows: a.number,
2432
- text: a.string,
2433
- editorKey: a.string,
2434
- options: a.arrayOf(Le)
2435
- }), ba = a.shape({
2436
- key: a.string,
2437
- label: a.string,
2438
- type: a.string,
2439
- imageKey: a.string,
2440
- titleKey: a.string,
2441
- subtitleKey: a.string,
2442
- blockClass: a.string,
2443
- icon: a.node,
2444
- variant: a.string,
2445
- chipOptions: a.arrayOf(Le),
2446
- defaultColor: a.string,
2447
- className: a.string,
2448
- format: a.string
2401
+ label: r.string.isRequired,
2402
+ color: r.string
2403
+ }), Me = r.shape({
2404
+ type: r.string.isRequired,
2405
+ label: r.string.isRequired,
2406
+ color: r.string,
2407
+ variant: r.string,
2408
+ onClick: r.func
2409
+ }), pa = r.shape({
2410
+ title: r.string.isRequired,
2411
+ type: r.string.isRequired,
2412
+ variant: r.string,
2413
+ icon: r.node
2414
+ }), ga = r.shape({
2415
+ key: r.string.isRequired,
2416
+ title: r.string,
2417
+ type: r.string,
2418
+ imageKey: r.string,
2419
+ titleKey: r.string,
2420
+ subtitleKey: r.string,
2421
+ onClickDetails: r.bool,
2422
+ variant: r.string,
2423
+ chipOptions: r.arrayOf(Ae),
2424
+ defaultColor: r.string,
2425
+ className: r.string,
2426
+ format: r.string,
2427
+ menuList: r.arrayOf(pa)
2428
+ }), Ce = r.shape({
2429
+ key: r.string.isRequired,
2430
+ label: r.string,
2431
+ type: r.string.isRequired,
2432
+ required: r.bool,
2433
+ minLength: r.number,
2434
+ parentClass: r.string,
2435
+ search: r.bool,
2436
+ multiple: r.bool,
2437
+ dropdownMaxHeight: r.string,
2438
+ dragDrop: r.bool,
2439
+ countriesList: r.bool,
2440
+ defaultCountry: r.string,
2441
+ placeholder: r.string,
2442
+ rows: r.number,
2443
+ text: r.string,
2444
+ editorKey: r.string,
2445
+ options: r.arrayOf(Ae)
2446
+ }), ma = r.shape({
2447
+ key: r.string,
2448
+ label: r.string,
2449
+ type: r.string,
2450
+ imageKey: r.string,
2451
+ titleKey: r.string,
2452
+ subtitleKey: r.string,
2453
+ blockClass: r.string,
2454
+ icon: r.node,
2455
+ variant: r.string,
2456
+ chipOptions: r.arrayOf(Ae),
2457
+ defaultColor: r.string,
2458
+ className: r.string,
2459
+ format: r.string
2449
2460
  });
2450
- $e.propTypes = {
2451
- config: a.shape({
2452
- title: a.string.isRequired,
2453
- description: a.string,
2454
- buttonText: a.string,
2455
- fetchData: a.func.isRequired,
2456
- isStaticData: a.bool,
2461
+ Ke.propTypes = {
2462
+ config: r.shape({
2463
+ title: r.string.isRequired,
2464
+ description: r.string,
2465
+ buttonText: r.string,
2466
+ fetchData: r.func.isRequired,
2467
+ isStaticData: r.bool,
2457
2468
  /* ================= TABLE CONFIG ================= */
2458
- tableConfig: a.shape({
2459
- table_head: a.arrayOf(ua).isRequired,
2460
- search: a.shape({
2461
- enabled: a.bool,
2462
- useServerSideSearch: a.bool,
2463
- searchKeys: a.arrayOf(a.string)
2469
+ tableConfig: r.shape({
2470
+ table_head: r.arrayOf(ga).isRequired,
2471
+ search: r.shape({
2472
+ enabled: r.bool,
2473
+ useServerSideSearch: r.bool,
2474
+ searchKeys: r.arrayOf(r.string)
2464
2475
  }),
2465
- pagination: a.shape({
2466
- enabled: a.bool,
2467
- useServerSidePagination: a.bool
2476
+ pagination: r.shape({
2477
+ enabled: r.bool,
2478
+ useServerSidePagination: r.bool
2468
2479
  }),
2469
- filter: a.shape({
2470
- enabled: a.bool,
2471
- useServerSideFilters: a.bool
2480
+ filter: r.shape({
2481
+ enabled: r.bool,
2482
+ useServerSideFilters: r.bool
2472
2483
  })
2473
2484
  }).isRequired,
2474
2485
  /* ================= MODAL CONFIG ================= */
2475
- modalConfig: a.shape({
2476
- addModal: a.shape({
2477
- title: a.string.isRequired,
2478
- size: a.string,
2479
- formClass: a.string,
2480
- formFields: a.arrayOf(Se),
2481
- handleSubmit: a.func.isRequired,
2482
- actionButtons: a.arrayOf(Ne)
2486
+ modalConfig: r.shape({
2487
+ addModal: r.shape({
2488
+ title: r.string.isRequired,
2489
+ size: r.string,
2490
+ formClass: r.string,
2491
+ formFields: r.arrayOf(Ce),
2492
+ handleSubmit: r.func.isRequired,
2493
+ actionButtons: r.arrayOf(Me)
2483
2494
  }),
2484
- editModal: a.shape({
2485
- title: a.string.isRequired,
2486
- size: a.string,
2487
- formClass: a.string,
2488
- formFields: a.arrayOf(Se),
2489
- handleSubmit: a.func.isRequired,
2490
- actionButtons: a.arrayOf(Ne)
2495
+ editModal: r.shape({
2496
+ title: r.string.isRequired,
2497
+ size: r.string,
2498
+ formClass: r.string,
2499
+ formFields: r.arrayOf(Ce),
2500
+ handleSubmit: r.func.isRequired,
2501
+ actionButtons: r.arrayOf(Me)
2491
2502
  }),
2492
- deleteModal: a.shape({
2493
- title: a.string.isRequired,
2494
- size: a.string,
2495
- confirmText: a.string,
2496
- referenceKey: a.string,
2497
- actionButtons: a.arrayOf(Ne)
2503
+ deleteModal: r.shape({
2504
+ title: r.string.isRequired,
2505
+ size: r.string,
2506
+ confirmText: r.string,
2507
+ referenceKey: r.string,
2508
+ actionButtons: r.arrayOf(Me)
2498
2509
  }),
2499
- viewModal: a.shape({
2500
- title: a.string.isRequired,
2501
- size: a.string,
2510
+ viewModal: r.shape({
2511
+ title: r.string.isRequired,
2512
+ size: r.string,
2502
2513
  // 👇 This covers your commented code:
2503
- component: a.elementType,
2514
+ component: r.elementType,
2504
2515
  // for custom component like TeamMemberDetail
2505
- fields: a.arrayOf(ba),
2506
- footer: a.shape({
2507
- cancelButton: a.bool,
2508
- cancelText: a.string
2516
+ fields: r.arrayOf(ma),
2517
+ footer: r.shape({
2518
+ cancelButton: r.bool,
2519
+ cancelText: r.string
2509
2520
  })
2510
2521
  })
2511
2522
  }),
2512
2523
  /* ================= FILTER CONFIG ================= */
2513
- filterConfig: a.shape({
2514
- fields: a.arrayOf(Se)
2524
+ filterConfig: r.shape({
2525
+ fields: r.arrayOf(Ce)
2515
2526
  })
2516
2527
  }).isRequired
2517
2528
  };
2518
- const pa = () => {
2529
+ const fa = () => {
2519
2530
  if (typeof document > "u" || document.getElementById("react-admin-crud-manager-styles")) return;
2520
- const u = document.createElement("style");
2521
- u.id = "react-admin-crud-manager-styles";
2522
- const l = `
2531
+ const b = document.createElement("style");
2532
+ b.id = "react-admin-crud-manager-styles";
2533
+ const o = `
2523
2534
  .no-spinner::-webkit-outer-spin-button,
2524
2535
  .no-spinner::-webkit-inner-spin-button {
2525
2536
  -webkit-appearance: none;
@@ -2535,14 +2546,14 @@ const pa = () => {
2535
2546
  box-shadow: none !important;
2536
2547
  }
2537
2548
  `;
2538
- u.textContent = l, document.head.appendChild(u);
2549
+ b.textContent = o, document.head.appendChild(b);
2539
2550
  };
2540
- function Ma(u) {
2541
- return z(() => {
2542
- pa();
2543
- }, []), /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e($e, { config: u.config }) });
2551
+ function La(b) {
2552
+ return K(() => {
2553
+ fa();
2554
+ }, []), /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(Ke, { config: b.config }) });
2544
2555
  }
2545
2556
  export {
2546
- Ma as default
2557
+ La as default
2547
2558
  };
2548
2559
  //# sourceMappingURL=index.es.js.map