@wealthx/shadcn 1.5.33 → 1.5.35

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.
@@ -72,7 +72,7 @@ __export(ai_conversations_exports, {
72
72
  });
73
73
  module.exports = __toCommonJS(ai_conversations_exports);
74
74
  var import_react5 = require("react");
75
- var import_lucide_react7 = require("lucide-react");
75
+ var import_lucide_react8 = require("lucide-react");
76
76
 
77
77
  // src/lib/utils.ts
78
78
  var import_clsx = require("clsx");
@@ -120,8 +120,8 @@ function getInitials(name) {
120
120
  // src/components/ui/avatar.tsx
121
121
  var import_avatar = require("@base-ui/react/avatar");
122
122
  var import_jsx_runtime = require("react/jsx-runtime");
123
- function Avatar(_a) {
124
- var _b = _a, {
123
+ function Avatar(_a2) {
124
+ var _b = _a2, {
125
125
  className,
126
126
  size = "default"
127
127
  } = _b, props = __objRest(_b, [
@@ -140,8 +140,8 @@ function Avatar(_a) {
140
140
  }, props)
141
141
  );
142
142
  }
143
- function AvatarFallback(_a) {
144
- var _b = _a, {
143
+ function AvatarFallback(_a2) {
144
+ var _b = _a2, {
145
145
  className
146
146
  } = _b, props = __objRest(_b, [
147
147
  "className"
@@ -175,8 +175,8 @@ function mergeRefs(...refs) {
175
175
  };
176
176
  }
177
177
  var Slot = React.forwardRef(
178
- (_a, forwardedRef) => {
179
- var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
178
+ (_a2, forwardedRef) => {
179
+ var _b = _a2, { children } = _b, props = __objRest(_b, ["children"]);
180
180
  const child = React.Children.only(children);
181
181
  if (!React.isValidElement(child)) return null;
182
182
  const childProps = child.props;
@@ -243,8 +243,8 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
243
243
  }
244
244
  }
245
245
  );
246
- var Button = (0, import_react.forwardRef)(function Button2(_a, ref) {
247
- var _b = _a, {
246
+ var Button = (0, import_react.forwardRef)(function Button2(_a2, ref) {
247
+ var _b = _a2, {
248
248
  className,
249
249
  variant,
250
250
  size,
@@ -298,16 +298,16 @@ function useThemeVars() {
298
298
 
299
299
  // src/components/ui/dialog.tsx
300
300
  var import_jsx_runtime4 = require("react/jsx-runtime");
301
- function Dialog(_a) {
302
- var props = __objRest(_a, []);
301
+ function Dialog(_a2) {
302
+ var props = __objRest(_a2, []);
303
303
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dialog.Dialog.Root, __spreadValues({ "data-slot": "dialog" }, props));
304
304
  }
305
- function DialogPortal(_a) {
306
- var props = __objRest(_a, []);
305
+ function DialogPortal(_a2) {
306
+ var props = __objRest(_a2, []);
307
307
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dialog.Dialog.Portal, __spreadValues({ "data-slot": "dialog-portal" }, props));
308
308
  }
309
- function DialogOverlay(_a) {
310
- var _b = _a, {
309
+ function DialogOverlay(_a2) {
310
+ var _b = _a2, {
311
311
  className
312
312
  } = _b, props = __objRest(_b, [
313
313
  "className"
@@ -335,8 +335,8 @@ var DIALOG_MAX_WIDTHS = {
335
335
  full: "100%"
336
336
  };
337
337
  var DIALOG_AUTO_MIN_WIDTH = "20rem";
338
- function DialogContent(_a) {
339
- var _b = _a, {
338
+ function DialogContent(_a2) {
339
+ var _b = _a2, {
340
340
  className,
341
341
  children,
342
342
  showCloseButton = true,
@@ -397,8 +397,8 @@ function DialogContent(_a) {
397
397
  )
398
398
  ] });
399
399
  }
400
- function DialogHeader(_a) {
401
- var _b = _a, {
400
+ function DialogHeader(_a2) {
401
+ var _b = _a2, {
402
402
  className
403
403
  } = _b, props = __objRest(_b, [
404
404
  "className"
@@ -411,8 +411,8 @@ function DialogHeader(_a) {
411
411
  }, props)
412
412
  );
413
413
  }
414
- function DialogFooter(_a) {
415
- var _b = _a, {
414
+ function DialogFooter(_a2) {
415
+ var _b = _a2, {
416
416
  className,
417
417
  showCloseButton = false,
418
418
  children
@@ -445,8 +445,8 @@ function DialogFooter(_a) {
445
445
  })
446
446
  );
447
447
  }
448
- function DialogTitle(_a) {
449
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
448
+ function DialogTitle(_a2) {
449
+ var _b = _a2, { className } = _b, props = __objRest(_b, ["className"]);
450
450
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
451
451
  import_dialog.Dialog.Title,
452
452
  __spreadValues({
@@ -455,8 +455,8 @@ function DialogTitle(_a) {
455
455
  }, props)
456
456
  );
457
457
  }
458
- function DialogDescription(_a) {
459
- var _b = _a, {
458
+ function DialogDescription(_a2) {
459
+ var _b = _a2, {
460
460
  className
461
461
  } = _b, props = __objRest(_b, [
462
462
  "className"
@@ -507,8 +507,8 @@ var ToggleGroupContext = React3.createContext({
507
507
  variant: "default",
508
508
  spacing: 0
509
509
  });
510
- function ToggleGroup(_a) {
511
- var _b = _a, {
510
+ function ToggleGroup(_a2) {
511
+ var _b = _a2, {
512
512
  className,
513
513
  variant,
514
514
  size,
@@ -542,8 +542,8 @@ function ToggleGroup(_a) {
542
542
  })
543
543
  );
544
544
  }
545
- function ToggleGroupItem(_a) {
546
- var _b = _a, {
545
+ function ToggleGroupItem(_a2) {
546
+ var _b = _a2, {
547
547
  className,
548
548
  children,
549
549
  variant,
@@ -581,8 +581,8 @@ function ToggleGroupItem(_a) {
581
581
  // src/components/ui/tooltip.tsx
582
582
  var import_tooltip = require("@base-ui/react/tooltip");
583
583
  var import_jsx_runtime7 = require("react/jsx-runtime");
584
- function TooltipProvider(_a) {
585
- var _b = _a, {
584
+ function TooltipProvider(_a2) {
585
+ var _b = _a2, {
586
586
  delay = 0
587
587
  } = _b, props = __objRest(_b, [
588
588
  "delay"
@@ -595,16 +595,16 @@ function TooltipProvider(_a) {
595
595
  }, props)
596
596
  );
597
597
  }
598
- function Tooltip(_a) {
599
- var props = __objRest(_a, []);
598
+ function Tooltip(_a2) {
599
+ var props = __objRest(_a2, []);
600
600
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_tooltip.Tooltip.Root, __spreadValues({ "data-slot": "tooltip" }, props));
601
601
  }
602
- function TooltipTrigger(_a) {
603
- var props = __objRest(_a, []);
602
+ function TooltipTrigger(_a2) {
603
+ var props = __objRest(_a2, []);
604
604
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_tooltip.Tooltip.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
605
605
  }
606
- function TooltipContent(_a) {
607
- var _b = _a, {
606
+ function TooltipContent(_a2) {
607
+ var _b = _a2, {
608
608
  className,
609
609
  sideOffset = 8,
610
610
  side,
@@ -663,8 +663,8 @@ var badgeVariants = (0, import_class_variance_authority3.cva)(
663
663
  }
664
664
  }
665
665
  );
666
- function Badge(_a) {
667
- var _b = _a, {
666
+ function Badge(_a2) {
667
+ var _b = _a2, {
668
668
  className,
669
669
  variant = "default",
670
670
  asChild = false
@@ -686,8 +686,8 @@ function Badge(_a) {
686
686
 
687
687
  // src/components/ui/input.tsx
688
688
  var import_jsx_runtime9 = require("react/jsx-runtime");
689
- function Input(_a) {
690
- var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
689
+ function Input(_a2) {
690
+ var _b = _a2, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
691
691
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
692
692
  "input",
693
693
  __spreadValues({
@@ -707,8 +707,8 @@ function Input(_a) {
707
707
  var import_class_variance_authority4 = require("class-variance-authority");
708
708
  var import_tabs = require("@base-ui/react/tabs");
709
709
  var import_jsx_runtime10 = require("react/jsx-runtime");
710
- function Tabs(_a) {
711
- var _b = _a, {
710
+ function Tabs(_a2) {
711
+ var _b = _a2, {
712
712
  className,
713
713
  orientation = "horizontal"
714
714
  } = _b, props = __objRest(_b, [
@@ -741,8 +741,8 @@ var tabsListVariants = (0, import_class_variance_authority4.cva)(
741
741
  }
742
742
  }
743
743
  );
744
- function TabsList(_a) {
745
- var _b = _a, {
744
+ function TabsList(_a2) {
745
+ var _b = _a2, {
746
746
  className,
747
747
  variant = "default"
748
748
  } = _b, props = __objRest(_b, [
@@ -758,8 +758,8 @@ function TabsList(_a) {
758
758
  }, props)
759
759
  );
760
760
  }
761
- function TabsTrigger(_a) {
762
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
761
+ function TabsTrigger(_a2) {
762
+ var _b = _a2, { className } = _b, props = __objRest(_b, ["className"]);
763
763
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
764
764
  import_tabs.Tabs.Tab,
765
765
  __spreadValues({
@@ -909,8 +909,8 @@ function ConversationListItem({
909
909
  function filterConversations(conversations, query, filter, channelFilter) {
910
910
  const q = query.toLowerCase();
911
911
  return conversations.filter((c) => {
912
- var _a, _b;
913
- const matchesFilter = filter === "all" || (filter === "emails" ? ((_a = c.channel) != null ? _a : "chat") === "email" : c.status === filter);
912
+ var _a2, _b;
913
+ const matchesFilter = filter === "all" || (filter === "emails" ? ((_a2 = c.channel) != null ? _a2 : "chat") === "email" : c.status === filter);
914
914
  const matchesChannel = channelFilter === "all" || ((_b = c.channel) != null ? _b : "chat") === channelFilter;
915
915
  const matchesSearch = !q || c.contact.name.toLowerCase().includes(q) || c.lastMessage.toLowerCase().includes(q);
916
916
  return matchesFilter && matchesChannel && matchesSearch;
@@ -1047,25 +1047,22 @@ var import_react4 = require("@tiptap/react");
1047
1047
  var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
1048
1048
  var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
1049
1049
  var import_extension_link = __toESM(require("@tiptap/extension-link"));
1050
- var import_react_markdown = __toESM(require("react-markdown"));
1051
- var import_rehype_raw = __toESM(require("rehype-raw"));
1052
- var import_rehype_sanitize = __toESM(require("rehype-sanitize"));
1053
- var import_lucide_react5 = require("lucide-react");
1050
+ var import_lucide_react6 = require("lucide-react");
1054
1051
 
1055
1052
  // src/components/ui/dropdown-menu.tsx
1056
1053
  var import_lucide_react4 = require("lucide-react");
1057
1054
  var import_menu = require("@base-ui/react/menu");
1058
1055
  var import_jsx_runtime13 = require("react/jsx-runtime");
1059
- function DropdownMenu(_a) {
1060
- var props = __objRest(_a, []);
1056
+ function DropdownMenu(_a2) {
1057
+ var props = __objRest(_a2, []);
1061
1058
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_menu.Menu.Root, __spreadValues({ "data-slot": "dropdown-menu" }, props));
1062
1059
  }
1063
- function DropdownMenuTrigger(_a) {
1064
- var props = __objRest(_a, []);
1060
+ function DropdownMenuTrigger(_a2) {
1061
+ var props = __objRest(_a2, []);
1065
1062
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_menu.Menu.Trigger, __spreadValues({ "data-slot": "dropdown-menu-trigger" }, props));
1066
1063
  }
1067
- function DropdownMenuContent(_a) {
1068
- var _b = _a, {
1064
+ function DropdownMenuContent(_a2) {
1065
+ var _b = _a2, {
1069
1066
  className,
1070
1067
  sideOffset = 4,
1071
1068
  style
@@ -1087,8 +1084,8 @@ function DropdownMenuContent(_a) {
1087
1084
  }, props)
1088
1085
  ) }) });
1089
1086
  }
1090
- function DropdownMenuItem(_a) {
1091
- var _b = _a, {
1087
+ function DropdownMenuItem(_a2) {
1088
+ var _b = _a2, {
1092
1089
  className,
1093
1090
  inset,
1094
1091
  variant = "default"
@@ -1110,8 +1107,8 @@ function DropdownMenuItem(_a) {
1110
1107
  }, props)
1111
1108
  );
1112
1109
  }
1113
- function DropdownMenuSeparator(_a) {
1114
- var _b = _a, {
1110
+ function DropdownMenuSeparator(_a2) {
1111
+ var _b = _a2, {
1115
1112
  className
1116
1113
  } = _b, props = __objRest(_b, [
1117
1114
  "className"
@@ -1130,16 +1127,16 @@ var React4 = __toESM(require("react"));
1130
1127
  var import_popover = require("@base-ui/react/popover");
1131
1128
  var import_jsx_runtime14 = require("react/jsx-runtime");
1132
1129
  var PopoverPortalContext = React4.createContext(void 0);
1133
- function Popover(_a) {
1134
- var props = __objRest(_a, []);
1130
+ function Popover(_a2) {
1131
+ var props = __objRest(_a2, []);
1135
1132
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_popover.Popover.Root, __spreadValues({ "data-slot": "popover" }, props));
1136
1133
  }
1137
- function PopoverTrigger(_a) {
1138
- var props = __objRest(_a, []);
1134
+ function PopoverTrigger(_a2) {
1135
+ var props = __objRest(_a2, []);
1139
1136
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_popover.Popover.Trigger, __spreadValues({ "data-slot": "popover-trigger" }, props));
1140
1137
  }
1141
- function PopoverContent(_a) {
1142
- var _b = _a, {
1138
+ function PopoverContent(_a2) {
1139
+ var _b = _a2, {
1143
1140
  className,
1144
1141
  align = "center",
1145
1142
  sideOffset = 4,
@@ -1176,8 +1173,8 @@ function PopoverContent(_a) {
1176
1173
  // src/components/ui/separator.tsx
1177
1174
  var import_separator = require("@base-ui/react/separator");
1178
1175
  var import_jsx_runtime15 = require("react/jsx-runtime");
1179
- function Separator(_a) {
1180
- var _b = _a, {
1176
+ function Separator(_a2) {
1177
+ var _b = _a2, {
1181
1178
  className,
1182
1179
  orientation = "horizontal"
1183
1180
  } = _b, props = __objRest(_b, [
@@ -1199,8 +1196,8 @@ function Separator(_a) {
1199
1196
 
1200
1197
  // src/components/ui/textarea.tsx
1201
1198
  var import_jsx_runtime16 = require("react/jsx-runtime");
1202
- function Textarea(_a) {
1203
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1199
+ function Textarea(_a2) {
1200
+ var _b = _a2, { className } = _b, props = __objRest(_b, ["className"]);
1204
1201
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1205
1202
  "textarea",
1206
1203
  __spreadValues({
@@ -1214,9 +1211,17 @@ function Textarea(_a) {
1214
1211
  );
1215
1212
  }
1216
1213
 
1217
- // src/components/ui/ai-conversations/thread.tsx
1214
+ // src/components/ui/ai-conversations/bubble.tsx
1215
+ var import_react_markdown = __toESM(require("react-markdown"));
1216
+ var import_rehype_raw = __toESM(require("rehype-raw"));
1217
+ var import_rehype_sanitize = __toESM(require("rehype-sanitize"));
1218
+ var import_lucide_react5 = require("lucide-react");
1218
1219
  var import_jsx_runtime17 = require("react/jsx-runtime");
1219
- function BubbleAvatar({
1220
+ var _a;
1221
+ var EMAIL_SANITIZE_SCHEMA = __spreadProps(__spreadValues({}, import_rehype_sanitize.defaultSchema), {
1222
+ strip: ["script", "style", "head", ...(_a = import_rehype_sanitize.defaultSchema.strip) != null ? _a : []]
1223
+ });
1224
+ function BubbleAvatar2({
1220
1225
  role,
1221
1226
  senderName
1222
1227
  }) {
@@ -1228,16 +1233,21 @@ function BubbleAvatar({
1228
1233
  }
1229
1234
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AvatarFallback, { children: getInitials(senderName != null ? senderName : "?") }) });
1230
1235
  }
1231
- function ChatBubble({ message, channel, className }) {
1232
- const { role, content, timestamp, senderName, subject } = message;
1233
- const isEmail = channel === "email";
1234
- if (role === "system") {
1235
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("my-2 flex items-center gap-3 px-2", className), children: [
1236
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { className: "flex-1" }),
1237
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "shrink-0 text-caption text-muted-foreground", children: content }),
1238
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { className: "flex-1" })
1239
- ] });
1240
- }
1236
+ function SystemDivider({
1237
+ content,
1238
+ className
1239
+ }) {
1240
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("my-2 flex items-center gap-3 px-2", className), children: [
1241
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { className: "flex-1" }),
1242
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "shrink-0 text-caption text-muted-foreground", children: content }),
1243
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { className: "flex-1" })
1244
+ ] });
1245
+ }
1246
+ function ChatMessageBubble({
1247
+ message,
1248
+ className
1249
+ }) {
1250
+ const { role, content, timestamp, senderName } = message;
1241
1251
  const isAdvisor = role === "advisor";
1242
1252
  const isBot = role === "bot";
1243
1253
  const isVisitor = role === "visitor";
@@ -1251,13 +1261,65 @@ function ChatBubble({ message, channel, className }) {
1251
1261
  className
1252
1262
  ),
1253
1263
  children: [
1254
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BubbleAvatar, { role, senderName }),
1264
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BubbleAvatar2, { role, senderName }),
1255
1265
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1256
1266
  "div",
1257
1267
  {
1258
1268
  className: cn(
1259
- "flex flex-col gap-1",
1260
- isEmail ? "max-w-[85%] w-full" : "max-w-[70%]",
1269
+ "flex max-w-[70%] flex-col gap-1",
1270
+ isAdvisor && "items-end"
1271
+ ),
1272
+ children: [
1273
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-caption text-muted-foreground", children: displayName }),
1274
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1275
+ "div",
1276
+ {
1277
+ className: cn(
1278
+ "break-words px-3 py-2 text-sm leading-relaxed [&_a]:underline [&_p]:m-0",
1279
+ isBot && "border border-border bg-muted/60 text-foreground [&_a]:text-primary",
1280
+ isVisitor && "border border-border bg-background text-foreground [&_a]:text-primary",
1281
+ isAdvisor && "bg-primary text-primary-foreground [&_a]:text-primary-foreground"
1282
+ ),
1283
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1284
+ import_react_markdown.default,
1285
+ {
1286
+ rehypePlugins: [import_rehype_raw.default, [import_rehype_sanitize.default, import_rehype_sanitize.defaultSchema]],
1287
+ children: content
1288
+ }
1289
+ )
1290
+ }
1291
+ ),
1292
+ timestamp && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-caption text-muted-foreground", children: timestamp })
1293
+ ]
1294
+ }
1295
+ )
1296
+ ]
1297
+ }
1298
+ );
1299
+ }
1300
+ function EmailMessageBubble({
1301
+ message,
1302
+ className
1303
+ }) {
1304
+ const { role, content, timestamp, senderName, subject } = message;
1305
+ const isAdvisor = role === "advisor";
1306
+ const isBot = role === "bot";
1307
+ const displayName = isBot ? "AI Assistant" : isAdvisor ? senderName != null ? senderName : "Advisor" : senderName != null ? senderName : "Lead";
1308
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1309
+ "div",
1310
+ {
1311
+ className: cn(
1312
+ "flex gap-2.5",
1313
+ isAdvisor ? "flex-row-reverse" : "flex-row",
1314
+ className
1315
+ ),
1316
+ children: [
1317
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BubbleAvatar2, { role, senderName }),
1318
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1319
+ "div",
1320
+ {
1321
+ className: cn(
1322
+ "flex w-full max-w-[85%] flex-col gap-1",
1261
1323
  isAdvisor && "items-end"
1262
1324
  ),
1263
1325
  children: [
@@ -1266,29 +1328,22 @@ function ChatBubble({ message, channel, className }) {
1266
1328
  "div",
1267
1329
  {
1268
1330
  className: cn(
1269
- "text-sm leading-relaxed break-words",
1270
- !isEmail && "px-3 py-2 [&_p]:m-0 [&_a]:underline",
1271
- isEmail && [
1272
- "border border-border bg-background px-4 py-3 w-full",
1273
- "[&_p]:mb-2 [&_p:last-child]:mb-0",
1274
- "[&_ul]:mb-2 [&_ul]:list-disc [&_ul]:pl-4",
1275
- "[&_ol]:mb-2 [&_ol]:list-decimal [&_ol]:pl-4",
1276
- "[&_li]:mb-0.5",
1277
- "[&_h1]:mb-2 [&_h1]:text-sm [&_h1]:font-bold",
1278
- "[&_h2]:mb-1.5 [&_h2]:text-sm [&_h2]:font-semibold",
1279
- "[&_h3]:mb-1 [&_h3]:text-sm [&_h3]:font-medium",
1280
- "[&_strong]:font-semibold [&_em]:italic",
1281
- "[&_a]:underline [&_a]:text-primary",
1282
- "[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground [&_blockquote]:italic",
1283
- "[&_hr]:my-3 [&_hr]:border-border"
1284
- ],
1285
- !isEmail && isBot && "border border-border bg-muted/60 text-foreground [&_a]:text-primary",
1286
- !isEmail && isVisitor && "border border-border bg-background text-foreground [&_a]:text-primary",
1287
- !isEmail && isAdvisor && "bg-primary text-primary-foreground [&_a]:text-primary-foreground",
1288
- isEmail && isAdvisor && "bg-muted/30"
1331
+ "w-full break-words border border-border bg-background px-4 py-3 text-sm leading-relaxed",
1332
+ "[&_p]:mb-2 [&_p:last-child]:mb-0",
1333
+ "[&_ul]:mb-2 [&_ul]:list-disc [&_ul]:pl-4",
1334
+ "[&_ol]:mb-2 [&_ol]:list-decimal [&_ol]:pl-4",
1335
+ "[&_li]:mb-0.5",
1336
+ "[&_h1]:mb-2 [&_h1]:text-sm [&_h1]:font-bold",
1337
+ "[&_h2]:mb-1.5 [&_h2]:text-sm [&_h2]:font-semibold",
1338
+ "[&_h3]:mb-1 [&_h3]:text-sm [&_h3]:font-medium",
1339
+ "[&_strong]:font-semibold [&_em]:italic",
1340
+ "[&_a]:text-primary [&_a]:underline",
1341
+ "[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:italic [&_blockquote]:text-muted-foreground",
1342
+ "[&_hr]:my-3 [&_hr]:border-border",
1343
+ isAdvisor && "bg-muted/30"
1289
1344
  ),
1290
1345
  children: [
1291
- isEmail && subject && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "mb-2.5 border-b border-border pb-2", children: [
1346
+ subject && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "mb-2.5 border-b border-border pb-2", children: [
1292
1347
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs font-medium text-muted-foreground", children: "Subject:" }),
1293
1348
  " ",
1294
1349
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-semibold text-foreground", children: subject })
@@ -1296,7 +1351,7 @@ function ChatBubble({ message, channel, className }) {
1296
1351
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1297
1352
  import_react_markdown.default,
1298
1353
  {
1299
- rehypePlugins: [import_rehype_raw.default, [import_rehype_sanitize.default, import_rehype_sanitize.defaultSchema]],
1354
+ rehypePlugins: [import_rehype_raw.default, [import_rehype_sanitize.default, EMAIL_SANITIZE_SCHEMA]],
1300
1355
  children: content
1301
1356
  }
1302
1357
  )
@@ -1311,13 +1366,25 @@ function ChatBubble({ message, channel, className }) {
1311
1366
  }
1312
1367
  );
1313
1368
  }
1369
+ function ChatBubble({ message, channel, className }) {
1370
+ if (message.role === "system") {
1371
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SystemDivider, { content: message.content, className });
1372
+ }
1373
+ if (channel === "email") {
1374
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(EmailMessageBubble, { message, className });
1375
+ }
1376
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChatMessageBubble, { message, className });
1377
+ }
1378
+
1379
+ // src/components/ui/ai-conversations/thread.tsx
1380
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1314
1381
  function ComposerToolbarButton({
1315
1382
  label,
1316
1383
  icon: Icon,
1317
1384
  pressed,
1318
1385
  onToggle
1319
1386
  }) {
1320
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1387
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1321
1388
  "button",
1322
1389
  {
1323
1390
  type: "button",
@@ -1328,7 +1395,7 @@ function ComposerToolbarButton({
1328
1395
  "flex size-7 items-center justify-center transition-colors",
1329
1396
  pressed ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted hover:text-foreground"
1330
1397
  ),
1331
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { className: "size-3.5" })
1398
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { className: "size-3.5" })
1332
1399
  }
1333
1400
  );
1334
1401
  }
@@ -1344,7 +1411,7 @@ function ComposerLinkPopover({
1344
1411
  setOpen(false);
1345
1412
  setUrl("");
1346
1413
  };
1347
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1414
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1348
1415
  Popover,
1349
1416
  {
1350
1417
  open,
@@ -1357,7 +1424,7 @@ function ComposerLinkPopover({
1357
1424
  setOpen(newOpen);
1358
1425
  },
1359
1426
  children: [
1360
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1427
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1361
1428
  PopoverTrigger,
1362
1429
  {
1363
1430
  "aria-label": "Insert link",
@@ -1365,11 +1432,11 @@ function ComposerLinkPopover({
1365
1432
  "flex size-7 items-center justify-center transition-colors",
1366
1433
  (editor == null ? void 0 : editor.isActive("link")) ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted hover:text-foreground"
1367
1434
  ),
1368
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Link2, { className: "size-3.5" })
1435
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Link2, { className: "size-3.5" })
1369
1436
  }
1370
1437
  ),
1371
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverContent, { className: "w-72 p-2", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-1.5", children: [
1372
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1438
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PopoverContent, { className: "w-72 p-2", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-1.5", children: [
1439
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1373
1440
  "input",
1374
1441
  {
1375
1442
  type: "url",
@@ -1381,7 +1448,7 @@ function ComposerLinkPopover({
1381
1448
  autoFocus: true
1382
1449
  }
1383
1450
  ),
1384
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { size: "sm", className: "h-8 px-3", onClick: handleApply, children: "Apply" })
1451
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { size: "sm", className: "h-8 px-3", onClick: handleApply, children: "Apply" })
1385
1452
  ] }) })
1386
1453
  ]
1387
1454
  }
@@ -1391,8 +1458,8 @@ function ComposerEmailFieldRow({
1391
1458
  label,
1392
1459
  children
1393
1460
  }) {
1394
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-3 border-b border-border px-4 py-2.5", children: [
1395
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w-14 shrink-0 text-sm text-muted-foreground", children: label }),
1461
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-3 border-b border-border px-4 py-2.5", children: [
1462
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w-14 shrink-0 text-sm text-muted-foreground", children: label }),
1396
1463
  children
1397
1464
  ] });
1398
1465
  }
@@ -1457,7 +1524,7 @@ function ChatComposer({
1457
1524
  setEmailSubject(emailReplySubject ? `Re: ${emailReplySubject}` : "");
1458
1525
  }
1459
1526
  };
1460
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1527
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1461
1528
  "div",
1462
1529
  {
1463
1530
  className: cn(
@@ -1465,27 +1532,27 @@ function ChatComposer({
1465
1532
  className
1466
1533
  ),
1467
1534
  children: [
1468
- isEmailIntegrated && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "border-b border-border px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1535
+ isEmailIntegrated && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "border-b border-border px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1469
1536
  Tabs,
1470
1537
  {
1471
1538
  value: channel,
1472
1539
  onValueChange: (v) => v && handleChannelChange(v),
1473
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TabsList, { variant: "default", className: "w-full", children: [
1474
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TabsTrigger, { value: "chat", className: "flex-1 gap-1.5", children: [
1475
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.MessageSquare, { className: "size-3.5" }),
1540
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(TabsList, { variant: "default", className: "w-full", children: [
1541
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(TabsTrigger, { value: "chat", className: "flex-1 gap-1.5", children: [
1542
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.MessageSquare, { className: "size-3.5" }),
1476
1543
  "Chat"
1477
1544
  ] }),
1478
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TabsTrigger, { value: "email", className: "flex-1 gap-1.5", children: [
1479
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Mail, { className: "size-3.5" }),
1545
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(TabsTrigger, { value: "email", className: "flex-1 gap-1.5", children: [
1546
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Mail, { className: "size-3.5" }),
1480
1547
  "Email"
1481
1548
  ] })
1482
1549
  ] })
1483
1550
  }
1484
1551
  ) }),
1485
- mode === "ai" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2 bg-muted/30 px-4 py-2.5 text-[12px] text-muted-foreground", children: [
1486
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "size-3.5 shrink-0 text-muted-foreground" }),
1487
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "AI is handling this conversation." }),
1488
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1552
+ mode === "ai" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2 bg-muted/30 px-4 py-2.5 text-[12px] text-muted-foreground", children: [
1553
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Bot, { className: "size-3.5 shrink-0 text-muted-foreground" }),
1554
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: "AI is handling this conversation." }),
1555
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1489
1556
  Button,
1490
1557
  {
1491
1558
  variant: "link",
@@ -1495,12 +1562,12 @@ function ChatComposer({
1495
1562
  children: "Take Over"
1496
1563
  }
1497
1564
  ),
1498
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "to reply directly." })
1565
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: "to reply directly." })
1499
1566
  ] }) : (
1500
1567
  /* Email panel stays in normal flow to anchor container height;
1501
1568
  chat panel is an absolute overlay so both tabs share identical dimensions */
1502
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative", children: [
1503
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1569
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "relative", children: [
1570
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1504
1571
  "div",
1505
1572
  {
1506
1573
  className: cn(
@@ -1509,8 +1576,8 @@ function ChatComposer({
1509
1576
  ),
1510
1577
  "aria-hidden": channel !== "email",
1511
1578
  children: [
1512
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(ComposerEmailFieldRow, { label: "To", children: [
1513
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1579
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(ComposerEmailFieldRow, { label: "To", children: [
1580
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1514
1581
  "input",
1515
1582
  {
1516
1583
  type: "email",
@@ -1520,7 +1587,7 @@ function ChatComposer({
1520
1587
  className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
1521
1588
  }
1522
1589
  ),
1523
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1590
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1524
1591
  "button",
1525
1592
  {
1526
1593
  type: "button",
@@ -1528,12 +1595,12 @@ function ChatComposer({
1528
1595
  className: "flex shrink-0 items-center gap-0.5 text-sm text-muted-foreground hover:text-foreground",
1529
1596
  children: [
1530
1597
  "CC",
1531
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ChevronDown, { className: "size-3.5" })
1598
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.ChevronDown, { className: "size-3.5" })
1532
1599
  ]
1533
1600
  }
1534
1601
  )
1535
1602
  ] }),
1536
- showCc && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerEmailFieldRow, { label: "CC", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1603
+ showCc && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ComposerEmailFieldRow, { label: "CC", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1537
1604
  "input",
1538
1605
  {
1539
1606
  type: "email",
@@ -1543,7 +1610,7 @@ function ChatComposer({
1543
1610
  className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
1544
1611
  }
1545
1612
  ) }),
1546
- emailMode !== "reply" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerEmailFieldRow, { label: "Subject", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1613
+ emailMode !== "reply" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ComposerEmailFieldRow, { label: "Subject", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1547
1614
  "input",
1548
1615
  {
1549
1616
  type: "text",
@@ -1553,11 +1620,11 @@ function ChatComposer({
1553
1620
  className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
1554
1621
  }
1555
1622
  ) }),
1556
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react4.EditorContent, { editor }),
1557
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
1558
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-0.5", children: [
1559
- emailReplySubject && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
1560
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1623
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react4.EditorContent, { editor }),
1624
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
1625
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-0.5", children: [
1626
+ emailReplySubject && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
1627
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1561
1628
  ToggleGroup,
1562
1629
  {
1563
1630
  type: "single",
@@ -1571,51 +1638,51 @@ function ChatComposer({
1571
1638
  },
1572
1639
  className: "mr-1.5",
1573
1640
  children: [
1574
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ToggleGroupItem, { value: "reply", children: "Reply" }),
1575
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ToggleGroupItem, { value: "new", children: "New email" })
1641
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ToggleGroupItem, { value: "reply", children: "Reply" }),
1642
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ToggleGroupItem, { value: "new", children: "New email" })
1576
1643
  ]
1577
1644
  }
1578
1645
  ),
1579
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { orientation: "vertical", className: "mr-1.5 h-4" })
1646
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Separator, { orientation: "vertical", className: "mr-1.5 h-4" })
1580
1647
  ] }),
1581
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1648
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1582
1649
  ComposerToolbarButton,
1583
1650
  {
1584
1651
  label: "Bold",
1585
- icon: import_lucide_react5.Bold,
1652
+ icon: import_lucide_react6.Bold,
1586
1653
  pressed: editor == null ? void 0 : editor.isActive("bold"),
1587
1654
  onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run()
1588
1655
  }
1589
1656
  ),
1590
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1657
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1591
1658
  ComposerToolbarButton,
1592
1659
  {
1593
1660
  label: "Italic",
1594
- icon: import_lucide_react5.Italic,
1661
+ icon: import_lucide_react6.Italic,
1595
1662
  pressed: editor == null ? void 0 : editor.isActive("italic"),
1596
1663
  onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run()
1597
1664
  }
1598
1665
  ),
1599
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1666
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1600
1667
  ComposerToolbarButton,
1601
1668
  {
1602
1669
  label: "Underline",
1603
- icon: import_lucide_react5.Underline,
1670
+ icon: import_lucide_react6.Underline,
1604
1671
  pressed: editor == null ? void 0 : editor.isActive("underline"),
1605
1672
  onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleUnderline().run()
1606
1673
  }
1607
1674
  ),
1608
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { orientation: "vertical", className: "mx-1.5 h-4" }),
1609
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerLinkPopover, { editor }),
1610
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerToolbarButton, { label: "Attach file", icon: import_lucide_react5.Paperclip })
1675
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Separator, { orientation: "vertical", className: "mx-1.5 h-4" }),
1676
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ComposerLinkPopover, { editor }),
1677
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ComposerToolbarButton, { label: "Attach file", icon: import_lucide_react6.Paperclip })
1611
1678
  ] }),
1612
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1679
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1613
1680
  Button,
1614
1681
  {
1615
1682
  size: "sm",
1616
1683
  onClick: () => {
1617
- var _a;
1618
- const html = (_a = editor == null ? void 0 : editor.getHTML()) != null ? _a : "";
1684
+ var _a2;
1685
+ const html = (_a2 = editor == null ? void 0 : editor.getHTML()) != null ? _a2 : "";
1619
1686
  onSendEmail == null ? void 0 : onSendEmail({
1620
1687
  content: html,
1621
1688
  to: emailTo,
@@ -1627,7 +1694,7 @@ function ChatComposer({
1627
1694
  },
1628
1695
  disabled: !editor || editor.isEmpty || !emailTo.trim(),
1629
1696
  children: [
1630
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Send, { className: "mr-1.5 size-3.5" }),
1697
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Send, { className: "mr-1.5 size-3.5" }),
1631
1698
  "Send Email"
1632
1699
  ]
1633
1700
  }
@@ -1636,8 +1703,8 @@ function ChatComposer({
1636
1703
  ]
1637
1704
  }
1638
1705
  ),
1639
- channel === "chat" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "absolute inset-0 flex flex-col gap-3 p-4", children: [
1640
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1706
+ channel === "chat" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "absolute inset-0 flex flex-col gap-3 p-4", children: [
1707
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1641
1708
  Textarea,
1642
1709
  {
1643
1710
  value: inputValue,
@@ -1646,12 +1713,12 @@ function ChatComposer({
1646
1713
  className: "min-h-0 flex-1 resize-none text-base"
1647
1714
  }
1648
1715
  ),
1649
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-between", children: [
1650
- initialChannelRef.current !== "email" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
1651
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "mr-1.5 size-3.5" }),
1716
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center justify-between", children: [
1717
+ initialChannelRef.current !== "email" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
1718
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Bot, { className: "mr-1.5 size-3.5" }),
1652
1719
  "Let AI Handle"
1653
1720
  ] }),
1654
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1721
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1655
1722
  Button,
1656
1723
  {
1657
1724
  size: "sm",
@@ -1659,7 +1726,7 @@ function ChatComposer({
1659
1726
  onClick: () => onSend == null ? void 0 : onSend(inputValue),
1660
1727
  disabled: !inputValue.trim(),
1661
1728
  children: [
1662
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Send, { className: "mr-1.5 size-3.5" }),
1729
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Send, { className: "mr-1.5 size-3.5" }),
1663
1730
  "Send"
1664
1731
  ]
1665
1732
  }
@@ -1716,13 +1783,13 @@ function ChatThread({
1716
1783
  const prevLastMessageIdRef = import_react3.default.useRef(void 0);
1717
1784
  const prevContactIdRef = import_react3.default.useRef(contact.id);
1718
1785
  import_react3.default.useLayoutEffect(() => {
1719
- var _a, _b;
1786
+ var _a2, _b;
1720
1787
  const el = scrollRef.current;
1721
1788
  if (!el) return;
1722
1789
  if (preLoadScrollHeightRef.current !== null) {
1723
1790
  el.scrollTop = el.scrollHeight - preLoadScrollHeightRef.current;
1724
1791
  preLoadScrollHeightRef.current = null;
1725
- prevLastMessageIdRef.current = (_a = messages[messages.length - 1]) == null ? void 0 : _a.id;
1792
+ prevLastMessageIdRef.current = (_a2 = messages[messages.length - 1]) == null ? void 0 : _a2.id;
1726
1793
  prevContactIdRef.current = contact.id;
1727
1794
  return;
1728
1795
  }
@@ -1740,8 +1807,8 @@ function ChatThread({
1740
1807
  const el = scrollRef.current;
1741
1808
  if (el) el.scrollTop = el.scrollHeight;
1742
1809
  }, [isAiTyping]);
1743
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("flex flex-col bg-background", className), children: [
1744
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1810
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: cn("flex flex-col bg-background", className), children: [
1811
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1745
1812
  "div",
1746
1813
  {
1747
1814
  className: cn(
@@ -1749,7 +1816,7 @@ function ChatThread({
1749
1816
  "flex items-center gap-3 border-b border-border px-4"
1750
1817
  ),
1751
1818
  children: [
1752
- onBack && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1819
+ onBack && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1753
1820
  Button,
1754
1821
  {
1755
1822
  variant: "ghost",
@@ -1757,28 +1824,28 @@ function ChatThread({
1757
1824
  className: "size-8 shrink-0 md:hidden",
1758
1825
  onClick: onBack,
1759
1826
  "aria-label": "Back to conversations",
1760
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ArrowLeft, { className: "size-4" })
1827
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.ArrowLeft, { className: "size-4" })
1761
1828
  }
1762
1829
  ),
1763
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ContactAvatar, { name: contact.name, size: "md" }),
1764
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "min-w-0 flex-1", children: [
1765
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2", children: [
1766
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
1767
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ConversationStatusChip, { status, showDot: true })
1830
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ContactAvatar, { name: contact.name, size: "md" }),
1831
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "min-w-0 flex-1", children: [
1832
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
1833
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
1834
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ConversationStatusChip, { status, showDot: true })
1768
1835
  ] }),
1769
- contact.email && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-sm text-muted-foreground", children: contact.email })
1836
+ contact.email && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground", children: contact.email })
1770
1837
  ] }),
1771
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex shrink-0 items-center gap-2", children: [
1772
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "hidden items-center gap-2 md:flex", children: [
1773
- isClosed && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { variant: "outline", size: "sm", onClick: onReopen, children: "Reopen" }),
1774
- !isClosed && aiIsHandling && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { size: "sm", onClick: onTakeOver, children: "Take Over" }),
1775
- !isClosed && !aiIsHandling && channel !== "email" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
1776
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "mr-1.5 size-3.5" }),
1838
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex shrink-0 items-center gap-2", children: [
1839
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "hidden items-center gap-2 md:flex", children: [
1840
+ isClosed && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { variant: "outline", size: "sm", onClick: onReopen, children: "Reopen" }),
1841
+ !isClosed && aiIsHandling && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { size: "sm", onClick: onTakeOver, children: "Take Over" }),
1842
+ !isClosed && !aiIsHandling && channel !== "email" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
1843
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Bot, { className: "mr-1.5 size-3.5" }),
1777
1844
  "Let AI Handle"
1778
1845
  ] })
1779
1846
  ] }),
1780
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenu, { children: [
1781
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1847
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenu, { children: [
1848
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1782
1849
  DropdownMenuTrigger,
1783
1850
  {
1784
1851
  className: cn(
@@ -1786,38 +1853,38 @@ function ChatThread({
1786
1853
  "size-8"
1787
1854
  ),
1788
1855
  "aria-label": "More actions",
1789
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.MoreHorizontal, { className: "size-4" })
1856
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.MoreHorizontal, { className: "size-4" })
1790
1857
  }
1791
1858
  ),
1792
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuContent, { children: [
1793
- onShowLeadInfo && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
1794
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1859
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuContent, { children: [
1860
+ onShowLeadInfo && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
1861
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1795
1862
  DropdownMenuItem,
1796
1863
  {
1797
1864
  className: "md:hidden",
1798
1865
  onClick: onShowLeadInfo,
1799
1866
  children: [
1800
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ChevronRight, { className: "mr-2 size-4" }),
1867
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.ChevronRight, { className: "mr-2 size-4" }),
1801
1868
  "Lead Info"
1802
1869
  ]
1803
1870
  }
1804
1871
  ),
1805
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuSeparator, { className: "md:hidden" })
1872
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuSeparator, { className: "md:hidden" })
1806
1873
  ] }),
1807
- status === "needs-attention" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onUnmarkUrgent, children: [
1808
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Flag, { className: "mr-2 size-4" }),
1874
+ status === "needs-attention" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuItem, { onClick: onUnmarkUrgent, children: [
1875
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Flag, { className: "mr-2 size-4" }),
1809
1876
  "Unmark Urgent"
1810
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onMarkUrgent, children: [
1811
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Flag, { className: "mr-2 size-4" }),
1877
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuItem, { onClick: onMarkUrgent, children: [
1878
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Flag, { className: "mr-2 size-4" }),
1812
1879
  "Mark as Urgent"
1813
1880
  ] }),
1814
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onAssignToAdvisor, children: [
1815
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.UserCheck, { className: "mr-2 size-4" }),
1881
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuItem, { onClick: onAssignToAdvisor, children: [
1882
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.UserCheck, { className: "mr-2 size-4" }),
1816
1883
  "Assign to advisor"
1817
1884
  ] }),
1818
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuSeparator, {}),
1819
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onArchive, children: [
1820
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Archive, { className: "mr-2 size-4" }),
1885
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuSeparator, {}),
1886
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuItem, { onClick: onArchive, children: [
1887
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Archive, { className: "mr-2 size-4" }),
1821
1888
  "Archive"
1822
1889
  ] })
1823
1890
  ] })
@@ -1826,7 +1893,7 @@ function ChatThread({
1826
1893
  ]
1827
1894
  }
1828
1895
  ),
1829
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1896
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1830
1897
  "div",
1831
1898
  {
1832
1899
  ref: scrollRef,
@@ -1834,29 +1901,29 @@ function ChatThread({
1834
1901
  className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4",
1835
1902
  tabIndex: 0,
1836
1903
  children: [
1837
- isLoadingMoreMessages && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex justify-center py-1 text-caption text-muted-foreground", children: "Loading older messages..." }),
1838
- messages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground", children: [
1839
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.MessageSquare, { className: "size-8 opacity-30" }),
1840
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-sm", children: "No messages yet" })
1841
- ] }) : messages.map((msg) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChatBubble, { message: msg, channel }, msg.id)),
1842
- isAiTyping && !isClosed && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex gap-2.5", children: [
1843
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BubbleAvatar, { role: "bot" }),
1844
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col gap-1", children: [
1845
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-caption text-muted-foreground", children: "AI Assistant" }),
1846
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-1 border border-border bg-muted/60 px-3 py-2.5", children: [
1847
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:0ms]" }),
1848
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:150ms]" }),
1849
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:300ms]" })
1904
+ isLoadingMoreMessages && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex justify-center py-1 text-caption text-muted-foreground", children: "Loading older messages..." }),
1905
+ messages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground", children: [
1906
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.MessageSquare, { className: "size-8 opacity-30" }),
1907
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm", children: "No messages yet" })
1908
+ ] }) : messages.map((msg) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChatBubble, { message: msg, channel }, msg.id)),
1909
+ isAiTyping && !isClosed && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex gap-2.5", children: [
1910
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(BubbleAvatar, { role: "bot" }),
1911
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-1", children: [
1912
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-caption text-muted-foreground", children: "AI Assistant" }),
1913
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-1 border border-border bg-muted/60 px-3 py-2.5", children: [
1914
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:0ms]" }),
1915
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:150ms]" }),
1916
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:300ms]" })
1850
1917
  ] })
