@algorithm-shift/design-system 1.2.955 → 1.2.956

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -51,7 +51,7 @@ __export(src_exports, {
51
51
  Image: () => Image_default,
52
52
  Modal: () => Modal,
53
53
  MultiCheckbox: () => MultiCheckbox_default,
54
- MultiSelect: () => MultiSelect_default,
54
+ MultiSelect: () => LazyMultiSelectDropdown,
55
55
  Navbar: () => Navbar,
56
56
  NumberInput: () => NumberInput_default,
57
57
  Pagination: () => Pagination_default,
@@ -27759,6 +27759,14 @@ function useLazyDropdown(config) {
27759
27759
  const allDataRef = (0, import_react19.useRef)([]);
27760
27760
  const configRef = (0, import_react19.useRef)(config);
27761
27761
  const PAGE_SIZE = config.pageSize || 10;
27762
+ const uniqueOptions = (items) => {
27763
+ const seen = /* @__PURE__ */ new Set();
27764
+ return items.filter((item) => {
27765
+ if (seen.has(item.value)) return false;
27766
+ seen.add(item.value);
27767
+ return true;
27768
+ });
27769
+ };
27762
27770
  (0, import_react19.useEffect)(() => {
27763
27771
  configRef.current = config;
27764
27772
  }, [config]);
@@ -27811,7 +27819,10 @@ function useLazyDropdown(config) {
27811
27819
  pageOptions = transformToOptions(filtered.slice(start, end));
27812
27820
  setHasMore(end < filtered.length);
27813
27821
  }
27814
- setOptions((prev) => pageNum === 1 ? pageOptions : [...prev, ...pageOptions]);
27822
+ setOptions((prev) => {
27823
+ const merged = pageNum === 1 ? pageOptions : [...prev, ...pageOptions];
27824
+ return uniqueOptions(merged);
27825
+ });
27815
27826
  setPage(pageNum);
27816
27827
  } catch (err) {
27817
27828
  console.error("\u274C useLazyDropdown loadPage error:", err);
@@ -27831,7 +27842,7 @@ function useLazyDropdown(config) {
27831
27842
  });
27832
27843
  if (res.data?.success && Array.isArray(res.data.data) && res.data.data.length > 0) {
27833
27844
  const fetched = transformToOptions(res.data.data);
27834
- setOptions((prev) => [...fetched, ...prev]);
27845
+ setOptions((prev) => uniqueOptions([...fetched, ...prev]));
27835
27846
  }
27836
27847
  } catch (err) {
27837
27848
  console.warn("\u26A0\uFE0F Failed to fetch default value for dropdown:", err);
@@ -27926,7 +27937,7 @@ function LazySelectDropdown({
27926
27937
  value,
27927
27938
  axiosInstance
27928
27939
  });
27929
- const selectedOption = lazyOptions.find((opt) => opt.value === value);
27940
+ const selectedOption = (0, import_react20.useMemo)(() => lazyOptions.find((opt) => opt.value === value), [lazyOptions, value]);
27930
27941
  (0, import_react20.useEffect)(() => {
27931
27942
  const handleClickOutside = (e) => {
27932
27943
  if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
@@ -27961,7 +27972,16 @@ function LazySelectDropdown({
27961
27972
  };
27962
27973
  const handleFocus = () => {
27963
27974
  if (!disabled) setIsOpen(true);
27964
- loadPage(1, "");
27975
+ if (lazyOptions.length === 0)
27976
+ loadPage(1, "");
27977
+ };
27978
+ const handleRemoveSelection = (e) => {
27979
+ e.preventDefault();
27980
+ e.stopPropagation();
27981
+ onChange?.("", id || "");
27982
+ setSearchTerm("");
27983
+ reset();
27984
+ search("");
27965
27985
  };
27966
27986
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { ref: dropdownRef, className: "relative w-full", children: [
27967
27987
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
@@ -27971,7 +27991,7 @@ function LazySelectDropdown({
27971
27991
  id,
27972
27992
  name: id,
27973
27993
  className: cn(
27974
- "w-full px-3 py-2 border border-[#BDBDBD] rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500",
27994
+ "w-full px-3 py-2 border border-[#BDBDBD] rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500 pr-7",
27975
27995
  disabled ? "bg-gray-100 cursor-not-allowed" : "bg-white cursor-pointer",
27976
27996
  className,
27977
27997
  errorMessage ? "border-red-500" : ""
@@ -27984,6 +28004,16 @@ function LazySelectDropdown({
27984
28004
  disabled
27985
28005
  }
27986
28006
  ),
28007
+ selectedOption && !disabled && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28008
+ "button",
28009
+ {
28010
+ type: "button",
28011
+ "aria-label": "Clear selection",
28012
+ onClick: handleRemoveSelection,
28013
+ className: "absolute right-2 top-1/2 -translate-y-1/2 h-5 w-5 flex items-center justify-center rounded hover:bg-gray-200 text-gray-500 focus:outline-none",
28014
+ children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SquareX, { className: "h-5 w-5 pointer-events-none" })
28015
+ }
28016
+ ),
27987
28017
  errorMessage && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "mt-1 text-xs text-red-500", children: errorMessage }),
27988
28018
  isOpen && !disabled && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
27989
28019
  "div",
@@ -28706,343 +28736,230 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
28706
28736
  var TextInputGroup_default = TextInputGroup;
28707
28737
 
28708
28738
  // src/components/Inputs/Multiselect/MultiSelect.tsx
28709
- var React8 = __toESM(require("react"));
28710
-
28711
- // src/components/ui/command.tsx
28712
- var import_cmdk = require("cmdk");
28713
-
28714
- // src/components/ui/dialog.tsx
28715
- var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
28739
+ var import_react29 = require("react");
28716
28740
  var import_jsx_runtime48 = require("react/jsx-runtime");
28717
- function Dialog({
28718
- ...props
28719
- }) {
28720
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
28721
- }
28722
- function DialogPortal({
28723
- ...props
28724
- }) {
28725
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
28726
- }
28727
- function DialogOverlay({
28741
+ function LazyMultiSelectDropdown({
28742
+ options = [],
28743
+ value = [],
28744
+ onChange,
28745
+ placeholder,
28728
28746
  className,
28729
- ...props
28747
+ id,
28748
+ disabled,
28749
+ readOnly,
28750
+ source,
28751
+ apiUrl,
28752
+ pageSize,
28753
+ dataKey = "id",
28754
+ dataLabel = "name",
28755
+ errorMessage,
28756
+ axiosInstance,
28757
+ outputFormat = "array"
28730
28758
  }) {
28731
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28732
- DialogPrimitive.Overlay,
28733
- {
28734
- "data-slot": "dialog-overlay",
28735
- className: cn(
28736
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[60] bg-black/50",
28737
- className
28738
- ),
28739
- ...props
28759
+ const [isOpen, setIsOpen] = (0, import_react29.useState)(false);
28760
+ const [searchTerm, setSearchTerm] = (0, import_react29.useState)("");
28761
+ const dropdownRef = (0, import_react29.useRef)(null);
28762
+ const observerTarget = (0, import_react29.useRef)(null);
28763
+ const {
28764
+ options: lazyOptions,
28765
+ loading,
28766
+ hasMore,
28767
+ loadMore,
28768
+ search,
28769
+ reset,
28770
+ loadPage
28771
+ } = useLazyDropdown({
28772
+ enabled: true,
28773
+ dataSource: source || "",
28774
+ apiUrl,
28775
+ pageSize: pageSize || 10,
28776
+ dataKey,
28777
+ dataLabel,
28778
+ initialData: options || [],
28779
+ value,
28780
+ axiosInstance
28781
+ });
28782
+ const ensureUnique = (arr) => {
28783
+ return Array.from(new Set(arr));
28784
+ };
28785
+ const convertOutput = (values) => {
28786
+ const unique = ensureUnique(values);
28787
+ switch (outputFormat) {
28788
+ case "comma":
28789
+ return unique.join(",");
28790
+ case "semicolon":
28791
+ return unique.join(";");
28792
+ default:
28793
+ return unique;
28740
28794
  }
28741
- );
28742
- }
28743
- function DialogContent({
28744
- className,
28745
- children,
28746
- showCloseButton = true,
28747
- ...props
28748
- }) {
28749
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
28750
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DialogOverlay, {}),
28795
+ };
28796
+ const normalizeInput = (value2) => {
28797
+ let arr = [];
28798
+ if (Array.isArray(value2)) {
28799
+ arr = value2;
28800
+ } else if (typeof value2 === "string") {
28801
+ if (!value2.trim()) return [];
28802
+ if (value2.includes(";")) arr = value2.split(";").map((v) => v.trim());
28803
+ else if (value2.includes(",")) arr = value2.split(",").map((v) => v.trim());
28804
+ else arr = [value2.trim()];
28805
+ }
28806
+ return ensureUnique(arr);
28807
+ };
28808
+ const normalizedValue = normalizeInput(value);
28809
+ const selectedOptions = (0, import_react29.useMemo)(() => {
28810
+ return lazyOptions.filter((opt) => normalizedValue.includes(opt.value));
28811
+ }, [lazyOptions, normalizedValue]);
28812
+ (0, import_react29.useEffect)(() => {
28813
+ const handleClick = (e) => {
28814
+ if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
28815
+ setIsOpen(false);
28816
+ }
28817
+ };
28818
+ document.addEventListener("mousedown", handleClick);
28819
+ return () => document.removeEventListener("mousedown", handleClick);
28820
+ }, []);
28821
+ (0, import_react29.useEffect)(() => {
28822
+ if (!isOpen || !hasMore || loading) return;
28823
+ const obs = new IntersectionObserver(
28824
+ (entries) => {
28825
+ if (entries[0].isIntersecting) loadMore();
28826
+ },
28827
+ { threshold: 0.1 }
28828
+ );
28829
+ if (observerTarget.current) obs.observe(observerTarget.current);
28830
+ return () => obs.disconnect();
28831
+ }, [isOpen, hasMore, loading, loadMore]);
28832
+ const handleSearch = (e) => {
28833
+ const term = e.target.value;
28834
+ setSearchTerm(term);
28835
+ search(term);
28836
+ };
28837
+ const toggleSelect = (val) => {
28838
+ let updated;
28839
+ if (normalizedValue.includes(val)) {
28840
+ updated = normalizedValue.filter((v) => v !== val);
28841
+ } else {
28842
+ updated = ensureUnique([...normalizedValue, val]);
28843
+ }
28844
+ onChange(convertOutput(updated), id);
28845
+ };
28846
+ const removeTag = (val) => {
28847
+ const updated = normalizedValue.filter((v) => v !== val);
28848
+ onChange(convertOutput(updated), id);
28849
+ };
28850
+ const handleFocus = () => {
28851
+ if (!disabled) setIsOpen(true);
28852
+ if (lazyOptions.length === 0) loadPage(1, "");
28853
+ };
28854
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { ref: dropdownRef, className: "relative w-full", children: [
28751
28855
  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
28752
- DialogPrimitive.Content,
28856
+ "div",
28753
28857
  {
28754
- "data-slot": "dialog-content",
28858
+ onClick: handleFocus,
28755
28859
  className: cn(
28756
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-[70] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
28860
+ "min-h-10 w-full flex items-center flex-wrap gap-1 px-2 py-1 border border-[#BDBDBD] rounded-md bg-white cursor-pointer",
28861
+ disabled && "bg-gray-100 cursor-not-allowed",
28862
+ errorMessage && "border-red-500",
28757
28863
  className
28758
28864
  ),
28759
- ...props,
28760
28865
  children: [
28761
- children,
28762
- showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
28763
- DialogPrimitive.Close,
28866
+ selectedOptions.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
28867
+ "span",
28764
28868
  {
28765
- "data-slot": "dialog-close",
28766
- className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
28869
+ className: "bg-blue-100 text-blue-700 px-2 py-1 rounded-md text-xs flex items-center gap-1",
28767
28870
  children: [
28768
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(X, {}),
28769
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "sr-only", children: "Close" })
28871
+ opt.label,
28872
+ !disabled && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28873
+ "button",
28874
+ {
28875
+ type: "button",
28876
+ onClick: (e) => {
28877
+ e.stopPropagation();
28878
+ removeTag(opt.value);
28879
+ },
28880
+ className: "hover:text-red-600",
28881
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(X, { size: 12 })
28882
+ }
28883
+ )
28770
28884
  ]
28885
+ },
28886
+ opt.value
28887
+ )),
28888
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28889
+ "input",
28890
+ {
28891
+ type: "text",
28892
+ placeholder: selectedOptions.length ? "" : placeholder,
28893
+ className: "flex-1 min-w-[60px] p-1 outline-none",
28894
+ value: isOpen ? searchTerm : "",
28895
+ onChange: handleSearch,
28896
+ readOnly,
28897
+ disabled
28771
28898
  }
28772
28899
  )
28773
28900
  ]
28774
28901
  }
28775
- )
28776
- ] });
28777
- }
28778
- function DialogHeader({ className, ...props }) {
28779
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28780
- "div",
28781
- {
28782
- "data-slot": "dialog-header",
28783
- className: cn("flex flex-col gap-2 text-center sm:text-left", className),
28784
- ...props
28785
- }
28786
- );
28787
- }
28788
- function DialogFooter({ className, ...props }) {
28789
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28790
- "div",
28791
- {
28792
- "data-slot": "dialog-footer",
28793
- className: cn(
28794
- "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
28795
- className
28796
- ),
28797
- ...props
28798
- }
28799
- );
28800
- }
28801
- function DialogTitle({
28802
- className,
28803
- ...props
28804
- }) {
28805
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28806
- DialogPrimitive.Title,
28807
- {
28808
- "data-slot": "dialog-title",
28809
- className: cn("text-lg leading-none font-semibold", className),
28810
- ...props
28811
- }
28812
- );
28813
- }
28814
- function DialogDescription({
28815
- className,
28816
- ...props
28817
- }) {
28818
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28819
- DialogPrimitive.Description,
28820
- {
28821
- "data-slot": "dialog-description",
28822
- className: cn("text-muted-foreground text-sm", className),
28823
- ...props
28824
- }
28825
- );
28826
- }
28827
-
28828
- // src/components/ui/command.tsx
28829
- var import_jsx_runtime49 = require("react/jsx-runtime");
28830
- function Command2({
28831
- className,
28832
- ...props
28833
- }) {
28834
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28835
- import_cmdk.Command,
28836
- {
28837
- "data-slot": "command",
28838
- className: cn(
28839
- "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
28840
- className
28841
- ),
28842
- ...props
28843
- }
28844
- );
28845
- }
28846
- function CommandInput({
28847
- className,
28848
- ...props
28849
- }) {
28850
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
28851
- "div",
28852
- {
28853
- "data-slot": "command-input-wrapper",
28854
- className: "flex h-9 items-center gap-2 border-b px-3",
28855
- children: [
28856
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Search, { className: "size-4 shrink-0 opacity-50" }),
28857
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28858
- import_cmdk.Command.Input,
28859
- {
28860
- "data-slot": "command-input",
28861
- className: cn(
28862
- "placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
28863
- className
28864
- ),
28865
- ...props
28866
- }
28867
- )
28868
- ]
28869
- }
28870
- );
28871
- }
28872
- function CommandList({
28873
- className,
28874
- ...props
28875
- }) {
28876
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28877
- import_cmdk.Command.List,
28878
- {
28879
- "data-slot": "command-list",
28880
- className: cn(
28881
- "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
28882
- className
28883
- ),
28884
- ...props
28885
- }
28886
- );
28887
- }
28888
- function CommandEmpty({
28889
- ...props
28890
- }) {
28891
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28892
- import_cmdk.Command.Empty,
28893
- {
28894
- "data-slot": "command-empty",
28895
- className: "py-6 text-center text-sm",
28896
- ...props
28897
- }
28898
- );
28899
- }
28900
- function CommandGroup({
28901
- className,
28902
- ...props
28903
- }) {
28904
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28905
- import_cmdk.Command.Group,
28906
- {
28907
- "data-slot": "command-group",
28908
- className: cn(
28909
- "text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
28910
- className
28911
- ),
28912
- ...props
28913
- }
28914
- );
28915
- }
28916
- function CommandItem({
28917
- className,
28918
- ...props
28919
- }) {
28920
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28921
- import_cmdk.Command.Item,
28922
- {
28923
- "data-slot": "command-item",
28924
- className: cn(
28925
- "data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
28926
- className
28927
- ),
28928
- ...props
28929
- }
28930
- );
28931
- }
28932
-
28933
- // src/components/Inputs/Multiselect/MultiSelect.tsx
28934
- var import_jsx_runtime50 = require("react/jsx-runtime");
28935
- var MultiSelect = ({
28936
- value = [],
28937
- onChange,
28938
- data = [],
28939
- placeholder = "Select...",
28940
- disabled,
28941
- searchable = true,
28942
- className = "",
28943
- dataKey = "value",
28944
- dataLabel = "label",
28945
- ...props
28946
- }) => {
28947
- const [open, setOpen] = React8.useState(false);
28948
- React8.useEffect(() => {
28949
- if (value) {
28950
- onChange(value, props?.name || "");
28951
- }
28952
- }, []);
28953
- const toggleOption = (val) => {
28954
- onChange(
28955
- value?.includes(val) ? value.filter((v) => v !== val) : [...value || [], val],
28956
- props?.name || ""
28957
- );
28958
- };
28959
- const selectedLabels = React8.useMemo(
28960
- () => {
28961
- if (!data || !value) return [];
28962
- return data?.filter((opt) => value?.includes(opt.value)).map((opt) => opt.label);
28963
- },
28964
- [data, value]
28965
- );
28966
- const options = data && data?.map((item) => ({
28967
- value: item[dataKey],
28968
- label: item[dataLabel]
28969
- }));
28970
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
28971
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
28972
- Button,
28973
- {
28974
- variant: "outline",
28975
- role: "combobox",
28976
- className: `w-full justify-between ${className} ${props.errorMessage ? "border-red-500" : ""}`,
28977
- disabled,
28978
- type: "button",
28979
- children: [
28980
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "truncate", children: selectedLabels.length > 0 ? selectedLabels.join(", ") : placeholder }),
28981
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
28982
- ]
28983
- }
28984
- ) }),
28985
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
28986
- PopoverContent,
28902
+ ),
28903
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "mt-1 text-xs text-red-500", children: errorMessage }),
28904
+ isOpen && !disabled && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28905
+ "div",
28987
28906
  {
28988
- align: "start",
28989
- className: "w-[var(--radix-popover-trigger-width)] p-0",
28990
- onOpenAutoFocus: (e) => e.preventDefault(),
28991
- onInteractOutside: (e) => {
28992
- if (e.target.closest(".keep-open")) e.preventDefault();
28907
+ onMouseDown: (e) => e.stopPropagation(),
28908
+ className: "absolute z-[999] mt-1 bg-white border rounded-lg shadow-lg max-h-60 overflow-y-auto",
28909
+ style: {
28910
+ zIndex: 900,
28911
+ width: dropdownRef.current?.offsetWidth,
28912
+ top: dropdownRef.current ? dropdownRef.current.getBoundingClientRect().bottom + window.scrollY : 0,
28913
+ left: dropdownRef.current ? dropdownRef.current.getBoundingClientRect().left + window.scrollX : 0
28993
28914
  },
28994
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Command2, { shouldFilter: searchable, children: [
28995
- searchable && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(CommandInput, { placeholder: "Search..." }),
28996
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(CommandList, { children: [
28997
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(CommandEmpty, { children: "No options found." }),
28998
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(CommandGroup, { children: options.map((opt) => {
28999
- const isSelected = (value ?? [])?.includes(opt.value);
29000
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29001
- "div",
29002
- {
29003
- className: "keep-open",
29004
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29005
- CommandItem,
29006
- {
29007
- onMouseDown: (e) => {
29008
- e.preventDefault();
29009
- toggleOption(opt.value);
29010
- },
29011
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-2", children: [
29012
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Checkbox, { checked: isSelected }),
29013
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: opt.label })
29014
- ] })
29015
- },
29016
- opt.value
29017
- )
29018
- },
29019
- opt.value
29020
- );
29021
- }) })
29022
- ] })
29023
- ] })
28915
+ children: loading && lazyOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "px-3 py-4 text-center text-gray-500", children: "Loading..." }) : lazyOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
28916
+ lazyOptions.map((option) => {
28917
+ const isSelected = normalizedValue.includes(option.value);
28918
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
28919
+ "div",
28920
+ {
28921
+ onClick: () => toggleSelect(option.value),
28922
+ className: cn(
28923
+ "px-3 py-2 text-sm cursor-pointer hover:bg-blue-50 flex justify-between",
28924
+ isSelected && "bg-blue-100"
28925
+ ),
28926
+ children: [
28927
+ option.label,
28928
+ isSelected && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SquareX, { size: 16 })
28929
+ ]
28930
+ },
28931
+ option.value
28932
+ );
28933
+ }),
28934
+ hasMore && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28935
+ "div",
28936
+ {
28937
+ ref: observerTarget,
28938
+ className: "px-3 py-3 text-center text-gray-400 text-sm",
28939
+ children: loading ? "Loading\u2026" : "Scroll for more\u2026"
28940
+ }
28941
+ )
28942
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "px-3 py-4 text-center text-gray-500", children: "No results" })
29024
28943
  }
