@wealthx/shadcn 1.5.24 → 1.5.25

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.
Files changed (72) hide show
  1. package/.turbo/turbo-build.log +144 -144
  2. package/CHANGELOG.md +6 -0
  3. package/dist/{chunk-RYGZRDP6.mjs → chunk-4FJC64FV.mjs} +468 -410
  4. package/dist/{chunk-FGHM34AV.mjs → chunk-7JVKSZ4O.mjs} +1 -1
  5. package/dist/{chunk-6HTE24TP.mjs → chunk-EY5YPFKX.mjs} +1 -1
  6. package/dist/{chunk-3HFOSFOM.mjs → chunk-IG7DEIWU.mjs} +4 -4
  7. package/dist/{chunk-2VTOF7PW.mjs → chunk-K2KX3NX7.mjs} +1 -1
  8. package/dist/{chunk-NXZ2F4JA.mjs → chunk-KGBLORCQ.mjs} +1 -1
  9. package/dist/{chunk-2SDEURIQ.mjs → chunk-PX2B3Q3A.mjs} +7 -7
  10. package/dist/{chunk-66NM4AX2.mjs → chunk-QM7LU2BR.mjs} +10 -10
  11. package/dist/{chunk-4UCRTTVL.mjs → chunk-RNLIZRAK.mjs} +1 -1
  12. package/dist/{chunk-BWG7AX6X.mjs → chunk-SQ54W3JH.mjs} +1 -1
  13. package/dist/{chunk-RJHE3V4M.mjs → chunk-UMR3HVZF.mjs} +4 -4
  14. package/dist/{chunk-JGUC3KCA.mjs → chunk-VNB5E7SI.mjs} +5 -5
  15. package/dist/{chunk-ETT5JAXF.mjs → chunk-Z5QI7CW2.mjs} +1 -1
  16. package/dist/components/ui/about-you-form.mjs +4 -4
  17. package/dist/components/ui/ai-assistant-drawer.mjs +2 -2
  18. package/dist/components/ui/{ai-conversations.js → ai-conversations/index.js} +818 -763
  19. package/dist/components/ui/ai-conversations/index.mjs +42 -0
  20. package/dist/components/ui/appointment-action-dialogs.mjs +1 -1
  21. package/dist/components/ui/appointment-availability-settings.mjs +5 -5
  22. package/dist/components/ui/appointment-book-dialog.mjs +4 -4
  23. package/dist/components/ui/appointment-detail-sheet.mjs +3 -3
  24. package/dist/components/ui/appointment-upcoming-card.mjs +1 -1
  25. package/dist/components/ui/assets-liabilities-side-card.mjs +6 -6
  26. package/dist/components/ui/backoffice-signup-steps.mjs +4 -4
  27. package/dist/components/ui/bank-statement-generate-dialog.mjs +6 -6
  28. package/dist/components/ui/contact-alert-dialog/index.mjs +2 -2
  29. package/dist/components/ui/create-contact-modal.mjs +3 -3
  30. package/dist/components/ui/date-picker.mjs +2 -2
  31. package/dist/components/ui/expense-detail-item.mjs +3 -3
  32. package/dist/components/ui/expense-work-details.mjs +9 -9
  33. package/dist/components/ui/file-preview-dialog.mjs +2 -2
  34. package/dist/components/ui/financial-drawers.mjs +2 -2
  35. package/dist/components/ui/form-primitives.mjs +2 -2
  36. package/dist/components/ui/frontend-signup-steps.mjs +5 -5
  37. package/dist/components/ui/income-work-details.mjs +3 -3
  38. package/dist/components/ui/kanban-column.mjs +4 -4
  39. package/dist/components/ui/opportunity-card.mjs +1 -1
  40. package/dist/components/ui/opportunity-edit-modals.mjs +6 -6
  41. package/dist/components/ui/opportunity-summary-tab.mjs +8 -8
  42. package/dist/components/ui/pipeline-board.mjs +6 -6
  43. package/dist/components/ui/pipeline-dialogs.mjs +5 -5
  44. package/dist/components/ui/property-report-dialog.mjs +4 -4
  45. package/dist/components/ui/savings-goal-modal.mjs +4 -4
  46. package/dist/components/ui/share-details-dialog.mjs +2 -2
  47. package/dist/components/ui/signup-form-primitives.mjs +1 -1
  48. package/dist/index.js +4913 -4858
  49. package/dist/index.mjs +160 -160
  50. package/dist/styles.css +1 -1
  51. package/package.json +4 -4
  52. package/src/components/index.tsx +1 -0
  53. package/src/components/ui/ai-conversations/helpers.tsx +31 -0
  54. package/src/components/ui/ai-conversations/index.tsx +468 -0
  55. package/src/components/ui/ai-conversations/lead-panel.tsx +517 -0
  56. package/src/components/ui/ai-conversations/list.tsx +335 -0
  57. package/src/components/ui/ai-conversations/thread.tsx +919 -0
  58. package/src/components/ui/ai-conversations/types.ts +83 -0
  59. package/src/styles/styles-css.ts +1 -1
  60. package/tsup.config.ts +1 -1
  61. package/dist/components/ui/ai-conversations.mjs +0 -42
  62. package/src/components/ui/ai-conversations.tsx +0 -2270
  63. package/dist/{chunk-A43XIVO6.mjs → chunk-2PWTXE66.mjs} +3 -3
  64. package/dist/{chunk-PSBQ4I3M.mjs → chunk-53ZB2JWT.mjs} +6 -6
  65. package/dist/{chunk-G6RCC2SF.mjs → chunk-5ST6BK7R.mjs} +3 -3
  66. package/dist/{chunk-H5NI6ZIU.mjs → chunk-734FOOJC.mjs} +3 -3
  67. package/dist/{chunk-ONYADWSO.mjs → chunk-ABVCQWDY.mjs} +3 -3
  68. package/dist/{chunk-AADJ5IT6.mjs → chunk-ECC2LLZM.mjs} +3 -3
  69. package/dist/{chunk-DK55HZPN.mjs → chunk-KENLXFJ7.mjs} +6 -6
  70. package/dist/{chunk-ET4MTPIY.mjs → chunk-LDC6V6DJ.mjs} +3 -3
  71. package/dist/{chunk-3S4XQTAL.mjs → chunk-SO4RB3XB.mjs} +9 -9
  72. package/dist/{chunk-UMF6LLQK.mjs → chunk-TRM3KIHT.mjs} +3 -3
@@ -37,15 +37,15 @@ import {
37
37
  import {
38
38
  Badge
39
39
  } from "./chunk-X6RC5UWB.mjs";
40
- import {
41
- ToggleGroup,
42
- ToggleGroupItem
43
- } from "./chunk-OWFQSXVD.mjs";
44
40
  import {
45
41
  Popover,
46
42
  PopoverContent,
47
43
  PopoverTrigger
48
44
  } from "./chunk-HB5BKRMH.mjs";
45
+ import {
46
+ ToggleGroup,
47
+ ToggleGroupItem
48
+ } from "./chunk-OWFQSXVD.mjs";
49
49
  import {
50
50
  Input
51
51
  } from "./chunk-LBTHZSBT.mjs";
@@ -58,58 +58,30 @@ import {
58
58
  getInitials
59
59
  } from "./chunk-AFML43VJ.mjs";
60
60
 
61
- // src/components/ui/ai-conversations.tsx
62
- import React, { useState } from "react";
63
- import { useEditor, EditorContent } from "@tiptap/react";
64
- import StarterKit from "@tiptap/starter-kit";
65
- import TiptapUnderline from "@tiptap/extension-underline";
66
- import TiptapLink from "@tiptap/extension-link";
67
- import ReactMarkdown from "react-markdown";
68
- import rehypeRaw from "rehype-raw";
69
- import rehypeSanitize, { defaultSchema } from "rehype-sanitize";
70
- import {
71
- Archive,
72
- ArrowLeft,
73
- Bold,
74
- Bot,
75
- Briefcase,
76
- Calendar,
77
- CheckCircle2,
78
- ChevronLeft,
79
- ChevronRight,
80
- ChevronDown,
81
- Flag,
82
- HelpCircle,
83
- Italic,
84
- Link2,
85
- Lock,
86
- Mail,
87
- MapPin,
88
- MessageSquare,
89
- MoreHorizontal,
90
- Navigation,
91
- Paperclip,
92
- Phone,
93
- PhoneCall,
94
- Plus,
95
- Search,
96
- Send,
97
- Underline,
98
- UserCheck,
99
- UserPlus,
100
- Video
101
- } from "lucide-react";
102
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
61
+ // src/components/ui/ai-conversations/index.tsx
62
+ import { useState } from "react";
63
+ import { ChevronLeft, MessageSquare as MessageSquare3, Search as Search2 } from "lucide-react";
64
+
65
+ // src/components/ui/ai-conversations/list.tsx
66
+ import { Flag, Mail, MessageSquare, Search } from "lucide-react";
67
+
68
+ // src/components/ui/ai-conversations/helpers.tsx
69
+ import { jsx } from "react/jsx-runtime";
103
70
  function displayContactName(name) {
104
71
  return name.trim() || "Website User";
105
72
  }
106
73
  var PANEL_HEADER_HEIGHT = "h-[94px]";
107
- var APPOINTMENT_STATUS_LABEL = {
108
- requested: "Lead requested",
109
- confirmed: "Confirmed",
110
- pending: "Pending confirmation",
111
- cancelled: "Cancelled"
112
- };
74
+ function ContactAvatar({
75
+ name,
76
+ size = "md",
77
+ className
78
+ }) {
79
+ const avatarSize = size === "sm" ? "sm" : size === "lg" ? "lg" : "default";
80
+ return /* @__PURE__ */ jsx(Avatar, { size: avatarSize, className, children: /* @__PURE__ */ jsx(AvatarFallback, { className: "font-semibold", children: getInitials(name) }) });
81
+ }
82
+
83
+ // src/components/ui/ai-conversations/list.tsx
84
+ import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
113
85
  var STATUS_CONFIG = {
114
86
  "ai-active": {
115
87
  label: "AI Active",
@@ -139,14 +111,10 @@ function ConversationStatusChip({
139
111
  }) {
140
112
  const { label, variant, dotClass } = STATUS_CONFIG[status];
141
113
  return /* @__PURE__ */ jsxs(Badge, { variant, className, children: [
142
- showDot && /* @__PURE__ */ jsx("span", { className: cn("size-1.5 shrink-0 rounded-full", dotClass) }),
114
+ showDot && /* @__PURE__ */ jsx2("span", { className: cn("size-1.5 shrink-0 rounded-full", dotClass) }),
143
115
  label
144
116
  ] });
145
117
  }
146
- function ContactAvatar({ name, size = "md", className }) {
147
- const avatarSize = size === "sm" ? "sm" : size === "lg" ? "lg" : "default";
148
- return /* @__PURE__ */ jsx(Avatar, { size: avatarSize, className, children: /* @__PURE__ */ jsx(AvatarFallback, { className: "font-semibold", children: getInitials(name) }) });
149
- }
150
118
  function ConversationListItem({
151
119
  data,
152
120
  isActive,
@@ -167,25 +135,25 @@ function ConversationListItem({
167
135
  isActive ? "bg-muted" : "hover:bg-muted/40"
168
136
  ),
169
137
  children: [
170
- /* @__PURE__ */ jsx(ContactAvatar, { name: data.contact.name }),
138
+ /* @__PURE__ */ jsx2(ContactAvatar, { name: data.contact.name }),
171
139
  /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
172
140
  /* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center justify-between gap-2", children: [
173
- /* @__PURE__ */ jsx("span", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(data.contact.name) }),
141
+ /* @__PURE__ */ jsx2("span", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(data.contact.name) }),
174
142
  /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
175
- data.status === "needs-attention" && /* @__PURE__ */ jsx(Flag, { className: "size-3 text-warning-text" }),
176
- data.channel === "email" ? /* @__PURE__ */ jsx(Mail, { className: "size-3 text-muted-foreground" }) : /* @__PURE__ */ jsx(MessageSquare, { className: "size-3 text-muted-foreground" }),
177
- /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap text-xs text-muted-foreground", children: data.timestamp })
143
+ data.status === "needs-attention" && /* @__PURE__ */ jsx2(Flag, { className: "size-3 text-warning-text" }),
144
+ data.channel === "email" ? /* @__PURE__ */ jsx2(Mail, { className: "size-3 text-muted-foreground" }) : /* @__PURE__ */ jsx2(MessageSquare, { className: "size-3 text-muted-foreground" }),
145
+ /* @__PURE__ */ jsx2("span", { className: "whitespace-nowrap text-xs text-muted-foreground", children: data.timestamp })
178
146
  ] })
179
147
  ] }),
