@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.
- package/.turbo/turbo-build.log +144 -144
- package/CHANGELOG.md +6 -0
- package/dist/{chunk-RYGZRDP6.mjs → chunk-4FJC64FV.mjs} +468 -410
- package/dist/{chunk-FGHM34AV.mjs → chunk-7JVKSZ4O.mjs} +1 -1
- package/dist/{chunk-6HTE24TP.mjs → chunk-EY5YPFKX.mjs} +1 -1
- package/dist/{chunk-3HFOSFOM.mjs → chunk-IG7DEIWU.mjs} +4 -4
- package/dist/{chunk-2VTOF7PW.mjs → chunk-K2KX3NX7.mjs} +1 -1
- package/dist/{chunk-NXZ2F4JA.mjs → chunk-KGBLORCQ.mjs} +1 -1
- package/dist/{chunk-2SDEURIQ.mjs → chunk-PX2B3Q3A.mjs} +7 -7
- package/dist/{chunk-66NM4AX2.mjs → chunk-QM7LU2BR.mjs} +10 -10
- package/dist/{chunk-4UCRTTVL.mjs → chunk-RNLIZRAK.mjs} +1 -1
- package/dist/{chunk-BWG7AX6X.mjs → chunk-SQ54W3JH.mjs} +1 -1
- package/dist/{chunk-RJHE3V4M.mjs → chunk-UMR3HVZF.mjs} +4 -4
- package/dist/{chunk-JGUC3KCA.mjs → chunk-VNB5E7SI.mjs} +5 -5
- package/dist/{chunk-ETT5JAXF.mjs → chunk-Z5QI7CW2.mjs} +1 -1
- package/dist/components/ui/about-you-form.mjs +4 -4
- package/dist/components/ui/ai-assistant-drawer.mjs +2 -2
- package/dist/components/ui/{ai-conversations.js → ai-conversations/index.js} +818 -763
- package/dist/components/ui/ai-conversations/index.mjs +42 -0
- package/dist/components/ui/appointment-action-dialogs.mjs +1 -1
- package/dist/components/ui/appointment-availability-settings.mjs +5 -5
- package/dist/components/ui/appointment-book-dialog.mjs +4 -4
- package/dist/components/ui/appointment-detail-sheet.mjs +3 -3
- package/dist/components/ui/appointment-upcoming-card.mjs +1 -1
- package/dist/components/ui/assets-liabilities-side-card.mjs +6 -6
- package/dist/components/ui/backoffice-signup-steps.mjs +4 -4
- package/dist/components/ui/bank-statement-generate-dialog.mjs +6 -6
- package/dist/components/ui/contact-alert-dialog/index.mjs +2 -2
- package/dist/components/ui/create-contact-modal.mjs +3 -3
- package/dist/components/ui/date-picker.mjs +2 -2
- package/dist/components/ui/expense-detail-item.mjs +3 -3
- package/dist/components/ui/expense-work-details.mjs +9 -9
- package/dist/components/ui/file-preview-dialog.mjs +2 -2
- package/dist/components/ui/financial-drawers.mjs +2 -2
- package/dist/components/ui/form-primitives.mjs +2 -2
- package/dist/components/ui/frontend-signup-steps.mjs +5 -5
- package/dist/components/ui/income-work-details.mjs +3 -3
- package/dist/components/ui/kanban-column.mjs +4 -4
- package/dist/components/ui/opportunity-card.mjs +1 -1
- package/dist/components/ui/opportunity-edit-modals.mjs +6 -6
- package/dist/components/ui/opportunity-summary-tab.mjs +8 -8
- package/dist/components/ui/pipeline-board.mjs +6 -6
- package/dist/components/ui/pipeline-dialogs.mjs +5 -5
- package/dist/components/ui/property-report-dialog.mjs +4 -4
- package/dist/components/ui/savings-goal-modal.mjs +4 -4
- package/dist/components/ui/share-details-dialog.mjs +2 -2
- package/dist/components/ui/signup-form-primitives.mjs +1 -1
- package/dist/index.js +4913 -4858
- package/dist/index.mjs +160 -160
- package/dist/styles.css +1 -1
- package/package.json +4 -4
- package/src/components/index.tsx +1 -0
- package/src/components/ui/ai-conversations/helpers.tsx +31 -0
- package/src/components/ui/ai-conversations/index.tsx +468 -0
- package/src/components/ui/ai-conversations/lead-panel.tsx +517 -0
- package/src/components/ui/ai-conversations/list.tsx +335 -0
- package/src/components/ui/ai-conversations/thread.tsx +919 -0
- package/src/components/ui/ai-conversations/types.ts +83 -0
- package/src/styles/styles-css.ts +1 -1
- package/tsup.config.ts +1 -1
- package/dist/components/ui/ai-conversations.mjs +0 -42
- package/src/components/ui/ai-conversations.tsx +0 -2270
- package/dist/{chunk-A43XIVO6.mjs → chunk-2PWTXE66.mjs} +3 -3
- package/dist/{chunk-PSBQ4I3M.mjs → chunk-53ZB2JWT.mjs} +6 -6
- package/dist/{chunk-G6RCC2SF.mjs → chunk-5ST6BK7R.mjs} +3 -3
- package/dist/{chunk-H5NI6ZIU.mjs → chunk-734FOOJC.mjs} +3 -3
- package/dist/{chunk-ONYADWSO.mjs → chunk-ABVCQWDY.mjs} +3 -3
- package/dist/{chunk-AADJ5IT6.mjs → chunk-ECC2LLZM.mjs} +3 -3
- package/dist/{chunk-DK55HZPN.mjs → chunk-KENLXFJ7.mjs} +6 -6
- package/dist/{chunk-ET4MTPIY.mjs → chunk-LDC6V6DJ.mjs} +3 -3
- package/dist/{chunk-3S4XQTAL.mjs → chunk-SO4RB3XB.mjs} +9 -9
- package/dist/{chunk-UMF6LLQK.mjs → chunk-TRM3KIHT.mjs} +3 -3
|
@@ -56,7 +56,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
56
56
|
));
|
|
57
57
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
58
|
|
|
59
|
-
// src/components/ui/ai-conversations.tsx
|
|
59
|
+
// src/components/ui/ai-conversations/index.tsx
|
|
60
60
|
var ai_conversations_exports = {};
|
|
61
61
|
__export(ai_conversations_exports, {
|
|
62
62
|
AICollectedDataSection: () => AICollectedDataSection,
|
|
@@ -71,15 +71,8 @@ __export(ai_conversations_exports, {
|
|
|
71
71
|
LeadInfoPanel: () => LeadInfoPanel
|
|
72
72
|
});
|
|
73
73
|
module.exports = __toCommonJS(ai_conversations_exports);
|
|
74
|
-
var
|
|
75
|
-
var
|
|
76
|
-
var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
|
|
77
|
-
var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
|
|
78
|
-
var import_extension_link = __toESM(require("@tiptap/extension-link"));
|
|
79
|
-
var import_react_markdown = __toESM(require("react-markdown"));
|
|
80
|
-
var import_rehype_raw = __toESM(require("rehype-raw"));
|
|
81
|
-
var import_rehype_sanitize = __toESM(require("rehype-sanitize"));
|
|
82
|
-
var import_lucide_react4 = require("lucide-react");
|
|
74
|
+
var import_react5 = require("react");
|
|
75
|
+
var import_lucide_react7 = require("lucide-react");
|
|
83
76
|
|
|
84
77
|
// src/lib/utils.ts
|
|
85
78
|
var import_clsx = require("clsx");
|
|
@@ -165,8 +158,10 @@ function AvatarFallback(_a) {
|
|
|
165
158
|
);
|
|
166
159
|
}
|
|
167
160
|
|
|
168
|
-
// src/components/ui/
|
|
161
|
+
// src/components/ui/button.tsx
|
|
162
|
+
var import_react = require("react");
|
|
169
163
|
var import_class_variance_authority = require("class-variance-authority");
|
|
164
|
+
var import_lucide_react = require("lucide-react");
|
|
170
165
|
|
|
171
166
|
// src/lib/slot.tsx
|
|
172
167
|
var React = __toESM(require("react"));
|
|
@@ -215,56 +210,9 @@ var Slot = React.forwardRef(
|
|
|
215
210
|
);
|
|
216
211
|
Slot.displayName = "Slot";
|
|
217
212
|
|
|
218
|
-
// src/components/ui/badge.tsx
|
|
219
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
220
|
-
var badgeVariants = (0, import_class_variance_authority.cva)(
|
|
221
|
-
"inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2.5 py-0.5 text-caption whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",
|
|
222
|
-
{
|
|
223
|
-
variants: {
|
|
224
|
-
variant: {
|
|
225
|
-
default: "border-primary/40 bg-primary/10 text-foreground [a&]:hover:bg-primary/15",
|
|
226
|
-
secondary: "border-border bg-muted text-muted-foreground [a&]:hover:bg-muted/80",
|
|
227
|
-
destructive: "border-destructive/40 bg-destructive/10 text-destructive-text focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/15",
|
|
228
|
-
success: "border-success/40 bg-success/10 text-success-text [a&]:hover:bg-success/15",
|
|
229
|
-
warning: "border-warning/40 bg-warning/10 text-warning-text [a&]:hover:bg-warning/15",
|
|
230
|
-
info: "border-info/40 bg-info/10 text-info-text [a&]:hover:bg-info/15",
|
|
231
|
-
outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
232
|
-
ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
233
|
-
link: "text-primary underline-offset-4 [a&]:hover:underline"
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
defaultVariants: {
|
|
237
|
-
variant: "default"
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
);
|
|
241
|
-
function Badge(_a) {
|
|
242
|
-
var _b = _a, {
|
|
243
|
-
className,
|
|
244
|
-
variant = "default",
|
|
245
|
-
asChild = false
|
|
246
|
-
} = _b, props = __objRest(_b, [
|
|
247
|
-
"className",
|
|
248
|
-
"variant",
|
|
249
|
-
"asChild"
|
|
250
|
-
]);
|
|
251
|
-
const Comp = asChild ? Slot : "span";
|
|
252
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
253
|
-
Comp,
|
|
254
|
-
__spreadValues({
|
|
255
|
-
className: cn(badgeVariants({ variant }), className),
|
|
256
|
-
"data-slot": "badge",
|
|
257
|
-
"data-variant": variant
|
|
258
|
-
}, props)
|
|
259
|
-
);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
213
|
// src/components/ui/button.tsx
|
|
263
|
-
var
|
|
264
|
-
var
|
|
265
|
-
var import_lucide_react = require("lucide-react");
|
|
266
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
267
|
-
var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
214
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
215
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
268
216
|
"inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 font-sans text-button whitespace-nowrap transition-all active:scale-[0.98] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
269
217
|
{
|
|
270
218
|
variants: {
|
|
@@ -317,7 +265,7 @@ var Button = (0, import_react.forwardRef)(function Button2(_a, ref) {
|
|
|
317
265
|
]);
|
|
318
266
|
const Comp = asChild ? Slot : "button";
|
|
319
267
|
const isIconOnly = size === "icon" || size === "icon-xs" || size === "icon-sm" || size === "icon-lg";
|
|
320
|
-
return /* @__PURE__ */ (0,
|
|
268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
321
269
|
Comp,
|
|
322
270
|
__spreadProps(__spreadValues({
|
|
323
271
|
className: cn(buttonVariants({ variant, size, className })),
|
|
@@ -328,127 +276,35 @@ var Button = (0, import_react.forwardRef)(function Button2(_a, ref) {
|
|
|
328
276
|
ref,
|
|
329
277
|
type
|
|
330
278
|
}, props), {
|
|
331
|
-
children: loading ? /* @__PURE__ */ (0,
|
|
332
|
-
/* @__PURE__ */ (0,
|
|
279
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
280
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.Loader2, { "aria-hidden": "true", className: "animate-spin" }),
|
|
333
281
|
!isIconOnly && children
|
|
334
282
|
] }) : children
|
|
335
283
|
})
|
|
336
284
|
);
|
|
337
285
|
});
|
|
338
286
|
|
|
339
|
-
// src/components/ui/
|
|
340
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
341
|
-
function Input(_a) {
|
|
342
|
-
var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
|
|
343
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
344
|
-
"input",
|
|
345
|
-
__spreadValues({
|
|
346
|
-
className: cn(
|
|
347
|
-
"h-9 w-full min-w-0 border border-input bg-transparent px-3 py-1 text-body-medium font-sans shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-label-medium file:text-foreground placeholder:font-normal placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30",
|
|
348
|
-
"focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20",
|
|
349
|
-
"aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
|
|
350
|
-
className
|
|
351
|
-
),
|
|
352
|
-
"data-slot": "input",
|
|
353
|
-
type
|
|
354
|
-
}, props)
|
|
355
|
-
);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
// src/components/ui/dropdown-menu.tsx
|
|
287
|
+
// src/components/ui/dialog.tsx
|
|
359
288
|
var import_lucide_react2 = require("lucide-react");
|
|
360
|
-
var
|
|
289
|
+
var import_dialog = require("@base-ui/react/dialog");
|
|
361
290
|
|
|
362
291
|
// src/lib/theme-provider.tsx
|
|
363
292
|
var import_react2 = require("react");
|
|
364
|
-
var
|
|
293
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
365
294
|
var ThemeVarsContext = (0, import_react2.createContext)({});
|
|
366
295
|
function useThemeVars() {
|
|
367
296
|
return (0, import_react2.useContext)(ThemeVarsContext);
|
|
368
297
|
}
|
|
369
298
|
|
|
370
|
-
// src/components/ui/dropdown-menu.tsx
|
|
371
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
372
|
-
function DropdownMenu(_a) {
|
|
373
|
-
var props = __objRest(_a, []);
|
|
374
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_menu.Menu.Root, __spreadValues({ "data-slot": "dropdown-menu" }, props));
|
|
375
|
-
}
|
|
376
|
-
function DropdownMenuTrigger(_a) {
|
|
377
|
-
var props = __objRest(_a, []);
|
|
378
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_menu.Menu.Trigger, __spreadValues({ "data-slot": "dropdown-menu-trigger" }, props));
|
|
379
|
-
}
|
|
380
|
-
function DropdownMenuContent(_a) {
|
|
381
|
-
var _b = _a, {
|
|
382
|
-
className,
|
|
383
|
-
sideOffset = 4,
|
|
384
|
-
style
|
|
385
|
-
} = _b, props = __objRest(_b, [
|
|
386
|
-
"className",
|
|
387
|
-
"sideOffset",
|
|
388
|
-
"style"
|
|
389
|
-
]);
|
|
390
|
-
const themeVars = useThemeVars();
|
|
391
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_menu.Menu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_menu.Menu.Positioner, { sideOffset, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
392
|
-
import_menu.Menu.Popup,
|
|
393
|
-
__spreadValues({
|
|
394
|
-
className: cn(
|
|
395
|
-
"z-50 min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-none border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
396
|
-
className
|
|
397
|
-
),
|
|
398
|
-
"data-slot": "dropdown-menu-content",
|
|
399
|
-
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
400
|
-
}, props)
|
|
401
|
-
) }) });
|
|
402
|
-
}
|
|
403
|
-
function DropdownMenuItem(_a) {
|
|
404
|
-
var _b = _a, {
|
|
405
|
-
className,
|
|
406
|
-
inset,
|
|
407
|
-
variant = "default"
|
|
408
|
-
} = _b, props = __objRest(_b, [
|
|
409
|
-
"className",
|
|
410
|
-
"inset",
|
|
411
|
-
"variant"
|
|
412
|
-
]);
|
|
413
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
414
|
-
import_menu.Menu.Item,
|
|
415
|
-
__spreadValues({
|
|
416
|
-
className: cn(
|
|
417
|
-
"relative flex cursor-default items-center gap-2 rounded-none px-2 py-1.5 text-body-small outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",
|
|
418
|
-
className
|
|
419
|
-
),
|
|
420
|
-
"data-inset": inset,
|
|
421
|
-
"data-slot": "dropdown-menu-item",
|
|
422
|
-
"data-variant": variant
|
|
423
|
-
}, props)
|
|
424
|
-
);
|
|
425
|
-
}
|
|
426
|
-
function DropdownMenuSeparator(_a) {
|
|
427
|
-
var _b = _a, {
|
|
428
|
-
className
|
|
429
|
-
} = _b, props = __objRest(_b, [
|
|
430
|
-
"className"
|
|
431
|
-
]);
|
|
432
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
433
|
-
import_menu.Menu.Separator,
|
|
434
|
-
__spreadValues({
|
|
435
|
-
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
436
|
-
"data-slot": "dropdown-menu-separator"
|
|
437
|
-
}, props)
|
|
438
|
-
);
|
|
439
|
-
}
|
|
440
|
-
|
|
441
299
|
// src/components/ui/dialog.tsx
|
|
442
|
-
var
|
|
443
|
-
var import_dialog = require("@base-ui/react/dialog");
|
|
444
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
300
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
445
301
|
function Dialog(_a) {
|
|
446
302
|
var props = __objRest(_a, []);
|
|
447
|
-
return /* @__PURE__ */ (0,
|
|
303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dialog.Dialog.Root, __spreadValues({ "data-slot": "dialog" }, props));
|
|
448
304
|
}
|
|
449
305
|
function DialogPortal(_a) {
|
|
450
306
|
var props = __objRest(_a, []);
|
|
451
|
-
return /* @__PURE__ */ (0,
|
|
307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dialog.Dialog.Portal, __spreadValues({ "data-slot": "dialog-portal" }, props));
|
|
452
308
|
}
|
|
453
309
|
function DialogOverlay(_a) {
|
|
454
310
|
var _b = _a, {
|
|
@@ -456,7 +312,7 @@ function DialogOverlay(_a) {
|
|
|
456
312
|
} = _b, props = __objRest(_b, [
|
|
457
313
|
"className"
|
|
458
314
|
]);
|
|
459
|
-
return /* @__PURE__ */ (0,
|
|
315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
460
316
|
import_dialog.Dialog.Backdrop,
|
|
461
317
|
__spreadValues({
|
|
462
318
|
className: cn(
|
|
@@ -502,9 +358,9 @@ function DialogContent(_a) {
|
|
|
502
358
|
const themeVars = useThemeVars();
|
|
503
359
|
const isAuto = size === "auto";
|
|
504
360
|
const sizeStyle = isAuto ? { minWidth: minWidth != null ? minWidth : DIALOG_AUTO_MIN_WIDTH } : { maxWidth: DIALOG_MAX_WIDTHS[size] };
|
|
505
|
-
return /* @__PURE__ */ (0,
|
|
506
|
-
/* @__PURE__ */ (0,
|
|
507
|
-
/* @__PURE__ */ (0,
|
|
361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(DialogPortal, { container: container != null ? container : void 0, children: [
|
|
362
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DialogOverlay, { style: themeVars }),
|
|
363
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
508
364
|
import_dialog.Dialog.Popup,
|
|
509
365
|
__spreadProps(__spreadValues({
|
|
510
366
|
className: cn(
|
|
@@ -525,14 +381,14 @@ function DialogContent(_a) {
|
|
|
525
381
|
}, props), {
|
|
526
382
|
children: [
|
|
527
383
|
children,
|
|
528
|
-
showCloseButton ? /* @__PURE__ */ (0,
|
|
384
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
529
385
|
import_dialog.Dialog.Close,
|
|
530
386
|
{
|
|
531
387
|
className: "absolute top-4 right-4 inline-flex size-7 items-center justify-center transition-colors hover:bg-foreground/5 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border focus-visible:ring-offset-0 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
532
388
|
"data-slot": "dialog-close",
|
|
533
389
|
children: [
|
|
534
|
-
/* @__PURE__ */ (0,
|
|
535
|
-
/* @__PURE__ */ (0,
|
|
390
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.XIcon, {}),
|
|
391
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "sr-only", children: "Close" })
|
|
536
392
|
]
|
|
537
393
|
}
|
|
538
394
|
) : null
|
|
@@ -547,7 +403,7 @@ function DialogHeader(_a) {
|
|
|
547
403
|
} = _b, props = __objRest(_b, [
|
|
548
404
|
"className"
|
|
549
405
|
]);
|
|
550
|
-
return /* @__PURE__ */ (0,
|
|
406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
551
407
|
"div",
|
|
552
408
|
__spreadValues({
|
|
553
409
|
className: cn("flex flex-col gap-1.5", className),
|
|
@@ -565,7 +421,7 @@ function DialogFooter(_a) {
|
|
|
565
421
|
"showCloseButton",
|
|
566
422
|
"children"
|
|
567
423
|
]);
|
|
568
|
-
return /* @__PURE__ */ (0,
|
|
424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
569
425
|
"div",
|
|
570
426
|
__spreadProps(__spreadValues({
|
|
571
427
|
className: cn(
|
|
@@ -577,7 +433,7 @@ function DialogFooter(_a) {
|
|
|
577
433
|
}, props), {
|
|
578
434
|
children: [
|
|
579
435
|
children,
|
|
580
|
-
showCloseButton ? /* @__PURE__ */ (0,
|
|
436
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
581
437
|
import_dialog.Dialog.Close,
|
|
582
438
|
{
|
|
583
439
|
className: cn(buttonVariants({ variant: "outline" })),
|
|
@@ -591,7 +447,7 @@ function DialogFooter(_a) {
|
|
|
591
447
|
}
|
|
592
448
|
function DialogTitle(_a) {
|
|
593
449
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
594
|
-
return /* @__PURE__ */ (0,
|
|
450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
595
451
|
import_dialog.Dialog.Title,
|
|
596
452
|
__spreadValues({
|
|
597
453
|
className: cn("text-h5 leading-none", className),
|
|
@@ -605,7 +461,7 @@ function DialogDescription(_a) {
|
|
|
605
461
|
} = _b, props = __objRest(_b, [
|
|
606
462
|
"className"
|
|
607
463
|
]);
|
|
608
|
-
return /* @__PURE__ */ (0,
|
|
464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
609
465
|
import_dialog.Dialog.Description,
|
|
610
466
|
__spreadValues({
|
|
611
467
|
className: cn("text-body-small text-muted-foreground", className),
|
|
@@ -614,178 +470,16 @@ function DialogDescription(_a) {
|
|
|
614
470
|
);
|
|
615
471
|
}
|
|
616
472
|
|
|
617
|
-
// src/components/ui/popover.tsx
|
|
618
|
-
var import_popover = require("@base-ui/react/popover");
|
|
619
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
620
|
-
function Popover(_a) {
|
|
621
|
-
var props = __objRest(_a, []);
|
|
622
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_popover.Popover.Root, __spreadValues({ "data-slot": "popover" }, props));
|
|
623
|
-
}
|
|
624
|
-
function PopoverTrigger(_a) {
|
|
625
|
-
var props = __objRest(_a, []);
|
|
626
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_popover.Popover.Trigger, __spreadValues({ "data-slot": "popover-trigger" }, props));
|
|
627
|
-
}
|
|
628
|
-
function PopoverContent(_a) {
|
|
629
|
-
var _b = _a, {
|
|
630
|
-
className,
|
|
631
|
-
align = "center",
|
|
632
|
-
sideOffset = 4,
|
|
633
|
-
style
|
|
634
|
-
} = _b, props = __objRest(_b, [
|
|
635
|
-
"className",
|
|
636
|
-
"align",
|
|
637
|
-
"sideOffset",
|
|
638
|
-
"style"
|
|
639
|
-
]);
|
|
640
|
-
const themeVars = useThemeVars();
|
|
641
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_popover.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
642
|
-
import_popover.Popover.Positioner,
|
|
643
|
-
{
|
|
644
|
-
className: "z-[200]",
|
|
645
|
-
align,
|
|
646
|
-
sideOffset,
|
|
647
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
648
|
-
import_popover.Popover.Popup,
|
|
649
|
-
__spreadValues({
|
|
650
|
-
className: cn(
|
|
651
|
-
"z-50 w-72 border border-border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
652
|
-
className
|
|
653
|
-
),
|
|
654
|
-
"data-slot": "popover-content",
|
|
655
|
-
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
656
|
-
}, props)
|
|
657
|
-
)
|
|
658
|
-
}
|
|
659
|
-
) });
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
// src/components/ui/separator.tsx
|
|
663
|
-
var import_separator = require("@base-ui/react/separator");
|
|
664
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
665
|
-
function Separator(_a) {
|
|
666
|
-
var _b = _a, {
|
|
667
|
-
className,
|
|
668
|
-
orientation = "horizontal"
|
|
669
|
-
} = _b, props = __objRest(_b, [
|
|
670
|
-
"className",
|
|
671
|
-
"orientation"
|
|
672
|
-
]);
|
|
673
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
674
|
-
import_separator.Separator,
|
|
675
|
-
__spreadValues({
|
|
676
|
-
className: cn(
|
|
677
|
-
"shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
678
|
-
className
|
|
679
|
-
),
|
|
680
|
-
"data-orientation": orientation,
|
|
681
|
-
"data-slot": "separator"
|
|
682
|
-
}, props)
|
|
683
|
-
);
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
// src/components/ui/tabs.tsx
|
|
687
|
-
var import_class_variance_authority3 = require("class-variance-authority");
|
|
688
|
-
var import_tabs = require("@base-ui/react/tabs");
|
|
689
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
690
|
-
function Tabs(_a) {
|
|
691
|
-
var _b = _a, {
|
|
692
|
-
className,
|
|
693
|
-
orientation = "horizontal"
|
|
694
|
-
} = _b, props = __objRest(_b, [
|
|
695
|
-
"className",
|
|
696
|
-
"orientation"
|
|
697
|
-
]);
|
|
698
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
699
|
-
import_tabs.Tabs.Root,
|
|
700
|
-
__spreadValues({
|
|
701
|
-
className: cn(
|
|
702
|
-
"group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
|
|
703
|
-
className
|
|
704
|
-
),
|
|
705
|
-
"data-orientation": orientation,
|
|
706
|
-
"data-slot": "tabs"
|
|
707
|
-
}, props)
|
|
708
|
-
);
|
|
709
|
-
}
|
|
710
|
-
var tabsListVariants = (0, import_class_variance_authority3.cva)(
|
|
711
|
-
"group/tabs-list inline-flex w-fit items-center justify-center gap-1 rounded-none p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",
|
|
712
|
-
{
|
|
713
|
-
variants: {
|
|
714
|
-
variant: {
|
|
715
|
-
default: "bg-muted",
|
|
716
|
-
line: "bg-transparent p-0"
|
|
717
|
-
}
|
|
718
|
-
},
|
|
719
|
-
defaultVariants: {
|
|
720
|
-
variant: "default"
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
);
|
|
724
|
-
function TabsList(_a) {
|
|
725
|
-
var _b = _a, {
|
|
726
|
-
className,
|
|
727
|
-
variant = "default"
|
|
728
|
-
} = _b, props = __objRest(_b, [
|
|
729
|
-
"className",
|
|
730
|
-
"variant"
|
|
731
|
-
]);
|
|
732
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
733
|
-
import_tabs.Tabs.List,
|
|
734
|
-
__spreadValues({
|
|
735
|
-
className: cn(tabsListVariants({ variant }), className),
|
|
736
|
-
"data-slot": "tabs-list",
|
|
737
|
-
"data-variant": variant
|
|
738
|
-
}, props)
|
|
739
|
-
);
|
|
740
|
-
}
|
|
741
|
-
function TabsTrigger(_a) {
|
|
742
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
743
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
744
|
-
import_tabs.Tabs.Tab,
|
|
745
|
-
__spreadValues({
|
|
746
|
-
className: cn(
|
|
747
|
-
// Base layout & typography
|
|
748
|
-
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 whitespace-nowrap",
|
|
749
|
-
"rounded-none border border-transparent px-1.5 py-1 text-label-medium",
|
|
750
|
-
"text-muted-foreground transition-all",
|
|
751
|
-
// Vertical orientation
|
|
752
|
-
"group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start",
|
|
753
|
-
// Hover & focus
|
|
754
|
-
"hover:text-foreground",
|
|
755
|
-
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring",
|
|
756
|
-
// Disabled
|
|
757
|
-
"disabled:pointer-events-none disabled:opacity-50",
|
|
758
|
-
// Active state — Default variant: primary/10 bg + subtle shadow
|
|
759
|
-
// Base UI uses data-active attribute for the active/selected tab
|
|
760
|
-
"data-active:bg-primary/10 data-active:text-foreground",
|
|
761
|
-
"group-data-[variant=default]/tabs-list:data-active:shadow-sm",
|
|
762
|
-
// Active state — Line variant: suppress bg & shadow
|
|
763
|
-
"group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
764
|
-
"group-data-[variant=line]/tabs-list:data-active:shadow-none",
|
|
765
|
-
// Indicator pseudo-element (visible only for Line variant, active state)
|
|
766
|
-
"after:absolute after:bg-primary after:opacity-0 after:transition-opacity",
|
|
767
|
-
"group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5",
|
|
768
|
-
"group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5",
|
|
769
|
-
"group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
|
|
770
|
-
// SVG icons
|
|
771
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
772
|
-
className
|
|
773
|
-
),
|
|
774
|
-
"data-slot": "tabs-trigger"
|
|
775
|
-
}, props)
|
|
776
|
-
);
|
|
777
|
-
}
|
|
778
|
-
|
|
779
473
|
// src/components/ui/toggle-group.tsx
|
|
780
474
|
var React3 = __toESM(require("react"));
|
|
781
475
|
var import_toggle_group = require("@base-ui/react/toggle-group");
|
|
782
476
|
var import_toggle2 = require("@base-ui/react/toggle");
|
|
783
477
|
|
|
784
478
|
// src/components/ui/toggle.tsx
|
|
785
|
-
var
|
|
479
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
786
480
|
var import_toggle = require("@base-ui/react/toggle");
|
|
787
|
-
var
|
|
788
|
-
var toggleVariants = (0,
|
|
481
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
482
|
+
var toggleVariants = (0, import_class_variance_authority2.cva)(
|
|
789
483
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-pressed:bg-primary/10 data-pressed:inset-ring data-pressed:inset-ring-primary data-pressed:text-foreground data-pressed:hover:bg-primary/10 data-pressed:hover:text-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
790
484
|
{
|
|
791
485
|
variants: {
|
|
@@ -807,7 +501,7 @@ var toggleVariants = (0, import_class_variance_authority4.cva)(
|
|
|
807
501
|
);
|
|
808
502
|
|
|
809
503
|
// src/components/ui/toggle-group.tsx
|
|
810
|
-
var
|
|
504
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
811
505
|
var ToggleGroupContext = React3.createContext({
|
|
812
506
|
size: "default",
|
|
813
507
|
variant: "default",
|
|
@@ -829,7 +523,7 @@ function ToggleGroup(_a) {
|
|
|
829
523
|
"type",
|
|
830
524
|
"children"
|
|
831
525
|
]);
|
|
832
|
-
return /* @__PURE__ */ (0,
|
|
526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
833
527
|
import_toggle_group.ToggleGroup,
|
|
834
528
|
__spreadProps(__spreadValues({
|
|
835
529
|
className: cn(
|
|
@@ -844,7 +538,7 @@ function ToggleGroup(_a) {
|
|
|
844
538
|
multiple: type === "multiple",
|
|
845
539
|
style: { "--gap": spacing }
|
|
846
540
|
}, props), {
|
|
847
|
-
children: /* @__PURE__ */ (0,
|
|
541
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ToggleGroupContext.Provider, { value: { variant, size, spacing }, children })
|
|
848
542
|
})
|
|
849
543
|
);
|
|
850
544
|
}
|
|
@@ -861,7 +555,7 @@ function ToggleGroupItem(_a) {
|
|
|
861
555
|
"size"
|
|
862
556
|
]);
|
|
863
557
|
const context = React3.useContext(ToggleGroupContext);
|
|
864
|
-
return /* @__PURE__ */ (0,
|
|
558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
865
559
|
import_toggle2.Toggle,
|
|
866
560
|
__spreadProps(__spreadValues({
|
|
867
561
|
className: cn(
|
|
@@ -884,33 +578,16 @@ function ToggleGroupItem(_a) {
|
|
|
884
578
|
);
|
|
885
579
|
}
|
|
886
580
|
|
|
887
|
-
// src/components/ui/textarea.tsx
|
|
888
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
889
|
-
function Textarea(_a) {
|
|
890
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
891
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
892
|
-
"textarea",
|
|
893
|
-
__spreadValues({
|
|
894
|
-
className: cn(
|
|
895
|
-
// WealthX: removed shadow-xs (flat panels), added font-sans
|
|
896
|
-
"flex field-sizing-content min-h-16 w-full border border-input bg-transparent px-3 py-2 text-body-medium font-sans transition-[color,box-shadow] outline-none placeholder:font-normal placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
897
|
-
className
|
|
898
|
-
),
|
|
899
|
-
"data-slot": "textarea"
|
|
900
|
-
}, props)
|
|
901
|
-
);
|
|
902
|
-
}
|
|
903
|
-
|
|
904
581
|
// src/components/ui/tooltip.tsx
|
|
905
582
|
var import_tooltip = require("@base-ui/react/tooltip");
|
|
906
|
-
var
|
|
583
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
907
584
|
function TooltipProvider(_a) {
|
|
908
585
|
var _b = _a, {
|
|
909
586
|
delay = 0
|
|
910
587
|
} = _b, props = __objRest(_b, [
|
|
911
588
|
"delay"
|
|
912
589
|
]);
|
|
913
|
-
return /* @__PURE__ */ (0,
|
|
590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
914
591
|
import_tooltip.Tooltip.Provider,
|
|
915
592
|
__spreadValues({
|
|
916
593
|
"data-slot": "tooltip-provider",
|
|
@@ -920,11 +597,11 @@ function TooltipProvider(_a) {
|
|
|
920
597
|
}
|
|
921
598
|
function Tooltip(_a) {
|
|
922
599
|
var props = __objRest(_a, []);
|
|
923
|
-
return /* @__PURE__ */ (0,
|
|
600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_tooltip.Tooltip.Root, __spreadValues({ "data-slot": "tooltip" }, props));
|
|
924
601
|
}
|
|
925
602
|
function TooltipTrigger(_a) {
|
|
926
603
|
var props = __objRest(_a, []);
|
|
927
|
-
return /* @__PURE__ */ (0,
|
|
604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_tooltip.Tooltip.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
|
|
928
605
|
}
|
|
929
606
|
function TooltipContent(_a) {
|
|
930
607
|
var _b = _a, {
|
|
@@ -941,36 +618,201 @@ function TooltipContent(_a) {
|
|
|
941
618
|
"style"
|
|
942
619
|
]);
|
|
943
620
|
const themeVars = useThemeVars();
|
|
944
|
-
return /* @__PURE__ */ (0,
|
|
621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_tooltip.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_tooltip.Tooltip.Positioner, { sideOffset, side, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
945
622
|
import_tooltip.Tooltip.Popup,
|
|
946
623
|
__spreadProps(__spreadValues({
|
|
947
624
|
className: cn(
|
|
948
625
|
"relative z-50 w-fit animate-in overflow-visible bg-brand-secondary px-3 py-1.5 text-caption text-balance text-brand-secondary-foreground fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards",
|
|
949
626
|
className
|
|
950
627
|
),
|
|
951
|
-
"data-slot": "tooltip-content",
|
|
952
|
-
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
953
|
-
}, props), {
|
|
954
|
-
children: [
|
|
955
|
-
children,
|
|
956
|
-
/* @__PURE__ */ (0,
|
|
957
|
-
]
|
|
958
|
-
})
|
|
959
|
-
) }) });
|
|
628
|
+
"data-slot": "tooltip-content",
|
|
629
|
+
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
630
|
+
}, props), {
|
|
631
|
+
children: [
|
|
632
|
+
children,
|
|
633
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_tooltip.Tooltip.Arrow, { className: "z-50 size-2.5 rotate-45 bg-brand-secondary data-[side=bottom]:-top-1 data-[side=left]:-right-1 data-[side=right]:-left-1 data-[side=top]:-bottom-1" })
|
|
634
|
+
]
|
|
635
|
+
})
|
|
636
|
+
) }) });
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
// src/components/ui/ai-conversations/list.tsx
|
|
640
|
+
var import_lucide_react3 = require("lucide-react");
|
|
641
|
+
|
|
642
|
+
// src/components/ui/badge.tsx
|
|
643
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
644
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
645
|
+
var badgeVariants = (0, import_class_variance_authority3.cva)(
|
|
646
|
+
"inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2.5 py-0.5 text-caption whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",
|
|
647
|
+
{
|
|
648
|
+
variants: {
|
|
649
|
+
variant: {
|
|
650
|
+
default: "border-primary/40 bg-primary/10 text-foreground [a&]:hover:bg-primary/15",
|
|
651
|
+
secondary: "border-border bg-muted text-muted-foreground [a&]:hover:bg-muted/80",
|
|
652
|
+
destructive: "border-destructive/40 bg-destructive/10 text-destructive-text focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/15",
|
|
653
|
+
success: "border-success/40 bg-success/10 text-success-text [a&]:hover:bg-success/15",
|
|
654
|
+
warning: "border-warning/40 bg-warning/10 text-warning-text [a&]:hover:bg-warning/15",
|
|
655
|
+
info: "border-info/40 bg-info/10 text-info-text [a&]:hover:bg-info/15",
|
|
656
|
+
outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
657
|
+
ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
658
|
+
link: "text-primary underline-offset-4 [a&]:hover:underline"
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
defaultVariants: {
|
|
662
|
+
variant: "default"
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
);
|
|
666
|
+
function Badge(_a) {
|
|
667
|
+
var _b = _a, {
|
|
668
|
+
className,
|
|
669
|
+
variant = "default",
|
|
670
|
+
asChild = false
|
|
671
|
+
} = _b, props = __objRest(_b, [
|
|
672
|
+
"className",
|
|
673
|
+
"variant",
|
|
674
|
+
"asChild"
|
|
675
|
+
]);
|
|
676
|
+
const Comp = asChild ? Slot : "span";
|
|
677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
678
|
+
Comp,
|
|
679
|
+
__spreadValues({
|
|
680
|
+
className: cn(badgeVariants({ variant }), className),
|
|
681
|
+
"data-slot": "badge",
|
|
682
|
+
"data-variant": variant
|
|
683
|
+
}, props)
|
|
684
|
+
);
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
// src/components/ui/input.tsx
|
|
688
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
689
|
+
function Input(_a) {
|
|
690
|
+
var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
|
|
691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
692
|
+
"input",
|
|
693
|
+
__spreadValues({
|
|
694
|
+
className: cn(
|
|
695
|
+
"h-9 w-full min-w-0 border border-input bg-transparent px-3 py-1 text-body-medium font-sans shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-label-medium file:text-foreground placeholder:font-normal placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30",
|
|
696
|
+
"focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20",
|
|
697
|
+
"aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
|
|
698
|
+
className
|
|
699
|
+
),
|
|
700
|
+
"data-slot": "input",
|
|
701
|
+
type
|
|
702
|
+
}, props)
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// src/components/ui/tabs.tsx
|
|
707
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
708
|
+
var import_tabs = require("@base-ui/react/tabs");
|
|
709
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
710
|
+
function Tabs(_a) {
|
|
711
|
+
var _b = _a, {
|
|
712
|
+
className,
|
|
713
|
+
orientation = "horizontal"
|
|
714
|
+
} = _b, props = __objRest(_b, [
|
|
715
|
+
"className",
|
|
716
|
+
"orientation"
|
|
717
|
+
]);
|
|
718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
719
|
+
import_tabs.Tabs.Root,
|
|
720
|
+
__spreadValues({
|
|
721
|
+
className: cn(
|
|
722
|
+
"group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
|
|
723
|
+
className
|
|
724
|
+
),
|
|
725
|
+
"data-orientation": orientation,
|
|
726
|
+
"data-slot": "tabs"
|
|
727
|
+
}, props)
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
var tabsListVariants = (0, import_class_variance_authority4.cva)(
|
|
731
|
+
"group/tabs-list inline-flex w-fit items-center justify-center gap-1 rounded-none p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",
|
|
732
|
+
{
|
|
733
|
+
variants: {
|
|
734
|
+
variant: {
|
|
735
|
+
default: "bg-muted",
|
|
736
|
+
line: "bg-transparent p-0"
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
defaultVariants: {
|
|
740
|
+
variant: "default"
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
);
|
|
744
|
+
function TabsList(_a) {
|
|
745
|
+
var _b = _a, {
|
|
746
|
+
className,
|
|
747
|
+
variant = "default"
|
|
748
|
+
} = _b, props = __objRest(_b, [
|
|
749
|
+
"className",
|
|
750
|
+
"variant"
|
|
751
|
+
]);
|
|
752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
753
|
+
import_tabs.Tabs.List,
|
|
754
|
+
__spreadValues({
|
|
755
|
+
className: cn(tabsListVariants({ variant }), className),
|
|
756
|
+
"data-slot": "tabs-list",
|
|
757
|
+
"data-variant": variant
|
|
758
|
+
}, props)
|
|
759
|
+
);
|
|
760
|
+
}
|
|
761
|
+
function TabsTrigger(_a) {
|
|
762
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
764
|
+
import_tabs.Tabs.Tab,
|
|
765
|
+
__spreadValues({
|
|
766
|
+
className: cn(
|
|
767
|
+
// Base layout & typography
|
|
768
|
+
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 whitespace-nowrap",
|
|
769
|
+
"rounded-none border border-transparent px-1.5 py-1 text-label-medium",
|
|
770
|
+
"text-muted-foreground transition-all",
|
|
771
|
+
// Vertical orientation
|
|
772
|
+
"group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start",
|
|
773
|
+
// Hover & focus
|
|
774
|
+
"hover:text-foreground",
|
|
775
|
+
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring",
|
|
776
|
+
// Disabled
|
|
777
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
778
|
+
// Active state — Default variant: primary/10 bg + subtle shadow
|
|
779
|
+
// Base UI uses data-active attribute for the active/selected tab
|
|
780
|
+
"data-active:bg-primary/10 data-active:text-foreground",
|
|
781
|
+
"group-data-[variant=default]/tabs-list:data-active:shadow-sm",
|
|
782
|
+
// Active state — Line variant: suppress bg & shadow
|
|
783
|
+
"group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
784
|
+
"group-data-[variant=line]/tabs-list:data-active:shadow-none",
|
|
785
|
+
// Indicator pseudo-element (visible only for Line variant, active state)
|
|
786
|
+
"after:absolute after:bg-primary after:opacity-0 after:transition-opacity",
|
|
787
|
+
"group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5",
|
|
788
|
+
"group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5",
|
|
789
|
+
"group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
|
|
790
|
+
// SVG icons
|
|
791
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
792
|
+
className
|
|
793
|
+
),
|
|
794
|
+
"data-slot": "tabs-trigger"
|
|
795
|
+
}, props)
|
|
796
|
+
);
|
|
960
797
|
}
|
|
961
798
|
|
|
962
|
-
// src/components/ui/ai-conversations.tsx
|
|
963
|
-
var
|
|
799
|
+
// src/components/ui/ai-conversations/helpers.tsx
|
|
800
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
964
801
|
function displayContactName(name) {
|
|
965
802
|
return name.trim() || "Website User";
|
|
966
803
|
}
|
|
967
804
|
var PANEL_HEADER_HEIGHT = "h-[94px]";
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
805
|
+
function ContactAvatar({
|
|
806
|
+
name,
|
|
807
|
+
size = "md",
|
|
808
|
+
className
|
|
809
|
+
}) {
|
|
810
|
+
const avatarSize = size === "sm" ? "sm" : size === "lg" ? "lg" : "default";
|
|
811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Avatar, { size: avatarSize, className, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AvatarFallback, { className: "font-semibold", children: getInitials(name) }) });
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// src/components/ui/ai-conversations/list.tsx
|
|
815
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
974
816
|
var STATUS_CONFIG = {
|
|
975
817
|
"ai-active": {
|
|
976
818
|
label: "AI Active",
|
|
@@ -999,22 +841,18 @@ function ConversationStatusChip({
|
|
|
999
841
|
className
|
|
1000
842
|
}) {
|
|
1001
843
|
const { label, variant, dotClass } = STATUS_CONFIG[status];
|
|
1002
|
-
return /* @__PURE__ */ (0,
|
|
1003
|
-
showDot && /* @__PURE__ */ (0,
|
|
844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Badge, { variant, className, children: [
|
|
845
|
+
showDot && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: cn("size-1.5 shrink-0 rounded-full", dotClass) }),
|
|
1004
846
|
label
|
|
1005
847
|
] });
|
|
1006
848
|
}
|
|
1007
|
-
function ContactAvatar({ name, size = "md", className }) {
|
|
1008
|
-
const avatarSize = size === "sm" ? "sm" : size === "lg" ? "lg" : "default";
|
|
1009
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Avatar, { size: avatarSize, className, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AvatarFallback, { className: "font-semibold", children: getInitials(name) }) });
|
|
1010
|
-
}
|
|
1011
849
|
function ConversationListItem({
|
|
1012
850
|
data,
|
|
1013
851
|
isActive,
|
|
1014
852
|
onClick,
|
|
1015
853
|
onRead
|
|
1016
854
|
}) {
|
|
1017
|
-
return /* @__PURE__ */ (0,
|
|
855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1018
856
|
"button",
|
|
1019
857
|
{
|
|
1020
858
|
type: "button",
|
|
@@ -1028,25 +866,25 @@ function ConversationListItem({
|
|
|
1028
866
|
isActive ? "bg-muted" : "hover:bg-muted/40"
|
|
1029
867
|
),
|
|
1030
868
|
children: [
|
|
1031
|
-
/* @__PURE__ */ (0,
|
|
1032
|
-
/* @__PURE__ */ (0,
|
|
1033
|
-
/* @__PURE__ */ (0,
|
|
1034
|
-
/* @__PURE__ */ (0,
|
|
1035
|
-
/* @__PURE__ */ (0,
|
|
1036
|
-
data.status === "needs-attention" && /* @__PURE__ */ (0,
|
|
1037
|
-
data.channel === "email" ? /* @__PURE__ */ (0,
|
|
1038
|
-
/* @__PURE__ */ (0,
|
|
869
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ContactAvatar, { name: data.contact.name }),
|
|
870
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
871
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mb-1 flex items-center justify-between gap-2", children: [
|
|
872
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(data.contact.name) }),
|
|
873
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
874
|
+
data.status === "needs-attention" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react3.Flag, { className: "size-3 text-warning-text" }),
|
|
875
|
+
data.channel === "email" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react3.Mail, { className: "size-3 text-muted-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react3.MessageSquare, { className: "size-3 text-muted-foreground" }),
|
|
876
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "whitespace-nowrap text-xs text-muted-foreground", children: data.timestamp })
|
|
1039
877
|
] })
|
|
1040
878
|
] }),
|
|
1041
|
-
/* @__PURE__ */ (0,
|
|
1042
|
-
/* @__PURE__ */ (0,
|
|
1043
|
-
/* @__PURE__ */ (0,
|
|
1044
|
-
data.assignedTo && /* @__PURE__ */ (0,
|
|
879
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mb-1.5 flex items-center justify-between gap-2", children: [
|
|
880
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
881
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ConversationStatusChip, { status: data.status, showDot: true }),
|
|
882
|
+
data.assignedTo && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "truncate text-xs text-muted-foreground", children: [
|
|
1045
883
|
"\u2192 ",
|
|
1046
884
|
data.assignedTo
|
|
1047
885
|
] })
|
|
1048
886
|
] }),
|
|
1049
|
-
data.unreadCount ? /* @__PURE__ */ (0,
|
|
887
|
+
data.unreadCount ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1050
888
|
Badge,
|
|
1051
889
|
{
|
|
1052
890
|
variant: "default",
|
|
@@ -1055,8 +893,8 @@ function ConversationListItem({
|
|
|
1055
893
|
}
|
|
1056
894
|
) : null
|
|
1057
895
|
] }),
|
|
1058
|
-
/* @__PURE__ */ (0,
|
|
1059
|
-
data.lastMessageRole === "bot" ? /* @__PURE__ */ (0,
|
|
896
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "line-clamp-2 text-sm leading-relaxed text-muted-foreground", children: [
|
|
897
|
+
data.lastMessageRole === "bot" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-medium text-foreground/60", children: "AI: " }) : data.lastMessageRole === "advisor" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "font-medium text-foreground/60", children: "You: " }) : data.lastMessageRole === "visitor" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "font-medium text-foreground/60", children: [
|
|
1060
898
|
displayContactName(data.contact.name).split(" ")[0],
|
|
1061
899
|
":",
|
|
1062
900
|
" "
|
|
@@ -1071,45 +909,36 @@ function ConversationListItem({
|
|
|
1071
909
|
function filterConversations(conversations, query, filter, channelFilter) {
|
|
1072
910
|
const q = query.toLowerCase();
|
|
1073
911
|
return conversations.filter((c) => {
|
|
1074
|
-
var _a;
|
|
1075
|
-
const matchesFilter = filter === "all" || (filter === "
|
|
1076
|
-
const matchesChannel = channelFilter === "all" || ((
|
|
912
|
+
var _a, _b;
|
|
913
|
+
const matchesFilter = filter === "all" || (filter === "emails" ? ((_a = c.channel) != null ? _a : "chat") === "email" : c.status === filter);
|
|
914
|
+
const matchesChannel = channelFilter === "all" || ((_b = c.channel) != null ? _b : "chat") === channelFilter;
|
|
1077
915
|
const matchesSearch = !q || c.contact.name.toLowerCase().includes(q) || c.lastMessage.toLowerCase().includes(q);
|
|
1078
916
|
return matchesFilter && matchesChannel && matchesSearch;
|
|
1079
917
|
});
|
|
1080
918
|
}
|
|
1081
919
|
var FILTER_TABS = [
|
|
1082
920
|
{ id: "all", label: "All" },
|
|
1083
|
-
{ id: "
|
|
1084
|
-
{ id: "ai-active", label: "AI Active" },
|
|
921
|
+
{ id: "emails", label: "Emails" },
|
|
1085
922
|
{ id: "needs-attention", label: "Urgent" },
|
|
1086
|
-
{ id: "closed", label: "Archived" }
|
|
923
|
+
{ id: "closed", label: "Archived" },
|
|
924
|
+
{ id: "ai-active", label: "AI Active" }
|
|
1087
925
|
];
|
|
1088
926
|
function ConversationList({
|
|
1089
927
|
conversations,
|
|
1090
928
|
activeId,
|
|
1091
929
|
searchQuery = "",
|
|
1092
930
|
activeFilter = "all",
|
|
1093
|
-
channelFilter
|
|
931
|
+
channelFilter = "all",
|
|
1094
932
|
hasMore,
|
|
1095
933
|
isLoadingMore,
|
|
1096
934
|
onSearchChange,
|
|
1097
935
|
onFilterChange,
|
|
1098
|
-
onChannelFilterChange,
|
|
1099
936
|
onSelect,
|
|
1100
937
|
onRead,
|
|
1101
938
|
onLoadMore,
|
|
1102
939
|
className
|
|
1103
940
|
}) {
|
|
1104
|
-
|
|
1105
|
-
function handleChannelFilterChange(vals) {
|
|
1106
|
-
const v = vals[0];
|
|
1107
|
-
if (v) {
|
|
1108
|
-
setChannelFilter(v);
|
|
1109
|
-
onChannelFilterChange == null ? void 0 : onChannelFilterChange(v);
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1113
942
|
"div",
|
|
1114
943
|
{
|
|
1115
944
|
className: cn(
|
|
@@ -1117,50 +946,31 @@ function ConversationList({
|
|
|
1117
946
|
className
|
|
1118
947
|
),
|
|
1119
948
|
children: [
|
|
1120
|
-
/* @__PURE__ */ (0,
|
|
1121
|
-
/* @__PURE__ */ (0,
|
|
1122
|
-
/* @__PURE__ */ (0,
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
Input,
|
|
1126
|
-
{
|
|
1127
|
-
value: searchQuery,
|
|
1128
|
-
onChange: (e) => onSearchChange == null ? void 0 : onSearchChange(e.target.value),
|
|
1129
|
-
placeholder: "Search conversations...",
|
|
1130
|
-
className: "h-8 pl-8 text-sm"
|
|
1131
|
-
}
|
|
1132
|
-
)
|
|
1133
|
-
] }),
|
|
1134
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1135
|
-
ToggleGroup,
|
|
949
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn(PANEL_HEADER_HEIGHT, "flex shrink-0 flex-col"), children: [
|
|
950
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex shrink-0 items-center border-b border-border px-3 py-2.5", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative flex-1", children: [
|
|
951
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react3.Search, { className: "absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
952
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
953
|
+
Input,
|
|
1136
954
|
{
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
value: [channelFilter],
|
|
1142
|
-
onValueChange: handleChannelFilterChange,
|
|
1143
|
-
className: "shrink-0",
|
|
1144
|
-
children: [
|
|
1145
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ToggleGroupItem, { value: "all", "aria-label": "All channels", children: "All" }),
|
|
1146
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ToggleGroupItem, { value: "chat", "aria-label": "Chat", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react4.MessageSquare, { className: "size-3.5" }) }),
|
|
1147
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ToggleGroupItem, { value: "email", "aria-label": "Email", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react4.Mail, { className: "size-3.5" }) })
|
|
1148
|
-
]
|
|
955
|
+
value: searchQuery,
|
|
956
|
+
onChange: (e) => onSearchChange == null ? void 0 : onSearchChange(e.target.value),
|
|
957
|
+
placeholder: "Search conversations...",
|
|
958
|
+
className: "h-8 pl-8 text-sm"
|
|
1149
959
|
}
|
|
1150
960
|
)
|
|
1151
|
-
] }),
|
|
1152
|
-
/* @__PURE__ */ (0,
|
|
961
|
+
] }) }),
|
|
962
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex flex-1 items-center border-b border-border", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1153
963
|
Tabs,
|
|
1154
964
|
{
|
|
1155
965
|
value: activeFilter,
|
|
1156
966
|
onValueChange: (v) => v && (onFilterChange == null ? void 0 : onFilterChange(v)),
|
|
1157
967
|
className: "w-full",
|
|
1158
|
-
children: /* @__PURE__ */ (0,
|
|
968
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1159
969
|
TabsList,
|
|
1160
970
|
{
|
|
1161
971
|
variant: "line",
|
|
1162
972
|
className: "w-full justify-start gap-0 h-auto",
|
|
1163
|
-
children: FILTER_TABS.map((tab) => /* @__PURE__ */ (0,
|
|
973
|
+
children: FILTER_TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1164
974
|
TabsTrigger,
|
|
1165
975
|
{
|
|
1166
976
|
value: tab.id,
|
|
@@ -1174,17 +984,17 @@ function ConversationList({
|
|
|
1174
984
|
}
|
|
1175
985
|
) })
|
|
1176
986
|
] }),
|
|
1177
|
-
/* @__PURE__ */ (0,
|
|
987
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: (() => {
|
|
1178
988
|
const filtered = filterConversations(
|
|
1179
989
|
conversations,
|
|
1180
990
|
searchQuery,
|
|
1181
991
|
activeFilter,
|
|
1182
992
|
channelFilter
|
|
1183
993
|
);
|
|
1184
|
-
return filtered.length === 0 ? /* @__PURE__ */ (0,
|
|
1185
|
-
/* @__PURE__ */ (0,
|
|
1186
|
-
/* @__PURE__ */ (0,
|
|
1187
|
-
searchQuery && /* @__PURE__ */ (0,
|
|
994
|
+
return filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col items-center justify-center gap-2 p-8 text-muted-foreground", children: [
|
|
995
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react3.MessageSquare, { className: "size-8 opacity-30" }),
|
|
996
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-sm", children: "No conversations" }),
|
|
997
|
+
searchQuery && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1188
998
|
Button,
|
|
1189
999
|
{
|
|
1190
1000
|
variant: "outline",
|
|
@@ -1193,7 +1003,7 @@ function ConversationList({
|
|
|
1193
1003
|
children: "Clear search"
|
|
1194
1004
|
}
|
|
1195
1005
|
),
|
|
1196
|
-
!searchQuery && activeFilter !== "all" && /* @__PURE__ */ (0,
|
|
1006
|
+
!searchQuery && activeFilter !== "all" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1197
1007
|
Button,
|
|
1198
1008
|
{
|
|
1199
1009
|
variant: "outline",
|
|
@@ -1202,8 +1012,8 @@ function ConversationList({
|
|
|
1202
1012
|
children: "Clear filter"
|
|
1203
1013
|
}
|
|
1204
1014
|
)
|
|
1205
|
-
] }) : /* @__PURE__ */ (0,
|
|
1206
|
-
filtered.map((item) => /* @__PURE__ */ (0,
|
|
1015
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1016
|
+
filtered.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1207
1017
|
ConversationListItem,
|
|
1208
1018
|
{
|
|
1209
1019
|
data: item,
|
|
@@ -1213,7 +1023,7 @@ function ConversationList({
|
|
|
1213
1023
|
},
|
|
1214
1024
|
item.id
|
|
1215
1025
|
)),
|
|
1216
|
-
hasMore && /* @__PURE__ */ (0,
|
|
1026
|
+
hasMore && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "border-t border-border p-3", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1217
1027
|
Button,
|
|
1218
1028
|
{
|
|
1219
1029
|
variant: "outline",
|
|
@@ -1230,32 +1040,206 @@ function ConversationList({
|
|
|
1230
1040
|
}
|
|
1231
1041
|
);
|
|
1232
1042
|
}
|
|
1043
|
+
|
|
1044
|
+
// src/components/ui/ai-conversations/thread.tsx
|
|
1045
|
+
var import_react3 = __toESM(require("react"));
|
|
1046
|
+
var import_react4 = require("@tiptap/react");
|
|
1047
|
+
var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
|
|
1048
|
+
var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
|
|
1049
|
+
var import_extension_link = __toESM(require("@tiptap/extension-link"));
|
|
1050
|
+
var import_react_markdown = __toESM(require("react-markdown"));
|
|
1051
|
+
var import_rehype_raw = __toESM(require("rehype-raw"));
|
|
1052
|
+
var import_rehype_sanitize = __toESM(require("rehype-sanitize"));
|
|
1053
|
+
var import_lucide_react5 = require("lucide-react");
|
|
1054
|
+
|
|
1055
|
+
// src/components/ui/dropdown-menu.tsx
|
|
1056
|
+
var import_lucide_react4 = require("lucide-react");
|
|
1057
|
+
var import_menu = require("@base-ui/react/menu");
|
|
1058
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1059
|
+
function DropdownMenu(_a) {
|
|
1060
|
+
var props = __objRest(_a, []);
|
|
1061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_menu.Menu.Root, __spreadValues({ "data-slot": "dropdown-menu" }, props));
|
|
1062
|
+
}
|
|
1063
|
+
function DropdownMenuTrigger(_a) {
|
|
1064
|
+
var props = __objRest(_a, []);
|
|
1065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_menu.Menu.Trigger, __spreadValues({ "data-slot": "dropdown-menu-trigger" }, props));
|
|
1066
|
+
}
|
|
1067
|
+
function DropdownMenuContent(_a) {
|
|
1068
|
+
var _b = _a, {
|
|
1069
|
+
className,
|
|
1070
|
+
sideOffset = 4,
|
|
1071
|
+
style
|
|
1072
|
+
} = _b, props = __objRest(_b, [
|
|
1073
|
+
"className",
|
|
1074
|
+
"sideOffset",
|
|
1075
|
+
"style"
|
|
1076
|
+
]);
|
|
1077
|
+
const themeVars = useThemeVars();
|
|
1078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_menu.Menu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_menu.Menu.Positioner, { sideOffset, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1079
|
+
import_menu.Menu.Popup,
|
|
1080
|
+
__spreadValues({
|
|
1081
|
+
className: cn(
|
|
1082
|
+
"z-50 min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-none border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
1083
|
+
className
|
|
1084
|
+
),
|
|
1085
|
+
"data-slot": "dropdown-menu-content",
|
|
1086
|
+
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
1087
|
+
}, props)
|
|
1088
|
+
) }) });
|
|
1089
|
+
}
|
|
1090
|
+
function DropdownMenuItem(_a) {
|
|
1091
|
+
var _b = _a, {
|
|
1092
|
+
className,
|
|
1093
|
+
inset,
|
|
1094
|
+
variant = "default"
|
|
1095
|
+
} = _b, props = __objRest(_b, [
|
|
1096
|
+
"className",
|
|
1097
|
+
"inset",
|
|
1098
|
+
"variant"
|
|
1099
|
+
]);
|
|
1100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1101
|
+
import_menu.Menu.Item,
|
|
1102
|
+
__spreadValues({
|
|
1103
|
+
className: cn(
|
|
1104
|
+
"relative flex cursor-default items-center gap-2 rounded-none px-2 py-1.5 text-body-small outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",
|
|
1105
|
+
className
|
|
1106
|
+
),
|
|
1107
|
+
"data-inset": inset,
|
|
1108
|
+
"data-slot": "dropdown-menu-item",
|
|
1109
|
+
"data-variant": variant
|
|
1110
|
+
}, props)
|
|
1111
|
+
);
|
|
1112
|
+
}
|
|
1113
|
+
function DropdownMenuSeparator(_a) {
|
|
1114
|
+
var _b = _a, {
|
|
1115
|
+
className
|
|
1116
|
+
} = _b, props = __objRest(_b, [
|
|
1117
|
+
"className"
|
|
1118
|
+
]);
|
|
1119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1120
|
+
import_menu.Menu.Separator,
|
|
1121
|
+
__spreadValues({
|
|
1122
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
1123
|
+
"data-slot": "dropdown-menu-separator"
|
|
1124
|
+
}, props)
|
|
1125
|
+
);
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
// src/components/ui/popover.tsx
|
|
1129
|
+
var import_popover = require("@base-ui/react/popover");
|
|
1130
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1131
|
+
function Popover(_a) {
|
|
1132
|
+
var props = __objRest(_a, []);
|
|
1133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_popover.Popover.Root, __spreadValues({ "data-slot": "popover" }, props));
|
|
1134
|
+
}
|
|
1135
|
+
function PopoverTrigger(_a) {
|
|
1136
|
+
var props = __objRest(_a, []);
|
|
1137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_popover.Popover.Trigger, __spreadValues({ "data-slot": "popover-trigger" }, props));
|
|
1138
|
+
}
|
|
1139
|
+
function PopoverContent(_a) {
|
|
1140
|
+
var _b = _a, {
|
|
1141
|
+
className,
|
|
1142
|
+
align = "center",
|
|
1143
|
+
sideOffset = 4,
|
|
1144
|
+
style
|
|
1145
|
+
} = _b, props = __objRest(_b, [
|
|
1146
|
+
"className",
|
|
1147
|
+
"align",
|
|
1148
|
+
"sideOffset",
|
|
1149
|
+
"style"
|
|
1150
|
+
]);
|
|
1151
|
+
const themeVars = useThemeVars();
|
|
1152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_popover.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1153
|
+
import_popover.Popover.Positioner,
|
|
1154
|
+
{
|
|
1155
|
+
className: "z-[200]",
|
|
1156
|
+
align,
|
|
1157
|
+
sideOffset,
|
|
1158
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1159
|
+
import_popover.Popover.Popup,
|
|
1160
|
+
__spreadValues({
|
|
1161
|
+
className: cn(
|
|
1162
|
+
"z-50 w-72 border border-border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
1163
|
+
className
|
|
1164
|
+
),
|
|
1165
|
+
"data-slot": "popover-content",
|
|
1166
|
+
style: __spreadValues(__spreadValues({}, themeVars), style)
|
|
1167
|
+
}, props)
|
|
1168
|
+
)
|
|
1169
|
+
}
|
|
1170
|
+
) });
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
// src/components/ui/separator.tsx
|
|
1174
|
+
var import_separator = require("@base-ui/react/separator");
|
|
1175
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1176
|
+
function Separator(_a) {
|
|
1177
|
+
var _b = _a, {
|
|
1178
|
+
className,
|
|
1179
|
+
orientation = "horizontal"
|
|
1180
|
+
} = _b, props = __objRest(_b, [
|
|
1181
|
+
"className",
|
|
1182
|
+
"orientation"
|
|
1183
|
+
]);
|
|
1184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1185
|
+
import_separator.Separator,
|
|
1186
|
+
__spreadValues({
|
|
1187
|
+
className: cn(
|
|
1188
|
+
"shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
1189
|
+
className
|
|
1190
|
+
),
|
|
1191
|
+
"data-orientation": orientation,
|
|
1192
|
+
"data-slot": "separator"
|
|
1193
|
+
}, props)
|
|
1194
|
+
);
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
// src/components/ui/textarea.tsx
|
|
1198
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1199
|
+
function Textarea(_a) {
|
|
1200
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1202
|
+
"textarea",
|
|
1203
|
+
__spreadValues({
|
|
1204
|
+
className: cn(
|
|
1205
|
+
// WealthX: removed shadow-xs (flat panels), added font-sans
|
|
1206
|
+
"flex field-sizing-content min-h-16 w-full border border-input bg-transparent px-3 py-2 text-body-medium font-sans transition-[color,box-shadow] outline-none placeholder:font-normal placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
1207
|
+
className
|
|
1208
|
+
),
|
|
1209
|
+
"data-slot": "textarea"
|
|
1210
|
+
}, props)
|
|
1211
|
+
);
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
// src/components/ui/ai-conversations/thread.tsx
|
|
1215
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1233
1216
|
function BubbleAvatar({
|
|
1234
1217
|
role,
|
|
1235
1218
|
senderName
|
|
1236
1219
|
}) {
|
|
1237
1220
|
if (role === "bot") {
|
|
1238
|
-
return /* @__PURE__ */ (0,
|
|
1221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AvatarFallback, { className: "border border-border bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "size-3.5 text-muted-foreground" }) }) });
|
|
1239
1222
|
}
|
|
1240
1223
|
if (role === "advisor") {
|
|
1241
|
-
return /* @__PURE__ */ (0,
|
|
1224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AvatarFallback, { className: "font-semibold", children: getInitials(senderName != null ? senderName : "Advisor") }) });
|
|
1242
1225
|
}
|
|
1243
|
-
return /* @__PURE__ */ (0,
|
|
1226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AvatarFallback, { children: getInitials(senderName != null ? senderName : "?") }) });
|
|
1244
1227
|
}
|
|
1245
|
-
function ChatBubble({ message, className }) {
|
|
1246
|
-
const { role, content, timestamp, senderName } = message;
|
|
1228
|
+
function ChatBubble({ message, channel, className }) {
|
|
1229
|
+
const { role, content, timestamp, senderName, subject } = message;
|
|
1230
|
+
const isEmail = channel === "email";
|
|
1247
1231
|
if (role === "system") {
|
|
1248
|
-
return /* @__PURE__ */ (0,
|
|
1249
|
-
/* @__PURE__ */ (0,
|
|
1250
|
-
/* @__PURE__ */ (0,
|
|
1251
|
-
/* @__PURE__ */ (0,
|
|
1232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("my-2 flex items-center gap-3 px-2", className), children: [
|
|
1233
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { className: "flex-1" }),
|
|
1234
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "shrink-0 text-caption text-muted-foreground", children: content }),
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { className: "flex-1" })
|
|
1252
1236
|
] });
|
|
1253
1237
|
}
|
|
1254
1238
|
const isAdvisor = role === "advisor";
|
|
1255
1239
|
const isBot = role === "bot";
|
|
1256
1240
|
const isVisitor = role === "visitor";
|
|
1257
1241
|
const displayName = isBot ? "AI Assistant" : isAdvisor ? senderName != null ? senderName : "Advisor" : senderName != null ? senderName : "Lead";
|
|
1258
|
-
return /* @__PURE__ */ (0,
|
|
1242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1259
1243
|
"div",
|
|
1260
1244
|
{
|
|
1261
1245
|
className: cn(
|
|
@@ -1264,29 +1248,59 @@ function ChatBubble({ message, className }) {
|
|
|
1264
1248
|
className
|
|
1265
1249
|
),
|
|
1266
1250
|
children: [
|
|
1267
|
-
/* @__PURE__ */ (0,
|
|
1268
|
-
/* @__PURE__ */ (0,
|
|
1251
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BubbleAvatar, { role, senderName }),
|
|
1252
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1269
1253
|
"div",
|
|
1270
1254
|
{
|
|
1271
1255
|
className: cn(
|
|
1272
|
-
"flex
|
|
1256
|
+
"flex flex-col gap-1",
|
|
1257
|
+
isEmail ? "max-w-[85%] w-full" : "max-w-[70%]",
|
|
1273
1258
|
isAdvisor && "items-end"
|
|
1274
1259
|
),
|
|
1275
1260
|
children: [
|
|
1276
|
-
/* @__PURE__ */ (0,
|
|
1277
|
-
/* @__PURE__ */ (0,
|
|
1261
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-caption text-muted-foreground", children: displayName }),
|
|
1262
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1278
1263
|
"div",
|
|
1279
1264
|
{
|
|
1280
1265
|
className: cn(
|
|
1281
|
-
"
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1266
|
+
"text-sm leading-relaxed break-words",
|
|
1267
|
+
!isEmail && "px-3 py-2 [&_p]:m-0 [&_a]:underline",
|
|
1268
|
+
isEmail && [
|
|
1269
|
+
"border border-border bg-background px-4 py-3 w-full",
|
|
1270
|
+
"[&_p]:mb-2 [&_p:last-child]:mb-0",
|
|
1271
|
+
"[&_ul]:mb-2 [&_ul]:list-disc [&_ul]:pl-4",
|
|
1272
|
+
"[&_ol]:mb-2 [&_ol]:list-decimal [&_ol]:pl-4",
|
|
1273
|
+
"[&_li]:mb-0.5",
|
|
1274
|
+
"[&_h1]:mb-2 [&_h1]:text-sm [&_h1]:font-bold",
|
|
1275
|
+
"[&_h2]:mb-1.5 [&_h2]:text-sm [&_h2]:font-semibold",
|
|
1276
|
+
"[&_h3]:mb-1 [&_h3]:text-sm [&_h3]:font-medium",
|
|
1277
|
+
"[&_strong]:font-semibold [&_em]:italic",
|
|
1278
|
+
"[&_a]:underline [&_a]:text-primary",
|
|
1279
|
+
"[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground [&_blockquote]:italic",
|
|
1280
|
+
"[&_hr]:my-3 [&_hr]:border-border"
|
|
1281
|
+
],
|
|
1282
|
+
!isEmail && isBot && "border border-border bg-muted/60 text-foreground [&_a]:text-primary",
|
|
1283
|
+
!isEmail && isVisitor && "border border-border bg-background text-foreground [&_a]:text-primary",
|
|
1284
|
+
!isEmail && isAdvisor && "bg-primary text-primary-foreground [&_a]:text-primary-foreground",
|
|
1285
|
+
isEmail && isAdvisor && "bg-muted/30"
|
|
1285
1286
|
),
|
|
1286
|
-
children:
|
|
1287
|
+
children: [
|
|
1288
|
+
isEmail && subject && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "mb-2.5 border-b border-border pb-2", children: [
|
|
1289
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs font-medium text-muted-foreground", children: "Subject:" }),
|
|
1290
|
+
" ",
|
|
1291
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-semibold text-foreground", children: subject })
|
|
1292
|
+
] }),
|
|
1293
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1294
|
+
import_react_markdown.default,
|
|
1295
|
+
{
|
|
1296
|
+
rehypePlugins: [import_rehype_raw.default, [import_rehype_sanitize.default, import_rehype_sanitize.defaultSchema]],
|
|
1297
|
+
children: content
|
|
1298
|
+
}
|
|
1299
|
+
)
|
|
1300
|
+
]
|
|
1287
1301
|
}
|
|
1288
1302
|
),
|
|
1289
|
-
timestamp && /* @__PURE__ */ (0,
|
|
1303
|
+
timestamp && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-caption text-muted-foreground", children: timestamp })
|
|
1290
1304
|
]
|
|
1291
1305
|
}
|
|
1292
1306
|
)
|
|
@@ -1300,7 +1314,7 @@ function ComposerToolbarButton({
|
|
|
1300
1314
|
pressed,
|
|
1301
1315
|
onToggle
|
|
1302
1316
|
}) {
|
|
1303
|
-
return /* @__PURE__ */ (0,
|
|
1317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1304
1318
|
"button",
|
|
1305
1319
|
{
|
|
1306
1320
|
type: "button",
|
|
@@ -1311,11 +1325,13 @@ function ComposerToolbarButton({
|
|
|
1311
1325
|
"flex size-7 items-center justify-center transition-colors",
|
|
1312
1326
|
pressed ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
1313
1327
|
),
|
|
1314
|
-
children: /* @__PURE__ */ (0,
|
|
1328
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { className: "size-3.5" })
|
|
1315
1329
|
}
|
|
1316
1330
|
);
|
|
1317
1331
|
}
|
|
1318
|
-
function ComposerLinkPopover({
|
|
1332
|
+
function ComposerLinkPopover({
|
|
1333
|
+
editor
|
|
1334
|
+
}) {
|
|
1319
1335
|
const [open, setOpen] = import_react3.default.useState(false);
|
|
1320
1336
|
const [url, setUrl] = import_react3.default.useState("");
|
|
1321
1337
|
const handleApply = () => {
|
|
@@ -1325,7 +1341,7 @@ function ComposerLinkPopover({ editor }) {
|
|
|
1325
1341
|
setOpen(false);
|
|
1326
1342
|
setUrl("");
|
|
1327
1343
|
};
|
|
1328
|
-
return /* @__PURE__ */ (0,
|
|
1344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1329
1345
|
Popover,
|
|
1330
1346
|
{
|
|
1331
1347
|
open,
|
|
@@ -1338,7 +1354,7 @@ function ComposerLinkPopover({ editor }) {
|
|
|
1338
1354
|
setOpen(newOpen);
|
|
1339
1355
|
},
|
|
1340
1356
|
children: [
|
|
1341
|
-
/* @__PURE__ */ (0,
|
|
1357
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1342
1358
|
PopoverTrigger,
|
|
1343
1359
|
{
|
|
1344
1360
|
"aria-label": "Insert link",
|
|
@@ -1346,11 +1362,11 @@ function ComposerLinkPopover({ editor }) {
|
|
|
1346
1362
|
"flex size-7 items-center justify-center transition-colors",
|
|
1347
1363
|
(editor == null ? void 0 : editor.isActive("link")) ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
1348
1364
|
),
|
|
1349
|
-
children: /* @__PURE__ */ (0,
|
|
1365
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Link2, { className: "size-3.5" })
|
|
1350
1366
|
}
|
|
1351
1367
|
),
|
|
1352
|
-
/* @__PURE__ */ (0,
|
|
1353
|
-
/* @__PURE__ */ (0,
|
|
1368
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverContent, { className: "w-72 p-2", align: "start", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
1369
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1354
1370
|
"input",
|
|
1355
1371
|
{
|
|
1356
1372
|
type: "url",
|
|
@@ -1362,7 +1378,7 @@ function ComposerLinkPopover({ editor }) {
|
|
|
1362
1378
|
autoFocus: true
|
|
1363
1379
|
}
|
|
1364
1380
|
),
|
|
1365
|
-
/* @__PURE__ */ (0,
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { size: "sm", className: "h-8 px-3", onClick: handleApply, children: "Apply" })
|
|
1366
1382
|
] }) })
|
|
1367
1383
|
]
|
|
1368
1384
|
}
|
|
@@ -1372,8 +1388,8 @@ function ComposerEmailFieldRow({
|
|
|
1372
1388
|
label,
|
|
1373
1389
|
children
|
|
1374
1390
|
}) {
|
|
1375
|
-
return /* @__PURE__ */ (0,
|
|
1376
|
-
/* @__PURE__ */ (0,
|
|
1391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-3 border-b border-border px-4 py-2.5", children: [
|
|
1392
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w-14 shrink-0 text-sm text-muted-foreground", children: label }),
|
|
1377
1393
|
children
|
|
1378
1394
|
] });
|
|
1379
1395
|
}
|
|
@@ -1381,7 +1397,6 @@ function ChatComposer({
|
|
|
1381
1397
|
mode,
|
|
1382
1398
|
channel: channelProp = "chat",
|
|
1383
1399
|
onChannelChange,
|
|
1384
|
-
channelType = "chat",
|
|
1385
1400
|
isEmailIntegrated = false,
|
|
1386
1401
|
contactEmail = "",
|
|
1387
1402
|
inputValue = "",
|
|
@@ -1390,17 +1405,21 @@ function ChatComposer({
|
|
|
1390
1405
|
onSendEmail,
|
|
1391
1406
|
onTakeOver,
|
|
1392
1407
|
onLetAiHandle,
|
|
1408
|
+
emailReplySubject,
|
|
1393
1409
|
className
|
|
1394
1410
|
}) {
|
|
1395
|
-
const showIntegrateEmailPrompt = channelType === "email" && !isEmailIntegrated;
|
|
1396
|
-
const initialChannel = channelType === "email" && isEmailIntegrated ? "email" : channelProp;
|
|
1397
1411
|
const [channel, setChannel] = import_react3.default.useState(
|
|
1398
|
-
isEmailIntegrated ?
|
|
1412
|
+
isEmailIntegrated ? channelProp : "chat"
|
|
1399
1413
|
);
|
|
1400
1414
|
const [emailTo, setEmailTo] = import_react3.default.useState(contactEmail);
|
|
1401
1415
|
const [emailCc, setEmailCc] = import_react3.default.useState("");
|
|
1402
1416
|
const [showCc, setShowCc] = import_react3.default.useState(false);
|
|
1403
|
-
const [emailSubject, setEmailSubject] = import_react3.default.useState(
|
|
1417
|
+
const [emailSubject, setEmailSubject] = import_react3.default.useState(
|
|
1418
|
+
emailReplySubject ? `Re: ${emailReplySubject}` : ""
|
|
1419
|
+
);
|
|
1420
|
+
const [emailMode, setEmailMode] = import_react3.default.useState(
|
|
1421
|
+
emailReplySubject ? "reply" : "new"
|
|
1422
|
+
);
|
|
1404
1423
|
const [, forceUpdate] = import_react3.default.useReducer((x) => x + 1, 0);
|
|
1405
1424
|
const editor = (0, import_react4.useEditor)({
|
|
1406
1425
|
extensions: [
|
|
@@ -1420,23 +1439,21 @@ function ChatComposer({
|
|
|
1420
1439
|
setChannel(c);
|
|
1421
1440
|
onChannelChange == null ? void 0 : onChannelChange(c);
|
|
1422
1441
|
};
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
}
|
|
1439
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1442
|
+
const handleNewEmail = () => {
|
|
1443
|
+
setEmailSubject("");
|
|
1444
|
+
setEmailCc("");
|
|
1445
|
+
setShowCc(false);
|
|
1446
|
+
editor == null ? void 0 : editor.commands.clearContent();
|
|
1447
|
+
};
|
|
1448
|
+
const handleEmailModeChange = (mode2) => {
|
|
1449
|
+
setEmailMode(mode2);
|
|
1450
|
+
if (mode2 === "new") {
|
|
1451
|
+
handleNewEmail();
|
|
1452
|
+
} else {
|
|
1453
|
+
setEmailSubject(emailReplySubject ? `Re: ${emailReplySubject}` : "");
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1440
1457
|
"div",
|
|
1441
1458
|
{
|
|
1442
1459
|
className: cn(
|
|
@@ -1444,27 +1461,27 @@ function ChatComposer({
|
|
|
1444
1461
|
className
|
|
1445
1462
|
),
|
|
1446
1463
|
children: [
|
|
1447
|
-
isEmailIntegrated && /* @__PURE__ */ (0,
|
|
1464
|
+
isEmailIntegrated && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "border-b border-border px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1448
1465
|
Tabs,
|
|
1449
1466
|
{
|
|
1450
1467
|
value: channel,
|
|
1451
1468
|
onValueChange: (v) => v && handleChannelChange(v),
|
|
1452
|
-
children: /* @__PURE__ */ (0,
|
|
1453
|
-
/* @__PURE__ */ (0,
|
|
1454
|
-
/* @__PURE__ */ (0,
|
|
1469
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TabsList, { variant: "default", className: "w-full", children: [
|
|
1470
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TabsTrigger, { value: "chat", className: "flex-1 gap-1.5", children: [
|
|
1471
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.MessageSquare, { className: "size-3.5" }),
|
|
1455
1472
|
"Chat"
|
|
1456
1473
|
] }),
|
|
1457
|
-
/* @__PURE__ */ (0,
|
|
1458
|
-
/* @__PURE__ */ (0,
|
|
1474
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TabsTrigger, { value: "email", className: "flex-1 gap-1.5", children: [
|
|
1475
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Mail, { className: "size-3.5" }),
|
|
1459
1476
|
"Email"
|
|
1460
1477
|
] })
|
|
1461
1478
|
] })
|
|
1462
1479
|
}
|
|
1463
1480
|
) }),
|
|
1464
|
-
mode === "ai" ? /* @__PURE__ */ (0,
|
|
1465
|
-
/* @__PURE__ */ (0,
|
|
1466
|
-
/* @__PURE__ */ (0,
|
|
1467
|
-
/* @__PURE__ */ (0,
|
|
1481
|
+
mode === "ai" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2 bg-muted/30 px-4 py-2.5 text-[12px] text-muted-foreground", children: [
|
|
1482
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
1483
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "AI is handling this conversation." }),
|
|
1484
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1468
1485
|
Button,
|
|
1469
1486
|
{
|
|
1470
1487
|
variant: "link",
|
|
@@ -1474,12 +1491,12 @@ function ChatComposer({
|
|
|
1474
1491
|
children: "Take Over"
|
|
1475
1492
|
}
|
|
1476
1493
|
),
|
|
1477
|
-
/* @__PURE__ */ (0,
|
|
1494
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "to reply directly." })
|
|
1478
1495
|
] }) : (
|
|
1479
1496
|
/* Email panel stays in normal flow to anchor container height;
|
|
1480
1497
|
chat panel is an absolute overlay so both tabs share identical dimensions */
|
|
1481
|
-
/* @__PURE__ */ (0,
|
|
1482
|
-
/* @__PURE__ */ (0,
|
|
1498
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative", children: [
|
|
1499
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1483
1500
|
"div",
|
|
1484
1501
|
{
|
|
1485
1502
|
className: cn(
|
|
@@ -1488,8 +1505,8 @@ function ChatComposer({
|
|
|
1488
1505
|
),
|
|
1489
1506
|
"aria-hidden": channel !== "email",
|
|
1490
1507
|
children: [
|
|
1491
|
-
/* @__PURE__ */ (0,
|
|
1492
|
-
/* @__PURE__ */ (0,
|
|
1508
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(ComposerEmailFieldRow, { label: "To", children: [
|
|
1509
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1493
1510
|
"input",
|
|
1494
1511
|
{
|
|
1495
1512
|
type: "email",
|
|
@@ -1499,7 +1516,7 @@ function ChatComposer({
|
|
|
1499
1516
|
className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
|
|
1500
1517
|
}
|
|
1501
1518
|
),
|
|
1502
|
-
/* @__PURE__ */ (0,
|
|
1519
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1503
1520
|
"button",
|
|
1504
1521
|
{
|
|
1505
1522
|
type: "button",
|
|
@@ -1507,12 +1524,12 @@ function ChatComposer({
|
|
|
1507
1524
|
className: "flex shrink-0 items-center gap-0.5 text-sm text-muted-foreground hover:text-foreground",
|
|
1508
1525
|
children: [
|
|
1509
1526
|
"CC",
|
|
1510
|
-
/* @__PURE__ */ (0,
|
|
1527
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ChevronDown, { className: "size-3.5" })
|
|
1511
1528
|
]
|
|
1512
1529
|
}
|
|
1513
1530
|
)
|
|
1514
1531
|
] }),
|
|
1515
|
-
showCc && /* @__PURE__ */ (0,
|
|
1532
|
+
showCc && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerEmailFieldRow, { label: "CC", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1516
1533
|
"input",
|
|
1517
1534
|
{
|
|
1518
1535
|
type: "email",
|
|
@@ -1522,7 +1539,7 @@ function ChatComposer({
|
|
|
1522
1539
|
className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
|
|
1523
1540
|
}
|
|
1524
1541
|
) }),
|
|
1525
|
-
/* @__PURE__ */ (0,
|
|
1542
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerEmailFieldRow, { label: "Subject", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1526
1543
|
"input",
|
|
1527
1544
|
{
|
|
1528
1545
|
type: "text",
|
|
@@ -1532,68 +1549,96 @@ function ChatComposer({
|
|
|
1532
1549
|
className: "min-w-0 flex-1 bg-transparent text-base text-foreground outline-none placeholder:text-muted-foreground"
|
|
1533
1550
|
}
|
|
1534
1551
|
) }),
|
|
1535
|
-
/* @__PURE__ */ (0,
|
|
1536
|
-
/* @__PURE__ */ (0,
|
|
1537
|
-
/* @__PURE__ */ (0,
|
|
1538
|
-
/* @__PURE__ */ (0,
|
|
1552
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react4.EditorContent, { editor }),
|
|
1553
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
|
|
1554
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-0.5", children: [
|
|
1555
|
+
emailReplySubject && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1556
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1557
|
+
ToggleGroup,
|
|
1558
|
+
{
|
|
1559
|
+
type: "single",
|
|
1560
|
+
variant: "outline",
|
|
1561
|
+
size: "sm",
|
|
1562
|
+
spacing: 0,
|
|
1563
|
+
value: [emailMode],
|
|
1564
|
+
onValueChange: (values) => {
|
|
1565
|
+
const v = values[0];
|
|
1566
|
+
if (v) handleEmailModeChange(v);
|
|
1567
|
+
},
|
|
1568
|
+
className: "mr-1.5",
|
|
1569
|
+
children: [
|
|
1570
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ToggleGroupItem, { value: "reply", children: "Reply" }),
|
|
1571
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ToggleGroupItem, { value: "new", children: "New email" })
|
|
1572
|
+
]
|
|
1573
|
+
}
|
|
1574
|
+
),
|
|
1575
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { orientation: "vertical", className: "mr-1.5 h-4" })
|
|
1576
|
+
] }),
|
|
1577
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1539
1578
|
ComposerToolbarButton,
|
|
1540
1579
|
{
|
|
1541
1580
|
label: "Bold",
|
|
1542
|
-
icon:
|
|
1581
|
+
icon: import_lucide_react5.Bold,
|
|
1543
1582
|
pressed: editor == null ? void 0 : editor.isActive("bold"),
|
|
1544
1583
|
onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run()
|
|
1545
1584
|
}
|
|
1546
1585
|
),
|
|
1547
|
-
/* @__PURE__ */ (0,
|
|
1586
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1548
1587
|
ComposerToolbarButton,
|
|
1549
1588
|
{
|
|
1550
1589
|
label: "Italic",
|
|
1551
|
-
icon:
|
|
1590
|
+
icon: import_lucide_react5.Italic,
|
|
1552
1591
|
pressed: editor == null ? void 0 : editor.isActive("italic"),
|
|
1553
1592
|
onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run()
|
|
1554
1593
|
}
|
|
1555
1594
|
),
|
|
1556
|
-
/* @__PURE__ */ (0,
|
|
1595
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1557
1596
|
ComposerToolbarButton,
|
|
1558
1597
|
{
|
|
1559
1598
|
label: "Underline",
|
|
1560
|
-
icon:
|
|
1599
|
+
icon: import_lucide_react5.Underline,
|
|
1561
1600
|
pressed: editor == null ? void 0 : editor.isActive("underline"),
|
|
1562
1601
|
onToggle: () => editor == null ? void 0 : editor.chain().focus().toggleUnderline().run()
|
|
1563
1602
|
}
|
|
1564
1603
|
),
|
|
1565
|
-
/* @__PURE__ */ (0,
|
|
1566
|
-
/* @__PURE__ */ (0,
|
|
1567
|
-
/* @__PURE__ */ (0,
|
|
1604
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, { orientation: "vertical", className: "mx-1.5 h-4" }),
|
|
1605
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerLinkPopover, { editor }),
|
|
1606
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ComposerToolbarButton, { label: "Attach file", icon: import_lucide_react5.Paperclip })
|
|
1568
1607
|
] }),
|
|
1569
|
-
/* @__PURE__ */ (0,
|
|
1570
|
-
Button,
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1608
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1609
|
+
onLetAiHandle && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
|
|
1610
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "mr-1.5 size-3.5" }),
|
|
1611
|
+
"Let AI Handle"
|
|
1612
|
+
] }),
|
|
1613
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1614
|
+
Button,
|
|
1615
|
+
{
|
|
1616
|
+
size: "sm",
|
|
1617
|
+
onClick: () => {
|
|
1618
|
+
var _a;
|
|
1619
|
+
const html = (_a = editor == null ? void 0 : editor.getHTML()) != null ? _a : "";
|
|
1620
|
+
onSendEmail == null ? void 0 : onSendEmail({
|
|
1621
|
+
content: html,
|
|
1622
|
+
to: emailTo,
|
|
1623
|
+
cc: emailCc,
|
|
1624
|
+
subject: emailSubject
|
|
1625
|
+
});
|
|
1626
|
+
editor == null ? void 0 : editor.commands.clearContent();
|
|
1627
|
+
},
|
|
1628
|
+
disabled: !editor || editor.isEmpty || !emailTo.trim(),
|
|
1629
|
+
children: [
|
|
1630
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Send, { className: "mr-1.5 size-3.5" }),
|
|
1631
|
+
"Send Email"
|
|
1632
|
+
]
|
|
1633
|
+
}
|
|
1634
|
+
)
|
|
1635
|
+
] })
|
|
1591
1636
|
] })
|
|
1592
1637
|
]
|
|
1593
1638
|
}
|
|
1594
1639
|
),
|
|
1595
|
-
channel === "chat" && /* @__PURE__ */ (0,
|
|
1596
|
-
/* @__PURE__ */ (0,
|
|
1640
|
+
channel === "chat" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "absolute inset-0 flex flex-col gap-3 p-4", children: [
|
|
1641
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1597
1642
|
Textarea,
|
|
1598
1643
|
{
|
|
1599
1644
|
value: inputValue,
|
|
@@ -1602,19 +1647,19 @@ function ChatComposer({
|
|
|
1602
1647
|
className: "min-h-0 flex-1 resize-none text-base"
|
|
1603
1648
|
}
|
|
1604
1649
|
),
|
|
1605
|
-
/* @__PURE__ */ (0,
|
|
1606
|
-
/* @__PURE__ */ (0,
|
|
1607
|
-
/* @__PURE__ */ (0,
|
|
1650
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
1651
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
|
|
1652
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "mr-1.5 size-3.5" }),
|
|
1608
1653
|
"Let AI Handle"
|
|
1609
1654
|
] }),
|
|
1610
|
-
/* @__PURE__ */ (0,
|
|
1655
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1611
1656
|
Button,
|
|
1612
1657
|
{
|
|
1613
1658
|
size: "sm",
|
|
1614
1659
|
onClick: () => onSend == null ? void 0 : onSend(inputValue),
|
|
1615
1660
|
disabled: !inputValue.trim(),
|
|
1616
1661
|
children: [
|
|
1617
|
-
/* @__PURE__ */ (0,
|
|
1662
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Send, { className: "mr-1.5 size-3.5" }),
|
|
1618
1663
|
"Send"
|
|
1619
1664
|
]
|
|
1620
1665
|
}
|
|
@@ -1635,7 +1680,6 @@ function ChatThread({
|
|
|
1635
1680
|
isAiTyping = false,
|
|
1636
1681
|
channel,
|
|
1637
1682
|
onChannelChange,
|
|
1638
|
-
channelType,
|
|
1639
1683
|
isEmailIntegrated,
|
|
1640
1684
|
inputValue,
|
|
1641
1685
|
onInputChange,
|
|
@@ -1643,6 +1687,7 @@ function ChatThread({
|
|
|
1643
1687
|
onSendEmail,
|
|
1644
1688
|
onTakeOver,
|
|
1645
1689
|
onLetAiHandle,
|
|
1690
|
+
emailReplySubject,
|
|
1646
1691
|
onReopen,
|
|
1647
1692
|
onMarkUrgent,
|
|
1648
1693
|
onUnmarkUrgent,
|
|
@@ -1695,8 +1740,8 @@ function ChatThread({
|
|
|
1695
1740
|
const el = scrollRef.current;
|
|
1696
1741
|
if (el) el.scrollTop = el.scrollHeight;
|
|
1697
1742
|
}, [isAiTyping]);
|
|
1698
|
-
return /* @__PURE__ */ (0,
|
|
1699
|
-
/* @__PURE__ */ (0,
|
|
1743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("flex flex-col bg-background", className), children: [
|
|
1744
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1700
1745
|
"div",
|
|
1701
1746
|
{
|
|
1702
1747
|
className: cn(
|
|
@@ -1704,7 +1749,7 @@ function ChatThread({
|
|
|
1704
1749
|
"flex items-center gap-3 border-b border-border px-4"
|
|
1705
1750
|
),
|
|
1706
1751
|
children: [
|
|
1707
|
-
onBack && /* @__PURE__ */ (0,
|
|
1752
|
+
onBack && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1708
1753
|
Button,
|
|
1709
1754
|
{
|
|
1710
1755
|
variant: "ghost",
|
|
@@ -1712,28 +1757,28 @@ function ChatThread({
|
|
|
1712
1757
|
className: "size-8 shrink-0 md:hidden",
|
|
1713
1758
|
onClick: onBack,
|
|
1714
1759
|
"aria-label": "Back to conversations",
|
|
1715
|
-
children: /* @__PURE__ */ (0,
|
|
1760
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ArrowLeft, { className: "size-4" })
|
|
1716
1761
|
}
|
|
1717
1762
|
),
|
|
1718
|
-
/* @__PURE__ */ (0,
|
|
1719
|
-
/* @__PURE__ */ (0,
|
|
1720
|
-
/* @__PURE__ */ (0,
|
|
1721
|
-
/* @__PURE__ */ (0,
|
|
1722
|
-
/* @__PURE__ */ (0,
|
|
1763
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ContactAvatar, { name: contact.name, size: "md" }),
|
|
1764
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1766
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
|
|
1767
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ConversationStatusChip, { status, showDot: true })
|
|
1723
1768
|
] }),
|
|
1724
|
-
contact.email && /* @__PURE__ */ (0,
|
|
1769
|
+
contact.email && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-sm text-muted-foreground", children: contact.email })
|
|
1725
1770
|
] }),
|
|
1726
|
-
/* @__PURE__ */ (0,
|
|
1727
|
-
/* @__PURE__ */ (0,
|
|
1728
|
-
isClosed && /* @__PURE__ */ (0,
|
|
1729
|
-
!isClosed && aiIsHandling && /* @__PURE__ */ (0,
|
|
1730
|
-
!isClosed && !aiIsHandling && /* @__PURE__ */ (0,
|
|
1731
|
-
/* @__PURE__ */ (0,
|
|
1771
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
1772
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "hidden items-center gap-2 md:flex", children: [
|
|
1773
|
+
isClosed && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { variant: "outline", size: "sm", onClick: onReopen, children: "Reopen" }),
|
|
1774
|
+
!isClosed && aiIsHandling && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { size: "sm", onClick: onTakeOver, children: "Take Over" }),
|
|
1775
|
+
!isClosed && !aiIsHandling && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
|
|
1776
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Bot, { className: "mr-1.5 size-3.5" }),
|
|
1732
1777
|
"Let AI Handle"
|
|
1733
1778
|
] })
|
|
1734
1779
|
] }),
|
|
1735
|
-
/* @__PURE__ */ (0,
|
|
1736
|
-
/* @__PURE__ */ (0,
|
|
1780
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenu, { children: [
|
|
1781
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1737
1782
|
DropdownMenuTrigger,
|
|
1738
1783
|
{
|
|
1739
1784
|
className: cn(
|
|
@@ -1741,38 +1786,38 @@ function ChatThread({
|
|
|
1741
1786
|
"size-8"
|
|
1742
1787
|
),
|
|
1743
1788
|
"aria-label": "More actions",
|
|
1744
|
-
children: /* @__PURE__ */ (0,
|
|
1789
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.MoreHorizontal, { className: "size-4" })
|
|
1745
1790
|
}
|
|
1746
1791
|
),
|
|
1747
|
-
/* @__PURE__ */ (0,
|
|
1748
|
-
onShowLeadInfo && /* @__PURE__ */ (0,
|
|
1749
|
-
/* @__PURE__ */ (0,
|
|
1792
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuContent, { children: [
|
|
1793
|
+
onShowLeadInfo && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1794
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1750
1795
|
DropdownMenuItem,
|
|
1751
1796
|
{
|
|
1752
1797
|
className: "md:hidden",
|
|
1753
1798
|
onClick: onShowLeadInfo,
|
|
1754
1799
|
children: [
|
|
1755
|
-
/* @__PURE__ */ (0,
|
|
1800
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ChevronRight, { className: "mr-2 size-4" }),
|
|
1756
1801
|
"Lead Info"
|
|
1757
1802
|
]
|
|
1758
1803
|
}
|
|
1759
1804
|
),
|
|
1760
|
-
/* @__PURE__ */ (0,
|
|
1805
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuSeparator, { className: "md:hidden" })
|
|
1761
1806
|
] }),
|
|
1762
|
-
status === "needs-attention" ? /* @__PURE__ */ (0,
|
|
1763
|
-
/* @__PURE__ */ (0,
|
|
1807
|
+
status === "needs-attention" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onUnmarkUrgent, children: [
|
|
1808
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Flag, { className: "mr-2 size-4" }),
|
|
1764
1809
|
"Unmark Urgent"
|
|
1765
|
-
] }) : /* @__PURE__ */ (0,
|
|
1766
|
-
/* @__PURE__ */ (0,
|
|
1810
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onMarkUrgent, children: [
|
|
1811
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Flag, { className: "mr-2 size-4" }),
|
|
1767
1812
|
"Mark as Urgent"
|
|
1768
1813
|
] }),
|
|
1769
|
-
/* @__PURE__ */ (0,
|
|
1770
|
-
/* @__PURE__ */ (0,
|
|
1814
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onAssignToAdvisor, children: [
|
|
1815
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.UserCheck, { className: "mr-2 size-4" }),
|
|
1771
1816
|
"Assign to advisor"
|
|
1772
1817
|
] }),
|
|
1773
|
-
/* @__PURE__ */ (0,
|
|
1774
|
-
/* @__PURE__ */ (0,
|
|
1775
|
-
/* @__PURE__ */ (0,
|
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuSeparator, {}),
|
|
1819
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: onArchive, children: [
|
|
1820
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Archive, { className: "mr-2 size-4" }),
|
|
1776
1821
|
"Archive"
|
|
1777
1822
|
] })
|
|
1778
1823
|
] })
|
|
@@ -1781,7 +1826,7 @@ function ChatThread({
|
|
|
1781
1826
|
]
|
|
1782
1827
|
}
|
|
1783
1828
|
),
|
|
1784
|
-
/* @__PURE__ */ (0,
|
|
1829
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1785
1830
|
"div",
|
|
1786
1831
|
{
|
|
1787
1832
|
ref: scrollRef,
|
|
@@ -1789,29 +1834,29 @@ function ChatThread({
|
|
|
1789
1834
|
className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4",
|
|
1790
1835
|
tabIndex: 0,
|
|
1791
1836
|
children: [
|
|
1792
|
-
isLoadingMoreMessages && /* @__PURE__ */ (0,
|
|
1793
|
-
messages.length === 0 ? /* @__PURE__ */ (0,
|
|
1794
|
-
/* @__PURE__ */ (0,
|
|
1795
|
-
/* @__PURE__ */ (0,
|
|
1796
|
-
] }) : messages.map((msg) => /* @__PURE__ */ (0,
|
|
1797
|
-
isAiTyping && !isClosed && /* @__PURE__ */ (0,
|
|
1798
|
-
/* @__PURE__ */ (0,
|
|
1799
|
-
/* @__PURE__ */ (0,
|
|
1800
|
-
/* @__PURE__ */ (0,
|
|
1801
|
-
/* @__PURE__ */ (0,
|
|
1802
|
-
/* @__PURE__ */ (0,
|
|
1803
|
-
/* @__PURE__ */ (0,
|
|
1804
|
-
/* @__PURE__ */ (0,
|
|
1837
|
+
isLoadingMoreMessages && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex justify-center py-1 text-caption text-muted-foreground", children: "Loading older messages..." }),
|
|
1838
|
+
messages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground", children: [
|
|
1839
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.MessageSquare, { className: "size-8 opacity-30" }),
|
|
1840
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-sm", children: "No messages yet" })
|
|
1841
|
+
] }) : messages.map((msg) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChatBubble, { message: msg, channel }, msg.id)),
|
|
1842
|
+
isAiTyping && !isClosed && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex gap-2.5", children: [
|
|
1843
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BubbleAvatar, { role: "bot" }),
|
|
1844
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
1845
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-caption text-muted-foreground", children: "AI Assistant" }),
|
|
1846
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-1 border border-border bg-muted/60 px-3 py-2.5", children: [
|
|
1847
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:0ms]" }),
|
|
1848
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:150ms]" }),
|
|
1849
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:300ms]" })
|
|
1805
1850
|
] })
|
|
1806
1851
|
] })
|
|
1807
1852
|
] })
|
|
1808
1853
|
]
|
|
1809
1854
|
}
|
|
1810
1855
|
),
|
|
1811
|
-
isClosed ? /* @__PURE__ */ (0,
|
|
1812
|
-
/* @__PURE__ */ (0,
|
|
1813
|
-
/* @__PURE__ */ (0,
|
|
1814
|
-
/* @__PURE__ */ (0,
|
|
1856
|
+
isClosed ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-3 border-t border-border bg-muted/30 px-4 py-3 text-sm text-muted-foreground", children: [
|
|
1857
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Lock, { className: "size-3.5 shrink-0" }),
|
|
1858
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "This conversation is closed." }),
|
|
1859
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1815
1860
|
Button,
|
|
1816
1861
|
{
|
|
1817
1862
|
variant: "outline",
|
|
@@ -1821,13 +1866,12 @@ function ChatThread({
|
|
|
1821
1866
|
children: "Reopen"
|
|
1822
1867
|
}
|
|
1823
1868
|
)
|
|
1824
|
-
] }) : /* @__PURE__ */ (0,
|
|
1869
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1825
1870
|
ChatComposer,
|
|
1826
1871
|
{
|
|
1827
1872
|
mode,
|
|
1828
1873
|
channel,
|
|
1829
1874
|
onChannelChange,
|
|
1830
|
-
channelType,
|
|
1831
1875
|
isEmailIntegrated,
|
|
1832
1876
|
contactEmail: contact.email,
|
|
1833
1877
|
inputValue,
|
|
@@ -1835,34 +1879,45 @@ function ChatThread({
|
|
|
1835
1879
|
onSend,
|
|
1836
1880
|
onSendEmail,
|
|
1837
1881
|
onTakeOver,
|
|
1838
|
-
onLetAiHandle
|
|
1882
|
+
onLetAiHandle,
|
|
1883
|
+
emailReplySubject
|
|
1839
1884
|
}
|
|
1840
1885
|
)
|
|
1841
1886
|
] });
|
|
1842
1887
|
}
|
|
1888
|
+
|
|
1889
|
+
// src/components/ui/ai-conversations/lead-panel.tsx
|
|
1890
|
+
var import_lucide_react6 = require("lucide-react");
|
|
1891
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1843
1892
|
function AICollectedDataSection({
|
|
1844
1893
|
fields,
|
|
1845
1894
|
className
|
|
1846
1895
|
}) {
|
|
1847
|
-
return /* @__PURE__ */ (0,
|
|
1896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: cn("flex flex-col", className), children: fields.map((field, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1848
1897
|
"div",
|
|
1849
1898
|
{
|
|
1850
1899
|
className: "flex items-center justify-between gap-2 border-b border-border/40 py-1.5 last:border-b-0",
|
|
1851
1900
|
children: [
|
|
1852
|
-
/* @__PURE__ */ (0,
|
|
1853
|
-
/* @__PURE__ */ (0,
|
|
1854
|
-
/* @__PURE__ */ (0,
|
|
1855
|
-
field.confidence === "confirmed" ? /* @__PURE__ */ (0,
|
|
1901
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "shrink-0 text-sm text-muted-foreground", children: field.label }),
|
|
1902
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
1903
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-right text-sm font-medium text-foreground", children: field.value }),
|
|
1904
|
+
field.confidence === "confirmed" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.CheckCircle2, { className: "size-3 shrink-0 text-success-text" }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.HelpCircle, { className: "size-3 shrink-0 text-warning-text" })
|
|
1856
1905
|
] })
|
|
1857
1906
|
]
|
|
1858
1907
|
},
|
|
1859
1908
|
i
|
|
1860
1909
|
)) });
|
|
1861
1910
|
}
|
|
1911
|
+
var APPOINTMENT_STATUS_LABEL = {
|
|
1912
|
+
requested: "Lead requested",
|
|
1913
|
+
confirmed: "Confirmed",
|
|
1914
|
+
pending: "Pending confirmation",
|
|
1915
|
+
cancelled: "Cancelled"
|
|
1916
|
+
};
|
|
1862
1917
|
var MEETING_ICON = {
|
|
1863
|
-
video:
|
|
1864
|
-
phone:
|
|
1865
|
-
"in-person":
|
|
1918
|
+
video: import_lucide_react6.Video,
|
|
1919
|
+
phone: import_lucide_react6.Phone,
|
|
1920
|
+
"in-person": import_lucide_react6.MapPin
|
|
1866
1921
|
};
|
|
1867
1922
|
var MEETING_LABEL = {
|
|
1868
1923
|
video: "Video Call",
|
|
@@ -1870,9 +1925,9 @@ var MEETING_LABEL = {
|
|
|
1870
1925
|
"in-person": "In Person"
|
|
1871
1926
|
};
|
|
1872
1927
|
var MEETING_DETAIL_ICON = {
|
|
1873
|
-
video:
|
|
1874
|
-
phone:
|
|
1875
|
-
"in-person":
|
|
1928
|
+
video: import_lucide_react6.Link2,
|
|
1929
|
+
phone: import_lucide_react6.PhoneCall,
|
|
1930
|
+
"in-person": import_lucide_react6.Navigation
|
|
1876
1931
|
};
|
|
1877
1932
|
function MeetingDetailRow({
|
|
1878
1933
|
meetingType,
|
|
@@ -1880,9 +1935,9 @@ function MeetingDetailRow({
|
|
|
1880
1935
|
}) {
|
|
1881
1936
|
const DetailIcon = MEETING_DETAIL_ICON[meetingType];
|
|
1882
1937
|
const isLink = detail.startsWith("http");
|
|
1883
|
-
return /* @__PURE__ */ (0,
|
|
1884
|
-
/* @__PURE__ */ (0,
|
|
1885
|
-
isLink ? /* @__PURE__ */ (0,
|
|
1938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1939
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DetailIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
1940
|
+
isLink ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1886
1941
|
"a",
|
|
1887
1942
|
{
|
|
1888
1943
|
href: detail,
|
|
@@ -1891,7 +1946,7 @@ function MeetingDetailRow({
|
|
|
1891
1946
|
className: "text-sm text-primary underline underline-offset-2 break-all hover:text-primary/80",
|
|
1892
1947
|
children: detail
|
|
1893
1948
|
}
|
|
1894
|
-
) : /* @__PURE__ */ (0,
|
|
1949
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm text-muted-foreground break-all", children: detail })
|
|
1895
1950
|
] });
|
|
1896
1951
|
}
|
|
1897
1952
|
function AppointmentSection({
|
|
@@ -1904,23 +1959,23 @@ function AppointmentSection({
|
|
|
1904
1959
|
}) {
|
|
1905
1960
|
const AppointmentIcon = MEETING_ICON[appointment.meetingType];
|
|
1906
1961
|
const canReschedule = !isAnonymous && !!onRescheduleAppointment;
|
|
1907
|
-
return /* @__PURE__ */ (0,
|
|
1908
|
-
/* @__PURE__ */ (0,
|
|
1909
|
-
/* @__PURE__ */ (0,
|
|
1910
|
-
/* @__PURE__ */ (0,
|
|
1962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
1963
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1964
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Calendar, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
1965
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-medium text-foreground", children: appointment.datetime })
|
|
1911
1966
|
] }),
|
|
1912
|
-
/* @__PURE__ */ (0,
|
|
1913
|
-
/* @__PURE__ */ (0,
|
|
1914
|
-
/* @__PURE__ */ (0,
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1968
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AppointmentIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
1969
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm text-muted-foreground", children: MEETING_LABEL[appointment.meetingType] })
|
|
1915
1970
|
] }),
|
|
1916
|
-
appointment.meetingDetail && /* @__PURE__ */ (0,
|
|
1971
|
+
appointment.meetingDetail && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1917
1972
|
MeetingDetailRow,
|
|
1918
1973
|
{
|
|
1919
1974
|
meetingType: appointment.meetingType,
|
|
1920
1975
|
detail: appointment.meetingDetail
|
|
1921
1976
|
}
|
|
1922
1977
|
),
|
|
1923
|
-
/* @__PURE__ */ (0,
|
|
1978
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1924
1979
|
"span",
|
|
1925
1980
|
{
|
|
1926
1981
|
className: cn("text-sm font-medium", {
|
|
@@ -1932,9 +1987,9 @@ function AppointmentSection({
|
|
|
1932
1987
|
children: APPOINTMENT_STATUS_LABEL[appointment.status]
|
|
1933
1988
|
}
|
|
1934
1989
|
),
|
|
1935
|
-
appointment.status === "requested" && /* @__PURE__ */ (0,
|
|
1936
|
-
/* @__PURE__ */ (0,
|
|
1937
|
-
/* @__PURE__ */ (0,
|
|
1990
|
+
appointment.status === "requested" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex gap-2 pt-1", children: [
|
|
1991
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { size: "sm", className: "flex-1", onClick: onApproveAppointment, children: "Approve" }),
|
|
1992
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1938
1993
|
Button,
|
|
1939
1994
|
{
|
|
1940
1995
|
variant: "outline",
|
|
@@ -1944,7 +1999,7 @@ function AppointmentSection({
|
|
|
1944
1999
|
children: "Decline"
|
|
1945
2000
|
}
|
|
1946
2001
|
),
|
|
1947
|
-
canReschedule && /* @__PURE__ */ (0,
|
|
2002
|
+
canReschedule && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1948
2003
|
Button,
|
|
1949
2004
|
{
|
|
1950
2005
|
variant: "ghost",
|
|
@@ -1955,7 +2010,7 @@ function AppointmentSection({
|
|
|
1955
2010
|
}
|
|
1956
2011
|
)
|
|
1957
2012
|
] }),
|
|
1958
|
-
(appointment.status === "confirmed" || appointment.status === "cancelled") && canReschedule && /* @__PURE__ */ (0,
|
|
2013
|
+
(appointment.status === "confirmed" || appointment.status === "cancelled") && canReschedule && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1959
2014
|
Button,
|
|
1960
2015
|
{
|
|
1961
2016
|
variant: "outline",
|
|
@@ -1968,13 +2023,13 @@ function AppointmentSection({
|
|
|
1968
2023
|
] });
|
|
1969
2024
|
}
|
|
1970
2025
|
function PanelSectionHeader({ children }) {
|
|
1971
|
-
return /* @__PURE__ */ (0,
|
|
2026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mb-2.5 text-overline text-muted-foreground", children });
|
|
1972
2027
|
}
|
|
1973
2028
|
function PanelSection({
|
|
1974
2029
|
children,
|
|
1975
2030
|
last = false
|
|
1976
2031
|
}) {
|
|
1977
|
-
return /* @__PURE__ */ (0,
|
|
2032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: cn("px-4 py-4", !last && "border-b border-border"), children });
|
|
1978
2033
|
}
|
|
1979
2034
|
function LeadInfoPanel({
|
|
1980
2035
|
contact,
|
|
@@ -2000,8 +2055,8 @@ function LeadInfoPanel({
|
|
|
2000
2055
|
}) {
|
|
2001
2056
|
const isAnonymous = !contact.name.trim();
|
|
2002
2057
|
const addToContactsDisabled = isAnonymous || isKnownContact;
|
|
2003
|
-
return /* @__PURE__ */ (0,
|
|
2004
|
-
/* @__PURE__ */ (0,
|
|
2058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: cn("flex flex-col bg-background", className), children: [
|
|
2059
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2005
2060
|
"div",
|
|
2006
2061
|
{
|
|
2007
2062
|
className: cn(
|
|
@@ -2009,7 +2064,7 @@ function LeadInfoPanel({
|
|
|
2009
2064
|
"flex items-center justify-between border-b border-border px-4"
|
|
2010
2065
|
),
|
|
2011
2066
|
children: [
|
|
2012
|
-
onBack && /* @__PURE__ */ (0,
|
|
2067
|
+
onBack && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2013
2068
|
Button,
|
|
2014
2069
|
{
|
|
2015
2070
|
variant: "ghost",
|
|
@@ -2017,15 +2072,15 @@ function LeadInfoPanel({
|
|
|
2017
2072
|
className: "size-8 shrink-0 md:hidden",
|
|
2018
2073
|
onClick: onBack,
|
|
2019
2074
|
"aria-label": "Back to conversation",
|
|
2020
|
-
children: /* @__PURE__ */ (0,
|
|
2075
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.ArrowLeft, { className: "size-4" })
|
|
2021
2076
|
}
|
|
2022
2077
|
),
|
|
2023
|
-
/* @__PURE__ */ (0,
|
|
2024
|
-
onToggleCollapse && /* @__PURE__ */ (0,
|
|
2025
|
-
/* @__PURE__ */ (0,
|
|
2078
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-semibold text-foreground", children: "Lead Info" }),
|
|
2079
|
+
onToggleCollapse && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
|
|
2080
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2026
2081
|
TooltipTrigger,
|
|
2027
2082
|
{
|
|
2028
|
-
render: /* @__PURE__ */ (0,
|
|
2083
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2029
2084
|
Button,
|
|
2030
2085
|
{
|
|
2031
2086
|
variant: "ghost",
|
|
@@ -2033,8 +2088,8 @@ function LeadInfoPanel({
|
|
|
2033
2088
|
className: "size-7",
|
|
2034
2089
|
onClick: onToggleCollapse,
|
|
2035
2090
|
"aria-label": isCollapsed ? "Expand panel" : "Collapse panel",
|
|
2036
|
-
children: /* @__PURE__ */ (0,
|
|
2037
|
-
|
|
2091
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2092
|
+
import_lucide_react6.ChevronRight,
|
|
2038
2093
|
{
|
|
2039
2094
|
className: cn(
|
|
2040
2095
|
"size-4 transition-transform duration-150",
|
|
@@ -2046,26 +2101,26 @@ function LeadInfoPanel({
|
|
|
2046
2101
|
)
|
|
2047
2102
|
}
|
|
2048
2103
|
),
|
|
2049
|
-
/* @__PURE__ */ (0,
|
|
2104
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { children: isCollapsed ? "Expand panel" : "Collapse panel" })
|
|
2050
2105
|
] })
|
|
2051
2106
|
]
|
|
2052
2107
|
}
|
|
2053
2108
|
),
|
|
2054
|
-
!isCollapsed && /* @__PURE__ */ (0,
|
|
2055
|
-
/* @__PURE__ */ (0,
|
|
2056
|
-
/* @__PURE__ */ (0,
|
|
2057
|
-
/* @__PURE__ */ (0,
|
|
2058
|
-
/* @__PURE__ */ (0,
|
|
2059
|
-
/* @__PURE__ */ (0,
|
|
2060
|
-
/* @__PURE__ */ (0,
|
|
2061
|
-
/* @__PURE__ */ (0,
|
|
2062
|
-
topic && /* @__PURE__ */ (0,
|
|
2109
|
+
!isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: [
|
|
2110
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
|
|
2111
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "Contact" }),
|
|
2112
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
2113
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ContactAvatar, { name: contact.name, size: "lg" }),
|
|
2114
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2115
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
|
|
2116
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground", children: source }),
|
|
2117
|
+
topic && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Badge, { variant: "secondary", className: "mt-1 text-xs", children: topic })
|
|
2063
2118
|
] })
|
|
2064
2119
|
] }),
|
|
2065
|
-
(contact.email || contact.phone || firstSeen) && /* @__PURE__ */ (0,
|
|
2066
|
-
contact.email && /* @__PURE__ */ (0,
|
|
2067
|
-
/* @__PURE__ */ (0,
|
|
2068
|
-
/* @__PURE__ */ (0,
|
|
2120
|
+
(contact.email || contact.phone || firstSeen) && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mt-3 flex flex-col gap-1.5", children: [
|
|
2121
|
+
contact.email && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
2122
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Mail, { className: "size-4 shrink-0" }),
|
|
2123
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2069
2124
|
"a",
|
|
2070
2125
|
{
|
|
2071
2126
|
href: `mailto:${contact.email}`,
|
|
@@ -2074,9 +2129,9 @@ function LeadInfoPanel({
|
|
|
2074
2129
|
}
|
|
2075
2130
|
)
|
|
2076
2131
|
] }),
|
|
2077
|
-
contact.phone && /* @__PURE__ */ (0,
|
|
2078
|
-
/* @__PURE__ */ (0,
|
|
2079
|
-
/* @__PURE__ */ (0,
|
|
2132
|
+
contact.phone && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
2133
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.PhoneCall, { className: "size-4 shrink-0" }),
|
|
2134
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2080
2135
|
"a",
|
|
2081
2136
|
{
|
|
2082
2137
|
href: `tel:${contact.phone}`,
|
|
@@ -2085,31 +2140,31 @@ function LeadInfoPanel({
|
|
|
2085
2140
|
}
|
|
2086
2141
|
)
|
|
2087
2142
|
] }),
|
|
2088
|
-
firstSeen && /* @__PURE__ */ (0,
|
|
2143
|
+
firstSeen && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { className: "text-sm text-muted-foreground", children: [
|
|
2089
2144
|
"First seen: ",
|
|
2090
2145
|
firstSeen
|
|
2091
2146
|
] })
|
|
2092
2147
|
] })
|
|
2093
2148
|
] }),
|
|
2094
|
-
/* @__PURE__ */ (0,
|
|
2095
|
-
/* @__PURE__ */ (0,
|
|
2096
|
-
aiFields.length > 0 ? /* @__PURE__ */ (0,
|
|
2097
|
-
/* @__PURE__ */ (0,
|
|
2098
|
-
/* @__PURE__ */ (0,
|
|
2099
|
-
/* @__PURE__ */ (0,
|
|
2100
|
-
/* @__PURE__ */ (0,
|
|
2149
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
|
|
2150
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "AI-Collected Data" }),
|
|
2151
|
+
aiFields.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
2152
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AICollectedDataSection, { fields: aiFields }),
|
|
2153
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mt-2.5 flex items-center gap-3 text-xs text-muted-foreground", children: [
|
|
2154
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-1", children: [
|
|
2155
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.CheckCircle2, { className: "size-3 text-success-text" }),
|
|
2101
2156
|
"confirmed"
|
|
2102
2157
|
] }),
|
|
2103
|
-
/* @__PURE__ */ (0,
|
|
2104
|
-
/* @__PURE__ */ (0,
|
|
2158
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-1", children: [
|
|
2159
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.HelpCircle, { className: "size-3 text-warning-text" }),
|
|
2105
2160
|
"estimated"
|
|
2106
2161
|
] })
|
|
2107
2162
|
] })
|
|
2108
|
-
] }) : /* @__PURE__ */ (0,
|
|
2163
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground", children: "AI is still gathering information..." })
|
|
2109
2164
|
] }),
|
|
2110
|
-
/* @__PURE__ */ (0,
|
|
2111
|
-
/* @__PURE__ */ (0,
|
|
2112
|
-
appointment ? /* @__PURE__ */ (0,
|
|
2165
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
|
|
2166
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "Appointment" }),
|
|
2167
|
+
appointment ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2113
2168
|
AppointmentSection,
|
|
2114
2169
|
{
|
|
2115
2170
|
appointment,
|
|
@@ -2119,7 +2174,7 @@ function LeadInfoPanel({
|
|
|
2119
2174
|
onDeclineAppointment,
|
|
2120
2175
|
onRescheduleAppointment
|
|
2121
2176
|
}
|
|
2122
|
-
) : /* @__PURE__ */ (0,
|
|
2177
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2123
2178
|
Button,
|
|
2124
2179
|
{
|
|
2125
2180
|
variant: "outline",
|
|
@@ -2128,20 +2183,20 @@ function LeadInfoPanel({
|
|
|
2128
2183
|
disabled: isAnonymous,
|
|
2129
2184
|
onClick: onBookAppointment,
|
|
2130
2185
|
children: [
|
|
2131
|
-
/* @__PURE__ */ (0,
|
|
2186
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Plus, { className: "mr-1.5 size-3.5" }),
|
|
2132
2187
|
"Book Appointment"
|
|
2133
2188
|
]
|
|
2134
2189
|
}
|
|
2135
2190
|
)
|
|
2136
2191
|
] }),
|
|
2137
|
-
/* @__PURE__ */ (0,
|
|
2138
|
-
/* @__PURE__ */ (0,
|
|
2139
|
-
/* @__PURE__ */ (0,
|
|
2140
|
-
/* @__PURE__ */ (0,
|
|
2141
|
-
/* @__PURE__ */ (0,
|
|
2192
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { children: [
|
|
2193
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelSectionHeader, { children: "CRM Actions" }),
|
|
2194
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
2195
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
|
|
2196
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2142
2197
|
TooltipTrigger,
|
|
2143
2198
|
{
|
|
2144
|
-
render: /* @__PURE__ */ (0,
|
|
2199
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2145
2200
|
Button,
|
|
2146
2201
|
{
|
|
2147
2202
|
variant: "outline",
|
|
@@ -2150,16 +2205,16 @@ function LeadInfoPanel({
|
|
|
2150
2205
|
disabled: addToContactsDisabled,
|
|
2151
2206
|
onClick: onAddToContacts,
|
|
2152
2207
|
children: [
|
|
2153
|
-
/* @__PURE__ */ (0,
|
|
2208
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.UserPlus, { className: "mr-1.5 size-3.5" }),
|
|
2154
2209
|
"Add to Contacts"
|
|
2155
2210
|
]
|
|
2156
2211
|
}
|
|
2157
2212
|
)
|
|
2158
2213
|
}
|
|
2159
2214
|
),
|
|
2160
|
-
isKnownContact && /* @__PURE__ */ (0,
|
|
2215
|
+
isKnownContact && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { children: "Already in contacts" })
|
|
2161
2216
|
] }),
|
|
2162
|
-
/* @__PURE__ */ (0,
|
|
2217
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2163
2218
|
Button,
|
|
2164
2219
|
{
|
|
2165
2220
|
variant: "outline",
|
|
@@ -2168,23 +2223,23 @@ function LeadInfoPanel({
|
|
|
2168
2223
|
disabled: isAnonymous,
|
|
2169
2224
|
onClick: onCreateOpportunity,
|
|
2170
2225
|
children: [
|
|
2171
|
-
/* @__PURE__ */ (0,
|
|
2226
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.Briefcase, { className: "mr-1.5 size-3.5" }),
|
|
2172
2227
|
"Add to CRM"
|
|
2173
2228
|
]
|
|
2174
2229
|
}
|
|
2175
2230
|
)
|
|
2176
2231
|
] })
|
|
2177
2232
|
] }),
|
|
2178
|
-
/* @__PURE__ */ (0,
|
|
2179
|
-
/* @__PURE__ */ (0,
|
|
2180
|
-
/* @__PURE__ */ (0,
|
|
2181
|
-
notesSaveStatus === "saving" && /* @__PURE__ */ (0,
|
|
2182
|
-
notesSaveStatus === "saved" && /* @__PURE__ */ (0,
|
|
2183
|
-
/* @__PURE__ */ (0,
|
|
2233
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PanelSection, { last: true, children: [
|
|
2234
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mb-2.5 flex items-center justify-between", children: [
|
|
2235
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-overline text-muted-foreground", children: "Internal Notes" }),
|
|
2236
|
+
notesSaveStatus === "saving" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs text-muted-foreground", children: "Saving..." }),
|
|
2237
|
+
notesSaveStatus === "saved" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-1 text-xs text-success-text", children: [
|
|
2238
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.CheckCircle2, { className: "size-3" }),
|
|
2184
2239
|
"Saved"
|
|
2185
2240
|
] })
|
|
2186
2241
|
] }),
|
|
2187
|
-
/* @__PURE__ */ (0,
|
|
2242
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2188
2243
|
Textarea,
|
|
2189
2244
|
{
|
|
2190
2245
|
value: internalNotes,
|
|
@@ -2198,6 +2253,9 @@ function LeadInfoPanel({
|
|
|
2198
2253
|
] })
|
|
2199
2254
|
] });
|
|
2200
2255
|
}
|
|
2256
|
+
|
|
2257
|
+
// src/components/ui/ai-conversations/index.tsx
|
|
2258
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2201
2259
|
function ConversationsPage({
|
|
2202
2260
|
conversations,
|
|
2203
2261
|
activeConversationId,
|
|
@@ -2216,7 +2274,6 @@ function ConversationsPage({
|
|
|
2216
2274
|
onChannelFilterChange,
|
|
2217
2275
|
channel,
|
|
2218
2276
|
onChannelChange,
|
|
2219
|
-
channelType,
|
|
2220
2277
|
isEmailIntegrated,
|
|
2221
2278
|
inputValue,
|
|
2222
2279
|
internalNotes,
|
|
@@ -2237,6 +2294,7 @@ function ConversationsPage({
|
|
|
2237
2294
|
onSendEmail,
|
|
2238
2295
|
onTakeOver,
|
|
2239
2296
|
onLetAiHandle,
|
|
2297
|
+
emailReplySubject,
|
|
2240
2298
|
onReopen,
|
|
2241
2299
|
onMarkUrgent,
|
|
2242
2300
|
onUnmarkUrgent,
|
|
@@ -2254,7 +2312,7 @@ function ConversationsPage({
|
|
|
2254
2312
|
onLoadMore,
|
|
2255
2313
|
className
|
|
2256
2314
|
}) {
|
|
2257
|
-
const [mobilePanel, setMobilePanel] = (0,
|
|
2315
|
+
const [mobilePanel, setMobilePanel] = (0, import_react5.useState)(
|
|
2258
2316
|
"list"
|
|
2259
2317
|
);
|
|
2260
2318
|
const handleSelectConversation = (id) => {
|
|
@@ -2265,12 +2323,12 @@ function ConversationsPage({
|
|
|
2265
2323
|
onToggleLeadPanel == null ? void 0 : onToggleLeadPanel();
|
|
2266
2324
|
setMobilePanel(showLeadPanel ? "chat" : "lead");
|
|
2267
2325
|
};
|
|
2268
|
-
return /* @__PURE__ */ (0,
|
|
2326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2269
2327
|
"div",
|
|
2270
2328
|
{
|
|
2271
2329
|
className: cn("flex h-full overflow-hidden bg-background", className),
|
|
2272
2330
|
children: [
|
|
2273
|
-
/* @__PURE__ */ (0,
|
|
2331
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2274
2332
|
ConversationList,
|
|
2275
2333
|
{
|
|
2276
2334
|
conversations,
|
|
@@ -2288,12 +2346,11 @@ function ConversationsPage({
|
|
|
2288
2346
|
onLoadMore,
|
|
2289
2347
|
className: cn(
|
|
2290
2348
|
"shrink-0 md:w-[320px]",
|
|
2291
|
-
// Mobile: full width, visible only on list panel
|
|
2292
2349
|
mobilePanel === "list" ? "flex w-full md:flex" : "hidden md:flex"
|
|
2293
2350
|
)
|
|
2294
2351
|
}
|
|
2295
2352
|
),
|
|
2296
|
-
contact ? /* @__PURE__ */ (0,
|
|
2353
|
+
contact ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2297
2354
|
ChatThread,
|
|
2298
2355
|
{
|
|
2299
2356
|
contact,
|
|
@@ -2303,7 +2360,6 @@ function ConversationsPage({
|
|
|
2303
2360
|
isAiTyping,
|
|
2304
2361
|
channel,
|
|
2305
2362
|
onChannelChange,
|
|
2306
|
-
channelType,
|
|
2307
2363
|
isEmailIntegrated,
|
|
2308
2364
|
inputValue,
|
|
2309
2365
|
onInputChange,
|
|
@@ -2311,6 +2367,7 @@ function ConversationsPage({
|
|
|
2311
2367
|
onSendEmail,
|
|
2312
2368
|
onTakeOver,
|
|
2313
2369
|
onLetAiHandle,
|
|
2370
|
+
emailReplySubject,
|
|
2314
2371
|
onReopen,
|
|
2315
2372
|
onMarkUrgent,
|
|
2316
2373
|
onUnmarkUrgent,
|
|
@@ -2327,31 +2384,29 @@ function ConversationsPage({
|
|
|
2327
2384
|
)
|
|
2328
2385
|
},
|
|
2329
2386
|
contact.id
|
|
2330
|
-
) : /* @__PURE__ */ (0,
|
|
2387
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2331
2388
|
"div",
|
|
2332
2389
|
{
|
|
2333
2390
|
className: cn(
|
|
2334
2391
|
"min-w-0 flex-1 items-center justify-center border-r border-border bg-muted/10",
|
|
2335
2392
|
mobilePanel === "chat" ? "flex md:flex" : "hidden md:flex"
|
|
2336
2393
|
),
|
|
2337
|
-
children: /* @__PURE__ */ (0,
|
|
2338
|
-
/* @__PURE__ */ (0,
|
|
2339
|
-
/* @__PURE__ */ (0,
|
|
2394
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
|
|
2395
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.MessageSquare, { className: "size-10 opacity-30" }),
|
|
2396
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm", children: "Select a conversation" })
|
|
2340
2397
|
] })
|
|
2341
2398
|
}
|
|
2342
2399
|
),
|
|
2343
|
-
contact && /* @__PURE__ */ (0,
|
|
2344
|
-
/* @__PURE__ */ (0,
|
|
2400
|
+
contact && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
2401
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2345
2402
|
"div",
|
|
2346
2403
|
{
|
|
2347
2404
|
className: cn(
|
|
2348
|
-
// Mobile: full-width, instant show/hide based on mobilePanel
|
|
2349
2405
|
mobilePanel === "lead" ? "flex w-full shrink-0 flex-col" : "hidden",
|
|
2350
|
-
// Desktop: always rendered, animate width open/close
|
|
2351
2406
|
"md:block md:shrink-0 md:overflow-hidden md:transition-[width] md:duration-200 md:ease-in-out",
|
|
2352
2407
|
showLeadPanel ? "md:w-[320px]" : "md:w-0"
|
|
2353
2408
|
),
|
|
2354
|
-
children: /* @__PURE__ */ (0,
|
|
2409
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2355
2410
|
LeadInfoPanel,
|
|
2356
2411
|
{
|
|
2357
2412
|
contact,
|
|
@@ -2377,11 +2432,11 @@ function ConversationsPage({
|
|
|
2377
2432
|
)
|
|
2378
2433
|
}
|
|
2379
2434
|
),
|
|
2380
|
-
!showLeadPanel && onToggleLeadPanel && /* @__PURE__ */ (0,
|
|
2381
|
-
/* @__PURE__ */ (0,
|
|
2435
|
+
!showLeadPanel && onToggleLeadPanel && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "hidden shrink-0 items-start border-l border-border pt-[29px] md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Tooltip, { children: [
|
|
2436
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2382
2437
|
TooltipTrigger,
|
|
2383
2438
|
{
|
|
2384
|
-
render: /* @__PURE__ */ (0,
|
|
2439
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2385
2440
|
Button,
|
|
2386
2441
|
{
|
|
2387
2442
|
variant: "ghost",
|
|
@@ -2389,12 +2444,12 @@ function ConversationsPage({
|
|
|
2389
2444
|
className: "size-8",
|
|
2390
2445
|
"aria-label": "Show lead info",
|
|
2391
2446
|
onClick: handleToggleLeadPanel,
|
|
2392
|
-
children: /* @__PURE__ */ (0,
|
|
2447
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.ChevronLeft, { className: "size-4" })
|
|
2393
2448
|
}
|
|
2394
2449
|
)
|
|
2395
2450
|
}
|
|
2396
2451
|
),
|
|
2397
|
-
/* @__PURE__ */ (0,
|
|
2452
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TooltipContent, { children: "Show lead info" })
|
|
2398
2453
|
] }) })
|
|
2399
2454
|
] })
|
|
2400
2455
|
]
|
|
@@ -2409,8 +2464,8 @@ function AiConvAssignAdvisorDialog({
|
|
|
2409
2464
|
onValueChange,
|
|
2410
2465
|
onConfirm
|
|
2411
2466
|
}) {
|
|
2412
|
-
const [search, setSearch] = (0,
|
|
2413
|
-
const [roleFilter, setRoleFilter] = (0,
|
|
2467
|
+
const [search, setSearch] = (0, import_react5.useState)("");
|
|
2468
|
+
const [roleFilter, setRoleFilter] = (0, import_react5.useState)("");
|
|
2414
2469
|
const roles = Array.from(
|
|
2415
2470
|
new Set(advisors.map((a) => a.role).filter(Boolean))
|
|
2416
2471
|
);
|
|
@@ -2424,13 +2479,13 @@ function AiConvAssignAdvisorDialog({
|
|
|
2424
2479
|
setRoleFilter("");
|
|
2425
2480
|
}
|
|
2426
2481
|
};
|
|
2427
|
-
return /* @__PURE__ */ (0,
|
|
2428
|
-
/* @__PURE__ */ (0,
|
|
2429
|
-
/* @__PURE__ */ (0,
|
|
2430
|
-
/* @__PURE__ */ (0,
|
|
2482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogContent, { children: [
|
|
2483
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogHeader, { children: [
|
|
2484
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DialogTitle, { children: "Assign to advisor" }),
|
|
2485
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DialogDescription, { children: "Choose an advisor to handle this conversation." })
|
|
2431
2486
|
] }),
|
|
2432
|
-
/* @__PURE__ */ (0,
|
|
2433
|
-
roles.length > 0 && /* @__PURE__ */ (0,
|
|
2487
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col gap-0", children: [
|
|
2488
|
+
roles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pb-3", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2434
2489
|
ToggleGroup,
|
|
2435
2490
|
{
|
|
2436
2491
|
type: "single",
|
|
@@ -2443,14 +2498,14 @@ function AiConvAssignAdvisorDialog({
|
|
|
2443
2498
|
setRoleFilter(!v || v === "__all__" ? "" : v);
|
|
2444
2499
|
},
|
|
2445
2500
|
children: [
|
|
2446
|
-
/* @__PURE__ */ (0,
|
|
2447
|
-
roles.map((role) => /* @__PURE__ */ (0,
|
|
2501
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ToggleGroupItem, { value: "__all__", children: "All" }),
|
|
2502
|
+
roles.map((role) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ToggleGroupItem, { value: role, children: role }, role))
|
|
2448
2503
|
]
|
|
2449
2504
|
}
|
|
2450
2505
|
) }),
|
|
2451
|
-
/* @__PURE__ */ (0,
|
|
2452
|
-
/* @__PURE__ */ (0,
|
|
2453
|
-
/* @__PURE__ */ (0,
|
|
2506
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2 border border-input px-3", children: [
|
|
2507
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.Search, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
2508
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2454
2509
|
"input",
|
|
2455
2510
|
{
|
|
2456
2511
|
type: "text",
|
|
@@ -2461,7 +2516,7 @@ function AiConvAssignAdvisorDialog({
|
|
|
2461
2516
|
}
|
|
2462
2517
|
)
|
|
2463
2518
|
] }),
|
|
2464
|
-
/* @__PURE__ */ (0,
|
|
2519
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "max-h-52 overflow-y-auto border border-t-0 border-input", children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "No advisors found." }) : filtered.map((advisor) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2465
2520
|
"button",
|
|
2466
2521
|
{
|
|
2467
2522
|
type: "button",
|
|
@@ -2471,19 +2526,19 @@ function AiConvAssignAdvisorDialog({
|
|
|
2471
2526
|
value === advisor.id && "bg-muted font-medium"
|
|
2472
2527
|
),
|
|
2473
2528
|
children: [
|
|
2474
|
-
/* @__PURE__ */ (0,
|
|
2475
|
-
/* @__PURE__ */ (0,
|
|
2476
|
-
/* @__PURE__ */ (0,
|
|
2477
|
-
advisor.role && /* @__PURE__ */ (0,
|
|
2529
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Avatar, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AvatarFallback, { className: "font-semibold", children: advisor.initials }) }),
|
|
2530
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2531
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate text-sm", children: advisor.name }),
|
|
2532
|
+
advisor.role && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate text-xs text-muted-foreground", children: advisor.role })
|
|
2478
2533
|
] })
|
|
2479
2534
|
]
|
|
2480
2535
|
},
|
|
2481
2536
|
advisor.id
|
|
2482
2537
|
)) })
|
|
2483
2538
|
] }),
|
|
2484
|
-
/* @__PURE__ */ (0,
|
|
2485
|
-
/* @__PURE__ */ (0,
|
|
2486
|
-
/* @__PURE__ */ (0,
|
|
2539
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DialogFooter, { children: [
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
2541
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { onClick: onConfirm, children: "Assign" })
|
|
2487
2542
|
] })
|
|
2488
2543
|
] }) });
|
|
2489
2544
|
}
|