1851
1918
  ] })
1852
1919
  ] })
1853
1920
  ]
1854
1921
  }
1855
1922
  ),
1856
- isClosed ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-3 border-t border-border bg-muted/30 px-4 py-3 text-sm text-muted-foreground", children: [
1857
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Lock, { className: "size-3.5 shrink-0" }),
1858
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "This conversation is closed." }),
1859
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1923
+ isClosed ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-3 border-t border-border bg-muted/30 px-4 py-3 text-sm text-muted-foreground", children: [
1924
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Lock, { className: "size-3.5 shrink-0" }),
1925
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: "This conversation is closed." }),
1926
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1860
1927
  Button,
1861
1928
  {
1862
1929
  variant: "outline",
@@ -1866,7 +1933,7 @@ function ChatThread({
1866
1933
  children: "Reopen"
1867
1934
  }
1868
1935
  )
1869
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1936
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1870
1937
  ChatComposer,
1871
1938
  {
1872
1939
  mode,
@@ -1887,21 +1954,21 @@ function ChatThread({
1887
1954
  }
1888
1955
 
1889
1956
  // src/components/ui/ai-conversations/lead-panel.tsx
1890
- var import_lucide_react6 = require("lucide-react");
1891
- var import_jsx_runtime18 = require("react/jsx-runtime");
1957
+ var import_lucide_react7 = require("lucide-react");
1958
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1892
1959
  function AICollectedDataSection({
1893
1960
  fields,
1894
1961
  className
1895
1962
  }) {
1896
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: cn("flex flex-col", className), children: fields.map((field, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1963
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn("flex flex-col", className), children: fields.map((field, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
1897
1964
  "div",
1898
1965
  {
1899
1966
  className: "flex items-center justify-between gap-2 border-b border-border/40 py-1.5 last:border-b-0",
1900
1967
  children: [
1901
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "shrink-0 text-sm text-muted-foreground", children: field.label }),
1902
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-1.5", children: [
1903
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-right text-sm font-medium text-foreground", children: field.value }),
1904
- field.confidence === "confirmed" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.CheckCircle2, { className: "size-3 shrink-0 text-success-text" }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.HelpCircle, { className: "size-3 shrink-0 text-warning-text" })
1968
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "shrink-0 text-sm text-muted-foreground", children: field.label }),
1969
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-1.5", children: [
1970
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-right text-sm font-medium text-foreground", children: field.value }),
1971
+ field.confidence === "confirmed" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.CheckCircle2, { className: "size-3 shrink-0 text-success-text" }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.HelpCircle, { className: "size-3 shrink-0 text-warning-text" })
1905
1972
  ] })
1906
1973
  ]
