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