unifyedx-storybook-new 0.2.8 → 0.2.13

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,6 +1,6 @@
1
1
  import { jsxs as l, jsx as e, Fragment as ee } from "react/jsx-runtime";
2
- import ae, { useState as O, useMemo as ce, useId as ea, Fragment as Q, useEffect as X, useCallback as K, useRef as ue } from "react";
3
- import { a as J, U as ut, X as ye, P as _, L as mt, C as je, b as Ge, f as Ve, d as va, D as Na, F as ht, e as pt, h as gt, T as Ue, u as yt, i as ft, I as bt, j as vt, k as Nt, l as xt, m as kt, n as wt, S as xa, o as ka, M as Ct, p as St, q as wa, r as Dt, A as $t, E as Ft, s as Tt, t as At, v as Et, w as Rt, x as Ca, y as It, z as Sa, B as Da, G as zt, H as Pt, J as Bt, K as qe, N as aa, O as ta, Q as Lt, R as Ot, V as $a, W as Mt, Y as sa, Z as Vt, _ as Ut, $ as Fa, a0 as qt, a1 as jt, a2 as Gt, a3 as _t, a4 as Wt, a5 as Yt, a6 as Jt, a7 as Qt, a8 as Xt, a9 as Zt, aa as Ht, ab as Kt, ac as er, ad as ar, ae as tr } from "./vendor-zgKTz69B.js";
2
+ import ae, { useState as B, useMemo as ce, useId as ea, Fragment as Q, useEffect as X, useCallback as K, useRef as ue } from "react";
3
+ import { a as J, U as ut, X as ye, P as _, L as mt, C as je, b as Ge, f as Ue, d as va, D as Na, F as ht, e as pt, h as gt, T as Ve, u as yt, i as ft, I as bt, j as vt, k as Nt, l as xt, m as kt, n as wt, S as xa, o as ka, M as Ct, p as St, q as wa, r as Dt, A as $t, E as Ft, s as Tt, t as At, v as Et, w as Rt, x as Ca, y as It, z as Sa, B as Da, G as zt, H as Pt, J as Bt, K as qe, N as aa, O as ta, Q as Lt, R as Ot, V as $a, W as Mt, Y as sa, Z as Ut, _ as Vt, $ as Fa, a0 as qt, a1 as jt, a2 as Gt, a3 as _t, a4 as Wt, a5 as Yt, a6 as Jt, a7 as Qt, a8 as Xt, a9 as Zt, aa as Ht, ab as Kt, ac as er, ad as ar, ae as tr } from "./vendor-zgKTz69B.js";
4
4
  import { Popover as rr, PopoverButton as nr, PopoverPanel as sr, Transition as oe, Dialog as me, TransitionChild as ge, DialogPanel as Se, DialogTitle as _e, TabGroup as lr, TabList as or, Tab as re, TabPanels as ir, RadioGroup as ze, Listbox as Z, ListboxButton as cr, ListboxOptions as dr, ListboxOption as ur, SwitchGroup as mr, Switch as Ze, Menu as hr, MenuButton as pr, Portal as gr, MenuItems as yr, MenuItem as fr, DialogBackdrop as br } from "@headlessui/react";
5
5
  import { motion as ne, AnimatePresence as be } from "framer-motion";
6
6
  import { d as vr } from "./vendor-lodash-BD0xlZyL.js";