1907
1974
  },
@@ -1915,9 +1982,9 @@ var APPOINTMENT_STATUS_LABEL = {
1915
1982
  cancelled: "Cancelled"
1916
1983
  };
1917
1984
  var MEETING_ICON = {
1918
- video: import_lucide_react6.Video,
1919
- phone: import_lucide_react6.Phone,
1920
- "in-person": import_lucide_react6.MapPin
1985
+ video: import_lucide_react7.Video,
1986
+ phone: import_lucide_react7.Phone,
1987
+ "in-person": import_lucide_react7.MapPin
1921
1988
  };
1922
1989
  var MEETING_LABEL = {
1923
1990
  video: "Video Call",
@@ -1925,9 +1992,9 @@ var MEETING_LABEL = {
1925
1992
  "in-person": "In Person"
1926
1993
  };
1927
1994
  var MEETING_DETAIL_ICON = {
1928
- video: import_lucide_react6.Link2,
1929
- phone: import_lucide_react6.PhoneCall,
1930
- "in-person": import_lucide_react6.Navigation
1995
+ video: import_lucide_react7.Link2,
1996
+ phone: import_lucide_react7.PhoneCall,
1997
+ "in-person": import_lucide_react7.Navigation
1931
1998
  };
1932
1999
  function MeetingDetailRow({
1933
2000
  meetingType,
@@ -1935,9 +2002,9 @@ function MeetingDetailRow({
1935
2002
  }) {
1936
2003
  const DetailIcon = MEETING_DETAIL_ICON[meetingType];
1937
2004
  const isLink = detail.startsWith("http");
1938
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
1939
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DetailIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
1940
- isLink ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2005
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2", children: [
2006
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DetailIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
2007
+ isLink ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1941
2008
  "a",
1942
2009
  {
1943
2010
  href: detail,
@@ -1946,7 +2013,7 @@ function MeetingDetailRow({
1946
2013
  className: "text-sm text-primary underline underline-offset-2 break-all hover:text-primary/80",
1947
2014
  children: detail
1948
2015
  }
1949
- ) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm text-muted-foreground break-all", children: detail })
2016
+ ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm text-muted-foreground break-all", children: detail })
1950
2017
  ] });
1951
2018
  }
1952
2019
  function AppointmentSection({
@@ -1959,23 +2026,23 @@ function AppointmentSection({
1959
2026
  }) {
1960
2027
  const AppointmentIcon = MEETING_ICON[appointment.meetingType];
1961
2028
  const canReschedule = !isAnonymous && !!onRescheduleAppointment;
1962
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-2", children: [
1963
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
1964
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Calendar, { className: "size-3.5 shrink-0 text-muted-foreground" }),
1965
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-medium text-foreground", children: appointment.datetime })
2029
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col gap-2", children: [
2030
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2", children: [
2031
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.Calendar, { className: "size-3.5 shrink-0 text-muted-foreground" }),
2032
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm font-medium text-foreground", children: appointment.datetime })
1966
2033
  ] }),
