@wealthx/shadcn 1.5.34 → 1.5.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +109 -109
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-EEI4FLEE.mjs → chunk-DIH2NZZ3.mjs} +347 -272
- package/dist/components/ui/ai-conversations/index.js +419 -350
- package/dist/components/ui/ai-conversations/index.mjs +1 -1
- package/dist/index.js +4403 -4334
- package/dist/index.mjs +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/ui/ai-conversations/bubble.tsx +242 -0
- package/src/components/ui/ai-conversations/index.tsx +9 -8
- package/src/components/ui/ai-conversations/thread.tsx +11 -163
- package/src/styles/styles-css.ts +1 -1
|
@@ -57,6 +57,10 @@ import {
|
|
|
57
57
|
cn,
|
|
58
58
|
getInitials
|
|
59
59
|
} from "./chunk-AFML43VJ.mjs";
|
|
60
|
+
import {
|
|
61
|
+
__spreadProps,
|
|
62
|
+
__spreadValues
|
|
63
|
+
} from "./chunk-WNQUEZJF.mjs";
|
|
60
64
|
|
|
61
65
|
// src/components/ui/ai-conversations/index.tsx
|
|
62
66
|
import { useState } from "react";
|
|
@@ -178,8 +182,8 @@ function ConversationListItem({
|
|
|
178
182
|
function filterConversations(conversations, query, filter, channelFilter) {
|
|
179
183
|
const q = query.toLowerCase();
|
|
180
184
|
return conversations.filter((c) => {
|
|
181
|
-
var
|
|
182
|
-
const matchesFilter = filter === "all" || (filter === "emails" ? ((
|
|
185
|
+
var _a2, _b;
|
|
186
|
+
const matchesFilter = filter === "all" || (filter === "emails" ? ((_a2 = c.channel) != null ? _a2 : "chat") === "email" : c.status === filter);
|
|
183
187
|
const matchesChannel = channelFilter === "all" || ((_b = c.channel) != null ? _b : "chat") === channelFilter;
|
|
184
188
|
const matchesSearch = !q || c.contact.name.toLowerCase().includes(q) || c.lastMessage.toLowerCase().includes(q);
|
|
185
189
|
return matchesFilter && matchesChannel && matchesSearch;
|
|
@@ -316,14 +320,11 @@ import { useEditor, EditorContent } from "@tiptap/react";
|
|
|
316
320
|
import StarterKit from "@tiptap/starter-kit";
|
|
317
321
|
import TiptapUnderline from "@tiptap/extension-underline";
|
|
318
322
|
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
323
|
import {
|
|
323
324
|
Archive,
|
|
324
325
|
ArrowLeft,
|
|
325
326
|
Bold,
|
|
326
|
-
Bot,
|
|
327
|
+
Bot as Bot2,
|
|
327
328
|
ChevronDown,
|
|
328
329
|
ChevronRight,
|
|
329
330
|
Flag as Flag2,
|
|
@@ -338,8 +339,18 @@ import {
|
|
|
338
339
|
Underline,
|
|
339
340
|
UserCheck
|
|
340
341
|
} from "lucide-react";
|
|
341
|
-
|
|
342
|
-
|
|
342
|
+
|
|
343
|
+
// src/components/ui/ai-conversations/bubble.tsx
|
|
344
|
+
import ReactMarkdown from "react-markdown";
|
|
345
|
+
import rehypeRaw from "rehype-raw";
|
|
346
|
+
import rehypeSanitize, { defaultSchema } from "rehype-sanitize";
|
|
347
|
+
import { Bot } from "lucide-react";
|
|
348
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
349
|
+
var _a;
|
|
350
|
+
var EMAIL_SANITIZE_SCHEMA = __spreadProps(__spreadValues({}, defaultSchema), {
|
|
351
|
+
strip: ["script", "style", "head", ...(_a = defaultSchema.strip) != null ? _a : []]
|
|
352
|
+
});
|
|
353
|
+
function BubbleAvatar2({
|
|
343
354
|
role,
|
|
344
355
|
senderName
|
|
345
356
|
}) {
|
|
@@ -351,16 +362,21 @@ function BubbleAvatar({
|
|
|
351
362
|
}
|
|
352
363
|
return /* @__PURE__ */ jsx3(Avatar, { size: "sm", children: /* @__PURE__ */ jsx3(AvatarFallback, { children: getInitials(senderName != null ? senderName : "?") }) });
|
|
353
364
|
}
|
|
354
|
-
function
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
365
|
+
function SystemDivider({
|
|
366
|
+
content,
|
|
367
|
+
className
|
|
368
|
+
}) {
|
|
369
|
+
return /* @__PURE__ */ jsxs2("div", { className: cn("my-2 flex items-center gap-3 px-2", className), children: [
|
|
370
|
+
/* @__PURE__ */ jsx3(Separator, { className: "flex-1" }),
|
|
371
|
+
/* @__PURE__ */ jsx3("span", { className: "shrink-0 text-caption text-muted-foreground", children: content }),
|
|
372
|
+
/* @__PURE__ */ jsx3(Separator, { className: "flex-1" })
|
|
373
|
+
] });
|
|
374
|
+
}
|
|
375
|
+
function ChatMessageBubble({
|
|
376
|
+
message,
|
|
377
|
+
className
|
|
378
|
+
}) {
|
|
379
|
+
const { role, content, timestamp, senderName } = message;
|
|
364
380
|
const isAdvisor = role === "advisor";
|
|
365
381
|
const isBot = role === "bot";
|
|
366
382
|
const isVisitor = role === "visitor";
|
|
@@ -374,13 +390,65 @@ function ChatBubble({ message, channel, className }) {
|
|
|
374
390
|
className
|
|
375
391
|
),
|
|
376
392
|
children: [
|
|
377
|
-
/* @__PURE__ */ jsx3(
|
|
393
|
+
/* @__PURE__ */ jsx3(BubbleAvatar2, { role, senderName }),
|
|
378
394
|
/* @__PURE__ */ jsxs2(
|
|
379
395
|
"div",
|
|
380
396
|
{
|
|
381
397
|
className: cn(
|
|
382
|
-
"flex flex-col gap-1",
|
|
383
|
-
|
|
398
|
+
"flex max-w-[70%] flex-col gap-1",
|
|
399
|
+
isAdvisor && "items-end"
|
|
400
|
+
),
|
|
401
|
+
children: [
|
|
402
|
+
/* @__PURE__ */ jsx3("span", { className: "text-caption text-muted-foreground", children: displayName }),
|
|
403
|
+
/* @__PURE__ */ jsx3(
|
|
404
|
+
"div",
|
|
405
|
+
{
|
|
406
|
+
className: cn(
|
|
407
|
+
"break-words px-3 py-2 text-sm leading-relaxed [&_a]:underline [&_p]:m-0",
|
|
408
|
+
isBot && "border border-border bg-muted/60 text-foreground [&_a]:text-primary",
|
|
409
|
+
isVisitor && "border border-border bg-background text-foreground [&_a]:text-primary",
|
|
410
|
+
isAdvisor && "bg-primary text-primary-foreground [&_a]:text-primary-foreground"
|
|
411
|
+
),
|
|
412
|
+
children: /* @__PURE__ */ jsx3(
|
|
413
|
+
ReactMarkdown,
|
|
414
|
+
{
|
|
415
|
+
rehypePlugins: [rehypeRaw, [rehypeSanitize, defaultSchema]],
|
|
416
|
+
children: content
|
|
417
|
+
}
|
|
418
|
+
)
|
|
419
|
+
}
|
|
420
|
+
),
|
|
421
|
+
timestamp && /* @__PURE__ */ jsx3("span", { className: "text-caption text-muted-foreground", children: timestamp })
|
|
422
|
+
]
|
|
423
|
+
}
|
|
424
|
+
)
|
|
425
|
+
]
|
|
426
|
+
}
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
function EmailMessageBubble({
|
|
430
|
+
message,
|
|
431
|
+
className
|
|
432
|
+
}) {
|
|
433
|
+
const { role, content, timestamp, senderName, subject } = message;
|
|
434
|
+
const isAdvisor = role === "advisor";
|
|
435
|
+
const isBot = role === "bot";
|
|
436
|
+
const displayName = isBot ? "AI Assistant" : isAdvisor ? senderName != null ? senderName : "Advisor" : senderName != null ? senderName : "Lead";
|
|
437
|
+
return /* @__PURE__ */ jsxs2(
|
|
438
|
+
"div",
|
|
439
|
+
{
|
|
440
|
+
className: cn(
|
|
441
|
+
"flex gap-2.5",
|
|
442
|
+
isAdvisor ? "flex-row-reverse" : "flex-row",
|
|
443
|
+
className
|
|
444
|
+
),
|
|
445
|
+
children: [
|
|
446
|
+
/* @__PURE__ */ jsx3(BubbleAvatar2, { role, senderName }),
|
|
447
|
+
/* @__PURE__ */ jsxs2(
|
|
448
|
+
"div",
|
|
449
|
+
{
|
|
450
|
+
className: cn(
|
|
451
|
+
"flex w-full max-w-[85%] flex-col gap-1",
|
|
384
452
|
isAdvisor && "items-end"
|
|
385
453
|
),
|
|
386
454
|
children: [
|
|
@@ -389,29 +457,24 @@ function ChatBubble({ message, channel, className }) {
|
|
|
389
457
|
"div",
|
|
390
458
|
{
|
|
391
459
|
className: cn(
|
|
392
|
-
"text-sm leading-relaxed
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
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"
|
|
460
|
+
"w-full min-w-0 break-words whitespace-pre-line border border-border bg-background px-4 py-3 text-sm leading-relaxed [overflow-wrap:anywhere]",
|
|
461
|
+
"[&_p]:mb-2 [&_p:last-child]:mb-0",
|
|
462
|
+
"[&_ul]:mb-2 [&_ul]:list-disc [&_ul]:pl-4",
|
|
463
|
+
"[&_ol]:mb-2 [&_ol]:list-decimal [&_ol]:pl-4",
|
|
464
|
+
"[&_li]:mb-0.5",
|
|
465
|
+
"[&_h1]:mb-2 [&_h1]:text-sm [&_h1]:font-bold",
|
|
466
|
+
"[&_h2]:mb-1.5 [&_h2]:text-sm [&_h2]:font-semibold",
|
|
467
|
+
"[&_h3]:mb-1 [&_h3]:text-sm [&_h3]:font-medium",
|
|
468
|
+
"[&_strong]:font-semibold [&_em]:italic",
|
|
469
|
+
"[&_a]:text-primary [&_a]:underline",
|
|
470
|
+
"[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:italic [&_blockquote]:text-muted-foreground",
|
|
471
|
+
"[&_hr]:my-3 [&_hr]:border-border",
|
|
472
|
+
"[&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:bg-transparent [&_pre]:p-0 [&_pre]:font-[inherit] [&_pre]:text-[length:inherit]",
|
|
473
|
+
"[&_code]:whitespace-pre-wrap [&_code]:break-words [&_code]:bg-transparent [&_code]:p-0 [&_code]:font-[inherit] [&_code]:text-[length:inherit]",
|
|
474
|
+
isAdvisor && "bg-muted/30"
|
|
412
475
|
),
|
|
413
476
|
children: [
|
|
414
|
-
|
|
477
|
+
subject && /* @__PURE__ */ jsxs2("div", { className: "mb-2.5 border-b border-border pb-2", children: [
|
|
415
478
|
/* @__PURE__ */ jsx3("span", { className: "text-xs font-medium text-muted-foreground", children: "Subject:" }),
|
|
416
479
|
" ",
|
|
417
480
|
/* @__PURE__ */ jsx3("span", { className: "text-sm font-semibold text-foreground", children: subject })
|
|
@@ -419,7 +482,7 @@ function ChatBubble({ message, channel, className }) {
|
|
|
419
482
|
/* @__PURE__ */ jsx3(
|
|
420
483
|
ReactMarkdown,
|
|
421
484
|
{
|
|
422
|
-
rehypePlugins: [rehypeRaw, [rehypeSanitize,
|
|
485
|
+
rehypePlugins: [rehypeRaw, [rehypeSanitize, EMAIL_SANITIZE_SCHEMA]],
|
|
423
486
|
children: content
|
|
424
487
|
}
|
|
425
488
|
)
|
|
@@ -434,13 +497,25 @@ function ChatBubble({ message, channel, className }) {
|
|
|
434
497
|
}
|
|
435
498
|
);
|
|
436
499
|
}
|
|
500
|
+
function ChatBubble({ message, channel, className }) {
|
|
501
|
+
if (message.role === "system") {
|
|
502
|
+
return /* @__PURE__ */ jsx3(SystemDivider, { content: message.content, className });
|
|
503
|
+
}
|
|
504
|
+
if (channel === "email") {
|
|
505
|
+
return /* @__PURE__ */ jsx3(EmailMessageBubble, { message, className });
|
|
506
|
+
}
|
|
507
|
+
return /* @__PURE__ */ jsx3(ChatMessageBubble, { message, className });
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
// src/components/ui/ai-conversations/thread.tsx
|
|
511
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
437
512
|
function ComposerToolbarButton({
|
|
438
513
|
label,
|
|
439
514
|
icon: Icon,
|
|
440
515
|
pressed,
|
|
441
516
|
onToggle
|
|
442
517
|
}) {
|
|
443
|
-
return /* @__PURE__ */
|
|
518
|
+
return /* @__PURE__ */ jsx4(
|
|
444
519
|
"button",
|
|
445
520
|
{
|
|
446
521
|
type: "button",
|
|
@@ -451,7 +526,7 @@ function ComposerToolbarButton({
|
|
|
451
526
|
"flex size-7 items-center justify-center transition-colors",
|
|
452
527
|
pressed ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
453
528
|
),
|
|
454
|
-
children: /* @__PURE__ */
|
|
529
|
+
children: /* @__PURE__ */ jsx4(Icon, { className: "size-3.5" })
|
|
455
530
|
}
|
|
456
531
|
);
|
|
457
532
|
}
|
|
@@ -467,7 +542,7 @@ function ComposerLinkPopover({
|
|
|
467
542
|
setOpen(false);
|
|
468
543
|
setUrl("");
|
|
469
544
|
};
|
|
470
|
-
return /* @__PURE__ */
|
|
545
|
+
return /* @__PURE__ */ jsxs3(
|
|
471
546
|
Popover,
|
|
472
547
|
{
|
|
473
548
|
open,
|
|
@@ -480,7 +555,7 @@ function ComposerLinkPopover({
|
|
|
480
555
|
setOpen(newOpen);
|
|
481
556
|
},
|
|
482
557
|
children: [
|
|
483
|
-
/* @__PURE__ */
|
|
558
|
+
/* @__PURE__ */ jsx4(
|
|
484
559
|
PopoverTrigger,
|
|
485
560
|
{
|
|
486
561
|
"aria-label": "Insert link",
|
|
@@ -488,11 +563,11 @@ function ComposerLinkPopover({
|
|
|
488
563
|
"flex size-7 items-center justify-center transition-colors",
|
|
489
564
|
(editor == null ? void 0 : editor.isActive("link")) ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
490
565
|
),
|
|
491
|
-
children: /* @__PURE__ */
|
|
566
|
+
children: /* @__PURE__ */ jsx4(Link2, { className: "size-3.5" })
|
|
492
567
|
}
|
|
493
568
|
),
|
|
494
|
-
/* @__PURE__ */
|
|
495
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ jsx4(PopoverContent, { className: "w-72 p-2", align: "start", children: /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-1.5", children: [
|
|
570
|
+
/* @__PURE__ */ jsx4(
|
|
496
571
|
"input",
|
|
497
572
|
{
|
|
498
573
|
type: "url",
|
|
@@ -504,7 +579,7 @@ function ComposerLinkPopover({
|
|
|
504
579
|
autoFocus: true
|
|
505
580
|
}
|
|
506
581
|
),
|
|
507
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ jsx4(Button, { size: "sm", className: "h-8 px-3", onClick: handleApply, children: "Apply" })
|
|
508
583
|
] }) })
|
|
509
584
|
]
|
|
510
585
|
}
|
|
@@ -514,8 +589,8 @@ function ComposerEmailFieldRow({
|
|
|
514
589
|
label,
|
|
515
590
|
children
|
|
516
591
|
}) {
|
|
517
|
-
return /* @__PURE__ */
|
|
518
|
-
/* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3 border-b border-border px-4 py-2.5", children: [
|
|
593
|
+
/* @__PURE__ */ jsx4("span", { className: "w-14 shrink-0 text-sm text-muted-foreground", children: label }),
|
|
519
594
|
children
|
|
520
595
|
] });
|
|
521
596
|
}
|
|
@@ -580,7 +655,7 @@ function ChatComposer({
|
|
|
580
655
|
setEmailSubject(emailReplySubject ? `Re: ${emailReplySubject}` : "");
|
|
581
656
|
}
|
|
582
657
|
};
|
|
583
|
-
return /* @__PURE__ */
|
|
658
|
+
return /* @__PURE__ */ jsxs3(
|
|
584
659
|
"div",
|
|
585
660
|
{
|
|
586
661
|
className: cn(
|
|
@@ -588,27 +663,27 @@ function ChatComposer({
|
|
|
588
663
|
className
|
|
589
664
|
),
|
|
590
665
|
children: [
|
|
591
|
-
isEmailIntegrated && /* @__PURE__ */
|
|
666
|
+
isEmailIntegrated && /* @__PURE__ */ jsx4("div", { className: "border-b border-border px-3 py-2", children: /* @__PURE__ */ jsx4(
|
|
592
667
|
Tabs,
|
|
593
668
|
{
|
|
594
669
|
value: channel,
|
|
595
670
|
onValueChange: (v) => v && handleChannelChange(v),
|
|
596
|
-
children: /* @__PURE__ */
|
|
597
|
-
/* @__PURE__ */
|
|
598
|
-
/* @__PURE__ */
|
|
671
|
+
children: /* @__PURE__ */ jsxs3(TabsList, { variant: "default", className: "w-full", children: [
|
|
672
|
+
/* @__PURE__ */ jsxs3(TabsTrigger, { value: "chat", className: "flex-1 gap-1.5", children: [
|
|
673
|
+
/* @__PURE__ */ jsx4(MessageSquare2, { className: "size-3.5" }),
|
|
599
674
|
"Chat"
|
|
600
675
|
] }),
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ jsxs3(TabsTrigger, { value: "email", className: "flex-1 gap-1.5", children: [
|
|
677
|
+
/* @__PURE__ */ jsx4(Mail2, { className: "size-3.5" }),
|
|
603
678
|
"Email"
|
|
604
679
|
] })
|
|
605
680
|
] })
|
|
606
681
|
}
|
|
607
682
|
) }),
|
|
608
|
-
mode === "ai" ? /* @__PURE__ */
|
|
609
|
-
/* @__PURE__ */
|
|
610
|
-
/* @__PURE__ */
|
|
611
|
-
/* @__PURE__ */
|
|
683
|
+
mode === "ai" ? /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 bg-muted/30 px-4 py-2.5 text-[12px] text-muted-foreground", children: [
|
|
684
|
+
/* @__PURE__ */ jsx4(Bot2, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
685
|
+
/* @__PURE__ */ jsx4("span", { children: "AI is handling this conversation." }),
|
|
686
|
+
/* @__PURE__ */ jsx4(
|
|
612
687
|
Button,
|
|
613
688
|
{
|
|
614
689
|
variant: "link",
|
|
@@ -618,12 +693,12 @@ function ChatComposer({
|
|
|
618
693
|
children: "Take Over"
|
|
619
694
|
}
|
|
620
695
|
),
|
|
621
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ jsx4("span", { children: "to reply directly." })
|
|
622
697
|
] }) : (
|
|
623
698
|
/* Email panel stays in normal flow to anchor container height;
|
|
624
699
|
chat panel is an absolute overlay so both tabs share identical dimensions */
|
|
625
|
-
/* @__PURE__ */
|
|
626
|
-
/* @__PURE__ */
|
|
700
|
+
/* @__PURE__ */ jsxs3("div", { className: "relative", children: [
|
|
701
|
+
/* @__PURE__ */ jsxs3(
|
|
627
702
|
"div",
|
|
628
703
|
{
|
|
629
704
|
className: cn(
|
|
@@ -632,8 +707,8 @@ function ChatComposer({
|
|
|
632
707
|
),
|
|
633
708
|
"aria-hidden": channel !== "email",
|
|
634
709
|
children: [
|
|
635
|
-
/* @__PURE__ */
|
|
636
|
-
/* @__PURE__ */
|
|
710
|
+
/* @__PURE__ */ jsxs3(ComposerEmailFieldRow, { label: "To", children: [
|
|
711
|
+
/* @__PURE__ */ jsx4(
|
|
637
712
|
"input",
|
|
638
713
|
{
|
|
639
714
|
type: "email",
|
|
@@ -643,7 +718,7 @@ function ChatComposer({
|
|
|
643
718
|
className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
|
|
644
719
|
}
|
|
645
720
|
),
|
|
646
|
-
/* @__PURE__ */
|
|
721
|
+
/* @__PURE__ */ jsxs3(
|
|
647
722
|
"button",
|
|
648
723
|
{
|
|
649
724
|
type: "button",
|
|
@@ -651,12 +726,12 @@ function ChatComposer({
|
|
|
651
726
|
className: "flex shrink-0 items-center gap-0.5 text-sm text-muted-foreground hover:text-foreground",
|
|
652
727
|
children: [
|
|
653
728
|
"CC",
|
|
654
|
-
/* @__PURE__ */
|
|
729
|
+
/* @__PURE__ */ jsx4(ChevronDown, { className: "size-3.5" })
|
|
655
730
|
]
|
|
656
731
|
}
|
|
657
732
|
)
|
|
658
733
|
] }),
|
|
659
|
-
showCc && /* @__PURE__ */
|
|
734
|
+
showCc && /* @__PURE__ */ jsx4(ComposerEmailFieldRow, { label: "CC", children: /* @__PURE__ */ jsx4(
|
|
660
735
|
"input",
|
|
661
736
|
{
|
|
662
737
|
type: "email",
|
|
@@ -666,7 +741,7 @@ function ChatComposer({
|
|
|
666
741
|
className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
|
|
667
742
|
}
|
|
668
743
|
) }),
|
|
669
|
-
emailMode !== "reply" && /* @__PURE__ */
|
|
744
|
+
emailMode !== "reply" && /* @__PURE__ */ jsx4(ComposerEmailFieldRow, { label: "Subject", children: /* @__PURE__ */ jsx4(
|
|
670
745
|
"input",
|
|
671
746
|
{
|
|
672
747
|
type: "text",
|
|
@@ -676,11 +751,11 @@ function ChatComposer({
|
|
|
676
751
|
className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
|
|
677
752
|
}
|
|
678
753
|
) }),
|
|
679
|
-
/* @__PURE__ */
|
|
680
|
-
/* @__PURE__ */
|
|
681
|
-
/* @__PURE__ */
|
|
682
|
-
emailReplySubject && /* @__PURE__ */
|
|
683
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ jsx4(EditorContent, { editor }),
|
|
755
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
|
|
756
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-0.5", children: [
|
|
757
|
+
emailReplySubject && /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
758
|
+
/* @__PURE__ */ jsxs3(
|
|
684
759
|
ToggleGroup,
|
|
685
760
|
{
|
|
686
761
|
type: "single",
|
|
@@ -694,14 +769,14 @@ function ChatComposer({
|
|
|
694
769
|
},
|
|
695
770
|
className: "mr-1.5",
|
|
696
771
|
children: [
|
|
697
|
-
/* @__PURE__ */
|
|
698
|
-
/* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ jsx4(ToggleGroupItem, { value: "reply", children: "Reply" }),
|
|
773
|
+
/* @__PURE__ */ jsx4(ToggleGroupItem, { value: "new", children: "New email" })
|
|
699
774
|
]
|
|
700
775
|
}
|
|
701
776
|
),
|
|
702
|
-
/* @__PURE__ */
|
|
777
|
+
/* @__PURE__ */ jsx4(Separator, { orientation: "vertical", className: "mr-1.5 h-4" })
|
|
703
778
|
] }),
|
|
704
|
-
/* @__PURE__ */
|
|
779
|
+
/* @__PURE__ */ jsx4(
|
|
705
780
|
ComposerToolbarButton,
|
|
706
781
|
{
|
|
707
782
|
label: "Bold",
|
|
@@ -710,7 +785,7 @@ function ChatComposer({
|
|
|
710
785
|
onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run()
|
|
711
786
|
}
|
|
712
787
|
),
|
|
713
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ jsx4(
|
|
714
789
|
ComposerToolbarButton,
|
|
715
790
|
{
|
|
716
791
|
label: "Italic",
|
|
@@ -719,7 +794,7 @@ function ChatComposer({
|
|
|
719
794
|
onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run()
|
|
720
795
|
}
|
|
721
796
|
),
|
|
722
|
-
/* @__PURE__ */
|
|
797
|
+
/* @__PURE__ */ jsx4(
|
|
723
798
|
ComposerToolbarButton,
|
|
724
799
|
{
|
|
725
800
|
label: "Underline",
|
|
@@ -728,17 +803,17 @@ function ChatComposer({
|
|
|
728
803
|
onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleUnderline().run()
|
|
729
804
|
}
|
|
730
805
|
),
|
|
731
|
-
/* @__PURE__ */
|
|
732
|
-
/* @__PURE__ */
|
|
733
|
-
/* @__PURE__ */
|
|
806
|
+
/* @__PURE__ */ jsx4(Separator, { orientation: "vertical", className: "mx-1.5 h-4" }),
|
|
807
|
+
/* @__PURE__ */ jsx4(ComposerLinkPopover, { editor }),
|
|
808
|
+
/* @__PURE__ */ jsx4(ComposerToolbarButton, { label: "Attach file", icon: Paperclip })
|
|
734
809
|
] }),
|
|
735
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ jsx4("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs3(
|
|
736
811
|
Button,
|
|
737
812
|
{
|
|
738
813
|
size: "sm",
|
|
739
814
|
onClick: () => {
|
|
740
|
-
var
|
|
741
|
-
const html = (
|
|
815
|
+
var _a2;
|
|
816
|
+
const html = (_a2 = editor == null ? void 0 : editor.getHTML()) != null ? _a2 : "";
|
|
742
817
|
onSendEmail == null ? void 0 : onSendEmail({
|
|
743
818
|
content: html,
|
|
744
819
|
to: emailTo,
|
|
@@ -750,7 +825,7 @@ function ChatComposer({
|
|
|
750
825
|
},
|
|
751
826
|
disabled: !editor || editor.isEmpty || !emailTo.trim(),
|
|
752
827
|
children: [
|
|
753
|
-
/* @__PURE__ */
|
|
828
|
+
/* @__PURE__ */ jsx4(Send, { className: "mr-1.5 size-3.5" }),
|
|
754
829
|
"Send Email"
|
|
755
830
|
]
|
|
756
831
|
}
|
|
@@ -759,8 +834,8 @@ function ChatComposer({
|
|
|
759
834
|
]
|
|
760
835
|
}
|
|
761
836
|
),
|
|
762
|
-
channel === "chat" && /* @__PURE__ */
|
|
763
|
-
/* @__PURE__ */
|
|
837
|
+
channel === "chat" && /* @__PURE__ */ jsxs3("div", { className: "absolute inset-0 flex flex-col gap-3 p-4", children: [
|
|
838
|
+
/* @__PURE__ */ jsx4(
|
|
764
839
|
Textarea,
|
|
765
840
|
{
|
|
766
841
|
value: inputValue,
|
|
@@ -769,12 +844,12 @@ function ChatComposer({
|
|
|
769
844
|
className: "min-h-0 flex-1 resize-none text-base"
|
|
770
845
|
}
|
|
771
846
|
),
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
initialChannelRef.current !== "email" && /* @__PURE__ */
|
|
774
|
-
/* @__PURE__ */
|
|
847
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between", children: [
|
|
848
|
+
initialChannelRef.current !== "email" && /* @__PURE__ */ jsxs3(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
|
|
849
|
+
/* @__PURE__ */ jsx4(Bot2, { className: "mr-1.5 size-3.5" }),
|
|
775
850
|
"Let AI Handle"
|
|
776
851
|
] }),
|
|
777
|
-
/* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ jsxs3(
|
|
778
853
|
Button,
|
|
779
854
|
{
|
|
780
855
|
size: "sm",
|
|
@@ -782,7 +857,7 @@ function ChatComposer({
|
|
|
782
857
|
onClick: () => onSend == null ? void 0 : onSend(inputValue),
|
|
783
858
|
disabled: !inputValue.trim(),
|
|
784
859
|
children: [
|
|
785
|
-
/* @__PURE__ */
|
|
860
|
+
/* @__PURE__ */ jsx4(Send, { className: "mr-1.5 size-3.5" }),
|
|
786
861
|
"Send"
|
|
787
862
|
]
|
|
788
863
|
}
|
|
@@ -839,13 +914,13 @@ function ChatThread({
|
|
|
839
914
|
const prevLastMessageIdRef = React.useRef(void 0);
|
|
840
915
|
const prevContactIdRef = React.useRef(contact.id);
|
|
841
916
|
React.useLayoutEffect(() => {
|
|
842
|
-
var
|
|
917
|
+
var _a2, _b;
|
|
843
918
|
const el = scrollRef.current;
|
|
844
919
|
if (!el) return;
|
|
845
920
|
if (preLoadScrollHeightRef.current !== null) {
|
|
846
921
|
el.scrollTop = el.scrollHeight - preLoadScrollHeightRef.current;
|
|
847
922
|
preLoadScrollHeightRef.current = null;
|
|
848
|
-
prevLastMessageIdRef.current = (
|
|
923
|
+
prevLastMessageIdRef.current = (_a2 = messages[messages.length - 1]) == null ? void 0 : _a2.id;
|
|
849
924
|
prevContactIdRef.current = contact.id;
|
|
850
925
|
return;
|
|
851
926
|
}
|
|
@@ -863,8 +938,8 @@ function ChatThread({
|
|
|
863
938
|
const el = scrollRef.current;
|
|
864
939
|
if (el) el.scrollTop = el.scrollHeight;
|
|
865
940
|
}, [isAiTyping]);
|
|
866
|
-
return /* @__PURE__ */
|
|
867
|
-
/* @__PURE__ */
|
|
941
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn("flex flex-col bg-background", className), children: [
|
|
942
|
+
/* @__PURE__ */ jsxs3(
|
|
868
943
|
"div",
|
|
869
944
|
{
|
|
870
945
|
className: cn(
|
|
@@ -872,7 +947,7 @@ function ChatThread({
|
|
|
872
947
|
"flex items-center gap-3 border-b border-border px-4"
|
|
873
948
|
),
|
|
874
949
|
children: [
|
|
875
|
-
onBack && /* @__PURE__ */
|
|
950
|
+
onBack && /* @__PURE__ */ jsx4(
|
|
876
951
|
Button,
|
|
877
952
|
{
|
|
878
953
|
variant: "ghost",
|
|
@@ -880,28 +955,28 @@ function ChatThread({
|
|
|
880
955
|
className: "size-8 shrink-0 md:hidden",
|
|
881
956
|
onClick: onBack,
|
|
882
957
|
"aria-label": "Back to conversations",
|
|
883
|
-
children: /* @__PURE__ */
|
|
958
|
+
children: /* @__PURE__ */ jsx4(ArrowLeft, { className: "size-4" })
|
|
884
959
|
}
|
|
885
960
|
),
|
|
886
|
-
/* @__PURE__ */
|
|
887
|
-
/* @__PURE__ */
|
|
888
|
-
/* @__PURE__ */
|
|
889
|
-
/* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ jsx4(ContactAvatar, { name: contact.name, size: "md" }),
|
|
962
|
+
/* @__PURE__ */ jsxs3("div", { className: "min-w-0 flex-1", children: [
|
|
963
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
|
|
964
|
+
/* @__PURE__ */ jsx4("span", { className: "text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
|
|
965
|
+
/* @__PURE__ */ jsx4(ConversationStatusChip, { status, showDot: true })
|
|
891
966
|
] }),
|
|
892
|
-
contact.email && /* @__PURE__ */
|
|
967
|
+
contact.email && /* @__PURE__ */ jsx4("p", { className: "text-sm text-muted-foreground", children: contact.email })
|
|
893
968
|
] }),
|
|
894
|
-
/* @__PURE__ */
|
|
895
|
-
/* @__PURE__ */
|
|
896
|
-
isClosed && /* @__PURE__ */
|
|
897
|
-
!isClosed && aiIsHandling && /* @__PURE__ */
|
|
898
|
-
!isClosed && !aiIsHandling && channel !== "email" && /* @__PURE__ */
|
|
899
|
-
/* @__PURE__ */
|
|
969
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
970
|
+
/* @__PURE__ */ jsxs3("div", { className: "hidden items-center gap-2 md:flex", children: [
|
|
971
|
+
isClosed && /* @__PURE__ */ jsx4(Button, { variant: "outline", size: "sm", onClick: onReopen, children: "Reopen" }),
|
|
972
|
+
!isClosed && aiIsHandling && /* @__PURE__ */ jsx4(Button, { size: "sm", onClick: onTakeOver, children: "Take Over" }),
|
|
973
|
+
!isClosed && !aiIsHandling && channel !== "email" && /* @__PURE__ */ jsxs3(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
|
|
974
|
+
/* @__PURE__ */ jsx4(Bot2, { className: "mr-1.5 size-3.5" }),
|
|
900
975
|
"Let AI Handle"
|
|
901
976
|
] })
|
|
902
977
|
] }),
|
|
903
|
-
/* @__PURE__ */
|
|
904
|
-
/* @__PURE__ */
|
|
978
|
+
/* @__PURE__ */ jsxs3(DropdownMenu, { children: [
|
|
979
|
+
/* @__PURE__ */ jsx4(
|
|
905
980
|
DropdownMenuTrigger,
|
|
906
981
|
{
|
|
907
982
|
className: cn(
|
|
@@ -909,38 +984,38 @@ function ChatThread({
|
|
|
909
984
|
"size-8"
|
|
910
985
|
),
|
|
911
986
|
"aria-label": "More actions",
|
|
912
|
-
children: /* @__PURE__ */
|
|
987
|
+
children: /* @__PURE__ */ jsx4(MoreHorizontal, { className: "size-4" })
|
|
913
988
|
}
|
|
914
989
|
),
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
-
onShowLeadInfo && /* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
990
|
+
/* @__PURE__ */ jsxs3(DropdownMenuContent, { children: [
|
|
991
|
+
onShowLeadInfo && /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
992
|
+
/* @__PURE__ */ jsxs3(
|
|
918
993
|
DropdownMenuItem,
|
|
919
994
|
{
|
|
920
995
|
className: "md:hidden",
|
|
921
996
|
onClick: onShowLeadInfo,
|
|
922
997
|
children: [
|
|
923
|
-
/* @__PURE__ */
|
|
998
|
+
/* @__PURE__ */ jsx4(ChevronRight, { className: "mr-2 size-4" }),
|
|
924
999
|
"Lead Info"
|
|
925
1000
|
]
|
|
926
1001
|
}
|
|
927
1002
|
),
|
|
928
|
-
/* @__PURE__ */
|
|
1003
|
+
/* @__PURE__ */ jsx4(DropdownMenuSeparator, { className: "md:hidden" })
|
|
929
1004
|
] }),
|
|
930
|
-
status === "needs-attention" ? /* @__PURE__ */
|
|
931
|
-
/* @__PURE__ */
|
|
1005
|
+
status === "needs-attention" ? /* @__PURE__ */ jsxs3(DropdownMenuItem, { onClick: onUnmarkUrgent, children: [
|
|
1006
|
+
/* @__PURE__ */ jsx4(Flag2, { className: "mr-2 size-4" }),
|
|
932
1007
|
"Unmark Urgent"
|
|
933
|
-
] }) : /* @__PURE__ */
|
|
934
|
-
/* @__PURE__ */
|
|
1008
|
+
] }) : /* @__PURE__ */ jsxs3(DropdownMenuItem, { onClick: onMarkUrgent, children: [
|
|
1009
|
+
/* @__PURE__ */ jsx4(Flag2, { className: "mr-2 size-4" }),
|
|
935
1010
|
"Mark as Urgent"
|
|
936
1011
|
] }),
|
|
937
|
-
/* @__PURE__ */
|
|
938
|
-
/* @__PURE__ */
|
|
1012
|
+
/* @__PURE__ */ jsxs3(DropdownMenuItem, { onClick: onAssignToAdvisor, children: [
|
|
1013
|
+
/* @__PURE__ */ jsx4(UserCheck, { className: "mr-2 size-4" }),
|
|
939
1014
|
"Assign to advisor"
|
|
940
1015
|
] }),
|
|
941
|
-
/* @__PURE__ */
|
|
942
|
-
/* @__PURE__ */
|
|
943
|
-
/* @__PURE__ */
|
|
1016
|
+
/* @__PURE__ */ jsx4(DropdownMenuSeparator, {}),
|
|
1017
|
+
/* @__PURE__ */ jsxs3(DropdownMenuItem, { onClick: onArchive, children: [
|
|
1018
|
+
/* @__PURE__ */ jsx4(Archive, { className: "mr-2 size-4" }),
|
|
944
1019
|
"Archive"
|
|
945
1020
|
] })
|
|
946
1021
|
] })
|
|
@@ -949,7 +1024,7 @@ function ChatThread({
|
|
|
949
1024
|
]
|
|
950
1025
|
}
|
|
951
1026
|
),
|
|
952
|
-
/* @__PURE__ */
|
|
1027
|
+
/* @__PURE__ */ jsxs3(
|
|
953
1028
|
"div",
|
|
954
1029
|
{
|
|
955
1030
|
ref: scrollRef,
|
|
@@ -957,29 +1032,29 @@ function ChatThread({
|
|
|
957
1032
|
className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4",
|
|
958
1033
|
tabIndex: 0,
|
|
959
1034
|
children: [
|
|
960
|
-
isLoadingMoreMessages && /* @__PURE__ */
|
|
961
|
-
messages.length === 0 ? /* @__PURE__ */
|
|
962
|
-
/* @__PURE__ */
|
|
963
|
-
/* @__PURE__ */
|
|
964
|
-
] }) : messages.map((msg) => /* @__PURE__ */
|
|
965
|
-
isAiTyping && !isClosed && /* @__PURE__ */
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
/* @__PURE__ */
|
|
968
|
-
/* @__PURE__ */
|
|
969
|
-
/* @__PURE__ */
|
|
970
|
-
/* @__PURE__ */
|
|
971
|
-
/* @__PURE__ */
|
|
972
|
-
/* @__PURE__ */
|
|
1035
|
+
isLoadingMoreMessages && /* @__PURE__ */ jsx4("div", { className: "flex justify-center py-1 text-caption text-muted-foreground", children: "Loading older messages..." }),
|
|
1036
|
+
messages.length === 0 ? /* @__PURE__ */ jsxs3("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground", children: [
|
|
1037
|
+
/* @__PURE__ */ jsx4(MessageSquare2, { className: "size-8 opacity-30" }),
|
|
1038
|
+
/* @__PURE__ */ jsx4("p", { className: "text-sm", children: "No messages yet" })
|
|
1039
|
+
] }) : messages.map((msg) => /* @__PURE__ */ jsx4(ChatBubble, { message: msg, channel }, msg.id)),
|
|
1040
|
+
isAiTyping && !isClosed && /* @__PURE__ */ jsxs3("div", { className: "flex gap-2.5", children: [
|
|
1041
|
+
/* @__PURE__ */ jsx4(BubbleAvatar, { role: "bot" }),
|
|
1042
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-1", children: [
|
|
1043
|
+
/* @__PURE__ */ jsx4("span", { className: "text-caption text-muted-foreground", children: "AI Assistant" }),
|
|
1044
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-1 border border-border bg-muted/60 px-3 py-2.5", children: [
|
|
1045
|
+
/* @__PURE__ */ jsx4("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:0ms]" }),
|
|
1046
|
+
/* @__PURE__ */ jsx4("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:150ms]" }),
|
|
1047
|
+
/* @__PURE__ */ jsx4("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:300ms]" })
|
|
973
1048
|
] })
|
|
974
1049
|
] })
|
|
975
1050
|
] })
|
|
976
1051
|
]
|
|
977
1052
|
}
|
|
978
1053
|
),
|
|
979
|
-
isClosed ? /* @__PURE__ */
|
|
980
|
-
/* @__PURE__ */
|
|
981
|
-
/* @__PURE__ */
|
|
982
|
-
/* @__PURE__ */
|
|
1054
|
+
isClosed ? /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3 border-t border-border bg-muted/30 px-4 py-3 text-sm text-muted-foreground", children: [
|
|
1055
|
+
/* @__PURE__ */ jsx4(Lock, { className: "size-3.5 shrink-0" }),
|
|
1056
|
+
/* @__PURE__ */ jsx4("span", { children: "This conversation is closed." }),
|
|
1057
|
+
/* @__PURE__ */ jsx4(
|
|
983
1058
|
Button,
|
|
984
1059
|
{
|
|
985
1060
|
variant: "outline",
|
|
@@ -989,7 +1064,7 @@ function ChatThread({
|
|
|
989
1064
|
children: "Reopen"
|
|
990
1065
|
}
|
|
991
1066
|
)
|
|
992
|
-
] }) : /* @__PURE__ */
|
|
1067
|
+
] }) : /* @__PURE__ */ jsx4(
|
|
993
1068
|
ChatComposer,
|
|
994
1069
|
{
|
|
995
1070
|
mode,
|
|
@@ -1027,20 +1102,20 @@ import {
|
|
|
1027
1102
|
UserPlus,
|
|
1028
1103
|
Video
|
|
1029
1104
|
} from "lucide-react";
|
|
1030
|
-
import { Fragment as Fragment3, jsx as
|
|
1105
|
+
import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1031
1106
|
function AICollectedDataSection({
|
|
1032
1107
|
fields,
|
|
1033
1108
|
className
|
|
1034
1109
|
}) {
|
|
1035
|
-
return /* @__PURE__ */
|
|
1110
|
+
return /* @__PURE__ */ jsx5("div", { className: cn("flex flex-col", className), children: fields.map((field, i) => /* @__PURE__ */ jsxs4(
|
|
1036
1111
|
"div",
|
|
1037
1112
|
{
|
|
1038
1113
|
className: "flex items-center justify-between gap-2 border-b border-border/40 py-1.5 last:border-b-0",
|
|
1039
1114
|
children: [
|
|
1040
|
-
/* @__PURE__ */
|
|
1041
|
-
/* @__PURE__ */
|
|
1042
|
-
/* @__PURE__ */
|
|
1043
|
-
field.confidence === "confirmed" ? /* @__PURE__ */
|
|
1115
|
+
/* @__PURE__ */ jsx5("span", { className: "shrink-0 text-sm text-muted-foreground", children: field.label }),
|
|
1116
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1.5", children: [
|
|
1117
|
+
/* @__PURE__ */ jsx5("span", { className: "text-right text-sm font-medium text-foreground", children: field.value }),
|
|
1118
|
+
field.confidence === "confirmed" ? /* @__PURE__ */ jsx5(CheckCircle2, { className: "size-3 shrink-0 text-success-text" }) : /* @__PURE__ */ jsx5(HelpCircle, { className: "size-3 shrink-0 text-warning-text" })
|
|
1044
1119
|
] })
|
|
1045
1120
|
]
|
|
1046
1121
|
},
|
|
@@ -1074,9 +1149,9 @@ function MeetingDetailRow({
|
|
|
1074
1149
|
}) {
|
|
1075
1150
|
const DetailIcon = MEETING_DETAIL_ICON[meetingType];
|
|
1076
1151
|
const isLink = detail.startsWith("http");
|
|
1077
|
-
return /* @__PURE__ */
|
|
1078
|
-
/* @__PURE__ */
|
|
1079
|
-
isLink ? /* @__PURE__ */
|
|
1152
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
1153
|
+
/* @__PURE__ */ jsx5(DetailIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
1154
|
+
isLink ? /* @__PURE__ */ jsx5(
|
|
1080
1155
|
"a",
|
|
1081
1156
|
{
|
|
1082
1157
|
href: detail,
|
|
@@ -1085,7 +1160,7 @@ function MeetingDetailRow({
|
|
|
1085
1160
|
className: "text-sm text-primary underline underline-offset-2 break-all hover:text-primary/80",
|
|
1086
1161
|
children: detail
|
|
1087
1162
|
}
|
|
1088
|
-
) : /* @__PURE__ */
|
|
1163
|
+
) : /* @__PURE__ */ jsx5("span", { className: "text-sm text-muted-foreground break-all", children: detail })
|
|
1089
1164
|
] });
|
|
1090
1165
|
}
|
|
1091
1166
|
function AppointmentSection({
|
|
@@ -1098,23 +1173,23 @@ function AppointmentSection({
|
|
|
1098
1173
|
}) {
|
|
1099
1174
|
const AppointmentIcon = MEETING_ICON[appointment.meetingType];
|
|
1100
1175
|
const canReschedule = !isAnonymous && !!onRescheduleAppointment;
|
|
1101
|
-
return /* @__PURE__ */
|
|
1102
|
-
/* @__PURE__ */
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
/* @__PURE__ */
|
|
1176
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-2", children: [
|
|
1177
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
1178
|
+
/* @__PURE__ */ jsx5(Calendar, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
1179
|
+
/* @__PURE__ */ jsx5("span", { className: "text-sm font-medium text-foreground", children: appointment.datetime })
|
|
1105
1180
|
] }),
|
|
1106
|
-
/* @__PURE__ */
|
|
1107
|
-
/* @__PURE__ */
|
|
1108
|
-
/* @__PURE__ */
|
|
1181
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
1182
|
+
/* @__PURE__ */ jsx5(AppointmentIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
1183
|
+
/* @__PURE__ */ jsx5("span", { className: "text-sm text-muted-foreground", children: MEETING_LABEL[appointment.meetingType] })
|
|
1109
1184
|
] }),
|
|
1110
|
-
appointment.meetingDetail && /* @__PURE__ */
|
|
1185
|
+
appointment.meetingDetail && /* @__PURE__ */ jsx5(
|
|
1111
1186
|
MeetingDetailRow,
|
|
1112
1187
|
{
|
|
1113
1188
|
meetingType: appointment.meetingType,
|
|
1114
1189
|
detail: appointment.meetingDetail
|
|
1115
1190
|
}
|
|
1116
1191
|
),
|
|
1117
|
-
/* @__PURE__ */
|
|
1192
|
+
/* @__PURE__ */ jsx5(
|
|
1118
1193
|
"span",
|
|
1119
1194
|
{
|
|
1120
1195
|
className: cn("text-sm font-medium", {
|
|
@@ -1126,9 +1201,9 @@ function AppointmentSection({
|
|
|
1126
1201
|
children: APPOINTMENT_STATUS_LABEL[appointment.status]
|
|
1127
1202
|
}
|
|
1128
1203
|
),
|
|
1129
|
-
appointment.status === "requested" && /* @__PURE__ */
|
|
1130
|
-
/* @__PURE__ */
|
|
1131
|
-
/* @__PURE__ */
|
|
1204
|
+
appointment.status === "requested" && /* @__PURE__ */ jsxs4("div", { className: "flex gap-2 pt-1", children: [
|
|
1205
|
+
/* @__PURE__ */ jsx5(Button, { size: "sm", className: "flex-1", onClick: onApproveAppointment, children: "Approve" }),
|
|
1206
|
+
/* @__PURE__ */ jsx5(
|
|
1132
1207
|
Button,
|
|
1133
1208
|
{
|
|
1134
1209
|
variant: "outline",
|
|
@@ -1138,7 +1213,7 @@ function AppointmentSection({
|
|
|
1138
1213
|
children: "Decline"
|
|
1139
1214
|
}
|
|
1140
1215
|
),
|
|
1141
|
-
canReschedule && /* @__PURE__ */
|
|
1216
|
+
canReschedule && /* @__PURE__ */ jsx5(
|
|
1142
1217
|
Button,
|
|
1143
1218
|
{
|
|
1144
1219
|
variant: "ghost",
|
|
@@ -1149,7 +1224,7 @@ function AppointmentSection({
|
|
|
1149
1224
|
}
|
|
1150
1225
|
)
|
|
1151
1226
|
] }),
|
|
1152
|
-
(appointment.status === "confirmed" || appointment.status === "cancelled") && canReschedule && /* @__PURE__ */
|
|
1227
|
+
(appointment.status === "confirmed" || appointment.status === "cancelled") && canReschedule && /* @__PURE__ */ jsx5(
|
|
1153
1228
|
Button,
|
|
1154
1229
|
{
|
|
1155
1230
|
variant: "outline",
|
|
@@ -1162,13 +1237,13 @@ function AppointmentSection({
|
|
|
1162
1237
|
] });
|
|
1163
1238
|
}
|
|
1164
1239
|
function PanelSectionHeader({ children }) {
|
|
1165
|
-
return /* @__PURE__ */
|
|
1240
|
+
return /* @__PURE__ */ jsx5("p", { className: "mb-2.5 text-overline text-muted-foreground", children });
|
|
1166
1241
|
}
|
|
1167
1242
|
function PanelSection({
|
|
1168
1243
|
children,
|
|
1169
1244
|
last = false
|
|
1170
1245
|
}) {
|
|
1171
|
-
return /* @__PURE__ */
|
|
1246
|
+
return /* @__PURE__ */ jsx5("div", { className: cn("px-4 py-4", !last && "border-b border-border"), children });
|
|
1172
1247
|
}
|
|
1173
1248
|
function LeadInfoPanel({
|
|
1174
1249
|
contact,
|
|
@@ -1194,8 +1269,8 @@ function LeadInfoPanel({
|
|
|
1194
1269
|
}) {
|
|
1195
1270
|
const isAnonymous = !contact.name.trim();
|
|
1196
1271
|
const addToContactsDisabled = isAnonymous || isKnownContact;
|
|
1197
|
-
return /* @__PURE__ */
|
|
1198
|
-
/* @__PURE__ */
|
|
1272
|
+
return /* @__PURE__ */ jsxs4("div", { className: cn("flex flex-col bg-background", className), children: [
|
|
1273
|
+
/* @__PURE__ */ jsxs4(
|
|
1199
1274
|
"div",
|
|
1200
1275
|
{
|
|
1201
1276
|
className: cn(
|
|
@@ -1203,7 +1278,7 @@ function LeadInfoPanel({
|
|
|
1203
1278
|
"flex items-center justify-between border-b border-border px-4"
|
|
1204
1279
|
),
|
|
1205
1280
|
children: [
|
|
1206
|
-
onBack && /* @__PURE__ */
|
|
1281
|
+
onBack && /* @__PURE__ */ jsx5(
|
|
1207
1282
|
Button,
|
|
1208
1283
|
{
|
|
1209
1284
|
variant: "ghost",
|
|
@@ -1211,15 +1286,15 @@ function LeadInfoPanel({
|
|
|
1211
1286
|
className: "size-8 shrink-0 md:hidden",
|
|
1212
1287
|
onClick: onBack,
|
|
1213
1288
|
"aria-label": "Back to conversation",
|
|
1214
|
-
children: /* @__PURE__ */
|
|
1289
|
+
children: /* @__PURE__ */ jsx5(ArrowLeft2, { className: "size-4" })
|
|
1215
1290
|
}
|
|
1216
1291
|
),
|
|
1217
|
-
/* @__PURE__ */
|
|
1218
|
-
onToggleCollapse && /* @__PURE__ */
|
|
1219
|
-
/* @__PURE__ */
|
|
1292
|
+
/* @__PURE__ */ jsx5("span", { className: "text-sm font-semibold text-foreground", children: "Lead Info" }),
|
|
1293
|
+
onToggleCollapse && /* @__PURE__ */ jsxs4(Tooltip, { children: [
|
|
1294
|
+
/* @__PURE__ */ jsx5(
|
|
1220
1295
|
TooltipTrigger,
|
|
1221
1296
|
{
|
|
1222
|
-
render: /* @__PURE__ */
|
|
1297
|
+
render: /* @__PURE__ */ jsx5(
|
|
1223
1298
|
Button,
|
|
1224
1299
|
{
|
|
1225
1300
|
variant: "ghost",
|
|
@@ -1227,7 +1302,7 @@ function LeadInfoPanel({
|
|
|
1227
1302
|
className: "size-7",
|
|
1228
1303
|
onClick: onToggleCollapse,
|
|
1229
1304
|
"aria-label": isCollapsed ? "Expand panel" : "Collapse panel",
|
|
1230
|
-
children: /* @__PURE__ */
|
|
1305
|
+
children: /* @__PURE__ */ jsx5(
|
|
1231
1306
|
ChevronRight2,
|
|
1232
1307
|
{
|
|
1233
1308
|
className: cn(
|
|
@@ -1240,26 +1315,26 @@ function LeadInfoPanel({
|
|
|
1240
1315
|
)
|
|
1241
1316
|
}
|
|
1242
1317
|
),
|
|
1243
|
-
/* @__PURE__ */
|
|
1318
|
+
/* @__PURE__ */ jsx5(TooltipContent, { children: isCollapsed ? "Expand panel" : "Collapse panel" })
|
|
1244
1319
|
] })
|
|
1245
1320
|
]
|
|
1246
1321
|
}
|
|
1247
1322
|
),
|
|
1248
|
-
!isCollapsed && /* @__PURE__ */
|
|
1249
|
-
/* @__PURE__ */
|
|
1250
|
-
/* @__PURE__ */
|
|
1251
|
-
/* @__PURE__ */
|
|
1252
|
-
/* @__PURE__ */
|
|
1253
|
-
/* @__PURE__ */
|
|
1254
|
-
/* @__PURE__ */
|
|
1255
|
-
/* @__PURE__ */
|
|
1256
|
-
topic && /* @__PURE__ */
|
|
1323
|
+
!isCollapsed && /* @__PURE__ */ jsxs4("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: [
|
|
1324
|
+
/* @__PURE__ */ jsxs4(PanelSection, { children: [
|
|
1325
|
+
/* @__PURE__ */ jsx5(PanelSectionHeader, { children: "Contact" }),
|
|
1326
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-3", children: [
|
|
1327
|
+
/* @__PURE__ */ jsx5(ContactAvatar, { name: contact.name, size: "lg" }),
|
|
1328
|
+
/* @__PURE__ */ jsxs4("div", { className: "min-w-0 flex-1", children: [
|
|
1329
|
+
/* @__PURE__ */ jsx5("p", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
|
|
1330
|
+
/* @__PURE__ */ jsx5("p", { className: "text-sm text-muted-foreground", children: source }),
|
|
1331
|
+
topic && /* @__PURE__ */ jsx5(Badge, { variant: "secondary", className: "mt-1 text-xs", children: topic })
|
|
1257
1332
|
] })
|
|
1258
1333
|
] }),
|
|
1259
|
-
(contact.email || contact.phone || firstSeen) && /* @__PURE__ */
|
|
1260
|
-
contact.email && /* @__PURE__ */
|
|
1261
|
-
/* @__PURE__ */
|
|
1262
|
-
/* @__PURE__ */
|
|
1334
|
+
(contact.email || contact.phone || firstSeen) && /* @__PURE__ */ jsxs4("div", { className: "mt-3 flex flex-col gap-1.5", children: [
|
|
1335
|
+
contact.email && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
1336
|
+
/* @__PURE__ */ jsx5(Mail3, { className: "size-4 shrink-0" }),
|
|
1337
|
+
/* @__PURE__ */ jsx5(
|
|
1263
1338
|
"a",
|
|
1264
1339
|
{
|
|
1265
1340
|
href: `mailto:${contact.email}`,
|
|
@@ -1268,9 +1343,9 @@ function LeadInfoPanel({
|
|
|
1268
1343
|
}
|
|
1269
1344
|
)
|
|
1270
1345
|
] }),
|
|
1271
|
-
contact.phone && /* @__PURE__ */
|
|
1272
|
-
/* @__PURE__ */
|
|
1273
|
-
/* @__PURE__ */
|
|
1346
|
+
contact.phone && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
1347
|
+
/* @__PURE__ */ jsx5(PhoneCall, { className: "size-4 shrink-0" }),
|
|
1348
|
+
/* @__PURE__ */ jsx5(
|
|
1274
1349
|
"a",
|
|
1275
1350
|
{
|
|
1276
1351
|
href: `tel:${contact.phone}`,
|
|
@@ -1279,31 +1354,31 @@ function LeadInfoPanel({
|
|
|
1279
1354
|
}
|
|
1280
1355
|
)
|
|
1281
1356
|
] }),
|
|
1282
|
-
firstSeen && /* @__PURE__ */
|
|
1357
|
+
firstSeen && /* @__PURE__ */ jsxs4("p", { className: "text-sm text-muted-foreground", children: [
|
|
1283
1358
|
"First seen: ",
|
|
1284
1359
|
firstSeen
|
|
1285
1360
|
] })
|
|
1286
1361
|
] })
|
|
1287
1362
|
] }),
|
|
1288
|
-
/* @__PURE__ */
|
|
1289
|
-
/* @__PURE__ */
|
|
1290
|
-
aiFields.length > 0 ? /* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */
|
|
1292
|
-
/* @__PURE__ */
|
|
1293
|
-
/* @__PURE__ */
|
|
1294
|
-
/* @__PURE__ */
|
|
1363
|
+
/* @__PURE__ */ jsxs4(PanelSection, { children: [
|
|
1364
|
+
/* @__PURE__ */ jsx5(PanelSectionHeader, { children: "AI-Collected Data" }),
|
|
1365
|
+
aiFields.length > 0 ? /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
1366
|
+
/* @__PURE__ */ jsx5(AICollectedDataSection, { fields: aiFields }),
|
|
1367
|
+
/* @__PURE__ */ jsxs4("div", { className: "mt-2.5 flex items-center gap-3 text-xs text-muted-foreground", children: [
|
|
1368
|
+
/* @__PURE__ */ jsxs4("span", { className: "flex items-center gap-1", children: [
|
|
1369
|
+
/* @__PURE__ */ jsx5(CheckCircle2, { className: "size-3 text-success-text" }),
|
|
1295
1370
|
"confirmed"
|
|
1296
1371
|
] }),
|
|
1297
|
-
/* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1372
|
+
/* @__PURE__ */ jsxs4("span", { className: "flex items-center gap-1", children: [
|
|
1373
|
+
/* @__PURE__ */ jsx5(HelpCircle, { className: "size-3 text-warning-text" }),
|
|
1299
1374
|
"estimated"
|
|
1300
1375
|
] })
|
|
1301
1376
|
] })
|
|
1302
|
-
] }) : /* @__PURE__ */
|
|
1377
|
+
] }) : /* @__PURE__ */ jsx5("p", { className: "text-sm text-muted-foreground", children: "AI is still gathering information..." })
|
|
1303
1378
|
] }),
|
|
1304
|
-
/* @__PURE__ */
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
appointment ? /* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ jsxs4(PanelSection, { children: [
|
|
1380
|
+
/* @__PURE__ */ jsx5(PanelSectionHeader, { children: "Appointment" }),
|
|
1381
|
+
appointment ? /* @__PURE__ */ jsx5(
|
|
1307
1382
|
AppointmentSection,
|
|
1308
1383
|
{
|
|
1309
1384
|
appointment,
|
|
@@ -1313,7 +1388,7 @@ function LeadInfoPanel({
|
|
|
1313
1388
|
onDeclineAppointment,
|
|
1314
1389
|
onRescheduleAppointment
|
|
1315
1390
|
}
|
|
1316
|
-
) : /* @__PURE__ */
|
|
1391
|
+
) : /* @__PURE__ */ jsxs4(
|
|
1317
1392
|
Button,
|
|
1318
1393
|
{
|
|
1319
1394
|
variant: "outline",
|
|
@@ -1322,20 +1397,20 @@ function LeadInfoPanel({
|
|
|
1322
1397
|
disabled: isAnonymous,
|
|
1323
1398
|
onClick: onBookAppointment,
|
|
1324
1399
|
children: [
|
|
1325
|
-
/* @__PURE__ */
|
|
1400
|
+
/* @__PURE__ */ jsx5(Plus, { className: "mr-1.5 size-3.5" }),
|
|
1326
1401
|
"Book Appointment"
|
|
1327
1402
|
]
|
|
1328
1403
|
}
|
|
1329
1404
|
)
|
|
1330
1405
|
] }),
|
|
1331
|
-
/* @__PURE__ */
|
|
1332
|
-
/* @__PURE__ */
|
|
1333
|
-
/* @__PURE__ */
|
|
1334
|
-
/* @__PURE__ */
|
|
1335
|
-
/* @__PURE__ */
|
|
1406
|
+
/* @__PURE__ */ jsxs4(PanelSection, { children: [
|
|
1407
|
+
/* @__PURE__ */ jsx5(PanelSectionHeader, { children: "CRM Actions" }),
|
|
1408
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-2", children: [
|
|
1409
|
+
/* @__PURE__ */ jsxs4(Tooltip, { children: [
|
|
1410
|
+
/* @__PURE__ */ jsx5(
|
|
1336
1411
|
TooltipTrigger,
|
|
1337
1412
|
{
|
|
1338
|
-
render: /* @__PURE__ */
|
|
1413
|
+
render: /* @__PURE__ */ jsxs4(
|
|
1339
1414
|
Button,
|
|
1340
1415
|
{
|
|
1341
1416
|
variant: "outline",
|
|
@@ -1344,16 +1419,16 @@ function LeadInfoPanel({
|
|
|
1344
1419
|
disabled: addToContactsDisabled,
|
|
1345
1420
|
onClick: onAddToContacts,
|
|
1346
1421
|
children: [
|
|
1347
|
-
/* @__PURE__ */
|
|
1422
|
+
/* @__PURE__ */ jsx5(UserPlus, { className: "mr-1.5 size-3.5" }),
|
|
1348
1423
|
"Add to Contacts"
|
|
1349
1424
|
]
|
|
1350
1425
|
}
|
|
1351
1426
|
)
|
|
1352
1427
|
}
|
|
1353
1428
|
),
|
|
1354
|
-
isKnownContact && /* @__PURE__ */
|
|
1429
|
+
isKnownContact && /* @__PURE__ */ jsx5(TooltipContent, { children: "Already in contacts" })
|
|
1355
1430
|
] }),
|
|
1356
|
-
/* @__PURE__ */
|
|
1431
|
+
/* @__PURE__ */ jsxs4(
|
|
1357
1432
|
Button,
|
|
1358
1433
|
{
|
|
1359
1434
|
variant: "outline",
|
|
@@ -1362,23 +1437,23 @@ function LeadInfoPanel({
|
|
|
1362
1437
|
disabled: isAnonymous,
|
|
1363
1438
|
onClick: onCreateOpportunity,
|
|
1364
1439
|
children: [
|
|
1365
|
-
/* @__PURE__ */
|
|
1440
|
+
/* @__PURE__ */ jsx5(Briefcase, { className: "mr-1.5 size-3.5" }),
|
|
1366
1441
|
"Add to CRM"
|
|
1367
1442
|
]
|
|
1368
1443
|
}
|
|
1369
1444
|
)
|
|
1370
1445
|
] })
|
|
1371
1446
|
] }),
|
|
1372
|
-
/* @__PURE__ */
|
|
1373
|
-
/* @__PURE__ */
|
|
1374
|
-
/* @__PURE__ */
|
|
1375
|
-
notesSaveStatus === "saving" && /* @__PURE__ */
|
|
1376
|
-
notesSaveStatus === "saved" && /* @__PURE__ */
|
|
1377
|
-
/* @__PURE__ */
|
|
1447
|
+
/* @__PURE__ */ jsxs4(PanelSection, { last: true, children: [
|
|
1448
|
+
/* @__PURE__ */ jsxs4("div", { className: "mb-2.5 flex items-center justify-between", children: [
|
|
1449
|
+
/* @__PURE__ */ jsx5("p", { className: "text-overline text-muted-foreground", children: "Internal Notes" }),
|
|
1450
|
+
notesSaveStatus === "saving" && /* @__PURE__ */ jsx5("span", { className: "text-xs text-muted-foreground", children: "Saving..." }),
|
|
1451
|
+
notesSaveStatus === "saved" && /* @__PURE__ */ jsxs4("span", { className: "flex items-center gap-1 text-xs text-success-text", children: [
|
|
1452
|
+
/* @__PURE__ */ jsx5(CheckCircle2, { className: "size-3" }),
|
|
1378
1453
|
"Saved"
|
|
1379
1454
|
] })
|
|
1380
1455
|
] }),
|
|
1381
|
-
/* @__PURE__ */
|
|
1456
|
+
/* @__PURE__ */ jsx5(
|
|
1382
1457
|
Textarea,
|
|
1383
1458
|
{
|
|
1384
1459
|
value: internalNotes,
|
|
@@ -1394,7 +1469,7 @@ function LeadInfoPanel({
|
|
|
1394
1469
|
}
|
|
1395
1470
|
|
|
1396
1471
|
// src/components/ui/ai-conversations/index.tsx
|
|
1397
|
-
import { Fragment as Fragment4, jsx as
|
|
1472
|
+
import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1398
1473
|
function ConversationsPage({
|
|
1399
1474
|
conversations,
|
|
1400
1475
|
activeConversationId,
|
|
@@ -1462,12 +1537,12 @@ function ConversationsPage({
|
|
|
1462
1537
|
onToggleLeadPanel == null ? void 0 : onToggleLeadPanel();
|
|
1463
1538
|
setMobilePanel(showLeadPanel ? "chat" : "lead");
|
|
1464
1539
|
};
|
|
1465
|
-
return /* @__PURE__ */
|
|
1540
|
+
return /* @__PURE__ */ jsx6(TooltipProvider, { children: /* @__PURE__ */ jsxs5(
|
|
1466
1541
|
"div",
|
|
1467
1542
|
{
|
|
1468
1543
|
className: cn("flex h-full overflow-hidden bg-background", className),
|
|
1469
1544
|
children: [
|
|
1470
|
-
/* @__PURE__ */
|
|
1545
|
+
/* @__PURE__ */ jsx6(
|
|
1471
1546
|
ConversationList,
|
|
1472
1547
|
{
|
|
1473
1548
|
conversations,
|
|
@@ -1489,7 +1564,7 @@ function ConversationsPage({
|
|
|
1489
1564
|
)
|
|
1490
1565
|
}
|
|
1491
1566
|
),
|
|
1492
|
-
contact ? /* @__PURE__ */
|
|
1567
|
+
contact ? /* @__PURE__ */ jsx6(
|
|
1493
1568
|
ChatThread,
|
|
1494
1569
|
{
|
|
1495
1570
|
contact,
|
|
@@ -1523,21 +1598,21 @@ function ConversationsPage({
|
|
|
1523
1598
|
)
|
|
1524
1599
|
},
|
|
1525
1600
|
contact.id
|
|
1526
|
-
) : /* @__PURE__ */
|
|
1601
|
+
) : /* @__PURE__ */ jsx6(
|
|
1527
1602
|
"div",
|
|
1528
1603
|
{
|
|
1529
1604
|
className: cn(
|
|
1530
1605
|
"min-w-0 flex-1 items-center justify-center border-r border-border bg-muted/10",
|
|
1531
1606
|
mobilePanel === "chat" ? "flex md:flex" : "hidden md:flex"
|
|
1532
1607
|
),
|
|
1533
|
-
children: /* @__PURE__ */
|
|
1534
|
-
/* @__PURE__ */
|
|
1535
|
-
/* @__PURE__ */
|
|
1608
|
+
children: /* @__PURE__ */ jsxs5("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
|
|
1609
|
+
/* @__PURE__ */ jsx6(MessageSquare3, { className: "size-10 opacity-30" }),
|
|
1610
|
+
/* @__PURE__ */ jsx6("p", { className: "text-sm", children: "Select a conversation" })
|
|
1536
1611
|
] })
|
|
1537
1612
|
}
|
|
1538
1613
|
),
|
|
1539
|
-
contact && /* @__PURE__ */
|
|
1540
|
-
/* @__PURE__ */
|
|
1614
|
+
contact && /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
1615
|
+
/* @__PURE__ */ jsx6(
|
|
1541
1616
|
"div",
|
|
1542
1617
|
{
|
|
1543
1618
|
className: cn(
|
|
@@ -1545,7 +1620,7 @@ function ConversationsPage({
|
|
|
1545
1620
|
"md:block md:shrink-0 md:overflow-hidden md:transition-[width] md:duration-200 md:ease-in-out",
|
|
1546
1621
|
showLeadPanel ? "md:w-[320px]" : "md:w-0"
|
|
1547
1622
|
),
|
|
1548
|
-
children: /* @__PURE__ */
|
|
1623
|
+
children: /* @__PURE__ */ jsx6(
|
|
1549
1624
|
LeadInfoPanel,
|
|
1550
1625
|
{
|
|
1551
1626
|
contact,
|
|
@@ -1571,11 +1646,11 @@ function ConversationsPage({
|
|
|
1571
1646
|
)
|
|
1572
1647
|
}
|
|
1573
1648
|
),
|
|
1574
|
-
!showLeadPanel && onToggleLeadPanel && /* @__PURE__ */
|
|
1575
|
-
/* @__PURE__ */
|
|
1649
|
+
!showLeadPanel && onToggleLeadPanel && /* @__PURE__ */ jsx6("div", { className: "hidden shrink-0 items-start border-l border-border pt-[29px] md:flex", children: /* @__PURE__ */ jsxs5(Tooltip, { children: [
|
|
1650
|
+
/* @__PURE__ */ jsx6(
|
|
1576
1651
|
TooltipTrigger,
|
|
1577
1652
|
{
|
|
1578
|
-
render: /* @__PURE__ */
|
|
1653
|
+
render: /* @__PURE__ */ jsx6(
|
|
1579
1654
|
Button,
|
|
1580
1655
|
{
|
|
1581
1656
|
variant: "ghost",
|
|
@@ -1583,12 +1658,12 @@ function ConversationsPage({
|
|
|
1583
1658
|
className: "size-8",
|
|
1584
1659
|
"aria-label": "Show lead info",
|
|
1585
1660
|
onClick: handleToggleLeadPanel,
|
|
1586
|
-
children: /* @__PURE__ */
|
|
1661
|
+
children: /* @__PURE__ */ jsx6(ChevronLeft, { className: "size-4" })
|
|
1587
1662
|
}
|
|
1588
1663
|
)
|
|
1589
1664
|
}
|
|
1590
1665
|
),
|
|
1591
|
-
/* @__PURE__ */
|
|
1666
|
+
/* @__PURE__ */ jsx6(TooltipContent, { children: "Show lead info" })
|
|
1592
1667
|
] }) })
|
|
1593
1668
|
] })
|
|
1594
1669
|
]
|
|
@@ -1618,13 +1693,13 @@ function AiConvAssignAdvisorDialog({
|
|
|
1618
1693
|
setRoleFilter("");
|
|
1619
1694
|
}
|
|
1620
1695
|
};
|
|
1621
|
-
return /* @__PURE__ */
|
|
1622
|
-
/* @__PURE__ */
|
|
1623
|
-
/* @__PURE__ */
|
|
1624
|
-
/* @__PURE__ */
|
|
1696
|
+
return /* @__PURE__ */ jsx6(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs5(DialogContent, { children: [
|
|
1697
|
+
/* @__PURE__ */ jsxs5(DialogHeader, { children: [
|
|
1698
|
+
/* @__PURE__ */ jsx6(DialogTitle, { children: "Assign to advisor" }),
|
|
1699
|
+
/* @__PURE__ */ jsx6(DialogDescription, { children: "Choose an advisor to handle this conversation." })
|
|
1625
1700
|
] }),
|
|
1626
|
-
/* @__PURE__ */
|
|
1627
|
-
roles.length > 0 && /* @__PURE__ */
|
|
1701
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-0", children: [
|
|
1702
|
+
roles.length > 0 && /* @__PURE__ */ jsx6("div", { className: "pb-3", children: /* @__PURE__ */ jsxs5(
|
|
1628
1703
|
ToggleGroup,
|
|
1629
1704
|
{
|
|
1630
1705
|
type: "single",
|
|
@@ -1637,14 +1712,14 @@ function AiConvAssignAdvisorDialog({
|
|
|
1637
1712
|
setRoleFilter(!v || v === "__all__" ? "" : v);
|
|
1638
1713
|
},
|
|
1639
1714
|
children: [
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
roles.map((role) => /* @__PURE__ */
|
|
1715
|
+
/* @__PURE__ */ jsx6(ToggleGroupItem, { value: "__all__", children: "All" }),
|
|
1716
|
+
roles.map((role) => /* @__PURE__ */ jsx6(ToggleGroupItem, { value: role, children: role }, role))
|
|
1642
1717
|
]
|
|
1643
1718
|
}
|
|
1644
1719
|
) }),
|
|
1645
|
-
/* @__PURE__ */
|
|
1646
|
-
/* @__PURE__ */
|
|
1647
|
-
/* @__PURE__ */
|
|
1720
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 border border-input px-3", children: [
|
|
1721
|
+
/* @__PURE__ */ jsx6(Search2, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
1722
|
+
/* @__PURE__ */ jsx6(
|
|
1648
1723
|
"input",
|
|
1649
1724
|
{
|
|
1650
1725
|
type: "text",
|
|
@@ -1655,7 +1730,7 @@ function AiConvAssignAdvisorDialog({
|
|
|
1655
1730
|
}
|
|
1656
1731
|
)
|
|
1657
1732
|
] }),
|
|
1658
|
-
/* @__PURE__ */
|
|
1733
|
+
/* @__PURE__ */ jsx6("div", { className: "max-h-52 overflow-y-auto border border-t-0 border-input", children: filtered.length === 0 ? /* @__PURE__ */ jsx6("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "No advisors found." }) : filtered.map((advisor) => /* @__PURE__ */ jsxs5(
|
|
1659
1734
|
"button",
|
|
1660
1735
|
{
|
|
1661
1736
|
type: "button",
|
|
@@ -1665,19 +1740,19 @@ function AiConvAssignAdvisorDialog({
|
|
|
1665
1740
|
value === advisor.id && "bg-muted font-medium"
|
|
1666
1741
|
),
|
|
1667
1742
|
children: [
|
|
1668
|
-
/* @__PURE__ */
|
|
1669
|
-
/* @__PURE__ */
|
|
1670
|
-
/* @__PURE__ */
|
|
1671
|
-
advisor.role && /* @__PURE__ */
|
|
1743
|
+
/* @__PURE__ */ jsx6(Avatar, { size: "sm", children: /* @__PURE__ */ jsx6(AvatarFallback, { className: "font-semibold", children: advisor.initials }) }),
|
|
1744
|
+
/* @__PURE__ */ jsxs5("div", { className: "min-w-0 flex-1", children: [
|
|
1745
|
+
/* @__PURE__ */ jsx6("p", { className: "truncate text-sm", children: advisor.name }),
|
|
1746
|
+
advisor.role && /* @__PURE__ */ jsx6("p", { className: "truncate text-xs text-muted-foreground", children: advisor.role })
|
|
1672
1747
|
] })
|
|
1673
1748
|
]
|
|
1674
1749
|
},
|
|
1675
1750
|
advisor.id
|
|
1676
1751
|
)) })
|
|
1677
1752
|
] }),
|
|
1678
|
-
/* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */
|
|
1680
|
-
/* @__PURE__ */
|
|
1753
|
+
/* @__PURE__ */ jsxs5(DialogFooter, { children: [
|
|
1754
|
+
/* @__PURE__ */ jsx6(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
1755
|
+
/* @__PURE__ */ jsx6(Button, { onClick: onConfirm, children: "Assign" })
|
|
1681
1756
|
] })
|
|
1682
1757
|
] }) });
|
|
1683
1758
|
}
|