pxengine 0.1.102 → 0.1.104

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.cjs CHANGED
@@ -25042,7 +25042,7 @@ var LayoutAtom = ({
25042
25042
  gapMap[gap],
25043
25043
  className
25044
25044
  );
25045
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: classes, children: children.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react3.default.Fragment, { children: renderComponent(child, index) }, child.id || `layout-item-${index}`)) });
25045
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: classes, children: (Array.isArray(children) ? children : []).map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react3.default.Fragment, { children: renderComponent(child, index) }, child.id || `layout-item-${index}`)) });
25046
25046
  };
25047
25047
 
25048
25048
  // src/atoms/CardAtom.tsx
@@ -25139,8 +25139,8 @@ var CardAtom = ({
25139
25139
  title && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CardTitle, { className: "text-xl font-bold text-gray900", children: title }),
25140
25140
  description && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CardDescription, { children: description })
25141
25141
  ] }),
25142
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CardContent, { className: "space-y-4", children: (children || []).map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react4.default.Fragment, { children: renderComponent(child, index) }, child.id || `card-content-${index}`)) }),
25143
- footer && footer.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CardFooter, { className: "bg-gray50/50 border-t border-gray200 flex flex-wrap gap-2 pt-6", children: footer.map((footerChild, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react4.default.Fragment, { children: renderComponent(footerChild, index) }, footerChild.id || `card-footer-${index}`)) })
25142
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CardContent, { className: "space-y-4", children: (Array.isArray(children) ? children : []).map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react4.default.Fragment, { children: renderComponent(child, index) }, child.id || `card-content-${index}`)) }),
25143
+ Array.isArray(footer) && footer.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CardFooter, { className: "bg-gray50/50 border-t border-gray200 flex flex-wrap gap-2 pt-6", children: footer.map((footerChild, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react4.default.Fragment, { children: renderComponent(footerChild, index) }, footerChild.id || `card-footer-${index}`)) })
25144
25144
  ]
25145
25145
  }
25146
25146
  );
@@ -25577,7 +25577,7 @@ var InputAtom = ({
25577
25577
  children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectValue, { placeholder: placeholder || "Select option" })
25578
25578
  }
25579
25579
  ),
25580
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContent, { className: "rounded-xl border-border shadow-xl", children: options?.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectItem, { value: opt.value, children: opt.label }, opt.value)) })
25580
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContent, { className: "rounded-xl border-border shadow-xl", children: (Array.isArray(options) ? options : []).map((opt) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectItem, { value: opt.value, children: opt.label }, opt.value)) })
25581
25581
  ]
25582
25582
  }
25583
25583
  );
@@ -25647,7 +25647,7 @@ var InputAtom = ({
25647
25647
  className: cn("gap-2.5 bg-transparent", className),
25648
25648
  style: remainingStyle,
25649
25649
  onValueChange: isInteractive ? (val) => handleChange(val) : void 0,
25650
- children: options?.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center space-x-3 bg-transparent", children: [
25650
+ children: (Array.isArray(options) ? options : []).map((opt) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center space-x-3 bg-transparent", children: [
25651
25651
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
25652
25652
  RadioGroupItem,
25653
25653
  {
@@ -25885,8 +25885,9 @@ var TabsAtom = ({
25885
25885
  className,
25886
25886
  renderComponent
25887
25887
  }) => {
25888
+ const safeTabs = Array.isArray(tabs) ? tabs : [];
25888
25889
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tabs, { defaultValue, className: cn("w-full", className), children: [
25889
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TabsList, { className: "bg-gray-100/50 p-1 rounded-xl", children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25890
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TabsList, { className: "bg-gray-100/50 p-1 rounded-xl", children: safeTabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25890
25891
  TabsTrigger,
25891
25892
  {
25892
25893
  value: tab.value,
@@ -25895,7 +25896,7 @@ var TabsAtom = ({
25895
25896
  },
25896
25897
  tab.value
25897
25898
  )) }),
25898
- tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TabsContent, { value: tab.value, className: "mt-4", children: tab.content.map((child) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react6.default.Fragment, { children: renderComponent(child) }, child.id)) }, tab.value))
25899
+ safeTabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TabsContent, { value: tab.value, className: "mt-4", children: (Array.isArray(tab.content) ? tab.content : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react6.default.Fragment, { children: renderComponent(child) }, child.id)) }, tab.value))
25899
25900
  ] });
25900
25901
  };
25901
25902
 
@@ -25950,14 +25951,15 @@ var AccordionAtom = ({
25950
25951
  className,
25951
25952
  renderComponent
25952
25953
  }) => {
25953
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Accordion, { type: "single", collapsible: true, className: cn("w-full", className), children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
25954
+ const safeItems = Array.isArray(items) ? items : [];
25955
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Accordion, { type: "single", collapsible: true, className: cn("w-full", className), children: safeItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
25954
25956
  AccordionItem,
25955
25957
  {
25956
25958
  value: item.value,
25957
25959
  className: "border-gray-100",
25958
25960
  children: [
25959
25961
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AccordionTrigger, { className: "text-sm font-semibold hover:no-underline hover:text-purple600 py-4", children: item.trigger }),
25960
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AccordionContent, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "pt-2 pb-4", children: item.content.map((child) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react7.default.Fragment, { children: renderComponent(child) }, child.id)) }) })
25962
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AccordionContent, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "pt-2 pb-4", children: (Array.isArray(item.content) ? item.content : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react7.default.Fragment, { children: renderComponent(child) }, child.id)) }) })
25961
25963
  ]
25962
25964
  },
25963
25965
  item.value
@@ -26392,7 +26394,7 @@ var ScrollAreaAtom = ({
26392
26394
  className: cn("rounded-xl border", className),
26393
26395
  style: { height: maxHeight },
26394
26396
  children: [
26395
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "p-4", children: children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react8.default.Fragment, { children: renderComponent(child) }, child.id)) }),
26397
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "p-4", children: (Array.isArray(children) ? children : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react8.default.Fragment, { children: renderComponent(child) }, child.id)) }),
26396
26398
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ScrollBar, { orientation: "vertical" })
26397
26399
  ]
26398
26400
  }
@@ -26595,8 +26597,9 @@ var CarouselAtom = ({
26595
26597
  className,
26596
26598
  renderComponent
26597
26599
  }) => {
26600
+ const safeItems = Array.isArray(items) ? items : [];
26598
26601
  return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Carousel, { className: cn("w-full max-w-xs mx-auto", className), children: [
26599
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CarouselContent, { children: items.map((slide, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CarouselItem, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "p-1", children: slide.map((child) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react9.default.Fragment, { children: renderComponent(child) }, child.id)) }) }, index)) }),
26602
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CarouselContent, { children: safeItems.map((slide, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CarouselItem, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "p-1", children: (Array.isArray(slide) ? slide : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react9.default.Fragment, { children: renderComponent(child) }, child.id)) }) }, index)) }),
26600
26603
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CarouselPrevious, {}),
26601
26604
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CarouselNext, {})
26602
26605
  ] });
@@ -26617,7 +26620,7 @@ var AspectRatioAtom = ({
26617
26620
  className,
26618
26621
  renderComponent
26619
26622
  }) => {
26620
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AspectRatio, { ratio, children: children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react10.default.Fragment, { children: renderComponent(child) }, child.id)) }) });
26623
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AspectRatio, { ratio, children: (Array.isArray(children) ? children : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react10.default.Fragment, { children: renderComponent(child) }, child.id)) }) });
26621
26624
  };
26622
26625
 
26623
26626
  // src/atoms/CollapsibleAtom.tsx
@@ -26644,8 +26647,8 @@ var CollapsibleAtom = ({
26644
26647
  defaultOpen,
26645
26648
  className: cn("w-full space-y-2", className),
26646
26649
  children: [
26647
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex items-center justify-between space-x-4 px-4 py-2 bg-gray-50 rounded-lg cursor-pointer hover:bg-gray-100 transition-colors", children: trigger.map((child) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react11.default.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26648
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CollapsibleContent2, { className: "space-y-2", children: content.map((child) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react11.default.Fragment, { children: renderComponent(child) }, child.id)) })
26650
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex items-center justify-between space-x-4 px-4 py-2 bg-gray-50 rounded-lg cursor-pointer hover:bg-gray-100 transition-colors", children: (Array.isArray(trigger) ? trigger : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react11.default.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26651
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CollapsibleContent2, { className: "space-y-2", children: (Array.isArray(content) ? content : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react11.default.Fragment, { children: renderComponent(child) }, child.id)) })
26649
26652
  ]
26650
26653
  }
26651
26654
  );
@@ -26684,7 +26687,7 @@ var TooltipAtom = ({
26684
26687
  renderComponent
26685
26688
  }) => {
26686
26689
  return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Tooltip, { children: [
26687
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: cn("inline-block", className), children: children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react12.default.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26690
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: cn("inline-block", className), children: (Array.isArray(children) ? children : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react12.default.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26688
26691
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TooltipContent, { className: "bg-gray-900 text-white border-none rounded-lg shadow-xl px-3 py-1.5 text-xs", children: content })
26689
26692
  ] }) });
26690
26693
  };
@@ -26722,8 +26725,8 @@ var PopoverAtom = ({
26722
26725
  renderComponent
26723
26726
  }) => {
26724
26727
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Popover, { children: [
26725
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: cn("inline-block cursor-pointer", className), children: trigger.map((child) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react13.default.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26726
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(PopoverContent, { className: "w-80 rounded-2xl shadow-2xl border-gray-100 p-4 bg-white/95 backdrop-blur-sm", children: content.map((child) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react13.default.Fragment, { children: renderComponent(child) }, child.id)) })
26728
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: cn("inline-block cursor-pointer", className), children: (Array.isArray(trigger) ? trigger : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react13.default.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26729
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(PopoverContent, { className: "w-80 rounded-2xl shadow-2xl border-gray-100 p-4 bg-white/95 backdrop-blur-sm", children: (Array.isArray(content) ? content : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react13.default.Fragment, { children: renderComponent(child) }, child.id)) })
26727
26730
  ] });
26728
26731
  };
26729
26732
 
@@ -26834,14 +26837,14 @@ var DialogAtom = ({
26834
26837
  renderComponent
26835
26838
  }) => {
26836
26839
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Dialog, { children: [
26837
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DialogTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: cn("inline-block cursor-pointer", className), children: trigger.map((child) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react14.default.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26840
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DialogTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: cn("inline-block cursor-pointer", className), children: (Array.isArray(trigger) ? trigger : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react14.default.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26838
26841
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(DialogContent, { className: "sm:max-w-[425px] rounded-3xl p-6 bg-white/95 backdrop-blur-md shadow-3xl border-gray-100", children: [
26839
26842
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(DialogHeader, { children: [
26840
26843
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DialogTitle, { className: "text-xl font-bold bg-gradient-to-r from-purple600 to-indigo-600 bg-clip-text text-transparent", children: title }),
26841
26844
  description && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DialogDescription, { className: "text-gray-500 font-medium pt-1", children: description })
26842
26845
  ] }),
26843
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "py-4", children: children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react14.default.Fragment, { children: renderComponent(child) }, child.id)) }),
26844
- footer && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DialogFooter, { className: "pt-2", children: footer.map((child) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react14.default.Fragment, { children: renderComponent(child) }, child.id)) })
26846
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "py-4", children: (Array.isArray(children) ? children : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react14.default.Fragment, { children: renderComponent(child) }, child.id)) }),
26847
+ footer && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DialogFooter, { className: "pt-2", children: (Array.isArray(footer) ? footer : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react14.default.Fragment, { children: renderComponent(child) }, child.id)) })
26845
26848
  ] })
26846
26849
  ] });
26847
26850
  };
