@kite-copilot/chat-panel 0.2.34 → 0.2.35

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 CHANGED
@@ -40,6 +40,7 @@ var import_client = require("react-dom/client");
40
40
 
41
41
  // src/ChatPanel.tsx
42
42
  var React4 = __toESM(require("react"), 1);
43
+ var import_supabase_js = require("@supabase/supabase-js");
43
44
 
44
45
  // src/lib/utils.ts
45
46
  var import_clsx = require("clsx");
@@ -884,8 +885,36 @@ function DataRenderer({ type, data }) {
884
885
  }
885
886
  }
886
887
 
887
- // src/ChatPanel.tsx
888
+ // src/components/TypingIndicator.tsx
888
889
  var import_jsx_runtime9 = require("react/jsx-runtime");
890
+ function TypingIndicator({ className = "" }) {
891
+ 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: [
892
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
893
+ "span",
894
+ {
895
+ className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
896
+ style: { animationDelay: "0ms", animationDuration: "600ms" }
897
+ }
898
+ ),
899
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
900
+ "span",
901
+ {
902
+ className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
903
+ style: { animationDelay: "150ms", animationDuration: "600ms" }
904
+ }
905
+ ),
906
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
907
+ "span",
908
+ {
909
+ className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce",
910
+ style: { animationDelay: "300ms", animationDuration: "600ms" }
911
+ }
912
+ )
913
+ ] }) });
914
+ }
915
+
916
+ // src/ChatPanel.tsx
917
+ var import_jsx_runtime10 = require("react/jsx-runtime");
889
918
  var DEFAULT_AGENT_URL = "http://localhost:5002";
890
919
  var PANEL_WIDTH = 340;
891
920
  function unescapeJsonString(str) {
@@ -907,7 +936,7 @@ function renderMarkdown(text) {
907
936
  const codeMatch = remaining.match(/^`([^`]+)`/);
908
937
  if (codeMatch) {
909
938
  parts.push(
910
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
939
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
911
940
  "code",
912
941
  {
913
942
  className: "bg-gray-100 px-1 py-0.5 rounded text-xs font-mono",
@@ -921,20 +950,20 @@ function renderMarkdown(text) {
921
950
  }
922
951
  const boldMatch = remaining.match(/^\*\*([^*]+)\*\*/);
923
952
  if (boldMatch) {
924
- parts.push(/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("strong", { children: boldMatch[1] }, keyIndex++));
953
+ parts.push(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: boldMatch[1] }, keyIndex++));
925
954
  remaining = remaining.slice(boldMatch[0].length);
926
955
  continue;
927
956
  }
928
957
  const italicMatch = remaining.match(/^\*([^*]+)\*/);
929
958
  if (italicMatch) {
930
- parts.push(/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("em", { children: italicMatch[1] }, keyIndex++));
959
+ parts.push(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("em", { children: italicMatch[1] }, keyIndex++));
931
960
  remaining = remaining.slice(italicMatch[0].length);
932
961
  continue;
933
962
  }
934
963
  const linkMatch = remaining.match(/^\[([^\]]+)\]\(([^)]+)\)/);
935
964
  if (linkMatch) {
936
965
  parts.push(
937
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
966
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
938
967
  "a",
939
968
  {
940
969
  href: linkMatch[2],
@@ -954,7 +983,7 @@ function renderMarkdown(text) {
954
983
  const url = urlMatch[1];
955
984
  const href = url.startsWith("www.") ? `https://${url}` : url;
956
985
  parts.push(
957
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
986
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
958
987
  "a",
959
988
  {
960
989
  href,
@@ -973,7 +1002,7 @@ function renderMarkdown(text) {
973
1002
  if (emailMatch) {
974
1003
  const email = emailMatch[1];
975
1004
  parts.push(
976
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1005
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
977
1006
  "a",
978
1007
  {
979
1008
  href: `mailto:${email}`,
@@ -998,17 +1027,17 @@ function renderMarkdown(text) {
998
1027
  remaining = remaining.slice(nextSpecial);
999
1028
  }
1000
1029
  }
1001
- return parts.length === 1 ? parts[0] : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: parts });
1030
+ return parts.length === 1 ? parts[0] : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: parts });
1002
1031
  };
1003
1032
  const flushList = () => {
1004
1033
  if (currentList) {
1005
1034
  const ListTag = currentList.type === "ul" ? "ul" : "ol";
1006
1035
  elements.push(
1007
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1036
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1008
1037
  ListTag,
1009
1038
  {
1010
1039
  className: `${currentList.type === "ul" ? "list-disc" : "list-decimal"} ml-4 my-1`,
1011
- children: currentList.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("li", { className: "ml-2", children: item }, i))
1040
+ children: currentList.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { className: "ml-2", children: item }, i))
1012
1041
  },
1013
1042
  elements.length
1014
1043
  )
@@ -1021,11 +1050,11 @@ function renderMarkdown(text) {
1021
1050
  if (line.startsWith("```")) {
1022
1051
  if (inCodeBlock) {
1023
1052
  elements.push(
1024
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1053
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1025
1054
  "pre",
1026
1055
  {
1027
1056
  className: "bg-gray-100 rounded p-2 my-1 overflow-x-auto",
1028
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("code", { className: "text-xs font-mono", children: codeContent.join("\n") })
1057
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("code", { className: "text-xs font-mono", children: codeContent.join("\n") })
1029
1058
  },
1030
1059
  elements.length
1031
1060
  )
@@ -1051,7 +1080,7 @@ function renderMarkdown(text) {
1051
1080
  const content = processInlineFormatting(headerMatch[2]);
1052
1081
  const className = level === 1 ? "text-lg font-bold my-1" : level === 2 ? "text-base font-bold my-1" : "text-sm font-semibold my-1";
1053
1082
  elements.push(
1054
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className, children: content }, elements.length)
1083
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className, children: content }, elements.length)
1055
1084
  );
1056
1085
  continue;
1057
1086
  }
@@ -1075,23 +1104,23 @@ function renderMarkdown(text) {
1075
1104
  }
1076
1105
  if (line.trim() === "") {
1077
1106
  flushList();
1078
- elements.push(/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "h-2" }, elements.length));
1107
+ elements.push(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-2" }, elements.length));
1079
1108
  continue;
1080
1109
  }
1081
1110
  if (line.match(/^[-*_]{3,}$/)) {
1082
1111
  flushList();
1083
1112
  elements.push(
1084
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("hr", { className: "my-2 border-gray-200" }, elements.length)
1113
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("hr", { className: "my-2 border-gray-200" }, elements.length)
1085
1114
  );
1086
1115
  continue;
1087
1116
  }
1088
1117
  flushList();
1089
1118
  elements.push(
1090
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: processInlineFormatting(line) }, elements.length)
1119
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: processInlineFormatting(line) }, elements.length)
1091
1120
  );
1092
1121
  }
1093
1122
  flushList();
1094
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: elements });
1123
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: elements });
1095
1124
  }