180
148
  /* @__PURE__ */ jsxs("div", { className: "mb-1.5 flex items-center justify-between gap-2", children: [
181
149
  /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-1.5", children: [
182
- /* @__PURE__ */ jsx(ConversationStatusChip, { status: data.status, showDot: true }),
150
+ /* @__PURE__ */ jsx2(ConversationStatusChip, { status: data.status, showDot: true }),
183
151
  data.assignedTo && /* @__PURE__ */ jsxs("span", { className: "truncate text-xs text-muted-foreground", children: [
184
152
  "\u2192 ",
185
153
  data.assignedTo
186
154
  ] })
187
155
  ] }),
188
- data.unreadCount ? /* @__PURE__ */ jsx(
156
+ data.unreadCount ? /* @__PURE__ */ jsx2(
189
157
  Badge,
190
158
  {
191
159
  variant: "default",
@@ -195,7 +163,7 @@ function ConversationListItem({
195
163
  ) : null
196
164
  ] }),
197
165
  /* @__PURE__ */ jsxs("p", { className: "line-clamp-2 text-sm leading-relaxed text-muted-foreground", children: [
198
- data.lastMessageRole === "bot" ? /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground/60", children: "AI: " }) : data.lastMessageRole === "advisor" ? /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground/60", children: "You: " }) : data.lastMessageRole === "visitor" ? /* @__PURE__ */ jsxs("span", { className: "font-medium text-foreground/60", children: [
166
+ data.lastMessageRole === "bot" ? /* @__PURE__ */ jsx2("span", { className: "font-medium text-foreground/60", children: "AI: " }) : data.lastMessageRole === "advisor" ? /* @__PURE__ */ jsx2("span", { className: "font-medium text-foreground/60", children: "You: " }) : data.lastMessageRole === "visitor" ? /* @__PURE__ */ jsxs("span", { className: "font-medium text-foreground/60", children: [
199
167
  displayContactName(data.contact.name).split(" ")[0],
200
168
  ":",
201
169
  " "
@@ -210,44 +178,35 @@ function ConversationListItem({
210
178
  function filterConversations(conversations, query, filter, channelFilter) {
211
179
  const q = query.toLowerCase();
212
180
  return conversations.filter((c) => {
213
- var _a;
214
- const matchesFilter = filter === "all" || (filter === "open" ? c.status !== "closed" : c.status === filter);
215
- const matchesChannel = channelFilter === "all" || ((_a = c.channel) != null ? _a : "chat") === channelFilter;
181
+ var _a, _b;
182
+ const matchesFilter = filter === "all" || (filter === "emails" ? ((_a = c.channel) != null ? _a : "chat") === "email" : c.status === filter);
183
+ const matchesChannel = channelFilter === "all" || ((_b = c.channel) != null ? _b : "chat") === channelFilter;
216
184
  const matchesSearch = !q || c.contact.name.toLowerCase().includes(q) || c.lastMessage.toLowerCase().includes(q);
217
185
  return matchesFilter && matchesChannel && matchesSearch;
218
186
  });
219
187
  }
220
188
  var FILTER_TABS = [
221
189
  { id: "all", label: "All" },
222
- { id: "open", label: "Open" },
223
- { id: "ai-active", label: "AI Active" },
190
+ { id: "emails", label: "Emails" },
224
191
  { id: "needs-attention", label: "Urgent" },
225
- { id: "closed", label: "Archived" }
192
+ { id: "closed", label: "Archived" },
193
+ { id: "ai-active", label: "AI Active" }
226
194
  ];
227
195
  function ConversationList({
228
196
  conversations,
229
197
  activeId,
230
198
  searchQuery = "",
231
199
  activeFilter = "all",
232
- channelFilter: channelFilterProp = "all",
200
+ channelFilter = "all",
233
201
  hasMore,
234
202
  isLoadingMore,
235
203
  onSearchChange,
236
204
  onFilterChange,
237
- onChannelFilterChange,
238
205
  onSelect,
239
206
  onRead,
240
207
  onLoadMore,
241
208
  className
242
209
  }) {
243
- const [channelFilter, setChannelFilter] = useState(channelFilterProp);
244
- function handleChannelFilterChange(vals) {
245
- const v = vals[0];
246
- if (v) {
247
- setChannelFilter(v);
248
- onChannelFilterChange == null ? void 0 : onChannelFilterChange(v);
249
- }
250
- }
251
210
  return /* @__PURE__ */ jsxs(
252
211
  "div",
253
212
  {
@@ -257,49 +216,30 @@ function ConversationList({
257
216
  ),
258
217
  children: [
259
218
  /* @__PURE__ */ jsxs("div", { className: cn(PANEL_HEADER_HEIGHT, "flex shrink-0 flex-col"), children: [
260
- /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-3 py-2.5", children: [
261
- /* @__PURE__ */ jsxs("div", { className: "relative flex-1", children: [
262
- /* @__PURE__ */ jsx(Search, { className: "absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" }),
263
- /* @__PURE__ */ jsx(
264
- Input,
265
- {
266
- value: searchQuery,
267
- onChange: (e) => onSearchChange == null ? void 0 : onSearchChange(e.target.value),
268
- placeholder: "Search conversations...",
269
- className: "h-8 pl-8 text-sm"
270
- }
271
- )
272
- ] }),
273
- /* @__PURE__ */ jsxs(
274
- ToggleGroup,
219
+ /* @__PURE__ */ jsx2("div", { className: "flex shrink-0 items-center border-b border-border px-3 py-2.5", children: /* @__PURE__ */ jsxs("div", { className: "relative flex-1", children: [
220
+ /* @__PURE__ */ jsx2(Search, { className: "absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" }),
221
+ /* @__PURE__ */ jsx2(
222
+ Input,
275
223
  {
276
- type: "single",
277
- variant: "outline",
278
- size: "sm",
279
- spacing: 0,
280
- value: [channelFilter],
281
- onValueChange: handleChannelFilterChange,
282
- className: "shrink-0",
283
- children: [
284
- /* @__PURE__ */ jsx(ToggleGroupItem, { value: "all", "aria-label": "All channels", children: "All" }),
285
- /* @__PURE__ */ jsx(ToggleGroupItem, { value: "chat", "aria-label": "Chat", children: /* @__PURE__ */ jsx(MessageSquare, { className: "size-3.5" }) }),
286
- /* @__PURE__ */ jsx(ToggleGroupItem, { value: "email", "aria-label": "Email", children: /* @__PURE__ */ jsx(Mail, { className: "size-3.5" }) })
287
- ]
224
+ value: searchQuery,
225
+ onChange: (e) => onSearchChange == null ? void 0 : onSearchChange(e.target.value),
226
+ placeholder: "Search conversations...",
227
+ className: "h-8 pl-8 text-sm"
288
228
  }
289
229
  )
290
- ] }),
291
- /* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center border-b border-border", children: /* @__PURE__ */ jsx(
230
+ ] }) }),
231
+ /* @__PURE__ */ jsx2("div", { className: "flex flex-1 items-center border-b border-border", children: /* @__PURE__ */ jsx2(
292
232
  Tabs,
293
233
  {
294
234
  value: activeFilter,
295
235
  onValueChange: (v) => v && (onFilterChange == null ? void 0 : onFilterChange(v)),
296
236
  className: "w-full",
297
- children: /* @__PURE__ */ jsx(
237
+ children: /* @__PURE__ */ jsx2(
298
238
  TabsList,
299
239
  {
300
240
  variant: "line",
301
241
  className: "w-full justify-start gap-0 h-auto",
302
- children: FILTER_TABS.map((tab) => /* @__PURE__ */ jsx(
242
+ children: FILTER_TABS.map((tab) => /* @__PURE__ */ jsx2(
303
243
  TabsTrigger,
304
244
  {
305
245
  value: tab.id,
@@ -313,7 +253,7 @@ function ConversationList({
313
253
  }
314
254
  ) })
315
255
  ] }),
316
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: (() => {
256
+ /* @__PURE__ */ jsx2("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: (() => {
317
257
  const filtered = filterConversations(
318
258
  conversations,
319
259
  searchQuery,
@@ -321,9 +261,9 @@ function ConversationList({
321
261
  channelFilter
322
262
  );
323
263
  return filtered.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center gap-2 p-8 text-muted-foreground", children: [
324
- /* @__PURE__ */ jsx(MessageSquare, { className: "size-8 opacity-30" }),
325
- /* @__PURE__ */ jsx("p", { className: "text-sm", children: "No conversations" }),
326
- searchQuery && /* @__PURE__ */ jsx(
264
+ /* @__PURE__ */ jsx2(MessageSquare, { className: "size-8 opacity-30" }),
265
+ /* @__PURE__ */ jsx2("p", { className: "text-sm", children: "No conversations" }),
266
+ searchQuery && /* @__PURE__ */ jsx2(
327
267
  Button,
328
268
  {
329
269
  variant: "outline",
@@ -332,7 +272,7 @@ function ConversationList({
332
272
  children: "Clear search"
333
273
  }
334
274
  ),
335
- !searchQuery && activeFilter !== "all" && /* @__PURE__ */ jsx(
275
+ !searchQuery && activeFilter !== "all" && /* @__PURE__ */ jsx2(
336
276
  Button,
337
277
  {
338
278
  variant: "outline",
@@ -342,7 +282,7 @@ function ConversationList({
342
282
  }
343
283
  )
344
284
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
345
- filtered.map((item) => /* @__PURE__ */ jsx(
285
+ filtered.map((item) => /* @__PURE__ */ jsx2(
346
286
  ConversationListItem,
347
287
  {
348
288
  data: item,
@@ -352,7 +292,7 @@ function ConversationList({
352
292
  },
353
293
  item.id
354
294
  )),
355
- hasMore && /* @__PURE__ */ jsx("div", { className: "border-t border-border p-3", children: /* @__PURE__ */ jsx(
295
+ hasMore && /* @__PURE__ */ jsx2("div", { className: "border-t border-border p-3", children: /* @__PURE__ */ jsx2(
356
296
  Button,
357
297
  {
358
298
  variant: "outline",
@@ -369,32 +309,63 @@ function ConversationList({
369
309
  }
370
310
  );
371
311
  }
312
+
313
+ // src/components/ui/ai-conversations/thread.tsx
314
+ import React from "react";
315
+ import { useEditor, EditorContent } from "@tiptap/react";
316
+ import StarterKit from "@tiptap/starter-kit";
317
+ import TiptapUnderline from "@tiptap/extension-underline";
318
+ import TiptapLink from "@tiptap/extension-link";
319
+ import ReactMarkdown from "react-markdown";
320
+ import rehypeRaw from "rehype-raw";
321
+ import rehypeSanitize, { defaultSchema } from "rehype-sanitize";
322
+ import {
323
+ Archive,
324
+ ArrowLeft,
325
+ Bold,
326
+ Bot,
327
+ ChevronDown,
328
+ ChevronRight,
329
+ Flag as Flag2,
330
+ Italic,
331
+ Link2,
332
+ Lock,
333
+ Mail as Mail2,
334
+ MessageSquare as MessageSquare2,
335
+ MoreHorizontal,
336
+ Paperclip,
337
+ Send,
338
+ Underline,
339
+ UserCheck
340
+ } from "lucide-react";
341
+ import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
372
342
  function BubbleAvatar({
373
343
  role,
374
344
  senderName
375
345
  }) {
376
346
  if (role === "bot") {
377
- return /* @__PURE__ */ jsx(Avatar, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "border border-border bg-muted", children: /* @__PURE__ */ jsx(Bot, { className: "size-3.5 text-muted-foreground" }) }) });
347
+ return /* @__PURE__ */ jsx3(Avatar, { size: "sm", children: /* @__PURE__ */ jsx3(AvatarFallback, { className: "border border-border bg-muted", children: /* @__PURE__ */ jsx3(Bot, { className: "size-3.5 text-muted-foreground" }) }) });
378
348
  }
379
349
  if (role === "advisor") {
380
- return /* @__PURE__ */ jsx(Avatar, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "font-semibold", children: getInitials(senderName != null ? senderName : "Advisor") }) });
350
+ return /* @__PURE__ */ jsx3(Avatar, { size: "sm", children: /* @__PURE__ */ jsx3(AvatarFallback, { className: "font-semibold", children: getInitials(senderName != null ? senderName : "Advisor") }) });
381
351
  }
382
- return /* @__PURE__ */ jsx(Avatar, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback, { children: getInitials(senderName != null ? senderName : "?") }) });
352
+ return /* @__PURE__ */ jsx3(Avatar, { size: "sm", children: /* @__PURE__ */ jsx3(AvatarFallback, { children: getInitials(senderName != null ? senderName : "?") }) });
383
353
  }
384
- function ChatBubble({ message, className }) {
385
- const { role, content, timestamp, senderName } = message;
354
+ function ChatBubble({ message, channel, className }) {
355
+ const { role, content, timestamp, senderName, subject } = message;
356
+ const isEmail = channel === "email";
386
357
  if (role === "system") {
387
- return /* @__PURE__ */ jsxs("div", { className: cn("my-2 flex items-center gap-3 px-2", className), children: [
388
- /* @__PURE__ */ jsx(Separator, { className: "flex-1" }),
389
- /* @__PURE__ */ jsx("span", { className: "shrink-0 text-caption text-muted-foreground", children: content }),
390
- /* @__PURE__ */ jsx(Separator, { className: "flex-1" })
358
+ return /* @__PURE__ */ jsxs2("div", { className: cn("my-2 flex items-center gap-3 px-2", className), children: [
359
+ /* @__PURE__ */ jsx3(Separator, { className: "flex-1" }),
360
+ /* @__PURE__ */ jsx3("span", { className: "shrink-0 text-caption text-muted-foreground", children: content }),
361
+ /* @__PURE__ */ jsx3(Separator, { className: "flex-1" })
391
362
  ] });
392
363
  }
393
364
  const isAdvisor = role === "advisor";
394
365
  const isBot = role === "bot";
395
366
  const isVisitor = role === "visitor";
396
367
  const displayName = isBot ? "AI Assistant" : isAdvisor ? senderName != null ? senderName : "Advisor" : senderName != null ? senderName : "Lead";
397
- return /* @__PURE__ */ jsxs(
368
+ return /* @__PURE__ */ jsxs2(
398
369
  "div",
399
370
  {
400
371
  className: cn(
@@ -403,29 +374,59 @@ function ChatBubble({ message, className }) {
403
374
  className
404
375
  ),
405
376
  children: [
406
- /* @__PURE__ */ jsx(BubbleAvatar, { role, senderName }),
407
- /* @__PURE__ */ jsxs(
377
+ /* @__PURE__ */ jsx3(BubbleAvatar, { role, senderName }),
378
+ /* @__PURE__ */ jsxs2(
408
379
  "div",
409
380
  {
410
381
  className: cn(
411
- "flex max-w-[70%] flex-col gap-1",
382
+ "flex flex-col gap-1",
383
+ isEmail ? "max-w-[85%] w-full" : "max-w-[70%]",
412
384
  isAdvisor && "items-end"
413
385
  ),
414
386
  children: [
415
- /* @__PURE__ */ jsx("span", { className: "text-caption text-muted-foreground", children: displayName }),
416
- /* @__PURE__ */ jsx(
387
+ /* @__PURE__ */ jsx3("span", { className: "text-caption text-muted-foreground", children: displayName }),
388
+ /* @__PURE__ */ jsxs2(
417
389
  "div",
418
390
  {
419
391
  className: cn(
420
- "px-3 py-2 text-sm leading-relaxed break-words [&_a]:underline [&_p]:m-0",
421
- isBot && "border border-border bg-muted/60 text-foreground [&_a]:text-primary",
422
- isVisitor && "border border-border bg-background text-foreground [&_a]:text-primary",
423
- isAdvisor && "bg-primary text-primary-foreground [&_a]:text-primary-foreground"
392
+ "text-sm leading-relaxed break-words",
393
+ !isEmail && "px-3 py-2 [&_p]:m-0 [&_a]:underline",
394
+ isEmail && [
395
+ "border border-border bg-background px-4 py-3 w-full",
396
+ "[&_p]:mb-2 [&_p:last-child]:mb-0",
397
+ "[&_ul]:mb-2 [&_ul]:list-disc [&_ul]:pl-4",
398
+ "[&_ol]:mb-2 [&_ol]:list-decimal [&_ol]:pl-4",
399
+ "[&_li]:mb-0.5",
400
+ "[&_h1]:mb-2 [&_h1]:text-sm [&_h1]:font-bold",
401
+ "[&_h2]:mb-1.5 [&_h2]:text-sm [&_h2]:font-semibold",
402
+ "[&_h3]:mb-1 [&_h3]:text-sm [&_h3]:font-medium",
403
+ "[&_strong]:font-semibold [&_em]:italic",
404
+ "[&_a]:underline [&_a]:text-primary",
405
+ "[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground [&_blockquote]:italic",
406
+ "[&_hr]:my-3 [&_hr]:border-border"
407
+ ],
408
+ !isEmail && isBot && "border border-border bg-muted/60 text-foreground [&_a]:text-primary",
409
+ !isEmail && isVisitor && "border border-border bg-background text-foreground [&_a]:text-primary",
410
+ !isEmail && isAdvisor && "bg-primary text-primary-foreground [&_a]:text-primary-foreground",
411
+ isEmail && isAdvisor && "bg-muted/30"
424
412
  ),
425
- children: /* @__PURE__ */ jsx(ReactMarkdown, { rehypePlugins: [rehypeRaw, [rehypeSanitize, defaultSchema]], children: content })
413
+ children: [
414
+ isEmail && subject && /* @__PURE__ */ jsxs2("div", { className: "mb-2.5 border-b border-border pb-2", children: [
415
+ /* @__PURE__ */ jsx3("span", { className: "text-xs font-medium text-muted-foreground", children: "Subject:" }),
416
+ " ",
417
+ /* @__PURE__ */ jsx3("span", { className: "text-sm font-semibold text-foreground", children: subject })
418
+ ] }),
419
+ /* @__PURE__ */ jsx3(
420
+ ReactMarkdown,
421
+ {
422
+ rehypePlugins: [rehypeRaw, [rehypeSanitize, defaultSchema]],
423
+ children: content
424
+ }
425
+ )
426
+ ]
426
427
  }
427
428
  ),
428
- timestamp && /* @__PURE__ */ jsx("span", { className: "text-caption text-muted-foreground", children: timestamp })
429
+ timestamp && /* @__PURE__ */ jsx3("span", { className: "text-caption text-muted-foreground", children: timestamp })
429
430
  ]
430
431
  }
431
432
  )
@@ -439,7 +440,7 @@ function ComposerToolbarButton({
439
440
  pressed,
440
441
  onToggle
441
442
  }) {
442
- return /* @__PURE__ */ jsx(
443
+ return /* @__PURE__ */ jsx3(
443
444
  "button",
444
445
  {
445
446
  type: "button",
@@ -450,11 +451,13 @@ function ComposerToolbarButton({
450
451
  "flex size-7 items-center justify-center transition-colors",
451
452
  pressed ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted hover:text-foreground"
452
453
  ),
453
- children: /* @__PURE__ */ jsx(Icon, { className: "size-3.5" })
454
+ children: /* @__PURE__ */ jsx3(Icon, { className: "size-3.5" })
454
455
  }
455
456
  );
456
457
  }
457
- function ComposerLinkPopover({ editor }) {
458
+ function ComposerLinkPopover({
459
+ editor
460
+ }) {
458
461
  const [open, setOpen] = React.useState(false);
459
462
  const [url, setUrl] = React.useState("");
460
463
  const handleApply = () => {
@@ -464,7 +467,7 @@ function ComposerLinkPopover({ editor }) {
464
467
  setOpen(false);
465
468
  setUrl("");
466
469
  };
467
- return /* @__PURE__ */ jsxs(
470
+ return /* @__PURE__ */ jsxs2(
468
471
  Popover,
469
472
  {
470
473
  open,
@@ -477,7 +480,7 @@ function ComposerLinkPopover({ editor }) {
477
480
  setOpen(newOpen);
478
481
  },
479
482
  children: [
480
- /* @__PURE__ */ jsx(
483
+ /* @__PURE__ */ jsx3(
481
484
  PopoverTrigger,
482
485
  {
483
486
  "aria-label": "Insert link",
@@ -485,11 +488,11 @@ function ComposerLinkPopover({ editor }) {
485
488
  "flex size-7 items-center justify-center transition-colors",
486
489
  (editor == null ? void 0 : editor.isActive("link")) ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted hover:text-foreground"
487
490
  ),
488
- children: /* @__PURE__ */ jsx(Link2, { className: "size-3.5" })
491
+ children: /* @__PURE__ */ jsx3(Link2, { className: "size-3.5" })
489
492
  }
490
493
  ),
491
- /* @__PURE__ */ jsx(PopoverContent, { className: "w-72 p-2", align: "start", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
492
- /* @__PURE__ */ jsx(
494
+ /* @__PURE__ */ jsx3(PopoverContent, { className: "w-72 p-2", align: "start", children: /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1.5", children: [
495
+ /* @__PURE__ */ jsx3(
493
496
  "input",
494
497
  {
495
498
  type: "url",
@@ -501,7 +504,7 @@ function ComposerLinkPopover({ editor }) {
501
504
  autoFocus: true
502
505
  }
503
506
  ),
504
- /* @__PURE__ */ jsx(Button, { size: "sm", className: "h-8 px-3", onClick: handleApply, children: "Apply" })
507
+ /* @__PURE__ */ jsx3(Button, { size: "sm", className: "h-8 px-3", onClick: handleApply, children: "Apply" })
505
508
  ] }) })
506
509
  ]
507
510
  }
@@ -511,8 +514,8 @@ function ComposerEmailFieldRow({
511
514
  label,
512
515
  children
513
516
  }) {
514
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 border-b border-border px-4 py-2.5", children: [
515
- /* @__PURE__ */ jsx("span", { className: "w-14 shrink-0 text-sm text-muted-foreground", children: label }),
517
+ return /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-3 border-b border-border px-4 py-2.5", children: [
518
+ /* @__PURE__ */ jsx3("span", { className: "w-14 shrink-0 text-sm text-muted-foreground", children: label }),
516
519
  children
517
520
  ] });
518
521
  }
@@ -520,7 +523,6 @@ function ChatComposer({
520
523
  mode,
521
524
  channel: channelProp = "chat",
522
525
  onChannelChange,
523
- channelType = "chat",
524
526
  isEmailIntegrated = false,
525
527
  contactEmail = "",
526
528
  inputValue = "",
@@ -529,17 +531,21 @@ function ChatComposer({
529
531
  onSendEmail,
530
532
  onTakeOver,
531
533
  onLetAiHandle,
534
+ emailReplySubject,
532
535
  className
533
536
  }) {
534
- const showIntegrateEmailPrompt = channelType === "email" && !isEmailIntegrated;
535
- const initialChannel = channelType === "email" && isEmailIntegrated ? "email" : channelProp;
536
537
  const [channel, setChannel] = React.useState(
537
- isEmailIntegrated ? initialChannel : "chat"
538
+ isEmailIntegrated ? channelProp : "chat"
538
539
  );
539
540
  const [emailTo, setEmailTo] = React.useState(contactEmail);
540
541
  const [emailCc, setEmailCc] = React.useState("");
541
542
  const [showCc, setShowCc] = React.useState(false);
542
- const [emailSubject, setEmailSubject] = React.useState("");
543
+ const [emailSubject, setEmailSubject] = React.useState(
544
+ emailReplySubject ? `Re: ${emailReplySubject}` : ""
545
+ );
546
+ const [emailMode, setEmailMode] = React.useState(
547
+ emailReplySubject ? "reply" : "new"
548
+ );
543
549
  const [, forceUpdate] = React.useReducer((x) => x + 1, 0);
544
550
  const editor = useEditor({
545
551
  extensions: [
@@ -559,23 +565,21 @@ function ChatComposer({
559
565
  setChannel(c);
560
566
  onChannelChange == null ? void 0 : onChannelChange(c);
561
567
  };
562
- if (showIntegrateEmailPrompt) {
563
- return /* @__PURE__ */ jsxs(
564
- "div",
565
- {
566
- className: cn(
567
- "flex flex-col items-center justify-center gap-2 border-t border-border bg-muted/30 px-6 py-8 text-center",
568
- className
569
- ),
570
- children: [
571
- /* @__PURE__ */ jsx(Mail, { className: "h-8 w-8 text-muted-foreground" }),
572
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: "Email integration required" }),
573
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Please integrate your email to reply to this conversation." })
574
- ]
575
- }
576
- );
577
- }
578
- return /* @__PURE__ */ jsxs(
568
+ const handleNewEmail = () => {
569
+ setEmailSubject("");
570
+ setEmailCc("");
571
+ setShowCc(false);
572
+ editor == null ? void 0 : editor.commands.clearContent();
573
+ };
574
+ const handleEmailModeChange = (mode2) => {
575
+ setEmailMode(mode2);
576
+ if (mode2 === "new") {
577
+ handleNewEmail();
578
+ } else {
579
+ setEmailSubject(emailReplySubject ? `Re: ${emailReplySubject}` : "");
580
+ }
581
+ };
582
+ return /* @__PURE__ */ jsxs2(
579
583
  "div",
580
584
  {
581
585
  className: cn(
@@ -583,27 +587,27 @@ function ChatComposer({
583
587
  className
584
588
  ),
585
589
  children: [
586
- isEmailIntegrated && /* @__PURE__ */ jsx("div", { className: "border-b border-border px-3 py-2", children: /* @__PURE__ */ jsx(
590
+ isEmailIntegrated && /* @__PURE__ */ jsx3("div", { className: "border-b border-border px-3 py-2", children: /* @__PURE__ */ jsx3(
587
591
  Tabs,
588
592
  {
589
593
  value: channel,
590
594
  onValueChange: (v) => v && handleChannelChange(v),
591
- children: /* @__PURE__ */ jsxs(TabsList, { variant: "default", className: "w-full", children: [
592
- /* @__PURE__ */ jsxs(TabsTrigger, { value: "chat", className: "flex-1 gap-1.5", children: [
593
- /* @__PURE__ */ jsx(MessageSquare, { className: "size-3.5" }),
595
+ children: /* @__PURE__ */ jsxs2(TabsList, { variant: "default", className: "w-full", children: [
596
+ /* @__PURE__ */ jsxs2(TabsTrigger, { value: "chat", className: "flex-1 gap-1.5", children: [
597
+ /* @__PURE__ */ jsx3(MessageSquare2, { className: "size-3.5" }),
594
598
  "Chat"
595
599
  ] }),
596
- /* @__PURE__ */ jsxs(TabsTrigger, { value: "email", className: "flex-1 gap-1.5", children: [
597
- /* @__PURE__ */ jsx(Mail, { className: "size-3.5" }),
600
+ /* @__PURE__ */ jsxs2(TabsTrigger, { value: "email", className: "flex-1 gap-1.5", children: [
601
+ /* @__PURE__ */ jsx3(Mail2, { className: "size-3.5" }),
598
602
  "Email"
599
603
  ] })
600
604
  ] })
601
605
  }
602
606
  ) }),
603
- mode === "ai" ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 bg-muted/30 px-4 py-2.5 text-[12px] text-muted-foreground", children: [
604
- /* @__PURE__ */ jsx(Bot, { className: "size-3.5 shrink-0 text-muted-foreground" }),
605
- /* @__PURE__ */ jsx("span", { children: "AI is handling this conversation." }),
606
- /* @__PURE__ */ jsx(
607
+ mode === "ai" ? /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 bg-muted/30 px-4 py-2.5 text-[12px] text-muted-foreground", children: [
608
+ /* @__PURE__ */ jsx3(Bot, { className: "size-3.5 shrink-0 text-muted-foreground" }),
609
+ /* @__PURE__ */ jsx3("span", { children: "AI is handling this conversation." }),
610
+ /* @__PURE__ */ jsx3(
607
611
  Button,
608
612
  {
609
613
  variant: "link",
@@ -613,12 +617,12 @@ function ChatComposer({
613
617
  children: "Take Over"
614
618
  }
615
619
  ),
616
- /* @__PURE__ */ jsx("span", { children: "to reply directly." })
620
+ /* @__PURE__ */ jsx3("span", { children: "to reply directly." })
617
621
  ] }) : (
618
622
  /* Email panel stays in normal flow to anchor container height;
619
623
  chat panel is an absolute overlay so both tabs share identical dimensions */
620
- /* @__PURE__ */ jsxs("div", { className: "relative", children: [
621
- /* @__PURE__ */ jsxs(
624
+ /* @__PURE__ */ jsxs2("div", { className: "relative", children: [
625
+ /* @__PURE__ */ jsxs2(
622
626
  "div",
623
627
  {
624
628
  className: cn(
@@ -627,8 +631,8 @@ function ChatComposer({
627
631
  ),
628
632
  "aria-hidden": channel !== "email",
629
633
  children: [
630
- /* @__PURE__ */ jsxs(ComposerEmailFieldRow, { label: "To", children: [
631
- /* @__PURE__ */ jsx(
634
+ /* @__PURE__ */ jsxs2(ComposerEmailFieldRow, { label: "To", children: [
635
+ /* @__PURE__ */ jsx3(
632
636
  "input",
633
637
  {
634
638
  type: "email",
@@ -638,7 +642,7 @@ function ChatComposer({
638
642
  className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
639
643
  }
640
644
  ),
641
- /* @__PURE__ */ jsxs(
645
+ /* @__PURE__ */ jsxs2(
642
646
  "button",
643
647
  {
644
648
  type: "button",
@@ -646,12 +650,12 @@ function ChatComposer({
646
650
  className: "flex shrink-0 items-center gap-0.5 text-sm text-muted-foreground hover:text-foreground",
647
651
  children: [
648
652
  "CC",
649
- /* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5" })
653
+ /* @__PURE__ */ jsx3(ChevronDown, { className: "size-3.5" })
650
654
  ]
651
655
  }
652
656
  )
653
657
  ] }),
654
- showCc && /* @__PURE__ */ jsx(ComposerEmailFieldRow, { label: "CC", children: /* @__PURE__ */ jsx(
658
+ showCc && /* @__PURE__ */ jsx3(ComposerEmailFieldRow, { label: "CC", children: /* @__PURE__ */ jsx3(
655
659
  "input",
656
660
  {
657
661
  type: "email",
@@ -661,7 +665,7 @@ function ChatComposer({
661
665
  className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
662
666
  }
663
667
  ) }),
664
- /* @__PURE__ */ jsx(ComposerEmailFieldRow, { label: "Subject", children: /* @__PURE__ */ jsx(
668
+ /* @__PURE__ */ jsx3(ComposerEmailFieldRow, { label: "Subject", children: /* @__PURE__ */ jsx3(
665
669
  "input",
666
670
  {
667
671
  type: "text",
@@ -671,10 +675,32 @@ function ChatComposer({
671
675
  className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
672
676
  }
673
677
  ) }),
674
- /* @__PURE__ */ jsx(EditorContent, { editor }),
675
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
676
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5", children: [
677
- /* @__PURE__ */ jsx(
678
+ /* @__PURE__ */ jsx3(EditorContent, { editor }),
679
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
680
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-0.5", children: [
681
+ emailReplySubject && /* @__PURE__ */ jsxs2(Fragment2, { children: [
682
+ /* @__PURE__ */ jsxs2(
683
+ ToggleGroup,
684
+ {
685
+ type: "single",
686
+ variant: "outline",
687
+ size: "sm",
688
+ spacing: 0,
689
+ value: [emailMode],
690
+ onValueChange: (values) => {
691
+ const v = values[0];
692
+ if (v) handleEmailModeChange(v);
693
+ },
694
+ className: "mr-1.5",
695
+ children: [
696
+ /* @__PURE__ */ jsx3(ToggleGroupItem, { value: "reply", children: "Reply" }),
697
+ /* @__PURE__ */ jsx3(ToggleGroupItem, { value: "new", children: "New email" })
698
+ ]
699
+ }
700
+ ),
701
+ /* @__PURE__ */ jsx3(Separator, { orientation: "vertical", className: "mr-1.5 h-4" })
702
+ ] }),
703
+ /* @__PURE__ */ jsx3(
678
704
  ComposerToolbarButton,
679
705
  {
680
706
  label: "Bold",
@@ -683,7 +709,7 @@ function ChatComposer({
683
709
  onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run()
684
710
  }
685
711
  ),
686
- /* @__PURE__ */ jsx(
712
+ /* @__PURE__ */ jsx3(
687
713
  ComposerToolbarButton,
688
714
  {
689
715
  label: "Italic",
@@ -692,7 +718,7 @@ function ChatComposer({
692
718
  onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run()
693
719
  }
694
720
  ),
695
- /* @__PURE__ */ jsx(
721
+ /* @__PURE__ */ jsx3(
696
722
  ComposerToolbarButton,
697
723
  {
698
724
  label: "Underline",
@@ -701,38 +727,44 @@ function ChatComposer({
701
727
  onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleUnderline().run()
702
728
  }
703
729
  ),
704
- /* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "mx-1.5 h-4" }),
705
- /* @__PURE__ */ jsx(ComposerLinkPopover, { editor }),
706
- /* @__PURE__ */ jsx(ComposerToolbarButton, { label: "Attach file", icon: Paperclip })
730
+ /* @__PURE__ */ jsx3(Separator, { orientation: "vertical", className: "mx-1.5 h-4" }),
731
+ /* @__PURE__ */ jsx3(ComposerLinkPopover, { editor }),
732
+ /* @__PURE__ */ jsx3(ComposerToolbarButton, { label: "Attach file", icon: Paperclip })
707
733
  ] }),
708
- /* @__PURE__ */ jsxs(
709
- Button,
710
- {
711
- size: "sm",
712
- onClick: () => {
713
- var _a;
714
- const html = (_a = editor == null ? void 0 : editor.getHTML()) != null ? _a : "";
715
- onSendEmail == null ? void 0 : onSendEmail({
716
- content: html,
717
- to: emailTo,
718
- cc: emailCc,
719
- subject: emailSubject
720
- });
721
- editor == null ? void 0 : editor.commands.clearContent();
722
- },
723
- disabled: !editor || editor.isEmpty || !emailTo.trim(),
724
- children: [
725
- /* @__PURE__ */ jsx(Send, { className: "mr-1.5 size-3.5" }),
726
- "Send Email"
727
- ]
728
- }
729
- )
734
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
735
+ onLetAiHandle && /* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
736
+ /* @__PURE__ */ jsx3(Bot, { className: "mr-1.5 size-3.5" }),
737
+ "Let AI Handle"
738
+ ] }),
739
+ /* @__PURE__ */ jsxs2(
740
+ Button,
741
+ {
742
+ size: "sm",
743
+ onClick: () => {
744
+ var _a;
745
+ const html = (_a = editor == null ? void 0 : editor.getHTML()) != null ? _a : "";
746
+ onSendEmail == null ? void 0 : onSendEmail({
747
+ content: html,
748
+ to: emailTo,
749
+ cc: emailCc,
750
+ subject: emailSubject
751
+ });
752
+ editor == null ? void 0 : editor.commands.clearContent();
753
+ },
754
+ disabled: !editor || editor.isEmpty || !emailTo.trim(),
755
+ children: [
756
+ /* @__PURE__ */ jsx3(Send, { className: "mr-1.5 size-3.5" }),
757
+ "Send Email"
758
+ ]
759
+ }
760
+ )
761
+ ] })
730
762
  ] })
731
763
  ]
732
764
  }
733
765
  ),
734
- channel === "chat" && /* @__PURE__ */ jsxs("div", { className: "absolute inset-0 flex flex-col gap-3 p-4", children: [
735
- /* @__PURE__ */ jsx(
766
+ channel === "chat" && /* @__PURE__ */ jsxs2("div", { className: "absolute inset-0 flex flex-col gap-3 p-4", children: [
767
+ /* @__PURE__ */ jsx3(
736
768
  Textarea,
737
769
  {
738
770
  value: inputValue,
@@ -741,19 +773,19 @@ function ChatComposer({
741
773
  className: "min-h-0 flex-1 resize-none text-base"
742
774
  }
743
775
  ),
744
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
745
- /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
746
- /* @__PURE__ */ jsx(Bot, { className: "mr-1.5 size-3.5" }),
776
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between", children: [
777
+ /* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
778
+ /* @__PURE__ */ jsx3(Bot, { className: "mr-1.5 size-3.5" }),
747
779
  "Let AI Handle"
748
780
  ] }),
749
- /* @__PURE__ */ jsxs(
781
+ /* @__PURE__ */ jsxs2(
750
782
  Button,
751
783
  {
752
784
  size: "sm",
753
785
  onClick: () => onSend == null ? void 0 : onSend(inputValue),
754
786
  disabled: !inputValue.trim(),
755
787
  children: [
756
- /* @__PURE__ */ jsx(Send, { className: "mr-1.5 size-3.5" }),
788
+ /* @__PURE__ */ jsx3(Send, { className: "mr-1.5 size-3.5" }),
757
789
  "Send"
758
790
  ]
759
791
  }
@@ -774,7 +806,6 @@ function ChatThread({
774
806
  isAiTyping = false,
775
807
  channel,
776
808
  onChannelChange,
777
- channelType,
778
809
  isEmailIntegrated,
779
810
  inputValue,
780
811
  onInputChange,
@@ -782,6 +813,7 @@ function ChatThread({
782
813
  onSendEmail,
783
814
  onTakeOver,
784
815
  onLetAiHandle,
816
+ emailReplySubject,
785
817
  onReopen,
786
818
  onMarkUrgent,
787
819
  onUnmarkUrgent,
@@ -834,8 +866,8 @@ function ChatThread({
834
866
  const el = scrollRef.current;
835
867
  if (el) el.scrollTop = el.scrollHeight;
836
868
  }, [isAiTyping]);
837
- return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col bg-background", className), children: [
838
- /* @__PURE__ */ jsxs(
869
+ return /* @__PURE__ */ jsxs2("div", { className: cn("flex flex-col bg-background", className), children: [
870
+ /* @__PURE__ */ jsxs2(
839
871
  "div",
840
872
  {
841
873
  className: cn(
@@ -843,7 +875,7 @@ function ChatThread({
843
875
  "flex items-center gap-3 border-b border-border px-4"
844
876
  ),
845
877
  children: [
846
- onBack && /* @__PURE__ */ jsx(
878
+ onBack && /* @__PURE__ */ jsx3(
847
879
  Button,
848
880
  {
849
881
  variant: "ghost",
@@ -851,28 +883,28 @@ function ChatThread({
851
883
  className: "size-8 shrink-0 md:hidden",
852
884
  onClick: onBack,
853
885
  "aria-label": "Back to conversations",
854
- children: /* @__PURE__ */ jsx(ArrowLeft, { className: "size-4" })
886
+ children: /* @__PURE__ */ jsx3(ArrowLeft, { className: "size-4" })
855
887
  }
856
888
  ),
857
- /* @__PURE__ */ jsx(ContactAvatar, { name: contact.name, size: "md" }),
858
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
859
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
860
- /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
861
- /* @__PURE__ */ jsx(ConversationStatusChip, { status, showDot: true })
889
+ /* @__PURE__ */ jsx3(ContactAvatar, { name: contact.name, size: "md" }),
890
+ /* @__PURE__ */ jsxs2("div", { className: "min-w-0 flex-1", children: [
891
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
892
+ /* @__PURE__ */ jsx3("span", { className: "text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
893
+ /* @__PURE__ */ jsx3(ConversationStatusChip, { status, showDot: true })
862
894
  ] }),
863
- contact.email && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: contact.email })
895
+ contact.email && /* @__PURE__ */ jsx3("p", { className: "text-sm text-muted-foreground", children: contact.email })
864
896
  ] }),
865
- /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
866
- /* @__PURE__ */ jsxs("div", { className: "hidden items-center gap-2 md:flex", children: [
867
- isClosed && /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: onReopen, children: "Reopen" }),
868
- !isClosed && aiIsHandling && /* @__PURE__ */ jsx(Button, { size: "sm", onClick: onTakeOver, children: "Take Over" }),
869
- !isClosed && !aiIsHandling && /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
870
- /* @__PURE__ */ jsx(Bot, { className: "mr-1.5 size-3.5" }),
897
+ /* @__PURE__ */ jsxs2("div", { className: "flex shrink-0 items-center gap-2", children: [
898
+ /* @__PURE__ */ jsxs2("div", { className: "hidden items-center gap-2 md:flex", children: [
899
+ isClosed && /* @__PURE__ */ jsx3(Button, { variant: "outline", size: "sm", onClick: onReopen, children: "Reopen" }),
900
+ !isClosed && aiIsHandling && /* @__PURE__ */ jsx3(Button, { size: "sm", onClick: onTakeOver, children: "Take Over" }),
901
+ !isClosed && !aiIsHandling && /* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
902
+ /* @__PURE__ */ jsx3(Bot, { className: "mr-1.5 size-3.5" }),
871
903
  "Let AI Handle"
872
904
  ] })
873
905
  ] }),
874
- /* @__PURE__ */ jsxs(DropdownMenu, { children: [
875
- /* @__PURE__ */ jsx(
906
+ /* @__PURE__ */ jsxs2(DropdownMenu, { children: [
907
+ /* @__PURE__ */ jsx3(
876
908
  DropdownMenuTrigger,
877
909
  {
878
910
  className: cn(
@@ -880,38 +912,38 @@ function ChatThread({
880
912
  "size-8"
881
913
  ),
882
914
  "aria-label": "More actions",
883
- children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-4" })
915
+ children: /* @__PURE__ */ jsx3(MoreHorizontal, { className: "size-4" })
884
916
  }
885
917
  ),
886
- /* @__PURE__ */ jsxs(DropdownMenuContent, { children: [
887
- onShowLeadInfo && /* @__PURE__ */ jsxs(Fragment, { children: [
888
- /* @__PURE__ */ jsxs(
918
+ /* @__PURE__ */ jsxs2(DropdownMenuContent, { children: [
919
+ onShowLeadInfo && /* @__PURE__ */ jsxs2(Fragment2, { children: [
920
+ /* @__PURE__ */ jsxs2(
889
921
  DropdownMenuItem,
890
922
  {
891
923
  className: "md:hidden",
892
924
  onClick: onShowLeadInfo,
893
925
  children: [
894
- /* @__PURE__ */ jsx(ChevronRight, { className: "mr-2 size-4" }),
926
+ /* @__PURE__ */ jsx3(ChevronRight, { className: "mr-2 size-4" }),
895
927
  "Lead Info"
896
928
  ]
897
929
  }
898
930
  ),
899
- /* @__PURE__ */ jsx(DropdownMenuSeparator, { className: "md:hidden" })
931
+ /* @__PURE__ */ jsx3(DropdownMenuSeparator, { className: "md:hidden" })
900
932
  ] }),
901
- status === "needs-attention" ? /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onUnmarkUrgent, children: [
902
- /* @__PURE__ */ jsx(Flag, { className: "mr-2 size-4" }),
933
+ status === "needs-attention" ? /* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: onUnmarkUrgent, children: [
934
+ /* @__PURE__ */ jsx3(Flag2, { className: "mr-2 size-4" }),
903
935
  "Unmark Urgent"
904
- ] }) : /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onMarkUrgent, children: [
905
- /* @__PURE__ */ jsx(Flag, { className: "mr-2 size-4" }),
936
+ ] }) : /* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: onMarkUrgent, children: [
937
+ /* @__PURE__ */ jsx3(Flag2, { className: "mr-2 size-4" }),
906
938
  "Mark as Urgent"
907
939
  ] }),
908
- /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onAssignToAdvisor, children: [
909
- /* @__PURE__ */ jsx(UserCheck, { className: "mr-2 size-4" }),
940
+ /* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: onAssignToAdvisor, children: [
941
+ /* @__PURE__ */ jsx3(UserCheck, { className: "mr-2 size-4" }),
910
942
  "Assign to advisor"
911
943
  ] }),
912
- /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
913
- /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onArchive, children: [
914
- /* @__PURE__ */ jsx(Archive, { className: "mr-2 size-4" }),
944
+ /* @__PURE__ */ jsx3(DropdownMenuSeparator, {}),
945
+ /* @__PURE__ */ jsxs2(DropdownMenuItem, { onClick: onArchive, children: [
946
+ /* @__PURE__ */ jsx3(Archive, { className: "mr-2 size-4" }),
915
947
  "Archive"
916
948
  ] })
917
949
  ] })
@@ -920,7 +952,7 @@ function ChatThread({
920
952
  ]
921
953
  }
922
954
  ),
923
- /* @__PURE__ */ jsxs(
955
+ /* @__PURE__ */ jsxs2(
924
956
  "div",
925
957
  {
926
958
  ref: scrollRef,
@@ -928,29 +960,29 @@ function ChatThread({
928
960
  className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4",
929
961
  tabIndex: 0,
930
962
  children: [
931
- isLoadingMoreMessages && /* @__PURE__ */ jsx("div", { className: "flex justify-center py-1 text-caption text-muted-foreground", children: "Loading older messages..." }),
932
- messages.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground", children: [
933
- /* @__PURE__ */ jsx(MessageSquare, { className: "size-8 opacity-30" }),
934
- /* @__PURE__ */ jsx("p", { className: "text-sm", children: "No messages yet" })
935
- ] }) : messages.map((msg) => /* @__PURE__ */ jsx(ChatBubble, { message: msg }, msg.id)),
936
- isAiTyping && !isClosed && /* @__PURE__ */ jsxs("div", { className: "flex gap-2.5", children: [
937
- /* @__PURE__ */ jsx(BubbleAvatar, { role: "bot" }),
938
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
939
- /* @__PURE__ */ jsx("span", { className: "text-caption text-muted-foreground", children: "AI Assistant" }),
940
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 border border-border bg-muted/60 px-3 py-2.5", children: [
941
- /* @__PURE__ */ jsx("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:0ms]" }),
942
- /* @__PURE__ */ jsx("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:150ms]" }),
943
- /* @__PURE__ */ jsx("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:300ms]" })
963
+ isLoadingMoreMessages && /* @__PURE__ */ jsx3("div", { className: "flex justify-center py-1 text-caption text-muted-foreground", children: "Loading older messages..." }),
964
+ messages.length === 0 ? /* @__PURE__ */ jsxs2("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground", children: [
965
+ /* @__PURE__ */ jsx3(MessageSquare2, { className: "size-8 opacity-30" }),
966
+ /* @__PURE__ */ jsx3("p", { className: "text-sm", children: "No messages yet" })
967
+ ] }) : messages.map((msg) => /* @__PURE__ */ jsx3(ChatBubble, { message: msg, channel }, msg.id)),
968
+ isAiTyping && !isClosed && /* @__PURE__ */ jsxs2("div", { className: "flex gap-2.5", children: [
969
+ /* @__PURE__ */ jsx3(BubbleAvatar, { role: "bot" }),
970
+ /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-1", children: [
971
+ /* @__PURE__ */ jsx3("span", { className: "text-caption text-muted-foreground", children: "AI Assistant" }),
972
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1 border border-border bg-muted/60 px-3 py-2.5", children: [
973
+ /* @__PURE__ */ jsx3("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:0ms]" }),
974
+ /* @__PURE__ */ jsx3("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:150ms]" }),
975
+ /* @__PURE__ */ jsx3("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:300ms]" })
944
976
  ] })
945
977
  ] })
946
978
  ] })
947
979
  ]
948
980
  }
949
981
  ),
950
- isClosed ? /* @__PURE__ */ 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: [
951
- /* @__PURE__ */ jsx(Lock, { className: "size-3.5 shrink-0" }),
952
- /* @__PURE__ */ jsx("span", { children: "This conversation is closed." }),
953
- /* @__PURE__ */ jsx(
982
+ isClosed ? /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-3 border-t border-border bg-muted/30 px-4 py-3 text-sm text-muted-foreground", children: [
983
+ /* @__PURE__ */ jsx3(Lock, { className: "size-3.5 shrink-0" }),
984
+ /* @__PURE__ */ jsx3("span", { children: "This conversation is closed." }),
985
+ /* @__PURE__ */ jsx3(
954
986
  Button,
955
987
  {
956
988
  variant: "outline",
@@ -960,13 +992,12 @@ function ChatThread({
960
992
  children: "Reopen"
961
993
  }
962
994
  )
963
- ] }) : /* @__PURE__ */ jsx(
995
+ ] }) : /* @__PURE__ */ jsx3(
964
996
  ChatComposer,
965
997
  {
966
998
  mode,
967
999
  channel,
968
1000
  onChannelChange,
969
- channelType,
970
1001
  isEmailIntegrated,
971
1002
  contactEmail: contact.email,
972
1003
  inputValue,
@@ -974,30 +1005,57 @@ function ChatThread({
974
1005
  onSend,
975
1006
  onSendEmail,
976
1007
  onTakeOver,
977
- onLetAiHandle
1008
+ onLetAiHandle,
1009
+ emailReplySubject
978
1010
  }
979
1011
  )
980
1012
  ] });
981
1013
  }
1014
+
1015
+ // src/components/ui/ai-conversations/lead-panel.tsx
1016
+ import {
1017
+ ArrowLeft as ArrowLeft2,
1018
+ Briefcase,
1019
+ Calendar,
1020
+ CheckCircle2,
1021
+ ChevronRight as ChevronRight2,
1022
+ HelpCircle,
1023
+ Link2 as Link22,
1024
+ Mail as Mail3,
1025
+ MapPin,
1026
+ Navigation,
1027
+ Phone,
1028
+ PhoneCall,
1029
+ Plus,
1030
+ UserPlus,
1031
+ Video
1032
+ } from "lucide-react";
1033
+ import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
982
1034
  function AICollectedDataSection({
983
1035
  fields,
984
1036
  className
985
1037
  }) {
986
- return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col", className), children: fields.map((field, i) => /* @__PURE__ */ jsxs(
1038
+ return /* @__PURE__ */ jsx4("div", { className: cn("flex flex-col", className), children: fields.map((field, i) => /* @__PURE__ */ jsxs3(
987
1039
  "div",
988
1040
  {
989
1041
  className: "flex items-center justify-between gap-2 border-b border-border/40 py-1.5 last:border-b-0",
990
1042
  children: [
991
- /* @__PURE__ */ jsx("span", { className: "shrink-0 text-sm text-muted-foreground", children: field.label }),
992
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
993
- /* @__PURE__ */ jsx("span", { className: "text-right text-sm font-medium text-foreground", children: field.value }),
994
- field.confidence === "confirmed" ? /* @__PURE__ */ jsx(CheckCircle2, { className: "size-3 shrink-0 text-success-text" }) : /* @__PURE__ */ jsx(HelpCircle, { className: "size-3 shrink-0 text-warning-text" })
1043
+ /* @__PURE__ */ jsx4("span", { className: "shrink-0 text-sm text-muted-foreground", children: field.label }),
1044
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-1.5", children: [
1045
+ /* @__PURE__ */ jsx4("span", { className: "text-right text-sm font-medium text-foreground", children: field.value }),
1046
+ field.confidence === "confirmed" ? /* @__PURE__ */ jsx4(CheckCircle2, { className: "size-3 shrink-0 text-success-text" }) : /* @__PURE__ */ jsx4(HelpCircle, { className: "size-3 shrink-0 text-warning-text" })
995
1047
  ] })
996
1048
  ]
997
1049
  },
998
1050
  i
999
1051
  )) });
1000
1052
  }
1053
+ var APPOINTMENT_STATUS_LABEL = {
1054
+ requested: "Lead requested",
1055
+ confirmed: "Confirmed",
1056
+ pending: "Pending confirmation",
1057
+ cancelled: "Cancelled"
1058
+ };
1001
1059
  var MEETING_ICON = {
1002
1060
  video: Video,
1003
1061
  phone: Phone,
@@ -1009,7 +1067,7 @@ var MEETING_LABEL = {
1009
1067
  "in-person": "In Person"
1010
1068
  };
1011
1069
  var MEETING_DETAIL_ICON = {
1012
- video: Link2,
1070
+ video: Link22,
1013
1071
  phone: PhoneCall,
1014
1072
  "in-person": Navigation
1015
1073
  };
@@ -1019,9 +1077,9 @@ function MeetingDetailRow({
1019
1077
  }) {
1020
1078
  const DetailIcon = MEETING_DETAIL_ICON[meetingType];
1021
1079
  const isLink = detail.startsWith("http");
1022
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1023
- /* @__PURE__ */ jsx(DetailIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
1024
- isLink ? /* @__PURE__ */ jsx(
1080
+ return /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
1081
+ /* @__PURE__ */ jsx4(DetailIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
1082
+ isLink ? /* @__PURE__ */ jsx4(
1025
1083
  "a",
1026
1084
  {
1027
1085
  href: detail,
@@ -1030,7 +1088,7 @@ function MeetingDetailRow({
1030
1088
  className: "text-sm text-primary underline underline-offset-2 break-all hover:text-primary/80",
1031
1089
  children: detail
1032
1090
  }
1033
- ) : /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground break-all", children: detail })
1091
+ ) : /* @__PURE__ */ jsx4("span", { className: "text-sm text-muted-foreground break-all", children: detail })
1034
1092
  ] });
1035
1093
  }
1036
1094
  function AppointmentSection({
@@ -1043,23 +1101,23 @@ function AppointmentSection({
1043
1101
  }) {
1044
1102
  const AppointmentIcon = MEETING_ICON[appointment.meetingType];
1045
1103
  const canReschedule = !isAnonymous && !!onRescheduleAppointment;
1046
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1047
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1048
- /* @__PURE__ */ jsx(Calendar, { className: "size-3.5 shrink-0 text-muted-foreground" }),
1049
- /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: appointment.datetime })
1104
+ return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-2", children: [
1105
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
1106
+ /* @__PURE__ */ jsx4(Calendar, { className: "size-3.5 shrink-0 text-muted-foreground" }),
1107
+ /* @__PURE__ */ jsx4("span", { className: "text-sm font-medium text-foreground", children: appointment.datetime })
1050
1108
  ] }),
1051
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1052
- /* @__PURE__ */ jsx(AppointmentIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
1053
- /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: MEETING_LABEL[appointment.meetingType] })
1109
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
1110
+ /* @__PURE__ */ jsx4(AppointmentIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
1111
+ /* @__PURE__ */ jsx4("span", { className: "text-sm text-muted-foreground", children: MEETING_LABEL[appointment.meetingType] })
1054
1112
  ] }),
1055
- appointment.meetingDetail && /* @__PURE__ */ jsx(
1113
+ appointment.meetingDetail && /* @__PURE__ */ jsx4(
1056
1114
  MeetingDetailRow,
1057
1115
  {
1058
1116
  meetingType: appointment.meetingType,
1059
1117
  detail: appointment.meetingDetail
1060
1118
  }
1061
1119
  ),
1062
- /* @__PURE__ */ jsx(
1120
+ /* @__PURE__ */ jsx4(
1063
1121
  "span",
1064
1122
  {
1065
1123
  className: cn("text-sm font-medium", {
@@ -1071,9 +1129,9 @@ function AppointmentSection({
1071
1129
  children: APPOINTMENT_STATUS_LABEL[appointment.status]
1072
1130
  }
1073
1131
  ),
1074
- appointment.status === "requested" && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 pt-1", children: [
1075
- /* @__PURE__ */ jsx(Button, { size: "sm", className: "flex-1", onClick: onApproveAppointment, children: "Approve" }),
1076
- /* @__PURE__ */ jsx(
1132
+ appointment.status === "requested" && /* @__PURE__ */ jsxs3("div", { className: "flex gap-2 pt-1", children: [
1133
+ /* @__PURE__ */ jsx4(Button, { size: "sm", className: "flex-1", onClick: onApproveAppointment, children: "Approve" }),
1134
+ /* @__PURE__ */ jsx4(
1077
1135
  Button,
1078
1136
  {
1079
1137
  variant: "outline",
@@ -1083,7 +1141,7 @@ function AppointmentSection({
1083
1141
  children: "Decline"
1084
1142
  }
1085
1143
  ),
1086
- canReschedule && /* @__PURE__ */ jsx(
1144
+ canReschedule && /* @__PURE__ */ jsx4(
1087
1145
  Button,
1088
1146
  {
1089
1147
  variant: "ghost",
@@ -1094,7 +1152,7 @@ function AppointmentSection({
1094
1152
  }
1095
1153
  )
1096
1154
  ] }),
1097
- (appointment.status === "confirmed" || appointment.status === "cancelled") && canReschedule && /* @__PURE__ */ jsx(
1155
+ (appointment.status === "confirmed" || appointment.status === "cancelled") && canReschedule && /* @__PURE__ */ jsx4(
1098
1156
  Button,
1099
1157
  {
1100
1158
  variant: "outline",
@@ -1107,13 +1165,13 @@ function AppointmentSection({
1107
1165
  ] });
1108
1166
  }
1109
1167
  function PanelSectionHeader({ children }) {
1110
- return /* @__PURE__ */ jsx("p", { className: "mb-2.5 text-overline text-muted-foreground", children });
1168
+ return /* @__PURE__ */ jsx4("p", { className: "mb-2.5 text-overline text-muted-foreground", children });
1111
1169
  }
1112
1170
  function PanelSection({
1113
1171
  children,
1114
1172
  last = false
1115
1173
  }) {
1116
- return /* @__PURE__ */ jsx("div", { className: cn("px-4 py-4", !last && "border-b border-border"), children });
1174
+ return /* @__PURE__ */ jsx4("div", { className: cn("px-4 py-4", !last && "border-b border-border"), children });
1117
1175
  }
1118
1176
  function LeadInfoPanel({
1119
1177
  contact,
@@ -1139,8 +1197,8 @@ function LeadInfoPanel({
1139
1197
  }) {
1140
1198
  const isAnonymous = !contact.name.trim();
1141
1199
  const addToContactsDisabled = isAnonymous || isKnownContact;
1142
- return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col bg-background", className), children: [
1143
- /* @__PURE__ */ jsxs(
1200
+ return /* @__PURE__ */ jsxs3("div", { className: cn("flex flex-col bg-background", className), children: [
1201
+ /* @__PURE__ */ jsxs3(
1144
1202
  "div",
1145
1203
  {
1146
1204
  className: cn(
@@ -1148,7 +1206,7 @@ function LeadInfoPanel({
1148
1206
  "flex items-center justify-between border-b border-border px-4"
1149
1207
  ),
1150
1208
  children: [
1151
- onBack && /* @__PURE__ */ jsx(
1209
+ onBack && /* @__PURE__ */ jsx4(
1152
1210
  Button,
1153
1211
  {
1154
1212
  variant: "ghost",
@@ -1156,15 +1214,15 @@ function LeadInfoPanel({
1156
1214
  className: "size-8 shrink-0 md:hidden",
1157
1215
  onClick: onBack,
1158
1216
  "aria-label": "Back to conversation",
1159
- children: /* @__PURE__ */ jsx(ArrowLeft, { className: "size-4" })
1217
+ children: /* @__PURE__ */ jsx4(ArrowLeft2, { className: "size-4" })
1160
1218
  }
1161
1219
  ),
1162
- /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground", children: "Lead Info" }),
1163
- onToggleCollapse && /* @__PURE__ */ jsxs(Tooltip, { children: [
1164
- /* @__PURE__ */ jsx(
1220
+ /* @__PURE__ */ jsx4("span", { className: "text-sm font-semibold text-foreground", children: "Lead Info" }),
1221
+ onToggleCollapse && /* @__PURE__ */ jsxs3(Tooltip, { children: [
1222
+ /* @__PURE__ */ jsx4(
1165
1223
  TooltipTrigger,
1166
1224
  {
1167
- render: /* @__PURE__ */ jsx(
1225
+ render: /* @__PURE__ */ jsx4(
1168
1226
  Button,
1169
1227
  {
1170
1228
  variant: "ghost",
@@ -1172,8 +1230,8 @@ function LeadInfoPanel({
1172
1230
  className: "size-7",
1173
1231
  onClick: onToggleCollapse,
1174
1232
  "aria-label": isCollapsed ? "Expand panel" : "Collapse panel",
1175
- children: /* @__PURE__ */ jsx(
1176
- ChevronRight,
1233
+ children: /* @__PURE__ */ jsx4(
1234
+ ChevronRight2,
1177
1235
  {
1178
1236
  className: cn(
1179
1237
  "size-4 transition-transform duration-150",
@@ -1185,26 +1243,26 @@ function LeadInfoPanel({
1185
1243
  )
1186
1244
  }
1187
1245
  ),
1188
- /* @__PURE__ */ jsx(TooltipContent, { children: isCollapsed ? "Expand panel" : "Collapse panel" })
1246
+ /* @__PURE__ */ jsx4(TooltipContent, { children: isCollapsed ? "Expand panel" : "Collapse panel" })
1189
1247
  ] })
1190
1248
  ]
1191
1249
  }
1192
1250
  ),
1193
- !isCollapsed && /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: [
1194
- /* @__PURE__ */ jsxs(PanelSection, { children: [
1195
- /* @__PURE__ */ jsx(PanelSectionHeader, { children: "Contact" }),
1196
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
1197
- /* @__PURE__ */ jsx(ContactAvatar, { name: contact.name, size: "lg" }),
1198
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
1199
- /* @__PURE__ */ jsx("p", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
1200
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: source }),
1201
- topic && /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "mt-1 text-xs", children: topic })
1251
+ !isCollapsed && /* @__PURE__ */ jsxs3("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: [
1252
+ /* @__PURE__ */ jsxs3(PanelSection, { children: [
1253
+ /* @__PURE__ */ jsx4(PanelSectionHeader, { children: "Contact" }),
1254
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3", children: [
1255
+ /* @__PURE__ */ jsx4(ContactAvatar, { name: contact.name, size: "lg" }),
1256
+ /* @__PURE__ */ jsxs3("div", { className: "min-w-0 flex-1", children: [
1257
+ /* @__PURE__ */ jsx4("p", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
1258
+ /* @__PURE__ */ jsx4("p", { className: "text-sm text-muted-foreground", children: source }),
1259
+ topic && /* @__PURE__ */ jsx4(Badge, { variant: "secondary", className: "mt-1 text-xs", children: topic })
1202
1260
  ] })
1203
1261
  ] }),
1204
- (contact.email || contact.phone || firstSeen) && /* @__PURE__ */ jsxs("div", { className: "mt-3 flex flex-col gap-1.5", children: [
1205
- contact.email && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
1206
- /* @__PURE__ */ jsx(Mail, { className: "size-4 shrink-0" }),
1207
- /* @__PURE__ */ jsx(
1262
+ (contact.email || contact.phone || firstSeen) && /* @__PURE__ */ jsxs3("div", { className: "mt-3 flex flex-col gap-1.5", children: [
1263
+ contact.email && /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
1264
+ /* @__PURE__ */ jsx4(Mail3, { className: "size-4 shrink-0" }),
1265
+ /* @__PURE__ */ jsx4(
1208
1266
  "a",
1209
1267
  {
1210
1268
  href: `mailto:${contact.email}`,
@@ -1213,9 +1271,9 @@ function LeadInfoPanel({
1213
1271
  }
1214
1272
  )
1215
1273
  ] }),
1216
- contact.phone && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
1217
- /* @__PURE__ */ jsx(PhoneCall, { className: "size-4 shrink-0" }),
1218
- /* @__PURE__ */ jsx(
1274
+ contact.phone && /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
1275
+ /* @__PURE__ */ jsx4(PhoneCall, { className: "size-4 shrink-0" }),
1276
+ /* @__PURE__ */ jsx4(
1219
1277
  "a",
1220
1278
  {
1221
1279
  href: `tel:${contact.phone}`,
@@ -1224,31 +1282,31 @@ function LeadInfoPanel({
1224
1282
  }
1225
1283
  )
1226
1284
  ] }),
1227
- firstSeen && /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
1285
+ firstSeen && /* @__PURE__ */ jsxs3("p", { className: "text-sm text-muted-foreground", children: [
1228
1286
  "First seen: ",
1229
1287
  firstSeen
1230
1288
  ] })
1231
1289
  ] })
1232
1290
  ] }),
1233
- /* @__PURE__ */ jsxs(PanelSection, { children: [
1234
- /* @__PURE__ */ jsx(PanelSectionHeader, { children: "AI-Collected Data" }),
1235
- aiFields.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
1236
- /* @__PURE__ */ jsx(AICollectedDataSection, { fields: aiFields }),
1237
- /* @__PURE__ */ jsxs("div", { className: "mt-2.5 flex items-center gap-3 text-xs text-muted-foreground", children: [
1238
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
1239
- /* @__PURE__ */ jsx(CheckCircle2, { className: "size-3 text-success-text" }),
1291
+ /* @__PURE__ */ jsxs3(PanelSection, { children: [
1292
+ /* @__PURE__ */ jsx4(PanelSectionHeader, { children: "AI-Collected Data" }),
1293
+ aiFields.length > 0 ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
1294
+ /* @__PURE__ */ jsx4(AICollectedDataSection, { fields: aiFields }),
1295
+ /* @__PURE__ */ jsxs3("div", { className: "mt-2.5 flex items-center gap-3 text-xs text-muted-foreground", children: [
1296
+ /* @__PURE__ */ jsxs3("span", { className: "flex items-center gap-1", children: [
1297
+ /* @__PURE__ */ jsx4(CheckCircle2, { className: "size-3 text-success-text" }),
1240
1298
  "confirmed"
1241
1299
  ] }),
1242
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
1243
- /* @__PURE__ */ jsx(HelpCircle, { className: "size-3 text-warning-text" }),
1300
+ /* @__PURE__ */ jsxs3("span", { className: "flex items-center gap-1", children: [
1301
+ /* @__PURE__ */ jsx4(HelpCircle, { className: "size-3 text-warning-text" }),
1244
1302
  "estimated"
1245
1303
  ] })
1246
1304
  ] })
1247
- ] }) : /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "AI is still gathering information..." })
1305
+ ] }) : /* @__PURE__ */ jsx4("p", { className: "text-sm text-muted-foreground", children: "AI is still gathering information..." })
1248
1306
  ] }),
1249
- /* @__PURE__ */ jsxs(PanelSection, { children: [
1250
- /* @__PURE__ */ jsx(PanelSectionHeader, { children: "Appointment" }),
1251
- appointment ? /* @__PURE__ */ jsx(
1307
+ /* @__PURE__ */ jsxs3(PanelSection, { children: [
1308
+ /* @__PURE__ */ jsx4(PanelSectionHeader, { children: "Appointment" }),
1309
+ appointment ? /* @__PURE__ */ jsx4(
1252
1310
  AppointmentSection,
1253
1311
  {
1254
1312
  appointment,
@@ -1258,7 +1316,7 @@ function LeadInfoPanel({
1258
1316
  onDeclineAppointment,
1259
1317
  onRescheduleAppointment
1260
1318
  }
1261
- ) : /* @__PURE__ */ jsxs(
1319
+ ) : /* @__PURE__ */ jsxs3(
1262
1320
  Button,
1263
1321
  {
1264
1322
  variant: "outline",
@@ -1267,20 +1325,20 @@ function LeadInfoPanel({
1267
1325
  disabled: isAnonymous,
1268
1326
  onClick: onBookAppointment,
1269
1327
  children: [
1270
- /* @__PURE__ */ jsx(Plus, { className: "mr-1.5 size-3.5" }),
1328
+ /* @__PURE__ */ jsx4(Plus, { className: "mr-1.5 size-3.5" }),
1271
1329
  "Book Appointment"
1272
1330
  ]
1273
1331
  }
1274
1332
  )
1275
1333
  ] }),
1276
- /* @__PURE__ */ jsxs(PanelSection, { children: [
1277
- /* @__PURE__ */ jsx(PanelSectionHeader, { children: "CRM Actions" }),
1278
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1279
- /* @__PURE__ */ jsxs(Tooltip, { children: [
1280
- /* @__PURE__ */ jsx(
1334
+ /* @__PURE__ */ jsxs3(PanelSection, { children: [
1335
+ /* @__PURE__ */ jsx4(PanelSectionHeader, { children: "CRM Actions" }),
1336
+ /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-2", children: [
1337
+ /* @__PURE__ */ jsxs3(Tooltip, { children: [
1338
+ /* @__PURE__ */ jsx4(
1281
1339
  TooltipTrigger,
1282
1340
  {
1283
- render: /* @__PURE__ */ jsxs(
1341
+ render: /* @__PURE__ */ jsxs3(
1284
1342
  Button,
1285
1343
  {
1286
1344
  variant: "outline",
@@ -1289,16 +1347,16 @@ function LeadInfoPanel({
1289
1347
  disabled: addToContactsDisabled,
1290
1348
  onClick: onAddToContacts,
1291
1349
  children: [
1292
- /* @__PURE__ */ jsx(UserPlus, { className: "mr-1.5 size-3.5" }),
1350
+ /* @__PURE__ */ jsx4(UserPlus, { className: "mr-1.5 size-3.5" }),
1293
1351
  "Add to Contacts"
1294
1352
  ]
1295
1353
  }
1296
1354
  )
1297
1355
  }
1298
1356
  ),
1299
- isKnownContact && /* @__PURE__ */ jsx(TooltipContent, { children: "Already in contacts" })
1357
+ isKnownContact && /* @__PURE__ */ jsx4(TooltipContent, { children: "Already in contacts" })
1300
1358
  ] }),
1301
- /* @__PURE__ */ jsxs(
1359
+ /* @__PURE__ */ jsxs3(
1302
1360
  Button,
1303
1361
  {
1304
1362
  variant: "outline",
@@ -1307,23 +1365,23 @@ function LeadInfoPanel({
1307
1365
  disabled: isAnonymous,
1308
1366
  onClick: onCreateOpportunity,
1309
1367
  children: [
1310
- /* @__PURE__ */ jsx(Briefcase, { className: "mr-1.5 size-3.5" }),
1368
+ /* @__PURE__ */ jsx4(Briefcase, { className: "mr-1.5 size-3.5" }),
1311
1369
  "Add to CRM"
1312
1370
  ]
1313
1371
  }
1314
1372
  )
1315
1373
  ] })
1316
1374
  ] }),
1317
- /* @__PURE__ */ jsxs(PanelSection, { last: true, children: [
1318
- /* @__PURE__ */ jsxs("div", { className: "mb-2.5 flex items-center justify-between", children: [
1319
- /* @__PURE__ */ jsx("p", { className: "text-overline text-muted-foreground", children: "Internal Notes" }),
1320
- notesSaveStatus === "saving" && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "Saving..." }),
1321
- notesSaveStatus === "saved" && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 text-xs text-success-text", children: [
1322
- /* @__PURE__ */ jsx(CheckCircle2, { className: "size-3" }),
1375
+ /* @__PURE__ */ jsxs3(PanelSection, { last: true, children: [
1376
+ /* @__PURE__ */ jsxs3("div", { className: "mb-2.5 flex items-center justify-between", children: [
1377
+ /* @__PURE__ */ jsx4("p", { className: "text-overline text-muted-foreground", children: "Internal Notes" }),
1378
+ notesSaveStatus === "saving" && /* @__PURE__ */ jsx4("span", { className: "text-xs text-muted-foreground", children: "Saving..." }),
1379
+ notesSaveStatus === "saved" && /* @__PURE__ */ jsxs3("span", { className: "flex items-center gap-1 text-xs text-success-text", children: [
1380
+ /* @__PURE__ */ jsx4(CheckCircle2, { className: "size-3" }),
1323
1381
  "Saved"
1324
1382
  ] })
1325
1383
  ] }),
1326
- /* @__PURE__ */ jsx(
1384
+ /* @__PURE__ */ jsx4(
1327
1385
  Textarea,
1328
1386
  {
1329
1387
  value: internalNotes,
@@ -1337,6 +1395,9 @@ function LeadInfoPanel({
1337
1395
  ] })
1338
1396
  ] });
1339
1397
  }
1398
+
1399
+ // src/components/ui/ai-conversations/index.tsx
1400
+ import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
1340
1401
  function ConversationsPage({
1341
1402
  conversations,
1342
1403
  activeConversationId,
@@ -1355,7 +1416,6 @@ function ConversationsPage({
1355
1416
  onChannelFilterChange,
1356
1417
  channel,
1357
1418
  onChannelChange,
1358
- channelType,
1359
1419
  isEmailIntegrated,
1360
1420
  inputValue,
1361
1421
  internalNotes,
@@ -1376,6 +1436,7 @@ function ConversationsPage({
1376
1436
  onSendEmail,
1377
1437
  onTakeOver,
1378
1438
  onLetAiHandle,
1439
+ emailReplySubject,
1379
1440
  onReopen,
1380
1441
  onMarkUrgent,
1381
1442
  onUnmarkUrgent,
@@ -1404,12 +1465,12 @@ function ConversationsPage({
1404
1465
  onToggleLeadPanel == null ? void 0 : onToggleLeadPanel();
1405
1466
  setMobilePanel(showLeadPanel ? "chat" : "lead");
1406
1467
  };
1407
- return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(
1468
+ return /* @__PURE__ */ jsx5(TooltipProvider, { children: /* @__PURE__ */ jsxs4(
1408
1469
  "div",
1409
1470
  {
1410
1471
  className: cn("flex h-full overflow-hidden bg-background", className),
1411
1472
  children: [
1412
- /* @__PURE__ */ jsx(
1473
+ /* @__PURE__ */ jsx5(
1413
1474
  ConversationList,
1414
1475
  {
1415
1476
  conversations,
@@ -1427,12 +1488,11 @@ function ConversationsPage({
1427
1488
  onLoadMore,
1428
1489
  className: cn(
1429
1490
  "shrink-0 md:w-[320px]",
1430
- // Mobile: full width, visible only on list panel
1431
1491
  mobilePanel === "list" ? "flex w-full md:flex" : "hidden md:flex"
1432
1492
  )
1433
1493
  }
1434
1494
  ),
1435
- contact ? /* @__PURE__ */ jsx(
1495
+ contact ? /* @__PURE__ */ jsx5(
1436
1496
  ChatThread,
1437
1497
  {
1438
1498
  contact,
@@ -1442,7 +1502,6 @@ function ConversationsPage({
1442
1502
  isAiTyping,
1443
1503
  channel,
1444
1504
  onChannelChange,
1445
- channelType,
1446
1505
  isEmailIntegrated,
1447
1506
  inputValue,
1448
1507
  onInputChange,
@@ -1450,6 +1509,7 @@ function ConversationsPage({
1450
1509
  onSendEmail,
1451
1510
  onTakeOver,
1452
1511
  onLetAiHandle,
1512
+ emailReplySubject,
1453
1513
  onReopen,
1454
1514
  onMarkUrgent,
1455
1515
  onUnmarkUrgent,
@@ -1466,31 +1526,29 @@ function ConversationsPage({
1466
1526
  )
1467
1527
  },
1468
1528
  contact.id
1469
- ) : /* @__PURE__ */ jsx(
1529
+ ) : /* @__PURE__ */ jsx5(
1470
1530
  "div",
1471
1531
  {
1472
1532
  className: cn(
1473
1533
  "min-w-0 flex-1 items-center justify-center border-r border-border bg-muted/10",
1474
1534
  mobilePanel === "chat" ? "flex md:flex" : "hidden md:flex"
1475
1535
  ),
1476
- children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
1477
- /* @__PURE__ */ jsx(MessageSquare, { className: "size-10 opacity-30" }),
1478
- /* @__PURE__ */ jsx("p", { className: "text-sm", children: "Select a conversation" })
1536
+ children: /* @__PURE__ */ jsxs4("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
1537
+ /* @__PURE__ */ jsx5(MessageSquare3, { className: "size-10 opacity-30" }),
1538
+ /* @__PURE__ */ jsx5("p", { className: "text-sm", children: "Select a conversation" })
1479
1539
  ] })
1480
1540
  }
1481
1541
  ),
1482
- contact && /* @__PURE__ */ jsxs(Fragment, { children: [
1483
- /* @__PURE__ */ jsx(
1542
+ contact && /* @__PURE__ */ jsxs4(Fragment4, { children: [
1543
+ /* @__PURE__ */ jsx5(
1484
1544
  "div",
1485
1545
  {
1486
1546
  className: cn(
1487
- // Mobile: full-width, instant show/hide based on mobilePanel
1488
1547
  mobilePanel === "lead" ? "flex w-full shrink-0 flex-col" : "hidden",
1489
- // Desktop: always rendered, animate width open/close
1490
1548
  "md:block md:shrink-0 md:overflow-hidden md:transition-[width] md:duration-200 md:ease-in-out",
1491
1549
  showLeadPanel ? "md:w-[320px]" : "md:w-0"
1492
1550
  ),
1493
- children: /* @__PURE__ */ jsx(
1551
+ children: /* @__PURE__ */ jsx5(
1494
1552
  LeadInfoPanel,
1495
1553
  {
1496
1554
  contact,
@@ -1516,11 +1574,11 @@ function ConversationsPage({
1516
1574
  )
1517
1575
  }
1518
1576
  ),
1519
- !showLeadPanel && onToggleLeadPanel && /* @__PURE__ */ jsx("div", { className: "hidden shrink-0 items-start border-l border-border pt-[29px] md:flex", children: /* @__PURE__ */ jsxs(Tooltip, { children: [
1520
- /* @__PURE__ */ jsx(
1577
+ !showLeadPanel && onToggleLeadPanel && /* @__PURE__ */ jsx5("div", { className: "hidden shrink-0 items-start border-l border-border pt-[29px] md:flex", children: /* @__PURE__ */ jsxs4(Tooltip, { children: [
1578
+ /* @__PURE__ */ jsx5(
1521
1579
  TooltipTrigger,
1522
1580
  {
1523
- render: /* @__PURE__ */ jsx(
1581
+ render: /* @__PURE__ */ jsx5(
1524
1582
  Button,
1525
1583
  {
1526
1584
  variant: "ghost",
@@ -1528,12 +1586,12 @@ function ConversationsPage({
1528
1586
  className: "size-8",
1529
1587
  "aria-label": "Show lead info",
1530
1588
  onClick: handleToggleLeadPanel,
1531
- children: /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4" })
1589
+ children: /* @__PURE__ */ jsx5(ChevronLeft, { className: "size-4" })
1532
1590
  }
1533
1591
  )
1534
1592
  }
1535
1593
  ),
1536
- /* @__PURE__ */ jsx(TooltipContent, { children: "Show lead info" })
1594
+ /* @__PURE__ */ jsx5(TooltipContent, { children: "Show lead info" })
1537
1595
  ] }) })
1538
1596
  ] })
1539
1597
  ]
@@ -1563,13 +1621,13 @@ function AiConvAssignAdvisorDialog({
1563
1621
  setRoleFilter("");
1564
1622
  }
1565
1623
  };
1566
- return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { children: [
1567
- /* @__PURE__ */ jsxs(DialogHeader, { children: [
1568
- /* @__PURE__ */ jsx(DialogTitle, { children: "Assign to advisor" }),
1569
- /* @__PURE__ */ jsx(DialogDescription, { children: "Choose an advisor to handle this conversation." })
1624
+ return /* @__PURE__ */ jsx5(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs4(DialogContent, { children: [
1625
+ /* @__PURE__ */ jsxs4(DialogHeader, { children: [
1626
+ /* @__PURE__ */ jsx5(DialogTitle, { children: "Assign to advisor" }),
1627
+ /* @__PURE__ */ jsx5(DialogDescription, { children: "Choose an advisor to handle this conversation." })
1570
1628
  ] }),
1571
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0", children: [
1572
- roles.length > 0 && /* @__PURE__ */ jsx("div", { className: "pb-3", children: /* @__PURE__ */ jsxs(
1629
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-0", children: [
1630
+ roles.length > 0 && /* @__PURE__ */ jsx5("div", { className: "pb-3", children: /* @__PURE__ */ jsxs4(
1573
1631
  ToggleGroup,
1574
1632
  {
1575
1633
  type: "single",
@@ -1582,14 +1640,14 @@ function AiConvAssignAdvisorDialog({
1582
1640
  setRoleFilter(!v || v === "__all__" ? "" : v);
1583
1641
  },
1584
1642
  children: [
1585
- /* @__PURE__ */ jsx(ToggleGroupItem, { value: "__all__", children: "All" }),
1586
- roles.map((role) => /* @__PURE__ */ jsx(ToggleGroupItem, { value: role, children: role }, role))
1643
+ /* @__PURE__ */ jsx5(ToggleGroupItem, { value: "__all__", children: "All" }),
1644
+ roles.map((role) => /* @__PURE__ */ jsx5(ToggleGroupItem, { value: role, children: role }, role))
1587
1645
  ]
1588
1646
  }
1589
1647
  ) }),
1590
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border border-input px-3", children: [
1591
- /* @__PURE__ */ jsx(Search, { className: "size-4 shrink-0 text-muted-foreground" }),
1592
- /* @__PURE__ */ jsx(
1648
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 border border-input px-3", children: [
1649
+ /* @__PURE__ */ jsx5(Search2, { className: "size-4 shrink-0 text-muted-foreground" }),
1650
+ /* @__PURE__ */ jsx5(
1593
1651
  "input",
1594
1652
  {
1595
1653
  type: "text",
@@ -1600,7 +1658,7 @@ function AiConvAssignAdvisorDialog({
1600
1658
  }
1601
1659
  )
1602
1660
  ] }),
1603
- /* @__PURE__ */ jsx("div", { className: "max-h-52 overflow-y-auto border border-t-0 border-input", children: filtered.length === 0 ? /* @__PURE__ */ jsx("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "No advisors found." }) : filtered.map((advisor) => /* @__PURE__ */ jsxs(
1661
+ /* @__PURE__ */ jsx5("div", { className: "max-h-52 overflow-y-auto border border-t-0 border-input", children: filtered.length === 0 ? /* @__PURE__ */ jsx5("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "No advisors found." }) : filtered.map((advisor) => /* @__PURE__ */ jsxs4(
1604
1662
  "button",
1605
1663
  {
1606
1664
  type: "button",
@@ -1610,19 +1668,19 @@ function AiConvAssignAdvisorDialog({
1610
1668
  value === advisor.id && "bg-muted font-medium"
1611
1669
  ),
1612
1670
  children: [
1613
- /* @__PURE__ */ jsx(Avatar, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "font-semibold", children: advisor.initials }) }),
1614
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
1615
- /* @__PURE__ */ jsx("p", { className: "truncate text-sm", children: advisor.name }),
1616
- advisor.role && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-muted-foreground", children: advisor.role })
1671
+ /* @__PURE__ */ jsx5(Avatar, { size: "sm", children: /* @__PURE__ */ jsx5(AvatarFallback, { className: "font-semibold", children: advisor.initials }) }),
1672
+ /* @__PURE__ */ jsxs4("div", { className: "min-w-0 flex-1", children: [
1673
+ /* @__PURE__ */ jsx5("p", { className: "truncate text-sm", children: advisor.name }),
1674
+ advisor.role && /* @__PURE__ */ jsx5("p", { className: "truncate text-xs text-muted-foreground", children: advisor.role })
1617
1675
  ] })
1618
1676
  ]
1619
1677
  },
1620
1678
  advisor.id
1621
1679
  )) })
1622
1680
  ] }),
1623
- /* @__PURE__ */ jsxs(DialogFooter, { children: [
1624
- /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
1625
- /* @__PURE__ */ jsx(Button, { onClick: onConfirm, children: "Assign" })
1681
+ /* @__PURE__ */ jsxs4(DialogFooter, { children: [
1682
+ /* @__PURE__ */ jsx5(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
1683
+ /* @__PURE__ */ jsx5(Button, { onClick: onConfirm, children: "Assign" })
1626
1684
  ] })
1627
1685
  ] }) });
1628
1686
  }