@@ -26965,7 +26968,7 @@ var SheetAtom = ({
26965
26968
  renderComponent
26966
26969
  }) => {
26967
26970
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Sheet2, { children: [
26968
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SheetTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: cn("inline-block cursor-pointer", className), children: trigger.map((child) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react15.default.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26971
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SheetTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: cn("inline-block cursor-pointer", className), children: (Array.isArray(trigger) ? trigger : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react15.default.Fragment, { children: renderComponent(child) }, child.id)) }) }),
26969
26972
  /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
26970
26973
  SheetContent,
26971
26974
  {
@@ -26976,8 +26979,8 @@ var SheetAtom = ({
26976
26979
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SheetTitle, { className: "text-xl font-bold text-gray-900", children: title }),
26977
26980
  description && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SheetDescription, { className: "text-gray-500 font-medium", children: description })
26978
26981
  ] }),
26979
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "py-8", children: children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react15.default.Fragment, { children: renderComponent(child) }, child.id)) }),
26980
- footer && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SheetFooter, { className: "absolute bottom-6 left-6 right-6", children: footer.map((child) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react15.default.Fragment, { children: renderComponent(child) }, child.id)) })
26982
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "py-8", children: (Array.isArray(children) ? children : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react15.default.Fragment, { children: renderComponent(child) }, child.id)) }),
26983
+ footer && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SheetFooter, { className: "absolute bottom-6 left-6 right-6", children: (Array.isArray(footer) ? footer : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react15.default.Fragment, { children: renderComponent(child) }, child.id)) })
26981
26984
  ]
26982
26985
  }
26983
26986
  )
