@algorithm-shift/design-system 1.2.71 → 1.2.72

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.mjs CHANGED
@@ -28897,8 +28897,126 @@ var Pagination_default = CustomPagination;
28897
28897
 
28898
28898
  // src/components/Navigation/Tabs/Tabs.tsx
28899
28899
  import Link5 from "next/link";
28900
+ import { useRouter } from "next/navigation";
28901
+
28902
+ // src/components/ui/dialog.tsx
28903
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
28900
28904
  import { jsx as jsx51, jsxs as jsxs29 } from "react/jsx-runtime";
28901
- var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
28905
+ function Dialog({
28906
+ ...props
28907
+ }) {
28908
+ return /* @__PURE__ */ jsx51(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
28909
+ }
28910
+ function DialogPortal({
28911
+ ...props
28912
+ }) {
28913
+ return /* @__PURE__ */ jsx51(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
28914
+ }
28915
+ function DialogOverlay({
28916
+ className,
28917
+ ...props
28918
+ }) {
28919
+ return /* @__PURE__ */ jsx51(
28920
+ DialogPrimitive.Overlay,
28921
+ {
28922
+ "data-slot": "dialog-overlay",
28923
+ className: cn(
28924
+ "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",
28925
+ className
28926
+ ),
28927
+ ...props
28928
+ }
28929
+ );
28930
+ }
28931
+ function DialogContent({
28932
+ className,
28933
+ children,
28934
+ showCloseButton = true,
28935
+ ...props
28936
+ }) {
28937
+ return /* @__PURE__ */ jsxs29(DialogPortal, { "data-slot": "dialog-portal", children: [
28938
+ /* @__PURE__ */ jsx51(DialogOverlay, {}),
28939
+ /* @__PURE__ */ jsxs29(
28940
+ DialogPrimitive.Content,
28941
+ {
28942
+ "data-slot": "dialog-content",
28943
+ className: cn(
28944
+ "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",
28945
+ className
28946
+ ),
28947
+ ...props,
28948
+ children: [
28949
+ children,
28950
+ showCloseButton && /* @__PURE__ */ jsxs29(
28951
+ DialogPrimitive.Close,
28952
+ {
28953
+ "data-slot": "dialog-close",
28954
+ 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",
28955
+ children: [
28956
+ /* @__PURE__ */ jsx51(X, {}),
28957
+ /* @__PURE__ */ jsx51("span", { className: "sr-only", children: "Close" })
28958
+ ]
28959
+ }
28960
+ )
28961
+ ]
28962
+ }
28963
+ )
28964
+ ] });
28965
+ }
28966
+ function DialogHeader({ className, ...props }) {
28967
+ return /* @__PURE__ */ jsx51(
28968
+ "div",
28969
+ {
28970
+ "data-slot": "dialog-header",
28971
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
28972
+ ...props
28973
+ }
28974
+ );
28975
+ }
28976
+ function DialogFooter({ className, ...props }) {
28977
+ return /* @__PURE__ */ jsx51(
28978
+ "div",
28979
+ {
28980
+ "data-slot": "dialog-footer",
28981
+ className: cn(
28982
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
28983
+ className
28984
+ ),
28985
+ ...props
28986
+ }
28987
+ );
28988
+ }
28989
+ function DialogTitle({
28990
+ className,
28991
+ ...props
28992
+ }) {
28993
+ return /* @__PURE__ */ jsx51(
28994
+ DialogPrimitive.Title,
28995
+ {
28996
+ "data-slot": "dialog-title",
28997
+ className: cn("text-lg leading-none font-semibold", className),
28998
+ ...props
28999
+ }
29000
+ );
29001
+ }
29002
+ function DialogDescription({
29003
+ className,
29004
+ ...props
29005
+ }) {
29006
+ return /* @__PURE__ */ jsx51(
29007
+ DialogPrimitive.Description,
29008
+ {
29009
+ "data-slot": "dialog-description",
29010
+ className: cn("text-muted-foreground text-sm", className),
29011
+ ...props
29012
+ }
29013
+ );
29014
+ }
29015
+
29016
+ // src/components/Navigation/Tabs/Tabs.tsx
29017
+ import { useCallback as useCallback2, useState as useState5 } from "react";
29018
+ import { Fragment as Fragment18, jsx as jsx52, jsxs as jsxs30 } from "react/jsx-runtime";
29019
+ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode, isBuilder = true }) => {
28902
29020
  const rawTabs = Array.isArray(tabs) ? tabs : [];
28903
29021
  const baseClasses = "text-[12px] text-foreground p-2 text-center rounded-md transition-colors";
28904
29022
  const activeClasses = "bg-white/10 text-white";
@@ -28907,26 +29025,45 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
28907
29025
  if (!path) return false;
28908
29026
  return pathname === path || path !== "/" && pathname?.startsWith(path);
28909
29027
  };