1967
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
1968
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AppointmentIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
1969
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm text-muted-foreground", children: MEETING_LABEL[appointment.meetingType] })
2034
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2", children: [
2035
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AppointmentIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
2036
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm text-muted-foreground", children: MEETING_LABEL[appointment.meetingType] })
1970
2037
  ] }),
1971
- appointment.meetingDetail && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2038
+ appointment.meetingDetail && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1972
2039
  MeetingDetailRow,
1973
2040
  {
1974
2041
  meetingType: appointment.meetingType,
1975
2042
  detail: appointment.meetingDetail
1976
2043
  }
1977
2044
  ),
1978
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2045
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1979
2046
  "span",
1980
2047
  {
1981
2048
  className: cn("text-sm font-medium", {
@@ -1987,9 +2054,9 @@ function AppointmentSection({
1987
2054
  children: APPOINTMENT_STATUS_LABEL[appointment.status]
1988
2055
  }
1989
2056
  ),
1990
- appointment.status === "requested" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex gap-2 pt-1", children: [
1991
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { size: "sm", className: "flex-1", onClick: onApproveAppointment, children: "Approve" }),
1992
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2057
+ appointment.status === "requested" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex gap-2 pt-1", children: [
2058
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { size: "sm", className: "flex-1", onClick: onApproveAppointment, children: "Approve" }),
2059
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1993
2060
  Button,
1994
2061
  {
1995
2062
  variant: "outline",
@@ -1999,7 +2066,7 @@ function AppointmentSection({
1999
2066
  children: "Decline"
2000
2067
  }
2001
2068
  ),
2002
- canReschedule && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2069
+ canReschedule && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2003
2070
  Button,
2004
2071
  {
2005
2072
  variant: "ghost",
@@ -2010,7 +2077,7 @@ function AppointmentSection({
2010
2077
  }
2011
2078
  )
2012
2079
  ] }),