@@ -27104,7 +27107,7 @@ var AlertDialogAtom = ({
27104
27107
  renderComponent
27105
27108
  }) => {
27106
27109
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(AlertDialog, { children: [
27107
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AlertDialogTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: cn("inline-block cursor-pointer", className), children: trigger.map((child) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react16.default.Fragment, { children: renderComponent(child) }, child.id)) }) }),
27110
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AlertDialogTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: cn("inline-block cursor-pointer", className), children: (Array.isArray(trigger) ? trigger : []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react16.default.Fragment, { children: renderComponent(child) }, child.id)) }) }),
27108
27111
  /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(AlertDialogContent, { className: "rounded-3xl p-6 bg-white shadow-3xl border-gray-100", children: [
27109
27112
  /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(AlertDialogHeader, { children: [
27110
27113
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AlertDialogTitle, { className: "text-lg font-bold text-gray-900", children: title }),
@@ -27218,9 +27221,10 @@ var BreadcrumbAtom = ({
27218
27221
  items,
27219
27222
  className
27220
27223
  }) => {
27221
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Breadcrumb, { className, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(BreadcrumbList, { children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_react17.default.Fragment, { children: [
27224
+ const safeItems = Array.isArray(items) ? items : [];
27225
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Breadcrumb, { className, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(BreadcrumbList, { children: safeItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_react17.default.Fragment, { children: [
27222
27226
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(BreadcrumbItem, { children: item.isCurrent ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(BreadcrumbLink, { href: item.href || "#", children: item.label }) }),
27223
- index < items.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(BreadcrumbSeparator, {})
27227
+ index < safeItems.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(BreadcrumbSeparator, {})
27224
27228
  ] }, index)) }) });
27225
27229
  };
27226
27230
 
@@ -32180,6 +32184,7 @@ var CommandAtom = ({
32180
32184
  groups,
32181
32185
  className
32182
32186
  }) => {
32187
+ const safeGroups = Array.isArray(groups) ? groups : [];
32183
32188
  return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
32184
32189
  "div",
32185
32190
  {
@@ -32191,9 +32196,9 @@ var CommandAtom = ({
32191
32196
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(CommandInput, { placeholder }),
32192
32197
  /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(CommandList, { children: [
32193
32198
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(CommandEmpty, { children: "No results found." }),
32194
- groups.map((group, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_react50.default.Fragment, { children: [
32195
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(CommandGroup, { heading: group.heading, children: group.items.map((item, j) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(CommandItem, { value: item.value, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { children: item.label }) }, j)) }),
32196
- i < groups.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(CommandSeparator, {})
32199
+ safeGroups.map((group, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_react50.default.Fragment, { children: [
32200
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(CommandGroup, { heading: group.heading, children: (Array.isArray(group.items) ? group.items : []).map((item, j) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(CommandItem, { value: item.value, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { children: item.label }) }, j)) }),
32201
+ i < safeGroups.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(CommandSeparator, {})
32197
32202
  ] }, i))
32198
32203
  ] })
32199
32204
  ] })
@@ -32377,7 +32382,7 @@ var FormSelectAtom = ({
32377
32382
  label && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(FormLabel, { children: label }),
32378
32383
  /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Select, { onValueChange: field.onChange, defaultValue: field.value, children: [
32379
32384
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(FormControl, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SelectTrigger, { id: id || `form-select-${fieldName}`, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SelectValue, { placeholder }) }) }),
32380
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SelectContent, { children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SelectItem, { value: option.value, children: option.label }, option.value)) })
32385
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SelectContent, { children: (Array.isArray(options) ? options : []).map((option) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SelectItem, { value: option.value, children: option.label }, option.value)) })
32381
32386
  ] }),
32382
32387
  description && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(FormDescription, { children: description }),
32383
32388
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(FormMessage, {})
@@ -32672,6 +32677,7 @@ var SliderAtom = ({
32672
32677
  var import_jsx_runtime72 = require("react/jsx-runtime");
32673
32678
  var RadioGroupAtom = ({ id, label, options, defaultValue, disabled, className, style, onValueChange }) => {
32674
32679
  const hasPxVars = style && Object.keys(style).some((key) => key.startsWith("--px-"));
32680
+ const safeOptions = Array.isArray(options) ? options : [];
32675
32681
  return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex flex-col gap-2 w-full", children: [
32676
32682
  label && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
32677
32683
  Label,
@@ -32691,7 +32697,7 @@ var RadioGroupAtom = ({ id, label, options, defaultValue, disabled, className, s
32691
32697
  className: cn("grid gap-2", className),
32692
32698
  style,
32693
32699
  "data-px-styled": hasPxVars ? "" : void 0,
32694
- children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex items-center space-x-2", children: [
32700
+ children: safeOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex items-center space-x-2", children: [
32695
32701
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
32696
32702
  RadioGroupItem,
32697
32703
  {
@@ -32895,6 +32901,7 @@ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
32895
32901
  // src/atoms/DropdownMenuAtom.tsx
32896
32902
  var import_jsx_runtime75 = require("react/jsx-runtime");
32897
32903
  var DropdownMenuAtom = ({ trigger, items, className, onAction }) => {
32904
+ const safeItems = Array.isArray(items) ? items : [];
32898
32905
  return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(DropdownMenu, { children: [
32899
32906
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(DropdownMenuTrigger, { asChild: true, children: trigger }),
32900
32907
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
@@ -32904,7 +32911,7 @@ var DropdownMenuAtom = ({ trigger, items, className, onAction }) => {
32904
32911
  "w-56 bg-white/80 backdrop-blur-md border-purple-100",
32905
32912
  className
32906
32913
  ),
32907
- children: items.map((item) => {
32914
+ children: safeItems.map((item) => {
32908
32915
  const Icon3 = item.icon ? lucide_react_exports[item.icon] : null;
32909
32916
  return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
32910
32917
  DropdownMenuItem,
@@ -33067,6 +33074,7 @@ ContextMenuShortcut.displayName = "ContextMenuShortcut";
33067
33074
  // src/atoms/ContextMenuAtom.tsx
33068
33075
  var import_jsx_runtime77 = require("react/jsx-runtime");
33069
33076
  var ContextMenuAtom = ({ trigger, items, className, onAction }) => {
33077
+ const safeItems = Array.isArray(items) ? items : [];
33070
33078
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(ContextMenu, { children: [
33071
33079
  /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ContextMenuTrigger, { asChild: true, children: trigger }),
33072
33080
  /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
@@ -33076,7 +33084,7 @@ var ContextMenuAtom = ({ trigger, items, className, onAction }) => {
33076
33084
  "w-64 bg-white/80 backdrop-blur-md border-purple-100",
33077
33085
  className
33078
33086
  ),
33079
- children: items.map((item) => {
33087
+ children: safeItems.map((item) => {
33080
33088
  const Icon3 = item.icon ? lucide_react_exports[item.icon] : null;
33081
33089
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
33082
33090
  ContextMenuItem,
@@ -33258,6 +33266,7 @@ var InputOTPAtom = ({ length, className, onChange }) => {
33258
33266
  var import_react51 = __toESM(require("react"), 1);
33259
33267
  var import_jsx_runtime81 = require("react/jsx-runtime");
33260
33268
  var KbdAtom = ({ keys, className }) => {
33269
+ const safeKeys = Array.isArray(keys) ? keys : [];
33261
33270
  return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
33262
33271
  "kbd",
33263
33272
  {
@@ -33265,9 +33274,9 @@ var KbdAtom = ({ keys, className }) => {
33265
33274
  "pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100",
33266
33275
  className
33267
33276
  ),
33268
- children: keys.map((key, i) => /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_react51.default.Fragment, { children: [
33277
+ children: safeKeys.map((key, i) => /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_react51.default.Fragment, { children: [
33269
33278
  /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "text-xs", children: key }),
33270
- i < keys.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { children: "+" })
33279
+ i < safeKeys.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { children: "+" })
33271
33280
  ] }, i))
33272
33281
  }
33273
33282
  );
@@ -33315,6 +33324,7 @@ var ResizableAtom = ({
33315
33324
  renderComponent
33316
33325
  }) => {
33317
33326
  const Group7 = ResizablePanelGroup;
33327
+ const safePanels = Array.isArray(panels) ? panels : [];
33318
33328
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
33319
33329
  Group7,
33320
33330
  {
@@ -33323,15 +33333,15 @@ var ResizableAtom = ({
33323
33333
  "min-h-[200px] w-full rounded-lg border border-purple-100",
33324
33334
  className
33325
33335
  ),
33326
- children: panels.map((panel, i) => /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_react52.default.Fragment, { children: [
33327
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ResizablePanel, { defaultSize: panel.defaultSize, className: "p-4", children: panel.children.map((child, childIdx) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
33336
+ children: safePanels.map((panel, i) => /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_react52.default.Fragment, { children: [
33337
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ResizablePanel, { defaultSize: panel.defaultSize, className: "p-4", children: (Array.isArray(panel.children) ? panel.children : []).map((child, childIdx) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
33328
33338
  import_react52.default.Fragment,
33329
33339
  {
33330
33340
  children: renderComponent(child)
33331
33341
  },
33332
33342
  child.id || `resizable-child-${i}-${childIdx}`
33333
33343
  )) }),
33334
- i < panels.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ResizableHandle, { withHandle: true })
33344
+ i < safePanels.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ResizableHandle, { withHandle: true })
33335
33345
  ] }, i))
33336
33346
  }
33337
33347
  );
@@ -33854,6 +33864,7 @@ var TimelineAtom = ({
33854
33864
  items,
33855
33865
  className
33856
33866
  }) => {
33867
+ const safeItems = Array.isArray(items) ? items : [];
33857
33868
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
33858
33869
  "div",
33859
33870
  {
@@ -33861,7 +33872,7 @@ var TimelineAtom = ({
33861
33872
  "space-y-6 relative before:absolute before:inset-0 before:ml-5 before:-translate-x-px before:h-full before:w-0.5 before:bg-gradient-to-b before:from-purple-500 before:via-indigo-500 before:to-gray-200 before:pointer-events-none",
33862
33873
  className
33863
33874
  ),
33864
- children: items.map((item, i) => {
33875
+ children: safeItems.map((item, i) => {
33865
33876
  const Icon3 = item.icon ? lucide_react_exports[item.icon] : null;
33866
33877
  const isCompleted = item.status === "completed";
33867
33878
  const isActive = item.status === "active";
@@ -34559,7 +34570,7 @@ var EditableField = import_react56.default.memo(
34559
34570
  if (!value) {
34560
34571
  return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { className: "opacity-0", children: "-" });
34561
34572
  }
34562
- return value.toString();
34573
+ return typeof value === "object" ? JSON.stringify(value) : String(value ?? "");
34563
34574
  };
34564
34575
  return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
34565
34576
  "div",
@@ -34668,7 +34679,7 @@ var ActionButton = import_react57.default.memo(
34668
34679
  setTimeLeft((prev) => {
34669
34680
  if (prev <= 1) {
34670
34681
  clearInterval(timer);
34671
- onProceed();
34682
+ onProceed?.();
34672
34683
  return 0;
34673
34684
  }
34674
34685
  return prev - 1;
@@ -34684,7 +34695,7 @@ var ActionButton = import_react57.default.memo(
34684
34695
  variant,
34685
34696
  size,
34686
34697
  disabled: disabled || isLoading,
34687
- onClick: onProceed,
34698
+ onClick: () => onProceed?.(),
34688
34699
  className: cn(
34689
34700
  "relative min-w-[140px] overflow-hidden group transition-all duration-300",
34690
34701
  "bg-[var(--primary-color)] hover:opacity-90 text-white font-bold rounded-full px-5 py-2.5 shadow-[0_4px_14px_0_hsl(var(--primary)/30%)] hover:shadow-[0_6px_20px_0_hsl(var(--primary)/40%)]",
@@ -35010,7 +35021,7 @@ var DynamicFormCard = import_react59.default.memo(
35010
35021
  ...rest
35011
35022
  }) => {
35012
35023
  const fields = (0, import_react59.useMemo)(
35013
- () => providedFields ?? generateFieldsFromData(data),
35024
+ () => Array.isArray(providedFields) ? providedFields : generateFieldsFromData(data),
35014
35025
  [providedFields, data]
35015
35026
  );
35016
35027
  const handleProceed = () => {
@@ -35082,7 +35093,7 @@ var StatsGrid = ({
35082
35093
  {
35083
35094
  id: `stat-label-${index}`,
35084
35095
  type: "text",
35085
- content: item.label,
35096
+ content: typeof item.label === "object" ? JSON.stringify(item.label) : String(item.label ?? ""),
35086
35097
  variant: "small",
35087
35098
  className: cn(!hasPxVars && "text-muted-foreground", "font-medium tracking-wide uppercase text-[10px]"),
35088
35099
  style: textColor ? { color: textColor } : void 0
@@ -35122,7 +35133,7 @@ var StatsGrid = ({
35122
35133
  ),
35123
35134
  children: [
35124
35135
  TrendIcon && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(TrendIcon, { className: "w-3 h-3 mr-0.5" }),
35125
- item.trend
35136
+ typeof item.trend === "object" ? JSON.stringify(item.trend) : String(item.trend ?? "")
35126
35137
  ]
35127
35138
  }
35128
35139
  )
@@ -35234,6 +35245,7 @@ var LoadingOverlay = ({
35234
35245
  // src/molecules/generic/FilterBar/FilterBar.tsx
35235
35246
  var import_jsx_runtime101 = require("react/jsx-runtime");
35236
35247
  var FilterBar = ({ filters, showSearch = true, className, onFilterToggle, onSearch }) => {
35248
+ const safeFilters = Array.isArray(filters) ? filters : [];
35237
35249
  return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
35238
35250
  "div",
35239
35251
  {
@@ -35253,7 +35265,7 @@ var FilterBar = ({ filters, showSearch = true, className, onFilterToggle, onSear
35253
35265
  }
35254
35266
  )
35255
35267
  ] }),
35256
- /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "flex flex-wrap gap-2", children: filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
35268
+ /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "flex flex-wrap gap-2", children: safeFilters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
35257
35269
  Badge2,
35258
35270
  {
35259
35271
  variant: filter.active ? "default" : "outline",
@@ -35353,7 +35365,8 @@ var FileUpload = ({ title, accept, multiple, className, style, onFilesSelected }
35353
35365
  // src/molecules/generic/TagCloud/TagCloud.tsx
35354
35366
  var import_jsx_runtime103 = require("react/jsx-runtime");
35355
35367
  var TagCloud = ({ tags = [], className, onTagClick }) => {
35356
- const normalizedTags = tags.map(
35368
+ const safeTags = Array.isArray(tags) ? tags : [];
35369
+ const normalizedTags = safeTags.map(
35357
35370
  (t) => typeof t === "string" ? { label: t, value: t } : t
35358
35371
  );
35359
35372
  return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: cn("flex flex-wrap gap-3.5", className), children: normalizedTags.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(
@@ -35379,6 +35392,8 @@ var DataGrid = ({
35379
35392
  pageSize = 10,
35380
35393
  className
35381
35394
  }) => {
35395
+ const safeColumns = Array.isArray(columns) ? columns : [];
35396
+ const safeData = Array.isArray(data) ? data : [];
35382
35397
  const renderCell = (item, column) => {
35383
35398
  const value = item[column.accessorKey];
35384
35399
  switch (column.type) {
@@ -35388,7 +35403,7 @@ var DataGrid = ({
35388
35403
  {
35389
35404
  variant: "secondary",
35390
35405
  className: "bg-purple-50 text-purple-700 border-purple-100",
35391
- children: value
35406
+ children: typeof value === "object" ? JSON.stringify(value) : String(value ?? "")
35392
35407
  }
35393
35408
  );
35394
35409
  case "avatar":
@@ -35402,9 +35417,9 @@ var DataGrid = ({
35402
35417
  case "date":
35403
35418
  return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "text-muted-foreground", children: new Date(value).toLocaleDateString() });
35404
35419
  case "number":
35405
- return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "font-mono font-medium", children: value.toLocaleString() });
35420
+ return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "font-mono font-medium", children: Number(value ?? 0).toLocaleString() });
35406
35421
  default:
35407
- return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { children: value });
35422
+ return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { children: typeof value === "object" ? JSON.stringify(value) : String(value ?? "") });
35408
35423
  }
35409
35424
  };
35410
35425
  return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
@@ -35415,7 +35430,7 @@ var DataGrid = ({
35415
35430
  className
35416
35431
  ),
35417
35432
  children: /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(Table3, { children: [
35418
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(TableHeader, { className: "bg-gray-50/50", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(TableRow, { children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
35433
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(TableHeader, { className: "bg-gray-50/50", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(TableRow, { children: safeColumns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
35419
35434
  TableHead,
35420
35435
  {
35421
35436
  className: "font-bold text-gray-900 h-12",
@@ -35423,11 +35438,11 @@ var DataGrid = ({
35423
35438
  },
35424
35439
  col.accessorKey
35425
35440
  )) }) }),
35426
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(TableBody, { children: data.slice(0, pageSize).map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
35441
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(TableBody, { children: safeData.slice(0, pageSize).map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
35427
35442
  TableRow,
35428
35443
  {
35429
35444
  className: "hover:bg-purple-50/30 transition-colors border-gray-50",
35430
- children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(TableCell, { className: "py-4", children: renderCell(item, col) }, col.accessorKey))
35445
+ children: safeColumns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(TableCell, { className: "py-4", children: renderCell(item, col) }, col.accessorKey))
35431
35446
  },
35432
35447
  idx
35433
35448
  )) })
@@ -35444,10 +35459,11 @@ var StepWizard = ({
35444
35459
  currentStep,
35445
35460
  className
35446
35461
  }) => {
35447
- return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: cn("flex items-center w-full", className), children: steps.map((step, i) => {
35462
+ const safeSteps = Array.isArray(steps) ? steps : [];
35463
+ return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: cn("flex items-center w-full", className), children: safeSteps.map((step, i) => {
35448
35464
  const isCompleted = i < currentStep;
35449
35465
  const isActive = i === currentStep;
35450
- const isLast = i === steps.length - 1;
35466
+ const isLast = i === safeSteps.length - 1;
35451
35467
  return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(import_react61.default.Fragment, { children: [
35452
35468
  /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "flex flex-col items-center relative group", children: [
35453
35469
  /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
@@ -35490,6 +35506,7 @@ var NotificationList = ({
35490
35506
  notifications,
35491
35507
  className
35492
35508
  }) => {
35509
+ const safeNotifications = Array.isArray(notifications) ? notifications : [];
35493
35510
  const getIcon = (type) => {
35494
35511
  switch (type) {
35495
35512
  case "success":
@@ -35514,7 +35531,7 @@ var NotificationList = ({
35514
35531
  return "bg-blue-50";
35515
35532
  }
35516
35533
  };
35517
- return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: cn("flex flex-col gap-2", className), children: notifications.map((n) => /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
35534
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: cn("flex flex-col gap-2", className), children: safeNotifications.map((n) => /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
35518
35535
  "div",
35519
35536
  {
35520
35537
  className: cn(
@@ -35577,15 +35594,16 @@ var PLATFORM_STYLES = {
35577
35594
  };
35578
35595
  var PlatformPost = ({ post, loading, className }) => {
35579
35596
  const [copied, setCopied] = (0, import_react62.useState)(false);
35580
- const [caption, setCaption] = (0, import_react62.useState)(post.caption);
35597
+ const [caption, setCaption] = (0, import_react62.useState)(post?.caption ?? "");
35598
+ const safeHashtags = Array.isArray(post.hashtags) ? post.hashtags : [];
35581
35599
  const style = PLATFORM_STYLES[post.platform] || PLATFORM_STYLES.twitter;
35582
35600
  const charCount = caption.length;
35583
35601
  const isOverLimit = charCount > post.character_limit;
35584
35602
  const isInstagram = post.platform === "instagram";
35585
35603
  const handleCopy = async () => {
35586
- const fullText = isInstagram ? post.hashtags.join(" ") : `${caption}
35604
+ const fullText = isInstagram ? safeHashtags.join(" ") : `${caption}
35587
35605
 
35588
- ${post.hashtags.join(" ")}`;
35606
+ ${safeHashtags.join(" ")}`;
35589
35607
  try {
35590
35608
  await navigator.clipboard.writeText(fullText);
35591
35609
  setCopied(true);
@@ -35639,7 +35657,7 @@ ${post.hashtags.join(" ")}`;
35639
35657
  }
35640
35658
  ) }),
35641
35659
  /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "px-4 pt-3 pb-4 space-y-2.5", children: [
35642
- loading ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "h-3 w-[50%] rounded bg-[#27272a] animate-pulse" }) : post.hashtags.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("p", { className: cn("text-xs font-medium leading-relaxed", style.hashtagColor), children: post.hashtags.join(" ") }) : null,
35660
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "h-3 w-[50%] rounded bg-[#27272a] animate-pulse" }) : safeHashtags.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("p", { className: cn("text-xs font-medium leading-relaxed", style.hashtagColor), children: safeHashtags.join(" ") }) : null,
35643
35661
  !isInstagram && (loading ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "h-2.5 w-[30%] rounded bg-[#27272a] animate-pulse" }) : /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
35644
35662
  "p",
35645
35663
  {
@@ -35844,6 +35862,7 @@ var hideScrollbar = {
35844
35862
  var CIStatusSection = ({
35845
35863
  branches
35846
35864
  }) => {
35865
+ const safeBranches = Array.isArray(branches) ? branches : [];
35847
35866
  return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
35848
35867
  "div",
35849
35868
  {
@@ -35864,7 +35883,7 @@ var CIStatusSection = ({
35864
35883
  className: "space-y-1.5 max-h-[220px] overflow-y-auto slim-scrollbar",
35865
35884
  style: hideScrollbar,
35866
35885
  children: [
35867
- branches.map((branch) => {
35886
+ safeBranches.map((branch) => {
35868
35887
  const cfg = STATUS_CONFIG[branch.status] || STATUS_CONFIG.none;
35869
35888
  return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(
35870
35889
  "div",
@@ -35886,7 +35905,7 @@ var CIStatusSection = ({
35886
35905
  branch.branch
35887
35906
  );
35888
35907
  }),
35889
- branches.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("p", { className: "text-xs text-gray-500 italic py-2", children: "No branches found" })
35908
+ safeBranches.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("p", { className: "text-xs text-gray-500 italic py-2", children: "No branches found" })
35890
35909
  ]
35891
35910
  }
35892
35911
  )
@@ -35927,6 +35946,7 @@ var hideScrollbar2 = {
35927
35946
  var PRListSection = ({
35928
35947
  pullRequests
35929
35948
  }) => {
35949
+ const safePullRequests = Array.isArray(pullRequests) ? pullRequests : [];
35930
35950
  return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
35931
35951
  "div",
35932
35952
  {
@@ -35947,7 +35967,7 @@ var PRListSection = ({
35947
35967
  className: "space-y-2 max-h-[220px] overflow-y-auto slim-scrollbar",
35948
35968
  style: hideScrollbar2,
35949
35969
  children: [
35950
- pullRequests.map((pr) => {
35970
+ safePullRequests.map((pr) => {
35951
35971
  const cfg = REVIEW_CONFIG[pr.review_status] || REVIEW_CONFIG.needs_review;
35952
35972
  return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
35953
35973
  "div",
@@ -35989,7 +36009,7 @@ var PRListSection = ({
35989
36009
  pr.number
35990
36010
  );
35991
36011
  }),
35992
- pullRequests.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("p", { className: "text-xs text-gray-500 italic py-2", children: "No open pull requests" })
36012
+ safePullRequests.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("p", { className: "text-xs text-gray-500 italic py-2", children: "No open pull requests" })
35993
36013
  ]
35994
36014
  }
35995
36015
  )
@@ -36053,6 +36073,7 @@ var hideScrollbar3 = {
36053
36073
  WebkitOverflowScrolling: "touch"
36054
36074
  };
36055
36075
  var StaleIssueList = ({ issues }) => {
36076
+ const safeIssues = Array.isArray(issues) ? issues : [];
36056
36077
  return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
36057
36078
  "div",
36058
36079
  {
@@ -36073,14 +36094,14 @@ var StaleIssueList = ({ issues }) => {
36073
36094
  className: "space-y-2 max-h-[220px] overflow-y-auto slim-scrollbar",
36074
36095
  style: hideScrollbar3,
36075
36096
  children: [
36076
- issues.map((issue) => /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
36097
+ safeIssues.map((issue) => /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(
36077
36098
  "div",
36078
36099
  {
36079
36100
  className: "flex items-center justify-between rounded-lg px-3 py-2.5",
36080
36101
  style: { backgroundColor: "rgba(40, 40, 40, 0.7)" },
36081
36102
  children: [
36082
36103
  /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
36083
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: "flex shrink-0 gap-1", children: issue.labels.slice(0, 2).map((label) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
36104
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: "flex shrink-0 gap-1", children: (Array.isArray(issue.labels) ? issue.labels : []).slice(0, 2).map((label) => /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
36084
36105
  "span",
36085
36106
  {
36086
36107
  className: cn(
@@ -36101,7 +36122,7 @@ var StaleIssueList = ({ issues }) => {
36101
36122
  },
36102
36123
  issue.number
36103
36124
  )),
36104
- issues.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("p", { className: "text-xs text-gray-500 italic py-2", children: "No stale issues" })
36125
+ safeIssues.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("p", { className: "text-xs text-gray-500 italic py-2", children: "No stale issues" })
36105
36126
  ]
36106
36127
  }
36107
36128
  )
@@ -36161,7 +36182,7 @@ var GitHubIssueTrackerCard = ({ owner, repo, open_bugs, velocity_per_week, stale
36161
36182
  }
36162
36183
  )
36163
36184
  ] }),
36164
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(StaleIssueList, { issues: stale_issues })
36185
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(StaleIssueList, { issues: Array.isArray(stale_issues) ? stale_issues : [] })
36165
36186
  ] })
36166
36187
  ] });
36167
36188
  };
@@ -36204,6 +36225,8 @@ var DataTable = ({
36204
36225
  rows,
36205
36226
  loading
36206
36227
  }) => {
36228
+ const safeColumns = Array.isArray(columns) ? columns : [];
36229
+ const safeRows = Array.isArray(rows) ? rows : [];
36207
36230
  return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
36208
36231
  "div",
36209
36232
  {
@@ -36222,7 +36245,7 @@ var DataTable = ({
36222
36245
  }
36223
36246
  ) }),
36224
36247
  /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "px-3 pb-3 overflow-x-auto", style: hideScrollbar4, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "space-y-3 p-2", children: [...Array(3)].map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "h-8 rounded bg-[#27272a] animate-pulse" }, i)) }) : /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("table", { className: "w-full text-sm", children: [
36225
- /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("tr", { className: "border-b border-[#3f3f46]/40", children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
36248
+ /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("tr", { className: "border-b border-[#3f3f46]/40", children: safeColumns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
36226
36249
  "th",
36227
36250
  {
36228
36251
  className: cn(
@@ -36234,14 +36257,14 @@ var DataTable = ({
36234
36257
  col.key
36235
36258
  )) }) }),
36236
36259
  /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)("tbody", { children: [
36237
- rows.map((row, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
36260
+ safeRows.map((row, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
36238
36261
  "tr",
36239
36262
  {
36240
36263
  className: cn(
36241
36264
  "transition-colors hover:bg-[#27272a]/40",
36242
- rowIdx !== rows.length - 1 && "border-b border-[#27272a]/50"
36265
+ rowIdx !== safeRows.length - 1 && "border-b border-[#27272a]/50"
36243
36266
  ),
36244
- children: columns.map((col) => {
36267
+ children: safeColumns.map((col) => {
36245
36268
  const cellColor = getCellColor(col.type, row[col.key]);
36246
36269
  return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
36247
36270
  "td",
@@ -36260,10 +36283,10 @@ var DataTable = ({
36260
36283
  },
36261
36284
  rowIdx
36262
36285
  )),
36263
- rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
36286
+ safeRows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
36264
36287
  "td",
36265
36288
  {
36266
- colSpan: columns.length,
36289
+ colSpan: safeColumns.length,
36267
36290
  className: "px-3 py-6 text-center text-xs text-gray-500 italic",
36268
36291
  children: "No data available"
36269
36292
  }
@@ -36295,7 +36318,8 @@ var AutoChart = ({
36295
36318
  type = "bar",
36296
36319
  loading
36297
36320
  }) => {
36298
- const maxValue = Math.max(...data.map((d) => d.value), 1);
36321
+ const safeData = Array.isArray(data) ? data : [];
36322
+ const maxValue = safeData.length ? Math.max(...safeData.map((d) => d.value), 1) : 1;
36299
36323
  return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
36300
36324
  "div",
36301
36325
  {
@@ -36320,7 +36344,7 @@ var AutoChart = ({
36320
36344
  style: { height: `${40 + i * 25}%` }
36321
36345
  },
36322
36346
  i
36323
- )) }) : type === "bar" ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: "flex items-end gap-3 h-[140px] w-full justify-center", children: data.map((point, idx) => {
36347
+ )) }) : type === "bar" ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: "flex items-end gap-3 h-[140px] w-full justify-center", children: safeData.map((point, idx) => {
36324
36348
  const heightPercent = point.value / maxValue * 100;
36325
36349
  const color = point.color || DEFAULT_COLORS[idx % DEFAULT_COLORS.length];
36326
36350
  return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
@@ -36346,7 +36370,7 @@ var AutoChart = ({
36346
36370
  );
36347
36371
  }) }) : (
36348
36372
  /* Horizontal bar chart */
36349
- /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: "flex flex-col gap-2.5 w-full", children: data.map((point, idx) => {
36373
+ /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: "flex flex-col gap-2.5 w-full", children: safeData.map((point, idx) => {
36350
36374
  const widthPercent = point.value / maxValue * 100;
36351
36375
  const color = point.color || DEFAULT_COLORS[idx % DEFAULT_COLORS.length];
36352
36376
  return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: "space-y-1", children: [
@@ -36440,7 +36464,7 @@ var GoogleSheetsCard = ({
36440
36464
  ] });
36441
36465
  };
36442
36466
  function autoGenerateChart(columns, rows) {
36443
- if (!rows.length || !columns.length) return null;
36467
+ if (!Array.isArray(rows) || !Array.isArray(columns) || !rows.length || !columns.length) return null;
36444
36468
  const labelCol = columns.find(
36445
36469
  (c) => c.type === "text" || c.type === void 0
36446
36470
  );
@@ -36659,6 +36683,7 @@ var GitHubReposListCard = ({
36659
36683
  className,
36660
36684
  sendMessage
36661
36685
  }) => {
36686
+ const safeRepos = Array.isArray(repos) ? repos : [];
36662
36687
  const handleRepoClick = (repo) => {
36663
36688
  sendMessage?.(`Use repo ${repo.full_name}`);
36664
36689
  };
@@ -36678,7 +36703,7 @@ var GitHubReposListCard = ({
36678
36703
  /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { className: "text-sm font-semibold text-white", children: "Your Repositories" }),
36679
36704
  /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("span", { className: "text-xs text-gray-500", children: [
36680
36705
  "(",
36681
- repos.length,
36706
+ safeRepos.length,
36682
36707
  ")"
36683
36708
  ] })
36684
36709
  ] }),
@@ -36692,7 +36717,7 @@ var GitHubReposListCard = ({
36692
36717
  maxHeight: 380,
36693
36718
  overflowY: "auto"
36694
36719
  },
36695
- children: repos.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "px-4 py-8 text-center text-sm text-gray-500", children: "No repositories found." }) : /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "divide-y divide-white/5 py-1", children: repos.map((repo) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
36720
+ children: safeRepos.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "px-4 py-8 text-center text-sm text-gray-500", children: "No repositories found." }) : /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "divide-y divide-white/5 py-1", children: safeRepos.map((repo) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
36696
36721
  RepoRow,
36697
36722
  {
36698
36723
  repo,
@@ -36750,6 +36775,7 @@ function timeAgo2(dateStr) {
36750
36775
  return `${months}mo ago`;
36751
36776
  }
36752
36777
  var SpreadsheetRow = ({ spreadsheet, onClick }) => {
36778
+ const safeSheets = Array.isArray(spreadsheet.sheets) ? spreadsheet.sheets : [];
36753
36779
  return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
36754
36780
  "button",
36755
36781
  {
@@ -36769,7 +36795,7 @@ var SpreadsheetRow = ({ spreadsheet, onClick }) => {
36769
36795
  timeAgo2(spreadsheet.modified_time)
36770
36796
  ] })
36771
36797
  ] }),
36772
- spreadsheet.sheets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "mt-1.5 flex flex-wrap gap-1", children: spreadsheet.sheets.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
36798
+ safeSheets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "mt-1.5 flex flex-wrap gap-1", children: safeSheets.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
36773
36799
  "span",
36774
36800
  {
36775
36801
  className: "inline-block rounded px-1.5 py-0.5 text-[10px] font-medium",
@@ -36802,8 +36828,10 @@ var GoogleSheetsListCard = ({
36802
36828
  className,
36803
36829
  sendMessage
36804
36830
  }) => {
36831
+ const safeSpreadsheets = Array.isArray(spreadsheets) ? spreadsheets : [];
36805
36832
  const handleSheetClick = (spreadsheet) => {
36806
- const firstTab = spreadsheet.sheets.length > 0 ? spreadsheet.sheets[0].title : "Sheet1";
36833
+ const safeSheets = Array.isArray(spreadsheet.sheets) ? spreadsheet.sheets : [];
36834
+ const firstTab = safeSheets.length > 0 ? safeSheets[0].title : "Sheet1";
36807
36835
  sendMessage?.(
36808
36836
  `Read spreadsheet "${spreadsheet.name}" (ID: ${spreadsheet.id}), tab: ${firstTab}`
36809
36837
  );
@@ -36814,7 +36842,7 @@ var GoogleSheetsListCard = ({
36814
36842
  /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "text-sm font-semibold text-white", children: "Your Spreadsheets" }),
36815
36843
  /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("span", { className: "text-xs text-gray-500", children: [
36816
36844
  "(",
36817
- spreadsheets.length,
36845
+ safeSpreadsheets.length,
36818
36846
  ")"
36819
36847
  ] })
36820
36848
  ] }),
@@ -36828,7 +36856,7 @@ var GoogleSheetsListCard = ({
36828
36856
  maxHeight: 380,
36829
36857
  overflowY: "auto"
36830
36858
  },
36831
- children: spreadsheets.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "px-4 py-8 text-center text-sm text-gray-500", children: "No spreadsheets found." }) : /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "divide-y divide-white/5 py-1", children: spreadsheets.map((spreadsheet) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
36859
+ children: safeSpreadsheets.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "px-4 py-8 text-center text-sm text-gray-500", children: "No spreadsheets found." }) : /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "divide-y divide-white/5 py-1", children: safeSpreadsheets.map((spreadsheet) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
36832
36860
  SpreadsheetRow,
36833
36861
  {
36834
36862
  spreadsheet,
@@ -37214,9 +37242,10 @@ var InputWidget = ({
37214
37242
  onAction,
37215
37243
  isSubmitting = false
37216
37244
  }) => {
37245
+ const safeFields = Array.isArray(fields) ? fields : [];
37217
37246
  const [values, setValues] = import_react66.default.useState(() => {
37218
37247
  const initial = {};
37219
- for (const f of fields) {
37248
+ for (const f of safeFields) {
37220
37249
  initial[f.key] = f.defaultValue ?? defaultForKind(f.kind);
37221
37250
  }
37222
37251
  return initial;
@@ -37224,7 +37253,7 @@ var InputWidget = ({
37224
37253
  const update = (key, v) => {
37225
37254
  setValues((prev) => ({ ...prev, [key]: v }));
37226
37255
  };
37227
- const buildElementsForSubmission = () => fields.map((f) => ({
37256
+ const buildElementsForSubmission = () => safeFields.map((f) => ({
37228
37257
  id: `${id}-${f.key}`,
37229
37258
  atomName: kindToAtomName(f.kind),
37230
37259
  props: {
@@ -37256,7 +37285,7 @@ var InputWidget = ({
37256
37285
  }
37257
37286
  if (action === "reset") {
37258
37287
  const reset = {};
37259
- for (const f of fields) reset[f.key] = f.defaultValue ?? defaultForKind(f.kind);
37288
+ for (const f of safeFields) reset[f.key] = f.defaultValue ?? defaultForKind(f.kind);
37260
37289
  setValues(reset);
37261
37290
  }
37262
37291
  onAction?.(action, payload);
@@ -37272,7 +37301,7 @@ var InputWidget = ({
37272
37301
  title && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("h3", { className: "text-base font-semibold", style: { color: "var(--px-text-color, inherit)" }, children: title }),
37273
37302
  description && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("p", { className: "text-sm opacity-80", style: { color: "var(--px-text-color, inherit)" }, children: description })
37274
37303
  ] }),
37275
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { className: "flex flex-col gap-4", children: fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
37304
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { className: "flex flex-col gap-4", children: safeFields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
37276
37305
  FieldRenderer,
37277
37306
  {
37278
37307
  field,
@@ -37490,7 +37519,7 @@ var TrendBadge = ({ item }) => {
37490
37519
  var KPIStatsCard = import_react67.default.memo(
37491
37520
  ({ title, subtitle, stats, items, theme, className, onAction: _onAction }) => {
37492
37521
  const s = th(theme);
37493
- const displayStats = stats || items || [];
37522
+ const displayStats = Array.isArray(stats) ? stats : Array.isArray(items) ? items : [];
37494
37523
  return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
37495
37524
  "div",
37496
37525
  {
@@ -37592,7 +37621,7 @@ var ApprovalCard = import_react68.default.memo(
37592
37621
  sendMessage?.(`${labels[next]}: ${title}`);
37593
37622
  onAction?.({ type: "approval", value: next, title });
37594
37623
  };
37595
- const config = STATUS_CONFIG2[status];
37624
+ const config = STATUS_CONFIG2[status] ?? STATUS_CONFIG2.pending;
37596
37625
  const StatusIcon = config.icon;
37597
37626
  return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
37598
37627
  "div",
@@ -37620,7 +37649,7 @@ var ApprovalCard = import_react68.default.memo(
37620
37649
  style: i < details.length - 1 ? { borderBottomColor: theme?.border } : {},
37621
37650
  children: [
37622
37651
  /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("span", { className: "text-cardText/50", style: s.muted, children: d.label }),
37623
- /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("span", { className: "font-medium text-cardText", style: s.text, children: d.value })
37652
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("span", { className: "font-medium text-cardText", style: s.text, children: typeof d.value === "object" ? JSON.stringify(d.value) : String(d.value ?? "") })
37624
37653
  ]
37625
37654
  },
37626
37655
  i
@@ -37684,7 +37713,7 @@ var StepDot = ({ step, accentColor }) => {
37684
37713
  var TimelineCard = import_react69.default.memo(
37685
37714
  ({ title, steps, milestones, theme, className, onAction: _onAction }) => {
37686
37715
  const s = th(theme);
37687
- const displaySteps = steps || milestones || [];
37716
+ const displaySteps = Array.isArray(steps) ? steps : Array.isArray(milestones) ? milestones : [];
37688
37717
  return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { className: cn("w-full rounded-[16px] border border-gray400 bg-cardSurface p-4", className), style: s.root, children: [
37689
37718
  title && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("h3", { className: "mb-4 text-sm font-semibold text-cardText", style: s.text, children: title }),
37690
37719
  /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "space-y-0", children: displaySteps.map((step, idx) => {
@@ -37874,7 +37903,7 @@ var DataTableCard = import_react71.default.memo(
37874
37903
  className: cn("border-b border-gray400/40 transition-colors hover:bg-white/[0.02]", rowIdx === safeRows.length - 1 && "border-b-0"),
37875
37904
  style: { borderBottomColor: theme?.border },
37876
37905
  children: cols.map((col, colIdx) => {
37877
- const raw = row?.[col.key] ?? row?.[col.label];
37906
+ const raw = Array.isArray(row) ? row[colIdx] : row?.[col.key] ?? row?.[col.label];
37878
37907
  const cell = raw ?? "\u2014";
37879
37908
  const isHighlight = highlight != null && (col.key === highlight || col.label === highlight);
37880
37909
  return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
@@ -37919,7 +37948,7 @@ var ChecklistCard = import_react72.default.memo(
37919
37948
  onAction
37920
37949
  }) => {
37921
37950
  const s = th(theme);
37922
- const source = items || tasks || [];
37951
+ const source = Array.isArray(items) ? items : Array.isArray(tasks) ? tasks : [];
37923
37952
  const [checked, setChecked] = import_react72.default.useState(
37924
37953
  () => new Set(source.filter((i) => i.checked).map((i) => i.id))
37925
37954
  );
@@ -38054,7 +38083,7 @@ var PollCard = import_react73.default.memo(
38054
38083
  onAction
38055
38084
  }) => {
38056
38085
  const s = th(theme);
38057
- const source = options || choices || [];
38086
+ const source = Array.isArray(options) ? options : Array.isArray(choices) ? choices : [];
38058
38087
  const [selected, setSelected] = import_react73.default.useState(/* @__PURE__ */ new Set());
38059
38088
  const [hasVoted, setHasVoted] = import_react73.default.useState(false);
38060
38089
  const [voteCounts, setVoteCounts] = import_react73.default.useState(
@@ -38101,7 +38130,9 @@ Selected: ${labels.join(", ")}`);
38101
38130
  const isSelected = selected.has(opt.id);
38102
38131
  const count = voteCounts[opt.id] ?? 0;
38103
38132
  const pct = hasVoted && displayTotal > 0 ? Math.round(count / displayTotal * 100) : 0;
38104
- const isWinner = hasVoted && count === Math.max(...Object.values(voteCounts));
38133
+ const voteCountValues = Object.values(voteCounts);
38134
+ const maxVotes = voteCountValues.length ? Math.max(...voteCountValues) : 0;
38135
+ const isWinner = hasVoted && count === maxVotes;
38105
38136
  const accentSubtleBg = theme?.accent ? withAlpha(theme.accent, 0.1) : void 0;
38106
38137
  return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
38107
38138
  "div",
@@ -38205,8 +38236,8 @@ var STATUS_STYLES = {
38205
38236
  cancelled: { label: "Cancelled", className: "text-rose-400 bg-rose-500/10 border-rose-500/20", dot: "bg-rose-400" }
38206
38237
  };
38207
38238
  function AvatarInitials({ name }) {
38208
- const initials = name.split(" ").map((p) => p[0]).slice(0, 2).join("").toUpperCase();
38209
- const hue = name.split("").reduce((acc, ch) => acc + ch.charCodeAt(0), 0) % 360;
38239
+ const initials = (name ?? "").split(" ").map((p) => p[0]).slice(0, 2).join("").toUpperCase();
38240
+ const hue = (name ?? "").split("").reduce((acc, ch) => acc + ch.charCodeAt(0), 0) % 360;
38210
38241
  return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
38211
38242
  "div",
38212
38243
  {
@@ -38233,17 +38264,18 @@ var CalendarEventCard = import_react74.default.memo(
38233
38264
  onAction
38234
38265
  }) => {
38235
38266
  const s = th(theme);
38236
- const cfg = STATUS_STYLES[status];
38267
+ const cfg = STATUS_STYLES[status] ?? STATUS_STYLES.upcoming;
38237
38268
  const parsedDate = import_react74.default.useMemo(() => {
38238
38269
  try {
38239
- const d = new Date(date);
38270
+ const safeDate = date ?? "";
38271
+ const d = new Date(safeDate);
38240
38272
  if (isNaN(d.getTime())) {
38241
- const parts = date.split(/[\s,]+/);
38242
- return { day: parts[1] || date, month: parts[0] || "" };
38273
+ const parts = safeDate.split(/[\s,]+/);
38274
+ return { day: parts[1] || safeDate, month: parts[0] || "" };
38243
38275
  }
38244
38276
  return { day: d.getDate().toString(), month: d.toLocaleString("en", { month: "short" }) };
38245
38277
  } catch {
38246
- return { day: date, month: "" };
38278
+ return { day: date ?? "", month: "" };
38247
38279
  }
38248
38280
  }, [date]);
38249
38281
  const handleJoin = (e) => {
@@ -38359,13 +38391,13 @@ var BudgetAllocCard = import_react75.default.memo(
38359
38391
  onAction: _onAction
38360
38392
  }) => {
38361
38393
  const s = th(theme);
38362
- const source = items || allocations || [];
38363
- const computedTotal = total ?? source.reduce((sum, i) => sum + i.amount, 0);
38394
+ const source = Array.isArray(items) ? items : Array.isArray(allocations) ? allocations : [];
38395
+ const computedTotal = total ?? source.reduce((sum, i) => sum + (Number(i.amount) || 0), 0);
38364
38396
  const paletteWithAccent = [theme?.accent ?? PALETTE[0], ...PALETTE.slice(1)];
38365
38397
  const segments = source.map((item, idx) => ({
38366
38398
  ...item,
38367
38399
  color: item.color || paletteWithAccent[idx % paletteWithAccent.length],
38368
- pct: computedTotal > 0 ? item.amount / computedTotal * 100 : 0
38400
+ pct: computedTotal > 0 ? (Number(item.amount) || 0) / computedTotal * 100 : 0
38369
38401
  }));
38370
38402
  return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(
38371
38403
  "div",
@@ -38486,6 +38518,8 @@ var ComparisonCard = import_react76.default.memo(
38486
38518
  onAction
38487
38519
  }) => {
38488
38520
  const s = th(theme);
38521
+ const safeOptions = Array.isArray(options) ? options : [];
38522
+ const safeAttributeLabels = Array.isArray(attribute_labels) ? attribute_labels : [];
38489
38523
  const [selected, setSelected] = import_react76.default.useState(null);
38490
38524
  const [isSubmitted, setIsSubmitted] = import_react76.default.useState(false);
38491
38525
  const isInteractive = isLatestMessage && !disabled && !isSubmitted;
@@ -38522,8 +38556,8 @@ var ComparisonCard = import_react76.default.memo(
38522
38556
  "div",
38523
38557
  {
38524
38558
  className: "grid gap-3",
38525
- style: { gridTemplateColumns: `repeat(${options.length}, minmax(0, 1fr))` },
38526
- children: options.map((opt) => {
38559
+ style: { gridTemplateColumns: `repeat(${safeOptions.length}, minmax(0, 1fr))` },
38560
+ children: safeOptions.map((opt) => {
38527
38561
  const isChosen = selected === opt.id;
38528
38562
  const isGoldBadge = !opt.badge_color || opt.badge_color === "gold";
38529
38563
  const badgeColor = opt.badge_color ? BADGE_COLORS[opt.badge_color] : BADGE_COLORS.gold;
@@ -38568,8 +38602,8 @@ var ComparisonCard = import_react76.default.memo(
38568
38602
  ]
38569
38603
  }
38570
38604
  ),
38571
- /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "flex flex-col divide-y divide-gray400/30 flex-1", children: attribute_labels.map((attrLabel, rowIdx) => {
38572
- const attr = opt.attributes[rowIdx];
38605
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("div", { className: "flex flex-col divide-y divide-gray400/30 flex-1", children: safeAttributeLabels.map((attrLabel, rowIdx) => {
38606
+ const attr = opt.attributes?.[rowIdx];
38573
38607
  return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
38574
38608
  "div",
38575
38609
  {
@@ -38779,7 +38813,7 @@ var ResearchBriefCard = ({
38779
38813
  item.label,
38780
38814
  ": "
38781
38815
  ] }),
38782
- /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "text-muted-foreground", children: item.value })
38816
+ /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("span", { className: "text-muted-foreground", children: typeof item.value === "object" ? JSON.stringify(item.value) : String(item.value ?? "") })
38783
38817
  ] }, `${item.label}-${idx}`)) })
38784
38818
  ] })
38785
38819
  ]
@@ -38800,6 +38834,7 @@ var PriorityActionsCard = ({
38800
38834
  actions,
38801
38835
  className
38802
38836
  }) => {
38837
+ const safeActions = Array.isArray(actions) ? actions : [];
38803
38838
  return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
38804
38839
  "div",
38805
38840
  {
@@ -38810,7 +38845,7 @@ var PriorityActionsCard = ({
38810
38845
  children: [
38811
38846
  /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
38812
38847
  summary ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("p", { className: "mt-2 text-sm leading-relaxed text-muted-foreground", children: summary }) : null,
38813
- /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "mt-4 space-y-2.5", children: actions.map((action, idx) => /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
38848
+ /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "mt-4 space-y-2.5", children: safeActions.map((action, idx) => /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
38814
38849
  "div",
38815
38850
  {
38816
38851
  className: "rounded-xl border border-border/70 bg-background/50 p-3",
@@ -38873,7 +38908,7 @@ var CampaignBriefCard = ({
38873
38908
  ] }),
38874
38909
  constraints.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("ul", { className: "mt-4 space-y-1.5 text-sm text-foreground/90", children: constraints.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)("li", { children: [
38875
38910
  "- ",
38876
- item
38911
+ typeof item === "object" ? JSON.stringify(item) : String(item ?? "")
38877
38912
  ] }, `${item}-${i}`)) }) : null
38878
38913
  ] });
38879
38914
  };
@@ -38888,16 +38923,17 @@ var DataSourceChecklistCard = ({
38888
38923
  className,
38889
38924
  onAction
38890
38925
  }) => {
38891
- const connectedCount = items.filter((i) => i.connected).length;
38926
+ const safeItems = Array.isArray(items) ? items : [];
38927
+ const connectedCount = safeItems.filter((i) => i.connected).length;
38892
38928
  return /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38893
38929
  /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
38894
38930
  /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("p", { className: "mt-1 text-xs text-muted-foreground", children: [
38895
38931
  connectedCount,
38896
38932
  "/",
38897
- items.length,
38933
+ safeItems.length,
38898
38934
  " connected"
38899
38935
  ] }),
38900
- /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "mt-3 space-y-2", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/60 p-3", children: [
38936
+ /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("div", { className: "mt-3 space-y-2", children: safeItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/60 p-3", children: [
38901
38937
  /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
38902
38938
  /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("p", { className: "text-sm font-medium text-foreground", children: item.source }),
38903
38939
  /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { className: cn("text-xs font-semibold", item.connected ? "text-emerald-600" : "text-amber-600"), children: item.connected ? "Connected" : "Pending" })
@@ -38930,7 +38966,7 @@ var GoalAlignmentCard = ({
38930
38966
  className
38931
38967
  }) => /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38932
38968
  /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
38933
- /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "mt-3 space-y-2", children: goals.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38969
+ /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "mt-3 space-y-2", children: (Array.isArray(goals) ? goals : []).map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38934
38970
  /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
38935
38971
  /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("p", { className: "text-sm font-medium text-foreground", children: item.goal }),
38936
38972
  item.status ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("span", { className: cn("text-xs font-semibold", statusColor[item.status]), children: item.status }) : null
@@ -38947,7 +38983,7 @@ var AudiencePersonaCard = ({
38947
38983
  className
38948
38984
  }) => /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38949
38985
  /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
38950
- /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "mt-3 space-y-2", children: segments.map((segment, i) => /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38986
+ /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "mt-3 space-y-2", children: (Array.isArray(segments) ? segments : []).map((segment, i) => /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38951
38987
  /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
38952
38988
  /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("p", { className: "text-sm font-medium text-foreground", children: segment.name }),
38953
38989
  segment.percentage !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("span", { className: "text-xs text-muted-foreground", children: [
@@ -38968,20 +39004,23 @@ var ChannelPlanCard = ({
38968
39004
  title,
38969
39005
  plans,
38970
39006
  className
38971
- }) => /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38972
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
38973
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "mt-3 space-y-2", children: plans.map((plan, i) => /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
38974
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("p", { className: "text-sm font-medium text-foreground", children: plan.channel }),
38975
- plan.objective ? /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("p", { className: "mt-1 text-xs text-muted-foreground", children: [
38976
- "Objective: ",
38977
- plan.objective
38978
- ] }) : null,
38979
- plan.cadence ? /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
38980
- "Cadence: ",
38981
- plan.cadence
38982
- ] }) : null
38983
- ] }, `${plan.channel}-${i}`)) })
38984
- ] });
39007
+ }) => {
39008
+ const safePlans = Array.isArray(plans) ? plans : [];
39009
+ return /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
39010
+ /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
39011
+ /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "mt-3 space-y-2", children: safePlans.map((plan, i) => /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
39012
+ /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("p", { className: "text-sm font-medium text-foreground", children: plan.channel }),
39013
+ plan.objective ? /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("p", { className: "mt-1 text-xs text-muted-foreground", children: [
39014
+ "Objective: ",
39015
+ plan.objective
39016
+ ] }) : null,
39017
+ plan.cadence ? /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
39018
+ "Cadence: ",
39019
+ plan.cadence
39020
+ ] }) : null
39021
+ ] }, `${plan.channel}-${i}`)) })
39022
+ ] });
39023
+ };
38985
39024
 
38986
39025
  // src/molecules/generic/InsightDigestCard/InsightDigestCard.tsx
38987
39026
  var import_jsx_runtime142 = require("react/jsx-runtime");
@@ -38995,17 +39034,20 @@ var InsightDigestCard = ({
38995
39034
  summary,
38996
39035
  insights,
38997
39036
  className
38998
- }) => /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
38999
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
39000
- summary ? /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("p", { className: "mt-2 text-sm text-muted-foreground", children: summary }) : null,
39001
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "mt-3 space-y-2", children: insights.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
39002
- /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
39003
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("p", { className: "text-sm font-medium text-foreground", children: item.label }),
39004
- item.confidence ? /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: cn("text-xs font-semibold", confidenceColor[item.confidence]), children: item.confidence }) : null
39005
- ] }),
39006
- /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: item.detail })
39007
- ] }, `${item.label}-${i}`)) })
39008
- ] });
39037
+ }) => {
39038
+ const safeInsights = Array.isArray(insights) ? insights : [];
39039
+ return /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
39040
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
39041
+ summary ? /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("p", { className: "mt-2 text-sm text-muted-foreground", children: summary }) : null,
39042
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("div", { className: "mt-3 space-y-2", children: safeInsights.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
39043
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
39044
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("p", { className: "text-sm font-medium text-foreground", children: item.label }),
39045
+ item.confidence ? /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("span", { className: cn("text-xs font-semibold", confidenceColor[item.confidence]), children: item.confidence }) : null
39046
+ ] }),
39047
+ /* @__PURE__ */ (0, import_jsx_runtime142.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: item.detail })
39048
+ ] }, `${item.label}-${i}`)) })
39049
+ ] });
39050
+ };
39009
39051
 
39010
39052
  // src/molecules/generic/ActionPriorityCard/ActionPriorityCard.tsx
39011
39053
  var import_jsx_runtime143 = require("react/jsx-runtime");
@@ -39018,20 +39060,23 @@ var ActionPriorityCard = ({
39018
39060
  title,
39019
39061
  actions,
39020
39062
  className
39021
- }) => /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
39022
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
39023
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "mt-3 space-y-2", children: actions.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
39024
- /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
39025
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("p", { className: "text-sm font-medium text-foreground", children: action.title }),
39026
- action.priority ? /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("span", { className: cn("rounded-full px-2.5 py-1 text-[11px] font-semibold", priorityBadge[action.priority]), children: action.priority }) : null
39027
- ] }),
39028
- action.owner || action.timeline ? /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("p", { className: "mt-1 text-xs text-muted-foreground", children: [
39029
- action.owner ? `Owner: ${action.owner}` : "",
39030
- action.owner && action.timeline ? " \u2022 " : "",
39031
- action.timeline ? `Timeline: ${action.timeline}` : ""
39032
- ] }) : null
39033
- ] }, `${action.title}-${i}`)) })
39034
- ] });
39063
+ }) => {
39064
+ const safeActions = Array.isArray(actions) ? actions : [];
39065
+ return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
39066
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
39067
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { className: "mt-3 space-y-2", children: safeActions.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
39068
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
39069
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("p", { className: "text-sm font-medium text-foreground", children: action.title }),
39070
+ action.priority ? /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("span", { className: cn("rounded-full px-2.5 py-1 text-[11px] font-semibold", priorityBadge[action.priority]), children: action.priority }) : null
39071
+ ] }),
39072
+ action.owner || action.timeline ? /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("p", { className: "mt-1 text-xs text-muted-foreground", children: [
39073
+ action.owner ? `Owner: ${action.owner}` : "",
39074
+ action.owner && action.timeline ? " \u2022 " : "",
39075
+ action.timeline ? `Timeline: ${action.timeline}` : ""
39076
+ ] }) : null
39077
+ ] }, `${action.title}-${i}`)) })
39078
+ ] });
39079
+ };
39035
39080
 