29028
+ const router = useRouter();
29029
+ const [showExitDialog, setShowExitDialog] = useState5(false);
29030
+ const [pendingUrl, setPendingUrl] = useState5(null);
29031
+ const handleBuilderExit = useCallback2(
29032
+ (e, url) => {
29033
+ if (isBuilder) {
29034
+ e.preventDefault();
29035
+ setPendingUrl(url);
29036
+ setShowExitDialog(true);
29037
+ }
29038
+ },
29039
+ [isBuilder]
29040
+ );
29041
+ const confirmExit = () => {
29042
+ if (pendingUrl) {
29043
+ setShowExitDialog(false);
29044
+ router.push(pendingUrl);
29045
+ }
29046
+ };
28910
29047
  const renderDesktopTab = (tab, index) => {
28911
29048
  const finalClasses = [baseClasses, isActive(tab.url) ? activeClasses : hoverClasses, tab.className || ""].join(" ");
28912
29049
  if (Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown) {
28913
- return /* @__PURE__ */ jsxs29(DropdownMenu, { children: [
28914
- /* @__PURE__ */ jsxs29(DropdownMenuTrigger, { className: `${finalClasses} inline-flex items-center gap-1`, children: [
29050
+ return /* @__PURE__ */ jsxs30(DropdownMenu, { children: [
29051
+ /* @__PURE__ */ jsxs30(DropdownMenuTrigger, { className: `${finalClasses} inline-flex items-center gap-1`, children: [
28915
29052
  tab.header,
28916
- /* @__PURE__ */ jsx51(ChevronDown, { className: "h-4 w-4 opacity-80" })
29053
+ /* @__PURE__ */ jsx52(ChevronDown, { className: "h-4 w-4 opacity-80" })
28917
29054
  ] }),
28918
- /* @__PURE__ */ jsx51(
29055
+ /* @__PURE__ */ jsx52(
28919
29056
  DropdownMenuContent,
28920
29057
  {
28921
29058
  align: "start",
28922
29059
  sideOffset: 6,
28923
29060
  className: "z-50 min-w-[160px] rounded-md border border-gray-200 bg-white p-1 shadow-lg",
28924
- children: tab.children.map((item) => /* @__PURE__ */ jsx51(
29061
+ children: tab.children.map((item) => /* @__PURE__ */ jsx52(
28925
29062
  DropdownMenuItem,
28926
29063
  {
28927
29064
  asChild: true,
28928
29065
  className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100 focus:bg-gray-100",
28929
- children: /* @__PURE__ */ jsx51(Link5, { href: item.url || "#", children: item.header })
29066
+ children: /* @__PURE__ */ jsx52(Link5, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
28930
29067
  },
28931
29068
  item.id
28932
29069
  ))
@@ -28934,14 +29071,24 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
28934
29071
  )
28935
29072
  ] }, index);
28936
29073
  }
28937
- return tab.url ? /* @__PURE__ */ jsx51(Link5, { href: tab.url, className: finalClasses, style: tab.style, children: tab.header }, index) : /* @__PURE__ */ jsx51("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
29074
+ return tab.url ? /* @__PURE__ */ jsx52(
29075
+ Link5,
29076
+ {
29077
+ href: tab.url,
29078
+ className: finalClasses,
29079
+ style: tab.style,
29080
+ onClick: (e) => handleBuilderExit(e, tab.url || "#"),
29081
+ children: tab.header
29082
+ },
29083
+ index
29084
+ ) : /* @__PURE__ */ jsx52("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
28938
29085
  };
28939
- const renderMobileMenu = () => /* @__PURE__ */ jsxs29(DropdownMenu, { children: [
28940
- /* @__PURE__ */ jsxs29(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
28941
- /* @__PURE__ */ jsx51(Menu, { className: "h-4 w-4" }),
29086
+ const renderMobileMenu = () => /* @__PURE__ */ jsxs30(DropdownMenu, { children: [
29087
+ /* @__PURE__ */ jsxs30(DropdownMenuTrigger, { className: "flex items-center gap-2 px-3 py-2 rounded-md bg-white/10 text-white text-sm", children: [
29088
+ /* @__PURE__ */ jsx52(Menu, { className: "h-4 w-4" }),
28942
29089
  "Menu"
28943
29090
  ] }),
28944
- /* @__PURE__ */ jsx51(
29091
+ /* @__PURE__ */ jsx52(
28945
29092
  DropdownMenuContent,
28946
29093
  {
28947
29094
  align: "start",
@@ -28950,25 +29097,25 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
28950
29097
  children: rawTabs.map((tab, i) => {
28951
29098
  const hasChildren = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
28952
29099
  if (hasChildren) {
28953
- return /* @__PURE__ */ jsxs29(DropdownMenuSub, { children: [
28954
- /* @__PURE__ */ jsx51(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 }),
28955
- /* @__PURE__ */ jsx51(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item) => /* @__PURE__ */ jsx51(
29100
+ return /* @__PURE__ */ jsxs30(DropdownMenuSub, { children: [
29101
+ /* @__PURE__ */ jsx52(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 }),
29102
+ /* @__PURE__ */ jsx52(DropdownMenuSubContent, { className: "bg-white border shadow-lg rounded-md p-1", children: tab.children.map((item) => /* @__PURE__ */ jsx52(
28956
29103
  DropdownMenuItem,
28957
29104
  {
28958
29105
  asChild: true,
28959
29106
  className: "cursor-pointer rounded-sm px-3 py-2 text-[12px] text-gray-800 hover:bg-gray-100",
28960
- children: /* @__PURE__ */ jsx51(Link5, { href: item.url || "#", children: item.header })
29107
+ children: /* @__PURE__ */ jsx52(Link5, { href: item.url || "#", onClick: (e) => handleBuilderExit(e, item.url || "#"), children: item.header })
28961
29108
  },
28962
29109
  item.id
28963
29110
  )) })
28964
29111
  ] }, i);
28965
29112
  }
28966
- return /* @__PURE__ */ jsx51(
29113
+ return /* @__PURE__ */ jsx52(
28967
29114
  DropdownMenuItem,
28968
29115
  {
28969
29116
  asChild: true,
28970
29117
  className: "cursor-pointer rounded-sm px-3 py-2 text-[13px] text-gray-800 hover:bg-gray-100",
28971
- children: /* @__PURE__ */ jsx51(Link5, { href: tab.url || "#", children: tab.header })
29118
+ children: /* @__PURE__ */ jsx52(Link5, { href: tab.url || "#", onClick: (e) => handleBuilderExit(e, tab.url || "#"), children: tab.header })
28972
29119
  },
28973
29120
  i
28974
29121
  );
@@ -28978,55 +29125,84 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
28978
29125
  ] });
28979
29126
  const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
28980
29127
  const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
28981
- return /* @__PURE__ */ jsxs29("div", { className, style, children: [
28982
- forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ jsx51("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx51("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ jsx51("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx51("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
28983
- forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ jsx51("div", { children: renderMobileMenu() }) : /* @__PURE__ */ jsx51("div", { className: "flex md:hidden", children: renderMobileMenu() })
29128
+ return /* @__PURE__ */ jsxs30(Fragment18, { children: [
29129
+ /* @__PURE__ */ jsxs30("div", { className, style, children: [
29130
+ forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ jsx52("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx52("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ jsx52("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx52("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
29131
+ forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ jsx52("div", { children: renderMobileMenu() }) : /* @__PURE__ */ jsx52("div", { className: "flex md:hidden", children: renderMobileMenu() })
29132
+ ] }),
29133
+ /* @__PURE__ */ jsx52(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs30(DialogContent, { className: "bg-[#fff]", children: [
29134
+ /* @__PURE__ */ jsxs30(DialogHeader, { children: [
29135
+ /* @__PURE__ */ jsx52(DialogTitle, { children: "Exit Builder?" }),
29136
+ /* @__PURE__ */ jsx52(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
29137
+ ] }),
29138
+ /* @__PURE__ */ jsxs30(DialogFooter, { children: [
29139
+ /* @__PURE__ */ jsx52(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
29140
+ /* @__PURE__ */ jsx52(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
29141
+ ] })
29142
+ ] }) })
28984
29143
  ] });
28985
29144
  };
28986
29145
  var Tabs_default = Tabs;
28987
29146
 
28988
29147
  // src/components/Navigation/Stages/Stages.tsx
28989
29148
  import React8 from "react";
28990
- import { jsx as jsx52, jsxs as jsxs30 } from "react/jsx-runtime";
28991
- var StagesComponent = ({ stages, isShowBtn, buttonText, className, style }) => {
28992
- return /* @__PURE__ */ jsx52("div", { className, style, children: /* @__PURE__ */ jsxs30("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
28993
- /* @__PURE__ */ jsx52("div", { className: "flex items-center", children: /* @__PURE__ */ jsx52("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsx52("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx52("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
28994
- /* @__PURE__ */ jsx52("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ jsxs30(React8.Fragment, { children: [
28995
- /* @__PURE__ */ jsx52(
29149
+ import { jsx as jsx53, jsxs as jsxs31 } from "react/jsx-runtime";
29150
+ var StagesComponent = ({ stages, isShowBtn, buttonText, className, style, onStageChange }) => {
29151
+ return /* @__PURE__ */ jsx53("div", { className, style, children: /* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
29152
+ /* @__PURE__ */ jsx53("div", { className: "flex items-center", children: /* @__PURE__ */ jsx53("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsx53("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx53("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
29153
+ /* @__PURE__ */ jsx53("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ jsxs31(React8.Fragment, { children: [
29154
+ /* @__PURE__ */ jsx53(
28996
29155
  "button",
28997
29156
  {
28998
29157
  className: `min-w-[120px] px-4 py-2 rounded-full text-sm font-medium transition-colors duration-200 whitespace-nowrap ${stage.isActive ? "bg-[#034486] text-white shadow-md" : "bg-white text-gray-700 hover:bg-gray-100 border border-gray-200"}`,
29158
+ onClick: () => {
29159
+ if (onStageChange) {
29160
+ onStageChange(stage.id);
29161
+ }
29162
+ },
28999
29163
  children: stage.header
29000
29164
  }
29001
29165
  ),
29002
- index < stages.length - 1 && /* @__PURE__ */ jsx52("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
29166
+ index < stages.length - 1 && /* @__PURE__ */ jsx53("div", { className: "flex-shrink-0 w-3 h-px bg-gray-300" })
29003
29167
  ] }, stage.id)) }),
29004
- isShowBtn && /* @__PURE__ */ jsx52("div", { className: "flex items-center", children: /* @__PURE__ */ jsx52("button", { className: "bg-[#034486] text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm", children: buttonText }) })
29168
+ isShowBtn && /* @__PURE__ */ jsx53("div", { className: "flex items-center", children: /* @__PURE__ */ jsx53(
29169
+ "button",
29170
+ {
29171
+ className: "bg-[#034486] text-white px-6 py-2 rounded-lg text-sm font-medium transition-colors duration-200 shadow-sm",
29172
+ onClick: () => {
29173
+ const activeStage = stages?.find((stage) => stage.isActive);
29174
+ if (activeStage && onStageChange) {
29175
+ onStageChange(activeStage.id);
29176
+ }
29177
+ },
29178
+ children: buttonText
29179
+ }
29180
+ ) })
29005
29181
  ] }) });
29006
29182
  };
29007
29183
  var Stages_default = StagesComponent;
29008
29184
 
29009
29185
  // src/components/Navigation/Spacer/Spacer.tsx
29010
- import { jsx as jsx53 } from "react/jsx-runtime";
29186
+ import { jsx as jsx54 } from "react/jsx-runtime";
29011
29187
  var Spacer = ({ className, style }) => {
29012
- return /* @__PURE__ */ jsx53("div", { className: `${className}`, style });
29188
+ return /* @__PURE__ */ jsx54("div", { className: `${className}`, style });
29013
29189
  };
29014
29190
  var Spacer_default = Spacer;
29015
29191
 
29016
29192
  // src/components/Navigation/Profile/Profile.tsx
29017
- import { jsx as jsx54, jsxs as jsxs31 } from "react/jsx-runtime";
29193
+ import { jsx as jsx55, jsxs as jsxs32 } from "react/jsx-runtime";
29018
29194
 
29019
29195
  // src/components/Navigation/Notification/Notification.tsx
29020
- import { jsx as jsx55, jsxs as jsxs32 } from "react/jsx-runtime";
29196
+ import { jsx as jsx56, jsxs as jsxs33 } from "react/jsx-runtime";
29021
29197
 
29022
29198
  // src/components/Navigation/Logo/Logo.tsx
29023
- import { jsx as jsx56 } from "react/jsx-runtime";
29199
+ import { jsx as jsx57 } from "react/jsx-runtime";
29024
29200
 
29025
29201
  // src/components/ui/avatar.tsx
29026
29202
  import * as React9 from "react";
29027
29203
  import * as AvatarPrimitive from "@radix-ui/react-avatar";
29028
- import { jsx as jsx57 } from "react/jsx-runtime";
29029
- var Avatar = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
29204
+ import { jsx as jsx58 } from "react/jsx-runtime";
29205
+ var Avatar = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx58(
29030
29206
  AvatarPrimitive.Root,
29031
29207
  {
29032
29208
  ref,
@@ -29038,7 +29214,7 @@ var Avatar = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
29038
29214
  }
29039
29215
  ));
29040
29216
  Avatar.displayName = AvatarPrimitive.Root.displayName;
29041
- var AvatarImage = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
29217
+ var AvatarImage = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx58(
29042
29218
  AvatarPrimitive.Image,
29043
29219
  {
29044
29220
  ref,
@@ -29047,7 +29223,7 @@ var AvatarImage = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
29047
29223
  }
29048
29224
  ));
29049
29225
  AvatarImage.displayName = AvatarPrimitive.Image.displayName;
29050
- var AvatarFallback = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
29226
+ var AvatarFallback = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx58(
29051
29227
  AvatarPrimitive.Fallback,
29052
29228
  {
29053
29229
  ref,
@@ -29063,8 +29239,10 @@ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
29063
29239
  // src/components/Navigation/Navbar/Navbar.tsx
29064
29240
  import Link6 from "next/link";
29065
29241
  import Image3 from "next/image";
29242
+ import { useRouter as useRouter2 } from "next/navigation";
29066
29243
  import { DropdownMenuSeparator } from "@radix-ui/react-dropdown-menu";
29067
- import { Fragment as Fragment18, jsx as jsx58, jsxs as jsxs33 } from "react/jsx-runtime";
29244
+ import { useCallback as useCallback3, useMemo as useMemo3, useState as useState6 } from "react";
29245
+ import { Fragment as Fragment19, jsx as jsx59, jsxs as jsxs34 } from "react/jsx-runtime";
29068
29246
  function Navbar({
29069
29247
  style,
29070
29248
  badgeType,
@@ -29077,77 +29255,131 @@ function Navbar({
29077
29255
  canvasMode = "desktop",
29078
29256
  list = [],
29079
29257
  profileMenu = [],
29080
- userName = "Guest User"
29258
+ userName = "Guest User",
29259
+ isBuilder = true,
29260
+ source,
29261
+ navList
29081
29262
  }) {
29082
29263
  const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
29083
- return /* @__PURE__ */ jsx58("nav", { className: "w-full border-b border-b-white dark:border-b-gray-800 dark:bg-gray-800 bg-white shadow-sm", style, children: /* @__PURE__ */ jsxs33("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
29084
- /* @__PURE__ */ jsx58(Link6, { href: "/", className: "flex items-center space-x-2", children: imageUrl ? /* @__PURE__ */ jsx58(Image3, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ jsx58("span", { className: "font-semibold text-blue-700", children: "Logo" }) }),
29085
- !isMobileView && /* @__PURE__ */ jsx58("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: list.map((item) => /* @__PURE__ */ jsx58(
29086
- Link6,
29264
+ const router = useRouter2();
29265
+ const [showExitDialog, setShowExitDialog] = useState6(false);
29266
+ const [pendingUrl, setPendingUrl] = useState6(null);
29267
+ const handleBuilderExit = useCallback3(
29268
+ (e, url) => {
29269
+ if (isBuilder) {
29270
+ e.preventDefault();
29271
+ setPendingUrl(url);
29272
+ setShowExitDialog(true);
29273
+ }
29274
+ },
29275
+ [isBuilder]
29276
+ );
29277
+ const confirmExit = () => {
29278
+ if (pendingUrl) {
29279
+ setShowExitDialog(false);
29280
+ router.push(pendingUrl);
29281
+ }
29282
+ };
29283
+ const formatedMenu = useMemo3(() => {
29284
+ if (source === "state" && navList && navList.length) {
29285
+ return navList.map((i) => ({ ...i, header: i.name || "Menu" }));
29286
+ }
29287
+ return list || [];
29288
+ }, [source, navList]);
29289
+ return /* @__PURE__ */ jsxs34(Fragment19, { children: [
29290
+ /* @__PURE__ */ jsx59(
29291
+ "nav",
29087
29292
  {
29088
- href: item.url || "#",
29089
- className: "text-sm font-medium dark:text-white text-gray-600 hover:text-gray-900 transition-colors",
29090
- children: item.header
29091
- },
29092
- item.id
29093
- )) }),
29094
- /* @__PURE__ */ jsxs33("div", { className: "flex items-center space-x-3", children: [
29095
- !isMobileView ? /* @__PURE__ */ jsx58("div", { className: "flex-1 px-6", children: /* @__PURE__ */ jsxs33("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
29096
- /* @__PURE__ */ jsx58(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
29097
- /* @__PURE__ */ jsx58(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
29098
- ] }) }) : /* @__PURE__ */ jsx58(
29099
- Button,
29100
- {
29101
- variant: "ghost",
29102
- size: "icon",
29103
- className: "border border-gray-400",
29104
- children: /* @__PURE__ */ jsx58(Search, { className: "h-5 w-5 text-gray-400" })
29105
- }
29106
- ),
29107
- /* @__PURE__ */ jsxs33("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
29108
- /* @__PURE__ */ jsx58(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx58(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
29109
- badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ jsx58("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__ */ jsx58("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
29110
- ] }),
29111
- /* @__PURE__ */ jsxs33(DropdownMenu, { children: [
29112
- /* @__PURE__ */ jsx58(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs33("div", { className: "flex items-center space-x-2", children: [
29113
- !isMobileView && showName && /* @__PURE__ */ jsx58("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
29114
- !isMobileView ? /* @__PURE__ */ jsxs33(Fragment18, { children: [
29115
- /* @__PURE__ */ jsx58(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ jsx58(
29116
- AvatarImage,
29117
- {
29118
- src: "/images/appbuilder/toolset/profile.svg",
29119
- alt: "Profile"
29120
- }
29121
- ) : /* @__PURE__ */ jsx58("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) }) }),
29122
- /* @__PURE__ */ jsx58(
29123
- Button,
29124
- {
29125
- variant: "ghost",
29126
- size: "icon",
29127
- className: "text-gray-900 md:hidden dark:invert",
29128
- children: /* @__PURE__ */ jsx58(Menu, { className: "h-6 w-6" })
29129
- }
29130
- )
29131
- ] }) : /* @__PURE__ */ jsx58(
29132
- Button,
29293
+ className: "w-full border-b border-b-white dark:border-b-gray-800 dark:bg-gray-800 bg-white shadow-sm",
29294
+ style,
29295
+ children: /* @__PURE__ */ jsxs34("div", { className: "mx-auto flex max-w-[90%] items-center justify-between px-4 py-4", children: [
29296
+ /* @__PURE__ */ jsx59(
29297
+ Link6,
29133
29298
  {
29134
- variant: "ghost",
29135
- size: "icon",
29136
- className: "text-gray-900 dark:invert",
29137
- children: /* @__PURE__ */ jsx58(Menu, { className: "h-6 w-6" })
29299
+ href: "/",
29300
+ onClick: (e) => handleBuilderExit(e, "/"),
29301
+ className: "flex items-center space-x-2",
29302
+ children: imageUrl ? /* @__PURE__ */ jsx59(Image3, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ jsx59("span", { className: "font-semibold text-blue-700", children: "Logo" })
29138
29303
  }
29139
- )
29140
- ] }) }),
29141
- /* @__PURE__ */ jsxs33(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
29142
- profileMenu && profileMenu.length > 0 && /* @__PURE__ */ jsx58(Fragment18, { children: profileMenu.map((item) => /* @__PURE__ */ jsx58(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx58(Link6, { href: item.url || "#", children: item.header }) }, item.id)) }),
29143
- /* @__PURE__ */ jsxs33("div", { className: "md:hidden", children: [
29144
- /* @__PURE__ */ jsx58(DropdownMenuSeparator, {}),
29145
- list && list.length > 0 && /* @__PURE__ */ jsx58(Fragment18, { children: list.map((item) => /* @__PURE__ */ jsx58(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx58(Link6, { href: item.url || "#", children: item.header }) }, item.id)) })
29304
+ ),
29305
+ !isMobileView && /* @__PURE__ */ jsx59("div", { className: "flex items-center space-x-6 sm:hidden md:flex", children: formatedMenu.map((item) => /* @__PURE__ */ jsx59(
29306
+ Link6,
29307
+ {
29308
+ href: item.url || "#",
29309
+ onClick: (e) => handleBuilderExit(e, item.url),
29310
+ className: "text-sm font-medium dark:text-white text-gray-600 hover:text-gray-900 transition-colors",
29311
+ children: item.header
29312
+ },
29313
+ item.id
29314
+ )) }),
29315
+ /* @__PURE__ */ jsxs34("div", { className: "flex items-center space-x-3", children: [
29316
+ !isMobileView ? /* @__PURE__ */ jsx59("div", { className: "flex-1 px-6", children: /* @__PURE__ */ jsxs34("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
29317
+ /* @__PURE__ */ jsx59(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 dark:text-white text-gray-400" }),
29318
+ /* @__PURE__ */ jsx59(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
29319
+ ] }) }) : /* @__PURE__ */ jsx59(Button, { variant: "ghost", size: "icon", className: "border border-gray-400", children: /* @__PURE__ */ jsx59(Search, { className: "h-5 w-5 text-gray-400" }) }),
29320
+ /* @__PURE__ */ jsxs34("div", { className: "relative bg-[#E9E9E9] dark:bg-gray-700 rounded-md", children: [
29321
+ /* @__PURE__ */ jsx59(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx59(Bell, { className: "h-5 w-5 text-[#1C1B1F] dark:text-gray-400" }) }),
29322
+ badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && Number(badgeCount) > 0 ? /* @__PURE__ */ jsx59("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__ */ jsx59("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
29323
+ ] }),
29324
+ /* @__PURE__ */ jsxs34(DropdownMenu, { children: [
29325
+ /* @__PURE__ */ jsx59(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs34("div", { className: "flex items-center space-x-2", children: [
29326
+ !isMobileView && showName && /* @__PURE__ */ jsx59("h4", { className: "text-[#000000] dark:text-gray-300 text-[13px] font-[500] mb-0", children: userName }),
29327
+ !isMobileView ? /* @__PURE__ */ jsxs34(Fragment19, { children: [
29328
+ /* @__PURE__ */ jsx59(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ jsx59(
29329
+ AvatarImage,
29330
+ {
29331
+ src: "/images/appbuilder/toolset/profile.svg",
29332
+ alt: "Profile"
29333
+ }
29334
+ ) : /* @__PURE__ */ jsx59("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) }) }),
29335
+ /* @__PURE__ */ jsx59(
29336
+ Button,
29337
+ {
29338
+ variant: "ghost",
29339
+ size: "icon",
29340
+ className: "text-gray-900 md:hidden dark:invert",
29341
+ children: /* @__PURE__ */ jsx59(Menu, { className: "h-6 w-6" })
29342
+ }
29343
+ )
29344
+ ] }) : /* @__PURE__ */ jsx59(Button, { variant: "ghost", size: "icon", className: "text-gray-900 dark:invert", children: /* @__PURE__ */ jsx59(Menu, { className: "h-6 w-6" }) })
29345
+ ] }) }),
29346
+ /* @__PURE__ */ jsxs34(DropdownMenuContent, { align: "end", className: "bg-white dark:bg-gray-800", children: [
29347
+ profileMenu && profileMenu.length > 0 && /* @__PURE__ */ jsx59(Fragment19, { children: profileMenu.map((item) => /* @__PURE__ */ jsx59(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx59(
29348
+ Link6,
29349
+ {
29350
+ href: item.url || "#",
29351
+ onClick: (e) => handleBuilderExit(e, item.url),
29352
+ children: item.header
29353
+ }
29354
+ ) }, item.id)) }),
29355
+ /* @__PURE__ */ jsxs34("div", { className: "md:hidden", children: [
29356
+ /* @__PURE__ */ jsx59(DropdownMenuSeparator, {}),
29357
+ formatedMenu && formatedMenu.length > 0 && /* @__PURE__ */ jsx59(Fragment19, { children: formatedMenu.map((item) => /* @__PURE__ */ jsx59(DropdownMenuItem, { className: "text-black dark:invert", children: /* @__PURE__ */ jsx59(
29358
+ Link6,
29359
+ {
29360
+ href: item.url || "#",
29361
+ onClick: (e) => handleBuilderExit(e, item.url),
29362
+ children: item.header
29363
+ }
29364
+ ) }, item.id)) })
29365
+ ] })
29366
+ ] })
29367
+ ] })
29146
29368
  ] })
29147
29369
  ] })
29370
+ }
29371
+ ),
29372
+ /* @__PURE__ */ jsx59(Dialog, { open: showExitDialog, onOpenChange: setShowExitDialog, children: /* @__PURE__ */ jsxs34(DialogContent, { className: "bg-[#fff]", children: [
29373
+ /* @__PURE__ */ jsxs34(DialogHeader, { children: [
29374
+ /* @__PURE__ */ jsx59(DialogTitle, { children: "Exit Builder?" }),
29375
+ /* @__PURE__ */ jsx59(DialogDescription, { children: "You are about to leave the builder. Any unsaved changes may be lost." })
29376
+ ] }),
29377
+ /* @__PURE__ */ jsxs34(DialogFooter, { children: [
29378
+ /* @__PURE__ */ jsx59(Button, { className: "cursor-pointer bg-[#12715b] text-[#fff]", variant: "outline", onClick: () => setShowExitDialog(false), children: "Cancel" }),
29379
+ /* @__PURE__ */ jsx59(Button, { className: "cursor-pointer border-[#12715b] border", onClick: confirmExit, children: "Yes, Exit" })
29148
29380
  ] })
29149
- ] })
29150
- ] }) });
29381
+ ] }) })
29382
+ ] });
29151
29383
  }
29152
29384
 
29153
29385
  // src/components/Chart/BarChart.tsx
@@ -29164,35 +29396,35 @@ import {
29164
29396
  ResponsiveContainer,
29165
29397
  Legend
29166
29398
  } from "recharts";
29167
- import { jsx as jsx59, jsxs as jsxs34 } from "react/jsx-runtime";
29399
+ import { jsx as jsx60, jsxs as jsxs35 } from "react/jsx-runtime";
29168
29400
  var ChartComponent = ({ className, style, loading, ...props }) => {
29169
29401
  const data = Array.isArray(props.data) ? props.data : [];
29170
29402
  const chartType = props.chartType || "bar";
29171
29403
  const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
29172
29404
  if (loading || data.length === 0) {
29173
- return /* @__PURE__ */ jsx59(
29405
+ return /* @__PURE__ */ jsx60(
29174
29406
  "div",
29175
29407
  {
29176
29408
  className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
29177
29409
  style,
29178
- children: /* @__PURE__ */ jsx59("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
29410
+ children: /* @__PURE__ */ jsx60("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
29179
29411
  }
29180
29412
  );
29181
29413
  }
29182
- return /* @__PURE__ */ jsx59("div", { className: `${className} h-[400px]`, style, children: /* @__PURE__ */ jsx59(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs34(BarChart, { data, title: "Leads", desc: "content", children: [
29183
- /* @__PURE__ */ jsx59(CartesianGrid, { strokeDasharray: "3 3" }),
29184
- /* @__PURE__ */ jsx59(XAxis, { dataKey: "name" }),
29185
- /* @__PURE__ */ jsx59(YAxis, {}),
29186
- /* @__PURE__ */ jsx59(Tooltip, { formatter: (value) => `${value}k` }),
29187
- /* @__PURE__ */ jsx59(Legend, { verticalAlign: legendsPosition, align: "center" }),
29188
- /* @__PURE__ */ jsx59(
29414
+ return /* @__PURE__ */ jsx60("div", { className: `${className} h-[400px]`, style, children: /* @__PURE__ */ jsx60(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs35(BarChart, { data, title: "Leads", desc: "content", children: [
29415
+ /* @__PURE__ */ jsx60(CartesianGrid, { strokeDasharray: "3 3" }),
29416
+ /* @__PURE__ */ jsx60(XAxis, { dataKey: "name" }),
29417
+ /* @__PURE__ */ jsx60(YAxis, {}),
29418
+ /* @__PURE__ */ jsx60(Tooltip, { formatter: (value) => `${value}k` }),
29419
+ /* @__PURE__ */ jsx60(Legend, { verticalAlign: legendsPosition, align: "center" }),
29420
+ /* @__PURE__ */ jsx60(
29189
29421
  Bar,
29190
29422
  {
29191
29423
  dataKey: "value",
29192
29424
  fill: "#00695C",
29193
29425
  radius: [6, 6, 0, 0],
29194
29426
  isAnimationActive: false,
29195
- children: data.map((entry, index) => /* @__PURE__ */ jsx59(
29427
+ children: data.map((entry, index) => /* @__PURE__ */ jsx60(
29196
29428
  "rect",
29197
29429
  {
29198
29430
  fill: entry.color || "#00695C"
@@ -29201,16 +29433,16 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
29201
29433
  ))
29202
29434
  }
29203
29435
  )
29204
- ] }) : /* @__PURE__ */ jsxs34(AreaChart, { data, children: [
29205
- /* @__PURE__ */ jsx59("defs", { children: /* @__PURE__ */ jsxs34("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
29206
- /* @__PURE__ */ jsx59("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
29207
- /* @__PURE__ */ jsx59("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
29436
+ ] }) : /* @__PURE__ */ jsxs35(AreaChart, { data, children: [
29437
+ /* @__PURE__ */ jsx60("defs", { children: /* @__PURE__ */ jsxs35("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
29438
+ /* @__PURE__ */ jsx60("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
29439
+ /* @__PURE__ */ jsx60("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
29208
29440
  ] }) }),
29209
- /* @__PURE__ */ jsx59(CartesianGrid, { strokeDasharray: "3 3" }),
29210
- /* @__PURE__ */ jsx59(XAxis, { dataKey: "name" }),
29211
- /* @__PURE__ */ jsx59(YAxis, {}),
29212
- /* @__PURE__ */ jsx59(Tooltip, { formatter: (value) => `${value}k` }),
29213
- /* @__PURE__ */ jsx59(
29441
+ /* @__PURE__ */ jsx60(CartesianGrid, { strokeDasharray: "3 3" }),
29442
+ /* @__PURE__ */ jsx60(XAxis, { dataKey: "name" }),
29443
+ /* @__PURE__ */ jsx60(YAxis, {}),
29444
+ /* @__PURE__ */ jsx60(Tooltip, { formatter: (value) => `${value}k` }),
29445
+ /* @__PURE__ */ jsx60(
29214
29446
  Area,
29215
29447
  {
29216
29448
  type: "monotone",
@@ -29226,7 +29458,7 @@ var ChartComponent = ({ className, style, loading, ...props }) => {
29226
29458
  var BarChart_default = React10.memo(ChartComponent);
29227
29459
 
29228
29460
  // src/components/Chart/PieChart.tsx
29229
- import React11, { useMemo as useMemo3 } from "react";
29461
+ import React11, { useEffect as useEffect22, useMemo as useMemo4, useState as useState7 } from "react";
29230
29462
  import {
29231
29463
  PieChart,
29232
29464
  Pie,
@@ -29235,7 +29467,7 @@ import {
29235
29467
  Tooltip as Tooltip2,
29236
29468
  LabelList
29237
29469
  } from "recharts";
29238
- import { Fragment as Fragment19, jsx as jsx60, jsxs as jsxs35 } from "react/jsx-runtime";
29470
+ import { Fragment as Fragment20, jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
29239
29471
  var getRandomColor = () => {
29240
29472
  const palette = [
29241
29473
  "#2563eb",
@@ -29255,51 +29487,57 @@ var DonutChart = ({ className, style, loading, ...props }) => {
29255
29487
  const showLegends = props.showLegends ?? true;
29256
29488
  const labelType = props.labelType || "inside";
29257
29489
  const canvasMode = props.canvasMode;
29258
- const data = useMemo3(() => {
29490
+ const data = useMemo4(() => {
29259
29491
  if (!Array.isArray(props.data)) return [];
29260
29492
  return props.data.map((item) => ({ ...item, color: getRandomColor() }));
29261
29493
  }, [props.data]);
29262
- const total = useMemo3(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
29494
+ const total = useMemo4(() => data.reduce((sum, d) => sum + d.value, 0), [data]);
29263
29495
  const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
29264
- const renderLegends = useMemo3(() => {
29496
+ const [mounted, setMounted] = useState7(false);
29497
+ useEffect22(() => {
29498
+ const timeout = setTimeout(() => setMounted(true), 100);
29499
+ return () => clearTimeout(timeout);
29500
+ }, []);
29501
+ const renderLegends = useMemo4(() => {
29265
29502
  if (!showLegends) return null;
29266
- return /* @__PURE__ */ jsx60(Fragment19, { children: data.map((d) => /* @__PURE__ */ jsxs35(
29503
+ return /* @__PURE__ */ jsx61(Fragment20, { children: data.map((d) => /* @__PURE__ */ jsxs36(
29267
29504
  "div",
29268
29505
  {
29269
29506
  className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
29270
29507
  children: [
29271
- /* @__PURE__ */ jsx60(
29508
+ /* @__PURE__ */ jsx61(
29272
29509
  "span",
29273
29510
  {
29274
29511
  className: "inline-block w-[16px] h-[16px] rounded",
29275
29512
  style: { backgroundColor: d.color }
29276
29513
  }
29277
29514
  ),
29278
- /* @__PURE__ */ jsx60("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
29515
+ /* @__PURE__ */ jsx61("span", { className: "text-[#000000] text-[12px] md:text-[13px] font-[500]", children: d.name })
29279
29516
  ]
29280
29517
  },
29281
29518
  d.name
29282
29519
  )) });
29283
29520
  }, [data, showLegends]);
29521
+ if (!mounted) return null;
29284
29522
  if (loading || data.length === 0) {
29285
- return /* @__PURE__ */ jsx60(
29523
+ return /* @__PURE__ */ jsx61(
29286
29524
  "div",
29287
29525
  {
29288
29526
  className: `flex items-center justify-center w-full h-[300px] md:h-[400px] bg-gray-50 animate-pulse rounded-lg ${className}`,
29289
29527
  style,
29290
- children: /* @__PURE__ */ jsx60("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
29528
+ children: /* @__PURE__ */ jsx61("div", { className: "text-gray-400 text-sm md:text-base", children: loading ? "Loading chart report..." : "No data available to display the chart." })
29291
29529
  }
29292
29530
  );
29293
29531
  }
29294
- return /* @__PURE__ */ jsxs35(
29532
+ return /* @__PURE__ */ jsxs36(
29295
29533
  "div",
29296
29534
  {
29297
29535
  className: `relative flex flex-col items-center ${className}`,
29298
29536
  style,
29299
29537
  children: [
29300
- /* @__PURE__ */ jsxs35("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
29301
- /* @__PURE__ */ jsx60(ResponsiveContainer2, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs35(PieChart, { children: [
29302
- /* @__PURE__ */ jsxs35(
29538
+ /* @__PURE__ */ jsxs36("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
29539
+ /* @__PURE__ */ jsx61(ResponsiveContainer2, { width: "99%", height: "100%", children: /* @__PURE__ */ jsxs36(PieChart, { children: [
29540
+ /* @__PURE__ */ jsxs36(
29303
29541
  Pie,
29304
29542
  {
29305
29543
  data,
@@ -29311,8 +29549,8 @@ var DonutChart = ({ className, style, loading, ...props }) => {
29311
29549
  labelLine: false,
29312
29550
  isAnimationActive: false,
29313
29551
  children: [
29314
- data.map((entry, index) => /* @__PURE__ */ jsx60(Cell, { fill: entry.color }, `cell-${index}`)),
29315
- /* @__PURE__ */ jsx60(
29552
+ data.map((entry, index) => /* @__PURE__ */ jsx61(Cell, { fill: entry.color }, `cell-${index}`)),
29553
+ /* @__PURE__ */ jsx61(
29316
29554
  LabelList,
29317
29555
  {
29318
29556
  dataKey: "value",
@@ -29325,14 +29563,14 @@ var DonutChart = ({ className, style, loading, ...props }) => {
29325
29563
  ]
29326
29564
  }
29327
29565
  ),
29328
- /* @__PURE__ */ jsx60(
29566
+ /* @__PURE__ */ jsx61(
29329
29567
  Tooltip2,
29330
29568
  {
29331
29569
  formatter: (value, name) => [`${value}k`, name]
29332
29570
  }
29333
29571
  )
29334
29572
  ] }) }),
29335
- /* @__PURE__ */ jsxs35(
29573
+ /* @__PURE__ */ jsxs36(
29336
29574
  "div",
29337
29575
  {
29338
29576
  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]`,
@@ -29343,7 +29581,7 @@ var DonutChart = ({ className, style, loading, ...props }) => {
29343
29581
  }
29344
29582
  )
29345
29583
  ] }),
29346
- /* @__PURE__ */ jsx60("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
29584
+ /* @__PURE__ */ jsx61("div", { className: "flex flex-wrap justify-center gap-2 mt-6 w-full md:w-auto", children: renderLegends })
29347
29585
  ]
29348
29586
  }
29349
29587
  );
@@ -29351,10 +29589,10 @@ var DonutChart = ({ className, style, loading, ...props }) => {
29351
29589
  var PieChart_default = React11.memo(DonutChart);
29352
29590
 
29353
29591
  // src/components/Blocks/EmailComposer.tsx
29354
- import { jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
29592
+ import { jsx as jsx62, jsxs as jsxs37 } from "react/jsx-runtime";
29355
29593
  function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
29356
- return /* @__PURE__ */ jsx61("div", { className, style, children: /* @__PURE__ */ jsxs36("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
29357
- /* @__PURE__ */ jsx61("div", { className: "mb-3", children: /* @__PURE__ */ jsx61(
29594
+ return /* @__PURE__ */ jsx62("div", { className, style, children: /* @__PURE__ */ jsxs37("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
29595
+ /* @__PURE__ */ jsx62("div", { className: "mb-3", children: /* @__PURE__ */ jsx62(
29358
29596
  "input",
29359
29597
  {
29360
29598
  type: "email",
@@ -29363,8 +29601,8 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
29363
29601
  required: true
29364
29602
  }
29365
29603
  ) }),
29366
- /* @__PURE__ */ jsx61("div", { className: "mb-3", children: /* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-2", children: [
29367
- /* @__PURE__ */ jsx61(
29604
+ /* @__PURE__ */ jsx62("div", { className: "mb-3", children: /* @__PURE__ */ jsxs37("div", { className: "flex items-center gap-2", children: [
29605
+ /* @__PURE__ */ jsx62(
29368
29606
  "input",
29369
29607
  {
29370
29608
  type: "email",
@@ -29375,7 +29613,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
29375
29613
  required: true
29376
29614
  }
29377
29615
  ),
29378
- !showCc && /* @__PURE__ */ jsx61(
29616
+ !showCc && /* @__PURE__ */ jsx62(
29379
29617
  "button",
29380
29618
  {
29381
29619
  onClick: () => setShowCc?.(true),
@@ -29383,7 +29621,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
29383
29621
  children: "Cc"
29384
29622
  }
29385
29623
  ),
29386
- !showBcc && /* @__PURE__ */ jsx61(
29624
+ !showBcc && /* @__PURE__ */ jsx62(
29387
29625
  "button",
29388
29626
  {
29389
29627
  onClick: () => setShowBcc?.(true),
@@ -29392,7 +29630,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
29392
29630
  }
29393
29631
  )
29394
29632
  ] }) }),
29395
- showCc && /* @__PURE__ */ jsx61("div", { className: "mb-3", children: /* @__PURE__ */ jsx61(
29633
+ showCc && /* @__PURE__ */ jsx62("div", { className: "mb-3", children: /* @__PURE__ */ jsx62(
29396
29634
  "input",
29397
29635
  {
29398
29636
  type: "text",
@@ -29402,7 +29640,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
29402
29640
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
29403
29641
  }
29404
29642
  ) }),
29405
- showBcc && /* @__PURE__ */ jsx61("div", { className: "mb-3", children: /* @__PURE__ */ jsx61(
29643
+ showBcc && /* @__PURE__ */ jsx62("div", { className: "mb-3", children: /* @__PURE__ */ jsx62(
29406
29644
  "input",
29407
29645
  {
29408
29646
  type: "text",
@@ -29412,7 +29650,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
29412
29650
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
29413
29651
  }
29414
29652
  ) }),
29415
- /* @__PURE__ */ jsx61("div", { className: "mb-3", children: /* @__PURE__ */ jsx61(
29653
+ /* @__PURE__ */ jsx62("div", { className: "mb-3", children: /* @__PURE__ */ jsx62(
29416
29654
  "input",
29417
29655
  {
29418
29656
  type: "text",
@@ -29422,11 +29660,11 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
29422
29660
  className: "w-full flex-1 border-2 rounded-md h-[40px] px-3 focus:outline-none border-[#E9E9E9] text-[#383838]"
29423
29661
  }
29424
29662
  ) }),
29425
- /* @__PURE__ */ jsx61("div", { className: "mb-4", children: /* @__PURE__ */ jsx61(MyEditor, { value: body, onChange: setBody }) }),
29426
- /* @__PURE__ */ jsxs36("div", { className: "flex justify-end gap-2", children: [
29427
- /* @__PURE__ */ jsx61("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
29428
- /* @__PURE__ */ jsx61("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
29429
- /* @__PURE__ */ jsx61("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
29663
+ /* @__PURE__ */ jsx62("div", { className: "mb-4", children: /* @__PURE__ */ jsx62(MyEditor, { value: body, onChange: setBody }) }),
29664
+ /* @__PURE__ */ jsxs37("div", { className: "flex justify-end gap-2", children: [
29665
+ /* @__PURE__ */ jsx62("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
29666
+ /* @__PURE__ */ jsx62("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
29667
+ /* @__PURE__ */ jsx62("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
29430
29668
  ] })
29431
29669
  ] }) });
29432
29670
  }
@@ -29471,10 +29709,10 @@ function showSonnerToast({
29471
29709
  // src/components/ui/sonner.tsx
29472
29710
  import { useTheme } from "next-themes";
29473
29711
  import { Toaster as Sonner } from "sonner";
29474
- import { jsx as jsx62 } from "react/jsx-runtime";
29712
+ import { jsx as jsx63 } from "react/jsx-runtime";
29475
29713
  var Toaster = ({ ...props }) => {
29476
29714
  const { theme = "system" } = useTheme();
29477
- return /* @__PURE__ */ jsx62(
29715
+ return /* @__PURE__ */ jsx63(
29478
29716
  Sonner,
29479
29717
  {
29480
29718
  theme,