29025
- ),
29026
- props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
28944
+ ) })
29027
28945
  ] });
29028
- };
29029
- var MultiSelect_default = MultiSelect;
28946
+ }
29030
28947
 
29031
28948
  // src/components/ui/data-table.tsx
29032
- var React10 = __toESM(require("react"));
28949
+ var React9 = __toESM(require("react"));
29033
28950
  var import_free_solid_svg_icons2 = require("@fortawesome/free-solid-svg-icons");
29034
28951
  var import_react_fontawesome3 = require("@fortawesome/react-fontawesome");
29035
28952
  var import_react_table2 = require("@tanstack/react-table");
29036
28953
 
29037
28954
  // src/components/ui/table.tsx
29038
- var import_jsx_runtime51 = require("react/jsx-runtime");
28955
+ var import_jsx_runtime49 = require("react/jsx-runtime");
29039
28956
  function Table3({ className, ...props }) {
29040
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
28957
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
29041
28958
  "div",
29042
28959
  {
29043
28960
  "data-slot": "table-container",
29044
28961
  className: "relative w-full overflow-x-auto rounded-md border border-gray-200 bg-white",
29045
- children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
28962
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
29046
28963
  "table",
29047
28964
  {
29048
28965
  "data-slot": "table",
@@ -29054,7 +28971,7 @@ function Table3({ className, ...props }) {
29054
28971
  );
29055
28972
  }
29056
28973
  function TableHeader({ className, ...props }) {
29057
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
28974
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
29058
28975
  "thead",
29059
28976
  {
29060
28977
  "data-slot": "table-header",
@@ -29067,7 +28984,7 @@ function TableHeader({ className, ...props }) {
29067
28984
  );
29068
28985
  }
29069
28986
  function TableBody({ className, ...props }) {
29070
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
28987
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
29071
28988
  "tbody",
29072
28989
  {
29073
28990
  "data-slot": "table-body",
@@ -29080,7 +28997,7 @@ function TableBody({ className, ...props }) {
29080
28997
  );
29081
28998
  }
29082
28999
  function TableRow({ className, ...props }) {
29083
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29000
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
29084
29001
  "tr",
29085
29002
  {
29086
29003
  "data-slot": "table-row",
@@ -29093,7 +29010,7 @@ function TableRow({ className, ...props }) {
29093
29010
  );
29094
29011
  }
29095
29012
  function TableHead({ className, ...props }) {
29096
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29013
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
29097
29014
  "th",
29098
29015
  {
29099
29016
  "data-slot": "table-head",
@@ -29106,7 +29023,7 @@ function TableHead({ className, ...props }) {
29106
29023
  );
29107
29024
  }
29108
29025
  function TableCell({ className, ...props }) {
29109
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29026
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
29110
29027
  "td",
29111
29028
  {
29112
29029
  "data-slot": "table-cell",
@@ -29123,7 +29040,7 @@ function TableCell({ className, ...props }) {
29123
29040
  var import_react_table = require("@tanstack/react-table");
29124
29041
 
29125
29042
  // src/lib/table/cellRendererFactory.tsx
29126
- var import_react29 = __toESM(require("react"));
29043
+ var import_react30 = __toESM(require("react"));
29127
29044
  var import_image3 = __toESM(require("next/image"));
29128
29045
 
29129
29046
  // src/lib/dayjs-setup.ts
@@ -29172,7 +29089,7 @@ var valueFormatter = (value, format2, customFormatters = {}) => {
29172
29089
  };
29173
29090
 
29174
29091
  // src/lib/table/cellRendererFactory.tsx
29175
- var import_jsx_runtime52 = require("react/jsx-runtime");
29092
+ var import_jsx_runtime50 = require("react/jsx-runtime");
29176
29093
  var getContrastColor = (bg) => {
29177
29094
  let c = bg.trim().toUpperCase();
29178
29095
  if (/^#([a-fA-F0-9]{3})$/.test(c)) {
@@ -29206,9 +29123,9 @@ var getContrastColor = (bg) => {
29206
29123
  };
29207
29124
  var sanitizeValue = (val) => {
29208
29125
  if (val == null) return null;
29209
- if (import_react29.default.isValidElement(val)) return val;
29126
+ if (import_react30.default.isValidElement(val)) return val;
29210
29127
  if (typeof val === "string" || typeof val === "number") return val;
29211
- if (Array.isArray(val)) return val.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react29.default.Fragment, { children: sanitizeValue(v) }, i));
29128
+ if (Array.isArray(val)) return val.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react30.default.Fragment, { children: sanitizeValue(v) }, i));
29212
29129
  if (typeof val === "object") {
29213
29130
  if ("name" in val && typeof val.name === "string") return val.name;
29214
29131
  if ("label" in val && typeof val.label === "string") return val.label;
@@ -29225,13 +29142,13 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29225
29142
  switch (renderer) {
29226
29143
  /* -------------------- BASIC -------------------- */
29227
29144
  case "text":
29228
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: row?.[rendererProps?.rowField] || formattedValue });
29145
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: row?.[rendererProps?.rowField] || formattedValue });
29229
29146
  case "number":
29230
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "tabular-nums text-right", children: valueFormatter(row?.[rendererProps?.rowField] || value, "number:2") });
29147
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "tabular-nums text-right", children: valueFormatter(row?.[rendererProps?.rowField] || value, "number:2") });
29231
29148
  case "date":
29232
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: valueFormatter(row?.[rendererProps?.rowField] || value, format2) });
29149
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: valueFormatter(row?.[rendererProps?.rowField] || value, format2) });
29233
29150
  case "link":