39036
39081
  // src/molecules/generic/RiskSignalCard/RiskSignalCard.tsx
39037
39082
  var import_jsx_runtime144 = require("react/jsx-runtime");
@@ -39044,19 +39089,22 @@ var RiskSignalCard = ({
39044
39089
  title,
39045
39090
  risks,
39046
39091
  className
39047
- }) => /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
39048
- /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
39049
- /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("div", { className: "mt-3 space-y-2", children: risks.map((risk, i) => /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
39050
- /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
39051
- /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("p", { className: "text-sm font-medium text-foreground", children: risk.signal }),
39052
- risk.severity ? /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: cn("text-xs font-semibold", severityColor[risk.severity]), children: risk.severity }) : null
39053
- ] }),
39054
- risk.impact ? /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("p", { className: "mt-1 text-xs text-muted-foreground", children: [
39055
- "Impact: ",
39056
- risk.impact
39057
- ] }) : null
39058
- ] }, `${risk.signal}-${i}`)) })
39059
- ] });
39092
+ }) => {
39093
+ const safeRisks = Array.isArray(risks) ? risks : [];
39094
+ return /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
39095
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
39096
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("div", { className: "mt-3 space-y-2", children: safeRisks.map((risk, i) => /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: [
39097
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
39098
+ /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("p", { className: "text-sm font-medium text-foreground", children: risk.signal }),
39099
+ risk.severity ? /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { className: cn("text-xs font-semibold", severityColor[risk.severity]), children: risk.severity }) : null
39100
+ ] }),
39101
+ risk.impact ? /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("p", { className: "mt-1 text-xs text-muted-foreground", children: [
39102
+ "Impact: ",
39103
+ risk.impact
39104
+ ] }) : null
39105
+ ] }, `${risk.signal}-${i}`)) })
39106
+ ] });
39107
+ };
39060
39108
 