2013
- (appointment.status === "confirmed" || appointment.status === "cancelled") && canReschedule && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2080
+ (appointment.status === "confirmed" || appointment.status === "cancelled") && canReschedule && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2014
2081
  Button,
2015
2082
  {
2016
2083
  variant: "outline",
@@ -2023,13 +2090,13 @@ function AppointmentSection({
2023
2090
  ] });
2024
2091
  }
2025
2092
  function PanelSectionHeader({ children }) {
2026
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mb-2.5 text-overline text-muted-foreground", children });
2093
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "mb-2.5 text-overline text-muted-foreground", children });
2027
2094
  }
2028
2095
  function PanelSection({
2029
2096
  children,
2030
2097
  last = false
2031
2098
  }) {
2032
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: cn("px-4 py-4", !last && "border-b border-border"), children });
2099
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn("px-4 py-4", !last && "border-b border-border"), children });
2033
2100
  }
2034
2101
  function LeadInfoPanel({
2035
2102
  contact,
@@ -2055,8 +2122,8 @@ function LeadInfoPanel({
2055
2122
  }) {
2056
2123
  const isAnonymous = !contact.name.trim();
2057
2124
  const addToContactsDisabled = isAnonymous || isKnownContact;
2058
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: cn("flex flex-col bg-background", className), children: [
2059
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2125
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cn("flex flex-col bg-background", className), children: [
2126
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2060
2127
  "div",
2061
2128
  {
2062
2129
  className: cn(
@@ -2064,7 +2131,7 @@ function LeadInfoPanel({
2064
2131
  "flex items-center justify-between border-b border-border px-4"
2065
2132
  ),
2066
2133
  children: [
2067
- onBack && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2134
+ onBack && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2068
2135
  Button,
2069
2136
  {
2070
2137
  variant: "ghost",
@@ -2072,15 +2139,15 @@ function LeadInfoPanel({
2072
2139
  className: "size-8 shrink-0 md:hidden",
2073
2140
  onClick: onBack,
2074
2141
  "aria-label": "Back to conversation",
2075
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.ArrowLeft, { className: "size-4" })
2142
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.ArrowLeft, { className: "size-4" })
2076
2143
  }
2077
2144
  ),
2078
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-semibold text-foreground", children: "Lead Info" }),
2079
- onToggleCollapse && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
2080
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2145
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm font-semibold text-foreground", children: "Lead Info" }),
2146
+ onToggleCollapse && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Tooltip, { children: [
2147
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2081
2148
  TooltipTrigger,
2082
2149
  {
2083
- render: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2150
+ render: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2084
2151
  Button,
2085
2152
  {
2086
2153
  variant: "ghost",
@@ -2088,8 +2155,8 @@ function LeadInfoPanel({
2088
2155
  className: "size-7",
2089
2156
  onClick: onToggleCollapse,
2090
2157
  "aria-label": isCollapsed ? "Expand panel" : "Collapse panel",
2091
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2092
- import_lucide_react6.ChevronRight,
2158
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2159
+ import_lucide_react7.ChevronRight,
2093
2160
  {
2094
2161
  className: cn(
2095
2162
  "size-4 transition-transform duration-150",
@@ -2101,26 +2168,26 @@ function LeadInfoPanel({
2101
2168
  )
2102
2169
  }
2103
2170
  ),
2104
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { children: isCollapsed ? "Expand panel" : "Collapse panel" })
2171
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TooltipContent, { children: isCollapsed ? "Expand panel" : "Collapse panel" })
2105
2172
  ] })
2106
2173
  ]
2107
2174
  }
2108
2175
  ),
2109
- !isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: [
2110
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
2111
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "Contact" }),
2112
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-3", children: [
2113
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ContactAvatar, { name: contact.name, size: "lg" }),
2114
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "min-w-0 flex-1", children: [
2115
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
2116
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground", children: source }),
2117
- topic && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Badge, { variant: "secondary", className: "mt-1 text-xs", children: topic })
2176
+ !isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: [
2177
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(PanelSection, { children: [
2178
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PanelSectionHeader, { children: "Contact" }),
2179
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-3", children: [
2180
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContactAvatar, { name: contact.name, size: "lg" }),
2181
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "min-w-0 flex-1", children: [
2182
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
2183
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-muted-foreground", children: source }),
2184
+ topic && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Badge, { variant: "secondary", className: "mt-1 text-xs", children: topic })
2118
2185
  ] })
2119
2186
  ] }),
2120
- (contact.email || contact.phone || firstSeen) && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mt-3 flex flex-col gap-1.5", children: [
2121
- contact.email && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
2122
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Mail, { className: "size-4 shrink-0" }),
2123
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2187
+ (contact.email || contact.phone || firstSeen) && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "mt-3 flex flex-col gap-1.5", children: [
2188
+ contact.email && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
2189
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.Mail, { className: "size-4 shrink-0" }),
2190
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2124
2191
  "a",