29234
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29151
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29235
29152
  "a",
29236
29153
  {
29237
29154
  href: `${rendererProps?.prefix || ""}${row?.[rendererProps?.rowField] || formattedValue}`,
@@ -29243,7 +29160,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29243
29160
  );
29244
29161
  /* -------------------- VISUAL -------------------- */
29245
29162
  case "image":
29246
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29163
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29247
29164
  import_image3.default,
29248
29165
  {
29249
29166
  src: row?.[rendererProps?.rowField] || formattedValue || rendererProps?.fallback || "/placeholder.png",
@@ -29260,7 +29177,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29260
29177
  case "icon":
29261
29178
  const maybeIcon = lucide_react_exports[rendererProps?.icon];
29262
29179
  const IconComponent = typeof maybeIcon === "function" ? maybeIcon : Star;
29263
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29180
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29264
29181
  IconComponent,
29265
29182
  {
29266
29183
  size: rendererProps?.size || 16,
@@ -29272,7 +29189,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29272
29189
  const color = rendererProps?.colorMap?.[formattedValue] || rendererProps?.color || "gray";
29273
29190
  if (!formattedValue) return null;
29274
29191
  const textColor = getContrastColor(color);
29275
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29192
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29276
29193
  "span",
29277
29194
  {
29278
29195
  className: `inline-block px-2 py-1 text-xs rounded-full bg-${color}-100 text-${textColor}-700 ${rendererProps?.className || ""}`,
@@ -29287,13 +29204,13 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29287
29204
  const IconComponent2 = typeof maybeIcon2 === "function" ? maybeIcon2 : Star;
29288
29205
  if (!formattedValue) return null;
29289
29206
  const textColor = getContrastColor(color);
29290
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
29207
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
29291
29208
  "span",
29292
29209
  {
29293
29210
  className: `inline-flex items-center gap-1 px-2 py-1 text-xs rounded-full bg-[${color}]-100 text-[${textColor}]-700`,
29294
29211
  style: { backgroundColor: color, color: textColor },
29295
29212
  children: [
29296
- rendererProps?.icon && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: IconComponent2 ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(IconComponent2, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Box, { className: "h-4 w-4" }) }),
29213
+ rendererProps?.icon && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, { children: IconComponent2 ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(IconComponent2, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Box, { className: "h-4 w-4" }) }),
29297
29214
  formattedValue
29298
29215
  ]
29299
29216
  }
@@ -29301,7 +29218,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29301
29218
  }
29302
29219
  /* -------------------- INTERACTIVE -------------------- */
29303
29220
  case "button":
29304
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29221
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29305
29222
  "button",
29306
29223
  {
29307
29224
  onClick: () => rendererProps?.onClick?.(row, formattedValue),
@@ -29310,8 +29227,8 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29310
29227
  }
29311
29228
  );
29312
29229
  case "switch":
29313
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("label", { className: "inline-flex items-center cursor-pointer", children: [
29314
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29230
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { className: "inline-flex items-center cursor-pointer", children: [
29231
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29315
29232
  "input",
29316
29233
  {
29317
29234
  type: "checkbox",
@@ -29320,10 +29237,10 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29320
29237
  className: "sr-only peer"
29321
29238
  }
29322
29239
  ),
29323
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "relative w-9 h-5 bg-gray-300 peer-checked:bg-blue-600 rounded-full transition-all", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "absolute top-[2px] left-[2px] w-4 h-4 bg-white rounded-full peer-checked:translate-x-4 transition-all" }) })
29240
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "relative w-9 h-5 bg-gray-300 peer-checked:bg-blue-600 rounded-full transition-all", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "absolute top-[2px] left-[2px] w-4 h-4 bg-white rounded-full peer-checked:translate-x-4 transition-all" }) })
29324
29241
  ] });
29325
29242
  case "progress":
29326
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "w-full bg-gray-100 rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29243
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "w-full bg-gray-100 rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29327
29244
  "div",
29328
29245
  {
29329
29246
  className: "bg-blue-600 h-2 rounded-full transition-all",
@@ -29332,7 +29249,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29332
29249
  ) });
29333
29250
  case "rating": {
29334
29251
  const stars = Math.round(Number(row?.[rendererProps?.rowField] || formattedValue) || 0);
29335
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex items-center", children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29252
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex items-center", children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29336
29253
  Star,
29337
29254
  {
29338
29255
  size: 16,
@@ -29346,7 +29263,7 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29346
29263
  case "custom": {
29347
29264
  const CustomRenderer = customRenderers[rendererProps?.customRendererId] || customRenderers[rendererProps?.rendererId];
29348
29265
  if (CustomRenderer)
29349
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29266
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29350
29267
  CustomRenderer,
29351
29268
  {
29352
29269
  value: formattedValue,
@@ -29354,11 +29271,11 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29354
29271
  ...rendererProps
29355
29272
  }
29356
29273
  );
29357
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: "Missing custom renderer" });
29274
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: "Missing custom renderer" });
29358
29275
  }