1096
1125
  var defaultStartingQuestions = [
1097
1126
  {
@@ -1318,13 +1347,19 @@ function ChatPanel({
1318
1347
  orgId,
1319
1348
  userName,
1320
1349
  userEmail,
1321
- userOrganization
1350
+ userOrganization,
1351
+ supabaseUrl,
1352
+ supabaseAnonKey
1322
1353
  } = {}) {
1323
1354
  const [messages, setMessages] = React4.useState(initialMessages);
1324
1355
  const [input, setInput] = React4.useState("");
1325
1356
  const [sessionId, setSessionId] = React4.useState(() => crypto.randomUUID());
1326
1357
  const [isEscalated, setIsEscalated] = React4.useState(false);
1327
1358
  const escalationWsRef = React4.useRef(null);
1359
+ const [agentIsTyping, setAgentIsTyping] = React4.useState(false);
1360
+ const supabaseRef = React4.useRef(null);
1361
+ const typingChannelRef = React4.useRef(null);
1362
+ const typingTimeoutRef = React4.useRef(null);
1328
1363
  const resetSession = React4.useCallback(() => {
1329
1364
  setSessionId(crypto.randomUUID());
1330
1365
  setIsEscalated(false);
@@ -1332,7 +1367,106 @@ function ChatPanel({
1332
1367
  escalationWsRef.current.close();
1333
1368
  escalationWsRef.current = null;
1334
1369
  }
1370
+ setAgentIsTyping(false);
1371
+ if (typingChannelRef.current) {
1372
+ typingChannelRef.current.unsubscribe();
1373
+ typingChannelRef.current = null;
1374
+ }
1335
1375
  }, []);
1376
+ React4.useEffect(() => {
1377
+ if (supabaseUrl && supabaseAnonKey && !supabaseRef.current) {
1378
+ supabaseRef.current = (0, import_supabase_js.createClient)(supabaseUrl, supabaseAnonKey);
1379
+ }
1380
+ }, [supabaseUrl, supabaseAnonKey]);
1381
+ React4.useEffect(() => {
1382
+ if (!isEscalated || !sessionId || !supabaseRef.current) {
1383
+ return;
1384
+ }
1385
+ const channelName = `typing:${sessionId}`;
1386
+ const channel = supabaseRef.current.channel(channelName);
1387
+ channel.on("broadcast", { event: "typing" }, (payload) => {
1388
+ const { sender, isTyping } = payload.payload;
1389
+ if (sender === "agent") {
1390
+ setAgentIsTyping(isTyping);
1391
+ if (isTyping) {
1392
+ if (typingTimeoutRef.current) {
1393
+ window.clearTimeout(typingTimeoutRef.current);
1394
+ }
1395
+ typingTimeoutRef.current = window.setTimeout(() => {
1396
+ setAgentIsTyping(false);
1397
+ }, 5e3);
1398
+ }
1399
+ }
1400
+ }).subscribe();
1401
+ typingChannelRef.current = channel;
1402
+ return () => {
1403
+ channel.unsubscribe();
1404
+ typingChannelRef.current = null;
1405
+ if (typingTimeoutRef.current) {
1406
+ window.clearTimeout(typingTimeoutRef.current);
1407
+ }
1408
+ };
1409
+ }, [isEscalated, sessionId]);
1410
+ const heartbeatIntervalRef = React4.useRef(null);
1411
+ const updateCustomerStatus = React4.useCallback(async (status) => {
1412
+ if (!supabaseRef.current || !sessionId) return;
1413
+ try {
1414
+ await supabaseRef.current.from("escalations").update({
1415
+ customer_status: status,
1416
+ customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
1417
+ }).eq("session_id", sessionId);
1418
+ } catch (err) {
1419
+ console.error("[KiteChat] Failed to update customer status:", err);
1420
+ }
1421
+ }, [sessionId]);
1422
+ React4.useEffect(() => {
1423
+ if (!isEscalated || !sessionId || !supabaseRef.current) {
1424
+ return;
1425
+ }
1426
+ const currentSessionId = sessionId;
1427
+ const supabase = supabaseRef.current;
1428
+ updateCustomerStatus("active");
1429
+ heartbeatIntervalRef.current = window.setInterval(() => {
1430
+ updateCustomerStatus("active");
1431
+ }, 6e4);
1432
+ return () => {
1433
+ supabase.from("escalations").update({
1434
+ customer_status: "disconnected",
1435
+ customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
1436
+ }).eq("session_id", currentSessionId).then(
1437
+ () => {
1438
+ console.log("[KiteChat] Marked customer as disconnected");
1439
+ },
1440
+ (err) => {
1441
+ console.error("[KiteChat] Failed to mark disconnected:", err);
1442
+ }
1443
+ );
1444
+ if (heartbeatIntervalRef.current) {
1445
+ window.clearInterval(heartbeatIntervalRef.current);
1446
+ heartbeatIntervalRef.current = null;
1447
+ }
1448
+ };
1449
+ }, [isEscalated, sessionId, updateCustomerStatus]);
1450
+ const sendTypingIndicator = React4.useCallback((isTyping) => {
1451
+ if (!typingChannelRef.current || !isEscalated) return;
1452
+ typingChannelRef.current.send({
1453
+ type: "broadcast",
1454
+ event: "typing",
1455
+ payload: { sender: "user", isTyping }
1456
+ });
1457
+ }, [isEscalated]);
1458
+ const userTypingTimeoutRef = React4.useRef(null);
1459
+ const handleTypingStart = React4.useCallback(() => {
1460
+ if (!isEscalated || !supabaseRef.current) return;
1461
+ sendTypingIndicator(true);
1462
+ updateCustomerStatus("active");
1463
+ if (userTypingTimeoutRef.current) {
1464
+ window.clearTimeout(userTypingTimeoutRef.current);
1465
+ }
1466
+ userTypingTimeoutRef.current = window.setTimeout(() => {
1467
+ sendTypingIndicator(false);
1468
+ }, 1500);
1469
+ }, [isEscalated, sendTypingIndicator, updateCustomerStatus]);
1336
1470
  const streamIntervals = React4.useRef({});
1337
1471
  const isEmpty = messages.length === 0;
1338
1472
  const [phase, setPhase] = React4.useState("idle");
@@ -1607,12 +1741,13 @@ function ChatPanel({
1607
1741
  type: "user_message",
1608
1742
  content
1609
1743
  }));
1744
+ updateCustomerStatus("active");
1610
1745
  return true;
1611
1746
  } catch (err) {
1612
1747
  console.error("[KiteChat] Failed to send escalated message:", err);
1613
1748
  return false;
1614
1749
  }
1615
- }, []);
1750
+ }, [updateCustomerStatus]);
1616
1751
  React4.useEffect(() => {
1617
1752
  return () => {
1618
1753
  if (escalationWsRef.current) {
@@ -1743,6 +1878,11 @@ function ChatPanel({
1743
1878
  };
1744
1879
  setMessages((prev) => [...prev, userMessage]);
1745
1880
  sendEscalatedMessage(trimmed);
1881
+ sendTypingIndicator(false);
1882
+ if (userTypingTimeoutRef.current) {
1883
+ window.clearTimeout(userTypingTimeoutRef.current);
1884
+ userTypingTimeoutRef.current = null;
1885
+ }
1746
1886
  setInput("");
1747
1887
  return;
1748
1888
  }
@@ -2761,8 +2901,8 @@ ${userText}`
2761
2901
  }
2762
2902
  }
2763
2903
  if (!isOpen) {
2764
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "fixed bottom-6 left-1/2 -translate-x-1/2 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime9.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_runtime9.jsxs)("div", { className: "flex items-center gap-3 w-full", children: [
2765
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2904
+ 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: [
2905
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2766
2906
  "button",
2767
2907
  {
2768
2908
  onClick: () => {
@@ -2771,23 +2911,23 @@ ${userText}`
2771
2911
  },
2772
2912
  className: "flex items-center gap-3 flex-1 group",
2773
2913
  children: [
2774
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm text-gray-500 flex-1 text-left", children: "Ask a question..." }),
2775
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-xs text-gray-400 font-medium", children: "\u2318I" })
2914
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm text-gray-500 flex-1 text-left", children: "Ask a question..." }),
2915
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-gray-400 font-medium", children: "\u2318I" })
2776
2916
  ]
2777
2917
  }
2778
2918
  ),
2779
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2919
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2780
2920
  "button",
2781
2921
  {
2782
2922
  onClick: () => {
2783
2923
  onOpen?.();
2784
2924
  },
2785
2925
  className: "h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors",
2786
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" })
2926
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" })
2787
2927
  }
2788
2928
  )
2789
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
2790
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2929
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
2930
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2791
2931
  "input",
2792
2932
  {
2793
2933
  ref: searchInputRef,
@@ -2815,9 +2955,9 @@ ${userText}`
2815
2955
  className: "flex-1 text-sm text-gray-700 outline-none bg-transparent"
2816
2956
  }
2817
2957
  ),
2818
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2", children: [
2819
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-xs text-gray-400 font-medium", children: "\u21B5 Enter" }),
2820
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2958
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2", children: [
2959
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-gray-400 font-medium", children: "\u21B5 Enter" }),
2960
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2821
2961
  "button",
2822
2962
  {
2823
2963
  onClick: () => {
@@ -2829,25 +2969,25 @@ ${userText}`
2829
2969
  setSearchExpanded(false);
2830
2970
  },