2125
2192
  {
2126
2193
  href: `mailto:${contact.email}`,
@@ -2129,9 +2196,9 @@ function LeadInfoPanel({
2129
2196
  }
2130
2197
  )
2131
2198
  ] }),
2132
- contact.phone && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
2133
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.PhoneCall, { className: "size-4 shrink-0" }),
2134
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2199
+ contact.phone && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
2200
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.PhoneCall, { className: "size-4 shrink-0" }),
2201
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2135
2202
  "a",
2136
2203
  {
2137
2204
  href: `tel:${contact.phone}`,
@@ -2140,31 +2207,31 @@ function LeadInfoPanel({
2140
2207
  }
2141
2208
  )
2142
2209
  ] }),
2143
- firstSeen && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { className: "text-sm text-muted-foreground", children: [
2210
+ firstSeen && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { className: "text-sm text-muted-foreground", children: [
2144
2211
  "First seen: ",
2145
2212
  firstSeen
2146
2213
  ] })
2147
2214
  ] })
2148
2215
  ] }),
2149
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
2150
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "AI-Collected Data" }),
2151
- aiFields.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
2152
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AICollectedDataSection, { fields: aiFields }),
2153
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mt-2.5 flex items-center gap-3 text-xs text-muted-foreground", children: [
2154
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-1", children: [
2155
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.CheckCircle2, { className: "size-3 text-success-text" }),
2216
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(PanelSection, { children: [
2217
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PanelSectionHeader, { children: "AI-Collected Data" }),
2218
+ aiFields.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
2219
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AICollectedDataSection, { fields: aiFields }),
2220
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "mt-2.5 flex items-center gap-3 text-xs text-muted-foreground", children: [
2221
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "flex items-center gap-1", children: [
2222
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.CheckCircle2, { className: "size-3 text-success-text" }),
2156
2223
  "confirmed"
2157
2224
  ] }),