29359
29276
  /* -------------------- DEFAULT -------------------- */
29360
29277
  default:
29361
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: formattedValue });
29278
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: formattedValue });
29362
29279
  }
29363
29280
  };
29364
29281
 
@@ -29407,7 +29324,7 @@ var useDynamicColumns = (config, customRenderers = {}, customFormatters = {}) =>
29407
29324
  };
29408
29325
 
29409
29326
  // src/components/ui/data-table.tsx
29410
- var import_jsx_runtime53 = require("react/jsx-runtime");
29327
+ var import_jsx_runtime51 = require("react/jsx-runtime");
29411
29328
  function DataTable({
29412
29329
  columns,
29413
29330
  data,
@@ -29426,10 +29343,10 @@ function DataTable({
29426
29343
  onDeleteRow,
29427
29344
  rowActions
29428
29345
  }) {
29429
- const [columnFilters, setColumnFilters] = React10.useState([]);
29430
- const [columnVisibility, setColumnVisibility] = React10.useState({});
29431
- const [manualSort, setManualSort] = React10.useState(null);
29432
- const [searchTerm, setSearchTerm] = React10.useState("");
29346
+ const [columnFilters, setColumnFilters] = React9.useState([]);
29347
+ const [columnVisibility, setColumnVisibility] = React9.useState({});
29348
+ const [manualSort, setManualSort] = React9.useState(null);
29349
+ const [searchTerm, setSearchTerm] = React9.useState("");
29433
29350
  const tableData = Array.isArray(data) ? data : [];
29434
29351
  const dynamicCols = useDynamicColumns({ columns });
29435
29352
  const table = (0, import_react_table2.useReactTable)({
@@ -29480,11 +29397,11 @@ function DataTable({
29480
29397
  return [];
29481
29398
  };
29482
29399
  const pageCount = table.getPageCount() === 0 ? 1 : table.getPageCount();
29483
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "overflow-hidden rounded-md w-full", children: [
29484
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: `flex ${globalSearch ? "justify-between" : "justify-end"} p-2 bg-gray-50`, children: [
29485
- globalSearch && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-2 w-full max-w-sm", children: [
29486
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "relative w-full", children: [
29487
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29400
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "overflow-hidden rounded-md w-full", children: [
29401
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: `flex ${globalSearch ? "justify-between" : "justify-end"} p-2 bg-gray-50`, children: [
29402
+ globalSearch && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-2 w-full max-w-sm", children: [
29403
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "relative w-full", children: [
29404
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29488
29405
  "input",
29489
29406
  {
29490
29407
  type: "text",
@@ -29499,9 +29416,9 @@ function DataTable({
29499
29416
  className: "border border-gray-300 rounded-md text-sm px-3 py-2 pl-8 w-full focus:outline-none focus:ring-1 focus:ring-[#12715B]"
29500
29417
  }
29501
29418
  ),
29502
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Search, { className: "absolute left-2 top-2.5 text-gray-400", size: 16 })
29419
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Search, { className: "absolute left-2 top-2.5 text-gray-400", size: 16 })
29503
29420
  ] }),
29504
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29421
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29505
29422
  Button,
29506
29423
  {
29507
29424
  size: "sm",
@@ -29511,8 +29428,8 @@ function DataTable({
29511
29428
  }
29512
29429
  )
29513
29430
  ] }),
29514
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Popover, { children: [
29515
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29431
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Popover, { children: [
29432
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29516
29433
  Button,
29517
29434
  {
29518
29435
  variant: "outline",
@@ -29521,10 +29438,10 @@ function DataTable({
29521
29438
  children: "Manage Columns"
29522
29439
  }
29523
29440
  ) }),
29524
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
29525
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
29526
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
29527
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29441
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
29442
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
29443
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
29444
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29528
29445
  "input",
29529
29446
  {
29530
29447
  type: "checkbox",
@@ -29543,8 +29460,8 @@ function DataTable({
29543
29460
  ),
29544
29461
  "Toggle All"
29545
29462
  ] }),
29546
- table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
29547
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29463
+ table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
29464
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29548
29465
  "input",
29549
29466
  {
29550
29467
  type: "checkbox",
@@ -29557,12 +29474,12 @@ function DataTable({
29557
29474
  ] })
29558
29475
  ] })
29559
29476
  ] }),
29560
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Table3, { className: "table-fixed", children: [
29561
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableRow, { children: hg.headers.map((header, index) => {
29477
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Table3, { className: "table-fixed", children: [
29478
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableRow, { children: hg.headers.map((header, index) => {
29562
29479
  const canSort = header.column.getCanSort();
29563
29480
  const canFilter = header.column.getCanFilter();
29564
29481
  const sortDir = manualSort?.key === header.column.id ? manualSort.dir : null;
29565
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29482
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29566
29483
  TableHead,
29567
29484
  {
29568
29485
  className: "relative select-none",
@@ -29571,8 +29488,8 @@ function DataTable({
29571
29488
  minWidth: header.column.columnDef.minSize,
29572
29489
  maxWidth: header.column.columnDef.maxSize
29573
29490
  },
29574
- children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center justify-between", children: [
29575
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
29491
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center justify-between", children: [
29492
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
29576
29493
  "span",
29577
29494
  {
29578
29495
  className: `flex items-center gap-1 ${canSort ? "cursor-pointer" : ""}`,
@@ -29584,32 +29501,32 @@ function DataTable({
29584
29501
  },
29585
29502
  children: [
29586
29503
  (0, import_react_table2.flexRender)(header.column.columnDef.header, header.getContext()),
29587
- canSort && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
29588
- sortDir === "asc" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ArrowUp, { size: 14, className: "text-gray-500" }),
29589
- sortDir === "desc" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ArrowDown, { size: 14, className: "text-gray-500" }),
29590
- !sortDir && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ArrowUpDown, { size: 14, className: "text-gray-400" })
29504
+ canSort && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
29505
+ sortDir === "asc" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ArrowUp, { size: 14, className: "text-gray-500" }),
29506
+ sortDir === "desc" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ArrowDown, { size: 14, className: "text-gray-500" }),
29507
+ !sortDir && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ArrowUpDown, { size: 14, className: "text-gray-400" })
29591
29508
  ] })
29592
29509
  ]
29593
29510
  }
29594
29511
  ),
29595
- canFilter && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Popover, { children: [
29596
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29512
+ canFilter && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Popover, { children: [
29513
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29597
29514
  "span",
29598
29515
  {
29599
29516
  role: "presentation",
29600
29517
  className: "pl-5 cursor-pointer",
29601
29518
  onClick: (e) => e.stopPropagation(),
29602
- children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react_fontawesome3.FontAwesomeIcon, { icon: import_free_solid_svg_icons2.faEllipsisH, className: "w-5 h-5 text-gray-500" })
29519
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_fontawesome3.FontAwesomeIcon, { icon: import_free_solid_svg_icons2.faEllipsisH, className: "w-5 h-5 text-gray-500" })
29603
29520
  }
29604
29521
  ) }),
29605
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29522
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29606
29523
  PopoverContent,
29607
29524
  {
29608
29525
  align: "center",
29609
29526
  sideOffset: 14,
29610
29527
  className: "w-50 p-3 z-[200] border-gray-300",
29611
29528
  avoidCollisions: true,
29612
- children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
29529
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
29613
29530
  "form",
29614
29531
  {
29615
29532
  onSubmit: (e) => {
@@ -29622,8 +29539,8 @@ function DataTable({
29622
29539
  },
29623
29540
  className: "space-y-2",
29624
29541
  children: [
29625
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("label", { htmlFor: "filter", className: "text-xs text-gray-500 font-normal", children: "Filter by value:" }),
29626
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29542
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", { htmlFor: "filter", className: "text-xs text-gray-500 font-normal", children: "Filter by value:" }),
29543
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29627
29544
  "input",
29628
29545
  {
29629
29546
  name: "filter",
@@ -29633,7 +29550,7 @@ function DataTable({
29633
29550
  autoComplete: "off"
29634
29551
  }
29635
29552
  ),
29636
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "justify-end flex", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29553
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "justify-end flex", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29637
29554
  Button,
29638
29555
  {
29639
29556
  type: "submit",
@@ -29652,11 +29569,11 @@ function DataTable({
29652
29569
  `header-${header.id}-${index}`
29653
29570
  );
29654
29571
  }) }, `header-group-${hg.id}`)) }),
29655
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableBody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_jsx_runtime53.Fragment, { children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableRow, { children: dynamicCols.map((_2, j) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableCell, { className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "h-4 bg-gray-200 rounded w-3/4 block animate-pulse" }) }, j)) }, i)) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableRow, { children: row.getVisibleCells().map((cell, cellIndex, arr) => {
29572
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableBody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableRow, { children: dynamicCols.map((_2, j) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableCell, { className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "h-4 bg-gray-200 rounded w-3/4 block animate-pulse" }) }, j)) }, i)) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableRow, { children: row.getVisibleCells().map((cell, cellIndex, arr) => {
29656
29573
  const meta = cell.column.columnDef.meta || {};
29657
29574
  const isClickable = meta?.isClickable;
29658
29575
  const isLastCell = cellIndex === arr.length - 1;
29659
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
29576
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
29660
29577
  TableCell,
29661
29578
  {
29662
29579
  className: `${meta?.cellClass ?? ""} ${isClickable ? "cursor-pointer hover:bg-gray-100 underline text-blue-500" : ""} relative py-2`,
@@ -29673,9 +29590,9 @@ function DataTable({
29673
29590
  },
29674
29591
  children: [
29675
29592
  (0, import_react_table2.flexRender)(cell.column.columnDef.cell, cell.getContext()),
29676
- isLastCell && rowActions && rowActions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "absolute bg-[#fff] p-1 px-4 inset-y-0 right-0 flex items-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 shadow-lg rounded", children: rowActions.map((action) => {
29593
+ isLastCell && rowActions && rowActions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "absolute bg-[#fff] p-1 px-4 inset-y-0 right-0 flex items-center opacity-0 group-hover:opacity-100 transition-opacity duration-200 shadow-lg rounded", children: rowActions.map((action) => {
29677
29594
  const isDelete = action.id === "delete" || action.icon === "delete";
29678
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29595
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29679
29596
  "button",
29680
29597
  {
29681
29598
  className: `ml-2 px-2 py-1 text-[12px] rounded cursor-pointer ${isDelete ? "bg-red-800 text-white hover:bg-neutral-600" : "bg-gray-300 hover:bg-gray-400"}`,
@@ -29697,17 +29614,17 @@ function DataTable({
29697
29614
  },
29698
29615
  `cell-${cell.id}-${cellIndex}`
29699
29616
  );
29700
- }) }, row.id)) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TableCell, { colSpan: dynamicCols.length, className: "h-24 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "flex items-center justify-center py-10 w-full min-w-full text-gray-600 bg-gray-100", children: "No results." }) }) }) })
29617
+ }) }, row.id)) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TableCell, { colSpan: dynamicCols.length, className: "h-24 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "flex items-center justify-center py-10 w-full min-w-full text-gray-600 bg-gray-100", children: "No results." }) }) }) })
29701
29618
  ] }),