39061
39109
  // src/molecules/generic/ScoreBreakdownCard/ScoreBreakdownCard.tsx
39062
39110
  var import_jsx_runtime145 = require("react/jsx-runtime");
@@ -39066,24 +39114,27 @@ var ScoreBreakdownCard = ({
39066
39114
  outOf = 100,
39067
39115
  items,
39068
39116
  className
39069
- }) => /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
39070
- /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
39071
- /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
39072
- totalScore !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("span", { className: "rounded-full border border-border px-2.5 py-1 text-xs text-muted-foreground", children: [
39073
- totalScore,
39074
- "/",
39075
- outOf
39076
- ] }) : null
39077
- ] }),
39078
- /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "mt-3 space-y-2", children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "flex items-center justify-between gap-2 text-sm", children: [
39079
- /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("p", { className: "font-medium text-foreground", children: item.label }),
39080
- /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("p", { className: "text-muted-foreground", children: [
39081
- item.score,
39082
- "/",
39083
- item.outOf ?? outOf
39084
- ] })
39085
- ] }) }, `${item.label}-${i}`)) })
39086
- ] });
39117
+ }) => {
39118
+ const safeItems = Array.isArray(items) ? items : [];
39119
+ return /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
39120
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
39121
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
39122
+ totalScore !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("span", { className: "rounded-full border border-border px-2.5 py-1 text-xs text-muted-foreground", children: [
39123
+ totalScore,
39124
+ "/",
39125
+ outOf
39126
+ ] }) : null
39127
+ ] }),
39128
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "mt-3 space-y-2", children: safeItems.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3", children: /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { className: "flex items-center justify-between gap-2 text-sm", children: [
39129
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("p", { className: "font-medium text-foreground", children: item.label }),
39130
+ /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("p", { className: "text-muted-foreground", children: [
39131
+ item.score,
39132
+ "/",
39133
+ item.outOf ?? outOf
39134
+ ] })
39135
+ ] }) }, `${item.label}-${i}`)) })
39136
+ ] });
39137
+ };
39087
39138
 
