proctoring-ui-3 1.0.0

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.
@@ -0,0 +1,3460 @@
1
+ import De, { useState as W, useRef as he, useEffect as de } from "react";
2
+ import { useTranslation as rt } from "react-i18next";
3
+ import { Heart as Lt, Home as Ot, Calendar as Mt, Users as Tt, Settings as Pt, User as at, ChevronDown as we, LogOut as st, X as xe, AlertCircle as Qe, Upload as Dt, File as Ft, Trash2 as zt, Search as Ce, Save as At, Edit as Ee, Sparkles as It, Check as je, ChevronRight as ke, CheckCircle as Vt, ChevronLeft as Me, AlertTriangle as lt } from "lucide-react";
4
+ import { useNavigate as Wt, useLocation as Fe, Link as Se } from "react-router-dom";
5
+ import { createPortal as Te } from "react-dom";
6
+ var Pe = { exports: {} }, ge = {};
7
+ /**
8
+ * @license React
9
+ * react-jsx-runtime.production.min.js
10
+ *
11
+ * Copyright (c) Facebook, Inc. and its affiliates.
12
+ *
13
+ * This source code is licensed under the MIT license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */
16
+ var Ze;
17
+ function Bt() {
18
+ if (Ze) return ge;
19
+ Ze = 1;
20
+ var r = De, a = Symbol.for("react.element"), o = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, h = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, b = { key: !0, ref: !0, __self: !0, __source: !0 };
21
+ function c(x, k, j) {
22
+ var _, y = {}, C = null, z = null;
23
+ j !== void 0 && (C = "" + j), k.key !== void 0 && (C = "" + k.key), k.ref !== void 0 && (z = k.ref);
24
+ for (_ in k) n.call(k, _) && !b.hasOwnProperty(_) && (y[_] = k[_]);
25
+ if (x && x.defaultProps) for (_ in k = x.defaultProps, k) y[_] === void 0 && (y[_] = k[_]);
26
+ return { $$typeof: a, type: x, key: C, ref: z, props: y, _owner: h.current };
27
+ }
28
+ return ge.Fragment = o, ge.jsx = c, ge.jsxs = c, ge;
29
+ }
30
+ var pe = {};
31
+ /**
32
+ * @license React
33
+ * react-jsx-runtime.development.js
34
+ *
35
+ * Copyright (c) Facebook, Inc. and its affiliates.
36
+ *
37
+ * This source code is licensed under the MIT license found in the
38
+ * LICENSE file in the root directory of this source tree.
39
+ */
40
+ var et;
41
+ function Yt() {
42
+ return et || (et = 1, process.env.NODE_ENV !== "production" && function() {
43
+ var r = De, a = Symbol.for("react.element"), o = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), x = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), z = Symbol.for("react.offscreen"), L = Symbol.iterator, p = "@@iterator";
44
+ function O(t) {
45
+ if (t === null || typeof t != "object")
46
+ return null;
47
+ var s = L && t[L] || t[p];
48
+ return typeof s == "function" ? s : null;
49
+ }
50
+ var i = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
+ function E(t) {
52
+ {
53
+ for (var s = arguments.length, u = new Array(s > 1 ? s - 1 : 0), N = 1; N < s; N++)
54
+ u[N - 1] = arguments[N];
55
+ q("error", t, u);
56
+ }
57
+ }
58
+ function q(t, s, u) {
59
+ {
60
+ var N = i.ReactDebugCurrentFrame, B = N.getStackAddendum();
61
+ B !== "" && (s += "%s", u = u.concat([B]));
62
+ var U = u.map(function(F) {
63
+ return String(F);
64
+ });
65
+ U.unshift("Warning: " + s), Function.prototype.apply.call(console[t], console, U);
66
+ }
67
+ }
68
+ var K = !1, A = !1, te = !1, re = !1, Q = !1, $;
69
+ $ = Symbol.for("react.module.reference");
70
+ function G(t) {
71
+ return !!(typeof t == "string" || typeof t == "function" || t === n || t === b || Q || t === h || t === j || t === _ || re || t === z || K || A || te || typeof t == "object" && t !== null && (t.$$typeof === C || t.$$typeof === y || t.$$typeof === c || t.$$typeof === x || t.$$typeof === k || // This needs to include all possible module reference object
72
+ // types supported by any Flight configuration anywhere since
73
+ // we don't know which Flight build this will end up being used
74
+ // with.
75
+ t.$$typeof === $ || t.getModuleId !== void 0));
76
+ }
77
+ function d(t, s, u) {
78
+ var N = t.displayName;
79
+ if (N)
80
+ return N;
81
+ var B = s.displayName || s.name || "";
82
+ return B !== "" ? u + "(" + B + ")" : u;
83
+ }
84
+ function w(t) {
85
+ return t.displayName || "Context";
86
+ }
87
+ function S(t) {
88
+ if (t == null)
89
+ return null;
90
+ if (typeof t.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
91
+ return t.displayName || t.name || null;
92
+ if (typeof t == "string")
93
+ return t;
94
+ switch (t) {
95
+ case n:
96
+ return "Fragment";
97
+ case o:
98
+ return "Portal";
99
+ case b:
100
+ return "Profiler";
101
+ case h:
102
+ return "StrictMode";
103
+ case j:
104
+ return "Suspense";
105
+ case _:
106
+ return "SuspenseList";
107
+ }
108
+ if (typeof t == "object")
109
+ switch (t.$$typeof) {
110
+ case x:
111
+ var s = t;
112
+ return w(s) + ".Consumer";
113
+ case c:
114
+ var u = t;
115
+ return w(u._context) + ".Provider";
116
+ case k:
117
+ return d(t, t.render, "ForwardRef");
118
+ case y:
119
+ var N = t.displayName || null;
120
+ return N !== null ? N : S(t.type) || "Memo";
121
+ case C: {
122
+ var B = t, U = B._payload, F = B._init;
123
+ try {
124
+ return S(F(U));
125
+ } catch {
126
+ return null;
127
+ }
128
+ }
129
+ }
130
+ return null;
131
+ }
132
+ var D = Object.assign, I = 0, m, M, H, ee, le, l, v;
133
+ function g() {
134
+ }
135
+ g.__reactDisabledLog = !0;
136
+ function T() {
137
+ {
138
+ if (I === 0) {
139
+ m = console.log, M = console.info, H = console.warn, ee = console.error, le = console.group, l = console.groupCollapsed, v = console.groupEnd;
140
+ var t = {
141
+ configurable: !0,
142
+ enumerable: !0,
143
+ value: g,
144
+ writable: !0
145
+ };
146
+ Object.defineProperties(console, {
147
+ info: t,
148
+ log: t,
149
+ warn: t,
150
+ error: t,
151
+ group: t,
152
+ groupCollapsed: t,
153
+ groupEnd: t
154
+ });
155
+ }
156
+ I++;
157
+ }
158
+ }
159
+ function R() {
160
+ {
161
+ if (I--, I === 0) {
162
+ var t = {
163
+ configurable: !0,
164
+ enumerable: !0,
165
+ writable: !0
166
+ };
167
+ Object.defineProperties(console, {
168
+ log: D({}, t, {
169
+ value: m
170
+ }),
171
+ info: D({}, t, {
172
+ value: M
173
+ }),
174
+ warn: D({}, t, {
175
+ value: H
176
+ }),
177
+ error: D({}, t, {
178
+ value: ee
179
+ }),
180
+ group: D({}, t, {
181
+ value: le
182
+ }),
183
+ groupCollapsed: D({}, t, {
184
+ value: l
185
+ }),
186
+ groupEnd: D({}, t, {
187
+ value: v
188
+ })
189
+ });
190
+ }
191
+ I < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
+ }
193
+ }
194
+ var Y = i.ReactCurrentDispatcher, Z;
195
+ function ne(t, s, u) {
196
+ {
197
+ if (Z === void 0)
198
+ try {
199
+ throw Error();
200
+ } catch (B) {
201
+ var N = B.stack.trim().match(/\n( *(at )?)/);
202
+ Z = N && N[1] || "";
203
+ }
204
+ return `
205
+ ` + Z + t;
206
+ }
207
+ }
208
+ var f = !1, oe;
209
+ {
210
+ var ce = typeof WeakMap == "function" ? WeakMap : Map;
211
+ oe = new ce();
212
+ }
213
+ function ve(t, s) {
214
+ if (!t || f)
215
+ return "";
216
+ {
217
+ var u = oe.get(t);
218
+ if (u !== void 0)
219
+ return u;
220
+ }
221
+ var N;
222
+ f = !0;
223
+ var B = Error.prepareStackTrace;
224
+ Error.prepareStackTrace = void 0;
225
+ var U;
226
+ U = Y.current, Y.current = null, T();
227
+ try {
228
+ if (s) {
229
+ var F = function() {
230
+ throw Error();
231
+ };
232
+ if (Object.defineProperty(F.prototype, "props", {
233
+ set: function() {
234
+ throw Error();
235
+ }
236
+ }), typeof Reflect == "object" && Reflect.construct) {
237
+ try {
238
+ Reflect.construct(F, []);
239
+ } catch (se) {
240
+ N = se;
241
+ }
242
+ Reflect.construct(t, [], F);
243
+ } else {
244
+ try {
245
+ F.call();
246
+ } catch (se) {
247
+ N = se;
248
+ }
249
+ t.call(F.prototype);
250
+ }
251
+ } else {
252
+ try {
253
+ throw Error();
254
+ } catch (se) {
255
+ N = se;
256
+ }
257
+ t();
258
+ }
259
+ } catch (se) {
260
+ if (se && N && typeof se.stack == "string") {
261
+ for (var P = se.stack.split(`
262
+ `), ae = N.stack.split(`
263
+ `), J = P.length - 1, X = ae.length - 1; J >= 1 && X >= 0 && P[J] !== ae[X]; )
264
+ X--;
265
+ for (; J >= 1 && X >= 0; J--, X--)
266
+ if (P[J] !== ae[X]) {
267
+ if (J !== 1 || X !== 1)
268
+ do
269
+ if (J--, X--, X < 0 || P[J] !== ae[X]) {
270
+ var ie = `
271
+ ` + P[J].replace(" at new ", " at ");
272
+ return t.displayName && ie.includes("<anonymous>") && (ie = ie.replace("<anonymous>", t.displayName)), typeof t == "function" && oe.set(t, ie), ie;
273
+ }
274
+ while (J >= 1 && X >= 0);
275
+ break;
276
+ }
277
+ }
278
+ } finally {
279
+ f = !1, Y.current = U, R(), Error.prepareStackTrace = B;
280
+ }
281
+ var be = t ? t.displayName || t.name : "", me = be ? ne(be) : "";
282
+ return typeof t == "function" && oe.set(t, me), me;
283
+ }
284
+ function ot(t, s, u) {
285
+ return ve(t, !1);
286
+ }
287
+ function it(t) {
288
+ var s = t.prototype;
289
+ return !!(s && s.isReactComponent);
290
+ }
291
+ function ye(t, s, u) {
292
+ if (t == null)
293
+ return "";
294
+ if (typeof t == "function")
295
+ return ve(t, it(t));
296
+ if (typeof t == "string")
297
+ return ne(t);
298
+ switch (t) {
299
+ case j:
300
+ return ne("Suspense");
301
+ case _:
302
+ return ne("SuspenseList");
303
+ }
304
+ if (typeof t == "object")
305
+ switch (t.$$typeof) {
306
+ case k:
307
+ return ot(t.render);
308
+ case y:
309
+ return ye(t.type, s, u);
310
+ case C: {
311
+ var N = t, B = N._payload, U = N._init;
312
+ try {
313
+ return ye(U(B), s, u);
314
+ } catch {
315
+ }
316
+ }
317
+ }
318
+ return "";
319
+ }
320
+ var fe = Object.prototype.hasOwnProperty, ze = {}, Ae = i.ReactDebugCurrentFrame;
321
+ function Ne(t) {
322
+ if (t) {
323
+ var s = t._owner, u = ye(t.type, t._source, s ? s.type : null);
324
+ Ae.setExtraStackFrame(u);
325
+ } else
326
+ Ae.setExtraStackFrame(null);
327
+ }
328
+ function dt(t, s, u, N, B) {
329
+ {
330
+ var U = Function.call.bind(fe);
331
+ for (var F in t)
332
+ if (U(t, F)) {
333
+ var P = void 0;
334
+ try {
335
+ if (typeof t[F] != "function") {
336
+ var ae = Error((N || "React class") + ": " + u + " type `" + F + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[F] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
+ throw ae.name = "Invariant Violation", ae;
338
+ }
339
+ P = t[F](s, F, N, u, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
+ } catch (J) {
341
+ P = J;
342
+ }
343
+ P && !(P instanceof Error) && (Ne(B), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", N || "React class", u, F, typeof P), Ne(null)), P instanceof Error && !(P.message in ze) && (ze[P.message] = !0, Ne(B), E("Failed %s type: %s", u, P.message), Ne(null));
344
+ }
345
+ }
346
+ }
347
+ var ct = Array.isArray;
348
+ function $e(t) {
349
+ return ct(t);
350
+ }
351
+ function xt(t) {
352
+ {
353
+ var s = typeof Symbol == "function" && Symbol.toStringTag, u = s && t[Symbol.toStringTag] || t.constructor.name || "Object";
354
+ return u;
355
+ }
356
+ }
357
+ function mt(t) {
358
+ try {
359
+ return Ie(t), !1;
360
+ } catch {
361
+ return !0;
362
+ }
363
+ }
364
+ function Ie(t) {
365
+ return "" + t;
366
+ }
367
+ function Ve(t) {
368
+ if (mt(t))
369
+ return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", xt(t)), Ie(t);
370
+ }
371
+ var We = i.ReactCurrentOwner, ht = {
372
+ key: !0,
373
+ ref: !0,
374
+ __self: !0,
375
+ __source: !0
376
+ }, Be, Ye;
377
+ function ut(t) {
378
+ if (fe.call(t, "ref")) {
379
+ var s = Object.getOwnPropertyDescriptor(t, "ref").get;
380
+ if (s && s.isReactWarning)
381
+ return !1;
382
+ }
383
+ return t.ref !== void 0;
384
+ }
385
+ function bt(t) {
386
+ if (fe.call(t, "key")) {
387
+ var s = Object.getOwnPropertyDescriptor(t, "key").get;
388
+ if (s && s.isReactWarning)
389
+ return !1;
390
+ }
391
+ return t.key !== void 0;
392
+ }
393
+ function vt(t, s) {
394
+ typeof t.ref == "string" && We.current;
395
+ }
396
+ function ft(t, s) {
397
+ {
398
+ var u = function() {
399
+ Be || (Be = !0, E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
400
+ };
401
+ u.isReactWarning = !0, Object.defineProperty(t, "key", {
402
+ get: u,
403
+ configurable: !0
404
+ });
405
+ }
406
+ }
407
+ function gt(t, s) {
408
+ {
409
+ var u = function() {
410
+ Ye || (Ye = !0, E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
411
+ };
412
+ u.isReactWarning = !0, Object.defineProperty(t, "ref", {
413
+ get: u,
414
+ configurable: !0
415
+ });
416
+ }
417
+ }
418
+ var pt = function(t, s, u, N, B, U, F) {
419
+ var P = {
420
+ // This tag allows us to uniquely identify this as a React Element
421
+ $$typeof: a,
422
+ // Built-in properties that belong on the element
423
+ type: t,
424
+ key: s,
425
+ ref: u,
426
+ props: F,
427
+ // Record the component responsible for creating this element.
428
+ _owner: U
429
+ };
430
+ return P._store = {}, Object.defineProperty(P._store, "validated", {
431
+ configurable: !1,
432
+ enumerable: !1,
433
+ writable: !0,
434
+ value: !1
435
+ }), Object.defineProperty(P, "_self", {
436
+ configurable: !1,
437
+ enumerable: !1,
438
+ writable: !1,
439
+ value: N
440
+ }), Object.defineProperty(P, "_source", {
441
+ configurable: !1,
442
+ enumerable: !1,
443
+ writable: !1,
444
+ value: B
445
+ }), Object.freeze && (Object.freeze(P.props), Object.freeze(P)), P;
446
+ };
447
+ function kt(t, s, u, N, B) {
448
+ {
449
+ var U, F = {}, P = null, ae = null;
450
+ u !== void 0 && (Ve(u), P = "" + u), bt(s) && (Ve(s.key), P = "" + s.key), ut(s) && (ae = s.ref, vt(s, B));
451
+ for (U in s)
452
+ fe.call(s, U) && !ht.hasOwnProperty(U) && (F[U] = s[U]);
453
+ if (t && t.defaultProps) {
454
+ var J = t.defaultProps;
455
+ for (U in J)
456
+ F[U] === void 0 && (F[U] = J[U]);
457
+ }
458
+ if (P || ae) {
459
+ var X = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
460
+ P && ft(F, X), ae && gt(F, X);
461
+ }
462
+ return pt(t, P, ae, B, N, We.current, F);
463
+ }
464
+ }
465
+ var Re = i.ReactCurrentOwner, He = i.ReactDebugCurrentFrame;
466
+ function ue(t) {
467
+ if (t) {
468
+ var s = t._owner, u = ye(t.type, t._source, s ? s.type : null);
469
+ He.setExtraStackFrame(u);
470
+ } else
471
+ He.setExtraStackFrame(null);
472
+ }
473
+ var _e;
474
+ _e = !1;
475
+ function Le(t) {
476
+ return typeof t == "object" && t !== null && t.$$typeof === a;
477
+ }
478
+ function Ue() {
479
+ {
480
+ if (Re.current) {
481
+ var t = S(Re.current.type);
482
+ if (t)
483
+ return `
484
+
485
+ Check the render method of \`` + t + "`.";
486
+ }
487
+ return "";
488
+ }
489
+ }
490
+ function wt(t) {
491
+ return "";
492
+ }
493
+ var qe = {};
494
+ function jt(t) {
495
+ {
496
+ var s = Ue();
497
+ if (!s) {
498
+ var u = typeof t == "string" ? t : t.displayName || t.name;
499
+ u && (s = `
500
+
501
+ Check the top-level render call using <` + u + ">.");
502
+ }
503
+ return s;
504
+ }
505
+ }
506
+ function Ke(t, s) {
507
+ {
508
+ if (!t._store || t._store.validated || t.key != null)
509
+ return;
510
+ t._store.validated = !0;
511
+ var u = jt(s);
512
+ if (qe[u])
513
+ return;
514
+ qe[u] = !0;
515
+ var N = "";
516
+ t && t._owner && t._owner !== Re.current && (N = " It was passed a child from " + S(t._owner.type) + "."), ue(t), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', u, N), ue(null);
517
+ }
518
+ }
519
+ function Ge(t, s) {
520
+ {
521
+ if (typeof t != "object")
522
+ return;
523
+ if ($e(t))
524
+ for (var u = 0; u < t.length; u++) {
525
+ var N = t[u];
526
+ Le(N) && Ke(N, s);
527
+ }
528
+ else if (Le(t))
529
+ t._store && (t._store.validated = !0);
530
+ else if (t) {
531
+ var B = O(t);
532
+ if (typeof B == "function" && B !== t.entries)
533
+ for (var U = B.call(t), F; !(F = U.next()).done; )
534
+ Le(F.value) && Ke(F.value, s);
535
+ }
536
+ }
537
+ }
538
+ function yt(t) {
539
+ {
540
+ var s = t.type;
541
+ if (s == null || typeof s == "string")
542
+ return;
543
+ var u;
544
+ if (typeof s == "function")
545
+ u = s.propTypes;
546
+ else if (typeof s == "object" && (s.$$typeof === k || // Note: Memo only checks outer props here.
547
+ // Inner props are checked in the reconciler.
548
+ s.$$typeof === y))
549
+ u = s.propTypes;
550
+ else
551
+ return;
552
+ if (u) {
553
+ var N = S(s);
554
+ dt(u, t.props, "prop", N, t);
555
+ } else if (s.PropTypes !== void 0 && !_e) {
556
+ _e = !0;
557
+ var B = S(s);
558
+ E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", B || "Unknown");
559
+ }
560
+ typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
561
+ }
562
+ }
563
+ function Nt(t) {
564
+ {
565
+ for (var s = Object.keys(t.props), u = 0; u < s.length; u++) {
566
+ var N = s[u];
567
+ if (N !== "children" && N !== "key") {
568
+ ue(t), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", N), ue(null);
569
+ break;
570
+ }
571
+ }
572
+ t.ref !== null && (ue(t), E("Invalid attribute `ref` supplied to `React.Fragment`."), ue(null));
573
+ }
574
+ }
575
+ var Je = {};
576
+ function Xe(t, s, u, N, B, U) {
577
+ {
578
+ var F = G(t);
579
+ if (!F) {
580
+ var P = "";
581
+ (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (P += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
582
+ var ae = wt();
583
+ ae ? P += ae : P += Ue();
584
+ var J;
585
+ t === null ? J = "null" : $e(t) ? J = "array" : t !== void 0 && t.$$typeof === a ? (J = "<" + (S(t.type) || "Unknown") + " />", P = " Did you accidentally export a JSX literal instead of a component?") : J = typeof t, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", J, P);
586
+ }
587
+ var X = kt(t, s, u, B, U);
588
+ if (X == null)
589
+ return X;
590
+ if (F) {
591
+ var ie = s.children;
592
+ if (ie !== void 0)
593
+ if (N)
594
+ if ($e(ie)) {
595
+ for (var be = 0; be < ie.length; be++)
596
+ Ge(ie[be], t);
597
+ Object.freeze && Object.freeze(ie);
598
+ } else
599
+ E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
600
+ else
601
+ Ge(ie, t);
602
+ }
603
+ if (fe.call(s, "key")) {
604
+ var me = S(t), se = Object.keys(s).filter(function(_t) {
605
+ return _t !== "key";
606
+ }), Oe = se.length > 0 ? "{key: someKey, " + se.join(": ..., ") + ": ...}" : "{key: someKey}";
607
+ if (!Je[me + Oe]) {
608
+ var Rt = se.length > 0 ? "{" + se.join(": ..., ") + ": ...}" : "{}";
609
+ E(`A props object containing a "key" prop is being spread into JSX:
610
+ let props = %s;
611
+ <%s {...props} />
612
+ React keys must be passed directly to JSX without using spread:
613
+ let props = %s;
614
+ <%s key={someKey} {...props} />`, Oe, me, Rt, me), Je[me + Oe] = !0;
615
+ }
616
+ }
617
+ return t === n ? Nt(X) : yt(X), X;
618
+ }
619
+ }
620
+ function Ct(t, s, u) {
621
+ return Xe(t, s, u, !0);
622
+ }
623
+ function Et(t, s, u) {
624
+ return Xe(t, s, u, !1);
625
+ }
626
+ var St = Et, $t = Ct;
627
+ pe.Fragment = n, pe.jsx = St, pe.jsxs = $t;
628
+ }()), pe;
629
+ }
630
+ process.env.NODE_ENV === "production" ? Pe.exports = Bt() : Pe.exports = Yt();
631
+ var e = Pe.exports;
632
+ function Zt({ text: r, link: a, linkText: o, year: n, navigationItems: h = [] }) {
633
+ const { t: b } = rt("pages-product-page"), c = Wt(), x = Fe(), k = [
634
+ {
635
+ icon: Ot,
636
+ label: "Dashboard",
637
+ path: "/dashboard",
638
+ key: "dashboard"
639
+ },
640
+ {
641
+ icon: Mt,
642
+ label: "Calendar",
643
+ path: "/calendar",
644
+ key: "calendar"
645
+ },
646
+ {
647
+ icon: Tt,
648
+ label: "Admins",
649
+ path: "/admins",
650
+ key: "admins"
651
+ },
652
+ {
653
+ icon: Pt,
654
+ label: "Settings",
655
+ path: "/settings",
656
+ key: "settings"
657
+ }
658
+ ], j = h.length > 0 ? h : k, _ = (y) => x.pathname === y;
659
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
660
+ /* @__PURE__ */ e.jsxs("footer", { className: "hidden md:block relative overflow-hidden border-t transition-all duration-300 bg-gradient-to-r from-white via-violet-50/30 to-white border-slate-200/50 dark:bg-gradient-to-r dark:from-slate-800 dark:via-slate-900 dark:to-slate-800 dark:border-slate-700/50 shadow-sm", children: [
661
+ /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 w-full h-full opacity-5 bg-gradient-to-r from-violet-300 to-indigo-300 dark:bg-gradient-to-r dark:from-violet-500 dark:to-indigo-500" }),
662
+ /* @__PURE__ */ e.jsx("div", { className: "relative z-10 px-6 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "max-w-7xl mx-auto flex flex-wrap items-center justify-between gap-4", children: [
663
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-3", children: [
664
+ /* @__PURE__ */ e.jsx("div", { className: "w-8 h-8 rounded-lg bg-gradient-to-br from-violet-600 to-indigo-600 flex items-center justify-center shadow-md shadow-violet-200 dark:shadow-violet-900/50", children: /* @__PURE__ */ e.jsx(
665
+ "svg",
666
+ {
667
+ className: "w-4 h-4 text-white",
668
+ fill: "none",
669
+ stroke: "currentColor",
670
+ viewBox: "0 0 24 24",
671
+ children: /* @__PURE__ */ e.jsx(
672
+ "path",
673
+ {
674
+ strokeLinecap: "round",
675
+ strokeLinejoin: "round",
676
+ strokeWidth: 2,
677
+ d: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"
678
+ }
679
+ )
680
+ }
681
+ ) }),
682
+ /* @__PURE__ */ e.jsxs("span", { className: "text-sm text-slate-600 dark:text-slate-400", children: [
683
+ "© ",
684
+ n || (/* @__PURE__ */ new Date()).getFullYear()
685
+ ] }),
686
+ /* @__PURE__ */ e.jsx(
687
+ "a",
688
+ {
689
+ href: a || "#",
690
+ target: "_blank",
691
+ rel: "noopener noreferrer",
692
+ className: "text-sm font-medium transition-all duration-200 hover:scale-105 inline-block text-violet-600 hover:text-violet-700 dark:text-violet-400 dark:hover:text-violet-300",
693
+ children: b("footer.text")
694
+ }
695
+ )
696
+ ] }),
697
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-6", children: [
698
+ /* @__PURE__ */ e.jsx(
699
+ "a",
700
+ {
701
+ href: "#",
702
+ className: "text-sm font-medium transition-all duration-200 hover:scale-105 text-slate-600 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-300",
703
+ children: "Privacy"
704
+ }
705
+ ),
706
+ /* @__PURE__ */ e.jsx(
707
+ "a",
708
+ {
709
+ href: "#",
710
+ className: "text-sm font-medium transition-all duration-200 hover:scale-105 text-slate-600 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-300",
711
+ children: "Terms"
712
+ }
713
+ ),
714
+ /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-slate-500 dark:text-slate-500", children: [
715
+ "Made with ",
716
+ /* @__PURE__ */ e.jsx(Lt, { className: "w-3 h-3 inline text-red-500 fill-red-500" })
717
+ ] })
718
+ ] })
719
+ ] }) })
720
+ ] }),
721
+ /* @__PURE__ */ e.jsx("nav", { className: "md:hidden fixed bottom-0 left-0 right-0 z-50 safe-area-bottom", children: /* @__PURE__ */ e.jsxs("div", { className: "relative backdrop-blur-2xl bg-white/90 dark:bg-slate-900/95 border-t border-slate-200/50 dark:border-slate-700/50 shadow-2xl", children: [
722
+ /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-violet-50/30 to-transparent dark:from-violet-950/20 dark:to-transparent pointer-events-none" }),
723
+ /* @__PURE__ */ e.jsx("div", { className: "absolute top-0 left-0 right-0 h-0.5 bg-gradient-to-r from-transparent via-violet-500 to-transparent opacity-50" }),
724
+ /* @__PURE__ */ e.jsx("div", { className: "relative grid grid-cols-4 gap-1 px-2 py-2 pb-safe", children: j.map((y, C) => {
725
+ const z = y.icon, L = _(y.path);
726
+ return /* @__PURE__ */ e.jsxs(
727
+ "button",
728
+ {
729
+ onClick: () => c(y.path),
730
+ className: `relative flex flex-col items-center justify-center py-2 px-1 rounded-2xl transition-all duration-300 group ${L ? "bg-gradient-to-br from-violet-500 to-indigo-600 shadow-lg shadow-violet-500/30" : "hover:bg-slate-100 dark:hover:bg-slate-800/50 active:scale-95"}`,
731
+ children: [
732
+ L && /* @__PURE__ */ e.jsx("div", { className: "absolute -top-1 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full bg-white shadow-lg shadow-white/50 animate-pulse" }),
733
+ /* @__PURE__ */ e.jsxs("div", { className: `relative mb-1 transition-transform duration-300 ${L ? "scale-110" : "group-hover:scale-110"}`, children: [
734
+ /* @__PURE__ */ e.jsx(
735
+ z,
736
+ {
737
+ className: `w-6 h-6 transition-colors duration-300 ${L ? "text-white" : "text-slate-600 dark:text-slate-400 group-hover:text-violet-600 dark:group-hover:text-violet-400"}`,
738
+ strokeWidth: L ? 2.5 : 2
739
+ }
740
+ ),
741
+ L && /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 rounded-full bg-white/20 animate-ping" })
742
+ ] }),
743
+ /* @__PURE__ */ e.jsx("span", { className: `text-xs font-semibold transition-all duration-300 ${L ? "text-white scale-105" : "text-slate-600 dark:text-slate-400 group-hover:text-violet-600 dark:group-hover:text-violet-400"}`, children: y.label }),
744
+ y.badge && /* @__PURE__ */ e.jsx("div", { className: "absolute top-1 right-2 w-2 h-2 rounded-full bg-red-500 border-2 border-white dark:border-slate-900 animate-pulse" })
745
+ ]
746
+ },
747
+ y.key || C
748
+ );
749
+ }) }),
750
+ /* @__PURE__ */ e.jsx("div", { className: "h-safe-area-inset-bottom bg-white/50 dark:bg-slate-900/50" })
751
+ ] }) }),
752
+ /* @__PURE__ */ e.jsx("style", { jsx: !0, children: `
753
+ .safe-area-bottom {
754
+ padding-bottom: env(safe-area-inset-bottom);
755
+ }
756
+ .pb-safe {
757
+ padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
758
+ }
759
+ .h-safe-area-inset-bottom {
760
+ height: env(safe-area-inset-bottom);
761
+ }
762
+ ` })
763
+ ] });
764
+ }
765
+ const Ht = ({ user: r, onLogout: a, showEmail: o = !0 }) => {
766
+ const [n, h] = W(!1), [b, c] = W({ top: 0, right: 0 }), x = he(null), k = he(null);
767
+ return de(() => {
768
+ const j = (_) => {
769
+ x.current && !x.current.contains(_.target) && k.current && !k.current.contains(_.target) && h(!1);
770
+ };
771
+ return n && document.addEventListener("mousedown", j), () => document.removeEventListener("mousedown", j);
772
+ }, [n]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
773
+ /* @__PURE__ */ e.jsxs(
774
+ "button",
775
+ {
776
+ ref: x,
777
+ onClick: () => {
778
+ if (!n && x.current) {
779
+ const j = x.current.getBoundingClientRect();
780
+ c({
781
+ top: j.bottom + 6,
782
+ right: window.innerWidth - j.right
783
+ });
784
+ }
785
+ h(!n);
786
+ },
787
+ title: "Account",
788
+ className: `p-2 sm:p-2.5 rounded-xl transition-all duration-200
789
+ bg-white hover:bg-slate-50 text-slate-700
790
+ border border-slate-200 shadow-sm
791
+ dark:bg-slate-700/50 dark:hover:bg-slate-700 dark:text-slate-300 dark:border-slate-600/50
792
+ hover:scale-105 active:scale-95
793
+ flex items-center gap-1`,
794
+ children: [
795
+ /* @__PURE__ */ e.jsx(at, { className: "w-[18px] h-[18px]" }),
796
+ /* @__PURE__ */ e.jsx(
797
+ we,
798
+ {
799
+ className: `w-3 h-3 text-slate-400 transition-transform duration-200 ${n ? "rotate-180" : ""}`
800
+ }
801
+ )
802
+ ]
803
+ }
804
+ ),
805
+ n && Te(
806
+ /* @__PURE__ */ e.jsxs(
807
+ "div",
808
+ {
809
+ ref: k,
810
+ style: { top: b.top, right: b.right },
811
+ className: `fixed w-48 rounded-xl border shadow-lg overflow-hidden z-[9999]
812
+ bg-white border-slate-200/60
813
+ dark:bg-slate-800 dark:border-slate-700/60
814
+ animate-in fade-in zoom-in-95 duration-150`,
815
+ children: [
816
+ ((r == null ? void 0 : r.name) || (r == null ? void 0 : r.email)) && /* @__PURE__ */ e.jsxs("div", { className: "px-3.5 py-3 border-b border-slate-100 dark:border-slate-700", children: [
817
+ (r == null ? void 0 : r.name) && /* @__PURE__ */ e.jsx("p", { className: "text-sm font-semibold text-slate-800 dark:text-slate-200 truncate", children: r.name }),
818
+ o && (r == null ? void 0 : r.email) && /* @__PURE__ */ e.jsx("p", { className: "text-xs font-medium text-slate-500 dark:text-slate-400 truncate mt-0.5", children: r.email })
819
+ ] }),
820
+ /* @__PURE__ */ e.jsxs(
821
+ "button",
822
+ {
823
+ onClick: () => {
824
+ h(!1), a();
825
+ },
826
+ className: `w-full flex items-center gap-2 px-3.5 py-2.5
827
+ text-sm font-medium text-red-600 dark:text-red-400
828
+ hover:bg-red-50 dark:hover:bg-red-900/20
829
+ transition-colors duration-150`,
830
+ children: [
831
+ /* @__PURE__ */ e.jsx(st, { className: "w-4 h-4 flex-shrink-0" }),
832
+ "Logout"
833
+ ]
834
+ }
835
+ )
836
+ ]
837
+ }
838
+ ),
839
+ document.body
840
+ )
841
+ ] });
842
+ }, er = ({
843
+ appIcon: r,
844
+ appName: a,
845
+ appShortName: o,
846
+ appTagline: n,
847
+ userName: h,
848
+ // <-- Taken from props!
849
+ userEmail: b,
850
+ // <-- Taken from props!
851
+ userRole: c,
852
+ onLogout: x,
853
+ // <-- Added onLogout prop!
854
+ navLinks: k = [],
855
+ showAccessibility: j = !0,
856
+ showUserInfo: _ = !0,
857
+ showLanguageSelector: y = !0,
858
+ showThemeToggle: C = !0,
859
+ showAppIcon: z = !0,
860
+ showAppFullName: L = !0,
861
+ showAppTagline: p = !1,
862
+ showNavLinks: O = !1,
863
+ rightContent: i
864
+ }) => {
865
+ var ne;
866
+ const E = Fe(), [q, K] = W(
867
+ localStorage.getItem("language") || "eng"
868
+ ), [A, te] = W(!1), [re, Q] = W(!1), [$, G] = W(16), [d, w] = W(!1), [S, D] = W(!1), [I, m] = W(!1), [M, H] = W(!1), [ee, le] = W(!1);
869
+ de(() => {
870
+ const f = localStorage.getItem("theme") || "light";
871
+ m(f === "dark"), document.documentElement.classList.toggle("dark", f === "dark");
872
+ }, []), de(() => {
873
+ const f = () => le(window.scrollY > 8);
874
+ return window.addEventListener("scroll", f, { passive: !0 }), () => window.removeEventListener("scroll", f);
875
+ }, []), de(() => {
876
+ H(!1);
877
+ }, [E.pathname]);
878
+ const l = () => {
879
+ m((f) => {
880
+ const oe = !f;
881
+ return oe ? (document.documentElement.classList.add("dark"), localStorage.setItem("theme", "dark")) : (document.documentElement.classList.remove("dark"), localStorage.setItem("theme", "light")), oe;
882
+ });
883
+ }, v = (f) => {
884
+ K(f), localStorage.setItem("language", f), Q(!1);
885
+ };
886
+ de(() => {
887
+ document.documentElement.style.fontSize = `${$}px`, document.body.style.filter = d ? "grayscale(100%)" : "none", document.body.style.fontFamily = S ? "OpenDyslexic, Arial, sans-serif" : "inherit";
888
+ }, [$, d, S]);
889
+ const g = {
890
+ eng: { label: "English", disabled: !1 },
891
+ hin: { label: "Hindi", disabled: !1 }
892
+ }, T = () => {
893
+ $ < 24 && G($ + 2);
894
+ }, R = () => {
895
+ $ > 12 && G($ - 2);
896
+ }, Y = () => G(16), Z = (f) => f === "/" ? E.pathname === "/" : E.pathname.startsWith(f);
897
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
898
+ /* @__PURE__ */ e.jsxs(
899
+ "nav",
900
+ {
901
+ className: `
902
+ w-full sticky top-0 z-50 overflow-hidden
903
+ bg-white/95 dark:bg-slate-900/95 backdrop-blur-md
904
+ border-b border-slate-200/60 dark:border-slate-700/60
905
+ transition-all duration-300
906
+ ${ee ? "shadow-xl shadow-slate-200/50 dark:shadow-slate-950/50" : "shadow-sm shadow-slate-100/50 dark:shadow-slate-900/30"}
907
+ `,
908
+ children: [
909
+ /* @__PURE__ */ e.jsx("div", { className: "absolute top-0 right-0 w-96 h-96 rounded-full blur-3xl opacity-20 bg-violet-300 dark:bg-violet-500 -translate-y-1/2 translate-x-1/2 pointer-events-none" }),
910
+ /* @__PURE__ */ e.jsx("div", { className: "absolute bottom-0 left-0 w-48 h-48 rounded-full blur-3xl opacity-20 bg-indigo-300 dark:bg-indigo-500 translate-y-1/2 -translate-x-1/2 pointer-events-none" }),
911
+ /* @__PURE__ */ e.jsxs("div", { className: "relative z-10 mx-auto px-3 sm:px-5 lg:px-6 py-2 sm:py-0", children: [
912
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between h-14 sm:h-20", children: [
913
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 sm:gap-4 group flex-shrink-0", children: [
914
+ z && r && /* @__PURE__ */ e.jsx("div", { className: "w-8 h-8 sm:w-16 sm:h-16 flex items-center justify-center group-hover:scale-105 transition-transform duration-200", children: /* @__PURE__ */ e.jsx(
915
+ "img",
916
+ {
917
+ src: r,
918
+ alt: "Institution Logo",
919
+ className: "h-8 sm:h-14 w-auto object-contain"
920
+ }
921
+ ) }),
922
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col leading-tight", children: [
923
+ /* @__PURE__ */ e.jsx("span", { className: "font-extrabold text-base sm:text-xl text-slate-900 dark:text-white sm:hidden tracking-tight", children: o || a }),
924
+ /* @__PURE__ */ e.jsxs("div", { className: "hidden sm:flex flex-col", children: [
925
+ /* @__PURE__ */ e.jsx("span", { className: "font-extrabold text-slate-900 dark:text-white tracking-tight text-lg lg:hidden", children: o || a }),
926
+ L && /* @__PURE__ */ e.jsx("span", { className: "font-extrabold text-slate-900 dark:text-white tracking-tight hidden lg:block text-[17px] xl:text-lg leading-tight max-w-md", children: a }),
927
+ p && n && /* @__PURE__ */ e.jsx("span", { className: "mt-0.5 text-[10px] font-semibold tracking-[0.2em] text-violet-600 dark:text-violet-400 uppercase", children: n })
928
+ ] })
929
+ ] })
930
+ ] }),
931
+ O && k.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "hidden md:flex items-center gap-2", children: k.map((f) => {
932
+ var ce;
933
+ return f != null && f.to ? ((ce = f == null ? void 0 : f.to) == null ? void 0 : ce.startsWith("http")) ? /* @__PURE__ */ e.jsx(
934
+ "a",
935
+ {
936
+ href: f.to,
937
+ target: f.target || "_self",
938
+ rel: "noopener noreferrer",
939
+ className: "relative px-4 lg:px-5 py-2.5 rounded-xl text-sm font-semibold tracking-wide transition-all duration-200 text-slate-600 dark:text-slate-300 hover:text-violet-700 dark:hover:text-violet-400 hover:bg-violet-50/80 dark:hover:bg-slate-700/50",
940
+ children: f.label
941
+ },
942
+ f.to
943
+ ) : /* @__PURE__ */ e.jsxs(
944
+ Se,
945
+ {
946
+ to: f.to,
947
+ target: f.target || "_self",
948
+ rel: f.target === "_blank" ? "noopener noreferrer" : void 0,
949
+ className: `relative px-4 lg:px-5 py-2.5 rounded-xl text-sm font-semibold tracking-wide transition-all duration-200 ${Z(f.to) ? "text-violet-700 dark:text-violet-400 bg-violet-50 dark:bg-violet-600/10 shadow-sm" : "text-slate-600 dark:text-slate-300 hover:text-violet-700 dark:hover:text-violet-400 hover:bg-violet-50/80 dark:hover:bg-slate-700/50"}`,
950
+ children: [
951
+ f.label,
952
+ Z(f.to) && /* @__PURE__ */ e.jsx("span", { className: "absolute bottom-1 left-1/2 -translate-x-1/2 w-4 h-0.5 rounded-full bg-gradient-to-r from-violet-600 to-indigo-600" })
953
+ ]
954
+ },
955
+ f.to
956
+ ) : null;
957
+ }) }),
958
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1.5 sm:gap-2", children: [
959
+ i && /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: i }),
960
+ j && /* @__PURE__ */ e.jsx(
961
+ "button",
962
+ {
963
+ onClick: () => te(!0),
964
+ className: "p-2 sm:p-2.5 rounded-xl transition-all duration-200 bg-white hover:bg-slate-50 text-slate-700 border border-slate-200 shadow-sm dark:bg-slate-700/50 dark:hover:bg-slate-700 dark:text-slate-300 dark:border-slate-600/50 hover:scale-105 active:scale-95",
965
+ title: "Accessibility Settings",
966
+ children: /* @__PURE__ */ e.jsx("svg", { className: "w-4 h-4 sm:w-[18px] sm:h-[18px]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4" }) })
967
+ }
968
+ ),
969
+ C && /* @__PURE__ */ e.jsx(
970
+ "button",
971
+ {
972
+ onClick: l,
973
+ "aria-label": "Toggle theme",
974
+ title: I ? "Switch to Light Mode" : "Switch to Dark Mode",
975
+ className: "p-2 sm:p-2.5 rounded-xl transition-all duration-200 bg-white hover:bg-slate-50 text-slate-700 border border-slate-200 shadow-sm dark:bg-slate-700/50 dark:hover:bg-slate-700 dark:text-yellow-400 dark:border-slate-600/50 hover:scale-105 active:scale-95",
976
+ children: I ? /* @__PURE__ */ e.jsx("svg", { className: "w-4 h-4 sm:w-[18px] sm:h-[18px]", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z", clipRule: "evenodd" }) }) : /* @__PURE__ */ e.jsx("svg", { className: "w-4 h-4 sm:w-[18px] sm:h-[18px]", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { d: "M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z" }) })
977
+ }
978
+ ),
979
+ y && /* @__PURE__ */ e.jsxs(
980
+ "button",
981
+ {
982
+ onClick: () => Q(!0),
983
+ className: "hidden sm:flex items-center gap-2 px-4 py-2.5 rounded-xl bg-white hover:bg-slate-50 text-slate-700 border border-slate-200 shadow-sm dark:bg-slate-700/50 dark:hover:bg-slate-700 dark:text-slate-300 dark:border-slate-600/50 hover:scale-105 active:scale-95 transition-all duration-200",
984
+ children: [
985
+ /* @__PURE__ */ e.jsx("svg", { className: "w-[18px] h-[18px]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 2a10 10 0 100 20 10 10 0 000-20zm0 0c2.5 2.5 4 6 4 10s-1.5 7.5-4 10m0-20C9.5 4.5 8 8 8 12s1.5 7.5 4 10m-9-10h18" }) }),
986
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children: (ne = g[q]) == null ? void 0 : ne.label })
987
+ ]
988
+ }
989
+ ),
990
+ y && /* @__PURE__ */ e.jsx(
991
+ "button",
992
+ {
993
+ onClick: () => Q(!0),
994
+ className: "sm:hidden p-2 rounded-xl bg-white hover:bg-slate-50 text-slate-700 border border-slate-200 shadow-sm dark:bg-slate-700/50 dark:hover:bg-slate-700 dark:text-slate-300 dark:border-slate-600/50 hover:scale-105 active:scale-95 transition-all duration-200",
995
+ children: /* @__PURE__ */ e.jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 2a10 10 0 100 20 10 10 0 000-20zm0 0c2.5 2.5 4 6 4 10s-1.5 7.5-4 10m0-20C9.5 4.5 8 8 8 12s1.5 7.5 4 10m-9-10h18" }) })
996
+ }
997
+ ),
998
+ _ && /* @__PURE__ */ e.jsx(
999
+ Ht,
1000
+ {
1001
+ user: { name: h, email: b },
1002
+ onLogout: x,
1003
+ showEmail: !0
1004
+ }
1005
+ ),
1006
+ O && k.length > 0 && /* @__PURE__ */ e.jsx(
1007
+ "button",
1008
+ {
1009
+ onClick: () => H((f) => !f),
1010
+ "aria-label": M ? "Close menu" : "Open menu",
1011
+ className: "md:hidden p-2 rounded-xl transition-all duration-200 bg-white dark:bg-slate-700/50 border border-slate-200 dark:border-slate-600/50 text-slate-700 dark:text-slate-300 shadow-sm hover:scale-105 active:scale-95",
1012
+ children: M ? /* @__PURE__ */ e.jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) : /* @__PURE__ */ e.jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h16M4 18h16" }) })
1013
+ }
1014
+ )
1015
+ ] })
1016
+ ] }),
1017
+ O && M && k.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "md:hidden border-t border-slate-200 dark:border-slate-700 pb-3 animate-in slide-in-from-top-2 duration-200", children: /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-0.5 pt-2", children: k.map((f) => {
1018
+ var ce;
1019
+ return f != null && f.to ? ((ce = f == null ? void 0 : f.to) == null ? void 0 : ce.startsWith("http")) ? /* @__PURE__ */ e.jsx(
1020
+ "a",
1021
+ {
1022
+ href: f.to,
1023
+ target: f.target || "_self",
1024
+ rel: "noopener noreferrer",
1025
+ className: "flex items-center justify-between px-3 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-700/50",
1026
+ children: f.label
1027
+ },
1028
+ f.to
1029
+ ) : /* @__PURE__ */ e.jsxs(
1030
+ Se,
1031
+ {
1032
+ to: f.to,
1033
+ target: f.target || "_self",
1034
+ rel: f.target === "_blank" ? "noopener noreferrer" : void 0,
1035
+ className: `flex items-center justify-between px-3 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200 ${Z(f.to) ? "bg-violet-50 dark:bg-violet-600/10 text-violet-700 dark:text-violet-400" : "text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-700/50"}`,
1036
+ children: [
1037
+ f.label,
1038
+ Z(f.to) && /* @__PURE__ */ e.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gradient-to-r from-violet-600 to-indigo-600" })
1039
+ ]
1040
+ },
1041
+ f.to
1042
+ ) : null;
1043
+ }) }) })
1044
+ ] })
1045
+ ]
1046
+ }
1047
+ ),
1048
+ A && /* Accessibility Modal (unchanged) */
1049
+ /* @__PURE__ */ e.jsx("div", { className: "overflow-hidden overflow-x-hidden fixed top-0 right-0 left-0 z-50 flex justify-center items-center w-full h-full bg-gray-800 bg-opacity-50", children: /* @__PURE__ */ e.jsx("div", { className: "relative p-4 w-full max-w-md", children: /* @__PURE__ */ e.jsxs("div", { className: "relative rounded-2xl shadow-2xl bg-white border border-slate-200 dark:bg-gradient-to-br dark:from-slate-800 dark:to-slate-900 dark:border dark:border-slate-700", children: [
1050
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between p-5 border-b rounded-t-2xl border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 to-violet-50/30 dark:bg-gradient-to-r dark:from-slate-800 dark:to-slate-900", children: [
1051
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-3", children: [
1052
+ /* @__PURE__ */ e.jsx("div", { className: "w-10 h-10 rounded-lg bg-gradient-to-br from-violet-600 to-indigo-600 flex items-center justify-center", children: /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5 text-white", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4" }) }) }),
1053
+ /* @__PURE__ */ e.jsx("h3", { className: "text-lg font-bold text-slate-900 dark:text-white", children: "Accessibility Settings" })
1054
+ ] }),
1055
+ /* @__PURE__ */ e.jsx("button", { onClick: () => te(!1), className: "p-2 rounded-lg transition-colors text-slate-400 hover:bg-slate-100 hover:text-slate-900 dark:hover:bg-slate-700 dark:hover:text-white", children: /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })
1056
+ ] }),
1057
+ /* @__PURE__ */ e.jsxs("div", { className: "p-6 space-y-6", children: [
1058
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
1059
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
1060
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm font-semibold text-slate-700 dark:text-slate-300", children: "Font Size" }),
1061
+ /* @__PURE__ */ e.jsxs("span", { className: "text-sm font-medium px-3 py-1 rounded-lg bg-violet-100 text-violet-700 border border-violet-200 dark:bg-violet-600/20 dark:text-violet-400 dark:border dark:border-violet-500/30", children: [
1062
+ $,
1063
+ "px"
1064
+ ] })
1065
+ ] }),
1066
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
1067
+ /* @__PURE__ */ e.jsx("button", { onClick: R, className: "flex-1 py-3 px-4 rounded-xl font-semibold transition-all duration-200 bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-200 dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-300 dark:border dark:border-slate-600", children: "A-" }),
1068
+ /* @__PURE__ */ e.jsx("button", { onClick: Y, className: "flex-1 py-3 px-4 rounded-xl font-semibold transition-all duration-200 bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-200 dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-300 dark:border dark:border-slate-600", children: "A" }),
1069
+ /* @__PURE__ */ e.jsx("button", { onClick: T, className: "flex-1 py-3 px-4 rounded-xl font-semibold transition-all duration-200 bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-200 dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-300 dark:border dark:border-slate-600", children: "A+" })
1070
+ ] })
1071
+ ] }),
1072
+ /* @__PURE__ */ e.jsx("div", { className: "border-t border-slate-200 dark:border-slate-700" }),
1073
+ /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
1074
+ /* @__PURE__ */ e.jsx("label", { className: "text-sm font-semibold text-slate-700 dark:text-slate-300", children: "Grayscale Mode" }),
1075
+ /* @__PURE__ */ e.jsx("button", { onClick: () => w(!d), className: `relative inline-flex h-7 w-12 items-center rounded-full transition-colors ${d ? "bg-gradient-to-r from-violet-600 to-indigo-600" : "bg-slate-300 dark:bg-slate-700"}`, children: /* @__PURE__ */ e.jsx("span", { className: `inline-block h-5 w-5 transform rounded-full bg-white shadow-lg transition-transform ${d ? "translate-x-6" : "translate-x-1"}` }) })
1076
+ ] }),
1077
+ /* @__PURE__ */ e.jsx("div", { className: "border-t border-slate-200 dark:border-slate-700" }),
1078
+ /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
1079
+ /* @__PURE__ */ e.jsx("label", { className: "text-sm font-semibold text-slate-700 dark:text-slate-300", children: "Dyslexia-Friendly Font" }),
1080
+ /* @__PURE__ */ e.jsx("button", { onClick: () => D(!S), className: `relative inline-flex h-7 w-12 items-center rounded-full transition-colors ${S ? "bg-gradient-to-r from-violet-600 to-indigo-600" : "bg-slate-300 dark:bg-slate-700"}`, children: /* @__PURE__ */ e.jsx("span", { className: `inline-block h-5 w-5 transform rounded-full bg-white shadow-lg transition-transform ${S ? "translate-x-6" : "translate-x-1"}` }) })
1081
+ ] })
1082
+ ] }),
1083
+ /* @__PURE__ */ e.jsx("div", { className: "flex p-5 border-t rounded-b border-slate-200 dark:border-slate-700", children: /* @__PURE__ */ e.jsx("button", { onClick: () => te(!1), className: "w-full py-3 px-5 text-sm font-semibold text-white bg-gradient-to-r from-violet-600 to-indigo-600 hover:from-violet-700 hover:to-indigo-700 rounded-xl shadow-lg transition-all duration-200", children: "Close" }) })
1084
+ ] }) }) }),
1085
+ re && /* Language Modal (unchanged) */
1086
+ /* @__PURE__ */ e.jsx("div", { className: "overflow-hidden overflow-x-hidden fixed top-0 right-0 left-0 z-50 flex justify-center items-center w-full h-full bg-gray-800 bg-opacity-50", children: /* @__PURE__ */ e.jsx("div", { className: "relative p-4 w-full max-w-md", children: /* @__PURE__ */ e.jsxs("div", { className: "relative rounded-2xl shadow-2xl bg-white border border-slate-200 dark:bg-gradient-to-br dark:from-slate-800 dark:to-slate-900 dark:border dark:border-slate-700", children: [
1087
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between p-5 border-b rounded-t-2xl border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 to-violet-50/30 dark:bg-gradient-to-r dark:from-slate-800 dark:to-slate-900", children: [
1088
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-3", children: [
1089
+ /* @__PURE__ */ e.jsx("div", { className: "w-10 h-10 rounded-lg bg-gradient-to-br from-violet-600 to-indigo-600 flex items-center justify-center", children: /* @__PURE__ */ e.jsx("svg", { className: "w-[18px] h-[18px] text-white", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 2a10 10 0 100 20 10 10 0 000-20zm0 0c2.5 2.5 4 6 4 10s-1.5 7.5-4 10m0-20C9.5 4.5 8 8 8 12s1.5 7.5 4 10m-9-10h18" }) }) }),
1090
+ /* @__PURE__ */ e.jsx("h3", { className: "text-lg font-bold text-slate-900 dark:text-white", children: "Select Language" })
1091
+ ] }),
1092
+ /* @__PURE__ */ e.jsx("button", { onClick: () => Q(!1), className: "p-2 rounded-lg transition-colors text-slate-400 hover:bg-slate-100 hover:text-slate-900 dark:hover:bg-slate-700 dark:hover:text-white", children: /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })
1093
+ ] }),
1094
+ /* @__PURE__ */ e.jsx("div", { className: "p-5", children: /* @__PURE__ */ e.jsx("ul", { className: "space-y-3", children: Object.keys(g).map((f) => /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("button", { onClick: () => v(f), disabled: g[f].disabled, className: `w-full px-5 py-4 rounded-xl text-left font-semibold transition-all duration-200 ${f === q ? "bg-gradient-to-r from-violet-600 to-indigo-600 text-white shadow-lg" : "bg-slate-50 hover:bg-slate-100 text-slate-700 border border-slate-200 dark:bg-slate-700/50 dark:hover:bg-slate-700 dark:text-slate-300 dark:border dark:border-slate-600"} ${g[f].disabled ? "opacity-50 cursor-not-allowed" : "hover:scale-[1.02]"}`, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
1095
+ /* @__PURE__ */ e.jsx("span", { children: g[f].label }),
1096
+ f === q && /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) })
1097
+ ] }) }) }, f)) }) }),
1098
+ /* @__PURE__ */ e.jsx("div", { className: "flex p-5 border-t rounded-b border-slate-200 dark:border-slate-700", children: /* @__PURE__ */ e.jsx("button", { onClick: () => Q(!1), className: "w-full py-3 px-5 text-sm font-semibold text-white bg-gradient-to-r from-violet-600 to-indigo-600 hover:from-violet-700 hover:to-indigo-700 rounded-xl shadow-lg transition-all duration-200", children: "Close" }) })
1099
+ ] }) }) })
1100
+ ] });
1101
+ }, tt = (r, a) => {
1102
+ const o = {}, n = (h) => {
1103
+ for (const b of h)
1104
+ if (b.subItems) {
1105
+ const c = b.subItems.some(
1106
+ (x) => x.path && a.startsWith(x.path)
1107
+ );
1108
+ n(b.subItems), c && (o[b.name] = !0);
1109
+ }
1110
+ };
1111
+ return n(r), o;
1112
+ }, tr = ({ menuItems: r, user: a, onLogout: o, onNavigate: n }) => {
1113
+ const { t: h } = rt("pages-product-page"), [b, c] = W(!1), x = he(null), k = Fe(), [j, _] = W(
1114
+ () => tt(r, k.pathname)
1115
+ ), y = (i) => _((E) => ({ ...E, [i]: !E[i] })), C = (i) => k.pathname === i;
1116
+ de(() => {
1117
+ _((i) => ({
1118
+ ...i,
1119
+ ...tt(r, k.pathname)
1120
+ }));
1121
+ }, [k.pathname, r]), de(() => {
1122
+ const i = (E) => {
1123
+ x.current && !x.current.contains(E.target) && c(!1);
1124
+ };
1125
+ return b && document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
1126
+ }, [b]);
1127
+ const z = "bg-violet-100 text-violet-700 dark:bg-violet-600/20 dark:text-violet-400", L = "bg-violet-600 dark:bg-violet-400", p = "bg-slate-300 group-hover:bg-violet-400 dark:bg-slate-600 dark:group-hover:bg-slate-500", O = ({ item: i, depth: E = 0 }) => {
1128
+ const q = !!i.path, K = C(i.path);
1129
+ return E === 0 ? /* @__PURE__ */ e.jsx("div", { children: q ? /* @__PURE__ */ e.jsx(Se, { to: i.path, onClick: () => n == null ? void 0 : n(), children: /* @__PURE__ */ e.jsxs("div", { className: `
1130
+ flex items-center gap-2.5
1131
+ px-3 py-2 rounded-xl cursor-pointer
1132
+ transition-all duration-150 group
1133
+ ${K ? "bg-gradient-to-r from-violet-600 to-indigo-600 text-white shadow-sm shadow-violet-500/20" : "text-slate-600 hover:bg-slate-100/80 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-700/50 dark:hover:text-white"}
1134
+ `, children: [
1135
+ /* @__PURE__ */ e.jsx("div", { className: `
1136
+ w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0
1137
+ ${K ? "bg-white/20" : "bg-slate-100 group-hover:bg-slate-200 dark:bg-slate-700/60 dark:group-hover:bg-slate-700"}
1138
+ `, children: /* @__PURE__ */ e.jsx(i.icon, { className: `w-3.5 h-3.5 ${K ? "text-white" : "text-slate-500 dark:text-slate-400"}` }) }),
1139
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-none", children: h(i.name) })
1140
+ ] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1141
+ /* @__PURE__ */ e.jsxs(
1142
+ "div",
1143
+ {
1144
+ onClick: () => y(i.name),
1145
+ className: `
1146
+ flex items-center justify-between
1147
+ px-3 py-2 rounded-xl cursor-pointer
1148
+ transition-all duration-150 group
1149
+ ${j[i.name] ? "bg-slate-100/80 text-slate-900 dark:bg-slate-700/40 dark:text-white" : "text-slate-600 hover:bg-slate-100/80 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-700/50 dark:hover:text-white"}
1150
+ `,
1151
+ children: [
1152
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2.5", children: [
1153
+ /* @__PURE__ */ e.jsx("div", { className: `
1154
+ w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0
1155
+ ${j[i.name] ? "bg-violet-100 dark:bg-violet-600/20" : "bg-slate-100 group-hover:bg-slate-200 dark:bg-slate-700/60 dark:group-hover:bg-slate-700"}
1156
+ `, children: /* @__PURE__ */ e.jsx(i.icon, { className: `w-3.5 h-3.5 ${j[i.name] ? "text-violet-600 dark:text-violet-400" : "text-slate-500 dark:text-slate-400"}` }) }),
1157
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm font-semibold leading-none", children: h(i.name) })
1158
+ ] }),
1159
+ /* @__PURE__ */ e.jsx(
1160
+ "svg",
1161
+ {
1162
+ className: `w-3 h-3 flex-shrink-0 transition-transform duration-200
1163
+ text-slate-400 dark:text-slate-500
1164
+ ${j[i.name] ? "rotate-90" : ""}`,
1165
+ fill: "none",
1166
+ stroke: "currentColor",
1167
+ viewBox: "0 0 24 24",
1168
+ children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" })
1169
+ }
1170
+ )
1171
+ ]
1172
+ }
1173
+ ),
1174
+ i.subItems && j[i.name] && /* @__PURE__ */ e.jsx("div", { className: "mt-0.5 ml-3.5 pl-3 space-y-0.5 border-l border-slate-200/70 dark:border-slate-700/70", children: i.subItems.map((A) => /* @__PURE__ */ e.jsx(O, { item: A, depth: 1 }, A.name)) })
1175
+ ] }) }) : /* @__PURE__ */ e.jsx("div", { children: q ? /* @__PURE__ */ e.jsx(Se, { to: i.path, onClick: () => n == null ? void 0 : n(), children: /* @__PURE__ */ e.jsxs("div", { className: `
1176
+ flex items-center gap-2
1177
+ px-2.5 py-1.5 rounded-lg cursor-pointer
1178
+ transition-all duration-150 group
1179
+ ${K ? z : "text-slate-500 hover:bg-slate-100/70 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-slate-700/30 dark:hover:text-slate-300"}
1180
+ `, children: [
1181
+ /* @__PURE__ */ e.jsx("div", { className: `w-1.5 h-1.5 rounded-full flex-shrink-0 transition-all duration-200
1182
+ ${K ? L : p}` }),
1183
+ /* @__PURE__ */ e.jsx("span", { className: "text-[13px] font-medium", children: h(i.name) })
1184
+ ] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1185
+ /* @__PURE__ */ e.jsxs(
1186
+ "div",
1187
+ {
1188
+ onClick: () => y(i.name),
1189
+ className: `
1190
+ flex items-center justify-between
1191
+ px-2.5 py-1.5 rounded-lg cursor-pointer
1192
+ transition-all duration-150 group
1193
+ ${j[i.name] ? "bg-slate-100/70 text-slate-700 dark:bg-slate-700/30 dark:text-slate-300" : "text-slate-500 hover:bg-slate-100/70 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-slate-700/30 dark:hover:text-slate-300"}
1194
+ `,
1195
+ children: [
1196
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
1197
+ /* @__PURE__ */ e.jsx("div", { className: `w-1.5 h-1.5 rounded-full flex-shrink-0 transition-all duration-200
1198
+ ${j[i.name] ? L : p}` }),
1199
+ /* @__PURE__ */ e.jsx("span", { className: "text-[13px] font-medium", children: h(i.name) })
1200
+ ] }),
1201
+ /* @__PURE__ */ e.jsx(
1202
+ "svg",
1203
+ {
1204
+ className: `w-3 h-3 flex-shrink-0 transition-transform duration-200
1205
+ text-slate-400 dark:text-slate-500
1206
+ ${j[i.name] ? "rotate-90" : ""}`,
1207
+ fill: "none",
1208
+ stroke: "currentColor",
1209
+ viewBox: "0 0 24 24",
1210
+ children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" })
1211
+ }
1212
+ )
1213
+ ]
1214
+ }
1215
+ ),
1216
+ i.subItems && j[i.name] && /* @__PURE__ */ e.jsx("div", { className: "mt-0.5 ml-3 pl-2.5 space-y-0.5 border-l border-slate-200/70 dark:border-slate-700/70", children: i.subItems.map((A) => /* @__PURE__ */ e.jsx(O, { item: A, depth: E + 1 }, A.name)) })
1217
+ ] }) });
1218
+ };
1219
+ return /* @__PURE__ */ e.jsxs("div", { className: "h-full w-full flex pl-2.5 sm:pl-3.5 max-sm:pr-2.5 sm:max-sm:pr-3.5", children: [
1220
+ /* @__PURE__ */ e.jsxs("div", { className: `
1221
+ rounded-2xl overflow-hidden border w-full
1222
+ transition-all duration-300 relative
1223
+ bg-gradient-to-br from-white via-violet-50/20 to-white
1224
+ border-slate-200/50 dark:border-slate-700/50
1225
+ dark:from-slate-800 dark:to-slate-900
1226
+ flex flex-col
1227
+ `, children: [
1228
+ /* @__PURE__ */ e.jsx("div", { className: `absolute top-0 right-0 w-48 h-48 rounded-full blur-3xl opacity-10
1229
+ bg-violet-300 dark:bg-violet-500
1230
+ -translate-y-1/2 translate-x-1/2 pointer-events-none` }),
1231
+ /* @__PURE__ */ e.jsxs("div", { className: "relative z-10 flex flex-col h-full p-2.5 sm:p-3.5", children: [
1232
+ /* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0 mb-2.5 sm:mb-3.5", children: /* @__PURE__ */ e.jsxs("div", { className: `flex items-center gap-2.5 px-3 py-2 rounded-xl sm:rounded-2xl border
1233
+ bg-gradient-to-r from-violet-50 to-indigo-50 border-slate-200/50
1234
+ dark:from-slate-700/50 dark:to-slate-800/60 dark:border-slate-600/50`, children: [
1235
+ /* @__PURE__ */ e.jsx("div", { className: `w-7 h-7 rounded-lg flex-shrink-0
1236
+ bg-gradient-to-br from-violet-600 to-indigo-600
1237
+ flex items-center justify-center
1238
+ shadow-sm shadow-violet-500/20`, children: /* @__PURE__ */ e.jsx("svg", { className: "w-3.5 h-3.5 text-white", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h16M4 18h16" }) }) }),
1239
+ /* @__PURE__ */ e.jsxs("div", { children: [
1240
+ /* @__PURE__ */ e.jsx("h3", { className: "text-sm font-bold text-slate-900 dark:text-white leading-tight", children: "Navigation" }),
1241
+ /* @__PURE__ */ e.jsxs("p", { className: "text-[11px] text-slate-500 dark:text-slate-400 leading-none mt-0.5", children: [
1242
+ r.length,
1243
+ " items"
1244
+ ] })
1245
+ ] })
1246
+ ] }) }),
1247
+ /* @__PURE__ */ e.jsx(
1248
+ "nav",
1249
+ {
1250
+ className: "flex-1 overflow-y-auto space-y-0.5 custom-scrollbar",
1251
+ "aria-label": "Main navigation",
1252
+ children: r.map((i) => /* @__PURE__ */ e.jsx(O, { item: i, depth: 0 }, i.name))
1253
+ }
1254
+ ),
1255
+ a && /* @__PURE__ */ e.jsxs(
1256
+ "div",
1257
+ {
1258
+ ref: x,
1259
+ className: "flex-shrink-0 mt-2.5 sm:mt-3.5 pt-2.5 sm:pt-3.5 border-t border-slate-200/80 dark:border-slate-700/80",
1260
+ children: [
1261
+ b && o && /* @__PURE__ */ e.jsx("div", { className: `
1262
+ mb-1.5 rounded-xl overflow-hidden
1263
+ bg-white dark:bg-slate-800
1264
+ border border-red-100 dark:border-red-500/20
1265
+ shadow-sm
1266
+ animate-in slide-in-from-bottom-1 duration-150
1267
+ `, children: /* @__PURE__ */ e.jsxs(
1268
+ "button",
1269
+ {
1270
+ onClick: () => {
1271
+ o(), c(!1);
1272
+ },
1273
+ className: `
1274
+ w-full flex items-center gap-2.5 px-3 py-2.5
1275
+ text-[13px] font-medium text-red-500
1276
+ hover:bg-red-50 dark:hover:bg-red-500/10
1277
+ transition-colors duration-150
1278
+ `,
1279
+ children: [
1280
+ /* @__PURE__ */ e.jsx(st, { className: "w-3.5 h-3.5 flex-shrink-0" }),
1281
+ "Sign out"
1282
+ ]
1283
+ }
1284
+ ) }),
1285
+ /* @__PURE__ */ e.jsxs(
1286
+ "button",
1287
+ {
1288
+ onClick: () => c((i) => !i),
1289
+ className: `
1290
+ w-full flex items-center gap-2.5
1291
+ px-2.5 py-2 rounded-xl border
1292
+ transition-all duration-150
1293
+ ${b ? "bg-violet-50 border-violet-200/60 dark:bg-violet-900/20 dark:border-violet-700/40" : "bg-slate-50/60 border-slate-200/50 hover:bg-violet-50 hover:border-violet-200/60 dark:bg-slate-800/40 dark:border-slate-700/50 dark:hover:bg-violet-900/20 dark:hover:border-violet-700/40"}
1294
+ `,
1295
+ children: [
1296
+ /* @__PURE__ */ e.jsx("div", { className: `
1297
+ w-7 h-7 rounded-lg flex-shrink-0
1298
+ bg-gradient-to-br from-violet-600 to-indigo-600
1299
+ flex items-center justify-center shadow-sm shadow-violet-500/20
1300
+ `, children: /* @__PURE__ */ e.jsx(at, { className: "w-3.5 h-3.5 text-white" }) }),
1301
+ /* @__PURE__ */ e.jsxs("div", { className: "flex-1 text-left min-w-0", children: [
1302
+ /* @__PURE__ */ e.jsx("p", { className: "text-[13px] font-semibold text-slate-900 dark:text-white truncate leading-none", children: a.username }),
1303
+ /* @__PURE__ */ e.jsx("p", { className: "text-[11px] text-slate-400 dark:text-slate-500 truncate mt-0.5 leading-none", children: a.email })
1304
+ ] }),
1305
+ /* @__PURE__ */ e.jsx(we, { className: `
1306
+ w-3 h-3 flex-shrink-0 text-slate-400 dark:text-slate-500
1307
+ transition-transform duration-200
1308
+ ${b ? "rotate-180" : ""}
1309
+ ` })
1310
+ ]
1311
+ }
1312
+ )
1313
+ ]
1314
+ }
1315
+ )
1316
+ ] })
1317
+ ] }),
1318
+ /* @__PURE__ */ e.jsx("style", { children: `
1319
+ .custom-scrollbar::-webkit-scrollbar { width: 3px; }
1320
+ .custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
1321
+ .custom-scrollbar::-webkit-scrollbar-thumb { background: rgb(203 213 225 / 0.6); border-radius: 999px; }
1322
+ .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgb(148 163 184); }
1323
+ ` })
1324
+ ] });
1325
+ }, rr = ({
1326
+ icon: r,
1327
+ title: a,
1328
+ subtitle: o,
1329
+ badge: n,
1330
+ actions: h,
1331
+ searchBar: b,
1332
+ onIconClick: c,
1333
+ iconTitle: x
1334
+ }) => /* @__PURE__ */ e.jsxs(
1335
+ "div",
1336
+ {
1337
+ className: `
1338
+ flex-shrink-0 relative overflow-hidden
1339
+ rounded-xl sm:rounded-2xl border
1340
+ transition-all duration-300
1341
+ bg-gradient-to-br from-violet-50 via-indigo-50 to-blue-50
1342
+ border-slate-200/50
1343
+ dark:bg-gradient-to-br dark:from-slate-800 dark:to-slate-900
1344
+ dark:border-slate-700/50
1345
+ `,
1346
+ children: [
1347
+ /* @__PURE__ */ e.jsx("div", { className: `absolute top-0 right-0 w-64 h-64 rounded-full blur-3xl opacity-20
1348
+ bg-violet-300 dark:bg-violet-500
1349
+ -translate-y-1/2 translate-x-1/2 pointer-events-none` }),
1350
+ /* @__PURE__ */ e.jsx("div", { className: `absolute bottom-0 left-0 w-48 h-48 rounded-full blur-3xl opacity-20
1351
+ bg-indigo-300 dark:bg-indigo-500
1352
+ translate-y-1/2 -translate-x-1/2 pointer-events-none` }),
1353
+ /* @__PURE__ */ e.jsxs("div", { className: "relative z-10 px-4 py-3 sm:px-5 sm:py-3.5", children: [
1354
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
1355
+ r && /* @__PURE__ */ e.jsx(
1356
+ "div",
1357
+ {
1358
+ className: `
1359
+ flex-shrink-0 w-9 h-9 sm:w-10 sm:h-10
1360
+ rounded-xl bg-gradient-to-br from-violet-600 to-indigo-600
1361
+ flex items-center justify-center
1362
+ shadow-md shadow-violet-200/40 dark:shadow-violet-900/30
1363
+ transition-all duration-200
1364
+ ${c ? "cursor-pointer hover:scale-110 hover:shadow-lg active:scale-95" : "hover:scale-105"}
1365
+ `,
1366
+ onClick: c,
1367
+ title: x,
1368
+ role: c ? "button" : void 0,
1369
+ tabIndex: c ? 0 : void 0,
1370
+ onKeyDown: c ? (k) => {
1371
+ (k.key === "Enter" || k.key === " ") && (k.preventDefault(), c());
1372
+ } : void 0,
1373
+ children: /* @__PURE__ */ e.jsx(r, { className: "w-[18px] h-[18px] sm:w-5 sm:h-5 text-white" })
1374
+ }
1375
+ ),
1376
+ /* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
1377
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
1378
+ /* @__PURE__ */ e.jsx("h2", { className: `text-base sm:text-lg font-bold tracking-tight
1379
+ text-slate-900 dark:text-white leading-tight truncate`, children: a }),
1380
+ n && /* @__PURE__ */ e.jsx("span", { className: `
1381
+ inline-flex items-center px-2 py-0.5 rounded-full
1382
+ text-[11px] font-semibold tracking-wide
1383
+ bg-violet-100 text-violet-700
1384
+ border border-violet-200/50
1385
+ dark:bg-violet-600/50 dark:text-violet-400 dark:border-violet-500/30
1386
+ `, children: n })
1387
+ ] }),
1388
+ o && /* @__PURE__ */ e.jsx("p", { className: "mt-0.5 text-xs text-slate-500 dark:text-slate-400 leading-snug truncate", children: o })
1389
+ ] }),
1390
+ h && /* @__PURE__ */ e.jsx("div", { className: `
1391
+ flex-shrink-0
1392
+ flex items-center gap-1.5
1393
+ overflow-x-auto sm:overflow-x-visible
1394
+ scroll-smooth
1395
+ pb-0.5 sm:pb-0
1396
+ max-w-[calc(100vw-14rem)]
1397
+ sm:max-w-none
1398
+ sm:flex-wrap
1399
+ [&::-webkit-scrollbar]:hidden
1400
+ `, children: h })
1401
+ ] }),
1402
+ b && /* @__PURE__ */ e.jsx("div", { className: "mt-3 pt-3 border-t border-slate-200/40 dark:border-slate-700/50", children: b })
1403
+ ] })
1404
+ ]
1405
+ }
1406
+ ), ar = ({
1407
+ icon: r,
1408
+ onClick: a,
1409
+ title: o,
1410
+ variant: n = "secondary",
1411
+ size: h = "md"
1412
+ // sm | md
1413
+ }) => {
1414
+ const b = {
1415
+ secondary: `bg-white hover:bg-slate-50 text-slate-700 border border-slate-200 shadow-sm
1416
+ dark:bg-slate-700/50 dark:hover:bg-slate-700 dark:text-slate-300 dark:border-slate-600/50`,
1417
+ danger: `bg-white hover:bg-red-50 text-slate-500 hover:text-red-600 border border-slate-200 shadow-sm
1418
+ dark:bg-slate-700/50 dark:hover:bg-red-900/20 dark:text-slate-400 dark:hover:text-red-400 dark:border-slate-600/50`,
1419
+ primary: `bg-violet-100 hover:bg-violet-200 text-violet-700 border border-violet-200 shadow-sm
1420
+ dark:bg-violet-600/20 dark:hover:bg-violet-600/30 dark:text-violet-400 dark:border-violet-500/30`
1421
+ }, c = {
1422
+ sm: "p-1.5",
1423
+ md: "p-2 sm:p-2.5"
1424
+ }, x = {
1425
+ sm: "w-3.5 h-3.5",
1426
+ md: "w-4 h-4 sm:w-[18px] sm:h-[18px]"
1427
+ };
1428
+ return /* @__PURE__ */ e.jsx(
1429
+ "button",
1430
+ {
1431
+ onClick: a,
1432
+ title: o,
1433
+ "aria-label": o,
1434
+ className: `
1435
+ rounded-xl transition-all duration-200
1436
+ ${c[h]}
1437
+ ${b[n] ?? b.secondary}
1438
+ hover:scale-105 active:scale-95
1439
+ `,
1440
+ children: /* @__PURE__ */ e.jsx(r, { className: x[h] })
1441
+ }
1442
+ );
1443
+ }, sr = ({
1444
+ children: r,
1445
+ icon: a,
1446
+ iconPosition: o = "left",
1447
+ disabled: n = !1,
1448
+ onClick: h,
1449
+ variant: b = "primary",
1450
+ loading: c = !1,
1451
+ size: x = "md",
1452
+ // sm | md | lg
1453
+ className: k = "",
1454
+ ...j
1455
+ }) => {
1456
+ const _ = {
1457
+ sm: "px-3 py-1.5 text-xs rounded-lg gap-1.5",
1458
+ md: "px-4 py-2 sm:px-5 sm:py-2.5 text-sm rounded-xl gap-2",
1459
+ lg: "px-5 py-2.5 sm:px-6 sm:py-3 text-sm sm:text-base rounded-xl gap-2"
1460
+ }, y = {
1461
+ sm: "w-3.5 h-3.5",
1462
+ md: "w-4 h-4",
1463
+ lg: "w-4 h-4 sm:w-5 sm:h-5"
1464
+ }, C = {
1465
+ primary: n || c ? "bg-violet-300 text-white cursor-not-allowed opacity-60 dark:bg-violet-800/50" : "bg-gradient-to-r from-violet-600 to-indigo-600 text-white hover:from-violet-700 hover:to-indigo-700 shadow-md hover:shadow-lg hover:scale-105 active:scale-95",
1466
+ secondary: n || c ? "bg-gray-200 text-gray-400 cursor-not-allowed opacity-60 dark:bg-gray-700 dark:text-gray-500" : "bg-white text-slate-700 border border-slate-200 hover:bg-slate-50 dark:bg-slate-700/50 dark:text-slate-300 dark:border-slate-600 dark:hover:bg-slate-700 shadow-sm hover:shadow-md hover:scale-105 active:scale-95",
1467
+ danger: n || c ? "bg-red-300 text-white cursor-not-allowed opacity-60 dark:bg-red-800/50" : "bg-red-600 text-white hover:bg-red-700 shadow-md hover:shadow-lg hover:scale-105 active:scale-95"
1468
+ };
1469
+ return /* @__PURE__ */ e.jsxs(
1470
+ "button",
1471
+ {
1472
+ disabled: n || c,
1473
+ onClick: n || c ? void 0 : h,
1474
+ className: `
1475
+ inline-flex items-center justify-center font-semibold whitespace-nowrap
1476
+ transition-all duration-200
1477
+ ${_[x]}
1478
+ ${C[b]}
1479
+ ${k}
1480
+ `,
1481
+ ...j,
1482
+ children: [
1483
+ a && o === "left" && !c && /* @__PURE__ */ e.jsx(a, { className: `${y[x]} flex-shrink-0` }),
1484
+ c && /* @__PURE__ */ e.jsx("span", { className: `${y[x]} flex-shrink-0 animate-spin rounded-full
1485
+ border-2 border-white/30 border-t-white` }),
1486
+ /* @__PURE__ */ e.jsx("span", { children: c ? "Loading..." : r }),
1487
+ a && o === "right" && !c && /* @__PURE__ */ e.jsx(a, { className: `${y[x]} flex-shrink-0` })
1488
+ ]
1489
+ }
1490
+ );
1491
+ }, lr = ({
1492
+ value: r,
1493
+ onChange: a,
1494
+ placeholder: o = "Search...",
1495
+ onClear: n
1496
+ }) => /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
1497
+ /* @__PURE__ */ e.jsx(
1498
+ "svg",
1499
+ {
1500
+ className: "absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400 dark:text-slate-500",
1501
+ fill: "none",
1502
+ stroke: "currentColor",
1503
+ viewBox: "0 0 24 24",
1504
+ children: /* @__PURE__ */ e.jsx(
1505
+ "path",
1506
+ {
1507
+ strokeLinecap: "round",
1508
+ strokeLinejoin: "round",
1509
+ strokeWidth: 2,
1510
+ d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
1511
+ }
1512
+ )
1513
+ }
1514
+ ),
1515
+ /* @__PURE__ */ e.jsx(
1516
+ "input",
1517
+ {
1518
+ type: "text",
1519
+ placeholder: o,
1520
+ value: r,
1521
+ onChange: a,
1522
+ className: "w-full pl-12 pr-4 py-3 rounded-xl border transition-all duration-200 bg-white border-slate-200 text-slate-900 placeholder-slate-400 focus:border-violet-400 focus:bg-slate-50 dark:bg-slate-800/50 dark:border-slate-700 dark:text-white dark:placeholder-slate-500 dark:focus:border-violet-500 dark:focus:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-violet-500/20"
1523
+ }
1524
+ ),
1525
+ r && n && /* @__PURE__ */ e.jsx(
1526
+ "button",
1527
+ {
1528
+ onClick: n,
1529
+ className: "absolute right-4 top-1/2 -translate-y-1/2 p-1 rounded-lg transition-colors text-slate-400 hover:text-slate-600 hover:bg-slate-100 dark:text-slate-500 dark:hover:text-slate-300 dark:hover:bg-slate-700",
1530
+ children: /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
1531
+ }
1532
+ )
1533
+ ] }), nr = ({
1534
+ columns: r,
1535
+ data: a,
1536
+ onSort: o,
1537
+ sortConfig: n,
1538
+ emptyMessage: h = "No data found",
1539
+ emptyDescription: b = "Try adjusting your filters or add new data",
1540
+ emptyIcon: c
1541
+ }) => a.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "h-full rounded-2xl border bg-white border-slate-200/50 dark:bg-slate-800/50 dark:border-slate-700/50 flex items-center justify-center", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center py-12 px-6", children: [
1542
+ /* @__PURE__ */ e.jsx("div", { className: "w-16 h-16 rounded-full bg-slate-100 dark:bg-slate-700 flex items-center justify-center mx-auto mb-4", children: c ? /* @__PURE__ */ e.jsx(c, { className: "w-8 h-8 text-slate-400 dark:text-slate-500" }) : /* @__PURE__ */ e.jsx("svg", { className: "w-8 h-8 text-slate-400 dark:text-slate-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4" }) }) }),
1543
+ /* @__PURE__ */ e.jsx("h3", { className: "text-lg font-semibold text-slate-900 dark:text-slate-300 mb-2", children: h }),
1544
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm text-slate-600 dark:text-slate-400", children: b })
1545
+ ] }) }) : /* @__PURE__ */ e.jsx("div", { className: "h-full rounded-2xl border bg-white border-slate-200/50 dark:bg-slate-800/50 dark:border-slate-700/50 flex flex-col overflow-hidden", children: /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full", children: [
1546
+ /* @__PURE__ */ e.jsx("thead", { className: "bg-slate-50 dark:bg-slate-800/50 sticky top-0 ", children: /* @__PURE__ */ e.jsx("tr", { children: r.map((x) => /* @__PURE__ */ e.jsx(
1547
+ "th",
1548
+ {
1549
+ onClick: () => x.sortable && o && o(x.key),
1550
+ className: `
1551
+ px-6 py-4 text-left text-xs font-semibold text-slate-700 dark:text-slate-300 uppercase tracking-wider
1552
+ ${x.sortable ? "cursor-pointer select-none hover:bg-slate-100 dark:hover:bg-slate-700/50" : ""}
1553
+ `,
1554
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
1555
+ /* @__PURE__ */ e.jsx("span", { children: x.label }),
1556
+ x.sortable && (n == null ? void 0 : n.key) === x.key && /* @__PURE__ */ e.jsx("span", { className: "text-violet-600 dark:text-violet-400", children: n.direction === "asc" ? "↑" : "↓" })
1557
+ ] })
1558
+ },
1559
+ x.key
1560
+ )) }) }),
1561
+ /* @__PURE__ */ e.jsx("tbody", { className: "divide-y divide-slate-200 dark:divide-slate-700", children: a.map((x, k) => /* @__PURE__ */ e.jsx(
1562
+ "tr",
1563
+ {
1564
+ className: "hover:bg-slate-50 dark:hover:bg-slate-800/30 transition-colors",
1565
+ children: r.map((j) => /* @__PURE__ */ e.jsx(
1566
+ "td",
1567
+ {
1568
+ className: "px-6 py-4 whitespace-nowrap text-sm",
1569
+ children: j.render ? j.render(x) : x[j.key]
1570
+ },
1571
+ j.key
1572
+ ))
1573
+ },
1574
+ x.id || k
1575
+ )) })
1576
+ ] }) }) }), or = ({
1577
+ icon: r,
1578
+ onClick: a,
1579
+ children: o,
1580
+ variant: n = "primary",
1581
+ disabled: h = !1,
1582
+ title: b = "",
1583
+ size: c = "md"
1584
+ }) => {
1585
+ const x = {
1586
+ primary: "bg-violet-100 text-violet-700 hover:bg-violet-200 border border-violet-200 dark:bg-violet-600/20 dark:text-violet-400 dark:hover:bg-violet-600/30 dark:border dark:border-violet-500/30",
1587
+ amber: "bg-amber-50 text-amber-700 border border-amber-200 hover:bg-amber-100 dark:bg-amber-900/20 dark:text-amber-300 dark:border-amber-700/40",
1588
+ emerald: "bg-emerald-50 text-emerald-700 border border-emerald-200 hover:bg-emerald-100 dark:bg-emerald-900/20 dark:text-emerald-300 dark:border-emerald-700/40",
1589
+ red: "bg-red-50 text-red-700 border border-red-200 hover:bg-red-100 dark:bg-red-900/20 dark:text-red-300 dark:border-red-700/40",
1590
+ teal: "bg-teal-50 text-teal-700 border border-teal-200 hover:bg-teal-100 dark:bg-teal-900/20 dark:text-teal-300 dark:border-teal-700/40",
1591
+ blue: "bg-blue-50 text-blue-700 border border-blue-200 hover:bg-blue-100 dark:bg-blue-900/20 dark:text-blue-300 dark:border-blue-700/40",
1592
+ indigo: "bg-indigo-50 text-indigo-700 border border-indigo-200 hover:bg-indigo-100 dark:bg-indigo-900/20 dark:text-indigo-300 dark:border-indigo-700/40",
1593
+ pink: "bg-pink-50 text-pink-700 border border-pink-200 hover:bg-pink-100 dark:bg-pink-900/20 dark:text-pink-300 dark:border-pink-700/40",
1594
+ cyan: "bg-cyan-50 text-cyan-700 border border-cyan-200 hover:bg-cyan-100 dark:bg-cyan-900/20 dark:text-cyan-300 dark:border-cyan-700/40",
1595
+ orange: "bg-orange-50 text-orange-700 border border-orange-200 hover:bg-orange-100 dark:bg-orange-900/20 dark:text-orange-300 dark:border-orange-700/40",
1596
+ dark: "bg-slate-800 text-slate-100 border border-slate-700 hover:bg-slate-700 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600 dark:border-slate-600",
1597
+ ghost: "bg-transparent text-slate-600 border border-dashed border-slate-300 hover:bg-slate-50 dark:text-slate-400 dark:border-slate-600 dark:hover:bg-slate-800/50",
1598
+ rainbow: "action-btn-rainbow",
1599
+ disabled: "bg-slate-100/50 text-slate-400 border border-slate-200/50 cursor-not-allowed dark:bg-slate-800/30 dark:text-slate-500 dark:border-slate-700/50"
1600
+ }, k = {
1601
+ sm: "px-2.5 py-1.5 text-xs gap-1",
1602
+ md: "px-3 py-1.5 sm:px-3.5 sm:py-2 text-sm gap-1.5"
1603
+ }, j = h ? x.disabled : x[n] ?? x.primary;
1604
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1605
+ /* @__PURE__ */ e.jsx("style", { children: `
1606
+ @property --beam-angle {
1607
+ syntax: '<angle>';
1608
+ initial-value: 0deg;
1609
+ inherits: false;
1610
+ }
1611
+
1612
+ @keyframes beam-travel {
1613
+ to { --beam-angle: 360deg; }
1614
+ }
1615
+
1616
+ .action-btn-rainbow {
1617
+ position: relative;
1618
+ background: white;
1619
+ color: #1e293b;
1620
+ border: 2px solid #e2e8f0;
1621
+ overflow: hidden;
1622
+ z-index: 0;
1623
+ }
1624
+
1625
+ /* blocks glow from bleeding into button interior */
1626
+ .action-btn-rainbow::before {
1627
+ content: '';
1628
+ position: absolute;
1629
+ inset: 0;
1630
+ background: white;
1631
+ border-radius: inherit;
1632
+ z-index: 0;
1633
+ }
1634
+
1635
+ /* moving beam on border */
1636
+ .action-btn-rainbow::after {
1637
+ content: '';
1638
+ position: absolute;
1639
+ inset: -1px;
1640
+ border-radius: inherit;
1641
+ background: conic-gradient(
1642
+ from var(--beam-angle),
1643
+ transparent 75%,
1644
+ #a78bfa 82%,
1645
+ #f472b6 88%,
1646
+ #fbbf24 92%,
1647
+ #34d399 96%,
1648
+ transparent 100%
1649
+ );
1650
+ animation: beam-travel 2s linear infinite;
1651
+ z-index: 1;
1652
+ mask: linear-gradient(#fff 0 0) content-box,
1653
+ linear-gradient(#fff 0 0);
1654
+ mask-composite: exclude;
1655
+ -webkit-mask: linear-gradient(#fff 0 0) content-box,
1656
+ linear-gradient(#fff 0 0);
1657
+ -webkit-mask-composite: destination-out;
1658
+ padding: 3px;
1659
+ }
1660
+
1661
+ /* text/icon above blocking layer */
1662
+ .action-btn-rainbow > * {
1663
+ position: relative;
1664
+ z-index: 2;
1665
+ }
1666
+
1667
+ .action-btn-rainbow:hover {
1668
+ color: #000;
1669
+ transform: scale(1.05);
1670
+ border-color: #c4b5fd;
1671
+ }
1672
+
1673
+ .dark .action-btn-rainbow {
1674
+ background: #0f172a;
1675
+ color: #e2e8f0;
1676
+ border-color: #334155;
1677
+ }
1678
+
1679
+ .dark .action-btn-rainbow::before {
1680
+ background: #0f172a;
1681
+ }
1682
+
1683
+ .dark .action-btn-rainbow:hover {
1684
+ color: #fff;
1685
+ border-color: #7c3aed;
1686
+ }
1687
+ ` }),
1688
+ /* @__PURE__ */ e.jsxs(
1689
+ "button",
1690
+ {
1691
+ onClick: h ? void 0 : a,
1692
+ type: "button",
1693
+ title: b,
1694
+ disabled: h,
1695
+ className: `
1696
+ inline-flex items-center justify-center relative
1697
+ ${k[c]}
1698
+ rounded-xl font-semibold whitespace-nowrap
1699
+ transition-all duration-200
1700
+ ${j}
1701
+ ${h ? "opacity-60" : "active:scale-95"}
1702
+ `,
1703
+ children: [
1704
+ r && /* @__PURE__ */ e.jsx(r, { className: "w-3.5 h-3.5 flex-shrink-0" }),
1705
+ o && /* @__PURE__ */ e.jsx("span", { children: o })
1706
+ ]
1707
+ }
1708
+ )
1709
+ ] });
1710
+ }, ir = ({
1711
+ isOpen: r,
1712
+ onClose: a,
1713
+ title: o,
1714
+ subtitle: n,
1715
+ icon: h,
1716
+ children: b,
1717
+ size: c = "md",
1718
+ fullscreen: x = !1,
1719
+ hideHeader: k = !1
1720
+ }) => {
1721
+ if (de(() => {
1722
+ const y = (C) => {
1723
+ C.key === "Escape" && a();
1724
+ };
1725
+ return r && (document.addEventListener("keydown", y), document.body.style.overflow = "hidden"), () => {
1726
+ document.removeEventListener("keydown", y), document.body.style.overflow = "unset";
1727
+ };
1728
+ }, [r, a]), !r) return null;
1729
+ const j = {
1730
+ sm: "max-w-md",
1731
+ md: "max-w-2xl",
1732
+ lg: "max-w-4xl",
1733
+ xl: "max-w-6xl"
1734
+ }, _ = /* @__PURE__ */ e.jsx("div", { className: `flex-shrink-0 px-4 py-3 sm:px-5 sm:py-4
1735
+ bg-gradient-to-r from-violet-50 via-indigo-50 to-violet-50
1736
+ dark:from-slate-700/50 dark:via-slate-800/50 dark:to-slate-700/50
1737
+ border-b border-slate-200 dark:border-slate-700`, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
1738
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2.5 sm:gap-3 min-w-0", children: [
1739
+ h && /* @__PURE__ */ e.jsx("div", { className: `flex-shrink-0 w-9 h-9 sm:w-10 sm:h-10 rounded-xl
1740
+ flex items-center justify-center
1741
+ bg-gradient-to-br from-violet-600 to-indigo-600 shadow-lg`, children: /* @__PURE__ */ e.jsx(h, { className: "w-[18px] h-[18px] sm:w-5 sm:h-5 text-white" }) }),
1742
+ /* @__PURE__ */ e.jsxs("div", { className: "min-w-0", children: [
1743
+ /* @__PURE__ */ e.jsx("h3", { className: "text-sm sm:text-base font-bold text-slate-900 dark:text-white truncate", children: o }),
1744
+ n && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400 mt-0.5 truncate", children: n })
1745
+ ] })
1746
+ ] }),
1747
+ /* @__PURE__ */ e.jsx(
1748
+ "button",
1749
+ {
1750
+ onClick: a,
1751
+ className: `flex-shrink-0 p-1.5 rounded-lg border transition-all duration-200
1752
+ text-slate-400
1753
+ hover:bg-slate-100 hover:text-slate-900
1754
+ border-slate-200 hover:border-slate-300
1755
+ dark:border-slate-600 dark:hover:bg-slate-700
1756
+ dark:hover:text-white dark:hover:border-slate-500
1757
+ hover:scale-105 active:scale-95`,
1758
+ "aria-label": "Close modal",
1759
+ children: /* @__PURE__ */ e.jsx(xe, { className: "w-4 h-4" })
1760
+ }
1761
+ )
1762
+ ] }) });
1763
+ return x ? Te(
1764
+ /* @__PURE__ */ e.jsxs("div", { className: "fixed inset-0 z-[11000] flex flex-col animate-in fade-in duration-200 bg-white dark:bg-slate-800", children: [
1765
+ !k && _,
1766
+ /* @__PURE__ */ e.jsx("div", { className: "flex-1 min-h-0 overflow-hidden", children: b })
1767
+ ] }),
1768
+ document.body
1769
+ ) : Te(
1770
+ /* @__PURE__ */ e.jsxs("div", { className: "fixed inset-0 z-[11000] overflow-y-auto flex min-h-full items-center justify-center animate-in fade-in duration-200", children: [
1771
+ /* @__PURE__ */ e.jsx(
1772
+ "div",
1773
+ {
1774
+ className: "fixed inset-0 bg-slate-900/50 backdrop-blur-sm",
1775
+ onClick: a
1776
+ }
1777
+ ),
1778
+ /* @__PURE__ */ e.jsx("div", { className: `relative z-[11001] w-full ${j[c]} animate-in zoom-in-95 duration-200 my-auto`, children: /* @__PURE__ */ e.jsxs("div", { className: `
1779
+ rounded-xl sm:rounded-2xl border overflow-hidden
1780
+ bg-white border-slate-200/50 shadow-2xl ml-2 mr-2
1781
+ dark:bg-slate-800 dark:border-slate-700/50
1782
+ flex flex-col max-h-[70dvh] sm:max-h-[80dvh]
1783
+ `, children: [
1784
+ !k && _,
1785
+ /* @__PURE__ */ e.jsx("div", { className: "flex-1 min-h-0 overflow-y-auto", children: b })
1786
+ ] }) })
1787
+ ] }),
1788
+ document.body
1789
+ );
1790
+ }, Ut = ({
1791
+ checked: r = !1,
1792
+ onChange: a,
1793
+ disabled: o = !1,
1794
+ label: n,
1795
+ name: h,
1796
+ helpText: b
1797
+ }) => {
1798
+ const c = () => {
1799
+ o || a(h, !r);
1800
+ };
1801
+ return /* @__PURE__ */ e.jsxs("div", { className: "space-y-1.5", children: [
1802
+ n && /* @__PURE__ */ e.jsx("span", { className: "block text-sm font-semibold text-slate-700 dark:text-slate-300", children: n }),
1803
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
1804
+ /* @__PURE__ */ e.jsx(
1805
+ "button",
1806
+ {
1807
+ type: "button",
1808
+ role: "switch",
1809
+ "aria-checked": r,
1810
+ onClick: c,
1811
+ disabled: o,
1812
+ className: `
1813
+ relative inline-flex h-6 w-11 flex-shrink-0 items-center rounded-full
1814
+ transition-all duration-200
1815
+ ${r ? "bg-gradient-to-r from-violet-600 to-indigo-600 shadow-md shadow-violet-200 dark:shadow-violet-900/30" : "bg-slate-300 dark:bg-slate-600"}
1816
+ ${o ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:scale-105 active:scale-95"}
1817
+ focus:outline-none focus-visible:ring-2 focus-visible:ring-violet-500/30 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-slate-800
1818
+ `,
1819
+ children: /* @__PURE__ */ e.jsx(
1820
+ "span",
1821
+ {
1822
+ className: `
1823
+ inline-block h-4 w-4 transform rounded-full bg-white shadow-md
1824
+ transition-transform duration-200
1825
+ ${r ? "translate-x-6" : "translate-x-1"}
1826
+ `
1827
+ }
1828
+ )
1829
+ }
1830
+ ),
1831
+ /* @__PURE__ */ e.jsx("span", { className: `text-sm font-medium ${r ? "text-violet-700 dark:text-violet-400" : "text-slate-500 dark:text-slate-400"}`, children: r ? "Yes" : "No" })
1832
+ ] }),
1833
+ b && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400 leading-snug", children: b })
1834
+ ] });
1835
+ }, nt = ({ field: r, value: a, onChange: o, error: n, index: h, mode: b = "create" }) => {
1836
+ var I;
1837
+ const [c, x] = W(""), [k, j] = W(!1), [_, y] = W(!1), [C, z] = W(null), [L, p] = W(""), [O, i] = W(!1), E = (m) => {
1838
+ const M = m.target.value;
1839
+ o(r.name, M);
1840
+ }, q = (m) => {
1841
+ o(r.name, m), j(!1), x("");
1842
+ }, K = () => {
1843
+ j(!1), x(""), i(!1), z(null);
1844
+ }, A = () => {
1845
+ c.trim() && (o(r.name, c.trim()), y(!0), j(!1), x(""));
1846
+ }, te = (m, M) => {
1847
+ M.preventDefault(), M.stopPropagation(), z(m), p(m.label), i(!0);
1848
+ }, re = async (m) => {
1849
+ m.preventDefault(), m.stopPropagation(), L.trim() && C && r.onEditRank && await r.onEditRank(C.value, L.trim()) && (a === C.value && o(r.name, C.value), i(!1), z(null), p(""));
1850
+ }, Q = (m) => {
1851
+ m.preventDefault(), m.stopPropagation(), i(!1), z(null), p("");
1852
+ }, $ = (() => {
1853
+ if (!c) return r.options || [];
1854
+ const m = Array.isArray(r.options) ? r.options : [];
1855
+ if (r.fuzzySearch && typeof r.findFuzzyMatches == "function")
1856
+ try {
1857
+ return r.findFuzzyMatches(c, m, r.fuzzyThreshold || 0.5);
1858
+ } catch (M) {
1859
+ return console.error("Fuzzy search error:", M), m.filter(
1860
+ (H) => {
1861
+ var ee;
1862
+ return (ee = H.label) == null ? void 0 : ee.toLowerCase().includes(c.toLowerCase());
1863
+ }
1864
+ );
1865
+ }
1866
+ return m.filter(
1867
+ (M) => {
1868
+ var H;
1869
+ return (H = M.label) == null ? void 0 : H.toLowerCase().includes(c.toLowerCase());
1870
+ }
1871
+ ) || [];
1872
+ })(), G = c.trim() && r.fuzzySearch && r.options && typeof r.checkForDuplicateDesignation == "function" ? r.checkForDuplicateDesignation(c, r.options, 0.8) : null, d = G && G.similarityScore === 1, w = r.type === "select-or-custom" && a && !((I = r.options) != null && I.some((m) => m.value === a)), S = () => {
1873
+ var M;
1874
+ if (!a) return r.placeholder;
1875
+ if (r.type === "select-or-custom" && w)
1876
+ return a;
1877
+ const m = (M = r.options) == null ? void 0 : M.find((H) => H.value === a);
1878
+ return m ? m.label : r.placeholder;
1879
+ }, D = () => {
1880
+ var ee, le;
1881
+ const m = r.icon, M = `
1882
+ w-full px-3.5 py-2.5 rounded-xl border transition-all duration-200
1883
+ bg-white dark:bg-slate-800 text-sm text-slate-900 dark:text-white
1884
+ focus:outline-none focus:ring-2 focus:ring-violet-500/20 placeholder-slate-400
1885
+ `, H = n ? "border-red-300 dark:border-red-700 focus:border-red-500 focus:ring-red-500" : "border-slate-300 dark:border-slate-600 focus:border-violet-500 focus:ring-violet-500";
1886
+ switch (r.type) {
1887
+ case "select-or-custom":
1888
+ return _ || w ? /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
1889
+ m && /* @__PURE__ */ e.jsx("div", { className: "absolute left-3 sm:left-4 top-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ e.jsx(m, { className: "w-4 h-4 sm:w-5 sm:h-5 text-slate-400" }) }),
1890
+ /* @__PURE__ */ e.jsx(
1891
+ "input",
1892
+ {
1893
+ type: "text",
1894
+ value: a,
1895
+ onChange: (l) => o(r.name, l.target.value),
1896
+ placeholder: r.customPlaceholder || "Enter custom value",
1897
+ disabled: r.disabled,
1898
+ className: `${M} ${H} ${m ? "pl-9 sm:pl-12" : ""} pr-32 disabled:opacity-50 disabled:cursor-not-allowed`
1899
+ }
1900
+ ),
1901
+ /* @__PURE__ */ e.jsx(
1902
+ "button",
1903
+ {
1904
+ type: "button",
1905
+ onClick: (l) => {
1906
+ l.preventDefault(), l.stopPropagation(), y(!1), o(r.name, "");
1907
+ },
1908
+ className: "absolute right-3 top-1/2 -translate-y-1/2 px-3 py-1.5 text-xs font-semibold text-slate-600 hover:text-slate-900 dark:text-slate-400 dark:hover:text-white transition-colors rounded-lg hover:bg-slate-100 dark:hover:bg-slate-700",
1909
+ children: "Select Existing"
1910
+ }
1911
+ )
1912
+ ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1913
+ /* @__PURE__ */ e.jsxs(
1914
+ "button",
1915
+ {
1916
+ type: "button",
1917
+ onClick: (l) => {
1918
+ l.preventDefault(), l.stopPropagation(), r.disabled || j(!0);
1919
+ },
1920
+ disabled: r.disabled,
1921
+ className: ` relative ${M} ${H} ${m ? "pl-12" : ""} pr-4 text-left flex items-center justify-between disabled:opacity-50 disabled:cursor-not-allowed hover:border-violet-400 dark:hover:border-violet-500`,
1922
+ children: [
1923
+ m && /* @__PURE__ */ e.jsx("div", { className: "absolute left-3 sm:left-4 top-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ e.jsx(m, { className: "w-4 h-4 sm:w-5 sm:h-5 text-slate-400" }) }),
1924
+ /* @__PURE__ */ e.jsx(
1925
+ "span",
1926
+ {
1927
+ className: `${a ? "" : "text-slate-400"} truncate pr-2`,
1928
+ title: S(),
1929
+ children: S()
1930
+ }
1931
+ ),
1932
+ /* @__PURE__ */ e.jsx(we, { className: "w-5 h-5 text-slate-400 " })
1933
+ ]
1934
+ }
1935
+ ),
1936
+ k && /* @__PURE__ */ e.jsx(
1937
+ "div",
1938
+ {
1939
+ className: "fixed inset-0 z-50 flex items-center justify-center p-3 sm:p-4 bg-slate-900/50 backdrop-blur-sm animate-in fade-in duration-200",
1940
+ onMouseDown: (l) => {
1941
+ l.target === l.currentTarget && (l.preventDefault(), l.stopPropagation(), K());
1942
+ },
1943
+ children: /* @__PURE__ */ e.jsx(
1944
+ "div",
1945
+ {
1946
+ className: "relative w-full max-w-md animate-in zoom-in-95 duration-200",
1947
+ onMouseDown: (l) => l.stopPropagation(),
1948
+ children: /* @__PURE__ */ e.jsxs("div", { className: "rounded-2xl border overflow-hidden bg-white border-slate-200/50 shadow-2xl max-h-[70vh] sm:max-h-[80vh] dark:bg-slate-800 dark:border-slate-700/50 flex flex-col", children: [
1949
+ /* @__PURE__ */ e.jsx("div", { className: `flex-shrink-0 px-4 py-3 sm:px-5 sm:py-4
1950
+ bg-gradient-to-r from-violet-50 via-indigo-50 to-violet-50
1951
+ dark:from-slate-700/50 dark:via-slate-800/50 dark:to-slate-700/50
1952
+ border-b border-slate-200 dark:border-slate-700 rounded-t-2xl`, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
1953
+ /* @__PURE__ */ e.jsxs("div", { className: "min-w-0", children: [
1954
+ /* @__PURE__ */ e.jsx("h3", { className: "text-sm sm:text-base font-bold text-slate-900 dark:text-white truncate", children: O ? "Edit Rank Designation" : r.modalTitle || r.label }),
1955
+ /* @__PURE__ */ e.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400 mt-0.5 truncate", children: O ? `Editing: ${C == null ? void 0 : C.label}` : r.modalSubtitle || "Search existing or create new" })
1956
+ ] }),
1957
+ /* @__PURE__ */ e.jsx(
1958
+ "button",
1959
+ {
1960
+ type: "button",
1961
+ onClick: (l) => {
1962
+ l.preventDefault(), l.stopPropagation(), K();
1963
+ },
1964
+ className: `flex-shrink-0 p-1.5 rounded-lg border transition-all duration-200
1965
+ text-slate-400 hover:bg-slate-100 hover:text-slate-900
1966
+ border-slate-200/50 hover:border-slate-300
1967
+ dark:border-slate-700/50 dark:hover:bg-slate-700
1968
+ dark:hover:text-white dark:hover:border-slate-500
1969
+ hover:scale-105 active:scale-95`,
1970
+ children: /* @__PURE__ */ e.jsx(xe, { className: "w-4 h-4" })
1971
+ }
1972
+ )
1973
+ ] }) }),
1974
+ O ? /* @__PURE__ */ e.jsxs("div", { className: "p-4 sm:p-5 space-y-3 sm:space-y-4", children: [
1975
+ /* @__PURE__ */ e.jsxs("div", { children: [
1976
+ /* @__PURE__ */ e.jsx("label", { className: `block text-xs font-semibold uppercase tracking-wide
1977
+ text-slate-700 dark:text-slate-300 mb-1.5`, children: "Edit Rank Designation" }),
1978
+ /* @__PURE__ */ e.jsx(
1979
+ "input",
1980
+ {
1981
+ type: "text",
1982
+ value: L,
1983
+ onChange: (l) => p(l.target.value),
1984
+ className: `w-full px-3 py-2.5 sm:px-4 sm:py-3 rounded-xl border
1985
+ border-slate-200/50 dark:border-slate-700/50
1986
+ bg-white dark:bg-slate-800
1987
+ text-sm text-slate-900 dark:text-white
1988
+ focus:border-violet-500 focus:ring-2 focus:ring-violet-500/20 transition-all`,
1989
+ placeholder: "Enter new rank name",
1990
+ autoFocus: !0
1991
+ }
1992
+ )
1993
+ ] }),
1994
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 sm:gap-3", children: [
1995
+ /* @__PURE__ */ e.jsxs(
1996
+ "button",
1997
+ {
1998
+ type: "button",
1999
+ onClick: Q,
2000
+ className: `flex-1 inline-flex items-center justify-center gap-2
2001
+ px-3 py-2.5 sm:px-4 sm:py-3 rounded-xl
2002
+ bg-white dark:bg-slate-700 hover:bg-slate-50 dark:hover:bg-slate-600
2003
+ text-sm font-semibold text-slate-700 dark:text-slate-300
2004
+ border border-slate-200/50 dark:border-slate-700/50
2005
+ transition-all duration-200 hover:scale-105 active:scale-95 shadow-sm`,
2006
+ children: [
2007
+ /* @__PURE__ */ e.jsx(xe, { className: "w-4 h-4" }),
2008
+ " Cancel"
2009
+ ]
2010
+ }
2011
+ ),
2012
+ /* @__PURE__ */ e.jsxs(
2013
+ "button",
2014
+ {
2015
+ type: "button",
2016
+ onClick: re,
2017
+ className: `flex-1 inline-flex items-center justify-center gap-2
2018
+ px-3 py-2.5 sm:px-4 sm:py-3 rounded-xl
2019
+ bg-gradient-to-r from-violet-600 to-indigo-600
2020
+ hover:from-violet-700 hover:to-indigo-700
2021
+ text-sm font-semibold text-white
2022
+ shadow-md hover:shadow-lg
2023
+ transition-all duration-200 hover:scale-105 active:scale-95`,
2024
+ children: [
2025
+ /* @__PURE__ */ e.jsx(At, { className: "w-4 h-4" }),
2026
+ " Save Changes"
2027
+ ]
2028
+ }
2029
+ )
2030
+ ] })
2031
+ ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2032
+ /* @__PURE__ */ e.jsx("div", { className: "p-4 border-b border-slate-200 dark:border-slate-700", children: /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
2033
+ /* @__PURE__ */ e.jsx(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400" }),
2034
+ /* @__PURE__ */ e.jsx(
2035
+ "input",
2036
+ {
2037
+ type: "text",
2038
+ value: c,
2039
+ onChange: (l) => x(l.target.value),
2040
+ placeholder: r.fuzzySearch ? "Search or type to create new..." : "Search...",
2041
+ className: "w-full pl-10 pr-4 py-2.5 rounded-lg border border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 text-slate-900 dark:text-white placeholder-slate-400 focus:border-violet-500 focus:ring-2 focus:ring-violet-500/20 transition-all",
2042
+ autoFocus: !0
2043
+ }
2044
+ )
2045
+ ] }) }),
2046
+ G && G.similarityScore < 1 && /* @__PURE__ */ e.jsx("div", { className: "mx-4 mt-4 p-3 rounded-lg bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800/50", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-start space-x-2", children: [
2047
+ /* @__PURE__ */ e.jsx(Qe, { className: "w-4 h-4 text-amber-600 dark:text-amber-400 flex-shrink-0 mt-0.5" }),
2048
+ /* @__PURE__ */ e.jsxs("div", { className: "flex-1 text-xs", children: [
2049
+ /* @__PURE__ */ e.jsx("p", { className: "font-semibold text-amber-900 dark:text-amber-300", children: "Similar designation found!" }),
2050
+ /* @__PURE__ */ e.jsxs("p", { className: "text-amber-700 dark:text-amber-400 mt-1", children: [
2051
+ "Similar rank found (",
2052
+ G.scorePercentage,
2053
+ "% match). You can still create this if it's different."
2054
+ ] })
2055
+ ] })
2056
+ ] }) }),
2057
+ /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto p-2", children: c.trim() ? (
2058
+ /* Show filtered results + Create New when user types */
2059
+ /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2060
+ $.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "space-y-1 mb-3", children: [
2061
+ /* @__PURE__ */ e.jsx("p", { className: "px-4 py-2 text-xs font-semibold text-slate-500 dark:text-slate-400 uppercase tracking-wider", children: "Existing Options" }),
2062
+ $.map((l) => /* @__PURE__ */ e.jsx("div", { className: "group relative", children: /* @__PURE__ */ e.jsxs(
2063
+ "button",
2064
+ {
2065
+ type: "button",
2066
+ onClick: (v) => {
2067
+ v.preventDefault(), v.stopPropagation(), q(l.value);
2068
+ },
2069
+ className: `w-full text-left px-4 py-3 rounded-lg transition-all duration-200 flex items-center justify-between ${a === l.value ? "bg-violet-100 dark:bg-violet-600/20 text-violet-900 dark:text-violet-300 font-semibold" : "hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-300"}`,
2070
+ children: [
2071
+ /* @__PURE__ */ e.jsx("span", { children: l.label }),
2072
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2073
+ r.fuzzySearch && l.scorePercentage && /* @__PURE__ */ e.jsxs("span", { className: "inline-flex items-center px-2 py-0.5 rounded-md text-xs font-semibold bg-green-100 text-green-800 dark:bg-green-600/20 dark:text-green-400", children: [
2074
+ l.scorePercentage,
2075
+ "% match"
2076
+ ] }),
2077
+ r.onEditRank && !r.disabled && /* @__PURE__ */ e.jsx(
2078
+ "button",
2079
+ {
2080
+ type: "button",
2081
+ onClick: (v) => te(l, v),
2082
+ className: "opacity-0 group-hover:opacity-100 transition-opacity p-1.5 rounded-md hover:bg-white dark:hover:bg-slate-600 text-slate-500 hover:text-violet-600 dark:text-slate-400 dark:hover:text-violet-400",
2083
+ title: "Edit this rank",
2084
+ children: /* @__PURE__ */ e.jsx(Ee, { className: "w-3.5 h-3.5" })
2085
+ }
2086
+ )
2087
+ ] })
2088
+ ]
2089
+ }
2090
+ ) }, l.value))
2091
+ ] }),
2092
+ (!d || (G == null ? void 0 : G.similarityScore) < 1) && /* @__PURE__ */ e.jsxs("div", { className: $.length > 0 ? "border-t border-slate-200 dark:border-slate-700 pt-3" : "", children: [
2093
+ /* @__PURE__ */ e.jsx("p", { className: "px-4 py-2 text-xs font-semibold text-slate-500 dark:text-slate-400 uppercase tracking-wider", children: $.length > 0 ? b === "edit" ? "Or Update To" : "Or Create New" : "No matches found" }),
2094
+ /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx(
2095
+ "button",
2096
+ {
2097
+ type: "button",
2098
+ onClick: (l) => {
2099
+ l.preventDefault(), l.stopPropagation(), A();
2100
+ },
2101
+ className: "w-full px-4 py-3 rounded-lg transition-all duration-200 bg-gradient-to-r from-violet-600 to-indigo-600 hover:from-violet-700 hover:to-indigo-700 text-white font-semibold shadow-lg hover:shadow-xl transform hover:-translate-y-0.5 min-w-0",
2102
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center space-x-2 min-w-0", children: [
2103
+ /* @__PURE__ */ e.jsx(It, { className: "w-5 h-5 flex-shrink-0" }),
2104
+ /* @__PURE__ */ e.jsxs("span", { className: "truncate", children: [
2105
+ b === "edit" ? "Update to" : "Create New",
2106
+ ": ",
2107
+ c.trim()
2108
+ ] })
2109
+ ] })
2110
+ }
2111
+ ) })
2112
+ ] })
2113
+ ] })
2114
+ ) : (
2115
+ /* Show all options when no search query */
2116
+ /* @__PURE__ */ e.jsx("div", { className: "space-y-1", children: r.options && r.options.length > 0 ? r.options.map((l) => /* @__PURE__ */ e.jsx("div", { className: "group relative", children: /* @__PURE__ */ e.jsx(
2117
+ "button",
2118
+ {
2119
+ type: "button",
2120
+ onClick: (v) => {
2121
+ v.preventDefault(), v.stopPropagation(), q(l.value);
2122
+ },
2123
+ className: `w-full text-left px-4 py-3 rounded-lg transition-all duration-200 break-words whitespace-normal ${a === l.value ? "bg-violet-100 dark:bg-violet-600/20 text-violet-900 dark:text-violet-300 font-semibold" : "hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-300"}`,
2124
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
2125
+ /* @__PURE__ */ e.jsx("span", { className: "flex-1", children: l.label }),
2126
+ r.onEditRank && !r.disabled && /* @__PURE__ */ e.jsx(
2127
+ "button",
2128
+ {
2129
+ type: "button",
2130
+ onClick: (v) => te(l, v),
2131
+ className: "opacity-0 group-hover:opacity-100 transition-opacity ml-2 p-1.5 rounded-md hover:bg-white dark:hover:bg-slate-600 text-slate-500 hover:text-violet-600 dark:text-slate-400 dark:hover:text-violet-400",
2132
+ title: "Edit this rank",
2133
+ children: /* @__PURE__ */ e.jsx(Ee, { className: "w-3.5 h-3.5" })
2134
+ }
2135
+ )
2136
+ ] })
2137
+ }
2138
+ ) }, l.value)) : /* @__PURE__ */ e.jsx("div", { className: "text-center py-8", children: /* @__PURE__ */ e.jsx("p", { className: "text-sm text-slate-500 dark:text-slate-400", children: "No options available" }) }) })
2139
+ ) })
2140
+ ] }),
2141
+ /* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0 px-6 py-3 border-t border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-800/50", children: /* @__PURE__ */ e.jsxs("p", { className: "text-xs text-slate-500 dark:text-slate-400 text-center", children: [
2142
+ !O && ($ ? `${$.length} option${$.length !== 1 ? "s" : ""} available` : ""),
2143
+ O && "Edit the rank designation and save changes"
2144
+ ] }) })
2145
+ ] })
2146
+ }
2147
+ )
2148
+ }
2149
+ )
2150
+ ] });
2151
+ case "select":
2152
+ return r.searchable ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2153
+ /* @__PURE__ */ e.jsxs(
2154
+ "button",
2155
+ {
2156
+ type: "button",
2157
+ onClick: (l) => {
2158
+ l.preventDefault(), l.stopPropagation(), r.disabled || j(!0);
2159
+ },
2160
+ disabled: r.disabled,
2161
+ className: `relative ${M} ${H} flex items-center justify-between ${m ? "pl-12" : ""} pr-4 text-left disabled:opacity-50 disabled:cursor-not-allowed hover:border-violet-400 dark:hover:border-violet-500`,
2162
+ children: [
2163
+ m && /* @__PURE__ */ e.jsx("div", { className: "absolute left-3 sm:left-4 top-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ e.jsx(m, { className: "w-4 h-4 sm:w-5 sm:h-5 text-slate-400" }) }),
2164
+ /* @__PURE__ */ e.jsx("span", { className: a ? "text-slate-900 dark:text-white truncate" : "text-slate-400", children: S() }),
2165
+ /* @__PURE__ */ e.jsx(we, { className: "w-5 h-5 text-slate-400" })
2166
+ ]
2167
+ }
2168
+ ),
2169
+ k && /* @__PURE__ */ e.jsx(
2170
+ "div",
2171
+ {
2172
+ className: "fixed inset-0 z-50 flex items-center justify-center p-3 sm:p-4 bg-black/50 backdrop-blur-sm animate-in fade-in duration-200",
2173
+ onMouseDown: (l) => {
2174
+ l.target === l.currentTarget && (l.preventDefault(), l.stopPropagation(), K());
2175
+ },
2176
+ children: /* @__PURE__ */ e.jsxs(
2177
+ "div",
2178
+ {
2179
+ className: "bg-white dark:bg-slate-800 rounded-2xl shadow-2xl w-full max-w-md max-h-[70vh] sm:max-h-[80vh] flex flex-col border border-slate-200 dark:border-slate-700 animate-in zoom-in-95 duration-200",
2180
+ onMouseDown: (l) => l.stopPropagation(),
2181
+ children: [
2182
+ /* @__PURE__ */ e.jsxs("div", { className: `flex items-center justify-between gap-3
2183
+ px-4 py-3 sm:px-5 sm:py-4
2184
+ bg-gradient-to-r from-violet-50 via-indigo-50 to-violet-50
2185
+ dark:from-slate-700/50 dark:via-slate-800/50 dark:to-slate-700/50
2186
+ border-b border-slate-200 dark:border-slate-700 rounded-t-2xl`, children: [
2187
+ /* @__PURE__ */ e.jsxs("div", { className: "min-w-0", children: [
2188
+ /* @__PURE__ */ e.jsx("h3", { className: "text-sm sm:text-base font-bold text-slate-900 dark:text-white", children: r.modalTitle || "Select Option" }),
2189
+ r.modalSubtitle && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400 mt-0.5", children: r.modalSubtitle })
2190
+ ] }),
2191
+ /* @__PURE__ */ e.jsx(
2192
+ "button",
2193
+ {
2194
+ type: "button",
2195
+ onClick: (l) => {
2196
+ l.preventDefault(), l.stopPropagation(), K();
2197
+ },
2198
+ className: `flex-shrink-0 p-1.5 rounded-lg border transition-all duration-200
2199
+ text-slate-400 hover:bg-slate-100 hover:text-slate-900
2200
+ border-slate-200/50 dark:border-slate-700/50
2201
+ dark:hover:bg-slate-700 dark:hover:text-white`,
2202
+ children: /* @__PURE__ */ e.jsx(xe, { className: "w-4 h-4" })
2203
+ }
2204
+ )
2205
+ ] }),
2206
+ /* @__PURE__ */ e.jsx("div", { className: "p-4 border-b border-slate-200 dark:border-slate-700", children: /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
2207
+ /* @__PURE__ */ e.jsx(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400" }),
2208
+ /* @__PURE__ */ e.jsx(
2209
+ "input",
2210
+ {
2211
+ type: "text",
2212
+ value: c,
2213
+ onChange: (l) => x(l.target.value),
2214
+ placeholder: "Search...",
2215
+ className: "w-full pl-10 pr-4 py-2.5 rounded-lg border border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 text-slate-900 dark:text-white placeholder-slate-400 focus:border-violet-500 focus:ring-2 focus:ring-violet-500/20 transition-all",
2216
+ autoFocus: !0
2217
+ }
2218
+ )
2219
+ ] }) }),
2220
+ /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto p-2", children: $.length > 0 ? /* @__PURE__ */ e.jsx("div", { className: "space-y-1", children: $.map((l) => /* @__PURE__ */ e.jsx(
2221
+ "button",
2222
+ {
2223
+ type: "button",
2224
+ onClick: (v) => {
2225
+ v.preventDefault(), v.stopPropagation(), q(l.value);
2226
+ },
2227
+ className: `w-full text-left px-4 py-3 rounded-lg transition-all duration-200 break-all whitespace-normal ${a === l.value ? "bg-violet-100 dark:bg-violet-600/20 text-violet-900 dark:text-violet-300 font-semibold" : "hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-300"}`,
2228
+ children: l.label
2229
+ },
2230
+ l.value
2231
+ )) }) : /* @__PURE__ */ e.jsx("div", { className: "text-center py-8", children: /* @__PURE__ */ e.jsx("p", { className: "text-sm text-slate-500 dark:text-slate-400", children: "No options found" }) }) })
2232
+ ]
2233
+ }
2234
+ )
2235
+ }
2236
+ )
2237
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
2238
+ m && /* @__PURE__ */ e.jsx("div", { className: "absolute left-3 sm:left-4 top-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ e.jsx(m, { className: "w-4 h-4 sm:w-5 sm:h-5 text-slate-400" }) }),
2239
+ /* @__PURE__ */ e.jsxs(
2240
+ "select",
2241
+ {
2242
+ value: a,
2243
+ onChange: E,
2244
+ disabled: r.disabled,
2245
+ className: `${M} ${H} ${m ? "pl-12" : ""} pr-10 appearance-none cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed focus:outline-none focus:ring-2 focus:ring-violet-500/20`,
2246
+ children: [
2247
+ /* @__PURE__ */ e.jsx("option", { value: "", children: r.placeholder || "Select an option" }),
2248
+ (ee = r.options) == null ? void 0 : ee.map((l) => /* @__PURE__ */ e.jsx("option", { value: l.value, children: l.label }, l.value))
2249
+ ]
2250
+ }
2251
+ ),
2252
+ /* @__PURE__ */ e.jsx(we, { className: "absolute right-4 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400 pointer-events-none" })
2253
+ ] });
2254
+ case "date":
2255
+ case "number":
2256
+ return /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
2257
+ m && /* @__PURE__ */ e.jsx("div", { className: "absolute left-3 sm:left-4 top-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ e.jsx(m, { className: "w-4 h-4 sm:w-5 sm:h-5 text-slate-400" }) }),
2258
+ /* @__PURE__ */ e.jsx(
2259
+ "input",
2260
+ {
2261
+ type: r.type,
2262
+ value: a,
2263
+ onChange: (l) => o(r.name, l.target.value),
2264
+ disabled: r.disabled,
2265
+ min: r.min,
2266
+ max: r.max,
2267
+ step: r.step,
2268
+ className: `${M} ${H} ${m ? "pl-12" : ""} disabled:opacity-50 disabled:cursor-not-allowed focus:outline-none focus:ring-2 focus:ring-violet-500/20`
2269
+ }
2270
+ )
2271
+ ] });
2272
+ case "textarea":
2273
+ return r.isHtml ? r.disabled ? /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
2274
+ m && /* @__PURE__ */ e.jsx("div", { className: "absolute left-3 sm:left-4 top-3 pointer-events-none", children: /* @__PURE__ */ e.jsx(m, { className: "w-4 h-4 sm:w-5 sm:h-5 text-slate-400" }) }),
2275
+ /* @__PURE__ */ e.jsx(
2276
+ "div",
2277
+ {
2278
+ className: `${M} ${H} ${m ? "pl-12" : ""} opacity-50 cursor-not-allowed prose prose-sm max-w-none [&>*]:my-0.5 [&>ul]:list-disc [&>ul]:pl-4 [&>ol]:list-decimal [&>ol]:pl-4`,
2279
+ style: { minHeight: `${(r.rows || 4) * 1.75 + 1.5}rem` },
2280
+ dangerouslySetInnerHTML: { __html: a || "" }
2281
+ }
2282
+ )
2283
+ ] }) : r.renderHtmlEditor ? r.renderHtmlEditor({
2284
+ content: a || "",
2285
+ onChange: (l) => o(r.name, l),
2286
+ height: r.height || 200,
2287
+ rows: r.rows || 4
2288
+ }) : /* @__PURE__ */ e.jsxs("div", { className: "p-3 bg-amber-50 text-amber-800 rounded-xl border border-amber-200 text-sm", children: [
2289
+ "HTML Editor component not provided. Please pass ",
2290
+ /* @__PURE__ */ e.jsx("code", { children: "renderHtmlEditor" }),
2291
+ " to this field configuration."
2292
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
2293
+ m && /* @__PURE__ */ e.jsx("div", { className: "absolute left-3 sm:left-4 top-3 pointer-events-none", children: /* @__PURE__ */ e.jsx(m, { className: "w-4 h-4 sm:w-5 sm:h-5 text-slate-400" }) }),
2294
+ /* @__PURE__ */ e.jsx(
2295
+ "textarea",
2296
+ {
2297
+ value: a,
2298
+ onChange: (l) => o(r.name, l.target.value),
2299
+ placeholder: r.placeholder,
2300
+ disabled: r.disabled,
2301
+ rows: r.rows || 4,
2302
+ className: `${M} ${H} ${m ? "pl-12" : ""} placeholder-slate-400 resize-none disabled:opacity-50 disabled:cursor-not-allowed focus:outline-none focus:ring-2 focus:ring-violet-500/20`
2303
+ }
2304
+ )
2305
+ ] });
2306
+ case "checkbox":
2307
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-3", children: [
2308
+ /* @__PURE__ */ e.jsx(
2309
+ "input",
2310
+ {
2311
+ type: "checkbox",
2312
+ checked: a || !1,
2313
+ onChange: (l) => o(r.name, l.target.checked),
2314
+ disabled: r.disabled,
2315
+ className: "h-5 w-5 rounded border-slate-300 text-violet-600 focus:ring-violet-500 dark:border-slate-600 dark:bg-slate-700 disabled:opacity-50 disabled:cursor-not-allowed"
2316
+ }
2317
+ ),
2318
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium text-slate-700 dark:text-slate-300", children: r.checkboxLabel || r.label })
2319
+ ] });
2320
+ case "toggle":
2321
+ return /* @__PURE__ */ e.jsx(
2322
+ Ut,
2323
+ {
2324
+ checked: a || !1,
2325
+ onChange: o,
2326
+ disabled: r.disabled,
2327
+ label: r.toggleLabel,
2328
+ name: r.name,
2329
+ helpText: r.helpText
2330
+ }
2331
+ );
2332
+ case "radio":
2333
+ return /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap items-center gap-3 sm:gap-6", children: (le = r.options) == null ? void 0 : le.map((l) => /* @__PURE__ */ e.jsxs(
2334
+ "label",
2335
+ {
2336
+ className: `flex items-center cursor-pointer ${r.disabled ? "opacity-50 cursor-not-allowed" : ""}`,
2337
+ children: [
2338
+ /* @__PURE__ */ e.jsx(
2339
+ "input",
2340
+ {
2341
+ type: "radio",
2342
+ name: r.name,
2343
+ value: l.value,
2344
+ checked: a === l.value,
2345
+ onChange: (v) => o(r.name, v.target.value),
2346
+ disabled: r.disabled,
2347
+ className: "h-4 w-4 text-violet-600 border-slate-300 focus:ring-2 focus:ring-violet-500 cursor-pointer disabled:cursor-not-allowed dark:border-slate-600 dark:bg-slate-700"
2348
+ }
2349
+ ),
2350
+ /* @__PURE__ */ e.jsx("span", { className: `ml-2 text-sm ${a === l.value ? "font-medium text-violet-900 dark:text-violet-300" : "text-slate-700 dark:text-slate-300"}`, children: l.label })
2351
+ ]
2352
+ },
2353
+ l.value
2354
+ )) });
2355
+ case "file": {
2356
+ const l = De.useRef(null), v = Array.isArray(a) ? a : [];
2357
+ return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
2358
+ /* @__PURE__ */ e.jsxs("div", { className: "relative flex items-center", children: [
2359
+ m && /* @__PURE__ */ e.jsx("div", { className: "absolute left-3 sm:left-4 top-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ e.jsx(m, { className: "w-4 h-4 sm:w-5 sm:h-5 text-slate-400" }) }),
2360
+ /* @__PURE__ */ e.jsx(
2361
+ "div",
2362
+ {
2363
+ onClick: () => {
2364
+ var g;
2365
+ return !r.disabled && ((g = l.current) == null ? void 0 : g.click());
2366
+ },
2367
+ className: `w-full px-4 py-3 rounded-xl border transition-all duration-200 bg-white dark:bg-slate-800 text-slate-900 dark:text-white ${m ? "pl-12" : "pl-4"} pr-14 cursor-pointer select-none ${r.disabled ? "opacity-50 cursor-not-allowed border-slate-300 dark:border-slate-600" : "border-slate-300 dark:border-slate-600 hover:border-violet-400 dark:hover:border-violet-500"} ${n ? "border-red-300 dark:border-red-700" : ""}`,
2368
+ children: /* @__PURE__ */ e.jsx("span", { className: "text-slate-400 dark:text-slate-500 text-sm", children: v.length > 0 ? `${v.length} file${v.length !== 1 ? "s" : ""} selected` : r.placeholder || "Select files to upload..." })
2369
+ }
2370
+ ),
2371
+ /* @__PURE__ */ e.jsx(
2372
+ "button",
2373
+ {
2374
+ type: "button",
2375
+ disabled: r.disabled,
2376
+ onClick: () => {
2377
+ var g;
2378
+ return (g = l.current) == null ? void 0 : g.click();
2379
+ },
2380
+ className: "absolute right-2 top-1/2 -translate-y-1/2 p-2 rounded-lg bg-violet-600 hover:bg-violet-700 active:bg-violet-800 disabled:opacity-50 disabled:cursor-not-allowed text-white transition-colors",
2381
+ title: "Browse files",
2382
+ children: /* @__PURE__ */ e.jsx(Dt, { className: "w-4 h-4" })
2383
+ }
2384
+ ),
2385
+ /* @__PURE__ */ e.jsx(
2386
+ "input",
2387
+ {
2388
+ ref: l,
2389
+ type: "file",
2390
+ accept: r.accept,
2391
+ multiple: r.multiple ?? !1,
2392
+ className: "hidden",
2393
+ onChange: (g) => {
2394
+ r.onFilesSelected && r.onFilesSelected(g.target.files), g.target.value = "";
2395
+ }
2396
+ }
2397
+ )
2398
+ ] }),
2399
+ v.map(({ tempId: g, file: T, documentName: R }) => /* @__PURE__ */ e.jsxs("div", { className: "group flex items-center gap-3 px-4 py-3 rounded-xl border border-violet-200 dark:border-violet-700/40 bg-violet-50/50 dark:bg-violet-900/10 transition-colors", children: [
2400
+ /* @__PURE__ */ e.jsx("div", { className: "w-8 h-8 rounded-lg bg-violet-100 dark:bg-violet-900/30 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ e.jsx(Ft, { className: "w-4 h-4 text-violet-600 dark:text-violet-400" }) }),
2401
+ /* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
2402
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm font-semibold text-slate-800 dark:text-slate-200 truncate", children: R || (T == null ? void 0 : T.name) }),
2403
+ (T == null ? void 0 : T.size) !== void 0 && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-violet-600 dark:text-violet-400 mt-0.5", children: T.size < 1024 * 1024 ? `${(T.size / 1024).toFixed(1)} KB` : `${(T.size / (1024 * 1024)).toFixed(2)} MB` })
2404
+ ] }),
2405
+ r.onRemove && /* @__PURE__ */ e.jsx(
2406
+ "button",
2407
+ {
2408
+ type: "button",
2409
+ onClick: () => r.onRemove(g),
2410
+ className: "w-7 h-7 rounded-lg flex items-center justify-center text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-all flex-shrink-0 opacity-60 sm:opacity-0 sm:group-hover:opacity-100",
2411
+ title: "Remove",
2412
+ children: /* @__PURE__ */ e.jsx(zt, { className: "w-3.5 h-3.5" })
2413
+ }
2414
+ )
2415
+ ] }, g))
2416
+ ] });
2417
+ }
2418
+ case "text":
2419
+ case "email":
2420
+ case "password":
2421
+ default:
2422
+ return /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
2423
+ m && /* @__PURE__ */ e.jsx("div", { className: "absolute left-3 sm:left-4 top-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ e.jsx(m, { className: "w-4 h-4 sm:w-5 sm:h-5 text-slate-400" }) }),
2424
+ /* @__PURE__ */ e.jsx(
2425
+ "input",
2426
+ {
2427
+ type: r.type,
2428
+ value: r.displayValue ?? a ?? "",
2429
+ onChange: (l) => o(r.name, l.target.value),
2430
+ placeholder: r.placeholder,
2431
+ disabled: r.disabled,
2432
+ className: `${M} ${H} ${m ? "pl-12" : ""} placeholder-slate-400 disabled:opacity-50 disabled:cursor-not-allowed focus:outline-none focus:ring-2 focus:ring-violet-500/20`
2433
+ }
2434
+ )
2435
+ ] });
2436
+ }
2437
+ };
2438
+ return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
2439
+ /* @__PURE__ */ e.jsx("label", { className: "block", children: /* @__PURE__ */ e.jsxs("span", { className: "text-sm font-semibold text-slate-700 dark:text-slate-300 flex items-center space-x-1", children: [
2440
+ /* @__PURE__ */ e.jsx("span", { children: r.label }),
2441
+ r.required && /* @__PURE__ */ e.jsx("span", { className: "text-red-500 dark:text-red-400", children: "*" })
2442
+ ] }) }),
2443
+ /* @__PURE__ */ e.jsx("div", { className: "mt-2", children: D() }),
2444
+ n && /* @__PURE__ */ e.jsxs("p", { className: "text-xs sm:text-sm text-red-600 dark:text-red-400 flex items-center gap-1.5 animate-in slide-in-from-top-1 duration-200", children: [
2445
+ /* @__PURE__ */ e.jsx(Qe, { className: "w-3.5 h-3.5 flex-shrink-0" }),
2446
+ /* @__PURE__ */ e.jsx("span", { children: n })
2447
+ ] }),
2448
+ r.helpText && !n && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: r.helpText })
2449
+ ] });
2450
+ }, dr = ({
2451
+ fields: r = [],
2452
+ initialData: a = {},
2453
+ onSubmit: o,
2454
+ onCancel: n,
2455
+ onEdit: h,
2456
+ onFieldChange: b,
2457
+ submitButtonText: c = "Submit",
2458
+ cancelButtonText: x = "Cancel",
2459
+ editButtonText: k = "Edit",
2460
+ showEditingBadge: j = !1,
2461
+ editingEntity: _ = "",
2462
+ helpText: y = "All fields marked with * are required",
2463
+ isModal: C = !0,
2464
+ mode: z = "edit",
2465
+ disabled: L = !1,
2466
+ // ✅ Add disabled prop for loading states
2467
+ renderCustomField: p
2468
+ }) => {
2469
+ const O = he(!0), [i, E] = W(() => {
2470
+ const d = {};
2471
+ return (typeof r == "function" ? r(a) : r).forEach((S) => {
2472
+ d[S.name] = a[S.name] || "";
2473
+ }), d;
2474
+ }), [q, K] = W({}), A = z === "view", te = A ? !0 : !C;
2475
+ de(() => {
2476
+ if (O.current) {
2477
+ O.current = !1;
2478
+ return;
2479
+ }
2480
+ if (a && Object.keys(a).length > 0 && a.id) {
2481
+ const w = {};
2482
+ (typeof r == "function" ? r(i) : r).forEach((D) => {
2483
+ w[D.name] = a[D.name] || "";
2484
+ }), E(w);
2485
+ }
2486
+ }, [a.id]);
2487
+ const re = typeof r == "function" ? r(i) : r, Q = (d, w) => {
2488
+ if (A) return;
2489
+ const S = { ...i, [d]: w };
2490
+ E(S);
2491
+ const D = { ...q };
2492
+ delete D[d], re.forEach((I) => {
2493
+ var m;
2494
+ if ((m = I.validation) != null && m.custom && D[I.name]) {
2495
+ const M = I.name === d ? w : i[I.name];
2496
+ I.validation.custom(M, S) === !0 && delete D[I.name];
2497
+ }
2498
+ }), K(D), b && b(d, w, S);
2499
+ }, $ = () => {
2500
+ if (A) return !0;
2501
+ const d = {};
2502
+ return re.forEach((w) => {
2503
+ const S = i[w.name], D = w.isHtml ? !(S || "").replace(/<[^>]*>/g, "").trim() : !S;
2504
+ if (w.required && D) {
2505
+ d[w.name] = `${w.label} is required`;
2506
+ return;
2507
+ }
2508
+ if (w.validation && S) {
2509
+ const { minLength: I, maxLength: m, pattern: M, custom: H } = w.validation, ee = w.isHtml ? (S || "").replace(/<[^>]*>/g, "").trim() : S;
2510
+ if (I && ee.length < I) {
2511
+ d[w.name] = `Minimum ${I} characters required`;
2512
+ return;
2513
+ }
2514
+ if (m && ee.length > m) {
2515
+ d[w.name] = `Maximum ${m} characters allowed`;
2516
+ return;
2517
+ }
2518
+ if (M && !M.test(S)) {
2519
+ d[w.name] = w.validation.patternMessage || w.validation.message || "Invalid format";
2520
+ return;
2521
+ }
2522
+ if (H) {
2523
+ const le = H(S, i);
2524
+ if (le !== !0) {
2525
+ d[w.name] = typeof le == "string" ? le : w.validation.message || "Validation failed";
2526
+ return;
2527
+ }
2528
+ }
2529
+ }
2530
+ }), K(d), Object.keys(d).length === 0;
2531
+ }, G = (d) => {
2532
+ d.preventDefault(), !A && $() && o(i);
2533
+ };
2534
+ return /* @__PURE__ */ e.jsxs("form", { onSubmit: G, className: "flex flex-col h-full max-h-[75vh] sm:max-h-[70vh]", children: [
2535
+ /* @__PURE__ */ e.jsxs("div", { className: "flex-1 overflow-y-auto px-4 pt-4 sm:px-5 sm:pt-5", children: [
2536
+ A && /* @__PURE__ */ e.jsxs("div", { className: `mb-4 flex items-center gap-3 p-3 sm:p-3.5 rounded-xl
2537
+ bg-blue-50 border border-blue-200
2538
+ dark:bg-blue-600/10 dark:border-blue-500/30`, children: [
2539
+ /* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0 p-1.5 rounded-lg bg-blue-600 dark:bg-blue-500", children: /* @__PURE__ */ e.jsx(je, { className: "w-3.5 h-3.5 text-white" }) }),
2540
+ /* @__PURE__ */ e.jsxs("div", { className: "min-w-0", children: [
2541
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm font-semibold text-slate-900 dark:text-white leading-tight", children: "View Mode" }),
2542
+ /* @__PURE__ */ e.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400 leading-snug", children: "Read-only — no changes will be saved" })
2543
+ ] })
2544
+ ] }),
2545
+ !A && j && _ && /* @__PURE__ */ e.jsxs("div", { className: `mb-4 flex items-center gap-3 p-3 sm:p-3.5 rounded-xl
2546
+ bg-violet-50 border border-violet-200
2547
+ dark:bg-violet-600/10 dark:border-violet-500/30`, children: [
2548
+ /* @__PURE__ */ e.jsx("span", { className: "flex-shrink-0 w-2 h-2 rounded-full bg-violet-500 animate-pulse" }),
2549
+ /* @__PURE__ */ e.jsxs("div", { className: "min-w-0", children: [
2550
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm font-semibold text-slate-900 dark:text-white leading-tight", children: "Editing Mode" }),
2551
+ /* @__PURE__ */ e.jsxs("p", { className: "text-xs text-slate-500 dark:text-slate-400 truncate", children: [
2552
+ "Modifying:",
2553
+ " ",
2554
+ /* @__PURE__ */ e.jsx("span", { className: "font-semibold text-violet-600 dark:text-violet-400", children: _ })
2555
+ ] })
2556
+ ] })
2557
+ ] }),
2558
+ /* @__PURE__ */ e.jsx("div", { className: "space-y-4 pb-4", children: re.map((d, w) => {
2559
+ const S = i[d.name], D = q[d.name];
2560
+ if (p) {
2561
+ const I = p({
2562
+ field: d,
2563
+ value: S,
2564
+ error: D,
2565
+ index: w,
2566
+ mode: z,
2567
+ disabled: A || d.disabled || L,
2568
+ onChange: Q
2569
+ });
2570
+ if (I) return /* @__PURE__ */ e.jsx("div", { children: I }, d.name || w);
2571
+ }
2572
+ return /* @__PURE__ */ e.jsx(
2573
+ nt,
2574
+ {
2575
+ field: { ...d, disabled: A || d.disabled || L },
2576
+ value: S,
2577
+ onChange: Q,
2578
+ error: D,
2579
+ mode: z
2580
+ },
2581
+ d.name || w
2582
+ );
2583
+ }) })
2584
+ ] }),
2585
+ /* @__PURE__ */ e.jsxs("div", { className: `flex-shrink-0 bg-white dark:bg-slate-800
2586
+ border-t border-slate-200 dark:border-slate-700
2587
+ px-4 py-3 sm:px-5 sm:py-4`, children: [
2588
+ A ? /* @__PURE__ */ e.jsxs("div", { className: `flex ${C ? "flex-col-reverse sm:flex-row" : "flex-row"} gap-2.5`, children: [
2589
+ te && n && /* @__PURE__ */ e.jsxs(
2590
+ "button",
2591
+ {
2592
+ type: "button",
2593
+ onClick: n,
2594
+ className: `${C ? "flex-1 sm:flex-none" : "w-auto"}
2595
+ flex items-center justify-center gap-2
2596
+ px-4 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200
2597
+ bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-200
2598
+ dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-300 dark:border-slate-600
2599
+ hover:scale-[1.02] active:scale-[0.98]`,
2600
+ children: [
2601
+ /* @__PURE__ */ e.jsx(xe, { className: "w-4 h-4" }),
2602
+ /* @__PURE__ */ e.jsx("span", { children: "Close" })
2603
+ ]
2604
+ }
2605
+ ),
2606
+ h && /* @__PURE__ */ e.jsxs(
2607
+ "button",
2608
+ {
2609
+ type: "button",
2610
+ onClick: h,
2611
+ className: `${C ? "flex-1" : "w-auto"}
2612
+ flex items-center justify-center gap-2
2613
+ px-4 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200
2614
+ bg-gradient-to-r from-violet-600 to-indigo-600
2615
+ hover:from-violet-700 hover:to-indigo-700
2616
+ text-white shadow-md hover:shadow-lg
2617
+ hover:scale-[1.02] active:scale-[0.98]`,
2618
+ children: [
2619
+ /* @__PURE__ */ e.jsx(Ee, { className: "w-4 h-4" }),
2620
+ /* @__PURE__ */ e.jsx("span", { children: k })
2621
+ ]
2622
+ }
2623
+ )
2624
+ ] }) : (
2625
+ /* Edit mode actions */
2626
+ /* @__PURE__ */ e.jsxs("div", { className: `flex ${C ? "flex-col-reverse sm:flex-row" : "flex-row justify-start"} gap-2.5`, children: [
2627
+ n && /* @__PURE__ */ e.jsxs(
2628
+ "button",
2629
+ {
2630
+ type: "button",
2631
+ onClick: n,
2632
+ disabled: L,
2633
+ className: `${C ? "flex-1 sm:flex-none" : "w-auto"}
2634
+ flex items-center justify-center gap-2
2635
+ px-4 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200
2636
+ bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-200
2637
+ dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-300 dark:border-slate-600
2638
+ disabled:opacity-50 disabled:cursor-not-allowed
2639
+ hover:scale-[1.02] active:scale-[0.98]`,
2640
+ children: [
2641
+ /* @__PURE__ */ e.jsx(xe, { className: "w-4 h-4" }),
2642
+ /* @__PURE__ */ e.jsx("span", { children: x })
2643
+ ]
2644
+ }
2645
+ ),
2646
+ /* @__PURE__ */ e.jsxs(
2647
+ "button",
2648
+ {
2649
+ type: "submit",
2650
+ disabled: L,
2651
+ className: `${C ? "flex-1" : "w-auto"}
2652
+ flex items-center justify-center gap-2
2653
+ px-4 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200
2654
+ bg-gradient-to-r from-violet-600 to-indigo-600
2655
+ hover:from-violet-700 hover:to-indigo-700
2656
+ text-white shadow-md hover:shadow-lg
2657
+ disabled:opacity-50 disabled:cursor-not-allowed
2658
+ hover:scale-[1.02] active:scale-[0.98] disabled:hover:scale-100`,
2659
+ children: [
2660
+ L ? /* @__PURE__ */ e.jsx("span", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin flex-shrink-0" }) : /* @__PURE__ */ e.jsx(je, { className: "w-4 h-4 flex-shrink-0" }),
2661
+ /* @__PURE__ */ e.jsx("span", { children: L ? "Saving..." : c })
2662
+ ]
2663
+ }
2664
+ )
2665
+ ] })
2666
+ ),
2667
+ !A && y && /* @__PURE__ */ e.jsx("p", { className: "mt-2.5 text-xs text-slate-400 dark:text-slate-500 text-center", children: y })
2668
+ ] })
2669
+ ] });
2670
+ }, qt = ({
2671
+ isOpen: r,
2672
+ onClose: a,
2673
+ onSelect: o,
2674
+ options: n = [],
2675
+ selectedValue: h,
2676
+ title: b = "Select Option",
2677
+ subtitle: c = "Choose from the list below",
2678
+ icon: x,
2679
+ searchable: k = !0,
2680
+ searchPlaceholder: j = "Search options..."
2681
+ }) => {
2682
+ const [_, y] = W(""), C = he(null);
2683
+ de(() => {
2684
+ const p = (O) => {
2685
+ O.key === "Escape" && a();
2686
+ };
2687
+ return r && (document.addEventListener("keydown", p), k && C.current && setTimeout(() => {
2688
+ var O;
2689
+ return (O = C.current) == null ? void 0 : O.focus();
2690
+ }, 100)), () => document.removeEventListener("keydown", p);
2691
+ }, [r, a, k]);
2692
+ const z = _ ? n.filter(
2693
+ (p) => p.label.toLowerCase().includes(_.toLowerCase())
2694
+ ) : n, L = (p) => {
2695
+ o(p), a(), y("");
2696
+ };
2697
+ return r ? /* @__PURE__ */ e.jsxs("div", { className: "fixed inset-0 z-[60] flex items-center justify-center p-4 animate-in fade-in duration-200", children: [
2698
+ /* @__PURE__ */ e.jsx(
2699
+ "div",
2700
+ {
2701
+ className: "absolute inset-0 bg-slate-900/60 backdrop-blur-sm",
2702
+ onClick: a
2703
+ }
2704
+ ),
2705
+ /* @__PURE__ */ e.jsx("div", { className: "relative w-full max-w-md animate-in zoom-in-95 duration-200", children: /* @__PURE__ */ e.jsxs("div", { className: "rounded-2xl border overflow-hidden bg-white border-slate-200/50 shadow-2xl dark:bg-slate-800 dark:border-slate-700/50 max-h-[80vh] flex flex-col", children: [
2706
+ /* @__PURE__ */ e.jsxs("div", { className: "flex-shrink-0 px-6 py-5 bg-gradient-to-r from-violet-50 via-indigo-50 to-violet-50 border-b border-slate-200 dark:bg-gradient-to-r dark:from-slate-700/50 dark:via-slate-800/50 dark:to-slate-700/50 dark:border-slate-700", children: [
2707
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
2708
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-3", children: [
2709
+ x && /* @__PURE__ */ e.jsx("div", { className: "w-12 h-12 rounded-xl flex items-center justify-center bg-gradient-to-br from-violet-600 to-indigo-600 shadow-lg", children: /* @__PURE__ */ e.jsx(x, { className: "w-6 h-6 text-white" }) }),
2710
+ /* @__PURE__ */ e.jsxs("div", { children: [
2711
+ /* @__PURE__ */ e.jsx("h3", { className: "text-lg font-bold text-slate-900 dark:text-white", children: b }),
2712
+ c && /* @__PURE__ */ e.jsx("p", { className: "text-sm text-slate-600 dark:text-slate-400 mt-0.5", children: c })
2713
+ ] })
2714
+ ] }),
2715
+ /* @__PURE__ */ e.jsx(
2716
+ "button",
2717
+ {
2718
+ onClick: a,
2719
+ className: "p-2 rounded-lg border transition-all duration-200 text-slate-400 hover:bg-slate-100 hover:text-slate-900 border-slate-300 hover:border-slate-400 dark:border-slate-600 dark:hover:bg-slate-700 dark:hover:text-white dark:hover:border-slate-500",
2720
+ children: /* @__PURE__ */ e.jsx(xe, { className: "w-5 h-5" })
2721
+ }
2722
+ )
2723
+ ] }),
2724
+ k && /* @__PURE__ */ e.jsxs("div", { className: "mt-4 relative", children: [
2725
+ /* @__PURE__ */ e.jsx(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400 dark:text-slate-500" }),
2726
+ /* @__PURE__ */ e.jsx(
2727
+ "input",
2728
+ {
2729
+ ref: C,
2730
+ type: "text",
2731
+ value: _,
2732
+ onChange: (p) => y(p.target.value),
2733
+ placeholder: j,
2734
+ className: `w-full pl-11 pr-4 py-3 rounded-xl border transition-all duration-200
2735
+ bg-white border-slate-200 text-slate-900 placeholder-slate-400
2736
+ focus:border-violet-400 focus:bg-slate-50
2737
+ dark:bg-slate-700/50 dark:border-slate-600 dark:text-white dark:placeholder-slate-500
2738
+ dark:focus:border-violet-500 dark:focus:bg-slate-700
2739
+ focus:outline-none focus:ring-2 focus:ring-violet-500/20`
2740
+ }
2741
+ )
2742
+ ] })
2743
+ ] }),
2744
+ /* @__PURE__ */ e.jsx("div", { className: "flex-grow overflow-y-auto custom-scrollbar", children: z.length > 0 ? /* @__PURE__ */ e.jsx("div", { className: "p-3 space-y-1", children: z.map((p) => {
2745
+ const O = p.value === h;
2746
+ return /* @__PURE__ */ e.jsxs(
2747
+ "button",
2748
+ {
2749
+ type: "button",
2750
+ onClick: () => L(p.value),
2751
+ className: `w-full px-4 py-3.5 rounded-xl text-left flex items-center justify-between transition-all duration-200 group
2752
+ ${O ? "bg-gradient-to-r from-violet-600 to-indigo-600 text-white shadow-lg shadow-violet-500/30 dark:shadow-violet-900/30" : "text-slate-700 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-700/50"}`,
2753
+ children: [
2754
+ /* @__PURE__ */ e.jsx("span", { className: "font-medium", children: p.label }),
2755
+ O && /* @__PURE__ */ e.jsx("div", { className: "w-6 h-6 rounded-full bg-white/20 flex items-center justify-center", children: /* @__PURE__ */ e.jsx(je, { className: "w-4 h-4 text-white" }) })
2756
+ ]
2757
+ },
2758
+ p.value
2759
+ );
2760
+ }) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-4 py-12 text-center", children: [
2761
+ /* @__PURE__ */ e.jsx("div", { className: "w-16 h-16 mx-auto mb-4 rounded-full bg-slate-100 dark:bg-slate-700/50 flex items-center justify-center", children: /* @__PURE__ */ e.jsx(Ce, { className: "w-8 h-8 text-slate-400 dark:text-slate-500" }) }),
2762
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm font-semibold text-slate-600 dark:text-slate-400", children: "No options found" }),
2763
+ /* @__PURE__ */ e.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-500 mt-1", children: "Try adjusting your search terms" })
2764
+ ] }) }),
2765
+ /* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0 px-6 py-3 border-t border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-800/50", children: /* @__PURE__ */ e.jsxs("p", { className: "text-xs text-slate-500 dark:text-slate-400 text-center", children: [
2766
+ z.length,
2767
+ " option",
2768
+ z.length !== 1 ? "s" : "",
2769
+ " available"
2770
+ ] }) })
2771
+ ] }) })
2772
+ ] }) : null;
2773
+ }, cr = ({
2774
+ value: r,
2775
+ onChange: a,
2776
+ options: o = [],
2777
+ placeholder: n = "Select an option",
2778
+ label: h,
2779
+ icon: b,
2780
+ required: c = !1,
2781
+ disabled: x = !1,
2782
+ error: k,
2783
+ searchable: j = !0,
2784
+ name: _,
2785
+ modalTitle: y,
2786
+ modalSubtitle: C
2787
+ }) => {
2788
+ const [z, L] = W(!1), p = o.find((E) => E.value === r), O = (p == null ? void 0 : p.label) || n, i = (E) => {
2789
+ a(_, E);
2790
+ };
2791
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2792
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
2793
+ h && /* @__PURE__ */ e.jsxs("label", { className: "flex items-center text-sm font-semibold text-slate-700 dark:text-slate-300", children: [
2794
+ b && /* @__PURE__ */ e.jsx(b, { className: "w-4 h-4 mr-2 text-violet-600 dark:text-violet-400" }),
2795
+ h,
2796
+ c && /* @__PURE__ */ e.jsx("span", { className: "text-red-500 ml-1", children: "*" })
2797
+ ] }),
2798
+ /* @__PURE__ */ e.jsxs(
2799
+ "button",
2800
+ {
2801
+ type: "button",
2802
+ onClick: () => !x && L(!0),
2803
+ disabled: x,
2804
+ className: `w-full px-4 py-3 rounded-xl border transition-all duration-200 flex items-center justify-between text-left
2805
+ ${k ? "border-red-500 focus:border-red-500 focus:ring-red-500/20" : "border-slate-200 focus:border-violet-400 dark:border-slate-600 dark:focus:border-violet-500"}
2806
+ ${x ? "opacity-50 cursor-not-allowed bg-slate-100 dark:bg-slate-800" : "bg-slate-50 hover:bg-white dark:bg-slate-700/50 dark:hover:bg-slate-700 cursor-pointer"}
2807
+ text-slate-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-violet-500/20`,
2808
+ children: [
2809
+ /* @__PURE__ */ e.jsx(
2810
+ "span",
2811
+ {
2812
+ className: `text-sm ${r ? "" : "text-slate-400 dark:text-slate-500"}`,
2813
+ children: O
2814
+ }
2815
+ ),
2816
+ /* @__PURE__ */ e.jsx(ke, { className: "w-5 h-5 text-slate-400 dark:text-slate-500" })
2817
+ ]
2818
+ }
2819
+ ),
2820
+ !k && r && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2 mt-2", children: [
2821
+ /* @__PURE__ */ e.jsx("div", { className: "w-5 h-5 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center", children: /* @__PURE__ */ e.jsx(je, { className: "w-3 h-3 text-green-600 dark:text-green-400" }) }),
2822
+ /* @__PURE__ */ e.jsx("span", { className: "text-xs text-green-600 dark:text-green-400 font-medium", children: "Selected" })
2823
+ ] }),
2824
+ k && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-red-500 flex items-center space-x-1 mt-1", children: /* @__PURE__ */ e.jsx("span", { children: k }) })
2825
+ ] }),
2826
+ /* @__PURE__ */ e.jsx(
2827
+ qt,
2828
+ {
2829
+ isOpen: z,
2830
+ onClose: () => L(!1),
2831
+ onSelect: i,
2832
+ options: o,
2833
+ selectedValue: r,
2834
+ title: y || h || "Select Option",
2835
+ subtitle: C || `Choose from ${o.length} options`,
2836
+ icon: b,
2837
+ searchable: j
2838
+ }
2839
+ )
2840
+ ] });
2841
+ }, xr = ({
2842
+ steps: r = [],
2843
+ initialData: a = {},
2844
+ onSubmit: o,
2845
+ onCancel: n,
2846
+ onEdit: h,
2847
+ onStepChange: b,
2848
+ submitButtonText: c = "Submit",
2849
+ cancelButtonText: x = "Cancel",
2850
+ editButtonText: k = "Edit Record",
2851
+ showEditingBadge: j = !1,
2852
+ editingEntity: _ = "",
2853
+ helpText: y = "All fields marked with * are required",
2854
+ isModal: C = !0,
2855
+ mode: z = "create"
2856
+ }) => {
2857
+ var l;
2858
+ const L = he(null), [p, O] = W(0), [i, E] = W(
2859
+ () => typeof window < "u" ? window.innerWidth >= 1024 : !0
2860
+ ), [q, K] = W(() => {
2861
+ const v = typeof r == "function" ? r(a) : r, g = {};
2862
+ return v.forEach((T) => {
2863
+ T.fields && T.fields.forEach((R) => {
2864
+ g[R.name] = a[R.name] || "";
2865
+ });
2866
+ }), g;
2867
+ }), [A, te] = W({}), [re, Q] = W(/* @__PURE__ */ new Set([0])), $ = z === "view", G = z === "edit", d = typeof r == "function" ? r(q) : r;
2868
+ de(() => {
2869
+ b && b(p, q);
2870
+ }, [p, q, b]);
2871
+ const w = () => {
2872
+ var v;
2873
+ (v = L.current) == null || v.scrollTo({ top: 0, behavior: "smooth" });
2874
+ }, S = (v, g) => {
2875
+ if ($) return;
2876
+ const R = d.flatMap((Y) => Y.fields || []).find((Y) => Y.name === v);
2877
+ K((Y) => {
2878
+ const Z = { ...Y, [v]: g };
2879
+ return R != null && R.resetFieldsOnChange && R.resetFieldsOnChange.forEach((ne) => {
2880
+ Z[ne] = "";
2881
+ }), Z;
2882
+ }), A[v] && te((Y) => ({ ...Y, [v]: "" })), R != null && R.onChange && R.onChange(v, g);
2883
+ }, D = (v) => {
2884
+ if ($) return !0;
2885
+ const g = {}, T = d[v];
2886
+ if (T.customValidator) {
2887
+ const R = T.customValidator(v, q);
2888
+ Object.assign(g, R);
2889
+ }
2890
+ return T.fields && T.fields.length > 0 && T.fields.forEach((R) => {
2891
+ const Y = q[R.name];
2892
+ if (R.required && !Y) {
2893
+ g[R.name] = `${R.label} is required`;
2894
+ return;
2895
+ }
2896
+ if (Y && R.validation) {
2897
+ const { minLength: Z, maxLength: ne, pattern: f, min: oe, max: ce, custom: ve } = R.validation;
2898
+ Z && Y.length < Z && (g[R.name] = `Minimum ${Z} characters required`), ne && Y.length > ne && (g[R.name] = `Maximum ${ne} characters allowed`), f && !f.test(Y) && (g[R.name] = R.validation.message || "Invalid format"), oe !== void 0 && parseFloat(Y) < oe && (g[R.name] = R.validation.message || `Minimum value is ${oe}`), ce !== void 0 && parseFloat(Y) > ce && (g[R.name] = R.validation.message || `Maximum value is ${ce}`), ve && !ve(Y) && (g[R.name] = R.validation.message || "Validation failed");
2899
+ }
2900
+ }), te(g), Object.keys(g).length === 0;
2901
+ }, I = (v) => {
2902
+ if (v.preventDefault(), v.stopPropagation(), D(p)) {
2903
+ const g = p + 1;
2904
+ O(g), Q((T) => /* @__PURE__ */ new Set([...T, g])), w();
2905
+ }
2906
+ }, m = (v) => {
2907
+ v.preventDefault(), v.stopPropagation(), O((g) => g - 1), w();
2908
+ }, M = (v) => {
2909
+ if (typeof window < "u" && window.innerWidth < 1024 && E(!1), $) {
2910
+ O(v), Q((g) => /* @__PURE__ */ new Set([...g, v])), w();
2911
+ return;
2912
+ }
2913
+ (re.has(v) || v === p + 1) && (v > p ? D(p) && (O(v), Q((g) => /* @__PURE__ */ new Set([...g, v])), w()) : (O(v), w()));
2914
+ }, H = (v) => {
2915
+ v.preventDefault(), !$ && D(p) && o(q);
2916
+ }, ee = p === d.length - 1, le = p === 0;
2917
+ return /* @__PURE__ */ e.jsxs("form", { onSubmit: H, className: "flex h-full overflow-hidden relative", children: [
2918
+ i && /* @__PURE__ */ e.jsx(
2919
+ "div",
2920
+ {
2921
+ className: "lg:hidden absolute inset-0 z-20 bg-black/40 backdrop-blur-[1px]",
2922
+ onClick: () => E(!1)
2923
+ }
2924
+ ),
2925
+ /* @__PURE__ */ e.jsxs("div", { className: `
2926
+ overflow-hidden transition-all duration-300 ease-in-out
2927
+ border-r border-slate-200 dark:border-slate-700
2928
+ absolute z-30 h-full bg-white dark:bg-slate-800
2929
+ lg:relative lg:flex-shrink-0 lg:z-auto lg:h-auto lg:bg-transparent dark:lg:bg-transparent
2930
+ ${i ? "w-52 lg:w-56" : "w-0 lg:w-10"}
2931
+ `, children: [
2932
+ !i && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col h-full items-center justify-between py-4 px-2 gap-3", children: [
2933
+ /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center gap-2 flex-1 justify-center", children: d.map((v, g) => {
2934
+ const T = g === p, R = g < p;
2935
+ return /* @__PURE__ */ e.jsx(
2936
+ "button",
2937
+ {
2938
+ type: "button",
2939
+ onClick: () => M(g),
2940
+ title: d[g].title,
2941
+ className: `
2942
+ rounded-full transition-all duration-300 flex-shrink-0
2943
+ ${R ? "w-2 h-2 bg-emerald-500 shadow-sm" : T ? $ ? "w-2.5 h-2.5 bg-blue-500 shadow-md ring-2 ring-blue-300/40 dark:ring-blue-600/40" : "w-2.5 h-2.5 bg-violet-500 shadow-md ring-2 ring-violet-300/40 dark:ring-violet-600/40" : "w-2 h-2 bg-slate-300 dark:bg-slate-600 hover:bg-slate-400"}
2944
+ `
2945
+ },
2946
+ g
2947
+ );
2948
+ }) }),
2949
+ /* @__PURE__ */ e.jsx("div", { className: "w-1 h-16 bg-slate-200/60 dark:bg-slate-700/60 rounded-full overflow-hidden", children: /* @__PURE__ */ e.jsx(
2950
+ "div",
2951
+ {
2952
+ className: `w-full rounded-full transition-all duration-500 ${$ ? "bg-blue-500" : "bg-gradient-to-b from-violet-500 to-indigo-500"}`,
2953
+ style: { height: `${(p + 1) / d.length * 100}%` }
2954
+ }
2955
+ ) })
2956
+ ] }),
2957
+ i && /* @__PURE__ */ e.jsxs("div", { className: "h-full flex flex-col px-3 sm:px-4 pt-4 pb-4 overflow-y-auto", children: [
2958
+ /* @__PURE__ */ e.jsx("div", { className: "flex-1 space-y-1.5 mb-4", children: d.map((v, g) => {
2959
+ const T = g === p, R = ($ || re.has(g)) && g < p, Y = $ ? !0 : re.has(g) || g === p + 1, Z = v.icon;
2960
+ return /* @__PURE__ */ e.jsx(
2961
+ "button",
2962
+ {
2963
+ type: "button",
2964
+ onClick: () => Y && M(g),
2965
+ disabled: !Y,
2966
+ className: `
2967
+ w-full p-3 rounded-xl transition-all duration-200 text-left
2968
+ ${T ? $ ? "bg-gradient-to-r from-blue-600 to-cyan-600 text-white shadow-md scale-[1.01]" : "bg-gradient-to-r from-violet-600 to-indigo-600 text-white shadow-md scale-[1.01]" : R ? "bg-white dark:bg-slate-800/50 border border-emerald-200 dark:border-emerald-500/30 hover:shadow-sm" : Y ? "bg-white dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 hover:shadow-sm" : "bg-slate-100 dark:bg-slate-800/30 border border-slate-200 dark:border-slate-700 opacity-50 cursor-not-allowed"}
2969
+ `,
2970
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2.5", children: [
2971
+ /* @__PURE__ */ e.jsx(
2972
+ "div",
2973
+ {
2974
+ className: `
2975
+ w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0 transition-all
2976
+ ${T ? "bg-white/20" : R ? "bg-emerald-100 dark:bg-emerald-500/20" : "bg-slate-100 dark:bg-slate-700"}
2977
+ `,
2978
+ children: R && !T ? /* @__PURE__ */ e.jsx(Vt, { className: "w-4 h-4 text-emerald-600 dark:text-emerald-400" }) : /* @__PURE__ */ e.jsx(
2979
+ Z,
2980
+ {
2981
+ className: `w-4 h-4 ${T ? "text-white" : Y ? $ ? "text-blue-600 dark:text-blue-400" : "text-violet-600 dark:text-violet-400" : "text-slate-400 dark:text-slate-500"}`
2982
+ }
2983
+ )
2984
+ }
2985
+ ),
2986
+ /* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
2987
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1.5 mb-0.5", children: [
2988
+ /* @__PURE__ */ e.jsxs("span", { className: `text-[10px] font-semibold uppercase tracking-wider ${T ? "text-white/70" : "text-slate-400 dark:text-slate-500"}`, children: [
2989
+ $ ? "§" : "#",
2990
+ g + 1
2991
+ ] }),
2992
+ R && !T && !$ && /* @__PURE__ */ e.jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-semibold bg-emerald-100 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-400", children: "✓" })
2993
+ ] }),
2994
+ /* @__PURE__ */ e.jsx("p", { className: `text-xs font-semibold truncate leading-tight ${T ? "text-white" : R ? "text-slate-900 dark:text-white" : Y ? "text-slate-700 dark:text-slate-300" : "text-slate-400 dark:text-slate-500"}`, children: v.title }),
2995
+ v.subtitle && /* @__PURE__ */ e.jsx("p", { className: `text-[10px] mt-0.5 line-clamp-1 leading-snug ${T ? "text-white/75" : "text-slate-400 dark:text-slate-500"}`, children: v.subtitle })
2996
+ ] })
2997
+ ] })
2998
+ },
2999
+ g
3000
+ );
3001
+ }) }),
3002
+ !$ && y && /* @__PURE__ */ e.jsx("div", { className: "p-3 rounded-xl bg-blue-50 border border-blue-200 dark:bg-blue-900/20 dark:border-blue-800/30 flex-shrink-0", children: /* @__PURE__ */ e.jsxs("p", { className: "text-[11px] text-slate-600 dark:text-slate-400 leading-relaxed", children: [
3003
+ /* @__PURE__ */ e.jsx("span", { className: "font-semibold text-blue-600 dark:text-blue-400", children: "Tip: " }),
3004
+ y
3005
+ ] }) })
3006
+ ] })
3007
+ ] }),
3008
+ /* @__PURE__ */ e.jsxs("div", { className: "flex-1 flex flex-col min-h-0 relative", children: [
3009
+ /* @__PURE__ */ e.jsxs("div", { className: `lg:hidden flex-shrink-0 flex items-center gap-2.5 px-3.5 py-2
3010
+ border-b border-slate-200 dark:border-slate-700
3011
+ bg-white dark:bg-slate-800`, children: [
3012
+ /* @__PURE__ */ e.jsx(
3013
+ "button",
3014
+ {
3015
+ type: "button",
3016
+ onClick: () => E(!i),
3017
+ className: `p-2.5 rounded-lg border border-slate-200 dark:border-slate-600
3018
+ bg-white dark:bg-slate-700 text-slate-500 dark:text-slate-400
3019
+ hover:bg-violet-50 hover:border-violet-300 hover:text-violet-600
3020
+ dark:hover:bg-violet-900/30 dark:hover:border-violet-600 dark:hover:text-violet-400
3021
+ transition-all duration-200 active:scale-95`,
3022
+ "aria-label": "Toggle steps",
3023
+ children: i ? /* @__PURE__ */ e.jsx(Me, { className: "w-4 h-4" }) : /* @__PURE__ */ e.jsx(ke, { className: "w-4 h-4" })
3024
+ }
3025
+ ),
3026
+ /* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
3027
+ /* @__PURE__ */ e.jsx("p", { className: "text-xs font-semibold text-slate-700 dark:text-slate-300 truncate", children: d[p].title }),
3028
+ /* @__PURE__ */ e.jsxs("p", { className: `text-[10px] font-medium ${$ ? "text-blue-500" : "text-violet-500"}`, children: [
3029
+ $ ? "Section" : "Step",
3030
+ " ",
3031
+ p + 1,
3032
+ "/",
3033
+ d.length
3034
+ ] })
3035
+ ] }),
3036
+ /* @__PURE__ */ e.jsx("div", { className: "w-16 h-1.5 bg-slate-200 dark:bg-slate-700 rounded-full overflow-hidden flex-shrink-0", children: /* @__PURE__ */ e.jsx(
3037
+ "div",
3038
+ {
3039
+ className: `h-1.5 rounded-full transition-all duration-300 ${$ ? "bg-blue-500" : "bg-gradient-to-r from-violet-500 to-indigo-500"}`,
3040
+ style: { width: `${(p + 1) / d.length * 100}%` }
3041
+ }
3042
+ ) })
3043
+ ] }),
3044
+ /* @__PURE__ */ e.jsx(
3045
+ "button",
3046
+ {
3047
+ type: "button",
3048
+ onClick: () => E(!i),
3049
+ className: `hidden lg:flex absolute left-0 top-5 -translate-x-[1.625rem] z-20
3050
+ w-6 h-6 lg:w-7 lg:h-7 rounded-full
3051
+ bg-white dark:bg-slate-800
3052
+ border border-slate-200 dark:border-slate-600
3053
+ shadow-md hover:shadow-lg
3054
+ items-center justify-center
3055
+ hover:bg-violet-50 dark:hover:bg-violet-900/30
3056
+ hover:border-violet-300 dark:hover:border-violet-600
3057
+ hover:scale-110 active:scale-95
3058
+ transition-all duration-200 group`,
3059
+ "aria-label": i ? "Collapse steps" : "Expand steps",
3060
+ children: i ? /* @__PURE__ */ e.jsx(Me, { className: "w-3 h-3 lg:w-3.5 lg:h-3.5 text-slate-400 group-hover:text-violet-500 transition-colors" }) : /* @__PURE__ */ e.jsx(ke, { className: "w-3 h-3 lg:w-3.5 lg:h-3.5 text-slate-400 group-hover:text-violet-500 transition-colors" })
3061
+ }
3062
+ ),
3063
+ /* @__PURE__ */ e.jsx("div", { ref: L, className: "flex-1 min-h-0 overflow-y-auto px-3.5 sm:px-5 lg:px-6 py-4 sm:py-5", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 sm:space-y-5 w-full", children: d[p].customRender ? $ && d[p].customViewRender ? /* @__PURE__ */ e.jsx("div", { className: "w-full", children: typeof d[p].customViewRender == "function" ? d[p].customViewRender() : d[p].customViewRender }) : /* @__PURE__ */ e.jsx("div", { className: "w-full", children: typeof d[p].customRender == "function" ? d[p].customRender({ formData: q, errors: A, handleChange: S, mode: z }) : d[p].customRender }) : (l = d[p].fields) == null ? void 0 : l.map((v, g) => /* @__PURE__ */ e.jsx(
3064
+ nt,
3065
+ {
3066
+ index: g,
3067
+ field: { ...v, disabled: $ || v.disabled },
3068
+ value: q[v.name],
3069
+ onChange: S,
3070
+ error: A[v.name],
3071
+ mode: z
3072
+ },
3073
+ v.name || g
3074
+ )) }) }),
3075
+ /* @__PURE__ */ e.jsx("div", { className: `flex-shrink-0 px-4 py-3 sm:px-5 sm:py-3.5
3076
+ border-t border-slate-200 dark:border-slate-700
3077
+ bg-white dark:bg-slate-800`, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-2.5", children: [
3078
+ le ? /* @__PURE__ */ e.jsx("div", {}) : /* @__PURE__ */ e.jsxs(
3079
+ "button",
3080
+ {
3081
+ type: "button",
3082
+ onClick: m,
3083
+ className: `inline-flex items-center gap-2 px-3.5 py-2.5 sm:px-4 sm:py-2.5
3084
+ rounded-xl text-sm font-semibold transition-all duration-200
3085
+ bg-white hover:bg-slate-50 text-slate-700
3086
+ border border-slate-200 dark:border-slate-600
3087
+ dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-300
3088
+ shadow-sm hover:shadow-md hover:scale-105 active:scale-95`,
3089
+ children: [
3090
+ /* @__PURE__ */ e.jsx(Me, { className: "w-4 h-4 flex-shrink-0" }),
3091
+ /* @__PURE__ */ e.jsx("span", { className: G ? void 0 : "hidden sm:inline", children: "Previous" })
3092
+ ]
3093
+ }
3094
+ ),
3095
+ /* @__PURE__ */ e.jsx("div", { className: "flex-1" }),
3096
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: $ ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3097
+ /* @__PURE__ */ e.jsxs(
3098
+ "button",
3099
+ {
3100
+ type: "button",
3101
+ onClick: n,
3102
+ className: `hidden sm:inline-flex items-center gap-1.5 px-3.5 py-2.5 sm:px-4 sm:py-2.5
3103
+ rounded-xl text-sm font-semibold transition-all duration-200
3104
+ bg-white hover:bg-slate-50 text-slate-700
3105
+ border border-slate-200 dark:border-slate-600
3106
+ dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-300
3107
+ shadow-sm hover:shadow-md hover:scale-105 active:scale-95`,
3108
+ children: [
3109
+ /* @__PURE__ */ e.jsx(xe, { className: "w-4 h-4 flex-shrink-0" }),
3110
+ /* @__PURE__ */ e.jsx("span", { className: "hidden sm:inline", children: "Close" })
3111
+ ]
3112
+ }
3113
+ ),
3114
+ !ee && /* @__PURE__ */ e.jsxs(
3115
+ "button",
3116
+ {
3117
+ type: "button",
3118
+ onClick: I,
3119
+ className: `inline-flex items-center gap-1.5 px-3.5 py-2.5 sm:px-4 sm:py-2.5
3120
+ rounded-xl text-sm font-semibold transition-all duration-200
3121
+ bg-white hover:bg-slate-50 text-slate-700
3122
+ border border-slate-200 dark:border-slate-600
3123
+ dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-300
3124
+ shadow-sm hover:shadow-md hover:scale-105 active:scale-95`,
3125
+ children: [
3126
+ /* @__PURE__ */ e.jsx("span", { className: "hidden sm:inline", children: "Next" }),
3127
+ /* @__PURE__ */ e.jsx(ke, { className: "w-4 h-4 flex-shrink-0" })
3128
+ ]
3129
+ }
3130
+ ),
3131
+ h && /* @__PURE__ */ e.jsxs(
3132
+ "button",
3133
+ {
3134
+ type: "button",
3135
+ onClick: h,
3136
+ className: `inline-flex items-center gap-1.5 px-3.5 py-2.5 sm:px-4 sm:py-2.5
3137
+ rounded-xl text-sm font-semibold transition-all duration-200
3138
+ bg-gradient-to-r from-violet-600 to-indigo-600
3139
+ hover:from-violet-700 hover:to-indigo-700
3140
+ text-white shadow-md hover:shadow-lg
3141
+ hover:scale-105 active:scale-95`,
3142
+ children: [
3143
+ /* @__PURE__ */ e.jsx(Ee, { className: "w-4 h-4 flex-shrink-0" }),
3144
+ /* @__PURE__ */ e.jsx("span", { className: "hidden sm:inline", children: k }),
3145
+ /* @__PURE__ */ e.jsx("span", { className: "sm:hidden", children: "Edit" })
3146
+ ]
3147
+ }
3148
+ )
3149
+ ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3150
+ /* @__PURE__ */ e.jsxs(
3151
+ "button",
3152
+ {
3153
+ type: "button",
3154
+ onClick: n,
3155
+ className: `
3156
+ items-center gap-1.5 px-3.5 py-2.5 sm:px-4 sm:py-2.5
3157
+ rounded-xl text-sm font-semibold transition-all duration-200
3158
+ bg-white hover:bg-slate-50 text-slate-700
3159
+ border border-slate-200 dark:border-slate-600
3160
+ dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-300
3161
+ shadow-sm hover:shadow-md hover:scale-105 active:scale-95
3162
+ ${G ? "hidden sm:inline-flex" : "inline-flex"}
3163
+ `,
3164
+ children: [
3165
+ /* @__PURE__ */ e.jsx(xe, { className: "w-4 h-4 flex-shrink-0" }),
3166
+ /* @__PURE__ */ e.jsx("span", { className: "hidden sm:inline", children: x })
3167
+ ]
3168
+ }
3169
+ ),
3170
+ ee ? /* @__PURE__ */ e.jsxs(
3171
+ "button",
3172
+ {
3173
+ type: "submit",
3174
+ className: `inline-flex items-center gap-1.5 px-3.5 py-2.5 sm:px-4 sm:py-2.5
3175
+ rounded-xl text-sm font-semibold transition-all duration-200
3176
+ bg-gradient-to-r from-violet-600 to-indigo-600
3177
+ hover:from-violet-700 hover:to-indigo-700
3178
+ text-white shadow-md hover:shadow-lg
3179
+ hover:scale-105 active:scale-95`,
3180
+ children: [
3181
+ /* @__PURE__ */ e.jsx(je, { className: "w-4 h-4 flex-shrink-0" }),
3182
+ /* @__PURE__ */ e.jsx("span", { children: c })
3183
+ ]
3184
+ }
3185
+ ) : /* @__PURE__ */ e.jsxs(
3186
+ "button",
3187
+ {
3188
+ type: "button",
3189
+ onClick: I,
3190
+ className: `inline-flex items-center gap-1.5 px-3.5 py-2.5 sm:px-4 sm:py-2.5
3191
+ rounded-xl text-sm font-semibold transition-all duration-200
3192
+ bg-white hover:bg-slate-50 text-slate-700
3193
+ border border-slate-200 dark:border-slate-600
3194
+ dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-300
3195
+ shadow-sm hover:shadow-md hover:scale-105 active:scale-95`,
3196
+ children: [
3197
+ /* @__PURE__ */ e.jsx("span", { children: "Next" }),
3198
+ /* @__PURE__ */ e.jsx(ke, { className: "w-4 h-4 flex-shrink-0" })
3199
+ ]
3200
+ }
3201
+ )
3202
+ ] }) })
3203
+ ] }) })
3204
+ ] })
3205
+ ] });
3206
+ }, mr = ({
3207
+ header: r,
3208
+ error: a = null,
3209
+ errorDescription: o = null,
3210
+ onErrorClose: n,
3211
+ children: h,
3212
+ loading: b = !1,
3213
+ loadingMessage: c = "Loading data..."
3214
+ }) => /* @__PURE__ */ e.jsx("div", { className: "h-full w-full flex flex-col overflow-hidden p-2.5 sm:p-3.5", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2.5 sm:gap-3 h-full overflow-hidden", children: [
3215
+ r && /* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0", children: r }),
3216
+ a && /* @__PURE__ */ e.jsx("div", { className: `
3217
+ flex-shrink-0 rounded-xl border overflow-hidden
3218
+ bg-red-50 border-red-200/70 shadow-sm
3219
+ dark:bg-red-900/20 dark:border-red-800/40
3220
+ animate-in slide-in-from-top-2 duration-200
3221
+ `, children: /* @__PURE__ */ e.jsx("div", { className: "px-3.5 py-2.5 sm:px-4 sm:py-3", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2.5", children: [
3222
+ /* @__PURE__ */ e.jsx("div", { className: `
3223
+ flex-shrink-0 w-7 h-7 sm:w-8 sm:h-8 rounded-lg mt-0.5
3224
+ bg-red-100 dark:bg-red-800/30
3225
+ flex items-center justify-center
3226
+ `, children: /* @__PURE__ */ e.jsx(lt, { className: "w-3.5 h-3.5 sm:w-4 sm:h-4 text-red-600 dark:text-red-400" }) }),
3227
+ /* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
3228
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm font-semibold text-red-800 dark:text-red-300 leading-snug", children: a }),
3229
+ o && /* @__PURE__ */ e.jsx("p", { className: "mt-0.5 text-xs text-red-700/80 dark:text-red-400 leading-relaxed", children: o })
3230
+ ] }),
3231
+ n && /* @__PURE__ */ e.jsx(
3232
+ "button",
3233
+ {
3234
+ onClick: n,
3235
+ className: `flex-shrink-0 p-2 rounded-lg mt-0.5
3236
+ text-red-400 transition-all duration-200
3237
+ hover:bg-red-100 hover:text-red-600
3238
+ dark:hover:bg-red-800/50 dark:hover:text-red-300
3239
+ hover:scale-105 active:scale-95`,
3240
+ "aria-label": "Dismiss error",
3241
+ children: /* @__PURE__ */ e.jsx(xe, { className: "w-3.5 h-3.5" })
3242
+ }
3243
+ )
3244
+ ] }) }) }),
3245
+ /* @__PURE__ */ e.jsx("div", { className: "flex-grow min-h-0 overflow-y-auto", children: b ? /* @__PURE__ */ e.jsx("div", { className: `
3246
+ h-full flex items-center justify-center
3247
+ rounded-xl sm:rounded-2xl border
3248
+ bg-white border-slate-200/60 shadow-sm
3249
+ dark:bg-slate-800/50 dark:border-slate-700/50
3250
+ `, children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center gap-3 px-6 py-10", children: [
3251
+ /* @__PURE__ */ e.jsxs("div", { className: "relative w-9 h-9", children: [
3252
+ /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 rounded-full border-[2.5px] border-slate-200 dark:border-slate-700" }),
3253
+ /* @__PURE__ */ e.jsx("div", { className: `absolute inset-0 rounded-full border-[2.5px] border-transparent
3254
+ border-t-violet-600 dark:border-t-violet-400 animate-spin` })
3255
+ ] }),
3256
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-1", children: [0, 120, 240].map((x) => /* @__PURE__ */ e.jsx(
3257
+ "span",
3258
+ {
3259
+ className: `w-1 h-1 rounded-full bg-gradient-to-r from-violet-500 to-indigo-500
3260
+ animate-bounce`,
3261
+ style: { animationDelay: `${x}ms` }
3262
+ },
3263
+ x
3264
+ )) }),
3265
+ /* @__PURE__ */ e.jsx("p", { className: "text-xs font-medium text-slate-500 dark:text-slate-400", children: c })
3266
+ ] }) }) : h })
3267
+ ] }) }), hr = ({
3268
+ message: r = "Loading...",
3269
+ supportingMessage: a = !1,
3270
+ title: o = "Loading Data",
3271
+ className: n = "",
3272
+ size: h = "lg"
3273
+ }) => {
3274
+ const b = {
3275
+ sm: "h-7 w-7 border-2",
3276
+ md: "h-9 w-9 border-[3px]",
3277
+ lg: "h-10 w-10 sm:h-12 sm:w-12 border-[3px] sm:border-[4px]",
3278
+ xl: "h-12 w-12 sm:h-16 sm:w-16 border-[4px]"
3279
+ };
3280
+ return /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col items-center justify-center h-full w-full text-center px-4 ${n}`, children: [
3281
+ /* @__PURE__ */ e.jsx("div", { className: `animate-spin rounded-full ${b[h]}
3282
+ border-slate-200 border-t-violet-500 border-r-violet-500 mb-4` }),
3283
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-1 mb-3", children: [0, 120, 240].map((c) => /* @__PURE__ */ e.jsx(
3284
+ "span",
3285
+ {
3286
+ className: "w-1 h-1 rounded-full bg-gradient-to-r from-violet-500 to-indigo-500 animate-bounce",
3287
+ style: { animationDelay: `${c}ms` }
3288
+ },
3289
+ c
3290
+ )) }),
3291
+ /* @__PURE__ */ e.jsx("h3", { className: "text-sm sm:text-base font-semibold text-slate-900 dark:text-slate-200 mb-1", children: o }),
3292
+ /* @__PURE__ */ e.jsx("p", { className: "text-xs sm:text-sm text-slate-500 dark:text-slate-400 max-w-xs", children: a || r })
3293
+ ] });
3294
+ }, ur = ({ error: r, errorDescription: a, onClose: o }) => r ? /* @__PURE__ */ e.jsx("div", { className: `mx-4 mt-3 sm:mx-5 sm:mt-4 rounded-xl border
3295
+ border-red-200 bg-red-50
3296
+ dark:bg-red-900/20 dark:border-red-800/50
3297
+ animate-in slide-in-from-top-1 duration-200`, children: /* @__PURE__ */ e.jsx("div", { className: "px-3.5 py-3 sm:px-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2.5", children: [
3298
+ /* @__PURE__ */ e.jsx("div", { className: `flex-shrink-0 w-7 h-7 rounded-lg mt-0.5
3299
+ bg-red-100 dark:bg-red-800/30
3300
+ flex items-center justify-center`, children: /* @__PURE__ */ e.jsx(lt, { className: "w-3.5 h-3.5 text-red-600 dark:text-red-400" }) }),
3301
+ /* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
3302
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm font-semibold text-red-800 dark:text-red-300 leading-snug", children: r }),
3303
+ a && /* @__PURE__ */ e.jsx("p", { className: "mt-0.5 text-xs text-red-700/80 dark:text-red-400 leading-relaxed", children: a })
3304
+ ] }),
3305
+ o && /* @__PURE__ */ e.jsx(
3306
+ "button",
3307
+ {
3308
+ type: "button",
3309
+ onClick: o,
3310
+ "aria-label": "Close error",
3311
+ className: `flex-shrink-0 p-1 rounded-lg mt-0.5 transition-all duration-200
3312
+ text-red-400
3313
+ hover:bg-red-100 hover:text-red-600
3314
+ dark:hover:bg-red-800/50 dark:hover:text-red-300
3315
+ hover:scale-105 active:scale-95`,
3316
+ children: /* @__PURE__ */ e.jsx(xe, { className: "w-3.5 h-3.5" })
3317
+ }
3318
+ )
3319
+ ] }) }) }) : null, br = ({
3320
+ content: r,
3321
+ className: a = "",
3322
+ emptyText: o = null,
3323
+ size: n = "md"
3324
+ // 'xs' | 'sm' | 'md'
3325
+ }) => {
3326
+ if (!r || !r.replace(/<[^>]*>/g, "").trim())
3327
+ return o ? /* @__PURE__ */ e.jsx("span", { className: "text-slate-400 dark:text-slate-500 text-sm italic", children: o }) : null;
3328
+ const h = {
3329
+ xs: "prose-xs text-xs",
3330
+ sm: "prose-sm text-sm",
3331
+ md: "prose-base text-base"
3332
+ }[n] || "prose-sm text-sm";
3333
+ return /* @__PURE__ */ e.jsx(
3334
+ "div",
3335
+ {
3336
+ className: `
3337
+ prose ${h} max-w-none
3338
+ text-slate-700 dark:text-slate-300
3339
+
3340
+ [&>*]:my-0.5
3341
+ [&>p]:m-0
3342
+
3343
+ [&>h1]:text-2xl [&>h1]:font-bold [&>h1]:mt-2
3344
+ [&>h2]:text-xl [&>h2]:font-semibold [&>h2]:mt-2
3345
+ [&>h3]:text-lg [&>h3]:font-semibold
3346
+ [&>h4]:text-base [&>h4]:font-semibold
3347
+
3348
+ [&>ul]:list-disc [&>ul]:pl-4
3349
+ [&>ol]:list-decimal [&>ol]:pl-4
3350
+
3351
+ [&>strong]:font-semibold
3352
+
3353
+ ${a}
3354
+ `,
3355
+ dangerouslySetInnerHTML: { __html: r }
3356
+ }
3357
+ );
3358
+ };
3359
+ let V = null;
3360
+ const vr = ({
3361
+ items: r = [],
3362
+ onReorder: a,
3363
+ onDropFrom: o,
3364
+ onDropTo: n,
3365
+ listId: h = "default",
3366
+ disabled: b = !1,
3367
+ renderItem: c,
3368
+ className: x = "",
3369
+ dropZoneClassName: k = "",
3370
+ activeDropZoneClassName: j = "",
3371
+ children: _,
3372
+ footer: y = null
3373
+ }) => {
3374
+ const C = he(null), [z, L] = W(null), [p, O] = W(!1), [i, E] = W(null);
3375
+ de(() => {
3376
+ const d = () => {
3377
+ V && (V = null, E(null), L(null), O(!1), C.current = null);
3378
+ };
3379
+ return document.addEventListener("dragend", d), () => document.removeEventListener("dragend", d);
3380
+ }, []);
3381
+ const q = (d, w) => {
3382
+ C.current = w, E(r[w].id), V = { listId: h, index: w, item: r[w] }, d.dataTransfer.effectAllowed = "move";
3383
+ }, K = (d, w) => {
3384
+ d.preventDefault(), (V == null ? void 0 : V.listId) === h && L(w);
3385
+ }, A = () => {
3386
+ C.current = null, E(null), L(null), O(!1), V = null;
3387
+ }, te = (d) => {
3388
+ d.preventDefault(), !b && (V == null ? void 0 : V.listId) !== h && O(!0);
3389
+ }, re = (d) => {
3390
+ d.currentTarget.contains(d.relatedTarget) || (O(!1), (V == null ? void 0 : V.listId) === h && L(null));
3391
+ }, Q = (d, w) => {
3392
+ if (d.preventDefault(), d.stopPropagation(), !!V) {
3393
+ if (V.listId === h) {
3394
+ const S = C.current;
3395
+ if (S === w) {
3396
+ A();
3397
+ return;
3398
+ }
3399
+ const D = [...r], [I] = D.splice(S, 1);
3400
+ D.splice(w, 0, I), a == null || a(D);
3401
+ } else
3402
+ o == null || o({ item: V.item, fromListId: V.listId, toIndex: w }), n == null || n({ item: V.item, fromIndex: V.index });
3403
+ A();
3404
+ }
3405
+ }, $ = (d) => {
3406
+ if (d.preventDefault(), !!V) {
3407
+ if (V.listId === h) {
3408
+ A();
3409
+ return;
3410
+ }
3411
+ o == null || o({ item: V.item, fromListId: V.listId, toIndex: r.length }), n == null || n({ item: V.item, fromIndex: V.index }), A();
3412
+ }
3413
+ }, G = p && !b && (V == null ? void 0 : V.listId) !== h;
3414
+ return /* @__PURE__ */ e.jsxs(
3415
+ "div",
3416
+ {
3417
+ className: `${k} ${G ? j : ""} ${x}`,
3418
+ onDragOver: b ? void 0 : te,
3419
+ onDragLeave: b ? void 0 : re,
3420
+ onDrop: b ? void 0 : $,
3421
+ children: [
3422
+ r.length === 0 ? _ : r.map((d, w) => {
3423
+ const S = i === d.id, D = (V == null ? void 0 : V.listId) === h && z === w && i !== d.id;
3424
+ return c(d, w, b ? {} : {
3425
+ draggable: !0,
3426
+ onDragStart: (m) => q(m, w),
3427
+ onDragEnter: (m) => K(m, w),
3428
+ onDragEnd: A,
3429
+ onDrop: (m) => Q(m, w)
3430
+ }, S, D);
3431
+ }),
3432
+ y
3433
+ ]
3434
+ }
3435
+ );
3436
+ };
3437
+ export {
3438
+ or as ActionButton,
3439
+ nr as DataTable,
3440
+ vr as DragDropList,
3441
+ dr as DynamicForm,
3442
+ xr as DynamicFormMultiStep,
3443
+ Zt as Footer,
3444
+ nt as FormField,
3445
+ br as HtmlContent,
3446
+ ar as IconButton,
3447
+ hr as Loader,
3448
+ mr as ManagerLayout,
3449
+ ir as Modal,
3450
+ ur as ModalErrorAlert,
3451
+ er as Navbar,
3452
+ rr as PageHeader,
3453
+ sr as PrimaryButton,
3454
+ lr as SearchInput,
3455
+ qt as SelectModal,
3456
+ cr as SelectModalField,
3457
+ tr as Sidebar,
3458
+ Ut as Toggle,
3459
+ Ht as UserMenu
3460
+ };