29702
- pagination && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
29703
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { children: [
29619
+ pagination && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
29620
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { children: [
29704
29621
  "Page ",
29705
29622
  table.getState().pagination.pageIndex + 1,
29706
29623
  " of ",
29707
29624
  pageCount
29708
29625
  ] }),
29709
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-2", children: [
29710
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29626
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-center gap-2", children: [
29627
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29711
29628
  "button",
29712
29629
  {
29713
29630
  onClick: () => table.previousPage(),
@@ -29720,7 +29637,7 @@ function DataTable({
29720
29637
  table.getState().pagination.pageIndex + 1,
29721
29638
  table.getPageCount(),
29722
29639
  5
29723
- ).map((pageNum, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29640
+ ).map((pageNum, index) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29724
29641
  "button",
29725
29642
  {
29726
29643
  disabled: pageNum === "...",
@@ -29730,7 +29647,7 @@ function DataTable({
29730
29647
  },
29731
29648
  index
29732
29649
  )),
29733
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29650
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
29734
29651
  "button",
29735
29652
  {
29736
29653
  onClick: () => table.nextPage(),
@@ -29745,7 +29662,7 @@ function DataTable({
29745
29662
  }
29746
29663
 
29747
29664
  // src/components/DataDisplay/Table/Table.tsx
29748
- var import_jsx_runtime54 = require("react/jsx-runtime");
29665
+ var import_jsx_runtime52 = require("react/jsx-runtime");
29749
29666
  var Table4 = ({
29750
29667
  columns,
29751
29668
  data,
@@ -29770,7 +29687,7 @@ var Table4 = ({
29770
29687
  const rawColumns = Array.isArray(columns) ? columns : [];
29771
29688
  const rawData = Array.isArray(data) ? data : [];
29772
29689
  const isControlled = typeof page === "number";
29773
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: `${className || ""} space-y-3`, style, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
29690
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: `${className || ""} space-y-3`, style, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
29774
29691
  DataTable,
29775
29692
  {
29776
29693
  ...props,
@@ -29802,9 +29719,9 @@ var Table4 = ({
29802
29719
  var Table_default = Table4;
29803
29720
 
29804
29721
  // src/components/ui/pagination.tsx
29805
- var import_jsx_runtime55 = require("react/jsx-runtime");
29722
+ var import_jsx_runtime53 = require("react/jsx-runtime");
29806
29723
  function Pagination({ className, ...props }) {
29807
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
29724
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29808
29725
  "nav",
29809
29726
  {
29810
29727
  role: "navigation",
@@ -29819,7 +29736,7 @@ function PaginationContent({
29819
29736
  className,
29820
29737
  ...props
29821
29738
  }) {
29822
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
29739
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29823
29740
  "ul",
29824
29741
  {
29825
29742
  "data-slot": "pagination-content",
@@ -29829,7 +29746,7 @@ function PaginationContent({
29829
29746
  );
29830
29747
  }
29831
29748
  function PaginationItem({ ...props }) {
29832
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("li", { "data-slot": "pagination-item", ...props });
29749
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("li", { "data-slot": "pagination-item", ...props });
29833
29750
  }
29834
29751
  function PaginationLink({
29835
29752
  className,
@@ -29837,7 +29754,7 @@ function PaginationLink({
29837
29754
  size = "icon",
29838
29755
  ...props
29839
29756
  }) {
29840
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
29757
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
29841
29758
  "a",
29842
29759
  {
29843
29760
  "aria-current": isActive ? "page" : void 0,
@@ -29858,7 +29775,7 @@ function PaginationPrevious({
29858
29775
  className,
29859
29776
  ...props
29860
29777
  }) {
29861
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
29778
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
29862
29779
  PaginationLink,
29863
29780
  {
29864
29781
  "aria-label": "Go to previous page",
@@ -29866,8 +29783,8 @@ function PaginationPrevious({
29866
29783
  className: cn("gap-1 px-2.5 sm:pl-2.5", className),
29867
29784
  ...props,
29868
29785
  children: [
29869
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ChevronLeft, {}),
29870
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "hidden sm:block", children: "Previous" })
29786
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ChevronLeft, {}),
29787
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "hidden sm:block", children: "Previous" })
29871
29788
  ]
29872
29789
  }
29873
29790
  );
@@ -29876,7 +29793,7 @@ function PaginationNext({
29876
29793
  className,
29877
29794
  ...props
29878
29795
  }) {
29879
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
29796
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
29880
29797
  PaginationLink,
29881
29798
  {
29882
29799
  "aria-label": "Go to next page",
@@ -29884,8 +29801,8 @@ function PaginationNext({
29884
29801
  className: cn("gap-1 px-2.5 sm:pr-2.5", className),
29885
29802
  ...props,
29886
29803
  children: [
29887
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "hidden sm:block", children: "Next" }),
29888
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ChevronRight, {})
29804
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "hidden sm:block", children: "Next" }),
29805
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ChevronRight, {})
29889
29806
  ]
29890
29807
  }
29891
29808
  );
@@ -29894,7 +29811,7 @@ function PaginationEllipsis({
29894
29811
  className,
29895
29812
  ...props
29896
29813
  }) {
29897
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
29814
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
29898
29815
  "span",
29899
29816
  {
29900
29817
  "aria-hidden": true,
@@ -29902,15 +29819,15 @@ function PaginationEllipsis({
29902
29819
  className: cn("flex size-9 items-center justify-center", className),
29903
29820
  ...props,
29904
29821
  children: [
29905
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Ellipsis, { className: "size-4" }),
29906
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "sr-only", children: "More pages" })
29822
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Ellipsis, { className: "size-4" }),
29823
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "sr-only", children: "More pages" })
29907
29824
  ]
29908
29825
  }
29909
29826
  );
29910
29827
  }
29911
29828
 
29912
29829
  // src/components/DataDisplay/Pagination/Pagination.tsx
29913
- var import_jsx_runtime56 = require("react/jsx-runtime");
29830
+ var import_jsx_runtime54 = require("react/jsx-runtime");
29914
29831
  var CustomPagination = ({
29915
29832
  totalPages,
29916
29833
  currentPage,
@@ -29956,10 +29873,10 @@ var CustomPagination = ({
29956
29873
  }
29957
29874
  };
29958
29875
  const pageNumbers = getPageNumbers();
29959
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
29960
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-2", children: [
29961
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
29962
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
29876
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
29877
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-2", children: [
29878
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
29879
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
29963
29880
  Select,
29964
29881
  {
29965
29882
  defaultValue: String(perPage),
@@ -29967,26 +29884,26 @@ var CustomPagination = ({
29967
29884
  onPageChange({ page: 1, itemsPerPage: Number(value) });
29968
29885
  },
29969
29886
  children: [
29970
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectValue, { placeholder: "Select" }) }),
29971
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(SelectContent, { children: [
29972
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "5", children: "5" }),
29973
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "10", children: "10" }),
29974
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "20", children: "20" }),
29975
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "50", children: "50" })
29887
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectValue, { placeholder: "Select" }) }),
29888
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(SelectContent, { children: [
29889
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "5", children: "5" }),
29890
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "10", children: "10" }),
29891
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "20", children: "20" }),
29892
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(SelectItem, { value: "50", children: "50" })
29976
29893
  ] })
29977
29894
  ]
29978
29895
  }
29979
29896
  )
29980
29897
  ] }),
29981
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Pagination, { className: "justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(PaginationContent, { children: [
29982
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
29898
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Pagination, { className: "justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(PaginationContent, { children: [
29899
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
29983
29900
  PaginationPrevious,
29984
29901
  {
29985
29902
  onClick: () => handlePageChange(currentPage - 1),
29986
29903
  className: currentPage === 1 ? "pointer-events-none opacity-50" : "cursor-pointer"
29987
29904
  }
29988
29905
  ) }),
29989
- pageNumbers.map((pageNumber, index) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PaginationEllipsis, {}) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
29906
+ pageNumbers.map((pageNumber, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PaginationEllipsis, {}) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
29990
29907
  PaginationLink,
29991
29908
  {
29992
29909
  onClick: () => handlePageChange(pageNumber),
@@ -29995,7 +29912,7 @@ var CustomPagination = ({
29995
29912
  children: pageNumber
29996
29913
  }
29997
29914
  ) }, index)),
29998
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
29915
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
29999
29916
  PaginationNext,
