@copilotz/chat-ui 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +568 -533
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +430 -395
- package/dist/index.js.map +1 -1
- package/dist/styles.css +9 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1168,8 +1168,21 @@ function SheetDescription({
|
|
|
1168
1168
|
);
|
|
1169
1169
|
}
|
|
1170
1170
|
|
|
1171
|
-
// src/components/ui/
|
|
1171
|
+
// src/components/ui/skeleton.tsx
|
|
1172
1172
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1173
|
+
function Skeleton({ className, ...props }) {
|
|
1174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1175
|
+
"div",
|
|
1176
|
+
{
|
|
1177
|
+
"data-slot": "skeleton",
|
|
1178
|
+
className: cn("bg-accent animate-pulse rounded-md", className),
|
|
1179
|
+
...props
|
|
1180
|
+
}
|
|
1181
|
+
);
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
// src/components/ui/sidebar.tsx
|
|
1185
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1173
1186
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
1174
1187
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
1175
1188
|
var SIDEBAR_WIDTH = "16rem";
|
|
@@ -1235,7 +1248,7 @@ function SidebarProvider({
|
|
|
1235
1248
|
}),
|
|
1236
1249
|
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
1237
1250
|
);
|
|
1238
|
-
return /* @__PURE__ */ (0,
|
|
1251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1239
1252
|
"div",
|
|
1240
1253
|
{
|
|
1241
1254
|
"data-slot": "sidebar-wrapper",
|
|
@@ -1263,7 +1276,7 @@ function Sidebar({
|
|
|
1263
1276
|
}) {
|
|
1264
1277
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
1265
1278
|
if (collapsible === "none") {
|
|
1266
|
-
return /* @__PURE__ */ (0,
|
|
1279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1267
1280
|
"div",
|
|
1268
1281
|
{
|
|
1269
1282
|
"data-slot": "sidebar",
|
|
@@ -1277,7 +1290,7 @@ function Sidebar({
|
|
|
1277
1290
|
);
|
|
1278
1291
|
}
|
|
1279
1292
|
if (isMobile) {
|
|
1280
|
-
return /* @__PURE__ */ (0,
|
|
1293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1281
1294
|
SheetContent,
|
|
1282
1295
|
{
|
|
1283
1296
|
"data-sidebar": "sidebar",
|
|
@@ -1289,16 +1302,16 @@ function Sidebar({
|
|
|
1289
1302
|
},
|
|
1290
1303
|
side,
|
|
1291
1304
|
children: [
|
|
1292
|
-
/* @__PURE__ */ (0,
|
|
1293
|
-
/* @__PURE__ */ (0,
|
|
1294
|
-
/* @__PURE__ */ (0,
|
|
1305
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(SheetHeader, { className: "sr-only", children: [
|
|
1306
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SheetTitle, { children: "Sidebar" }),
|
|
1307
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
1295
1308
|
] }),
|
|
1296
|
-
/* @__PURE__ */ (0,
|
|
1309
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex h-full w-full flex-col", children })
|
|
1297
1310
|
]
|
|
1298
1311
|
}
|
|
1299
1312
|
) });
|
|
1300
1313
|
}
|
|
1301
|
-
return /* @__PURE__ */ (0,
|
|
1314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1302
1315
|
"div",
|
|
1303
1316
|
{
|
|
1304
1317
|
className: "group peer text-sidebar-foreground hidden md:block",
|
|
@@ -1308,7 +1321,7 @@ function Sidebar({
|
|
|
1308
1321
|
"data-side": side,
|
|
1309
1322
|
"data-slot": "sidebar",
|
|
1310
1323
|
children: [
|
|
1311
|
-
/* @__PURE__ */ (0,
|
|
1324
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1312
1325
|
"div",
|
|
1313
1326
|
{
|
|
1314
1327
|
"data-slot": "sidebar-gap",
|
|
@@ -1320,7 +1333,7 @@ function Sidebar({
|
|
|
1320
1333
|
)
|
|
1321
1334
|
}
|
|
1322
1335
|
),
|
|
1323
|
-
/* @__PURE__ */ (0,
|
|
1336
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1324
1337
|
"div",
|
|
1325
1338
|
{
|
|
1326
1339
|
"data-slot": "sidebar-container",
|
|
@@ -1332,7 +1345,7 @@ function Sidebar({
|
|
|
1332
1345
|
className
|
|
1333
1346
|
),
|
|
1334
1347
|
...props,
|
|
1335
|
-
children: /* @__PURE__ */ (0,
|
|
1348
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1336
1349
|
"div",
|
|
1337
1350
|
{
|
|
1338
1351
|
"data-sidebar": "sidebar",
|
|
@@ -1353,7 +1366,7 @@ function SidebarTrigger({
|
|
|
1353
1366
|
...props
|
|
1354
1367
|
}) {
|
|
1355
1368
|
const { toggleSidebar } = useSidebar();
|
|
1356
|
-
return /* @__PURE__ */ (0,
|
|
1369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1357
1370
|
Button,
|
|
1358
1371
|
{
|
|
1359
1372
|
"data-sidebar": "trigger",
|
|
@@ -1367,15 +1380,15 @@ function SidebarTrigger({
|
|
|
1367
1380
|
},
|
|
1368
1381
|
...props,
|
|
1369
1382
|
children: [
|
|
1370
|
-
/* @__PURE__ */ (0,
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1383
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react3.PanelLeftIcon, {}),
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
1372
1385
|
]
|
|
1373
1386
|
}
|
|
1374
1387
|
);
|
|
1375
1388
|
}
|
|
1376
1389
|
function SidebarRail({ className, ...props }) {
|
|
1377
1390
|
const { toggleSidebar } = useSidebar();
|
|
1378
|
-
return /* @__PURE__ */ (0,
|
|
1391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1379
1392
|
"button",
|
|
1380
1393
|
{
|
|
1381
1394
|
"data-sidebar": "rail",
|
|
@@ -1398,7 +1411,7 @@ function SidebarRail({ className, ...props }) {
|
|
|
1398
1411
|
);
|
|
1399
1412
|
}
|
|
1400
1413
|
function SidebarInset({ className, ...props }) {
|
|
1401
|
-
return /* @__PURE__ */ (0,
|
|
1414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1402
1415
|
"main",
|
|
1403
1416
|
{
|
|
1404
1417
|
"data-slot": "sidebar-inset",
|
|
@@ -1412,7 +1425,7 @@ function SidebarInset({ className, ...props }) {
|
|
|
1412
1425
|
);
|
|
1413
1426
|
}
|
|
1414
1427
|
function SidebarHeader({ className, ...props }) {
|
|
1415
|
-
return /* @__PURE__ */ (0,
|
|
1428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1416
1429
|
"div",
|
|
1417
1430
|
{
|
|
1418
1431
|
"data-slot": "sidebar-header",
|
|
@@ -1423,7 +1436,7 @@ function SidebarHeader({ className, ...props }) {
|
|
|
1423
1436
|
);
|
|
1424
1437
|
}
|
|
1425
1438
|
function SidebarFooter({ className, ...props }) {
|
|
1426
|
-
return /* @__PURE__ */ (0,
|
|
1439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1427
1440
|
"div",
|
|
1428
1441
|
{
|
|
1429
1442
|
"data-slot": "sidebar-footer",
|
|
@@ -1434,7 +1447,7 @@ function SidebarFooter({ className, ...props }) {
|
|
|
1434
1447
|
);
|
|
1435
1448
|
}
|
|
1436
1449
|
function SidebarContent({ className, ...props }) {
|
|
1437
|
-
return /* @__PURE__ */ (0,
|
|
1450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1438
1451
|
"div",
|
|
1439
1452
|
{
|
|
1440
1453
|
"data-slot": "sidebar-content",
|
|
@@ -1448,7 +1461,7 @@ function SidebarContent({ className, ...props }) {
|
|
|
1448
1461
|
);
|
|
1449
1462
|
}
|
|
1450
1463
|
function SidebarGroup({ className, ...props }) {
|
|
1451
|
-
return /* @__PURE__ */ (0,
|
|
1464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1452
1465
|
"div",
|
|
1453
1466
|
{
|
|
1454
1467
|
"data-slot": "sidebar-group",
|
|
@@ -1464,7 +1477,7 @@ function SidebarGroupLabel({
|
|
|
1464
1477
|
...props
|
|
1465
1478
|
}) {
|
|
1466
1479
|
const Comp = asChild ? import_react_slot3.Slot : "div";
|
|
1467
|
-
return /* @__PURE__ */ (0,
|
|
1480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1468
1481
|
Comp,
|
|
1469
1482
|
{
|
|
1470
1483
|
"data-slot": "sidebar-group-label",
|
|
@@ -1482,7 +1495,7 @@ function SidebarGroupContent({
|
|
|
1482
1495
|
className,
|
|
1483
1496
|
...props
|
|
1484
1497
|
}) {
|
|
1485
|
-
return /* @__PURE__ */ (0,
|
|
1498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1486
1499
|
"div",
|
|
1487
1500
|
{
|
|
1488
1501
|
"data-slot": "sidebar-group-content",
|
|
@@ -1493,7 +1506,7 @@ function SidebarGroupContent({
|
|
|
1493
1506
|
);
|
|
1494
1507
|
}
|
|
1495
1508
|
function SidebarMenu({ className, ...props }) {
|
|
1496
|
-
return /* @__PURE__ */ (0,
|
|
1509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1497
1510
|
"ul",
|
|
1498
1511
|
{
|
|
1499
1512
|
"data-slot": "sidebar-menu",
|
|
@@ -1504,7 +1517,7 @@ function SidebarMenu({ className, ...props }) {
|
|
|
1504
1517
|
);
|
|
1505
1518
|
}
|
|
1506
1519
|
function SidebarMenuItem({ className, ...props }) {
|
|
1507
|
-
return /* @__PURE__ */ (0,
|
|
1520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1508
1521
|
"li",
|
|
1509
1522
|
{
|
|
1510
1523
|
"data-slot": "sidebar-menu-item",
|
|
@@ -1545,7 +1558,7 @@ function SidebarMenuButton({
|
|
|
1545
1558
|
}) {
|
|
1546
1559
|
const Comp = asChild ? import_react_slot3.Slot : "button";
|
|
1547
1560
|
const { isMobile, state } = useSidebar();
|
|
1548
|
-
const button = /* @__PURE__ */ (0,
|
|
1561
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1549
1562
|
Comp,
|
|
1550
1563
|
{
|
|
1551
1564
|
"data-slot": "sidebar-menu-button",
|
|
@@ -1564,9 +1577,9 @@ function SidebarMenuButton({
|
|
|
1564
1577
|
children: tooltip
|
|
1565
1578
|
};
|
|
1566
1579
|
}
|
|
1567
|
-
return /* @__PURE__ */ (0,
|
|
1568
|
-
/* @__PURE__ */ (0,
|
|
1569
|
-
/* @__PURE__ */ (0,
|
|
1580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Tooltip, { children: [
|
|
1581
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipTrigger, { asChild: true, children: button }),
|
|
1582
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1570
1583
|
TooltipContent,
|
|
1571
1584
|
{
|
|
1572
1585
|
side: "right",
|
|
@@ -1584,7 +1597,7 @@ function SidebarMenuAction({
|
|
|
1584
1597
|
...props
|
|
1585
1598
|
}) {
|
|
1586
1599
|
const Comp = asChild ? import_react_slot3.Slot : "button";
|
|
1587
|
-
return /* @__PURE__ */ (0,
|
|
1600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1588
1601
|
Comp,
|
|
1589
1602
|
{
|
|
1590
1603
|
"data-slot": "sidebar-menu-action",
|
|
@@ -1609,7 +1622,7 @@ function SidebarMenuAction({
|
|
|
1609
1622
|
var React5 = __toESM(require("react"), 1);
|
|
1610
1623
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
1611
1624
|
var import_lucide_react4 = require("lucide-react");
|
|
1612
|
-
var
|
|
1625
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1613
1626
|
function cleanupBodyStyles2() {
|
|
1614
1627
|
if (typeof document !== "undefined" && document.body.style.pointerEvents === "none") {
|
|
1615
1628
|
document.body.style.pointerEvents = "";
|
|
@@ -1633,23 +1646,23 @@ function Dialog({
|
|
|
1633
1646
|
cleanupBodyStyles2();
|
|
1634
1647
|
};
|
|
1635
1648
|
}, []);
|
|
1636
|
-
return /* @__PURE__ */ (0,
|
|
1649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", open, onOpenChange, ...props });
|
|
1637
1650
|
}
|
|
1638
1651
|
function DialogTrigger({
|
|
1639
1652
|
...props
|
|
1640
1653
|
}) {
|
|
1641
|
-
return /* @__PURE__ */ (0,
|
|
1654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
1642
1655
|
}
|
|
1643
1656
|
function DialogPortal({
|
|
1644
1657
|
...props
|
|
1645
1658
|
}) {
|
|
1646
|
-
return /* @__PURE__ */ (0,
|
|
1659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
1647
1660
|
}
|
|
1648
1661
|
function DialogOverlay({
|
|
1649
1662
|
className,
|
|
1650
1663
|
...props
|
|
1651
1664
|
}) {
|
|
1652
|
-
return /* @__PURE__ */ (0,
|
|
1665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1653
1666
|
DialogPrimitive.Overlay,
|
|
1654
1667
|
{
|
|
1655
1668
|
"data-slot": "dialog-overlay",
|
|
@@ -1670,9 +1683,9 @@ function DialogContent({
|
|
|
1670
1683
|
showCloseButton = true,
|
|
1671
1684
|
...props
|
|
1672
1685
|
}) {
|
|
1673
|
-
return /* @__PURE__ */ (0,
|
|
1674
|
-
/* @__PURE__ */ (0,
|
|
1675
|
-
/* @__PURE__ */ (0,
|
|
1686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
1687
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogOverlay, {}),
|
|
1688
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1676
1689
|
DialogPrimitive.Content,
|
|
1677
1690
|
{
|
|
1678
1691
|
"data-slot": "dialog-content",
|
|
@@ -1684,14 +1697,14 @@ function DialogContent({
|
|
|
1684
1697
|
...props,
|
|
1685
1698
|
children: [
|
|
1686
1699
|
children,
|
|
1687
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
1700
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1688
1701
|
DialogPrimitive.Close,
|
|
1689
1702
|
{
|
|
1690
1703
|
"data-slot": "dialog-close",
|
|
1691
1704
|
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1692
1705
|
children: [
|
|
1693
|
-
/* @__PURE__ */ (0,
|
|
1694
|
-
/* @__PURE__ */ (0,
|
|
1706
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react4.XIcon, {}),
|
|
1707
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: "Close" })
|
|
1695
1708
|
]
|
|
1696
1709
|
}
|
|
1697
1710
|
)
|
|
@@ -1701,7 +1714,7 @@ function DialogContent({
|
|
|
1701
1714
|
] });
|
|
1702
1715
|
}
|
|
1703
1716
|
function DialogHeader({ className, ...props }) {
|
|
1704
|
-
return /* @__PURE__ */ (0,
|
|
1717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1705
1718
|
"div",
|
|
1706
1719
|
{
|
|
1707
1720
|
"data-slot": "dialog-header",
|
|
@@ -1711,7 +1724,7 @@ function DialogHeader({ className, ...props }) {
|
|
|
1711
1724
|
);
|
|
1712
1725
|
}
|
|
1713
1726
|
function DialogFooter({ className, ...props }) {
|
|
1714
|
-
return /* @__PURE__ */ (0,
|
|
1727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1715
1728
|
"div",
|
|
1716
1729
|
{
|
|
1717
1730
|
"data-slot": "dialog-footer",
|
|
@@ -1727,7 +1740,7 @@ function DialogTitle({
|
|
|
1727
1740
|
className,
|
|
1728
1741
|
...props
|
|
1729
1742
|
}) {
|
|
1730
|
-
return /* @__PURE__ */ (0,
|
|
1743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1731
1744
|
DialogPrimitive.Title,
|
|
1732
1745
|
{
|
|
1733
1746
|
"data-slot": "dialog-title",
|
|
@@ -1740,7 +1753,7 @@ function DialogDescription({
|
|
|
1740
1753
|
className,
|
|
1741
1754
|
...props
|
|
1742
1755
|
}) {
|
|
1743
|
-
return /* @__PURE__ */ (0,
|
|
1756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1744
1757
|
DialogPrimitive.Description,
|
|
1745
1758
|
{
|
|
1746
1759
|
"data-slot": "dialog-description",
|
|
@@ -1753,7 +1766,7 @@ function DialogDescription({
|
|
|
1753
1766
|
// src/components/ui/alert-dialog.tsx
|
|
1754
1767
|
var React6 = __toESM(require("react"), 1);
|
|
1755
1768
|
var AlertDialogPrimitive = __toESM(require("@radix-ui/react-alert-dialog"), 1);
|
|
1756
|
-
var
|
|
1769
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1757
1770
|
function cleanupBodyStyles3() {
|
|
1758
1771
|
if (typeof document !== "undefined" && document.body.style.pointerEvents === "none") {
|
|
1759
1772
|
document.body.style.pointerEvents = "";
|
|
@@ -1777,18 +1790,18 @@ function AlertDialog({
|
|
|
1777
1790
|
cleanupBodyStyles3();
|
|
1778
1791
|
};
|
|
1779
1792
|
}, []);
|
|
1780
|
-
return /* @__PURE__ */ (0,
|
|
1793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", open, onOpenChange, ...props });
|
|
1781
1794
|
}
|
|
1782
1795
|
function AlertDialogPortal({
|
|
1783
1796
|
...props
|
|
1784
1797
|
}) {
|
|
1785
|
-
return /* @__PURE__ */ (0,
|
|
1798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props });
|
|
1786
1799
|
}
|
|
1787
1800
|
function AlertDialogOverlay({
|
|
1788
1801
|
className,
|
|
1789
1802
|
...props
|
|
1790
1803
|
}) {
|
|
1791
|
-
return /* @__PURE__ */ (0,
|
|
1804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1792
1805
|
AlertDialogPrimitive.Overlay,
|
|
1793
1806
|
{
|
|
1794
1807
|
"data-slot": "alert-dialog-overlay",
|
|
@@ -1807,9 +1820,9 @@ function AlertDialogContent({
|
|
|
1807
1820
|
className,
|
|
1808
1821
|
...props
|
|
1809
1822
|
}) {
|
|
1810
|
-
return /* @__PURE__ */ (0,
|
|
1811
|
-
/* @__PURE__ */ (0,
|
|
1812
|
-
/* @__PURE__ */ (0,
|
|
1823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(AlertDialogPortal, { children: [
|
|
1824
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AlertDialogOverlay, {}),
|
|
1825
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1813
1826
|
AlertDialogPrimitive.Content,
|
|
1814
1827
|
{
|
|
1815
1828
|
"data-slot": "alert-dialog-content",
|
|
@@ -1826,7 +1839,7 @@ function AlertDialogHeader({
|
|
|
1826
1839
|
className,
|
|
1827
1840
|
...props
|
|
1828
1841
|
}) {
|
|
1829
|
-
return /* @__PURE__ */ (0,
|
|
1842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1830
1843
|
"div",
|
|
1831
1844
|
{
|
|
1832
1845
|
"data-slot": "alert-dialog-header",
|
|
@@ -1839,7 +1852,7 @@ function AlertDialogFooter({
|
|
|
1839
1852
|
className,
|
|
1840
1853
|
...props
|
|
1841
1854
|
}) {
|
|
1842
|
-
return /* @__PURE__ */ (0,
|
|
1855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1843
1856
|
"div",
|
|
1844
1857
|
{
|
|
1845
1858
|
"data-slot": "alert-dialog-footer",
|
|
@@ -1855,7 +1868,7 @@ function AlertDialogTitle({
|
|
|
1855
1868
|
className,
|
|
1856
1869
|
...props
|
|
1857
1870
|
}) {
|
|
1858
|
-
return /* @__PURE__ */ (0,
|
|
1871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1859
1872
|
AlertDialogPrimitive.Title,
|
|
1860
1873
|
{
|
|
1861
1874
|
"data-slot": "alert-dialog-title",
|
|
@@ -1868,7 +1881,7 @@ function AlertDialogDescription({
|
|
|
1868
1881
|
className,
|
|
1869
1882
|
...props
|
|
1870
1883
|
}) {
|
|
1871
|
-
return /* @__PURE__ */ (0,
|
|
1884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1872
1885
|
AlertDialogPrimitive.Description,
|
|
1873
1886
|
{
|
|
1874
1887
|
"data-slot": "alert-dialog-description",
|
|
@@ -1881,7 +1894,7 @@ function AlertDialogAction({
|
|
|
1881
1894
|
className,
|
|
1882
1895
|
...props
|
|
1883
1896
|
}) {
|
|
1884
|
-
return /* @__PURE__ */ (0,
|
|
1897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1885
1898
|
AlertDialogPrimitive.Action,
|
|
1886
1899
|
{
|
|
1887
1900
|
className: cn(buttonVariants(), className),
|
|
@@ -1893,7 +1906,7 @@ function AlertDialogCancel({
|
|
|
1893
1906
|
className,
|
|
1894
1907
|
...props
|
|
1895
1908
|
}) {
|
|
1896
|
-
return /* @__PURE__ */ (0,
|
|
1909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1897
1910
|
AlertDialogPrimitive.Cancel,
|
|
1898
1911
|
{
|
|
1899
1912
|
className: cn(buttonVariants({ variant: "outline" }), className),
|
|
@@ -1905,16 +1918,16 @@ function AlertDialogCancel({
|
|
|
1905
1918
|
// src/components/ui/dropdown-menu.tsx
|
|
1906
1919
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
1907
1920
|
var import_lucide_react5 = require("lucide-react");
|
|
1908
|
-
var
|
|
1921
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1909
1922
|
function DropdownMenu({
|
|
1910
1923
|
...props
|
|
1911
1924
|
}) {
|
|
1912
|
-
return /* @__PURE__ */ (0,
|
|
1925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
1913
1926
|
}
|
|
1914
1927
|
function DropdownMenuTrigger({
|
|
1915
1928
|
...props
|
|
1916
1929
|
}) {
|
|
1917
|
-
return /* @__PURE__ */ (0,
|
|
1930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1918
1931
|
DropdownMenuPrimitive.Trigger,
|
|
1919
1932
|
{
|
|
1920
1933
|
"data-slot": "dropdown-menu-trigger",
|
|
@@ -1927,7 +1940,7 @@ function DropdownMenuContent({
|
|
|
1927
1940
|
sideOffset = 4,
|
|
1928
1941
|
...props
|
|
1929
1942
|
}) {
|
|
1930
|
-
return /* @__PURE__ */ (0,
|
|
1943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1931
1944
|
DropdownMenuPrimitive.Content,
|
|
1932
1945
|
{
|
|
1933
1946
|
"data-slot": "dropdown-menu-content",
|
|
@@ -1946,7 +1959,7 @@ function DropdownMenuItem({
|
|
|
1946
1959
|
variant = "default",
|
|
1947
1960
|
...props
|
|
1948
1961
|
}) {
|
|
1949
|
-
return /* @__PURE__ */ (0,
|
|
1962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1950
1963
|
DropdownMenuPrimitive.Item,
|
|
1951
1964
|
{
|
|
1952
1965
|
"data-slot": "dropdown-menu-item",
|
|
@@ -1965,7 +1978,7 @@ function DropdownMenuLabel({
|
|
|
1965
1978
|
inset,
|
|
1966
1979
|
...props
|
|
1967
1980
|
}) {
|
|
1968
|
-
return /* @__PURE__ */ (0,
|
|
1981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1969
1982
|
DropdownMenuPrimitive.Label,
|
|
1970
1983
|
{
|
|
1971
1984
|
"data-slot": "dropdown-menu-label",
|
|
@@ -1982,7 +1995,7 @@ function DropdownMenuSeparator({
|
|
|
1982
1995
|
className,
|
|
1983
1996
|
...props
|
|
1984
1997
|
}) {
|
|
1985
|
-
return /* @__PURE__ */ (0,
|
|
1998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1986
1999
|
DropdownMenuPrimitive.Separator,
|
|
1987
2000
|
{
|
|
1988
2001
|
"data-slot": "dropdown-menu-separator",
|
|
@@ -1997,7 +2010,7 @@ var import_lucide_react7 = require("lucide-react");
|
|
|
1997
2010
|
|
|
1998
2011
|
// src/components/chat/UserMenu.tsx
|
|
1999
2012
|
var import_lucide_react6 = require("lucide-react");
|
|
2000
|
-
var
|
|
2013
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2001
2014
|
var getInitials = (name, email) => {
|
|
2002
2015
|
if (name) {
|
|
2003
2016
|
return name.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase();
|
|
@@ -2032,27 +2045,27 @@ var UserMenu = ({
|
|
|
2032
2045
|
};
|
|
2033
2046
|
const displayName = getDisplayName(user, labels.guest);
|
|
2034
2047
|
const initials = getInitials(user?.name, user?.email);
|
|
2035
|
-
return /* @__PURE__ */ (0,
|
|
2036
|
-
/* @__PURE__ */ (0,
|
|
2048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SidebarMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SidebarMenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DropdownMenu, { children: [
|
|
2049
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2037
2050
|
SidebarMenuButton,
|
|
2038
2051
|
{
|
|
2039
2052
|
size: "lg",
|
|
2040
2053
|
className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
|
|
2041
2054
|
tooltip: displayName,
|
|
2042
2055
|
children: [
|
|
2043
|
-
/* @__PURE__ */ (0,
|
|
2044
|
-
user?.avatar && /* @__PURE__ */ (0,
|
|
2045
|
-
/* @__PURE__ */ (0,
|
|
2056
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Avatar, { className: "h-8 w-8 rounded-lg", children: [
|
|
2057
|
+
user?.avatar && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AvatarImage, { src: user.avatar, alt: displayName }),
|
|
2058
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AvatarFallback, { className: "rounded-lg bg-primary/10 text-primary text-xs font-medium", children: initials })
|
|
2046
2059
|
] }),
|
|
2047
|
-
/* @__PURE__ */ (0,
|
|
2048
|
-
/* @__PURE__ */ (0,
|
|
2049
|
-
user?.email && /* @__PURE__ */ (0,
|
|
2060
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden", children: [
|
|
2061
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "truncate font-medium", children: displayName }),
|
|
2062
|
+
user?.email && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "truncate text-xs text-muted-foreground", children: user.email })
|
|
2050
2063
|
] }),
|
|
2051
|
-
/* @__PURE__ */ (0,
|
|
2064
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.ChevronsUpDown, { className: "ml-auto size-4 group-data-[collapsible=icon]:hidden" })
|
|
2052
2065
|
]
|
|
2053
2066
|
}
|
|
2054
2067
|
) }),
|
|
2055
|
-
/* @__PURE__ */ (0,
|
|
2068
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2056
2069
|
DropdownMenuContent,
|
|
2057
2070
|
{
|
|
2058
2071
|
className: "w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg",
|
|
@@ -2060,72 +2073,72 @@ var UserMenu = ({
|
|
|
2060
2073
|
align: "end",
|
|
2061
2074
|
sideOffset: 4,
|
|
2062
2075
|
children: [
|
|
2063
|
-
/* @__PURE__ */ (0,
|
|
2064
|
-
/* @__PURE__ */ (0,
|
|
2065
|
-
user?.avatar && /* @__PURE__ */ (0,
|
|
2066
|
-
/* @__PURE__ */ (0,
|
|
2076
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DropdownMenuLabel, { className: "p-0 font-normal", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: [
|
|
2077
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Avatar, { className: "h-8 w-8 rounded-lg", children: [
|
|
2078
|
+
user?.avatar && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AvatarImage, { src: user.avatar, alt: displayName }),
|
|
2079
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AvatarFallback, { className: "rounded-lg bg-primary/10 text-primary text-xs font-medium", children: initials })
|
|
2067
2080
|
] }),
|
|
2068
|
-
/* @__PURE__ */ (0,
|
|
2069
|
-
/* @__PURE__ */ (0,
|
|
2070
|
-
user?.email && /* @__PURE__ */ (0,
|
|
2081
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
2082
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "truncate font-medium", children: displayName }),
|
|
2083
|
+
user?.email && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "truncate text-xs text-muted-foreground", children: user.email })
|
|
2071
2084
|
] })
|
|
2072
2085
|
] }) }),
|
|
2073
|
-
/* @__PURE__ */ (0,
|
|
2074
|
-
callbacks?.onViewProfile && /* @__PURE__ */ (0,
|
|
2075
|
-
/* @__PURE__ */ (0,
|
|
2076
|
-
/* @__PURE__ */ (0,
|
|
2086
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DropdownMenuSeparator, {}),
|
|
2087
|
+
callbacks?.onViewProfile && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DropdownMenuItem, { onClick: callbacks.onViewProfile, children: [
|
|
2088
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.User, { className: "mr-2 h-4 w-4" }),
|
|
2089
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: labels.profile })
|
|
2077
2090
|
] }),
|
|
2078
|
-
callbacks?.onOpenSettings && /* @__PURE__ */ (0,
|
|
2079
|
-
/* @__PURE__ */ (0,
|
|
2080
|
-
/* @__PURE__ */ (0,
|
|
2091
|
+
callbacks?.onOpenSettings && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DropdownMenuItem, { onClick: callbacks.onOpenSettings, children: [
|
|
2092
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.Settings, { className: "mr-2 h-4 w-4" }),
|
|
2093
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: labels.settings })
|
|
2081
2094
|
] }),
|
|
2082
2095
|
additionalItems,
|
|
2083
|
-
showThemeOptions && callbacks?.onThemeChange && /* @__PURE__ */ (0,
|
|
2084
|
-
/* @__PURE__ */ (0,
|
|
2085
|
-
/* @__PURE__ */ (0,
|
|
2096
|
+
showThemeOptions && callbacks?.onThemeChange && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
2097
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DropdownMenuSeparator, {}),
|
|
2098
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2086
2099
|
DropdownMenuItem,
|
|
2087
2100
|
{
|
|
2088
2101
|
onClick: () => callbacks.onThemeChange?.("light"),
|
|
2089
2102
|
className: currentTheme === "light" ? "bg-accent" : "",
|
|
2090
2103
|
children: [
|
|
2091
|
-
/* @__PURE__ */ (0,
|
|
2092
|
-
/* @__PURE__ */ (0,
|
|
2104
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.Sun, { className: "mr-2 h-4 w-4" }),
|
|
2105
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: labels.lightMode })
|
|
2093
2106
|
]
|
|
2094
2107
|
}
|
|
2095
2108
|
),
|
|
2096
|
-
/* @__PURE__ */ (0,
|
|
2109
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2097
2110
|
DropdownMenuItem,
|
|
2098
2111
|
{
|
|
2099
2112
|
onClick: () => callbacks.onThemeChange?.("dark"),
|
|
2100
2113
|
className: currentTheme === "dark" ? "bg-accent" : "",
|
|
2101
2114
|
children: [
|
|
2102
|
-
/* @__PURE__ */ (0,
|
|
2103
|
-
/* @__PURE__ */ (0,
|
|
2115
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.Moon, { className: "mr-2 h-4 w-4" }),
|
|
2116
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: labels.darkMode })
|
|
2104
2117
|
]
|
|
2105
2118
|
}
|
|
2106
2119
|
),
|
|
2107
|
-
/* @__PURE__ */ (0,
|
|
2120
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2108
2121
|
DropdownMenuItem,
|
|
2109
2122
|
{
|
|
2110
2123
|
onClick: () => callbacks.onThemeChange?.("system"),
|
|
2111
2124
|
className: currentTheme === "system" ? "bg-accent" : "",
|
|
2112
2125
|
children: [
|
|
2113
|
-
/* @__PURE__ */ (0,
|
|
2114
|
-
/* @__PURE__ */ (0,
|
|
2126
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.Palette, { className: "mr-2 h-4 w-4" }),
|
|
2127
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: labels.systemTheme })
|
|
2115
2128
|
]
|
|
2116
2129
|
}
|
|
2117
2130
|
)
|
|
2118
2131
|
] }),
|
|
2119
|
-
callbacks?.onLogout && /* @__PURE__ */ (0,
|
|
2120
|
-
/* @__PURE__ */ (0,
|
|
2121
|
-
/* @__PURE__ */ (0,
|
|
2132
|
+
callbacks?.onLogout && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
2133
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DropdownMenuSeparator, {}),
|
|
2134
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2122
2135
|
DropdownMenuItem,
|
|
2123
2136
|
{
|
|
2124
2137
|
onClick: callbacks.onLogout,
|
|
2125
2138
|
className: "text-destructive focus:text-destructive focus:bg-destructive/10",
|
|
2126
2139
|
children: [
|
|
2127
|
-
/* @__PURE__ */ (0,
|
|
2128
|
-
/* @__PURE__ */ (0,
|
|
2140
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.LogOut, { className: "mr-2 h-4 w-4" }),
|
|
2141
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: labels.logout })
|
|
2129
2142
|
]
|
|
2130
2143
|
}
|
|
2131
2144
|
)
|
|
@@ -2137,7 +2150,7 @@ var UserMenu = ({
|
|
|
2137
2150
|
};
|
|
2138
2151
|
|
|
2139
2152
|
// src/components/chat/Sidebar.tsx
|
|
2140
|
-
var
|
|
2153
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2141
2154
|
var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
|
|
2142
2155
|
const [title, setTitle] = (0, import_react2.useState)("");
|
|
2143
2156
|
const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
|
|
@@ -2146,17 +2159,17 @@ var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
|
|
|
2146
2159
|
setTitle("");
|
|
2147
2160
|
setIsOpen(false);
|
|
2148
2161
|
};
|
|
2149
|
-
return /* @__PURE__ */ (0,
|
|
2150
|
-
/* @__PURE__ */ (0,
|
|
2151
|
-
/* @__PURE__ */ (0,
|
|
2162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
2163
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogTrigger, { asChild: true, children: trigger || /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Button, { className: "w-full justify-start", variant: "outline", children: [
|
|
2164
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Plus, { className: "mr-2 h-4 w-4" }),
|
|
2152
2165
|
config.labels?.newChat || "New Chat"
|
|
2153
2166
|
] }) }),
|
|
2154
|
-
/* @__PURE__ */ (0,
|
|
2155
|
-
/* @__PURE__ */ (0,
|
|
2156
|
-
/* @__PURE__ */ (0,
|
|
2157
|
-
/* @__PURE__ */ (0,
|
|
2167
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DialogContent, { children: [
|
|
2168
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DialogHeader, { children: [
|
|
2169
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogTitle, { children: config.labels?.createNewThread || "New Conversation" }),
|
|
2170
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DialogDescription, { children: "Give your new conversation a name or leave blank to auto-generate one." })
|
|
2158
2171
|
] }),
|
|
2159
|
-
/* @__PURE__ */ (0,
|
|
2172
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2160
2173
|
Input,
|
|
2161
2174
|
{
|
|
2162
2175
|
value: title,
|
|
@@ -2166,16 +2179,16 @@ var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
|
|
|
2166
2179
|
autoFocus: true
|
|
2167
2180
|
}
|
|
2168
2181
|
),
|
|
2169
|
-
/* @__PURE__ */ (0,
|
|
2170
|
-
/* @__PURE__ */ (0,
|
|
2171
|
-
/* @__PURE__ */ (0,
|
|
2182
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DialogFooter, { children: [
|
|
2183
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { variant: "outline", onClick: () => setIsOpen(false), children: config.labels?.cancel || "Cancel" }),
|
|
2184
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { onClick: handleCreate, children: config.labels?.create || "Create" })
|
|
2172
2185
|
] })
|
|
2173
2186
|
] })
|
|
2174
2187
|
] });
|
|
2175
2188
|
};
|
|
2176
2189
|
var ThreadInitialsIcon = ({ title }) => {
|
|
2177
2190
|
const initials = title?.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase() || "?";
|
|
2178
|
-
return /* @__PURE__ */ (0,
|
|
2191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex shrink-0 items-center justify-center rounded bg-muted text-[10px] font-medium", children: initials });
|
|
2179
2192
|
};
|
|
2180
2193
|
var Sidebar2 = ({
|
|
2181
2194
|
threads,
|
|
@@ -2252,38 +2265,38 @@ var Sidebar2 = ({
|
|
|
2252
2265
|
const cancelEdit = () => {
|
|
2253
2266
|
setEditingThreadId(null);
|
|
2254
2267
|
};
|
|
2255
|
-
return /* @__PURE__ */ (0,
|
|
2256
|
-
/* @__PURE__ */ (0,
|
|
2257
|
-
/* @__PURE__ */ (0,
|
|
2258
|
-
/* @__PURE__ */ (0,
|
|
2259
|
-
/* @__PURE__ */ (0,
|
|
2260
|
-
/* @__PURE__ */ (0,
|
|
2261
|
-
config.branding?.subtitle && /* @__PURE__ */ (0,
|
|
2268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Sidebar, { collapsible: "icon", ...props, children: [
|
|
2269
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SidebarHeader, { children: [
|
|
2270
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-3 px-2 py-3", children: [
|
|
2271
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex items-center justify-center shrink-0", children: config.branding?.logo || /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { className: "h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AvatarFallback, { className: "bg-primary text-primary-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Bot, { className: "h-4 w-4" }) }) }) }),
|
|
2272
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col min-w-0 group-data-[collapsible=icon]:hidden", children: [
|
|
2273
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-semibold truncate", children: config.branding?.title || "Chat" }),
|
|
2274
|
+
config.branding?.subtitle && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs text-muted-foreground truncate", children: config.branding.subtitle })
|
|
2262
2275
|
] })
|
|
2263
2276
|
] }),
|
|
2264
|
-
onCreateThread && /* @__PURE__ */ (0,
|
|
2277
|
+
onCreateThread && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2265
2278
|
CreateThreadDialog,
|
|
2266
2279
|
{
|
|
2267
2280
|
config,
|
|
2268
2281
|
onCreateThread,
|
|
2269
|
-
trigger: /* @__PURE__ */ (0,
|
|
2282
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarMenuItem, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2270
2283
|
SidebarMenuButton,
|
|
2271
2284
|
{
|
|
2272
2285
|
size: "lg",
|
|
2273
2286
|
className: "w-full justify-start gap-2 border border-sidebar-border shadow-sm hover:bg-sidebar-accent hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:justify-center",
|
|
2274
2287
|
tooltip: config.labels?.newChat || "New Chat",
|
|
2275
2288
|
children: [
|
|
2276
|
-
/* @__PURE__ */ (0,
|
|
2277
|
-
/* @__PURE__ */ (0,
|
|
2289
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Plus, { className: "size-4" }),
|
|
2290
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "group-data-[collapsible=icon]:hidden", children: config.labels?.newChat || "New Chat" })
|
|
2278
2291
|
]
|
|
2279
2292
|
}
|
|
2280
2293
|
) }) })
|
|
2281
2294
|
}
|
|
2282
2295
|
),
|
|
2283
|
-
/* @__PURE__ */ (0,
|
|
2284
|
-
/* @__PURE__ */ (0,
|
|
2285
|
-
/* @__PURE__ */ (0,
|
|
2286
|
-
/* @__PURE__ */ (0,
|
|
2296
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "px-2 py-1 mt-4", children: [
|
|
2297
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative group-data-[collapsible=icon]:hidden", children: [
|
|
2298
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Search, { className: "pointer-events-none absolute left-2 top-1/2 size-4 -translate-y-1/2 select-none opacity-50" }),
|
|
2299
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2287
2300
|
Input,
|
|
2288
2301
|
{
|
|
2289
2302
|
className: "pl-8 h-8 bg-sidebar-accent/50 border-sidebar-border focus-visible:ring-1 focus-visible:ring-sidebar-ring",
|
|
@@ -2293,7 +2306,7 @@ var Sidebar2 = ({
|
|
|
2293
2306
|
}
|
|
2294
2307
|
)
|
|
2295
2308
|
] }),
|
|
2296
|
-
/* @__PURE__ */ (0,
|
|
2309
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "hidden group-data-[collapsible=icon]:flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2297
2310
|
Button,
|
|
2298
2311
|
{
|
|
2299
2312
|
variant: "ghost",
|
|
@@ -2301,13 +2314,13 @@ var Sidebar2 = ({
|
|
|
2301
2314
|
className: "h-7 w-7",
|
|
2302
2315
|
onClick: () => setOpen(true),
|
|
2303
2316
|
title: config.labels?.search || "Search",
|
|
2304
|
-
children: /* @__PURE__ */ (0,
|
|
2317
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Search, { className: "h-4 w-4" })
|
|
2305
2318
|
}
|
|
2306
2319
|
) })
|
|
2307
2320
|
] })
|
|
2308
2321
|
] }),
|
|
2309
|
-
/* @__PURE__ */ (0,
|
|
2310
|
-
threads.some((t) => t.isArchived) && /* @__PURE__ */ (0,
|
|
2322
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SidebarContent, { children: [
|
|
2323
|
+
threads.some((t) => t.isArchived) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "px-4 py-2 mt-2 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2311
2324
|
Button,
|
|
2312
2325
|
{
|
|
2313
2326
|
variant: "ghost",
|
|
@@ -2315,18 +2328,18 @@ var Sidebar2 = ({
|
|
|
2315
2328
|
onClick: () => setShowArchived(!showArchived),
|
|
2316
2329
|
className: "h-6 text-xs w-full justify-start text-muted-foreground",
|
|
2317
2330
|
children: [
|
|
2318
|
-
/* @__PURE__ */ (0,
|
|
2331
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Filter, { className: "mr-2 h-3 w-3" }),
|
|
2319
2332
|
showArchived ? config.labels?.hideArchived || "Hide Archived" : config.labels?.showArchived || "Show Archived"
|
|
2320
2333
|
]
|
|
2321
2334
|
}
|
|
2322
2335
|
) }),
|
|
2323
|
-
Object.keys(groupedThreads).length === 0 ? /* @__PURE__ */ (0,
|
|
2324
|
-
/* @__PURE__ */ (0,
|
|
2325
|
-
/* @__PURE__ */ (0,
|
|
2326
|
-
] }) : Object.entries(groupedThreads).map(([group, groupThreads]) => /* @__PURE__ */ (0,
|
|
2327
|
-
/* @__PURE__ */ (0,
|
|
2328
|
-
/* @__PURE__ */ (0,
|
|
2329
|
-
editingThreadId === thread.id ? /* @__PURE__ */ (0,
|
|
2336
|
+
Object.keys(groupedThreads).length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "px-4 py-8 text-center text-muted-foreground group-data-[collapsible=icon]:hidden", children: [
|
|
2337
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "mx-auto h-8 w-8 mb-2 flex items-center justify-center rounded-full bg-muted/50", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Plus, { className: "h-4 w-4 opacity-50" }) }),
|
|
2338
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-xs", children: searchQuery ? config.labels?.noThreadsFound || "No conversations found" : config.labels?.noThreadsYet || "No conversations yet" })
|
|
2339
|
+
] }) : Object.entries(groupedThreads).map(([group, groupThreads]) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SidebarGroup, { className: "mt-2", children: [
|
|
2340
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarGroupLabel, { className: "group-data-[collapsible=icon]:hidden", children: group }),
|
|
2341
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarGroupContent, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarMenu, { children: groupThreads.map((thread) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SidebarMenuItem, { children: [
|
|
2342
|
+
editingThreadId === thread.id ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex items-center gap-1 px-2 py-1", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2330
2343
|
Input,
|
|
2331
2344
|
{
|
|
2332
2345
|
ref: inputRef,
|
|
@@ -2339,42 +2352,42 @@ var Sidebar2 = ({
|
|
|
2339
2352
|
onBlur: saveEdit,
|
|
2340
2353
|
className: "h-7 text-sm"
|
|
2341
2354
|
}
|
|
2342
|
-
) }) : /* @__PURE__ */ (0,
|
|
2355
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2343
2356
|
SidebarMenuButton,
|
|
2344
2357
|
{
|
|
2345
2358
|
isActive: currentThreadId === thread.id,
|
|
2346
2359
|
onClick: () => onSelectThread?.(thread.id),
|
|
2347
2360
|
tooltip: thread.title,
|
|
2348
2361
|
children: [
|
|
2349
|
-
/* @__PURE__ */ (0,
|
|
2350
|
-
/* @__PURE__ */ (0,
|
|
2351
|
-
thread.isArchived && /* @__PURE__ */ (0,
|
|
2362
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ThreadInitialsIcon, { title: thread.title || "?" }),
|
|
2363
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex flex-col items-start gap-0.5 flex-1 min-w-0 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "truncate w-full", children: thread.title || "New Chat" }) }),
|
|
2364
|
+
thread.isArchived && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Archive, { className: "ml-auto h-3 w-3 opacity-50 group-data-[collapsible=icon]:hidden" })
|
|
2352
2365
|
]
|
|
2353
2366
|
}
|
|
2354
2367
|
),
|
|
2355
|
-
!editingThreadId && /* @__PURE__ */ (0,
|
|
2356
|
-
/* @__PURE__ */ (0,
|
|
2357
|
-
/* @__PURE__ */ (0,
|
|
2358
|
-
/* @__PURE__ */ (0,
|
|
2368
|
+
!editingThreadId && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenu, { children: [
|
|
2369
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(SidebarMenuAction, { showOnHover: true, children: [
|
|
2370
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.MoreHorizontal, {}),
|
|
2371
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: "More" })
|
|
2359
2372
|
] }) }),
|
|
2360
|
-
/* @__PURE__ */ (0,
|
|
2361
|
-
/* @__PURE__ */ (0,
|
|
2362
|
-
/* @__PURE__ */ (0,
|
|
2363
|
-
/* @__PURE__ */ (0,
|
|
2373
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuContent, { className: "w-48", side: "right", align: "start", children: [
|
|
2374
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: () => startEditing(thread), children: [
|
|
2375
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Edit2, { className: "mr-2 h-4 w-4" }),
|
|
2376
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: config.labels?.renameThread || "Rename" })
|
|
2364
2377
|
] }),
|
|
2365
|
-
/* @__PURE__ */ (0,
|
|
2366
|
-
/* @__PURE__ */ (0,
|
|
2367
|
-
/* @__PURE__ */ (0,
|
|
2378
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownMenuItem, { onClick: () => onArchiveThread?.(thread.id), children: [
|
|
2379
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Archive, { className: "mr-2 h-4 w-4" }),
|
|
2380
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: thread.isArchived ? config.labels?.unarchiveThread || "Unarchive" : config.labels?.archiveThread || "Archive" })
|
|
2368
2381
|
] }),
|
|
2369
|
-
/* @__PURE__ */ (0,
|
|
2370
|
-
/* @__PURE__ */ (0,
|
|
2382
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuSeparator, {}),
|
|
2383
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2371
2384
|
DropdownMenuItem,
|
|
2372
2385
|
{
|
|
2373
2386
|
onClick: () => setDeleteThreadId(thread.id),
|
|
2374
2387
|
className: "text-destructive focus:text-destructive",
|
|
2375
2388
|
children: [
|
|
2376
|
-
/* @__PURE__ */ (0,
|
|
2377
|
-
/* @__PURE__ */ (0,
|
|
2389
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.Trash2, { className: "mr-2 h-4 w-4" }),
|
|
2390
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: config.labels?.deleteThread || "Delete" })
|
|
2378
2391
|
]
|
|
2379
2392
|
}
|
|
2380
2393
|
)
|
|
@@ -2383,7 +2396,7 @@ var Sidebar2 = ({
|
|
|
2383
2396
|
] }, thread.id)) }) })
|
|
2384
2397
|
] }, group))
|
|
2385
2398
|
] }),
|
|
2386
|
-
/* @__PURE__ */ (0,
|
|
2399
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2387
2400
|
UserMenu,
|
|
2388
2401
|
{
|
|
2389
2402
|
user,
|
|
@@ -2394,15 +2407,15 @@ var Sidebar2 = ({
|
|
|
2394
2407
|
additionalItems: userMenuAdditionalItems
|
|
2395
2408
|
}
|
|
2396
2409
|
) }),
|
|
2397
|
-
/* @__PURE__ */ (0,
|
|
2398
|
-
deleteThreadId && /* @__PURE__ */ (0,
|
|
2399
|
-
/* @__PURE__ */ (0,
|
|
2400
|
-
/* @__PURE__ */ (0,
|
|
2401
|
-
/* @__PURE__ */ (0,
|
|
2410
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SidebarRail, {}),
|
|
2411
|
+
deleteThreadId && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AlertDialog, { open: !!deleteThreadId, onOpenChange: () => setDeleteThreadId(null), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(AlertDialogContent, { children: [
|
|
2412
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(AlertDialogHeader, { children: [
|
|
2413
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AlertDialogTitle, { children: config.labels?.deleteConfirmTitle || "Delete Conversation" }),
|
|
2414
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AlertDialogDescription, { children: config.labels?.deleteConfirmDescription || "Are you sure you want to delete this conversation? This action cannot be undone." })
|
|
2402
2415
|
] }),
|
|
2403
|
-
/* @__PURE__ */ (0,
|
|
2404
|
-
/* @__PURE__ */ (0,
|
|
2405
|
-
/* @__PURE__ */ (0,
|
|
2416
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(AlertDialogFooter, { children: [
|
|
2417
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AlertDialogCancel, { children: config.labels?.cancel || "Cancel" }),
|
|
2418
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2406
2419
|
AlertDialogAction,
|
|
2407
2420
|
{
|
|
2408
2421
|
onClick: () => deleteThreadId && handleDeleteThread(deleteThreadId),
|
|
@@ -2418,7 +2431,7 @@ var Sidebar2 = ({
|
|
|
2418
2431
|
// src/components/chat/ChatHeader.tsx
|
|
2419
2432
|
var import_react3 = __toESM(require("react"), 1);
|
|
2420
2433
|
var import_lucide_react8 = require("lucide-react");
|
|
2421
|
-
var
|
|
2434
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2422
2435
|
var ChatHeader = ({
|
|
2423
2436
|
config,
|
|
2424
2437
|
currentThreadTitle,
|
|
@@ -2486,52 +2499,52 @@ var ChatHeader = ({
|
|
|
2486
2499
|
};
|
|
2487
2500
|
const selectedAgent = agentOptions.find((agent) => agent.id === selectedAgentId) || null;
|
|
2488
2501
|
const agentPlaceholder = config.agentSelector?.label || "Select agent";
|
|
2489
|
-
return /* @__PURE__ */ (0,
|
|
2502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2490
2503
|
Card,
|
|
2491
2504
|
{
|
|
2492
2505
|
"data-chat-header": true,
|
|
2493
2506
|
className: `py-0 border-b rounded-none relative z-10 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80 ${className}`,
|
|
2494
2507
|
style: isMobile ? { paddingTop: "env(safe-area-inset-top)" } : void 0,
|
|
2495
|
-
children: /* @__PURE__ */ (0,
|
|
2496
|
-
/* @__PURE__ */ (0,
|
|
2497
|
-
/* @__PURE__ */ (0,
|
|
2498
|
-
/* @__PURE__ */ (0,
|
|
2499
|
-
/* @__PURE__ */ (0,
|
|
2508
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CardHeader, { className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2509
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
2510
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
|
|
2511
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SidebarTrigger, { className: "-ml-1" }) }),
|
|
2512
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { children: config.labels?.sidebarToggle || "Toggle Sidebar" })
|
|
2500
2513
|
] }),
|
|
2501
|
-
showAgentSelector && /* @__PURE__ */ (0,
|
|
2502
|
-
/* @__PURE__ */ (0,
|
|
2514
|
+
showAgentSelector && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenu, { children: [
|
|
2515
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2503
2516
|
Button,
|
|
2504
2517
|
{
|
|
2505
2518
|
variant: "ghost",
|
|
2506
2519
|
className: "h-9 px-3 gap-1.5 font-medium text-base hover:bg-accent/50",
|
|
2507
2520
|
children: [
|
|
2508
|
-
selectedAgent?.avatarUrl ? /* @__PURE__ */ (0,
|
|
2509
|
-
/* @__PURE__ */ (0,
|
|
2510
|
-
/* @__PURE__ */ (0,
|
|
2521
|
+
selectedAgent?.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Avatar, { className: "h-5 w-5", children: [
|
|
2522
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AvatarImage, { src: selectedAgent.avatarUrl, alt: selectedAgent.name }),
|
|
2523
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AvatarFallback, { className: "text-[10px]", children: selectedAgent.name.charAt(0).toUpperCase() })
|
|
2511
2524
|
] }) : null,
|
|
2512
|
-
/* @__PURE__ */ (0,
|
|
2513
|
-
/* @__PURE__ */ (0,
|
|
2525
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "max-w-[200px] truncate", children: selectedAgent?.name || agentPlaceholder }),
|
|
2526
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.ChevronDown, { className: "h-4 w-4 opacity-50" })
|
|
2514
2527
|
]
|
|
2515
2528
|
}
|
|
2516
2529
|
) }),
|
|
2517
|
-
/* @__PURE__ */ (0,
|
|
2530
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuContent, { align: "start", className: "w-[280px]", children: agentOptions.map((agent) => {
|
|
2518
2531
|
const isSelected = agent.id === selectedAgentId;
|
|
2519
|
-
return /* @__PURE__ */ (0,
|
|
2532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2520
2533
|
DropdownMenuItem,
|
|
2521
2534
|
{
|
|
2522
2535
|
onClick: () => onSelectAgent?.(agent.id),
|
|
2523
2536
|
className: "flex items-start gap-3 p-3 cursor-pointer",
|
|
2524
2537
|
children: [
|
|
2525
|
-
agent.avatarUrl ? /* @__PURE__ */ (0,
|
|
2526
|
-
/* @__PURE__ */ (0,
|
|
2527
|
-
/* @__PURE__ */ (0,
|
|
2528
|
-
] }) : /* @__PURE__ */ (0,
|
|
2529
|
-
/* @__PURE__ */ (0,
|
|
2530
|
-
/* @__PURE__ */ (0,
|
|
2531
|
-
/* @__PURE__ */ (0,
|
|
2532
|
-
isSelected && /* @__PURE__ */ (0,
|
|
2538
|
+
agent.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Avatar, { className: "h-6 w-6 mt-0.5 shrink-0", children: [
|
|
2539
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AvatarImage, { src: agent.avatarUrl, alt: agent.name }),
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AvatarFallback, { className: "text-[10px]", children: agent.name.charAt(0).toUpperCase() })
|
|
2541
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "h-6 w-6 mt-0.5 shrink-0 flex items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Bot, { className: "h-3.5 w-3.5 text-primary" }) }),
|
|
2542
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
2543
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2544
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "font-medium text-sm", children: agent.name }),
|
|
2545
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Check, { className: "h-4 w-4 text-primary shrink-0" })
|
|
2533
2546
|
] }),
|
|
2534
|
-
agent.description && /* @__PURE__ */ (0,
|
|
2547
|
+
agent.description && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-xs text-muted-foreground mt-0.5 line-clamp-2", children: agent.description })
|
|
2535
2548
|
] })
|
|
2536
2549
|
]
|
|
2537
2550
|
},
|
|
@@ -2539,59 +2552,59 @@ var ChatHeader = ({
|
|
|
2539
2552
|
);
|
|
2540
2553
|
}) })
|
|
2541
2554
|
] }),
|
|
2542
|
-
!showAgentSelector && isMobile && /* @__PURE__ */ (0,
|
|
2555
|
+
!showAgentSelector && isMobile && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm font-medium truncate max-w-[150px] ml-2", children: currentThreadTitle || config.branding?.title || "Chat" })
|
|
2543
2556
|
] }),
|
|
2544
|
-
/* @__PURE__ */ (0,
|
|
2545
|
-
/* @__PURE__ */ (0,
|
|
2546
|
-
showCustomComponentButton && config.customComponent && /* @__PURE__ */ (0,
|
|
2547
|
-
/* @__PURE__ */ (0,
|
|
2557
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex-1" }),
|
|
2558
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
2559
|
+
showCustomComponentButton && config.customComponent && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
|
|
2560
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2548
2561
|
Button,
|
|
2549
2562
|
{
|
|
2550
2563
|
variant: "ghost",
|
|
2551
2564
|
size: "icon",
|
|
2552
2565
|
className: "h-8 w-8",
|
|
2553
2566
|
onClick: onCustomComponentToggle,
|
|
2554
|
-
children: config.customComponent.icon || /* @__PURE__ */ (0,
|
|
2567
|
+
children: config.customComponent.icon || /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Menu, { className: "h-4 w-4" })
|
|
2555
2568
|
}
|
|
2556
2569
|
) }),
|
|
2557
|
-
/* @__PURE__ */ (0,
|
|
2570
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { children: config.customComponent.label || config.labels?.customComponentToggle || "Toggle" })
|
|
2558
2571
|
] }),
|
|
2559
2572
|
config.headerActions,
|
|
2560
|
-
/* @__PURE__ */ (0,
|
|
2561
|
-
/* @__PURE__ */ (0,
|
|
2562
|
-
/* @__PURE__ */ (0,
|
|
2563
|
-
onNewThread && /* @__PURE__ */ (0,
|
|
2564
|
-
/* @__PURE__ */ (0,
|
|
2565
|
-
/* @__PURE__ */ (0,
|
|
2573
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenu, { children: [
|
|
2574
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button, { variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.MoreVertical, { className: "h-4 w-4" }) }) }),
|
|
2575
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuContent, { align: "end", children: [
|
|
2576
|
+
onNewThread && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
2577
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuItem, { onClick: () => onNewThread?.(), className: "font-medium text-primary", children: [
|
|
2578
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Plus, { className: "h-4 w-4 mr-2" }),
|
|
2566
2579
|
config.labels?.newThread || "New Thread"
|
|
2567
2580
|
] }),
|
|
2568
|
-
/* @__PURE__ */ (0,
|
|
2581
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuSeparator, {})
|
|
2569
2582
|
] }),
|
|
2570
|
-
onExportData && /* @__PURE__ */ (0,
|
|
2571
|
-
/* @__PURE__ */ (0,
|
|
2583
|
+
onExportData && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuItem, { onClick: onExportData, children: [
|
|
2584
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Download, { className: "h-4 w-4 mr-2" }),
|
|
2572
2585
|
config.labels?.exportData || "Export Data"
|
|
2573
2586
|
] }),
|
|
2574
|
-
onImportData && /* @__PURE__ */ (0,
|
|
2575
|
-
/* @__PURE__ */ (0,
|
|
2587
|
+
onImportData && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuItem, { onClick: handleImportClick, children: [
|
|
2588
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Upload, { className: "h-4 w-4 mr-2" }),
|
|
2576
2589
|
config.labels?.importData || "Import Data"
|
|
2577
2590
|
] }),
|
|
2578
|
-
(onExportData || onImportData) && /* @__PURE__ */ (0,
|
|
2579
|
-
/* @__PURE__ */ (0,
|
|
2580
|
-
/* @__PURE__ */ (0,
|
|
2591
|
+
(onExportData || onImportData) && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuSeparator, {}),
|
|
2592
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuItem, { onClick: toggleDarkMode, children: isDarkMode ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
2593
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Sun, { className: "h-4 w-4 mr-2" }),
|
|
2581
2594
|
config.labels?.lightMode || "Light Mode"
|
|
2582
|
-
] }) : /* @__PURE__ */ (0,
|
|
2583
|
-
/* @__PURE__ */ (0,
|
|
2595
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
2596
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Moon, { className: "h-4 w-4 mr-2" }),
|
|
2584
2597
|
config.labels?.darkMode || "Dark Mode"
|
|
2585
2598
|
] }) }),
|
|
2586
|
-
onClearAll && /* @__PURE__ */ (0,
|
|
2587
|
-
/* @__PURE__ */ (0,
|
|
2588
|
-
/* @__PURE__ */ (0,
|
|
2599
|
+
onClearAll && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
2600
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuSeparator, {}),
|
|
2601
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2589
2602
|
DropdownMenuItem,
|
|
2590
2603
|
{
|
|
2591
2604
|
onClick: onClearAll,
|
|
2592
2605
|
className: "text-destructive",
|
|
2593
2606
|
children: [
|
|
2594
|
-
/* @__PURE__ */ (0,
|
|
2607
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Trash2, { className: "h-4 w-4 mr-2" }),
|
|
2595
2608
|
config.labels?.clearAll || "Clear All"
|
|
2596
2609
|
]
|
|
2597
2610
|
}
|
|
@@ -2610,7 +2623,7 @@ var import_react5 = require("react");
|
|
|
2610
2623
|
|
|
2611
2624
|
// src/components/chat/UserContext.tsx
|
|
2612
2625
|
var import_react4 = require("react");
|
|
2613
|
-
var
|
|
2626
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2614
2627
|
var Ctx = (0, import_react4.createContext)(void 0);
|
|
2615
2628
|
var ChatUserContextProvider = ({ children, initial }) => {
|
|
2616
2629
|
const [ctx, setCtx] = (0, import_react4.useState)(() => ({
|
|
@@ -2636,7 +2649,7 @@ var ChatUserContextProvider = ({ children, initial }) => {
|
|
|
2636
2649
|
setContext: setPartial,
|
|
2637
2650
|
resetContext: () => setCtx({ updatedAt: Date.now() })
|
|
2638
2651
|
}), [ctx, setPartial]);
|
|
2639
|
-
return /* @__PURE__ */ (0,
|
|
2652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Ctx.Provider, { value, children });
|
|
2640
2653
|
};
|
|
2641
2654
|
function useChatUserContext() {
|
|
2642
2655
|
const v = (0, import_react4.useContext)(Ctx);
|
|
@@ -2646,13 +2659,13 @@ function useChatUserContext() {
|
|
|
2646
2659
|
|
|
2647
2660
|
// src/components/ui/progress.tsx
|
|
2648
2661
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"), 1);
|
|
2649
|
-
var
|
|
2662
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2650
2663
|
function Progress({
|
|
2651
2664
|
className,
|
|
2652
2665
|
value,
|
|
2653
2666
|
...props
|
|
2654
2667
|
}) {
|
|
2655
|
-
return /* @__PURE__ */ (0,
|
|
2668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2656
2669
|
ProgressPrimitive.Root,
|
|
2657
2670
|
{
|
|
2658
2671
|
"data-slot": "progress",
|
|
@@ -2661,7 +2674,7 @@ function Progress({
|
|
|
2661
2674
|
className
|
|
2662
2675
|
),
|
|
2663
2676
|
...props,
|
|
2664
|
-
children: /* @__PURE__ */ (0,
|
|
2677
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2665
2678
|
ProgressPrimitive.Indicator,
|
|
2666
2679
|
{
|
|
2667
2680
|
"data-slot": "progress-indicator",
|
|
@@ -2675,7 +2688,7 @@ function Progress({
|
|
|
2675
2688
|
|
|
2676
2689
|
// src/components/chat/ChatInput.tsx
|
|
2677
2690
|
var import_lucide_react9 = require("lucide-react");
|
|
2678
|
-
var
|
|
2691
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2679
2692
|
var FileUploadItem = (0, import_react5.memo)(function FileUploadItem2({ file, progress, onCancel }) {
|
|
2680
2693
|
const guessTypeFromName = (name) => {
|
|
2681
2694
|
const ext = (name || "").split(".").pop()?.toLowerCase();
|
|
@@ -2704,10 +2717,10 @@ var FileUploadItem = (0, import_react5.memo)(function FileUploadItem2({ file, pr
|
|
|
2704
2717
|
};
|
|
2705
2718
|
const getFileIcon = (type, name) => {
|
|
2706
2719
|
const t = typeof type === "string" && type.length > 0 ? type : guessTypeFromName(name);
|
|
2707
|
-
if (t.startsWith("image/")) return /* @__PURE__ */ (0,
|
|
2708
|
-
if (t.startsWith("video/")) return /* @__PURE__ */ (0,
|
|
2709
|
-
if (t.startsWith("audio/")) return /* @__PURE__ */ (0,
|
|
2710
|
-
return /* @__PURE__ */ (0,
|
|
2720
|
+
if (t.startsWith("image/")) return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Image, { className: "h-4 w-4" });
|
|
2721
|
+
if (t.startsWith("video/")) return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Video, { className: "h-4 w-4" });
|
|
2722
|
+
if (t.startsWith("audio/")) return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Mic, { className: "h-4 w-4" });
|
|
2723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.FileText, { className: "h-4 w-4" });
|
|
2711
2724
|
};
|
|
2712
2725
|
const formatFileSize = (bytes) => {
|
|
2713
2726
|
if (bytes === 0) return "0 Bytes";
|
|
@@ -2716,21 +2729,21 @@ var FileUploadItem = (0, import_react5.memo)(function FileUploadItem2({ file, pr
|
|
|
2716
2729
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
2717
2730
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
|
|
2718
2731
|
};
|
|
2719
|
-
return /* @__PURE__ */ (0,
|
|
2732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Card, { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardContent, { className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
2720
2733
|
getFileIcon(file.type, file.name),
|
|
2721
|
-
/* @__PURE__ */ (0,
|
|
2722
|
-
/* @__PURE__ */ (0,
|
|
2723
|
-
/* @__PURE__ */ (0,
|
|
2724
|
-
/* @__PURE__ */ (0,
|
|
2734
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
2735
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-sm font-medium truncate", children: file.name }),
|
|
2736
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs text-muted-foreground", children: formatFileSize(file.size ?? 0) }),
|
|
2737
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Progress, { value: progress, className: "h-1 mt-1" })
|
|
2725
2738
|
] }),
|
|
2726
|
-
/* @__PURE__ */ (0,
|
|
2739
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2727
2740
|
Button,
|
|
2728
2741
|
{
|
|
2729
2742
|
variant: "ghost",
|
|
2730
2743
|
size: "icon",
|
|
2731
2744
|
className: "h-6 w-6",
|
|
2732
2745
|
onClick: onCancel,
|
|
2733
|
-
children: /* @__PURE__ */ (0,
|
|
2746
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
|
|
2734
2747
|
}
|
|
2735
2748
|
)
|
|
2736
2749
|
] }) }) });
|
|
@@ -2754,9 +2767,9 @@ var AttachmentPreview = (0, import_react5.memo)(function AttachmentPreview2({ at
|
|
|
2754
2767
|
const minutes = Math.floor(seconds / 60);
|
|
2755
2768
|
return `${minutes}:${(seconds % 60).toString().padStart(2, "0")}`;
|
|
2756
2769
|
};
|
|
2757
|
-
return /* @__PURE__ */ (0,
|
|
2758
|
-
attachment.kind === "image" && /* @__PURE__ */ (0,
|
|
2759
|
-
/* @__PURE__ */ (0,
|
|
2770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Card, { className: "relative group", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(CardContent, { className: "p-2", children: [
|
|
2771
|
+
attachment.kind === "image" && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "relative", children: [
|
|
2772
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2760
2773
|
"img",
|
|
2761
2774
|
{
|
|
2762
2775
|
src: attachment.dataUrl,
|
|
@@ -2764,19 +2777,19 @@ var AttachmentPreview = (0, import_react5.memo)(function AttachmentPreview2({ at
|
|
|
2764
2777
|
className: "w-full h-20 object-cover rounded"
|
|
2765
2778
|
}
|
|
2766
2779
|
),
|
|
2767
|
-
/* @__PURE__ */ (0,
|
|
2780
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity rounded flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2768
2781
|
Button,
|
|
2769
2782
|
{
|
|
2770
2783
|
variant: "destructive",
|
|
2771
2784
|
size: "icon",
|
|
2772
2785
|
className: "h-6 w-6",
|
|
2773
2786
|
onClick: onRemove,
|
|
2774
|
-
children: /* @__PURE__ */ (0,
|
|
2787
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
|
|
2775
2788
|
}
|
|
2776
2789
|
) })
|
|
2777
2790
|
] }),
|
|
2778
|
-
attachment.kind === "video" && /* @__PURE__ */ (0,
|
|
2779
|
-
/* @__PURE__ */ (0,
|
|
2791
|
+
attachment.kind === "video" && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "relative", children: [
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2780
2793
|
"video",
|
|
2781
2794
|
{
|
|
2782
2795
|
src: attachment.dataUrl,
|
|
@@ -2785,34 +2798,34 @@ var AttachmentPreview = (0, import_react5.memo)(function AttachmentPreview2({ at
|
|
|
2785
2798
|
muted: true
|
|
2786
2799
|
}
|
|
2787
2800
|
),
|
|
2788
|
-
/* @__PURE__ */ (0,
|
|
2801
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity rounded flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2789
2802
|
Button,
|
|
2790
2803
|
{
|
|
2791
2804
|
variant: "destructive",
|
|
2792
2805
|
size: "icon",
|
|
2793
2806
|
className: "h-6 w-6",
|
|
2794
2807
|
onClick: onRemove,
|
|
2795
|
-
children: /* @__PURE__ */ (0,
|
|
2808
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
|
|
2796
2809
|
}
|
|
2797
2810
|
) }),
|
|
2798
|
-
/* @__PURE__ */ (0,
|
|
2811
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Badge, { className: "absolute bottom-1 right-1 text-xs", children: formatDuration(attachment.durationMs) })
|
|
2799
2812
|
] }),
|
|
2800
|
-
attachment.kind === "audio" && /* @__PURE__ */ (0,
|
|
2801
|
-
/* @__PURE__ */ (0,
|
|
2813
|
+
attachment.kind === "audio" && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2 p-2", children: [
|
|
2814
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2802
2815
|
Button,
|
|
2803
2816
|
{
|
|
2804
2817
|
variant: "outline",
|
|
2805
2818
|
size: "icon",
|
|
2806
2819
|
className: "h-8 w-8",
|
|
2807
2820
|
onClick: handlePlayPause,
|
|
2808
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
2821
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Pause, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Play, { className: "h-3 w-3" })
|
|
2809
2822
|
}
|
|
2810
2823
|
),
|
|
2811
|
-
/* @__PURE__ */ (0,
|
|
2812
|
-
/* @__PURE__ */ (0,
|
|
2813
|
-
/* @__PURE__ */ (0,
|
|
2824
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex-1", children: [
|
|
2825
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs font-medium", children: attachment.fileName || "\xC1udio" }),
|
|
2826
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs text-muted-foreground", children: formatDuration(attachment.durationMs) })
|
|
2814
2827
|
] }),
|
|
2815
|
-
/* @__PURE__ */ (0,
|
|
2828
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2816
2829
|
"audio",
|
|
2817
2830
|
{
|
|
2818
2831
|
ref: audioRef,
|
|
@@ -2822,18 +2835,18 @@ var AttachmentPreview = (0, import_react5.memo)(function AttachmentPreview2({ at
|
|
|
2822
2835
|
onEnded: () => setIsPlaying(false)
|
|
2823
2836
|
}
|
|
2824
2837
|
),
|
|
2825
|
-
/* @__PURE__ */ (0,
|
|
2838
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2826
2839
|
Button,
|
|
2827
2840
|
{
|
|
2828
2841
|
variant: "ghost",
|
|
2829
2842
|
size: "icon",
|
|
2830
2843
|
className: "h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
2831
2844
|
onClick: onRemove,
|
|
2832
|
-
children: /* @__PURE__ */ (0,
|
|
2845
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.X, { className: "h-3 w-3" })
|
|
2833
2846
|
}
|
|
2834
2847
|
)
|
|
2835
2848
|
] }),
|
|
2836
|
-
attachment.fileName && attachment.kind !== "audio" && /* @__PURE__ */ (0,
|
|
2849
|
+
attachment.fileName && attachment.kind !== "audio" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "absolute bottom-0 left-0 right-0 bg-black/70 text-white text-xs p-1 rounded-b", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "truncate", children: attachment.fileName }) })
|
|
2837
2850
|
] }) });
|
|
2838
2851
|
});
|
|
2839
2852
|
var AudioRecorder = (0, import_react5.memo)(function AudioRecorder2({ isRecording, onStartRecording, onStopRecording, onCancel, recordingDuration, config }) {
|
|
@@ -2843,47 +2856,47 @@ var AudioRecorder = (0, import_react5.memo)(function AudioRecorder2({ isRecordin
|
|
|
2843
2856
|
return `${mins}:${secs.toString().padStart(2, "0")}`;
|
|
2844
2857
|
};
|
|
2845
2858
|
if (!isRecording) {
|
|
2846
|
-
return /* @__PURE__ */ (0,
|
|
2847
|
-
/* @__PURE__ */ (0,
|
|
2859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
2860
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2848
2861
|
Button,
|
|
2849
2862
|
{
|
|
2850
2863
|
variant: "outline",
|
|
2851
2864
|
size: "icon",
|
|
2852
2865
|
onClick: onStartRecording,
|
|
2853
2866
|
className: "h-10 w-10",
|
|
2854
|
-
children: /* @__PURE__ */ (0,
|
|
2867
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Mic, { className: "h-4 w-4" })
|
|
2855
2868
|
}
|
|
2856
2869
|
) }),
|
|
2857
|
-
/* @__PURE__ */ (0,
|
|
2870
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { children: config?.labels?.recordAudioTooltip })
|
|
2858
2871
|
] });
|
|
2859
2872
|
}
|
|
2860
|
-
return /* @__PURE__ */ (0,
|
|
2861
|
-
/* @__PURE__ */ (0,
|
|
2862
|
-
/* @__PURE__ */ (0,
|
|
2863
|
-
/* @__PURE__ */ (0,
|
|
2873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Card, { className: "border-red-200 bg-red-50 dark:border-red-800 dark:bg-red-950", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardContent, { className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
2874
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2875
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "h-3 w-3 bg-red-500 rounded-full animate-pulse" }),
|
|
2876
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-sm font-medium text-red-700 dark:text-red-300", children: "Gravando" })
|
|
2864
2877
|
] }),
|
|
2865
|
-
/* @__PURE__ */ (0,
|
|
2866
|
-
/* @__PURE__ */ (0,
|
|
2867
|
-
/* @__PURE__ */ (0,
|
|
2878
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Badge, { variant: "outline", className: "text-xs", children: formatTime(recordingDuration) }),
|
|
2879
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex gap-1 ml-auto", children: [
|
|
2880
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2868
2881
|
Button,
|
|
2869
2882
|
{
|
|
2870
2883
|
variant: "outline",
|
|
2871
2884
|
size: "sm",
|
|
2872
2885
|
onClick: onCancel,
|
|
2873
2886
|
children: [
|
|
2874
|
-
/* @__PURE__ */ (0,
|
|
2887
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.X, { className: "h-3 w-3 mr-1" }),
|
|
2875
2888
|
"Cancelar"
|
|
2876
2889
|
]
|
|
2877
2890
|
}
|
|
2878
2891
|
),
|
|
2879
|
-
/* @__PURE__ */ (0,
|
|
2892
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2880
2893
|
Button,
|
|
2881
2894
|
{
|
|
2882
2895
|
variant: "default",
|
|
2883
2896
|
size: "sm",
|
|
2884
2897
|
onClick: onStopRecording,
|
|
2885
2898
|
children: [
|
|
2886
|
-
/* @__PURE__ */ (0,
|
|
2899
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Square, { className: "h-3 w-3 mr-1" }),
|
|
2887
2900
|
"Parar"
|
|
2888
2901
|
]
|
|
2889
2902
|
}
|
|
@@ -3109,8 +3122,8 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3109
3122
|
onAttachmentsChange(newAttachments);
|
|
3110
3123
|
};
|
|
3111
3124
|
const canAddMoreAttachments = attachments.length < maxAttachments;
|
|
3112
|
-
return /* @__PURE__ */ (0,
|
|
3113
|
-
uploadProgress.size > 0 && /* @__PURE__ */ (0,
|
|
3125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: `border-t py-0 bg-transparent ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "px-0 md:p-2 pb-1 space-y-4 bg-transparent", children: [
|
|
3126
|
+
uploadProgress.size > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "space-y-2", children: Array.from(uploadProgress.entries()).map(([id, progress]) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3114
3127
|
FileUploadItem,
|
|
3115
3128
|
{
|
|
3116
3129
|
file: { name: progress.fileName },
|
|
@@ -3125,7 +3138,7 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3125
3138
|
},
|
|
3126
3139
|
id
|
|
3127
3140
|
)) }),
|
|
3128
|
-
isRecording && /* @__PURE__ */ (0,
|
|
3141
|
+
isRecording && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3129
3142
|
AudioRecorder,
|
|
3130
3143
|
{
|
|
3131
3144
|
isRecording,
|
|
@@ -3136,7 +3149,7 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3136
3149
|
config
|
|
3137
3150
|
}
|
|
3138
3151
|
),
|
|
3139
|
-
attachments.length > 0 && /* @__PURE__ */ (0,
|
|
3152
|
+
attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "grid grid-cols-4 gap-2", children: attachments.map((attachment, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3140
3153
|
AttachmentPreview,
|
|
3141
3154
|
{
|
|
3142
3155
|
attachment,
|
|
@@ -3144,15 +3157,15 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3144
3157
|
},
|
|
3145
3158
|
index
|
|
3146
3159
|
)) }),
|
|
3147
|
-
/* @__PURE__ */ (0,
|
|
3160
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("form", { onSubmit: handleSubmit, className: "mb-1 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3148
3161
|
"div",
|
|
3149
3162
|
{
|
|
3150
3163
|
className: "flex items-end gap-2 p-3 border rounded-lg bg-background w-full md:min-w-3xl max-w-3xl",
|
|
3151
3164
|
onDrop: handleDrop,
|
|
3152
3165
|
onDragOver: handleDragOver,
|
|
3153
3166
|
children: [
|
|
3154
|
-
enableFileUpload && canAddMoreAttachments && /* @__PURE__ */ (0,
|
|
3155
|
-
/* @__PURE__ */ (0,
|
|
3167
|
+
enableFileUpload && canAddMoreAttachments && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
3168
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3156
3169
|
"input",
|
|
3157
3170
|
{
|
|
3158
3171
|
ref: fileInputRef,
|
|
@@ -3163,8 +3176,8 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3163
3176
|
className: "hidden"
|
|
3164
3177
|
}
|
|
3165
3178
|
),
|
|
3166
|
-
/* @__PURE__ */ (0,
|
|
3167
|
-
/* @__PURE__ */ (0,
|
|
3179
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
3180
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3168
3181
|
Button,
|
|
3169
3182
|
{
|
|
3170
3183
|
type: "button",
|
|
@@ -3177,13 +3190,13 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3177
3190
|
fileInputRef.current?.click();
|
|
3178
3191
|
},
|
|
3179
3192
|
disabled,
|
|
3180
|
-
children: /* @__PURE__ */ (0,
|
|
3193
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Paperclip, { className: "h-4 w-4" })
|
|
3181
3194
|
}
|
|
3182
3195
|
) }),
|
|
3183
|
-
/* @__PURE__ */ (0,
|
|
3196
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { children: config?.labels?.attachFileTooltip })
|
|
3184
3197
|
] })
|
|
3185
3198
|
] }),
|
|
3186
|
-
/* @__PURE__ */ (0,
|
|
3199
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3187
3200
|
Textarea,
|
|
3188
3201
|
{
|
|
3189
3202
|
ref: textareaRef,
|
|
@@ -3196,7 +3209,7 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3196
3209
|
rows: 1
|
|
3197
3210
|
}
|
|
3198
3211
|
) }),
|
|
3199
|
-
enableAudioRecording && !isRecording && canAddMoreAttachments && !value.trim() && /* @__PURE__ */ (0,
|
|
3212
|
+
enableAudioRecording && !isRecording && canAddMoreAttachments && !value.trim() && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3200
3213
|
AudioRecorder,
|
|
3201
3214
|
{
|
|
3202
3215
|
isRecording,
|
|
@@ -3207,8 +3220,8 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3207
3220
|
config
|
|
3208
3221
|
}
|
|
3209
3222
|
),
|
|
3210
|
-
isGenerating ? /* @__PURE__ */ (0,
|
|
3211
|
-
/* @__PURE__ */ (0,
|
|
3223
|
+
isGenerating ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
3224
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3212
3225
|
Button,
|
|
3213
3226
|
{
|
|
3214
3227
|
type: "button",
|
|
@@ -3216,36 +3229,36 @@ var ChatInput = (0, import_react5.memo)(function ChatInput2({
|
|
|
3216
3229
|
size: "icon",
|
|
3217
3230
|
className: "h-10 w-10",
|
|
3218
3231
|
onClick: onStopGeneration,
|
|
3219
|
-
children: /* @__PURE__ */ (0,
|
|
3232
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Square, { className: "h-4 w-4" })
|
|
3220
3233
|
}
|
|
3221
3234
|
) }),
|
|
3222
|
-
/* @__PURE__ */ (0,
|
|
3223
|
-
] }) : /* @__PURE__ */ (0,
|
|
3224
|
-
/* @__PURE__ */ (0,
|
|
3235
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { children: config?.labels?.stopGenerationTooltip })
|
|
3236
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Tooltip, { children: [
|
|
3237
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3225
3238
|
Button,
|
|
3226
3239
|
{
|
|
3227
3240
|
type: "submit",
|
|
3228
3241
|
size: "icon",
|
|
3229
3242
|
className: "h-10 w-10",
|
|
3230
3243
|
disabled: disabled || !value.trim() && attachments.length === 0,
|
|
3231
|
-
children: disabled ? /* @__PURE__ */ (0,
|
|
3244
|
+
children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Send, { className: "h-4 w-4" })
|
|
3232
3245
|
}
|
|
3233
3246
|
) }),
|
|
3234
|
-
/* @__PURE__ */ (0,
|
|
3247
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TooltipContent, { children: config?.labels?.sendMessageTooltip })
|
|
3235
3248
|
] })
|
|
3236
3249
|
]
|
|
3237
3250
|
}
|
|
3238
3251
|
) }),
|
|
3239
|
-
/* @__PURE__ */ (0,
|
|
3252
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "text-[10px] text-muted-foreground text-center", children: [
|
|
3240
3253
|
window.innerWidth > 768 ? config?.labels?.inputHelpText : "",
|
|
3241
|
-
attachments.length > 0 && /* @__PURE__ */ (0,
|
|
3254
|
+
attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
3242
3255
|
" \u2022 ",
|
|
3243
3256
|
attachments.length,
|
|
3244
3257
|
"/",
|
|
3245
3258
|
maxAttachments,
|
|
3246
3259
|
" anexos"
|
|
3247
3260
|
] }),
|
|
3248
|
-
config?.labels?.footerLabel && /* @__PURE__ */ (0,
|
|
3261
|
+
config?.labels?.footerLabel && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
3249
3262
|
" \u2022 ",
|
|
3250
3263
|
config.labels.footerLabel
|
|
3251
3264
|
] })
|
|
@@ -3259,16 +3272,16 @@ var import_react6 = require("react");
|
|
|
3259
3272
|
// src/components/ui/scroll-area.tsx
|
|
3260
3273
|
var React11 = __toESM(require("react"), 1);
|
|
3261
3274
|
var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"), 1);
|
|
3262
|
-
var
|
|
3275
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3263
3276
|
var ScrollArea = React11.forwardRef(({ className, children, viewportClassName, onScroll, onScrollCapture, ...props }, ref) => {
|
|
3264
|
-
return /* @__PURE__ */ (0,
|
|
3277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3265
3278
|
ScrollAreaPrimitive.Root,
|
|
3266
3279
|
{
|
|
3267
3280
|
"data-slot": "scroll-area",
|
|
3268
3281
|
className: cn("relative", className),
|
|
3269
3282
|
...props,
|
|
3270
3283
|
children: [
|
|
3271
|
-
/* @__PURE__ */ (0,
|
|
3284
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3272
3285
|
ScrollAreaPrimitive.Viewport,
|
|
3273
3286
|
{
|
|
3274
3287
|
ref,
|
|
@@ -3282,8 +3295,8 @@ var ScrollArea = React11.forwardRef(({ className, children, viewportClassName, o
|
|
|
3282
3295
|
children
|
|
3283
3296
|
}
|
|
3284
3297
|
),
|
|
3285
|
-
/* @__PURE__ */ (0,
|
|
3286
|
-
/* @__PURE__ */ (0,
|
|
3298
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ScrollBar, {}),
|
|
3299
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ScrollAreaPrimitive.Corner, {})
|
|
3287
3300
|
]
|
|
3288
3301
|
}
|
|
3289
3302
|
);
|
|
@@ -3294,7 +3307,7 @@ function ScrollBar({
|
|
|
3294
3307
|
orientation = "vertical",
|
|
3295
3308
|
...props
|
|
3296
3309
|
}) {
|
|
3297
|
-
return /* @__PURE__ */ (0,
|
|
3310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3298
3311
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
3299
3312
|
{
|
|
3300
3313
|
"data-slot": "scroll-area-scrollbar",
|
|
@@ -3306,7 +3319,7 @@ function ScrollBar({
|
|
|
3306
3319
|
className
|
|
3307
3320
|
),
|
|
3308
3321
|
...props,
|
|
3309
|
-
children: /* @__PURE__ */ (0,
|
|
3322
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3310
3323
|
ScrollAreaPrimitive.ScrollAreaThumb,
|
|
3311
3324
|
{
|
|
3312
3325
|
"data-slot": "scroll-area-thumb",
|
|
@@ -3319,7 +3332,7 @@ function ScrollBar({
|
|
|
3319
3332
|
|
|
3320
3333
|
// src/components/chat/UserProfile.tsx
|
|
3321
3334
|
var import_lucide_react10 = require("lucide-react");
|
|
3322
|
-
var
|
|
3335
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3323
3336
|
var getInitials2 = (name, email) => {
|
|
3324
3337
|
if (name) {
|
|
3325
3338
|
return name.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase();
|
|
@@ -3333,29 +3346,29 @@ var getFieldIcon = (type, key) => {
|
|
|
3333
3346
|
const iconClass = "h-4 w-4 text-muted-foreground";
|
|
3334
3347
|
switch (type) {
|
|
3335
3348
|
case "email":
|
|
3336
|
-
return /* @__PURE__ */ (0,
|
|
3349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Mail, { className: iconClass });
|
|
3337
3350
|
case "phone":
|
|
3338
|
-
return /* @__PURE__ */ (0,
|
|
3351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Phone, { className: iconClass });
|
|
3339
3352
|
case "url":
|
|
3340
|
-
return /* @__PURE__ */ (0,
|
|
3353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Globe, { className: iconClass });
|
|
3341
3354
|
case "date":
|
|
3342
|
-
return /* @__PURE__ */ (0,
|
|
3355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Calendar, { className: iconClass });
|
|
3343
3356
|
}
|
|
3344
3357
|
const lowerKey = key?.toLowerCase() || "";
|
|
3345
|
-
if (lowerKey.includes("follower")) return /* @__PURE__ */ (0,
|
|
3346
|
-
if (lowerKey.includes("following")) return /* @__PURE__ */ (0,
|
|
3347
|
-
if (lowerKey.includes("post") || lowerKey.includes("publication")) return /* @__PURE__ */ (0,
|
|
3348
|
-
if (lowerKey.includes("verified") || lowerKey.includes("badge")) return /* @__PURE__ */ (0,
|
|
3349
|
-
if (lowerKey.includes("bio")) return /* @__PURE__ */ (0,
|
|
3350
|
-
if (lowerKey.includes("email")) return /* @__PURE__ */ (0,
|
|
3351
|
-
if (lowerKey.includes("phone") || lowerKey.includes("tel")) return /* @__PURE__ */ (0,
|
|
3352
|
-
if (lowerKey.includes("location") || lowerKey.includes("address") || lowerKey.includes("city")) return /* @__PURE__ */ (0,
|
|
3353
|
-
if (lowerKey.includes("company") || lowerKey.includes("org")) return /* @__PURE__ */ (0,
|
|
3354
|
-
if (lowerKey.includes("job") || lowerKey.includes("role") || lowerKey.includes("title") || lowerKey.includes("position")) return /* @__PURE__ */ (0,
|
|
3355
|
-
if (lowerKey.includes("website") || lowerKey.includes("url") || lowerKey.includes("link")) return /* @__PURE__ */ (0,
|
|
3356
|
-
if (lowerKey.includes("username") || lowerKey.includes("handle")) return /* @__PURE__ */ (0,
|
|
3357
|
-
if (lowerKey.includes("date") || lowerKey.includes("birthday") || lowerKey.includes("joined")) return /* @__PURE__ */ (0,
|
|
3358
|
-
return /* @__PURE__ */ (0,
|
|
3358
|
+
if (lowerKey.includes("follower")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Users, { className: iconClass });
|
|
3359
|
+
if (lowerKey.includes("following")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.UserPlus, { className: iconClass });
|
|
3360
|
+
if (lowerKey.includes("post") || lowerKey.includes("publication")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Image, { className: iconClass });
|
|
3361
|
+
if (lowerKey.includes("verified") || lowerKey.includes("badge")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.BadgeCheck, { className: iconClass });
|
|
3362
|
+
if (lowerKey.includes("bio")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.FileText, { className: iconClass });
|
|
3363
|
+
if (lowerKey.includes("email")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Mail, { className: iconClass });
|
|
3364
|
+
if (lowerKey.includes("phone") || lowerKey.includes("tel")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Phone, { className: iconClass });
|
|
3365
|
+
if (lowerKey.includes("location") || lowerKey.includes("address") || lowerKey.includes("city")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.MapPin, { className: iconClass });
|
|
3366
|
+
if (lowerKey.includes("company") || lowerKey.includes("org")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Building, { className: iconClass });
|
|
3367
|
+
if (lowerKey.includes("job") || lowerKey.includes("role") || lowerKey.includes("title") || lowerKey.includes("position")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Briefcase, { className: iconClass });
|
|
3368
|
+
if (lowerKey.includes("website") || lowerKey.includes("url") || lowerKey.includes("link")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Globe, { className: iconClass });
|
|
3369
|
+
if (lowerKey.includes("username") || lowerKey.includes("handle")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.AtSign, { className: iconClass });
|
|
3370
|
+
if (lowerKey.includes("date") || lowerKey.includes("birthday") || lowerKey.includes("joined")) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Calendar, { className: iconClass });
|
|
3371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.User, { className: iconClass });
|
|
3359
3372
|
};
|
|
3360
3373
|
var formatValue = (value, type, key) => {
|
|
3361
3374
|
if (value === null || value === void 0) return "-";
|
|
@@ -3389,15 +3402,15 @@ var getMemoryCategoryIcon = (category) => {
|
|
|
3389
3402
|
const iconClass = "h-4 w-4 text-muted-foreground";
|
|
3390
3403
|
switch (category) {
|
|
3391
3404
|
case "preference":
|
|
3392
|
-
return /* @__PURE__ */ (0,
|
|
3405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Heart, { className: iconClass });
|
|
3393
3406
|
case "fact":
|
|
3394
|
-
return /* @__PURE__ */ (0,
|
|
3407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Info, { className: iconClass });
|
|
3395
3408
|
case "goal":
|
|
3396
|
-
return /* @__PURE__ */ (0,
|
|
3409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Target, { className: iconClass });
|
|
3397
3410
|
case "context":
|
|
3398
|
-
return /* @__PURE__ */ (0,
|
|
3411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Lightbulb, { className: iconClass });
|
|
3399
3412
|
default:
|
|
3400
|
-
return /* @__PURE__ */ (0,
|
|
3413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Brain, { className: iconClass });
|
|
3401
3414
|
}
|
|
3402
3415
|
};
|
|
3403
3416
|
var getMemoryCategoryLabel = (category) => {
|
|
@@ -3467,66 +3480,66 @@ var UserProfile = ({
|
|
|
3467
3480
|
const displayName = user?.name || user?.email?.split("@")[0] || "User";
|
|
3468
3481
|
const initials = getInitials2(user?.name, user?.email);
|
|
3469
3482
|
const normalizedFields = normalizeCustomFields(customFields);
|
|
3470
|
-
return /* @__PURE__ */ (0,
|
|
3483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Sheet, { open: isOpen, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3471
3484
|
SheetContent,
|
|
3472
3485
|
{
|
|
3473
3486
|
side: "right",
|
|
3474
3487
|
className: cn("w-full sm:max-w-md p-0 flex flex-col h-full overflow-hidden", className),
|
|
3475
3488
|
children: [
|
|
3476
|
-
/* @__PURE__ */ (0,
|
|
3477
|
-
/* @__PURE__ */ (0,
|
|
3478
|
-
/* @__PURE__ */ (0,
|
|
3479
|
-
/* @__PURE__ */ (0,
|
|
3480
|
-
user?.avatar && /* @__PURE__ */ (0,
|
|
3481
|
-
/* @__PURE__ */ (0,
|
|
3489
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SheetHeader, { className: "px-6 py-4 border-b shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SheetTitle, { children: labels.title }) }) }),
|
|
3490
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ScrollArea, { className: "flex-1 min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "p-6 space-y-6", children: [
|
|
3491
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col items-center text-center space-y-4", children: [
|
|
3492
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Avatar, { className: "h-24 w-24 shrink-0", children: [
|
|
3493
|
+
user?.avatar && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AvatarImage, { src: user.avatar, alt: displayName }),
|
|
3494
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AvatarFallback, { className: "text-2xl bg-primary/10 text-primary", children: initials })
|
|
3482
3495
|
] }),
|
|
3483
|
-
/* @__PURE__ */ (0,
|
|
3484
|
-
/* @__PURE__ */ (0,
|
|
3485
|
-
user?.email && /* @__PURE__ */ (0,
|
|
3496
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "w-full px-2", children: [
|
|
3497
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h2", { className: "text-xl font-semibold break-words", children: displayName }),
|
|
3498
|
+
user?.email && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm text-muted-foreground break-words", children: user.email })
|
|
3486
3499
|
] })
|
|
3487
3500
|
] }),
|
|
3488
|
-
/* @__PURE__ */ (0,
|
|
3489
|
-
/* @__PURE__ */ (0,
|
|
3490
|
-
/* @__PURE__ */ (0,
|
|
3491
|
-
/* @__PURE__ */ (0,
|
|
3492
|
-
/* @__PURE__ */ (0,
|
|
3493
|
-
/* @__PURE__ */ (0,
|
|
3494
|
-
/* @__PURE__ */ (0,
|
|
3495
|
-
/* @__PURE__ */ (0,
|
|
3496
|
-
/* @__PURE__ */ (0,
|
|
3501
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Separator, {}),
|
|
3502
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-3", children: [
|
|
3503
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: labels.basicInfo }),
|
|
3504
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-2", children: [
|
|
3505
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
|
|
3506
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.User, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
3507
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3508
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs text-muted-foreground", children: "Name" }),
|
|
3509
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm font-medium break-words", children: displayName })
|
|
3497
3510
|
] })
|
|
3498
3511
|
] }),
|
|
3499
|
-
user?.email && /* @__PURE__ */ (0,
|
|
3500
|
-
/* @__PURE__ */ (0,
|
|
3501
|
-
/* @__PURE__ */ (0,
|
|
3502
|
-
/* @__PURE__ */ (0,
|
|
3503
|
-
/* @__PURE__ */ (0,
|
|
3512
|
+
user?.email && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
|
|
3513
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.AtSign, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
3514
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3515
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs text-muted-foreground", children: "Handle" }),
|
|
3516
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm font-medium break-words", children: user.email })
|
|
3504
3517
|
] })
|
|
3505
3518
|
] }),
|
|
3506
|
-
user?.id && user.id !== user?.name && user.id !== user?.email && /* @__PURE__ */ (0,
|
|
3507
|
-
/* @__PURE__ */ (0,
|
|
3508
|
-
/* @__PURE__ */ (0,
|
|
3509
|
-
/* @__PURE__ */ (0,
|
|
3510
|
-
/* @__PURE__ */ (0,
|
|
3519
|
+
user?.id && user.id !== user?.name && user.id !== user?.email && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
|
|
3520
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.User, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
|
|
3521
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3522
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs text-muted-foreground", children: "ID" }),
|
|
3523
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm font-medium break-words", children: user.id })
|
|
3511
3524
|
] })
|
|
3512
3525
|
] })
|
|
3513
3526
|
] })
|
|
3514
3527
|
] }),
|
|
3515
|
-
normalizedFields.length > 0 && /* @__PURE__ */ (0,
|
|
3516
|
-
/* @__PURE__ */ (0,
|
|
3517
|
-
/* @__PURE__ */ (0,
|
|
3518
|
-
/* @__PURE__ */ (0,
|
|
3519
|
-
/* @__PURE__ */ (0,
|
|
3528
|
+
normalizedFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
3529
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Separator, {}),
|
|
3530
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-3", children: [
|
|
3531
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: labels.customFields }),
|
|
3532
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "space-y-2", children: normalizedFields.map((field) => {
|
|
3520
3533
|
const isBioField = field.key.toLowerCase().includes("bio");
|
|
3521
|
-
return /* @__PURE__ */ (0,
|
|
3534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3522
3535
|
"div",
|
|
3523
3536
|
{
|
|
3524
3537
|
className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50",
|
|
3525
3538
|
children: [
|
|
3526
|
-
/* @__PURE__ */ (0,
|
|
3527
|
-
/* @__PURE__ */ (0,
|
|
3528
|
-
/* @__PURE__ */ (0,
|
|
3529
|
-
/* @__PURE__ */ (0,
|
|
3539
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "mt-0.5 shrink-0", children: field.icon || getFieldIcon(field.type, field.key) }),
|
|
3540
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3541
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs text-muted-foreground", children: field.label }),
|
|
3542
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: cn(
|
|
3530
3543
|
"text-sm font-medium",
|
|
3531
3544
|
isBioField ? "whitespace-pre-wrap break-words" : "break-words"
|
|
3532
3545
|
), children: formatValue(field.value, field.type, field.key) })
|
|
@@ -3538,26 +3551,26 @@ var UserProfile = ({
|
|
|
3538
3551
|
}) })
|
|
3539
3552
|
] })
|
|
3540
3553
|
] }),
|
|
3541
|
-
/* @__PURE__ */ (0,
|
|
3542
|
-
/* @__PURE__ */ (0,
|
|
3543
|
-
/* @__PURE__ */ (0,
|
|
3544
|
-
/* @__PURE__ */ (0,
|
|
3545
|
-
/* @__PURE__ */ (0,
|
|
3554
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Separator, {}),
|
|
3555
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-3", children: [
|
|
3556
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
3557
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("h3", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider flex items-center gap-2", children: [
|
|
3558
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Brain, { className: "h-4 w-4" }),
|
|
3546
3559
|
labels.memories
|
|
3547
3560
|
] }),
|
|
3548
|
-
onAddMemory && /* @__PURE__ */ (0,
|
|
3561
|
+
onAddMemory && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3549
3562
|
Button,
|
|
3550
3563
|
{
|
|
3551
3564
|
variant: "ghost",
|
|
3552
3565
|
size: "sm",
|
|
3553
3566
|
className: "h-7 px-2",
|
|
3554
3567
|
onClick: () => setIsAddingMemory(true),
|
|
3555
|
-
children: /* @__PURE__ */ (0,
|
|
3568
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Plus, { className: "h-4 w-4" })
|
|
3556
3569
|
}
|
|
3557
3570
|
)
|
|
3558
3571
|
] }),
|
|
3559
|
-
isAddingMemory && onAddMemory && /* @__PURE__ */ (0,
|
|
3560
|
-
/* @__PURE__ */ (0,
|
|
3572
|
+
isAddingMemory && onAddMemory && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex gap-2", children: [
|
|
3573
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3561
3574
|
Input,
|
|
3562
3575
|
{
|
|
3563
3576
|
value: newMemoryContent,
|
|
@@ -3574,24 +3587,24 @@ var UserProfile = ({
|
|
|
3574
3587
|
autoFocus: true
|
|
3575
3588
|
}
|
|
3576
3589
|
),
|
|
3577
|
-
/* @__PURE__ */ (0,
|
|
3590
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Button, { size: "sm", onClick: handleAddMemory, disabled: !newMemoryContent.trim(), children: "Salvar" })
|
|
3578
3591
|
] }),
|
|
3579
|
-
/* @__PURE__ */ (0,
|
|
3592
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "space-y-2", children: memories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm text-muted-foreground text-center py-4", children: labels.noMemories }) : memories.map((memory) => {
|
|
3580
3593
|
const isEditing = editingMemoryId === memory.id;
|
|
3581
|
-
return /* @__PURE__ */ (0,
|
|
3594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3582
3595
|
"div",
|
|
3583
3596
|
{
|
|
3584
3597
|
className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50 group",
|
|
3585
3598
|
children: [
|
|
3586
|
-
/* @__PURE__ */ (0,
|
|
3587
|
-
/* @__PURE__ */ (0,
|
|
3588
|
-
/* @__PURE__ */ (0,
|
|
3589
|
-
/* @__PURE__ */ (0,
|
|
3590
|
-
/* @__PURE__ */ (0,
|
|
3591
|
-
/* @__PURE__ */ (0,
|
|
3599
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "mt-0.5 shrink-0", children: memory.source === "agent" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Bot, { className: "h-4 w-4 text-primary" }) : getMemoryCategoryIcon(memory.category) }),
|
|
3600
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3601
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center gap-2 mb-0.5", children: [
|
|
3602
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-xs text-muted-foreground", children: getMemoryCategoryLabel(memory.category) }),
|
|
3603
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-xs text-muted-foreground", children: "\u2022" }),
|
|
3604
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-xs text-muted-foreground", children: memory.source === "agent" ? "IA" : "Voc\xEA" })
|
|
3592
3605
|
] }),
|
|
3593
|
-
isEditing ? /* @__PURE__ */ (0,
|
|
3594
|
-
/* @__PURE__ */ (0,
|
|
3606
|
+
isEditing ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-2", children: [
|
|
3607
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3595
3608
|
Textarea,
|
|
3596
3609
|
{
|
|
3597
3610
|
value: editingMemoryContent,
|
|
@@ -3608,8 +3621,8 @@ var UserProfile = ({
|
|
|
3608
3621
|
}
|
|
3609
3622
|
}
|
|
3610
3623
|
),
|
|
3611
|
-
/* @__PURE__ */ (0,
|
|
3612
|
-
/* @__PURE__ */ (0,
|
|
3624
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex gap-1 justify-end", children: [
|
|
3625
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3613
3626
|
Button,
|
|
3614
3627
|
{
|
|
3615
3628
|
variant: "ghost",
|
|
@@ -3617,12 +3630,12 @@ var UserProfile = ({
|
|
|
3617
3630
|
className: "h-7 px-2",
|
|
3618
3631
|
onClick: handleCancelEdit,
|
|
3619
3632
|
children: [
|
|
3620
|
-
/* @__PURE__ */ (0,
|
|
3633
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.X, { className: "h-3.5 w-3.5 mr-1" }),
|
|
3621
3634
|
"Cancelar"
|
|
3622
3635
|
]
|
|
3623
3636
|
}
|
|
3624
3637
|
),
|
|
3625
|
-
/* @__PURE__ */ (0,
|
|
3638
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3626
3639
|
Button,
|
|
3627
3640
|
{
|
|
3628
3641
|
size: "sm",
|
|
@@ -3630,33 +3643,33 @@ var UserProfile = ({
|
|
|
3630
3643
|
onClick: handleSaveEdit,
|
|
3631
3644
|
disabled: !editingMemoryContent.trim(),
|
|
3632
3645
|
children: [
|
|
3633
|
-
/* @__PURE__ */ (0,
|
|
3646
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Check, { className: "h-3.5 w-3.5 mr-1" }),
|
|
3634
3647
|
"Salvar"
|
|
3635
3648
|
]
|
|
3636
3649
|
}
|
|
3637
3650
|
)
|
|
3638
3651
|
] })
|
|
3639
|
-
] }) : /* @__PURE__ */ (0,
|
|
3652
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm break-words", children: memory.content })
|
|
3640
3653
|
] }),
|
|
3641
|
-
!isEditing && (onUpdateMemory || onDeleteMemory) && /* @__PURE__ */ (0,
|
|
3642
|
-
onUpdateMemory && /* @__PURE__ */ (0,
|
|
3654
|
+
!isEditing && (onUpdateMemory || onDeleteMemory) && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity shrink-0", children: [
|
|
3655
|
+
onUpdateMemory && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3643
3656
|
Button,
|
|
3644
3657
|
{
|
|
3645
3658
|
variant: "ghost",
|
|
3646
3659
|
size: "icon",
|
|
3647
3660
|
className: "h-7 w-7",
|
|
3648
3661
|
onClick: () => handleStartEdit(memory),
|
|
3649
|
-
children: /* @__PURE__ */ (0,
|
|
3662
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Pencil, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
3650
3663
|
}
|
|
3651
3664
|
),
|
|
3652
|
-
onDeleteMemory && /* @__PURE__ */ (0,
|
|
3665
|
+
onDeleteMemory && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3653
3666
|
Button,
|
|
3654
3667
|
{
|
|
3655
3668
|
variant: "ghost",
|
|
3656
3669
|
size: "icon",
|
|
3657
3670
|
className: "h-7 w-7",
|
|
3658
3671
|
onClick: () => onDeleteMemory(memory.id),
|
|
3659
|
-
children: /* @__PURE__ */ (0,
|
|
3672
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Trash2, { className: "h-3.5 w-3.5 text-destructive" })
|
|
3660
3673
|
}
|
|
3661
3674
|
)
|
|
3662
3675
|
] })
|
|
@@ -3667,8 +3680,8 @@ var UserProfile = ({
|
|
|
3667
3680
|
}) })
|
|
3668
3681
|
] })
|
|
3669
3682
|
] }) }),
|
|
3670
|
-
/* @__PURE__ */ (0,
|
|
3671
|
-
onEditProfile && /* @__PURE__ */ (0,
|
|
3683
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "p-4 border-t space-y-2 shrink-0", children: [
|
|
3684
|
+
onEditProfile && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3672
3685
|
Button,
|
|
3673
3686
|
{
|
|
3674
3687
|
variant: "outline",
|
|
@@ -3677,7 +3690,7 @@ var UserProfile = ({
|
|
|
3677
3690
|
children: "Edit Profile"
|
|
3678
3691
|
}
|
|
3679
3692
|
),
|
|
3680
|
-
onLogout && /* @__PURE__ */ (0,
|
|
3693
|
+
onLogout && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3681
3694
|
Button,
|
|
3682
3695
|
{
|
|
3683
3696
|
variant: "destructive",
|
|
@@ -3694,7 +3707,7 @@ var UserProfile = ({
|
|
|
3694
3707
|
|
|
3695
3708
|
// src/components/chat/ChatUI.tsx
|
|
3696
3709
|
var import_lucide_react11 = require("lucide-react");
|
|
3697
|
-
var
|
|
3710
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3698
3711
|
var ChatUI = ({
|
|
3699
3712
|
messages = [],
|
|
3700
3713
|
threads = [],
|
|
@@ -3702,6 +3715,7 @@ var ChatUI = ({
|
|
|
3702
3715
|
config: userConfig,
|
|
3703
3716
|
sidebar: _sidebar,
|
|
3704
3717
|
isGenerating = false,
|
|
3718
|
+
isMessagesLoading = false,
|
|
3705
3719
|
callbacks = {},
|
|
3706
3720
|
user,
|
|
3707
3721
|
assistant,
|
|
@@ -3881,13 +3895,13 @@ var ChatUI = ({
|
|
|
3881
3895
|
const SuggestionIconComponents = [import_lucide_react11.MessageSquare, import_lucide_react11.Lightbulb, import_lucide_react11.Zap, import_lucide_react11.HelpCircle];
|
|
3882
3896
|
const renderSuggestions = () => {
|
|
3883
3897
|
if (messages.length > 0 || !suggestions.length) return null;
|
|
3884
|
-
return /* @__PURE__ */ (0,
|
|
3885
|
-
/* @__PURE__ */ (0,
|
|
3886
|
-
/* @__PURE__ */ (0,
|
|
3887
|
-
/* @__PURE__ */ (0,
|
|
3888
|
-
/* @__PURE__ */ (0,
|
|
3898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col items-center justify-center min-h-[60vh] py-8 px-4", children: [
|
|
3899
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "text-center mb-8", children: [
|
|
3900
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "inline-flex items-center justify-center w-14 h-14 rounded-2xl bg-gradient-to-br from-primary/20 to-primary/5 mb-4 shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Sparkles, { className: "w-7 h-7 text-primary" }) }),
|
|
3901
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h2", { className: "text-xl font-semibold mb-2", children: config.branding.title }),
|
|
3902
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-muted-foreground text-sm max-w-md", children: config.branding.subtitle })
|
|
3889
3903
|
] }),
|
|
3890
|
-
/* @__PURE__ */ (0,
|
|
3904
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 w-full max-w-2xl", children: suggestions.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3891
3905
|
"button",
|
|
3892
3906
|
{
|
|
3893
3907
|
type: "button",
|
|
@@ -3896,10 +3910,10 @@ var ChatUI = ({
|
|
|
3896
3910
|
children: [
|
|
3897
3911
|
(() => {
|
|
3898
3912
|
const IconComponent = SuggestionIconComponents[index % SuggestionIconComponents.length];
|
|
3899
|
-
return /* @__PURE__ */ (0,
|
|
3913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center justify-center w-8 h-8 rounded-lg bg-primary/10 text-primary shrink-0 group-hover:bg-primary/15 transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconComponent, { className: "h-4 w-4" }) });
|
|
3900
3914
|
})(),
|
|
3901
|
-
/* @__PURE__ */ (0,
|
|
3902
|
-
/* @__PURE__ */ (0,
|
|
3915
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-1 min-w-0 pr-6", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm font-medium leading-snug line-clamp-2", children: suggestion }) }),
|
|
3916
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.ArrowRight, { className: "absolute right-4 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" })
|
|
3903
3917
|
]
|
|
3904
3918
|
},
|
|
3905
3919
|
index
|
|
@@ -3909,25 +3923,44 @@ var ChatUI = ({
|
|
|
3909
3923
|
const renderInlineSuggestions = (messageId) => {
|
|
3910
3924
|
const items = messageSuggestions?.[messageId];
|
|
3911
3925
|
if (!items || items.length === 0) return null;
|
|
3912
|
-
return /* @__PURE__ */ (0,
|
|
3926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-wrap gap-2 mt-2 ml-11", children: items.map((suggestion, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3913
3927
|
"button",
|
|
3914
3928
|
{
|
|
3915
3929
|
type: "button",
|
|
3916
3930
|
onClick: () => handleSendMessage(suggestion),
|
|
3917
3931
|
className: "group inline-flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-full border border-border bg-background hover:bg-accent hover:border-accent-foreground/20 transition-all duration-150 text-foreground/80 hover:text-foreground",
|
|
3918
3932
|
children: [
|
|
3919
|
-
/* @__PURE__ */ (0,
|
|
3920
|
-
/* @__PURE__ */ (0,
|
|
3933
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Sparkles, { className: "h-3 w-3 text-primary opacity-70 group-hover:opacity-100" }),
|
|
3934
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "max-w-[200px] truncate", children: suggestion })
|
|
3921
3935
|
]
|
|
3922
3936
|
},
|
|
3923
3937
|
`${messageId}-suggestion-${index}`
|
|
3924
3938
|
)) });
|
|
3925
3939
|
};
|
|
3940
|
+
const renderMessageLoadingSkeleton = () => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "space-y-6 py-2", children: [0, 1, 2, 3].map((index) => {
|
|
3941
|
+
const isUserRow = index % 2 === 1;
|
|
3942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3943
|
+
"div",
|
|
3944
|
+
{
|
|
3945
|
+
className: `flex gap-3 ${isUserRow ? "justify-end" : "justify-start"}`,
|
|
3946
|
+
children: [
|
|
3947
|
+
!isUserRow && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Skeleton, { className: "h-8 w-8 rounded-full shrink-0" }),
|
|
3948
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: `space-y-2 ${isUserRow ? "w-[70%]" : "w-[75%]"}`, children: [
|
|
3949
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Skeleton, { className: "h-4 w-24" }),
|
|
3950
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Skeleton, { className: "h-4 w-full" }),
|
|
3951
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Skeleton, { className: "h-4 w-[85%]" })
|
|
3952
|
+
] }),
|
|
3953
|
+
isUserRow && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Skeleton, { className: "h-8 w-8 rounded-full shrink-0" })
|
|
3954
|
+
]
|
|
3955
|
+
},
|
|
3956
|
+
`message-skeleton-${index}`
|
|
3957
|
+
);
|
|
3958
|
+
}) });
|
|
3926
3959
|
const shouldShowAgentSelector = Boolean(
|
|
3927
3960
|
config.agentSelector?.enabled && onSelectAgent && agentOptions.length > 0 && (!config.agentSelector?.hideIfSingle || agentOptions.length > 1)
|
|
3928
3961
|
);
|
|
3929
|
-
return /* @__PURE__ */ (0,
|
|
3930
|
-
/* @__PURE__ */ (0,
|
|
3962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SidebarProvider, { defaultOpen: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: `flex h-[100svh] md:h-screen bg-background w-full overflow-hidden ${className}`, children: [
|
|
3963
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3931
3964
|
Sidebar2,
|
|
3932
3965
|
{
|
|
3933
3966
|
threads,
|
|
@@ -3957,8 +3990,8 @@ var ChatUI = ({
|
|
|
3957
3990
|
showThemeOptions: !!callbacks.onThemeChange
|
|
3958
3991
|
}
|
|
3959
3992
|
),
|
|
3960
|
-
/* @__PURE__ */ (0,
|
|
3961
|
-
/* @__PURE__ */ (0,
|
|
3993
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SidebarInset, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col h-full min-h-0", children: [
|
|
3994
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3962
3995
|
ChatHeader,
|
|
3963
3996
|
{
|
|
3964
3997
|
config,
|
|
@@ -3973,50 +4006,52 @@ var ChatUI = ({
|
|
|
3973
4006
|
onSelectAgent
|
|
3974
4007
|
}
|
|
3975
4008
|
),
|
|
3976
|
-
/* @__PURE__ */ (0,
|
|
3977
|
-
/* @__PURE__ */ (0,
|
|
3978
|
-
/* @__PURE__ */ (0,
|
|
4009
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-1 flex-row min-h-0 overflow-hidden", children: [
|
|
4010
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex-1 flex flex-col min-h-0", children: [
|
|
4011
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3979
4012
|
ScrollArea,
|
|
3980
4013
|
{
|
|
3981
4014
|
ref: scrollAreaRef,
|
|
3982
4015
|
className: "flex-1 min-h-0",
|
|
3983
4016
|
viewportClassName: "p-4 overscroll-contain",
|
|
3984
4017
|
onScrollCapture: handleScroll,
|
|
3985
|
-
children: /* @__PURE__ */ (0,
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
/* @__PURE__ */ (0,
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4018
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "max-w-4xl mx-auto space-y-4 pb-4", children: [
|
|
4019
|
+
isMessagesLoading ? renderMessageLoadingSkeleton() : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
4020
|
+
renderSuggestions(),
|
|
4021
|
+
messages.map((message, index) => {
|
|
4022
|
+
const prevMessage = index > 0 ? messages[index - 1] : null;
|
|
4023
|
+
const isGrouped = prevMessage !== null && prevMessage.role === message.role;
|
|
4024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: isGrouped ? "space-y-1 -mt-2" : "space-y-2", children: [
|
|
4025
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4026
|
+
Message,
|
|
4027
|
+
{
|
|
4028
|
+
message,
|
|
4029
|
+
userAvatar: user?.avatar,
|
|
4030
|
+
userName: user?.name,
|
|
4031
|
+
assistantAvatar: assistant?.avatar,
|
|
4032
|
+
assistantName: assistant?.name,
|
|
4033
|
+
showTimestamp: config.ui.showTimestamps,
|
|
4034
|
+
showAvatar: config.ui.showAvatars,
|
|
4035
|
+
enableCopy: config.features.enableMessageCopy,
|
|
4036
|
+
enableEdit: config.features.enableMessageEditing,
|
|
4037
|
+
enableRegenerate: config.features.enableRegeneration,
|
|
4038
|
+
enableToolCallsDisplay: config.features.enableToolCallsDisplay,
|
|
4039
|
+
compactMode: config.ui.compactMode,
|
|
4040
|
+
onAction: handleMessageAction,
|
|
4041
|
+
toolUsedLabel: config.labels.toolUsed,
|
|
4042
|
+
thinkingLabel: config.labels.thinking,
|
|
4043
|
+
isGrouped
|
|
4044
|
+
}
|
|
4045
|
+
),
|
|
4046
|
+
message.role === "assistant" && renderInlineSuggestions(message.id)
|
|
4047
|
+
] }, message.id);
|
|
4048
|
+
})
|
|
4049
|
+
] }),
|
|
4050
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ref: messagesEndRef })
|
|
4016
4051
|
] })
|
|
4017
4052
|
}
|
|
4018
4053
|
),
|
|
4019
|
-
/* @__PURE__ */ (0,
|
|
4054
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "bg-background pb-[env(safe-area-inset-bottom)]", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4020
4055
|
ChatInput,
|
|
4021
4056
|
{
|
|
4022
4057
|
value: inputValue,
|
|
@@ -4042,17 +4077,17 @@ var ChatUI = ({
|
|
|
4042
4077
|
}
|
|
4043
4078
|
) })
|
|
4044
4079
|
] }),
|
|
4045
|
-
config?.customComponent?.component && !isMobile && /* @__PURE__ */ (0,
|
|
4080
|
+
config?.customComponent?.component && !isMobile && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4046
4081
|
"div",
|
|
4047
4082
|
{
|
|
4048
4083
|
className: `h-full transition-all duration-300 ease-in-out overflow-hidden ${state.showSidebar ? "w-80" : "w-0"}`,
|
|
4049
|
-
children: state.showSidebar && /* @__PURE__ */ (0,
|
|
4084
|
+
children: state.showSidebar && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-col h-full border-l bg-background animate-in slide-in-from-right-4 duration-300 w-80", children: renderCustomComponent() })
|
|
4050
4085
|
}
|
|
4051
4086
|
)
|
|
4052
4087
|
] })
|
|
4053
4088
|
] }) }),
|
|
4054
|
-
isCustomMounted && config.customComponent?.component && isMobile && /* @__PURE__ */ (0,
|
|
4055
|
-
/* @__PURE__ */ (0,
|
|
4089
|
+
isCustomMounted && config.customComponent?.component && isMobile && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "fixed inset-0 z-50", children: [
|
|
4090
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4056
4091
|
"div",
|
|
4057
4092
|
{
|
|
4058
4093
|
className: `absolute inset-0 bg-background/80 backdrop-blur-sm transition-opacity duration-200 ease-out ${isCustomVisible ? "opacity-100" : "opacity-0"}`,
|
|
@@ -4060,16 +4095,16 @@ var ChatUI = ({
|
|
|
4060
4095
|
onClick: closeSidebar
|
|
4061
4096
|
}
|
|
4062
4097
|
),
|
|
4063
|
-
/* @__PURE__ */ (0,
|
|
4098
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4064
4099
|
"div",
|
|
4065
4100
|
{
|
|
4066
4101
|
className: `absolute top-0 right-0 h-full w-full bg-background transform-gpu transition-transform duration-200 ease-out ${isCustomVisible ? "translate-x-0" : "translate-x-full"}`,
|
|
4067
4102
|
style: { willChange: "transform" },
|
|
4068
|
-
children: /* @__PURE__ */ (0,
|
|
4103
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-full flex flex-col", children: renderCustomComponent() })
|
|
4069
4104
|
}
|
|
4070
4105
|
)
|
|
4071
4106
|
] }),
|
|
4072
|
-
isUserProfileOpen && /* @__PURE__ */ (0,
|
|
4107
|
+
isUserProfileOpen && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4073
4108
|
UserProfile,
|
|
4074
4109
|
{
|
|
4075
4110
|
isOpen: isUserProfileOpen,
|
|
@@ -4094,7 +4129,7 @@ var ChatUI = ({
|
|
|
4094
4129
|
// src/components/chat/ThreadManager.tsx
|
|
4095
4130
|
var import_react8 = require("react");
|
|
4096
4131
|
var import_lucide_react12 = require("lucide-react");
|
|
4097
|
-
var
|
|
4132
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4098
4133
|
var ThreadItem = ({ thread, isActive, config, onSelect, onRename, onDelete, onArchive }) => {
|
|
4099
4134
|
const [isEditing, setIsEditing] = (0, import_react8.useState)(false);
|
|
4100
4135
|
const [editTitle, setEditTitle] = (0, import_react8.useState)(thread.title);
|
|
@@ -4123,9 +4158,9 @@ var ThreadItem = ({ thread, isActive, config, onSelect, onRename, onDelete, onAr
|
|
|
4123
4158
|
handleCancelEdit();
|
|
4124
4159
|
}
|
|
4125
4160
|
};
|
|
4126
|
-
return /* @__PURE__ */ (0,
|
|
4127
|
-
/* @__PURE__ */ (0,
|
|
4128
|
-
/* @__PURE__ */ (0,
|
|
4161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Card, { className: `cursor-pointer transition-all duration-200 hover:shadow-md py-0 ${isActive ? "ring-2 ring-primary bg-primary/5" : "hover:bg-muted/50"}`, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CardContent, { className: "p-3 max-w-sm", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
|
|
4162
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex-1 min-w-0", onClick: onSelect, children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4163
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4129
4164
|
Input,
|
|
4130
4165
|
{
|
|
4131
4166
|
ref: inputRef,
|
|
@@ -4137,44 +4172,44 @@ var ThreadItem = ({ thread, isActive, config, onSelect, onRename, onDelete, onAr
|
|
|
4137
4172
|
placeholder: config?.labels?.threadNamePlaceholder || "Conversation name"
|
|
4138
4173
|
}
|
|
4139
4174
|
),
|
|
4140
|
-
/* @__PURE__ */ (0,
|
|
4141
|
-
/* @__PURE__ */ (0,
|
|
4142
|
-
] }) : /* @__PURE__ */ (0,
|
|
4143
|
-
/* @__PURE__ */ (0,
|
|
4144
|
-
/* @__PURE__ */ (0,
|
|
4145
|
-
/* @__PURE__ */ (0,
|
|
4146
|
-
/* @__PURE__ */ (0,
|
|
4175
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { size: "sm", variant: "ghost", onClick: handleSaveEdit, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Check, { className: "h-3 w-3" }) }),
|
|
4176
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { size: "sm", variant: "ghost", onClick: handleCancelEdit, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.X, { className: "h-3 w-3" }) })
|
|
4177
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
4178
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h4", { className: "font-medium text-sm truncate mb-1", children: thread.title }),
|
|
4179
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
4180
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
4181
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Hash, { className: "h-3 w-3" }),
|
|
4147
4182
|
thread.messageCount,
|
|
4148
4183
|
" msgs"
|
|
4149
4184
|
] }),
|
|
4150
|
-
/* @__PURE__ */ (0,
|
|
4151
|
-
/* @__PURE__ */ (0,
|
|
4152
|
-
/* @__PURE__ */ (0,
|
|
4185
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Separator, { orientation: "vertical", className: "h-3" }),
|
|
4186
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
4187
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Calendar, { className: "h-3 w-3" }),
|
|
4153
4188
|
formatDate(thread.updatedAt, config?.labels)
|
|
4154
4189
|
] }),
|
|
4155
|
-
thread.isArchived && /* @__PURE__ */ (0,
|
|
4156
|
-
/* @__PURE__ */ (0,
|
|
4157
|
-
/* @__PURE__ */ (0,
|
|
4158
|
-
/* @__PURE__ */ (0,
|
|
4190
|
+
thread.isArchived && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
4191
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Separator, { orientation: "vertical", className: "h-3" }),
|
|
4192
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Badge, { variant: "secondary", className: "text-xs", children: [
|
|
4193
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Archive, { className: "h-2 w-2 mr-1" }),
|
|
4159
4194
|
config?.labels?.archiveThread || "Archived"
|
|
4160
4195
|
] })
|
|
4161
4196
|
] })
|
|
4162
4197
|
] })
|
|
4163
4198
|
] }) }),
|
|
4164
|
-
!isEditing && /* @__PURE__ */ (0,
|
|
4165
|
-
/* @__PURE__ */ (0,
|
|
4166
|
-
/* @__PURE__ */ (0,
|
|
4167
|
-
/* @__PURE__ */ (0,
|
|
4168
|
-
/* @__PURE__ */ (0,
|
|
4199
|
+
!isEditing && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DropdownMenu, { children: [
|
|
4200
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { variant: "ghost", size: "icon", className: "h-6 w-6 m-auto", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.MoreVertical, { className: "h-3 w-3" }) }) }),
|
|
4201
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DropdownMenuContent, { align: "end", children: [
|
|
4202
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DropdownMenuItem, { onClick: () => setIsEditing(true), children: [
|
|
4203
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Edit2, { className: "h-4 w-4 mr-2" }),
|
|
4169
4204
|
config?.labels?.renameThread || "Rename"
|
|
4170
4205
|
] }),
|
|
4171
|
-
/* @__PURE__ */ (0,
|
|
4172
|
-
/* @__PURE__ */ (0,
|
|
4206
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DropdownMenuItem, { onClick: onArchive, children: [
|
|
4207
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Archive, { className: "h-4 w-4 mr-2" }),
|
|
4173
4208
|
thread.isArchived ? config?.labels?.unarchiveThread || "Unarchive" : config?.labels?.archiveThread || "Archive"
|
|
4174
4209
|
] }),
|
|
4175
|
-
/* @__PURE__ */ (0,
|
|
4176
|
-
/* @__PURE__ */ (0,
|
|
4177
|
-
/* @__PURE__ */ (0,
|
|
4210
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DropdownMenuSeparator, {}),
|
|
4211
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DropdownMenuItem, { onClick: onDelete, className: "text-destructive", children: [
|
|
4212
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Trash2, { className: "h-4 w-4 mr-2" }),
|
|
4178
4213
|
config?.labels?.deleteThread || "Delete"
|
|
4179
4214
|
] })
|
|
4180
4215
|
] })
|
|
@@ -4189,17 +4224,17 @@ var CreateThreadDialog2 = ({ onCreateThread, config }) => {
|
|
|
4189
4224
|
setTitle("");
|
|
4190
4225
|
setIsOpen(false);
|
|
4191
4226
|
};
|
|
4192
|
-
return /* @__PURE__ */ (0,
|
|
4193
|
-
/* @__PURE__ */ (0,
|
|
4194
|
-
/* @__PURE__ */ (0,
|
|
4227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
4228
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DialogTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Button, { variant: "outline", className: "w-full", children: [
|
|
4229
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Plus, { className: "h-4 w-4 mr-2" }),
|
|
4195
4230
|
config?.labels?.createNewThread || "New Conversation"
|
|
4196
4231
|
] }) }),
|
|
4197
|
-
/* @__PURE__ */ (0,
|
|
4198
|
-
/* @__PURE__ */ (0,
|
|
4199
|
-
/* @__PURE__ */ (0,
|
|
4200
|
-
/* @__PURE__ */ (0,
|
|
4232
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DialogContent, { children: [
|
|
4233
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DialogHeader, { children: [
|
|
4234
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DialogTitle, { children: config?.labels?.createNewThread || "Create New Conversation" }),
|
|
4235
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DialogDescription, { children: "Give your new conversation a name or leave blank to auto-generate one." })
|
|
4201
4236
|
] }),
|
|
4202
|
-
/* @__PURE__ */ (0,
|
|
4237
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4203
4238
|
Input,
|
|
4204
4239
|
{
|
|
4205
4240
|
value: title,
|
|
@@ -4209,9 +4244,9 @@ var CreateThreadDialog2 = ({ onCreateThread, config }) => {
|
|
|
4209
4244
|
autoFocus: true
|
|
4210
4245
|
}
|
|
4211
4246
|
),
|
|
4212
|
-
/* @__PURE__ */ (0,
|
|
4213
|
-
/* @__PURE__ */ (0,
|
|
4214
|
-
/* @__PURE__ */ (0,
|
|
4247
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DialogFooter, { children: [
|
|
4248
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { variant: "outline", onClick: () => setIsOpen(false), children: config?.labels?.cancel || "Cancel" }),
|
|
4249
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { onClick: handleCreate, children: config?.labels?.create || "Create" })
|
|
4215
4250
|
] })
|
|
4216
4251
|
] })
|
|
4217
4252
|
] });
|
|
@@ -4265,20 +4300,20 @@ var ThreadManager = ({
|
|
|
4265
4300
|
setDeleteThreadId(null);
|
|
4266
4301
|
};
|
|
4267
4302
|
if (!isOpen) return null;
|
|
4268
|
-
return /* @__PURE__ */ (0,
|
|
4269
|
-
/* @__PURE__ */ (0,
|
|
4270
|
-
/* @__PURE__ */ (0,
|
|
4271
|
-
/* @__PURE__ */ (0,
|
|
4272
|
-
/* @__PURE__ */ (0,
|
|
4273
|
-
/* @__PURE__ */ (0,
|
|
4303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: `fixed inset-0 z-50 bg-background/80 backdrop-blur-sm ${className}`, children: [
|
|
4304
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "fixed left-0 top-0 h-full w-full max-w-md border-r bg-background shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Card, { className: "h-full border-0 rounded-none", children: [
|
|
4305
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(CardHeader, { className: "border-b", children: [
|
|
4306
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
4307
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(CardTitle, { className: "flex items-center gap-2", children: [
|
|
4308
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.MessageSquare, { className: "h-5 w-5" }),
|
|
4274
4309
|
config?.labels?.newChat || "Conversations"
|
|
4275
4310
|
] }),
|
|
4276
|
-
/* @__PURE__ */ (0,
|
|
4311
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { variant: "ghost", size: "icon", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.X, { className: "h-4 w-4" }) })
|
|
4277
4312
|
] }),
|
|
4278
|
-
/* @__PURE__ */ (0,
|
|
4279
|
-
/* @__PURE__ */ (0,
|
|
4280
|
-
/* @__PURE__ */ (0,
|
|
4281
|
-
/* @__PURE__ */ (0,
|
|
4313
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-3", children: [
|
|
4314
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "relative", children: [
|
|
4315
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
4316
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4282
4317
|
Input,
|
|
4283
4318
|
{
|
|
4284
4319
|
placeholder: config?.labels?.search || "Search conversations...",
|
|
@@ -4288,8 +4323,8 @@ var ThreadManager = ({
|
|
|
4288
4323
|
}
|
|
4289
4324
|
)
|
|
4290
4325
|
] }),
|
|
4291
|
-
/* @__PURE__ */ (0,
|
|
4292
|
-
/* @__PURE__ */ (0,
|
|
4326
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
4327
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4293
4328
|
Button,
|
|
4294
4329
|
{
|
|
4295
4330
|
variant: "outline",
|
|
@@ -4297,12 +4332,12 @@ var ThreadManager = ({
|
|
|
4297
4332
|
onClick: () => setShowArchived(!showArchived),
|
|
4298
4333
|
className: "text-xs",
|
|
4299
4334
|
children: [
|
|
4300
|
-
/* @__PURE__ */ (0,
|
|
4335
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.Filter, { className: "h-3 w-3 mr-1" }),
|
|
4301
4336
|
showArchived ? config?.labels?.hideArchived || "Hide Archived" : config?.labels?.showArchived || "Show Archived"
|
|
4302
4337
|
]
|
|
4303
4338
|
}
|
|
4304
4339
|
),
|
|
4305
|
-
/* @__PURE__ */ (0,
|
|
4340
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Badge, { variant: "secondary", className: "text-xs", children: [
|
|
4306
4341
|
filteredThreads.length,
|
|
4307
4342
|
" / ",
|
|
4308
4343
|
threads.length
|
|
@@ -4310,14 +4345,14 @@ var ThreadManager = ({
|
|
|
4310
4345
|
] })
|
|
4311
4346
|
] })
|
|
4312
4347
|
] }),
|
|
4313
|
-
/* @__PURE__ */ (0,
|
|
4314
|
-
/* @__PURE__ */ (0,
|
|
4315
|
-
/* @__PURE__ */ (0,
|
|
4316
|
-
/* @__PURE__ */ (0,
|
|
4317
|
-
/* @__PURE__ */ (0,
|
|
4318
|
-
] }) : Object.entries(groupedThreads).map(([group, groupThreads]) => /* @__PURE__ */ (0,
|
|
4319
|
-
/* @__PURE__ */ (0,
|
|
4320
|
-
/* @__PURE__ */ (0,
|
|
4348
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(CardContent, { className: "p-0 flex-1", children: [
|
|
4349
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "p-4", children: onCreateThread && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CreateThreadDialog2, { onCreateThread, config }) }),
|
|
4350
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ScrollArea, { className: "h-[calc(100vh-280px)]", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "px-4 pb-4 space-y-4", children: Object.keys(groupedThreads).length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "text-center py-8 text-muted-foreground", children: [
|
|
4351
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react12.MessageSquare, { className: "h-12 w-12 mx-auto mb-3 opacity-50" }),
|
|
4352
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-sm", children: searchQuery ? config?.labels?.noThreadsFound || "No conversations found" : config?.labels?.noThreadsYet || "No conversations yet" })
|
|
4353
|
+
] }) : Object.entries(groupedThreads).map(([group, groupThreads]) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
|
|
4354
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h3", { className: "text-sm font-medium text-muted-foreground mb-2 px-2", children: group }),
|
|
4355
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "space-y-2", children: groupThreads.map((thread) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4321
4356
|
ThreadItem,
|
|
4322
4357
|
{
|
|
4323
4358
|
thread,
|
|
@@ -4333,14 +4368,14 @@ var ThreadManager = ({
|
|
|
4333
4368
|
] }, group)) }) })
|
|
4334
4369
|
] })
|
|
4335
4370
|
] }) }),
|
|
4336
|
-
deleteThreadId && /* @__PURE__ */ (0,
|
|
4337
|
-
/* @__PURE__ */ (0,
|
|
4338
|
-
/* @__PURE__ */ (0,
|
|
4339
|
-
/* @__PURE__ */ (0,
|
|
4371
|
+
deleteThreadId && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AlertDialog, { open: !!deleteThreadId, onOpenChange: () => setDeleteThreadId(null), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AlertDialogContent, { children: [
|
|
4372
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AlertDialogHeader, { children: [
|
|
4373
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AlertDialogTitle, { children: config?.labels?.deleteConfirmTitle || "Delete Conversation" }),
|
|
4374
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AlertDialogDescription, { children: config?.labels?.deleteConfirmDescription || "Are you sure you want to delete this conversation? This action cannot be undone." })
|
|
4340
4375
|
] }),
|
|
4341
|
-
/* @__PURE__ */ (0,
|
|
4342
|
-
/* @__PURE__ */ (0,
|
|
4343
|
-
/* @__PURE__ */ (0,
|
|
4376
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(AlertDialogFooter, { children: [
|
|
4377
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(AlertDialogCancel, { children: config?.labels?.cancel || "Cancel" }),
|
|
4378
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4344
4379
|
AlertDialogAction,
|
|
4345
4380
|
{
|
|
4346
4381
|
onClick: () => deleteThreadId && handleDeleteThread(deleteThreadId),
|