unifyedx-storybook-new 0.2.75 → 0.2.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import { jsxs as n, jsx as e, Fragment as ee } from "react/jsx-runtime";
2
- import re, { useState as B, useMemo as ae, useId as He, Fragment as Q, useEffect as te, useCallback as K, useRef as fe } from "react";
1
+ import { jsxs as n, jsx as e, Fragment as te } from "react/jsx-runtime";
2
+ import re, { useState as B, useMemo as ae, useId as He, Fragment as Q, useEffect as Z, useCallback as ee, useRef as fe } from "react";
3
3
  import { a as H, U as ct, X as ve, P as c, L as ja, C as xe, b as et, D as dt, f as St, d as Wt, F as _a, e as Ua, h as Ga, T as Le, u as qa, I as Jt, i as Xt, j as Ya, k as Wa, l as Ja, m as Ht, S as vt, n as Qt, M as Xa, o as Ha, p as Nt, q as Qa, A as Za, E as Zt, r as Ka, s as er, t as tr, v as ar, w as Kt, x as rr, y as ea, z as ta, B as nr, G as sr, H as lr, J as Qe, K as mt, N as ut, O as ir, Q as or, R as aa, V as cr, W as wt, Y as dr, Z as mr, _ as Be, $ as ur, a0 as hr, a1 as pr, a2 as gr, a3 as br, a4 as fr, a5 as Dt, a6 as yr, a7 as xr, a8 as vr, a9 as Nr, aa as wr, ab as kr, ac as Cr, ad as zr, ae as Sr, af as Ae, ag as ra, ah as Dr, ai as $r, aj as Tr, ak as Ar, al as Fr, am as na, an as Er, ao as Rr, ap as sa, aq as Ir, ar as ht, as as la, at as Or } from "./vendor-yf0QH1Io.js";
4
- import { Popover as Pr, PopoverButton as Mr, PopoverPanel as Lr, Transition as he, Dialog as ye, TransitionChild as ke, DialogPanel as Fe, DialogTitle as tt, TabGroup as Br, TabList as Vr, Tab as se, TabPanels as jr, RadioGroup as Ue, Listbox as Z, ListboxButton as _r, ListboxOptions as Ur, ListboxOption as Gr, SwitchGroup as qr, Switch as lt, Menu as Yr, MenuButton as Wr, Portal as Jr, MenuItems as Xr, MenuItem as Hr, DialogBackdrop as Qr } from "@headlessui/react";
4
+ import { Popover as Pr, PopoverButton as Mr, PopoverPanel as Lr, Transition as he, Dialog as ye, TransitionChild as ke, DialogPanel as Fe, DialogTitle as tt, TabGroup as Br, TabList as Vr, Tab as se, TabPanels as jr, RadioGroup as Ue, Listbox as K, ListboxButton as _r, ListboxOptions as Ur, ListboxOption as Gr, SwitchGroup as qr, Switch as lt, Menu as Yr, MenuButton as Wr, Portal as Jr, MenuItems as Xr, MenuItem as Hr, DialogBackdrop as Qr } from "@headlessui/react";
5
5
  import { motion as ie, AnimatePresence as Se } from "framer-motion";
6
6
  import { d as Zr } from "./vendor-lodash-Dkzj2D3U.js";
7
7
  import { useFloating as ia, offset as oa, flip as ca, shift as da, autoUpdate as ma, useClick as Kr, useDismiss as en, useInteractions as tn, FloatingPortal as an } from "@floating-ui/react";