39088
39139
  // src/molecules/generic/NextStepCard/NextStepCard.tsx
39089
39140
  var import_jsx_runtime146 = require("react/jsx-runtime");
@@ -39093,26 +39144,29 @@ var NextStepCard = ({
39093
39144
  ctaLabel = "Proceed",
39094
39145
  className,
39095
39146
  onAction
39096
- }) => /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
39097
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
39098
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { className: "mt-3 space-y-2", children: steps.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3 text-sm", children: [
39099
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("p", { className: "font-medium text-foreground", children: item.step }),
39100
- item.owner || item.due ? /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("p", { className: "mt-1 text-xs text-muted-foreground", children: [
39101
- item.owner ? `Owner: ${item.owner}` : "",
39102
- item.owner && item.due ? " \u2022 " : "",
39103
- item.due ? `Due: ${item.due}` : ""
39104
- ] }) : null
39105
- ] }, `${item.step}-${i}`)) }),
39106
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
39107
- "button",
39108
- {
39109
- type: "button",
39110
- onClick: () => onAction?.({ type: "next_step_continue", stepsCount: steps.length }),
39111
- className: "mt-4 rounded-full border border-border px-4 py-2 text-sm text-foreground",
39112
- children: ctaLabel
39113
- }
39114
- )
39115
- ] });
39147
+ }) => {
39148
+ const safeSteps = Array.isArray(steps) ? steps : [];
39149
+ return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: cn("rounded-2xl border border-border bg-card/70 p-5 shadow-sm", className), children: [
39150
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("h3", { className: "text-base font-semibold text-foreground", children: title }),
39151
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { className: "mt-3 space-y-2", children: safeSteps.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "rounded-xl border border-border/70 bg-background/50 p-3 text-sm", children: [
39152
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("p", { className: "font-medium text-foreground", children: item.step }),
39153
+ item.owner || item.due ? /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("p", { className: "mt-1 text-xs text-muted-foreground", children: [
39154
+ item.owner ? `Owner: ${item.owner}` : "",
39155
+ item.owner && item.due ? " \u2022 " : "",
39156
+ item.due ? `Due: ${item.due}` : ""
39157
+ ] }) : null
39158
+ ] }, `${item.step}-${i}`)) }),
39159
+ /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
39160
+ "button",
39161
+ {
39162
+ type: "button",
39163
+ onClick: () => onAction?.({ type: "next_step_continue", stepsCount: safeSteps.length }),
39164
+ className: "mt-4 rounded-full border border-border px-4 py-2 text-sm text-foreground",
39165
+ children: ctaLabel
39166
+ }
39167
+ )
39168
+ ] });
39169
+ };
39116
39170
 