30000
29917
  {
30001
29918
  onClick: () => handlePageChange(currentPage + 1),
@@ -30008,12 +29925,128 @@ var CustomPagination = ({
30008
29925
  var Pagination_default = CustomPagination;
30009
29926
 
30010
29927
  // src/components/Navigation/Tabs/Tabs.tsx
30011
- var import_react30 = require("react");
29928
+ var import_react31 = require("react");
30012
29929
  var import_link5 = __toESM(require("next/link"));
30013
29930
  var import_navigation3 = require("next/navigation");
30014
- var import_jsx_runtime57 = require("react/jsx-runtime");
29931
+
29932
+ // src/components/ui/dialog.tsx
29933
+ var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
29934
+ var import_jsx_runtime55 = require("react/jsx-runtime");
29935
+ function Dialog({
29936
+ ...props
29937
+ }) {
29938
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
29939
+ }
29940
+ function DialogPortal({
29941
+ ...props
29942
+ }) {
29943
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
29944
+ }
29945
+ function DialogOverlay({
29946
+ className,
29947
+ ...props
29948
+ }) {
29949
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
29950
+ DialogPrimitive.Overlay,
29951
+ {
29952
+ "data-slot": "dialog-overlay",
29953
+ className: cn(
29954
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[60] bg-black/50",
29955
+ className
29956
+ ),
29957
+ ...props
29958
+ }
29959
+ );
29960
+ }
29961
+ function DialogContent({
29962
+ className,
29963
+ children,
29964
+ showCloseButton = true,
29965
+ ...props
29966
+ }) {
29967
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
29968
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DialogOverlay, {}),
29969
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
29970
+ DialogPrimitive.Content,
29971
+ {
29972
+ "data-slot": "dialog-content",
29973
+ className: cn(
29974
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-[70] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
29975
+ className
29976
+ ),
29977
+ ...props,
29978
+ children: [
29979
+ children,
29980
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
29981
+ DialogPrimitive.Close,
29982
+ {
29983
+ "data-slot": "dialog-close",
29984
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
29985
+ children: [
29986
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(X, {}),
29987
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "sr-only", children: "Close" })
29988
+ ]
29989
+ }
29990
+ )
29991
+ ]
29992
+ }
29993
+ )
29994
+ ] });
29995
+ }
29996
+ function DialogHeader({ className, ...props }) {
29997
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
29998
+ "div",
29999
+ {
30000
+ "data-slot": "dialog-header",
30001
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
30002
+ ...props
30003
+ }
30004
+ );
30005
+ }
30006
+ function DialogFooter({ className, ...props }) {
30007
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
30008
+ "div",
30009
+ {
30010
+ "data-slot": "dialog-footer",
30011
+ className: cn(
30012
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
30013
+ className
30014
+ ),
30015
+ ...props
30016
+ }
30017
+ );
30018
+ }
30019
+ function DialogTitle({
30020
+ className,
30021
+ ...props
30022
+ }) {
30023
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
30024
+ DialogPrimitive.Title,
30025
+ {
30026
+ "data-slot": "dialog-title",
30027
+ className: cn("text-lg leading-none font-semibold", className),
30028
+ ...props
30029
+ }
30030
+ );
30031
+ }
30032
+ function DialogDescription({
30033
+ className,
30034
+ ...props
30035
+ }) {
30036
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
30037
+ DialogPrimitive.Description,
30038
+ {
30039
+ "data-slot": "dialog-description",
30040
+ className: cn("text-muted-foreground text-sm", className),
30041
+ ...props
30042
+ }
30043
+ );
30044
+ }
30045
+
30046
+ // src/components/Navigation/Tabs/Tabs.tsx
30047
+ var import_jsx_runtime56 = require("react/jsx-runtime");
30015
30048
  var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = false, source, parentKey, menuNameKey, menuUrlKey, loading }) => {
30016
- const [openIndex, setOpenIndex] = (0, import_react30.useState)(null);
30049
+ const [openIndex, setOpenIndex] = (0, import_react31.useState)(null);
30017
30050
  function groupMenus(menus = []) {
30018
30051
  const menuMap = /* @__PURE__ */ new Map();
30019
30052
  menus.forEach((menu) => {
@@ -30046,7 +30079,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30046
30079
  });
30047
30080
  return sortMenus(rootMenus);
30048
30081
  }
30049
- const rawTabs = (0, import_react30.useMemo)(() => {
30082
+ const rawTabs = (0, import_react31.useMemo)(() => {
30050
30083
  if (!Array.isArray(tabs)) return [];
30051
30084
  if (source === "manual") return Array.isArray(tabs) ? tabs : [];
30052
30085
  return groupMenus(tabs);
@@ -30059,9 +30092,9 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30059
30092
  return pathname === path || path !== "/" && pathname?.startsWith(path);
30060
30093
  };
30061
30094
  const router = (0, import_navigation3.useRouter)();
30062
- const [showExitDialog, setShowExitDialog] = (0, import_react30.useState)(false);
30063
- const [pendingUrl, setPendingUrl] = (0, import_react30.useState)(null);
30064
- const handleBuilderExit = (0, import_react30.useCallback)(
30095
+ const [showExitDialog, setShowExitDialog] = (0, import_react31.useState)(false);
30096
+ const [pendingUrl, setPendingUrl] = (0, import_react31.useState)(null);
30097
+ const handleBuilderExit = (0, import_react31.useCallback)(
30065
30098
  (e, url) => {
30066
30099
  if (isBuilder) {
30067
30100
  e.preventDefault();
@@ -30081,13 +30114,13 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30081
30114
  const renderDesktopTab = (tab, index) => {
30082
30115
  const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
30083
30116
  if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
30084
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
30117
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
30085
30118
  DropdownMenu,
30086
30119
  {
30087
30120
  open: openIndex === index,
30088
30121
  onOpenChange: (open) => setOpenIndex(open ? index : null),
30089
30122
  children: [
30090
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
30123
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
30091
30124
  DropdownMenuTrigger,
30092
30125
  {
30093
30126
  className: `${finalClasses} inline-flex items-center gap-1`,
@@ -30100,11 +30133,11 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30100
30133
  },
30101
30134
  children: [
30102
30135
  tab.header,
30103
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ChevronDown, { className: "h-4 w-4 opacity-80" })
30136
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ChevronDown, { className: "h-4 w-4 opacity-80" })
30104
30137
  ]
30105
30138
  }
30106
30139
  ),
30107
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30140
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
30108
30141
  DropdownMenuContent,
30109
30142
  {
30110
30143
  align: "start",
@@ -30117,12 +30150,12 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30117
30150
  onMouseLeave: () => {
30118
30151
  timeout = setTimeout(() => setOpenIndex(null), 150);
30119
30152
  },
30120
- children: tab.children.map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30153
+ children: tab.children.map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
30121
30154
  DropdownMenuItem,
30122
30155
  {
30123
30156
  asChild: true,
30124
30157
  className: "cursor-pointer rounded-sm px-3 py-2 text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
30125
- children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30158
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
30126
30159
  import_link5.default,
30127
30160
  {
30128
30161
  href: item.url || "#",
@@ -30141,7 +30174,7 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30141
30174
  index
30142
30175
  );
30143
30176
  }
30144
- return tab.url ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30177
+ return tab.url ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
30145
30178
  import_link5.default,
30146
30179
  {
30147
30180
  href: tab.url,
@@ -30152,14 +30185,14 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30152
30185
  children: tab.header
30153
30186
  },
30154
30187
  index
30155
- ) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
30188
+ ) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
30156
30189
  };
30157
- const renderMobileMenu = () => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DropdownMenu, { children: [
30158
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
30159
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Menu, { className: "h-4 w-4" }),
30190
+ const renderMobileMenu = () => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenu, { children: [
30191
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
30192
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Menu, { className: "h-4 w-4" }),
30160
30193
  "Menu"
30161
30194
  ] }),
30162
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30195
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
30163
30196
  DropdownMenuContent,
30164
30197
  {
30165
30198
  align: "start",
@@ -30168,25 +30201,25 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30168
30201
  children: rawTabs.map((tab, i) => {
30169
30202
  const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
30170
30203
  if (hasChildren) {
30171
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DropdownMenuSub, { children: [
30172
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DropdownMenuSubTrigger, { className: "flex items-center justify-between cursor-pointer rounded-sm px-3 py-2 text-[13px] text-foreground hover:text-foreground", children: tab.header }),
30173
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30204
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DropdownMenuSub, { children: [
30205
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DropdownMenuSubTrigger, { className: "flex items-center justify-between cursor-pointer rounded-sm px-3 py-2 text-[13px] text-foreground hover:text-foreground", children: tab.header }),
30206
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
30174
30207
  DropdownMenuItem,
30175
30208
  {
30176
30209
  asChild: true,
30177
30210
  className: "cursor-pointer rounded-sm px-3 py-2 text-gray-800 hover:bg-gray-100",
30178
- children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_link5.default, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
30211
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_link5.default, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
30179
30212
  },
30180
30213
  item.id || index
30181
30214
  )) })
30182
30215
  ] }, i);
30183
30216
  }
30184
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30217
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
30185
30218
  DropdownMenuItem,
30186
30219
  {
30187
30220
  asChild: true,
30188
30221
  className: "cursor-pointer rounded-sm px-3 py-2 text-[13px] text-gray-800 hover:bg-gray-100",
30189
- children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_link5.default, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
30222
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_link5.default, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
30190
30223
  },
30191
30224
  i
30192
30225
  );
@@ -30196,19 +30229,19 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30196
30229
  ] });
30197
30230
  const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
30198
30231
  const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
30199
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
30200
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: cn("min-h-10", className), style, children: [
30201
- forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
30202
- forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { children: renderMobileMenu() }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex md:hidden", children: renderMobileMenu() })
30232
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
30233
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: cn("min-h-10", className), style, children: [
30234
+ forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
30235
+ forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { children: renderMobileMenu() }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex md:hidden", children: renderMobileMenu() })
30203
30236
  ] }),
30204
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
30205
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DialogHeader, { children: [
30206
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DialogTitle, { children: "Exit Builder?" }),
30207
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
30237
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
30238
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DialogHeader, { children: [
30239
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DialogTitle, { children: "Exit Builder?" }),
30240
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
30208
30241
  ] }),
30209
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(DialogFooter, { children: [
30210
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
30211
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
30242
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(DialogFooter, { children: [
30243
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
30244
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
30212
30245
  ] })
30213
30246
  ] }) })
30214
30247
  ] });
@@ -30216,10 +30249,10 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuil
30216
30249
  var Tabs_default = Tabs;
30217
30250
 
30218
30251
  // src/components/Navigation/Stages/Stages.tsx
30219
- var import_react31 = __toESM(require("react"));
30220
- var import_jsx_runtime58 = require("react/jsx-runtime");
30252
+ var import_react32 = __toESM(require("react"));
30253
+ var import_jsx_runtime57 = require("react/jsx-runtime");
30221
30254
  var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange, currentStage, dataKey = "key", dataLabel = "header", loading }) => {
30222
- const [activeStage, setActiveStage] = (0, import_react31.useState)(currentStage || (stages && stages.length > 0 ? stages[0].key : null));
30255
+ const [activeStage, setActiveStage] = (0, import_react32.useState)(currentStage || (stages && stages.length > 0 ? stages[0].key : null));
30223
30256
  const nextStage = () => {
30224
30257
  if (!stages || stages.length === 0) return;
30225
30258
  const currentIndex = stages.findIndex((stage) => stage[dataKey] === activeStage);
@@ -30236,9 +30269,9 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
30236
30269
  onStageChange?.(stageKey);
30237
30270
  };
30238
30271
  const isAllStagesCompleted = activeStage === lastStage;
30239
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
30240
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
30241
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
30272
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
30273
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
30274
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: loading ? Array(6).fill(null).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30242
30275
  "button",
30243
30276
  {
30244
30277
  className: `
@@ -30251,8 +30284,8 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
30251
30284
  const currentIndex = stages.findIndex((s) => s[dataKey] === activeStage);
30252
30285
  const isCompleted = isAllStagesCompleted || index < currentIndex;
30253
30286
  const isActive = !isAllStagesCompleted && index === currentIndex;
30254
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_react31.default.Fragment, { children: [
30255
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
30287
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_react32.default.Fragment, { children: [
30288
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30256
30289
  "button",
30257
30290
  {
30258
30291
  className: `
@@ -30265,10 +30298,10 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
30265
30298
  children: stage[dataLabel]
30266
30299
  }
30267
30300
  ),