2831
2971
  className: "h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors cursor-pointer",
2832
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" })
2972
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" })
2833
2973
  }
2834
2974
  )
2835
2975
  ] })
2836
2976
  ] }) }) });
2837
2977
  }
2838
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2978
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2839
2979
  "section",
2840
2980
  {
2841
2981
  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"}`,
2842
2982
  style: { width: `${PANEL_WIDTH}px` },
2843
2983
  children: [
2844
- /* @__PURE__ */ (0, import_jsx_runtime9.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: [
2845
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2.5", children: [
2846
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" }),
2847
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { className: "text-sm font-semibold text-gray-800", children: "Copilot" })
2984
+ /* @__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: [
2985
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2.5", children: [
2986
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" }),
2987
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { className: "text-sm font-semibold text-gray-800", children: "Copilot" })
2848
2988
  ] }),
2849
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-1", children: [
2850
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2989
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-1", children: [
2990
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2851
2991
  Button,
2852
2992
  {
2853
2993
  variant: "ghost",
@@ -2862,29 +3002,29 @@ ${userText}`
2862
3002
  activeGuideRef.current = void 0;
2863
3003
  setGuideComplete(false);
2864
3004
  },
2865
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.SquarePen, { className: "h-3 w-3" })
3005
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.SquarePen, { className: "h-3 w-3" })
2866
3006
  }
2867
3007
  ),
2868
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3008
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2869
3009
  Button,
2870
3010
  {
2871
3011
  variant: "ghost",
2872
3012
  size: "sm",
2873
3013
  className: "h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",
2874
3014
  onClick: () => onClose?.(),
2875
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Minus, { className: "h-3.5 w-3.5" })
3015
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Minus, { className: "h-3.5 w-3.5" })
2876
3016
  }
2877
3017
  )
2878
3018
  ] })
2879
3019
  ] }),
2880
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3020
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2881
3021
  "div",
2882
3022
  {
2883
3023
  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",
2884
- children: isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "w-full overflow-y-auto px-4", children: [
2885
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "py-3 transition-all duration-300", children: /* @__PURE__ */ (0, import_jsx_runtime9.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?" }) }),
2886
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "pb-4 px-4", children: [
2887
- panelView === "landing" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex flex-col gap-1", children: loadingQuestions ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Loader2, { className: "h-4 w-4 animate-spin text-gray-400" }) }) : startingQuestions.map((question, index) => {
3024
+ children: isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w-full overflow-y-auto px-4", children: [
3025
+ /* @__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?" }) }),
3026
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "pb-4 px-4", children: [
3027
+ 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) => {
2888
3028
  const iconColors = [
2889
3029
  "bg-blue-400",
2890
3030
  "bg-green-400",
@@ -2892,7 +3032,7 @@ ${userText}`
2892
3032
  "bg-orange-400",
2893
3033
  "bg-pink-400"
2894
3034
  ];
2895
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3035
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2896
3036
  Button,
2897
3037
  {
2898
3038
  type: "button",
@@ -2901,7 +3041,7 @@ ${userText}`
2901
3041
  className: "w-full justify-start rounded-lg px-3 py-1.5 text-xs text-gray-700 hover:bg-gray-100 h-auto",
2902
3042
  onClick: () => sendTopic(question.prompt),
2903
3043
  children: [
2904
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3044
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2905
3045
  "span",
2906
3046
  {
2907
3047
  className: `mr-2 inline-block h-1.5 w-1.5 rounded-full ${iconColors[index % iconColors.length]}`
@@ -2913,9 +3053,9 @@ ${userText}`
2913
3053
  question.id
2914
3054
  );
2915
3055
  }) }) }),
2916
- panelView === "folder" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
2917
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mb-3 flex items-center gap-2", children: [
2918
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3056
+ panelView === "folder" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
3057
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mb-3 flex items-center gap-2", children: [
3058
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2919
3059
  Button,
2920
3060
  {
2921
3061
  type: "button",
@@ -2924,12 +3064,12 @@ ${userText}`
2924
3064
  className: "h-7 w-7 rounded-full hover:bg-gray-100",
2925
3065
  onClick: closeFolder,
2926
3066
  "aria-label": "Back to suggestions",
2927
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.ArrowLeft, { className: "h-4 w-4 text-gray-500" })
3067
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowLeft, { className: "h-4 w-4 text-gray-500" })
2928
3068
  }
2929
3069
  ),
2930
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-xs font-medium uppercase tracking-wide text-gray-400", children: "Topics" })
3070
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs font-medium uppercase tracking-wide text-gray-400", children: "Topics" })
2931
3071
  ] }),
2932
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex flex-col gap-1.5", children: folders.find((f) => f.id === currentFolderId)?.topics.map((topic) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3072
+ /* @__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)(
2933
3073
  Button,
2934
3074
  {
2935
3075
  type: "button",
@@ -2943,7 +3083,7 @@ ${userText}`
2943
3083
  )) })
2944
3084
  ] })
2945
3085
  ] })
2946
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex-1 min-h-0 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ScrollArea, { ref: messagesContainerRef, className: "h-full", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-2 px-4 py-3", children: [
3086
+ ] }) : /* @__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: [
2947
3087
  messages.map((message, index) => {
2948
3088
  const isUser = message.role === "user";
2949
3089
  const previousRole = index > 0 ? messages[index - 1].role : void 0;
@@ -2963,17 +3103,20 @@ ${userText}`
2963
3103
  return null;
2964
3104
  }
2965
3105
  if (isUser) {
2966
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `flex justify-end ${isRoleChange ? "mt-3" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3.5 py-2.5 text-sm text-white shadow-sm", children: message.content }) }, message.id);
3106
+ 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.5 py-2.5 text-sm text-white shadow-sm", children: message.content }) }, message.id);
2967
3107
  }
2968
3108
  if (message.role === "agent") {
2969
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `flex justify-start ${isRoleChange ? "mt-3" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "max-w-[260px] rounded-2xl rounded-bl-md bg-blue-500 px-3.5 py-2.5 text-sm text-white shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "whitespace-pre-wrap leading-relaxed", children: renderMarkdown(message.content || "") }) }) }, message.id);
3109
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `flex flex-col items-start ${isRoleChange ? "mt-3" : ""}`, children: [
3110
+ isRoleChange && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-gray-500 mb-1 ml-1", children: "Agent" }),
3111
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "max-w-[260px] rounded-2xl rounded-bl-md bg-white border border-gray-200 px-3.5 py-2.5 text-sm text-gray-800 shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap leading-relaxed", children: renderMarkdown(message.content || "") }) })
3112
+ ] }, message.id);
2970
3113
  }
2971
3114
  if (message.kind === "searchSummary") {
2972
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3115
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2973
3116
  "div",
2974
3117
  {
2975
3118
  className: `${isRoleChange ? "mt-3" : ""}`,
2976
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3119
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2977
3120
  AssistantSearchSummary,
2978
3121
  {
2979
3122
  title: message.title ?? "Search results",
@@ -2985,27 +3128,27 @@ ${userText}`
2985
3128
  );
2986
3129
  }
2987
3130
  if (message.kind === "guideComplete") {
2988
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3131
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2989
3132
  "div",
2990
3133
  {
2991
3134
  ref: isCurrentGuideStep ? currentStepRef : null,
2992
3135
  className: `${isRoleChange ? "mt-3" : ""}`,
2993
- children: /* @__PURE__ */ (0, import_jsx_runtime9.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: [
2994
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CheckCircle2, { className: "h-5 w-5 text-green-600 flex-shrink-0" }),
2995
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "font-medium text-green-800", children: message.content })
3136
+ 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: [
3137
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-5 w-5 text-green-600 flex-shrink-0" }),
3138
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "font-medium text-green-800", children: message.content })
2996
3139
  ] })
2997
3140
  },
2998
3141
  message.id
2999
3142
  );
3000
3143
  }
