@kite-copilot/chat-panel 0.2.34 → 0.2.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto.cjs +521 -326
- package/dist/auto.d.cts +1 -1
- package/dist/auto.d.ts +1 -1
- package/dist/auto.js +1 -1
- package/dist/{chunk-URD5MNZI.js → chunk-GUAWNSRO.js} +527 -330
- package/dist/{createKiteChat-DPFkdPqV.d.cts → createKiteChat-jmAPjuv_.d.cts} +14 -2
- package/dist/{createKiteChat-DPFkdPqV.d.ts → createKiteChat-jmAPjuv_.d.ts} +14 -2
- package/dist/embed.global.js +64 -22
- package/dist/index.cjs +525 -330
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -71,6 +71,7 @@ var import_client = require("react-dom/client");
|
|
|
71
71
|
|
|
72
72
|
// src/ChatPanel.tsx
|
|
73
73
|
var React4 = __toESM(require("react"), 1);
|
|
74
|
+
var import_supabase_js = require("@supabase/supabase-js");
|
|
74
75
|
|
|
75
76
|
// src/lib/utils.ts
|
|
76
77
|
var import_clsx = require("clsx");
|
|
@@ -938,8 +939,36 @@ function DataRenderer({ type, data }) {
|
|
|
938
939
|
}
|
|
939
940
|
}
|
|
940
941
|
|
|
941
|
-
// src/
|
|
942
|
+
// src/components/TypingIndicator.tsx
|
|
942
943
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
944
|
+
function TypingIndicator({ className = "" }) {
|
|
945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `flex items-center gap-1 px-4 py-3 ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
946
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
947
|
+
"span",
|
|
948
|
+
{
|
|
949
|
+
className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
|
|
950
|
+
style: { animationDelay: "0ms", animationDuration: "600ms" }
|
|
951
|
+
}
|
|
952
|
+
),
|
|
953
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
954
|
+
"span",
|
|
955
|
+
{
|
|
956
|
+
className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
|
|
957
|
+
style: { animationDelay: "150ms", animationDuration: "600ms" }
|
|
958
|
+
}
|
|
959
|
+
),
|
|
960
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
961
|
+
"span",
|
|
962
|
+
{
|
|
963
|
+
className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
|
|
964
|
+
style: { animationDelay: "300ms", animationDuration: "600ms" }
|
|
965
|
+
}
|
|
966
|
+
)
|
|
967
|
+
] }) });
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
// src/ChatPanel.tsx
|
|
971
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
943
972
|
var DEFAULT_AGENT_URL = "http://localhost:5002";
|
|
944
973
|
var PANEL_WIDTH = 340;
|
|
945
974
|
function unescapeJsonString(str) {
|
|
@@ -961,7 +990,7 @@ function renderMarkdown(text) {
|
|
|
961
990
|
const codeMatch = remaining.match(/^`([^`]+)`/);
|
|
962
991
|
if (codeMatch) {
|
|
963
992
|
parts.push(
|
|
964
|
-
/* @__PURE__ */ (0,
|
|
993
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
965
994
|
"code",
|
|
966
995
|
{
|
|
967
996
|
className: "bg-gray-100 px-1 py-0.5 rounded text-xs font-mono",
|
|
@@ -975,20 +1004,20 @@ function renderMarkdown(text) {
|
|
|
975
1004
|
}
|
|
976
1005
|
const boldMatch = remaining.match(/^\*\*([^*]+)\*\*/);
|
|
977
1006
|
if (boldMatch) {
|
|
978
|
-
parts.push(/* @__PURE__ */ (0,
|
|
1007
|
+
parts.push(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: boldMatch[1] }, keyIndex++));
|
|
979
1008
|
remaining = remaining.slice(boldMatch[0].length);
|
|
980
1009
|
continue;
|
|
981
1010
|
}
|
|
982
1011
|
const italicMatch = remaining.match(/^\*([^*]+)\*/);
|
|
983
1012
|
if (italicMatch) {
|
|
984
|
-
parts.push(/* @__PURE__ */ (0,
|
|
1013
|
+
parts.push(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("em", { children: italicMatch[1] }, keyIndex++));
|
|
985
1014
|
remaining = remaining.slice(italicMatch[0].length);
|
|
986
1015
|
continue;
|
|
987
1016
|
}
|
|
988
1017
|
const linkMatch = remaining.match(/^\[([^\]]+)\]\(([^)]+)\)/);
|
|
989
1018
|
if (linkMatch) {
|
|
990
1019
|
parts.push(
|
|
991
|
-
/* @__PURE__ */ (0,
|
|
1020
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
992
1021
|
"a",
|
|
993
1022
|
{
|
|
994
1023
|
href: linkMatch[2],
|
|
@@ -1008,7 +1037,7 @@ function renderMarkdown(text) {
|
|
|
1008
1037
|
const url = urlMatch[1];
|
|
1009
1038
|
const href = url.startsWith("www.") ? `https://${url}` : url;
|
|
1010
1039
|
parts.push(
|
|
1011
|
-
/* @__PURE__ */ (0,
|
|
1040
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1012
1041
|
"a",
|
|
1013
1042
|
{
|
|
1014
1043
|
href,
|
|
@@ -1027,7 +1056,7 @@ function renderMarkdown(text) {
|
|
|
1027
1056
|
if (emailMatch) {
|
|
1028
1057
|
const email = emailMatch[1];
|
|
1029
1058
|
parts.push(
|
|
1030
|
-
/* @__PURE__ */ (0,
|
|
1059
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1031
1060
|
"a",
|
|
1032
1061
|
{
|
|
1033
1062
|
href: `mailto:${email}`,
|
|
@@ -1052,17 +1081,17 @@ function renderMarkdown(text) {
|
|
|
1052
1081
|
remaining = remaining.slice(nextSpecial);
|
|
1053
1082
|
}
|
|
1054
1083
|
}
|
|
1055
|
-
return parts.length === 1 ? parts[0] : /* @__PURE__ */ (0,
|
|
1084
|
+
return parts.length === 1 ? parts[0] : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: parts });
|
|
1056
1085
|
};
|
|
1057
1086
|
const flushList = () => {
|
|
1058
1087
|
if (currentList) {
|
|
1059
1088
|
const ListTag = currentList.type === "ul" ? "ul" : "ol";
|
|
1060
1089
|
elements.push(
|
|
1061
|
-
/* @__PURE__ */ (0,
|
|
1090
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1062
1091
|
ListTag,
|
|
1063
1092
|
{
|
|
1064
1093
|
className: `${currentList.type === "ul" ? "list-disc" : "list-decimal"} ml-4 my-1`,
|
|
1065
|
-
children: currentList.items.map((item, i) => /* @__PURE__ */ (0,
|
|
1094
|
+
children: currentList.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { className: "ml-2", children: item }, i))
|
|
1066
1095
|
},
|
|
1067
1096
|
elements.length
|
|
1068
1097
|
)
|
|
@@ -1075,11 +1104,11 @@ function renderMarkdown(text) {
|
|
|
1075
1104
|
if (line.startsWith("```")) {
|
|
1076
1105
|
if (inCodeBlock) {
|
|
1077
1106
|
elements.push(
|
|
1078
|
-
/* @__PURE__ */ (0,
|
|
1107
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1079
1108
|
"pre",
|
|
1080
1109
|
{
|
|
1081
1110
|
className: "bg-gray-100 rounded p-2 my-1 overflow-x-auto",
|
|
1082
|
-
children: /* @__PURE__ */ (0,
|
|
1111
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("code", { className: "text-xs font-mono", children: codeContent.join("\n") })
|
|
1083
1112
|
},
|
|
1084
1113
|
elements.length
|
|
1085
1114
|
)
|
|
@@ -1105,7 +1134,7 @@ function renderMarkdown(text) {
|
|
|
1105
1134
|
const content = processInlineFormatting(headerMatch[2]);
|
|
1106
1135
|
const className = level === 1 ? "text-lg font-bold my-1" : level === 2 ? "text-base font-bold my-1" : "text-sm font-semibold my-1";
|
|
1107
1136
|
elements.push(
|
|
1108
|
-
/* @__PURE__ */ (0,
|
|
1137
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className, children: content }, elements.length)
|
|
1109
1138
|
);
|
|
1110
1139
|
continue;
|
|
1111
1140
|
}
|
|
@@ -1129,23 +1158,23 @@ function renderMarkdown(text) {
|
|
|
1129
1158
|
}
|
|
1130
1159
|
if (line.trim() === "") {
|
|
1131
1160
|
flushList();
|
|
1132
|
-
elements.push(/* @__PURE__ */ (0,
|
|
1161
|
+
elements.push(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-2" }, elements.length));
|
|
1133
1162
|
continue;
|
|
1134
1163
|
}
|
|
1135
1164
|
if (line.match(/^[-*_]{3,}$/)) {
|
|
1136
1165
|
flushList();
|
|
1137
1166
|
elements.push(
|
|
1138
|
-
/* @__PURE__ */ (0,
|
|
1167
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("hr", { className: "my-2 border-gray-200" }, elements.length)
|
|
1139
1168
|
);
|
|
1140
1169
|
continue;
|
|
1141
1170
|
}
|
|
1142
1171
|
flushList();
|
|
1143
1172
|
elements.push(
|
|
1144
|
-
/* @__PURE__ */ (0,
|
|
1173
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: processInlineFormatting(line) }, elements.length)
|
|
1145
1174
|
);
|
|
1146
1175
|
}
|
|
1147
1176
|
flushList();
|
|
1148
|
-
return /* @__PURE__ */ (0,
|
|
1177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: elements });
|
|
1149
1178
|
}
|
|
1150
1179
|
var defaultStartingQuestions = [
|
|
1151
1180
|
{
|
|
@@ -1372,21 +1401,155 @@ function ChatPanel({
|
|
|
1372
1401
|
orgId,
|
|
1373
1402
|
userName,
|
|
1374
1403
|
userEmail,
|
|
1375
|
-
userOrganization
|
|
1404
|
+
userOrganization,
|
|
1405
|
+
supabaseUrl,
|
|
1406
|
+
supabaseAnonKey
|
|
1376
1407
|
} = {}) {
|
|
1377
1408
|
const [messages, setMessages] = React4.useState(initialMessages);
|
|
1378
1409
|
const [input, setInput] = React4.useState("");
|
|
1379
1410
|
const [sessionId, setSessionId] = React4.useState(() => crypto.randomUUID());
|
|
1380
1411
|
const [isEscalated, setIsEscalated] = React4.useState(false);
|
|
1381
1412
|
const escalationWsRef = React4.useRef(null);
|
|
1413
|
+
const [agentIsTyping, setAgentIsTyping] = React4.useState(false);
|
|
1414
|
+
const supabaseRef = React4.useRef(null);
|
|
1415
|
+
const typingChannelRef = React4.useRef(null);
|
|
1416
|
+
const typingTimeoutRef = React4.useRef(null);
|
|
1382
1417
|
const resetSession = React4.useCallback(() => {
|
|
1418
|
+
if (isEscalated && supabaseRef.current && sessionId) {
|
|
1419
|
+
supabaseRef.current.from("escalations").update({
|
|
1420
|
+
customer_status: "disconnected",
|
|
1421
|
+
customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
|
|
1422
|
+
}).eq("session_id", sessionId);
|
|
1423
|
+
}
|
|
1383
1424
|
setSessionId(crypto.randomUUID());
|
|
1384
1425
|
setIsEscalated(false);
|
|
1385
1426
|
if (escalationWsRef.current) {
|
|
1386
1427
|
escalationWsRef.current.close();
|
|
1387
1428
|
escalationWsRef.current = null;
|
|
1388
1429
|
}
|
|
1389
|
-
|
|
1430
|
+
setAgentIsTyping(false);
|
|
1431
|
+
if (typingChannelRef.current) {
|
|
1432
|
+
typingChannelRef.current.unsubscribe();
|
|
1433
|
+
typingChannelRef.current = null;
|
|
1434
|
+
}
|
|
1435
|
+
}, [isEscalated, sessionId]);
|
|
1436
|
+
React4.useEffect(() => {
|
|
1437
|
+
if (supabaseUrl && supabaseAnonKey && !supabaseRef.current) {
|
|
1438
|
+
supabaseRef.current = (0, import_supabase_js.createClient)(supabaseUrl, supabaseAnonKey);
|
|
1439
|
+
}
|
|
1440
|
+
}, [supabaseUrl, supabaseAnonKey]);
|
|
1441
|
+
React4.useEffect(() => {
|
|
1442
|
+
if (!isEscalated || !sessionId || !supabaseRef.current) {
|
|
1443
|
+
return;
|
|
1444
|
+
}
|
|
1445
|
+
const channelName = `typing:${sessionId}`;
|
|
1446
|
+
const channel = supabaseRef.current.channel(channelName);
|
|
1447
|
+
channel.on("broadcast", { event: "typing" }, (payload) => {
|
|
1448
|
+
const { sender, isTyping } = payload.payload;
|
|
1449
|
+
if (sender === "agent") {
|
|
1450
|
+
setAgentIsTyping(isTyping);
|
|
1451
|
+
if (isTyping) {
|
|
1452
|
+
if (typingTimeoutRef.current) {
|
|
1453
|
+
window.clearTimeout(typingTimeoutRef.current);
|
|
1454
|
+
}
|
|
1455
|
+
typingTimeoutRef.current = window.setTimeout(() => {
|
|
1456
|
+
setAgentIsTyping(false);
|
|
1457
|
+
}, 5e3);
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
}).subscribe((status) => {
|
|
1461
|
+
if (status === "SUBSCRIBED") {
|
|
1462
|
+
typingChannelRef.current = channel;
|
|
1463
|
+
}
|
|
1464
|
+
});
|
|
1465
|
+
return () => {
|
|
1466
|
+
channel.unsubscribe();
|
|
1467
|
+
typingChannelRef.current = null;
|
|
1468
|
+
if (typingTimeoutRef.current) {
|
|
1469
|
+
window.clearTimeout(typingTimeoutRef.current);
|
|
1470
|
+
}
|
|
1471
|
+
};
|
|
1472
|
+
}, [isEscalated, sessionId]);
|
|
1473
|
+
const heartbeatIntervalRef = React4.useRef(null);
|
|
1474
|
+
const updateCustomerStatus = React4.useCallback(async (status) => {
|
|
1475
|
+
if (!supabaseRef.current || !sessionId) return;
|
|
1476
|
+
try {
|
|
1477
|
+
await supabaseRef.current.from("escalations").update({
|
|
1478
|
+
customer_status: status,
|
|
1479
|
+
customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
|
|
1480
|
+
}).eq("session_id", sessionId);
|
|
1481
|
+
} catch (err) {
|
|
1482
|
+
console.error("[KiteChat] Failed to update customer status:", err);
|
|
1483
|
+
}
|
|
1484
|
+
}, [sessionId]);
|
|
1485
|
+
React4.useEffect(() => {
|
|
1486
|
+
if (!isEscalated || !sessionId || !supabaseRef.current) {
|
|
1487
|
+
return;
|
|
1488
|
+
}
|
|
1489
|
+
const currentSessionId = sessionId;
|
|
1490
|
+
const supabase = supabaseRef.current;
|
|
1491
|
+
updateCustomerStatus("active");
|
|
1492
|
+
heartbeatIntervalRef.current = window.setInterval(() => {
|
|
1493
|
+
updateCustomerStatus("active");
|
|
1494
|
+
}, 6e4);
|
|
1495
|
+
const handleBeforeUnload = () => {
|
|
1496
|
+
supabase.from("escalations").update({
|
|
1497
|
+
customer_status: "disconnected",
|
|
1498
|
+
customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
|
|
1499
|
+
}).eq("session_id", currentSessionId);
|
|
1500
|
+
};
|
|
1501
|
+
const handleVisibilityChange = () => {
|
|
1502
|
+
if (document.visibilityState === "hidden") {
|
|
1503
|
+
supabase.from("escalations").update({
|
|
1504
|
+
customer_status: "disconnected",
|
|
1505
|
+
customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
|
|
1506
|
+
}).eq("session_id", currentSessionId);
|
|
1507
|
+
} else if (document.visibilityState === "visible") {
|
|
1508
|
+
updateCustomerStatus("active");
|
|
1509
|
+
}
|
|
1510
|
+
};
|
|
1511
|
+
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
1512
|
+
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
1513
|
+
return () => {
|
|
1514
|
+
window.removeEventListener("beforeunload", handleBeforeUnload);
|
|
1515
|
+
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
1516
|
+
supabase.from("escalations").update({
|
|
1517
|
+
customer_status: "disconnected",
|
|
1518
|
+
customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
|
|
1519
|
+
}).eq("session_id", currentSessionId).then(
|
|
1520
|
+
() => {
|
|
1521
|
+
console.log("[KiteChat] Marked customer as disconnected");
|
|
1522
|
+
},
|
|
1523
|
+
(err) => {
|
|
1524
|
+
console.error("[KiteChat] Failed to mark disconnected:", err);
|
|
1525
|
+
}
|
|
1526
|
+
);
|
|
1527
|
+
if (heartbeatIntervalRef.current) {
|
|
1528
|
+
window.clearInterval(heartbeatIntervalRef.current);
|
|
1529
|
+
heartbeatIntervalRef.current = null;
|
|
1530
|
+
}
|
|
1531
|
+
};
|
|
1532
|
+
}, [isEscalated, sessionId, updateCustomerStatus]);
|
|
1533
|
+
const sendTypingIndicator = React4.useCallback((isTyping) => {
|
|
1534
|
+
if (!typingChannelRef.current || !isEscalated) return;
|
|
1535
|
+
typingChannelRef.current.send({
|
|
1536
|
+
type: "broadcast",
|
|
1537
|
+
event: "typing",
|
|
1538
|
+
payload: { sender: "user", isTyping }
|
|
1539
|
+
});
|
|
1540
|
+
}, [isEscalated]);
|
|
1541
|
+
const userTypingTimeoutRef = React4.useRef(null);
|
|
1542
|
+
const handleTypingStart = React4.useCallback(() => {
|
|
1543
|
+
if (!isEscalated || !supabaseRef.current) return;
|
|
1544
|
+
sendTypingIndicator(true);
|
|
1545
|
+
updateCustomerStatus("active");
|
|
1546
|
+
if (userTypingTimeoutRef.current) {
|
|
1547
|
+
window.clearTimeout(userTypingTimeoutRef.current);
|
|
1548
|
+
}
|
|
1549
|
+
userTypingTimeoutRef.current = window.setTimeout(() => {
|
|
1550
|
+
sendTypingIndicator(false);
|
|
1551
|
+
}, 1500);
|
|
1552
|
+
}, [isEscalated, sendTypingIndicator, updateCustomerStatus]);
|
|
1390
1553
|
const streamIntervals = React4.useRef({});
|
|
1391
1554
|
const isEmpty = messages.length === 0;
|
|
1392
1555
|
const [phase, setPhase] = React4.useState("idle");
|
|
@@ -1661,12 +1824,13 @@ function ChatPanel({
|
|
|
1661
1824
|
type: "user_message",
|
|
1662
1825
|
content
|
|
1663
1826
|
}));
|
|
1827
|
+
updateCustomerStatus("active");
|
|
1664
1828
|
return true;
|
|
1665
1829
|
} catch (err) {
|
|
1666
1830
|
console.error("[KiteChat] Failed to send escalated message:", err);
|
|
1667
1831
|
return false;
|
|
1668
1832
|
}
|
|
1669
|
-
}, []);
|
|
1833
|
+
}, [updateCustomerStatus]);
|
|
1670
1834
|
React4.useEffect(() => {
|
|
1671
1835
|
return () => {
|
|
1672
1836
|
if (escalationWsRef.current) {
|
|
@@ -1797,6 +1961,11 @@ function ChatPanel({
|
|
|
1797
1961
|
};
|
|
1798
1962
|
setMessages((prev) => [...prev, userMessage]);
|
|
1799
1963
|
sendEscalatedMessage(trimmed);
|
|
1964
|
+
sendTypingIndicator(false);
|
|
1965
|
+
if (userTypingTimeoutRef.current) {
|
|
1966
|
+
window.clearTimeout(userTypingTimeoutRef.current);
|
|
1967
|
+
userTypingTimeoutRef.current = null;
|
|
1968
|
+
}
|
|
1800
1969
|
setInput("");
|
|
1801
1970
|
return;
|
|
1802
1971
|
}
|
|
@@ -2815,8 +2984,8 @@ ${userText}`
|
|
|
2815
2984
|
}
|
|
2816
2985
|
}
|
|
2817
2986
|
if (!isOpen) {
|
|
2818
|
-
return /* @__PURE__ */ (0,
|
|
2819
|
-
/* @__PURE__ */ (0,
|
|
2987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "fixed bottom-6 left-1/2 -translate-x-1/2 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `flex items-center gap-3 rounded-2xl bg-white border border-gray-200 shadow-lg px-4 py-2 hover:shadow-xl transition-all duration-300 ease-out focus-within:border-gray-700 ${searchExpanded ? "w-[480px]" : "w-[320px]"}`, children: !searchExpanded ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-3 w-full", children: [
|
|
2988
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2820
2989
|
"button",
|
|
2821
2990
|
{
|
|
2822
2991
|
onClick: () => {
|
|
@@ -2825,23 +2994,23 @@ ${userText}`
|
|
|
2825
2994
|
},
|
|
2826
2995
|
className: "flex items-center gap-3 flex-1 group",
|
|
2827
2996
|
children: [
|
|
2828
|
-
/* @__PURE__ */ (0,
|
|
2829
|
-
/* @__PURE__ */ (0,
|
|
2997
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm text-gray-500 flex-1 text-left", children: "Ask a question..." }),
|
|
2998
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-gray-400 font-medium", children: "\u2318I" })
|
|
2830
2999
|
]
|
|
2831
3000
|
}
|
|
2832
3001
|
),
|
|
2833
|
-
/* @__PURE__ */ (0,
|
|
3002
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2834
3003
|
"button",
|
|
2835
3004
|
{
|
|
2836
3005
|
onClick: () => {
|
|
2837
3006
|
onOpen?.();
|
|
2838
3007
|
},
|
|
2839
3008
|
className: "h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors",
|
|
2840
|
-
children: /* @__PURE__ */ (0,
|
|
3009
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" })
|
|
2841
3010
|
}
|
|
2842
3011
|
)
|
|
2843
|
-
] }) : /* @__PURE__ */ (0,
|
|
2844
|
-
/* @__PURE__ */ (0,
|
|
3012
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
3013
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2845
3014
|
"input",
|
|
2846
3015
|
{
|
|
2847
3016
|
ref: searchInputRef,
|
|
@@ -2869,9 +3038,9 @@ ${userText}`
|
|
|
2869
3038
|
className: "flex-1 text-sm text-gray-700 outline-none bg-transparent"
|
|
2870
3039
|
}
|
|
2871
3040
|
),
|
|
2872
|
-
/* @__PURE__ */ (0,
|
|
2873
|
-
/* @__PURE__ */ (0,
|
|
2874
|
-
/* @__PURE__ */ (0,
|
|
3041
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3042
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-gray-400 font-medium", children: "\u21B5 Enter" }),
|
|
3043
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2875
3044
|
"button",
|
|
2876
3045
|
{
|
|
2877
3046
|
onClick: () => {
|
|
@@ -2883,25 +3052,25 @@ ${userText}`
|
|
|
2883
3052
|
setSearchExpanded(false);
|
|
2884
3053
|
},
|
|
2885
3054
|
className: "h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors cursor-pointer",
|
|
2886
|
-
children: /* @__PURE__ */ (0,
|
|
3055
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" })
|
|
2887
3056
|
}
|
|
2888
3057
|
)
|
|
2889
3058
|
] })
|
|
2890
3059
|
] }) }) });
|
|
2891
3060
|
}
|
|
2892
|
-
return /* @__PURE__ */ (0,
|
|
3061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2893
3062
|
"section",
|
|
2894
3063
|
{
|
|
2895
3064
|
className: `fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${isOpen ? "translate-x-0" : "translate-x-full"}`,
|
|
2896
3065
|
style: { width: `${PANEL_WIDTH}px` },
|
|
2897
3066
|
children: [
|
|
2898
|
-
/* @__PURE__ */ (0,
|
|
2899
|
-
/* @__PURE__ */ (0,
|
|
2900
|
-
/* @__PURE__ */ (0,
|
|
2901
|
-
/* @__PURE__ */ (0,
|
|
3067
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0", children: [
|
|
3068
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
3069
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" }),
|
|
3070
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { className: "text-sm font-semibold text-gray-800", children: "Copilot" })
|
|
2902
3071
|
] }),
|
|
2903
|
-
/* @__PURE__ */ (0,
|
|
2904
|
-
/* @__PURE__ */ (0,
|
|
3072
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
3073
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2905
3074
|
Button,
|
|
2906
3075
|
{
|
|
2907
3076
|
variant: "ghost",
|
|
@@ -2916,29 +3085,40 @@ ${userText}`
|
|
|
2916
3085
|
activeGuideRef.current = void 0;
|
|
2917
3086
|
setGuideComplete(false);
|
|
2918
3087
|
},
|
|
2919
|
-
children: /* @__PURE__ */ (0,
|
|
3088
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.SquarePen, { className: "h-3 w-3" })
|
|
2920
3089
|
}
|
|
2921
3090
|
),
|
|
2922
|
-
/* @__PURE__ */ (0,
|
|
3091
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2923
3092
|
Button,
|
|
2924
3093
|
{
|
|
2925
3094
|
variant: "ghost",
|
|
2926
3095
|
size: "sm",
|
|
2927
3096
|
className: "h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",
|
|
2928
|
-
onClick: () =>
|
|
2929
|
-
|
|
3097
|
+
onClick: () => {
|
|
3098
|
+
if (isEscalated) {
|
|
3099
|
+
resetSession();
|
|
3100
|
+
setMessages([]);
|
|
3101
|
+
setPanelView("landing");
|
|
3102
|
+
setCurrentFolderId(void 0);
|
|
3103
|
+
setActiveGuide(void 0);
|
|
3104
|
+
activeGuideRef.current = void 0;
|
|
3105
|
+
setGuideComplete(false);
|
|
3106
|
+
}
|
|
3107
|
+
onClose?.();
|
|
3108
|
+
},
|
|
3109
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Minus, { className: "h-3.5 w-3.5" })
|
|
2930
3110
|
}
|
|
2931
3111
|
)
|
|
2932
3112
|
] })
|
|
2933
3113
|
] }),
|
|
2934
|
-
/* @__PURE__ */ (0,
|
|
3114
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2935
3115
|
"div",
|
|
2936
3116
|
{
|
|
2937
3117
|
className: isEmpty ? "grid flex-1 place-items-center transition-all duration-300" : "flex flex-1 flex-col transition-all duration-300 min-h-0 overflow-hidden",
|
|
2938
|
-
children: isEmpty ? /* @__PURE__ */ (0,
|
|
2939
|
-
/* @__PURE__ */ (0,
|
|
2940
|
-
/* @__PURE__ */ (0,
|
|
2941
|
-
panelView === "landing" && /* @__PURE__ */ (0,
|
|
3118
|
+
children: isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w-full overflow-y-auto px-4", children: [
|
|
3119
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "py-3 transition-all duration-300", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h2", { className: "text-center text-2xl font-semibold text-gray-900", children: panelView === "folder" ? folders.find((f) => f.id === currentFolderId)?.title || "" : "How can I help?" }) }),
|
|
3120
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "pb-4 px-4", children: [
|
|
3121
|
+
panelView === "landing" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-col gap-1", children: loadingQuestions ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Loader2, { className: "h-4 w-4 animate-spin text-gray-400" }) }) : startingQuestions.map((question, index) => {
|
|
2942
3122
|
const iconColors = [
|
|
2943
3123
|
"bg-blue-400",
|
|
2944
3124
|
"bg-green-400",
|
|
@@ -2946,7 +3126,7 @@ ${userText}`
|
|
|
2946
3126
|
"bg-orange-400",
|
|
2947
3127
|
"bg-pink-400"
|
|
2948
3128
|
];
|
|
2949
|
-
return /* @__PURE__ */ (0,
|
|
3129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2950
3130
|
Button,
|
|
2951
3131
|
{
|
|
2952
3132
|
type: "button",
|
|
@@ -2955,7 +3135,7 @@ ${userText}`
|
|
|
2955
3135
|
className: "w-full justify-start rounded-lg px-3 py-1.5 text-xs text-gray-700 hover:bg-gray-100 h-auto",
|
|
2956
3136
|
onClick: () => sendTopic(question.prompt),
|
|
2957
3137
|
children: [
|
|
2958
|
-
/* @__PURE__ */ (0,
|
|
3138
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2959
3139
|
"span",
|
|
2960
3140
|
{
|
|
2961
3141
|
className: `mr-2 inline-block h-1.5 w-1.5 rounded-full ${iconColors[index % iconColors.length]}`
|
|
@@ -2967,9 +3147,9 @@ ${userText}`
|
|
|
2967
3147
|
question.id
|
|
2968
3148
|
);
|
|
2969
3149
|
}) }) }),
|
|
2970
|
-
panelView === "folder" && /* @__PURE__ */ (0,
|
|
2971
|
-
/* @__PURE__ */ (0,
|
|
2972
|
-
/* @__PURE__ */ (0,
|
|
3150
|
+
panelView === "folder" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
3151
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
3152
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2973
3153
|
Button,
|
|
2974
3154
|
{
|
|
2975
3155
|
type: "button",
|
|
@@ -2978,12 +3158,12 @@ ${userText}`
|
|
|
2978
3158
|
className: "h-7 w-7 rounded-full hover:bg-gray-100",
|
|
2979
3159
|
onClick: closeFolder,
|
|
2980
3160
|
"aria-label": "Back to suggestions",
|
|
2981
|
-
children: /* @__PURE__ */ (0,
|
|
3161
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowLeft, { className: "h-4 w-4 text-gray-500" })
|
|
2982
3162
|
}
|
|
2983
3163
|
),
|
|
2984
|
-
/* @__PURE__ */ (0,
|
|
3164
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs font-medium uppercase tracking-wide text-gray-400", children: "Topics" })
|
|
2985
3165
|
] }),
|
|
2986
|
-
/* @__PURE__ */ (0,
|
|
3166
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-col gap-1.5", children: folders.find((f) => f.id === currentFolderId)?.topics.map((topic) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2987
3167
|
Button,
|
|
2988
3168
|
{
|
|
2989
3169
|
type: "button",
|
|
@@ -2997,7 +3177,7 @@ ${userText}`
|
|
|
2997
3177
|
)) })
|
|
2998
3178
|
] })
|
|
2999
3179
|
] })
|
|
3000
|
-
] }) : /* @__PURE__ */ (0,
|
|
3180
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex-1 min-h-0 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ScrollArea, { ref: messagesContainerRef, className: "h-full", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-2 px-4 py-3", children: [
|
|
3001
3181
|
messages.map((message, index) => {
|
|
3002
3182
|
const isUser = message.role === "user";
|
|
3003
3183
|
const previousRole = index > 0 ? messages[index - 1].role : void 0;
|
|
@@ -3017,17 +3197,20 @@ ${userText}`
|
|
|
3017
3197
|
return null;
|
|
3018
3198
|
}
|
|
3019
3199
|
if (isUser) {
|
|
3020
|
-
return /* @__PURE__ */ (0,
|
|
3200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `flex justify-end ${isRoleChange ? "mt-3" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3 py-2 text-xs text-white shadow-sm", children: message.content }) }, message.id);
|
|
3021
3201
|
}
|
|
3022
3202
|
if (message.role === "agent") {
|
|
3023
|
-
return /* @__PURE__ */ (0,
|
|
3203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `flex flex-col items-start ${isRoleChange ? "mt-3" : ""}`, children: [
|
|
3204
|
+
isRoleChange && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-[10px] text-gray-500 mb-1 ml-1", children: "Agent" }),
|
|
3205
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "max-w-[260px] rounded-2xl rounded-bl-md bg-white border border-gray-200 px-3 py-2 text-xs text-gray-800 shadow-sm", children: message.content })
|
|
3206
|
+
] }, message.id);
|
|
3024
3207
|
}
|
|
3025
3208
|
if (message.kind === "searchSummary") {
|
|
3026
|
-
return /* @__PURE__ */ (0,
|
|
3209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3027
3210
|
"div",
|
|
3028
3211
|
{
|
|
3029
3212
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3030
|
-
children: /* @__PURE__ */ (0,
|
|
3213
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3031
3214
|
AssistantSearchSummary,
|
|
3032
3215
|
{
|
|
3033
3216
|
title: message.title ?? "Search results",
|
|
@@ -3039,27 +3222,27 @@ ${userText}`
|
|
|
3039
3222
|
);
|
|
3040
3223
|
}
|
|
3041
3224
|
if (message.kind === "guideComplete") {
|
|
3042
|
-
return /* @__PURE__ */ (0,
|
|
3225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3043
3226
|
"div",
|
|
3044
3227
|
{
|
|
3045
3228
|
ref: isCurrentGuideStep ? currentStepRef : null,
|
|
3046
3229
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3047
|
-
children: /* @__PURE__ */ (0,
|
|
3048
|
-
/* @__PURE__ */ (0,
|
|
3049
|
-
/* @__PURE__ */ (0,
|
|
3230
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2 rounded-xl bg-green-50 border border-green-200 px-3 py-2.5 text-sm leading-6", children: [
|
|
3231
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-5 w-5 text-green-600 flex-shrink-0" }),
|
|
3232
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "font-medium text-green-800", children: message.content })
|
|
3050
3233
|
] })
|
|
3051
3234
|
},
|
|
3052
3235
|
message.id
|
|
3053
3236
|
);
|
|
3054
3237
|
}
|
|
3055
3238
|
if (message.kind === "navigationAction") {
|
|
3056
|
-
return /* @__PURE__ */ (0,
|
|
3239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3057
3240
|
"div",
|
|
3058
3241
|
{
|
|
3059
3242
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3060
3243
|
children: [
|
|
3061
|
-
/* @__PURE__ */ (0,
|
|
3062
|
-
message.navigationTarget && /* @__PURE__ */ (0,
|
|
3244
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700", children: message.content || "" }),
|
|
3245
|
+
message.navigationTarget && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3063
3246
|
Button,
|
|
3064
3247
|
{
|
|
3065
3248
|
type: "button",
|
|
@@ -3070,10 +3253,10 @@ ${userText}`
|
|
|
3070
3253
|
message.navigationTarget
|
|
3071
3254
|
),
|
|
3072
3255
|
children: [
|
|
3073
|
-
/* @__PURE__ */ (0,
|
|
3074
|
-
/* @__PURE__ */ (0,
|
|
3075
|
-
/* @__PURE__ */ (0,
|
|
3076
|
-
/* @__PURE__ */ (0,
|
|
3256
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Confirm" }),
|
|
3257
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
|
|
3258
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
|
|
3259
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
|
|
3077
3260
|
] })
|
|
3078
3261
|
]
|
|
3079
3262
|
}
|
|
@@ -3131,26 +3314,26 @@ ${userText}`
|
|
|
3131
3314
|
} else {
|
|
3132
3315
|
successContent = "Action completed successfully.";
|
|
3133
3316
|
}
|
|
3134
|
-
return /* @__PURE__ */ (0,
|
|
3317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3135
3318
|
"div",
|
|
3136
3319
|
{
|
|
3137
3320
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3138
|
-
children: /* @__PURE__ */ (0,
|
|
3321
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 text-gray-700", children: successContent })
|
|
3139
3322
|
},
|
|
3140
3323
|
message.id
|
|
3141
3324
|
);
|
|
3142
3325
|
}
|
|
3143
|
-
return /* @__PURE__ */ (0,
|
|
3326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3144
3327
|
"div",
|
|
3145
3328
|
{
|
|
3146
3329
|
className: `min-w-0 ${isRoleChange ? "mt-3" : ""}`,
|
|
3147
3330
|
children: [
|
|
3148
|
-
/* @__PURE__ */ (0,
|
|
3149
|
-
actionType === "updateCompanyInfo" && /* @__PURE__ */ (0,
|
|
3150
|
-
/* @__PURE__ */ (0,
|
|
3151
|
-
/* @__PURE__ */ (0,
|
|
3152
|
-
/* @__PURE__ */ (0,
|
|
3153
|
-
/* @__PURE__ */ (0,
|
|
3331
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700", children: message.content || "" }),
|
|
3332
|
+
actionType === "updateCompanyInfo" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden", children: [
|
|
3333
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
3334
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3335
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
|
|
3336
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3154
3337
|
Input,
|
|
3155
3338
|
{
|
|
3156
3339
|
placeholder: "Acme Corporation",
|
|
@@ -3163,9 +3346,9 @@ ${userText}`
|
|
|
3163
3346
|
}
|
|
3164
3347
|
)
|
|
3165
3348
|
] }),
|
|
3166
|
-
/* @__PURE__ */ (0,
|
|
3167
|
-
/* @__PURE__ */ (0,
|
|
3168
|
-
/* @__PURE__ */ (0,
|
|
3349
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3350
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
|
|
3351
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3169
3352
|
Input,
|
|
3170
3353
|
{
|
|
3171
3354
|
type: "email",
|
|
@@ -3180,9 +3363,9 @@ ${userText}`
|
|
|
3180
3363
|
)
|
|
3181
3364
|
] })
|
|
3182
3365
|
] }),
|
|
3183
|
-
/* @__PURE__ */ (0,
|
|
3184
|
-
/* @__PURE__ */ (0,
|
|
3185
|
-
/* @__PURE__ */ (0,
|
|
3366
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3367
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Address" }),
|
|
3368
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3186
3369
|
Input,
|
|
3187
3370
|
{
|
|
3188
3371
|
placeholder: "123 Main St, San Francisco, CA",
|
|
@@ -3195,10 +3378,10 @@ ${userText}`
|
|
|
3195
3378
|
}
|
|
3196
3379
|
)
|
|
3197
3380
|
] }),
|
|
3198
|
-
/* @__PURE__ */ (0,
|
|
3199
|
-
/* @__PURE__ */ (0,
|
|
3200
|
-
/* @__PURE__ */ (0,
|
|
3201
|
-
/* @__PURE__ */ (0,
|
|
3381
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
3382
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3383
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Phone" }),
|
|
3384
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3202
3385
|
Input,
|
|
3203
3386
|
{
|
|
3204
3387
|
type: "tel",
|
|
@@ -3212,9 +3395,9 @@ ${userText}`
|
|
|
3212
3395
|
}
|
|
3213
3396
|
)
|
|
3214
3397
|
] }),
|
|
3215
|
-
/* @__PURE__ */ (0,
|
|
3216
|
-
/* @__PURE__ */ (0,
|
|
3217
|
-
/* @__PURE__ */ (0,
|
|
3398
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3399
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Website" }),
|
|
3400
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3218
3401
|
Input,
|
|
3219
3402
|
{
|
|
3220
3403
|
type: "url",
|
|
@@ -3230,9 +3413,9 @@ ${userText}`
|
|
|
3230
3413
|
] })
|
|
3231
3414
|
] })
|
|
3232
3415
|
] }),
|
|
3233
|
-
actionType === "addApiKey" && /* @__PURE__ */ (0,
|
|
3234
|
-
/* @__PURE__ */ (0,
|
|
3235
|
-
/* @__PURE__ */ (0,
|
|
3416
|
+
actionType === "addApiKey" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3417
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "API Key Name" }),
|
|
3418
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3236
3419
|
Input,
|
|
3237
3420
|
{
|
|
3238
3421
|
placeholder: "Production Key",
|
|
@@ -3245,11 +3428,11 @@ ${userText}`
|
|
|
3245
3428
|
}
|
|
3246
3429
|
)
|
|
3247
3430
|
] }) }),
|
|
3248
|
-
actionType === "addCustomer" && /* @__PURE__ */ (0,
|
|
3249
|
-
/* @__PURE__ */ (0,
|
|
3250
|
-
/* @__PURE__ */ (0,
|
|
3251
|
-
/* @__PURE__ */ (0,
|
|
3252
|
-
/* @__PURE__ */ (0,
|
|
3431
|
+
actionType === "addCustomer" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden", children: [
|
|
3432
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
3433
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3434
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
|
|
3435
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3253
3436
|
Input,
|
|
3254
3437
|
{
|
|
3255
3438
|
placeholder: "Acme Corporation",
|
|
@@ -3262,9 +3445,9 @@ ${userText}`
|
|
|
3262
3445
|
}
|
|
3263
3446
|
)
|
|
3264
3447
|
] }),
|
|
3265
|
-
/* @__PURE__ */ (0,
|
|
3266
|
-
/* @__PURE__ */ (0,
|
|
3267
|
-
/* @__PURE__ */ (0,
|
|
3448
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3449
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
|
|
3450
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3268
3451
|
Input,
|
|
3269
3452
|
{
|
|
3270
3453
|
type: "email",
|
|
@@ -3279,9 +3462,9 @@ ${userText}`
|
|
|
3279
3462
|
)
|
|
3280
3463
|
] })
|
|
3281
3464
|
] }),
|
|
3282
|
-
/* @__PURE__ */ (0,
|
|
3283
|
-
/* @__PURE__ */ (0,
|
|
3284
|
-
/* @__PURE__ */ (0,
|
|
3465
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3466
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Location" }),
|
|
3467
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3285
3468
|
Input,
|
|
3286
3469
|
{
|
|
3287
3470
|
placeholder: "San Francisco, CA",
|
|
@@ -3294,9 +3477,9 @@ ${userText}`
|
|
|
3294
3477
|
}
|
|
3295
3478
|
)
|
|
3296
3479
|
] }),
|
|
3297
|
-
/* @__PURE__ */ (0,
|
|
3298
|
-
/* @__PURE__ */ (0,
|
|
3299
|
-
/* @__PURE__ */ (0,
|
|
3480
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3481
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Subscription Tier" }),
|
|
3482
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3300
3483
|
"select",
|
|
3301
3484
|
{
|
|
3302
3485
|
value: formData.subscription || "Starter",
|
|
@@ -3306,19 +3489,19 @@ ${userText}`
|
|
|
3306
3489
|
}),
|
|
3307
3490
|
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
3308
3491
|
children: [
|
|
3309
|
-
/* @__PURE__ */ (0,
|
|
3310
|
-
/* @__PURE__ */ (0,
|
|
3311
|
-
/* @__PURE__ */ (0,
|
|
3492
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Starter", children: "Starter" }),
|
|
3493
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Professional", children: "Professional" }),
|
|
3494
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Enterprise", children: "Enterprise" })
|
|
3312
3495
|
]
|
|
3313
3496
|
}
|
|
3314
3497
|
)
|
|
3315
3498
|
] })
|
|
3316
3499
|
] }),
|
|
3317
|
-
(actionType === "enable2FA" || actionType === "disable2FA") && /* @__PURE__ */ (0,
|
|
3318
|
-
actionType === "changePassword" && /* @__PURE__ */ (0,
|
|
3319
|
-
/* @__PURE__ */ (0,
|
|
3320
|
-
/* @__PURE__ */ (0,
|
|
3321
|
-
/* @__PURE__ */ (0,
|
|
3500
|
+
(actionType === "enable2FA" || actionType === "disable2FA") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: actionType === "enable2FA" ? "This will enable two-factor authentication for your account. You'll need to set up an authenticator app." : "This will disable two-factor authentication for your account. Your account will be less secure." }) }),
|
|
3501
|
+
actionType === "changePassword" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
3502
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3503
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Current Password" }),
|
|
3504
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3322
3505
|
Input,
|
|
3323
3506
|
{
|
|
3324
3507
|
type: "password",
|
|
@@ -3331,9 +3514,9 @@ ${userText}`
|
|
|
3331
3514
|
}
|
|
3332
3515
|
)
|
|
3333
3516
|
] }),
|
|
3334
|
-
/* @__PURE__ */ (0,
|
|
3335
|
-
/* @__PURE__ */ (0,
|
|
3336
|
-
/* @__PURE__ */ (0,
|
|
3517
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3518
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "New Password" }),
|
|
3519
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3337
3520
|
Input,
|
|
3338
3521
|
{
|
|
3339
3522
|
type: "password",
|
|
@@ -3346,9 +3529,9 @@ ${userText}`
|
|
|
3346
3529
|
}
|
|
3347
3530
|
)
|
|
3348
3531
|
] }),
|
|
3349
|
-
/* @__PURE__ */ (0,
|
|
3350
|
-
/* @__PURE__ */ (0,
|
|
3351
|
-
/* @__PURE__ */ (0,
|
|
3532
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3533
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Confirm New Password" }),
|
|
3534
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3352
3535
|
Input,
|
|
3353
3536
|
{
|
|
3354
3537
|
type: "password",
|
|
@@ -3362,10 +3545,10 @@ ${userText}`
|
|
|
3362
3545
|
)
|
|
3363
3546
|
] })
|
|
3364
3547
|
] }),
|
|
3365
|
-
actionType === "toggleNotification" && /* @__PURE__ */ (0,
|
|
3366
|
-
/* @__PURE__ */ (0,
|
|
3367
|
-
/* @__PURE__ */ (0,
|
|
3368
|
-
/* @__PURE__ */ (0,
|
|
3548
|
+
actionType === "toggleNotification" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
3549
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3550
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Notification Type" }),
|
|
3551
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3369
3552
|
"select",
|
|
3370
3553
|
{
|
|
3371
3554
|
value: formData.notificationType || "paymentReceived",
|
|
@@ -3375,17 +3558,17 @@ ${userText}`
|
|
|
3375
3558
|
}),
|
|
3376
3559
|
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
3377
3560
|
children: [
|
|
3378
|
-
/* @__PURE__ */ (0,
|
|
3379
|
-
/* @__PURE__ */ (0,
|
|
3380
|
-
/* @__PURE__ */ (0,
|
|
3381
|
-
/* @__PURE__ */ (0,
|
|
3382
|
-
/* @__PURE__ */ (0,
|
|
3561
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "paymentReceived", children: "Payment Received" }),
|
|
3562
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "paymentFailed", children: "Payment Failed" }),
|
|
3563
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "invoicePaid", children: "Invoice Paid" }),
|
|
3564
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "monthlySummary", children: "Monthly Summary" }),
|
|
3565
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "productUpdates", children: "Product Updates" })
|
|
3383
3566
|
]
|
|
3384
3567
|
}
|
|
3385
3568
|
)
|
|
3386
3569
|
] }),
|
|
3387
|
-
/* @__PURE__ */ (0,
|
|
3388
|
-
/* @__PURE__ */ (0,
|
|
3570
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3571
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3389
3572
|
"input",
|
|
3390
3573
|
{
|
|
3391
3574
|
type: "checkbox",
|
|
@@ -3397,12 +3580,12 @@ ${userText}`
|
|
|
3397
3580
|
className: "h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"
|
|
3398
3581
|
}
|
|
3399
3582
|
),
|
|
3400
|
-
/* @__PURE__ */ (0,
|
|
3583
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs text-black", children: "Enable this notification" })
|
|
3401
3584
|
] })
|
|
3402
3585
|
] }),
|
|
3403
|
-
(actionType === "connectIntegration" || actionType === "disconnectIntegration") && /* @__PURE__ */ (0,
|
|
3404
|
-
/* @__PURE__ */ (0,
|
|
3405
|
-
/* @__PURE__ */ (0,
|
|
3586
|
+
(actionType === "connectIntegration" || actionType === "disconnectIntegration") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3587
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Integration" }),
|
|
3588
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3406
3589
|
"select",
|
|
3407
3590
|
{
|
|
3408
3591
|
value: formData.integrationName || "Slack",
|
|
@@ -3412,17 +3595,17 @@ ${userText}`
|
|
|
3412
3595
|
}),
|
|
3413
3596
|
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
3414
3597
|
children: [
|
|
3415
|
-
/* @__PURE__ */ (0,
|
|
3416
|
-
/* @__PURE__ */ (0,
|
|
3417
|
-
/* @__PURE__ */ (0,
|
|
3598
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Slack", children: "Slack" }),
|
|
3599
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Zapier", children: "Zapier" }),
|
|
3600
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Webhook", children: "Webhook" })
|
|
3418
3601
|
]
|
|
3419
3602
|
}
|
|
3420
3603
|
)
|
|
3421
3604
|
] }) }),
|
|
3422
|
-
actionType === "addPaymentMethod" && /* @__PURE__ */ (0,
|
|
3423
|
-
/* @__PURE__ */ (0,
|
|
3424
|
-
/* @__PURE__ */ (0,
|
|
3425
|
-
/* @__PURE__ */ (0,
|
|
3605
|
+
actionType === "addPaymentMethod" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
3606
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3607
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Card Number" }),
|
|
3608
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3426
3609
|
Input,
|
|
3427
3610
|
{
|
|
3428
3611
|
placeholder: "1234 5678 9012 3456",
|
|
@@ -3435,9 +3618,9 @@ ${userText}`
|
|
|
3435
3618
|
}
|
|
3436
3619
|
)
|
|
3437
3620
|
] }),
|
|
3438
|
-
/* @__PURE__ */ (0,
|
|
3439
|
-
/* @__PURE__ */ (0,
|
|
3440
|
-
/* @__PURE__ */ (0,
|
|
3621
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3622
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Expiry Date" }),
|
|
3623
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3441
3624
|
Input,
|
|
3442
3625
|
{
|
|
3443
3626
|
placeholder: "MM/YY",
|
|
@@ -3451,11 +3634,11 @@ ${userText}`
|
|
|
3451
3634
|
)
|
|
3452
3635
|
] })
|
|
3453
3636
|
] }),
|
|
3454
|
-
actionType === "removePaymentMethod" && /* @__PURE__ */ (0,
|
|
3455
|
-
actionType === "refundPayment" && /* @__PURE__ */ (0,
|
|
3456
|
-
/* @__PURE__ */ (0,
|
|
3457
|
-
/* @__PURE__ */ (0,
|
|
3458
|
-
/* @__PURE__ */ (0,
|
|
3637
|
+
actionType === "removePaymentMethod" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: "This will remove the default payment method from your account." }) }),
|
|
3638
|
+
actionType === "refundPayment" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
3639
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3640
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Transaction ID or Customer Name" }),
|
|
3641
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3459
3642
|
Input,
|
|
3460
3643
|
{
|
|
3461
3644
|
placeholder: "e.g., txn_1234 or Acme Corp",
|
|
@@ -3480,9 +3663,9 @@ ${userText}`
|
|
|
3480
3663
|
}
|
|
3481
3664
|
)
|
|
3482
3665
|
] }),
|
|
3483
|
-
/* @__PURE__ */ (0,
|
|
3484
|
-
/* @__PURE__ */ (0,
|
|
3485
|
-
/* @__PURE__ */ (0,
|
|
3666
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3667
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Amount (optional)" }),
|
|
3668
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3486
3669
|
Input,
|
|
3487
3670
|
{
|
|
3488
3671
|
placeholder: "$0.00",
|
|
@@ -3495,9 +3678,9 @@ ${userText}`
|
|
|
3495
3678
|
}
|
|
3496
3679
|
)
|
|
3497
3680
|
] }),
|
|
3498
|
-
/* @__PURE__ */ (0,
|
|
3499
|
-
/* @__PURE__ */ (0,
|
|
3500
|
-
/* @__PURE__ */ (0,
|
|
3681
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3682
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Reason (optional)" }),
|
|
3683
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3501
3684
|
Input,
|
|
3502
3685
|
{
|
|
3503
3686
|
placeholder: "e.g., Customer request",
|
|
@@ -3511,10 +3694,10 @@ ${userText}`
|
|
|
3511
3694
|
)
|
|
3512
3695
|
] })
|
|
3513
3696
|
] }),
|
|
3514
|
-
actionType === "deleteApiKey" && /* @__PURE__ */ (0,
|
|
3515
|
-
/* @__PURE__ */ (0,
|
|
3516
|
-
/* @__PURE__ */ (0,
|
|
3517
|
-
/* @__PURE__ */ (0,
|
|
3697
|
+
actionType === "deleteApiKey" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
3698
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3699
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "API Key Name or ID" }),
|
|
3700
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3518
3701
|
Input,
|
|
3519
3702
|
{
|
|
3520
3703
|
placeholder: "Production Key",
|
|
@@ -3528,12 +3711,12 @@ ${userText}`
|
|
|
3528
3711
|
}
|
|
3529
3712
|
)
|
|
3530
3713
|
] }),
|
|
3531
|
-
/* @__PURE__ */ (0,
|
|
3714
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-red-600", children: "Warning: This action cannot be undone. The API key will be permanently deleted." })
|
|
3532
3715
|
] }),
|
|
3533
|
-
actionType === "addWebhook" && /* @__PURE__ */ (0,
|
|
3534
|
-
/* @__PURE__ */ (0,
|
|
3535
|
-
/* @__PURE__ */ (0,
|
|
3536
|
-
/* @__PURE__ */ (0,
|
|
3716
|
+
actionType === "addWebhook" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
3717
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3718
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Webhook URL" }),
|
|
3719
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3537
3720
|
Input,
|
|
3538
3721
|
{
|
|
3539
3722
|
type: "url",
|
|
@@ -3547,9 +3730,9 @@ ${userText}`
|
|
|
3547
3730
|
}
|
|
3548
3731
|
)
|
|
3549
3732
|
] }),
|
|
3550
|
-
/* @__PURE__ */ (0,
|
|
3551
|
-
/* @__PURE__ */ (0,
|
|
3552
|
-
/* @__PURE__ */ (0,
|
|
3733
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3734
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Name (optional)" }),
|
|
3735
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3553
3736
|
Input,
|
|
3554
3737
|
{
|
|
3555
3738
|
placeholder: "Production Webhook",
|
|
@@ -3563,9 +3746,9 @@ ${userText}`
|
|
|
3563
3746
|
)
|
|
3564
3747
|
] })
|
|
3565
3748
|
] }),
|
|
3566
|
-
actionType === "updateCurrency" && /* @__PURE__ */ (0,
|
|
3567
|
-
/* @__PURE__ */ (0,
|
|
3568
|
-
/* @__PURE__ */ (0,
|
|
3749
|
+
actionType === "updateCurrency" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3750
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Currency" }),
|
|
3751
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3569
3752
|
"select",
|
|
3570
3753
|
{
|
|
3571
3754
|
value: formData.currency || "USD",
|
|
@@ -3575,17 +3758,17 @@ ${userText}`
|
|
|
3575
3758
|
}),
|
|
3576
3759
|
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
3577
3760
|
children: [
|
|
3578
|
-
/* @__PURE__ */ (0,
|
|
3579
|
-
/* @__PURE__ */ (0,
|
|
3580
|
-
/* @__PURE__ */ (0,
|
|
3581
|
-
/* @__PURE__ */ (0,
|
|
3761
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "USD", children: "USD ($)" }),
|
|
3762
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "EUR", children: "EUR (\u20AC)" }),
|
|
3763
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "GBP", children: "GBP (\xA3)" }),
|
|
3764
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "JPY", children: "JPY (\xA5)" })
|
|
3582
3765
|
]
|
|
3583
3766
|
}
|
|
3584
3767
|
)
|
|
3585
3768
|
] }) }),
|
|
3586
|
-
actionType === "updateTimezone" && /* @__PURE__ */ (0,
|
|
3587
|
-
/* @__PURE__ */ (0,
|
|
3588
|
-
/* @__PURE__ */ (0,
|
|
3769
|
+
actionType === "updateTimezone" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3770
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Timezone" }),
|
|
3771
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3589
3772
|
"select",
|
|
3590
3773
|
{
|
|
3591
3774
|
value: formData.timezone || "America/Los_Angeles",
|
|
@@ -3595,18 +3778,18 @@ ${userText}`
|
|
|
3595
3778
|
}),
|
|
3596
3779
|
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
3597
3780
|
children: [
|
|
3598
|
-
/* @__PURE__ */ (0,
|
|
3599
|
-
/* @__PURE__ */ (0,
|
|
3600
|
-
/* @__PURE__ */ (0,
|
|
3601
|
-
/* @__PURE__ */ (0,
|
|
3781
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "America/Los_Angeles", children: "Pacific Time (PT)" }),
|
|
3782
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "America/New_York", children: "Eastern Time (ET)" }),
|
|
3783
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Europe/London", children: "GMT" }),
|
|
3784
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Asia/Tokyo", children: "JST" })
|
|
3602
3785
|
]
|
|
3603
3786
|
}
|
|
3604
3787
|
)
|
|
3605
3788
|
] }) }),
|
|
3606
|
-
actionType === "revokeSession" && /* @__PURE__ */ (0,
|
|
3607
|
-
/* @__PURE__ */ (0,
|
|
3608
|
-
/* @__PURE__ */ (0,
|
|
3609
|
-
/* @__PURE__ */ (0,
|
|
3789
|
+
actionType === "revokeSession" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
3790
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3791
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Device/Session" }),
|
|
3792
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3610
3793
|
Input,
|
|
3611
3794
|
{
|
|
3612
3795
|
placeholder: "MacBook Pro",
|
|
@@ -3619,12 +3802,12 @@ ${userText}`
|
|
|
3619
3802
|
}
|
|
3620
3803
|
)
|
|
3621
3804
|
] }),
|
|
3622
|
-
/* @__PURE__ */ (0,
|
|
3805
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: "This will sign out the device and invalidate its session." })
|
|
3623
3806
|
] }),
|
|
3624
|
-
actionType === "createSubscription" && /* @__PURE__ */ (0,
|
|
3625
|
-
/* @__PURE__ */ (0,
|
|
3626
|
-
/* @__PURE__ */ (0,
|
|
3627
|
-
/* @__PURE__ */ (0,
|
|
3807
|
+
actionType === "createSubscription" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
3808
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3809
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Customer Email" }),
|
|
3810
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3628
3811
|
Input,
|
|
3629
3812
|
{
|
|
3630
3813
|
type: "email",
|
|
@@ -3638,9 +3821,9 @@ ${userText}`
|
|
|
3638
3821
|
}
|
|
3639
3822
|
)
|
|
3640
3823
|
] }),
|
|
3641
|
-
/* @__PURE__ */ (0,
|
|
3642
|
-
/* @__PURE__ */ (0,
|
|
3643
|
-
/* @__PURE__ */ (0,
|
|
3824
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3825
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Plan" }),
|
|
3826
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3644
3827
|
"select",
|
|
3645
3828
|
{
|
|
3646
3829
|
value: formData.plan || "Starter",
|
|
@@ -3650,16 +3833,16 @@ ${userText}`
|
|
|
3650
3833
|
}),
|
|
3651
3834
|
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
3652
3835
|
children: [
|
|
3653
|
-
/* @__PURE__ */ (0,
|
|
3654
|
-
/* @__PURE__ */ (0,
|
|
3655
|
-
/* @__PURE__ */ (0,
|
|
3836
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Starter", children: "Starter ($29/mo)" }),
|
|
3837
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Professional", children: "Professional ($99/mo)" }),
|
|
3838
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Enterprise", children: "Enterprise ($299/mo)" })
|
|
3656
3839
|
]
|
|
3657
3840
|
}
|
|
3658
3841
|
)
|
|
3659
3842
|
] }),
|
|
3660
|
-
/* @__PURE__ */ (0,
|
|
3661
|
-
/* @__PURE__ */ (0,
|
|
3662
|
-
/* @__PURE__ */ (0,
|
|
3843
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3844
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Billing Cycle" }),
|
|
3845
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3663
3846
|
"select",
|
|
3664
3847
|
{
|
|
3665
3848
|
value: formData.billingCycle || "monthly",
|
|
@@ -3669,18 +3852,18 @@ ${userText}`
|
|
|
3669
3852
|
}),
|
|
3670
3853
|
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
3671
3854
|
children: [
|
|
3672
|
-
/* @__PURE__ */ (0,
|
|
3673
|
-
/* @__PURE__ */ (0,
|
|
3855
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "monthly", children: "Monthly" }),
|
|
3856
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "yearly", children: "Yearly (Save 15%)" })
|
|
3674
3857
|
]
|
|
3675
3858
|
}
|
|
3676
3859
|
)
|
|
3677
3860
|
] })
|
|
3678
3861
|
] }),
|
|
3679
|
-
actionType === "exportCertificate" && /* @__PURE__ */ (0,
|
|
3680
|
-
/* @__PURE__ */ (0,
|
|
3681
|
-
/* @__PURE__ */ (0,
|
|
3682
|
-
/* @__PURE__ */ (0,
|
|
3683
|
-
/* @__PURE__ */ (0,
|
|
3862
|
+
actionType === "exportCertificate" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
3863
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: "This will export your certificate of incorporation document." }),
|
|
3864
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3865
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Format" }),
|
|
3866
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3684
3867
|
"select",
|
|
3685
3868
|
{
|
|
3686
3869
|
value: formData.format || "pdf",
|
|
@@ -3690,17 +3873,17 @@ ${userText}`
|
|
|
3690
3873
|
}),
|
|
3691
3874
|
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
3692
3875
|
children: [
|
|
3693
|
-
/* @__PURE__ */ (0,
|
|
3694
|
-
/* @__PURE__ */ (0,
|
|
3876
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "pdf", children: "PDF" }),
|
|
3877
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "json", children: "JSON" })
|
|
3695
3878
|
]
|
|
3696
3879
|
}
|
|
3697
3880
|
)
|
|
3698
3881
|
] })
|
|
3699
3882
|
] }),
|
|
3700
|
-
(actionType === "toggleBlockRule" || actionType === "enableBlockRule" || actionType === "disableBlockRule") && /* @__PURE__ */ (0,
|
|
3701
|
-
/* @__PURE__ */ (0,
|
|
3702
|
-
/* @__PURE__ */ (0,
|
|
3703
|
-
/* @__PURE__ */ (0,
|
|
3883
|
+
(actionType === "toggleBlockRule" || actionType === "enableBlockRule" || actionType === "disableBlockRule") && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
|
|
3884
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
3885
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Block Rule" }),
|
|
3886
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3704
3887
|
"select",
|
|
3705
3888
|
{
|
|
3706
3889
|
value: formData.ruleId || "rule_1",
|
|
@@ -3710,17 +3893,17 @@ ${userText}`
|
|
|
3710
3893
|
}),
|
|
3711
3894
|
className: "h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",
|
|
3712
3895
|
children: [
|
|
3713
|
-
/* @__PURE__ */ (0,
|
|
3714
|
-
/* @__PURE__ */ (0,
|
|
3715
|
-
/* @__PURE__ */ (0,
|
|
3716
|
-
/* @__PURE__ */ (0,
|
|
3896
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_1", children: "Block if risk level = 'highest'" }),
|
|
3897
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_2", children: "Block if matches Stripe block lists" }),
|
|
3898
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_3", children: "Block if CVC verification fails" }),
|
|
3899
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_4", children: "Block if Postal code verification fails" })
|
|
3717
3900
|
]
|
|
3718
3901
|
}
|
|
3719
3902
|
)
|
|
3720
3903
|
] }),
|
|
3721
|
-
/* @__PURE__ */ (0,
|
|
3904
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: actionType === "enableBlockRule" ? "This will enable the selected block rule to actively block matching payments." : actionType === "disableBlockRule" ? "This will disable the selected block rule. Matching payments will no longer be blocked." : "This will toggle the selected block rule's state." })
|
|
3722
3905
|
] }),
|
|
3723
|
-
/* @__PURE__ */ (0,
|
|
3906
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3724
3907
|
Button,
|
|
3725
3908
|
{
|
|
3726
3909
|
type: "button",
|
|
@@ -3729,10 +3912,10 @@ ${userText}`
|
|
|
3729
3912
|
className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
|
|
3730
3913
|
onClick: handleActionSubmit,
|
|
3731
3914
|
children: [
|
|
3732
|
-
/* @__PURE__ */ (0,
|
|
3733
|
-
/* @__PURE__ */ (0,
|
|
3734
|
-
/* @__PURE__ */ (0,
|
|
3735
|
-
/* @__PURE__ */ (0,
|
|
3915
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Confirm" }),
|
|
3916
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
|
|
3917
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
|
|
3918
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
|
|
3736
3919
|
] })
|
|
3737
3920
|
]
|
|
3738
3921
|
}
|
|
@@ -3743,25 +3926,25 @@ ${userText}`
|
|
|
3743
3926
|
);
|
|
3744
3927
|
}
|
|
3745
3928
|
if (message.kind === "bulkPreview" && message.csvData) {
|
|
3746
|
-
return /* @__PURE__ */ (0,
|
|
3929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3747
3930
|
"div",
|
|
3748
3931
|
{
|
|
3749
3932
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3750
3933
|
children: [
|
|
3751
|
-
/* @__PURE__ */ (0,
|
|
3752
|
-
/* @__PURE__ */ (0,
|
|
3753
|
-
/* @__PURE__ */ (0,
|
|
3754
|
-
/* @__PURE__ */ (0,
|
|
3755
|
-
/* @__PURE__ */ (0,
|
|
3756
|
-
/* @__PURE__ */ (0,
|
|
3934
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700", children: message.content || "" }),
|
|
3935
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "bg-gray-50 rounded-lg border border-gray-200 overflow-hidden", children: [
|
|
3936
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "bg-gray-100 px-3 py-2 border-b border-gray-200 flex items-center gap-2", children: [
|
|
3937
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-4 w-4 text-gray-600" }),
|
|
3938
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs font-medium text-gray-700", children: message.csvData.fileName }),
|
|
3939
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-xs text-gray-500", children: [
|
|
3757
3940
|
"\u2022 ",
|
|
3758
3941
|
message.csvData.rowCount,
|
|
3759
3942
|
" rows"
|
|
3760
3943
|
] })
|
|
3761
3944
|
] }),
|
|
3762
|
-
/* @__PURE__ */ (0,
|
|
3763
|
-
/* @__PURE__ */ (0,
|
|
3764
|
-
/* @__PURE__ */ (0,
|
|
3945
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-3 py-2 border-b border-gray-100", children: [
|
|
3946
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 mb-1", children: "Columns" }),
|
|
3947
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-wrap gap-1", children: message.csvData.columns.map((col, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3765
3948
|
"span",
|
|
3766
3949
|
{
|
|
3767
3950
|
className: "text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",
|
|
@@ -3770,23 +3953,23 @@ ${userText}`
|
|
|
3770
3953
|
i
|
|
3771
3954
|
)) })
|
|
3772
3955
|
] }),
|
|
3773
|
-
message.csvData.sampleRows.length > 0 && /* @__PURE__ */ (0,
|
|
3774
|
-
/* @__PURE__ */ (0,
|
|
3775
|
-
/* @__PURE__ */ (0,
|
|
3956
|
+
message.csvData.sampleRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-3 py-2", children: [
|
|
3957
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 mb-1", children: "Sample Data" }),
|
|
3958
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-1", children: message.csvData.sampleRows.slice(0, 3).map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3776
3959
|
"div",
|
|
3777
3960
|
{
|
|
3778
3961
|
className: "text-xs text-gray-600 bg-white rounded px-2 py-1 border border-gray-100",
|
|
3779
3962
|
children: [
|
|
3780
|
-
Object.entries(row).slice(0, 3).map(([key, val], j) => /* @__PURE__ */ (0,
|
|
3963
|
+
Object.entries(row).slice(0, 3).map(([key, val], j) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
3781
3964
|
j > 0 && " \u2022 ",
|
|
3782
|
-
/* @__PURE__ */ (0,
|
|
3965
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-gray-400", children: [
|
|
3783
3966
|
key,
|
|
3784
3967
|
":"
|
|
3785
3968
|
] }),
|
|
3786
3969
|
" ",
|
|
3787
3970
|
val
|
|
3788
3971
|
] }, key)),
|
|
3789
|
-
Object.keys(row).length > 3 && /* @__PURE__ */ (0,
|
|
3972
|
+
Object.keys(row).length > 3 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-gray-400", children: [
|
|
3790
3973
|
" ",
|
|
3791
3974
|
"..."
|
|
3792
3975
|
] })
|
|
@@ -3795,14 +3978,14 @@ ${userText}`
|
|
|
3795
3978
|
i
|
|
3796
3979
|
)) })
|
|
3797
3980
|
] }),
|
|
3798
|
-
message.suggestedAction && /* @__PURE__ */ (0,
|
|
3981
|
+
message.suggestedAction && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "px-3 py-2 bg-blue-50 border-t border-blue-100", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-xs text-blue-700", children: [
|
|
3799
3982
|
"Suggested action:",
|
|
3800
3983
|
" ",
|
|
3801
|
-
/* @__PURE__ */ (0,
|
|
3984
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: message.suggestedAction.replace(/_/g, " ") })
|
|
3802
3985
|
] }) })
|
|
3803
3986
|
] }),
|
|
3804
|
-
message.bulkSessionId && /* @__PURE__ */ (0,
|
|
3805
|
-
/* @__PURE__ */ (0,
|
|
3987
|
+
message.bulkSessionId && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
|
|
3988
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3806
3989
|
Button,
|
|
3807
3990
|
{
|
|
3808
3991
|
type: "button",
|
|
@@ -3811,19 +3994,19 @@ ${userText}`
|
|
|
3811
3994
|
className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
|
|
3812
3995
|
onClick: () => message.bulkSessionId && confirmBulkOperation(message.bulkSessionId),
|
|
3813
3996
|
children: [
|
|
3814
|
-
/* @__PURE__ */ (0,
|
|
3997
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
3815
3998
|
"Process ",
|
|
3816
3999
|
message.csvData.rowCount,
|
|
3817
4000
|
" rows"
|
|
3818
4001
|
] }),
|
|
3819
|
-
/* @__PURE__ */ (0,
|
|
3820
|
-
/* @__PURE__ */ (0,
|
|
3821
|
-
/* @__PURE__ */ (0,
|
|
4002
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
|
|
4003
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
|
|
4004
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
|
|
3822
4005
|
] })
|
|
3823
4006
|
]
|
|
3824
4007
|
}
|
|
3825
4008
|
),
|
|
3826
|
-
/* @__PURE__ */ (0,
|
|
4009
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3827
4010
|
Button,
|
|
3828
4011
|
{
|
|
3829
4012
|
type: "button",
|
|
@@ -3843,35 +4026,35 @@ ${userText}`
|
|
|
3843
4026
|
if (message.kind === "bulkProgress" && message.bulkProgress) {
|
|
3844
4027
|
const { processed, total, successes, failures } = message.bulkProgress;
|
|
3845
4028
|
const percentage = Math.round(processed / total * 100);
|
|
3846
|
-
return /* @__PURE__ */ (0,
|
|
4029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3847
4030
|
"div",
|
|
3848
4031
|
{
|
|
3849
4032
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3850
|
-
children: /* @__PURE__ */ (0,
|
|
3851
|
-
/* @__PURE__ */ (0,
|
|
3852
|
-
/* @__PURE__ */ (0,
|
|
3853
|
-
/* @__PURE__ */ (0,
|
|
4033
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "bg-gray-50 rounded-lg border border-gray-200 p-3", children: [
|
|
4034
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
4035
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Loader2, { className: "h-4 w-4 animate-spin text-blue-600" }),
|
|
4036
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-sm font-medium text-gray-700", children: [
|
|
3854
4037
|
"Processing... ",
|
|
3855
4038
|
processed,
|
|
3856
4039
|
" of ",
|
|
3857
4040
|
total
|
|
3858
4041
|
] })
|
|
3859
4042
|
] }),
|
|
3860
|
-
/* @__PURE__ */ (0,
|
|
4043
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-2 bg-gray-200 rounded-full overflow-hidden mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3861
4044
|
"div",
|
|
3862
4045
|
{
|
|
3863
4046
|
className: "h-full bg-blue-600 transition-all duration-300",
|
|
3864
4047
|
style: { width: `${percentage}%` }
|
|
3865
4048
|
}
|
|
3866
4049
|
) }),
|
|
3867
|
-
/* @__PURE__ */ (0,
|
|
3868
|
-
/* @__PURE__ */ (0,
|
|
3869
|
-
/* @__PURE__ */ (0,
|
|
4050
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-600", children: [
|
|
4051
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1", children: [
|
|
4052
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3 text-green-600" }),
|
|
3870
4053
|
successes,
|
|
3871
4054
|
" successful"
|
|
3872
4055
|
] }),
|
|
3873
|
-
failures > 0 && /* @__PURE__ */ (0,
|
|
3874
|
-
/* @__PURE__ */ (0,
|
|
4056
|
+
failures > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
|
|
4057
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
|
|
3875
4058
|
failures,
|
|
3876
4059
|
" failed"
|
|
3877
4060
|
] })
|
|
@@ -3885,41 +4068,41 @@ ${userText}`
|
|
|
3885
4068
|
const { total, successes, failures, navigationPage } = message.bulkSummary;
|
|
3886
4069
|
const hasFailures = failures.length > 0;
|
|
3887
4070
|
const pageLabel = navigationPage?.page === "customers" ? "Customers" : navigationPage?.page === "dashboard" ? "Dashboard" : navigationPage?.page === "settings" ? "Settings" : "Results";
|
|
3888
|
-
return /* @__PURE__ */ (0,
|
|
4071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3889
4072
|
"div",
|
|
3890
4073
|
{
|
|
3891
4074
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
3892
|
-
children: /* @__PURE__ */ (0,
|
|
4075
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3893
4076
|
"div",
|
|
3894
4077
|
{
|
|
3895
4078
|
className: `rounded-lg border p-3 ${hasFailures ? "bg-amber-50 border-amber-200" : "bg-green-50 border-green-200"}`,
|
|
3896
4079
|
children: [
|
|
3897
|
-
/* @__PURE__ */ (0,
|
|
3898
|
-
/* @__PURE__ */ (0,
|
|
4080
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
4081
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3899
4082
|
import_lucide_react4.CheckCircle2,
|
|
3900
4083
|
{
|
|
3901
4084
|
className: `h-5 w-5 ${hasFailures ? "text-amber-600" : "text-green-600"}`
|
|
3902
4085
|
}
|
|
3903
4086
|
),
|
|
3904
|
-
/* @__PURE__ */ (0,
|
|
4087
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm font-medium text-gray-800", children: "Bulk operation complete" })
|
|
3905
4088
|
] }),
|
|
3906
|
-
/* @__PURE__ */ (0,
|
|
3907
|
-
/* @__PURE__ */ (0,
|
|
3908
|
-
/* @__PURE__ */ (0,
|
|
3909
|
-
/* @__PURE__ */ (0,
|
|
4089
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-sm text-gray-600 mb-2", children: message.content || `Processed ${total} rows: ${successes} successful${hasFailures ? `, ${failures.length} failed` : ""}.` }),
|
|
4090
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-4 text-xs", children: [
|
|
4091
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-green-700", children: [
|
|
4092
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3" }),
|
|
3910
4093
|
successes,
|
|
3911
4094
|
" successful"
|
|
3912
4095
|
] }),
|
|
3913
|
-
hasFailures && /* @__PURE__ */ (0,
|
|
3914
|
-
/* @__PURE__ */ (0,
|
|
4096
|
+
hasFailures && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
|
|
4097
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
|
|
3915
4098
|
failures.length,
|
|
3916
4099
|
" failed"
|
|
3917
4100
|
] })
|
|
3918
4101
|
] }),
|
|
3919
|
-
hasFailures && /* @__PURE__ */ (0,
|
|
3920
|
-
/* @__PURE__ */ (0,
|
|
3921
|
-
/* @__PURE__ */ (0,
|
|
3922
|
-
failures.slice(0, 5).map((failure, i) => /* @__PURE__ */ (0,
|
|
4102
|
+
hasFailures && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 pt-2 border-t border-amber-200", children: [
|
|
4103
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-amber-700 mb-1", children: "Failed Rows" }),
|
|
4104
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-1 max-h-32 overflow-y-auto", children: [
|
|
4105
|
+
failures.slice(0, 5).map((failure, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3923
4106
|
"div",
|
|
3924
4107
|
{
|
|
3925
4108
|
className: "text-xs text-red-700 bg-red-50 rounded px-2 py-1",
|
|
@@ -3933,14 +4116,14 @@ ${userText}`
|
|
|
3933
4116
|
},
|
|
3934
4117
|
i
|
|
3935
4118
|
)),
|
|
3936
|
-
failures.length > 5 && /* @__PURE__ */ (0,
|
|
4119
|
+
failures.length > 5 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "text-xs text-amber-600", children: [
|
|
3937
4120
|
"...and ",
|
|
3938
4121
|
failures.length - 5,
|
|
3939
4122
|
" more"
|
|
3940
4123
|
] })
|
|
3941
4124
|
] })
|
|
3942
4125
|
] }),
|
|
3943
|
-
navigationPage && successes > 0 && /* @__PURE__ */ (0,
|
|
4126
|
+
navigationPage && successes > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3 pt-2 border-t border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3944
4127
|
"button",
|
|
3945
4128
|
{
|
|
3946
4129
|
type: "button",
|
|
@@ -3973,12 +4156,12 @@ ${userText}`
|
|
|
3973
4156
|
},
|
|
3974
4157
|
className: "flex items-center gap-2 text-xs text-gray-500 hover:text-gray-700 transition-colors group cursor-pointer",
|
|
3975
4158
|
children: [
|
|
3976
|
-
/* @__PURE__ */ (0,
|
|
3977
|
-
/* @__PURE__ */ (0,
|
|
3978
|
-
/* @__PURE__ */ (0,
|
|
3979
|
-
/* @__PURE__ */ (0,
|
|
4159
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 px-1.5 py-0.5 bg-gray-100 rounded text-[10px] font-medium text-gray-600 group-hover:bg-gray-200", children: [
|
|
4160
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-2.5 w-2.5" }),
|
|
4161
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "+" }),
|
|
4162
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-2.5 w-2.5" })
|
|
3980
4163
|
] }),
|
|
3981
|
-
/* @__PURE__ */ (0,
|
|
4164
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
3982
4165
|
"View ",
|
|
3983
4166
|
pageLabel
|
|
3984
4167
|
] })
|
|
@@ -3992,19 +4175,19 @@ ${userText}`
|
|
|
3992
4175
|
message.id
|
|
3993
4176
|
);
|
|
3994
4177
|
}
|
|
3995
|
-
return /* @__PURE__ */ (0,
|
|
4178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(React4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3996
4179
|
"div",
|
|
3997
4180
|
{
|
|
3998
4181
|
ref: isCurrentGuideStep ? currentStepRef : null,
|
|
3999
4182
|
className: `${isRoleChange ? "mt-3" : ""}`,
|
|
4000
4183
|
children: [
|
|
4001
|
-
/* @__PURE__ */ (0,
|
|
4184
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-sm leading-6 text-gray-700", children: (() => {
|
|
4002
4185
|
const text = message.content || "";
|
|
4003
4186
|
if (message.kind === "guideStep") {
|
|
4004
4187
|
const m = text.match(/^(Step\s+\d+:)([\s\S]*)/);
|
|
4005
4188
|
if (m) {
|
|
4006
|
-
return /* @__PURE__ */ (0,
|
|
4007
|
-
/* @__PURE__ */ (0,
|
|
4189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
4190
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: m[1] }),
|
|
4008
4191
|
m[2]
|
|
4009
4192
|
] });
|
|
4010
4193
|
}
|
|
@@ -4012,16 +4195,16 @@ ${userText}`
|
|
|
4012
4195
|
if (message.role === "assistant" && text) {
|
|
4013
4196
|
return renderMarkdown(text);
|
|
4014
4197
|
}
|
|
4015
|
-
return text || /* @__PURE__ */ (0,
|
|
4198
|
+
return text || /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "opacity-70", children: "Thinking\u2026" });
|
|
4016
4199
|
})() }),
|
|
4017
|
-
message.role === "assistant" && message.structuredData && /* @__PURE__ */ (0,
|
|
4200
|
+
message.role === "assistant" && message.structuredData && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4018
4201
|
DataRenderer,
|
|
4019
4202
|
{
|
|
4020
4203
|
type: message.structuredData.type,
|
|
4021
4204
|
data: message.structuredData.data
|
|
4022
4205
|
}
|
|
4023
4206
|
) }),
|
|
4024
|
-
message.role === "assistant" && message.followups && message.followups.length > 0 && !message.followupSelected && /* @__PURE__ */ (0,
|
|
4207
|
+
message.role === "assistant" && message.followups && message.followups.length > 0 && !message.followupSelected && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3 flex flex-wrap gap-1.5", children: message.followups.map((followup) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4025
4208
|
"button",
|
|
4026
4209
|
{
|
|
4027
4210
|
type: "button",
|
|
@@ -4035,8 +4218,8 @@ ${userText}`
|
|
|
4035
4218
|
}
|
|
4036
4219
|
) }, message.id);
|
|
4037
4220
|
}),
|
|
4038
|
-
(activeGuide || guideComplete) && /* @__PURE__ */ (0,
|
|
4039
|
-
activeGuide && activeGuide.stepIndex > 0 && /* @__PURE__ */ (0,
|
|
4221
|
+
(activeGuide || guideComplete) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
|
|
4222
|
+
activeGuide && activeGuide.stepIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4040
4223
|
Button,
|
|
4041
4224
|
{
|
|
4042
4225
|
type: "button",
|
|
@@ -4044,10 +4227,10 @@ ${userText}`
|
|
|
4044
4227
|
variant: "secondary",
|
|
4045
4228
|
className: "h-7 w-7 rounded-full p-0 bg-gray-100 hover:bg-gray-200 border border-gray-200",
|
|
4046
4229
|
onClick: goBackGuide,
|
|
4047
|
-
children: /* @__PURE__ */ (0,
|
|
4230
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowLeft, { className: "h-3.5 w-3.5 text-gray-600" })
|
|
4048
4231
|
}
|
|
4049
4232
|
),
|
|
4050
|
-
/* @__PURE__ */ (0,
|
|
4233
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4051
4234
|
Button,
|
|
4052
4235
|
{
|
|
4053
4236
|
type: "button",
|
|
@@ -4056,31 +4239,32 @@ ${userText}`
|
|
|
4056
4239
|
className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
|
|
4057
4240
|
onClick: guideComplete ? handleBack : advanceGuide,
|
|
4058
4241
|
children: [
|
|
4059
|
-
/* @__PURE__ */ (0,
|
|
4060
|
-
/* @__PURE__ */ (0,
|
|
4061
|
-
/* @__PURE__ */ (0,
|
|
4062
|
-
/* @__PURE__ */ (0,
|
|
4242
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: guideComplete ? "Done" : "Next" }),
|
|
4243
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
|
|
4244
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
|
|
4245
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
|
|
4063
4246
|
] })
|
|
4064
4247
|
]
|
|
4065
4248
|
}
|
|
4066
4249
|
)
|
|
4067
4250
|
] }),
|
|
4068
|
-
(phase === "thinking" || phase === "searching" || phase === "executing" || phase === "responding") && /* @__PURE__ */ (0,
|
|
4251
|
+
(phase === "thinking" || phase === "searching" || phase === "executing" || phase === "responding") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `${lastRole === "user" ? "mt-3" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4069
4252
|
AssistantActivity,
|
|
4070
4253
|
{
|
|
4071
4254
|
phase,
|
|
4072
4255
|
progressSteps
|
|
4073
4256
|
}
|
|
4074
4257
|
) }),
|
|
4075
|
-
|
|
4258
|
+
isEscalated && agentIsTyping && phase === "idle" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TypingIndicator, {}) }),
|
|
4259
|
+
!activeGuide && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: messagesEndRef })
|
|
4076
4260
|
] }) }) }) })
|
|
4077
4261
|
}
|
|
4078
4262
|
),
|
|
4079
|
-
/* @__PURE__ */ (0,
|
|
4080
|
-
pendingFile && /* @__PURE__ */ (0,
|
|
4081
|
-
/* @__PURE__ */ (0,
|
|
4082
|
-
/* @__PURE__ */ (0,
|
|
4083
|
-
/* @__PURE__ */ (0,
|
|
4263
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-4 py-3 border-t border-gray-100 bg-gray-50/50 shrink-0", children: [
|
|
4264
|
+
pendingFile && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mb-2 flex items-center gap-2 rounded-xl bg-blue-50 border border-blue-200 px-3 py-2", children: [
|
|
4265
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-4 w-4 text-blue-600" }),
|
|
4266
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-blue-700 flex-1 truncate", children: pendingFile.name }),
|
|
4267
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4084
4268
|
"button",
|
|
4085
4269
|
{
|
|
4086
4270
|
type: "button",
|
|
@@ -4089,12 +4273,12 @@ ${userText}`
|
|
|
4089
4273
|
if (fileInputRef.current) fileInputRef.current.value = "";
|
|
4090
4274
|
},
|
|
4091
4275
|
className: "text-blue-600 hover:text-blue-800",
|
|
4092
|
-
children: /* @__PURE__ */ (0,
|
|
4276
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-4 w-4" })
|
|
4093
4277
|
}
|
|
4094
4278
|
)
|
|
4095
4279
|
] }),
|
|
4096
|
-
/* @__PURE__ */ (0,
|
|
4097
|
-
/* @__PURE__ */ (0,
|
|
4280
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { onSubmit: handleSubmit, className: "w-full", children: [
|
|
4281
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4098
4282
|
"input",
|
|
4099
4283
|
{
|
|
4100
4284
|
ref: fileInputRef,
|
|
@@ -4109,8 +4293,8 @@ ${userText}`
|
|
|
4109
4293
|
}
|
|
4110
4294
|
}
|
|
4111
4295
|
),
|
|
4112
|
-
/* @__PURE__ */ (0,
|
|
4113
|
-
/* @__PURE__ */ (0,
|
|
4296
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex w-full items-start gap-2 rounded-xl border border-gray-200 bg-white px-3 py-2 shadow-sm", children: [
|
|
4297
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4114
4298
|
Button,
|
|
4115
4299
|
{
|
|
4116
4300
|
type: "button",
|
|
@@ -4119,15 +4303,20 @@ ${userText}`
|
|
|
4119
4303
|
onClick: () => fileInputRef.current?.click(),
|
|
4120
4304
|
className: "h-5 w-5 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100",
|
|
4121
4305
|
title: "Upload CSV for bulk operations",
|
|
4122
|
-
children: /* @__PURE__ */ (0,
|
|
4306
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Paperclip, { className: "h-2.5 w-2.5" })
|
|
4123
4307
|
}
|
|
4124
4308
|
),
|
|
4125
|
-
/* @__PURE__ */ (0,
|
|
4309
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4126
4310
|
"textarea",
|
|
4127
4311
|
{
|
|
4128
4312
|
placeholder: pendingFile ? "Describe what to do with this CSV..." : "Ask anything...",
|
|
4129
4313
|
value: input,
|
|
4130
|
-
onChange: (e) =>
|
|
4314
|
+
onChange: (e) => {
|
|
4315
|
+
setInput(e.target.value);
|
|
4316
|
+
if (e.target.value.length > 0) {
|
|
4317
|
+
handleTypingStart();
|
|
4318
|
+
}
|
|
4319
|
+
},
|
|
4131
4320
|
rows: 1,
|
|
4132
4321
|
className: "flex-1 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 text-sm placeholder:text-gray-400 resize-none overflow-hidden outline-none",
|
|
4133
4322
|
style: { minHeight: "20px", maxHeight: "120px" },
|
|
@@ -4178,20 +4367,20 @@ ${userText}`
|
|
|
4178
4367
|
}
|
|
4179
4368
|
}
|
|
4180
4369
|
),
|
|
4181
|
-
/* @__PURE__ */ (0,
|
|
4370
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4182
4371
|
Button,
|
|
4183
4372
|
{
|
|
4184
4373
|
type: "submit",
|
|
4185
4374
|
size: "icon",
|
|
4186
4375
|
disabled: !input.trim() && !pendingFile,
|
|
4187
4376
|
className: "h-6 w-6 rounded-full bg-gray-900 hover:bg-gray-800 disabled:bg-gray-300",
|
|
4188
|
-
children: /* @__PURE__ */ (0,
|
|
4377
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowUp, { className: "h-2.5 w-2.5" })
|
|
4189
4378
|
}
|
|
4190
4379
|
)
|
|
4191
4380
|
] })
|
|
4192
4381
|
] })
|
|
4193
4382
|
] }),
|
|
4194
|
-
/* @__PURE__ */ (0,
|
|
4383
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4195
4384
|
GuideCursor,
|
|
4196
4385
|
{
|
|
4197
4386
|
x: cursorState.x,
|
|
@@ -4209,7 +4398,7 @@ function PanelToggle({
|
|
|
4209
4398
|
onClick,
|
|
4210
4399
|
className = ""
|
|
4211
4400
|
}) {
|
|
4212
|
-
return /* @__PURE__ */ (0,
|
|
4401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4213
4402
|
"button",
|
|
4214
4403
|
{
|
|
4215
4404
|
type: "button",
|
|
@@ -4220,7 +4409,7 @@ function PanelToggle({
|
|
|
4220
4409
|
right: isOpen ? `${PANEL_WIDTH}px` : "0px",
|
|
4221
4410
|
transform: "translateY(-50%)"
|
|
4222
4411
|
},
|
|
4223
|
-
children: isOpen ? /* @__PURE__ */ (0,
|
|
4412
|
+
children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ChevronRight, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ChevronLeft, { className: "h-4 w-4" })
|
|
4224
4413
|
}
|
|
4225
4414
|
);
|
|
4226
4415
|
}
|
|
@@ -4238,7 +4427,9 @@ function ChatPanelWithToggle({
|
|
|
4238
4427
|
orgId,
|
|
4239
4428
|
userName,
|
|
4240
4429
|
userEmail,
|
|
4241
|
-
userOrganization
|
|
4430
|
+
userOrganization,
|
|
4431
|
+
supabaseUrl,
|
|
4432
|
+
supabaseAnonKey
|
|
4242
4433
|
}) {
|
|
4243
4434
|
const [internalIsOpen, setInternalIsOpen] = React4.useState(defaultOpen);
|
|
4244
4435
|
const isOpen = controlledIsOpen !== void 0 ? controlledIsOpen : internalIsOpen;
|
|
@@ -4258,7 +4449,7 @@ function ChatPanelWithToggle({
|
|
|
4258
4449
|
document.body.style.transition = originalTransition;
|
|
4259
4450
|
};
|
|
4260
4451
|
}, [isOpen]);
|
|
4261
|
-
return /* @__PURE__ */ (0,
|
|
4452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4262
4453
|
ChatPanel,
|
|
4263
4454
|
{
|
|
4264
4455
|
isOpen,
|
|
@@ -4274,25 +4465,27 @@ function ChatPanelWithToggle({
|
|
|
4274
4465
|
orgId,
|
|
4275
4466
|
userName,
|
|
4276
4467
|
userEmail,
|
|
4277
|
-
userOrganization
|
|
4468
|
+
userOrganization,
|
|
4469
|
+
supabaseUrl,
|
|
4470
|
+
supabaseAnonKey
|
|
4278
4471
|
}
|
|
4279
4472
|
);
|
|
4280
4473
|
}
|
|
4281
4474
|
function HelpButton({ onClick, className = "" }) {
|
|
4282
|
-
return /* @__PURE__ */ (0,
|
|
4475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4283
4476
|
"button",
|
|
4284
4477
|
{
|
|
4285
4478
|
type: "button",
|
|
4286
4479
|
onClick,
|
|
4287
4480
|
className: `flex items-center justify-center w-6 h-16 bg-gray-100 hover:bg-gray-200 border border-gray-200 border-r-0 rounded-l-lg text-gray-600 hover:text-gray-800 transition-all duration-200 shadow-sm ${className}`,
|
|
4288
4481
|
"aria-label": "Open help",
|
|
4289
|
-
children: /* @__PURE__ */ (0,
|
|
4482
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ChevronLeft, { className: "h-4 w-4" })
|
|
4290
4483
|
}
|
|
4291
4484
|
);
|
|
4292
4485
|
}
|
|
4293
4486
|
|
|
4294
4487
|
// src/createKiteChat.tsx
|
|
4295
|
-
var
|
|
4488
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
4296
4489
|
function KiteChatWrapper({
|
|
4297
4490
|
initialConfig,
|
|
4298
4491
|
onConfigUpdate,
|
|
@@ -4329,7 +4522,7 @@ function KiteChatWrapper({
|
|
|
4329
4522
|
container.classList.toggle("dark", prefersDark);
|
|
4330
4523
|
}
|
|
4331
4524
|
}, [config.theme]);
|
|
4332
|
-
return /* @__PURE__ */ (0,
|
|
4525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4333
4526
|
ChatPanelWithToggle,
|
|
4334
4527
|
{
|
|
4335
4528
|
isOpen,
|
|
@@ -4344,7 +4537,9 @@ function KiteChatWrapper({
|
|
|
4344
4537
|
orgId: config.orgId,
|
|
4345
4538
|
userName: config.userName,
|
|
4346
4539
|
userEmail: config.userEmail,
|
|
4347
|
-
userOrganization: config.userOrganization
|
|
4540
|
+
userOrganization: config.userOrganization,
|
|
4541
|
+
supabaseUrl: config.supabaseUrl,
|
|
4542
|
+
supabaseAnonKey: config.supabaseAnonKey
|
|
4348
4543
|
}
|
|
4349
4544
|
);
|
|
4350
4545
|
}
|
|
@@ -4374,7 +4569,7 @@ function createKiteChat(config) {
|
|
|
4374
4569
|
}
|
|
4375
4570
|
root = (0, import_client.createRoot)(containerElement);
|
|
4376
4571
|
root.render(
|
|
4377
|
-
/* @__PURE__ */ (0,
|
|
4572
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4378
4573
|
KiteChatWrapper,
|
|
4379
4574
|
{
|
|
4380
4575
|
initialConfig: currentConfig,
|