30268
- index < stages.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
30301
+ index < stages.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
30269
30302
  ] }, stage.id);
30270
30303
  }) }),
30271
- isShowBtn && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
30304
+ isShowBtn && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
30272
30305
  "button",
30273
30306
  {
30274
30307
  className: "bg-green-700 text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm",
@@ -30283,26 +30316,26 @@ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStag
30283
30316
  var Stages_default = StagesComponent;
30284
30317
 
30285
30318
  // src/components/Navigation/Spacer/Spacer.tsx
30286
- var import_jsx_runtime59 = require("react/jsx-runtime");
30319
+ var import_jsx_runtime58 = require("react/jsx-runtime");
30287
30320
  var Spacer = ({ className, style }) => {
30288
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: `${className}`, style });
30321
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: `${className}`, style });
30289
30322
  };
30290
30323
  var Spacer_default = Spacer;
30291
30324
 
30292
30325
  // src/components/Navigation/Profile/Profile.tsx
30293
- var import_jsx_runtime60 = require("react/jsx-runtime");
30326
+ var import_jsx_runtime59 = require("react/jsx-runtime");
30294
30327
 
30295
30328
  // src/components/Navigation/Notification/Notification.tsx
30296
- var import_jsx_runtime61 = require("react/jsx-runtime");
30329
+ var import_jsx_runtime60 = require("react/jsx-runtime");
30297
30330
 
30298
30331
  // src/components/Navigation/Logo/Logo.tsx
30299
- var import_jsx_runtime62 = require("react/jsx-runtime");
30332
+ var import_jsx_runtime61 = require("react/jsx-runtime");
30300
30333
 
30301
30334
  // src/components/ui/avatar.tsx
30302
- var React12 = __toESM(require("react"));
30335
+ var React11 = __toESM(require("react"));
30303
30336
  var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
30304
- var import_jsx_runtime63 = require("react/jsx-runtime");
30305
- var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30337
+ var import_jsx_runtime62 = require("react/jsx-runtime");
30338
+ var Avatar = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
30306
30339
  AvatarPrimitive.Root,
30307
30340
  {
30308
30341
  ref,
@@ -30314,7 +30347,7 @@ var Avatar = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
30314
30347
  }
30315
30348
  ));
30316
30349
  Avatar.displayName = AvatarPrimitive.Root.displayName;
30317
- var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30350
+ var AvatarImage = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
30318
30351
  AvatarPrimitive.Image,
30319
30352
  {
30320
30353
  ref,
@@ -30323,7 +30356,7 @@ var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PUR
30323
30356
  }
30324
30357
  ));
30325
30358
  AvatarImage.displayName = AvatarPrimitive.Image.displayName;
30326
- var AvatarFallback = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30359
+ var AvatarFallback = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
30327
30360
  AvatarPrimitive.Fallback,
30328
30361
  {
30329
30362
  ref,
@@ -30341,8 +30374,8 @@ var import_link6 = __toESM(require("next/link"));
30341
30374
  var import_image4 = __toESM(require("next/image"));
30342
30375
  var import_navigation4 = require("next/navigation");
30343
30376
  var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
30344
- var import_react32 = require("react");
30345
- var import_jsx_runtime64 = require("react/jsx-runtime");
30377
+ var import_react33 = require("react");
30378
+ var import_jsx_runtime63 = require("react/jsx-runtime");
30346
30379
  function Navbar({
30347
30380
  style,
30348
30381
  badgeType,
@@ -30362,9 +30395,9 @@ function Navbar({
30362
30395
  }) {
30363
30396
  const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
30364
30397
  const router = (0, import_navigation4.useRouter)();
30365
- const [showExitDialog, setShowExitDialog] = (0, import_react32.useState)(false);
30366
- const [pendingUrl, setPendingUrl] = (0, import_react32.useState)(null);
30367
- const handleBuilderExit = (0, import_react32.useCallback)(
30398
+ const [showExitDialog, setShowExitDialog] = (0, import_react33.useState)(false);
30399
+ const [pendingUrl, setPendingUrl] = (0, import_react33.useState)(null);
30400
+ const handleBuilderExit = (0, import_react33.useCallback)(
30368
30401
  (e, url) => {
30369
30402
  if (isBuilder) {
30370
30403
  e.preventDefault();
@@ -30380,29 +30413,29 @@ function Navbar({
30380
30413
  router.push(pendingUrl);
30381
30414
  }
30382
30415
  };
30383
- const formatedMenu = (0, import_react32.useMemo)(() => {
30416
+ const formatedMenu = (0, import_react33.useMemo)(() => {
30384
30417
  if (source === "state" && navList && navList.length) {
30385
30418
  return navList.map((i) => ({ ...i, header: i.name || "Menu" }));
30386
30419
  }
30387
30420
  return list || [];
30388
30421
  }, [source, navList]);
30389
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
30390
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
30422
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
30423
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30391
30424
  "nav",
30392
30425
  {
30393
30426
  className: "w-full border-b border-b-white dark:border-b-gray-800 dark:bg-gray-800 bg-white shadow-sm",
30394
30427
  style,
30395
- children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
30396
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
30428
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
30429
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30397
30430
  import_link6.default,
30398
30431
  {
30399
30432
  href: "/",
30400
30433
  onClick: (e) => handleBuilderExit(e, "/"),
30401
30434
  className: "flex items-center space-x-2",
30402
- children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_image4.default, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "font-semibold text-blue-700", children: "Logo" })
30435
+ children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_image4.default, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "font-semibold text-blue-700", children: "Logo" })
30403
30436
  }
30404
30437
  ),
30405
- !isMobileView && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
30438
+ !isMobileView && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30406
30439
  import_link6.default,
30407
30440
  {
30408
30441
  href: item.url || "#",
@@ -30412,39 +30445,39 @@ function Navbar({
30412
30445
  },
30413
30446
  item.id
30414
30447
  )) }),
30415
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex items-center space-x-3", children: [
30416
- !isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "flex-1 px-6", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
30417
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
30418
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
30419
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Search, { className: "h-5 w-5 text-gray-400" }) }),
30420
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
30421
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
30422
- badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] text-white leading-8", children: badgeCount }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
30448
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center space-x-3", children: [
30449
+ !isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex-1 px-6", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
30450
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
30451
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
30452
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Search, { className: "h-5 w-5 text-gray-400" }) }),
30453
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
30454
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
30455
+ badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] text-white leading-8", children: badgeCount }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
30423
30456
  ] }),
30424
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(DropdownMenu, { children: [
30425
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex items-center space-x-2", children: [
30426
- !isMobileView && showName && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
30427
- !isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
30428
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
30457
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DropdownMenu, { children: [
30458
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center space-x-2", children: [
30459
+ !isMobileView && showName && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
30460
+ !isMobileView ? /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
30461
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30429
30462
  AvatarImage,
30430
30463
  {
30431
30464
  src: "/images/appbuilder/toolset/profile.svg",
30432
30465
  alt: "Profile"
30433
30466
  }
30434
- ) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "w-8 h-8 bg-[#12715b] rounded-full text-[#fff] text-center text-[11px] flex items-center justify-center", children: userName && getInitials(userName) }) }),
30435
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
30467
+ ) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "w-8 h-8 bg-[#12715b] rounded-full text-[#fff] text-center text-[11px] flex items-center justify-center", children: userName && getInitials(userName) }) }),
30468
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30436
30469
  Button,
30437
30470
  {
30438
30471
  variant: "ghost",
30439
30472
  size: "icon",
30440
30473
  className: "text-gray-900 md:hidden dark:invert",
30441
- children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Menu, { className: "h-6 w-6" })
30474
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Menu, { className: "h-6 w-6" })
30442
30475
  }
30443
30476
  )
30444
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Menu, { className: "h-6 w-6" }) })
30477
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Menu, { className: "h-6 w-6" }) })
30445
30478
  ] }) }),
30446
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
30447
- profileMenu && profileMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_jsx_runtime64.Fragment, { children: profileMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
30479
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
30480
+ profileMenu && profileMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_jsx_runtime63.Fragment, { children: profileMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30448
30481
  import_link6.default,
30449
30482
  {
30450
30483
  href: item.url || "#",
@@ -30452,9 +30485,9 @@ function Navbar({
30452
30485
  children: item.header
30453
30486
  }
30454
30487
  ) }, item.id)) }),
30455
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "md:hidden", children: [
30456
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react_dropdown_menu.DropdownMenuSeparator, {}),
30457
- formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_jsx_runtime64.Fragment, { children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
30488
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "md:hidden", children: [
30489
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react_dropdown_menu.DropdownMenuSeparator, {}),
30490
+ formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_jsx_runtime63.Fragment, { children: formatedMenu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
30458
30491
  import_link6.default,
30459
30492
  {
30460
30493
  href: item.url || "#",
@@ -30469,51 +30502,51 @@ function Navbar({
30469
30502
  ] })
30470
30503
  }
30471
30504
  ),
30472
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
30473
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(DialogHeader, { children: [
30474
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DialogTitle, { children: "Exit Builder?" }),
30475
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
30505
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DialogContent, { className: "bg-[#fff]", children: [
30506
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DialogHeader, { children: [
30507
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DialogTitle, { children: "Exit Builder?" }),
30508
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
30476
30509
  ] }),
30477
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(DialogFooter, { children: [
30478
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
30479
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
30510
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(DialogFooter, { children: [
30511
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
30512
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
30480
30513
  ] })
30481
30514
  ] }) })
30482
30515
  ] });
30483
30516
  }
30484
30517
 
30485
30518
  // src/components/Chart/BarChart.tsx
30486
- var import_react33 = __toESM(require("react"));
30519
+ var import_react34 = __toESM(require("react"));
30487
30520
  var import_recharts = require("recharts");
30488
- var import_jsx_runtime65 = require("react/jsx-runtime");
30521
+ var import_jsx_runtime64 = require("react/jsx-runtime");
30489
30522
  var ChartComponent = ({ className, style, loading, ...props }) => {
30490
30523
  const data = Array.isArray(props.data) ? props.data : [];
30491
30524
  const chartType = props.chartType || "bar";
30492
30525
  const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
30493
30526
  if (loading || data.length === 0) {
30494
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
30527
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
30495
30528
  "div",
30496
30529
  {
30497
30530
  className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
30498
30531
  style,
30499
- children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
30532
+ children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
30500
30533
  }
30501
30534
  );
30502
30535
  }