@@ -8,14 +8,14 @@ import { useFloating as Ta, offset as Aa, flip as Ea, shift as Ra, autoUpdate as
8
8
  import He, { debounce as Cr } from "lodash";
9
9
  import { toast as le, ToastContainer as Sr, Slide as Dr } from "react-toastify";
10
10
  import "react-toastify/dist/ReactToastify.css";
11
- import { P as $r, S as Fr, F as Tr, G as Ar, a as Er, E as Rr, b as Ir, C as zr, R as Pr, c as Br, d as Lr, e as Or, f as Mr, I as Vr, g as ia } from "./vendor-syncfusion-DGcZfoFG.js";
12
- const Ur = (t) => {
11
+ import { P as $r, S as Fr, F as Tr, G as Ar, a as Er, E as Rr, b as Ir, C as zr, R as Pr, c as Br, d as Lr, e as Or, f as Mr, I as Ur, g as ia } from "./vendor-syncfusion-DGcZfoFG.js";
12
+ const Vr = (t) => {
13
13
  let r = 2166136261;
14
14
  for (let s = 0; s < t.length; s++)
15
15
  r ^= t.charCodeAt(s), r += (r << 1) + (r << 4) + (r << 7) + (r << 8) + (r << 24);
16
16
  return r >>> 0;
17
17
  }, qr = (t) => {
18
- const r = (t ?? "").trim().toLowerCase(), s = parseInt((r.match(/\d+$/) ?? [0])[0], 10) || 0, o = Ur(r), n = (o % 360 + 37 * s) % 360, u = 55 + (o >>> 8) % 20, i = 30 + (o >>> 16) % 10, d = 86 + (o >>> 24) % 8, y = `hsl(${n}, ${u}%, ${d}%)`, b = `hsl(${n}, ${u}%, ${i}%)`;
18
+ const r = (t ?? "").trim().toLowerCase(), s = parseInt((r.match(/\d+$/) ?? [0])[0], 10) || 0, o = Vr(r), n = (o % 360 + 37 * s) % 360, u = 55 + (o >>> 8) % 20, i = 30 + (o >>> 16) % 10, d = 86 + (o >>> 24) % 8, y = `hsl(${n}, ${u}%, ${d}%)`, b = `hsl(${n}, ${u}%, ${i}%)`;
19
19
  return { bg: y, text: b };
20
20
  }, jr = (t = "") => t.split(" ").map((r) => r[0]).slice(0, 2).join("").toUpperCase(), za = ({
21
21
  src: t,
@@ -29,7 +29,7 @@ const Ur = (t) => {
29
29
  className: u,
30
30
  ...i
31
31
  }) => {
32
- const [d, y] = O(!1), b = ce(() => qr(r), []), N = t && !d, a = !N && r, k = !N && !r, m = J(
32
+ const [d, y] = B(!1), b = ce(() => qr(r), []), N = t && !d, a = !N && r, k = !N && !r, m = J(
33
33
  "avatar-container",
34
34
  `avatar--size-${s}`,
35
35
  u
@@ -276,10 +276,10 @@ const _r = {
276
276
  "datepicker-trigger--disabled": i
277
277
  }),
278
278
  disabled: i,
279
- "aria-label": t ? `Selected date is ${Ve(t, "PPP")}` : o,
279
+ "aria-label": t ? `Selected date is ${Ue(t, "PPP")}` : o,
280
280
  children: [
281
281
  /* @__PURE__ */ e(va, { className: "datepicker-icon" }),
282
- t ? /* @__PURE__ */ e("span", { className: "datepicker-value", children: Ve(t, "PPP") }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: o })
282
+ t ? /* @__PURE__ */ e("span", { className: "datepicker-value", children: Ue(t, "PPP") }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: o })
283
283
  ]
284
284
  }
285
285
  ),
@@ -322,9 +322,9 @@ const _r = {
322
322
  const b = t?.from, N = t?.to, a = (m) => {
323
323
  m.stopPropagation(), m.preventDefault(), s?.();
324
324
  }, k = b && N ? /* @__PURE__ */ l(ee, { children: [
325
- Ve(b, "MMM d, y"),
325
+ Ue(b, "MMM d, y"),
326
326
  " - ",
327
- Ve(N, "MMM d, y")
327
+ Ue(N, "MMM d, y")
328
328
  ] }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: o });
329
329
  return /* @__PURE__ */ l("div", { className: J("datepicker-wrapper", d), children: [
330
330
  n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "daterangepicker-input", children: n }),
@@ -714,7 +714,7 @@ const _r = {
714
714
  $ && /* @__PURE__ */ l("div", { className: "file-list-container", children: [
715
715
  /* @__PURE__ */ e("h3", { children: "Upload Queue" }),
716
716
  /* @__PURE__ */ l("ul", { className: "file-list", children: [
717
- i.map((L, E) => /* @__PURE__ */ l(
717
+ i.map((L, O) => /* @__PURE__ */ l(
718
718
  "li",
719
719
  {
720
720
  className: "file-item",
@@ -735,16 +735,16 @@ const _r = {
735
735
  "button",
736
736
  {
737
737
  type: "button",
738
- onClick: () => y(E),
738
+ onClick: () => y(O),
739
739
  className: "remove-file-button",
740
- children: /* @__PURE__ */ e(Ue, { size: 16 })
740
+ children: /* @__PURE__ */ e(Ve, { size: 16 })
741
741
  }
742
742
  )
743
743
  ]
744
744
  },
745
- `${L.name}-${E}`
745
+ `${L.name}-${O}`
746
746
  )),
747
- d.map(({ file: L, message: E }, C) => /* @__PURE__ */ l(
747
+ d.map(({ file: L, message: O }, C) => /* @__PURE__ */ l(
748
748
  "li",
749
749
  {
750
750
  className: "file-item file-item--rejected",
@@ -759,7 +759,7 @@ const _r = {
759
759
  /* @__PURE__ */ l("div", { children: [
760
760
  /* @__PURE__ */ e("p", { className: "file-item-name", children: L.name }),
761
761
  /* @__PURE__ */ e("p", { className: "file-item-size", children: ua(L.size) }),
762
- /* @__PURE__ */ e("p", { className: "rejection-reason", children: E })
762
+ /* @__PURE__ */ e("p", { className: "rejection-reason", children: O })
763
763
  ] })
764
764
  ] }),
765
765
  /* @__PURE__ */ e(
@@ -768,7 +768,7 @@ const _r = {
768
768
  type: "button",
769
769
  onClick: () => b(C),
770
770
  className: "remove-file-button",
771
- children: /* @__PURE__ */ e(Ue, { size: 16 })
771
+ children: /* @__PURE__ */ e(Ve, { size: 16 })
772
772
  }
773
773
  )
774
774
  ]
@@ -817,63 +817,63 @@ const _r = {
817
817
  fetchCreatedOrUpdatedByUsers: i = async () => []
818
818
  // Mockable fetcher
819
819
  }) => {
820
- const [d, y] = O({
820
+ const [d, y] = B({
821
821
  createdBy: [],
822
822
  updatedBy: []
823
- }), [b, N] = O({
823
+ }), [b, N] = B({
824
824
  createdBy: !1,
825
825
  updatedBy: !1
826
826
  }), a = yt({
827
827
  initialValues: JSON.parse(JSON.stringify(u)),
828
828
  // Deep copy
829
829
  onSubmit: (C) => {
830
- const I = {};
831
- Object.keys(C).forEach((P) => {
832
- I[P] = {
833
- operator: C[P].operator || "in",
834
- values: Array.isArray(C[P].values) ? C[P].values : [],
835
- range: C[P].range || null
830
+ const T = {};
831
+ Object.keys(C).forEach((I) => {
832
+ T[I] = {
833
+ operator: C[I].operator || "in",
834
+ values: Array.isArray(C[I].values) ? C[I].values : [],
835
+ range: C[I].range || null
836
836
  };
837
- }), console.log("[storybook filter] Applied Filters:", I), typeof s == "function" && s({
838
- filters: I,
837
+ }), console.log("[storybook filter] Applied Filters:", T), typeof s == "function" && s({
838
+ filters: T,
839
839
  activeCount: m
840
840
  }), r();
841
841
  },
842
842
  enableReinitialize: !0
843
- }), k = ce(() => n.reduce((C, I) => {
844
- const P = I.key, A = a.values[P];
845
- let U = !1;
846
- if (A)
847
- switch (I.type) {
843
+ }), k = ce(() => n.reduce((C, T) => {
844
+ const I = T.key, E = a.values[I];
845
+ let V = !1;
846
+ if (E)
847
+ switch (T.type) {
848
848
  case "multiselect":
849
849
  case "multiselect-users":
850
- U = Array.isArray(A.values) && A.values.length > 0;
850
+ V = Array.isArray(E.values) && E.values.length > 0;
851
851
  break;
852
852
  case "date":
853
- (A.range && A.range !== "" || Array.isArray(A.values) && A.values.length > 0) && (U = !0);
853
+ (E.range && E.range !== "" || Array.isArray(E.values) && E.values.length > 0) && (V = !0);
854
854
  break;
855
855
  }
856
- return C[P] = U, C;
857
- }, {}), [n, a.values]), m = Object.values(k).filter(Boolean).length, g = async (C, I) => {
856
+ return C[I] = V, C;
857
+ }, {}), [n, a.values]), m = Object.values(k).filter(Boolean).length, g = async (C, T) => {
858
858
  try {
859
- N((A) => ({ ...A, [C]: !0 }));
860
- const P = await i(C, I);
861
- y((A) => ({ ...A, [C]: P }));
862
- } catch (P) {
863
- console.error(`Error fetching ${C} users:`, P);
859
+ N((E) => ({ ...E, [C]: !0 }));
860
+ const I = await i(C, T);
861
+ y((E) => ({ ...E, [C]: I }));
862
+ } catch (I) {
863
+ console.error(`Error fetching ${C} users:`, I);
864
864
  } finally {
865
- N((P) => ({ ...P, [C]: !1 }));
865
+ N((I) => ({ ...I, [C]: !1 }));
866
866
  }
867
867
  }, $ = (C) => {
868
- const I = n[C].key, P = n[C].url;
869
- n[C].type === "multiselect-users" && d[I].length === 0 && !b[I] && g(I, P);
868
+ const T = n[C].key, I = n[C].url;
869
+ n[C].type === "multiselect-users" && d[T].length === 0 && !b[T] && g(T, I);
870
870
  }, L = () => {
871
871
  a.resetForm(), y({ createdBy: [], updatedBy: [] }), o();
872
- }, E = (C) => {
873
- const I = n.find((U) => U.key === C);
874
- if (!I) return null;
875
- const P = a.values[C] || u[C], A = Array.isArray(P.values) ? P.values : [];
876
- switch (I.type) {
872
+ }, O = (C) => {
873
+ const T = n.find((V) => V.key === C);
874
+ if (!T) return null;
875
+ const I = a.values[C] || u[C], E = Array.isArray(I.values) ? I.values : [];
876
+ switch (T.type) {
877
877
  case "multiselect":
878
878
  return /* @__PURE__ */ l("div", { className: "filter-panel-content", children: [
879
879
  /* @__PURE__ */ l("div", { className: "filter-operator-group", children: [
@@ -881,10 +881,10 @@ const _r = {
881
881
  /* @__PURE__ */ e(
882
882
  "select",
883
883
  {
884
- value: P.operator || "in",
884
+ value: I.operator || "in",
885
885
  onChange: (c) => a.setFieldValue(`${C}.operator`, c.target.value),
886
886
  className: "filter-select",
887
- children: I.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Includes" : "Excludes" }, c))
887
+ children: T.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Includes" : "Excludes" }, c))
888
888
  }
889
889
  )
890
890
  ] }),
@@ -896,9 +896,9 @@ const _r = {
896
896
  type: "checkbox",
897
897
  id: `select-all-${C}`,
898
898
  className: "filter-checkbox-input",
899
- checked: I.options.length > 0 && A.length === I.options.length,
899
+ checked: T.options.length > 0 && E.length === T.options.length,
900
900
  onChange: (c) => {
901
- const h = c.target.checked ? I.options.map((x) => x.value) : [];
901
+ const h = c.target.checked ? T.options.map((x) => x.value) : [];
902
902
  a.setFieldValue(`${C}.values`, h);
903
903
  }
904
904
  }
@@ -912,16 +912,16 @@ const _r = {
912
912
  }
913
913
  )
914
914
  ] }),
915
- I.options.map((c) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
915
+ T.options.map((c) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
916
916
  /* @__PURE__ */ e(
917
917
  "input",
918
918
  {
919
919
  type: "checkbox",
920
920
  id: `${C}-${c.value}`,
921
921
  className: "filter-checkbox-input",
922
- checked: A.includes(c.value),
922
+ checked: E.includes(c.value),
923
923
  onChange: (h) => {
924
- const x = h.target.checked ? [...A, c.value] : A.filter((F) => F !== c.value);
924
+ const x = h.target.checked ? [...E, c.value] : E.filter((F) => F !== c.value);
925
925
  a.setFieldValue(`${C}.values`, x);
926
926
  }
927
927
  }
@@ -938,21 +938,21 @@ const _r = {
938
938
  ] })
939
939
  ] });
940
940
  case "multiselect-users":
941
- const U = d[C] || [], q = b[C];
941
+ const V = d[C] || [], q = b[C];
942
942
  return /* @__PURE__ */ l("div", { className: "filter-panel-content", children: [
943
943
  /* @__PURE__ */ l("div", { className: "filter-operator-group", children: [
944
944
  /* @__PURE__ */ e("label", { className: "filter-label", children: "Operator:" }),
945
945
  /* @__PURE__ */ e(
946
946
  "select",
947
947
  {
948
- value: P.operator || "in",
948
+ value: I.operator || "in",
949
949
  onChange: (c) => a.setFieldValue(`${C}.operator`, c.target.value),
950
950
  className: "filter-select",
951
- children: I.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Includes" : "Excludes" }, c))
951
+ children: T.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Includes" : "Excludes" }, c))
952
952
  }
953
953
  )
954
954
  ] }),
955
- q ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: U.length > 0 ? /* @__PURE__ */ l(ee, { children: [
955
+ q ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: V.length > 0 ? /* @__PURE__ */ l(ee, { children: [
956
956
  /* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
957
957
  /* @__PURE__ */ e(
958
958
  "input",
@@ -960,9 +960,9 @@ const _r = {
960
960
  type: "checkbox",
961
961
  id: `select-all-users-${C}`,
962
962
  className: "filter-checkbox-input",
963
- checked: U.length > 0 && A.length === U.length,
963
+ checked: V.length > 0 && E.length === V.length,
964
964
  onChange: (c) => {
965
- const h = c.target.checked ? U.map((x) => x.email) : [];
965
+ const h = c.target.checked ? V.map((x) => x.email) : [];
966
966
  a.setFieldValue(
967
967
  `${C}.values`,
968
968
  h
@@ -979,16 +979,16 @@ const _r = {
979
979
  }
980
980
  )
981
981
  ] }),
982
- U.map((c) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item createdby", children: [
982
+ V.map((c) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item createdby", children: [
983
983
  /* @__PURE__ */ e(
984
984
  "input",
985
985
  {
986
986
  type: "checkbox",
987
987
  id: `${C}-${c.email}`,
988
988
  className: "filter-checkbox-input",
989
- checked: A.includes(c.email),
989
+ checked: E.includes(c.email),
990
990
  onChange: (h) => {
991
- const x = h.target.checked ? [...A, c.email] : A.filter((F) => F !== c.email);
991
+ const x = h.target.checked ? [...E, c.email] : E.filter((F) => F !== c.email);
992
992
  a.setFieldValue(
993
993
  `${C}.values`,
994
994
  x
@@ -1011,7 +1011,7 @@ const _r = {
1011
1011
  ] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
1012
1012
  ] });
1013
1013
  case "date":
1014
- const G = P.values || [], [v, p] = G, f = v && p, w = {
1014
+ const G = I.values || [], [v, p] = G, f = v && p, w = {
1015
1015
  startDate: v instanceof Date ? v : /* @__PURE__ */ new Date(),
1016
1016
  // Fallback to today
1017
1017
  endDate: p instanceof Date ? p : /* @__PURE__ */ new Date(),
@@ -1024,10 +1024,10 @@ const _r = {
1024
1024
  /* @__PURE__ */ e(
1025
1025
  "select",
1026
1026
  {
1027
- value: P.operator,
1027
+ value: I.operator,
1028
1028
  onChange: (c) => a.setFieldValue(`${C}.operator`, c.target.value),
1029
1029
  className: "filter-select",
1030
- children: I.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Is" : "Is not" }, c))
1030
+ children: T.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Is" : "Is not" }, c))
1031
1031
  }
1032
1032
  ),
1033
1033
  f && /* @__PURE__ */ e(
@@ -1140,7 +1140,7 @@ const _r = {
1140
1140
  animate: { opacity: 1, x: 0 },
1141
1141
  transition: { duration: 0.3 },
1142
1142
  className: "h-full",
1143
- children: E(C.key)
1143
+ children: O(C.key)
1144
1144
  },
1145
1145
  C.key
1146
1146
  )
@@ -1213,7 +1213,7 @@ const _r = {
1213
1213
  ] });
1214
1214
  }, ma = {
1215
1215
  delete: {
1216
- icon: Ue,
1216
+ icon: Ve,
1217
1217
  iconClass: "icon--delete",
1218
1218
  primaryButtonCategory: "danger"
1219
1219
  // Assuming you add a 'danger' category to your Button
@@ -1313,7 +1313,7 @@ const _r = {
1313
1313
  onItemsPerPageChange: n,
1314
1314
  itemsPerPageOptions: u = [10, 15, 20]
1315
1315
  }) => {
1316
- const i = Math.ceil(r / s), [d, y] = O(t);
1316
+ const i = Math.ceil(r / s), [d, y] = B(t);
1317
1317
  X(() => {
1318
1318
  y(t);
1319
1319
  }, [t]);
@@ -1401,7 +1401,7 @@ const _r = {
1401
1401
  )
1402
1402
  ] })
1403
1403
  ] });
1404
- }, Va = ({
1404
+ }, Ua = ({
1405
1405
  label: t,
1406
1406
  value: r,
1407
1407
  // The currently selected option's value (e.g., 'work')
@@ -1457,7 +1457,7 @@ const _r = {
1457
1457
  customClass: u = "",
1458
1458
  ...i
1459
1459
  }) => {
1460
- const [d, y] = O(t);
1460
+ const [d, y] = B(t);
1461
1461
  X(() => {
1462
1462
  y(t);
1463
1463
  }, [t]);
@@ -1504,7 +1504,7 @@ const _r = {
1504
1504
  // From RHF's <Controller>
1505
1505
  showSearch: y = !0
1506
1506
  }) => {
1507
- const [b, N] = O(""), a = b === "" ? o : o.filter(
1507
+ const [b, N] = B(""), a = b === "" ? o : o.filter(
1508
1508
  (m) => m.label.toLowerCase().includes(b.toLowerCase())
1509
1509
  ), k = o.find((m) => r?.id ? m.id === r.id : m.id === r || m.value === r);
1510
1510
  return /* @__PURE__ */ e(Z, { value: r, onChange: s, disabled: u, children: /* @__PURE__ */ l("div", { className: "select-wrapper", ref: d, children: [
@@ -1571,7 +1571,7 @@ const _r = {
1571
1571
  i && /* @__PURE__ */ e("p", { className: "select-error-message", children: i })
1572
1572
  ] }) });
1573
1573
  }, Hr = () => {
1574
- const [t, r] = O(window.location.pathname);
1574
+ const [t, r] = B(window.location.pathname);
1575
1575
  return X(() => {
1576
1576
  const s = () => {
1577
1577
  r(window.location.pathname);
@@ -1585,8 +1585,8 @@ const _r = {
1585
1585
  if ((s.href || s.url || s.path) === r || s.children && na(s.children, r))
1586
1586
  return s;
1587
1587
  return null;
1588
- }, Ua = ({ item: t, isCollapsed: r, level: s = 0 }) => {
1589
- const { pathname: o } = Hr(), n = t.href || t.url || t.path, [u, i] = O(!1), d = t.icon;
1588
+ }, Va = ({ item: t, isCollapsed: r, level: s = 0 }) => {
1589
+ const { pathname: o } = Hr(), n = t.href || t.url || t.path, [u, i] = B(!1), d = t.icon;
1590
1590
  X(() => {
1591
1591
  na([t], o) && i(!0);
1592
1592
  }, [t, o]);
@@ -1644,7 +1644,7 @@ const _r = {
1644
1644
  }),
1645
1645
  "aria-hidden": !u || r,
1646
1646
  children: t.children.map((a) => /* @__PURE__ */ e(
1647
- Ua,
1647
+ Va,
1648
1648
  {
1649
1649
  item: a,
1650
1650
  isCollapsed: r,
@@ -1708,7 +1708,7 @@ const _r = {
1708
1708
  }
1709
1709
  )
1710
1710
  ] }),
1711
- /* @__PURE__ */ e("nav", { className: "sidebar-nav", "aria-label": "Primary", children: /* @__PURE__ */ e("ul", { className: "sidebar-nav-list", children: t.map((y) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(Ua, { item: y, isCollapsed: r }) }, y.label || y.name)) }) }),
1711
+ /* @__PURE__ */ e("nav", { className: "sidebar-nav", "aria-label": "Primary", children: /* @__PURE__ */ e("ul", { className: "sidebar-nav-list", children: t.map((y) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(Va, { item: y, isCollapsed: r }) }, y.label || y.name)) }) }),
1712
1712
  /* @__PURE__ */ l("div", { className: "sidebar-footer", children: [
1713
1713
  /* @__PURE__ */ e(za, { src: d.avatar, name: d.name, size: "medium" }),
1714
1714
  /* @__PURE__ */ l("div", { className: "user-info", children: [
@@ -1776,7 +1776,7 @@ const _r = {
1776
1776
  // ✅ New prop to control visibility
1777
1777
  ...d
1778
1778
  }) => {
1779
- const y = r || d.name, [b, N] = O(
1779
+ const y = r || d.name, [b, N] = B(
1780
1780
  d.value?.length || d.defaultValue?.length || 0
1781
1781
  ), a = (m) => {
1782
1782
  N(m.target.value.length), d.onChange && d.onChange(m);
@@ -2425,7 +2425,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2425
2425
  return pn(o);
2426
2426
  }
2427
2427
  }, oa = (t, r) => {
2428
- const [s, o] = O(t);
2428
+ const [s, o] = B(t);
2429
2429
  return X(
2430
2430
  () => {
2431
2431
  const n = Cr(() => {
@@ -2497,16 +2497,16 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2497
2497
  },
2498
2498
  isChanged: d = !1
2499
2499
  }) => {
2500
- const [y, b] = O(ga[0]), [N, a] = O(""), k = oa(N, 400), [m, g] = O([]), [$, L] = O(/* @__PURE__ */ new Set()), [E, C] = O(!1), [I, P] = O(ya[0]), {
2501
- control: A,
2502
- handleSubmit: U,
2500
+ const [y, b] = B(ga[0]), [N, a] = B(""), k = oa(N, 400), [m, g] = B([]), [$, L] = B(/* @__PURE__ */ new Set()), [O, C] = B(!1), [T, I] = B(ya[0]), {
2501
+ control: E,
2502
+ handleSubmit: V,
2503
2503
  watch: q,
2504
2504
  formState: { errors: G, isSubmitting: v }
2505
2505
  } = zt({
2506
2506
  defaultValues: { pendingInvites: [] },
2507
2507
  resolver: Lt(yn)
2508
2508
  }), { fields: p, append: f, remove: w, update: c } = Pt({
2509
- control: A,
2509
+ control: E,
2510
2510
  name: "pendingInvites"
2511
2511
  }), h = q("pendingInvites");
2512
2512
  X(() => {
@@ -2516,47 +2516,47 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2516
2516
  }, [k, y]);
2517
2517
  const x = (D) => {
2518
2518
  L((z) => {
2519
- const V = new Set(z);
2520
- return V.has(D) ? V.delete(D) : V.add(D), V;
2519
+ const U = new Set(z);
2520
+ return U.has(D) ? U.delete(D) : U.add(D), U;
2521
2521
  });
2522
2522
  }, F = () => {
2523
2523
  m.filter((D) => $.has(D.id)).forEach((D) => {
2524
- p.find((z) => z.id === D.id) || f({ ...D, permission: I.name });
2524
+ p.find((z) => z.id === D.id) || f({ ...D, permission: T.name });
2525
2525
  }), L(/* @__PURE__ */ new Set()), a("");
2526
2526
  }, R = (D) => {
2527
- P(D), p.forEach(
2528
- (z, V) => c(V, { ...p[V], permission: D.name })
2527
+ I(D), p.forEach(
2528
+ (z, U) => c(U, { ...p[U], permission: D.name })
2529
2529
  );
2530
2530
  }, j = async (D) => {
2531
2531
  try {
2532
2532
  if (n === se.DRIVE) {
2533
2533
  const z = {
2534
2534
  entity: t,
2535
- userGroupRolesObj: D.pendingInvites.map((V) => ({
2536
- id: V.id,
2537
- permission: V.permission,
2538
- type: V.type.toLowerCase()
2535
+ userGroupRolesObj: D.pendingInvites.map((U) => ({
2536
+ id: U.id,
2537
+ permission: U.permission,
2538
+ type: U.type.toLowerCase()
2539
2539
  }))
2540
2540
  };
2541
2541
  i(z, o);
2542
2542
  } else if (n === se.INTEREST) {
2543
- const z = D.pendingInvites.map((V) => ({
2544
- identity: V.id,
2545
- type: V.type.toLowerCase(),
2543
+ const z = D.pendingInvites.map((U) => ({
2544
+ identity: U.id,
2545
+ type: U.type.toLowerCase(),
2546
2546
  opt: !0,
2547
2547
  lock: !1,
2548
2548
  moderator: !1,
2549
- userName: V.name,
2549
+ userName: U.name,
2550
2550
  interestId: t?.data?.id
2551
2551
  }));
2552
2552
  i(z, o);
2553
2553
  } else if (n === se.ARTICLE) {
2554
2554
  const z = {
2555
2555
  entity: t,
2556
- userGroupRolesObj: D.pendingInvites.map((V) => ({
2557
- id: V.id,
2558
- permission: V.permission,
2559
- type: V.type.toLowerCase()
2556
+ userGroupRolesObj: D.pendingInvites.map((U) => ({
2557
+ id: U.id,
2558
+ permission: U.permission,
2559
+ type: U.type.toLowerCase()
2560
2560
  }))
2561
2561
  };
2562
2562
  i(z, o);
@@ -2569,9 +2569,9 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2569
2569
  throw console.error("Failed to submit invites:", z), z;
2570
2570
  }
2571
2571
  }, S = (D) => {
2572
- const z = o[y.code].find((V) => V.name === D.name) || h.find((V) => V.name === D.name);
2572
+ const z = o[y.code].find((U) => U.name === D.name) || h.find((U) => U.name === D.name);
2573
2573
  return z ? `${z.permission}` : "";
2574
- }, T = () => {
2574
+ }, A = () => {
2575
2575
  switch (n) {
2576
2576
  case se.DRIVE:
2577
2577
  return "Share with others";
@@ -2585,7 +2585,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2585
2585
  }, M = ce(() => $.size === 0 && !d, [$, d]);
2586
2586
  return /* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-white", children: [
2587
2587
  /* @__PURE__ */ l("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
2588
- /* @__PURE__ */ e(me.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: T() }),
2588
+ /* @__PURE__ */ e(me.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: A() }),
2589
2589
  /* @__PURE__ */ l("div", { className: "flex items-center gap-4", children: [
2590
2590
  n === se.DRIVE && /* @__PURE__ */ l("button", { className: "flex items-center gap-2 text-sm text-blue-600 hover:text-blue-800 font-semibold hover:cursor-pointer", children: [
2591
2591
  /* @__PURE__ */ e(Bt, { className: "h-5 w-5" }),
@@ -2664,7 +2664,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2664
2664
  value: N
2665
2665
  }
2666
2666
  ) }),
2667
- /* @__PURE__ */ e(be, { children: (m?.length > 0 || E) && /* @__PURE__ */ e(
2667
+ /* @__PURE__ */ e(be, { children: (m?.length > 0 || O) && /* @__PURE__ */ e(
2668
2668
  ne.div,
2669
2669
  {
2670
2670
  initial: { opacity: 0, y: -10 },
@@ -2672,7 +2672,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2672
2672
  exit: { opacity: 0, y: -10 },
2673
2673
  transition: { duration: 0.2 },
2674
2674
  className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
2675
- children: E ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ l(ee, { children: [
2675
+ children: O ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ l(ee, { children: [
2676
2676
  /* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: m.map((D) => {
2677
2677
  const z = S(D);
2678
2678
  return /* @__PURE__ */ l(
@@ -2748,15 +2748,15 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2748
2748
  n === se.DRIVE && /* @__PURE__ */ e(
2749
2749
  Z,
2750
2750
  {
2751
- value: I,
2751
+ value: T,
2752
2752
  onChange: R,
2753
2753
  children: /* @__PURE__ */ l("div", { className: "relative", children: [
2754
2754
  /* @__PURE__ */ l(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: [
2755
2755
  /* @__PURE__ */ l("span", { className: "flex items-center", children: [
2756
- /* @__PURE__ */ e(I.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
2756
+ /* @__PURE__ */ e(T.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
2757
2757
  /* @__PURE__ */ l("span", { className: "truncate", children: [
2758
2758
  "Can ",
2759
- I.name
2759
+ T.name
2760
2760
  ] })
2761
2761
  ] }),
2762
2762
  /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ e(aa, { className: "h-5 w-5 text-gray-400" }) })
@@ -2773,7 +2773,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2773
2773
  {
2774
2774
  value: D,
2775
2775
  className: ({ active: z }) => `${z ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
2776
- children: ({ selected: z, active: V }) => /* @__PURE__ */ l(ee, { children: [
2776
+ children: ({ selected: z, active: U }) => /* @__PURE__ */ l(ee, { children: [
2777
2777
  /* @__PURE__ */ l(
2778
2778
  "span",
2779
2779
  {
@@ -2782,7 +2782,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2782
2782
  /* @__PURE__ */ e(
2783
2783
  D.icon,
2784
2784
  {
2785
- className: `h-5 w-5 mr-2 ${V ? "text-white" : "text-gray-400"}`
2785
+ className: `h-5 w-5 mr-2 ${U ? "text-white" : "text-gray-400"}`
2786
2786
  }
2787
2787
  ),
2788
2788
  "Can ",
@@ -2868,7 +2868,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2868
2868
  /* @__PURE__ */ e(
2869
2869
  "button",
2870
2870
  {
2871
- onClick: U(j),
2871
+ onClick: V(j),
2872
2872
  disabled: v || h.length === 0 && M,
2873
2873
  className: "px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md shadow-sm hover:bg-blue-700 hover:cursor-pointer focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-blue-300 disabled:cursor-not-allowed",
2874
2874
  children: v ? "Inviting..." : n === se.DRIVE ? "Send Invites" : "Add"
@@ -2882,7 +2882,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2882
2882
  { name: "Can manage", icon: Da, value: "edit" },
2883
2883
  { name: "Remove", icon: Ot, isDestructive: !0, value: "remove" }
2884
2884
  ], bn = ({ item: t, allowedPermissions: r, onPermissionChange: s }) => {
2885
- const [o, n] = O(!1), { refs: u, floatingStyles: i, context: d } = Ta({
2885
+ const [o, n] = B(!1), { refs: u, floatingStyles: i, context: d } = Ta({
2886
2886
  open: o,
2887
2887
  onOpenChange: n,
2888
2888
  middleware: [Aa(8), Ea(), Ra({ padding: 8 })],
@@ -2970,28 +2970,31 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2970
2970
  existingShares: n,
2971
2971
  allowedPermissions: u
2972
2972
  }) => {
2973
- const [i, d] = O(n), [y, b] = O(0), [N, a] = O(""), k = oa(N, 300), m = {
2973
+ const [i, d] = B(n), [y, b] = B(0), [N, a] = B(""), k = oa(N, 300), m = {
2974
2974
  users: i.users.filter(
2975
- (E) => E.name.toLowerCase().includes(k.toLowerCase())
2975
+ (C) => C.name.toLowerCase().includes(k.toLowerCase())
2976
2976
  ),
2977
2977
  groups: i.groups.filter(
2978
- (E) => E.name.toLowerCase().includes(k.toLowerCase())
2978
+ (C) => C.name.toLowerCase().includes(k.toLowerCase())
2979
2979
  ),
2980
2980
  roles: i.roles.filter(
2981
- (E) => E.name.toLowerCase().includes(k.toLowerCase())
2981
+ (C) => C.name.toLowerCase().includes(k.toLowerCase())
2982
2982
  )
2983
- }, g = async (E, C, I, P) => {
2984
- const A = C.value;
2985
- d(A === "Remove" ? (U) => ({
2986
- ...U,
2987
- [I]: U[I].filter((q) => q.id !== E.id)
2988
- }) : (U) => ({
2989
- ...U,
2990
- [I]: U[I].map(
2991
- (q) => q.id === E.id ? { ...q, permission: A } : q
2983
+ }, g = async (C, T, I, E) => {
2984
+ const V = T.value;
2985
+ d((q) => ({
2986
+ ...q,
2987
+ [I]: q[I].map(
2988
+ (G) => G.id === C.id ? { ...G, permission: V } : G
2992
2989
  )
2993
2990
  }));
2994
- }, $ = ["users", "groups", "roles"], L = ["Users", "Groups", "Roles"];
2991
+ }, $ = () => {
2992
+ d((C) => ({
2993
+ users: C.users.filter((T) => T.permission !== "remove"),
2994
+ groups: C.groups.filter((T) => T.permission !== "remove"),
2995
+ roles: C.roles.filter((T) => T.permission !== "remove")
2996
+ }));
2997
+ }, L = ["users", "groups", "roles"], O = ["Users", "Groups", "Roles"];
2995
2998
  return (
2996
2999
  // The main structure remains the same...
2997
3000
  /* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-gray-50", children: [
@@ -3017,120 +3020,130 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3017
3020
  }
3018
3021
  )
3019
3022
  ] }),
3020
- /* @__PURE__ */ e("div", { className: "flex flex-col flex-grow", children: /* @__PURE__ */ l(re.Group, { selectedIndex: y, onChange: b, children: [
3021
- /* @__PURE__ */ l("div", { className: "p-4 bg-white border-b border-gray-300", children: [
3022
- /* @__PURE__ */ e(re.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: L.map((E) => /* @__PURE__ */ e(
3023
- re,
3024
- {
3025
- className: ({
3026
- selected: C
3027
- }) => `w-full py-2 text-sm font-medium leading-5 rounded-md
3023
+ /* @__PURE__ */ l("div", { className: "flex flex-col flex-grow", children: [
3024
+ /* @__PURE__ */ l(re.Group, { selectedIndex: y, onChange: b, children: [
3025
+ /* @__PURE__ */ l("div", { className: "p-4 bg-white border-b border-gray-300", children: [
3026
+ /* @__PURE__ */ e(re.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: O.map((C) => /* @__PURE__ */ e(
3027
+ re,
3028
+ {
3029
+ className: ({
3030
+ selected: T
3031
+ }) => `w-full py-2 text-sm font-medium leading-5 rounded-md
3028
3032
  focus:outline-none focus:ring-2 ring-offset-2 ring-offset-blue-400 ring-white ring-opacity-60
3029
- ${C ? "bg-white shadow text-blue-700" : "text-gray-600 hover:bg-white/[0.6]"}`,
3030
- children: E
3031
- },
3032
- E
3033
- )) }),
3034
- /* @__PURE__ */ e("div", { className: "mt-4", children: /* @__PURE__ */ e(
3035
- he,
3036
- {
3037
- onDebouncedChange: a,
3038
- value: N,
3039
- placeholder: `Search in ${L[y]}...`
3040
- }
3041
- ) })
3042
- ] }),
3043
- /* @__PURE__ */ e("div", { className: "flex-grow overflow-y-auto p-4 h-[calc(100vh-330px)]", children: /* @__PURE__ */ e(be, { mode: "wait", children: /* @__PURE__ */ e(
3044
- ne.div,
3045
- {
3046
- initial: { y: 10, opacity: 0 },
3047
- animate: { y: 0, opacity: 1 },
3048
- exit: { y: -10, opacity: 0 },
3049
- transition: { duration: 0.2 },
3050
- children: /* @__PURE__ */ e(re.Panels, { as: Q, children: $.map((E) => /* @__PURE__ */ e(
3051
- re.Panel,
3033
+ ${T ? "bg-white shadow text-blue-700" : "text-gray-600 hover:bg-white/[0.6]"}`,
3034
+ children: C
3035
+ },
3036
+ C
3037
+ )) }),
3038
+ /* @__PURE__ */ e("div", { className: "mt-4", children: /* @__PURE__ */ e(
3039
+ he,
3052
3040
  {
3053
- className: "space-y-3 focus:outline-none",
3054
- children: /* @__PURE__ */ e(be, { children: m[E].length > 0 ? m[E].map((C) => /* @__PURE__ */ l(
3055
- ne.div,
3056
- {
3057
- layout: !0,
3058
- initial: { opacity: 0, y: 20 },
3059
- animate: { opacity: 1, y: 0 },
3060
- exit: {
3061
- opacity: 0,
3062
- x: -20,
3063
- transition: { duration: 0.2 }
3064
- },
3065
- className: "flex items-center justify-between p-3 bg-white border border-gray-300 rounded-lg shadow-sm",
3066
- children: [
3067
- /* @__PURE__ */ l("div", { className: "flex items-center gap-3 overflow-hidden", children: [
3068
- /* @__PURE__ */ e(
3069
- "img",
3070
- {
3071
- src: C.avatarUrl || `https://avatar.vercel.sh/${C.name}.svg?text=${C.name.charAt(0)}`,
3072
- alt: C.name,
3073
- className: "w-10 h-10 rounded-full flex-shrink-0"
3074
- }
3075
- ),
3076
- /* @__PURE__ */ l("div", { className: "overflow-hidden", children: [
3077
- /* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children: C.name }),
3078
- E !== "users" && /* @__PURE__ */ e(
3079
- "button",
3080
- {
3081
- onClick: () => o({
3082
- id: C.id,
3083
- type: E,
3084
- name: C.name
3085
- }),
3086
- className: "text-sm text-blue-600 hover:underline hover:cursor-pointer",
3087
- children: "View Members"
3088
- }
3089
- )
3090
- ] })
3091
- ] }),
3092
- /* @__PURE__ */ e(
3093
- bn,
3094
- {
3095
- item: C,
3096
- allowedPermissions: u,
3097
- onPermissionChange: (I) => g(
3098
- C,
3099
- I,
3100
- E
3101
- )
3102
- }
3103
- )
3104
- ]
3105
- },
3106
- C.id
3107
- )) : (
3108
- // Empty state is unchanged
3109
- /* @__PURE__ */ l(
3041
+ onDebouncedChange: a,
3042
+ value: N,
3043
+ placeholder: `Search in ${O[y]}...`
3044
+ }
3045
+ ) })
3046
+ ] }),
3047
+ /* @__PURE__ */ e("div", { className: "flex-grow overflow-y-auto p-4 h-[calc(100vh-330px)]", children: /* @__PURE__ */ e(be, { mode: "wait", children: /* @__PURE__ */ e(
3048
+ ne.div,
3049
+ {
3050
+ initial: { y: 10, opacity: 0 },
3051
+ animate: { y: 0, opacity: 1 },
3052
+ exit: { y: -10, opacity: 0 },
3053
+ transition: { duration: 0.2 },
3054
+ children: /* @__PURE__ */ e(re.Panels, { as: Q, children: L.map((C) => /* @__PURE__ */ e(
3055
+ re.Panel,
3056
+ {
3057
+ className: "space-y-3 focus:outline-none",
3058
+ children: /* @__PURE__ */ e(be, { children: m[C].length > 0 ? m[C].map((T) => /* @__PURE__ */ l(
3110
3059
  ne.div,
3111
3060
  {
3112
- initial: { opacity: 0 },
3113
- animate: { opacity: 1 },
3114
- className: "flex flex-col items-center justify-center text-center p-8 mt-10 bg-white rounded-lg border border-gray-300",
3061
+ layout: !0,
3062
+ initial: { opacity: 0, y: 20 },
3063
+ animate: { opacity: 1, y: 0 },
3064
+ exit: {
3065
+ opacity: 0,
3066
+ x: -20,
3067
+ transition: { duration: 0.2 }
3068
+ },
3069
+ className: "flex items-center justify-between p-3 bg-white border border-gray-300 rounded-lg shadow-sm",
3115
3070
  children: [
3116
- /* @__PURE__ */ e(Ca, { className: "h-12 w-12 text-gray-400" }),
3117
- /* @__PURE__ */ l("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: [
3118
- "No ",
3119
- L[y],
3120
- " Found"
3071
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-3 overflow-hidden", children: [
3072
+ /* @__PURE__ */ e(
3073
+ "img",
3074
+ {
3075
+ src: T.avatarUrl || `https://avatar.vercel.sh/${T.name}.svg?text=${T.name.charAt(0)}`,
3076
+ alt: T.name,
3077
+ className: "w-10 h-10 rounded-full flex-shrink-0"
3078
+ }
3079
+ ),
3080
+ /* @__PURE__ */ l("div", { className: "overflow-hidden", children: [
3081
+ /* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children: T.name }),
3082
+ C !== "users" && /* @__PURE__ */ e(
3083
+ "button",
3084
+ {
3085
+ onClick: () => o({
3086
+ id: T.id,
3087
+ type: C,
3088
+ name: T.name
3089
+ }),
3090
+ className: "text-sm text-blue-600 hover:underline hover:cursor-pointer",
3091
+ children: "View Members"
3092
+ }
3093
+ )
3094
+ ] })
3121
3095
  ] }),
3122
- /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: N ? `No results for "${N}"` : `There are no ${L[y].toLowerCase()} with access.` })
3096
+ /* @__PURE__ */ e(
3097
+ bn,
3098
+ {
3099
+ item: T,
3100
+ allowedPermissions: u,
3101
+ onPermissionChange: (I) => g(
3102
+ T,
3103
+ I,
3104
+ C
3105
+ )
3106
+ }
3107
+ )
3123
3108
  ]
3124
- }
3125
- )
3126
- ) })
3127
- },
3128
- E
3129
- )) })
3130
- },
3131
- y
3132
- ) }) })
3133
- ] }) })
3109
+ },
3110
+ T.id
3111
+ )) : (
3112
+ // Empty state is unchanged
3113
+ /* @__PURE__ */ l(
3114
+ ne.div,
3115
+ {
3116
+ initial: { opacity: 0 },
3117
+ animate: { opacity: 1 },
3118
+ className: "flex flex-col items-center justify-center text-center p-8 mt-10 bg-white rounded-lg border border-gray-300",
3119
+ children: [
3120
+ /* @__PURE__ */ e(Ca, { className: "h-12 w-12 text-gray-400" }),
3121
+ /* @__PURE__ */ l("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: [
3122
+ "No ",
3123
+ O[y],
3124
+ " Found"
3125
+ ] }),
3126
+ /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: N ? `No results for "${N}"` : `There are no ${O[y].toLowerCase()} with access.` })
3127
+ ]
3128
+ }
3129
+ )
3130
+ ) })
3131
+ },
3132
+ C
3133
+ )) })
3134
+ },
3135
+ y
3136
+ ) }) })
3137
+ ] }),
3138
+ /* @__PURE__ */ e("div", { className: "p-4 bg-white border-t border-gray-300 flex justify-end", children: /* @__PURE__ */ e(
3139
+ "button",
3140
+ {
3141
+ onClick: $,
3142
+ className: "px-4 py-2 bg-blue-600 text-white rounded-md shadow hover:bg-blue-700",
3143
+ children: "Update"
3144
+ }
3145
+ ) })
3146
+ ] })
3134
3147
  ] })
3135
3148
  );
3136
3149
  }, Nn = () => /* @__PURE__ */ l("div", { className: "flex items-center gap-4 p-4", children: [
@@ -3146,7 +3159,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3146
3159
  onClose: s,
3147
3160
  members: o
3148
3161
  }) => {
3149
- const [n, u] = O(!0), [i, d] = O(""), y = oa(i, 300), b = o.filter(
3162
+ const [n, u] = B(!0), [i, d] = B(""), y = oa(i, 300), b = o.filter(
3150
3163
  (m) => m.name.toLowerCase().includes(y.toLowerCase())
3151
3164
  ), N = {
3152
3165
  hidden: { opacity: 0 },
@@ -3267,9 +3280,9 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3267
3280
  allowedPermissions: d = [],
3268
3281
  ...y
3269
3282
  }) => {
3270
- const [b, N] = O(de.INVITE), [a, k] = O(t), [m, g] = O(null), [$, L] = O(!1), [E, C] = O([]), [I, P] = O(de.MANAGE), A = () => {
3283
+ const [b, N] = B(de.INVITE), [a, k] = B(t), [m, g] = B(null), [$, L] = B(!1), [O, C] = B([]), [T, I] = B(de.MANAGE), E = () => {
3271
3284
  N(de.INVITE), g(null), u();
3272
- }, U = () => {
3285
+ }, V = () => {
3273
3286
  N(de.MANAGE);
3274
3287
  }, q = async ({ id: p, name: f, type: w }) => {
3275
3288
  if (w === "groups") {
@@ -3280,16 +3293,16 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3280
3293
  }
3281
3294
  C(resp);
3282
3295
  }
3283
- g({ id: p, type: w, name: f }), P(b), N(de.MEMBERS);
3296
+ g({ id: p, type: w, name: f }), I(b), N(de.MEMBERS);
3284
3297
  }, G = (p) => {
3285
3298
  k(p);
3286
3299
  const f = !He.isEqual(
3287
3300
  He.mapValues(t, (w) => w.map((c) => ({ id: c.id, permission: c.permission }))),
3288
3301
  He.mapValues(p, (w) => w.map((c) => ({ id: c.id, permission: c.permission })))
3289
3302
  );
3290
- L(f), N(b === de.MEMBERS ? I : de.INVITE);
3303
+ L(f), N(b === de.MEMBERS ? T : de.INVITE);
3291
3304
  };
3292
- return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: Q, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: A, children: [
3305
+ return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: Q, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: E, children: [
3293
3306
  /* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
3294
3307
  /* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(Se, { className: "filter-modal-panel", style: { background: "white" }, children: (() => {
3295
3308
  switch (b) {
@@ -3307,7 +3320,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3307
3320
  {
3308
3321
  entity: o,
3309
3322
  onBack: G,
3310
- onClose: A,
3323
+ onClose: E,
3311
3324
  onOpenMembers: q,
3312
3325
  existingShares: a,
3313
3326
  calledBy: n,
@@ -3331,10 +3344,10 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3331
3344
  {
3332
3345
  entity: m,
3333
3346
  onBack: G,
3334
- onClose: A,
3347
+ onClose: E,
3335
3348
  calledBy: n,
3336
3349
  existingShares: a,
3337
- members: E
3350
+ members: O
3338
3351
  }
3339
3352
  )
3340
3353
  },
@@ -3353,8 +3366,8 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3353
3366
  fn,
3354
3367
  {
3355
3368
  entity: o,
3356
- onManage: U,
3357
- onClose: A,
3369
+ onManage: V,
3370
+ onClose: E,
3358
3371
  existingShares: a,
3359
3372
  calledBy: n,
3360
3373
  showExistingShares: i,
@@ -3397,22 +3410,22 @@ function Ye({
3397
3410
  getOptionId: m = ($) => String($.id),
3398
3411
  getOptionLabel: g = ($) => $.name
3399
3412
  }) {
3400
- const $ = ea(), L = ea(), [E, C] = O(""), I = ue(""), P = ce(() => {
3413
+ const $ = ea(), L = ea(), [O, C] = B(""), T = ue(""), I = ce(() => {
3401
3414
  const p = /* @__PURE__ */ new Map();
3402
3415
  for (const f of r) p.set(m(f), f);
3403
3416
  return p;
3404
- }, [r, m]), A = ce(() => Array.isArray(s) ? s.map((p) => p && typeof p == "object" ? P.get(m(p)) || null : P.get(String(p))).filter(Boolean) : [], [s, P, m]), U = ce(() => {
3405
- if (!E) return r;
3406
- const p = E.toLowerCase();
3417
+ }, [r, m]), E = ce(() => Array.isArray(s) ? s.map((p) => p && typeof p == "object" ? I.get(m(p)) || null : I.get(String(p))).filter(Boolean) : [], [s, I, m]), V = ce(() => {
3418
+ if (!O) return r;
3419
+ const p = O.toLowerCase();
3407
3420
  return r.filter((f) => g(f).toLowerCase().includes(p));
3408
- }, [r, E, g]);
3421
+ }, [r, O, g]);
3409
3422
  X(() => {
3410
- b === "server" && E.length >= k && E !== I.current && (I.current = E, N && N(E));
3411
- }, [E, b, k, N]);
3412
- const q = b === "client" ? U : r, G = () => {
3413
- if (!A.length)
3423
+ b === "server" && O.length >= k && O !== T.current && (T.current = O, N && N(O));
3424
+ }, [O, b, k, N]);
3425
+ const q = b === "client" ? V : r, G = () => {
3426
+ if (!E.length)
3414
3427
  return /* @__PURE__ */ e("span", { className: "text-gray-500", children: u });
3415
- const p = A.slice(0, d), f = A.length - d;
3428
+ const p = E.slice(0, d), f = E.length - d;
3416
3429
  return /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2", children: [
3417
3430
  p.map((w) => /* @__PURE__ */ e(
3418
3431
  "span",
@@ -3429,7 +3442,7 @@ function Ye({
3429
3442
  ] })
3430
3443
  ] });
3431
3444
  };
3432
- return /* @__PURE__ */ e(Z, { value: A, onChange: (p) => {
3445
+ return /* @__PURE__ */ e(Z, { value: E, onChange: (p) => {
3433
3446
  const f = Array.from(new Set(p.map((w) => m(w))));
3434
3447
  y !== -1 && f.length > y || o(f);
3435
3448
  }, multiple: !0, by: "id", children: ({ open: p }) => /* @__PURE__ */ l("div", { children: [
@@ -3471,14 +3484,14 @@ function Ye({
3471
3484
  /* @__PURE__ */ e("div", { className: "p-2 sticky top-0 bg-white z-20 shadow-sm", children: /* @__PURE__ */ e(
3472
3485
  he,
3473
3486
  {
3474
- value: E,
3487
+ value: O,
3475
3488
  onDebouncedChange: C,
3476
3489
  placeholder: b === "server" ? `Search (min ${k})…` : "Search options…"
3477
3490
  }
3478
3491
  ) }),
3479
3492
  b === "server" && a && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
3480
- q.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: b === "server" ? E.length < k ? `Type at least ${k} characters to search.` : "No results." : "No options found." }) : q.map((f) => {
3481
- const w = m(f), c = g(f), h = A.some((F) => m(F) === w), x = y !== -1 && A.length >= y && !h;
3493
+ q.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: b === "server" ? O.length < k ? `Type at least ${k} characters to search.` : "No results." : "No options found." }) : q.map((f) => {
3494
+ const w = m(f), c = g(f), h = E.some((F) => m(F) === w), x = y !== -1 && E.length >= y && !h;
3482
3495
  return /* @__PURE__ */ e(
3483
3496
  Z.Option,
3484
3497
  {
@@ -3675,9 +3688,9 @@ function Cn({
3675
3688
  dropId: N,
3676
3689
  indent: a = 24
3677
3690
  }) {
3678
- const { setNodeRef: k, isOver: m } = Vt({ id: N }), { attributes: g, listeners: $, setNodeRef: L, transform: E, isDragging: C } = Ut({ id: b }), I = E ? { transform: `translate3d(${Math.round(E.x)}px, ${Math.round(E.y)}px, 0)` } : void 0, [P, A] = O(!1), [U, q] = O(t.name), G = () => {
3679
- const p = U.trim();
3680
- A(!1), p && p !== t.name ? i?.(t, p) : q(t.name);
3691
+ const { setNodeRef: k, isOver: m } = Ut({ id: N }), { attributes: g, listeners: $, setNodeRef: L, transform: O, isDragging: C } = Vt({ id: b }), T = O ? { transform: `translate3d(${Math.round(O.x)}px, ${Math.round(O.y)}px, 0)` } : void 0, [I, E] = B(!1), [V, q] = B(t.name), G = () => {
3692
+ const p = V.trim();
3693
+ E(!1), p && p !== t.name ? i?.(t, p) : q(t.name);
3681
3694
  }, v = ce(() => /* @__PURE__ */ e(
3682
3695
  an,
3683
3696
  {
@@ -3687,7 +3700,7 @@ function Cn({
3687
3700
  { action: "delete", label: "Delete" }
3688
3701
  ],
3689
3702
  onSelect: (f) => {
3690
- f.action === "create" ? u?.(t) : f.action === "rename" ? A(!0) : f.action === "delete" && d?.(t);
3703
+ f.action === "create" ? u?.(t) : f.action === "rename" ? E(!0) : f.action === "delete" && d?.(t);
3691
3704
  }
3692
3705
  }
3693
3706
  ), [t, u, d]);
@@ -3696,30 +3709,30 @@ function Cn({
3696
3709
  {
3697
3710
  ref: k,
3698
3711
  className: `tv-row ${m ? "tv-drop-over" : ""} ${C ? "dragging" : ""}`,
3699
- style: { ...I, paddingLeft: 8 + r * a },
3712
+ style: { ...T, paddingLeft: 8 + r * a },
3700
3713
  onClick: (p) => {
3701
3714
  p.target.closest(".tv-toggle") || p.target.tagName === "INPUT" || n?.(t);
3702
3715
  },
3703
3716
  children: [
3704
3717
  /* @__PURE__ */ e("button", { className: "tv-toggle", onClick: o, "aria-label": "toggle", children: t.children?.length ? s ? /* @__PURE__ */ e(wa, { size: 16 }) : /* @__PURE__ */ e(je, { size: 16 }) : /* @__PURE__ */ e("span", { className: "tv-spacer" }) }),
3705
3718
  /* @__PURE__ */ e(Fa, { size: 16, className: "tv-folder-ic" }),
3706
- /* @__PURE__ */ e("div", { className: "tv-name", ref: L, children: P ? /* @__PURE__ */ e(
3719
+ /* @__PURE__ */ e("div", { className: "tv-name", ref: L, children: I ? /* @__PURE__ */ e(
3707
3720
  "input",
3708
3721
  {
3709
3722
  className: "tv-input",
3710
- value: U,
3723
+ value: V,
3711
3724
  onChange: (p) => q(p.target.value),
3712
3725
  onBlur: G,
3713
3726
  onKeyDown: (p) => {
3714
- p.key === "Enter" && G(), p.key === "Escape" && (A(!1), q(t.name));
3727
+ p.key === "Enter" && G(), p.key === "Escape" && (E(!1), q(t.name));
3715
3728
  },
3716
3729
  autoFocus: !0
3717
3730
  }
3718
- ) : /* @__PURE__ */ e("span", { onDoubleClick: () => A(!0), children: t.name }) }),
3731
+ ) : /* @__PURE__ */ e("span", { onDoubleClick: () => E(!0), children: t.name }) }),
3719
3732
  /* @__PURE__ */ e(wn, { listeners: $, attributes: g }),
3720
3733
  /* @__PURE__ */ e("div", { className: "tv-actions", children: y ? y(t, {
3721
3734
  onCreateChild: () => u?.(t),
3722
- onRename: () => A(!0),
3735
+ onRename: () => E(!0),
3723
3736
  onDelete: () => d?.(t)
3724
3737
  }) : v })
3725
3738
  ]
@@ -3820,7 +3833,7 @@ function ps({
3820
3833
  const { roots: $ } = ce(() => Fn(t) ? An(t, { rootId: r, getId: o, getName: u }) : Tn(
3821
3834
  t.map((x) => ({ ...x })),
3822
3835
  { rootId: r, getId: o, getParent: n, getName: u }
3823
- ), [t, r, o, n, u]), [L, E] = O({}), C = K((x) => {
3836
+ ), [t, r, o, n, u]), [L, O] = B({}), C = K((x) => {
3824
3837
  const F = {};
3825
3838
  return (function R(j) {
3826
3839
  j.forEach((S) => {
@@ -3829,16 +3842,16 @@ function ps({
3829
3842
  })(x), F;
3830
3843
  }, []);
3831
3844
  ae.useEffect(() => {
3832
- E(C($));
3845
+ O(C($));
3833
3846
  }, [$, C]);
3834
- const I = K(
3835
- (x) => E((F) => ({ ...F, [x]: !F[x] })),
3847
+ const T = K(
3848
+ (x) => O((F) => ({ ...F, [x]: !F[x] })),
3836
3849
  []
3837
- ), [P, A] = O(() => Ae($));
3838
- ae.useEffect(() => A(Ae($)), [$]);
3839
- const U = qt(
3850
+ ), [I, E] = B(() => Ae($));
3851
+ ae.useEffect(() => E(Ae($)), [$]);
3852
+ const V = qt(
3840
3853
  jt(Yt, { activationConstraint: { delay: 250, tolerance: 5 } })
3841
- ), q = ue(null), [G, v] = O(null), p = ue(0), f = () => {
3854
+ ), q = ue(null), [G, v] = B(null), p = ue(0), f = () => {
3842
3855
  }, w = ({ delta: x }) => {
3843
3856
  p.current = x?.x ?? 0;
3844
3857
  }, c = K(
@@ -3847,30 +3860,30 @@ function ps({
3847
3860
  if (p.current = 0, v(null), !x || !F) return;
3848
3861
  const j = String(x.id).replace(/^drag-/, ""), S = String(F.id).replace(/^drop-/, "");
3849
3862
  if (!j || !S || j === S) return;
3850
- let T = S;
3863
+ let A = S;
3851
3864
  const M = Math.max(0, Math.floor(-R / g));
3852
3865
  if (M > 0) {
3853
3866
  let ie = S;
3854
3867
  for (let xe = 0; xe < M; xe++) {
3855
- const B = Ka(P, ie, null);
3856
- if (!B) break;
3857
- if (!B.parentId) {
3858
- T = r;
3868
+ const P = Ka(I, ie, null);
3869
+ if (!P) break;
3870
+ if (!P.parentId) {
3871
+ A = r;
3859
3872
  break;
3860
3873
  }
3861
- T = B.parentId, ie = B.parentId;
3874
+ A = P.parentId, ie = P.parentId;
3862
3875
  }
3863
3876
  }
3864
- if (m && T === r) {
3865
- A(Ae($));
3877
+ if (m && A === r) {
3878
+ E(Ae($));
3866
3879
  return;
3867
3880
  }
3868
- const D = Ae(P), { newRoots: z, removed: V } = En(D, j);
3869
- if (!V) return;
3870
- const Ne = Rn(z, T, V);
3871
- A(Ne), a?.({ sourceId: j, destParentId: T, newTree: Ne });
3881
+ const D = Ae(I), { newRoots: z, removed: U } = En(D, j);
3882
+ if (!U) return;
3883
+ const Ne = Rn(z, A, U);
3884
+ E(Ne), a?.({ sourceId: j, destParentId: A, newTree: Ne });
3872
3885
  },
3873
- [P, $, r, m, g, a]
3886
+ [I, $, r, m, g, a]
3874
3887
  ), h = K(
3875
3888
  (x, F = 0) => x.map((R) => /* @__PURE__ */ l(ae.Fragment, { children: [
3876
3889
  /* @__PURE__ */ e(
@@ -3879,7 +3892,7 @@ function ps({
3879
3892
  node: R,
3880
3893
  depth: F,
3881
3894
  expanded: !!L[R.id],
3882
- onToggle: () => I(R.id),
3895
+ onToggle: () => T(R.id),
3883
3896
  onSelect: i,
3884
3897
  onCreateChild: y,
3885
3898
  onRename: b,
@@ -3892,7 +3905,7 @@ function ps({
3892
3905
  ),
3893
3906
  L[R.id] && R.children?.length > 0 ? h(R.children, F + 1) : null
3894
3907
  ] }, R.id)),
3895
- [L, g, y, N, b, i, k, I]
3908
+ [L, g, y, N, b, i, k, T]
3896
3909
  );
3897
3910
  return ae.useMemo(() => {
3898
3911
  if (!G) return null;
@@ -3905,8 +3918,8 @@ function ps({
3905
3918
  }
3906
3919
  return null;
3907
3920
  }
3908
- return F(P);
3909
- }, [G, P]), /* @__PURE__ */ l("div", { className: "tv", children: [
3921
+ return F(I);
3922
+ }, [G, I]), /* @__PURE__ */ l("div", { className: "tv", children: [
3910
3923
  s !== !1 && /* @__PURE__ */ l("div", { className: "tv-header", children: [
3911
3924
  /* @__PURE__ */ e("div", { className: "tv-title", children: s }),
3912
3925
  /* @__PURE__ */ e("button", { className: "tv-btn", onClick: d, children: "+ New folder" })
@@ -3920,12 +3933,12 @@ function ps({
3920
3933
  Gt,
3921
3934
  {
3922
3935
  collisionDetection: Wt,
3923
- sensors: U,
3936
+ sensors: V,
3924
3937
  onDragStart: f,
3925
3938
  onDragMove: w,
3926
3939
  onDragEnd: c,
3927
3940
  modifiers: [_t],
3928
- children: /* @__PURE__ */ e("div", { ref: q, className: "tv-list", children: h(P, 0) })
3941
+ children: /* @__PURE__ */ e("div", { ref: q, className: "tv-list", children: h(I, 0) })
3929
3942
  }
3930
3943
  )
3931
3944
  ] });
@@ -4251,7 +4264,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4251
4264
  ) }),
4252
4265
  a.fieldtype === "radio" && /* @__PURE__ */ l("div", { children: [
4253
4266
  /* @__PURE__ */ e(
4254
- Va,
4267
+ Ua,
4255
4268
  {
4256
4269
  selectedValue: typeof i[a.key] < "u" ? i[a.key] : a.default || "",
4257
4270
  onValueChange: (m) => {
@@ -4440,9 +4453,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4440
4453
  const zn = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
4441
4454
  function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4442
4455
  console.log(`[DynamicConfig/DataTableRenderer] Component loaded for section: ${t.key}`);
4443
- const [n, u] = O(t), [i, d] = O(null), [y, b] = O(null);
4456
+ const [n, u] = B(t), [i, d] = B(null), [y, b] = B(null);
4444
4457
  console.log(`[DataTableRenderer] ${n.key} - Received props:`, { item: t, initialData: r });
4445
- const [N, a] = O(() => {
4458
+ const [N, a] = B(() => {
4446
4459
  const v = r && r[n.key] || [], p = v.length > 0 ? v : [{ id: 0 }];
4447
4460
  return console.log(`[DataTableRenderer] ${n.key} - Initial data:`, p), p;
4448
4461
  }), k = ue(r);
@@ -4583,10 +4596,10 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4583
4596
  if (v.optionsFrom && r) {
4584
4597
  const { config: F, valueField: R, labelField: j } = v.optionsFrom, S = r[F] || [];
4585
4598
  if (Array.isArray(S))
4586
- return S.map((T) => ({
4587
- id: T[R] || "",
4588
- value: T[R] || "",
4589
- label: T[j] || ""
4599
+ return S.map((A) => ({
4600
+ id: A[R] || "",
4601
+ value: A[R] || "",
4602
+ label: A[j] || ""
4590
4603
  }));
4591
4604
  }
4592
4605
  return v.options || [];
@@ -4680,7 +4693,7 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4680
4693
  );
4681
4694
  case "radio":
4682
4695
  return (c, h) => /* @__PURE__ */ e(
4683
- Va,
4696
+ Ua,
4684
4697
  {
4685
4698
  selectedValue: c[v.key] || "",
4686
4699
  onValueChange: (x) => p(h, x),
@@ -4804,24 +4817,24 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4804
4817
  const f = [...v, p];
4805
4818
  return console.log("[DataTableRenderer] Updated data:", f), f;
4806
4819
  });
4807
- }, [n.fields]), E = K((v) => {
4820
+ }, [n.fields]), O = K((v) => {
4808
4821
  a((p) => {
4809
4822
  if (p.length <= 1)
4810
4823
  return p;
4811
4824
  const f = [...p];
4812
4825
  return f.splice(v, 1), f;
4813
4826
  });
4814
- }, []), [C, I] = O(null), P = K((v, p) => {
4815
- I(p), v.dataTransfer.effectAllowed = "move", v.dataTransfer.setData("text/html", "");
4816
- }, []), A = K((v) => {
4827
+ }, []), [C, T] = B(null), I = K((v, p) => {
4828
+ T(p), v.dataTransfer.effectAllowed = "move", v.dataTransfer.setData("text/html", "");
4829
+ }, []), E = K((v) => {
4817
4830
  v.preventDefault(), v.dataTransfer.dropEffect = "move";
4818
- }, []), U = K((v, p) => {
4831
+ }, []), V = K((v, p) => {
4819
4832
  v.preventDefault(), !(C === null || C === p) && (a((f) => {
4820
4833
  const w = [...f], c = w[C];
4821
4834
  return w.splice(C, 1), w.splice(p, 0, c), w;
4822
- }), I(null));
4835
+ }), T(null));
4823
4836
  }, [C]), q = K(() => {
4824
- I(null);
4837
+ T(null);
4825
4838
  }, []), G = K((v) => {
4826
4839
  console.log("[DataTableRenderer] handleAddAudience called with:", v), a((p) => {
4827
4840
  const f = [...p];
@@ -4869,9 +4882,9 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4869
4882
  {
4870
4883
  className: `hover:bg-gray-50 ${C === p ? "opacity-50" : ""}`,
4871
4884
  draggable: !0,
4872
- onDragStart: (f) => P(f, p),
4873
- onDragOver: A,
4874
- onDrop: (f) => U(f, p),
4885
+ onDragStart: (f) => I(f, p),
4886
+ onDragOver: E,
4887
+ onDrop: (f) => V(f, p),
4875
4888
  onDragEnd: q,
4876
4889
  children: [
4877
4890
  /* @__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(sa, { size: 16 }) }) }),
@@ -4879,7 +4892,7 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4879
4892
  /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
4880
4893
  "button",
4881
4894
  {
4882
- onClick: () => E(p),
4895
+ onClick: () => O(p),
4883
4896
  className: "text-red-500 hover:text-red-700",
4884
4897
  title: "Delete row",
4885
4898
  children: /* @__PURE__ */ e(Jt, { size: 16 })
@@ -4978,43 +4991,43 @@ const fa = () => {
4978
4991
  initialData: y = null
4979
4992
  // Add prop for initial demo data
4980
4993
  }) => {
4981
- const [b, N] = O(null), [a, k] = O(""), [m, g] = O(() => Array.isArray(y) ? y : []), [$, L] = O(null), [E, C] = O(null), [I, P] = O(""), A = async () => {
4994
+ const [b, N] = B(null), [a, k] = B(""), [m, g] = B(() => Array.isArray(y) ? y : []), [$, L] = B(null), [O, C] = B(null), [T, I] = B(""), E = async () => {
4982
4995
  try {
4983
4996
  const S = await Ee(t.collectionList);
4984
4997
  if (S) {
4985
- const T = S.map((M, D) => ({
4998
+ const A = S.map((M, D) => ({
4986
4999
  ...M,
4987
5000
  order: typeof M.order == "number" ? M.order : D + 1
4988
5001
  }));
4989
- T.sort((M, D) => (M.order ?? 0) - (D.order ?? 0)), g(T), s?.(T);
5002
+ A.sort((M, D) => (M.order ?? 0) - (D.order ?? 0)), g(A), s?.(A);
4990
5003
  }
4991
5004
  } catch (S) {
4992
5005
  console.log("Error loading collections:", S), typeof window < "u" && !window.location.pathname.includes("iframe.html") && le.error("Failed to load collections");
4993
5006
  }
4994
5007
  };
4995
5008
  X(() => {
4996
- (!y || y.length === 0) && A();
5009
+ (!y || y.length === 0) && E();
4997
5010
  }, [y]), X(() => {
4998
5011
  Array.isArray(y) && g(y);
4999
5012
  }, [y]);
5000
- const U = (S) => {
5013
+ const V = (S) => {
5001
5014
  u && (N(S.id), k(S.categoryName || ""));
5002
5015
  }, q = () => {
5003
5016
  if (!n || b !== null) return;
5004
5017
  const S = `temp-${Date.now()}`;
5005
- g((T) => [
5006
- ...T,
5018
+ g((A) => [
5019
+ ...A,
5007
5020
  {
5008
5021
  id: S,
5009
5022
  categoryName: "",
5010
5023
  links: [],
5011
- order: (T.at(-1)?.order ?? 0) + 1,
5024
+ order: (A.at(-1)?.order ?? 0) + 1,
5012
5025
  _temp: !0
5013
5026
  }
5014
5027
  ]), N(S), k("");
5015
5028
  }, G = () => {
5016
5029
  b != null && (g((S) => {
5017
- const T = S.find((D) => D.id === b), M = T && T._temp ? S.filter((D) => D.id !== b) : S;
5030
+ const A = S.find((D) => D.id === b), M = A && A._temp ? S.filter((D) => D.id !== b) : S;
5018
5031
  return s?.(M), M;
5019
5032
  }), N(null), k(""));
5020
5033
  }, v = async () => {
@@ -5022,78 +5035,78 @@ const fa = () => {
5022
5035
  const S = typeof b == "string" && b.startsWith("temp-");
5023
5036
  try {
5024
5037
  if (S) {
5025
- const T = await Re(t.collectionCreate, {
5038
+ const A = await Re(t.collectionCreate, {
5026
5039
  categoryName: a.trim(),
5027
5040
  order: (Array.isArray(m) && m.length > 0 ? m.at(-1)?.order ?? 0 : 0) + 1
5028
5041
  });
5029
- T && (g((M) => {
5030
- const D = M.map((z) => z.id === b ? T : z);
5042
+ A && (g((M) => {
5043
+ const D = M.map((z) => z.id === b ? A : z);
5031
5044
  return s?.(D), D;
5032
5045
  }), ke.success("Collection created successfully"));
5033
5046
  } else {
5034
- const T = await mn(
5047
+ const A = await mn(
5035
5048
  `${t.collectionUpdate}/${b}?newName=${a.trim()}`
5036
5049
  );
5037
5050
  g((M) => {
5038
5051
  const D = M.map(
5039
- (z) => z.id === b ? T && T.id ? { ...z, ...T } : { ...z, categoryName: a.trim() } : z
5052
+ (z) => z.id === b ? A && A.id ? { ...z, ...A } : { ...z, categoryName: a.trim() } : z
5040
5053
  );
5041
5054
  return s?.(D), D;
5042
5055
  }), le.success("Collection updated successfully");
5043
5056
  }
5044
5057
  N(null), k("");
5045
- } catch (T) {
5046
- console.log(T), le.error("Failed to save collection");
5058
+ } catch (A) {
5059
+ console.log(A), le.error("Failed to save collection");
5047
5060
  }
5048
5061
  }, p = async (S) => {
5049
5062
  if (i)
5050
5063
  try {
5051
- await un(`${t.collectionUpdate}/${S.id}`) && (le.success("Deleted successfully", { autoClose: 3e3 }), A());
5052
- } catch (T) {
5053
- console.log(T), le.error("Failed to delete collection");
5064
+ await un(`${t.collectionUpdate}/${S.id}`) && (le.success("Deleted successfully", { autoClose: 3e3 }), E());
5065
+ } catch (A) {
5066
+ console.log(A), le.error("Failed to delete collection");
5054
5067
  }
5055
- }, f = (S, T, M) => {
5056
- if (!d || !T || !M || T === M) return S;
5057
- const D = S.findIndex((ie) => ie.id === T), z = S.findIndex((ie) => ie.id === M);
5068
+ }, f = (S, A, M) => {
5069
+ if (!d || !A || !M || A === M) return S;
5070
+ const D = S.findIndex((ie) => ie.id === A), z = S.findIndex((ie) => ie.id === M);
5058
5071
  if (D === -1 || z === -1) return S;
5059
- const V = [...S], [Ne] = V.splice(D, 1);
5060
- return V.splice(z, 0, Ne), V.map((ie, xe) => ({ ...ie, order: xe + 1 }));
5072
+ const U = [...S], [Ne] = U.splice(D, 1);
5073
+ return U.splice(z, 0, Ne), U.map((ie, xe) => ({ ...ie, order: xe + 1 }));
5061
5074
  }, w = async (S) => {
5062
- const T = S.map((M) => ({
5075
+ const A = S.map((M) => ({
5063
5076
  id: M.id,
5064
5077
  order: M.order,
5065
5078
  categoryName: M.categoryName
5066
5079
  }));
5067
5080
  try {
5068
- await Re(t.updateCollection, T);
5081
+ await Re(t.updateCollection, A);
5069
5082
  } catch (M) {
5070
5083
  console.log(M), le.error("Failed to save order", { autoClose: 2500 });
5071
5084
  }
5072
- }, c = (S, T) => {
5073
- d && (S.dataTransfer.effectAllowed = "move", S.dataTransfer.setData("text/plain", String(T)), L(T));
5085
+ }, c = (S, A) => {
5086
+ d && (S.dataTransfer.effectAllowed = "move", S.dataTransfer.setData("text/plain", String(A)), L(A));
5074
5087
  }, h = (S) => {
5075
- $ && S !== E && C(S);
5088
+ $ && S !== O && C(S);
5076
5089
  }, x = (S) => {
5077
5090
  S.preventDefault();
5078
- }, F = async (S, T) => {
5091
+ }, F = async (S, A) => {
5079
5092
  S.preventDefault();
5080
5093
  const M = S.dataTransfer.getData("text/plain");
5081
5094
  M && (g((D) => {
5082
- const z = f(D, M, T);
5095
+ const z = f(D, M, A);
5083
5096
  return console.log("Reordered", z), w(z), s?.(z), z;
5084
5097
  }), L(null), C(null));
5085
5098
  }, R = () => {
5086
5099
  L(null), C(null);
5087
5100
  }, j = Array.isArray(m) ? m.filter(
5088
- (S) => S.categoryName?.toLowerCase().includes(I.toLowerCase())
5101
+ (S) => S.categoryName?.toLowerCase().includes(T.toLowerCase())
5089
5102
  ) : [];
5090
5103
  return /* @__PURE__ */ l("div", { className: `manage-collection-list ${r}`, children: [
5091
5104
  /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ l("div", { className: "w-1/2 flex justify-end", children: [
5092
5105
  o && /* @__PURE__ */ e(
5093
5106
  he,
5094
5107
  {
5095
- value: I,
5096
- onDebouncedChange: P,
5108
+ value: T,
5109
+ onDebouncedChange: I,
5097
5110
  placeholder: "Search Collection",
5098
5111
  customClass: "mr-4 searchmanagecollection"
5099
5112
  }
@@ -5112,13 +5125,13 @@ const fa = () => {
5112
5125
  )
5113
5126
  ] }) }),
5114
5127
  /* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: j.map((S) => {
5115
- const T = b === S.id, M = S?.links?.length ?? 0, D = $ === S.id, z = E === S.id && $ !== S.id;
5128
+ const A = b === S.id, M = S?.links?.length ?? 0, D = $ === S.id, z = O === S.id && $ !== S.id;
5116
5129
  return /* @__PURE__ */ e(
5117
5130
  "div",
5118
5131
  {
5119
5132
  onDragEnter: () => h(S.id),
5120
5133
  onDragOver: x,
5121
- onDrop: (V) => F(V, S.id),
5134
+ onDrop: (U) => F(U, S.id),
5122
5135
  onDragEnd: R,
5123
5136
  className: [
5124
5137
  "flex items-center justify-between p-3 border rounded-2xl mb-3",
@@ -5126,7 +5139,7 @@ const fa = () => {
5126
5139
  z ? "ring-2 ring-gray-800/20" : "",
5127
5140
  D ? "opacity-60" : ""
5128
5141
  ].join(" "),
5129
- children: T ? /* @__PURE__ */ l(ee, { children: [
5142
+ children: A ? /* @__PURE__ */ l(ee, { children: [
5130
5143
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
5131
5144
  "input",
5132
5145
  {
@@ -5134,9 +5147,9 @@ const fa = () => {
5134
5147
  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",
5135
5148
  value: a,
5136
5149
  placeholder: S._temp ? "New collection name" : "Edit collection name",
5137
- onChange: (V) => k(V.target.value),
5138
- onKeyDown: (V) => {
5139
- V.key === "Enter" && v(), V.key === "Escape" && G();
5150
+ onChange: (U) => k(U.target.value),
5151
+ onKeyDown: (U) => {
5152
+ U.key === "Enter" && v(), U.key === "Escape" && G();
5140
5153
  },
5141
5154
  autoFocus: !0
5142
5155
  }
@@ -5175,7 +5188,7 @@ const fa = () => {
5175
5188
  "aria-label": "Drag to reorder",
5176
5189
  className: "cursor-grab active:cursor-grabbing p-1 -m-1 rounded-md hover:bg-gray-50",
5177
5190
  draggable: !0,
5178
- onDragStart: (V) => c(V, S.id),
5191
+ onDragStart: (U) => c(U, S.id),
5179
5192
  children: /* @__PURE__ */ e(sa, {})
5180
5193
  }
5181
5194
  ),
@@ -5187,7 +5200,7 @@ const fa = () => {
5187
5200
  "button",
5188
5201
  {
5189
5202
  className: "cursor-pointer",
5190
- onClick: () => U(S),
5203
+ onClick: () => V(S),
5191
5204
  "aria-label": `Edit ${S.categoryName}`,
5192
5205
  children: /* @__PURE__ */ e(Qt, { color: "#767676" })
5193
5206
  }
@@ -5198,7 +5211,7 @@ const fa = () => {
5198
5211
  className: M === 0 && !S.protected ? "cursor-pointer" : "cursor-not-allowed",
5199
5212
  title: M === 0 && !S.protected ? "Delete" : "Cannot delete this collection",
5200
5213
  onClick: M === 0 ? () => p(S) : null,
5201
- children: /* @__PURE__ */ e(Ue, { color: M === 0 ? "#767676" : "#C2C2C2" })
5214
+ children: /* @__PURE__ */ e(Ve, { color: M === 0 ? "#767676" : "#C2C2C2" })
5202
5215
  }
5203
5216
  )
5204
5217
  ] })
@@ -5259,14 +5272,14 @@ function Mn(t) {
5259
5272
  const r = On(t);
5260
5273
  return Ce[r] || Ce[r.toLowerCase?.()] || Ln;
5261
5274
  }
5262
- function Vn({
5275
+ function Un({
5263
5276
  appid: t,
5264
5277
  configdata: r = null,
5265
5278
  disableApi: s = !1,
5266
5279
  onCancel: o,
5267
5280
  onSave: n
5268
5281
  }) {
5269
- const [u, i] = ae.useState(r), [d, y] = ae.useState(null), [b, N] = O(!1), [a, k] = O(!1), [m, g] = O({}), $ = `${ve()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, L = $, [E, C] = O(1), I = (f) => {
5282
+ const [u, i] = ae.useState(r), [d, y] = ae.useState(null), [b, N] = B(!1), [a, k] = B(!1), [m, g] = B({}), $ = `${ve()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, L = $, [O, C] = B(1), T = (f) => {
5270
5283
  if (!r || !r.configuration)
5271
5284
  return f;
5272
5285
  const w = {}, c = f?.configuration || {};
@@ -5274,16 +5287,16 @@ function Vn({
5274
5287
  if (h.key && h.type === "datatable") {
5275
5288
  const F = (c[h.key] || []).map((R, j) => {
5276
5289
  const S = { id: R.id || 0 };
5277
- return h.fields && h.fields.forEach((T) => {
5278
- if (T.fieldtype === "audience") {
5290
+ return h.fields && h.fields.forEach((A) => {
5291
+ if (A.fieldtype === "audience") {
5279
5292
  let M = { users: [], groups: [], roles: [] };
5280
- R[T.key] && (Array.isArray(R[T.key]) ? M = { users: [], groups: [], roles: [] } : typeof R[T.key] == "object" && (M = {
5281
- users: R[T.key].users || [],
5282
- groups: R[T.key].groups || [],
5283
- roles: R[T.key].roles || []
5284
- })), S[T.key] = M;
5293
+ R[A.key] && (Array.isArray(R[A.key]) ? M = { users: [], groups: [], roles: [] } : typeof R[A.key] == "object" && (M = {
5294
+ users: R[A.key].users || [],
5295
+ groups: R[A.key].groups || [],
5296
+ roles: R[A.key].roles || []
5297
+ })), S[A.key] = M;
5285
5298
  } else
5286
- S[T.key] = R[T.key] || T.default || "";
5299
+ S[A.key] = R[A.key] || A.default || "";
5287
5300
  }), S;
5288
5301
  });
5289
5302
  if (F.length === 0) {
@@ -5295,7 +5308,7 @@ function Vn({
5295
5308
  w[h.key] = F;
5296
5309
  } else h.key && (w[h.key] = c[h.key] || {});
5297
5310
  }), w;
5298
- }, P = () => {
5311
+ }, I = () => {
5299
5312
  if (r && r.configuration) {
5300
5313
  const f = {};
5301
5314
  r.configuration.forEach((w) => {
@@ -5325,10 +5338,10 @@ function Vn({
5325
5338
  N(!0);
5326
5339
  let w = await Ee($);
5327
5340
  if (w) {
5328
- const c = I(w);
5341
+ const c = T(w);
5329
5342
  y(c);
5330
5343
  } else
5331
- P();
5344
+ I();
5332
5345
  } catch (w) {
5333
5346
  console.error("Error fetching configuration:", w);
5334
5347
  let c = "Failed to load configuration";
@@ -5336,14 +5349,14 @@ function Vn({
5336
5349
  const h = w.response.status, x = w.response.data?.message || w.response.data?.error;
5337
5350
  h === 400 ? c = x || "Invalid request. Please check the application ID." : h === 401 ? c = "You are not authorized to access this configuration." : h === 403 ? c = "Access denied. You don't have permission to view this configuration." : h === 404 ? c = "Configuration not found. It may not exist yet or the application ID is incorrect." : h >= 500 ? c = x || "Server error. Please try again later." : c = x || `Failed to load configuration (Error ${h})`;
5338
5351
  } else w.request ? c = "Network error. Please check your connection and try again." : c = w.message || "An unexpected error occurred while loading configuration.";
5339
- ke.error(c), P();
5352
+ ke.error(c), I();
5340
5353
  } finally {
5341
5354
  N(!1);
5342
5355
  }
5343
5356
  };
5344
- r && (i(r), t ? f() : P());
5345
- }, [r, E, t, s]);
5346
- const A = (f, w) => {
5357
+ r && (i(r), t ? f() : I());
5358
+ }, [r, O, t, s]);
5359
+ const E = (f, w) => {
5347
5360
  y((c) => ({
5348
5361
  ...c,
5349
5362
  [f]: w
@@ -5351,7 +5364,7 @@ function Vn({
5351
5364
  const h = { ...c };
5352
5365
  return h[f] && delete h[f], h;
5353
5366
  });
5354
- }, U = () => {
5367
+ }, V = () => {
5355
5368
  const f = {};
5356
5369
  return !u || !d || u.configuration.forEach((w) => {
5357
5370
  if (w.type === "section")
@@ -5374,7 +5387,7 @@ function Vn({
5374
5387
  }
5375
5388
  }), f;
5376
5389
  }, q = (f) => Object.keys(f).length > 0, G = () => {
5377
- const f = U();
5390
+ const f = V();
5378
5391
  if (g(f), q(f)) {
5379
5392
  let c = [];
5380
5393
  Object.keys(f).forEach((h) => {
@@ -5398,12 +5411,12 @@ function Vn({
5398
5411
  const j = { id: R.id || 0 };
5399
5412
  return F.fields && F.fields.forEach((S) => {
5400
5413
  if (S.fieldtype === "audience") {
5401
- let T = { users: [], groups: [], roles: [] };
5402
- R[S.key] && typeof R[S.key] == "object" && !Array.isArray(R[S.key]) && (T = {
5414
+ let A = { users: [], groups: [], roles: [] };
5415
+ R[S.key] && typeof R[S.key] == "object" && !Array.isArray(R[S.key]) && (A = {
5403
5416
  users: R[S.key].users || [],
5404
5417
  groups: R[S.key].groups || [],
5405
5418
  roles: R[S.key].roles || []
5406
- }), j[S.key] = T;
5419
+ }), j[S.key] = A;
5407
5420
  } else
5408
5421
  j[S.key] = R[S.key] || "";
5409
5422
  }), j;
@@ -5435,7 +5448,7 @@ function Vn({
5435
5448
  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" }) });
5436
5449
  const p = r?.configuration || u?.configuration;
5437
5450
  return X(() => {
5438
- s && r ? (!d || Object.keys(d).length === 0) && P() : s && !r && P();
5451
+ s && r ? (!d || Object.keys(d).length === 0) && I() : s && !r && I();
5439
5452
  }, [s, r]), /* @__PURE__ */ l("div", { children: [
5440
5453
  /* @__PURE__ */ l(
5441
5454
  "div",
@@ -5452,7 +5465,7 @@ function Vn({
5452
5465
  {
5453
5466
  item: f,
5454
5467
  data: d,
5455
- updateHandler: A,
5468
+ updateHandler: E,
5456
5469
  validationErrors: m
5457
5470
  },
5458
5471
  w
@@ -5489,7 +5502,7 @@ const ys = ({
5489
5502
  appid: r = "Configuration-Page",
5490
5503
  disableApi: s = !1
5491
5504
  }) => {
5492
- const [o, n] = O(0), [u, i] = O(!1), [d, y] = O(r), {
5505
+ const [o, n] = B(0), [u, i] = B(!1), [d, y] = B(r), {
5493
5506
  pageHeader: b = {},
5494
5507
  appletHeader: N = {},
5495
5508
  breadcrumb: a = [],
@@ -5541,11 +5554,11 @@ const ys = ({
5541
5554
  }, L = a.map((p) => ({
5542
5555
  label: p.text,
5543
5556
  href: p.href || "#"
5544
- })), E = K(() => {
5557
+ })), O = K(() => {
5545
5558
  console.log("handleCancelRequest called - showing modal"), i(!0);
5546
5559
  }, []), C = K((p) => {
5547
5560
  i(!1), p.primary ? (console.log("User confirmed cancel - navigating back"), window.history.back()) : console.log("User cancelled the cancel action - modal closed, data preserved");
5548
- }, []), I = () => {
5561
+ }, []), T = () => {
5549
5562
  for (const p of g)
5550
5563
  if (p.type === "section" && p.fields) {
5551
5564
  const f = p.fields.find((w) => w.key === "displayname");
@@ -5555,20 +5568,20 @@ const ys = ({
5555
5568
  return r;
5556
5569
  };
5557
5570
  ae.useEffect(() => {
5558
- y(I());
5571
+ y(T());
5559
5572
  }, [g]);
5560
- const P = K((p) => {
5573
+ const I = K((p) => {
5561
5574
  console.log("Config saved with data:", p), Object.keys(p).forEach((f) => {
5562
5575
  const w = p[f];
5563
5576
  console.log(`Checking section ${f}:`, w), w && w.displayname && (console.log("Found displayname:", w.displayname), y(w.displayname));
5564
5577
  });
5565
- }, []), A = {
5578
+ }, []), E = {
5566
5579
  subHeading: "Application configuration and details",
5567
5580
  tags: [],
5568
5581
  ...N,
5569
5582
  heading: d
5570
5583
  // Ensure displayname always overrides config heading
5571
- }, U = {
5584
+ }, V = {
5572
5585
  about: "This application provides comprehensive functionality for your organization.",
5573
5586
  images: {
5574
5587
  desktop: "https://via.placeholder.com/600x400?text=Desktop+View",
@@ -5587,8 +5600,8 @@ const ys = ({
5587
5600
  ],
5588
5601
  ...k
5589
5602
  }, q = [
5590
- { label: "Overview", content: v(U) },
5591
- { label: "Configuration", content: /* @__PURE__ */ e(Vn, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel: E, onSave: P }) }
5603
+ { label: "Overview", content: v(V) },
5604
+ { label: "Configuration", content: /* @__PURE__ */ e(Un, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel: O, onSave: I }) }
5592
5605
  ];
5593
5606
  function G(p) {
5594
5607
  return p ? p.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: p } }) : p : "📱";
@@ -5647,11 +5660,11 @@ const ys = ({
5647
5660
  }
5648
5661
  ),
5649
5662
  /* @__PURE__ */ l("div", { className: "bg-[#ffffff] border border-[#eef2f6] rounded-[12px] px-6 py-5 flex gap-4 items-start mb-4 shadow-sm", children: [
5650
- /* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: G(A.icon) }),
5663
+ /* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: G(E.icon) }),
5651
5664
  /* @__PURE__ */ l("div", { className: "flex flex-col min-w-0", children: [
5652
- /* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: A.heading }),
5653
- /* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: A.subHeading }),
5654
- /* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: A.tags && A.tags.map((p, f) => /* @__PURE__ */ e(
5665
+ /* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: E.heading }),
5666
+ /* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: E.subHeading }),
5667
+ /* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: E.tags && E.tags.map((p, f) => /* @__PURE__ */ e(
5655
5668
  "span",
5656
5669
  {
5657
5670
  className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
@@ -5735,17 +5748,17 @@ const bs = ({
5735
5748
  showAdd: $ = !1,
5736
5749
  // Additional props
5737
5750
  searchPlaceholder: L = "Search...",
5738
- handleRefreshClick: E = () => {
5751
+ handleRefreshClick: O = () => {
5739
5752
  },
5740
5753
  handleSearchChange: C = () => {
5741
5754
  },
5742
5755
  // Optional: override export file names
5743
- excelFileName: I,
5744
- pdfFileName: P
5756
+ excelFileName: T,
5757
+ pdfFileName: I
5745
5758
  }) => {
5746
- const A = () => n?.current || o?.current, [U, q] = ae.useState(""), G = (t || "export").toString().trim() || "export", v = `${I || G}.xlsx`, p = `${P || G}.pdf`, f = (h, x, F) => Math.max(x, Math.min(h, F)), w = K(
5759
+ const E = () => n?.current || o?.current, [V, q] = ae.useState(""), G = (t || "export").toString().trim() || "export", v = `${T || G}.xlsx`, p = `${I || G}.pdf`, f = (h, x, F) => Math.max(x, Math.min(h, F)), w = K(
5747
5760
  (h) => {
5748
- const x = A();
5761
+ const x = E();
5749
5762
  if (console.log("openColumnChooserNear", x), !!x?.openColumnChooser) {
5750
5763
  if (typeof window > "u" || !h?.currentTarget) {
5751
5764
  x.openColumnChooser();
@@ -5753,9 +5766,9 @@ const bs = ({
5753
5766
  }
5754
5767
  try {
5755
5768
  const F = h.currentTarget.getBoundingClientRect(), R = F.left + window.scrollX, j = F.bottom + window.scrollY;
5756
- let S = R - 120, T = j - 120;
5769
+ let S = R - 120, A = j - 120;
5757
5770
  const M = window.innerWidth, D = window.innerHeight;
5758
- S = f(S, window.scrollX + 8, window.scrollX + M - 340), T = f(T, window.scrollY, window.scrollY + D - 120), console.log("openColumnChooserNear", S, T), x.openColumnChooser(S, T);
5771
+ S = f(S, window.scrollX + 8, window.scrollX + M - 340), A = f(A, window.scrollY, window.scrollY + D - 120), console.log("openColumnChooserNear", S, A), x.openColumnChooser(S, A);
5759
5772
  } catch (F) {
5760
5773
  console.log("coloumn choose error", F);
5761
5774
  }
@@ -5765,7 +5778,7 @@ const bs = ({
5765
5778
  // no external deps; reads ref at call time
5766
5779
  ), c = K(
5767
5780
  (h, x) => {
5768
- const F = A();
5781
+ const F = E();
5769
5782
  if (F)
5770
5783
  switch (h) {
5771
5784
  case "ColumnChooser":
@@ -5781,11 +5794,11 @@ const bs = ({
5781
5794
  m && F.pdfExport?.({ fileName: p });
5782
5795
  break;
5783
5796
  case "Refresh":
5784
- g && E();
5797
+ g && O();
5785
5798
  break;
5786
5799
  }
5787
5800
  },
5788
- [b, a, k, m, g, v, p, E, w]
5801
+ [b, a, k, m, g, v, p, O, w]
5789
5802
  );
5790
5803
  return /* @__PURE__ */ l("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: [
5791
5804
  /* @__PURE__ */ l("div", { className: "flex flex-col", children: [
@@ -5801,7 +5814,7 @@ const bs = ({
5801
5814
  he,
5802
5815
  {
5803
5816
  placeholder: L,
5804
- value: U,
5817
+ value: V,
5805
5818
  onDebouncedChange: (h) => {
5806
5819
  q(h), C(h);
5807
5820
  }
@@ -5911,44 +5924,44 @@ function vs(t) {
5911
5924
  enableSearchApi: g = !1,
5912
5925
  height: $ = "600",
5913
5926
  selectionSettings: L = { type: "Multiple", mode: "Row" },
5914
- enableCheckbox: E = !1,
5927
+ enableCheckbox: O = !1,
5915
5928
  columns: C = [],
5916
- onGridStateChange: I,
5917
- onRowSelected: P,
5918
- onRowDeselected: A,
5919
- onRowDoubleClick: U,
5929
+ onGridStateChange: T,
5930
+ onRowSelected: I,
5931
+ onRowDeselected: E,
5932
+ onRowDoubleClick: V,
5920
5933
  apiRef: q,
5921
5934
  gridProps: G = {}
5922
5935
  } = t, v = ue(null), {
5923
5936
  pageSettings: p,
5924
5937
  sortSettings: f,
5925
5938
  ...w
5926
- } = G || {}, [c, h] = ae.useState(p?.page || 1), [x, F] = ae.useState(f?.pageSize || 20), [R, j] = ae.useState(f?.sortKey || "updatedDate"), [S, T] = ae.useState(f?.direction || "Descending"), M = ce(() => {
5927
- const B = [$r];
5928
- return i && B.push(Fr), d && B.push(Tr), y && B.push(Ar), g && B.push(Er), a && B.push(Rr), k && B.push(Ir), m && B.push(zr), N && B.push(Pr), b && B.push(Br), B.push(Lr), B;
5939
+ } = G || {}, [c, h] = ae.useState(p?.page || 1), [x, F] = ae.useState(f?.pageSize || 20), [R, j] = ae.useState(f?.sortKey || "updatedDate"), [S, A] = ae.useState(f?.direction || "Descending"), M = ce(() => {
5940
+ const P = [$r];
5941
+ return i && P.push(Fr), d && P.push(Tr), y && P.push(Ar), g && P.push(Er), a && P.push(Rr), k && P.push(Ir), m && P.push(zr), N && P.push(Pr), b && P.push(Br), P.push(Lr), P;
5929
5942
  }, [i, d, y, g, a, k, m, N, b]), D = ce(() => {
5930
- const B = () => v.current, te = (W, pe) => {
5943
+ const P = () => v.current, te = (W, pe) => {
5931
5944
  !pe && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${W} requested but related service/feature is disabled.`);
5932
5945
  };
5933
5946
  return {
5934
- getInstance: () => B(),
5935
- refresh: () => B()?.refresh?.(),
5936
- getSelectedRecords: () => B()?.getSelectedRecords?.() ?? [],
5937
- clearSelection: () => B()?.clearSelection?.(),
5938
- selectRow: (W) => B()?.selectRow?.(W),
5939
- selectRows: (W) => B()?.selectRows?.(W),
5947
+ getInstance: () => P(),
5948
+ refresh: () => P()?.refresh?.(),
5949
+ getSelectedRecords: () => P()?.getSelectedRecords?.() ?? [],
5950
+ clearSelection: () => P()?.clearSelection?.(),
5951
+ selectRow: (W) => P()?.selectRow?.(W),
5952
+ selectRows: (W) => P()?.selectRows?.(W),
5940
5953
  search: (W) => {
5941
- te("search()", g), B()?.search?.(W);
5954
+ te("search()", g), P()?.search?.(W);
5942
5955
  },
5943
- print: () => B()?.print?.(),
5956
+ print: () => P()?.print?.(),
5944
5957
  excelExport: (W) => {
5945
- te("excelExport()", a), B()?.excelExport?.(W);
5958
+ te("excelExport()", a), P()?.excelExport?.(W);
5946
5959
  },
5947
5960
  pdfExport: (W) => {
5948
- te("pdfExport()", k), B()?.pdfExport?.(W);
5961
+ te("pdfExport()", k), P()?.pdfExport?.(W);
5949
5962
  },
5950
5963
  openColumnChooser: (W, pe) => {
5951
- te("openColumnChooser()", m), B()?.columnChooserModule?.openColumnChooser?.(W, pe);
5964
+ te("openColumnChooser()", m), P()?.columnChooserModule?.openColumnChooser?.(W, pe);
5952
5965
  }
5953
5966
  };
5954
5967
  }, []);
@@ -5957,14 +5970,14 @@ function vs(t) {
5957
5970
  }, [q, D]), X(() => () => {
5958
5971
  q && (q.current = null);
5959
5972
  }, []);
5960
- const z = (B) => {
5961
- const te = String(B || "");
5973
+ const z = (P) => {
5974
+ const te = String(P || "");
5962
5975
  return te === "Ascending" || te === "Descending" ? te : te.toLowerCase() === "ascending" ? "Ascending" : "Descending";
5963
- }, V = (B) => {
5964
- const te = v.current, W = B?.requestType, pe = W === "paging" ? "paging" : W === "sorting" ? "sorting" : W === "searching" ? "searching" : W === "filtering" ? "filtering" : W === "grouping" ? "grouping" : W === "reorder" ? "reorder" : W === "columnstate" ? "columnstate" : "other", $e = B?.pageSize ?? te?.pageSettings?.pageSize ?? x, Ie = B?.currentPage ?? te?.pageSettings?.currentPage ?? n, Je = B?.columnName && B?.direction ? [{ field: B.columnName, dir: z(B.direction) }] : (te?.sortSettings?.columns || []).map((Fe) => ({
5976
+ }, U = (P) => {
5977
+ const te = v.current, W = P?.requestType, pe = W === "paging" ? "paging" : W === "sorting" ? "sorting" : W === "searching" ? "searching" : W === "filtering" ? "filtering" : W === "grouping" ? "grouping" : W === "reorder" ? "reorder" : W === "columnstate" ? "columnstate" : "other", $e = P?.pageSize ?? te?.pageSettings?.pageSize ?? x, Ie = P?.currentPage ?? te?.pageSettings?.currentPage ?? n, Je = P?.columnName && P?.direction ? [{ field: P.columnName, dir: z(P.direction) }] : (te?.sortSettings?.columns || []).map((Fe) => ({
5965
5978
  field: Fe.field,
5966
5979
  dir: z(Fe.direction ?? Fe.dir)
5967
- })), Qe = B?.searchString ?? "", Xe = B?.columns ?? te?.filterSettings?.columns ?? [];
5980
+ })), Qe = P?.searchString ?? "", Xe = P?.columns ?? te?.filterSettings?.columns ?? [];
5968
5981
  return {
5969
5982
  reason: pe,
5970
5983
  page: { index: Ie, size: $e, skip: (Ie - 1) * $e, take: $e },
@@ -5972,17 +5985,17 @@ function vs(t) {
5972
5985
  // [{ field, dir: 'Ascending'|'Descending' }]
5973
5986
  search: Qe,
5974
5987
  filters: Xe,
5975
- rawEvent: B
5988
+ rawEvent: P
5976
5989
  };
5977
- }, Ne = (B) => {
5990
+ }, Ne = (P) => {
5978
5991
  setTimeout(() => {
5979
5992
  v?.current?.hideSpinner();
5980
- }, 1e3), B.requestType === "paging" && (h(B.currentPage), F(B.pageSize)), B.requestType === "sorting" && (j(B.columnName || "updatedDate"), T(B.direction === "Ascending" ? "ASC" : "DESC")), I && I(V(B), B);
5981
- }, ie = (B) => {
5982
- typeof U == "function" && U(B?.rowData, B);
5993
+ }, 1e3), P.requestType === "paging" && (h(P.currentPage), F(P.pageSize)), P.requestType === "sorting" && (j(P.columnName || "updatedDate"), A(P.direction === "Ascending" ? "ASC" : "DESC")), T && T(U(P), P);
5994
+ }, ie = (P) => {
5995
+ typeof V == "function" && V(P?.rowData, P);
5983
5996
  }, xe = () => {
5984
- const B = [];
5985
- return E && B.push(/* @__PURE__ */ e(ia, { type: "checkbox", width: "50" }, "__checkbox__")), C.forEach((te, W) => {
5997
+ const P = [];
5998
+ return O && P.push(/* @__PURE__ */ e(ia, { type: "checkbox", width: "50" }, "__checkbox__")), C.forEach((te, W) => {
5986
5999
  const {
5987
6000
  field: pe,
5988
6001
  headerText: $e,
@@ -6001,7 +6014,7 @@ function vs(t) {
6001
6014
  customAttributes: ct,
6002
6015
  ...dt
6003
6016
  } = te || {};
6004
- B.push(
6017
+ P.push(
6005
6018
  /* @__PURE__ */ e(
6006
6019
  ia,
6007
6020
  {
@@ -6025,7 +6038,7 @@ function vs(t) {
6025
6038
  pe || `col-${W}`
6026
6039
  )
6027
6040
  );
6028
- }), B;
6041
+ }), P;
6029
6042
  };
6030
6043
  return /* @__PURE__ */ l(
6031
6044
  Or,
@@ -6051,13 +6064,13 @@ function vs(t) {
6051
6064
  allowUnsort: !1
6052
6065
  },
6053
6066
  actionBegin: Ne,
6054
- rowSelected: P,
6055
- rowDeselected: A,
6067
+ rowSelected: I,
6068
+ rowDeselected: E,
6056
6069
  recordDoubleClick: ie,
6057
6070
  ...w,
6058
6071
  children: [
6059
6072
  /* @__PURE__ */ e(Mr, { children: xe() }),
6060
- /* @__PURE__ */ e(Vr, { services: M })
6073
+ /* @__PURE__ */ e(Ur, { services: M })
6061
6074
  ]
6062
6075
  }
6063
6076
  );
@@ -6076,7 +6089,7 @@ export {
6076
6089
  gs as CustomTab,
6077
6090
  Ma as DatePicker,
6078
6091
  Jr as DateRangePicker,
6079
- Vn as DynamicConfig,
6092
+ Un as DynamicConfig,
6080
6093
  es as FileUploadModal,
6081
6094
  ys as FullConfigPage,
6082
6095
  ns as FullScreenLoader,
@@ -6089,7 +6102,7 @@ export {
6089
6102
  en as PageHeader,
6090
6103
  os as PageLayout,
6091
6104
  ts as Pagination,
6092
- Va as RadioGroup,
6105
+ Ua as RadioGroup,
6093
6106
  he as SearchBar,
6094
6107
  ra as Select,
6095
6108
  rs as Sidebar,