3001
3144
  if (message.kind === "navigationAction") {
3002
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3145
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3003
3146
  "div",
3004
3147
  {
3005
3148
  className: `${isRoleChange ? "mt-3" : ""}`,
3006
3149
  children: [
3007
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700", children: message.content || "" }),
3008
- message.navigationTarget && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3150
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700", children: message.content || "" }),
3151
+ message.navigationTarget && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3009
3152
  Button,
3010
3153
  {
3011
3154
  type: "button",
@@ -3016,10 +3159,10 @@ ${userText}`
3016
3159
  message.navigationTarget
3017
3160
  ),
3018
3161
  children: [
3019
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "Confirm" }),
3020
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
3021
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
3022
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
3162
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Confirm" }),
3163
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
3164
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
3165
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
3023
3166
  ] })
3024
3167
  ]
3025
3168
  }
@@ -3077,26 +3220,26 @@ ${userText}`
3077
3220
  } else {
3078
3221
  successContent = "Action completed successfully.";
3079
3222
  }
3080
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3223
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3081
3224
  "div",
3082
3225
  {
3083
3226
  className: `${isRoleChange ? "mt-3" : ""}`,
3084
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 text-gray-700", children: successContent })
3227
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 text-gray-700", children: successContent })
3085
3228
  },
3086
3229
  message.id
3087
3230
  );
3088
3231
  }
3089
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3232
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3090
3233
  "div",
3091
3234
  {
3092
3235
  className: `min-w-0 ${isRoleChange ? "mt-3" : ""}`,
3093
3236
  children: [
3094
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700", children: message.content || "" }),
3095
- actionType === "updateCompanyInfo" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden", children: [
3096
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
3097
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3098
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
3099
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3237
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700", children: message.content || "" }),
3238
+ 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: [
3239
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
3240
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3241
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
3242
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3100
3243
  Input,
3101
3244
  {
3102
3245
  placeholder: "Acme Corporation",
@@ -3109,9 +3252,9 @@ ${userText}`
3109
3252
  }
3110
3253
  )
3111
3254
  ] }),
3112
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3113
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
3114
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3255
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3256
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
3257
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3115
3258
  Input,
3116
3259
  {
3117
3260
  type: "email",
@@ -3126,9 +3269,9 @@ ${userText}`
3126
3269
  )
3127
3270
  ] })
3128
3271
  ] }),
3129
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3130
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Address" }),
3131
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3272
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3273
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Address" }),
3274
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3132
3275
  Input,
3133
3276
  {
3134
3277
  placeholder: "123 Main St, San Francisco, CA",
@@ -3141,10 +3284,10 @@ ${userText}`
3141
3284
  }
3142
3285
  )
3143
3286
  ] }),
3144
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
3145
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3146
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Phone" }),
3147
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3287
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
3288
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3289
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Phone" }),
3290
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3148
3291
  Input,
3149
3292
  {
3150
3293
  type: "tel",
@@ -3158,9 +3301,9 @@ ${userText}`
3158
3301
  }
3159
3302
  )
3160
3303
  ] }),
3161
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3162
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Website" }),
3163
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3304
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3305
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Website" }),
3306
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3164
3307
  Input,
3165
3308
  {
3166
3309
  type: "url",
@@ -3176,9 +3319,9 @@ ${userText}`
3176
3319
  ] })
3177
3320
  ] })
3178
3321
  ] }),
3179
- actionType === "addApiKey" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3180
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "API Key Name" }),
3181
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3322
+ 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: [
3323
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "API Key Name" }),
3324
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3182
3325
  Input,
3183
3326
  {
3184
3327
  placeholder: "Production Key",
@@ -3191,11 +3334,11 @@ ${userText}`
3191
3334
  }
3192
3335
  )
3193
3336
  ] }) }),
3194
- actionType === "addCustomer" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden", children: [
3195
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
3196
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3197
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
3198
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3337
+ 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: [
3338
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "grid grid-cols-2 gap-2", children: [
3339
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3340
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Company Name" }),
3341
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3199
3342
  Input,
3200
3343
  {
3201
3344
  placeholder: "Acme Corporation",
@@ -3208,9 +3351,9 @@ ${userText}`
3208
3351
  }
3209
3352
  )
3210
3353
  ] }),
3211
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3212
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
3213
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3354
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3355
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Email" }),
3356
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3214
3357
  Input,
3215
3358
  {
3216
3359
  type: "email",
@@ -3225,9 +3368,9 @@ ${userText}`
3225
3368
  )
3226
3369
  ] })
3227
3370
  ] }),
3228
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3229
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Location" }),
3230
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3371
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3372
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Location" }),
3373
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3231
3374
  Input,
3232
3375
  {
3233
3376
  placeholder: "San Francisco, CA",
@@ -3240,9 +3383,9 @@ ${userText}`
3240
3383
  }
3241
3384
  )
3242
3385
  ] }),
3243
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3244
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Subscription Tier" }),
3245
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3386
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3387
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Subscription Tier" }),
3388
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3246
3389
  "select",
3247
3390
  {
3248
3391
  value: formData.subscription || "Starter",
@@ -3252,19 +3395,19 @@ ${userText}`
3252
3395
  }),
3253
3396
  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",
3254
3397
  children: [
3255
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Starter", children: "Starter" }),
3256
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Professional", children: "Professional" }),
3257
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Enterprise", children: "Enterprise" })
3398
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Starter", children: "Starter" }),
3399
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Professional", children: "Professional" }),
3400
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Enterprise", children: "Enterprise" })
3258
3401
  ]
3259
3402
  }
3260
3403
  )
3261
3404
  ] })
3262
3405
  ] }),
3263
- (actionType === "enable2FA" || actionType === "disable2FA") && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime9.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." }) }),
3264
- actionType === "changePassword" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3265
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3266
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Current Password" }),
3267
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3406
+ (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." }) }),
3407
+ 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: [
3408
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3409
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Current Password" }),
3410
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3268
3411
  Input,
3269
3412
  {
3270
3413
  type: "password",
@@ -3277,9 +3420,9 @@ ${userText}`
3277
3420
  }
3278
3421
  )
3279
3422
  ] }),
3280
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3281
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "New Password" }),
3282
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3423
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3424
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "New Password" }),
3425
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3283
3426
  Input,
3284
3427
  {
3285
3428
  type: "password",
@@ -3292,9 +3435,9 @@ ${userText}`
3292
3435
  }
3293
3436
  )
3294
3437
  ] }),
3295
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3296
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Confirm New Password" }),
3297
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3438
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3439
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Confirm New Password" }),
3440
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3298
3441
  Input,
3299
3442
  {
3300
3443
  type: "password",
@@ -3308,10 +3451,10 @@ ${userText}`
3308
3451
  )
3309
3452
  ] })
3310
3453
  ] }),
3311
- actionType === "toggleNotification" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3312
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3313
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Notification Type" }),
3314
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3454
+ 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: [
3455
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3456
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Notification Type" }),
3457
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3315
3458
  "select",
3316
3459
  {
3317
3460
  value: formData.notificationType || "paymentReceived",
@@ -3321,17 +3464,17 @@ ${userText}`
3321
3464
  }),
3322
3465
  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",
3323
3466
  children: [
3324
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "paymentReceived", children: "Payment Received" }),
3325
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "paymentFailed", children: "Payment Failed" }),
3326
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "invoicePaid", children: "Invoice Paid" }),
3327
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "monthlySummary", children: "Monthly Summary" }),
3328
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "productUpdates", children: "Product Updates" })
3467
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "paymentReceived", children: "Payment Received" }),
3468
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "paymentFailed", children: "Payment Failed" }),
3469
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "invoicePaid", children: "Invoice Paid" }),
3470
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "monthlySummary", children: "Monthly Summary" }),
3471
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "productUpdates", children: "Product Updates" })
3329
3472
  ]
3330
3473
  }
3331
3474
  )
3332
3475
  ] }),
3333
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2", children: [
3334
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3476
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2", children: [
3477
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3335
3478
  "input",
3336
3479
  {
3337
3480
  type: "checkbox",
@@ -3343,12 +3486,12 @@ ${userText}`
3343
3486
  className: "h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"
3344
3487
  }
3345
3488
  ),
3346
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs text-black", children: "Enable this notification" })
3489
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs text-black", children: "Enable this notification" })
3347
3490
  ] })
3348
3491
  ] }),
3349
- (actionType === "connectIntegration" || actionType === "disconnectIntegration") && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3350
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Integration" }),
3351
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3492
+ (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: [
3493
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Integration" }),
3494
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3352
3495
  "select",
3353
3496
  {
3354
3497
  value: formData.integrationName || "Slack",
@@ -3358,17 +3501,17 @@ ${userText}`
3358
3501
  }),