30503
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: `${className} h-[400px]`, style, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_recharts.BarChart, { data, title: "Leads", desc: "content", children: [
30504
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
30505
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.XAxis, { dataKey: "name" }),
30506
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.YAxis, {}),
30507
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
30508
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.Legend, { verticalAlign: legendsPosition, align: "center" }),
30509
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
30536
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: `${className} h-[400px]`, style, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_recharts.BarChart, { data, title: "Leads", desc: "content", children: [
30537
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
30538
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.XAxis, { dataKey: "name" }),
30539
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.YAxis, {}),
30540
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
30541
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.Legend, { verticalAlign: legendsPosition, align: "center" }),
30542
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
30510
30543
  import_recharts.Bar,
30511
30544
  {
30512
30545
  dataKey: "value",
30513
30546
  fill: "#00695C",
30514
30547
  radius: [6, 6, 0, 0],
30515
30548
  isAnimationActive: false,
30516
- children: data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
30549
+ children: data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
30517
30550
  "rect",
30518
30551
  {
30519
30552
  fill: entry.color || "#00695C"
@@ -30522,16 +30555,16 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
30522
30555
  ))
30523
30556
  }
30524
30557
  )
30525
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_recharts.AreaChart, { data, children: [
30526
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
30527
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
30528
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
30558
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_recharts.AreaChart, { data, children: [
30559
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
30560
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
30561
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
30529
30562
  ] }) }),
30530
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
30531
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.XAxis, { dataKey: "name" }),
30532
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.YAxis, {}),
30533
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
30534
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
30563
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.CartesianGrid, { strokeDasharray: "3 3" }),
30564
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.XAxis, { dataKey: "name" }),
30565
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.YAxis, {}),
30566
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_recharts.Tooltip, { formatter: (value) => `${value}k` }),
30567
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
30535
30568
  import_recharts.Area,
30536
30569
  {
30537
30570
  type: "monotone",
@@ -30544,12 +30577,12 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
30544
30577
  )
30545
30578
  ] }) }) });
30546
30579
  };
30547
- var BarChart_default = import_react33.default.memo(ChartComponent);
30580
+ var BarChart_default = import_react34.default.memo(ChartComponent);
30548
30581
 
30549
30582
  // src/components/Chart/PieChart.tsx
30550
- var import_react34 = __toESM(require("react"));
30583
+ var import_react35 = __toESM(require("react"));
30551
30584
  var import_recharts2 = require("recharts");
30552
- var import_jsx_runtime66 = require("react/jsx-runtime");
30585
+ var import_jsx_runtime65 = require("react/jsx-runtime");
30553
30586
  var getRandomColor = () => {
30554
30587
  const palette = [
30555
30588
  "#2563eb",
@@ -30569,32 +30602,32 @@ var DonutChart = ({ className, style, loading, ...props }) => {
30569
30602
  const showLegends = props.showLegends ?? true;
30570
30603
  const labelType = props.labelType || "inside";
30571
30604
  const canvasMode = props.canvasMode;
30572
- const data = (0, import_react34.useMemo)(() => {
30605
+ const data = (0, import_react35.useMemo)(() => {
30573
30606
  if (!Array.isArray(props.data)) return [];
30574
30607
  return props.data.map((item) => ({ ...item, color: getRandomColor() }));
30575
30608
  }, [props.data]);
30576
- const total = (0, import_react34.useMemo)(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
30609
+ const total = (0, import_react35.useMemo)(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
30577
30610
  const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
30578
- const [mounted, setMounted] = (0, import_react34.useState)(false);
30579
- (0, import_react34.useEffect)(() => {
30611
+ const [mounted, setMounted] = (0, import_react35.useState)(false);
30612
+ (0, import_react35.useEffect)(() => {
30580
30613
  const timeout = setTimeout(() => setMounted(true), 100);
30581
30614
  return () => clearTimeout(timeout);
30582
30615
  }, []);
30583
- const renderLegends = (0, import_react34.useMemo)(() => {
30616
+ const renderLegends = (0, import_react35.useMemo)(() => {
30584
30617
  if (!showLegends) return null;
30585
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_jsx_runtime66.Fragment, { children: data.map((d) => /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
30618
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_jsx_runtime65.Fragment, { children: data.map((d) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
30586
30619
  "div",
30587
30620
  {
30588
30621
  className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
30589
30622
  children: [
30590
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
30623
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
30591
30624
  "span",
30592
30625
  {
30593
30626
  className: "inline-block w-[16px] h-[16px] rounded",
30594
30627
  style: { backgroundColor: d.color }
30595
30628
  }
30596
30629
  ),
30597
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
30630
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
30598
30631
  ]
30599
30632
  },
30600
30633
  d.name
@@ -30602,24 +30635,24 @@ var DonutChart = ({ className, style, loading, ...props }) => {
30602
30635
  }, [data, showLegends]);
30603
30636
  if (!mounted) return null;
30604
30637
  if (loading || data.length === 0) {
30605
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
30638
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
30606
30639
  "div",
30607
30640
  {
30608
30641
  className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
30609
30642
  style,
30610
- children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
30643
+ children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
30611
30644
  }
30612
30645
  );
30613
30646
  }
30614
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
30647
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
30615
30648
  "div",
30616
30649
  {
30617
30650
  className: `relative flex flex-col items-center ${className}`,
30618
30651
  style,
30619
30652
  children: [
30620
- /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
30621
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_recharts2.ResponsiveContainer, { width: "99%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_recharts2.PieChart, { children: [
30622
- /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
30653
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
30654
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts2.ResponsiveContainer, { width: "99%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_recharts2.PieChart, { children: [
30655
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
30623
30656
  import_recharts2.Pie,
30624
30657
  {
30625
30658
  data,
@@ -30631,8 +30664,8 @@ var DonutChart = ({ className, style, loading, ...props }) => {
30631
30664
  labelLine: false,
30632
30665
  isAnimationActive: false,
30633
30666
  children: [
30634
- data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_recharts2.Cell, { fill: entry.color }, `cell-${index}`)),
30635
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
30667
+ data.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_recharts2.Cell, { fill: entry.color }, `cell-${index}`)),
30668
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
30636
30669
  import_recharts2.LabelList,
30637
30670
  {
30638
30671
  dataKey: "value",
@@ -30645,14 +30678,14 @@ var DonutChart = ({ className, style, loading, ...props }) => {
30645
30678
  ]
30646
30679
  }
30647
30680
  ),
30648
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
30681
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
30649
30682
  import_recharts2.Tooltip,
30650
30683
  {
30651
30684
  formatter: (value, name) => [`${value}k`, name]
30652
30685
  }
30653
30686
  )
30654
30687
  ] }) }),
30655
- /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
30688
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
30656
30689
  "div",
30657
30690
  {
30658
30691
  className: `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 ${forceMobile ? "text-2xl" : "text-4xl"} font-bold text-[#000]`,
@@ -30663,18 +30696,18 @@ var DonutChart = ({ className, style, loading, ...props }) => {
30663
30696
  }
30664
30697
  )
30665
30698
  ] }),
30666
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
30699
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
30667
30700
  ]
30668
30701
  }
30669
30702
  );
30670
30703
  };
30671
- var PieChart_default = import_react34.default.memo(DonutChart);
30704
+ var PieChart_default = import_react35.default.memo(DonutChart);
30672
30705
 
30673
30706
  // src/components/Blocks/EmailComposer.tsx
30674
- var import_jsx_runtime67 = require("react/jsx-runtime");
30707
+ var import_jsx_runtime66 = require("react/jsx-runtime");
30675
30708
  function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
30676
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
30677
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
30709
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
30710
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
30678
30711
  "input",
30679
30712
  {
30680
30713
  type: "email",
@@ -30683,8 +30716,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30683
30716
  required: true
30684
30717
  }
30685
30718
  ) }),
30686
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex items-center gap-2", children: [
30687
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
30719
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center gap-2", children: [
30720
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
30688
30721
  "input",
30689
30722
  {
30690
30723
  type: "email",
@@ -30695,7 +30728,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30695
30728
  required: true
30696
30729
  }
30697
30730
  ),
30698
- !showCc && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
30731
+ !showCc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
30699
30732
  "button",
30700
30733
  {
30701
30734
  onClick: () => setShowCc?.(true),
@@ -30703,7 +30736,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30703
30736
  children: "Cc"
30704
30737
  }
30705
30738
  ),
30706
- !showBcc && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
30739
+ !showBcc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
30707
30740
  "button",
30708
30741
  {
30709
30742
  onClick: () => setShowBcc?.(true),
@@ -30712,7 +30745,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30712
30745
  }
30713
30746
  )
30714
30747
  ] }) }),
30715
- showCc && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
30748
+ showCc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
30716
30749
  "input",
30717
30750
  {
30718
30751
  type: "text",
@@ -30722,7 +30755,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30722
30755
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
30723
30756
  }
30724
30757
  ) }),
30725
- showBcc && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
30758
+ showBcc && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
30726
30759
  "input",
30727
30760
  {
30728
30761
  type: "text",
@@ -30732,7 +30765,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30732
30765
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
30733
30766
  }
30734
30767
  ) }),
30735
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
30768
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
30736
30769
  "input",
30737
30770
  {
30738
30771
  type: "text",
@@ -30742,11 +30775,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
30742
30775
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
30743
30776
  }
30744
30777
  ) }),
30745
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(MyEditor, { value: body, onChange: setBody }) }),
30746
- /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex justify-end gap-2", children: [
30747
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
30748
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
30749
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
30778
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(MyEditor, { value: body, onChange: setBody }) }),
30779
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex justify-end gap-2", children: [
30780
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
30781
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
30782
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
30750
30783
  ] })
30751
30784
  ] }) });
30752
30785
  }
@@ -30791,10 +30824,10 @@ function showSonnerToast({
30791
30824
  // src/components/ui/sonner.tsx
30792
30825
  var import_next_themes = require("next-themes");
30793
30826
  var import_sonner2 = require("sonner");
30794
- var import_jsx_runtime68 = require("react/jsx-runtime");
30827
+ var import_jsx_runtime67 = require("react/jsx-runtime");
30795
30828
  var Toaster = ({ ...props }) => {
30796
30829
  const { theme = "system" } = (0, import_next_themes.useTheme)();
30797
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
30830
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
30798
30831
  import_sonner2.Toaster,
30799
30832
  {
30800
30833
  theme,