@@ -33,10 +33,10 @@ const wn = (t) => {
33
33
  "avatar-container",
34
34
  `avatar--size-${s}`,
35
35
  m
36
- ), g = y ? "transparent" : i || N.bg, S = l || N.text;
36
+ ), p = y ? "transparent" : i || N.bg, z = l || N.text;
37
37
  return /* @__PURE__ */ n("div", { className: d, style: {
38
- backgroundColor: g,
39
- color: S
38
+ backgroundColor: p,
39
+ color: z
40
40
  }, ...o, children: [
41
41
  y && /* @__PURE__ */ e(
42
42
  "img",
@@ -155,8 +155,8 @@ const Dn = {
155
155
  // ✅ Add children to the props list
156
156
  iconWidth: v,
157
157
  iconHeight: d,
158
- iconColor: g,
159
- strokeWidth: S,
158
+ iconColor: p,
159
+ strokeWidth: z,
160
160
  onClick: F,
161
161
  ...E
162
162
  }) => {
@@ -181,8 +181,8 @@ const Dn = {
181
181
  title: a || P && i || (typeof y == "string" ? y : void 0),
182
182
  "aria-label": i || P && a || (typeof y == "string" ? y : void 0),
183
183
  ...E,
184
- children: m ? /* @__PURE__ */ e(ja, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ n(ee, { children: [
185
- u && /* @__PURE__ */ e(u, { size: N === "large" ? 20 : 16, width: v || 16, height: d || 16, color: g || "#767676", strokeWidth: S || 2 }),
184
+ children: m ? /* @__PURE__ */ e(ja, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ n(te, { children: [
185
+ u && /* @__PURE__ */ e(u, { size: N === "large" ? 20 : 16, width: v || 16, height: d || 16, color: p || "#767676", strokeWidth: z || 2 }),
186
186
  y,
187
187
  r,
188
188
  " "
@@ -293,7 +293,7 @@ const Dn = {
293
293
  }) => {
294
294
  const N = t?.from, y = t?.to, r = (d) => {
295
295
  d.stopPropagation(), d.preventDefault(), s?.();
296
- }, v = N && y ? /* @__PURE__ */ n(ee, { children: [
296
+ }, v = N && y ? /* @__PURE__ */ n(te, { children: [
297
297
  St(N, "MMM d, y"),
298
298
  " - ",
299
299
  St(y, "MMM d, y")
@@ -607,9 +607,9 @@ const Dn = {
607
607
  formErrors: v,
608
608
  // --- UI Text ---
609
609
  title: d = "Upload Files",
610
- subHeading: g = "Supports PNG, JPG, PDF. Max size: 50MB."
610
+ subHeading: p = "Supports PNG, JPG, PDF. Max size: 50MB."
611
611
  }) => {
612
- const S = o.length > 0 || u.length > 0;
612
+ const z = o.length > 0 || u.length > 0;
613
613
  return /* @__PURE__ */ e(he, { appear: !0, show: t, as: Q, children: /* @__PURE__ */ n(
614
614
  ye,
615
615
  {
@@ -669,7 +669,7 @@ const Dn = {
669
669
  children: [
670
670
  /* @__PURE__ */ e(Ga, { size: 48, className: "text-gray-400" }),
671
671
  /* @__PURE__ */ e("p", { children: "Drag and drop files here" }),
672
- /* @__PURE__ */ e("p", { className: "sub-heading", children: g }),
672
+ /* @__PURE__ */ e("p", { className: "sub-heading", children: p }),
673
673
  /* @__PURE__ */ e("hr", {}),
674
674
  /* @__PURE__ */ e("p", { children: "OR" }),
675
675
  /* @__PURE__ */ e(
@@ -685,7 +685,7 @@ const Dn = {
685
685
  }
686
686
  ),
687
687
  v.filesToUpload && /* @__PURE__ */ e("p", { className: "form-error-message", children: v.filesToUpload.message }),
688
- S && /* @__PURE__ */ n("div", { className: "file-list-container", children: [
688
+ z && /* @__PURE__ */ n("div", { className: "file-list-container", children: [
689
689
  /* @__PURE__ */ e("h3", { children: "Upload Queue" }),
690
690
  /* @__PURE__ */ n("ul", { className: "file-list", children: [
691
691
  o.map((F, E) => /* @__PURE__ */ n(
@@ -840,18 +840,18 @@ const Dn = {
840
840
  updatedBy: !1
841
841
  }), [v, d] = B({
842
842
  startDate: null
843
- }), [g, S] = B({
843
+ }), [p, z] = B({
844
844
  endDate: null
845
845
  }), F = qa({
846
846
  initialValues: JSON.parse(JSON.stringify(m)),
847
847
  // Deep copy
848
848
  onSubmit: ($) => {
849
849
  const x = {};
850
- Object.keys($).forEach((f) => {
851
- x[f] = {
852
- operator: $[f].operator || "in",
853
- values: Array.isArray($[f].values) ? $[f].values : [],
854
- range: $[f].range || null
850
+ Object.keys($).forEach((b) => {
851
+ x[b] = {
852
+ operator: $[b].operator || "in",
853
+ values: Array.isArray($[b].values) ? $[b].values : [],
854
+ range: $[b].range || null
855
855
  };
856
856
  }), console.log("[storybook filter] Applied Filters:", x), typeof s == "function" && s({
857
857
  filters: x,
@@ -860,46 +860,46 @@ const Dn = {
860
860
  },
861
861
  enableReinitialize: !0
862
862
  }), E = ae(() => l.reduce(($, x) => {
863
- const f = x.key, z = F.values[f];
863
+ const b = x.key, S = F.values[b];
864
864
  let O = !1;
865
- if (z)
865
+ if (S)
866
866
  switch (x.type) {
867
867
  case "multiselect":
868
868
  case "multiselect-users":
869
- O = Array.isArray(z.values) && z.values.length > 0;
869
+ O = Array.isArray(S.values) && S.values.length > 0;
870
870
  break;
871
871
  case "date":
872
- (z.range && z.range !== "" || Array.isArray(z.values) && z.values.length > 0) && (O = !0);
872
+ (S.range && S.range !== "" || Array.isArray(S.values) && S.values.length > 0) && (O = !0);
873
873
  break;
874
874
  }
875
- return $[f] = O, $;
875
+ return $[b] = O, $;
876
876
  }, {}), [l, F.values]), R = Object.values(E).filter(Boolean).length, P = ae(() => l.some(($) => {
877
877
  if ($.type !== "date") return !1;
878
878
  const x = F.values?.[$.key]?.values;
879
879
  if (!Array.isArray(x) || x.length < 2) return !1;
880
- const [f, z] = x;
881
- if (!f || !z) return !1;
882
- const O = f instanceof Date ? f : new Date(f), I = z instanceof Date ? z : new Date(z);
880
+ const [b, S] = x;
881
+ if (!b || !S) return !1;
882
+ const O = b instanceof Date ? b : new Date(b), I = S instanceof Date ? S : new Date(S);
883
883
  return O > I;
884
884
  }), [l, F.values]), j = async ($, x) => {
885
885
  try {
886
- r((z) => ({ ...z, [$]: !0 }));
887
- const f = await u($, x);
888
- N((z) => ({ ...z, [$]: f }));
889
- } catch (f) {
890
- console.error(`Error fetching ${$} users:`, f);
886
+ r((S) => ({ ...S, [$]: !0 }));
887
+ const b = await u($, x);
888
+ N((S) => ({ ...S, [$]: b }));
889
+ } catch (b) {
890
+ console.error(`Error fetching ${$} users:`, b);
891
891
  } finally {
892
- r((f) => ({ ...f, [$]: !1 }));
892
+ r((b) => ({ ...b, [$]: !1 }));
893
893
  }
894
894
  }, U = ($) => {
895
- const x = l[$].key, f = l[$].url;
896
- l[$].type === "multiselect-users" && h[x].length === 0 && !y[x] && j(x, f);
895
+ const x = l[$].key, b = l[$].url;
896
+ l[$].type === "multiselect-users" && h[x].length === 0 && !y[x] && j(x, b);
897
897
  }, Y = () => {
898
898
  F.resetForm(), N({ createdBy: [], updatedBy: [] }), i();
899
899
  }, q = ($) => {
900
900
  const x = l.find((O) => O.key === $);
901
901
  if (!x) return null;
902
- const f = F.values[$] || m[$], z = Array.isArray(f.values) ? f.values : [];
902
+ const b = F.values[$] || m[$], S = Array.isArray(b.values) ? b.values : [];
903
903
  switch (x.type) {
904
904
  case "multiselect":
905
905
  return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
@@ -908,7 +908,7 @@ const Dn = {
908
908
  /* @__PURE__ */ e(
909
909
  "select",
910
910
  {
911
- value: f.operator || "in",
911
+ value: b.operator || "in",
912
912
  onChange: (A) => F.setFieldValue(`${$}.operator`, A.target.value),
913
913
  className: "filter-select",
914
914
  children: x.operators.map((A) => /* @__PURE__ */ e("option", { value: A, children: A === "in" ? "Includes" : "Excludes" }, A))
@@ -923,7 +923,7 @@ const Dn = {
923
923
  type: "checkbox",
924
924
  id: `select-all-${$}`,
925
925
  className: "filter-checkbox-input",
926
- checked: x.options.length > 0 && z.length === x.options.length,
926
+ checked: x.options.length > 0 && S.length === x.options.length,
927
927
  onChange: (A) => {
928
928
  const G = A.target.checked ? x.options.map((W) => W.value) : [];
929
929
  F.setFieldValue(`${$}.values`, G);
@@ -946,9 +946,9 @@ const Dn = {
946
946
  type: "checkbox",
947
947
  id: `${$}-${A.value}`,
948
948
  className: "filter-checkbox-input",
949
- checked: z.includes(A.value),
949
+ checked: S.includes(A.value),
950
950
  onChange: (G) => {
951
- const W = G.target.checked ? [...z, A.value] : z.filter((pe) => pe !== A.value);
951
+ const W = G.target.checked ? [...S, A.value] : S.filter((pe) => pe !== A.value);
952
952
  F.setFieldValue(`${$}.values`, W);
953
953
  }
954
954
  }
@@ -972,14 +972,14 @@ const Dn = {
972
972
  /* @__PURE__ */ e(
973
973
  "select",
974
974
  {
975
- value: f.operator || "in",
975
+ value: b.operator || "in",
976
976
  onChange: (A) => F.setFieldValue(`${$}.operator`, A.target.value),
977
977
  className: "filter-select",
978
978
  children: x.operators.map((A) => /* @__PURE__ */ e("option", { value: A, children: A === "in" ? "Includes" : "Excludes" }, A))
979
979
  }
980
980
  )
981
981
  ] }),
982
- I ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: O.length > 0 ? /* @__PURE__ */ n(ee, { children: [
982
+ I ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: O.length > 0 ? /* @__PURE__ */ n(te, { children: [
983
983
  /* @__PURE__ */ n("div", { className: "filter-checkbox-item", children: [
984
984
  /* @__PURE__ */ e(
985
985
  "input",
@@ -987,7 +987,7 @@ const Dn = {
987
987
  type: "checkbox",
988
988
  id: `select-all-users-${$}`,
989
989
  className: "filter-checkbox-input",
990
- checked: O.length > 0 && z.length === O.length,
990
+ checked: O.length > 0 && S.length === O.length,
991
991
  onChange: (A) => {
992
992
  const G = A.target.checked ? O.map((W) => W.email) : [];
993
993
  F.setFieldValue(
@@ -1013,9 +1013,9 @@ const Dn = {
1013
1013
  type: "checkbox",
1014
1014
  id: `${$}-${A.email}`,
1015
1015
  className: "filter-checkbox-input",
1016
- checked: z.includes(A.email),
1016
+ checked: S.includes(A.email),
1017
1017
  onChange: (G) => {
1018
- const W = G.target.checked ? [...z, A.email] : z.filter((pe) => pe !== A.email);
1018
+ const W = G.target.checked ? [...S, A.email] : S.filter((pe) => pe !== A.email);
1019
1019
  F.setFieldValue(
1020
1020
  `${$}.values`,
1021
1021
  W
@@ -1038,9 +1038,9 @@ const Dn = {
1038
1038
  ] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
1039
1039
  ] });
1040
1040
  case "date":
1041
- const D = f.values || [], [b, p] = D, w = b && p, k = D[0] || null, T = D[1] || null, L = {
1042
- startDate: k instanceof Date ? k.toISOString().slice(0, 10) : null,
1043
- endDate: k instanceof Date ? k.toISOString().slice(0, 10) : null
1041
+ const D = b.values || [], [f, g] = D, k = f && g, w = D[0] || null, T = D[1] || null, L = {
1042
+ startDate: w instanceof Date ? w.toISOString().slice(0, 10) : null,
1043
+ endDate: w instanceof Date ? w.toISOString().slice(0, 10) : null
1044
1044
  }, C = {
1045
1045
  startDate: T instanceof Date ? T.toISOString().slice(0, 10) : null,
1046
1046
  endDate: T instanceof Date ? T.toISOString().slice(0, 10) : null
@@ -1070,13 +1070,13 @@ const Dn = {
1070
1070
  /* @__PURE__ */ e(
1071
1071
  "select",
1072
1072
  {
1073
- value: f.operator,
1073
+ value: b.operator,
1074
1074
  onChange: (A) => F.setFieldValue(`${$}.operator`, A.target.value),
1075
1075
  className: "filter-select",
1076
1076
  children: x.operators.map((A) => /* @__PURE__ */ e("option", { value: A, children: A === "in" ? "Is" : "Is not" }, A))
1077
1077
  }
1078
1078
  ),
1079
- w && /* @__PURE__ */ e(
1079
+ k && /* @__PURE__ */ e(
1080
1080
  "button",
1081
1081
  {
1082
1082
  type: "button",
@@ -1092,7 +1092,7 @@ const Dn = {
1092
1092
  )
1093
1093
  ] }),
1094
1094
  /* @__PURE__ */ e("div", { className: "pb-0", children: /* @__PURE__ */ e("div", { className: "space-y-3", children: M.map((A) => {
1095
- const G = f.range === A.key || A.key === "anytime" && (!Array.isArray(f.values) || f.values.length === 0);
1095
+ const G = b.range === A.key || A.key === "anytime" && (!Array.isArray(b.values) || b.values.length === 0);
1096
1096
  return /* @__PURE__ */ n(
1097
1097
  "label",
1098
1098
  {
@@ -1164,7 +1164,7 @@ const Dn = {
1164
1164
  }
1165
1165
  )
1166
1166
  ] }),
1167
- k && T && k > T && /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-2", children: "End date must be after start date" })
1167
+ w && T && w > T && /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-2", children: "End date must be after start date" })
1168
1168
  ] })
1169
1169
  ] });
1170
1170
  default:
@@ -1419,7 +1419,7 @@ const Dn = {
1419
1419
  itemsPerPageOptions: m = [10, 15, 20]
1420
1420
  }) => {
1421
1421
  const o = Math.ceil(a / s), [u, h] = B(t);
1422
- te(() => {
1422
+ Z(() => {
1423
1423
  h(t);
1424
1424
  }, [t]);
1425
1425
  const N = Math.min((t - 1) * s + 1, a), y = Math.min(t * s, a), r = (v) => {
@@ -1532,7 +1532,7 @@ const Dn = {
1532
1532
  "radiogroup-option--checked": h,
1533
1533
  "radiogroup-option--error": !!l
1534
1534
  }),
1535
- children: ({ checked: u }) => /* @__PURE__ */ n(ee, { children: [
1535
+ children: ({ checked: u }) => /* @__PURE__ */ n(te, { children: [
1536
1536
  /* @__PURE__ */ n("div", { className: "radiogroup-option-content", children: [
1537
1537
  /* @__PURE__ */ e(Ue.Label, { as: "p", className: "option-label", children: o.label }),
1538
1538
  o.description && /* @__PURE__ */ e(
@@ -1567,20 +1567,20 @@ const Dn = {
1567
1567
  ...y
1568
1568
  }) => {
1569
1569
  const [r, v] = B(t);
1570
- te(() => {
1570
+ Z(() => {
1571
1571
  v(t);
1572
1572
  }, [t]);
1573
- const d = K(
1574
- Zr((S) => {
1575
- a?.(S);
1573
+ const d = ee(
1574
+ Zr((z) => {
1575
+ a?.(z);
1576
1576
  }, s),
1577
1577
  [s, a]
1578
1578
  );
1579
- te(() => (r !== t && d(r), () => {
1579
+ Z(() => (r !== t && d(r), () => {
1580
1580
  d.cancel();
1581
1581
  }), [r, d, t]);
1582
- const g = (S) => {
1583
- v(S.target.value);
1582
+ const p = (z) => {
1583
+ v(z.target.value);
1584
1584
  };
1585
1585
  return /* @__PURE__ */ n("div", { className: `search-bar-wrapper ${m}`, children: [
1586
1586
  l && /* @__PURE__ */ e("label", { htmlFor: "search-field", className: "sr-only", children: l }),
@@ -1594,7 +1594,7 @@ const Dn = {
1594
1594
  type: "search",
1595
1595
  name: "search",
1596
1596
  value: r,
1597
- onChange: g,
1597
+ onChange: p,
1598
1598
  style: o,
1599
1599
  ...y
1600
1600
  }
@@ -1627,7 +1627,7 @@ const Dn = {
1627
1627
  }
1628
1628
  return d.id === a || d.value === a || d.label === a;
1629
1629
  });
1630
- return /* @__PURE__ */ e(Z, { value: a, onChange: s, disabled: m, children: /* @__PURE__ */ n("div", { className: "select-wrapper", ref: u, children: [
1630
+ return /* @__PURE__ */ e(K, { value: a, onChange: s, disabled: m, children: /* @__PURE__ */ n("div", { className: "select-wrapper", ref: u, children: [
1631
1631
  t && /* @__PURE__ */ e("label", { className: "select-label", children: t }),
1632
1632
  /* @__PURE__ */ n("div", { className: "select-button-container", children: [
1633
1633
  /* @__PURE__ */ n(
@@ -1663,20 +1663,20 @@ const Dn = {
1663
1663
  /* @__PURE__ */ e("div", { className: "select-options-list", children: r.length === 0 && N !== "" ? /* @__PURE__ */ e("div", { className: "no-results", children: "No results found." }) : r.map((d) => /* @__PURE__ */ e(
1664
1664
  Gr,
1665
1665
  {
1666
- className: ({ active: g }) => `select-option ${g ? "active" : ""}`,
1666
+ className: ({ active: p }) => `select-option ${p ? "active" : ""}`,
1667
1667
  value: d,
1668
- children: ({ selected: g }) => /* @__PURE__ */ n(ee, { children: [
1668
+ children: ({ selected: p }) => /* @__PURE__ */ n(te, { children: [
1669
1669
  /* @__PURE__ */ n("div", { className: "option-content", children: [
1670
1670
  d.icon && /* @__PURE__ */ e(d.icon, { className: "option-icon" }),
1671
1671
  /* @__PURE__ */ e(
1672
1672
  "span",
1673
1673
  {
1674
- className: `option-label ${g ? "selected" : ""}`,
1674
+ className: `option-label ${p ? "selected" : ""}`,
1675
1675
  children: d.label
1676
1676
  }
1677
1677
  )
1678
1678
  ] }),
1679
- g ? /* @__PURE__ */ e(
1679
+ p ? /* @__PURE__ */ e(
1680
1680
  et,
1681
1681
  {
1682
1682
  className: "option-check-icon",
@@ -1695,7 +1695,7 @@ const Dn = {
1695
1695
  ] }) });
1696
1696
  }, Bn = () => {
1697
1697
  const [t, a] = B(window.location.pathname);
1698
- return te(() => {
1698
+ return Z(() => {
1699
1699
  const s = () => {
1700
1700
  a(window.location.pathname);
1701
1701
  };
@@ -1710,7 +1710,7 @@ const Dn = {
1710
1710
  return null;
1711
1711
  }, ga = ({ item: t, isCollapsed: a, level: s = 0 }) => {
1712
1712
  const { pathname: i } = Bn(), l = t.href || t.url || t.path, [m, o] = B(!1), u = t.icon;
1713
- te(() => {
1713
+ Z(() => {
1714
1714
  yt([t], i) && o(!0);
1715
1715
  }, [t, i]);
1716
1716
  const h = i === l, N = !h && !!yt([t], i), y = (r) => {
@@ -1789,7 +1789,7 @@ const Dn = {
1789
1789
  logoSmall: m,
1790
1790
  logoLarge: o,
1791
1791
  user: u = { name: "", email: "" }
1792
- }) => /* @__PURE__ */ n(ee, { children: [
1792
+ }) => /* @__PURE__ */ n(te, { children: [
1793
1793
  i && /* @__PURE__ */ e(
1794
1794
  "div",
1795
1795
  {
@@ -1968,7 +1968,7 @@ const Dn = {
1968
1968
  ...o
1969
1969
  }) => {
1970
1970
  const u = re.useId();
1971
- return /* @__PURE__ */ n(ee, { children: [
1971
+ return /* @__PURE__ */ n(te, { children: [
1972
1972
  re.cloneElement(t, { "data-tooltip-id": u }),
1973
1973
  /* @__PURE__ */ e(
1974
1974
  Qa,
@@ -2007,7 +2007,7 @@ const Dn = {
2007
2007
  showProgress: h = !0,
2008
2008
  closeOnOverlayClick: N = !0
2009
2009
  }) => {
2010
- const y = s[i], r = Object.keys(s), v = r.indexOf(i), d = (v + 1) / r.length * 100, g = v > 0 && m.onBack;
2010
+ const y = s[i], r = Object.keys(s), v = r.indexOf(i), d = (v + 1) / r.length * 100, p = v > 0 && m.onBack;
2011
2011
  return /* @__PURE__ */ e(he, { show: t, as: Q, children: /* @__PURE__ */ n(
2012
2012
  ye,
2013
2013
  {
@@ -2042,7 +2042,7 @@ const Dn = {
2042
2042
  children: /* @__PURE__ */ n(Fe, { className: "wizard-panel", children: [
2043
2043
  /* @__PURE__ */ n("header", { className: "wizard-header", children: [
2044
2044
  /* @__PURE__ */ n("div", { className: "wizard-header-content", children: [
2045
- g && /* @__PURE__ */ e(
2045
+ p && /* @__PURE__ */ e(
2046
2046
  "button",
2047
2047
  {
2048
2048
  onClick: m.onBack,
@@ -2131,7 +2131,7 @@ const Dn = {
2131
2131
  onClick: r,
2132
2132
  ...v
2133
2133
  }) => {
2134
- const d = u, g = H(
2134
+ const d = u, p = H(
2135
2135
  "btn-base-icon",
2136
2136
  "btn-icon-only",
2137
2137
  jn[h],
@@ -2143,7 +2143,7 @@ const Dn = {
2143
2143
  {
2144
2144
  "data-testid": t,
2145
2145
  type: s,
2146
- className: g,
2146
+ className: p,
2147
2147
  disabled: d,
2148
2148
  onClick: r,
2149
2149
  title: i,
@@ -2595,7 +2595,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2595
2595
  }
2596
2596
  }, zt = (t, a) => {
2597
2597
  const [s, i] = B(t);
2598
- return te(
2598
+ return Z(
2599
2599
  () => {
2600
2600
  const l = rn(() => {
2601
2601
  i(t);
@@ -2666,7 +2666,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2666
2666
  },
2667
2667
  isChanged: u = !1
2668
2668
  }) => {
2669
- const [h, N] = B(Mt[0]), [y, r] = B(""), v = zt(y, 400), [d, g] = B([]), [S, F] = B(/* @__PURE__ */ new Set()), [E, R] = B(!1), [P, j] = B(Lt[0]), {
2669
+ const [h, N] = B(Mt[0]), [y, r] = B(""), v = zt(y, 400), [d, p] = B([]), [z, F] = B(/* @__PURE__ */ new Set()), [E, R] = B(!1), [P, j] = B(Lt[0]), {
2670
2670
  control: U,
2671
2671
  handleSubmit: Y,
2672
2672
  watch: q,
@@ -2674,29 +2674,29 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2674
2674
  } = nr({
2675
2675
  defaultValues: { pendingInvites: [] },
2676
2676
  resolver: ir(rs)
2677
- }), { fields: f, append: z, remove: O, update: I } = sr({
2677
+ }), { fields: b, append: S, remove: O, update: I } = sr({
2678
2678
  control: U,
2679
2679
  name: "pendingInvites"
2680
2680
  }), D = q("pendingInvites");
2681
- te(() => {
2681
+ Z(() => {
2682
2682
  v.length > 1 ? (R(!0), es(h.name, v).then((C) => {
2683
- g(C);
2684
- }).catch((C) => console.error("Search failed:", C)).finally(() => R(!1))) : (g([]), F(/* @__PURE__ */ new Set()));
2683
+ p(C);
2684
+ }).catch((C) => console.error("Search failed:", C)).finally(() => R(!1))) : (p([]), F(/* @__PURE__ */ new Set()));
2685
2685
  }, [v, h]);
2686
- const b = (C) => {
2686
+ const f = (C) => {
2687
2687
  F((M) => {
2688
2688
  const _ = new Set(M);
2689
2689
  return _.has(C) ? _.delete(C) : _.add(C), _;
2690
2690
  });
2691
- }, p = () => {
2692
- d.filter((C) => S.has(C.id)).forEach((C) => {
2693
- f.find((M) => M.id === C.id) || z({ ...C, permission: P.name });
2691
+ }, g = () => {
2692
+ d.filter((C) => z.has(C.id)).forEach((C) => {
2693
+ b.find((M) => M.id === C.id) || S({ ...C, permission: P.name });
2694
2694
  }), F(/* @__PURE__ */ new Set()), r("");
2695
- }, w = (C) => {
2696
- j(C), f.forEach(
2697
- (M, _) => I(_, { ...f[_], permission: C.name })
2695
+ }, k = (C) => {
2696
+ j(C), b.forEach(
2697
+ (M, _) => I(_, { ...b[_], permission: C.name })
2698
2698
  );
2699
- }, k = async (C) => {
2699
+ }, w = async (C) => {
2700
2700
  try {
2701
2701
  if (l === ue.DRIVE) {
2702
2702
  const M = C.pendingInvites.map((A) => ({
@@ -2755,7 +2755,9 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2755
2755
  return "Add User, Groups or Roles test";
2756
2756
  }
2757
2757
  };
2758
- return ae(() => (console.log("InviteFlow - isChanged:", u, "pendingInvites.length:", D.length), D.length === 0 && !u), [D.length, u]), /* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-white", children: [
2758
+ return ae(() => (console.log("InviteFlow - isChanged:", u, "pendingInvites.length:", D.length), D.length === 0 && !u), [D.length, u]), Z(() => {
2759
+ typeof o == "function" && o({ pendingInvites: D }, i);
2760
+ }, [D]), /* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-white", children: [
2759
2761
  /* @__PURE__ */ n("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
2760
2762
  /* @__PURE__ */ e(ye.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: L() }),
2761
2763
  /* @__PURE__ */ n("div", { className: "flex items-center gap-4", children: [
@@ -2784,8 +2786,8 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2784
2786
  }
2785
2787
  ),
2786
2788
  /* @__PURE__ */ n("div", { className: "relative grid grid-cols-3 gap-2 items-start", children: [
2787
- /* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(Z, { value: h, onChange: N, children: /* @__PURE__ */ n("div", { className: "relative", children: [
2788
- /* @__PURE__ */ n(Z.Button, { className: "relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
2789
+ /* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(K, { value: h, onChange: N, children: /* @__PURE__ */ n("div", { className: "relative", children: [
2790
+ /* @__PURE__ */ n(K.Button, { className: "relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
2789
2791
  /* @__PURE__ */ n("span", { className: "flex items-center", children: [
2790
2792
  /* @__PURE__ */ e(h.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
2791
2793
  /* @__PURE__ */ e("span", { className: "truncate", children: h.name })
@@ -2799,12 +2801,12 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2799
2801
  leave: "transition ease-in duration-100",
2800
2802
  leaveFrom: "opacity-100",
2801
2803
  leaveTo: "opacity-0",
2802
- children: /* @__PURE__ */ e(Z.Options, { className: "absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: Mt.map((C) => /* @__PURE__ */ e(
2803
- Z.Option,
2804
+ children: /* @__PURE__ */ e(K.Options, { className: "absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: Mt.map((C) => /* @__PURE__ */ e(
2805
+ K.Option,
2804
2806
  {
2805
2807
  value: C,
2806
2808
  className: ({ active: M }) => `${M ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
2807
- children: ({ selected: M }) => /* @__PURE__ */ n(ee, { children: [
2809
+ children: ({ selected: M }) => /* @__PURE__ */ n(te, { children: [
2808
2810
  /* @__PURE__ */ n(
2809
2811
  "span",
2810
2812
  {
@@ -2844,20 +2846,20 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2844
2846
  exit: { opacity: 0, y: -10 },
2845
2847
  transition: { duration: 0.2 },
2846
2848
  className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
2847
- children: E ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ n(ee, { children: [
2849
+ children: E ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ n(te, { children: [
2848
2850
  /* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: d.map((C) => {
2849
2851
  const M = T(C);
2850
2852
  return /* @__PURE__ */ n(
2851
2853
  "div",
2852
2854
  {
2853
- onClick: () => M ? null : b(C.id),
2855
+ onClick: () => M ? null : f(C.id),
2854
2856
  className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${M ? " hover:cursor-not-allowed" : "hover:cursor-pointer"}`,
2855
2857
  children: [
2856
2858
  /* @__PURE__ */ e(
2857
2859
  "input",
2858
2860
  {
2859
2861
  type: "checkbox",
2860
- checked: S.has(C.id),
2862
+ checked: z.has(C.id),
2861
2863
  readOnly: !0,
2862
2864
  className: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500",
2863
2865
  disabled: !!M
@@ -2868,7 +2870,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2868
2870
  /* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children: C.name }),
2869
2871
  h.name === De.USER && /* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: C.id })
2870
2872
  ] }),
2871
- M ? /* @__PURE__ */ n(ee, { children: [
2873
+ M ? /* @__PURE__ */ n(te, { children: [
2872
2874
  /* @__PURE__ */ e("span", { className: "text-sm px-3 py-0.5 border border-dashed rounded-xl bg-teal-100 text-teal-700", children: M }),
2873
2875
  /* @__PURE__ */ e("span", { className: "text-sm text-gray-400", children: "Already added" })
2874
2876
  ] }) : ""
@@ -2890,7 +2892,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2890
2892
  /* @__PURE__ */ e(
2891
2893
  le,
2892
2894
  {
2893
- onClick: p,
2895
+ onClick: g,
2894
2896
  size: "small",
2895
2897
  label: "Add"
2896
2898
  }
@@ -2900,7 +2902,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2900
2902
  }
2901
2903
  ) })
2902
2904
  ] }),
2903
- /* @__PURE__ */ e(Se, { children: f.length > 0 && /* @__PURE__ */ n(
2905
+ /* @__PURE__ */ e(Se, { children: b.length > 0 && /* @__PURE__ */ n(
2904
2906
  ie.div,
2905
2907
  {
2906
2908
  initial: { opacity: 0, y: 20 },
@@ -2910,16 +2912,16 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2910
2912
  /* @__PURE__ */ n("div", { className: "flex justify-between items-center", children: [
2911
2913
  /* @__PURE__ */ n("div", { className: "font-semibold text-gray-800", children: [
2912
2914
  "Pending Invites (",
2913
- f.length,
2915
+ b.length,
2914
2916
  ")"
2915
2917
  ] }),
2916
2918
  l === ue.DRIVE && /* @__PURE__ */ e(
2917
- Z,
2919
+ K,
2918
2920
  {
2919
2921
  value: P,
2920
- onChange: w,
2922
+ onChange: k,
2921
2923
  children: /* @__PURE__ */ n("div", { className: "relative", children: [
2922
- /* @__PURE__ */ n(Z.Button, { className: "relative w-full border border-gray-300 bg-white rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
2924
+ /* @__PURE__ */ n(K.Button, { className: "relative w-full border border-gray-300 bg-white rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
2923
2925
  /* @__PURE__ */ n("span", { className: "flex items-center", children: [
2924
2926
  /* @__PURE__ */ e(P.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
2925
2927
  /* @__PURE__ */ n("span", { className: "truncate", children: [
@@ -2936,12 +2938,12 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2936
2938
  leave: "transition ease-in duration-100",
2937
2939
  leaveFrom: "opacity-100",
2938
2940
  leaveTo: "opacity-0",
2939
- children: /* @__PURE__ */ e(Z.Options, { className: "absolute z-10 mt-1 w-auto min-w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: Lt.map((C) => /* @__PURE__ */ e(
2940
- Z.Option,
2941
+ children: /* @__PURE__ */ e(K.Options, { className: "absolute z-10 mt-1 w-auto min-w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: Lt.map((C) => /* @__PURE__ */ e(
2942
+ K.Option,
2941
2943
  {
2942
2944
  value: C,
2943
2945
  className: ({ active: M }) => `${M ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
2944
- children: ({ selected: M, active: _ }) => /* @__PURE__ */ n(ee, { children: [
2946
+ children: ({ selected: M, active: _ }) => /* @__PURE__ */ n(te, { children: [
2945
2947
  /* @__PURE__ */ n(
2946
2948
  "span",
2947
2949
  {
@@ -2975,7 +2977,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2975
2977
  }
2976
2978
  )
2977
2979
  ] }),
2978
- /* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(Se, { children: f.map((C, M) => /* @__PURE__ */ n(
2980
+ /* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(Se, { children: b.map((C, M) => /* @__PURE__ */ n(
2979
2981
  ie.div,
2980
2982
  {
2981
2983
  layout: !0,
@@ -3036,7 +3038,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3036
3038
  /* @__PURE__ */ e(
3037
3039
  le,
3038
3040
  {
3039
- onClick: () => Y(k)(),
3041
+ onClick: () => Y(w)(),
3040
3042
  disabled: x || D.length === 0 && !u,
3041
3043
  label: x ? "Inviting..." : l === ue.DRIVE ? "Send Invites" : "Add"
3042
3044
  }
@@ -3058,15 +3060,15 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3058
3060
  }), h = Kr(u), N = en(u), { getReferenceProps: y, getFloatingProps: r } = tn([
3059
3061
  h,
3060
3062
  N
3061
- ]), v = ot.find((g) => g.name === t.permission || g.value === t.permission) || ot[0];
3063
+ ]), v = ot.find((p) => p.name === t.permission || p.value === t.permission) || ot[0];
3062
3064
  return (
3063
3065
  // FIX: The <Listbox> component now wraps both the button and the portal.
3064
3066
  // This provides the necessary context for both children.
3065
- /* @__PURE__ */ n(Z, { value: v, onChange: (g) => {
3066
- s(g), l(!1);
3067
+ /* @__PURE__ */ n(K, { value: v, onChange: (p) => {
3068
+ s(p), l(!1);
3067
3069
  }, children: [
3068
3070
  /* @__PURE__ */ n(
3069
- Z.Button,
3071
+ K.Button,
3070
3072
  {
3071
3073
  ref: m.setReference,
3072
3074
  ...y(),
@@ -3089,38 +3091,38 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3089
3091
  leaveFrom: "transform opacity-100 scale-100",
3090
3092
  leaveTo: "transform opacity-0 scale-95",
3091
3093
  children: /* @__PURE__ */ e(
3092
- Z.Options,
3094
+ K.Options,
3093
3095
  {
3094
3096
  ref: m.setFloating,
3095
3097
  style: o,
3096
3098
  ...r(),
3097
3099
  static: !0,
3098
3100
  className: "z-50 w-48 bg-white shadow-lg rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm",
3099
- children: ot.filter((g) => a.includes(g.value)).map((g) => /* @__PURE__ */ e(
3100
- Z.Option,
3101
+ children: ot.filter((p) => a.includes(p.value)).map((p) => /* @__PURE__ */ e(
3102
+ K.Option,
3101
3103
  {
3102
3104
  className: ({
3103
- active: S
3105
+ active: z
3104
3106
  }) => `relative select-none py-2 pl-10 pr-4 hover:cursor-pointer
3105
- ${S ? "bg-blue-100 text-blue-900" : "text-gray-900"}
3106
- ${g.isDestructive && S ? "bg-red-100 text-red-900" : ""}
3107
- ${g.isDestructive && !S ? "text-red-600" : ""}`,
3108
- value: g,
3109
- children: ({ selected: S }) => /* @__PURE__ */ n(ee, { children: [
3107
+ ${z ? "bg-blue-100 text-blue-900" : "text-gray-900"}
3108
+ ${p.isDestructive && z ? "bg-red-100 text-red-900" : ""}
3109
+ ${p.isDestructive && !z ? "text-red-600" : ""}`,
3110
+ value: p,
3111
+ children: ({ selected: z }) => /* @__PURE__ */ n(te, { children: [
3110
3112
  /* @__PURE__ */ n(
3111
3113
  "span",
3112
3114
  {
3113
- className: `flex items-center gap-2 truncate ${S ? "font-medium" : "font-normal"}`,
3115
+ className: `flex items-center gap-2 truncate ${z ? "font-medium" : "font-normal"}`,
3114
3116
  children: [
3115
- /* @__PURE__ */ e(g.icon, { className: "h-5 w-5", "aria-hidden": "true" }),
3116
- g.name
3117
+ /* @__PURE__ */ e(p.icon, { className: "h-5 w-5", "aria-hidden": "true" }),
3118
+ p.name
3117
3119
  ]
3118
3120
  }
3119
3121
  ),
3120
- S && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600", children: /* @__PURE__ */ e(ut, { className: "h-5 w-5", "aria-hidden": "true" }) })
3122
+ z && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600", children: /* @__PURE__ */ e(ut, { className: "h-5 w-5", "aria-hidden": "true" }) })
3121
3123
  ] })
3122
3124
  },
3123
- g.name
3125
+ p.name
3124
3126
  ))
3125
3127
  }
3126
3128
  )
@@ -3147,7 +3149,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3147
3149
  roles: o.roles.filter(
3148
3150
  (R) => R.name.toLowerCase().includes(v.toLowerCase())
3149
3151
  )
3150
- }, g = async (R, P, j, U) => {
3152
+ }, p = async (R, P, j, U) => {
3151
3153
  const Y = P.value;
3152
3154
  u((q) => ({
3153
3155
  ...q,
@@ -3155,7 +3157,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3155
3157
  ($) => $.id === R.id ? { ...$, permission: Y } : $
3156
3158
  )
3157
3159
  }));
3158
- }, S = () => {
3160
+ }, z = () => {
3159
3161
  const R = {
3160
3162
  users: o.users.filter((P) => P.permission !== "remove"),
3161
3163
  groups: o.groups.filter((P) => P.permission !== "remove"),
@@ -3266,7 +3268,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3266
3268
  {
3267
3269
  item: P,
3268
3270
  allowedPermissions: m,
3269
- onPermissionChange: (j) => g(
3271
+ onPermissionChange: (j) => p(
3270
3272
  P,
3271
3273
  j,
3272
3274
  R
@@ -3306,7 +3308,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3306
3308
  /* @__PURE__ */ e("div", { className: "p-4 bg-white border-t border-gray-300 flex justify-end", children: /* @__PURE__ */ e(
3307
3309
  "button",
3308
3310
  {
3309
- onClick: S,
3311
+ onClick: z,
3310
3312
  className: "px-4 py-2 bg-blue-600 text-white rounded-md shadow hover:bg-blue-700",
3311
3313
  children: "Update"
3312
3314
  }
@@ -3343,7 +3345,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3343
3345
  exit: { opacity: 0, x: -20 }
3344
3346
  }, v = () => l ? (
3345
3347
  // Show 5 skeleton items while loading
3346
- /* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((d, g) => /* @__PURE__ */ e(is, {}, g)) })
3348
+ /* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((d, p) => /* @__PURE__ */ e(is, {}, p)) })
3347
3349
  ) : N.length === 0 ? /* @__PURE__ */ n(
3348
3350
  ie.div,
3349
3351
  {
@@ -3448,25 +3450,25 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3448
3450
  allowedPermissions: u = [],
3449
3451
  ...h
3450
3452
  }) => {
3451
- const [N, y] = B(be.INVITE), [r, v] = B(t), [d, g] = B(null), [S, F] = B(!1), [E, R] = B([]), [P, j] = B(be.MANAGE), U = () => {
3452
- y(be.INVITE), g(null), m();
3453
+ const [N, y] = B(be.INVITE), [r, v] = B(t), [d, p] = B(null), [z, F] = B(!1), [E, R] = B([]), [P, j] = B(be.MANAGE), U = () => {
3454
+ y(be.INVITE), p(null), m();
3453
3455
  }, Y = () => {
3454
3456
  y(be.MANAGE);
3455
- }, q = async ({ id: f, name: z, type: O }) => {
3457
+ }, q = async ({ id: b, name: S, type: O }) => {
3456
3458
  if (O === "groups") {
3457
3459
  try {
3458
- const I = await Ze(`${Je.getMembersForGroup(z)}`);
3460
+ const I = await Ze(`${Je.getMembersForGroup(S)}`);
3459
3461
  } catch (I) {
3460
3462
  console.log("Error searching entities:", I);
3461
3463
  }
3462
3464
  R(resp);
3463
3465
  }
3464
- g({ id: f, type: O, name: z }), j(N), y(be.MEMBERS);
3465
- }, $ = (f) => {
3466
- console.log("changedExistingShares", f), v(f);
3467
- const z = it.mapValues(t, (D) => D.map((b) => ({ id: b.id, permission: b.permission })).sort((b, p) => b.id - p.id)), O = it.mapValues(f, (D) => D.map((b) => ({ id: b.id, permission: b.permission })).sort((b, p) => b.id - p.id));
3468
- console.log("Existing data:", z), console.log("Changed data:", O);
3469
- const I = !it.isEqual(z, O);
3466
+ p({ id: b, type: O, name: S }), j(N), y(be.MEMBERS);
3467
+ }, $ = (b) => {
3468
+ console.log("changedExistingShares", b), v(b);
3469
+ const S = it.mapValues(t, (D) => D.map((f) => ({ id: f.id, permission: f.permission })).sort((f, g) => f.id - g.id)), O = it.mapValues(b, (D) => D.map((f) => ({ id: f.id, permission: f.permission })).sort((f, g) => f.id - g.id));
3470
+ console.log("Existing data:", S), console.log("Changed data:", O);
3471
+ const I = !it.isEqual(S, O);
3470
3472
  console.log("hasPermissionChanged:", I), F(I), y(N === be.MEMBERS ? P : be.INVITE);
3471
3473
  };
3472
3474
  return /* @__PURE__ */ e(he, { appear: !0, show: a, as: Q, children: /* @__PURE__ */ n(ye, { as: "div", className: "relative z-50", onClose: U, children: [
@@ -3538,10 +3540,10 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3538
3540
  existingShares: r,
3539
3541
  calledBy: l,
3540
3542
  showExistingShares: o,
3541
- onFinalSubmit: (f) => {
3542
- s(f, r);
3543
+ onFinalSubmit: (b) => {
3544
+ s(b, r);
3543
3545
  },
3544
- isChanged: S
3546
+ isChanged: z
3545
3547
  }
3546
3548
  )
3547
3549
  },
@@ -3574,58 +3576,58 @@ function at({
3574
3576
  serverLoading: r = !1,
3575
3577
  minSearchChars: v = 2,
3576
3578
  // NEW: mappers (id/label keys)
3577
- getOptionId: d = (S) => String(S.id),
3578
- getOptionLabel: g = (S) => S.name
3579
+ getOptionId: d = (z) => String(z.id),
3580
+ getOptionLabel: p = (z) => z.name
3579
3581
  }) {
3580
- const S = He(), F = He(), [E, R] = B(""), P = fe(""), j = ae(() => {
3581
- const f = /* @__PURE__ */ new Map();
3582
- for (const z of a) f.set(d(z), z);
3583
- return f;
3584
- }, [a, d]), U = ae(() => Array.isArray(s) ? s.map((f) => f && typeof f == "object" ? j.get(d(f)) || null : j.get(String(f))).filter(Boolean) : [], [s, j, d]), Y = ae(() => {
3582
+ const z = He(), F = He(), [E, R] = B(""), P = fe(""), j = ae(() => {
3583
+ const b = /* @__PURE__ */ new Map();
3584
+ for (const S of a) b.set(d(S), S);
3585
+ return b;
3586
+ }, [a, d]), U = ae(() => Array.isArray(s) ? s.map((b) => b && typeof b == "object" ? j.get(d(b)) || null : j.get(String(b))).filter(Boolean) : [], [s, j, d]), Y = ae(() => {
3585
3587
  if (!E) return a;
3586
- const f = E.toLowerCase();
3587
- return a.filter((z) => g(z).toLowerCase().includes(f));
3588
- }, [a, E, g]);
3589
- te(() => {
3588
+ const b = E.toLowerCase();
3589
+ return a.filter((S) => p(S).toLowerCase().includes(b));
3590
+ }, [a, E, p]);
3591
+ Z(() => {
3590
3592
  N === "server" && E.length >= v && E !== P.current && (P.current = E, y && y(E));
3591
3593
  }, [E, N, v, y]);
3592
3594
  const q = N === "client" ? Y : a, $ = () => {
3593
3595
  if (!U.length)
3594
3596
  return /* @__PURE__ */ e("span", { className: "text-gray-500", children: m });
3595
- const f = U.slice(0, u), z = U.length - u;
3597
+ const b = U.slice(0, u), S = U.length - u;
3596
3598
  return /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-2", children: [
3597
- f.map((O) => /* @__PURE__ */ e(
3599
+ b.map((O) => /* @__PURE__ */ e(
3598
3600
  "span",
3599
3601
  {
3600
3602
  className: "px-2 py-1 text-xs font-medium text-white bg-gray-800 rounded-full",
3601
- children: g(O)
3603
+ children: p(O)
3602
3604
  },
3603
3605
  d(O)
3604
3606
  )),
3605
- z > 0 && /* @__PURE__ */ n("span", { className: "px-2 py-1 text-xs font-medium text-gray-600 bg-gray-200 rounded-full", children: [
3607
+ S > 0 && /* @__PURE__ */ n("span", { className: "px-2 py-1 text-xs font-medium text-gray-600 bg-gray-200 rounded-full", children: [
3606
3608
  "+",
3607
- z,
3609
+ S,
3608
3610
  " more"
3609
3611
  ] })
3610
3612
  ] });
3611
3613
  };
3612
- return /* @__PURE__ */ e(Z, { value: U, onChange: (f) => {
3613
- const z = Array.from(new Set(f.map((O) => d(O))));
3614
- h !== -1 && z.length > h || i(z);
3615
- }, multiple: !0, by: "id", children: ({ open: f }) => /* @__PURE__ */ n("div", { children: [
3614
+ return /* @__PURE__ */ e(K, { value: U, onChange: (b) => {
3615
+ const S = Array.from(new Set(b.map((O) => d(O))));
3616
+ h !== -1 && S.length > h || i(S);
3617
+ }, multiple: !0, by: "id", children: ({ open: b }) => /* @__PURE__ */ n("div", { children: [
3616
3618
  /* @__PURE__ */ e(
3617
- Z.Label,
3619
+ K.Label,
3618
3620
  {
3619
- id: S,
3621
+ id: z,
3620
3622
  className: "block text-sm font-medium leading-6 text-gray-900",
3621
3623
  children: t
3622
3624
  }
3623
3625
  ),
3624
3626
  /* @__PURE__ */ n("div", { className: "relative mt-2", children: [
3625
3627
  /* @__PURE__ */ n(
3626
- Z.Button,
3628
+ K.Button,
3627
3629
  {
3628
- "aria-labelledby": S,
3630
+ "aria-labelledby": z,
3629
3631
  "aria-invalid": !!o,
3630
3632
  "aria-describedby": o ? F : void 0,
3631
3633
  onBlur: l,
@@ -3643,11 +3645,11 @@ function at({
3643
3645
  he,
3644
3646
  {
3645
3647
  as: Q,
3646
- show: f,
3648
+ show: b,
3647
3649
  leave: "transition ease-in duration-100",
3648
3650
  leaveFrom: "opacity-100",
3649
3651
  leaveTo: "opacity-0",
3650
- children: /* @__PURE__ */ n(Z.Options, { className: "absolute z-10 w-full py-1 mt-1 overflow-auto text-base bg-white rounded-md shadow-lg max-h-60 ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: [
3652
+ children: /* @__PURE__ */ n(K.Options, { className: "absolute z-10 w-full py-1 mt-1 overflow-auto text-base bg-white rounded-md shadow-lg max-h-60 ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: [
3651
3653
  /* @__PURE__ */ e("div", { className: "p-2 sticky top-0 bg-white z-20 shadow-sm", children: /* @__PURE__ */ e(
3652
3654
  ge,
3653
3655
  {
@@ -3657,33 +3659,33 @@ function at({
3657
3659
  }
3658
3660
  ) }),
3659
3661
  N === "server" && r && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
3660
- q.length === 0 && !r ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: N === "server" ? E.length < v ? `Type at least ${v} characters to search.` : "No results." : "No options found." }) : q.map((z) => {
3661
- const O = d(z), I = g(z), D = U.some((p) => d(p) === O), b = h !== -1 && U.length >= h && !D;
3662
+ q.length === 0 && !r ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: N === "server" ? E.length < v ? `Type at least ${v} characters to search.` : "No results." : "No options found." }) : q.map((S) => {
3663
+ const O = d(S), I = p(S), D = U.some((g) => d(g) === O), f = h !== -1 && U.length >= h && !D;
3662
3664
  return /* @__PURE__ */ e(
3663
- Z.Option,
3665
+ K.Option,
3664
3666
  {
3665
- value: z,
3666
- disabled: b,
3667
- className: ({ active: p }) => Ge(
3668
- b ? " text-gray-400 bg-white cursor-not-allowed" : p ? " bg-gray-200 text-gray-900" : " text-gray-900",
3667
+ value: S,
3668
+ disabled: f,
3669
+ className: ({ active: g }) => Ge(
3670
+ f ? " text-gray-400 bg-white cursor-not-allowed" : g ? " bg-gray-200 text-gray-900" : " text-gray-900",
3669
3671
  " relative cursor-default select-none py-2 pl-3 pr-9"
3670
3672
  ),
3671
- children: ({ selected: p, active: w }) => /* @__PURE__ */ n(ee, { children: [
3673
+ children: ({ selected: g, active: k }) => /* @__PURE__ */ n(te, { children: [
3672
3674
  /* @__PURE__ */ e(
3673
3675
  "span",
3674
3676
  {
3675
3677
  className: Ge(
3676
- p ? "font-semibold" : "font-normal",
3678
+ g ? "font-semibold" : "font-normal",
3677
3679
  "block truncate"
3678
3680
  ),
3679
3681
  children: I
3680
3682
  }
3681
3683
  ),
3682
- p && /* @__PURE__ */ e(
3684
+ g && /* @__PURE__ */ e(
3683
3685
  "span",
3684
3686
  {
3685
3687
  className: Ge(
3686
- w ? " text-gray-900" : " text-gray-600",
3688
+ k ? " text-gray-900" : " text-gray-600",
3687
3689
  " absolute inset-y-0 right-0 flex items-center pr-4"
3688
3690
  ),
3689
3691
  children: /* @__PURE__ */ e(et, { className: "w-5 h-5", "aria-hidden": "true" })
@@ -3855,9 +3857,9 @@ function ms({
3855
3857
  dropId: y,
3856
3858
  indent: r = 24
3857
3859
  }) {
3858
- const { setNodeRef: v, isOver: d } = dr({ id: y }), { attributes: g, listeners: S, setNodeRef: F, transform: E, isDragging: R } = mr({ id: N }), P = E ? { transform: `translate3d(${Math.round(E.x)}px, ${Math.round(E.y)}px, 0)` } : void 0, [j, U] = B(!1), [Y, q] = B(t.name), $ = () => {
3859
- const f = Y.trim();
3860
- U(!1), f && f !== t.name ? o?.(t, f) : q(t.name);
3860
+ const { setNodeRef: v, isOver: d } = dr({ id: y }), { attributes: p, listeners: z, setNodeRef: F, transform: E, isDragging: R } = mr({ id: N }), P = E ? { transform: `translate3d(${Math.round(E.x)}px, ${Math.round(E.y)}px, 0)` } : void 0, [j, U] = B(!1), [Y, q] = B(t.name), $ = () => {
3861
+ const b = Y.trim();
3862
+ U(!1), b && b !== t.name ? o?.(t, b) : q(t.name);
3861
3863
  }, x = ae(() => /* @__PURE__ */ e(
3862
3864
  Gn,
3863
3865
  {
@@ -3866,8 +3868,8 @@ function ms({
3866
3868
  { action: "rename", label: "Rename" },
3867
3869
  { action: "delete", label: "Delete" }
3868
3870
  ],
3869
- onSelect: (z) => {
3870
- z.action === "create" ? m?.(t) : z.action === "rename" ? U(!0) : z.action === "delete" && u?.(t);
3871
+ onSelect: (S) => {
3872
+ S.action === "create" ? m?.(t) : S.action === "rename" ? U(!0) : S.action === "delete" && u?.(t);
3871
3873
  }
3872
3874
  }
3873
3875
  ), [t, m, u]);
@@ -3877,8 +3879,8 @@ function ms({
3877
3879
  ref: v,
3878
3880
  className: `tv-row ${d ? "tv-drop-over" : ""} ${R ? "dragging" : ""}`,
3879
3881
  style: { ...P, paddingLeft: 8 + a * r },
3880
- onClick: (f) => {
3881
- f.target.closest(".tv-toggle") || f.target.tagName === "INPUT" || l?.(t);
3882
+ onClick: (b) => {
3883
+ b.target.closest(".tv-toggle") || b.target.tagName === "INPUT" || l?.(t);
3882
3884
  },
3883
3885
  children: [
3884
3886
  /* @__PURE__ */ e("button", { className: "tv-toggle", onClick: i, "aria-label": "toggle", children: t.children?.length ? s ? /* @__PURE__ */ e(Nt, { size: 16 }) : /* @__PURE__ */ e(xe, { size: 16 }) : /* @__PURE__ */ e("span", { className: "tv-spacer" }) }),
@@ -3888,15 +3890,15 @@ function ms({
3888
3890
  {
3889
3891
  className: "tv-input",
3890
3892
  value: Y,
3891
- onChange: (f) => q(f.target.value),
3893
+ onChange: (b) => q(b.target.value),
3892
3894
  onBlur: $,
3893
- onKeyDown: (f) => {
3894
- f.key === "Enter" && $(), f.key === "Escape" && (U(!1), q(t.name));
3895
+ onKeyDown: (b) => {
3896
+ b.key === "Enter" && $(), b.key === "Escape" && (U(!1), q(t.name));
3895
3897
  },
3896
3898
  autoFocus: !0
3897
3899
  }
3898
3900
  ) : /* @__PURE__ */ e("span", { onDoubleClick: () => U(!0), children: t.name }) }),
3899
- /* @__PURE__ */ e(ds, { listeners: S, attributes: g }),
3901
+ /* @__PURE__ */ e(ds, { listeners: z, attributes: p }),
3900
3902
  /* @__PURE__ */ e("div", { className: "tv-actions", children: h ? h(t, {
3901
3903
  onCreateChild: () => m?.(t),
3902
3904
  onRename: () => U(!0),
@@ -3995,40 +3997,40 @@ function Hl({
3995
3997
  renderActions: v,
3996
3998
  disableMoveToRoot: d = !1,
3997
3999
  // ← allow root moves by default now
3998
- indentUnit: g = 24
4000
+ indentUnit: p = 24
3999
4001
  }) {
4000
- const { roots: S } = ae(() => gs(t) ? fs(t, { rootId: a, getId: i, getName: m }) : bs(
4001
- t.map((b) => ({ ...b })),
4002
+ const { roots: z } = ae(() => gs(t) ? fs(t, { rootId: a, getId: i, getName: m }) : bs(
4003
+ t.map((f) => ({ ...f })),
4002
4004
  { rootId: a, getId: i, getParent: l, getName: m }
4003
- ), [t, a, i, l, m]), [F, E] = B({}), R = K((b) => {
4004
- const p = {};
4005
- return (function w(k) {
4006
- k.forEach((T) => {
4007
- p[T.id] = !0, T.children?.length && w(T.children);
4005
+ ), [t, a, i, l, m]), [F, E] = B({}), R = ee((f) => {
4006
+ const g = {};
4007
+ return (function k(w) {
4008
+ w.forEach((T) => {
4009
+ g[T.id] = !0, T.children?.length && k(T.children);
4008
4010
  });
4009
- })(b), p;
4011
+ })(f), g;
4010
4012
  }, []);
4011
4013
  re.useEffect(() => {
4012
- E(R(S));
4013
- }, [S, R]);
4014
- const P = K(
4015
- (b) => E((p) => ({ ...p, [b]: !p[b] })),
4014
+ E(R(z));
4015
+ }, [z, R]);
4016
+ const P = ee(
4017
+ (f) => E((g) => ({ ...g, [f]: !g[f] })),
4016
4018
  []
4017
- ), [j, U] = B(() => Me(S));
4018
- re.useEffect(() => U(Me(S)), [S]);
4019
+ ), [j, U] = B(() => Me(z));
4020
+ re.useEffect(() => U(Me(z)), [z]);
4019
4021
  const Y = ur(
4020
4022
  hr(fr, { activationConstraint: { delay: 250, tolerance: 5 } })
4021
- ), q = fe(null), [$, x] = B(null), f = fe(0), z = () => {
4022
- }, O = ({ delta: b }) => {
4023
- f.current = b?.x ?? 0;
4024
- }, I = K(
4025
- ({ active: b, over: p }) => {
4026
- const w = f.current;
4027
- if (f.current = 0, x(null), !b || !p) return;
4028
- const k = String(b.id).replace(/^drag-/, ""), T = String(p.id).replace(/^drop-/, "");
4029
- if (!k || !T || k === T) return;
4023
+ ), q = fe(null), [$, x] = B(null), b = fe(0), S = () => {
4024
+ }, O = ({ delta: f }) => {
4025
+ b.current = f?.x ?? 0;
4026
+ }, I = ee(
4027
+ ({ active: f, over: g }) => {
4028
+ const k = b.current;
4029
+ if (b.current = 0, x(null), !f || !g) return;
4030
+ const w = String(f.id).replace(/^drag-/, ""), T = String(g.id).replace(/^drop-/, "");
4031
+ if (!w || !T || w === T) return;
4030
4032
  let L = T;
4031
- const C = Math.max(0, Math.floor(-w / g));
4033
+ const C = Math.max(0, Math.floor(-k / p));
4032
4034
  if (C > 0) {
4033
4035
  let W = T;
4034
4036
  for (let pe = 0; pe < C; pe++) {
@@ -4042,50 +4044,50 @@ function Hl({
4042
4044
  }
4043
4045
  }
4044
4046
  if (d && L === a) {
4045
- U(Me(S));
4047
+ U(Me(z));
4046
4048
  return;
4047
4049
  }
4048
- const M = Me(j), { newRoots: _, removed: A } = ys(M, k);
4050
+ const M = Me(j), { newRoots: _, removed: A } = ys(M, w);
4049
4051
  if (!A) return;
4050
4052
  const G = xs(_, L, A);
4051
- U(G), r?.({ sourceId: k, destParentId: L, newTree: G });
4053
+ U(G), r?.({ sourceId: w, destParentId: L, newTree: G });
4052
4054
  },
4053
- [j, S, a, d, g, r]
4054
- ), D = K(
4055
- (b, p = 0) => b.map((w) => /* @__PURE__ */ n(re.Fragment, { children: [
4055
+ [j, z, a, d, p, r]
4056
+ ), D = ee(
4057
+ (f, g = 0) => f.map((k) => /* @__PURE__ */ n(re.Fragment, { children: [
4056
4058
  /* @__PURE__ */ e(
4057
4059
  ms,
4058
4060
  {
4059
- node: w,
4060
- depth: p,
4061
- expanded: !!F[w.id],
4062
- onToggle: () => P(w.id),
4061
+ node: k,
4062
+ depth: g,
4063
+ expanded: !!F[k.id],
4064
+ onToggle: () => P(k.id),
4063
4065
  onSelect: o,
4064
4066
  onCreateChild: h,
4065
4067
  onRename: N,
4066
4068
  onDelete: y,
4067
4069
  renderActions: v,
4068
- dragId: `drag-${w.id}`,
4069
- dropId: `drop-${w.id}`,
4070
- indent: g
4070
+ dragId: `drag-${k.id}`,
4071
+ dropId: `drop-${k.id}`,
4072
+ indent: p
4071
4073
  }
4072
4074
  ),
4073
- F[w.id] && w.children?.length > 0 ? D(w.children, p + 1) : null
4074
- ] }, w.id)),
4075
- [F, g, h, y, N, o, v, P]
4075
+ F[k.id] && k.children?.length > 0 ? D(k.children, g + 1) : null
4076
+ ] }, k.id)),
4077
+ [F, p, h, y, N, o, v, P]
4076
4078
  );
4077
4079
  return re.useMemo(() => {
4078
4080
  if (!$) return null;
4079
- const b = String($).replace(/^drag-/, "");
4080
- function p(w) {
4081
- for (const k of w) {
4082
- if (k.id === b) return k;
4083
- const T = k.children?.length ? p(k.children) : null;
4081
+ const f = String($).replace(/^drag-/, "");
4082
+ function g(k) {
4083
+ for (const w of k) {
4084
+ if (w.id === f) return w;
4085
+ const T = w.children?.length ? g(w.children) : null;
4084
4086
  if (T) return T;
4085
4087
  }
4086
4088
  return null;
4087
4089
  }
4088
- return p(j);
4090
+ return g(j);
4089
4091
  }, [$, j]), /* @__PURE__ */ n("div", { className: "tv", children: [
4090
4092
  s !== !1 && /* @__PURE__ */ n("div", { className: "tv-header", children: [
4091
4093
  /* @__PURE__ */ e("div", { className: "tv-title", children: s }),
@@ -4101,7 +4103,7 @@ function Hl({
4101
4103
  {
4102
4104
  collisionDetection: br,
4103
4105
  sensors: Y,
4104
- onDragStart: z,
4106
+ onDragStart: S,
4105
4107
  onDragMove: O,
4106
4108
  onDragEnd: I,
4107
4109
  modifiers: [gr],
@@ -4136,7 +4138,7 @@ const Ql = ({
4136
4138
  /* @__PURE__ */ e(se.Panels, { unmount: !a, className: ze("flex-1", m), children: t.map((v) => /* @__PURE__ */ e(se.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: v.content }) }, v.key)) })
4137
4139
  ] }) : (
4138
4140
  // mostly this part is used : horizontal
4139
- /* @__PURE__ */ n(ee, { children: [
4141
+ /* @__PURE__ */ n(te, { children: [
4140
4142
  /* @__PURE__ */ e(se.List, { className: ze("flex gap-6 border rounded-t-2xl px-1.5 border-gray-300 mb-3 ", l), children: t.map((v) => /* @__PURE__ */ e(se, { className: r, children: v.label }, v.key)) }),
4141
4143
  /* @__PURE__ */ e(se.Panels, { unmount: !a, className: ze("mt-2", m), children: t.map((v) => /* @__PURE__ */ e(se.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: v.content }) }, v.key)) })
4142
4144
  ] })
@@ -4152,7 +4154,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4152
4154
  const r = a && a[t.key] || {};
4153
4155
  return console.log("Initial Section data for", t.key, r), r;
4154
4156
  }), h = fe(a);
4155
- te(() => {
4157
+ Z(() => {
4156
4158
  if (h.current !== a) {
4157
4159
  h.current = a;
4158
4160
  const r = a && a[t.key] || {};
@@ -4160,29 +4162,29 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4160
4162
  }
4161
4163
  }, [a, t.key]), console.log("Section data", o);
4162
4164
  const N = fe(o);
4163
- te(() => {
4165
+ Z(() => {
4164
4166
  N.current !== o && s && typeof s == "function" && (N.current = o, s(l.key, o));
4165
4167
  }, [l.key, o, s]);
4166
4168
  const y = (r) => {
4167
4169
  if (!r.dependsOn) return !0;
4168
- const { field: v, value: d, operator: g = "equals" } = r.dependsOn, S = o[v];
4169
- switch (g) {
4170
+ const { field: v, value: d, operator: p = "equals" } = r.dependsOn, z = o[v];
4171
+ switch (p) {
4170
4172
  case "equals":
4171
- return S === d;
4173
+ return z === d;
4172
4174
  case "notEquals":
4173
- return S !== d;
4175
+ return z !== d;
4174
4176
  case "contains":
4175
- return Array.isArray(S) && S.includes(d);
4177
+ return Array.isArray(z) && z.includes(d);
4176
4178
  case "notContains":
4177
- return !Array.isArray(S) || !S.includes(d);
4179
+ return !Array.isArray(z) || !z.includes(d);
4178
4180
  case "greaterThan":
4179
- return Number(S) > Number(d);
4181
+ return Number(z) > Number(d);
4180
4182
  case "lessThan":
4181
- return Number(S) < Number(d);
4183
+ return Number(z) < Number(d);
4182
4184
  case "isEmpty":
4183
- return !S || Array.isArray(S) && S.length === 0;
4185
+ return !z || Array.isArray(z) && z.length === 0;
4184
4186
  case "isNotEmpty":
4185
- return S && (!Array.isArray(S) || S.length > 0);
4187
+ return z && (!Array.isArray(z) || z.length > 0);
4186
4188
  default:
4187
4189
  return !0;
4188
4190
  }
@@ -4208,8 +4210,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4208
4210
  name: r.key,
4209
4211
  checked: !!(o[r.key] || r.default),
4210
4212
  onChange: (d) => {
4211
- const g = d.target ? d.target.checked : d, S = { ...o, [r.key]: g };
4212
- u(S), s && s(l.key, S);
4213
+ const p = d.target ? d.target.checked : d, z = { ...o, [r.key]: p };
4214
+ u(z), s && s(l.key, z);
4213
4215
  },
4214
4216
  label: r.label,
4215
4217
  disabled: r.disabled ? r.disabled : !1
@@ -4263,8 +4265,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4263
4265
  placeholder: r.placeholder,
4264
4266
  value: o[r.key] || "",
4265
4267
  onChange: (d) => {
4266
- const g = { ...o, [r.key]: d.target.value };
4267
- u(g), s && s(l.key, g);
4268
+ const p = { ...o, [r.key]: d.target.value };
4269
+ u(p), s && s(l.key, p);
4268
4270
  },
4269
4271
  required: r.required,
4270
4272
  disabled: r.disabled ? r.disabled : !1,
@@ -4283,8 +4285,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4283
4285
  placeholder: r.placeholder,
4284
4286
  value: o[r.key] || "",
4285
4287
  onChange: (d) => {
4286
- const g = { ...o, [r.key]: d.target.value };
4287
- u(g), s && s(l.key, g);
4288
+ const p = { ...o, [r.key]: d.target.value };
4289
+ u(p), s && s(l.key, p);
4288
4290
  },
4289
4291
  rows: 3,
4290
4292
  required: r.required,
@@ -4308,14 +4310,14 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4308
4310
  max: r.max,
4309
4311
  step: r.step,
4310
4312
  onChange: (d) => {
4311
- const g = d.target.value, S = { ...o, [r.key]: g };
4312
- u(S), s && s(l.key, S);
4313
+ const p = d.target.value, z = { ...o, [r.key]: p };
4314
+ u(z), s && s(l.key, z);
4313
4315
  },
4314
4316
  onBlur: (d) => {
4315
- const g = d.target.value;
4316
- if (g !== "" && g !== null && g !== void 0) {
4317
- const S = Number(g);
4318
- isNaN(S) || (r.min !== void 0 && S < r.min ? (d.target.setCustomValidity(`${r.label} must be at least ${r.min}`), d.target.reportValidity()) : r.max !== void 0 && S > r.max ? (d.target.setCustomValidity(`${r.label} must not exceed ${r.max}`), d.target.reportValidity()) : d.target.setCustomValidity(""));
4317
+ const p = d.target.value;
4318
+ if (p !== "" && p !== null && p !== void 0) {
4319
+ const z = Number(p);
4320
+ isNaN(z) || (r.min !== void 0 && z < r.min ? (d.target.setCustomValidity(`${r.label} must be at least ${r.min}`), d.target.reportValidity()) : r.max !== void 0 && z > r.max ? (d.target.setCustomValidity(`${r.label} must not exceed ${r.max}`), d.target.reportValidity()) : d.target.setCustomValidity(""));
4319
4321
  }
4320
4322
  },
4321
4323
  required: r.required,
@@ -4340,8 +4342,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4340
4342
  name: r.key,
4341
4343
  checked: !!(o[r.key] || r.default),
4342
4344
  onChange: (d) => {
4343
- const g = d.target ? d.target.checked : d, S = { ...o, [r.key]: g };
4344
- u(S), s && s(l.key, S);
4345
+ const p = d.target ? d.target.checked : d, z = { ...o, [r.key]: p };
4346
+ u(z), s && s(l.key, z);
4345
4347
  },
4346
4348
  label: r.placeholder || r.label,
4347
4349
  disabled: r.disabled ? r.disabled : !1,
@@ -4358,8 +4360,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4358
4360
  defaultValue: r.default,
4359
4361
  value: o[r.key] || "",
4360
4362
  onChange: (d) => {
4361
- const g = { ...o, [r.key]: d };
4362
- u(g);
4363
+ const p = { ...o, [r.key]: d };
4364
+ u(p);
4363
4365
  },
4364
4366
  options: r.options || [],
4365
4367
  placeholder: r.placeholder || `Select ${r.label}`,
@@ -4380,8 +4382,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4380
4382
  placeholder: r.placeholder || "Enter email address",
4381
4383
  value: o[r.key] || "",
4382
4384
  onChange: (d) => {
4383
- const g = { ...o, [r.key]: d.target.value };
4384
- u(g), s && s(l.key, g);
4385
+ const p = { ...o, [r.key]: d.target.value };
4386
+ u(p), s && s(l.key, p);
4385
4387
  },
4386
4388
  required: r.required,
4387
4389
  disabled: r.disabled ? r.disabled : !1,
@@ -4400,8 +4402,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4400
4402
  placeholder: r.placeholder || "Enter URL",
4401
4403
  value: o[r.key] || "",
4402
4404
  onChange: (d) => {
4403
- const g = { ...o, [r.key]: d.target.value };
4404
- u(g), s && s(l.key, g);
4405
+ const p = { ...o, [r.key]: d.target.value };
4406
+ u(p), s && s(l.key, p);
4405
4407
  },
4406
4408
  required: r.required,
4407
4409
  disabled: r.disabled ? r.disabled : !1,
@@ -4420,8 +4422,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4420
4422
  placeholder: r.placeholder || "Enter password",
4421
4423
  value: o[r.key] || "",
4422
4424
  onChange: (d) => {
4423
- const g = { ...o, [r.key]: d.target.value };
4424
- u(g), s && s(l.key, g);
4425
+ const p = { ...o, [r.key]: d.target.value };
4426
+ u(p), s && s(l.key, p);
4425
4427
  },
4426
4428
  required: r.required,
4427
4429
  disabled: r.disabled ? r.disabled : !1,
@@ -4436,8 +4438,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4436
4438
  {
4437
4439
  selectedItems: o[r.key] || [],
4438
4440
  onSelectionChange: (d) => {
4439
- const g = { ...o, [r.key]: d };
4440
- u(g), s && s(l.key, g);
4441
+ const p = { ...o, [r.key]: d };
4442
+ u(p), s && s(l.key, p);
4441
4443
  },
4442
4444
  options: r.options || [],
4443
4445
  placeholder: r.placeholder || `Select ${r.label}`,
@@ -4454,8 +4456,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4454
4456
  checked: typeof o[r.key] == "boolean" ? o[r.key] : r.default,
4455
4457
  onChange: (d) => {
4456
4458
  console.log("Toggle changed:", r.key, d);
4457
- const g = { ...o, [r.key]: d };
4458
- u(g), s && s(l.key, g);
4459
+ const p = { ...o, [r.key]: d };
4460
+ u(p), s && s(l.key, p);
4459
4461
  },
4460
4462
  disabled: r.disabled ? r.disabled : !1
4461
4463
  }
@@ -4468,8 +4470,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4468
4470
  label: r.label,
4469
4471
  value: o[r.key] ? new Date(o[r.key]) : null,
4470
4472
  onChange: (d) => {
4471
- const g = { ...o, [r.key]: d ? d.toISOString().split("T")[0] : "" };
4472
- u(g), s && s(l.key, g);
4473
+ const p = { ...o, [r.key]: d ? d.toISOString().split("T")[0] : "" };
4474
+ u(p), s && s(l.key, p);
4473
4475
  },
4474
4476
  placeholder: r.placeholder || "Select date",
4475
4477
  disabled: r.disabled ? r.disabled : !1,
@@ -4483,8 +4485,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4483
4485
  label: r.label,
4484
4486
  value: o[r.key] || { from: null, to: null },
4485
4487
  onChange: (d) => {
4486
- const g = { ...o, [r.key]: d };
4487
- u(g), s && s(l.key, g);
4488
+ const p = { ...o, [r.key]: d };
4489
+ u(p), s && s(l.key, p);
4488
4490
  },
4489
4491
  placeholder: r.placeholder || "Select date range",
4490
4492
  disabled: r.disabled ? r.disabled : !1,
@@ -4498,8 +4500,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4498
4500
  {
4499
4501
  selectedValue: typeof o[r.key] < "u" ? o[r.key] : r.default || "",
4500
4502
  onValueChange: (d) => {
4501
- const g = { ...o, [r.key]: d };
4502
- u(g), s && s(l.key, g);
4503
+ const p = { ...o, [r.key]: d };
4504
+ u(p), s && s(l.key, p);
4503
4505
  },
4504
4506
  options: r.options || [],
4505
4507
  disabled: r.disabled ? r.disabled : !1,
@@ -4518,9 +4520,9 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4518
4520
  name: r.key,
4519
4521
  value: d.value,
4520
4522
  checked: o[r.key] === d.value,
4521
- onChange: (g) => {
4522
- const S = { ...o, [r.key]: g.target.value };
4523
- u(S), s && s(l.key, S);
4523
+ onChange: (p) => {
4524
+ const z = { ...o, [r.key]: p.target.value };
4525
+ u(z), s && s(l.key, z);
4524
4526
  },
4525
4527
  disabled: r.disabled
4526
4528
  }
@@ -4538,8 +4540,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4538
4540
  {
4539
4541
  value: o[r.key] || "",
4540
4542
  onChange: (d) => {
4541
- const g = { ...o, [r.key]: d };
4542
- u(g), s && s(l.key, g);
4543
+ const p = { ...o, [r.key]: d };
4544
+ u(p), s && s(l.key, p);
4543
4545
  },
4544
4546
  placeholder: r.placeholder || `Search ${r.label}`,
4545
4547
  className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
@@ -4557,8 +4559,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4557
4559
  placeholder: r.placeholder || "Select date and time",
4558
4560
  value: o[r.key] || "",
4559
4561
  onChange: (d) => {
4560
- const g = { ...o, [r.key]: d.target.value };
4561
- u(g), s && s(l.key, g);
4562
+ const p = { ...o, [r.key]: d.target.value };
4563
+ u(p), s && s(l.key, p);
4562
4564
  },
4563
4565
  required: r.required,
4564
4566
  className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
@@ -4576,8 +4578,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4576
4578
  placeholder: r.placeholder || "Select time",
4577
4579
  value: o[r.key] || "",
4578
4580
  onChange: (d) => {
4579
- const g = { ...o, [r.key]: d.target.value };
4580
- u(g), s && s(l.key, g);
4581
+ const p = { ...o, [r.key]: d.target.value };
4582
+ u(p), s && s(l.key, p);
4581
4583
  },
4582
4584
  required: r.required,
4583
4585
  className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
@@ -4594,8 +4596,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4594
4596
  defaultValue: r.default || "#000000",
4595
4597
  value: o[r.key] || "#000000",
4596
4598
  onChange: (d) => {
4597
- const g = { ...o, [r.key]: d.target.value };
4598
- u(g), s && s(l.key, g);
4599
+ const p = { ...o, [r.key]: d.target.value };
4600
+ u(p), s && s(l.key, p);
4599
4601
  },
4600
4602
  className: `w-full h-10 ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
4601
4603
  }
@@ -4611,8 +4613,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4611
4613
  defaultValue: r.default || r.min || 0,
4612
4614
  value: o[r.key] || r.min || 0,
4613
4615
  onChange: (d) => {
4614
- const g = { ...o, [r.key]: d.target.value };
4615
- u(g), s && s(l.key, g);
4616
+ const p = { ...o, [r.key]: d.target.value };
4617
+ u(p), s && s(l.key, p);
4616
4618
  },
4617
4619
  min: r.min || 0,
4618
4620
  max: r.max || 100,
@@ -4637,8 +4639,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4637
4639
  type: "file",
4638
4640
  name: r.key,
4639
4641
  onChange: (d) => {
4640
- const g = d.target.files[0], S = { ...o, [r.key]: g ? g.name : "" };
4641
- u(S), s && s(l.key, S);
4642
+ const p = d.target.files[0], z = { ...o, [r.key]: p ? p.name : "" };
4643
+ u(z), s && s(l.key, z);
4642
4644
  },
4643
4645
  accept: r.accept,
4644
4646
  className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
@@ -4654,8 +4656,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4654
4656
  initialData: o[r.key] || r.initialData || [],
4655
4657
  className: r.className || "",
4656
4658
  onCollectionChange: (d) => {
4657
- const g = { ...o, [r.key]: d };
4658
- u(g), s && s(l.key, g);
4659
+ const p = { ...o, [r.key]: d };
4660
+ u(p), s && s(l.key, p);
4659
4661
  },
4660
4662
  showSearch: r.showSearch !== !1,
4661
4663
  allowAdd: r.allowAdd !== !1,
@@ -4686,32 +4688,32 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4686
4688
  const [l, m] = B(t), [o, u] = B(null), [h, N] = B(null);
4687
4689
  console.log(`[DataTableRenderer] ${l.key} - Received props:`, { item: t, initialData: a });
4688
4690
  const [y, r] = B(() => {
4689
- const x = a && a[l.key] || [], f = x.length > 0 ? x : [{ id: 0 }];
4690
- return console.log(`[DataTableRenderer] ${l.key} - Initial data:`, f), f;
4691
+ const x = a && a[l.key] || [], b = x.length > 0 ? x : [{ id: 0 }];
4692
+ return console.log(`[DataTableRenderer] ${l.key} - Initial data:`, b), b;
4691
4693
  }), v = fe(a);
4692
- te(() => {
4694
+ Z(() => {
4693
4695
  if (console.log(`[DataTableRenderer] ${l.key} - Checking for initialData changes`), console.log(`[DataTableRenderer] ${l.key} - Previous:`, v.current), console.log(`[DataTableRenderer] ${l.key} - Current:`, a), v.current !== a) {
4694
4696
  v.current = a;
4695
- const x = a && a[l.key] || [], f = x.length > 0 ? x : [{ id: 0 }];
4696
- console.log(`[DataTableRenderer] ${l.key} - Setting new data:`, f), r(f);
4697
+ const x = a && a[l.key] || [], b = x.length > 0 ? x : [{ id: 0 }];
4698
+ console.log(`[DataTableRenderer] ${l.key} - Setting new data:`, b), r(b);
4697
4699
  }
4698
4700
  }, [a, l.key]);
4699
- const d = fe(y), g = fe(null);
4700
- te(() => {
4701
- d.current !== y && s && typeof s == "function" && (d.current = y, g.current && clearTimeout(g.current), g.current = setTimeout(() => {
4701
+ const d = fe(y), p = fe(null);
4702
+ Z(() => {
4703
+ d.current !== y && s && typeof s == "function" && (d.current = y, p.current && clearTimeout(p.current), p.current = setTimeout(() => {
4702
4704
  s(l.key, y);
4703
4705
  }, 300));
4704
- }, [l.key, y, s]), te(() => () => {
4705
- g.current && clearTimeout(g.current);
4706
+ }, [l.key, y, s]), Z(() => () => {
4707
+ p.current && clearTimeout(p.current);
4706
4708
  }, []);
4707
- const S = (x) => {
4708
- const f = (I, D) => {
4709
- console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: I, value: D, type: typeof D }), r((b) => {
4710
- const p = [...b];
4711
- return p[I][x.key] = D, p;
4709
+ const z = (x) => {
4710
+ const b = (I, D) => {
4711
+ console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: I, value: D, type: typeof D }), r((f) => {
4712
+ const g = [...f];
4713
+ return g[I][x.key] = D, g;
4712
4714
  });
4713
- }, z = (I) => i[l.key]?.[I]?.[x.key], O = (I) => {
4714
- const D = z(I);
4715
+ }, S = (I) => i[l.key]?.[I]?.[x.key], O = (I) => {
4716
+ const D = S(I);
4715
4717
  return D ? /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-1", children: D }) : null;
4716
4718
  };
4717
4719
  switch (x.fieldtype) {
@@ -4721,10 +4723,10 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4721
4723
  X,
4722
4724
  {
4723
4725
  value: I[x.key] || "",
4724
- onChange: (b) => f(D, b.target.value),
4726
+ onChange: (f) => b(D, f.target.value),
4725
4727
  placeholder: x.placeholder || `Enter ${x.label}`,
4726
4728
  required: x.required,
4727
- className: `w-full ${z(D) ? "border-red-500" : ""}`
4729
+ className: `w-full ${S(D) ? "border-red-500" : ""}`
4728
4730
  }
4729
4731
  ),
4730
4732
  O(D)
@@ -4735,10 +4737,10 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4735
4737
  fa,
4736
4738
  {
4737
4739
  value: I[x.key] || "",
4738
- onChange: (b) => f(D, b.target.value),
4740
+ onChange: (f) => b(D, f.target.value),
4739
4741
  placeholder: x.placeholder || `Enter ${x.label}`,
4740
4742
  required: x.required,
4741
- className: `w-full ${z(D) ? "border-red-500" : ""}`,
4743
+ className: `w-full ${S(D) ? "border-red-500" : ""}`,
4742
4744
  rows: 3
4743
4745
  }
4744
4746
  ),
@@ -4754,17 +4756,17 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4754
4756
  min: x.min,
4755
4757
  max: x.max,
4756
4758
  step: x.step,
4757
- onChange: (b) => f(D, b.target.value),
4758
- onBlur: (b) => {
4759
- const p = b.target.value;
4760
- if (p !== "" && p !== null && p !== void 0) {
4761
- const w = Number(p);
4762
- isNaN(w) || (x.min !== void 0 && w < x.min ? (b.target.setCustomValidity(`${x.label} must be at least ${x.min}`), b.target.reportValidity()) : x.max !== void 0 && w > x.max ? (b.target.setCustomValidity(`${x.label} must not exceed ${x.max}`), b.target.reportValidity()) : b.target.setCustomValidity(""));
4759
+ onChange: (f) => b(D, f.target.value),
4760
+ onBlur: (f) => {
4761
+ const g = f.target.value;
4762
+ if (g !== "" && g !== null && g !== void 0) {
4763
+ const k = Number(g);
4764
+ isNaN(k) || (x.min !== void 0 && k < x.min ? (f.target.setCustomValidity(`${x.label} must be at least ${x.min}`), f.target.reportValidity()) : x.max !== void 0 && k > x.max ? (f.target.setCustomValidity(`${x.label} must not exceed ${x.max}`), f.target.reportValidity()) : f.target.setCustomValidity(""));
4763
4765
  }
4764
4766
  },
4765
4767
  placeholder: x.placeholder || `Enter ${x.label}`,
4766
4768
  required: x.required,
4767
- className: `w-full ${z(D) ? "border-red-500" : ""}`
4769
+ className: `w-full ${S(D) ? "border-red-500" : ""}`
4768
4770
  }
4769
4771
  ),
4770
4772
  x.min !== void 0 && /* @__PURE__ */ n("div", { style: { color: "#6b7280", fontSize: "11px", marginTop: "2px" }, children: [
@@ -4784,10 +4786,10 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4784
4786
  {
4785
4787
  type: "email",
4786
4788
  value: I[x.key] || "",
4787
- onChange: (b) => f(D, b.target.value),
4789
+ onChange: (f) => b(D, f.target.value),
4788
4790
  placeholder: x.placeholder || "Enter email address",
4789
4791
  required: x.required,
4790
- className: `w-full ${z(D) ? "border-red-500" : ""}`
4792
+ className: `w-full ${S(D) ? "border-red-500" : ""}`
4791
4793
  }
4792
4794
  ),
4793
4795
  O(D)
@@ -4799,10 +4801,10 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4799
4801
  {
4800
4802
  type: "url",
4801
4803
  value: I[x.key] || "",
4802
- onChange: (b) => f(D, b.target.value),
4804
+ onChange: (f) => b(D, f.target.value),
4803
4805
  placeholder: x.placeholder || "Enter URL",
4804
4806
  required: x.required,
4805
- className: `w-full ${z(D) ? "border-red-500" : ""}`
4807
+ className: `w-full ${S(D) ? "border-red-500" : ""}`
4806
4808
  }
4807
4809
  ),
4808
4810
  O(D)
@@ -4814,10 +4816,10 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4814
4816
  {
4815
4817
  type: "password",
4816
4818
  value: I[x.key] || "",
4817
- onChange: (b) => f(D, b.target.value),
4819
+ onChange: (f) => b(D, f.target.value),
4818
4820
  placeholder: x.placeholder || "Enter password",
4819
4821
  required: x.required,
4820
- className: `w-full ${z(D) ? "border-red-500" : ""}`
4822
+ className: `w-full ${S(D) ? "border-red-500" : ""}`
4821
4823
  }
4822
4824
  ),
4823
4825
  O(D)
@@ -4829,25 +4831,25 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4829
4831
  ft,
4830
4832
  {
4831
4833
  value: I[x.key] || "",
4832
- onChange: (b) => f(D, b),
4834
+ onChange: (f) => b(D, f),
4833
4835
  options: x.options || [],
4834
4836
  placeholder: x.placeholder || `Select ${x.label}`,
4835
4837
  required: x.required,
4836
- className: `w-full ${z(D) ? "border-red-500" : ""}`
4838
+ className: `w-full ${S(D) ? "border-red-500" : ""}`
4837
4839
  }
4838
4840
  ),
4839
4841
  O(D)
4840
4842
  ] });
4841
4843
  case "selectDynamic":
4842
4844
  return (I, D) => {
4843
- const b = () => {
4845
+ const f = () => {
4844
4846
  if (x.optionsFrom && a) {
4845
- const { config: p, valueField: w, labelField: k } = x.optionsFrom, T = a[p] || [];
4847
+ const { config: g, valueField: k, labelField: w } = x.optionsFrom, T = a[g] || [];
4846
4848
  if (Array.isArray(T))
4847
4849
  return T.map((L) => ({
4848
- id: L[w] || "",
4849
- value: L[w] || "",
4850
- label: L[k] || ""
4850
+ id: L[k] || "",
4851
+ value: L[k] || "",
4852
+ label: L[w] || ""
4851
4853
  }));
4852
4854
  }
4853
4855
  return x.options || [];
@@ -4858,11 +4860,11 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4858
4860
  {
4859
4861
  index: D,
4860
4862
  value: I[x.key] || "",
4861
- onChange: (p) => f(D, p),
4862
- options: b(),
4863
+ onChange: (g) => b(D, g),
4864
+ options: f(),
4863
4865
  placeholder: x.placeholder || `Select ${x.label}`,
4864
4866
  required: x.required,
4865
- className: `w-full ${z(D) ? "border-red-500" : ""}`
4867
+ className: `w-full ${S(D) ? "border-red-500" : ""}`
4866
4868
  },
4867
4869
  Math.random()
4868
4870
  ),
@@ -4871,12 +4873,12 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4871
4873
  };
4872
4874
  case "multiselect":
4873
4875
  return (I, D) => {
4874
- const b = I[x.key] || [];
4876
+ const f = I[x.key] || [];
4875
4877
  return /* @__PURE__ */ e(
4876
4878
  at,
4877
4879
  {
4878
- selectedItems: b,
4879
- onSelectionChange: (p) => f(D, p),
4880
+ selectedItems: f,
4881
+ onSelectionChange: (g) => b(D, g),
4880
4882
  options: x.options || [],
4881
4883
  placeholder: x.placeholder || `Select ${x.label}`,
4882
4884
  className: "w-full"
@@ -4889,7 +4891,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4889
4891
  pt,
4890
4892
  {
4891
4893
  checked: !!I[x.key],
4892
- onChange: (b) => f(D, b),
4894
+ onChange: (f) => b(D, f),
4893
4895
  label: x.placeholder || x.label,
4894
4896
  className: "w-full"
4895
4897
  }
@@ -4900,7 +4902,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4900
4902
  ya,
4901
4903
  {
4902
4904
  isOn: !!I[x.key],
4903
- onToggle: (b) => f(D, b),
4905
+ onToggle: (f) => b(D, f),
4904
4906
  label: x.placeholder || x.label,
4905
4907
  className: "w-full"
4906
4908
  }
@@ -4910,7 +4912,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4910
4912
  ha,
4911
4913
  {
4912
4914
  selectedDate: I[x.key] ? new Date(I[x.key]) : null,
4913
- onDateChange: (b) => f(D, b ? b.toISOString().split("T")[0] : ""),
4915
+ onDateChange: (f) => b(D, f ? f.toISOString().split("T")[0] : ""),
4914
4916
  placeholder: x.placeholder || "Select date",
4915
4917
  className: "w-full"
4916
4918
  }
@@ -4921,7 +4923,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4921
4923
  {
4922
4924
  type: "datetime-local",
4923
4925
  value: I[x.key] || "",
4924
- onChange: (b) => f(D, b.target.value),
4926
+ onChange: (f) => b(D, f.target.value),
4925
4927
  placeholder: x.placeholder || "Select date and time",
4926
4928
  required: x.required,
4927
4929
  className: "w-full"
@@ -4933,7 +4935,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4933
4935
  {
4934
4936
  type: "time",
4935
4937
  value: I[x.key] || "",
4936
- onChange: (b) => f(D, b.target.value),
4938
+ onChange: (f) => b(D, f.target.value),
4937
4939
  placeholder: x.placeholder || "Select time",
4938
4940
  required: x.required,
4939
4941
  className: "w-full"
@@ -4944,7 +4946,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4944
4946
  pa,
4945
4947
  {
4946
4948
  selectedValue: I[x.key] || "",
4947
- onValueChange: (b) => f(D, b),
4949
+ onValueChange: (f) => b(D, f),
4948
4950
  options: x.options || [],
4949
4951
  className: "w-full"
4950
4952
  }
@@ -4954,27 +4956,27 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4954
4956
  ge,
4955
4957
  {
4956
4958
  value: I[x.key] || "",
4957
- onChange: (b) => f(D, b),
4959
+ onChange: (f) => b(D, f),
4958
4960
  placeholder: x.placeholder || `Search ${x.label}`,
4959
4961
  className: "w-full"
4960
4962
  }
4961
4963
  );
4962
4964
  case "audience":
4963
4965
  return (I, D) => {
4964
- const b = I[x.key] || { users: [], groups: [], roles: [] }, p = [
4965
- ...b.users || [],
4966
- ...b.groups || [],
4967
- ...b.roles || []
4966
+ const f = I[x.key] || { users: [], groups: [], roles: [] }, g = [
4967
+ ...f.users || [],
4968
+ ...f.groups || [],
4969
+ ...f.roles || []
4968
4970
  ];
4969
4971
  return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
4970
- /* @__PURE__ */ e(Ns, { children: p.length > 0 ? p.slice(0, 3).map((w, k) => /* @__PURE__ */ e(
4972
+ /* @__PURE__ */ e(Ns, { children: g.length > 0 ? g.slice(0, 3).map((k, w) => /* @__PURE__ */ e(
4971
4973
  we,
4972
4974
  {
4973
4975
  size: "small",
4974
- name: w.name || w.displayName || w.id,
4975
- src: w.avatarUrl
4976
+ name: k.name || k.displayName || k.id,
4977
+ src: k.avatarUrl
4976
4978
  },
4977
- k
4979
+ w
4978
4980
  )) : null }),
4979
4981
  /* @__PURE__ */ e(
4980
4982
  "button",
@@ -4983,7 +4985,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4983
4985
  onClick: () => {
4984
4986
  N(x.key), u(D);
4985
4987
  },
4986
- children: p.length > 0 ? "Edit" : "Assign"
4988
+ children: g.length > 0 ? "Edit" : "Assign"
4987
4989
  }
4988
4990
  )
4989
4991
  ] });
@@ -4994,7 +4996,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4994
4996
  {
4995
4997
  type: "color",
4996
4998
  value: I[x.key] || "#000000",
4997
- onChange: (b) => f(D, b.target.value),
4999
+ onChange: (f) => b(D, f.target.value),
4998
5000
  className: "w-full h-10"
4999
5001
  }
5000
5002
  );
@@ -5005,7 +5007,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
5005
5007
  {
5006
5008
  type: "range",
5007
5009
  value: I[x.key] || x.min || 0,
5008
- onChange: (b) => f(D, b.target.value),
5010
+ onChange: (f) => b(D, f.target.value),
5009
5011
  min: x.min || 0,
5010
5012
  max: x.max || 100,
5011
5013
  step: x.step || 1,
@@ -5019,9 +5021,9 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
5019
5021
  X,
5020
5022
  {
5021
5023
  type: "file",
5022
- onChange: (b) => {
5023
- const p = b.target.files[0];
5024
- f(D, p ? p.name : "");
5024
+ onChange: (f) => {
5025
+ const g = f.target.files[0];
5026
+ b(D, g ? g.name : "");
5025
5027
  },
5026
5028
  accept: x.accept,
5027
5029
  className: "w-full"
@@ -5033,7 +5035,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
5033
5035
  {
5034
5036
  type: "hidden",
5035
5037
  value: I[x.key] || "",
5036
- onChange: (b) => f(D, b.target.value)
5038
+ onChange: (f) => b(D, f.target.value)
5037
5039
  }
5038
5040
  );
5039
5041
  // Default fallback for unknown field types
@@ -5043,59 +5045,72 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
5043
5045
  X,
5044
5046
  {
5045
5047
  value: I[x.key] || "",
5046
- onChange: (b) => f(D, b.target.value),
5048
+ onChange: (f) => b(D, f.target.value),
5047
5049
  placeholder: x.placeholder || `Enter ${x.label}`,
5048
5050
  required: x.required,
5049
- className: `w-full ${z(D) ? "border-red-500" : ""}`
5051
+ className: `w-full ${S(D) ? "border-red-500" : ""}`
5050
5052
  }
5051
5053
  ),
5052
5054
  O(D)
5053
5055
  ] });
5054
5056
  }
5055
- }, F = K(() => {
5057
+ }, F = ee(() => {
5056
5058
  console.log("[DataTableRenderer] Adding blank row"), r((x) => {
5057
5059
  console.log("[DataTableRenderer] Current data before add:", x);
5058
- const f = {
5060
+ const b = {
5059
5061
  id: x.length
5060
5062
  // Assign next available ID
5061
5063
  };
5062
5064
  l.fields.forEach((O) => {
5063
- O.fieldtype === "audience" ? f[O.key] = { users: [], groups: [], roles: [] } : f[O.key] = O.default || "";
5064
- }), console.log("[DataTableRenderer] New blank row:", f);
5065
- const z = [...x, f];
5066
- return console.log("[DataTableRenderer] Updated data:", z), z;
5065
+ O.fieldtype === "audience" ? b[O.key] = { users: [], groups: [], roles: [] } : b[O.key] = O.default || "";
5066
+ }), console.log("[DataTableRenderer] New blank row:", b);
5067
+ const S = [...x, b];
5068
+ return console.log("[DataTableRenderer] Updated data:", S), S;
5067
5069
  });
5068
- }, [l.fields]), E = K((x) => {
5069
- r((f) => {
5070
- if (f.length <= 1)
5071
- return f;
5072
- const z = [...f];
5073
- return z.splice(x, 1), z;
5070
+ }, [l.fields]), E = ee((x) => {
5071
+ r((b) => {
5072
+ if (b.length <= 1)
5073
+ return b;
5074
+ const S = [...b];
5075
+ return S.splice(x, 1), S;
5074
5076
  });
5075
- }, []), [R, P] = B(null), j = K((x, f) => {
5076
- P(f), x.dataTransfer.effectAllowed = "move", x.dataTransfer.setData("text/html", "");
5077
- }, []), U = K((x) => {
5077
+ }, []), [R, P] = B(null), j = ee((x, b) => {
5078
+ P(b), x.dataTransfer.effectAllowed = "move", x.dataTransfer.setData("text/html", "");
5079
+ }, []), U = ee((x) => {
5078
5080
  x.preventDefault(), x.dataTransfer.dropEffect = "move";
5079
- }, []), Y = K((x, f) => {
5080
- x.preventDefault(), !(R === null || R === f) && (r((z) => {
5081
- const O = [...z], I = O[R];
5082
- return O.splice(R, 1), O.splice(f, 0, I), O;
5081
+ }, []), Y = ee((x, b) => {
5082
+ x.preventDefault(), !(R === null || R === b) && (r((S) => {
5083
+ const O = [...S], I = O[R];
5084
+ return O.splice(R, 1), O.splice(b, 0, I), O;
5083
5085
  }), P(null));
5084
- }, [R]), q = K(() => {
5086
+ }, [R]), q = ee(() => {
5085
5087
  P(null);
5086
- }, []), $ = K((x) => {
5087
- console.log("[DataTableRenderer] handleAddAudience called with:", x), r((f) => {
5088
- const z = [...f];
5089
- if (o !== null && h && z[o]) {
5090
- const O = x.pendingInvites || [], I = O.filter((p) => p.type === "User"), D = O.filter((p) => p.type === "Group"), b = O.filter((p) => p.type === "Role");
5091
- z[o][h] = {
5092
- users: [...z[o][h]?.users || [], ...I],
5093
- groups: [...z[o][h]?.groups || [], ...D],
5094
- roles: [...z[o][h]?.roles || [], ...b]
5095
- }, console.log("[DataTableRenderer] Updated audience data:", z[o][h]);
5088
+ }, []), $ = ee((x, b) => {
5089
+ console.log("[DataTableRenderer] handleAddAudience called with:", { selectedEntities: x, existingShares: b });
5090
+ const S = x.pendingInvites || [], O = !b || !b.users?.length && !b.groups?.length && !b.roles?.length;
5091
+ if (S.length === 0 && O) {
5092
+ console.log("[DataTableRenderer] Ignoring empty initial call from InviteFlow useEffect");
5093
+ return;
5094
+ }
5095
+ r((I) => {
5096
+ const D = [...I];
5097
+ if (o !== null && h && D[o]) {
5098
+ if (S.length > 0) {
5099
+ const f = S.filter((w) => w.type === "User"), g = S.filter((w) => w.type === "Group"), k = S.filter((w) => w.type === "Role");
5100
+ D[o][h] = {
5101
+ users: [...D[o][h]?.users || [], ...f],
5102
+ groups: [...D[o][h]?.groups || [], ...g],
5103
+ roles: [...D[o][h]?.roles || [], ...k]
5104
+ };
5105
+ } else b && !O && (D[o][h] = {
5106
+ users: b.users || [],
5107
+ groups: b.groups || [],
5108
+ roles: b.roles || []
5109
+ });
5110
+ console.log("[DataTableRenderer] Updated audience data:", D[o][h]);
5096
5111
  }
5097
- return z;
5098
- }), u(null), N(null);
5112
+ return D;
5113
+ }), console.log("[DataTableRenderer] Closing modal after update"), u(null), N(null);
5099
5114
  }, [o, h]);
5100
5115
  return /* @__PURE__ */ n("div", { children: [
5101
5116
  /* @__PURE__ */ n("div", { style: { marginBottom: "20px" }, children: [
@@ -5115,32 +5130,32 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
5115
5130
  /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ n("table", { className: "min-w-full bg-white border border-gray-300", style: { marginBottom: "20px" }, children: [
5116
5131
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "bg-gray-50", children: [
5117
5132
  /* @__PURE__ */ e("th", { className: "px-4 py-2 w-10" }),
5118
- l.fields.map((x, f) => /* @__PURE__ */ e(
5133
+ l.fields.map((x, b) => /* @__PURE__ */ e(
5119
5134
  "th",
5120
5135
  {
5121
5136
  className: "px-4 py-2 text-left text-sm font-medium text-gray-700",
5122
5137
  children: x.label || x.key
5123
5138
  },
5124
- f
5139
+ b
5125
5140
  )),
5126
5141
  /* @__PURE__ */ e("th", { className: "px-4 py-2 w-16" })
5127
5142
  ] }) }),
5128
- /* @__PURE__ */ e("tbody", { children: y.map((x, f) => /* @__PURE__ */ n(
5143
+ /* @__PURE__ */ e("tbody", { children: y.map((x, b) => /* @__PURE__ */ n(
5129
5144
  "tr",
5130
5145
  {
5131
- className: `hover:bg-gray-50 ${R === f ? "opacity-50" : ""}`,
5146
+ className: `hover:bg-gray-50 ${R === b ? "opacity-50" : ""}`,
5132
5147
  draggable: !0,
5133
- onDragStart: (z) => j(z, f),
5148
+ onDragStart: (S) => j(S, b),
5134
5149
  onDragOver: U,
5135
- onDrop: (z) => Y(z, f),
5150
+ onDrop: (S) => Y(S, b),
5136
5151
  onDragEnd: q,
5137
5152
  children: [
5138
5153
  /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e("div", { className: "cursor-move text-gray-400 hover:text-gray-600", children: /* @__PURE__ */ e(wt, { size: 16 }) }) }),
5139
- l.fields.map((z, O) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: S(z)(x, f) }, O)),
5154
+ l.fields.map((S, O) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: z(S)(x, b) }, O)),
5140
5155
  /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
5141
5156
  "button",
5142
5157
  {
5143
- onClick: () => E(f),
5158
+ onClick: () => E(b),
5144
5159
  className: "text-red-500 hover:text-red-700",
5145
5160
  title: "Delete row",
5146
5161
  children: /* @__PURE__ */ e(yr, { size: 16 })
@@ -5148,7 +5163,7 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
5148
5163
  ) })
5149
5164
  ]
5150
5165
  },
5151
- f
5166
+ b
5152
5167
  )) })
5153
5168
  ] }) }),
5154
5169
  o !== null && (() => {
@@ -5194,32 +5209,32 @@ function Ss({
5194
5209
  onShowCancelModal: l,
5195
5210
  onCancel: m
5196
5211
  }) {
5197
- const [o, u] = re.useState(a), [h, N] = re.useState(null), [y, r] = re.useState(null), [v, d] = B(!1), [g, S] = B(!1), [F, E] = B({}), R = `${$e()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, P = R, [j, U] = B(1), Y = () => {
5212
+ const [o, u] = re.useState(a), [h, N] = re.useState(null), [y, r] = re.useState(null), [v, d] = B(!1), [p, z] = B(!1), [F, E] = B({}), R = `${$e()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, P = R, [j, U] = B(1), Y = () => {
5198
5213
  if (!y || !h)
5199
5214
  return console.log("[DynamicConfig] hasUnsavedChanges: false (no data)", { originalData: y, data: h }), !1;
5200
- const b = (T) => {
5215
+ const f = (T) => {
5201
5216
  if (T == null || typeof T != "object") return T;
5202
- if (Array.isArray(T)) return T.map(b);
5217
+ if (Array.isArray(T)) return T.map(f);
5203
5218
  const L = {};
5204
5219
  return Object.keys(T).sort().forEach((C) => {
5205
- L[C] = b(T[C]);
5220
+ L[C] = f(T[C]);
5206
5221
  }), L;
5207
- }, p = b(y), w = b(h), k = JSON.stringify(p) !== JSON.stringify(w);
5208
- return console.log("[DynamicConfig] hasUnsavedChanges:", k, {
5209
- originalData: p,
5210
- currentData: w,
5222
+ }, g = f(y), k = f(h), w = JSON.stringify(g) !== JSON.stringify(k);
5223
+ return console.log("[DynamicConfig] hasUnsavedChanges:", w, {
5224
+ originalData: g,
5225
+ currentData: k,
5211
5226
  originalRaw: y,
5212
5227
  currentRaw: h
5213
- }), k;
5214
- }, q = (b) => {
5228
+ }), w;
5229
+ }, q = (f) => {
5215
5230
  if (!a || !a.configuration)
5216
- return b;
5217
- const p = {}, w = b?.configuration || {};
5218
- return a.configuration.forEach((k) => {
5219
- if (k.key && k.type === "datatable") {
5220
- const L = (w[k.key] || []).map((C, M) => {
5231
+ return f;
5232
+ const g = {}, k = f?.configuration || {};
5233
+ return a.configuration.forEach((w) => {
5234
+ if (w.key && w.type === "datatable") {
5235
+ const L = (k[w.key] || []).map((C, M) => {
5221
5236
  const _ = { id: C.id || 0 };
5222
- return k.fields && k.fields.forEach((A) => {
5237
+ return w.fields && w.fields.forEach((A) => {
5223
5238
  if (A.fieldtype === "audience") {
5224
5239
  let G = { users: [], groups: [], roles: [] };
5225
5240
  C[A.key] && (Array.isArray(C[A.key]) ? G = { users: [], groups: [], roles: [] } : typeof C[A.key] == "object" && (G = {
@@ -5232,136 +5247,136 @@ function Ss({
5232
5247
  });
5233
5248
  if (L.length === 0) {
5234
5249
  const C = { id: 0 };
5235
- k.fields && k.fields.forEach((M) => {
5250
+ w.fields && w.fields.forEach((M) => {
5236
5251
  M.fieldtype === "audience" ? C[M.key] = { users: [], groups: [], roles: [] } : C[M.key] = M.default || "";
5237
5252
  }), L.push(C);
5238
5253
  }
5239
- p[k.key] = L;
5240
- } else if (k.key) {
5241
- const T = w[k.key] || {};
5242
- k.type === "section" && k.fields && k.fields.forEach((L) => {
5254
+ g[w.key] = L;
5255
+ } else if (w.key) {
5256
+ const T = k[w.key] || {};
5257
+ w.type === "section" && w.fields && w.fields.forEach((L) => {
5243
5258
  L.fieldtype === "managecollectionlist" && L.key && (!T[L.key] || !Array.isArray(T[L.key])) && (T[L.key] = L.initialData || []);
5244
- }), p[k.key] = T;
5259
+ }), g[w.key] = T;
5245
5260
  }
5246
- }), p;
5261
+ }), g;
5247
5262
  }, $ = () => {
5248
5263
  if (a && a.configuration) {
5249
- const b = {};
5250
- a.configuration.forEach((p) => {
5251
- if (p.key)
5252
- if (p.type === "datatable") {
5253
- const w = { id: 0 };
5254
- p.fields && p.fields.forEach((k) => {
5255
- k.fieldtype === "audience" ? w[k.key] = { users: [], groups: [], roles: [] } : (k.fieldtype, w[k.key] = k.default || "");
5256
- }), b[p.key] = [w];
5257
- } else if (p.type === "section") {
5258
- const w = {};
5259
- p.fields && Array.isArray(p.fields) && p.fields.forEach((k) => {
5260
- k.key && (k.fieldtype === "managecollectionlist" ? w[k.key] = k.initialData || [] : w[k.key] = k.default || "");
5261
- }), b[p.key] = w;
5264
+ const f = {};
5265
+ a.configuration.forEach((g) => {
5266
+ if (g.key)
5267
+ if (g.type === "datatable") {
5268
+ const k = { id: 0 };
5269
+ g.fields && g.fields.forEach((w) => {
5270
+ w.fieldtype === "audience" ? k[w.key] = { users: [], groups: [], roles: [] } : (w.fieldtype, k[w.key] = w.default || "");
5271
+ }), f[g.key] = [k];
5272
+ } else if (g.type === "section") {
5273
+ const k = {};
5274
+ g.fields && Array.isArray(g.fields) && g.fields.forEach((w) => {
5275
+ w.key && (w.fieldtype === "managecollectionlist" ? k[w.key] = w.initialData || [] : k[w.key] = w.default || "");
5276
+ }), f[g.key] = k;
5262
5277
  } else
5263
- b[p.key] = {};
5264
- }), N(b), r(b);
5278
+ f[g.key] = {};
5279
+ }), N(f), r(f);
5265
5280
  }
5266
5281
  };
5267
- te(() => {
5282
+ Z(() => {
5268
5283
  if (s) {
5269
5284
  d(!1);
5270
5285
  return;
5271
5286
  }
5272
- const b = async () => {
5287
+ const f = async () => {
5273
5288
  try {
5274
5289
  d(!0);
5275
- let p = await Ze(R);
5276
- if (p) {
5277
- const w = q(p);
5278
- N(w), r(w);
5290
+ let g = await Ze(R);
5291
+ if (g) {
5292
+ const k = q(g);
5293
+ N(k), r(k);
5279
5294
  } else
5280
5295
  $();
5281
- } catch (p) {
5282
- console.error("Error fetching configuration:", p);
5283
- let w = "Failed to load configuration";
5284
- if (p.response) {
5285
- const k = p.response.status, T = p.response.data?.message || p.response.data?.error;
5286
- k === 400 ? w = T || "Invalid request. Please check the application ID." : k === 401 ? w = "You are not authorized to access this configuration." : k === 403 ? w = "Access denied. You don't have permission to view this configuration." : k === 404 ? w = "Configuration not found. It may not exist yet or the application ID is incorrect." : k >= 500 ? w = T || "Server error. Please try again later." : w = T || `Failed to load configuration (Error ${k})`;
5287
- } else p.request ? w = "Network error. Please check your connection and try again." : w = p.message || "An unexpected error occurred while loading configuration.";
5288
- qe.error(w), $();
5296
+ } catch (g) {
5297
+ console.error("Error fetching configuration:", g);
5298
+ let k = "Failed to load configuration";
5299
+ if (g.response) {
5300
+ const w = g.response.status, T = g.response.data?.message || g.response.data?.error;
5301
+ w === 400 ? k = T || "Invalid request. Please check the application ID." : w === 401 ? k = "You are not authorized to access this configuration." : w === 403 ? k = "Access denied. You don't have permission to view this configuration." : w === 404 ? k = "Configuration not found. It may not exist yet or the application ID is incorrect." : w >= 500 ? k = T || "Server error. Please try again later." : k = T || `Failed to load configuration (Error ${w})`;
5302
+ } else g.request ? k = "Network error. Please check your connection and try again." : k = g.message || "An unexpected error occurred while loading configuration.";
5303
+ qe.error(k), $();
5289
5304
  } finally {
5290
5305
  d(!1);
5291
5306
  }
5292
5307
  };
5293
- a && (u(a), t ? b() : $());
5308
+ a && (u(a), t ? f() : $());
5294
5309
  }, [a, j, t, s]);
5295
- const x = (b, p) => {
5296
- console.log(`[DynamicConfig] handleSectionChange called for ${b}:`, p), N((w) => {
5297
- const k = {
5298
- ...w,
5299
- [b]: p
5310
+ const x = (f, g) => {
5311
+ console.log(`[DynamicConfig] handleSectionChange called for ${f}:`, g), N((k) => {
5312
+ const w = {
5313
+ ...k,
5314
+ [f]: g
5300
5315
  };
5301
- return console.log("[DynamicConfig] Updated data state:", k), k;
5302
- }), E((w) => {
5303
- const k = { ...w };
5304
- return k[b] && delete k[b], k;
5316
+ return console.log("[DynamicConfig] Updated data state:", w), w;
5317
+ }), E((k) => {
5318
+ const w = { ...k };
5319
+ return w[f] && delete w[f], w;
5305
5320
  });
5306
- }, f = () => {
5307
- const b = {};
5308
- return !o || !h || o.configuration.forEach((p) => {
5309
- if (p.type === "section")
5310
- p.fields.forEach((w) => {
5311
- const k = h[p.key]?.[w.key];
5312
- if (w.required && (!k || typeof k == "string" && k.trim() === "")) {
5313
- b[p.key] || (b[p.key] = {}), b[p.key][w.key] = `${w.label} is required`;
5321
+ }, b = () => {
5322
+ const f = {};
5323
+ return !o || !h || o.configuration.forEach((g) => {
5324
+ if (g.type === "section")
5325
+ g.fields.forEach((k) => {
5326
+ const w = h[g.key]?.[k.key];
5327
+ if (k.required && (!w || typeof w == "string" && w.trim() === "")) {
5328
+ f[g.key] || (f[g.key] = {}), f[g.key][k.key] = `${k.label} is required`;
5314
5329
  return;
5315
5330
  }
5316
- if (w.fieldtype === "number" && k !== "" && k !== null && k !== void 0) {
5317
- const T = Number(k);
5318
- isNaN(T) ? (b[p.key] || (b[p.key] = {}), b[p.key][w.key] = `${w.label} must be a valid number`) : (w.min !== void 0 && T < w.min && (b[p.key] || (b[p.key] = {}), b[p.key][w.key] = `${w.label} must be at least ${w.min}`), w.max !== void 0 && T > w.max && (b[p.key] || (b[p.key] = {}), b[p.key][w.key] = `${w.label} must not exceed ${w.max}`));
5331
+ if (k.fieldtype === "number" && w !== "" && w !== null && w !== void 0) {
5332
+ const T = Number(w);
5333
+ isNaN(T) ? (f[g.key] || (f[g.key] = {}), f[g.key][k.key] = `${k.label} must be a valid number`) : (k.min !== void 0 && T < k.min && (f[g.key] || (f[g.key] = {}), f[g.key][k.key] = `${k.label} must be at least ${k.min}`), k.max !== void 0 && T > k.max && (f[g.key] || (f[g.key] = {}), f[g.key][k.key] = `${k.label} must not exceed ${k.max}`));
5319
5334
  }
5320
5335
  });
5321
- else if (p.type === "datatable") {
5322
- const w = h[p.key];
5323
- Array.isArray(w) && w.forEach((k, T) => {
5324
- p.fields.forEach((L) => {
5325
- const C = k[L.key];
5336
+ else if (g.type === "datatable") {
5337
+ const k = h[g.key];
5338
+ Array.isArray(k) && k.forEach((w, T) => {
5339
+ g.fields.forEach((L) => {
5340
+ const C = w[L.key];
5326
5341
  if (L.required && (!C || typeof C == "string" && C.trim() === "")) {
5327
- b[p.key] || (b[p.key] = {}), b[p.key][T] || (b[p.key][T] = {}), b[p.key][T][L.key] = `${L.label} is required`;
5342
+ f[g.key] || (f[g.key] = {}), f[g.key][T] || (f[g.key][T] = {}), f[g.key][T][L.key] = `${L.label} is required`;
5328
5343
  return;
5329
5344
  }
5330
5345
  if (L.fieldtype === "number" && C !== "" && C !== null && C !== void 0) {
5331
5346
  const M = Number(C);
5332
- isNaN(M) ? (b[p.key] || (b[p.key] = {}), b[p.key][T] || (b[p.key][T] = {}), b[p.key][T][L.key] = `${L.label} must be a valid number`) : (L.min !== void 0 && M < L.min && (b[p.key] || (b[p.key] = {}), b[p.key][T] || (b[p.key][T] = {}), b[p.key][T][L.key] = `${L.label} must be at least ${L.min}`), L.max !== void 0 && M > L.max && (b[p.key] || (b[p.key] = {}), b[p.key][T] || (b[p.key][T] = {}), b[p.key][T][L.key] = `${L.label} must not exceed ${L.max}`));
5347
+ isNaN(M) ? (f[g.key] || (f[g.key] = {}), f[g.key][T] || (f[g.key][T] = {}), f[g.key][T][L.key] = `${L.label} must be a valid number`) : (L.min !== void 0 && M < L.min && (f[g.key] || (f[g.key] = {}), f[g.key][T] || (f[g.key][T] = {}), f[g.key][T][L.key] = `${L.label} must be at least ${L.min}`), L.max !== void 0 && M > L.max && (f[g.key] || (f[g.key] = {}), f[g.key][T] || (f[g.key][T] = {}), f[g.key][T][L.key] = `${L.label} must not exceed ${L.max}`));
5333
5348
  }
5334
5349
  });
5335
5350
  });
5336
5351
  }
5337
- }), b;
5338
- }, z = (b) => Object.keys(b).length > 0, O = () => {
5339
- if (g) {
5352
+ }), f;
5353
+ }, S = (f) => Object.keys(f).length > 0, O = () => {
5354
+ if (p) {
5340
5355
  console.log("[handleSave] Already saving, ignoring duplicate call");
5341
5356
  return;
5342
5357
  }
5343
5358
  console.log("[handleSave] Starting save process");
5344
- const b = f();
5345
- if (E(b), z(b)) {
5346
- let w = [];
5347
- Object.keys(b).forEach((k) => {
5348
- typeof b[k] == "object" && Object.keys(b[k]).forEach((T) => {
5349
- typeof b[k][T] == "object" ? Object.keys(b[k][T]).forEach((L) => {
5350
- w.push(`${k} row ${parseInt(T) + 1}: ${b[k][T][L]}`);
5351
- }) : w.push(`${k}: ${b[k][T]}`);
5359
+ const f = b();
5360
+ if (E(f), S(f)) {
5361
+ let k = [];
5362
+ Object.keys(f).forEach((w) => {
5363
+ typeof f[w] == "object" && Object.keys(f[w]).forEach((T) => {
5364
+ typeof f[w][T] == "object" ? Object.keys(f[w][T]).forEach((L) => {
5365
+ k.push(`${w} row ${parseInt(T) + 1}: ${f[w][T][L]}`);
5366
+ }) : k.push(`${w}: ${f[w][T]}`);
5352
5367
  });
5353
5368
  });
5354
5369
  return;
5355
5370
  }
5356
5371
  (async () => {
5357
5372
  try {
5358
- S(!0);
5359
- const w = {};
5373
+ z(!0);
5374
+ const k = {};
5360
5375
  h && Object.keys(h).forEach((T) => {
5361
5376
  const L = a?.configuration?.find(
5362
5377
  (C) => C.key === T && C.type === "datatable"
5363
5378
  );
5364
- L && Array.isArray(h[T]) ? w[T] = h[T].map((C) => {
5379
+ L && Array.isArray(h[T]) ? k[T] = h[T].map((C) => {
5365
5380
  const M = { id: C.id || 0 };
5366
5381
  return L.fields && L.fields.forEach((_) => {
5367
5382
  if (_.fieldtype === "audience") {
@@ -5374,19 +5389,19 @@ function Ss({
5374
5389
  } else
5375
5390
  M[_.key] = C[_.key] || "";
5376
5391
  }), M;
5377
- }) : w[T] = h[T];
5378
- }), (!w.appkey || w.appkey === "") && (w.appkey = t);
5379
- let k = await xt(P, w);
5380
- if (k && k.status != "fail") {
5392
+ }) : k[T] = h[T];
5393
+ }), (!k.appkey || k.appkey === "") && (k.appkey = t);
5394
+ let w = await xt(P, k);
5395
+ if (w && w.status != "fail") {
5381
5396
  E({}), r(JSON.parse(JSON.stringify(h)));
5382
- const T = k.message || "Configuration has been saved successfully";
5397
+ const T = w.message || "Configuration has been saved successfully";
5383
5398
  qe.success(T), i && typeof i == "function" && i(h);
5384
5399
  } else
5385
- throw qe.error(k?.message || "Failed to save configuration"), new Error("No response received from server");
5386
- } catch (w) {
5387
- console.error("Error saving configuration:", w), qe.error(w?.message || "Failed to save configuration");
5400
+ throw qe.error(w?.message || "Failed to save configuration"), new Error("No response received from server");
5401
+ } catch (k) {
5402
+ console.error("Error saving configuration:", k), qe.error(k?.message || "Failed to save configuration");
5388
5403
  } finally {
5389
- S(!1);
5404
+ z(!1);
5390
5405
  }
5391
5406
  })();
5392
5407
  }, I = () => {
@@ -5395,7 +5410,7 @@ function Ss({
5395
5410
  if (!o?.configuration && !a?.configuration)
5396
5411
  return /* @__PURE__ */ e("div", { className: "min-h-screen flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "text-gray-500", children: "No configuration available" }) });
5397
5412
  const D = a?.configuration || o?.configuration;
5398
- return te(() => {
5413
+ return Z(() => {
5399
5414
  s && a ? (!h || Object.keys(h).length === 0) && $() : s && !a && $();
5400
5415
  }, [s, a]), /* @__PURE__ */ n("div", { children: [
5401
5416
  /* @__PURE__ */ n(
@@ -5405,18 +5420,18 @@ function Ss({
5405
5420
  style: { padding: "0px 20px 0px 0px" },
5406
5421
  children: [
5407
5422
  v && /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-64", children: /* @__PURE__ */ e(ba, { size: "large" }) }),
5408
- !v && D?.map((b, p) => {
5409
- const w = zs(b.type);
5410
- if (w && w !== "UnknownType")
5423
+ !v && D?.map((f, g) => {
5424
+ const k = zs(f.type);
5425
+ if (k && k !== "UnknownType")
5411
5426
  return /* @__PURE__ */ e(
5412
- w,
5427
+ k,
5413
5428
  {
5414
- item: b,
5429
+ item: f,
5415
5430
  data: h,
5416
5431
  updateHandler: x,
5417
5432
  validationErrors: F
5418
5433
  },
5419
- p
5434
+ g
5420
5435
  );
5421
5436
  })
5422
5437
  ]
@@ -5429,7 +5444,7 @@ function Ss({
5429
5444
  category: "secondary",
5430
5445
  onClick: I,
5431
5446
  label: "Cancel",
5432
- disabled: g,
5447
+ disabled: p,
5433
5448
  type: "button"
5434
5449
  }
5435
5450
  ),
@@ -5438,8 +5453,8 @@ function Ss({
5438
5453
  {
5439
5454
  category: "primary",
5440
5455
  onClick: O,
5441
- disabled: g,
5442
- label: g ? "Saving..." : "Save",
5456
+ disabled: p,
5457
+ label: p ? "Saving..." : "Save",
5443
5458
  type: "submit"
5444
5459
  }
5445
5460
  )
@@ -5457,27 +5472,27 @@ const Kl = ({
5457
5472
  breadcrumb: N = [],
5458
5473
  overview: y = {},
5459
5474
  configuration: r = []
5460
- } = t, v = ae(() => r.map((f) => {
5461
- if (f.type === "section" && f.fields) {
5462
- const z = [...f.fields], O = z.findIndex((I) => I && I.key === "appkey");
5475
+ } = t, v = ae(() => r.map((b) => {
5476
+ if (b.type === "section" && b.fields) {
5477
+ const S = [...b.fields], O = S.findIndex((I) => I && I.key === "appkey");
5463
5478
  if (O !== -1) {
5464
- const I = z[O];
5465
- if (z[O] = {
5479
+ const I = S[O];
5480
+ if (S[O] = {
5466
5481
  ...I,
5467
5482
  default: a,
5468
5483
  value: a,
5469
5484
  readonly: !0,
5470
5485
  placeholder: a,
5471
5486
  disabled: !1
5472
- }, z.some((b) => b.key === "displayname")) {
5473
- const b = z.findIndex((w) => w.key === "displayname"), p = z[b] || {};
5474
- z[b] = {
5475
- ...p,
5476
- default: p.default || p.value || a,
5477
- placeholder: p.placeholder || "Enter display name"
5487
+ }, S.some((f) => f.key === "displayname")) {
5488
+ const f = S.findIndex((k) => k.key === "displayname"), g = S[f] || {};
5489
+ S[f] = {
5490
+ ...g,
5491
+ default: g.default || g.value || a,
5492
+ placeholder: g.placeholder || "Enter display name"
5478
5493
  };
5479
5494
  } else {
5480
- const b = {
5495
+ const f = {
5481
5496
  key: "displayname",
5482
5497
  label: "Display Name",
5483
5498
  fieldtype: "text",
@@ -5486,46 +5501,46 @@ const Kl = ({
5486
5501
  placeholder: "Enter display name",
5487
5502
  required: !1
5488
5503
  };
5489
- z.splice(O + 1, 0, b);
5504
+ S.splice(O + 1, 0, f);
5490
5505
  }
5491
5506
  }
5492
5507
  return {
5493
- ...f,
5494
- fields: z
5508
+ ...b,
5509
+ fields: S
5495
5510
  };
5496
5511
  }
5497
- return f;
5512
+ return b;
5498
5513
  }), [r, a]), d = {
5499
5514
  heading: "App Details",
5500
5515
  subHeading: "View app details and customize configurations to align with institutional requirements.",
5501
5516
  isLeftArrow: !0,
5502
5517
  onBackClick: () => window.history.back(),
5503
5518
  ...u
5504
- }, g = N.map((f) => ({
5505
- label: f.text,
5506
- href: f.href || "#"
5507
- })), S = K(() => {
5519
+ }, p = N.map((b) => ({
5520
+ label: b.text,
5521
+ href: b.href || "#"
5522
+ })), z = ee(() => {
5508
5523
  o(!0);
5509
- }, []), F = K((f) => {
5510
- o(!1), f.primary && window.history.back();
5511
- }, []), E = K((f) => {
5512
- console.log("Configuration changed:", f);
5513
- }, []), R = K(() => {
5524
+ }, []), F = ee((b) => {
5525
+ o(!1), b.primary && window.history.back();
5526
+ }, []), E = ee((b) => {
5527
+ console.log("Configuration changed:", b);
5528
+ }, []), R = ee(() => {
5514
5529
  window.history.back();
5515
5530
  }, []), P = (() => {
5516
5531
  if (h.headingKey && Array.isArray(r)) {
5517
- const f = h.headingKey.split("."), z = f[0], O = f[1], I = r.find((D) => D && D.key === z);
5532
+ const b = h.headingKey.split("."), S = b[0], O = b[1], I = r.find((D) => D && D.key === S);
5518
5533
  if (I && I.fields) {
5519
- const D = I.fields.find((b) => b && b.key === O);
5534
+ const D = I.fields.find((f) => f && f.key === O);
5520
5535
  if (D)
5521
5536
  return D.default ?? D.value ?? h.heading ?? a;
5522
5537
  }
5523
5538
  }
5524
5539
  if (Array.isArray(r)) {
5525
- for (const f of r)
5526
- if (f && f.fields) {
5527
- const z = f.fields.find((O) => O && O.key === "displayname");
5528
- if (z) return z.default ?? z.value ?? a;
5540
+ for (const b of r)
5541
+ if (b && b.fields) {
5542
+ const S = b.fields.find((O) => O && O.key === "displayname");
5543
+ if (S) return S.default ?? S.value ?? a;
5529
5544
  }
5530
5545
  }
5531
5546
  return h.heading || a;
@@ -5557,22 +5572,22 @@ const Kl = ({
5557
5572
  configuration: v
5558
5573
  }), [v]), q = ae(() => [
5559
5574
  { label: "Overview", content: x(U) },
5560
- { label: "Configuration", content: /* @__PURE__ */ e(Ss, { appid: a, configdata: Y, disableApi: s, onSave: E, onShowCancelModal: S, onCancel: R }) }
5561
- ], [a, Y, s, E, S, R, U]);
5562
- function $(f) {
5563
- return f ? f.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: f } }) : f : "📱";
5575
+ { label: "Configuration", content: /* @__PURE__ */ e(Ss, { appid: a, configdata: Y, disableApi: s, onSave: E, onShowCancelModal: z, onCancel: R }) }
5576
+ ], [a, Y, s, E, z, R, U]);
5577
+ function $(b) {
5578
+ return b ? b.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: b } }) : b : "📱";
5564
5579
  }
5565
- function x(f) {
5580
+ function x(b) {
5566
5581
  return /* @__PURE__ */ n("div", { className: "bg-white rounded-2xl p-1", children: [
5567
5582
  /* @__PURE__ */ n("section", { className: "mb-8", children: [
5568
5583
  /* @__PURE__ */ e("h2", { className: "text-xl font-semibold mb-2", children: "About" }),
5569
- /* @__PURE__ */ e("p", { className: "text-gray-700 text-base", children: f.about })
5584
+ /* @__PURE__ */ e("p", { className: "text-gray-700 text-base", children: b.about })
5570
5585
  ] }),
5571
5586
  /* @__PURE__ */ n("section", { className: "flex flex-row gap-6 justify-center items-center mb-8", children: [
5572
5587
  /* @__PURE__ */ e(
5573
5588
  "img",
5574
5589
  {
5575
- src: f.images.desktop,
5590
+ src: b.images.desktop,
5576
5591
  alt: "Desktop View",
5577
5592
  className: "rounded-xl border border-gray-200 w-[340px] h-[220px] object-cover"
5578
5593
  }
@@ -5580,7 +5595,7 @@ const Kl = ({
5580
5595
  /* @__PURE__ */ e(
5581
5596
  "img",
5582
5597
  {
5583
- src: f.images.mobile1,
5598
+ src: b.images.mobile1,
5584
5599
  alt: "Mobile View 1",
5585
5600
  className: "rounded-2xl border border-gray-200 w-[120px] h-[220px] object-cover"
5586
5601
  }
@@ -5588,10 +5603,10 @@ const Kl = ({
5588
5603
  ] }),
5589
5604
  /* @__PURE__ */ n("section", { children: [
5590
5605
  /* @__PURE__ */ e("h3", { className: "text-lg font-semibold mb-4", children: "Key Features" }),
5591
- /* @__PURE__ */ e("ul", { className: "space-y-3", children: f.features.map((z, O) => /* @__PURE__ */ n("li", { children: [
5592
- /* @__PURE__ */ e("span", { className: "font-semibold", children: z.title }),
5606
+ /* @__PURE__ */ e("ul", { className: "space-y-3", children: b.features.map((S, O) => /* @__PURE__ */ n("li", { children: [
5607
+ /* @__PURE__ */ e("span", { className: "font-semibold", children: S.title }),
5593
5608
  /* @__PURE__ */ e("br", {}),
5594
- /* @__PURE__ */ e("span", { className: "text-gray-700", children: z.description })
5609
+ /* @__PURE__ */ e("span", { className: "text-gray-700", children: S.description })
5595
5610
  ] }, O)) })
5596
5611
  ] })
5597
5612
  ] });
@@ -5601,8 +5616,8 @@ const Kl = ({
5601
5616
  Un,
5602
5617
  {
5603
5618
  heading: d.heading,
5604
- subHeading: g.length > 0 ? void 0 : d.subHeading,
5605
- breadcrumbItems: g,
5619
+ subHeading: p.length > 0 ? void 0 : d.subHeading,
5620
+ breadcrumbItems: p,
5606
5621
  isLeftArrow: d.isLeftArrow,
5607
5622
  onBackClick: d.onBackClick
5608
5623
  }
@@ -5612,25 +5627,25 @@ const Kl = ({
5612
5627
  /* @__PURE__ */ n("div", { className: "flex flex-col min-w-0", children: [
5613
5628
  /* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: j.heading }),
5614
5629
  /* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: j.subHeading }),
5615
- /* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: j.tags && j.tags.map((f, z) => /* @__PURE__ */ e(
5630
+ /* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: j.tags && j.tags.map((b, S) => /* @__PURE__ */ e(
5616
5631
  "span",
5617
5632
  {
5618
5633
  className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
5619
- children: f
5634
+ children: b
5620
5635
  },
5621
- z
5636
+ S
5622
5637
  )) })
5623
5638
  ] })
5624
5639
  ] }),
5625
5640
  /* @__PURE__ */ n("div", { className: "bg-white border border-gray-300 rounded-2xl w-full mt-5 ", children: [
5626
- /* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: q.map((f, z) => /* @__PURE__ */ e(
5641
+ /* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: q.map((b, S) => /* @__PURE__ */ e(
5627
5642
  "button",
5628
5643
  {
5629
- onClick: () => l(z),
5630
- className: `${i === z ? "border-black text-black" : "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"} whitespace-nowrap py-3 px-6 border-b-2 font-medium text-sm transition-colors duration-200`,
5631
- children: f.label
5644
+ onClick: () => l(S),
5645
+ className: `${i === S ? "border-black text-black" : "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"} whitespace-nowrap py-3 px-6 border-b-2 font-medium text-sm transition-colors duration-200`,
5646
+ children: b.label
5632
5647
  },
5633
- z
5648
+ S
5634
5649
  )) }) }),
5635
5650
  /* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children: q[i].content })
5636
5651
  ] }),
@@ -5657,68 +5672,68 @@ const Kl = ({
5657
5672
  allowReorder: o = !0,
5658
5673
  initialData: u = null
5659
5674
  }) => {
5660
- const [h, N] = B(null), [y, r] = B(""), [v, d] = B(() => Array.isArray(u) ? u : []), [g, S] = B(null), [F, E] = B(null), [R, P] = B("");
5661
- te(() => {
5675
+ const [h, N] = B(null), [y, r] = B(""), [v, d] = B(() => Array.isArray(u) ? u : []), [p, z] = B(null), [F, E] = B(null), [R, P] = B("");
5676
+ Z(() => {
5662
5677
  Array.isArray(u) && d(u);
5663
5678
  }, [u]);
5664
- const j = (p) => {
5665
- l && (N(p._id), r(p.categoryName || ""));
5679
+ const j = (g) => {
5680
+ l && (N(g._id), r(g.categoryName || ""));
5666
5681
  }, U = () => {
5667
5682
  if (!i || h !== null) return;
5668
- const w = (v.length > 0 ? Math.max(...v.map((k) => typeof k._id == "number" ? k._id : 0)) : 0) + 1;
5669
- d((k) => [
5670
- ...k,
5683
+ const k = (v.length > 0 ? Math.max(...v.map((w) => typeof w._id == "number" ? w._id : 0)) : 0) + 1;
5684
+ d((w) => [
5685
+ ...w,
5671
5686
  {
5672
- _id: w,
5687
+ _id: k,
5673
5688
  categoryName: "",
5674
5689
  links: [],
5675
- order: (k.at(-1)?.order ?? 0) + 1,
5690
+ order: (w.at(-1)?.order ?? 0) + 1,
5676
5691
  protected: !1,
5677
5692
  _class: "com.unifyed.model.Collection"
5678
5693
  }
5679
- ]), N(w), r("");
5694
+ ]), N(k), r("");
5680
5695
  }, Y = () => {
5681
- h != null && (d((p) => {
5682
- const k = !Array.isArray(u) || !u.some((T) => T._id === h) ? p.filter((T) => T._id !== h) : p;
5683
- return a?.(k), k;
5696
+ h != null && (d((g) => {
5697
+ const w = !Array.isArray(u) || !u.some((T) => T._id === h) ? g.filter((T) => T._id !== h) : g;
5698
+ return a?.(w), w;
5684
5699
  }), N(null), r(""));
5685
5700
  }, q = () => {
5686
- h == null || !y.trim() || (d((p) => {
5687
- const w = p.map((k) => k._id === h ? {
5688
- ...k,
5701
+ h == null || !y.trim() || (d((g) => {
5702
+ const k = g.map((w) => w._id === h ? {
5703
+ ...w,
5689
5704
  categoryName: y.trim()
5690
- } : k);
5691
- return a?.(w), w;
5692
- }), N(null), r(""));
5693
- }, $ = (p) => {
5694
- m && d((w) => {
5695
- const k = w.filter((T) => T._id !== p._id);
5705
+ } : w);
5696
5706
  return a?.(k), k;
5707
+ }), N(null), r(""));
5708
+ }, $ = (g) => {
5709
+ m && d((k) => {
5710
+ const w = k.filter((T) => T._id !== g._id);
5711
+ return a?.(w), w;
5697
5712
  });
5698
- }, x = (p, w, k) => {
5699
- const T = Number(w), L = Number(k);
5700
- if (!o || T === L) return p;
5701
- const C = p.findIndex((G) => Number(G._id) === T), M = p.findIndex((G) => Number(G._id) === L);
5702
- if (C === -1 || M === -1) return p;
5703
- const _ = [...p], [A] = _.splice(C, 1);
5713
+ }, x = (g, k, w) => {
5714
+ const T = Number(k), L = Number(w);
5715
+ if (!o || T === L) return g;
5716
+ const C = g.findIndex((G) => Number(G._id) === T), M = g.findIndex((G) => Number(G._id) === L);
5717
+ if (C === -1 || M === -1) return g;
5718
+ const _ = [...g], [A] = _.splice(C, 1);
5704
5719
  return _.splice(M, 0, A), _.map((G, W) => ({ ...G, order: W + 1 }));
5705
- }, f = (p, w) => {
5706
- o && (p.dataTransfer.effectAllowed = "move", p.dataTransfer.setData("text/plain", String(w)), S(Number(w)));
5707
- }, z = (p) => {
5708
- g && p !== F && E(p);
5709
- }, O = (p) => {
5710
- p.preventDefault();
5711
- }, I = (p, w) => {
5712
- p.preventDefault();
5713
- const k = p.dataTransfer.getData("text/plain"), T = k === "0" ? 0 : Number(k), L = w === "0" ? 0 : Number(w);
5720
+ }, b = (g, k) => {
5721
+ o && (g.dataTransfer.effectAllowed = "move", g.dataTransfer.setData("text/plain", String(k)), z(Number(k)));
5722
+ }, S = (g) => {
5723
+ p && g !== F && E(g);
5724
+ }, O = (g) => {
5725
+ g.preventDefault();
5726
+ }, I = (g, k) => {
5727
+ g.preventDefault();
5728
+ const w = g.dataTransfer.getData("text/plain"), T = w === "0" ? 0 : Number(w), L = k === "0" ? 0 : Number(k);
5714
5729
  T === void 0 || L === void 0 || (d((C) => {
5715
5730
  const M = x(C, T, L);
5716
5731
  return a?.(M), M;
5717
- }), S(null), E(null));
5732
+ }), z(null), E(null));
5718
5733
  }, D = () => {
5719
- S(null), E(null);
5720
- }, b = Array.isArray(v) ? v.filter(
5721
- (p) => p.categoryName?.toLowerCase().includes(R.toLowerCase())
5734
+ z(null), E(null);
5735
+ }, f = Array.isArray(v) ? v.filter(
5736
+ (g) => g.categoryName?.toLowerCase().includes(R.toLowerCase())
5722
5737
  ) : [];
5723
5738
  return /* @__PURE__ */ n("div", { className: `manage-collection-list ${t}`, children: [
5724
5739
  /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ n("div", { className: "w-1/2 flex justify-end", children: [
@@ -5744,14 +5759,14 @@ const Kl = ({
5744
5759
  }
5745
5760
  )
5746
5761
  ] }) }),
5747
- /* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: b.map((p) => {
5748
- const w = h === p._id, k = p?.links?.length ?? 0, T = g === p._id, L = F === p._id && g !== p._id;
5762
+ /* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: f.map((g) => {
5763
+ const k = h === g._id, w = g?.links?.length ?? 0, T = p === g._id, L = F === g._id && p !== g._id;
5749
5764
  return /* @__PURE__ */ e(
5750
5765
  "div",
5751
5766
  {
5752
- onDragEnter: () => z(p._id),
5767
+ onDragEnter: () => S(g._id),
5753
5768
  onDragOver: O,
5754
- onDrop: (C) => I(C, p._id),
5769
+ onDrop: (C) => I(C, g._id),
5755
5770
  onDragEnd: D,
5756
5771
  className: [
5757
5772
  "flex items-center justify-between p-3 border rounded-2xl mb-3",
@@ -5759,14 +5774,14 @@ const Kl = ({
5759
5774
  L ? "ring-2 ring-gray-800/20" : "",
5760
5775
  T ? "opacity-60" : ""
5761
5776
  ].join(" "),
5762
- children: w ? /* @__PURE__ */ n(ee, { children: [
5777
+ children: k ? /* @__PURE__ */ n(te, { children: [
5763
5778
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
5764
5779
  "input",
5765
5780
  {
5766
5781
  type: "text",
5767
5782
  className: "flex-1 h-10 px-3 max-w-[200px] border border-gray-300 rounded-2xl outline-none focus:ring-2 focus:ring-gray-800/20",
5768
5783
  value: y,
5769
- placeholder: !Array.isArray(u) || !u.some((C) => C._id === p._id) ? "New collection name" : "Edit collection name",
5784
+ placeholder: !Array.isArray(u) || !u.some((C) => C._id === g._id) ? "New collection name" : "Edit collection name",
5770
5785
  onChange: (C) => r(C.target.value),
5771
5786
  onKeyDown: (C) => {
5772
5787
  C.key === "Enter" && q(), C.key === "Escape" && Y();
@@ -5799,7 +5814,7 @@ const Kl = ({
5799
5814
  }
5800
5815
  )
5801
5816
  ] })
5802
- ] }) : /* @__PURE__ */ n(ee, { children: [
5817
+ ] }) : /* @__PURE__ */ n(te, { children: [
5803
5818
  /* @__PURE__ */ n("div", { className: "flex gap-2 items-center", children: [
5804
5819
  o && /* @__PURE__ */ e(
5805
5820
  "span",
@@ -5808,42 +5823,42 @@ const Kl = ({
5808
5823
  "aria-label": "Drag to reorder",
5809
5824
  className: "cursor-grab active:cursor-grabbing p-1 -m-1 rounded-md hover:bg-gray-50",
5810
5825
  draggable: !0,
5811
- onDragStart: (C) => f(C, p._id),
5826
+ onDragStart: (C) => b(C, g._id),
5812
5827
  children: /* @__PURE__ */ e(wt, {})
5813
5828
  }
5814
5829
  ),
5815
- /* @__PURE__ */ e("span", { children: p.categoryName })
5830
+ /* @__PURE__ */ e("span", { children: g.categoryName })
5816
5831
  ] }),
5817
5832
  /* @__PURE__ */ n("div", { className: "flex gap-2 items-center", children: [
5818
- p.protected ? /* @__PURE__ */ e("span", { className: "text-sm text-gray-600 cursor-default", children: p.qlAppName }) : /* @__PURE__ */ e("span", { className: "text-sm text-blue-600 cursor-default", children: `${k} ${k === 1 ? "link" : "links"}` }),
5833
+ g.protected ? /* @__PURE__ */ e("span", { className: "text-sm text-gray-600 cursor-default", children: g.qlAppName }) : /* @__PURE__ */ e("span", { className: "text-sm text-blue-600 cursor-default", children: `${w} ${w === 1 ? "link" : "links"}` }),
5819
5834
  l && /* @__PURE__ */ e(
5820
5835
  "button",
5821
5836
  {
5822
5837
  className: "cursor-pointer",
5823
- onClick: () => j(p),
5824
- "aria-label": `Edit ${p.categoryName}`,
5838
+ onClick: () => j(g),
5839
+ "aria-label": `Edit ${g.categoryName}`,
5825
5840
  children: /* @__PURE__ */ e(xr, { color: "#767676" })
5826
5841
  }
5827
5842
  ),
5828
5843
  m && /* @__PURE__ */ e(
5829
5844
  "span",
5830
5845
  {
5831
- className: k === 0 && !p.protected ? "cursor-pointer" : "cursor-not-allowed",
5832
- title: k === 0 && !p.protected ? "Delete" : "Cannot delete a collection with linked items",
5833
- onClick: k === 0 ? () => $(p) : null,
5834
- children: /* @__PURE__ */ e(Le, { color: k === 0 ? "#767676" : "#C2C2C2" })
5846
+ className: w === 0 && !g.protected ? "cursor-pointer" : "cursor-not-allowed",
5847
+ title: w === 0 && !g.protected ? "Delete" : "Cannot delete a collection with linked items",
5848
+ onClick: w === 0 ? () => $(g) : null,
5849
+ children: /* @__PURE__ */ e(Le, { color: w === 0 ? "#767676" : "#C2C2C2" })
5835
5850
  }
5836
5851
  )
5837
5852
  ] })
5838
5853
  ] })
5839
5854
  },
5840
- p._id
5855
+ g._id
5841
5856
  );
5842
5857
  }) })
5843
5858
  ] });
5844
5859
  };
5845
5860
  function ei({ children: t }) {
5846
- return /* @__PURE__ */ n(ee, { children: [
5861
+ return /* @__PURE__ */ n(te, { children: [
5847
5862
  t,
5848
5863
  /* @__PURE__ */ e(
5849
5864
  nn,
@@ -5930,8 +5945,8 @@ const Bt = () => {
5930
5945
  showFilter: r = !1,
5931
5946
  showPrint: v = !1,
5932
5947
  showExcel: d = !1,
5933
- showPdf: g = !1,
5934
- showRefresh: S = !1,
5948
+ showPdf: p = !1,
5949
+ showRefresh: z = !1,
5935
5950
  showAdd: F = !1,
5936
5951
  iSelectedRecords: E = 0,
5937
5952
  // Additional props
@@ -5947,11 +5962,11 @@ const Bt = () => {
5947
5962
  pdfFileName: q,
5948
5963
  searchIconSize: $,
5949
5964
  searchIconClass: x,
5950
- inputStyle: f
5965
+ inputStyle: b
5951
5966
  }) => {
5952
- const z = () => l?.current || i?.current, [O, I] = re.useState(""), D = (t || "export").toString().trim() || "export", b = `${Y || D}.xlsx`, p = `${q || D}.pdf`, w = (L, C, M) => Math.max(C, Math.min(L, M)), k = K(
5967
+ const S = () => l?.current || i?.current, [O, I] = re.useState(""), D = (t || "export").toString().trim() || "export", f = `${Y || D}.xlsx`, g = `${q || D}.pdf`, k = (L, C, M) => Math.max(C, Math.min(L, M)), w = ee(
5953
5968
  (L) => {
5954
- const C = z();
5969
+ const C = S();
5955
5970
  if (C?.openColumnChooser) {
5956
5971
  if (typeof window > "u" || !L?.currentTarget) {
5957
5972
  C.openColumnChooser();
@@ -5961,7 +5976,7 @@ const Bt = () => {
5961
5976
  const M = L.currentTarget.getBoundingClientRect(), _ = M.left + window.scrollX, A = M.bottom + window.scrollY;
5962
5977
  let G = _ - 120, W = A - 120;
5963
5978
  const pe = window.innerWidth, Ne = window.innerHeight;
5964
- G = w(G, window.scrollX + 8, window.scrollX + pe - 340), W = w(W, window.scrollY, window.scrollY + Ne - 120), C.openColumnChooser(G, W);
5979
+ G = k(G, window.scrollX + 8, window.scrollX + pe - 340), W = k(W, window.scrollY, window.scrollY + Ne - 120), C.openColumnChooser(G, W);
5965
5980
  } catch (M) {
5966
5981
  console.log("coloumn choose error", M);
5967
5982
  }
@@ -5969,9 +5984,9 @@ const Bt = () => {
5969
5984
  },
5970
5985
  []
5971
5986
  // no external deps; reads ref at call time
5972
- ), T = K(
5987
+ ), T = ee(
5973
5988
  (L, C) => {
5974
- const M = z();
5989
+ const M = S();
5975
5990
  if (M)
5976
5991
  switch (L) {
5977
5992
  case "Delete": {
@@ -5982,23 +5997,23 @@ const Bt = () => {
5982
5997
  break;
5983
5998
  }
5984
5999
  case "ColumnChooser":
5985
- y && (C ? k(C) : M.openColumnChooser?.());
6000
+ y && (C ? w(C) : M.openColumnChooser?.());
5986
6001
  break;
5987
6002
  case "Print":
5988
6003
  v && M.print?.();
5989
6004
  break;
5990
6005
  case "Excel":
5991
- d && M.excelExport?.({ fileName: b });
6006
+ d && M.excelExport?.({ fileName: f });
5992
6007
  break;
5993
6008
  case "Pdf":
5994
- g && M.pdfExport?.({ fileName: p });
6009
+ p && M.pdfExport?.({ fileName: g });
5995
6010
  break;
5996
6011
  case "Refresh":
5997
- S && P();
6012
+ z && P();
5998
6013
  break;
5999
6014
  }
6000
6015
  },
6001
- [y, v, d, g, S, b, p, P, k]
6016
+ [y, v, d, p, z, f, g, P, w]
6002
6017
  );
6003
6018
  return /* @__PURE__ */ n("div", { className: "flex items-center flex-wrap justify-between w-full px-4 py-2 bg-white border border-gray-200 rounded-t-2xl mb-0", children: [
6004
6019
  /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
@@ -6020,7 +6035,7 @@ const Bt = () => {
6020
6035
  },
6021
6036
  searchIconSize: $ || 16,
6022
6037
  searchIconClass: x || "",
6023
- inputStyle: f || { paddingTop: "4px", paddingBottom: "4px" }
6038
+ inputStyle: b || { paddingTop: "4px", paddingBottom: "4px" }
6024
6039
  }
6025
6040
  ) }),
6026
6041
  /* @__PURE__ */ n("div", { className: "flex gap-3", children: [
@@ -6066,7 +6081,7 @@ const Bt = () => {
6066
6081
  ariaLabel: "Excel Download"
6067
6082
  }
6068
6083
  ),
6069
- g && /* @__PURE__ */ e(
6084
+ p && /* @__PURE__ */ e(
6070
6085
  Ce,
6071
6086
  {
6072
6087
  icon: Cr,
@@ -6074,7 +6089,7 @@ const Bt = () => {
6074
6089
  ariaLabel: "PDF Download"
6075
6090
  }
6076
6091
  ),
6077
- S && /* @__PURE__ */ e(
6092
+ z && /* @__PURE__ */ e(
6078
6093
  Ce,
6079
6094
  {
6080
6095
  icon: zr,
@@ -6114,8 +6129,8 @@ function ai(t) {
6114
6129
  allowResizing: r = !0,
6115
6130
  allowExcelExport: v = !1,
6116
6131
  allowPdfExport: d = !1,
6117
- showColumnChooser: g = !1,
6118
- enableSearchApi: S = !1,
6132
+ showColumnChooser: p = !1,
6133
+ enableSearchApi: z = !1,
6119
6134
  height: F = "600",
6120
6135
  selectionSettings: E,
6121
6136
  enableCheckbox: R = !1,
@@ -6126,11 +6141,11 @@ function ai(t) {
6126
6141
  onRowDoubleClick: q,
6127
6142
  apiRef: $,
6128
6143
  gridProps: x = {}
6129
- } = t, f = fe(null), {
6130
- pageSettings: z,
6144
+ } = t, b = fe(null), {
6145
+ pageSettings: S,
6131
6146
  sortSettings: O,
6132
6147
  ...I
6133
- } = x || {}, [D, b] = re.useState(z?.page || l), [p, w] = re.useState(z?.pageSize || m), [k, T] = re.useState(O?.sortKey || "updatedDate"), [L, C] = re.useState(O?.direction || "Descending"), M = ae(() => {
6148
+ } = x || {}, [D, f] = re.useState(S?.page || l), [g, k] = re.useState(S?.pageSize || m), [w, T] = re.useState(O?.sortKey || "updatedDate"), [L, C] = re.useState(O?.direction || "Descending"), M = ae(() => {
6134
6149
  const V = E || {
6135
6150
  type: "Multiple",
6136
6151
  mode: "Row"
@@ -6146,21 +6161,21 @@ function ai(t) {
6146
6161
  } : V;
6147
6162
  }, [E, R]), _ = ae(() => {
6148
6163
  const V = [ln];
6149
- return (R || E) && V.push(on), u && V.push(cn), h && V.push(dn), N && V.push(mn), S && V.push(un), v && V.push(hn), d && V.push(pn), g && V.push(gn), r && V.push(bn), y && V.push(fn), V.push(yn), V;
6164
+ return (R || E) && V.push(on), u && V.push(cn), h && V.push(dn), N && V.push(mn), z && V.push(un), v && V.push(hn), d && V.push(pn), p && V.push(gn), r && V.push(bn), y && V.push(fn), V.push(yn), V;
6150
6165
  }, [
6151
6166
  u,
6152
6167
  h,
6153
6168
  N,
6154
- S,
6169
+ z,
6155
6170
  v,
6156
6171
  d,
6157
- g,
6172
+ p,
6158
6173
  r,
6159
6174
  y,
6160
6175
  R,
6161
6176
  E
6162
6177
  ]), A = ae(() => {
6163
- const V = () => f.current, ne = (J, ce) => {
6178
+ const V = () => b.current, ne = (J, ce) => {
6164
6179
  !ce && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${J} requested but related service/feature is disabled.`);
6165
6180
  };
6166
6181
  return {
@@ -6171,7 +6186,7 @@ function ai(t) {
6171
6186
  selectRow: (J, ce = !1) => V()?.selectRow?.(J, ce),
6172
6187
  selectRows: (J, ce = !1) => V()?.selectRows?.(J, ce),
6173
6188
  search: (J) => {
6174
- ne("search()", S), V()?.search?.(J);
6189
+ ne("search()", z), V()?.search?.(J);
6175
6190
  },
6176
6191
  print: () => V()?.print?.(),
6177
6192
  excelExport: (J) => {
@@ -6181,24 +6196,24 @@ function ai(t) {
6181
6196
  ne("pdfExport()", d), V()?.pdfExport?.(J);
6182
6197
  },
6183
6198
  openColumnChooser: (J, ce) => {
6184
- ne("openColumnChooser()", g), V()?.columnChooserModule?.openColumnChooser?.(J, ce);
6199
+ ne("openColumnChooser()", p), V()?.columnChooserModule?.openColumnChooser?.(J, ce);
6185
6200
  },
6186
6201
  // Additional useful methods
6187
6202
  getColumns: () => V()?.getColumns?.(),
6188
6203
  getFilteredRecords: () => V()?.getFilteredRecords?.(),
6189
6204
  autoFitColumns: (J) => V()?.autoFitColumns?.(J)
6190
6205
  };
6191
- }, [S, v, d, g]);
6192
- te(() => {
6206
+ }, [z, v, d, p]);
6207
+ Z(() => {
6193
6208
  $ && ($.current = A);
6194
- }, [$, A]), te(() => () => {
6209
+ }, [$, A]), Z(() => () => {
6195
6210
  $ && ($.current = null);
6196
6211
  }, [$]);
6197
6212
  const G = (V) => {
6198
6213
  const ne = String(V || "");
6199
6214
  return ne === "Ascending" || ne === "Descending" ? ne : ne.toLowerCase() === "ascending" ? "Ascending" : "Descending";
6200
6215
  }, W = (V) => {
6201
- const ne = f.current, J = V?.requestType, ce = J === "paging" ? "paging" : J === "sorting" ? "sorting" : J === "searching" ? "searching" : J === "filtering" ? "filtering" : J === "grouping" ? "grouping" : J === "reorder" ? "reorder" : J === "columnstate" ? "columnstate" : "other", Re = V?.pageSize ?? ne?.pageSettings?.pageSize ?? p, _e = V?.currentPage ?? ne?.pageSettings?.currentPage ?? l, rt = V?.columnName && V?.direction ? [{ field: V.columnName, dir: G(V.direction) }] : (ne?.sortSettings?.columns || []).map((Ie) => ({
6216
+ const ne = b.current, J = V?.requestType, ce = J === "paging" ? "paging" : J === "sorting" ? "sorting" : J === "searching" ? "searching" : J === "filtering" ? "filtering" : J === "grouping" ? "grouping" : J === "reorder" ? "reorder" : J === "columnstate" ? "columnstate" : "other", Re = V?.pageSize ?? ne?.pageSettings?.pageSize ?? g, _e = V?.currentPage ?? ne?.pageSettings?.currentPage ?? l, rt = V?.columnName && V?.direction ? [{ field: V.columnName, dir: G(V.direction) }] : (ne?.sortSettings?.columns || []).map((Ie) => ({
6202
6217
  field: Ie.field,
6203
6218
  dir: G(Ie.direction ?? Ie.dir)
6204
6219
  })), nt = V?.searchString ?? "", st = V?.columns ?? ne?.filterSettings?.columns ?? [];
@@ -6217,8 +6232,8 @@ function ai(t) {
6217
6232
  };
6218
6233
  }, pe = (V) => {
6219
6234
  setTimeout(() => {
6220
- f?.current?.hideSpinner();
6221
- }, 1e3), V.requestType === "paging" && (b(V.currentPage), w(V.pageSize)), V.requestType === "sorting" && (T(V.columnName || "updatedDate"), C(V.direction)), j?.(W(V), V);
6235
+ b?.current?.hideSpinner();
6236
+ }, 1e3), V.requestType === "paging" && (f(V.currentPage), k(V.pageSize)), V.requestType === "sorting" && (T(V.columnName || "updatedDate"), C(V.direction)), j?.(W(V), V);
6222
6237
  }, Ne = (V) => {
6223
6238
  q?.(V?.rowData, V);
6224
6239
  }, Ta = () => {
@@ -6282,18 +6297,18 @@ function ai(t) {
6282
6297
  }), V;
6283
6298
  }, Aa = ae(() => ({
6284
6299
  currentPage: D,
6285
- pageSize: p,
6286
- pageSizes: z?.pageSizes ?? [10, 20, 40, 60, 80, 100],
6300
+ pageSize: g,
6301
+ pageSizes: S?.pageSizes ?? [10, 20, 40, 60, 80, 100],
6287
6302
  totalCount: s
6288
- }), [D, p, z?.pageSizes, s]), Fa = ae(() => O ?? {
6289
- columns: [{ field: k, direction: G(L) }],
6303
+ }), [D, g, S?.pageSizes, s]), Fa = ae(() => O ?? {
6304
+ columns: [{ field: w, direction: G(L) }],
6290
6305
  allowUnsort: !1
6291
- }, [O, k, L]);
6306
+ }, [O, w, L]);
6292
6307
  return /* @__PURE__ */ n(
6293
6308
  xn,
6294
6309
  {
6295
6310
  id: i,
6296
- ref: f,
6311
+ ref: b,
6297
6312
  dataSource: {
6298
6313
  result: a,
6299
6314
  count: s
@@ -6305,7 +6320,7 @@ function ai(t) {
6305
6320
  allowGrouping: N,
6306
6321
  allowReordering: y,
6307
6322
  allowResizing: r,
6308
- showColumnChooser: g,
6323
+ showColumnChooser: p,
6309
6324
  selectionSettings: M,
6310
6325
  pageSettings: Aa,
6311
6326
  sortSettings: Fa,
@@ -6409,11 +6424,11 @@ function Ts({
6409
6424
  // spread remaining props (_id, instanceId, etc.)
6410
6425
  ...v
6411
6426
  }) {
6412
- const d = de(t), g = me[d];
6427
+ const d = de(t), p = me[d];
6413
6428
  return /* @__PURE__ */ n(
6414
6429
  oe,
6415
6430
  {
6416
- className: `flex flex-col ${g.card}`,
6431
+ className: `flex flex-col ${p.card}`,
6417
6432
  showCheckbox: a,
6418
6433
  checkboxPosition: s,
6419
6434
  onSelect: i,
@@ -6421,11 +6436,11 @@ function Ts({
6421
6436
  details: { type: "activity", title: m, group: o, author: h },
6422
6437
  ...v,
6423
6438
  children: [
6424
- /* @__PURE__ */ e("div", { className: "flex items-start justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${g.title} ml-3`, children: m }) }),
6425
- /* @__PURE__ */ n("div", { className: `text-zinc-500 dark:text-zinc-400 ${g.meta}`, children: [
6439
+ /* @__PURE__ */ e("div", { className: "flex items-start justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${p.title} ml-3`, children: m }) }),
6440
+ /* @__PURE__ */ n("div", { className: `text-zinc-500 dark:text-zinc-400 ${p.meta}`, children: [
6426
6441
  "Posted in ",
6427
6442
  /* @__PURE__ */ e("span", { className: "font-medium", children: "Global" }),
6428
- u ? /* @__PURE__ */ n(ee, { children: [
6443
+ u ? /* @__PURE__ */ n(te, { children: [
6429
6444
  ",",
6430
6445
  " ",
6431
6446
  /* @__PURE__ */ e(
@@ -6443,7 +6458,7 @@ function Ts({
6443
6458
  /* @__PURE__ */ e(we, { name: "John", size: "medium" }),
6444
6459
  /* @__PURE__ */ n("div", { className: "leading-tight", children: [
6445
6460
  /* @__PURE__ */ e("div", { className: "text-sm font-medium text-zinc-800 dark:text-zinc-100", children: h }),
6446
- /* @__PURE__ */ e("div", { className: `text-zinc-500 dark:text-zinc-400 ${g.meta}`, children: N })
6461
+ /* @__PURE__ */ e("div", { className: `text-zinc-500 dark:text-zinc-400 ${p.meta}`, children: N })
6447
6462
  ] })
6448
6463
  ] }),
6449
6464
  /* @__PURE__ */ n("p", { className: "mt-2 text-zinc-700 dark:text-zinc-300", children: [
@@ -6460,7 +6475,7 @@ function Ts({
6460
6475
  /* @__PURE__ */ e(
6461
6476
  "div",
6462
6477
  {
6463
- className: `mt-3 overflow-hidden rounded-lg border border-zinc-200 dark:border-zinc-800 ${g.media}`,
6478
+ className: `mt-3 overflow-hidden rounded-lg border border-zinc-200 dark:border-zinc-800 ${p.media}`,
6464
6479
  children: /* @__PURE__ */ e("img", { src: y, alt: "", className: "h-full w-full object-cover" })
6465
6480
  }
6466
6481
  ),
@@ -6834,18 +6849,18 @@ function _s({
6834
6849
  // optional full embed URL override
6835
6850
  ...v
6836
6851
  }) {
6837
- const d = de(t), g = me[d], S = Bs[d], F = r || js(N, y);
6852
+ const d = de(t), p = me[d], z = Bs[d], F = r || js(N, y);
6838
6853
  return /* @__PURE__ */ e(
6839
6854
  oe,
6840
6855
  {
6841
- className: `flex flex-col ${g.card} ${S.wrap}`,
6856
+ className: `flex flex-col ${p.card} ${z.wrap}`,
6842
6857
  showCheckbox: a,
6843
6858
  checkboxPosition: s,
6844
6859
  onSelect: i,
6845
6860
  identity: l,
6846
6861
  details: { type: "campus-map", title: m, campusName: o, activeFilter: h, mapQuery: N, zoom: y },
6847
6862
  ...v,
6848
- children: /* @__PURE__ */ n("div", { className: `relative mt-3 overflow-hidden rounded-2xl border border-zinc-200 dark:border-zinc-800 ${S.mapH}`, children: [
6863
+ children: /* @__PURE__ */ n("div", { className: `relative mt-3 overflow-hidden rounded-2xl border border-zinc-200 dark:border-zinc-800 ${z.mapH}`, children: [
6849
6864
  /* @__PURE__ */ e(
6850
6865
  "iframe",
6851
6866
  {
@@ -6859,7 +6874,7 @@ function _s({
6859
6874
  }
6860
6875
  ),
6861
6876
  /* @__PURE__ */ n("div", { className: "absolute left-4 right-4 top-3 flex items-center justify-between pointer-events-none", children: [
6862
- /* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 ${S.campusPill}`, children: [
6877
+ /* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 ${z.campusPill}`, children: [
6863
6878
  /* @__PURE__ */ e("span", { className: "truncate max-w-[60vw]", children: o }),
6864
6879
  /* @__PURE__ */ e("span", { className: "ml-2 text-zinc-400", children: "▾" })
6865
6880
  ] }),
@@ -6868,8 +6883,8 @@ function _s({
6868
6883
  /* @__PURE__ */ e("div", { className: "h-8 w-8 rounded-full bg-white/90 border border-zinc-300 flex items-center justify-center", children: "›" })
6869
6884
  ] })
6870
6885
  ] }),
6871
- /* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-14 md:top-12 pointer-events-none mt-2", children: /* @__PURE__ */ e("div", { className: `flex ${S.chipGap} overflow-x-auto scrollbar-none`, children: u.map((E) => /* @__PURE__ */ e(Vs, { label: E, active: E === h, size: d }, E)) }) }),
6872
- /* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-28 md:top-24 pointer-events-none", children: /* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 px-4 ${S.searchH}`, children: [
6886
+ /* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-14 md:top-12 pointer-events-none mt-2", children: /* @__PURE__ */ e("div", { className: `flex ${z.chipGap} overflow-x-auto scrollbar-none`, children: u.map((E) => /* @__PURE__ */ e(Vs, { label: E, active: E === h, size: d }, E)) }) }),
6887
+ /* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-28 md:top-24 pointer-events-none", children: /* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 px-4 ${z.searchH}`, children: [
6873
6888
  /* @__PURE__ */ e("svg", { width: "18", height: "18", viewBox: "0 0 24 24", "aria-hidden": "true", className: "opacity-60", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M15.5 14h-.79l-.28-.27a6.471 6.471 0 001.48-4.23C15.91 6.01 13.4 3.5 10.45 3.5S5 6.01 5 9.5 7.5 15.5 10.45 15.5c1.61 0 3.09-.59 4.23-1.48l.27.28v.79l4.25 4.25c.41.41 1.07.41 1.48 0s.41-1.07 0-1.48L15.5 14Zm-5.05 0C8.01 14 6 11.99 6 9.5S8.01 5 10.45 5s4.45 2.01 4.45 4.5-2.01 4.5-4.45 4.5Z" }) }),
6874
6889
  /* @__PURE__ */ e("span", { className: "ml-2 text-zinc-500 dark:text-zinc-400", children: "Search places" })
6875
6890
  ] }) })
@@ -7040,7 +7055,7 @@ function Ws({
7040
7055
  selectedIndex: u = 0,
7041
7056
  ...h
7042
7057
  }) {
7043
- const [N, y] = B(u), r = de(t), v = me[r], d = Gs[r], g = o[N] || o[0], S = (E, R) => {
7058
+ const [N, y] = B(u), r = de(t), v = me[r], d = Gs[r], p = o[N] || o[0], z = (E, R) => {
7044
7059
  y(R), i?.(E);
7045
7060
  }, F = r === "lg";
7046
7061
  return /* @__PURE__ */ n(
@@ -7067,11 +7082,11 @@ function Ws({
7067
7082
  ev: E,
7068
7083
  sizeMeta: d,
7069
7084
  isSelected: R === N,
7070
- onClick: (P) => S(P, R)
7085
+ onClick: (P) => z(P, R)
7071
7086
  },
7072
7087
  E._id || E.id || R
7073
7088
  )) }),
7074
- /* @__PURE__ */ e(Ys, { ev: g, sizeMeta: d })
7089
+ /* @__PURE__ */ e(Ys, { ev: p, sizeMeta: d })
7075
7090
  ] })
7076
7091
  ) : (
7077
7092
  // Small/Medium: Simple list only
@@ -7081,7 +7096,7 @@ function Ws({
7081
7096
  ev: E,
7082
7097
  sizeMeta: d,
7083
7098
  isSelected: R === N,
7084
- onClick: (P) => S(P, R)
7099
+ onClick: (P) => z(P, R)
7085
7100
  },
7086
7101
  E._id || E.id || R
7087
7102
  )) })
@@ -7257,7 +7272,7 @@ function Qs({
7257
7272
  onPin: N,
7258
7273
  ...y
7259
7274
  }) {
7260
- const [r, v] = B(u), d = de(t), g = me[d], S = Xs[d], F = (P, j) => {
7275
+ const [r, v] = B(u), d = de(t), p = me[d], z = Xs[d], F = (P, j) => {
7261
7276
  v(j), i?.(P);
7262
7277
  }, E = (P) => {
7263
7278
  const j = { ...P, starred: !P.starred };
@@ -7269,7 +7284,7 @@ function Qs({
7269
7284
  return /* @__PURE__ */ n(
7270
7285
  oe,
7271
7286
  {
7272
- className: `flex flex-col ${g.card} ${S.wrap}`,
7287
+ className: `flex flex-col ${p.card} ${z.wrap}`,
7273
7288
  showCheckbox: a,
7274
7289
  checkboxPosition: s,
7275
7290
  onSelect: i,
@@ -7277,13 +7292,13 @@ function Qs({
7277
7292
  details: { type: "emails", title: m, count: o?.length ?? 0 },
7278
7293
  ...y,
7279
7294
  children: [
7280
- /* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${g.title}`, children: m }) }),
7295
+ /* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${p.title}`, children: m }) }),
7281
7296
  /* @__PURE__ */ e(ge, { placeholder: "Type to search..." }),
7282
7297
  /* @__PURE__ */ e("div", { className: "space-y-0", children: o.map((P, j) => /* @__PURE__ */ e(
7283
7298
  Hs,
7284
7299
  {
7285
7300
  email: P,
7286
- sizeMeta: S,
7301
+ sizeMeta: z,
7287
7302
  isSelected: j === r,
7288
7303
  onClick: (U) => F(U, j),
7289
7304
  onStar: E,
@@ -7509,9 +7524,9 @@ function al({
7509
7524
  selectedIndex: u = 0,
7510
7525
  ...h
7511
7526
  }) {
7512
- const [N, y] = B(u), r = de(t), v = me[r], d = Ks[r], g = (E, R) => {
7527
+ const [N, y] = B(u), r = de(t), v = me[r], d = Ks[r], p = (E, R) => {
7513
7528
  y(R), i?.(E);
7514
- }, S = o[N] || o[0], F = d.layout === "split";
7529
+ }, z = o[N] || o[0], F = d.layout === "split";
7515
7530
  return /* @__PURE__ */ n(
7516
7531
  oe,
7517
7532
  {
@@ -7532,14 +7547,14 @@ function al({
7532
7547
  contact: E,
7533
7548
  sizeMeta: d,
7534
7549
  isSelected: R === N,
7535
- onClick: (P) => g(P, R)
7550
+ onClick: (P) => p(P, R)
7536
7551
  },
7537
7552
  E._id || E.id || R
7538
7553
  )) }),
7539
7554
  /* @__PURE__ */ e(
7540
7555
  el,
7541
7556
  {
7542
- contact: S,
7557
+ contact: z,
7543
7558
  sizeMeta: d
7544
7559
  }
7545
7560
  )
@@ -7551,7 +7566,7 @@ function al({
7551
7566
  contact: E,
7552
7567
  sizeMeta: d,
7553
7568
  isSelected: R === N,
7554
- onClick: (P) => g(P, R)
7569
+ onClick: (P) => p(P, R)
7555
7570
  },
7556
7571
  E._id || E.id || R
7557
7572
  )) })
@@ -7661,11 +7676,11 @@ function sl({
7661
7676
  ],
7662
7677
  ...r
7663
7678
  }) {
7664
- const v = de(t), d = me[v], g = nl[v];
7679
+ const v = de(t), d = me[v], p = nl[v];
7665
7680
  return /* @__PURE__ */ n(
7666
7681
  oe,
7667
7682
  {
7668
- className: `flex flex-col ${d.card} ${g.wrap}`,
7683
+ className: `flex flex-col ${d.card} ${p.wrap}`,
7669
7684
  showCheckbox: a,
7670
7685
  checkboxPosition: s,
7671
7686
  onSelect: i,
@@ -7680,11 +7695,11 @@ function sl({
7680
7695
  /* @__PURE__ */ e(Nt, { className: "h-4 w-4 opacity-70" })
7681
7696
  ] })
7682
7697
  ] }),
7683
- /* @__PURE__ */ n("div", { className: g.topGrid || g.grid, children: [
7698
+ /* @__PURE__ */ n("div", { className: p.topGrid || p.grid, children: [
7684
7699
  /* @__PURE__ */ n("div", { className: "space-y-4", children: [
7685
7700
  /* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Account Balance" }),
7686
- /* @__PURE__ */ e("div", { className: g.balance, children: Te(u) }),
7687
- !g.showTxns && /* @__PURE__ */ n("div", { className: g.totalsRow, children: [
7701
+ /* @__PURE__ */ e("div", { className: p.balance, children: Te(u) }),
7702
+ !p.showTxns && /* @__PURE__ */ n("div", { className: p.totalsRow, children: [
7688
7703
  /* @__PURE__ */ n("div", { children: [
7689
7704
  /* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Charges" }),
7690
7705
  /* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children: Te(h) })
@@ -7695,8 +7710,8 @@ function sl({
7695
7710
  ] })
7696
7711
  ] })
7697
7712
  ] }),
7698
- g.showTxns && /* @__PURE__ */ n("div", { className: "space-y-4", children: [
7699
- /* @__PURE__ */ n("div", { className: g.totalsRow, children: [
7713
+ p.showTxns && /* @__PURE__ */ n("div", { className: "space-y-4", children: [
7714
+ /* @__PURE__ */ n("div", { className: p.totalsRow, children: [
7700
7715
  /* @__PURE__ */ n("div", { children: [
7701
7716
  /* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Charges" }),
7702
7717
  /* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children: Te(h) })
@@ -7706,16 +7721,16 @@ function sl({
7706
7721
  /* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-green-600", children: Te(N) })
7707
7722
  ] })
7708
7723
  ] }),
7709
- /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: y.slice(0, 2).map((S, F) => /* @__PURE__ */ e(
7724
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: y.slice(0, 2).map((z, F) => /* @__PURE__ */ e(
7710
7725
  rl,
7711
7726
  {
7712
7727
  side: F === 0 ? "left" : "right",
7713
- date: S.date,
7714
- title: S.title,
7715
- amount: S.amount,
7716
- kind: S.kind
7728
+ date: z.date,
7729
+ title: z.title,
7730
+ amount: z.amount,
7731
+ kind: z.kind
7717
7732
  },
7718
- S.id || F
7733
+ z.id || F
7719
7734
  )) })
7720
7735
  ] })
7721
7736
  ] }),
@@ -7723,7 +7738,7 @@ function sl({
7723
7738
  "button",
7724
7739
  {
7725
7740
  type: "button",
7726
- className: `mt-4 w-full inline-flex items-center justify-center gap-2 rounded-xl border text-sm ${g.buttonPad}
7741
+ className: `mt-4 w-full inline-flex items-center justify-center gap-2 rounded-xl border text-sm ${p.buttonPad}
7727
7742
  border-orange-400 text-zinc-900 dark:text-zinc-100 bg-white dark:bg-zinc-900`,
7728
7743
  "aria-label": "View Transactions (mock)",
7729
7744
  children: [
@@ -7834,11 +7849,11 @@ function il({
7834
7849
  term: o = "Fall 2025",
7835
7850
  ...u
7836
7851
  }) {
7837
- const [h, N] = B("vacation"), [y, r] = B(!1), v = de(t), d = me[v], g = ll[v], S = Ye.find((F) => F.id === h) || Ye[0];
7852
+ const [h, N] = B("vacation"), [y, r] = B(!1), v = de(t), d = me[v], p = ll[v], z = Ye.find((F) => F.id === h) || Ye[0];
7838
7853
  return /* @__PURE__ */ n(
7839
7854
  oe,
7840
7855
  {
7841
- className: `flex flex-col ${d.card} ${g.wrap}`,
7856
+ className: `flex flex-col ${d.card} ${p.wrap}`,
7842
7857
  showCheckbox: a,
7843
7858
  checkboxPosition: s,
7844
7859
  onSelect: i,
@@ -7848,8 +7863,8 @@ function il({
7848
7863
  children: [
7849
7864
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
7850
7865
  /* @__PURE__ */ n("div", { children: [
7851
- /* @__PURE__ */ e("h3", { className: `text-zinc-900 dark:text-zinc-100 ${g.title} mb-1`, children: m }),
7852
- /* @__PURE__ */ n("div", { className: `text-zinc-600 dark:text-zinc-400 ${g.term} flex items-center gap-2`, children: [
7866
+ /* @__PURE__ */ e("h3", { className: `text-zinc-900 dark:text-zinc-100 ${p.title} mb-1`, children: m }),
7867
+ /* @__PURE__ */ n("div", { className: `text-zinc-600 dark:text-zinc-400 ${p.term} flex items-center gap-2`, children: [
7853
7868
  /* @__PURE__ */ e(Wt, { className: "h-4 w-4" }),
7854
7869
  "Term - ",
7855
7870
  o
@@ -7870,28 +7885,28 @@ function il({
7870
7885
  ] })
7871
7886
  ] })
7872
7887
  ] }),
7873
- g.showTabs && /* @__PURE__ */ e("div", { className: "flex border-b border-zinc-200 dark:border-zinc-800", children: Ye.map((F) => /* @__PURE__ */ e(
7888
+ p.showTabs && /* @__PURE__ */ e("div", { className: "flex border-b border-zinc-200 dark:border-zinc-800", children: Ye.map((F) => /* @__PURE__ */ e(
7874
7889
  "button",
7875
7890
  {
7876
- className: `flex-1 py-2 px-4 text-center ${g.tab} font-medium border-b-2 transition-colors duration-200 ${h === F.id ? "border-blue-500 text-blue-600 dark:text-blue-400" : "border-transparent text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100"}`,
7891
+ className: `flex-1 py-2 px-4 text-center ${p.tab} font-medium border-b-2 transition-colors duration-200 ${h === F.id ? "border-blue-500 text-blue-600 dark:text-blue-400" : "border-transparent text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100"}`,
7877
7892
  onClick: () => N(F.id),
7878
7893
  children: F.name.split(" ")[0]
7879
7894
  },
7880
7895
  F.id
7881
7896
  )) }),
7882
- /* @__PURE__ */ e("div", { className: "space-y-4 mb-6", children: g.showAllLeave ? (
7897
+ /* @__PURE__ */ e("div", { className: "space-y-4 mb-6", children: p.showAllLeave ? (
7883
7898
  // LG: Show all leave types
7884
- Ye.map((F) => /* @__PURE__ */ e(Gt, { leave: F, sizeMeta: g }, F.id))
7885
- ) : g.showSingleLeave ? (
7899
+ Ye.map((F) => /* @__PURE__ */ e(Gt, { leave: F, sizeMeta: p }, F.id))
7900
+ ) : p.showSingleLeave ? (
7886
7901
  // MD: Show active tab leave type
7887
- /* @__PURE__ */ e(Gt, { leave: S, sizeMeta: g })
7902
+ /* @__PURE__ */ e(Gt, { leave: z, sizeMeta: p })
7888
7903
  ) : (
7889
7904
  // SM: Show only available hours
7890
7905
  /* @__PURE__ */ e("div", { className: "bg-white dark:bg-zinc-900 rounded-lg border border-zinc-200 dark:border-zinc-800 p-4", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-3 mb-3", children: [
7891
7906
  /* @__PURE__ */ e(Ae, { className: "h-5 w-5 text-blue-600 dark:text-blue-400" }),
7892
7907
  /* @__PURE__ */ n("div", { children: [
7893
- /* @__PURE__ */ e("div", { className: `font-medium text-zinc-900 dark:text-zinc-100 ${g.table}`, children: "Available Leave" }),
7894
- /* @__PURE__ */ e("div", { className: `text-zinc-600 dark:text-zinc-400 ${g.table}`, children: S.available })
7908
+ /* @__PURE__ */ e("div", { className: `font-medium text-zinc-900 dark:text-zinc-100 ${p.table}`, children: "Available Leave" }),
7909
+ /* @__PURE__ */ e("div", { className: `text-zinc-600 dark:text-zinc-400 ${p.table}`, children: z.available })
7895
7910
  ] })
7896
7911
  ] }) })
7897
7912
  ) }),
@@ -8271,9 +8286,9 @@ function fl({
8271
8286
  showBanner: u = !0,
8272
8287
  ...h
8273
8288
  }) {
8274
- const [N, y] = B(o), r = de(t), v = me[r], d = hl[r], g = (E) => {
8289
+ const [N, y] = B(o), r = de(t), v = me[r], d = hl[r], p = (E) => {
8275
8290
  y((R) => R.filter((P) => P.id !== E.id));
8276
- }, S = N.find((E) => E.type === "banner"), F = N.filter((E) => E.type !== "banner");
8291
+ }, z = N.find((E) => E.type === "banner"), F = N.filter((E) => E.type !== "banner");
8277
8292
  return /* @__PURE__ */ n(
8278
8293
  oe,
8279
8294
  {
@@ -8286,11 +8301,11 @@ function fl({
8286
8301
  ...h,
8287
8302
  children: [
8288
8303
  /* @__PURE__ */ e("div", { className: "flex items-center justify-between ", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${v.title}`, children: m }) }),
8289
- u && S && t !== "sm" && /* @__PURE__ */ e(
8304
+ u && z && t !== "sm" && /* @__PURE__ */ e(
8290
8305
  bl,
8291
8306
  {
8292
- alert: S,
8293
- onDismiss: g
8307
+ alert: z,
8308
+ onDismiss: p
8294
8309
  }
8295
8310
  ),
8296
8311
  /* @__PURE__ */ e("div", { className: "space-y-0.5", children: F.slice(0, 3).map((E) => /* @__PURE__ */ e(
@@ -8298,7 +8313,7 @@ function fl({
8298
8313
  {
8299
8314
  alert: E,
8300
8315
  sizeMeta: d,
8301
- onDismiss: g
8316
+ onDismiss: p
8302
8317
  },
8303
8318
  E.id
8304
8319
  )) }),