3359
3502
  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",
3360
3503
  children: [
3361
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Slack", children: "Slack" }),
3362
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Zapier", children: "Zapier" }),
3363
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Webhook", children: "Webhook" })
3504
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Slack", children: "Slack" }),
3505
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Zapier", children: "Zapier" }),
3506
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Webhook", children: "Webhook" })
3364
3507
  ]
3365
3508
  }
3366
3509
  )
3367
3510
  ] }) }),
3368
- actionType === "addPaymentMethod" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3369
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3370
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Card Number" }),
3371
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3511
+ 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: [
3512
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3513
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Card Number" }),
3514
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3372
3515
  Input,
3373
3516
  {
3374
3517
  placeholder: "1234 5678 9012 3456",
@@ -3381,9 +3524,9 @@ ${userText}`
3381
3524
  }
3382
3525
  )
3383
3526
  ] }),
3384
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3385
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Expiry Date" }),
3386
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3527
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3528
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Expiry Date" }),
3529
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3387
3530
  Input,
3388
3531
  {
3389
3532
  placeholder: "MM/YY",
@@ -3397,11 +3540,11 @@ ${userText}`
3397
3540
  )
3398
3541
  ] })
3399
3542
  ] }),
3400
- actionType === "removePaymentMethod" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-black", children: "This will remove the default payment method from your account." }) }),
3401
- actionType === "refundPayment" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3402
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3403
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Transaction ID or Customer Name" }),
3404
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3543
+ 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." }) }),
3544
+ 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: [
3545
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3546
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Transaction ID or Customer Name" }),
3547
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3405
3548
  Input,
3406
3549
  {
3407
3550
  placeholder: "e.g., txn_1234 or Acme Corp",
@@ -3426,9 +3569,9 @@ ${userText}`
3426
3569
  }
3427
3570
  )
3428
3571
  ] }),
3429
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3430
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Amount (optional)" }),
3431
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3572
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3573
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Amount (optional)" }),
3574
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3432
3575
  Input,
3433
3576
  {
3434
3577
  placeholder: "$0.00",
@@ -3441,9 +3584,9 @@ ${userText}`
3441
3584
  }
3442
3585
  )
3443
3586
  ] }),
3444
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3445
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Reason (optional)" }),
3446
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3587
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3588
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Reason (optional)" }),
3589
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3447
3590
  Input,
3448
3591
  {
3449
3592
  placeholder: "e.g., Customer request",
@@ -3457,10 +3600,10 @@ ${userText}`
3457
3600
  )
3458
3601
  ] })
3459
3602
  ] }),
3460
- actionType === "deleteApiKey" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3461
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3462
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "API Key Name or ID" }),
3463
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3603
+ 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: [
3604
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3605
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "API Key Name or ID" }),
3606
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3464
3607
  Input,
3465
3608
  {
3466
3609
  placeholder: "Production Key",
@@ -3474,12 +3617,12 @@ ${userText}`
3474
3617
  }
3475
3618
  )
3476
3619
  ] }),
