@kareemelbalshe/any-table 1.0.2 → 1.0.3

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.js CHANGED
@@ -1,7 +1,7 @@
1
- import { jsx as a, jsxs as y, Fragment as Ce } from "react/jsx-runtime";
2
- import Xe, { useMemo as W, useState as S, useEffect as fe, useCallback as A, useRef as $t, useImperativeHandle as Dt, createContext as Mt, useContext as Qe } from "react";
3
- function P(e, t, s = void 0) {
4
- if (e == null) return s;
1
+ import { jsx as o, jsxs as y, Fragment as me } from "react/jsx-runtime";
2
+ import Ke, { useMemo as B, useState as A, useEffect as ne, useCallback as N, useRef as Tt, useImperativeHandle as Pt, createContext as Et, useContext as Ve } from "react";
3
+ function S(e, t, n = void 0) {
4
+ if (e == null) return n;
5
5
  if (!t || typeof t != "string") return e;
6
6
  if (t in e && e[t] !== void 0)
7
7
  return e[t];
@@ -10,90 +10,90 @@ function P(e, t, s = void 0) {
10
10
  for (let i = 0; i < l.length; i++) {
11
11
  const g = l[i];
12
12
  if (r == null)
13
- return s;
13
+ return n;
14
14
  r = r[g];
15
15
  }
16
- return r !== void 0 ? r : s;
16
+ return r !== void 0 ? r : n;
17
17
  }
18
- function _t(e) {
18
+ function $t(e) {
19
19
  return e !== null && typeof e == "object" && !Array.isArray(e);
20
20
  }
21
- function ue(e) {
21
+ function re(e) {
22
22
  if (!e || typeof e != "string") return "";
23
23
  let t = e.replace(/[._\-]+/g, " ");
24
- return t = t.replace(/([a-z])([A-Z])/g, "$1 $2"), t.split(" ").filter(Boolean).map((s) => {
25
- const o = s.toLowerCase();
26
- return s.length <= 3 && s === s.toUpperCase() ? s : o.charAt(0).toUpperCase() + o.slice(1);
24
+ return t = t.replace(/([a-z])([A-Z])/g, "$1 $2"), t.split(" ").filter(Boolean).map((n) => {
25
+ const s = n.toLowerCase();
26
+ return n.length <= 3 && n === n.toUpperCase() ? n : s.charAt(0).toUpperCase() + s.slice(1);
27
27
  }).join(" ");
28
28
  }
29
- const jt = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg", ".bmp", ".avif"], Ft = ["image", "avatar", "photo", "logo", "picture", "thumbnail", "banner", "img", "icon"], Wt = ["price", "spend", "cost", "amount", "total", "fee", "rate", "salary", "balance", "deposit", "commission", "charge"], Rt = ["status", "state", "phase", "condition"];
30
- function be(e, t) {
31
- const s = e.toLowerCase();
32
- if (Ft.some((r) => s.includes(r)))
29
+ const Bt = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg", ".bmp", ".avif"], Dt = ["image", "avatar", "photo", "logo", "picture", "thumbnail", "banner", "img", "icon"], Mt = ["price", "spend", "cost", "amount", "total", "fee", "rate", "salary", "balance", "deposit", "commission", "charge"], _t = ["status", "state", "phase", "condition"];
30
+ function ae(e, t) {
31
+ const n = e.toLowerCase();
32
+ if (Dt.some((r) => n.includes(r)))
33
33
  return "image";
34
- if (Wt.some((r) => s.includes(r)))
34
+ if (Mt.some((r) => n.includes(r)))
35
35
  return "currency";
36
- if (Rt.some((r) => s.includes(r)))
36
+ if (_t.some((r) => n.includes(r)))
37
37
  return "status";
38
- const o = t.filter((r) => r != null && r !== "");
39
- if (o.length === 0)
38
+ const s = t.filter((r) => r != null && r !== "");
39
+ if (s.length === 0)
40
40
  return "string";
41
- const l = o[0];
42
- if (typeof l == "boolean" || s.startsWith("is") || s.startsWith("has"))
41
+ const l = s[0];
42
+ if (typeof l == "boolean" || n.startsWith("is") || n.startsWith("has"))
43
43
  return "boolean";
44
44
  if (Array.isArray(l))
45
45
  return "array";
46
46
  if (typeof l == "object")
47
- return l.url && typeof l.url == "string" && Ie(l.url) ? "image" : "object";
47
+ return l.url && typeof l.url == "string" && Fe(l.url) ? "image" : "object";
48
48
  if (typeof l == "number")
49
49
  return "number";
50
50
  if (typeof l == "string") {
51
51
  const r = l.trim();
52
- if (Ie(r))
52
+ if (Fe(r))
53
53
  return "image";
54
- if ((zt(r) || s.includes("date") || s.includes("at") || s.includes("time")) && !isNaN(Date.parse(r)))
54
+ if ((jt(r) || n.includes("date") || n.includes("at") || n.includes("time")) && !isNaN(Date.parse(r)))
55
55
  return r.includes("T") || r.includes(":") ? "datetime" : "date";
56
56
  if (r.includes("@") && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r))
57
57
  return "email";
58
58
  if (r.startsWith("http://") || r.startsWith("https://"))
59
59
  return "url";
60
- if (s.includes("phone") || s.includes("mobile") || s.includes("tel"))
60
+ if (n.includes("phone") || n.includes("mobile") || n.includes("tel"))
61
61
  return "phone";
62
62
  }
63
63
  return "string";
64
64
  }
65
- function Ie(e) {
65
+ function Fe(e) {
66
66
  if (!e || typeof e != "string") return !1;
67
67
  if (e.startsWith("data:image/")) return !0;
68
68
  const t = e.toLowerCase().split("?")[0];
69
- return jt.some((s) => t.endsWith(s));
69
+ return Bt.some((n) => t.endsWith(n));
70
70
  }
71
- function zt(e) {
71
+ function jt(e) {
72
72
  return !e || typeof e != "string" || e.length < 10 ? !1 : /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?)?$/.test(e);
73
73
  }
74
- const Lt = ["__v", "password", "token", "refreshToken", "secret", "hash", "salt"];
75
- function Ot(e, t = Lt, s = 2) {
74
+ const Wt = ["__v", "password", "token", "refreshToken", "secret", "hash", "salt"];
75
+ function zt(e, t = Wt, n = 2) {
76
76
  if (!e || !e.length)
77
77
  return [];
78
- const o = /* @__PURE__ */ new Map(), l = e.slice(0, 10);
78
+ const s = /* @__PURE__ */ new Map(), l = e.slice(0, 10);
79
79
  for (const r of l)
80
- !r || typeof r != "object" || et(r, "", o, l, t, 0, s);
81
- return Array.from(o.values());
80
+ !r || typeof r != "object" || Ge(r, "", s, l, t, 0, n);
81
+ return Array.from(s.values());
82
82
  }
83
- function et(e, t, s, o, l, r, i) {
83
+ function Ge(e, t, n, s, l, r, i) {
84
84
  if (!(!e || typeof e != "object" || r > i))
85
85
  for (const g of Object.keys(e)) {
86
86
  if (l.includes(g)) continue;
87
87
  const c = t ? `${t}.${g}` : g, d = e[g];
88
- if (_t(d) && !Ht(d) && r < i) {
89
- et(d, c, s, o, l, r + 1, i);
88
+ if ($t(d) && !Ft(d) && r < i) {
89
+ Ge(d, c, n, s, l, r + 1, i);
90
90
  continue;
91
91
  }
92
- if (!s.has(c)) {
93
- const n = o.map((m) => P(m, c)), u = be(c, n);
94
- s.set(c, {
92
+ if (!n.has(c)) {
93
+ const a = s.map((m) => S(m, c)), u = ae(c, a);
94
+ n.set(c, {
95
95
  key: c,
96
- title: ue(c),
96
+ title: re(c),
97
97
  type: u,
98
98
  sortable: !0,
99
99
  searchable: !0,
@@ -102,34 +102,34 @@ function et(e, t, s, o, l, r, i) {
102
102
  }
103
103
  }
104
104
  }
105
- function Ht(e, t) {
105
+ function Ft(e, t) {
106
106
  return "en" in e && "ar" in e && Object.keys(e).length <= 3 ? !1 : "url" in e && typeof e.url == "string" || "coordinates" in e || "lat" in e && "lng" in e;
107
107
  }
108
- function Ut(e) {
109
- const { data: t = [], columns: s, autoColumns: o = !0, thead: l, headerData: r } = e;
108
+ function Lt(e) {
109
+ const { data: t = [], columns: n, autoColumns: s = !0, thead: l, headerData: r } = e;
110
110
  return r && Array.isArray(r) && r.length > 0 ? r.map((i, g) => {
111
- const c = l && l[g] ? l[g] : ue(i), d = t.map((u) => u?.[i]), n = be(i, d);
111
+ const c = l && l[g] ? l[g] : re(i), d = t.map((u) => u?.[i]), a = ae(i, d);
112
112
  return {
113
113
  key: i,
114
114
  title: c,
115
- type: n,
115
+ type: a,
116
116
  sortable: !0,
117
117
  searchable: !0,
118
- align: n === "number" || n === "currency" ? "right" : "left"
118
+ align: a === "number" || a === "currency" ? "right" : "left"
119
119
  };
120
- }) : s && Array.isArray(s) && s.length > 0 ? s.map((i) => {
120
+ }) : n && Array.isArray(n) && n.length > 0 ? n.map((i) => {
121
121
  if (typeof i == "string") {
122
- const n = t.map((m) => m?.[i]), u = be(i, n);
122
+ const a = t.map((m) => m?.[i]), u = ae(i, a);
123
123
  return {
124
124
  key: i,
125
- title: ue(i),
125
+ title: re(i),
126
126
  type: u,
127
127
  sortable: !0,
128
128
  searchable: !0,
129
129
  align: u === "number" || u === "currency" ? "right" : "left"
130
130
  };
131
131
  }
132
- const g = String(i.key), c = i.title !== void 0 ? i.title : ue(g), d = i.type || be(g, t.map((n) => n?.[g]));
132
+ const g = String(i.key), c = i.title !== void 0 ? i.title : re(g), d = i.type || ae(g, t.map((a) => a?.[g]));
133
133
  return {
134
134
  ...i,
135
135
  title: c,
@@ -138,53 +138,110 @@ function Ut(e) {
138
138
  searchable: i.searchable !== void 0 ? i.searchable : !0,
139
139
  align: i.align || (d === "number" || d === "currency" ? "right" : "left")
140
140
  };
141
- }) : o && t && t.length > 0 ? Ot(t) : [];
141
+ }) : s && t && t.length > 0 ? zt(t) : [];
142
142
  }
143
- function Kt({
143
+ function Ht(e) {
144
+ const {
145
+ explicitActions: t,
146
+ buttons: n,
147
+ block: s,
148
+ handleBlock: l,
149
+ view: r,
150
+ linkView: i,
151
+ viewHandler: g,
152
+ edit: c,
153
+ linkEdit: d,
154
+ editHandler: a,
155
+ del: u,
156
+ handleDelete: m
157
+ } = e, f = [...t || []];
158
+ return n && Array.isArray(n) && n.forEach((b, h) => {
159
+ f.push({
160
+ id: `legacy-btn-${h}`,
161
+ label: b.label,
162
+ icon: b.icon,
163
+ className: b.className,
164
+ show: b.show,
165
+ hide: b.hide,
166
+ onClick: (k) => b.onClick(k)
167
+ });
168
+ }), s && l && f.push({
169
+ id: "legacy-block",
170
+ label: (b) => b.isBanned || !b.isActive ? "Unblock" : "Block",
171
+ variant: (b) => b.isBanned || !b.isActive ? "success" : "danger",
172
+ onClick: (b) => l(b?._id || b?.id)
173
+ }), r && (g || i) && f.push({
174
+ id: "legacy-view",
175
+ label: "View",
176
+ variant: "primary",
177
+ onClick: (b) => {
178
+ const h = b?._id || b?.id;
179
+ g ? g(h) : i && typeof window < "u" && (window.location.href = `${i}/${h}`);
180
+ }
181
+ }), c && (a || d) && f.push({
182
+ id: "legacy-edit",
183
+ label: "Edit",
184
+ variant: "info",
185
+ onClick: (b) => {
186
+ const h = b?._id || b?.id;
187
+ a ? a(h) : d && typeof window < "u" && (window.location.href = `${d}/${h}`);
188
+ }
189
+ }), u && m && f.push({
190
+ id: "legacy-del",
191
+ label: "Delete",
192
+ variant: "danger",
193
+ confirmation: {
194
+ title: "Delete Item",
195
+ message: "Are you sure you want to delete this record?"
196
+ },
197
+ onClick: (b) => m(b?._id || b?.id)
198
+ }), f;
199
+ }
200
+ function Ot({
144
201
  config: e,
145
202
  onSearchChange: t
146
203
  }) {
147
- const s = W(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), o = s.enabled !== !1 && !!e, l = s.debounce ?? 350, [r, i] = S(""), [g, c] = S(""), [d, n] = S(!1);
148
- fe(() => {
149
- if (!o) return;
204
+ const n = B(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), s = n.enabled !== !1 && !!e, l = n.debounce ?? 350, [r, i] = A(""), [g, c] = A(""), [d, a] = A(!1);
205
+ ne(() => {
206
+ if (!s) return;
150
207
  if (r === "") {
151
- c(""), n(!1), t?.("");
208
+ c(""), a(!1), t?.("");
152
209
  return;
153
210
  }
154
- n(!0);
155
- const b = setTimeout(() => {
156
- c(r), n(!1), t?.(r);
211
+ a(!0);
212
+ const f = setTimeout(() => {
213
+ c(r), a(!1), t?.(r);
157
214
  }, l);
158
215
  return () => {
159
- clearTimeout(b);
216
+ clearTimeout(f);
160
217
  };
161
- }, [r, l, o, t]);
162
- const u = A((b) => {
163
- i(b);
164
- }, []), m = A(() => {
165
- i(""), c(""), n(!1), t?.("");
218
+ }, [r, l, s, t]);
219
+ const u = N((f) => {
220
+ i(f);
221
+ }, []), m = N(() => {
222
+ i(""), c(""), a(!1), t?.("");
166
223
  }, [t]);
167
224
  return {
168
- enabled: o,
225
+ enabled: s,
169
226
  search: r,
170
227
  debouncedSearch: g,
171
228
  isDebouncing: d,
172
229
  setSearch: u,
173
230
  clearSearch: m,
174
- searchConfig: s
231
+ searchConfig: n
175
232
  };
176
233
  }
177
- function It({
234
+ function Rt({
178
235
  config: e,
179
236
  onSortChange: t
180
237
  }) {
181
- const s = W(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), o = s.enabled !== !1 && !!e, l = s.allowUnsort ?? !0, [r, i] = S(
182
- s.defaultSortBy || null
183
- ), [g, c] = S(
184
- s.defaultSortOrder || null
185
- ), d = A(
238
+ const n = B(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), s = n.enabled !== !1 && !!e, l = n.allowUnsort ?? !0, [r, i] = A(
239
+ n.defaultSortBy || null
240
+ ), [g, c] = A(
241
+ n.defaultSortOrder || null
242
+ ), d = N(
186
243
  (m) => {
187
- if (o) {
244
+ if (s) {
188
245
  if (r !== m) {
189
246
  i(m), c("asc"), t?.(m, "asc");
190
247
  return;
@@ -192,86 +249,86 @@ function It({
192
249
  g === "asc" ? (c("desc"), t?.(m, "desc")) : g === "desc" && l ? (i(null), c(null), t?.(null, null)) : (c("asc"), t?.(m, "asc"));
193
250
  }
194
251
  },
195
- [o, r, g, l, t]
196
- ), n = A(
197
- (m, b) => {
198
- i(m), c(b), t?.(m, b);
252
+ [s, r, g, l, t]
253
+ ), a = N(
254
+ (m, f) => {
255
+ i(m), c(f), t?.(m, f);
199
256
  },
200
257
  [t]
201
- ), u = A(() => {
258
+ ), u = N(() => {
202
259
  i(null), c(null), t?.(null, null);
203
260
  }, [t]);
204
261
  return {
205
- enabled: o,
262
+ enabled: s,
206
263
  sortBy: r,
207
264
  sortOrder: g,
208
265
  toggleSort: d,
209
- setSorting: n,
266
+ setSorting: a,
210
267
  resetSorting: u,
211
- sortingConfig: s
268
+ sortingConfig: n
212
269
  };
213
270
  }
214
- function Gt({
271
+ function Ut({
215
272
  config: e,
216
273
  totalRecords: t,
217
- onPageChange: s
274
+ onPageChange: n
218
275
  }) {
219
- const o = W(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), l = o.enabled !== !1 && !!e, r = o.defaultPage || 1, i = o.defaultPageSize || 10, g = o.pageSizeOptions || [5, 10, 20, 50, 100], [c, d] = S(r), [n, u] = S(i), m = Math.max(1, Math.ceil(t / Math.max(1, n))), b = A(
220
- (N) => {
221
- const w = Math.max(1, Math.min(N, m));
222
- d(w), s?.(w, n);
276
+ const s = B(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), l = s.enabled !== !1 && !!e, r = s.defaultPage || 1, i = s.defaultPageSize || 10, g = s.pageSizeOptions || [5, 10, 20, 50, 100], [c, d] = A(r), [a, u] = A(i), m = Math.max(1, Math.ceil(t / Math.max(1, a))), f = N(
277
+ (w) => {
278
+ const x = Math.max(1, Math.min(w, m));
279
+ d(x), n?.(x, a);
223
280
  },
224
- [m, n, s]
225
- ), f = A(
226
- (N) => {
227
- u(N), d(1), s?.(1, N);
281
+ [m, a, n]
282
+ ), b = N(
283
+ (w) => {
284
+ u(w), d(1), n?.(1, w);
228
285
  },
229
- [s]
230
- ), k = A(() => {
231
- c < m && b(c + 1);
232
- }, [c, m, b]), C = A(() => {
233
- c > 1 && b(c - 1);
234
- }, [c, b]), D = A(() => {
235
- d(1), u(i), s?.(1, i);
236
- }, [i, s]), _ = A(
237
- (N = 5) => {
238
- const w = Math.max(
286
+ [n]
287
+ ), h = N(() => {
288
+ c < m && f(c + 1);
289
+ }, [c, m, f]), k = N(() => {
290
+ c > 1 && f(c - 1);
291
+ }, [c, f]), T = N(() => {
292
+ d(1), u(i), n?.(1, i);
293
+ }, [i, n]), $ = N(
294
+ (w = 5) => {
295
+ const x = Math.max(
239
296
  1,
240
- Math.min(c - Math.floor(N / 2), m - N + 1)
241
- ), R = Math.min(m, w + N - 1), H = [];
242
- for (let L = w; L <= R; L++)
243
- H.push(L);
244
- return H;
297
+ Math.min(c - Math.floor(w / 2), m - w + 1)
298
+ ), M = Math.min(m, x + w - 1), z = [];
299
+ for (let W = x; W <= M; W++)
300
+ z.push(W);
301
+ return z;
245
302
  },
246
303
  [c, m]
247
- ), x = A(
248
- (N) => {
249
- if (!l) return N;
250
- const w = (c - 1) * n;
251
- return N.slice(w, w + n);
304
+ ), p = N(
305
+ (w) => {
306
+ if (!l) return w;
307
+ const x = (c - 1) * a;
308
+ return w.slice(x, x + a);
252
309
  },
253
- [l, c, n]
310
+ [l, c, a]
254
311
  );
255
312
  return {
256
313
  enabled: l,
257
314
  page: c,
258
- pageSize: n,
315
+ pageSize: a,
259
316
  totalRecords: t,
260
317
  totalPages: m,
261
318
  pageSizeOptions: g,
262
319
  hasNextPage: c < m,
263
320
  hasPrevPage: c > 1,
264
- setPage: b,
265
- setPageSize: f,
266
- nextPage: k,
267
- prevPage: C,
268
- resetPagination: D,
269
- getPageWindow: _,
270
- sliceData: x,
271
- paginationConfig: o
321
+ setPage: f,
322
+ setPageSize: b,
323
+ nextPage: h,
324
+ prevPage: k,
325
+ resetPagination: T,
326
+ getPageWindow: $,
327
+ sliceData: p,
328
+ paginationConfig: s
272
329
  };
273
330
  }
274
- const Vt = [
331
+ const It = [
275
332
  "total",
276
333
  "totalCount",
277
334
  "count",
@@ -287,7 +344,7 @@ const Vt = [
287
344
  "pageInfo.total",
288
345
  "pageInfo.totalCount",
289
346
  "paging.total"
290
- ], Yt = [
347
+ ], Kt = [
291
348
  "page",
292
349
  "currentPage",
293
350
  "pageNumber",
@@ -297,7 +354,7 @@ const Vt = [
297
354
  "pagination.page",
298
355
  "pagination.currentPage",
299
356
  "pageInfo.page"
300
- ], Zt = [
357
+ ], Vt = [
301
358
  "pageSize",
302
359
  "limit",
303
360
  "perPage",
@@ -308,7 +365,7 @@ const Vt = [
308
365
  "pagination.pageSize",
309
366
  "pagination.limit",
310
367
  "pagination.perPage"
311
- ], Jt = [
368
+ ], Gt = [
312
369
  "totalPages",
313
370
  "pageCount",
314
371
  "lastPage",
@@ -319,82 +376,82 @@ const Vt = [
319
376
  "pagination.totalPages",
320
377
  "pagination.lastPage"
321
378
  ];
322
- function Q(e, t, s = 1, o = 10, l) {
379
+ function G(e, t, n = 1, s = 10, l) {
323
380
  if (!e || typeof e != "object") {
324
381
  const d = l !== void 0 ? l : 0;
325
382
  return {
326
- page: s,
327
- pageSize: o,
383
+ page: n,
384
+ pageSize: s,
328
385
  total: d,
329
- totalPages: Math.max(1, Math.ceil(d / Math.max(1, o))),
386
+ totalPages: Math.max(1, Math.ceil(d / Math.max(1, s))),
330
387
  hasNextPage: !1,
331
388
  hasPrevPage: !1
332
389
  };
333
390
  }
334
391
  let r;
335
392
  if (t?.totalPath) {
336
- const d = P(e, t.totalPath);
393
+ const d = S(e, t.totalPath);
337
394
  typeof d == "number" ? r = d : typeof d == "string" && !isNaN(Number(d)) && (r = Number(d));
338
395
  }
339
396
  if (r === void 0)
340
- for (const d of Vt) {
341
- const n = P(e, d);
342
- if (typeof n == "number" && !isNaN(n)) {
343
- r = n;
397
+ for (const d of It) {
398
+ const a = S(e, d);
399
+ if (typeof a == "number" && !isNaN(a)) {
400
+ r = a;
344
401
  break;
345
402
  }
346
- if (typeof n == "string" && n.trim() !== "" && !isNaN(Number(n))) {
347
- r = Number(n);
403
+ if (typeof a == "string" && a.trim() !== "" && !isNaN(Number(a))) {
404
+ r = Number(a);
348
405
  break;
349
406
  }
350
407
  }
351
408
  r === void 0 && (r = l !== void 0 ? l : 0);
352
409
  let i;
353
410
  if (t?.pagePath) {
354
- const d = P(e, t.pagePath);
411
+ const d = S(e, t.pagePath);
355
412
  typeof d == "number" ? i = d : typeof d == "string" && !isNaN(Number(d)) && (i = Number(d));
356
413
  }
357
414
  if (i === void 0)
358
- for (const d of Yt) {
359
- const n = P(e, d);
360
- if (typeof n == "number" && !isNaN(n)) {
361
- i = n;
415
+ for (const d of Kt) {
416
+ const a = S(e, d);
417
+ if (typeof a == "number" && !isNaN(a)) {
418
+ i = a;
362
419
  break;
363
420
  }
364
- if (typeof n == "string" && n.trim() !== "" && !isNaN(Number(n))) {
365
- i = Number(n);
421
+ if (typeof a == "string" && a.trim() !== "" && !isNaN(Number(a))) {
422
+ i = Number(a);
366
423
  break;
367
424
  }
368
425
  }
369
- i === void 0 && (i = s);
426
+ i === void 0 && (i = n);
370
427
  let g;
371
428
  if (t?.pageSizePath) {
372
- const d = P(e, t.pageSizePath);
429
+ const d = S(e, t.pageSizePath);
373
430
  typeof d == "number" ? g = d : typeof d == "string" && !isNaN(Number(d)) && (g = Number(d));
374
431
  }
375
432
  if (g === void 0)
376
- for (const d of Zt) {
377
- const n = P(e, d);
378
- if (typeof n == "number" && !isNaN(n)) {
379
- g = n;
433
+ for (const d of Vt) {
434
+ const a = S(e, d);
435
+ if (typeof a == "number" && !isNaN(a)) {
436
+ g = a;
380
437
  break;
381
438
  }
382
- if (typeof n == "string" && n.trim() !== "" && !isNaN(Number(n))) {
383
- g = Number(n);
439
+ if (typeof a == "string" && a.trim() !== "" && !isNaN(Number(a))) {
440
+ g = Number(a);
384
441
  break;
385
442
  }
386
443
  }
387
- g === void 0 && (g = o);
444
+ g === void 0 && (g = s);
388
445
  let c;
389
446
  if (t?.totalPagesPath) {
390
- const d = P(e, t.totalPagesPath);
447
+ const d = S(e, t.totalPagesPath);
391
448
  typeof d == "number" ? c = d : typeof d == "string" && !isNaN(Number(d)) && (c = Number(d));
392
449
  }
393
450
  if (c === void 0)
394
- for (const d of Jt) {
395
- const n = P(e, d);
396
- if (typeof n == "number" && !isNaN(n)) {
397
- c = n;
451
+ for (const d of Gt) {
452
+ const a = S(e, d);
453
+ if (typeof a == "number" && !isNaN(a)) {
454
+ c = a;
398
455
  break;
399
456
  }
400
457
  }
@@ -407,7 +464,7 @@ function Q(e, t, s = 1, o = 10, l) {
407
464
  hasPrevPage: i > 1
408
465
  };
409
466
  }
410
- const qt = [
467
+ const Yt = [
411
468
  "data",
412
469
  "items",
413
470
  "results",
@@ -428,23 +485,23 @@ const qt = [
428
485
  "subscriptions",
429
486
  "deadLetters.items"
430
487
  ];
431
- function Xt(e, t, s) {
432
- const o = s?.page || 1, l = s?.pageSize || 10;
488
+ function Zt(e, t, n) {
489
+ const s = n?.page || 1, l = n?.pageSize || 10;
433
490
  if (t?.transformResponse && typeof t.transformResponse == "function") {
434
491
  const r = t.transformResponse(e);
435
492
  if (Array.isArray(r))
436
493
  return {
437
494
  data: r,
438
- meta: Q(e, t.response, o, l, r.length),
495
+ meta: G(e, t.response, s, l, r.length),
439
496
  raw: e
440
497
  };
441
498
  if (r && typeof r == "object") {
442
499
  const i = Array.isArray(r.data) ? r.data : [], g = r.meta ? {
443
500
  total: r.meta.total !== void 0 ? r.meta.total : i.length,
444
- page: r.meta.page !== void 0 ? r.meta.page : o,
501
+ page: r.meta.page !== void 0 ? r.meta.page : s,
445
502
  pageSize: r.meta.pageSize !== void 0 ? r.meta.pageSize : l,
446
503
  totalPages: r.meta.totalPages !== void 0 ? r.meta.totalPages : Math.max(1, Math.ceil((r.meta.total || i.length) / (r.meta.pageSize || l)))
447
- } : Q(e, t.response, o, l, i.length);
504
+ } : G(e, t.response, s, l, i.length);
448
505
  return { data: i, meta: g, raw: e };
449
506
  }
450
507
  }
@@ -453,23 +510,23 @@ function Xt(e, t, s) {
453
510
  data: e,
454
511
  meta: {
455
512
  total: e.length,
456
- page: o,
513
+ page: s,
457
514
  pageSize: l,
458
515
  totalPages: Math.max(1, Math.ceil(e.length / l)),
459
- hasNextPage: o * l < e.length,
460
- hasPrevPage: o > 1
516
+ hasNextPage: s * l < e.length,
517
+ hasPrevPage: s > 1
461
518
  },
462
519
  raw: e
463
520
  };
464
521
  if (t?.response?.dataPath) {
465
- const r = P(e, t.response.dataPath), i = Array.isArray(r) ? r : [], g = Q(e, t.response, o, l, i.length);
522
+ const r = S(e, t.response.dataPath), i = Array.isArray(r) ? r : [], g = G(e, t.response, s, l, i.length);
466
523
  return { data: i, meta: g, raw: e };
467
524
  }
468
525
  if (e && typeof e == "object") {
469
- for (const r of qt) {
470
- const i = P(e, r);
526
+ for (const r of Yt) {
527
+ const i = S(e, r);
471
528
  if (Array.isArray(i)) {
472
- const g = Q(e, t?.response, o, l, i.length);
529
+ const g = G(e, t?.response, s, l, i.length);
473
530
  return {
474
531
  data: i,
475
532
  meta: g,
@@ -479,7 +536,7 @@ function Xt(e, t, s) {
479
536
  }
480
537
  for (const r in e)
481
538
  if (Array.isArray(e[r])) {
482
- const i = Q(e, t?.response, o, l, e[r].length);
539
+ const i = G(e, t?.response, s, l, e[r].length);
483
540
  return {
484
541
  data: e[r],
485
542
  meta: i,
@@ -507,7 +564,7 @@ function Xt(e, t, s) {
507
564
  data: [],
508
565
  meta: {
509
566
  total: 0,
510
- page: o,
567
+ page: s,
511
568
  pageSize: l,
512
569
  totalPages: 1,
513
570
  hasNextPage: !1,
@@ -516,54 +573,54 @@ function Xt(e, t, s) {
516
573
  raw: e
517
574
  };
518
575
  }
519
- function Qt(e, t, s, o) {
576
+ function Jt(e, t, n, s) {
520
577
  if (!e || !e.length) return [];
521
578
  if (!t || typeof t != "string" || !t.trim()) return e;
522
579
  const l = t.trim().toLowerCase();
523
- if (o && typeof o == "function")
524
- return e.filter((i) => o(i, l));
580
+ if (s && typeof s == "function")
581
+ return e.filter((i) => s(i, l));
525
582
  const r = l.split(/\s+/).filter(Boolean);
526
583
  return e.filter((i) => {
527
584
  if (!i || typeof i != "object") return !1;
528
585
  const g = [];
529
- if (s && s.length > 0)
530
- for (const d of s) {
531
- const n = P(i, d);
532
- n != null && (typeof n == "object" ? g.push(JSON.stringify(n).toLowerCase()) : g.push(String(n).toLowerCase()));
586
+ if (n && n.length > 0)
587
+ for (const d of n) {
588
+ const a = S(i, d);
589
+ a != null && (typeof a == "object" ? g.push(JSON.stringify(a).toLowerCase()) : g.push(String(a).toLowerCase()));
533
590
  }
534
591
  else
535
- Se(i, g);
592
+ ue(i, g);
536
593
  const c = g.join(" ");
537
594
  return r.every((d) => c.includes(d));
538
595
  });
539
596
  }
540
- function Se(e, t, s = 0) {
541
- if (!(s > 4 || e === null || e === void 0)) {
597
+ function ue(e, t, n = 0) {
598
+ if (!(n > 4 || e === null || e === void 0)) {
542
599
  if (typeof e != "object") {
543
600
  t.push(String(e).toLowerCase());
544
601
  return;
545
602
  }
546
603
  if (Array.isArray(e)) {
547
- for (const o of e)
548
- Se(o, t, s + 1);
604
+ for (const s of e)
605
+ ue(s, t, n + 1);
549
606
  return;
550
607
  }
551
- for (const o in e)
552
- if (Object.prototype.hasOwnProperty.call(e, o)) {
553
- if (o.startsWith("__") || o.toLowerCase().includes("password")) continue;
554
- Se(e[o], t, s + 1);
608
+ for (const s in e)
609
+ if (Object.prototype.hasOwnProperty.call(e, s)) {
610
+ if (s.startsWith("__") || s.toLowerCase().includes("password")) continue;
611
+ ue(e[s], t, n + 1);
555
612
  }
556
613
  }
557
614
  }
558
- function er(e, t, s, o) {
559
- if (!e || !e.length || !t || !s)
615
+ function qt(e, t, n, s) {
616
+ if (!e || !e.length || !t || !n)
560
617
  return e;
561
618
  const l = [...e];
562
- return o && typeof o == "function" ? (l.sort((r, i) => {
563
- const g = o(r, i);
564
- return s === "desc" ? -g : g;
619
+ return s && typeof s == "function" ? (l.sort((r, i) => {
620
+ const g = s(r, i);
621
+ return n === "desc" ? -g : g;
565
622
  }), l) : (l.sort((r, i) => {
566
- const g = P(r, t), c = P(i, t);
623
+ const g = S(r, t), c = S(i, t);
567
624
  if (g == null)
568
625
  return c == null ? 0 : 1;
569
626
  if (c == null)
@@ -575,153 +632,192 @@ function er(e, t, s, o) {
575
632
  d = g === c ? 0 : g ? -1 : 1;
576
633
  else if (g instanceof Date && c instanceof Date)
577
634
  d = g.getTime() - c.getTime();
578
- else if (typeof g == "string" && typeof c == "string" && Ge(g) && Ge(c))
635
+ else if (typeof g == "string" && typeof c == "string" && Le(g) && Le(c))
579
636
  d = new Date(g).getTime() - new Date(c).getTime();
580
637
  else {
581
- const n = String(g), u = String(c);
582
- d = n.localeCompare(u, void 0, {
638
+ const a = String(g), u = String(c);
639
+ d = a.localeCompare(u, void 0, {
583
640
  numeric: !0,
584
641
  sensitivity: "base"
585
642
  });
586
643
  }
587
- return s === "desc" ? -d : d;
644
+ return n === "desc" ? -d : d;
588
645
  }), l);
589
646
  }
590
- function Ge(e) {
647
+ function Le(e) {
591
648
  return e.length < 10 ? !1 : /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?)?$/.test(e);
592
649
  }
593
- function tr({
650
+ function Xt({
594
651
  data: e,
595
652
  api: t,
596
- columns: s,
597
- searchQuery: o,
653
+ columns: n,
654
+ searchQuery: s,
598
655
  sortBy: l,
599
656
  sortOrder: r,
600
657
  page: i,
601
658
  pageSize: g,
602
659
  manualLoading: c
603
660
  }) {
604
- const d = !!(t && typeof t.fetcher == "function"), n = d && t?.mode !== "client", [u, m] = S([]), [b, f] = S(0), [k, C] = S(!1), [D, _] = S(null), [x, N] = S(0), w = $t(null), R = A(async () => {
661
+ const d = !!(t && typeof t.fetcher == "function"), a = d && t?.mode !== "client", [u, m] = A([]), [f, b] = A(0), [h, k] = A(!1), [T, $] = A(null), [p, w] = A(0), x = Tt(null), M = N(async () => {
605
662
  if (!d || !t?.fetcher) return;
606
- w.current && w.current.abort();
607
- const j = new AbortController();
608
- w.current = j, C(!0), _(null);
609
- const F = t.paramNames || {}, U = F.pageParam || "page", te = F.pageSizeParam || "limit", V = F.searchParam || "q", Y = F.sortByParam || "sortBy", K = F.sortOrderParam || "sortOrder", Z = {
610
- [U]: i,
611
- [te]: g,
663
+ x.current && x.current.abort();
664
+ const D = new AbortController();
665
+ x.current = D, k(!0), $(null);
666
+ const _ = t.paramNames || {}, F = _.pageParam || "page", Z = _.pageSizeParam || "limit", O = _.searchParam || "q", R = _.sortByParam || "sortBy", L = _.sortOrderParam || "sortOrder", U = {
667
+ [F]: i,
668
+ [Z]: g,
612
669
  page: i,
613
670
  pageSize: g,
614
- ...o ? { [V]: o, search: o, q: o } : {},
615
- ...l ? { [Y]: l, sortBy: l } : {},
616
- ...r ? { [K]: r, sortOrder: r } : {},
671
+ ...s ? { [O]: s, search: s, q: s } : {},
672
+ ...l ? { [R]: l, sortBy: l } : {},
673
+ ...r ? { [L]: r, sortOrder: r } : {},
617
674
  ...t.params || {}
618
675
  };
619
676
  try {
620
- const B = await t.fetcher(Z, j.signal);
621
- if (j.signal.aborted) return;
622
- const I = Xt(
623
- B,
677
+ const P = await t.fetcher(U, D.signal);
678
+ if (D.signal.aborted) return;
679
+ const H = Zt(
680
+ P,
624
681
  t,
625
- Z
682
+ U
626
683
  );
627
- m(I.data), f(I.meta.total), t.onSuccess?.(I);
628
- } catch (B) {
629
- if (B?.name === "AbortError" || B?.name === "CanceledError")
684
+ m(H.data), b(H.meta.total), t.onSuccess?.(H);
685
+ } catch (P) {
686
+ if (P?.name === "AbortError" || P?.name === "CanceledError")
630
687
  return;
631
- _(B), t.onError?.(B);
688
+ $(P), t.onError?.(P);
632
689
  } finally {
633
- j.signal.aborted || C(!1);
690
+ D.signal.aborted || k(!1);
634
691
  }
635
- }, [d, t, i, g, o, l, r]);
636
- fe(() => {
637
- d && R();
638
- }, [R, x]), fe(() => () => {
639
- w.current && w.current.abort();
692
+ }, [d, t, i, g, s, l, r]);
693
+ ne(() => {
694
+ d && M();
695
+ }, [M, p]), ne(() => () => {
696
+ x.current && x.current.abort();
640
697
  }, []);
641
- const H = A(async () => {
642
- d && N((j) => j + 1);
643
- }, [d]), { displayRows: L, finalTotal: ye } = W(() => {
644
- if (n)
698
+ const z = N(async () => {
699
+ d && w((D) => D + 1);
700
+ }, [d]), { displayRows: W, finalTotal: oe } = B(() => {
701
+ if (a)
645
702
  return {
646
703
  displayRows: u,
647
- finalTotal: b
704
+ finalTotal: f
648
705
  };
649
- const j = d ? u : e || [], F = s.filter((B) => B.searchable !== !1).map((B) => B.key), U = Qt(j, o, F), V = s.find((B) => B.key === l)?.comparator, Y = er(U, l, r, V), K = (i - 1) * g;
706
+ const D = d ? u : e || [], _ = n.filter((P) => P.searchable !== !1).map((P) => P.key), F = Jt(D, s, _), O = n.find((P) => P.key === l)?.comparator, R = qt(F, l, r, O), L = (i - 1) * g;
650
707
  return {
651
- displayRows: Y.slice(K, K + g),
652
- finalTotal: U.length
708
+ displayRows: R.slice(L, L + g),
709
+ finalTotal: F.length
653
710
  };
654
711
  }, [
655
- n,
712
+ a,
656
713
  d,
657
714
  u,
658
715
  e,
659
- b,
716
+ f,
717
+ n,
660
718
  s,
661
- o,
662
719
  l,
663
720
  r,
664
721
  i,
665
722
  g
666
723
  ]);
667
724
  return {
668
- rows: L,
669
- totalRecords: ye,
670
- loading: c !== void 0 ? c : k,
671
- error: D,
672
- refresh: H,
673
- isServerMode: n,
725
+ rows: W,
726
+ totalRecords: oe,
727
+ loading: c !== void 0 ? c : h,
728
+ error: T,
729
+ refresh: z,
730
+ isServerMode: a,
674
731
  rawRemoteData: u
675
732
  };
676
733
  }
677
- function rr({
734
+ function Qt({
678
735
  tableRef: e,
679
736
  refresh: t,
680
- resetPagination: s,
681
- resetSearch: o,
737
+ resetPagination: n,
738
+ resetSearch: s,
682
739
  resetSorting: l,
683
740
  setPage: r,
684
741
  setPageSize: i,
685
742
  setSearch: g,
686
743
  setSorting: c,
687
744
  selectedRows: d,
688
- clearSelection: n,
745
+ clearSelection: a,
689
746
  getState: u
690
747
  }) {
691
- Dt(
748
+ Pt(
692
749
  e,
693
750
  () => ({
694
751
  refresh: t,
695
752
  reset: () => {
696
- s(), o(), l(), n();
753
+ n(), s(), l(), a();
697
754
  },
698
- resetSearch: o,
755
+ resetSearch: s,
699
756
  resetSorting: l,
700
- resetPagination: s,
757
+ resetPagination: n,
701
758
  setPage: r,
702
759
  setPageSize: i,
703
760
  setSearch: g,
704
761
  setSorting: c,
705
762
  getSelectedRows: () => d,
706
- clearSelection: n,
763
+ clearSelection: a,
707
764
  getState: u
708
765
  }),
709
766
  [
710
767
  t,
768
+ n,
711
769
  s,
712
- o,
713
770
  l,
714
771
  r,
715
772
  i,
716
773
  g,
717
774
  c,
718
775
  d,
719
- n,
776
+ a,
720
777
  u
721
778
  ]
722
779
  );
723
780
  }
724
- const tt = {
781
+ function er({
782
+ rows: e,
783
+ rowKeyResolver: t,
784
+ onSelectionChange: n
785
+ }) {
786
+ const [s, l] = A(/* @__PURE__ */ new Set()), r = N(
787
+ (u, m) => {
788
+ l((f) => {
789
+ const b = new Set(f);
790
+ b.has(u) ? b.delete(u) : b.add(u);
791
+ const h = e.filter((k, T) => b.has(t(k, T)));
792
+ return n?.(h, Array.from(b)), b;
793
+ });
794
+ },
795
+ [e, t, n]
796
+ ), i = N(() => {
797
+ if (s.size === e.length && e.length > 0)
798
+ l(/* @__PURE__ */ new Set()), n?.([], []);
799
+ else {
800
+ const u = new Set(e.map((m, f) => t(m, f)));
801
+ l(u), n?.(e, Array.from(u));
802
+ }
803
+ }, [e, s.size, t, n]), g = N(() => {
804
+ l(/* @__PURE__ */ new Set()), n?.([], []);
805
+ }, [n]), c = e.length > 0 && s.size === e.length, d = s.size > 0 && s.size < e.length, a = B(
806
+ () => e.filter((u, m) => s.has(t(u, m))),
807
+ [e, s, t]
808
+ );
809
+ return {
810
+ selectedKeys: s,
811
+ setSelectedKeys: l,
812
+ selectedRows: a,
813
+ onToggleSelectRow: r,
814
+ handleToggleSelectAll: i,
815
+ clearSelection: g,
816
+ allSelected: c,
817
+ isIndeterminate: d
818
+ };
819
+ }
820
+ const Ye = {
725
821
  primary: "#2667EC",
726
822
  primaryHover: "#1E54C6",
727
823
  primaryLight: "#397FF6",
@@ -740,33 +836,19 @@ const tt = {
740
836
  inputBg: "#1E293B",
741
837
  rowHover: "rgba(38, 103, 236, 0.04)",
742
838
  rowSelected: "rgba(38, 103, 236, 0.08)"
743
- }, rt = {
744
- mode: "auto",
745
- colors: tt,
746
- borderRadius: "1rem",
747
- fontFamily: "'Alexandria', system-ui, -apple-system, sans-serif",
748
- density: "normal",
749
- classes: {
750
- container: "w-full flex flex-col gap-4 font-sans text-gray-900 dark:text-gray-100",
751
- tableWrapper: "w-full overflow-x-auto rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-slate-900 shadow-sm transition-colors",
752
- table: "w-full border-collapse text-left text-sm",
753
- thead: "bg-gray-50/80 dark:bg-slate-800/80 backdrop-blur-md border-b border-gray-200 dark:border-gray-800 text-gray-700 dark:text-gray-300 font-bold uppercase tracking-wider text-xs",
754
- th: "py-3.5 px-4 font-bold select-none whitespace-nowrap",
755
- tbody: "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900",
756
- tr: "transition-colors duration-150 hover:bg-gray-50/60 dark:hover:bg-slate-800/40",
757
- td: "py-3 px-4 text-sm text-gray-700 dark:text-gray-300 align-middle",
758
- searchContainer: "w-full sm:max-w-md relative flex items-center",
759
- searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary transition-all",
760
- paginationContainer: "w-full flex flex-wrap items-center justify-between gap-4 pt-2 text-sm text-gray-600 dark:text-gray-400",
761
- paginationButton: "h-9 min-w-[36px] px-3 flex items-center justify-center rounded-xl font-bold text-sm transition-all duration-150 bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40 disabled:cursor-not-allowed",
762
- paginationButtonActive: "bg-primary text-white hover:bg-primary-soft shadow-md shadow-primary/30",
763
- paginationSelect: "h-9 px-3 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-700 dark:text-gray-300 focus:outline-none focus:border-primary cursor-pointer"
764
- }
765
- }, Ve = {
839
+ }, He = {
766
840
  default: {
767
- colors: tt,
841
+ colors: Ye,
768
842
  borderRadius: "1rem",
769
- density: "normal"
843
+ density: "normal",
844
+ classes: {
845
+ tableWrapper: "w-full overflow-x-auto rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-slate-900 shadow-sm transition-colors",
846
+ thead: "bg-gray-50/90 dark:bg-slate-800/90 backdrop-blur-md border-b border-gray-200 dark:border-gray-800 text-gray-700 dark:text-gray-300 font-bold uppercase text-xs tracking-wider",
847
+ tbody: "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900",
848
+ tr: "transition-colors duration-150 hover:bg-blue-50/50 dark:hover:bg-blue-950/20",
849
+ searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary transition-all",
850
+ paginationButtonActive: "bg-primary text-white hover:bg-primary-soft shadow-md shadow-primary/30 font-bold"
851
+ }
770
852
  },
771
853
  midnight: {
772
854
  colors: {
@@ -774,16 +856,16 @@ const tt = {
774
856
  primaryHover: "#4F46E5",
775
857
  primaryLight: "#818CF8",
776
858
  rowHover: "rgba(99, 102, 241, 0.08)",
777
- rowSelected: "rgba(99, 102, 241, 0.16)",
778
- theadBg: "#0F172A",
779
- theadText: "#C7D2FE"
859
+ rowSelected: "rgba(99, 102, 241, 0.16)"
780
860
  },
781
861
  borderRadius: "1.25rem",
782
862
  classes: {
783
- tableWrapper: "w-full overflow-x-auto rounded-2xl border border-indigo-200 dark:border-indigo-950/70 bg-indigo-50/30 dark:bg-[#090D16] shadow-xl shadow-indigo-500/5 dark:shadow-indigo-950/30 transition-colors",
784
- thead: "bg-indigo-100/60 dark:bg-[#0F172A]/90 backdrop-blur-md border-b border-indigo-200 dark:border-indigo-950/80 text-indigo-900 dark:text-indigo-200 font-bold uppercase text-xs tracking-wider",
785
- searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-indigo-200 dark:border-indigo-900/50 bg-white dark:bg-[#111827] text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/40 focus:border-indigo-500",
786
- paginationButtonActive: "bg-indigo-600 text-white shadow-lg shadow-indigo-600/30"
863
+ tableWrapper: "w-full overflow-x-auto rounded-2xl border border-indigo-200 dark:border-indigo-900/70 bg-white dark:bg-[#090d1a] shadow-xl shadow-indigo-500/5 dark:shadow-indigo-950/40 transition-colors",
864
+ thead: "bg-indigo-50/90 dark:bg-[#0f172a] backdrop-blur-md border-b border-indigo-200 dark:border-indigo-900/80 text-indigo-900 dark:text-indigo-200 font-bold uppercase text-xs tracking-wider",
865
+ tbody: "divide-y divide-indigo-100 dark:divide-indigo-950/60 bg-white dark:bg-[#090d1a]",
866
+ tr: "transition-colors duration-150 hover:bg-indigo-50/70 dark:hover:bg-indigo-950/30",
867
+ searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-indigo-200 dark:border-indigo-900/60 bg-white dark:bg-[#111728] text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-indigo-300/40 focus:outline-none focus:ring-2 focus:ring-indigo-500/40 focus:border-indigo-500 transition-all",
868
+ paginationButtonActive: "bg-indigo-600 text-white shadow-lg shadow-indigo-600/30 font-bold"
787
869
  }
788
870
  },
789
871
  emerald: {
@@ -791,18 +873,17 @@ const tt = {
791
873
  primary: "#10B981",
792
874
  primaryHover: "#059669",
793
875
  primaryLight: "#34D399",
794
- border: "#10B98125",
795
876
  rowHover: "rgba(16, 185, 129, 0.06)",
796
- rowSelected: "rgba(16, 185, 129, 0.12)",
797
- theadBg: "rgba(16, 185, 129, 0.08)",
798
- theadText: "#065F46"
877
+ rowSelected: "rgba(16, 185, 129, 0.12)"
799
878
  },
800
879
  borderRadius: "1rem",
801
880
  classes: {
802
- tableWrapper: "w-full overflow-x-auto rounded-2xl border border-emerald-500/20 bg-white dark:bg-slate-900 shadow-lg shadow-emerald-500/5 transition-colors",
803
- thead: "bg-emerald-500/10 dark:bg-emerald-950/30 border-b border-emerald-500/20 text-emerald-800 dark:text-emerald-300 font-bold uppercase text-xs",
804
- searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-emerald-500/30 bg-white dark:bg-slate-800 text-gray-900 dark:text-white focus:ring-emerald-500/40 focus:border-emerald-500",
805
- paginationButtonActive: "bg-emerald-600 text-white shadow-md shadow-emerald-600/30"
881
+ tableWrapper: "w-full overflow-x-auto rounded-2xl border border-emerald-300/60 dark:border-emerald-900/60 bg-white dark:bg-[#06140e] shadow-lg shadow-emerald-500/5 dark:shadow-emerald-950/30 transition-colors",
882
+ thead: "bg-emerald-50/90 dark:bg-emerald-950/60 backdrop-blur-md border-b border-emerald-200 dark:border-emerald-900/60 text-emerald-900 dark:text-emerald-200 font-bold uppercase text-xs tracking-wider",
883
+ tbody: "divide-y divide-emerald-100 dark:divide-emerald-950/60 bg-white dark:bg-[#06140e]",
884
+ tr: "transition-colors duration-150 hover:bg-emerald-50/70 dark:hover:bg-emerald-950/30",
885
+ searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-emerald-300/60 dark:border-emerald-800/60 bg-white dark:bg-[#0c1c14] text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-emerald-300/40 focus:outline-none focus:ring-2 focus:ring-emerald-500/40 focus:border-emerald-500 transition-all",
886
+ paginationButtonActive: "bg-emerald-600 text-white shadow-md shadow-emerald-600/30 font-bold"
806
887
  }
807
888
  },
808
889
  ocean: {
@@ -812,16 +893,16 @@ const tt = {
812
893
  primaryLight: "#38BDF8",
813
894
  secondary: "#06B6D4",
814
895
  rowHover: "rgba(14, 165, 233, 0.06)",
815
- rowSelected: "rgba(14, 165, 233, 0.12)",
816
- theadBg: "rgba(14, 165, 233, 0.08)",
817
- theadText: "#0369A1"
896
+ rowSelected: "rgba(14, 165, 233, 0.12)"
818
897
  },
819
898
  borderRadius: "1rem",
820
899
  classes: {
821
- tableWrapper: "w-full overflow-x-auto rounded-2xl border border-sky-500/20 bg-white dark:bg-slate-900 shadow-lg shadow-sky-500/5 transition-colors",
822
- thead: "bg-sky-500/10 dark:bg-sky-950/30 border-b border-sky-500/20 text-sky-800 dark:text-sky-300 font-bold uppercase text-xs",
823
- searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-sky-500/30 bg-white dark:bg-slate-800 text-gray-900 dark:text-white focus:ring-sky-500/40 focus:border-sky-500",
824
- paginationButtonActive: "bg-sky-500 text-white shadow-md shadow-sky-500/30"
900
+ tableWrapper: "w-full overflow-x-auto rounded-2xl border border-sky-300/60 dark:border-sky-900/60 bg-white dark:bg-[#07131d] shadow-lg shadow-sky-500/5 dark:shadow-sky-950/30 transition-colors",
901
+ thead: "bg-sky-50/90 dark:bg-sky-950/60 backdrop-blur-md border-b border-sky-200 dark:border-sky-900/60 text-sky-900 dark:text-sky-200 font-bold uppercase text-xs tracking-wider",
902
+ tbody: "divide-y divide-sky-100 dark:divide-sky-950/60 bg-white dark:bg-[#07131d]",
903
+ tr: "transition-colors duration-150 hover:bg-sky-50/70 dark:hover:bg-sky-950/30",
904
+ searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-sky-300/60 dark:border-sky-800/60 bg-white dark:bg-[#0d1d2b] text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-sky-300/40 focus:outline-none focus:ring-2 focus:ring-sky-500/40 focus:border-sky-500 transition-all",
905
+ paginationButtonActive: "bg-sky-500 text-white shadow-md shadow-sky-500/30 font-bold"
825
906
  }
826
907
  },
827
908
  luxury: {
@@ -830,15 +911,15 @@ const tt = {
830
911
  primaryHover: "#B45309",
831
912
  primaryLight: "#F59E0B",
832
913
  rowHover: "rgba(245, 158, 11, 0.06)",
833
- rowSelected: "rgba(245, 158, 11, 0.14)",
834
- theadBg: "rgba(245, 158, 11, 0.08)",
835
- theadText: "#78350F"
914
+ rowSelected: "rgba(245, 158, 11, 0.14)"
836
915
  },
837
916
  borderRadius: "1.25rem",
838
917
  classes: {
839
- tableWrapper: "w-full overflow-x-auto rounded-3xl border border-amber-300/60 dark:border-amber-500/30 bg-amber-50/30 dark:bg-[#120F0B] shadow-xl shadow-amber-500/10 transition-colors",
840
- thead: "bg-amber-100/70 dark:bg-amber-950/30 border-b border-amber-300/60 dark:border-amber-500/20 text-amber-900 dark:text-amber-300 font-bold uppercase text-xs tracking-wider",
841
- searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-amber-300/60 dark:border-amber-500/30 bg-white dark:bg-[#1A1612] text-gray-900 dark:text-amber-100 focus:ring-amber-500/40 focus:border-amber-500",
918
+ tableWrapper: "w-full overflow-x-auto rounded-3xl border border-amber-300/80 dark:border-amber-700/60 bg-white dark:bg-[#14100a] shadow-xl shadow-amber-500/10 transition-colors",
919
+ thead: "bg-amber-50/95 dark:bg-amber-950/80 backdrop-blur-md border-b border-amber-300/80 dark:border-amber-800/60 text-amber-950 dark:text-amber-200 font-black uppercase text-xs tracking-wider",
920
+ tbody: "divide-y divide-amber-100 dark:divide-amber-950/60 bg-white dark:bg-[#14100a]",
921
+ tr: "transition-colors duration-150 hover:bg-amber-50/80 dark:hover:bg-amber-950/40",
922
+ searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-amber-300/80 dark:border-amber-700/60 bg-white dark:bg-[#1c160e] text-gray-900 dark:text-amber-100 placeholder:text-gray-400 dark:placeholder:text-amber-400/40 focus:outline-none focus:ring-2 focus:ring-amber-500/40 focus:border-amber-500 transition-all",
842
923
  paginationButtonActive: "bg-gradient-to-r from-amber-500 to-yellow-500 text-white shadow-md shadow-amber-500/30 font-black"
843
924
  }
844
925
  },
@@ -848,16 +929,16 @@ const tt = {
848
929
  primaryHover: "#E11D48",
849
930
  primaryLight: "#FB7185",
850
931
  rowHover: "rgba(244, 63, 94, 0.06)",
851
- rowSelected: "rgba(244, 63, 94, 0.12)",
852
- theadBg: "rgba(244, 63, 94, 0.08)",
853
- theadText: "#881337"
932
+ rowSelected: "rgba(244, 63, 94, 0.12)"
854
933
  },
855
934
  borderRadius: "1rem",
856
935
  classes: {
857
- tableWrapper: "w-full overflow-x-auto rounded-2xl border border-rose-500/20 bg-white dark:bg-slate-900 shadow-lg shadow-rose-500/5",
858
- thead: "bg-rose-500/10 dark:bg-rose-950/30 border-b border-rose-500/20 text-rose-800 dark:text-rose-300 font-bold uppercase text-xs",
859
- searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-rose-500/30 bg-white dark:bg-slate-800 text-gray-900 dark:text-white focus:ring-rose-500/40 focus:border-rose-500",
860
- paginationButtonActive: "bg-rose-500 text-white shadow-md shadow-rose-500/30"
936
+ tableWrapper: "w-full overflow-x-auto rounded-2xl border border-rose-300/60 dark:border-rose-900/60 bg-white dark:bg-[#15070c] shadow-lg shadow-rose-500/5 dark:shadow-rose-950/30 transition-colors",
937
+ thead: "bg-rose-50/90 dark:bg-rose-950/60 backdrop-blur-md border-b border-rose-200 dark:border-rose-900/60 text-rose-900 dark:text-rose-200 font-bold uppercase text-xs tracking-wider",
938
+ tbody: "divide-y divide-rose-100 dark:divide-rose-950/60 bg-white dark:bg-[#15070c]",
939
+ tr: "transition-colors duration-150 hover:bg-rose-50/70 dark:hover:bg-rose-950/30",
940
+ searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-rose-300/60 dark:border-rose-800/60 bg-white dark:bg-[#1f0b13] text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-rose-300/40 focus:outline-none focus:ring-2 focus:ring-rose-500/40 focus:border-rose-500 transition-all",
941
+ paginationButtonActive: "bg-rose-500 text-white shadow-md shadow-rose-500/30 font-bold"
861
942
  }
862
943
  },
863
944
  minimal: {
@@ -881,19 +962,43 @@ const tt = {
881
962
  borderRadius: "0.375rem",
882
963
  density: "compact",
883
964
  classes: {
884
- tableWrapper: "w-full overflow-x-auto rounded-md border border-gray-300 dark:border-gray-700 bg-white dark:bg-slate-900 shadow-sm",
885
- thead: "bg-gray-100 dark:bg-slate-800 border-b border-gray-300 dark:border-gray-700 text-gray-700 dark:text-gray-300 font-bold uppercase text-xs",
886
- searchInput: "w-full pl-9 pr-8 py-1.5 rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-slate-800 text-xs",
887
- paginationButtonActive: "bg-blue-800 text-white"
965
+ tableWrapper: "w-full overflow-x-auto rounded-md border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-900 shadow-sm transition-colors",
966
+ thead: "bg-slate-100 dark:bg-slate-800 border-b border-slate-300 dark:border-slate-700 text-slate-800 dark:text-slate-200 font-bold uppercase text-xs tracking-wider",
967
+ tbody: "divide-y divide-slate-200 dark:divide-slate-800 bg-white dark:bg-slate-900",
968
+ tr: "transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/60",
969
+ searchInput: "w-full pl-9 pr-8 py-1.5 rounded border border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-800 text-xs",
970
+ paginationButtonActive: "bg-blue-800 text-white font-bold"
888
971
  }
889
972
  }
890
- }, Te = Mt(rt), ar = ({
973
+ }, Ze = {
974
+ mode: "auto",
975
+ colors: Ye,
976
+ borderRadius: "1rem",
977
+ fontFamily: "'Alexandria', system-ui, -apple-system, sans-serif",
978
+ density: "normal",
979
+ classes: {
980
+ container: "w-full flex flex-col gap-4 font-sans text-gray-900 dark:text-gray-100",
981
+ tableWrapper: "w-full overflow-x-auto rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-slate-900 shadow-sm transition-colors",
982
+ table: "w-full border-collapse text-left text-sm",
983
+ thead: "bg-gray-50/80 dark:bg-slate-800/80 backdrop-blur-md border-b border-gray-200 dark:border-gray-800 text-gray-700 dark:text-gray-300 font-bold uppercase tracking-wider text-xs",
984
+ th: "py-3.5 px-4 font-bold select-none whitespace-nowrap",
985
+ tbody: "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900",
986
+ tr: "transition-colors duration-150 hover:bg-gray-50/60 dark:hover:bg-slate-800/40",
987
+ td: "py-3 px-4 text-sm text-gray-700 dark:text-gray-300 align-middle",
988
+ searchContainer: "w-full sm:max-w-md relative flex items-center",
989
+ searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary transition-all",
990
+ paginationContainer: "w-full flex flex-wrap items-center justify-between gap-4 pt-2 text-sm text-gray-600 dark:text-gray-400",
991
+ paginationButton: "h-9 min-w-[36px] px-3 flex items-center justify-center rounded-xl font-bold text-sm transition-all duration-150 bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40 disabled:cursor-not-allowed",
992
+ paginationButtonActive: "bg-primary text-white hover:bg-primary-soft shadow-md shadow-primary/30",
993
+ paginationSelect: "h-9 px-3 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-700 dark:text-gray-300 focus:outline-none focus:border-primary cursor-pointer"
994
+ }
995
+ }, fe = Et(Ze), tr = ({
891
996
  theme: e,
892
997
  preset: t,
893
- children: s
998
+ children: n
894
999
  }) => {
895
- const o = Qe(Te), l = W(() => {
896
- const r = o || rt, i = t && Ve[t] ? Ve[t] : {};
1000
+ const s = Ve(fe), l = B(() => {
1001
+ const r = s || Ze, i = t && He[t] ? He[t] : {};
897
1002
  return {
898
1003
  ...r,
899
1004
  ...i,
@@ -909,22 +1014,22 @@ const tt = {
909
1014
  ...e?.classes || {}
910
1015
  }
911
1016
  };
912
- }, [o, t, e]);
913
- return /* @__PURE__ */ a(Te.Provider, { value: l, children: s });
1017
+ }, [s, t, e]);
1018
+ return /* @__PURE__ */ o(fe.Provider, { value: l, children: n });
914
1019
  };
915
- function ee() {
916
- return Qe(Te);
1020
+ function Y() {
1021
+ return Ve(fe);
917
1022
  }
918
- const nr = ({
1023
+ const rr = ({
919
1024
  value: e,
920
1025
  onChange: t,
921
- onClear: s,
922
- isDebouncing: o = !1,
1026
+ onClear: n,
1027
+ isDebouncing: s = !1,
923
1028
  placeholder: l = "Search records..."
924
1029
  }) => {
925
- const r = ee();
1030
+ const r = Y();
926
1031
  return /* @__PURE__ */ y("div", { className: r.classes?.searchContainer || "w-full sm:max-w-md relative flex items-center", children: [
927
- /* @__PURE__ */ a("span", { className: "absolute left-3.5 text-gray-400 dark:text-gray-500 pointer-events-none flex items-center", children: /* @__PURE__ */ a(
1032
+ /* @__PURE__ */ o("span", { className: "absolute left-3.5 text-gray-400 dark:text-gray-500 pointer-events-none flex items-center", children: /* @__PURE__ */ o(
928
1033
  "svg",
929
1034
  {
930
1035
  className: "w-4 h-4",
@@ -932,7 +1037,7 @@ const nr = ({
932
1037
  stroke: "currentColor",
933
1038
  viewBox: "0 0 24 24",
934
1039
  xmlns: "http://www.w3.org/2000/svg",
935
- children: /* @__PURE__ */ a(
1040
+ children: /* @__PURE__ */ o(
936
1041
  "path",
937
1042
  {
938
1043
  strokeLinecap: "round",
@@ -943,7 +1048,7 @@ const nr = ({
943
1048
  )
944
1049
  }
945
1050
  ) }),
946
- /* @__PURE__ */ a(
1051
+ /* @__PURE__ */ o(
947
1052
  "input",
948
1053
  {
949
1054
  type: "text",
@@ -954,15 +1059,15 @@ const nr = ({
954
1059
  }
955
1060
  ),
956
1061
  /* @__PURE__ */ y("div", { className: "absolute right-3 flex items-center gap-1.5", children: [
957
- o && /* @__PURE__ */ a("span", { className: "w-3.5 h-3.5 border-2 border-primary border-t-transparent rounded-full animate-spin" }),
958
- e && /* @__PURE__ */ a(
1062
+ s && /* @__PURE__ */ o("span", { className: "w-3.5 h-3.5 border-2 border-primary border-t-transparent rounded-full animate-spin" }),
1063
+ e && /* @__PURE__ */ o(
959
1064
  "button",
960
1065
  {
961
1066
  type: "button",
962
- onClick: s,
1067
+ onClick: n,
963
1068
  className: "p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded-full hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors",
964
1069
  title: "Clear search",
965
- children: /* @__PURE__ */ a(
1070
+ children: /* @__PURE__ */ o(
966
1071
  "svg",
967
1072
  {
968
1073
  className: "w-3.5 h-3.5",
@@ -970,147 +1075,195 @@ const nr = ({
970
1075
  stroke: "currentColor",
971
1076
  viewBox: "0 0 24 24",
972
1077
  xmlns: "http://www.w3.org/2000/svg",
973
- children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" })
1078
+ children: /* @__PURE__ */ o("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" })
974
1079
  }
975
1080
  )
976
1081
  }
977
1082
  )
978
1083
  ] })
979
1084
  ] });
980
- }, sr = ({
1085
+ }, ar = ({
1086
+ displayTitle: e,
1087
+ subtitle: t,
1088
+ isSearchEnabled: n,
1089
+ searchQuery: s = "",
1090
+ setSearch: l,
1091
+ clearSearch: r,
1092
+ isDebouncing: i = !1,
1093
+ searchPlaceholder: g,
1094
+ headerActions: c,
1095
+ add: d,
1096
+ linkAdd: a,
1097
+ addHandler: u
1098
+ }) => !(e || t || n || c || d) ? null : /* @__PURE__ */ y("div", { className: "w-full flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-1", children: [
1099
+ (e || t) && /* @__PURE__ */ y("div", { className: "flex flex-col", children: [
1100
+ e && /* @__PURE__ */ o("h3", { className: "text-lg font-bold tracking-tight text-gray-900 dark:text-white flex items-center gap-2", children: e }),
1101
+ t && /* @__PURE__ */ o("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-0.5", children: t })
1102
+ ] }),
1103
+ /* @__PURE__ */ y("div", { className: "flex flex-wrap items-center gap-3 w-full sm:w-auto justify-start sm:justify-end ml-auto", children: [
1104
+ n && l && r && /* @__PURE__ */ o(
1105
+ rr,
1106
+ {
1107
+ value: s,
1108
+ onChange: l,
1109
+ onClear: r,
1110
+ isDebouncing: i,
1111
+ placeholder: g
1112
+ }
1113
+ ),
1114
+ c,
1115
+ d && /* @__PURE__ */ y(
1116
+ "button",
1117
+ {
1118
+ type: "button",
1119
+ onClick: () => {
1120
+ u ? u() : a && typeof window < "u" && (window.location.href = a);
1121
+ },
1122
+ className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-xl bg-primary text-white text-xs sm:text-sm font-bold hover:bg-primary-soft transition-all shadow-sm shadow-primary/20 active:scale-95 whitespace-nowrap",
1123
+ children: [
1124
+ /* @__PURE__ */ o("span", { children: "+" }),
1125
+ /* @__PURE__ */ y("span", { children: [
1126
+ "Add ",
1127
+ e || "Record"
1128
+ ] })
1129
+ ]
1130
+ }
1131
+ )
1132
+ ] })
1133
+ ] }), nr = ({
981
1134
  columns: e,
982
1135
  hasActions: t,
983
- actionsTitle: s = "Actions",
984
- actionsWidth: o,
1136
+ actionsTitle: n = "Actions",
1137
+ actionsWidth: s,
985
1138
  sortBy: l,
986
1139
  sortOrder: r,
987
1140
  onSort: i,
988
1141
  selectable: g,
989
1142
  allSelected: c,
990
1143
  isIndeterminate: d,
991
- onToggleSelectAll: n,
1144
+ onToggleSelectAll: a,
992
1145
  headerClassName: u = ""
993
1146
  }) => {
994
- const m = ee(), b = {};
995
- return m.colors?.theadBg && (b.backgroundColor = m.colors.theadBg), m.colors?.theadText && (b.color = m.colors.theadText), /* @__PURE__ */ a(
1147
+ const m = Y(), f = {};
1148
+ return m.colors?.theadBg && (f.backgroundColor = m.colors.theadBg), m.colors?.theadText && (f.color = m.colors.theadText), /* @__PURE__ */ o(
996
1149
  "thead",
997
1150
  {
998
- style: b,
1151
+ style: f,
999
1152
  className: `${m.classes?.thead || "bg-gray-50/80 dark:bg-slate-800/80 border-b border-gray-200 dark:border-gray-800"} ${u}`,
1000
1153
  children: /* @__PURE__ */ y("tr", { children: [
1001
- g && /* @__PURE__ */ a("th", { className: "w-10 px-4 py-3 text-center align-middle", children: /* @__PURE__ */ a(
1154
+ g && /* @__PURE__ */ o("th", { className: "w-10 px-4 py-3 text-center align-middle", children: /* @__PURE__ */ o(
1002
1155
  "input",
1003
1156
  {
1004
1157
  type: "checkbox",
1005
1158
  checked: c,
1006
- ref: (f) => {
1007
- f && (f.indeterminate = !!d);
1159
+ ref: (b) => {
1160
+ b && (b.indeterminate = !!d);
1008
1161
  },
1009
- onChange: n,
1162
+ onChange: a,
1010
1163
  className: "w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-primary focus:ring-primary/30 cursor-pointer"
1011
1164
  }
1012
1165
  ) }),
1013
- e.map((f) => {
1014
- const k = l === f.key, C = f.sortable !== !1 && !!i, D = f.align === "center" ? "text-center" : f.align === "right" ? "text-right" : "text-left";
1015
- return /* @__PURE__ */ a(
1166
+ e.map((b) => {
1167
+ const h = l === b.key, k = b.sortable !== !1 && !!i, T = b.align === "center" ? "text-center" : b.align === "right" ? "text-right" : "text-left";
1168
+ return /* @__PURE__ */ o(
1016
1169
  "th",
1017
1170
  {
1018
1171
  style: {
1019
- width: f.width,
1020
- minWidth: f.minWidth,
1021
- maxWidth: f.maxWidth
1172
+ width: b.width,
1173
+ minWidth: b.minWidth,
1174
+ maxWidth: b.maxWidth
1022
1175
  },
1023
- onClick: () => C && i?.(String(f.key)),
1024
- className: `${m.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} ${D} ${f.headerClassName || ""} ${C ? "cursor-pointer hover:text-primary transition-colors group" : ""}`,
1176
+ onClick: () => k && i?.(String(b.key)),
1177
+ className: `${m.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} ${T} ${b.headerClassName || ""} ${k ? "cursor-pointer hover:text-primary transition-colors group" : ""}`,
1025
1178
  children: /* @__PURE__ */ y(
1026
1179
  "div",
1027
1180
  {
1028
- className: `inline-flex items-center gap-1.5 ${f.align === "center" ? "justify-center" : f.align === "right" ? "justify-end" : "justify-start"}`,
1181
+ className: `inline-flex items-center gap-1.5 ${b.align === "center" ? "justify-center" : b.align === "right" ? "justify-end" : "justify-start"}`,
1029
1182
  children: [
1030
- /* @__PURE__ */ a("span", { children: f.title }),
1031
- C && /* @__PURE__ */ a(
1183
+ /* @__PURE__ */ o("span", { children: b.title }),
1184
+ k && /* @__PURE__ */ o(
1032
1185
  "span",
1033
1186
  {
1034
- className: `inline-flex flex-col text-[10px] transition-transform ${k ? "text-primary scale-110" : "text-gray-400 opacity-40 group-hover:opacity-100"}`,
1035
- children: k ? r === "asc" ? "▲" : "▼" : /* @__PURE__ */ a("span", { className: "text-[9px] leading-none opacity-50", children: "▲▼" })
1187
+ className: `inline-flex flex-col text-[10px] transition-transform ${h ? "text-primary scale-110" : "text-gray-400 opacity-40 group-hover:opacity-100"}`,
1188
+ children: h ? r === "asc" ? "▲" : "▼" : /* @__PURE__ */ o("span", { className: "text-[9px] leading-none opacity-50", children: "▲▼" })
1036
1189
  }
1037
1190
  )
1038
1191
  ]
1039
1192
  }
1040
1193
  )
1041
1194
  },
1042
- String(f.key)
1195
+ String(b.key)
1043
1196
  );
1044
1197
  }),
1045
- t && /* @__PURE__ */ a(
1198
+ t && /* @__PURE__ */ o(
1046
1199
  "th",
1047
1200
  {
1048
- style: { width: o || "auto" },
1201
+ style: { width: s || "auto" },
1049
1202
  className: `${m.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} text-right pr-6`,
1050
- children: s
1203
+ children: n
1051
1204
  }
1052
1205
  )
1053
1206
  ] })
1054
1207
  }
1055
1208
  );
1056
- }, $ = () => /* @__PURE__ */ a("span", { className: "text-gray-400 dark:text-gray-500 font-mono text-sm", children: "—" }), at = ({ value: e }) => {
1209
+ }, E = () => /* @__PURE__ */ o("span", { className: "text-gray-400 dark:text-gray-500 font-mono text-sm", children: "—" }), Je = ({ value: e }) => {
1057
1210
  if (e == null || e === "")
1058
- return /* @__PURE__ */ a($, {});
1211
+ return /* @__PURE__ */ o(E, {});
1059
1212
  const t = String(e);
1060
- return /* @__PURE__ */ a("span", { className: "truncate block max-w-xs font-normal text-sm", title: t, children: t });
1213
+ return /* @__PURE__ */ o("span", { className: "truncate block max-w-xs font-normal text-sm", title: t, children: t });
1061
1214
  }, or = ({ value: e }) => {
1062
1215
  if (e == null || isNaN(Number(e)))
1063
- return /* @__PURE__ */ a($, {});
1216
+ return /* @__PURE__ */ o(E, {});
1064
1217
  const t = Number(e);
1065
- return /* @__PURE__ */ a("span", { className: "font-mono text-sm font-medium", children: t.toLocaleString() });
1066
- }, ir = ({ value: e }) => {
1218
+ return /* @__PURE__ */ o("span", { className: "font-mono text-sm font-medium", children: t.toLocaleString() });
1219
+ }, sr = ({ value: e }) => {
1067
1220
  if (e == null)
1068
- return /* @__PURE__ */ a($, {});
1221
+ return /* @__PURE__ */ o(E, {});
1069
1222
  const t = !!e;
1070
1223
  return /* @__PURE__ */ y(
1071
1224
  "span",
1072
1225
  {
1073
1226
  className: `inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-semibold tracking-wide ${t ? "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20" : "bg-rose-500/10 text-rose-600 dark:text-rose-400 border border-rose-500/20"}`,
1074
1227
  children: [
1075
- /* @__PURE__ */ a("span", { className: `w-1.5 h-1.5 rounded-full ${t ? "bg-emerald-500" : "bg-rose-500"}` }),
1228
+ /* @__PURE__ */ o("span", { className: `w-1.5 h-1.5 rounded-full ${t ? "bg-emerald-500" : "bg-rose-500"}` }),
1076
1229
  t ? "Yes" : "No"
1077
1230
  ]
1078
1231
  }
1079
1232
  );
1080
- }, Ye = ({
1233
+ }, Oe = ({
1081
1234
  value: e,
1082
1235
  isDateTime: t = !1
1083
1236
  }) => {
1084
- if (!e) return /* @__PURE__ */ a($, {});
1085
- const s = e instanceof Date ? e : new Date(e);
1086
- return isNaN(s.getTime()) ? /* @__PURE__ */ a(at, { value: e, column: { key: "" } }) : /* @__PURE__ */ y("span", { className: "whitespace-nowrap text-xs sm:text-sm font-medium text-gray-700 dark:text-gray-300", children: [
1087
- s.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" }),
1088
- t && /* @__PURE__ */ a("span", { className: "text-xs text-gray-400 dark:text-gray-500 ml-1.5", children: s.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" }) })
1237
+ if (!e) return /* @__PURE__ */ o(E, {});
1238
+ const n = e instanceof Date ? e : new Date(e);
1239
+ return isNaN(n.getTime()) ? /* @__PURE__ */ o(Je, { value: e, column: { key: "" } }) : /* @__PURE__ */ y("span", { className: "whitespace-nowrap text-xs sm:text-sm font-medium text-gray-700 dark:text-gray-300", children: [
1240
+ n.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" }),
1241
+ t && /* @__PURE__ */ o("span", { className: "text-xs text-gray-400 dark:text-gray-500 ml-1.5", children: n.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" }) })
1089
1242
  ] });
1090
- }, lr = ({ value: e, column: t }) => {
1243
+ }, ir = ({ value: e, column: t }) => {
1091
1244
  if (e == null || isNaN(Number(e)))
1092
- return /* @__PURE__ */ a($, {});
1093
- const s = Number(e), o = t.currency || "EGP";
1245
+ return /* @__PURE__ */ o(E, {});
1246
+ const n = Number(e), s = t.currency || "EGP";
1094
1247
  return /* @__PURE__ */ y("span", { className: "font-mono text-sm font-bold text-gray-900 dark:text-white", children: [
1095
- s.toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 }),
1248
+ n.toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 }),
1096
1249
  " ",
1097
- /* @__PURE__ */ a("span", { className: "text-xs font-normal text-gray-500 dark:text-gray-400", children: o })
1250
+ /* @__PURE__ */ o("span", { className: "text-xs font-normal text-gray-500 dark:text-gray-400", children: s })
1098
1251
  ] });
1099
- }, Ze = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E", dr = ({ value: e }) => {
1252
+ }, Re = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E", lr = ({ value: e }) => {
1100
1253
  let t = "";
1101
- return typeof e == "string" ? t = e : Array.isArray(e) && e.length > 0 ? t = typeof e[0] == "string" ? e[0] : e[0]?.url || "" : e && typeof e == "object" && (t = e.url || ""), t || (t = Ze), /* @__PURE__ */ a("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ a(
1254
+ return typeof e == "string" ? t = e : Array.isArray(e) && e.length > 0 ? t = typeof e[0] == "string" ? e[0] : e[0]?.url || "" : e && typeof e == "object" && (t = e.url || ""), t || (t = Re), /* @__PURE__ */ o("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ o(
1102
1255
  "img",
1103
1256
  {
1104
1257
  src: t,
1105
1258
  alt: "Thumbnail",
1106
1259
  className: "w-10 h-10 rounded-full object-cover border border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 shadow-sm",
1107
1260
  loading: "lazy",
1108
- onError: (s) => {
1109
- s.target.src = Ze;
1261
+ onError: (n) => {
1262
+ n.target.src = Re;
1110
1263
  }
1111
1264
  }
1112
1265
  ) });
1113
- }, cr = {
1266
+ }, dr = {
1114
1267
  active: { bg: "bg-emerald-500/10 border-emerald-500/20", text: "text-emerald-600 dark:text-emerald-400", dot: "bg-emerald-500" },
1115
1268
  delivered: { bg: "bg-emerald-500/10 border-emerald-500/20", text: "text-emerald-600 dark:text-emerald-400", dot: "bg-emerald-500" },
1116
1269
  completed: { bg: "bg-emerald-500/10 border-emerald-500/20", text: "text-emerald-600 dark:text-emerald-400", dot: "bg-emerald-500" },
@@ -1126,25 +1279,25 @@ const nr = ({
1126
1279
  cancelled: { bg: "bg-rose-500/10 border-rose-500/20", text: "text-rose-600 dark:text-rose-400", dot: "bg-rose-500" },
1127
1280
  offline: { bg: "bg-gray-500/10 border-gray-500/20", text: "text-gray-600 dark:text-gray-400", dot: "bg-gray-500" },
1128
1281
  closed: { bg: "bg-gray-500/10 border-gray-500/20", text: "text-gray-600 dark:text-gray-400", dot: "bg-gray-500" }
1129
- }, gr = ({ value: e, column: t }) => {
1282
+ }, cr = ({ value: e, column: t }) => {
1130
1283
  if (e == null || e === "")
1131
- return /* @__PURE__ */ a($, {});
1132
- const s = String(e), o = s.toLowerCase();
1133
- if (t.statusMap && t.statusMap[s]) {
1134
- const r = t.statusMap[s];
1284
+ return /* @__PURE__ */ o(E, {});
1285
+ const n = String(e), s = n.toLowerCase();
1286
+ if (t.statusMap && t.statusMap[n]) {
1287
+ const r = t.statusMap[n];
1135
1288
  return /* @__PURE__ */ y(
1136
1289
  "span",
1137
1290
  {
1138
1291
  className: "inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-bold uppercase tracking-wider border",
1139
1292
  style: { color: r.color, backgroundColor: r.bg },
1140
1293
  children: [
1141
- /* @__PURE__ */ a("span", { className: "w-1.5 h-1.5 rounded-full", style: { backgroundColor: r.color } }),
1142
- r.label || s
1294
+ /* @__PURE__ */ o("span", { className: "w-1.5 h-1.5 rounded-full", style: { backgroundColor: r.color } }),
1295
+ r.label || n
1143
1296
  ]
1144
1297
  }
1145
1298
  );
1146
1299
  }
1147
- const l = cr[o] || {
1300
+ const l = dr[s] || {
1148
1301
  bg: "bg-gray-500/10 border-gray-500/20",
1149
1302
  text: "text-gray-700 dark:text-gray-300",
1150
1303
  dot: "bg-gray-400"
@@ -1154,26 +1307,26 @@ const nr = ({
1154
1307
  {
1155
1308
  className: `inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-bold uppercase tracking-wider border ${l.bg} ${l.text}`,
1156
1309
  children: [
1157
- /* @__PURE__ */ a("span", { className: `w-1.5 h-1.5 rounded-full ${l.dot}` }),
1158
- s
1310
+ /* @__PURE__ */ o("span", { className: `w-1.5 h-1.5 rounded-full ${l.dot}` }),
1311
+ n
1159
1312
  ]
1160
1313
  }
1161
1314
  );
1162
- }, mr = ({ value: e }) => !Array.isArray(e) || e.length === 0 ? /* @__PURE__ */ a($, {}) : /* @__PURE__ */ y("div", { className: "flex flex-wrap gap-1 items-center", children: [
1163
- e.slice(0, 3).map((t, s) => /* @__PURE__ */ a(
1315
+ }, gr = ({ value: e }) => !Array.isArray(e) || e.length === 0 ? /* @__PURE__ */ o(E, {}) : /* @__PURE__ */ y("div", { className: "flex flex-wrap gap-1 items-center", children: [
1316
+ e.slice(0, 3).map((t, n) => /* @__PURE__ */ o(
1164
1317
  "span",
1165
1318
  {
1166
1319
  className: "inline-block px-2 py-0.5 text-xs rounded bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 border border-gray-200 dark:border-gray-700",
1167
1320
  children: typeof t == "object" ? JSON.stringify(t) : String(t)
1168
1321
  },
1169
- s
1322
+ n
1170
1323
  )),
1171
1324
  e.length > 3 && /* @__PURE__ */ y("span", { className: "text-xs text-gray-400 font-medium", children: [
1172
1325
  "+",
1173
1326
  e.length - 3
1174
1327
  ] })
1175
- ] }), ur = ({ value: e }) => !e || typeof e != "object" ? /* @__PURE__ */ a($, {}) : "en" in e || "ar" in e ? /* @__PURE__ */ a("span", { className: "font-medium text-sm", children: e.en || e.ar || "" }) : /* @__PURE__ */ a("span", { className: "font-mono text-xs text-gray-500 dark:text-gray-400 truncate block max-w-xs", title: JSON.stringify(e), children: JSON.stringify(e) }), br = ({ value: e }) => {
1176
- if (!e) return /* @__PURE__ */ a($, {});
1328
+ ] }), br = ({ value: e }) => !e || typeof e != "object" ? /* @__PURE__ */ o(E, {}) : "en" in e || "ar" in e ? /* @__PURE__ */ o("span", { className: "font-medium text-sm", children: e.en || e.ar || "" }) : /* @__PURE__ */ o("span", { className: "font-mono text-xs text-gray-500 dark:text-gray-400 truncate block max-w-xs", title: JSON.stringify(e), children: JSON.stringify(e) }), mr = ({ value: e }) => {
1329
+ if (!e) return /* @__PURE__ */ o(E, {});
1177
1330
  const t = String(e);
1178
1331
  return /* @__PURE__ */ y(
1179
1332
  "a",
@@ -1183,15 +1336,15 @@ const nr = ({
1183
1336
  rel: "noopener noreferrer",
1184
1337
  className: "text-primary hover:underline text-sm font-medium inline-flex items-center gap-1",
1185
1338
  children: [
1186
- /* @__PURE__ */ a("span", { className: "truncate max-w-[150px]", children: t }),
1187
- /* @__PURE__ */ a("span", { className: "text-xs", children: "↗" })
1339
+ /* @__PURE__ */ o("span", { className: "truncate max-w-[150px]", children: t }),
1340
+ /* @__PURE__ */ o("span", { className: "text-xs", children: "↗" })
1188
1341
  ]
1189
1342
  }
1190
1343
  );
1191
- }, fr = ({ value: e }) => {
1192
- if (!e) return /* @__PURE__ */ a($, {});
1344
+ }, ur = ({ value: e }) => {
1345
+ if (!e) return /* @__PURE__ */ o(E, {});
1193
1346
  const t = String(e);
1194
- return /* @__PURE__ */ a(
1347
+ return /* @__PURE__ */ o(
1195
1348
  "a",
1196
1349
  {
1197
1350
  href: `mailto:${t}`,
@@ -1199,10 +1352,10 @@ const nr = ({
1199
1352
  children: t
1200
1353
  }
1201
1354
  );
1202
- }, yr = ({ value: e }) => {
1203
- if (!e) return /* @__PURE__ */ a($, {});
1355
+ }, fr = ({ value: e }) => {
1356
+ if (!e) return /* @__PURE__ */ o(E, {});
1204
1357
  const t = String(e);
1205
- return /* @__PURE__ */ a(
1358
+ return /* @__PURE__ */ o(
1206
1359
  "a",
1207
1360
  {
1208
1361
  href: `tel:${t}`,
@@ -1210,15 +1363,15 @@ const nr = ({
1210
1363
  children: t
1211
1364
  }
1212
1365
  );
1213
- }, hr = ({ value: e }) => {
1366
+ }, yr = ({ value: e }) => {
1214
1367
  if (e == null || isNaN(Number(e)))
1215
- return /* @__PURE__ */ a($, {});
1216
- const t = Math.min(100, Math.max(0, Math.round(Number(e)))), s = t >= 80 ? "bg-emerald-500" : t >= 50 ? "bg-blue-500" : t >= 30 ? "bg-amber-500" : "bg-rose-500";
1368
+ return /* @__PURE__ */ o(E, {});
1369
+ const t = Math.min(100, Math.max(0, Math.round(Number(e)))), n = t >= 80 ? "bg-emerald-500" : t >= 50 ? "bg-blue-500" : t >= 30 ? "bg-amber-500" : "bg-rose-500";
1217
1370
  return /* @__PURE__ */ y("div", { className: "flex items-center gap-2.5 min-w-[120px]", children: [
1218
- /* @__PURE__ */ a("div", { className: "flex-1 h-2 rounded-full bg-gray-200 dark:bg-slate-700 overflow-hidden", children: /* @__PURE__ */ a(
1371
+ /* @__PURE__ */ o("div", { className: "flex-1 h-2 rounded-full bg-gray-200 dark:bg-slate-700 overflow-hidden", children: /* @__PURE__ */ o(
1219
1372
  "div",
1220
1373
  {
1221
- className: `h-full rounded-full ${s} transition-all duration-500`,
1374
+ className: `h-full rounded-full ${n} transition-all duration-500`,
1222
1375
  style: { width: `${t}%` }
1223
1376
  }
1224
1377
  ) }),
@@ -1227,76 +1380,76 @@ const nr = ({
1227
1380
  "%"
1228
1381
  ] })
1229
1382
  ] });
1230
- }, pr = ({ value: e }) => {
1383
+ }, hr = ({ value: e }) => {
1231
1384
  if (e == null || isNaN(Number(e)))
1232
- return /* @__PURE__ */ a($, {});
1385
+ return /* @__PURE__ */ o(E, {});
1233
1386
  const t = Number(e);
1234
1387
  return /* @__PURE__ */ y("div", { className: "inline-flex items-center gap-1.5 font-medium text-xs text-amber-500", children: [
1235
- /* @__PURE__ */ a("span", { className: "text-sm", children: "★" }),
1236
- /* @__PURE__ */ a("span", { className: "font-bold text-gray-900 dark:text-gray-100", children: t.toFixed(1) }),
1237
- /* @__PURE__ */ a("span", { className: "text-gray-400 dark:text-gray-500 text-[10px]", children: "/ 5" })
1388
+ /* @__PURE__ */ o("span", { className: "text-sm", children: "★" }),
1389
+ /* @__PURE__ */ o("span", { className: "font-bold text-gray-900 dark:text-gray-100", children: t.toFixed(1) }),
1390
+ /* @__PURE__ */ o("span", { className: "text-gray-400 dark:text-gray-500 text-[10px]", children: "/ 5" })
1238
1391
  ] });
1239
- }, xr = ({ value: e }) => {
1392
+ }, pr = ({ value: e }) => {
1240
1393
  if (e == null || e === "")
1241
- return /* @__PURE__ */ a($, {});
1394
+ return /* @__PURE__ */ o(E, {});
1242
1395
  const t = String(e);
1243
- return /* @__PURE__ */ a("span", { className: "inline-flex items-center px-2.5 py-0.5 rounded-lg text-xs font-bold bg-primary/10 text-primary border border-primary/20", children: t });
1244
- }, kr = ({ row: e, column: t, rowIndex: s }) => {
1245
- const o = P(e, t.key);
1396
+ return /* @__PURE__ */ o("span", { className: "inline-flex items-center px-2.5 py-0.5 rounded-lg text-xs font-bold bg-primary/10 text-primary border border-primary/20", children: t });
1397
+ }, xr = ({ row: e, column: t, rowIndex: n }) => {
1398
+ const s = S(e, t.key);
1246
1399
  if (t.render && typeof t.render == "function")
1247
- return /* @__PURE__ */ a(Ce, { children: t.render(o, e, s) });
1400
+ return /* @__PURE__ */ o(me, { children: t.render(s, e, n) });
1248
1401
  if (t.formatter && typeof t.formatter == "function")
1249
- return /* @__PURE__ */ a(Ce, { children: t.formatter(o, e, s) });
1402
+ return /* @__PURE__ */ o(me, { children: t.formatter(s, e, n) });
1250
1403
  switch (t.type) {
1251
1404
  case "boolean":
1252
- return /* @__PURE__ */ a(ir, { value: o, column: t });
1405
+ return /* @__PURE__ */ o(sr, { value: s, column: t });
1253
1406
  case "number":
1254
- return /* @__PURE__ */ a(or, { value: o, column: t });
1407
+ return /* @__PURE__ */ o(or, { value: s, column: t });
1255
1408
  case "currency":
1256
- return /* @__PURE__ */ a(lr, { value: o, column: t });
1409
+ return /* @__PURE__ */ o(ir, { value: s, column: t });
1257
1410
  case "date":
1258
- return /* @__PURE__ */ a(Ye, { value: o, column: t, isDateTime: !1 });
1411
+ return /* @__PURE__ */ o(Oe, { value: s, column: t, isDateTime: !1 });
1259
1412
  case "datetime":
1260
- return /* @__PURE__ */ a(Ye, { value: o, column: t, isDateTime: !0 });
1413
+ return /* @__PURE__ */ o(Oe, { value: s, column: t, isDateTime: !0 });
1261
1414
  case "image":
1262
- return /* @__PURE__ */ a(dr, { value: o, column: t });
1415
+ return /* @__PURE__ */ o(lr, { value: s, column: t });
1263
1416
  case "status":
1264
- return /* @__PURE__ */ a(gr, { value: o, column: t });
1417
+ return /* @__PURE__ */ o(cr, { value: s, column: t });
1265
1418
  case "progress":
1266
- return /* @__PURE__ */ a(hr, { value: o, column: t });
1419
+ return /* @__PURE__ */ o(yr, { value: s, column: t });
1267
1420
  case "rating":
1268
- return /* @__PURE__ */ a(pr, { value: o, column: t });
1421
+ return /* @__PURE__ */ o(hr, { value: s, column: t });
1269
1422
  case "badge":
1270
- return /* @__PURE__ */ a(xr, { value: o, column: t });
1423
+ return /* @__PURE__ */ o(pr, { value: s, column: t });
1271
1424
  case "array":
1272
- return /* @__PURE__ */ a(mr, { value: o, column: t });
1425
+ return /* @__PURE__ */ o(gr, { value: s, column: t });
1273
1426
  case "object":
1274
- return /* @__PURE__ */ a(ur, { value: o, column: t });
1427
+ return /* @__PURE__ */ o(br, { value: s, column: t });
1275
1428
  case "url":
1276
- return /* @__PURE__ */ a(br, { value: o, column: t });
1429
+ return /* @__PURE__ */ o(mr, { value: s, column: t });
1277
1430
  case "email":
1278
- return /* @__PURE__ */ a(fr, { value: o, column: t });
1431
+ return /* @__PURE__ */ o(ur, { value: s, column: t });
1279
1432
  case "phone":
1280
- return /* @__PURE__ */ a(yr, { value: o, column: t });
1433
+ return /* @__PURE__ */ o(fr, { value: s, column: t });
1281
1434
  default:
1282
- return /* @__PURE__ */ a(at, { value: o, column: t });
1435
+ return /* @__PURE__ */ o(Je, { value: s, column: t });
1283
1436
  }
1284
- }, wr = ({
1437
+ }, kr = ({
1285
1438
  isOpen: e,
1286
1439
  title: t,
1287
- message: s,
1288
- confirmText: o = "Confirm",
1440
+ message: n,
1441
+ confirmText: s = "Confirm",
1289
1442
  cancelText: l = "Cancel",
1290
1443
  type: r = "danger",
1291
1444
  onClose: i,
1292
1445
  onConfirm: g,
1293
1446
  isLoading: c = !1
1294
- }) => (fe(() => {
1295
- const d = (n) => {
1296
- n.key === "Escape" && i();
1447
+ }) => (ne(() => {
1448
+ const d = (a) => {
1449
+ a.key === "Escape" && i();
1297
1450
  };
1298
1451
  return e && window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
1299
- }, [e, i]), e ? /* @__PURE__ */ a(
1452
+ }, [e, i]), e ? /* @__PURE__ */ o(
1300
1453
  "div",
1301
1454
  {
1302
1455
  className: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm any-table-fade-in",
@@ -1308,17 +1461,17 @@ const nr = ({
1308
1461
  onClick: (d) => d.stopPropagation(),
1309
1462
  role: "dialog",
1310
1463
  children: [
1311
- /* @__PURE__ */ a(
1464
+ /* @__PURE__ */ o(
1312
1465
  "div",
1313
1466
  {
1314
1467
  className: `mx-auto mb-4 w-14 h-14 rounded-full flex items-center justify-center text-2xl ${r === "danger" ? "bg-rose-500/10 text-rose-500" : r === "warning" ? "bg-amber-500/10 text-amber-500" : "bg-blue-500/10 text-blue-500"}`,
1315
1468
  children: r === "danger" ? "⚠️" : r === "warning" ? "⚡" : "ℹ️"
1316
1469
  }
1317
1470
  ),
1318
- /* @__PURE__ */ a("h3", { className: "text-xl font-black text-gray-900 dark:text-white mb-2", children: t }),
1319
- /* @__PURE__ */ a("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-6 leading-relaxed", children: s }),
1471
+ /* @__PURE__ */ o("h3", { className: "text-xl font-black text-gray-900 dark:text-white mb-2", children: t }),
1472
+ /* @__PURE__ */ o("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-6 leading-relaxed", children: n }),
1320
1473
  /* @__PURE__ */ y("div", { className: "flex items-center justify-center gap-3", children: [
1321
- /* @__PURE__ */ a(
1474
+ /* @__PURE__ */ o(
1322
1475
  "button",
1323
1476
  {
1324
1477
  type: "button",
@@ -1328,14 +1481,14 @@ const nr = ({
1328
1481
  children: l
1329
1482
  }
1330
1483
  ),
1331
- /* @__PURE__ */ a(
1484
+ /* @__PURE__ */ o(
1332
1485
  "button",
1333
1486
  {
1334
1487
  type: "button",
1335
1488
  disabled: c,
1336
1489
  onClick: g,
1337
1490
  className: `w-full py-2.5 px-4 rounded-xl font-bold text-sm text-white transition-all shadow-md active:scale-95 disabled:opacity-50 ${r === "danger" ? "bg-rose-600 hover:bg-rose-700 shadow-rose-600/30" : "bg-primary hover:bg-primary-soft shadow-primary/30"}`,
1338
- children: c ? "Processing..." : o
1491
+ children: c ? "Processing..." : s
1339
1492
  }
1340
1493
  )
1341
1494
  ] })
@@ -1344,33 +1497,33 @@ const nr = ({
1344
1497
  )
1345
1498
  }
1346
1499
  ) : null);
1347
- function nt(e, t) {
1500
+ function qe(e, t) {
1348
1501
  if (!e) return null;
1349
- if (Xe.isValidElement(e))
1502
+ if (Ke.isValidElement(e))
1350
1503
  return e;
1351
1504
  if (typeof e == "function") {
1352
1505
  if (e.prototype && e.prototype.isReactComponent)
1353
- return /* @__PURE__ */ a(e, { className: "w-4 h-4 shrink-0" });
1354
- const s = e.displayName || e.name || "";
1355
- if (/^[A-Z]/.test(s))
1356
- return /* @__PURE__ */ a(e, { className: "w-4 h-4 shrink-0" });
1506
+ return /* @__PURE__ */ o(e, { className: "w-4 h-4 shrink-0" });
1507
+ const n = e.displayName || e.name || "";
1508
+ if (/^[A-Z]/.test(n))
1509
+ return /* @__PURE__ */ o(e, { className: "w-4 h-4 shrink-0" });
1357
1510
  try {
1358
1511
  const l = e(t);
1359
- return nt(l, t);
1512
+ return qe(l, t);
1360
1513
  } catch {
1361
- return /* @__PURE__ */ a(e, { className: "w-4 h-4 shrink-0" });
1514
+ return /* @__PURE__ */ o(e, { className: "w-4 h-4 shrink-0" });
1362
1515
  }
1363
1516
  }
1364
- return typeof e == "object" && e !== null && (e.$$typeof || e.render) ? /* @__PURE__ */ a(e, { className: "w-4 h-4 shrink-0" }) : typeof e == "string" ? e.startsWith("http://") || e.startsWith("https://") || e.startsWith("/") || e.startsWith("./") || e.startsWith("data:image/") || /\.(png|jpe?g|svg|webp|gif|ico)$/i.test(e) ? /* @__PURE__ */ a(
1517
+ return typeof e == "object" && e !== null && (e.$$typeof || e.render) ? /* @__PURE__ */ o(e, { className: "w-4 h-4 shrink-0" }) : typeof e == "string" ? e.startsWith("http://") || e.startsWith("https://") || e.startsWith("/") || e.startsWith("./") || e.startsWith("data:image/") || /\.(png|jpe?g|svg|webp|gif|ico)$/i.test(e) ? /* @__PURE__ */ o(
1365
1518
  "img",
1366
1519
  {
1367
1520
  src: e,
1368
1521
  alt: "action-icon",
1369
1522
  className: "w-4 h-4 object-contain shrink-0 inline-block"
1370
1523
  }
1371
- ) : /* @__PURE__ */ a("span", { className: "inline-flex items-center justify-center leading-none text-base", children: e }) : e;
1524
+ ) : /* @__PURE__ */ o("span", { className: "inline-flex items-center justify-center leading-none text-base", children: e }) : e;
1372
1525
  }
1373
- const Je = {
1526
+ const Ue = {
1374
1527
  primary: "bg-primary text-white hover:bg-primary-soft shadow-sm shadow-primary/20",
1375
1528
  secondary: "bg-emerald-600 text-white hover:bg-emerald-700 shadow-sm shadow-emerald-600/20",
1376
1529
  success: "bg-emerald-500 text-white hover:bg-emerald-600 shadow-sm shadow-emerald-500/20",
@@ -1379,199 +1532,199 @@ const Je = {
1379
1532
  info: "bg-sky-500 text-white hover:bg-sky-600 shadow-sm shadow-sky-500/20",
1380
1533
  neutral: "bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-700 border border-gray-200 dark:border-gray-700",
1381
1534
  ghost: "bg-transparent text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white"
1382
- }, Nr = ({ row: e, actions: t, context: s }) => {
1383
- const [o, l] = S(null), [r, i] = S({});
1535
+ }, wr = ({ row: e, actions: t, context: n }) => {
1536
+ const [s, l] = A(null), [r, i] = A({});
1384
1537
  if (!t || !t.length)
1385
1538
  return null;
1386
- const g = async (n) => {
1387
- if (n.confirmation) {
1388
- const u = typeof n.confirmation.title == "function" ? n.confirmation.title(e) : n.confirmation.title || "Confirm Action", m = typeof n.confirmation.message == "function" ? n.confirmation.message(e) : n.confirmation.message || "Are you sure you want to perform this action?";
1539
+ const g = async (a) => {
1540
+ if (a.confirmation) {
1541
+ const u = typeof a.confirmation.title == "function" ? a.confirmation.title(e) : a.confirmation.title || "Confirm Action", m = typeof a.confirmation.message == "function" ? a.confirmation.message(e) : a.confirmation.message || "Are you sure you want to perform this action?";
1389
1542
  l({
1390
1543
  isOpen: !0,
1391
1544
  title: u,
1392
1545
  message: m,
1393
- confirmText: n.confirmation.confirmText || "Confirm",
1394
- cancelText: n.confirmation.cancelText || "Cancel",
1395
- type: n.confirmation.type || "danger",
1546
+ confirmText: a.confirmation.confirmText || "Confirm",
1547
+ cancelText: a.confirmation.cancelText || "Cancel",
1548
+ type: a.confirmation.type || "danger",
1396
1549
  onConfirm: async () => {
1397
- l(null), await c(n);
1550
+ l(null), await c(a);
1398
1551
  }
1399
1552
  });
1400
1553
  return;
1401
1554
  }
1402
- await c(n);
1403
- }, c = async (n) => {
1404
- if (n.type === "button" || !n.type) {
1405
- i((u) => ({ ...u, [n.id]: !0 }));
1555
+ await c(a);
1556
+ }, c = async (a) => {
1557
+ if (a.type === "button" || !a.type) {
1558
+ i((u) => ({ ...u, [a.id]: !0 }));
1406
1559
  try {
1407
- await n.onClick(e, s);
1560
+ await a.onClick(e, n);
1408
1561
  } finally {
1409
- i((u) => ({ ...u, [n.id]: !1 }));
1562
+ i((u) => ({ ...u, [a.id]: !1 }));
1410
1563
  }
1411
1564
  }
1412
- }, d = async (n, u) => {
1565
+ }, d = async (a, u) => {
1413
1566
  const m = !u;
1414
- i((b) => ({ ...b, [n.id]: !0 }));
1567
+ i((f) => ({ ...f, [a.id]: !0 }));
1415
1568
  try {
1416
- await n.onChange(e, m, s);
1569
+ await a.onChange(e, m, n);
1417
1570
  } finally {
1418
- i((b) => ({ ...b, [n.id]: !1 }));
1571
+ i((f) => ({ ...f, [a.id]: !1 }));
1419
1572
  }
1420
1573
  };
1421
- return /* @__PURE__ */ y(Ce, { children: [
1422
- /* @__PURE__ */ a("div", { className: "flex items-center justify-end gap-2 pr-2", children: t.map((n) => {
1423
- if (typeof n.hide == "function" && n.hide(e) || typeof n.show == "function" && !n.show(e)) return null;
1424
- const u = typeof n.disabled == "function" ? n.disabled(e) : !!n.disabled, m = r[n.id] || (typeof n.loading == "function" ? n.loading(e) : !!n.loading), b = typeof n.label == "function" ? n.label(e) : n.label, f = nt(n.icon, e), k = typeof n.tooltip == "function" ? n.tooltip(e) : n.tooltip, C = typeof n.className == "function" ? n.className(e) : n.className || "";
1425
- if (n.type === "custom" && n.render)
1426
- return /* @__PURE__ */ a(Xe.Fragment, { children: n.render(e, s) }, n.id);
1427
- if (n.type === "switch") {
1428
- const N = n, w = N.checked(e);
1574
+ return /* @__PURE__ */ y(me, { children: [
1575
+ /* @__PURE__ */ o("div", { className: "flex items-center justify-end gap-2 pr-2", children: t.map((a) => {
1576
+ if (typeof a.hide == "function" && a.hide(e) || typeof a.show == "function" && !a.show(e)) return null;
1577
+ const u = typeof a.disabled == "function" ? a.disabled(e) : !!a.disabled, m = r[a.id] || (typeof a.loading == "function" ? a.loading(e) : !!a.loading), f = typeof a.label == "function" ? a.label(e) : a.label, b = qe(a.icon, e), h = typeof a.tooltip == "function" ? a.tooltip(e) : a.tooltip, k = typeof a.className == "function" ? a.className(e) : a.className || "";
1578
+ if (a.type === "custom" && a.render)
1579
+ return /* @__PURE__ */ o(Ke.Fragment, { children: a.render(e, n) }, a.id);
1580
+ if (a.type === "switch") {
1581
+ const w = a, x = w.checked(e);
1429
1582
  return /* @__PURE__ */ y(
1430
1583
  "div",
1431
1584
  {
1432
1585
  className: "flex items-center gap-2",
1433
- title: k || b,
1586
+ title: h || f,
1434
1587
  children: [
1435
- b && /* @__PURE__ */ y("span", { className: "text-xs font-semibold text-gray-500", children: [
1436
- b,
1588
+ f && /* @__PURE__ */ y("span", { className: "text-xs font-semibold text-gray-500", children: [
1589
+ f,
1437
1590
  ":"
1438
1591
  ] }),
1439
- /* @__PURE__ */ a(
1592
+ /* @__PURE__ */ o(
1440
1593
  "button",
1441
1594
  {
1442
1595
  type: "button",
1443
1596
  role: "switch",
1444
- "aria-checked": w,
1597
+ "aria-checked": x,
1445
1598
  disabled: u || m,
1446
- onClick: () => d(N, w),
1447
- className: `relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${w ? "bg-emerald-500" : "bg-gray-300 dark:bg-gray-700"} ${C}`,
1448
- children: /* @__PURE__ */ a(
1599
+ onClick: () => d(w, x),
1600
+ className: `relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${x ? "bg-emerald-500" : "bg-gray-300 dark:bg-gray-700"} ${k}`,
1601
+ children: /* @__PURE__ */ o(
1449
1602
  "span",
1450
1603
  {
1451
1604
  "aria-hidden": "true",
1452
- className: `pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out flex items-center justify-center ${w ? "translate-x-5" : "translate-x-0"}`,
1453
- children: m && /* @__PURE__ */ a("span", { className: "w-2.5 h-2.5 border-2 border-primary border-t-transparent rounded-full animate-spin" })
1605
+ className: `pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out flex items-center justify-center ${x ? "translate-x-5" : "translate-x-0"}`,
1606
+ children: m && /* @__PURE__ */ o("span", { className: "w-2.5 h-2.5 border-2 border-primary border-t-transparent rounded-full animate-spin" })
1454
1607
  }
1455
1608
  )
1456
1609
  }
1457
1610
  )
1458
1611
  ]
1459
1612
  },
1460
- n.id
1613
+ a.id
1461
1614
  );
1462
1615
  }
1463
- const D = typeof n.variant == "function" ? n.variant(e) : n.variant || "neutral", _ = Je[D] || Je.neutral, x = !b && f ? "p-2 min-w-[2rem]" : "px-3 py-1.5";
1616
+ const T = typeof a.variant == "function" ? a.variant(e) : a.variant || "neutral", $ = Ue[T] || Ue.neutral, p = !f && b ? "p-2 min-w-[2rem]" : "px-3 py-1.5";
1464
1617
  return /* @__PURE__ */ y(
1465
1618
  "button",
1466
1619
  {
1467
1620
  type: "button",
1468
1621
  disabled: u || m,
1469
- onClick: () => g(n),
1470
- title: k,
1471
- style: n.color ? { backgroundColor: n.color, color: "#ffffff" } : void 0,
1472
- className: `inline-flex items-center justify-center gap-1.5 ${x} rounded-xl text-xs font-bold transition-all duration-200 active:scale-95 disabled:cursor-not-allowed disabled:opacity-50 disabled:active:scale-100 ${_} ${C}`,
1622
+ onClick: () => g(a),
1623
+ title: h,
1624
+ style: a.color ? { backgroundColor: a.color, color: "#ffffff" } : void 0,
1625
+ className: `inline-flex items-center justify-center gap-1.5 ${p} rounded-xl text-xs font-bold transition-all duration-200 active:scale-95 disabled:cursor-not-allowed disabled:opacity-50 disabled:active:scale-100 ${$} ${k}`,
1473
1626
  children: [
1474
- m ? /* @__PURE__ */ a("span", { className: "w-3.5 h-3.5 border-2 border-current border-t-transparent rounded-full animate-spin" }) : f && /* @__PURE__ */ a("span", { className: "text-sm flex items-center justify-center shrink-0", children: f }),
1475
- b && /* @__PURE__ */ a("span", { children: b })
1627
+ m ? /* @__PURE__ */ o("span", { className: "w-3.5 h-3.5 border-2 border-current border-t-transparent rounded-full animate-spin" }) : b && /* @__PURE__ */ o("span", { className: "text-sm flex items-center justify-center shrink-0", children: b }),
1628
+ f && /* @__PURE__ */ o("span", { children: f })
1476
1629
  ]
1477
1630
  },
1478
- n.id
1631
+ a.id
1479
1632
  );
1480
1633
  }) }),
1481
- o && /* @__PURE__ */ a(
1482
- wr,
1634
+ s && /* @__PURE__ */ o(
1635
+ kr,
1483
1636
  {
1484
- isOpen: o.isOpen,
1485
- title: o.title,
1486
- message: o.message,
1487
- confirmText: o.confirmText,
1488
- cancelText: o.cancelText,
1489
- type: o.type,
1637
+ isOpen: s.isOpen,
1638
+ title: s.title,
1639
+ message: s.message,
1640
+ confirmText: s.confirmText,
1641
+ cancelText: s.cancelText,
1642
+ type: s.type,
1490
1643
  onClose: () => l(null),
1491
- onConfirm: o.onConfirm
1644
+ onConfirm: s.onConfirm
1492
1645
  }
1493
1646
  )
1494
1647
  ] });
1495
1648
  }, vr = ({
1496
1649
  rows: e,
1497
1650
  columns: t,
1498
- actions: s,
1499
- actionContext: o,
1651
+ actions: n,
1652
+ actionContext: s,
1500
1653
  rowKeyResolver: l,
1501
1654
  selectable: r,
1502
1655
  selectedKeys: i,
1503
1656
  onToggleSelectRow: g,
1504
1657
  onRowClick: c,
1505
1658
  striped: d = !1,
1506
- hoverable: n = !0,
1659
+ hoverable: a = !0,
1507
1660
  rowClassName: u
1508
1661
  }) => {
1509
- const m = ee(), b = !!(s && s.length > 0);
1510
- return /* @__PURE__ */ a("tbody", { className: m.classes?.tbody || "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900", children: e.map((f, k) => {
1511
- const C = l(f, k), D = i?.has(C), _ = typeof u == "function" ? u(f, k) : u || "";
1662
+ const m = Y(), f = !!(n && n.length > 0);
1663
+ return /* @__PURE__ */ o("tbody", { className: m.classes?.tbody || "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900", children: e.map((b, h) => {
1664
+ const k = l(b, h), T = i?.has(k), $ = typeof u == "function" ? u(b, h) : u || "";
1512
1665
  return /* @__PURE__ */ y(
1513
1666
  "tr",
1514
1667
  {
1515
- onClick: (x) => c?.(f, k, x),
1516
- className: `${m.classes?.tr || "transition-colors duration-150"} ${d && k % 2 === 1 ? "bg-gray-50/40 dark:bg-slate-800/20" : ""} ${n ? "hover:bg-gray-50/70 dark:hover:bg-slate-800/50" : ""} ${D ? "bg-primary/5 dark:bg-primary/10" : ""} ${c ? "cursor-pointer" : ""} ${_}`,
1668
+ onClick: (p) => c?.(b, h, p),
1669
+ className: `${m.classes?.tr || "transition-colors duration-150"} ${d && h % 2 === 1 ? "bg-gray-50/40 dark:bg-slate-800/20" : ""} ${a ? "hover:bg-gray-50/70 dark:hover:bg-slate-800/50" : ""} ${T ? "bg-primary/5 dark:bg-primary/10" : ""} ${c ? "cursor-pointer" : ""} ${$}`,
1517
1670
  children: [
1518
- r && /* @__PURE__ */ a(
1671
+ r && /* @__PURE__ */ o(
1519
1672
  "td",
1520
1673
  {
1521
1674
  className: "w-10 px-4 py-3 text-center align-middle",
1522
- onClick: (x) => x.stopPropagation(),
1523
- children: /* @__PURE__ */ a(
1675
+ onClick: (p) => p.stopPropagation(),
1676
+ children: /* @__PURE__ */ o(
1524
1677
  "input",
1525
1678
  {
1526
1679
  type: "checkbox",
1527
- checked: D,
1528
- onChange: () => g?.(C, f),
1680
+ checked: T,
1681
+ onChange: () => g?.(k, b),
1529
1682
  className: "w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-primary focus:ring-primary/30 cursor-pointer"
1530
1683
  }
1531
1684
  )
1532
1685
  }
1533
1686
  ),
1534
- t.map((x) => {
1535
- const N = x.align === "center" ? "text-center" : x.align === "right" ? "text-right" : "text-left", w = typeof x.className == "function" ? x.className(f?.[x.key], f, k) : x.className || "";
1536
- return /* @__PURE__ */ a(
1687
+ t.map((p) => {
1688
+ const w = p.align === "center" ? "text-center" : p.align === "right" ? "text-right" : "text-left", x = typeof p.className == "function" ? p.className(b?.[p.key], b, h) : p.className || "";
1689
+ return /* @__PURE__ */ o(
1537
1690
  "td",
1538
1691
  {
1539
1692
  style: {
1540
- width: x.width,
1541
- minWidth: x.minWidth,
1542
- maxWidth: x.maxWidth
1693
+ width: p.width,
1694
+ minWidth: p.minWidth,
1695
+ maxWidth: p.maxWidth
1543
1696
  },
1544
- className: `${m.classes?.td || "py-3 px-4 text-sm align-middle"} ${N} ${w}`,
1545
- children: /* @__PURE__ */ a(kr, { row: f, column: x, rowIndex: k })
1697
+ className: `${m.classes?.td || "py-3 px-4 text-sm align-middle"} ${w} ${x}`,
1698
+ children: /* @__PURE__ */ o(xr, { row: b, column: p, rowIndex: h })
1546
1699
  },
1547
- String(x.key)
1700
+ String(p.key)
1548
1701
  );
1549
1702
  }),
1550
- b && /* @__PURE__ */ a(
1703
+ f && /* @__PURE__ */ o(
1551
1704
  "td",
1552
1705
  {
1553
1706
  className: `${m.classes?.td || "py-3 px-4 text-sm align-middle"} text-right`,
1554
- onClick: (x) => x.stopPropagation(),
1555
- children: /* @__PURE__ */ a(
1556
- Nr,
1707
+ onClick: (p) => p.stopPropagation(),
1708
+ children: /* @__PURE__ */ o(
1709
+ wr,
1557
1710
  {
1558
- row: f,
1559
- actions: s || [],
1560
- context: o
1711
+ row: b,
1712
+ actions: n || [],
1713
+ context: s
1561
1714
  }
1562
1715
  )
1563
1716
  }
1564
1717
  )
1565
1718
  ]
1566
1719
  },
1567
- String(C)
1720
+ String(k)
1568
1721
  );
1569
1722
  }) });
1570
- }, Ar = ({
1723
+ }, Nr = ({
1571
1724
  page: e,
1572
1725
  pageSize: t,
1573
- totalRecords: s,
1574
- totalPages: o,
1726
+ totalRecords: n,
1727
+ totalPages: s,
1575
1728
  pageSizeOptions: l = [5, 10, 20, 50, 100],
1576
1729
  onPageChange: r,
1577
1730
  onPageSizeChange: i,
@@ -1579,78 +1732,78 @@ const Je = {
1579
1732
  showTotalCount: c = !0,
1580
1733
  pageWindow: d
1581
1734
  }) => {
1582
- const n = ee(), u = Math.min((e - 1) * t + 1, s), m = Math.min(e * t, s);
1735
+ const a = Y(), u = Math.min((e - 1) * t + 1, n), m = Math.min(e * t, n);
1583
1736
  return /* @__PURE__ */ y(
1584
1737
  "div",
1585
1738
  {
1586
- className: n.classes?.paginationContainer || "w-full flex flex-wrap items-center justify-between gap-4 pt-4 text-sm text-gray-600 dark:text-gray-400",
1739
+ className: a.classes?.paginationContainer || "w-full flex flex-wrap items-center justify-between gap-4 pt-4 text-sm text-gray-600 dark:text-gray-400",
1587
1740
  children: [
1588
1741
  /* @__PURE__ */ y("div", { className: "flex items-center gap-3", children: [
1589
- c && s > 0 ? /* @__PURE__ */ y("span", { className: "text-xs sm:text-sm font-medium", children: [
1742
+ c && n > 0 ? /* @__PURE__ */ y("span", { className: "text-xs sm:text-sm font-medium", children: [
1590
1743
  "Showing ",
1591
- /* @__PURE__ */ a("strong", { className: "text-gray-900 dark:text-white font-bold", children: u }),
1744
+ /* @__PURE__ */ o("strong", { className: "text-gray-900 dark:text-white font-bold", children: u }),
1592
1745
  " to",
1593
1746
  " ",
1594
- /* @__PURE__ */ a("strong", { className: "text-gray-900 dark:text-white font-bold", children: m }),
1747
+ /* @__PURE__ */ o("strong", { className: "text-gray-900 dark:text-white font-bold", children: m }),
1595
1748
  " of",
1596
1749
  " ",
1597
- /* @__PURE__ */ a("strong", { className: "text-gray-900 dark:text-white font-bold", children: s.toLocaleString() }),
1750
+ /* @__PURE__ */ o("strong", { className: "text-gray-900 dark:text-white font-bold", children: n.toLocaleString() }),
1598
1751
  " results"
1599
1752
  ] }) : /* @__PURE__ */ y("span", { className: "text-xs sm:text-sm font-medium", children: [
1600
1753
  "Page ",
1601
1754
  e,
1602
1755
  " of ",
1603
- o
1756
+ s
1604
1757
  ] }),
1605
1758
  g && /* @__PURE__ */ y("div", { className: "flex items-center gap-2 ml-2", children: [
1606
- /* @__PURE__ */ a("span", { className: "text-xs text-gray-500 hidden sm:inline", children: "Rows:" }),
1607
- /* @__PURE__ */ a(
1759
+ /* @__PURE__ */ o("span", { className: "text-xs text-gray-500 hidden sm:inline", children: "Rows:" }),
1760
+ /* @__PURE__ */ o(
1608
1761
  "select",
1609
1762
  {
1610
1763
  value: t,
1611
- onChange: (b) => i(Number(b.target.value)),
1612
- className: n.classes?.paginationSelect || "h-8 px-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-xs font-semibold text-gray-800 dark:text-gray-200 focus:outline-none focus:border-primary cursor-pointer",
1613
- children: l.map((b) => /* @__PURE__ */ y("option", { value: b, className: "bg-white dark:bg-slate-800 text-gray-900 dark:text-white", children: [
1614
- b,
1764
+ onChange: (f) => i(Number(f.target.value)),
1765
+ className: a.classes?.paginationSelect || "h-8 px-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-xs font-semibold text-gray-800 dark:text-gray-200 focus:outline-none focus:border-primary cursor-pointer",
1766
+ children: l.map((f) => /* @__PURE__ */ y("option", { value: f, className: "bg-white dark:bg-slate-800 text-gray-900 dark:text-white", children: [
1767
+ f,
1615
1768
  " / page"
1616
- ] }, b))
1769
+ ] }, f))
1617
1770
  }
1618
1771
  )
1619
1772
  ] })
1620
1773
  ] }),
1621
1774
  /* @__PURE__ */ y("div", { className: "flex items-center gap-1.5 ml-auto", children: [
1622
- /* @__PURE__ */ a(
1775
+ /* @__PURE__ */ o(
1623
1776
  "button",
1624
1777
  {
1625
1778
  type: "button",
1626
1779
  disabled: e <= 1,
1627
1780
  onClick: () => r(e - 1),
1628
1781
  "aria-label": "Previous Page",
1629
- className: `${n.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40"}`,
1782
+ className: `${a.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40"}`,
1630
1783
  children: "‹"
1631
1784
  }
1632
1785
  ),
1633
- d.map((b) => {
1634
- const f = b === e;
1635
- return /* @__PURE__ */ a(
1786
+ d.map((f) => {
1787
+ const b = f === e;
1788
+ return /* @__PURE__ */ o(
1636
1789
  "button",
1637
1790
  {
1638
1791
  type: "button",
1639
- onClick: () => r(b),
1640
- className: `${n.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs"} ${f ? n.classes?.paginationButtonActive || "bg-primary text-white shadow-sm shadow-primary/30" : "bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700"}`,
1641
- children: b
1792
+ onClick: () => r(f),
1793
+ className: `${a.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs"} ${b ? a.classes?.paginationButtonActive || "bg-primary text-white shadow-sm shadow-primary/30" : "bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700"}`,
1794
+ children: f
1642
1795
  },
1643
- b
1796
+ f
1644
1797
  );
1645
1798
  }),
1646
- /* @__PURE__ */ a(
1799
+ /* @__PURE__ */ o(
1647
1800
  "button",
1648
1801
  {
1649
1802
  type: "button",
1650
- disabled: e >= o,
1803
+ disabled: e >= s,
1651
1804
  onClick: () => r(e + 1),
1652
1805
  "aria-label": "Next Page",
1653
- className: `${n.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40"}`,
1806
+ className: `${a.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40"}`,
1654
1807
  children: "›"
1655
1808
  }
1656
1809
  )
@@ -1658,12 +1811,12 @@ const Je = {
1658
1811
  ]
1659
1812
  }
1660
1813
  );
1661
- }, Cr = ({
1814
+ }, Ar = ({
1662
1815
  columnsCount: e = 5,
1663
1816
  rowsCount: t = 5,
1664
- hasActions: s = !0
1665
- }) => /* @__PURE__ */ a("tbody", { className: "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900", children: Array.from({ length: t }).map((o, l) => /* @__PURE__ */ y("tr", { className: "any-table-pulse", children: [
1666
- Array.from({ length: e }).map((r, i) => /* @__PURE__ */ a("td", { className: "py-4 px-4 align-middle", children: /* @__PURE__ */ a(
1817
+ hasActions: n = !0
1818
+ }) => /* @__PURE__ */ o("tbody", { className: "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900", children: Array.from({ length: t }).map((s, l) => /* @__PURE__ */ y("tr", { className: "any-table-pulse", children: [
1819
+ Array.from({ length: e }).map((r, i) => /* @__PURE__ */ o("td", { className: "py-4 px-4 align-middle", children: /* @__PURE__ */ o(
1667
1820
  "div",
1668
1821
  {
1669
1822
  className: "h-4 bg-gray-200 dark:bg-slate-700/60 rounded-md",
@@ -1672,34 +1825,38 @@ const Je = {
1672
1825
  }
1673
1826
  }
1674
1827
  ) }, i)),
1675
- s && /* @__PURE__ */ a("td", { className: "py-4 px-4 text-right align-middle pr-6", children: /* @__PURE__ */ y("div", { className: "inline-flex gap-2 justify-end", children: [
1676
- /* @__PURE__ */ a("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" }),
1677
- /* @__PURE__ */ a("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" })
1828
+ n && /* @__PURE__ */ o("td", { className: "py-4 px-4 text-right align-middle pr-6", children: /* @__PURE__ */ y("div", { className: "inline-flex gap-2 justify-end", children: [
1829
+ /* @__PURE__ */ o("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" }),
1830
+ /* @__PURE__ */ o("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" })
1678
1831
  ] }) })
1679
- ] }, l)) }), Sr = ({
1832
+ ] }, l)) }), Cr = ({
1680
1833
  title: e,
1681
1834
  description: t,
1682
- isSearchActive: s = !1,
1683
- onClearSearch: o
1684
- }) => /* @__PURE__ */ y("div", { className: "w-full py-16 px-6 flex flex-col items-center justify-center text-center any-table-fade-in", children: [
1685
- /* @__PURE__ */ a("div", { className: "w-16 h-16 mb-4 rounded-2xl bg-gray-100 dark:bg-slate-800 text-gray-400 dark:text-gray-500 flex items-center justify-center text-3xl shadow-inner", children: s ? "🔍" : "📂" }),
1686
- /* @__PURE__ */ a("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1", children: e || (s ? "No matching records found" : "No data available") }),
1687
- /* @__PURE__ */ a("p", { className: "text-sm text-gray-500 dark:text-gray-400 max-w-sm mb-5 leading-relaxed", children: t || (s ? "Try adjusting your search criteria or clear the search filter." : "There are currently no records to display.") }),
1688
- s && o && /* @__PURE__ */ a(
1689
- "button",
1690
- {
1691
- type: "button",
1692
- onClick: o,
1693
- className: "px-4 py-2 rounded-xl bg-primary text-white text-xs font-bold hover:bg-primary-soft transition-all shadow-sm shadow-primary/20 active:scale-95",
1694
- children: "Clear Search Filter"
1695
- }
1696
- )
1697
- ] }), Tr = ({ error: e, onRetry: t }) => {
1698
- const s = typeof e == "string" ? e : e?.message || e?.response?.data?.message || "Failed to load table data.";
1835
+ isSearchActive: n = !1,
1836
+ onClearSearch: s,
1837
+ colSpan: l
1838
+ }) => {
1839
+ const g = /* @__PURE__ */ y("div", { className: "w-full py-16 px-6 flex flex-col items-center justify-center text-center any-table-fade-in", children: [
1840
+ /* @__PURE__ */ o("div", { className: "w-16 h-16 mb-4 rounded-2xl bg-gray-100 dark:bg-slate-800 text-gray-400 dark:text-gray-500 flex items-center justify-center text-3xl shadow-inner", children: n ? "🔍" : "📂" }),
1841
+ /* @__PURE__ */ o("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1", children: e || (n ? "No matching records found" : "No data available") }),
1842
+ /* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400 max-w-sm mb-5 leading-relaxed", children: t || (n ? "Try adjusting your search criteria or clear the search filter." : "There are currently no records to display.") }),
1843
+ n && s && /* @__PURE__ */ o(
1844
+ "button",
1845
+ {
1846
+ type: "button",
1847
+ onClick: s,
1848
+ className: "px-4 py-2 rounded-xl bg-primary text-white text-xs font-bold hover:bg-primary-soft transition-all shadow-sm shadow-primary/20 active:scale-95",
1849
+ children: "Clear Search Filter"
1850
+ }
1851
+ )
1852
+ ] });
1853
+ return l !== void 0 ? /* @__PURE__ */ o("tbody", { children: /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: l, className: "p-0", children: g }) }) }) : g;
1854
+ }, Sr = ({ error: e, onRetry: t }) => {
1855
+ const n = typeof e == "string" ? e : e?.message || e?.response?.data?.message || "Failed to load table data.";
1699
1856
  return /* @__PURE__ */ y("div", { className: "w-full py-14 px-6 flex flex-col items-center justify-center text-center any-table-fade-in", children: [
1700
- /* @__PURE__ */ a("div", { className: "w-14 h-14 mb-4 rounded-2xl bg-rose-500/10 text-rose-500 flex items-center justify-center text-2xl border border-rose-500/20", children: "⚠️" }),
1701
- /* @__PURE__ */ a("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1", children: "Unable to load data" }),
1702
- /* @__PURE__ */ a("p", { className: "text-xs sm:text-sm text-rose-600 dark:text-rose-400 font-medium max-w-md mb-5 leading-relaxed bg-rose-500/5 px-3 py-1.5 rounded-lg border border-rose-500/10", children: s }),
1857
+ /* @__PURE__ */ o("div", { className: "w-14 h-14 mb-4 rounded-2xl bg-rose-500/10 text-rose-500 flex items-center justify-center text-2xl border border-rose-500/20", children: "⚠️" }),
1858
+ /* @__PURE__ */ o("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1", children: "Unable to load data" }),
1859
+ /* @__PURE__ */ o("p", { className: "text-xs sm:text-sm text-rose-600 dark:text-rose-400 font-medium max-w-md mb-5 leading-relaxed bg-rose-500/5 px-3 py-1.5 rounded-lg border border-rose-500/10", children: n }),
1703
1860
  t && /* @__PURE__ */ y(
1704
1861
  "button",
1705
1862
  {
@@ -1707,365 +1864,301 @@ const Je = {
1707
1864
  onClick: t,
1708
1865
  className: "inline-flex items-center gap-2 px-4 py-2 rounded-xl bg-gray-900 dark:bg-white text-white dark:text-gray-900 text-xs font-bold hover:bg-gray-800 dark:hover:bg-gray-100 transition-all shadow-md active:scale-95",
1709
1866
  children: [
1710
- /* @__PURE__ */ a("span", { children: "🔄" }),
1711
- /* @__PURE__ */ a("span", { children: "Retry Request" })
1867
+ /* @__PURE__ */ o("span", { children: "🔄" }),
1868
+ /* @__PURE__ */ o("span", { children: "Retry Request" })
1712
1869
  ]
1713
1870
  }
1714
1871
  )
1715
1872
  ] });
1716
1873
  };
1717
- function qe(e) {
1874
+ function Ie(e) {
1718
1875
  const {
1719
1876
  data: t,
1720
- api: s,
1721
- columns: o,
1877
+ api: n,
1878
+ columns: s,
1722
1879
  autoColumns: l = !0,
1723
1880
  rowKey: r,
1724
1881
  title: i,
1725
1882
  subtitle: g,
1726
1883
  actions: c,
1727
1884
  actionsTitle: d = "Actions",
1728
- actionsWidth: n,
1885
+ actionsWidth: a,
1729
1886
  search: u = !0,
1730
1887
  sorting: m = !0,
1731
- pagination: b = !0,
1732
- selectable: f = !1,
1733
- onSelectionChange: k,
1734
- onRowClick: C,
1735
- loading: D,
1736
- loadingComponent: _,
1737
- emptyComponent: x,
1738
- emptyTitle: N,
1739
- emptyDescription: w,
1740
- errorComponent: R,
1741
- className: H = "",
1742
- tableClassName: L = "",
1743
- headerClassName: ye = "",
1744
- rowClassName: j,
1745
- headerActions: F,
1746
- showHeader: U = !0,
1747
- bordered: te = !0,
1748
- striped: V = !1,
1749
- hoverable: Y = !0,
1750
- compact: K = !1,
1751
- stickyHeader: Z = !1,
1752
- tableRef: B,
1888
+ pagination: f = !0,
1889
+ selectable: b = !1,
1890
+ onSelectionChange: h,
1891
+ onRowClick: k,
1892
+ loading: T,
1893
+ loadingComponent: $,
1894
+ emptyComponent: p,
1895
+ emptyTitle: w,
1896
+ emptyDescription: x,
1897
+ errorComponent: M,
1898
+ className: z = "",
1899
+ tableClassName: W = "",
1900
+ headerClassName: oe = "",
1901
+ rowClassName: D,
1902
+ headerActions: _,
1903
+ showHeader: F = !0,
1904
+ bordered: Z = !0,
1905
+ striped: O = !1,
1906
+ hoverable: R = !0,
1907
+ compact: L = !1,
1908
+ stickyHeader: U = !1,
1909
+ tableRef: P,
1753
1910
  // Legacy Wasel Props
1754
- thead: I,
1755
- headerData: Pe,
1756
- tbodys: Ee,
1757
- titleHeader: st,
1758
- add: Be,
1759
- linkAdd: $e,
1760
- addHandler: De,
1761
- view: Me,
1762
- linkView: re,
1763
- viewHandler: ae,
1764
- edit: _e,
1765
- linkEdit: ne,
1766
- editHandler: se,
1767
- del: je,
1768
- handleDelete: he,
1769
- block: Fe,
1770
- handleBlock: pe,
1771
- buttons: oe
1772
- } = e, v = ee(), ie = W(() => t || Ee || void 0, [t, Ee]), G = W(() => Ut({
1773
- data: ie,
1774
- columns: o,
1911
+ thead: H,
1912
+ headerData: ye,
1913
+ tbodys: he,
1914
+ titleHeader: Xe,
1915
+ add: Qe,
1916
+ linkAdd: et,
1917
+ addHandler: tt,
1918
+ view: pe,
1919
+ linkView: xe,
1920
+ viewHandler: ke,
1921
+ edit: we,
1922
+ linkEdit: ve,
1923
+ editHandler: Ne,
1924
+ del: Ae,
1925
+ handleDelete: Ce,
1926
+ block: Se,
1927
+ handleBlock: Te,
1928
+ buttons: Pe
1929
+ } = e, v = Y(), J = B(() => t || he || void 0, [t, he]), I = B(() => Lt({
1930
+ data: J,
1931
+ columns: s,
1775
1932
  autoColumns: l,
1776
- thead: I,
1777
- headerData: Pe
1778
- }).filter((h) => typeof h.hidden == "function" ? !h.hidden({ data: ie || [] }) : !h.hidden), [ie, o, l, I, Pe]), O = A(
1779
- (p, h) => {
1933
+ thead: H,
1934
+ headerData: ye
1935
+ }).filter((j) => typeof j.hidden == "function" ? !j.hidden({ data: J || [] }) : !j.hidden), [J, s, l, H, ye]), Ee = N(
1936
+ (C, j) => {
1780
1937
  if (typeof r == "function")
1781
- return r(p, h);
1938
+ return r(C, j);
1782
1939
  if (typeof r == "string") {
1783
- const M = P(p, r);
1784
- if (M != null) return M;
1940
+ const be = S(C, r);
1941
+ if (be != null) return be;
1785
1942
  }
1786
- const E = p?._id ?? p?.id ?? p?.key;
1787
- return E ?? h;
1943
+ const ge = C?._id ?? C?.id ?? C?.key;
1944
+ return ge ?? j;
1788
1945
  },
1789
1946
  [r]
1790
1947
  ), {
1791
- enabled: We,
1792
- search: Re,
1793
- debouncedSearch: ze,
1794
- isDebouncing: ot,
1795
- setSearch: Le,
1796
- clearSearch: xe,
1797
- searchConfig: it
1798
- } = Kt({ config: u }), {
1799
- enabled: lt,
1800
- sortBy: ke,
1801
- sortOrder: we,
1802
- toggleSort: dt,
1803
- setSorting: ct,
1804
- resetSorting: gt
1805
- } = It({ config: m }), Oe = W(() => {
1806
- const p = [...c || []];
1807
- return oe && Array.isArray(oe) && oe.forEach((h, E) => {
1808
- p.push({
1809
- id: `legacy-btn-${E}`,
1810
- label: h.label,
1811
- icon: h.icon,
1812
- className: h.className,
1813
- show: h.show,
1814
- hide: h.hide,
1815
- onClick: (M) => h.onClick(M)
1816
- });
1817
- }), Fe && pe && p.push({
1818
- id: "legacy-block",
1819
- label: (h) => h.isBanned || !h.isActive ? "Unblock" : "Block",
1820
- variant: (h) => h.isBanned || !h.isActive ? "success" : "danger",
1821
- onClick: (h) => pe(h?._id || h?.id)
1822
- }), Me && (ae || re) && p.push({
1823
- id: "legacy-view",
1824
- label: "View",
1825
- variant: "primary",
1826
- onClick: (h) => {
1827
- const E = h?._id || h?.id;
1828
- ae ? ae(E) : re && typeof window < "u" && (window.location.href = `${re}/${E}`);
1829
- }
1830
- }), _e && (se || ne) && p.push({
1831
- id: "legacy-edit",
1832
- label: "Edit",
1833
- variant: "info",
1834
- onClick: (h) => {
1835
- const E = h?._id || h?.id;
1836
- se ? se(E) : ne && typeof window < "u" && (window.location.href = `${ne}/${E}`);
1837
- }
1838
- }), je && he && p.push({
1839
- id: "legacy-del",
1840
- label: "Delete",
1841
- variant: "danger",
1842
- confirmation: {
1843
- title: "Delete Item",
1844
- message: "Are you sure you want to delete this record?"
1845
- },
1846
- onClick: (h) => he(h?._id || h?.id)
1847
- }), p;
1848
- }, [
1849
- c,
1850
- oe,
1851
- Fe,
1852
- pe,
1853
- Me,
1854
- re,
1855
- ae,
1856
- _e,
1857
- ne,
1858
- se,
1859
- je,
1860
- he
1861
- ]), [mt, ut] = S(1), [bt, ft] = S(10), {
1862
- rows: T,
1863
- totalRecords: Ne,
1864
- loading: le,
1865
- error: J,
1866
- refresh: q,
1867
- isServerMode: yt
1868
- } = tr({
1869
- data: ie,
1870
- api: s,
1871
- columns: G,
1872
- searchQuery: ze,
1873
- sortBy: ke,
1874
- sortOrder: we,
1875
- page: mt,
1948
+ enabled: rt,
1949
+ search: $e,
1950
+ debouncedSearch: at,
1951
+ isDebouncing: nt,
1952
+ setSearch: Be,
1953
+ clearSearch: De,
1954
+ searchConfig: ot
1955
+ } = Ot({ config: u }), {
1956
+ enabled: st,
1957
+ sortBy: se,
1958
+ sortOrder: ie,
1959
+ toggleSort: it,
1960
+ setSorting: lt,
1961
+ resetSorting: dt
1962
+ } = Rt({ config: m }), Me = B(
1963
+ () => Ht({
1964
+ explicitActions: c,
1965
+ buttons: Pe,
1966
+ block: Se,
1967
+ handleBlock: Te,
1968
+ view: pe,
1969
+ linkView: xe,
1970
+ viewHandler: ke,
1971
+ edit: we,
1972
+ linkEdit: ve,
1973
+ editHandler: Ne,
1974
+ del: Ae,
1975
+ handleDelete: Ce
1976
+ }),
1977
+ [
1978
+ c,
1979
+ Pe,
1980
+ Se,
1981
+ Te,
1982
+ pe,
1983
+ xe,
1984
+ ke,
1985
+ we,
1986
+ ve,
1987
+ Ne,
1988
+ Ae,
1989
+ Ce
1990
+ ]
1991
+ ), [ct, gt] = A(1), [bt, mt] = A(10), {
1992
+ rows: K,
1993
+ totalRecords: le,
1994
+ loading: q,
1995
+ error: X,
1996
+ refresh: V,
1997
+ isServerMode: ut
1998
+ } = Xt({
1999
+ data: J,
2000
+ api: n,
2001
+ columns: I,
2002
+ searchQuery: at,
2003
+ sortBy: se,
2004
+ sortOrder: ie,
2005
+ page: ct,
1876
2006
  pageSize: bt,
1877
- manualLoading: D
2007
+ manualLoading: T
1878
2008
  }), {
1879
- enabled: ht,
1880
- page: de,
1881
- pageSize: ve,
1882
- totalPages: He,
1883
- pageSizeOptions: pt,
1884
- setPage: ce,
1885
- setPageSize: Ue,
1886
- resetPagination: xt,
1887
- getPageWindow: kt,
1888
- paginationConfig: Ke
1889
- } = Gt({
1890
- config: b,
1891
- totalRecords: Ne,
1892
- onPageChange: (p, h) => {
1893
- ut(p), ft(h);
2009
+ enabled: ft,
2010
+ page: Q,
2011
+ pageSize: de,
2012
+ totalPages: _e,
2013
+ pageSizeOptions: yt,
2014
+ setPage: ee,
2015
+ setPageSize: je,
2016
+ resetPagination: ht,
2017
+ getPageWindow: pt,
2018
+ paginationConfig: We
2019
+ } = Ut({
2020
+ config: f,
2021
+ totalRecords: le,
2022
+ onPageChange: (C, j) => {
2023
+ gt(C), mt(j);
1894
2024
  }
1895
- }), [z, ge] = S(/* @__PURE__ */ new Set()), wt = A(
1896
- (p, h) => {
1897
- ge((E) => {
1898
- const M = new Set(E);
1899
- if (M.has(p) ? M.delete(p) : M.add(p), k) {
1900
- const Pt = T.filter((Et, Bt) => M.has(O(Et, Bt)));
1901
- k(Pt, Array.from(M));
1902
- }
1903
- return M;
1904
- });
1905
- },
1906
- [T, O, k]
1907
- ), Nt = A(() => {
1908
- if (z.size === T.length && T.length > 0)
1909
- ge(/* @__PURE__ */ new Set()), k?.([], []);
1910
- else {
1911
- const p = new Set(T.map((h, E) => O(h, E)));
1912
- ge(p), k?.(T, Array.from(p));
1913
- }
1914
- }, [T, z.size, O, k]), vt = A(() => {
1915
- ge(/* @__PURE__ */ new Set()), k?.([], []);
1916
- }, [k]), At = T.length > 0 && z.size === T.length, Ct = z.size > 0 && z.size < T.length, Ae = W(
2025
+ }), {
2026
+ selectedKeys: ze,
2027
+ selectedRows: te,
2028
+ onToggleSelectRow: xt,
2029
+ handleToggleSelectAll: kt,
2030
+ clearSelection: wt,
2031
+ allSelected: vt,
2032
+ isIndeterminate: Nt
2033
+ } = er({
2034
+ rows: K,
2035
+ rowKeyResolver: Ee,
2036
+ onSelectionChange: h
2037
+ }), At = B(
1917
2038
  () => ({
1918
- refresh: q,
1919
- loading: le,
1920
- page: de,
1921
- selectedRows: T.filter((p, h) => z.has(O(p, h))),
1922
- setPage: ce
2039
+ refresh: V,
2040
+ loading: q,
2041
+ page: Q,
2042
+ selectedRows: te,
2043
+ setPage: ee
1923
2044
  }),
1924
- [q, le, de, T, z, O, ce]
2045
+ [V, q, Q, te, ee]
1925
2046
  );
1926
- rr({
1927
- tableRef: B,
1928
- refresh: q,
1929
- resetPagination: xt,
1930
- resetSearch: xe,
1931
- resetSorting: gt,
1932
- setPage: ce,
1933
- setPageSize: Ue,
1934
- setSearch: Le,
1935
- setSorting: ct,
1936
- selectedRows: Ae.selectedRows,
1937
- clearSelection: vt,
2047
+ Qt({
2048
+ tableRef: P,
2049
+ refresh: V,
2050
+ resetPagination: ht,
2051
+ resetSearch: De,
2052
+ resetSorting: dt,
2053
+ setPage: ee,
2054
+ setPageSize: je,
2055
+ setSearch: Be,
2056
+ setSorting: lt,
2057
+ selectedRows: te,
2058
+ clearSelection: wt,
1938
2059
  getState: () => ({
1939
- data: T,
1940
- loading: le,
1941
- error: J,
1942
- page: de,
1943
- pageSize: ve,
1944
- total: Ne,
1945
- totalPages: He,
1946
- search: Re,
1947
- sortBy: ke,
1948
- sortOrder: we,
1949
- selectedRowKeys: Array.from(z),
1950
- selectedRows: Ae.selectedRows,
1951
- isServerMode: yt
2060
+ data: K,
2061
+ loading: q,
2062
+ error: X,
2063
+ page: Q,
2064
+ pageSize: de,
2065
+ total: le,
2066
+ totalPages: _e,
2067
+ search: $e,
2068
+ sortBy: se,
2069
+ sortOrder: ie,
2070
+ selectedRowKeys: Array.from(ze),
2071
+ selectedRows: te,
2072
+ isServerMode: ut
1952
2073
  })
1953
2074
  });
1954
- const X = i || st, me = Oe.length > 0, St = !!(X || g || We || F || Be), Tt = W(() => {
1955
- const p = {};
1956
- return v.borderRadius && (p["--any-table-radius"] = v.borderRadius), v.fontFamily && (p["--any-table-font"] = v.fontFamily, p.fontFamily = v.fontFamily), v.colors?.primary && (p["--any-table-primary"] = v.colors.primary), v.colors?.primaryHover && (p["--any-table-primary-hover"] = v.colors.primaryHover), v.colors?.border && (p["--any-table-border"] = v.colors.border), p;
2075
+ const Ct = i || Xe, ce = Me.length > 0, St = B(() => {
2076
+ const C = {};
2077
+ return v.borderRadius && (C["--any-table-radius"] = v.borderRadius), v.fontFamily && (C["--any-table-font"] = v.fontFamily, C.fontFamily = v.fontFamily), v.colors?.primary && (C["--any-table-primary"] = v.colors.primary), v.colors?.primaryHover && (C["--any-table-primary-hover"] = v.colors.primaryHover), v.colors?.border && (C["--any-table-border"] = v.colors.border), C;
1957
2078
  }, [v]);
1958
2079
  return /* @__PURE__ */ y(
1959
2080
  "div",
1960
2081
  {
1961
- style: Tt,
1962
- className: `any-table-wrapper ${v.classes?.container || "w-full flex flex-col gap-4 font-sans text-gray-900 dark:text-gray-100"} ${H}`,
2082
+ style: St,
2083
+ className: `any-table-wrapper ${v.classes?.container || "w-full flex flex-col gap-4 font-sans text-gray-900 dark:text-gray-100"} ${z}`,
1963
2084
  children: [
1964
- St && /* @__PURE__ */ y("div", { className: "w-full flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-1", children: [
1965
- (X || g) && /* @__PURE__ */ y("div", { className: "flex flex-col", children: [
1966
- X && /* @__PURE__ */ a("h3", { className: "text-lg font-bold tracking-tight text-gray-900 dark:text-white flex items-center gap-2", children: X }),
1967
- g && /* @__PURE__ */ a("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-0.5", children: g })
1968
- ] }),
1969
- /* @__PURE__ */ y("div", { className: "flex flex-wrap items-center gap-3 w-full sm:w-auto justify-start sm:justify-end ml-auto", children: [
1970
- We && /* @__PURE__ */ a(
1971
- nr,
1972
- {
1973
- value: Re,
1974
- onChange: Le,
1975
- onClear: xe,
1976
- isDebouncing: ot,
1977
- placeholder: it.placeholder
1978
- }
1979
- ),
1980
- F,
1981
- Be && /* @__PURE__ */ y(
1982
- "button",
1983
- {
1984
- type: "button",
1985
- onClick: () => {
1986
- De ? De() : $e && typeof window < "u" && (window.location.href = $e);
1987
- },
1988
- className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-xl bg-primary text-white text-xs sm:text-sm font-bold hover:bg-primary-soft transition-all shadow-sm shadow-primary/20 active:scale-95 whitespace-nowrap",
1989
- children: [
1990
- /* @__PURE__ */ a("span", { children: "+" }),
1991
- /* @__PURE__ */ y("span", { children: [
1992
- "Add ",
1993
- X || "Record"
1994
- ] })
1995
- ]
1996
- }
1997
- )
1998
- ] })
1999
- ] }),
2000
- /* @__PURE__ */ a(
2085
+ /* @__PURE__ */ o(
2086
+ ar,
2087
+ {
2088
+ displayTitle: Ct,
2089
+ subtitle: g,
2090
+ isSearchEnabled: rt,
2091
+ searchQuery: $e,
2092
+ setSearch: Be,
2093
+ clearSearch: De,
2094
+ isDebouncing: nt,
2095
+ searchPlaceholder: ot.placeholder,
2096
+ headerActions: _,
2097
+ add: Qe,
2098
+ linkAdd: et,
2099
+ addHandler: tt
2100
+ }
2101
+ ),
2102
+ /* @__PURE__ */ o(
2001
2103
  "div",
2002
2104
  {
2003
2105
  style: v.borderRadius ? { borderRadius: v.borderRadius } : void 0,
2004
- className: `${v.classes?.tableWrapper || "w-full overflow-x-auto rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-slate-900 shadow-sm transition-colors"} ${te ? "border border-gray-200 dark:border-gray-800" : "border-0 shadow-none"}`,
2005
- children: J ? typeof R == "function" ? R(J, q) : R || /* @__PURE__ */ a(Tr, { error: J, onRetry: q }) : /* @__PURE__ */ y(
2106
+ className: `${v.classes?.tableWrapper || "w-full overflow-x-auto rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-slate-900 shadow-sm transition-colors"} ${Z ? "" : "border-0 shadow-none"}`,
2107
+ children: X ? typeof M == "function" ? M(X, V) : M || /* @__PURE__ */ o(Sr, { error: X, onRetry: V }) : /* @__PURE__ */ y(
2006
2108
  "table",
2007
2109
  {
2008
- className: `${v.classes?.table || "w-full border-collapse text-left text-sm"} ${K || v.density === "compact" ? "text-xs" : ""} ${Z ? "relative" : ""} ${L}`,
2110
+ className: `${v.classes?.table || "w-full border-collapse text-left text-sm"} ${L || v.density === "compact" ? "text-xs" : ""} ${U ? "relative" : ""} ${W}`,
2009
2111
  children: [
2010
- U && /* @__PURE__ */ a(
2011
- sr,
2112
+ F && /* @__PURE__ */ o(
2113
+ nr,
2012
2114
  {
2013
- columns: G,
2014
- hasActions: me,
2115
+ columns: I,
2116
+ hasActions: ce,
2015
2117
  actionsTitle: d,
2016
- actionsWidth: n,
2017
- sortBy: ke,
2018
- sortOrder: we,
2019
- onSort: lt ? dt : void 0,
2020
- selectable: f,
2021
- allSelected: At,
2022
- isIndeterminate: Ct,
2023
- onToggleSelectAll: Nt,
2024
- headerClassName: ye
2118
+ actionsWidth: a,
2119
+ sortBy: se,
2120
+ sortOrder: ie,
2121
+ onSort: st ? it : void 0,
2122
+ selectable: b,
2123
+ allSelected: vt,
2124
+ isIndeterminate: Nt,
2125
+ onToggleSelectAll: kt,
2126
+ headerClassName: oe
2025
2127
  }
2026
2128
  ),
2027
- le && T.length === 0 ? _ ? /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: G.length + (f ? 1 : 0) + (me ? 1 : 0), children: _ }) }) }) : /* @__PURE__ */ a(
2028
- Cr,
2129
+ q && K.length === 0 ? $ || /* @__PURE__ */ o(
2130
+ Ar,
2029
2131
  {
2030
- columnsCount: G.length + (f ? 1 : 0),
2031
- rowsCount: ve || 5,
2032
- hasActions: me
2132
+ columnsCount: I.length + (b ? 1 : 0) + (ce ? 1 : 0),
2133
+ rowsCount: de || 5
2033
2134
  }
2034
- ) : T.length === 0 ? (
2035
- /* Empty State */
2036
- /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
2037
- "td",
2135
+ ) : K.length === 0 ? (
2136
+ // Empty State
2137
+ p || /* @__PURE__ */ o(
2138
+ Cr,
2038
2139
  {
2039
- colSpan: G.length + (f ? 1 : 0) + (me ? 1 : 0),
2040
- className: "p-0",
2041
- children: x || /* @__PURE__ */ a(
2042
- Sr,
2043
- {
2044
- title: N,
2045
- description: w,
2046
- isSearchActive: !!ze,
2047
- onClearSearch: xe
2048
- }
2049
- )
2140
+ title: w,
2141
+ description: x,
2142
+ colSpan: I.length + (b ? 1 : 0) + (ce ? 1 : 0)
2050
2143
  }
2051
- ) }) })
2144
+ )
2052
2145
  ) : (
2053
- /* Body Rows */
2054
- /* @__PURE__ */ a(
2146
+ // Table Body
2147
+ /* @__PURE__ */ o(
2055
2148
  vr,
2056
2149
  {
2057
- rows: T,
2058
- columns: G,
2059
- actions: Oe,
2060
- actionContext: Ae,
2061
- rowKeyResolver: O,
2062
- selectable: f,
2063
- selectedKeys: z,
2064
- onToggleSelectRow: wt,
2065
- onRowClick: C,
2066
- striped: V,
2067
- hoverable: Y,
2068
- rowClassName: j
2150
+ rows: K,
2151
+ columns: I,
2152
+ actions: Me,
2153
+ actionContext: At,
2154
+ rowKeyResolver: Ee,
2155
+ selectable: b,
2156
+ selectedKeys: ze,
2157
+ onToggleSelectRow: xt,
2158
+ onRowClick: k,
2159
+ striped: O,
2160
+ hoverable: R,
2161
+ rowClassName: D
2069
2162
  }
2070
2163
  )
2071
2164
  )
@@ -2074,80 +2167,83 @@ function qe(e) {
2074
2167
  )
2075
2168
  }
2076
2169
  ),
2077
- ht && !J && /* @__PURE__ */ a(
2078
- Ar,
2170
+ ft && /* @__PURE__ */ o(
2171
+ Nr,
2079
2172
  {
2080
- page: de,
2081
- pageSize: ve,
2082
- totalRecords: Ne,
2083
- totalPages: He,
2084
- pageSizeOptions: pt,
2085
- onPageChange: ce,
2086
- onPageSizeChange: Ue,
2087
- showPageSizeSelector: Ke.showPageSizeSelector,
2088
- showTotalCount: Ke.showTotalCount,
2089
- pageWindow: kt(5)
2173
+ page: Q,
2174
+ pageSize: de,
2175
+ totalRecords: le,
2176
+ totalPages: _e,
2177
+ pageSizeOptions: yt,
2178
+ onPageChange: ee,
2179
+ onPageSizeChange: je,
2180
+ showPageSizeSelector: We.showPageSizeSelector,
2181
+ showTotalCount: We.showTotalCount,
2182
+ pageWindow: pt(5)
2090
2183
  }
2091
2184
  )
2092
2185
  ]
2093
2186
  }
2094
2187
  );
2095
2188
  }
2096
- function Br(e) {
2097
- return !e.theme && !e.preset ? /* @__PURE__ */ a(qe, { ...e }) : /* @__PURE__ */ a(ar, { theme: e.theme, preset: e.preset, children: /* @__PURE__ */ a(qe, { ...e }) });
2189
+ function Er(e) {
2190
+ return !e.theme && !e.preset ? /* @__PURE__ */ o(Ie, { ...e }) : /* @__PURE__ */ o(tr, { theme: e.theme, preset: e.preset, children: /* @__PURE__ */ o(Ie, { ...e }) });
2098
2191
  }
2099
2192
  export {
2100
- Nr as ActionRenderer,
2101
- Br as AnyTable,
2102
- qe as AnyTableInner,
2103
- ar as AnyTableThemeProvider,
2104
- mr as ArrayRenderer,
2105
- xr as BadgeRenderer,
2106
- ir as BooleanRenderer,
2107
- kr as CellRenderer,
2108
- wr as ConfirmModal,
2109
- lr as CurrencyRenderer,
2110
- tt as DEFAULT_THEME_COLORS,
2111
- Ye as DateRenderer,
2112
- fr as EmailRenderer,
2113
- $ as FallbackPlaceholder,
2114
- dr as ImageRenderer,
2193
+ wr as ActionRenderer,
2194
+ Er as AnyTable,
2195
+ Ie as AnyTableInner,
2196
+ tr as AnyTableThemeProvider,
2197
+ gr as ArrayRenderer,
2198
+ pr as BadgeRenderer,
2199
+ sr as BooleanRenderer,
2200
+ xr as CellRenderer,
2201
+ kr as ConfirmModal,
2202
+ ir as CurrencyRenderer,
2203
+ Ye as DEFAULT_THEME_COLORS,
2204
+ Oe as DateRenderer,
2205
+ ur as EmailRenderer,
2206
+ E as FallbackPlaceholder,
2207
+ lr as ImageRenderer,
2115
2208
  or as NumberRenderer,
2116
- ur as ObjectRenderer,
2117
- yr as PhoneRenderer,
2118
- hr as ProgressRenderer,
2119
- pr as RatingRenderer,
2120
- gr as StatusRenderer,
2121
- at as StringRenderer,
2122
- Ve as TABLE_PRESETS,
2209
+ br as ObjectRenderer,
2210
+ fr as PhoneRenderer,
2211
+ yr as ProgressRenderer,
2212
+ hr as RatingRenderer,
2213
+ cr as StatusRenderer,
2214
+ Je as StringRenderer,
2215
+ He as TABLE_PRESETS,
2123
2216
  vr as TableBody,
2124
- Sr as TableEmptyState,
2125
- Tr as TableErrorState,
2126
- sr as TableHeader,
2127
- Ar as TablePagination,
2128
- nr as TableSearch,
2129
- Cr as TableSkeleton,
2130
- br as UrlRenderer,
2131
- Br as default,
2132
- rt as defaultAnyTableTheme,
2133
- Q as extractPaginationMeta,
2134
- Qt as filterRowsBySearch,
2135
- Ot as generateAutoColumns,
2136
- P as getNestedValue,
2137
- be as inferColumnType,
2138
- Ie as isImageUrl,
2139
- zt as isIsoDate,
2140
- _t as isPlainObject,
2141
- Xt as normalizeApiResponse,
2142
- nt as renderActionIcon,
2143
- Ut as resolveColumns,
2144
- er as sortRows,
2145
- ue as toTitleCase,
2146
- rr as useAnyTableController,
2147
- tr as useAnyTableData,
2148
- Gt as useAnyTablePagination,
2149
- Kt as useAnyTableSearch,
2150
- It as useAnyTableSorting,
2151
- ee as useAnyTableTheme
2217
+ Cr as TableEmptyState,
2218
+ Sr as TableErrorState,
2219
+ nr as TableHeader,
2220
+ Nr as TablePagination,
2221
+ rr as TableSearch,
2222
+ Ar as TableSkeleton,
2223
+ ar as TableToolbar,
2224
+ mr as UrlRenderer,
2225
+ Er as default,
2226
+ Ze as defaultAnyTableTheme,
2227
+ G as extractPaginationMeta,
2228
+ Jt as filterRowsBySearch,
2229
+ zt as generateAutoColumns,
2230
+ S as getNestedValue,
2231
+ ae as inferColumnType,
2232
+ Fe as isImageUrl,
2233
+ jt as isIsoDate,
2234
+ $t as isPlainObject,
2235
+ Zt as normalizeApiResponse,
2236
+ qe as renderActionIcon,
2237
+ Lt as resolveColumns,
2238
+ Ht as resolveTableActions,
2239
+ qt as sortRows,
2240
+ re as toTitleCase,
2241
+ Qt as useAnyTableController,
2242
+ Xt as useAnyTableData,
2243
+ Ut as useAnyTablePagination,
2244
+ Ot as useAnyTableSearch,
2245
+ er as useAnyTableSelection,
2246
+ Rt as useAnyTableSorting,
2247
+ Y as useAnyTableTheme
2152
2248
  };
2153
2249
  //# sourceMappingURL=index.js.map