2158
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-1", children: [
2159
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.HelpCircle, { className: "size-3 text-warning-text" }),
2225
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "flex items-center gap-1", children: [
2226
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.HelpCircle, { className: "size-3 text-warning-text" }),
2160
2227
  "estimated"
2161
2228
  ] })
2162
2229
  ] })
2163
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground", children: "AI is still gathering information..." })
2230
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-muted-foreground", children: "AI is still gathering information..." })
2164
2231
  ] }),
2165
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
2166
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "Appointment" }),
2167
- appointment ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2232
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(PanelSection, { children: [
2233
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PanelSectionHeader, { children: "Appointment" }),
2234
+ appointment ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2168
2235
  AppointmentSection,
2169
2236
  {
2170
2237
  appointment,
@@ -2174,7 +2241,7 @@ function LeadInfoPanel({
2174
2241
  onDeclineAppointment,
2175
2242
  onRescheduleAppointment
2176
2243
  }
2177
- ) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2244
+ ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2178
2245
  Button,
2179
2246
  {
2180
2247
  variant: "outline",
@@ -2183,20 +2250,20 @@ function LeadInfoPanel({
2183
2250
  disabled: isAnonymous,
2184
2251
  onClick: onBookAppointment,
2185
2252
  children: [
2186
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Plus, { className: "mr-1.5 size-3.5" }),
2253
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.Plus, { className: "mr-1.5 size-3.5" }),
2187
2254
  "Book Appointment"
2188
2255
  ]
2189
2256
  }
2190
2257
  )
2191
2258
  ] }),
2192
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
2193
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "CRM Actions" }),
2194
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-2", children: [
2195
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
2196
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2259
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(PanelSection, { children: [
2260
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PanelSectionHeader, { children: "CRM Actions" }),
2261
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col gap-2", children: [
2262
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Tooltip, { children: [
2263
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2197
2264
  TooltipTrigger,
2198
2265
  {
2199
- render: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2266
+ render: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2200
2267
  Button,
2201
2268
  {
2202
2269
  variant: "outline",
@@ -2205,16 +2272,16 @@ function LeadInfoPanel({
2205
2272
  disabled: addToContactsDisabled,
2206
2273
  onClick: onAddToContacts,
2207
2274
  children: [
2208
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.UserPlus, { className: "mr-1.5 size-3.5" }),
2275
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.UserPlus, { className: "mr-1.5 size-3.5" }),
2209
2276
  "Add to Contacts"
2210
2277
  ]
2211
2278
  }
2212
2279
  )
2213
2280
  }
2214
2281
  ),
2215
- isKnownContact && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { children: "Already in contacts" })
2282
+ isKnownContact && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TooltipContent, { children: "Already in contacts" })
2216
2283
  ] }),
2217
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2284
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2218
2285
  Button,