39117
39171
  // src/molecules/generic/PresentationJobCard/PresentationJobCard.tsx
39118
39172
  var import_react77 = require("react");
@@ -39170,8 +39224,8 @@ var FORMATS = [
39170
39224
  }
39171
39225
  ];
39172
39226
  var ExportModal = ({ formats, title, onClose }) => {
39173
- const available = FORMATS.filter((f) => formats[f.key]);
39174
- const filename = title.replace(/[^a-z0-9]/gi, "-").toLowerCase();
39227
+ const available = FORMATS.filter((f) => (formats ?? {})[f.key]);
39228
+ const filename = (title ?? "").replace(/[^a-z0-9]/gi, "-").toLowerCase();
39175
39229
  const [downloadingKey, setDownloadingKey] = (0, import_react77.useState)(null);
39176
39230
  const handleDownload = async (fmtKey, url, ext) => {
39177
39231
  if (downloadingKey) return;
@@ -40132,7 +40186,7 @@ var ResearchReportJobCard = (props) => {
40132
40186
  }
40133
40187
  const handleDownload = async () => {
40134
40188
  if (!htmlUrl) return;
40135
- const filename = `${title.replace(/[^a-z0-9]/gi, "-").toLowerCase()}.html`;
40189
+ const filename = `${(title ?? "").replace(/[^a-z0-9]/gi, "-").toLowerCase()}.html`;
40136
40190
  const href = `/api/download?url=${encodeURIComponent(htmlUrl)}&filename=${encodeURIComponent(filename)}`;
40137
40191
  try {
40138
40192
  const response = await fetch(href);
@@ -40480,6 +40534,7 @@ var WebSearchJobCard = ({
40480
40534
  ] })
40481
40535
  ] }) }) });
40482
40536
  }
40537
+ const safeResults = Array.isArray(results) ? results : [];
40483
40538
  const displayQuery = query || initialTitle || "Web Search";
40484
40539
  const statsText = [
40485
40540
  resultCount > 0 && `${resultCount} result${resultCount !== 1 ? "s" : ""}`,
@@ -40502,7 +40557,7 @@ var WebSearchJobCard = ({
40502
40557
  ] })
40503
40558
  ] }),
40504
40559
  summary && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("p", { className: "mt-3 text-xs text-zinc-400 leading-relaxed line-clamp-3", children: summary }),