3477
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-red-600", children: "Warning: This action cannot be undone. The API key will be permanently deleted." })
3620
+ /* @__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." })
3478
3621
  ] }),
3479
- actionType === "addWebhook" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3480
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3481
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Webhook URL" }),
3482
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3622
+ 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: [
3623
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3624
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Webhook URL" }),
3625
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3483
3626
  Input,
3484
3627
  {
3485
3628
  type: "url",
@@ -3493,9 +3636,9 @@ ${userText}`
3493
3636
  }
3494
3637
  )
3495
3638
  ] }),
3496
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3497
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Name (optional)" }),
3498
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
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: "Name (optional)" }),
3641
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3499
3642
  Input,
3500
3643
  {
3501
3644
  placeholder: "Production Webhook",
@@ -3509,9 +3652,9 @@ ${userText}`
3509
3652
  )
3510
3653
  ] })
3511
3654
  ] }),
3512
- actionType === "updateCurrency" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3513
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Currency" }),
3514
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3655
+ 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: [
3656
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Currency" }),
3657
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3515
3658
  "select",
3516
3659
  {
3517
3660
  value: formData.currency || "USD",
@@ -3521,17 +3664,17 @@ ${userText}`
3521
3664
  }),
3522
3665
  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",
3523
3666
  children: [
3524
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "USD", children: "USD ($)" }),
3525
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "EUR", children: "EUR (\u20AC)" }),
3526
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "GBP", children: "GBP (\xA3)" }),
3527
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "JPY", children: "JPY (\xA5)" })
3667
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "USD", children: "USD ($)" }),
3668
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "EUR", children: "EUR (\u20AC)" }),
3669
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "GBP", children: "GBP (\xA3)" }),
3670
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "JPY", children: "JPY (\xA5)" })
3528
3671
  ]
3529
3672
  }
3530
3673
  )
3531
3674
  ] }) }),
3532
- actionType === "updateTimezone" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3533
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Timezone" }),
3534
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3675
+ 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: [
3676
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Timezone" }),
3677
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3535
3678
  "select",
3536
3679
  {
3537
3680
  value: formData.timezone || "America/Los_Angeles",
@@ -3541,18 +3684,18 @@ ${userText}`
3541
3684
  }),
3542
3685
  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",
3543
3686
  children: [
3544
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "America/Los_Angeles", children: "Pacific Time (PT)" }),
3545
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "America/New_York", children: "Eastern Time (ET)" }),
3546
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Europe/London", children: "GMT" }),
3547
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Asia/Tokyo", children: "JST" })
3687
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "America/Los_Angeles", children: "Pacific Time (PT)" }),
3688
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "America/New_York", children: "Eastern Time (ET)" }),
3689
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Europe/London", children: "GMT" }),
3690
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Asia/Tokyo", children: "JST" })
3548
3691
  ]
3549
3692
  }
3550
3693
  )
3551
3694
  ] }) }),
3552
- actionType === "revokeSession" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3553
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3554
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Device/Session" }),
3555
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3695
+ 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: [
3696
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3697
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Device/Session" }),
3698
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3556
3699
  Input,
3557
3700
  {
3558
3701
  placeholder: "MacBook Pro",
@@ -3565,12 +3708,12 @@ ${userText}`
3565
3708
  }
3566
3709
  )
3567
3710
  ] }),
3568
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-black", children: "This will sign out the device and invalidate its session." })
3711
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: "This will sign out the device and invalidate its session." })
3569
3712
  ] }),
3570
- actionType === "createSubscription" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3571
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3572
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Customer Email" }),
3573
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3713
+ 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: [
3714
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3715
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Customer Email" }),
3716
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3574
3717
  Input,
3575
3718
  {
3576
3719
  type: "email",
@@ -3584,9 +3727,9 @@ ${userText}`
3584
3727
  }
3585
3728
  )
3586
3729
  ] }),
3587
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3588
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Plan" }),
3589
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3730
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3731
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Plan" }),
3732
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3590
3733
  "select",
3591
3734
  {
3592
3735
  value: formData.plan || "Starter",
@@ -3596,16 +3739,16 @@ ${userText}`
3596
3739
  }),
3597
3740
  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",
3598
3741
  children: [
3599
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Starter", children: "Starter ($29/mo)" }),
3600
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Professional", children: "Professional ($99/mo)" }),
3601
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "Enterprise", children: "Enterprise ($299/mo)" })
3742
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Starter", children: "Starter ($29/mo)" }),
3743
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Professional", children: "Professional ($99/mo)" }),
3744
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "Enterprise", children: "Enterprise ($299/mo)" })
3602
3745
  ]
3603
3746
  }
3604
3747
  )
3605
3748
  ] }),
3606
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3607
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Billing Cycle" }),
3608
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3749
+ /* @__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: "Billing Cycle" }),
3751
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3609
3752
  "select",
3610
3753
  {
3611
3754
  value: formData.billingCycle || "monthly",
@@ -3615,18 +3758,18 @@ ${userText}`
3615
3758
  }),
3616
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",
3617
3760
  children: [
3618
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "monthly", children: "Monthly" }),
3619
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "yearly", children: "Yearly (Save 15%)" })
3761
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "monthly", children: "Monthly" }),
3762
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "yearly", children: "Yearly (Save 15%)" })
3620
3763
  ]
3621
3764
  }
3622
3765
  )
3623
3766
  ] })
3624
3767
  ] }),
3625
- actionType === "exportCertificate" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3626
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-black", children: "This will export your certificate of incorporation document." }),
3627
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3628
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Format" }),
3629
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3768
+ 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: [
3769
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-black", children: "This will export your certificate of incorporation document." }),
3770
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3771
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Format" }),
3772
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3630
3773
  "select",
3631
3774
  {
3632
3775
  value: formData.format || "pdf",
@@ -3636,17 +3779,17 @@ ${userText}`
3636
3779
  }),
3637
3780
  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",
3638
3781
  children: [
3639
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "pdf", children: "PDF" }),
3640
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "json", children: "JSON" })
3782
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "pdf", children: "PDF" }),
3783
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "json", children: "JSON" })
3641
3784
  ]
3642
3785
  }
3643
3786
  )
3644
3787
  ] })
3645
3788
  ] }),
3646
- (actionType === "toggleBlockRule" || actionType === "enableBlockRule" || actionType === "disableBlockRule") && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
3647
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3648
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "text-xs font-medium text-black mb-1.5 block", children: "Block Rule" }),
3649
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3789
+ (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: [
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: "Block Rule" }),
3792
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3650
3793
  "select",
3651
3794
  {
3652
3795
  value: formData.ruleId || "rule_1",
@@ -3656,17 +3799,17 @@ ${userText}`
3656
3799
  }),
3657
3800
  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",
3658
3801
  children: [
3659
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "rule_1", children: "Block if risk level = 'highest'" }),
3660
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "rule_2", children: "Block if matches Stripe block lists" }),
3661
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "rule_3", children: "Block if CVC verification fails" }),
3662
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "rule_4", children: "Block if Postal code verification fails" })
3802
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_1", children: "Block if risk level = 'highest'" }),
3803
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_2", children: "Block if matches Stripe block lists" }),
3804
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_3", children: "Block if CVC verification fails" }),
3805
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "rule_4", children: "Block if Postal code verification fails" })
3663
3806
  ]
3664
3807
  }
3665
3808
  )
3666
3809
  ] }),
3667
- /* @__PURE__ */ (0, import_jsx_runtime9.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." })
3810
+ /* @__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." })
3668
3811
  ] }),
3669
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3812
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3670
3813
  Button,
3671
3814
  {
3672
3815
  type: "button",
@@ -3675,10 +3818,10 @@ ${userText}`
3675
3818
  className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
3676
3819
  onClick: handleActionSubmit,
3677
3820
  children: [
3678
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "Confirm" }),
3679
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
3680
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
3681
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
3821
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Confirm" }),
3822
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
3823
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
3824
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
3682
3825
  ] })
3683
3826
  ]
3684
3827
  }
@@ -3689,25 +3832,25 @@ ${userText}`
3689
3832
  );
3690
3833
  }
3691
3834
  if (message.kind === "bulkPreview" && message.csvData) {
3692
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3835
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3693
3836
  "div",
3694
3837
  {
3695
3838
  className: `${isRoleChange ? "mt-3" : ""}`,
3696
3839
  children: [
3697
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700", children: message.content || "" }),
3698
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "bg-gray-50 rounded-lg border border-gray-200 overflow-hidden", children: [
3699
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "bg-gray-100 px-3 py-2 border-b border-gray-200 flex items-center gap-2", children: [
3700
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-4 w-4 text-gray-600" }),
3701
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-xs font-medium text-gray-700", children: message.csvData.fileName }),
3702
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "text-xs text-gray-500", children: [
3840
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700", children: message.content || "" }),
3841
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "bg-gray-50 rounded-lg border border-gray-200 overflow-hidden", children: [
3842
+ /* @__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: [
3843
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-4 w-4 text-gray-600" }),
3844
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs font-medium text-gray-700", children: message.csvData.fileName }),
3845
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-xs text-gray-500", children: [
3703
3846
  "\u2022 ",
3704
3847
  message.csvData.rowCount,
3705
3848
  " rows"
3706
3849
  ] })
3707
3850
  ] }),
3708
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "px-3 py-2 border-b border-gray-100", children: [
3709
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 mb-1", children: "Columns" }),
3710
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex flex-wrap gap-1", children: message.csvData.columns.map((col, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3851
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-3 py-2 border-b border-gray-100", children: [
3852
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 mb-1", children: "Columns" }),
3853
+ /* @__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)(
3711
3854
  "span",
3712
3855
  {
3713
3856
  className: "text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",
@@ -3716,23 +3859,23 @@ ${userText}`
3716
3859
  i
3717
3860
  )) })
3718
3861
  ] }),
3719
- message.csvData.sampleRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "px-3 py-2", children: [
3720
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 mb-1", children: "Sample Data" }),
3721
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "space-y-1", children: message.csvData.sampleRows.slice(0, 3).map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3862
+ message.csvData.sampleRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-3 py-2", children: [
3863
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-gray-500 mb-1", children: "Sample Data" }),
3864
+ /* @__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)(
3722
3865
  "div",
3723
3866
  {
3724
3867
  className: "text-xs text-gray-600 bg-white rounded px-2 py-1 border border-gray-100",
3725
3868
  children: [
3726
- Object.entries(row).slice(0, 3).map(([key, val], j) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { children: [
3869
+ Object.entries(row).slice(0, 3).map(([key, val], j) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
3727
3870
  j > 0 && " \u2022 ",
3728
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "text-gray-400", children: [
3871
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-gray-400", children: [
3729
3872
  key,
3730
3873
  ":"
3731
3874
  ] }),
3732
3875
  " ",
3733
3876
  val
3734
3877
  ] }, key)),
3735
- Object.keys(row).length > 3 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "text-gray-400", children: [
3878
+ Object.keys(row).length > 3 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-gray-400", children: [
3736
3879
  " ",
3737
3880
  "..."
3738
3881
  ] })
@@ -3741,14 +3884,14 @@ ${userText}`
3741
3884
  i
3742
3885
  )) })
3743
3886
  ] }),
3744
- message.suggestedAction && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "px-3 py-2 bg-blue-50 border-t border-blue-100", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "text-xs text-blue-700", children: [
3887
+ 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: [
3745
3888
  "Suggested action:",
3746
3889
  " ",
3747
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("strong", { children: message.suggestedAction.replace(/_/g, " ") })
3890
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: message.suggestedAction.replace(/_/g, " ") })
3748
3891
  ] }) })
3749
3892
  ] }),
3750
- message.bulkSessionId && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
3751
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3893
+ message.bulkSessionId && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
3894
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3752
3895
  Button,
3753
3896
  {
3754
3897
  type: "button",
@@ -3757,19 +3900,19 @@ ${userText}`
3757
3900
  className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
3758
3901
  onClick: () => message.bulkSessionId && confirmBulkOperation(message.bulkSessionId),
3759
3902
  children: [
3760
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { children: [
3903
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
3761
3904
  "Process ",
3762
3905
  message.csvData.rowCount,
3763
3906
  " rows"
3764
3907
  ] }),
3765
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
3766
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
3767
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
3908
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
3909
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
3910
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
3768
3911
  ] })
3769
3912
  ]
3770
3913
  }
3771
3914
  ),
3772
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3915
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3773
3916
  Button,
3774
3917
  {
3775
3918
  type: "button",
@@ -3789,35 +3932,35 @@ ${userText}`
3789
3932
  if (message.kind === "bulkProgress" && message.bulkProgress) {
3790
3933
  const { processed, total, successes, failures } = message.bulkProgress;
3791
3934
  const percentage = Math.round(processed / total * 100);
3792
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3935
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3793
3936
  "div",
3794
3937
  {
3795
3938
  className: `${isRoleChange ? "mt-3" : ""}`,
3796
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "bg-gray-50 rounded-lg border border-gray-200 p-3", children: [
3797
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
3798
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Loader2, { className: "h-4 w-4 animate-spin text-blue-600" }),
3799
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "text-sm font-medium text-gray-700", children: [
3939
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "bg-gray-50 rounded-lg border border-gray-200 p-3", children: [
3940
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
3941
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Loader2, { className: "h-4 w-4 animate-spin text-blue-600" }),
3942
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "text-sm font-medium text-gray-700", children: [
3800
3943
  "Processing... ",
3801
3944
  processed,
3802
3945
  " of ",
3803
3946
  total
3804
3947
  ] })
3805
3948
  ] }),
3806
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "h-2 bg-gray-200 rounded-full overflow-hidden mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3949
+ /* @__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)(
3807
3950
  "div",
3808
3951
  {
3809
3952
  className: "h-full bg-blue-600 transition-all duration-300",
3810
3953
  style: { width: `${percentage}%` }
3811
3954
  }
3812
3955
  ) }),
3813
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-600", children: [
3814
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-1", children: [
3815
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3 text-green-600" }),
3956
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-600", children: [
3957
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1", children: [
3958
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3 text-green-600" }),
3816
3959
  successes,
3817
3960
  " successful"
3818
3961
  ] }),
3819
- failures > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
3820
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
3962
+ failures > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
3963
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
3821
3964
  failures,
3822
3965
  " failed"
3823
3966
  ] })
@@ -3831,41 +3974,41 @@ ${userText}`
3831
3974
  const { total, successes, failures, navigationPage } = message.bulkSummary;
3832
3975
  const hasFailures = failures.length > 0;
3833
3976
  const pageLabel = navigationPage?.page === "customers" ? "Customers" : navigationPage?.page === "dashboard" ? "Dashboard" : navigationPage?.page === "settings" ? "Settings" : "Results";
3834
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3977
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3835
3978
  "div",
3836
3979
  {
3837
3980
  className: `${isRoleChange ? "mt-3" : ""}`,
3838
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3981
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3839
3982
  "div",
3840
3983
  {
3841
3984
  className: `rounded-lg border p-3 ${hasFailures ? "bg-amber-50 border-amber-200" : "bg-green-50 border-green-200"}`,
3842
3985
  children: [
3843
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
3844
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3986
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
3987
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3845
3988
  import_lucide_react4.CheckCircle2,
3846
3989
  {
3847
3990
  className: `h-5 w-5 ${hasFailures ? "text-amber-600" : "text-green-600"}`
3848
3991
  }
3849
3992
  ),
3850
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm font-medium text-gray-800", children: "Bulk operation complete" })
3993
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm font-medium text-gray-800", children: "Bulk operation complete" })
3851
3994
  ] }),
3852
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-sm text-gray-600 mb-2", children: message.content || `Processed ${total} rows: ${successes} successful${hasFailures ? `, ${failures.length} failed` : ""}.` }),
3853
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-4 text-xs", children: [
3854
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-1 text-green-700", children: [
3855
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3" }),
3995
+ /* @__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` : ""}.` }),
3996
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-4 text-xs", children: [
3997
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-green-700", children: [
3998
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle2, { className: "h-3 w-3" }),
3856
3999
  successes,
3857
4000
  " successful"
3858
4001
  ] }),
3859
- hasFailures && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
3860
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
4002
+ hasFailures && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 text-red-600", children: [
4003
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-3 w-3" }),
3861
4004
  failures.length,
3862
4005
  " failed"
3863
4006
  ] })
3864
4007
  ] }),
3865
- hasFailures && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mt-3 pt-2 border-t border-amber-200", children: [
3866
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-amber-700 mb-1", children: "Failed Rows" }),
3867
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-1 max-h-32 overflow-y-auto", children: [
3868
- failures.slice(0, 5).map((failure, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
4008
+ hasFailures && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 pt-2 border-t border-amber-200", children: [
4009
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-[10px] uppercase tracking-wider text-amber-700 mb-1", children: "Failed Rows" }),
4010
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-1 max-h-32 overflow-y-auto", children: [
4011
+ failures.slice(0, 5).map((failure, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3869
4012
  "div",
3870
4013
  {
3871
4014
  className: "text-xs text-red-700 bg-red-50 rounded px-2 py-1",
@@ -3879,14 +4022,14 @@ ${userText}`
3879
4022
  },
3880
4023
  i
3881
4024
  )),
3882
- failures.length > 5 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "text-xs text-amber-600", children: [
4025
+ failures.length > 5 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "text-xs text-amber-600", children: [
3883
4026
  "...and ",
3884
4027
  failures.length - 5,
3885
4028
  " more"
3886
4029
  ] })
3887
4030
  ] })
3888
4031
  ] }),
3889
- navigationPage && successes > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mt-3 pt-2 border-t border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
4032
+ 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)(
3890
4033
  "button",
3891
4034
  {
3892
4035
  type: "button",
@@ -3919,12 +4062,12 @@ ${userText}`
3919
4062
  },
3920
4063
  className: "flex items-center gap-2 text-xs text-gray-500 hover:text-gray-700 transition-colors group cursor-pointer",
3921
4064
  children: [
3922
- /* @__PURE__ */ (0, import_jsx_runtime9.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: [
3923
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Command, { className: "h-2.5 w-2.5" }),
3924
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "+" }),
3925
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-2.5 w-2.5" })
4065
+ /* @__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: [
4066
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-2.5 w-2.5" }),
4067
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "+" }),
4068
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-2.5 w-2.5" })
3926
4069
  ] }),
3927
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { children: [
4070
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
3928
4071
  "View ",
3929
4072
  pageLabel
3930
4073
  ] })
@@ -3938,19 +4081,19 @@ ${userText}`
3938
4081
  message.id
3939
4082
  );
3940
4083
  }
3941
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(React4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
4084
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(React4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3942
4085
  "div",
3943
4086
  {
3944
4087
  ref: isCurrentGuideStep ? currentStepRef : null,
3945
4088
  className: `${isRoleChange ? "mt-3" : ""}`,
3946
4089
  children: [
3947
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-sm leading-6 text-gray-700", children: (() => {
4090
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-sm leading-6 text-gray-700", children: (() => {
3948
4091
  const text = message.content || "";
3949
4092
  if (message.kind === "guideStep") {
3950
4093
  const m = text.match(/^(Step\s+\d+:)([\s\S]*)/);
3951
4094
  if (m) {
3952
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
3953
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("strong", { children: m[1] }),
4095
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
4096
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: m[1] }),
3954
4097
  m[2]
3955
4098
  ] });
3956
4099
  }
@@ -3958,16 +4101,16 @@ ${userText}`
3958
4101
  if (message.role === "assistant" && text) {
3959
4102
  return renderMarkdown(text);
3960
4103
  }
3961
- return text || /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "opacity-70", children: "Thinking\u2026" });
4104
+ return text || /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "opacity-70", children: "Thinking\u2026" });
3962
4105
  })() }),
3963
- message.role === "assistant" && message.structuredData && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4106
+ message.role === "assistant" && message.structuredData && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3964
4107
  DataRenderer,
3965
4108
  {
3966
4109
  type: message.structuredData.type,
3967
4110
  data: message.structuredData.data
3968
4111
  }
3969
4112
  ) }),
3970
- message.role === "assistant" && message.followups && message.followups.length > 0 && !message.followupSelected && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mt-3 flex flex-wrap gap-1.5", children: message.followups.map((followup) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4113
+ 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)(
3971
4114
  "button",
3972
4115
  {
3973
4116
  type: "button",
@@ -3981,8 +4124,8 @@ ${userText}`
3981
4124
  }
3982
4125
  ) }, message.id);
3983
4126
  }),
3984
- (activeGuide || guideComplete) && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
3985
- activeGuide && activeGuide.stepIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4127
+ (activeGuide || guideComplete) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
4128
+ activeGuide && activeGuide.stepIndex > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3986
4129
  Button,
3987
4130
  {
3988
4131
  type: "button",
@@ -3990,10 +4133,10 @@ ${userText}`
3990
4133
  variant: "secondary",
3991
4134
  className: "h-7 w-7 rounded-full p-0 bg-gray-100 hover:bg-gray-200 border border-gray-200",
3992
4135
  onClick: goBackGuide,
3993
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.ArrowLeft, { className: "h-3.5 w-3.5 text-gray-600" })
4136
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowLeft, { className: "h-3.5 w-3.5 text-gray-600" })
3994
4137
  }
3995
4138
  ),
3996
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
4139
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3997
4140
  Button,
3998
4141
  {
3999
4142
  type: "button",
@@ -4002,31 +4145,32 @@ ${userText}`
4002
4145
  className: "h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",
4003
4146
  onClick: guideComplete ? handleBack : advanceGuide,
4004
4147
  children: [
4005
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: guideComplete ? "Done" : "Next" }),
4006
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
4007
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
4008
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
4148
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: guideComplete ? "Done" : "Next" }),
4149
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-0.5 text-gray-400", children: [
4150
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Command, { className: "h-3 w-3" }),
4151
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CornerDownLeft, { className: "h-3 w-3" })
4009
4152
  ] })
4010
4153
  ]
4011
4154
  }
4012
4155
  )
4013
4156
  ] }),
4014
- (phase === "thinking" || phase === "searching" || phase === "executing" || phase === "responding") && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `${lastRole === "user" ? "mt-3" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4157
+ (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)(
4015
4158
  AssistantActivity,
4016
4159
  {
4017
4160
  phase,
4018
4161
  progressSteps
4019
4162
  }
4020
4163
  ) }),
4021
- !activeGuide && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref: messagesEndRef })
4164
+ isEscalated && agentIsTyping && phase === "idle" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TypingIndicator, {}) }),
4165
+ !activeGuide && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: messagesEndRef })
4022
4166
  ] }) }) }) })
4023
4167
  }
4024
4168
  ),
4025
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "px-4 py-3 border-t border-gray-100 bg-gray-50/50 shrink-0", children: [
4026
- pendingFile && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mb-2 flex items-center gap-2 rounded-xl bg-blue-50 border border-blue-200 px-3 py-2", children: [
4027
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-4 w-4 text-blue-600" }),
4028
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-xs text-blue-700 flex-1 truncate", children: pendingFile.name }),
4029
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4169
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "px-4 py-3 border-t border-gray-100 bg-gray-50/50 shrink-0", children: [
4170
+ 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: [
4171
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.FileSpreadsheet, { className: "h-4 w-4 text-blue-600" }),
4172
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-xs text-blue-700 flex-1 truncate", children: pendingFile.name }),
4173
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4030
4174
  "button",
4031
4175
  {
4032
4176
  type: "button",
@@ -4035,12 +4179,12 @@ ${userText}`
4035
4179
  if (fileInputRef.current) fileInputRef.current.value = "";
4036
4180
  },
4037
4181
  className: "text-blue-600 hover:text-blue-800",
4038
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.X, { className: "h-4 w-4" })
4182
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "h-4 w-4" })
4039
4183
  }
4040
4184
  )
4041
4185
  ] }),
4042
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("form", { onSubmit: handleSubmit, className: "w-full", children: [
4043
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4186
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { onSubmit: handleSubmit, className: "w-full", children: [
4187
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4044
4188
  "input",
4045
4189
  {
4046
4190
  ref: fileInputRef,
@@ -4055,8 +4199,8 @@ ${userText}`
4055
4199
  }
4056
4200
  }
4057
4201
  ),
4058
- /* @__PURE__ */ (0, import_jsx_runtime9.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: [
4059
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4202
+ /* @__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: [
4203
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4060
4204
  Button,
4061
4205
  {
4062
4206
  type: "button",
@@ -4065,15 +4209,20 @@ ${userText}`
4065
4209
  onClick: () => fileInputRef.current?.click(),
4066
4210
  className: "h-5 w-5 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100",
4067
4211
  title: "Upload CSV for bulk operations",
4068
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.Paperclip, { className: "h-2.5 w-2.5" })
4212
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Paperclip, { className: "h-2.5 w-2.5" })
4069
4213
  }
4070
4214
  ),
4071
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4215
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4072
4216
  "textarea",
4073
4217
  {
4074
4218
  placeholder: pendingFile ? "Describe what to do with this CSV..." : "Ask anything...",
4075
4219
  value: input,
4076
- onChange: (e) => setInput(e.target.value),
4220
+ onChange: (e) => {
4221
+ setInput(e.target.value);
4222
+ if (e.target.value.length > 0) {
4223
+ handleTypingStart();
4224
+ }
4225
+ },
4077
4226
  rows: 1,
4078
4227
  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",
4079
4228
  style: { minHeight: "20px", maxHeight: "120px" },
@@ -4124,20 +4273,20 @@ ${userText}`
4124
4273
  }
4125
4274
  }
4126
4275
  ),
4127
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4276
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4128
4277
  Button,
4129
4278
  {
4130
4279
  type: "submit",
4131
4280
  size: "icon",
4132
4281
  disabled: !input.trim() && !pendingFile,
4133
4282
  className: "h-6 w-6 rounded-full bg-gray-900 hover:bg-gray-800 disabled:bg-gray-300",
4134
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.ArrowUp, { className: "h-2.5 w-2.5" })
4283
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowUp, { className: "h-2.5 w-2.5" })
4135
4284
  }
4136
4285
  )
4137
4286
  ] })
4138
4287
  ] })
4139
4288
  ] }),
4140
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4289
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4141
4290
  GuideCursor,
4142
4291
  {
4143
4292
  x: cursorState.x,
@@ -4164,7 +4313,9 @@ function ChatPanelWithToggle({
4164
4313
  orgId,
4165
4314
  userName,
4166
4315
  userEmail,
4167
- userOrganization
4316
+ userOrganization,
4317
+ supabaseUrl,
4318
+ supabaseAnonKey
4168
4319
  }) {
4169
4320
  const [internalIsOpen, setInternalIsOpen] = React4.useState(defaultOpen);
4170
4321
  const isOpen = controlledIsOpen !== void 0 ? controlledIsOpen : internalIsOpen;
@@ -4184,7 +4335,7 @@ function ChatPanelWithToggle({
4184
4335
  document.body.style.transition = originalTransition;
4185
4336
  };
4186
4337
  }, [isOpen]);
4187
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
4338
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4188
4339
  ChatPanel,
4189
4340
  {
4190
4341
  isOpen,
@@ -4200,13 +4351,15 @@ function ChatPanelWithToggle({
4200
4351
  orgId,
4201
4352
  userName,
4202
4353
  userEmail,
4203
- userOrganization
4354
+ userOrganization,
4355
+ supabaseUrl,
4356
+ supabaseAnonKey
4204
4357
  }
4205
4358
  );
4206
4359
  }
4207
4360
 
4208
4361
  // src/createKiteChat.tsx
4209
- var import_jsx_runtime10 = require("react/jsx-runtime");
4362
+ var import_jsx_runtime11 = require("react/jsx-runtime");
4210
4363
  function KiteChatWrapper({
4211
4364
  initialConfig,
4212
4365
  onConfigUpdate,
@@ -4243,7 +4396,7 @@ function KiteChatWrapper({
4243
4396
  container.classList.toggle("dark", prefersDark);
4244
4397
  }
4245
4398
  }, [config.theme]);
4246
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4399
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4247
4400
  ChatPanelWithToggle,
4248
4401
  {
4249
4402
  isOpen,
@@ -4258,7 +4411,9 @@ function KiteChatWrapper({
4258
4411
  orgId: config.orgId,
4259
4412
  userName: config.userName,
4260
4413
  userEmail: config.userEmail,
4261
- userOrganization: config.userOrganization
4414
+ userOrganization: config.userOrganization,
4415
+ supabaseUrl: config.supabaseUrl,
4416
+ supabaseAnonKey: config.supabaseAnonKey
4262
4417
  }
4263
4418
  );
4264
4419
  }
@@ -4288,7 +4443,7 @@ function createKiteChat(config) {
4288
4443
  }
4289
4444
  root = (0, import_client.createRoot)(containerElement);
4290
4445
  root.render(
4291
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4446
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4292
4447
  KiteChatWrapper,
4293
4448
  {
4294
4449
  initialConfig: currentConfig,