2219
2286
  {
2220
2287
  variant: "outline",
@@ -2223,23 +2290,23 @@ function LeadInfoPanel({
2223
2290
  disabled: isAnonymous,
2224
2291
  onClick: onCreateOpportunity,
2225
2292
  children: [
2226
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Briefcase, { className: "mr-1.5 size-3.5" }),
2293
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.Briefcase, { className: "mr-1.5 size-3.5" }),
2227
2294
  "Add to CRM"
2228
2295
  ]
2229
2296
  }
2230
2297
  )
2231
2298
  ] })
2232
2299
  ] }),
2233
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { last: true, children: [
2234
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mb-2.5 flex items-center justify-between", children: [
2235
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-overline text-muted-foreground", children: "Internal Notes" }),
2236
- notesSaveStatus === "saving" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs text-muted-foreground", children: "Saving..." }),
2237
- notesSaveStatus === "saved" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-1 text-xs text-success-text", children: [
2238
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.CheckCircle2, { className: "size-3" }),
2300
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(PanelSection, { last: true, children: [
2301
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "mb-2.5 flex items-center justify-between", children: [
2302
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-overline text-muted-foreground", children: "Internal Notes" }),
2303
+ notesSaveStatus === "saving" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-xs text-muted-foreground", children: "Saving..." }),
2304
+ notesSaveStatus === "saved" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "flex items-center gap-1 text-xs text-success-text", children: [
2305
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.CheckCircle2, { className: "size-3" }),
2239
2306
  "Saved"
2240
2307
  ] })
2241
2308
  ] }),
2242
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2309
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2243
2310
  Textarea,
2244
2311
  {
2245
2312
  value: internalNotes,
@@ -2255,7 +2322,7 @@ function LeadInfoPanel({
2255
2322
  }
2256
2323
 
2257
2324
  // src/components/ui/ai-conversations/index.tsx
2258
- var import_jsx_runtime19 = require("react/jsx-runtime");
2325
+ var import_jsx_runtime20 = require("react/jsx-runtime");
2259
2326
  function ConversationsPage({
2260
2327
  conversations,
2261
2328
  activeConversationId,
@@ -2323,12 +2390,12 @@ function ConversationsPage({
2323
2390
  onToggleLeadPanel == null ? void 0 : onToggleLeadPanel();
2324
2391
  setMobilePanel(showLeadPanel ? "chat" : "lead");
2325
2392
  };
2326
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2393
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2327
2394
  "div",
2328
2395
  {
2329
2396
  className: cn("flex h-full overflow-hidden bg-background", className),
2330
2397
  children: [
2331
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2398
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2332
2399
  ConversationList,
2333
2400
  {
2334
2401
  conversations,
@@ -2350,7 +2417,7 @@ function ConversationsPage({
2350
2417
  )
2351
2418
  }
2352
2419
  ),
2353
- contact ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2420
+ contact ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2354
2421
  ChatThread,
2355
2422
  {
2356
2423
  contact,
@@ -2384,21 +2451,21 @@ function ConversationsPage({
2384
2451
  )
2385
2452
  },
2386
2453
  contact.id
2387
- ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2454
+ ) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2388
2455
  "div",
2389
2456
  {
2390
2457
  className: cn(
2391
2458
  "min-w-0 flex-1 items-center justify-center border-r border-border bg-muted/10",
2392
2459
  mobilePanel === "chat" ? "flex md:flex" : "hidden md:flex"
2393
2460
  ),
2394
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
2395
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.MessageSquare, { className: "size-10 opacity-30" }),
2396
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm", children: "Select a conversation" })
2461
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
2462
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.MessageSquare, { className: "size-10 opacity-30" }),
2463
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm", children: "Select a conversation" })
2397
2464
  ] })
2398
2465
  }
2399
2466
  ),
2400
- contact && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
2401
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2467
+ contact && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
2468
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2402
2469
  "div",
2403
2470
  {
2404
2471
  className: cn(
@@ -2406,7 +2473,7 @@ function ConversationsPage({
2406
2473
  "md:block md:shrink-0 md:overflow-hidden md:transition-[width] md:duration-200 md:ease-in-out",
2407
2474
  showLeadPanel ? "md:w-[320px]" : "md:w-0"
2408
2475
  ),
2409
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2476
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2410
2477
  LeadInfoPanel,
2411
2478
  {
2412
2479
  contact,
@@ -2432,11 +2499,11 @@ function ConversationsPage({
2432
2499
  )
2433
2500
  }
2434
2501
  ),
2435
- !showLeadPanel && onToggleLeadPanel && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "hidden shrink-0 items-start border-l border-border pt-[29px] md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Tooltip, { children: [
2436
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2502
+ !showLeadPanel && onToggleLeadPanel && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "hidden shrink-0 items-start border-l border-border pt-[29px] md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Tooltip, { children: [
2503
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2437
2504
  TooltipTrigger,
2438
2505
  {
2439
- render: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2506
+ render: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2440
2507
  Button,
2441
2508
  {
2442
2509
  variant: "ghost",
@@ -2444,12 +2511,12 @@ function ConversationsPage({
2444
2511
  className: "size-8",
2445
2512
  "aria-label": "Show lead info",
2446
2513
  onClick: handleToggleLeadPanel,
2447
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.ChevronLeft, { className: "size-4" })
2514
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.ChevronLeft, { className: "size-4" })
2448
2515
  }
2449
2516
  )
2450
2517
  }
2451
2518
  ),
2452
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TooltipContent, { children: "Show lead info" })
2519
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipContent, { children: "Show lead info" })
2453
2520
  ] }) })
2454
2521
  ] })
2455
2522
  ]
@@ -2479,13 +2546,13 @@ function AiConvAssignAdvisorDialog({
2479
2546
  setRoleFilter("");
2480
2547
  }
2481
2548
  };
2482
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogContent, { children: [
2483
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogHeader, { children: [
2484
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DialogTitle, { children: "Assign to advisor" }),
2485
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DialogDescription, { children: "Choose an advisor to handle this conversation." })
2549
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogContent, { children: [
2550
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogHeader, { children: [
2551
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogTitle, { children: "Assign to advisor" }),
2552
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogDescription, { children: "Choose an advisor to handle this conversation." })
2486
2553
  ] }),
2487
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col gap-0", children: [
2488
- roles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pb-3", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2554
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-0", children: [
2555
+ roles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "pb-3", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2489
2556
  ToggleGroup,
2490
2557
  {
2491
2558
  type: "single",
@@ -2498,14 +2565,14 @@ function AiConvAssignAdvisorDialog({
2498
2565
  setRoleFilter(!v || v === "__all__" ? "" : v);
2499
2566
  },
2500
2567
  children: [
2501
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ToggleGroupItem, { value: "__all__", children: "All" }),
2502
- roles.map((role) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ToggleGroupItem, { value: role, children: role }, role))
2568
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ToggleGroupItem, { value: "__all__", children: "All" }),
2569
+ roles.map((role) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ToggleGroupItem, { value: role, children: role }, role))
2503
2570
  ]
2504
2571
  }
2505
2572
  ) }),
2506
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2 border border-input px-3", children: [
2507
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.Search, { className: "size-4 shrink-0 text-muted-foreground" }),
2508
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2573
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2 border border-input px-3", children: [
2574
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.Search, { className: "size-4 shrink-0 text-muted-foreground" }),
2575
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2509
2576
  "input",
2510
2577
  {
2511
2578
  type: "text",
@@ -2516,7 +2583,7 @@ function AiConvAssignAdvisorDialog({
2516
2583
  }
2517
2584
  )
2518
2585
  ] }),
2519
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "max-h-52 overflow-y-auto border border-t-0 border-input", children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "No advisors found." }) : filtered.map((advisor) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2586
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "max-h-52 overflow-y-auto border border-t-0 border-input", children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "No advisors found." }) : filtered.map((advisor) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2520
2587
  "button",
2521
2588
  {
2522
2589
  type: "button",
@@ -2526,19 +2593,19 @@ function AiConvAssignAdvisorDialog({
2526
2593
  value === advisor.id && "bg-muted font-medium"
2527
2594
  ),
2528
2595
  children: [
2529
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Avatar, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AvatarFallback, { className: "font-semibold", children: advisor.initials }) }),
2530
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "min-w-0 flex-1", children: [
2531
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate text-sm", children: advisor.name }),
2532
- advisor.role && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate text-xs text-muted-foreground", children: advisor.role })
2596
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Avatar, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AvatarFallback, { className: "font-semibold", children: advisor.initials }) }),
2597
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "min-w-0 flex-1", children: [
2598
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "truncate text-sm", children: advisor.name }),
2599
+ advisor.role && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "truncate text-xs text-muted-foreground", children: advisor.role })
2533
2600
  ] })
2534
2601
  ]
2535
2602
  },
2536
2603
  advisor.id
2537
2604
  )) })
2538
2605
  ] }),
2539
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogFooter, { children: [
2540
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
2541
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { onClick: onConfirm, children: "Assign" })
2606
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogFooter, { children: [
2607
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
2608
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button, { onClick: onConfirm, children: "Assign" })
2542
2609
  ] })
2543
2610
  ] }) });
2544
2611
  }