40505
- !compact && results.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "mt-4 space-y-2", children: results.map((result, i) => /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
40560
+ !compact && safeResults.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "mt-4 space-y-2", children: safeResults.map((result, i) => /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
40506
40561
  "a",
40507
40562
  {
40508
40563
  href: result.url,
@@ -41869,6 +41924,7 @@ var PlatformIconGroup = ({
41869
41924
  platforms,
41870
41925
  className
41871
41926
  }) => {
41927
+ const safePlatforms = Array.isArray(platforms) ? platforms : [];
41872
41928
  const getIcon = (platform) => {
41873
41929
  switch (platform) {
41874
41930
  case "instagram":
@@ -41897,7 +41953,7 @@ var PlatformIconGroup = ({
41897
41953
  return "text-gray-500 bg-gray-50 border-gray-100";
41898
41954
  }
41899
41955
  };
41900
- return /* @__PURE__ */ (0, import_jsx_runtime154.jsx)("div", { className: cn("flex gap-2", className), children: platforms.map((p, i) => {
41956
+ return /* @__PURE__ */ (0, import_jsx_runtime154.jsx)("div", { className: cn("flex gap-2", className), children: safePlatforms.map((p, i) => {
41901
41957
  const Icon3 = getIcon(p.platform);
41902
41958
  if (!Icon3) return null;
41903
41959
  return /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
@@ -41941,7 +41997,7 @@ var CreatorProfileSummary = ({
41941
41997
  id: `avatar-${name}`,
41942
41998
  type: "avatar",
41943
41999
  src: avatarSrc,
41944
- fallback: name.charAt(0),
42000
+ fallback: (name ?? "").charAt(0),
41945
42001
  className: "w-12 h-12 ring-2 ring-purple-100"
41946
42002
  }
41947
42003
  ),
@@ -41959,11 +42015,11 @@ var CreatorProfileSummary = ({
41959
42015
  /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("div", { className: "flex gap-3 mt-1", children: [
41960
42016
  followerCount && /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("div", { className: "flex flex-col", children: [
41961
42017
  /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "text-[10px] uppercase tracking-wider text-muted-foreground font-bold", children: "Followers" }),
41962
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "text-xs font-semibold text-purple-700", children: followerCount })
42018
+ /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "text-xs font-semibold text-purple-700", children: String(followerCount ?? "") })
41963
42019
  ] }),
41964
42020
  engagementRate && /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("div", { className: "flex flex-col border-l border-purple-100 pl-3", children: [
41965
42021
  /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "text-[10px] uppercase tracking-wider text-muted-foreground font-bold", children: "Engagement" }),
41966
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "text-xs font-semibold text-indigo-600", children: engagementRate })
42022
+ /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "text-xs font-semibold text-indigo-600", children: String(engagementRate ?? "") })
41967
42023
  ] })
41968
42024
  ] })
41969
42025
  ] })
@@ -41979,6 +42035,7 @@ var AudienceMetricCard = ({
41979
42035
  metrics,
41980
42036
  className
41981
42037
  }) => {
42038
+ const safeMetrics = Array.isArray(metrics) ? metrics : [];
41982
42039
  return /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
41983
42040
  Card,
41984
42041
  {
@@ -41988,10 +42045,10 @@ var AudienceMetricCard = ({
41988
42045
  ),
41989
42046
  children: [
41990
42047
  /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(CardHeader, { className: "pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(CardTitle, { className: "text-lg font-bold text-gray-900", children: title }) }),
41991
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(CardContent, { className: "space-y-4", children: metrics.map((metric, i) => /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "space-y-1.5", children: [
42048
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(CardContent, { className: "space-y-4", children: safeMetrics.map((metric, i) => /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "space-y-1.5", children: [
41992
42049
  /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex justify-between items-center text-sm", children: [
41993
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("span", { className: "font-medium text-gray-700", children: metric.label }),
41994
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("span", { className: "font-bold text-gray-900", children: metric.value })
42050
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("span", { className: "font-medium text-gray-700", children: String(metric.label ?? "") }),
42051
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("span", { className: "font-bold text-gray-900", children: String(metric.value ?? "") })
41995
42052
  ] }),
41996
42053
  metric.percentage !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
41997
42054
  ProgressAtom,
@@ -42097,9 +42154,10 @@ var BrandAffinityGroup = ({
42097
42154
  brands,
42098
42155
  className
42099
42156
  }) => {
42157
+ const safeBrands = Array.isArray(brands) ? brands : [];
42100
42158
  return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: cn("flex flex-col gap-3", className), children: [
42101
42159
  /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("h5", { className: "text-[10px] font-bold uppercase tracking-widest text-muted-foreground", children: "Recent Collaborations" }),
42102
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "flex flex-wrap gap-4 items-center", children: brands.map((brand, i) => /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "group relative", children: [
42160
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "flex flex-wrap gap-4 items-center", children: safeBrands.map((brand, i) => /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "group relative", children: [
42103
42161
  /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "h-10 w-10 overflow-hidden rounded-xl bg-white border border-gray-100 p-1.5 flex items-center justify-center grayscale hover:grayscale-0 transition-all duration-300 hover:scale-110 shadow-sm hover:shadow-md", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
42104
42162
  "img",
42105
42163
  {
@@ -42108,7 +42166,7 @@ var BrandAffinityGroup = ({
42108
42166
  className: "max-h-full max-w-full object-contain"
42109
42167
  }
42110
42168
  ) }),
42111
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "absolute -bottom-6 left-1/2 -translate-x-1/2 px-2 py-0.5 bg-gray-900 text-white text-[10px] rounded opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap z-50 pointer-events-none", children: brand.name })
42169
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "absolute -bottom-6 left-1/2 -translate-x-1/2 px-2 py-0.5 bg-gray-900 text-white text-[10px] rounded opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap z-50 pointer-events-none", children: String(brand.name ?? "") })
42112
42170
  ] }, i)) })
42113
42171
  ] });
42114
42172
  };
@@ -42119,7 +42177,8 @@ var ContentPreviewGallery = ({
42119
42177
  items,
42120
42178
  className
42121
42179
  }) => {
42122
- return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: cn("grid grid-cols-2 gap-2", className), children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
42180
+ const safeItems = Array.isArray(items) ? items : [];
42181
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: cn("grid grid-cols-2 gap-2", className), children: safeItems.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
42123
42182
  "a",
42124
42183
  {
42125
42184
  href: item.url || "#",
@@ -42229,6 +42288,7 @@ var TopPostsGrid = ({
42229
42288
  posts,
42230
42289
  className
42231
42290
  }) => {
42291
+ const safePosts = Array.isArray(posts) ? posts : [];
42232
42292
  return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
42233
42293
  "div",
42234
42294
  {
@@ -42236,7 +42296,7 @@ var TopPostsGrid = ({
42236
42296
  "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
42237
42297
  className
42238
42298
  ),
42239
- children: posts.map((post, i) => /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
42299
+ children: safePosts.map((post, i) => /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
42240
42300
  "div",
42241
42301
  {
42242
42302
  className: "group relative aspect-square overflow-hidden rounded-2xl bg-gray-100 border border-purple-50",
@@ -42254,20 +42314,20 @@ var TopPostsGrid = ({
42254
42314
  /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("span", { className: "flex items-center gap-1", children: [
42255
42315
  /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(Heart, { className: "w-3 h-3 fill-white" }),
42256
42316
  " ",
42257
- post.likes
42317
+ String(post.likes ?? "")
42258
42318
  ] }),
42259
42319
  /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("span", { className: "flex items-center gap-1", children: [
42260
42320
  /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(MessageCircle, { className: "w-3 h-3 fill-white" }),
42261
42321
  " ",
42262
- post.comments
42322
+ String(post.comments ?? "")
42263
42323
  ] }),
42264
42324
  /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("span", { className: "flex items-center gap-1", children: [
42265
42325
  /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(ChartColumn, { className: "w-3 h-3" }),
42266
42326
  " ",
42267
- post.engagement
42327
+ String(post.engagement ?? "")
42268
42328
  ] })
42269
42329
  ] }),
42270
- /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("span", { className: "text-[10px] text-gray-300 mt-2", children: post.date })
42330
+ /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("span", { className: "text-[10px] text-gray-300 mt-2", children: String(post.date ?? "") })
42271
42331
  ] })
42272
42332
  ]
42273
42333
  },
@@ -42287,6 +42347,7 @@ var CreatorActionHeader = ({
42287
42347
  actions,
42288
42348
  className
42289
42349
  }) => {
42350
+ const safeActions = Array.isArray(actions) ? actions : [];
42290
42351
  return /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
42291
42352
  "div",
42292
42353
  {
@@ -42310,17 +42371,17 @@ var CreatorActionHeader = ({
42310
42371
  /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { className: "flex flex-col md:flex-row items-start md:items-end gap-6", children: [
42311
42372
  /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", { className: "p-2 bg-white rounded-[32px] shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(Avatar, { className: "h-32 w-32 rounded-[24px] border-4 border-white", children: [
42312
42373
  /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(AvatarImage, { src: avatarSrc, className: "rounded-[24px]" }),
42313
- /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(AvatarFallback, { className: "rounded-[24px] bg-purple-50 text-purple-600 text-3xl font-bold", children: name.charAt(0) })
42374
+ /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(AvatarFallback, { className: "rounded-[24px] bg-purple-50 text-purple-600 text-3xl font-bold", children: (name ?? "").charAt(0) })
42314
42375
  ] }) }),
42315
42376
  /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { className: "mb-2", children: [
42316
- /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("h1", { className: "text-3xl font-bold text-gray-900 tracking-tight", children: name }),
42377
+ /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("h1", { className: "text-3xl font-bold text-gray-900 tracking-tight", children: String(name ?? "") }),
42317
42378
  /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("p", { className: "text-purple-600 font-medium tracking-wide", children: [
42318
42379
  "@",
42319
- handle
42380
+ String(handle ?? "")
42320
42381
  ] })
42321
42382
  ] })
42322
42383
  ] }),
42323
- /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", { className: "flex items-center gap-3 mb-2", children: actions.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
42384
+ /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", { className: "flex items-center gap-3 mb-2", children: safeActions.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
42324
42385
  Button,
42325
42386
  {
42326
42387
  variant: action.variant || "default",
@@ -42328,7 +42389,7 @@ var CreatorActionHeader = ({
42328
42389
  "rounded-2xl px-6 h-11 font-bold transition-all",
42329
42390
  action.variant === "default" && "bg-purple-600 hover:bg-purple-700 shadow-md hover:shadow-purple-200"
42330
42391
  ),
42331
- children: action.label
42392
+ children: String(action.label ?? "")
42332
42393
  },
42333
42394
  i
42334
42395
  )) })
@@ -42363,7 +42424,7 @@ var CreatorSearch = import_react84.default.memo(
42363
42424
  {
42364
42425
  id: `platform-${p}`,
42365
42426
  type: "badge",
42366
- label: p,
42427
+ label: String(p ?? ""),
42367
42428
  variant: "outline",
42368
42429
  className: "bg-background bg-gray200 border-gray400 text-white font-medium"
42369
42430
  },
@@ -42960,6 +43021,7 @@ function CreatorCompactView({
42960
43021
  timeDisplay,
42961
43022
  isLoading
42962
43023
  }) {
43024
+ const safeVersions = Array.isArray(versions) ? versions : [];
42963
43025
  const isComplete = versionStatus === "completed" || versionStatus === "complete";
42964
43026
  const statusTitle = isComplete ? "Creator Search Complete" : versionStatus === "failed" ? "Creator Search Failed" : "Creator Search Processing";
42965
43027
  if (isLoading) {
@@ -42971,7 +43033,7 @@ function CreatorCompactView({
42971
43033
  /* @__PURE__ */ (0, import_jsx_runtime169.jsx)("h4", { className: "w-fit rounded-md bg-purple200 px-2 py-[4px] text-xs font-medium text-purpleText", children: "VERIFIED CREATORS LIST" }),
42972
43034
  /* @__PURE__ */ (0, import_jsx_runtime169.jsx)("h3", { className: "text-gray900 md:text-lg font-bold", children: statusTitle })
42973
43035
  ] }),
42974
- versions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime169.jsx)("div", { className: "relative md:self-start", children: /* @__PURE__ */ (0, import_jsx_runtime169.jsxs)(DropdownMenu, { children: [
43036
+ safeVersions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime169.jsx)("div", { className: "relative md:self-start", children: /* @__PURE__ */ (0, import_jsx_runtime169.jsxs)(DropdownMenu, { children: [
42975
43037
  /* @__PURE__ */ (0, import_jsx_runtime169.jsxs)(
42976
43038
  DropdownMenuTrigger,
42977
43039
  {
@@ -42984,7 +43046,7 @@ function CreatorCompactView({
42984
43046
  ]
42985
43047
  }
42986
43048
  ),
42987
- /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(DropdownMenuContent, { className: "bg-[var(--creator-dropdown-bg)] border-2 border-gray400 min-w-[120px] max-h-[150px] overflow-y-auto", children: versions.map((v) => /* @__PURE__ */ (0, import_jsx_runtime169.jsxs)(
43049
+ /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(DropdownMenuContent, { className: "bg-[var(--creator-dropdown-bg)] border-2 border-gray400 min-w-[120px] max-h-[150px] overflow-y-auto", children: safeVersions.map((v) => /* @__PURE__ */ (0, import_jsx_runtime169.jsxs)(
42988
43050
  DropdownMenuItem,
42989
43051
  {
42990
43052
  onClick: () => onVersionSelect(v),
@@ -43673,8 +43735,9 @@ function filterPostsByPlatform(posts, platform) {
43673
43735
  }
43674
43736
  function PlatformMetricsBanner({
43675
43737
  platform,
43676
- metrics
43738
+ metrics: metricsProp
43677
43739
  }) {
43740
+ const metrics = metricsProp ?? {};
43678
43741
  const platformName = getPlatformName(platform);
43679
43742
  const bgColor = getPlatformBgColor(platform);
43680
43743
  const IconComponent = getPlatformIcon(platform);
@@ -43704,7 +43767,7 @@ function PlatformMetricsBanner({
43704
43767
  ] }),
43705
43768
  /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("div", { className: "flex flex-col items-start md:min-w-0", children: [
43706
43769
  /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)("span", { className: "text-xs md:text-md font-semibold text-gray900", children: [
43707
- (metrics.engagementRate * 100).toFixed(2),
43770
+ ((metrics?.engagementRate ?? 0) * 100).toFixed(2),
43708
43771
  "%"
43709
43772
  ] }),
43710
43773
  /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("span", { className: "text-xs text-gray900 opacity-80", children: "Engagement Rate" })