@object-ui/plugin-chatbot 16.0.0 → 16.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as e from "react";
2
2
  import { Children as t, Fragment as n, createContext as r, isValidElement as i, memo as a, useCallback as o, useContext as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
3
- import { Alert as f, AlertDescription as p, Avatar as m, AvatarFallback as h, AvatarImage as g, Badge as _, Button as v, Card as y, CardContent as b, CardDescription as x, CardHeader as S, CardTitle as C, Collapsible as w, CollapsibleContent as T, CollapsibleTrigger as E, Command as D, CommandEmpty as O, CommandGroup as k, CommandInput as A, CommandItem as j, CommandList as M, CommandSeparator as N, DropdownMenu as ee, DropdownMenuContent as P, DropdownMenuItem as F, DropdownMenuTrigger as I, Empty as te, EmptyDescription as ne, EmptyHeader as L, EmptyMedia as re, EmptyTitle as ie, HoverCard as R, HoverCardContent as ae, HoverCardTrigger as oe, Input as se, Label as z, ScrollArea as ce, ScrollBar as le, Select as ue, SelectContent as de, SelectItem as fe, SelectTrigger as pe, SelectValue as me, Separator as he, Sheet as ge, SheetContent as _e, SheetDescription as ve, SheetHeader as ye, SheetTitle as be, Skeleton as xe, Table as Se, TableBody as Ce, TableCell as B, TableHead as V, TableHeader as we, TableRow as Te, Tabs as Ee, TabsList as De, TabsTrigger as Oe, Textarea as ke, Tooltip as H, TooltipContent as Ae, TooltipProvider as U, TooltipTrigger as je, cn as W } from "@object-ui/components";
4
- import { AlertCircle as Me, ArrowDownIcon as Ne, ArrowRight as Pe, BookIcon as G, Bot as Fe, BrainIcon as Ie, Check as Le, CheckCircle2 as K, CheckCircleIcon as Re, CheckIcon as ze, ChevronDownIcon as Be, ChevronLeftIcon as Ve, ChevronRightIcon as q, CircleIcon as He, ClipboardList as Ue, Clock as We, Clock3 as Ge, ClockIcon as Ke, Copy as qe, CopyIcon as Je, CornerDownLeft as Ye, CornerDownLeftIcon as Xe, Eye as Ze, GitCompareArrows as Qe, HelpCircle as $e, Hourglass as et, ImageIcon as tt, Inbox as nt, Loader2 as rt, Loader2Icon as it, Maximize2 as at, MicIcon as ot, Minimize2 as st, PaperclipIcon as ct, PlusIcon as lt, RefreshCw as ut, Rocket as dt, Send as ft, ShieldCheck as pt, Sparkles as mt, SquareIcon as ht, Table2 as gt, TriangleAlert as _t, WifiOff as vt, WrenchIcon as yt, X as J, XCircle as Y, XCircleIcon as bt, XIcon as X } from "lucide-react";
3
+ import { Alert as f, AlertDescription as p, Avatar as m, AvatarFallback as h, AvatarImage as g, Badge as _, Button as v, Card as y, CardContent as b, CardDescription as x, CardHeader as S, CardTitle as C, Collapsible as w, CollapsibleContent as T, CollapsibleTrigger as E, Command as D, CommandEmpty as O, CommandGroup as k, CommandInput as A, CommandItem as j, CommandList as M, CommandSeparator as N, DropdownMenu as ee, DropdownMenuContent as P, DropdownMenuItem as F, DropdownMenuTrigger as I, Empty as te, EmptyDescription as ne, EmptyHeader as L, EmptyMedia as re, EmptyTitle as ie, HoverCard as R, HoverCardContent as ae, HoverCardTrigger as oe, Input as z, Label as B, ScrollArea as V, ScrollBar as H, Select as se, SelectContent as ce, SelectItem as le, SelectTrigger as ue, SelectValue as de, Separator as fe, Sheet as pe, SheetContent as me, SheetDescription as he, SheetHeader as ge, SheetTitle as _e, Skeleton as ve, Table as ye, TableBody as be, TableCell as U, TableHead as W, TableHeader as xe, TableRow as Se, Tabs as Ce, TabsList as we, TabsTrigger as Te, Textarea as Ee, Tooltip as De, TooltipContent as Oe, TooltipProvider as G, TooltipTrigger as ke, cn as K } from "@object-ui/components";
4
+ import { AlertCircle as Ae, ArrowDownIcon as je, ArrowRight as Me, BookIcon as Ne, Bot as Pe, BrainIcon as Fe, Check as Ie, CheckCircle2 as q, CheckCircleIcon as Le, CheckIcon as Re, ChevronDownIcon as ze, ChevronLeftIcon as Be, ChevronRightIcon as J, CircleIcon as Ve, ClipboardList as He, Clock as Ue, Clock3 as We, ClockIcon as Ge, Copy as Ke, CopyIcon as qe, CornerDownLeft as Je, CornerDownLeftIcon as Ye, Eye as Xe, GitCompareArrows as Ze, HelpCircle as Qe, Hourglass as $e, ImageIcon as et, Inbox as tt, Loader2 as nt, Loader2Icon as rt, Maximize2 as it, MicIcon as at, Minimize2 as ot, PaperclipIcon as st, PlusIcon as ct, RefreshCw as lt, Rocket as ut, Send as dt, ShieldCheck as ft, Sparkles as pt, SquareIcon as mt, Table2 as ht, TriangleAlert as gt, WifiOff as _t, WrenchIcon as vt, X as Y, XCircle as X, XCircleIcon as yt, XIcon as bt } from "lucide-react";
5
5
  import { Fragment as Z, jsx as Q, jsxs as $ } from "react/jsx-runtime";
6
6
  import { useChat as xt } from "@ai-sdk/react";
7
7
  import { DefaultChatTransport as St } from "ai";
@@ -446,90 +446,87 @@ function un(e = {}) {
446
446
  A.current = j, (e === "streaming" || e === "submitted") && j === "ready" && an();
447
447
  }, [j]);
448
448
  let [M, N] = d(() => ln(n)), [ee, P] = d(!1), [F, I] = d(""), [te, ne] = d(""), L = u(null);
449
- if (c(() => () => {
449
+ c(() => () => {
450
450
  L.current &&= (clearTimeout(L.current), null);
451
- }, []), S) {
452
- let { messages: e, status: t, error: n, sendMessage: r, regenerate: i, stop: a, setMessages: s } = k, c = t === "submitted" || t === "streaming", l = nn(e, { isStreaming: c }).map((t, n) => ({
453
- ...t,
454
- metadata: e[n]?.metadata
455
- }));
456
- return {
457
- messages: l,
458
- isLoading: c,
459
- error: n,
460
- sendMessage: o((e) => {
461
- let t = e.trim();
462
- if (!t) return;
463
- let n = [...l, {
464
- id: Rt("msg"),
465
- role: "user",
466
- content: t
467
- }];
468
- r({ text: t }), ne(""), x?.(t, n);
469
- }, [
470
- r,
471
- x,
472
- l
473
- ]),
474
- stop: a,
475
- reload: i,
476
- clear: o(() => {
477
- s([]);
478
- }, [s]),
479
- setMessages: s,
480
- isApiMode: !0,
481
- input: te,
482
- setInput: ne,
483
- handleInputChange: o((e) => {
484
- ne(e.target.value);
485
- }, [])
486
- };
487
- }
488
- let re = o(() => {
451
+ }, []);
452
+ let { messages: re, status: ie, error: R, sendMessage: ae, regenerate: oe, stop: z, setMessages: B } = k, V = ie === "submitted" || ie === "streaming", H = nn(re, { isStreaming: V }).map((e, t) => ({
453
+ ...e,
454
+ metadata: re[t]?.metadata
455
+ })), se = o((e) => {
456
+ let t = e.trim();
457
+ if (!t) return;
458
+ let n = [...H, {
459
+ id: Rt("msg"),
460
+ role: "user",
461
+ content: t
462
+ }];
463
+ ae({ text: t }), ne(""), x?.(t, n);
464
+ }, [
465
+ ae,
466
+ x,
467
+ H
468
+ ]), ce = o(() => {
469
+ B([]);
470
+ }, [B]), le = o((e) => {
471
+ ne(e.target.value);
472
+ }, []), ue = o(() => {
489
473
  L.current &&= (clearTimeout(L.current), null), P(!1);
474
+ }, []), de = o((e) => {
475
+ if (!e.trim()) return;
476
+ let t = {
477
+ id: Rt("msg"),
478
+ role: "user",
479
+ content: e.trim(),
480
+ timestamp: _ ? (/* @__PURE__ */ new Date()).toLocaleTimeString() : void 0
481
+ };
482
+ N((n) => {
483
+ let r = [...n, t];
484
+ return x?.(e.trim(), r), r;
485
+ }), I(""), v && (P(!0), L.current = setTimeout(() => {
486
+ let e = {
487
+ id: Rt("msg"),
488
+ role: "assistant",
489
+ content: y || "Thank you for your message!",
490
+ timestamp: _ ? (/* @__PURE__ */ new Date()).toLocaleTimeString() : void 0
491
+ };
492
+ N((t) => [...t, e]), P(!1);
493
+ }, b));
494
+ }, [
495
+ _,
496
+ v,
497
+ y,
498
+ b,
499
+ x
500
+ ]), fe = o(() => {}, []), pe = o(() => {
501
+ ue(), N([]);
502
+ }, [ue]), me = o((e) => {
503
+ I(e.target.value);
490
504
  }, []);
491
- return {
505
+ return S ? {
506
+ messages: H,
507
+ isLoading: V,
508
+ error: R,
509
+ sendMessage: se,
510
+ stop: z,
511
+ reload: oe,
512
+ clear: ce,
513
+ setMessages: B,
514
+ isApiMode: !0,
515
+ input: te,
516
+ setInput: ne,
517
+ handleInputChange: le
518
+ } : {
492
519
  messages: M,
493
520
  isLoading: ee,
494
521
  error: void 0,
495
- sendMessage: o((e) => {
496
- if (!e.trim()) return;
497
- let t = {
498
- id: Rt("msg"),
499
- role: "user",
500
- content: e.trim(),
501
- timestamp: _ ? (/* @__PURE__ */ new Date()).toLocaleTimeString() : void 0
502
- };
503
- N((n) => {
504
- let r = [...n, t];
505
- return x?.(e.trim(), r), r;
506
- }), I(""), v && (P(!0), L.current = setTimeout(() => {
507
- let e = {
508
- id: Rt("msg"),
509
- role: "assistant",
510
- content: y || "Thank you for your message!",
511
- timestamp: _ ? (/* @__PURE__ */ new Date()).toLocaleTimeString() : void 0
512
- };
513
- N((t) => [...t, e]), P(!1);
514
- }, b));
515
- }, [
516
- _,
517
- v,
518
- y,
519
- b,
520
- x
521
- ]),
522
- stop: re,
523
- reload: o(() => {}, []),
524
- clear: o(() => {
525
- re(), N([]);
526
- }, [re]),
522
+ sendMessage: de,
523
+ stop: ue,
524
+ reload: fe,
525
+ clear: pe,
527
526
  isApiMode: !1,
528
527
  input: F,
529
528
  setInput: I,
530
- handleInputChange: o((e) => {
531
- I(e.target.value);
532
- }, [])
529
+ handleInputChange: me
533
530
  };
534
531
  }
535
532
  //#endregion
@@ -726,15 +723,11 @@ function Mn() {
726
723
  //#endregion
727
724
  //#region src/FloatingChatbotTrigger.tsx
728
725
  function Nn() {
729
- try {
730
- let { t: e } = Tt();
731
- return (t, n) => {
732
- let r = e(`common.${t}`);
733
- return !r || r === `common.${t}` ? n : r;
734
- };
735
- } catch {
736
- return (e, t) => t;
737
- }
726
+ let { t: e } = Tt();
727
+ return (t, n) => {
728
+ let r = e(`common.${t}`);
729
+ return !r || r === `common.${t}` ? n : r;
730
+ };
738
731
  }
739
732
  var Pn = {
740
733
  32: "size-8",
@@ -759,11 +752,11 @@ function Ln({ position: e = "bottom-right", size: t = 56, className: n }) {
759
752
  let { isOpen: r, toggle: i } = Mn(), a = Nn();
760
753
  return /* @__PURE__ */ Q(v, {
761
754
  onClick: i,
762
- className: W("fixed z-50 rounded-full shadow-lg transition-transform hover:scale-105", In(t), r && "hidden", e === "bottom-right" ? "right-6 bottom-20 sm:bottom-6" : "left-6 bottom-20 sm:bottom-6", n),
755
+ className: K("fixed z-50 rounded-full shadow-lg transition-transform hover:scale-105", In(t), r && "hidden", e === "bottom-right" ? "right-6 bottom-20 sm:bottom-6" : "left-6 bottom-20 sm:bottom-6", n),
763
756
  size: "icon",
764
757
  "aria-label": r ? a("closeChat", "Close chat") : a("openChat", "Open chat"),
765
758
  "data-testid": "floating-chatbot-trigger",
766
- children: Q(r ? J : Fe, { className: "h-6 w-6" })
759
+ children: Q(r ? Y : Pe, { className: "h-6 w-6" })
767
760
  });
768
761
  }
769
762
  //#endregion
@@ -813,7 +806,7 @@ function Hn(e) {
813
806
  function Un({ title: e = "Chat", position: t = "bottom-right", width: n = 400, height: r = 520, children: i, className: a, headerExtra: o, headerActions: s }) {
814
807
  let { isOpen: c, isFullscreen: l, close: u, toggleFullscreen: d } = Mn();
815
808
  return c ? /* @__PURE__ */ $("div", {
816
- className: W("fixed z-50 flex flex-col overflow-hidden border bg-background shadow-xl transition-all", l ? "inset-0 h-svh w-screen rounded-none" : t === "bottom-right" ? W("left-3 right-3 bottom-[calc(4rem_+_env(safe-area-inset-bottom))] rounded-lg", "sm:left-auto sm:right-6 sm:bottom-20 sm:max-h-[calc(100vh_-_100px)]", Vn(n), Hn(r)) : W("left-3 right-3 bottom-[calc(4rem_+_env(safe-area-inset-bottom))] rounded-lg", "sm:right-auto sm:left-6 sm:bottom-20 sm:max-h-[calc(100vh_-_100px)]", Vn(n), Hn(r)), a),
809
+ className: K("fixed z-50 flex flex-col overflow-hidden border bg-background shadow-xl transition-all", l ? "inset-0 h-svh w-screen rounded-none" : t === "bottom-right" ? K("left-3 right-3 bottom-[calc(4rem_+_env(safe-area-inset-bottom))] rounded-lg", "sm:left-auto sm:right-6 sm:bottom-20 sm:max-h-[calc(100vh_-_100px)]", Vn(n), Hn(r)) : K("left-3 right-3 bottom-[calc(4rem_+_env(safe-area-inset-bottom))] rounded-lg", "sm:right-auto sm:left-6 sm:bottom-20 sm:max-h-[calc(100vh_-_100px)]", Vn(n), Hn(r)), a),
817
810
  role: "dialog",
818
811
  "aria-label": e,
819
812
  "data-testid": "floating-chatbot-panel",
@@ -840,7 +833,7 @@ function Un({ title: e = "Chat", position: t = "bottom-right", width: n = 400, h
840
833
  onClick: d,
841
834
  "aria-label": l ? "Exit fullscreen" : "Fullscreen",
842
835
  "data-testid": "floating-chatbot-fullscreen",
843
- children: Q(l ? st : at, { className: "h-4 w-4" })
836
+ children: Q(l ? ot : it, { className: "h-4 w-4" })
844
837
  }),
845
838
  /* @__PURE__ */ Q(v, {
846
839
  variant: "ghost",
@@ -849,7 +842,7 @@ function Un({ title: e = "Chat", position: t = "bottom-right", width: n = 400, h
849
842
  onClick: u,
850
843
  "aria-label": "Close chat",
851
844
  "data-testid": "floating-chatbot-close",
852
- children: /* @__PURE__ */ Q(J, { className: "h-4 w-4" })
845
+ children: /* @__PURE__ */ Q(Y, { className: "h-4 w-4" })
853
846
  })
854
847
  ]
855
848
  })
@@ -950,16 +943,16 @@ function Qn(e) {
950
943
  //#endregion
951
944
  //#region src/elements/conversation.tsx
952
945
  var $n = ({ className: e, ...t }) => /* @__PURE__ */ Q(Et, {
953
- className: W("relative flex-1 overflow-y-hidden", e),
946
+ className: K("relative flex-1 overflow-y-hidden", e),
954
947
  initial: "smooth",
955
948
  resize: "smooth",
956
949
  role: "log",
957
950
  ...t
958
951
  }), er = ({ className: e, ...t }) => /* @__PURE__ */ Q(Et.Content, {
959
- className: W("flex flex-col gap-8 p-4", e),
952
+ className: K("flex flex-col gap-8 p-4", e),
960
953
  ...t
961
954
  }), tr = ({ className: e, title: t = "No messages yet", description: n = "Start a conversation to see messages here", icon: r, children: i, ...a }) => /* @__PURE__ */ Q("div", {
962
- className: W("flex size-full flex-col items-center justify-center gap-3 p-8 text-center", e),
955
+ className: K("flex size-full flex-col items-center justify-center gap-3 p-8 text-center", e),
963
956
  ...a,
964
957
  children: i ?? /* @__PURE__ */ $(Z, { children: [r && /* @__PURE__ */ Q("div", {
965
958
  className: "text-muted-foreground",
@@ -979,13 +972,13 @@ var $n = ({ className: e, ...t }) => /* @__PURE__ */ Q(Et, {
979
972
  r();
980
973
  }, [r]);
981
974
  return !n && /* @__PURE__ */ Q(v, {
982
- className: W("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full", e),
975
+ className: K("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full", e),
983
976
  onClick: i,
984
977
  size: "icon",
985
978
  type: "button",
986
979
  variant: "outline",
987
980
  ...t,
988
- children: /* @__PURE__ */ Q(Ne, { className: "size-4" })
981
+ children: /* @__PURE__ */ Q(je, { className: "size-4" })
989
982
  });
990
983
  }, rr = Ot("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1", {
991
984
  variants: { orientation: {
@@ -999,27 +992,27 @@ function ir({ className: e, orientation: t, ...n }) {
999
992
  role: "group",
1000
993
  "data-slot": "button-group",
1001
994
  "data-orientation": t,
1002
- className: W(rr({ orientation: t }), e),
995
+ className: K(rr({ orientation: t }), e),
1003
996
  ...n
1004
997
  });
1005
998
  }
1006
999
  function ar({ className: e, asChild: t = !1, ...n }) {
1007
1000
  return /* @__PURE__ */ Q(t ? kt : "div", {
1008
- className: W("flex items-center gap-2 rounded-md border bg-muted px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", e),
1001
+ className: K("flex items-center gap-2 rounded-md border bg-muted px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", e),
1009
1002
  ...n
1010
1003
  });
1011
1004
  }
1012
1005
  //#endregion
1013
1006
  //#region src/elements/message.tsx
1014
1007
  var or = ({ className: e, from: t, ...n }) => /* @__PURE__ */ Q("div", {
1015
- className: W("group flex w-full max-w-[95%] flex-col gap-2", t === "user" ? "is-user ml-auto justify-end" : "is-assistant", e),
1008
+ className: K("group flex w-full max-w-[95%] flex-col gap-2", t === "user" ? "is-user ml-auto justify-end" : "is-assistant", e),
1016
1009
  ...n
1017
1010
  }), sr = ({ children: e, className: t, ...n }) => /* @__PURE__ */ Q("div", {
1018
- className: W("is-user:dark flex w-fit max-w-full min-w-0 flex-col gap-2 overflow-hidden text-sm", "group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground", "group-[.is-assistant]:text-foreground", t),
1011
+ className: K("is-user:dark flex w-fit max-w-full min-w-0 flex-col gap-2 overflow-hidden text-sm", "group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground", "group-[.is-assistant]:text-foreground", t),
1019
1012
  ...n,
1020
1013
  children: e
1021
1014
  }), cr = ({ className: e, children: t, ...n }) => /* @__PURE__ */ Q("div", {
1022
- className: W("flex items-center gap-1", e),
1015
+ className: K("flex items-center gap-1", e),
1023
1016
  ...n,
1024
1017
  children: t
1025
1018
  }), lr = ({ tooltip: e, children: t, label: n, variant: r = "ghost", size: i = "icon", ...a }) => {
@@ -1033,10 +1026,10 @@ var or = ({ className: e, from: t, ...n }) => /* @__PURE__ */ Q("div", {
1033
1026
  children: n || e
1034
1027
  })]
1035
1028
  });
1036
- return e ? /* @__PURE__ */ Q(U, { children: /* @__PURE__ */ $(H, { children: [/* @__PURE__ */ Q(je, {
1029
+ return e ? /* @__PURE__ */ Q(G, { children: /* @__PURE__ */ $(De, { children: [/* @__PURE__ */ Q(ke, {
1037
1030
  asChild: !0,
1038
1031
  children: o
1039
- }), /* @__PURE__ */ Q(Ae, { children: /* @__PURE__ */ Q("p", { children: e }) })] }) }) : o;
1032
+ }), /* @__PURE__ */ Q(Oe, { children: /* @__PURE__ */ Q("p", { children: e }) })] }) }) : o;
1040
1033
  }, ur = r(null), dr = () => {
1041
1034
  let e = s(ur);
1042
1035
  if (!e) throw Error("MessageBranch components must be used within MessageBranch");
@@ -1061,7 +1054,7 @@ var or = ({ className: e, from: t, ...n }) => /* @__PURE__ */ Q("div", {
1061
1054
  return /* @__PURE__ */ Q(ur.Provider, {
1062
1055
  value: l,
1063
1056
  children: /* @__PURE__ */ Q("div", {
1064
- className: W("grid w-full gap-2 [&>div]:pb-0", n),
1057
+ className: K("grid w-full gap-2 [&>div]:pb-0", n),
1065
1058
  ...r
1066
1059
  })
1067
1060
  });
@@ -1074,7 +1067,7 @@ var or = ({ className: e, from: t, ...n }) => /* @__PURE__ */ Q("div", {
1074
1067
  i,
1075
1068
  r
1076
1069
  ]), a.map((e, r) => /* @__PURE__ */ Q("div", {
1077
- className: W("grid gap-2 overflow-hidden [&>div]:pb-0", r === n ? "block" : "hidden"),
1070
+ className: K("grid gap-2 overflow-hidden [&>div]:pb-0", r === n ? "block" : "hidden"),
1078
1071
  ...t,
1079
1072
  children: e
1080
1073
  }, e.key));
@@ -1095,7 +1088,7 @@ var or = ({ className: e, from: t, ...n }) => /* @__PURE__ */ Q("div", {
1095
1088
  type: "button",
1096
1089
  variant: "ghost",
1097
1090
  ...t,
1098
- children: e ?? /* @__PURE__ */ Q(Ve, { size: 14 })
1091
+ children: e ?? /* @__PURE__ */ Q(Be, { size: 14 })
1099
1092
  });
1100
1093
  }, gr = ({ children: e, className: t, ...n }) => {
1101
1094
  let { goToNext: r, totalBranches: i } = dr();
@@ -1107,12 +1100,12 @@ var or = ({ className: e, from: t, ...n }) => /* @__PURE__ */ Q("div", {
1107
1100
  type: "button",
1108
1101
  variant: "ghost",
1109
1102
  ...n,
1110
- children: e ?? /* @__PURE__ */ Q(q, { size: 14 })
1103
+ children: e ?? /* @__PURE__ */ Q(J, { size: 14 })
1111
1104
  });
1112
1105
  }, _r = ({ className: e, ...t }) => {
1113
1106
  let { currentBranch: n, totalBranches: r } = dr();
1114
1107
  return /* @__PURE__ */ $(ar, {
1115
- className: W("border-none bg-transparent text-muted-foreground shadow-none", e),
1108
+ className: K("border-none bg-transparent text-muted-foreground shadow-none", e),
1116
1109
  ...t,
1117
1110
  children: [
1118
1111
  n + 1,
@@ -1121,14 +1114,14 @@ var or = ({ className: e, from: t, ...n }) => /* @__PURE__ */ Q("div", {
1121
1114
  ]
1122
1115
  });
1123
1116
  }, vr = a(({ className: e, ...t }) => /* @__PURE__ */ Q(At, {
1124
- className: W("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", e),
1117
+ className: K("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", e),
1125
1118
  ...t
1126
1119
  }), (e, t) => e.children === t.children);
1127
1120
  vr.displayName = "MessageResponse";
1128
1121
  function yr({ data: e, className: t, onRemove: n, ...r }) {
1129
1122
  let i = e.filename || "", a = (e.mediaType?.startsWith("image/") && e.url ? "image" : "file") == "image", o = i || (a ? "Image" : "Attachment");
1130
1123
  return /* @__PURE__ */ Q("div", {
1131
- className: W("group relative size-24 overflow-hidden rounded-lg", t),
1124
+ className: K("group relative size-24 overflow-hidden rounded-lg", t),
1132
1125
  ...r,
1133
1126
  children: a ? /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q("img", {
1134
1127
  alt: i || "attachment",
@@ -1144,17 +1137,17 @@ function yr({ data: e, className: t, onRemove: n, ...r }) {
1144
1137
  },
1145
1138
  type: "button",
1146
1139
  variant: "ghost",
1147
- children: [/* @__PURE__ */ Q(X, {}), /* @__PURE__ */ Q("span", {
1140
+ children: [/* @__PURE__ */ Q(bt, {}), /* @__PURE__ */ Q("span", {
1148
1141
  className: "sr-only",
1149
1142
  children: "Remove"
1150
1143
  })]
1151
- })] }) : /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ $(H, { children: [/* @__PURE__ */ Q(je, {
1144
+ })] }) : /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ $(De, { children: [/* @__PURE__ */ Q(ke, {
1152
1145
  asChild: !0,
1153
1146
  children: /* @__PURE__ */ Q("div", {
1154
1147
  className: "flex size-full shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",
1155
- children: /* @__PURE__ */ Q(ct, { className: "size-4" })
1148
+ children: /* @__PURE__ */ Q(st, { className: "size-4" })
1156
1149
  })
1157
- }), /* @__PURE__ */ Q(Ae, { children: /* @__PURE__ */ Q("p", { children: o }) })] }), n && /* @__PURE__ */ $(v, {
1150
+ }), /* @__PURE__ */ Q(Oe, { children: /* @__PURE__ */ Q("p", { children: o }) })] }), n && /* @__PURE__ */ $(v, {
1158
1151
  "aria-label": "Remove attachment",
1159
1152
  className: "size-6 shrink-0 rounded-full p-0 opacity-0 transition-opacity hover:bg-accent group-hover:opacity-100 [&>svg]:size-3",
1160
1153
  onClick: (e) => {
@@ -1162,7 +1155,7 @@ function yr({ data: e, className: t, onRemove: n, ...r }) {
1162
1155
  },
1163
1156
  type: "button",
1164
1157
  variant: "ghost",
1165
- children: [/* @__PURE__ */ Q(X, {}), /* @__PURE__ */ Q("span", {
1158
+ children: [/* @__PURE__ */ Q(bt, {}), /* @__PURE__ */ Q("span", {
1166
1159
  className: "sr-only",
1167
1160
  children: "Remove"
1168
1161
  })]
@@ -1171,13 +1164,13 @@ function yr({ data: e, className: t, onRemove: n, ...r }) {
1171
1164
  }
1172
1165
  function br({ children: e, className: t, ...n }) {
1173
1166
  return e ? /* @__PURE__ */ Q("div", {
1174
- className: W("ml-auto flex w-fit flex-wrap items-start gap-2", t),
1167
+ className: K("ml-auto flex w-fit flex-wrap items-start gap-2", t),
1175
1168
  ...n,
1176
1169
  children: e
1177
1170
  }) : null;
1178
1171
  }
1179
1172
  var xr = ({ className: e, children: t, ...n }) => /* @__PURE__ */ Q("div", {
1180
- className: W("mt-4 flex w-full items-center justify-between gap-4", e),
1173
+ className: K("mt-4 flex w-full items-center justify-between gap-4", e),
1181
1174
  ...n,
1182
1175
  children: t
1183
1176
  });
@@ -1187,7 +1180,7 @@ function Sr({ className: e, ...t }) {
1187
1180
  return /* @__PURE__ */ Q("div", {
1188
1181
  "data-slot": "input-group",
1189
1182
  role: "group",
1190
- className: W("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30", "h-9 min-w-0 has-[>textarea]:h-auto", "has-[>[data-align=inline-start]]:[&>input]:pl-2", "has-[>[data-align=inline-end]]:[&>input]:pr-2", "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3", "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3", "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50", "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40", e),
1183
+ className: K("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30", "h-9 min-w-0 has-[>textarea]:h-auto", "has-[>[data-align=inline-start]]:[&>input]:pl-2", "has-[>[data-align=inline-end]]:[&>input]:pr-2", "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3", "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3", "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50", "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40", e),
1191
1184
  ...t
1192
1185
  });
1193
1186
  }
@@ -1205,7 +1198,7 @@ function wr({ className: e, align: t = "inline-start", ...n }) {
1205
1198
  role: "group",
1206
1199
  "data-slot": "input-group-addon",
1207
1200
  "data-align": t,
1208
- className: W(Cr({ align: t }), e),
1201
+ className: K(Cr({ align: t }), e),
1209
1202
  onClick: (e) => {
1210
1203
  e.target.closest("button") || e.currentTarget.parentElement?.querySelector("input")?.focus();
1211
1204
  },
@@ -1226,14 +1219,14 @@ function Er({ className: e, type: t = "button", variant: n = "ghost", size: r =
1226
1219
  type: t,
1227
1220
  "data-size": r,
1228
1221
  variant: n,
1229
- className: W(Tr({ size: r }), e),
1222
+ className: K(Tr({ size: r }), e),
1230
1223
  ...i
1231
1224
  });
1232
1225
  }
1233
1226
  function Dr({ className: e, ...t }) {
1234
- return /* @__PURE__ */ Q(ke, {
1227
+ return /* @__PURE__ */ Q(Ee, {
1235
1228
  "data-slot": "input-group-control",
1236
- className: W("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent", e),
1229
+ className: K("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent", e),
1237
1230
  ...t
1238
1231
  });
1239
1232
  }
@@ -1322,7 +1315,7 @@ function Lr({ data: e, className: t, ...n }) {
1322
1315
  return /* @__PURE__ */ $(ii, { children: [/* @__PURE__ */ Q(oe, {
1323
1316
  asChild: !0,
1324
1317
  children: /* @__PURE__ */ $("div", {
1325
- className: W("group relative flex h-8 cursor-pointer select-none items-center gap-1.5 rounded-md border border-border px-1.5 font-medium text-sm transition-all hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50", t),
1318
+ className: K("group relative flex h-8 cursor-pointer select-none items-center gap-1.5 rounded-md border border-border px-1.5 font-medium text-sm transition-all hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50", t),
1326
1319
  ...n,
1327
1320
  children: [/* @__PURE__ */ $("div", {
1328
1321
  className: "relative size-5 shrink-0",
@@ -1336,7 +1329,7 @@ function Lr({ data: e, className: t, ...n }) {
1336
1329
  width: 20
1337
1330
  }) : /* @__PURE__ */ Q("div", {
1338
1331
  className: "flex size-5 items-center justify-center text-muted-foreground",
1339
- children: /* @__PURE__ */ Q(ct, { className: "size-3" })
1332
+ children: /* @__PURE__ */ Q(st, { className: "size-3" })
1340
1333
  })
1341
1334
  }), /* @__PURE__ */ $(v, {
1342
1335
  "aria-label": "Remove attachment",
@@ -1346,7 +1339,7 @@ function Lr({ data: e, className: t, ...n }) {
1346
1339
  },
1347
1340
  type: "button",
1348
1341
  variant: "ghost",
1349
- children: [/* @__PURE__ */ Q(X, {}), /* @__PURE__ */ Q("span", {
1342
+ children: [/* @__PURE__ */ Q(bt, {}), /* @__PURE__ */ Q("span", {
1350
1343
  className: "sr-only",
1351
1344
  children: "Remove"
1352
1345
  })]
@@ -1388,7 +1381,7 @@ function Lr({ data: e, className: t, ...n }) {
1388
1381
  function Rr({ children: e, className: t, ...r }) {
1389
1382
  let i = Ir();
1390
1383
  return i.files.length ? /* @__PURE__ */ Q("div", {
1391
- className: W("flex flex-wrap items-center gap-2 p-3 w-full", t),
1384
+ className: K("flex flex-wrap items-center gap-2 p-3 w-full", t),
1392
1385
  ...r,
1393
1386
  children: i.files.map((t) => /* @__PURE__ */ Q(n, { children: e(t) }, t.id))
1394
1387
  }) : null;
@@ -1401,7 +1394,7 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
1401
1394
  e.preventDefault(), n.openFileDialog();
1402
1395
  },
1403
1396
  children: [
1404
- /* @__PURE__ */ Q(tt, { className: "mr-2 size-4" }),
1397
+ /* @__PURE__ */ Q(et, { className: "mr-2 size-4" }),
1405
1398
  " ",
1406
1399
  e
1407
1400
  ]
@@ -1529,7 +1522,7 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
1529
1522
  title: r,
1530
1523
  type: "file"
1531
1524
  }), /* @__PURE__ */ Q("form", {
1532
- className: W("w-full", e),
1525
+ className: K("w-full", e),
1533
1526
  onSubmit: (e) => {
1534
1527
  e.preventDefault();
1535
1528
  let t = e.currentTarget, n = v ? _.textInput.value : new FormData(t).get("message") || "";
@@ -1566,7 +1559,7 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
1566
1559
  children: I
1567
1560
  });
1568
1561
  }, Vr = ({ className: e, ...t }) => /* @__PURE__ */ Q("div", {
1569
- className: W("contents", e),
1562
+ className: K("contents", e),
1570
1563
  ...t
1571
1564
  }), Hr = ({ onChange: e, className: t, placeholder: n = "What would you like to know?", ...r }) => {
1572
1565
  let i = jr(), a = Ir(), [o, s] = d(!1), c = (e) => {
@@ -1598,7 +1591,7 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
1598
1591
  }
1599
1592
  } : { onChange: e };
1600
1593
  return /* @__PURE__ */ Q(Dr, {
1601
- className: W("field-sizing-content max-h-48 min-h-16", t),
1594
+ className: K("field-sizing-content max-h-48 min-h-16", t),
1602
1595
  name: "message",
1603
1596
  onCompositionEnd: () => s(!1),
1604
1597
  onCompositionStart: () => s(!0),
@@ -1610,19 +1603,19 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
1610
1603
  });
1611
1604
  }, Ur = ({ className: e, ...t }) => /* @__PURE__ */ Q(wr, {
1612
1605
  align: "block-end",
1613
- className: W("order-first flex-wrap gap-1", e),
1606
+ className: K("order-first flex-wrap gap-1", e),
1614
1607
  ...t
1615
1608
  }), Wr = ({ className: e, ...t }) => /* @__PURE__ */ Q(wr, {
1616
1609
  align: "block-end",
1617
- className: W("justify-between gap-1", e),
1610
+ className: K("justify-between gap-1", e),
1618
1611
  ...t
1619
1612
  }), Gr = ({ className: e, ...t }) => /* @__PURE__ */ Q("div", {
1620
- className: W("flex items-center gap-1", e),
1613
+ className: K("flex items-center gap-1", e),
1621
1614
  ...t
1622
1615
  }), Kr = ({ variant: e = "ghost", className: n, size: r, ...i }) => {
1623
1616
  let a = r ?? (t.count(i.children) > 1 ? "sm" : "icon-sm");
1624
1617
  return /* @__PURE__ */ Q(Er, {
1625
- className: W(n),
1618
+ className: K(n),
1626
1619
  size: a,
1627
1620
  type: "button",
1628
1621
  variant: e,
@@ -1633,20 +1626,20 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
1633
1626
  children: /* @__PURE__ */ Q(Kr, {
1634
1627
  className: e,
1635
1628
  ...n,
1636
- children: t ?? /* @__PURE__ */ Q(lt, { className: "size-4" })
1629
+ children: t ?? /* @__PURE__ */ Q(ct, { className: "size-4" })
1637
1630
  })
1638
1631
  }), Yr = ({ className: e, ...t }) => /* @__PURE__ */ Q(P, {
1639
1632
  align: "start",
1640
- className: W(e),
1633
+ className: K(e),
1641
1634
  ...t
1642
1635
  }), Xr = ({ className: e, ...t }) => /* @__PURE__ */ Q(F, {
1643
- className: W(e),
1636
+ className: K(e),
1644
1637
  ...t
1645
1638
  }), Zr = ({ className: e, variant: t = "default", size: n = "icon-sm", status: r, children: i, ...a }) => {
1646
- let o = /* @__PURE__ */ Q(Xe, { className: "size-4" });
1647
- return r === "submitted" ? o = /* @__PURE__ */ Q(it, { className: "size-4 animate-spin" }) : r === "streaming" ? o = /* @__PURE__ */ Q(ht, { className: "size-4" }) : r === "error" && (o = /* @__PURE__ */ Q(X, { className: "size-4" })), /* @__PURE__ */ Q(Er, {
1639
+ let o = /* @__PURE__ */ Q(Ye, { className: "size-4" });
1640
+ return r === "submitted" ? o = /* @__PURE__ */ Q(rt, { className: "size-4 animate-spin" }) : r === "streaming" ? o = /* @__PURE__ */ Q(mt, { className: "size-4" }) : r === "error" && (o = /* @__PURE__ */ Q(bt, { className: "size-4" })), /* @__PURE__ */ Q(Er, {
1648
1641
  "aria-label": "Submit",
1649
- className: W(e),
1642
+ className: K(e),
1650
1643
  size: n,
1651
1644
  type: "submit",
1652
1645
  variant: t,
@@ -1684,23 +1677,23 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
1684
1677
  s && (i ? s.stop() : s.start());
1685
1678
  }, [s, i]);
1686
1679
  return /* @__PURE__ */ Q(Kr, {
1687
- className: W("relative transition-all duration-200", i && "animate-pulse bg-accent text-accent-foreground", e),
1680
+ className: K("relative transition-all duration-200", i && "animate-pulse bg-accent text-accent-foreground", e),
1688
1681
  disabled: !s,
1689
1682
  onClick: p,
1690
1683
  ...r,
1691
- children: /* @__PURE__ */ Q(ot, { className: "size-4" })
1684
+ children: /* @__PURE__ */ Q(at, { className: "size-4" })
1692
1685
  });
1693
- }, $r = (e) => /* @__PURE__ */ Q(ue, { ...e }), ei = ({ className: e, ...t }) => /* @__PURE__ */ Q(pe, {
1694
- className: W("border-none bg-transparent font-medium text-muted-foreground shadow-none transition-colors", "hover:bg-accent hover:text-foreground aria-expanded:bg-accent aria-expanded:text-foreground", e),
1686
+ }, $r = (e) => /* @__PURE__ */ Q(se, { ...e }), ei = ({ className: e, ...t }) => /* @__PURE__ */ Q(ue, {
1687
+ className: K("border-none bg-transparent font-medium text-muted-foreground shadow-none transition-colors", "hover:bg-accent hover:text-foreground aria-expanded:bg-accent aria-expanded:text-foreground", e),
1695
1688
  ...t
1696
- }), ti = ({ className: e, ...t }) => /* @__PURE__ */ Q(de, {
1697
- className: W(e),
1689
+ }), ti = ({ className: e, ...t }) => /* @__PURE__ */ Q(ce, {
1690
+ className: K(e),
1698
1691
  ...t
1699
- }), ni = ({ className: e, ...t }) => /* @__PURE__ */ Q(fe, {
1700
- className: W(e),
1692
+ }), ni = ({ className: e, ...t }) => /* @__PURE__ */ Q(le, {
1693
+ className: K(e),
1701
1694
  ...t
1702
- }), ri = ({ className: e, ...t }) => /* @__PURE__ */ Q(me, {
1703
- className: W(e),
1695
+ }), ri = ({ className: e, ...t }) => /* @__PURE__ */ Q(de, {
1696
+ className: K(e),
1704
1697
  ...t
1705
1698
  }), ii = ({ openDelay: e = 0, closeDelay: t = 0, ...n }) => /* @__PURE__ */ Q(R, {
1706
1699
  closeDelay: t,
@@ -1710,53 +1703,53 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
1710
1703
  align: e,
1711
1704
  ...t
1712
1705
  }), si = ({ className: e, ...t }) => /* @__PURE__ */ Q("div", {
1713
- className: W(e),
1706
+ className: K(e),
1714
1707
  ...t
1715
1708
  }), ci = ({ className: e, ...t }) => /* @__PURE__ */ Q("div", {
1716
- className: W(e),
1709
+ className: K(e),
1717
1710
  ...t
1718
1711
  }), li = ({ className: e, ...t }) => /* @__PURE__ */ Q("h3", {
1719
- className: W("mb-2 px-3 font-medium text-muted-foreground text-xs", e),
1712
+ className: K("mb-2 px-3 font-medium text-muted-foreground text-xs", e),
1720
1713
  ...t
1721
1714
  }), ui = ({ className: e, ...t }) => /* @__PURE__ */ Q("div", {
1722
- className: W("space-y-1", e),
1715
+ className: K("space-y-1", e),
1723
1716
  ...t
1724
1717
  }), di = ({ className: e, ...t }) => /* @__PURE__ */ Q("div", {
1725
- className: W("flex items-center gap-2 px-3 py-2 text-xs hover:bg-accent", e),
1718
+ className: K("flex items-center gap-2 px-3 py-2 text-xs hover:bg-accent", e),
1726
1719
  ...t
1727
1720
  }), fi = ({ className: e, ...t }) => /* @__PURE__ */ Q(D, {
1728
- className: W(e),
1721
+ className: K(e),
1729
1722
  ...t
1730
1723
  }), pi = ({ className: e, ...t }) => /* @__PURE__ */ Q(A, {
1731
- className: W(e),
1724
+ className: K(e),
1732
1725
  ...t
1733
1726
  }), mi = ({ className: e, ...t }) => /* @__PURE__ */ Q(M, {
1734
- className: W(e),
1727
+ className: K(e),
1735
1728
  ...t
1736
1729
  }), hi = ({ className: e, ...t }) => /* @__PURE__ */ Q(O, {
1737
- className: W(e),
1730
+ className: K(e),
1738
1731
  ...t
1739
1732
  }), gi = ({ className: e, ...t }) => /* @__PURE__ */ Q(k, {
1740
- className: W(e),
1733
+ className: K(e),
1741
1734
  ...t
1742
1735
  }), _i = ({ className: e, ...t }) => /* @__PURE__ */ Q(j, {
1743
- className: W(e),
1736
+ className: K(e),
1744
1737
  ...t
1745
1738
  }), vi = ({ className: e, ...t }) => /* @__PURE__ */ Q(N, {
1746
- className: W(e),
1739
+ className: K(e),
1747
1740
  ...t
1748
- }), yi = ({ className: e, children: t, ...n }) => /* @__PURE__ */ $(ce, {
1741
+ }), yi = ({ className: e, children: t, ...n }) => /* @__PURE__ */ $(V, {
1749
1742
  className: "w-full overflow-x-auto whitespace-nowrap",
1750
1743
  ...n,
1751
1744
  children: [/* @__PURE__ */ Q("div", {
1752
- className: W("flex w-max flex-nowrap items-center gap-2", e),
1745
+ className: K("flex w-max flex-nowrap items-center gap-2", e),
1753
1746
  children: t
1754
- }), /* @__PURE__ */ Q(le, {
1747
+ }), /* @__PURE__ */ Q(H, {
1755
1748
  className: "hidden",
1756
1749
  orientation: "horizontal"
1757
1750
  })]
1758
1751
  }), bi = ({ suggestion: e, onClick: t, className: n, variant: r = "outline", size: i = "sm", children: a, ...o }) => /* @__PURE__ */ Q(v, {
1759
- className: W("cursor-pointer rounded-full px-4", n),
1752
+ className: K("cursor-pointer rounded-full px-4", n),
1760
1753
  onClick: () => {
1761
1754
  t?.(e);
1762
1755
  },
@@ -1811,7 +1804,7 @@ var wi = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
1811
1804
  ]), /* @__PURE__ */ Q(xi.Provider, {
1812
1805
  value: { code: e },
1813
1806
  children: /* @__PURE__ */ Q("div", {
1814
- className: W("group relative w-full overflow-hidden rounded-md border bg-background text-foreground", r),
1807
+ className: K("group relative w-full overflow-hidden rounded-md border bg-background text-foreground", r),
1815
1808
  ...a,
1816
1809
  children: /* @__PURE__ */ $("div", {
1817
1810
  className: "relative",
@@ -1843,9 +1836,9 @@ var wi = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
1843
1836
  } catch (e) {
1844
1837
  t?.(e);
1845
1838
  }
1846
- }, f = o ? ze : Je;
1839
+ }, f = o ? Re : qe;
1847
1840
  return /* @__PURE__ */ Q(v, {
1848
- className: W("shrink-0", i),
1841
+ className: K("shrink-0", i),
1849
1842
  onClick: u,
1850
1843
  size: "icon",
1851
1844
  variant: "ghost",
@@ -1853,19 +1846,19 @@ var wi = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
1853
1846
  children: r ?? /* @__PURE__ */ Q(f, { size: 14 })
1854
1847
  });
1855
1848
  }, Ei = ({ className: e, ...t }) => /* @__PURE__ */ Q(w, {
1856
- className: W("not-prose mb-4 w-full rounded-md border", e),
1849
+ className: K("not-prose mb-4 w-full rounded-md border", e),
1857
1850
  ...t
1858
1851
  }), Di = (e) => /* @__PURE__ */ $(_, {
1859
1852
  className: "gap-1.5 rounded-full text-xs",
1860
1853
  variant: "secondary",
1861
1854
  children: [{
1862
- "input-streaming": /* @__PURE__ */ Q(He, { className: "size-4" }),
1863
- "input-available": /* @__PURE__ */ Q(Ke, { className: "size-4 animate-pulse" }),
1864
- "approval-requested": /* @__PURE__ */ Q(Ke, { className: "size-4 text-yellow-600" }),
1865
- "approval-responded": /* @__PURE__ */ Q(Re, { className: "size-4 text-blue-600" }),
1866
- "output-available": /* @__PURE__ */ Q(Re, { className: "size-4 text-green-600" }),
1867
- "output-error": /* @__PURE__ */ Q(bt, { className: "size-4 text-red-600" }),
1868
- "output-denied": /* @__PURE__ */ Q(bt, { className: "size-4 text-orange-600" })
1855
+ "input-streaming": /* @__PURE__ */ Q(Ve, { className: "size-4" }),
1856
+ "input-available": /* @__PURE__ */ Q(Ge, { className: "size-4 animate-pulse" }),
1857
+ "approval-requested": /* @__PURE__ */ Q(Ge, { className: "size-4 text-yellow-600" }),
1858
+ "approval-responded": /* @__PURE__ */ Q(Le, { className: "size-4 text-blue-600" }),
1859
+ "output-available": /* @__PURE__ */ Q(Le, { className: "size-4 text-green-600" }),
1860
+ "output-error": /* @__PURE__ */ Q(yt, { className: "size-4 text-red-600" }),
1861
+ "output-denied": /* @__PURE__ */ Q(yt, { className: "size-4 text-orange-600" })
1869
1862
  }[e], {
1870
1863
  "input-streaming": "Pending",
1871
1864
  "input-available": "Running",
@@ -1876,24 +1869,24 @@ var wi = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
1876
1869
  "output-denied": "Denied"
1877
1870
  }[e]]
1878
1871
  }), Oi = ({ className: e, title: t, type: n, state: r, ...i }) => /* @__PURE__ */ $(E, {
1879
- className: W("flex w-full items-center justify-between gap-4 p-3", e),
1872
+ className: K("flex w-full items-center justify-between gap-4 p-3", e),
1880
1873
  ...i,
1881
1874
  children: [/* @__PURE__ */ $("div", {
1882
1875
  className: "flex items-center gap-2",
1883
1876
  children: [
1884
- /* @__PURE__ */ Q(yt, { className: "size-4 text-muted-foreground" }),
1877
+ /* @__PURE__ */ Q(vt, { className: "size-4 text-muted-foreground" }),
1885
1878
  /* @__PURE__ */ Q("span", {
1886
1879
  className: "font-medium text-sm",
1887
1880
  children: t ?? n.split("-").slice(1).join("-")
1888
1881
  }),
1889
1882
  Di(r)
1890
1883
  ]
1891
- }), /* @__PURE__ */ Q(Be, { className: "size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180" })]
1884
+ }), /* @__PURE__ */ Q(ze, { className: "size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180" })]
1892
1885
  }), ki = ({ className: e, ...t }) => /* @__PURE__ */ Q(T, {
1893
- className: W("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in", e),
1886
+ className: K("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in", e),
1894
1887
  ...t
1895
1888
  }), Ai = ({ className: e, input: t, ...n }) => /* @__PURE__ */ $("div", {
1896
- className: W("space-y-2 overflow-hidden p-4", e),
1889
+ className: K("space-y-2 overflow-hidden p-4", e),
1897
1890
  ...n,
1898
1891
  children: [/* @__PURE__ */ Q("h4", {
1899
1892
  className: "font-medium text-muted-foreground text-xs uppercase tracking-wide",
@@ -1915,21 +1908,21 @@ var wi = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
1915
1908
  code: t,
1916
1909
  language: "json"
1917
1910
  })), /* @__PURE__ */ $("div", {
1918
- className: W("space-y-2 p-4", e),
1911
+ className: K("space-y-2 p-4", e),
1919
1912
  ...r,
1920
1913
  children: [/* @__PURE__ */ Q("h4", {
1921
1914
  className: "font-medium text-muted-foreground text-xs uppercase tracking-wide",
1922
1915
  children: n ? "Error" : "Result"
1923
1916
  }), /* @__PURE__ */ $("div", {
1924
- className: W("overflow-x-auto rounded-md text-xs [&_table]:w-full", n ? "bg-destructive/10 text-destructive" : "bg-muted/50 text-foreground"),
1917
+ className: K("overflow-x-auto rounded-md text-xs [&_table]:w-full", n ? "bg-destructive/10 text-destructive" : "bg-muted/50 text-foreground"),
1925
1918
  children: [n && /* @__PURE__ */ Q("div", { children: n }), a]
1926
1919
  })]
1927
1920
  });
1928
1921
  }, Mi = a(({ children: e, as: t = "p", className: n, duration: r = 2, spread: i = 2 }) => {
1929
- let a = Pt.create(t), o = l(() => (e?.length ?? 0) * i, [e, i]);
1922
+ let a = l(() => Pt.create(t), [t]), o = l(() => (e?.length ?? 0) * i, [e, i]);
1930
1923
  return /* @__PURE__ */ Q(a, {
1931
1924
  animate: { backgroundPosition: "0% center" },
1932
- className: W("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent", "[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]", n),
1925
+ className: K("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent", "[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]", n),
1933
1926
  initial: { backgroundPosition: "100% center" },
1934
1927
  style: {
1935
1928
  "--spread": `${o}px`,
@@ -1982,7 +1975,7 @@ var wi = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
1982
1975
  duration: f
1983
1976
  },
1984
1977
  children: /* @__PURE__ */ Q(w, {
1985
- className: W("not-prose mb-4", e),
1978
+ className: K("not-prose mb-4", e),
1986
1979
  onOpenChange: (e) => {
1987
1980
  u(e);
1988
1981
  },
@@ -2001,16 +1994,16 @@ var wi = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
2001
1994
  ] }), zi = a(({ className: e, children: t, getThinkingMessage: n = Ri, ...r }) => {
2002
1995
  let { isStreaming: i, isOpen: a, duration: o } = Pi();
2003
1996
  return /* @__PURE__ */ Q(E, {
2004
- className: W("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground", e),
1997
+ className: K("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground", e),
2005
1998
  ...r,
2006
1999
  children: t ?? /* @__PURE__ */ $(Z, { children: [
2007
- /* @__PURE__ */ Q(Ie, { className: "size-4" }),
2000
+ /* @__PURE__ */ Q(Fe, { className: "size-4" }),
2008
2001
  n(i, o),
2009
- /* @__PURE__ */ Q(Be, { className: W("size-4 transition-transform", a ? "rotate-180" : "rotate-0") })
2002
+ /* @__PURE__ */ Q(ze, { className: K("size-4 transition-transform", a ? "rotate-180" : "rotate-0") })
2010
2003
  ] })
2011
2004
  });
2012
2005
  }), Bi = a(({ className: e, children: t, ...n }) => /* @__PURE__ */ Q(T, {
2013
- className: W("mt-4 text-sm", "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in", e),
2006
+ className: K("mt-4 text-sm", "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in", e),
2014
2007
  ...n,
2015
2008
  children: /* @__PURE__ */ Q(At, { children: t })
2016
2009
  }));
@@ -2018,10 +2011,10 @@ Li.displayName = "Reasoning", zi.displayName = "ReasoningTrigger", Bi.displayNam
2018
2011
  //#endregion
2019
2012
  //#region src/elements/sources.tsx
2020
2013
  var Vi = ({ className: e, ...t }) => /* @__PURE__ */ Q(w, {
2021
- className: W("not-prose mb-4 text-primary text-xs", e),
2014
+ className: K("not-prose mb-4 text-primary text-xs", e),
2022
2015
  ...t
2023
2016
  }), Hi = ({ className: e, count: t, children: n, ...r }) => /* @__PURE__ */ Q(E, {
2024
- className: W("flex items-center gap-2", e),
2017
+ className: K("flex items-center gap-2", e),
2025
2018
  ...r,
2026
2019
  children: n ?? /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ $("p", {
2027
2020
  className: "font-medium",
@@ -2030,9 +2023,9 @@ var Vi = ({ className: e, ...t }) => /* @__PURE__ */ Q(w, {
2030
2023
  t,
2031
2024
  " sources"
2032
2025
  ]
2033
- }), /* @__PURE__ */ Q(Be, { className: "h-4 w-4" })] })
2026
+ }), /* @__PURE__ */ Q(ze, { className: "h-4 w-4" })] })
2034
2027
  }), Ui = ({ className: e, ...t }) => /* @__PURE__ */ Q(T, {
2035
- className: W("mt-3 flex w-fit flex-col gap-2", "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in", e),
2028
+ className: K("mt-3 flex w-fit flex-col gap-2", "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in", e),
2036
2029
  ...t
2037
2030
  }), Wi = ({ href: e, title: t, children: n, ...r }) => /* @__PURE__ */ Q("a", {
2038
2031
  className: "flex items-center gap-2",
@@ -2040,7 +2033,7 @@ var Vi = ({ className: e, ...t }) => /* @__PURE__ */ Q(w, {
2040
2033
  rel: "noreferrer",
2041
2034
  target: "_blank",
2042
2035
  ...r,
2043
- children: n ?? /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q(G, { className: "h-4 w-4" }), /* @__PURE__ */ Q("span", {
2036
+ children: n ?? /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q(Ne, { className: "h-4 w-4" }), /* @__PURE__ */ Q("span", {
2044
2037
  className: "block font-medium",
2045
2038
  children: t
2046
2039
  })] })
@@ -2193,25 +2186,25 @@ function aa({ health: e }) {
2193
2186
  children: [
2194
2187
  o.length > 0 ? /* @__PURE__ */ $("div", {
2195
2188
  className: "flex items-center gap-1.5 text-xs text-emerald-700",
2196
- children: [/* @__PURE__ */ Q(K, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: o.join(" · ") })]
2189
+ children: [/* @__PURE__ */ Q(q, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: o.join(" · ") })]
2197
2190
  }) : null,
2198
2191
  e.seedError ? /* @__PURE__ */ $("div", {
2199
2192
  className: "flex items-start gap-1.5 text-xs text-red-600",
2200
- children: [/* @__PURE__ */ Q(Y, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: e.seedError })]
2193
+ children: [/* @__PURE__ */ Q(X, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: e.seedError })]
2201
2194
  }) : null,
2202
2195
  n.map((e, t) => /* @__PURE__ */ $("div", {
2203
2196
  className: "flex items-start gap-1.5 text-xs text-red-600",
2204
- children: [/* @__PURE__ */ Q(Y, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: e.message })]
2197
+ children: [/* @__PURE__ */ Q(X, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: e.message })]
2205
2198
  }, `e${t}`)),
2206
2199
  r.map((e, t) => /* @__PURE__ */ $("div", {
2207
2200
  className: "flex items-start gap-1.5 text-xs text-amber-600",
2208
- children: [/* @__PURE__ */ Q(Me, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: e.message })]
2201
+ children: [/* @__PURE__ */ Q(Ae, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: e.message })]
2209
2202
  }, `w${t}`))
2210
2203
  ]
2211
2204
  });
2212
2205
  }
2213
- var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type your message...", onSendMessage: i, onClear: a, onStop: o, onReload: s, onUpgrade: c, disabled: l = !1, readOnly: u = !1, isLoading: d = !1, error: f, showTimestamp: p = !1, showAvatars: m = !1, userAvatarUrl: h, userAvatarFallback: g = "You", assistantAvatarUrl: _, assistantAvatarFallback: v = "AI", hideClearBar: y = !1, maxHeight: b = "500px", enableMarkdown: x = !0, enableFileUpload: S = !1, acceptedFileTypes: C = "image/*,.pdf,.doc,.docx,.txt,.csv,.tsv,.xlsx,.xlsm", maxFileSize: w = 10 * 1024 * 1024, suggestions: T, labels: E, models: D, selectedModelId: O, onModelChange: k, headerSlot: A, promptOverlaySlot: j, onInputChange: M, onToolApprove: N, toolApproveLabel: ee = "Approve", toolDenyLabel: P = "Deny", toolDenyReason: F = "User denied the operation", toolDecisions: I, onReviewDraft: te, toolReviewLabel: ne = (e) => `Review ${e} change${e === 1 ? "" : "s"}`, onPublishDrafts: L, onOpenBuiltApp: re, openBuiltAppLabel: ie = "Open app", onDesignBuiltApp: R, designBuiltAppLabel: ae = "Design in Studio", getArtifactAction: oe, onPreviewDraftApp: se, previewDraftLabel: z = "Preview", onDraftArtifacts: ce, onBuildMaterialized: le, publishDraftsLabel: ue = "Publish", publishedLabel: de = "Published", verifiedLabel: fe = "Verified", nextStepsLabel: pe = "What's next", planTitleLabel: me = "Proposed plan", builderHandoffTitleLabel: he = "Build this in the Builder", builderHandoffOpenLabel: ge = "Open in Builder →", builderHandoffSupersededTitle: _e = "A newer request is available", onOpenBuilder: ve, planExtendLabel: ye = "Adding to existing app", planQuestionsLabel: be = "Confirm before building", planAssumptionsLabel: xe = "Assumptions", planDeferredLabel: Se = "Not yet built", planApproveHintLabel: Ce = "Reply to approve or adjust this plan.", planApproveLabel: B = "Build it", planAdjustLabel: V = "Adjust", planBuiltLabel: we = "Built", planBuildingLabel: Te = "Building…", planReadyLabel: Ee = "The plan is ready. Build it now, or tell me what to adjust.", planApproveMessage: De = "Looks good — build it as proposed.", planApproveDefaultsMessage: Oe = "Build it with your best assumptions; use sensible defaults for the open questions.", planAnswerMessage: ke = (e, t) => `For "${e}", go with: ${t}.`, fetchPendingDraftCount: H, autoPublishDrafts: Ae = !1, processVisibility: U = "summary", surface: je = "card", ...Ne }, Pe) => {
2214
- let G = d ? "streaming" : "ready", Ie = je === "plain", [Re, ze] = e.useState(null), Be = e.useRef(""), Ve = e.useRef(null), q = e.useMemo(() => ({
2206
+ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type your message...", onSendMessage: i, onClear: a, onStop: o, onReload: s, onUpgrade: c, disabled: l = !1, readOnly: u = !1, isLoading: d = !1, error: f, showTimestamp: p = !1, showAvatars: m = !1, userAvatarUrl: h, userAvatarFallback: g = "You", assistantAvatarUrl: _, assistantAvatarFallback: v = "AI", hideClearBar: y = !1, maxHeight: b = "500px", enableMarkdown: x = !0, enableFileUpload: S = !1, acceptedFileTypes: C = "image/*,.pdf,.doc,.docx,.txt,.csv,.tsv,.xlsx,.xlsm", maxFileSize: w = 10 * 1024 * 1024, suggestions: T, labels: E, models: D, selectedModelId: O, onModelChange: k, headerSlot: A, promptOverlaySlot: j, onInputChange: M, onToolApprove: N, toolApproveLabel: ee = "Approve", toolDenyLabel: P = "Deny", toolDenyReason: F = "User denied the operation", toolDecisions: I, onReviewDraft: te, toolReviewLabel: ne = (e) => `Review ${e} change${e === 1 ? "" : "s"}`, onPublishDrafts: L, onOpenBuiltApp: re, openBuiltAppLabel: ie = "Open app", onDesignBuiltApp: R, designBuiltAppLabel: ae = "Design in Studio", getArtifactAction: oe, onPreviewDraftApp: z, previewDraftLabel: B = "Preview", onDraftArtifacts: V, onBuildMaterialized: H, publishDraftsLabel: se = "Publish", publishedLabel: ce = "Published", verifiedLabel: le = "Verified", nextStepsLabel: ue = "What's next", planTitleLabel: de = "Proposed plan", builderHandoffTitleLabel: fe = "Build this in the Builder", builderHandoffOpenLabel: pe = "Open in Builder →", builderHandoffSupersededTitle: me = "A newer request is available", onOpenBuilder: he, planExtendLabel: ge = "Adding to existing app", planQuestionsLabel: _e = "Confirm before building", planAssumptionsLabel: ve = "Assumptions", planDeferredLabel: ye = "Not yet built", planApproveHintLabel: be = "Reply to approve or adjust this plan.", planApproveLabel: U = "Build it", planAdjustLabel: W = "Adjust", planBuiltLabel: xe = "Built", planBuildingLabel: Se = "Building…", planReadyLabel: Ce = "The plan is ready. Build it now, or tell me what to adjust.", planApproveMessage: we = "Looks good — build it as proposed.", planApproveDefaultsMessage: Te = "Build it with your best assumptions; use sensible defaults for the open questions.", planAnswerMessage: Ee = (e, t) => `For "${e}", go with: ${t}.`, fetchPendingDraftCount: De, autoPublishDrafts: Oe = !1, processVisibility: G = "summary", surface: ke = "card", ...je }, Me) => {
2207
+ let Ne = d ? "streaming" : "ready", Fe = ke === "plain", [Le, Re] = e.useState(null), ze = e.useRef(""), Be = e.useRef(null), J = e.useMemo(() => ({
2215
2208
  emptyTitle: E?.emptyTitle ?? "Start a conversation",
2216
2209
  emptyDescription: E?.emptyDescription ?? "Ask anything — the assistant has access to your current app context.",
2217
2210
  clear: E?.clear ?? "Clear",
@@ -2238,54 +2231,54 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2238
2231
  connectionOfflineLabel: E?.connectionOfflineLabel ?? "Connection lost — reconnecting…",
2239
2232
  designingPlanLabel: E?.designingPlanLabel ?? "Designing your app…",
2240
2233
  designingPlanHints: E?.designingPlanHints ?? ha
2241
- }), [E]), [He, We] = e.useState(() => /* @__PURE__ */ new Set()), [Ge, Ke] = e.useState(() => /* @__PURE__ */ new Map()), [Je, Xe] = e.useState(() => /* @__PURE__ */ new Map()), tt = e.useRef(/* @__PURE__ */ new Set()), nt = e.useCallback(async (e) => {
2242
- if (H) try {
2243
- let t = await H(e);
2244
- Xe((n) => {
2234
+ }), [E]), [Ve, Ue] = e.useState(() => /* @__PURE__ */ new Set()), [We, Ge] = e.useState(() => /* @__PURE__ */ new Map()), [qe, Ye] = e.useState(() => /* @__PURE__ */ new Map()), et = e.useRef(/* @__PURE__ */ new Set()), tt = e.useCallback(async (e) => {
2235
+ if (De) try {
2236
+ let t = await De(e);
2237
+ Ye((n) => {
2245
2238
  if (n.get(e) === t) return n;
2246
2239
  let r = new Map(n);
2247
2240
  return r.set(e, t), r;
2248
2241
  });
2249
2242
  } catch {}
2250
- }, [H]);
2243
+ }, [De]);
2251
2244
  e.useEffect(() => {
2252
- if (!H || d) return;
2245
+ if (!De || d) return;
2253
2246
  let e = /* @__PURE__ */ new Set();
2254
2247
  for (let t of n) for (let n of t.toolInvocations ?? []) {
2255
2248
  let t = n.draftReview?.packageId, r = n.toolCallId;
2256
- t && r && !tt.current.has(r) && (tt.current.add(r), e.add(t));
2249
+ t && r && !et.current.has(r) && (et.current.add(r), e.add(t));
2257
2250
  }
2258
- for (let t of e) nt(t);
2251
+ for (let t of e) tt(t);
2259
2252
  }, [
2260
2253
  n,
2261
2254
  d,
2262
- H,
2263
- nt
2255
+ De,
2256
+ tt
2264
2257
  ]);
2265
- let it = e.useCallback(async (e) => {
2258
+ let rt = e.useCallback(async (e) => {
2266
2259
  if (!L) return;
2267
2260
  let t = [];
2268
2261
  for (let r of n) for (let n of r.toolInvocations ?? []) n.draftReview?.packageId === e && n.toolCallId && t.push(n.toolCallId);
2269
2262
  let r = await L(e), i = r && typeof r == "object" ? r : void 0;
2270
2263
  if ((i ? i.ok !== !1 : r !== !1) && t.length > 0) {
2271
- We((e) => {
2264
+ Ue((e) => {
2272
2265
  let n = new Set(e);
2273
2266
  for (let e of t) n.add(e);
2274
2267
  return n;
2275
2268
  });
2276
2269
  let e = i?.health;
2277
- e && Ke((n) => {
2270
+ e && Ge((n) => {
2278
2271
  let r = new Map(n);
2279
2272
  for (let n of t) r.set(n, e);
2280
2273
  return r;
2281
2274
  });
2282
2275
  }
2283
- nt(e);
2276
+ tt(e);
2284
2277
  }, [
2285
2278
  L,
2286
2279
  n,
2287
- nt
2288
- ]), at = e.useRef(/* @__PURE__ */ new Set()), ot = e.useRef(!1);
2280
+ tt
2281
+ ]), it = e.useRef(/* @__PURE__ */ new Set()), at = e.useRef(!1);
2289
2282
  e.useEffect(() => {
2290
2283
  let e = [];
2291
2284
  for (let t of n) for (let n of t.toolInvocations ?? []) {
@@ -2295,27 +2288,27 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2295
2288
  packageId: t.packageId
2296
2289
  });
2297
2290
  }
2298
- if (!ot.current) {
2299
- ot.current = !0;
2300
- for (let t of e) at.current.add(t.key);
2291
+ if (!at.current) {
2292
+ at.current = !0;
2293
+ for (let t of e) it.current.add(t.key);
2301
2294
  return;
2302
2295
  }
2303
- if (!Ae || !L || d) return;
2304
- let t = e.filter((e) => !at.current.has(e.key));
2296
+ if (!Oe || !L || d) return;
2297
+ let t = e.filter((e) => !it.current.has(e.key));
2305
2298
  if (t.length !== 0) {
2306
- for (let e of t) at.current.add(e.key);
2307
- for (let e of [...new Set(t.map((e) => e.packageId))]) it(e);
2299
+ for (let e of t) it.current.add(e.key);
2300
+ for (let e of [...new Set(t.map((e) => e.packageId))]) rt(e);
2308
2301
  }
2309
2302
  }, [
2310
2303
  n,
2311
2304
  d,
2312
- Ae,
2305
+ Oe,
2313
2306
  L,
2314
- it
2307
+ rt
2315
2308
  ]);
2316
- let st = e.useRef(/* @__PURE__ */ new Set());
2309
+ let ot = e.useRef(/* @__PURE__ */ new Set());
2317
2310
  e.useEffect(() => {
2318
- if (!ce) return;
2311
+ if (!V) return;
2319
2312
  let e = /* @__PURE__ */ new Map(), t;
2320
2313
  for (let r of n) {
2321
2314
  for (let t of r.buildProgress?.items ?? []) t?.type && t?.name && e.set(`${t.type}:${t.name}`, t);
@@ -2325,56 +2318,56 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2325
2318
  r?.packageId && r.items?.some((e) => e.type === "app") && (t = r.packageId);
2326
2319
  }
2327
2320
  }
2328
- let r = st.current, i = !1;
2321
+ let r = ot.current, i = !1;
2329
2322
  for (let t of e.keys()) r.has(t) || (r.add(t), i = !0);
2330
- i && ce([...e.values()], t);
2331
- }, [n, ce]);
2332
- let ct = e.useRef(/* @__PURE__ */ new Set());
2323
+ i && V([...e.values()], t);
2324
+ }, [n, V]);
2325
+ let st = e.useRef(/* @__PURE__ */ new Set());
2333
2326
  e.useEffect(() => {
2334
- if (le) for (let e of n) for (let t of e.toolInvocations ?? []) {
2327
+ if (H) for (let e of n) for (let t of e.toolInvocations ?? []) {
2335
2328
  let e = t.draftReview;
2336
2329
  if (!e?.materialized || !t.toolCallId) continue;
2337
2330
  let n = e.items.find((e) => e.type === "app");
2338
- !n || ct.current.has(t.toolCallId) || (ct.current.add(t.toolCallId), le(n.name));
2331
+ !n || st.current.has(t.toolCallId) || (st.current.add(t.toolCallId), H(n.name));
2339
2332
  }
2340
- }, [n, le]);
2341
- let lt = e.useCallback((e) => {
2333
+ }, [n, H]);
2334
+ let ct = e.useCallback((e) => {
2342
2335
  let t = !!e.text?.trim(), n = e.files?.map((e) => e.file).filter(Boolean), r = !!(n && n.length > 0);
2343
2336
  if (!(t || r)) return;
2344
2337
  let a = e.text?.trim() ?? "";
2345
- Be.current = a, Ve.current = null, J.current = null, i?.(a, n);
2346
- }, [i]), ft = e.useCallback((e) => {
2347
- J.current = null, i?.(e);
2348
- }, [i]), ht = e.useRef(null), [vt, yt] = e.useState(() => /* @__PURE__ */ new Set()), J = e.useRef(null), bt = e.useCallback((e, t) => {
2349
- t && (J.current = t, yt((e) => {
2338
+ ze.current = a, Be.current = null, Y.current = null, i?.(a, n);
2339
+ }, [i]), dt = e.useCallback((e) => {
2340
+ Y.current = null, i?.(e);
2341
+ }, [i]), mt = e.useRef(null), [_t, vt] = e.useState(() => /* @__PURE__ */ new Set()), Y = e.useRef(null), yt = e.useCallback((e, t) => {
2342
+ t && (Y.current = t, vt((e) => {
2350
2343
  let n = new Set(e);
2351
2344
  return n.add(t), n;
2352
- })), i?.(e ? Oe : De);
2345
+ })), i?.(e ? Te : we);
2353
2346
  }, [
2354
2347
  i,
2355
- De,
2356
- Oe
2357
- ]), X = e.useCallback(() => {
2358
- let e = ht.current?.querySelector("textarea");
2348
+ we,
2349
+ Te
2350
+ ]), bt = e.useCallback(() => {
2351
+ let e = mt.current?.querySelector("textarea");
2359
2352
  e && (e.focus(), e.scrollIntoView({ block: "nearest" }));
2360
2353
  }, []);
2361
2354
  e.useEffect(() => {
2362
- if (!f || !Xn(f) || Ve.current === f) return;
2363
- if (Ve.current = f, J.current) {
2364
- let e = J.current;
2365
- J.current = null, yt((t) => {
2355
+ if (!f || !Xn(f) || Be.current === f) return;
2356
+ if (Be.current = f, Y.current) {
2357
+ let e = Y.current;
2358
+ Y.current = null, vt((t) => {
2366
2359
  if (!t.has(e)) return t;
2367
2360
  let n = new Set(t);
2368
2361
  return n.delete(e), n;
2369
2362
  });
2370
2363
  }
2371
- let e = Be.current;
2364
+ let e = ze.current;
2372
2365
  if (!e) return;
2373
- let t = ht.current?.querySelector("textarea");
2366
+ let t = mt.current?.querySelector("textarea");
2374
2367
  t && t.value.trim() === "" && (t.value = e, t.dispatchEvent(new Event("input", { bubbles: !0 })), t.focus());
2375
2368
  }, [f]);
2376
2369
  let xt = e.useCallback((e) => {
2377
- navigator.clipboard?.writeText(e.content), ze(e.id), window.setTimeout(() => ze((t) => t === e.id ? null : t), 1500);
2370
+ navigator.clipboard?.writeText(e.content), Re(e.id), window.setTimeout(() => Re((t) => t === e.id ? null : t), 1500);
2378
2371
  }, []), St = e.useMemo(() => {
2379
2372
  let e = /* @__PURE__ */ new Set(), t = [], r = -1, i = 0;
2380
2373
  for (let e of n) for (let n of e.toolInvocations ?? []) (n.proposedPlan || Qi(n)) && n.toolCallId && t.push({
@@ -2400,7 +2393,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2400
2393
  }
2401
2394
  return e;
2402
2395
  }, [n]), Et = (e) => {
2403
- let t = e.state ?? (e.errorText ? "output-error" : e.result === void 0 ? "input-available" : "output-available"), n = `tool-${e.toolName}`, r = I?.[e.toolCallId], a = t === "approval-requested" && !!N && !r, o = t === "approval-requested" && !!e.pendingActionId, s = Gn(e.toolName), c = Kn(e.result), l = U === "debug" && s && s.toLowerCase() !== e.toolName.toLowerCase(), u = U === "debug" || a, d = e.draftReview?.packageId, f = d === void 0 ? void 0 : Je.get(d), p = f === void 0 ? He.has(e.toolCallId) : f === 0, m = t === "input-streaming" || t === "input-available", h = t === "output-available" && Ji(e.result) ? "approval-requested" : t, g = /* @__PURE__ */ $("span", {
2396
+ let t = e.state ?? (e.errorText ? "output-error" : e.result === void 0 ? "input-available" : "output-available"), n = `tool-${e.toolName}`, r = I?.[e.toolCallId], a = t === "approval-requested" && !!N && !r, o = t === "approval-requested" && !!e.pendingActionId, s = Gn(e.toolName), c = Kn(e.result), l = G === "debug" && s && s.toLowerCase() !== e.toolName.toLowerCase(), u = G === "debug" || a, d = e.draftReview?.packageId, f = d === void 0 ? void 0 : qe.get(d), p = f === void 0 ? Ve.has(e.toolCallId) : f === 0, m = t === "input-streaming" || t === "input-available", h = t === "output-available" && Ji(e.result) ? "approval-requested" : t, g = /* @__PURE__ */ $("span", {
2404
2397
  className: "inline-flex min-w-0 items-center gap-2",
2405
2398
  children: [
2406
2399
  /* @__PURE__ */ Q("span", { children: s || e.toolName }),
@@ -2409,10 +2402,10 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2409
2402
  children: e.toolName
2410
2403
  }) : null,
2411
2404
  m ? Zi(e) ? /* @__PURE__ */ Q(va, {
2412
- label: q.designingPlanLabel,
2413
- hints: q.designingPlanHints,
2414
- offlineLabel: q.connectionOfflineLabel
2415
- }) : /* @__PURE__ */ Q(ya, { offlineLabel: q.connectionOfflineLabel }) : null
2405
+ label: J.designingPlanLabel,
2406
+ hints: J.designingPlanHints,
2407
+ offlineLabel: J.connectionOfflineLabel
2408
+ }) : /* @__PURE__ */ Q(ya, { offlineLabel: J.connectionOfflineLabel }) : null
2416
2409
  ]
2417
2410
  });
2418
2411
  return /* @__PURE__ */ $(Ei, {
@@ -2455,18 +2448,18 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2455
2448
  L && e.draftReview.packageId ? p ? /* @__PURE__ */ $("span", {
2456
2449
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-emerald-200 bg-emerald-50 px-3 text-xs font-medium text-emerald-700",
2457
2450
  children: [
2458
- /* @__PURE__ */ Q(K, { className: "size-3.5" }),
2459
- de,
2451
+ /* @__PURE__ */ Q(q, { className: "size-3.5" }),
2452
+ ce,
2460
2453
  e.draftReview.failedCount ? ` · ${e.draftReview.failedCount} need${e.draftReview.failedCount === 1 ? "s" : ""} attention` : ""
2461
2454
  ]
2462
2455
  }) : /* @__PURE__ */ $("button", {
2463
2456
  type: "button",
2464
- onClick: () => void it(e.draftReview.packageId),
2457
+ onClick: () => void rt(e.draftReview.packageId),
2465
2458
  className: "inline-flex h-7 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground hover:bg-primary/90",
2466
2459
  "data-testid": "draft-publish",
2467
2460
  children: [
2468
- /* @__PURE__ */ Q(dt, { className: "size-3.5" }),
2469
- ue,
2461
+ /* @__PURE__ */ Q(ut, { className: "size-3.5" }),
2462
+ se,
2470
2463
  typeof f == "number" && f > 0 ? ` (${f})` : ""
2471
2464
  ]
2472
2465
  }) : null,
@@ -2474,29 +2467,29 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2474
2467
  type: "button",
2475
2468
  onClick: () => te(e.draftReview.items),
2476
2469
  className: L && e.draftReview.packageId ? "inline-flex h-7 items-center gap-1.5 rounded-md border px-3 text-xs font-medium hover:bg-muted" : "inline-flex h-7 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground hover:bg-primary/90",
2477
- children: [/* @__PURE__ */ Q(Qe, { className: "size-3.5" }), ne(e.draftReview.items.length)]
2470
+ children: [/* @__PURE__ */ Q(Ze, { className: "size-3.5" }), ne(e.draftReview.items.length)]
2478
2471
  }) : null,
2479
- se && !p ? (() => {
2472
+ z && !p ? (() => {
2480
2473
  let t = e.draftReview.items.find((e) => e.type === "app");
2481
2474
  return t ? /* @__PURE__ */ $("button", {
2482
2475
  type: "button",
2483
- onClick: () => se(t.name, {
2476
+ onClick: () => z(t.name, {
2484
2477
  materialized: e.draftReview.materialized === !0,
2485
2478
  appSegment: e.draftReview.packageId
2486
2479
  }),
2487
2480
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border px-3 text-xs font-medium hover:bg-muted",
2488
2481
  "data-testid": "draft-preview-app",
2489
- children: [/* @__PURE__ */ Q(Ze, { className: "size-3.5" }), z]
2482
+ children: [/* @__PURE__ */ Q(Xe, { className: "size-3.5" }), B]
2490
2483
  }) : null;
2491
2484
  })() : null,
2492
2485
  e.draftReview.verification ? e.draftReview.verification.errors > 0 ? /* @__PURE__ */ $("span", {
2493
2486
  className: "inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-amber-200 bg-amber-50 px-2.5 text-xs font-medium text-amber-700",
2494
2487
  "data-testid": "draft-verification-chip",
2495
- children: [/* @__PURE__ */ Q(_t, { className: "size-3.5" }), `${e.draftReview.verification.errors} issue${e.draftReview.verification.errors === 1 ? "" : "s"}`]
2488
+ children: [/* @__PURE__ */ Q(gt, { className: "size-3.5" }), `${e.draftReview.verification.errors} issue${e.draftReview.verification.errors === 1 ? "" : "s"}`]
2496
2489
  }) : /* @__PURE__ */ $("span", {
2497
2490
  className: "inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-emerald-200 bg-emerald-50 px-2.5 text-xs font-medium text-emerald-700",
2498
2491
  "data-testid": "draft-verification-chip",
2499
- children: [/* @__PURE__ */ Q(pt, { className: "size-3.5" }), fe]
2492
+ children: [/* @__PURE__ */ Q(ft, { className: "size-3.5" }), le]
2500
2493
  }) : null,
2501
2494
  e.draftReview.summary ? /* @__PURE__ */ Q("span", {
2502
2495
  className: "min-w-0 flex-1 truncate text-xs text-muted-foreground",
@@ -2509,19 +2502,19 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2509
2502
  "data-testid": "draft-issues",
2510
2503
  children: [e.draftReview.issues.filter((e) => e.severity === "error").map((e, t) => /* @__PURE__ */ $("div", {
2511
2504
  className: "flex items-start gap-1.5 text-xs text-red-600",
2512
- children: [/* @__PURE__ */ Q(Y, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: e.fix ? `${e.message} — ${e.fix}` : e.message })]
2505
+ children: [/* @__PURE__ */ Q(X, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: e.fix ? `${e.message} — ${e.fix}` : e.message })]
2513
2506
  }, `e${t}`)), e.draftReview.issues.filter((e) => e.severity !== "error").map((e, t) => /* @__PURE__ */ $("div", {
2514
2507
  className: "flex items-start gap-1.5 text-xs text-amber-600",
2515
- children: [/* @__PURE__ */ Q(Me, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: e.message })]
2508
+ children: [/* @__PURE__ */ Q(Ae, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: e.message })]
2516
2509
  }, `w${t}`))]
2517
2510
  }) : null,
2518
- He.has(e.toolCallId) ? /* @__PURE__ */ Q(aa, { health: Ge.get(e.toolCallId) }) : null,
2511
+ Ve.has(e.toolCallId) ? /* @__PURE__ */ Q(aa, { health: We.get(e.toolCallId) }) : null,
2519
2512
  e.draftReview.nextSteps && e.draftReview.nextSteps.length > 0 ? /* @__PURE__ */ $("div", {
2520
2513
  className: "flex flex-col gap-1 border-t bg-muted/20 px-3 py-2",
2521
2514
  "data-testid": "draft-next-steps",
2522
2515
  children: [/* @__PURE__ */ Q("span", {
2523
2516
  className: "text-xs font-medium text-foreground/80",
2524
- children: pe
2517
+ children: ue
2525
2518
  }), e.draftReview.nextSteps.map((e, t) => /* @__PURE__ */ $("div", {
2526
2519
  className: "flex items-start gap-1.5 text-xs text-muted-foreground",
2527
2520
  children: [/* @__PURE__ */ Q("span", {
@@ -2537,7 +2530,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2537
2530
  children: [
2538
2531
  /* @__PURE__ */ $("span", {
2539
2532
  className: "inline-flex items-center gap-1.5 text-xs font-medium text-foreground/80",
2540
- children: [/* @__PURE__ */ Q(mt, { className: "size-3.5" }), he]
2533
+ children: [/* @__PURE__ */ Q(pt, { className: "size-3.5" }), fe]
2541
2534
  }),
2542
2535
  /* @__PURE__ */ Q("p", {
2543
2536
  className: "text-xs text-muted-foreground",
@@ -2547,12 +2540,12 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2547
2540
  let t = !!Ct && e.toolCallId !== Ct;
2548
2541
  return /* @__PURE__ */ Q("button", {
2549
2542
  type: "button",
2550
- onClick: () => ve?.(e.builderHandoff),
2551
- disabled: !ve || t,
2543
+ onClick: () => he?.(e.builderHandoff),
2544
+ disabled: !he || t,
2552
2545
  "data-testid": t ? "builder-handoff-superseded" : "builder-handoff-open",
2553
- title: t ? _e : void 0,
2546
+ title: t ? me : void 0,
2554
2547
  className: "inline-flex w-fit items-center gap-1 rounded-md bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",
2555
- children: ge
2548
+ children: pe
2556
2549
  });
2557
2550
  })()
2558
2551
  ]
@@ -2563,14 +2556,14 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2563
2556
  children: [
2564
2557
  /* @__PURE__ */ $("span", {
2565
2558
  className: "inline-flex items-center gap-1.5 text-xs font-medium text-foreground/80",
2566
- children: [/* @__PURE__ */ Q(Ue, { className: "size-3.5" }), me]
2559
+ children: [/* @__PURE__ */ Q(He, { className: "size-3.5" }), de]
2567
2560
  }),
2568
2561
  e.proposedPlan.targetApp ? /* @__PURE__ */ $("span", {
2569
2562
  className: "inline-flex w-fit items-center gap-1 rounded-md border border-blue-200 bg-blue-50 px-2 py-0.5 text-[11px] font-medium text-blue-700 dark:border-blue-900/50 dark:bg-blue-950/30 dark:text-blue-300",
2570
2563
  "data-testid": "proposed-plan-extend",
2571
2564
  children: [
2572
2565
  "+ ",
2573
- ye,
2566
+ ge,
2574
2567
  " 「",
2575
2568
  e.proposedPlan.targetApp,
2576
2569
  "」"
@@ -2586,7 +2579,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2586
2579
  className: "inline-flex items-center gap-1 rounded-md border bg-background px-1.5 py-0.5 text-[11px] text-foreground/80",
2587
2580
  title: e.name,
2588
2581
  children: [
2589
- /* @__PURE__ */ Q(gt, { className: "size-3 text-foreground/40" }),
2582
+ /* @__PURE__ */ Q(ht, { className: "size-3 text-foreground/40" }),
2590
2583
  e.label || e.name,
2591
2584
  e.fieldCount > 0 ? /* @__PURE__ */ $("span", {
2592
2585
  className: "text-foreground/40",
@@ -2609,7 +2602,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2609
2602
  "data-testid": "proposed-plan-assumptions",
2610
2603
  children: [/* @__PURE__ */ Q("span", {
2611
2604
  className: "text-[11px] font-medium text-foreground/70",
2612
- children: xe
2605
+ children: ve
2613
2606
  }), t.map((e, t) => /* @__PURE__ */ $("div", {
2614
2607
  className: "flex items-start gap-1.5 text-[11px] text-muted-foreground",
2615
2608
  children: [/* @__PURE__ */ Q("span", {
@@ -2622,7 +2615,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2622
2615
  "data-testid": "proposed-plan-deferred",
2623
2616
  children: [/* @__PURE__ */ $("span", {
2624
2617
  className: "inline-flex items-center gap-1.5 text-[11px] font-medium text-amber-800 dark:text-amber-300",
2625
- children: [/* @__PURE__ */ Q(et, { className: "size-3.5" }), Se]
2618
+ children: [/* @__PURE__ */ Q($e, { className: "size-3.5" }), ye]
2626
2619
  }), n.map((e, t) => /* @__PURE__ */ $("div", {
2627
2620
  className: "flex items-start gap-1.5 text-[11px] text-amber-900/90 dark:text-amber-200/90",
2628
2621
  children: [/* @__PURE__ */ Q("span", {
@@ -2637,7 +2630,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2637
2630
  "data-testid": "proposed-plan-questions",
2638
2631
  children: [/* @__PURE__ */ $("span", {
2639
2632
  className: "inline-flex items-center gap-1.5 text-[11px] font-medium text-amber-800 dark:text-amber-300",
2640
- children: [/* @__PURE__ */ Q($e, { className: "size-3.5" }), be]
2633
+ children: [/* @__PURE__ */ Q(Qe, { className: "size-3.5" }), _e]
2641
2634
  }), e.proposedPlan.questions.map((t, n) => {
2642
2635
  let r = e.proposedPlan.questionChoices?.find((e) => e.text === t);
2643
2636
  return /* @__PURE__ */ $("div", {
@@ -2653,7 +2646,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2653
2646
  "data-testid": "proposed-plan-choice",
2654
2647
  children: r.options.map((e, n) => /* @__PURE__ */ Q("button", {
2655
2648
  type: "button",
2656
- onClick: () => i(ke(t, e)),
2649
+ onClick: () => i(Ee(t, e)),
2657
2650
  className: "inline-flex h-6 items-center rounded-full border border-amber-300 bg-background px-2 text-[11px] font-medium text-amber-900 hover:bg-amber-100 dark:border-amber-800 dark:text-amber-200 dark:hover:bg-amber-900/40",
2658
2651
  children: e
2659
2652
  }, n))
@@ -2667,35 +2660,35 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2667
2660
  children: /* @__PURE__ */ $("span", {
2668
2661
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-emerald-200 bg-emerald-50 px-3 text-xs font-medium text-emerald-700 dark:border-emerald-900/50 dark:bg-emerald-950/30 dark:text-emerald-300",
2669
2662
  "data-testid": "proposed-plan-built",
2670
- children: [/* @__PURE__ */ Q(K, { className: "size-3.5" }), we]
2663
+ children: [/* @__PURE__ */ Q(q, { className: "size-3.5" }), xe]
2671
2664
  })
2672
- }) : vt.has(e.toolCallId) ? /* @__PURE__ */ Q("div", {
2665
+ }) : _t.has(e.toolCallId) ? /* @__PURE__ */ Q("div", {
2673
2666
  className: "flex flex-wrap items-center gap-1.5 pt-0.5",
2674
2667
  "data-testid": "proposed-plan-actions",
2675
2668
  children: /* @__PURE__ */ $("span", {
2676
2669
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border bg-muted/40 px-3 text-xs font-medium text-muted-foreground",
2677
2670
  "data-testid": "proposed-plan-building",
2678
- children: [/* @__PURE__ */ Q(rt, { className: "size-3.5 animate-spin" }), Te]
2671
+ children: [/* @__PURE__ */ Q(nt, { className: "size-3.5 animate-spin" }), Se]
2679
2672
  })
2680
2673
  }) : /* @__PURE__ */ $("div", {
2681
2674
  className: "flex flex-wrap items-center gap-1.5 pt-0.5",
2682
2675
  "data-testid": "proposed-plan-actions",
2683
2676
  children: [/* @__PURE__ */ $("button", {
2684
2677
  type: "button",
2685
- onClick: () => bt(e.proposedPlan.questions.length > 0, e.toolCallId),
2678
+ onClick: () => yt(e.proposedPlan.questions.length > 0, e.toolCallId),
2686
2679
  className: "inline-flex h-7 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground hover:bg-primary/90",
2687
2680
  "data-testid": "proposed-plan-approve",
2688
- children: [/* @__PURE__ */ Q(dt, { className: "size-3.5" }), B]
2681
+ children: [/* @__PURE__ */ Q(ut, { className: "size-3.5" }), U]
2689
2682
  }), /* @__PURE__ */ Q("button", {
2690
2683
  type: "button",
2691
- onClick: X,
2684
+ onClick: bt,
2692
2685
  className: "inline-flex h-7 items-center rounded-md border bg-background px-3 text-xs font-medium hover:bg-accent",
2693
2686
  "data-testid": "proposed-plan-adjust",
2694
- children: V
2687
+ children: W
2695
2688
  })]
2696
2689
  }) : /* @__PURE__ */ Q("span", {
2697
2690
  className: "text-[11px] italic text-muted-foreground/80",
2698
- children: Ce
2691
+ children: be
2699
2692
  })
2700
2693
  ]
2701
2694
  }) : null,
@@ -2705,11 +2698,11 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2705
2698
  children: [
2706
2699
  /* @__PURE__ */ $("span", {
2707
2700
  className: "inline-flex items-center gap-1.5 text-xs font-medium text-foreground/80",
2708
- children: [/* @__PURE__ */ Q(Ue, { className: "size-3.5" }), me]
2701
+ children: [/* @__PURE__ */ Q(He, { className: "size-3.5" }), de]
2709
2702
  }),
2710
2703
  /* @__PURE__ */ Q("p", {
2711
2704
  className: "text-xs text-muted-foreground",
2712
- children: Ee
2705
+ children: Ce
2713
2706
  }),
2714
2707
  i ? St.has(e.toolCallId) ? /* @__PURE__ */ Q("div", {
2715
2708
  className: "flex flex-wrap items-center gap-1.5 pt-0.5",
@@ -2717,35 +2710,35 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2717
2710
  children: /* @__PURE__ */ $("span", {
2718
2711
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-emerald-200 bg-emerald-50 px-3 text-xs font-medium text-emerald-700 dark:border-emerald-900/50 dark:bg-emerald-950/30 dark:text-emerald-300",
2719
2712
  "data-testid": "proposed-plan-built",
2720
- children: [/* @__PURE__ */ Q(K, { className: "size-3.5" }), we]
2713
+ children: [/* @__PURE__ */ Q(q, { className: "size-3.5" }), xe]
2721
2714
  })
2722
- }) : vt.has(e.toolCallId) ? /* @__PURE__ */ Q("div", {
2715
+ }) : _t.has(e.toolCallId) ? /* @__PURE__ */ Q("div", {
2723
2716
  className: "flex flex-wrap items-center gap-1.5 pt-0.5",
2724
2717
  "data-testid": "proposed-plan-actions",
2725
2718
  children: /* @__PURE__ */ $("span", {
2726
2719
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border bg-muted/40 px-3 text-xs font-medium text-muted-foreground",
2727
2720
  "data-testid": "proposed-plan-building",
2728
- children: [/* @__PURE__ */ Q(rt, { className: "size-3.5 animate-spin" }), Te]
2721
+ children: [/* @__PURE__ */ Q(nt, { className: "size-3.5 animate-spin" }), Se]
2729
2722
  })
2730
2723
  }) : /* @__PURE__ */ $("div", {
2731
2724
  className: "flex flex-wrap items-center gap-1.5 pt-0.5",
2732
2725
  "data-testid": "proposed-plan-actions",
2733
2726
  children: [/* @__PURE__ */ $("button", {
2734
2727
  type: "button",
2735
- onClick: () => bt(!1, e.toolCallId),
2728
+ onClick: () => yt(!1, e.toolCallId),
2736
2729
  className: "inline-flex h-7 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground hover:bg-primary/90",
2737
2730
  "data-testid": "proposed-plan-approve",
2738
- children: [/* @__PURE__ */ Q(dt, { className: "size-3.5" }), B]
2731
+ children: [/* @__PURE__ */ Q(ut, { className: "size-3.5" }), U]
2739
2732
  }), /* @__PURE__ */ Q("button", {
2740
2733
  type: "button",
2741
- onClick: X,
2734
+ onClick: bt,
2742
2735
  className: "inline-flex h-7 items-center rounded-md border bg-background px-3 text-xs font-medium hover:bg-accent",
2743
2736
  "data-testid": "proposed-plan-adjust",
2744
- children: V
2737
+ children: W
2745
2738
  })]
2746
2739
  }) : /* @__PURE__ */ Q("span", {
2747
2740
  className: "text-[11px] italic text-muted-foreground/80",
2748
- children: Ce
2741
+ children: be
2749
2742
  })
2750
2743
  ]
2751
2744
  }) : null,
@@ -2755,7 +2748,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2755
2748
  children: [
2756
2749
  /* @__PURE__ */ $("span", {
2757
2750
  className: "inline-flex items-center gap-1.5 text-xs font-medium text-foreground/80",
2758
- children: [/* @__PURE__ */ Q(Ue, { className: "size-3.5" }), "确认改动"]
2751
+ children: [/* @__PURE__ */ Q(He, { className: "size-3.5" }), "确认改动"]
2759
2752
  }),
2760
2753
  e.proposedChanges.summary ? /* @__PURE__ */ Q("p", {
2761
2754
  className: "text-xs text-muted-foreground",
@@ -2765,7 +2758,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2765
2758
  className: "flex flex-col gap-1",
2766
2759
  children: e.proposedChanges.changes.map((e, t) => /* @__PURE__ */ $("div", {
2767
2760
  className: "flex items-start gap-1.5 rounded-md border bg-background px-2 py-1 text-[11px] text-foreground/80",
2768
- children: [/* @__PURE__ */ Q(gt, { className: "mt-px size-3 shrink-0 text-foreground/40" }), /* @__PURE__ */ Q("span", { children: Xi(e) })]
2761
+ children: [/* @__PURE__ */ Q(ht, { className: "mt-px size-3 shrink-0 text-foreground/40" }), /* @__PURE__ */ Q("span", { children: Xi(e) })]
2769
2762
  }, t))
2770
2763
  }),
2771
2764
  i ? Tt.has(e.toolCallId) ? /* @__PURE__ */ Q("div", {
@@ -2774,7 +2767,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2774
2767
  children: /* @__PURE__ */ $("span", {
2775
2768
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-emerald-200 bg-emerald-50 px-3 text-xs font-medium text-emerald-700 dark:border-emerald-900/50 dark:bg-emerald-950/30 dark:text-emerald-300",
2776
2769
  "data-testid": "proposed-changes-confirmed",
2777
- children: [/* @__PURE__ */ Q(K, { className: "size-3.5" }), "已确认"]
2770
+ children: [/* @__PURE__ */ Q(q, { className: "size-3.5" }), "已确认"]
2778
2771
  })
2779
2772
  }) : /* @__PURE__ */ $("div", {
2780
2773
  className: "flex flex-wrap items-center gap-1.5 pt-0.5",
@@ -2784,10 +2777,10 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2784
2777
  onClick: () => i("确认修改,应用你刚才提议的改动。"),
2785
2778
  className: "inline-flex h-7 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground hover:bg-primary/90",
2786
2779
  "data-testid": "proposed-changes-confirm",
2787
- children: [/* @__PURE__ */ Q(K, { className: "size-3.5" }), "确认修改"]
2780
+ children: [/* @__PURE__ */ Q(q, { className: "size-3.5" }), "确认修改"]
2788
2781
  }), /* @__PURE__ */ Q("button", {
2789
2782
  type: "button",
2790
- onClick: X,
2783
+ onClick: bt,
2791
2784
  className: "inline-flex h-7 items-center rounded-md border bg-background px-3 text-xs font-medium hover:bg-accent",
2792
2785
  "data-testid": "proposed-changes-adjust",
2793
2786
  children: "调整"
@@ -2802,28 +2795,28 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2802
2795
  }, e.toolCallId);
2803
2796
  };
2804
2797
  return /* @__PURE__ */ $("div", {
2805
- ref: Pe,
2806
- className: W(Ie ? "flex min-h-0 flex-col overflow-hidden bg-background" : "flex min-h-0 flex-col overflow-hidden rounded-lg border bg-background", t),
2798
+ ref: Me,
2799
+ className: K(Fe ? "flex min-h-0 flex-col overflow-hidden bg-background" : "flex min-h-0 flex-col overflow-hidden rounded-lg border bg-background", t),
2807
2800
  style: { maxHeight: b },
2808
- ...Ne,
2801
+ ...je,
2809
2802
  children: [
2810
2803
  a && !y && n.length > 0 && /* @__PURE__ */ Q("div", {
2811
- className: W("flex items-center justify-end px-4 py-2", Ie ? "bg-background" : "border-b bg-muted/30"),
2804
+ className: K("flex items-center justify-end px-4 py-2", Fe ? "bg-background" : "border-b bg-muted/30"),
2812
2805
  children: /* @__PURE__ */ Q("button", {
2813
2806
  type: "button",
2814
2807
  onClick: a,
2815
2808
  className: "text-xs text-muted-foreground hover:text-foreground transition-colors",
2816
- children: q.clear
2809
+ children: J.clear
2817
2810
  })
2818
2811
  }),
2819
2812
  A ? /* @__PURE__ */ Q("div", {
2820
- className: W("shrink-0", !Ie && "border-b bg-background/50"),
2813
+ className: K("shrink-0", !Fe && "border-b bg-background/50"),
2821
2814
  children: A
2822
2815
  }) : null,
2823
2816
  /* @__PURE__ */ $($n, {
2824
2817
  className: "flex-1 min-h-0",
2825
2818
  children: [/* @__PURE__ */ $(er, {
2826
- className: W("space-y-4", Ie ? "mx-auto w-full max-w-2xl px-4 py-8 sm:px-0" : "px-4 py-3"),
2819
+ className: K("space-y-4", Fe ? "mx-auto w-full max-w-2xl px-4 py-8 sm:px-0" : "px-4 py-3"),
2827
2820
  children: [n.length === 0 ? /* @__PURE__ */ $(tr, {
2828
2821
  className: "gap-3 px-0 py-8",
2829
2822
  children: [
@@ -2833,16 +2826,16 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2833
2826
  src: _,
2834
2827
  alt: "",
2835
2828
  className: "size-full rounded-md object-cover"
2836
- }) : /* @__PURE__ */ Q(Fe, { className: "size-4" })
2829
+ }) : /* @__PURE__ */ Q(Pe, { className: "size-4" })
2837
2830
  }),
2838
2831
  /* @__PURE__ */ $("div", {
2839
2832
  className: "w-full max-w-full space-y-1",
2840
2833
  children: [/* @__PURE__ */ Q("h3", {
2841
2834
  className: "text-sm font-medium text-foreground/90 break-words",
2842
- children: q.emptyTitle
2835
+ children: J.emptyTitle
2843
2836
  }), /* @__PURE__ */ Q("p", {
2844
2837
  className: "text-sm text-muted-foreground break-words",
2845
- children: q.emptyDescription
2838
+ children: J.emptyDescription
2846
2839
  })]
2847
2840
  }),
2848
2841
  T && T.length > 0 ? /* @__PURE__ */ Q("div", {
@@ -2850,30 +2843,30 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2850
2843
  children: T.map((e) => /* @__PURE__ */ Q(bi, {
2851
2844
  className: "h-auto min-h-8 min-w-0 max-w-full whitespace-normal break-words rounded-full border-border/60 bg-background/80 px-3 py-1 text-left text-xs font-medium text-foreground/90 shadow-none hover:bg-muted/60",
2852
2845
  suggestion: e,
2853
- onClick: ft
2846
+ onClick: dt
2854
2847
  }, e))
2855
2848
  }) : null
2856
2849
  ]
2857
2850
  }) : n.map((e) => {
2858
- let t = e.role === "user", n = e.toolInvocations ?? [], r = e.reasoning?.trim(), i = e.sources ?? [], a = t ? void 0 : e.buildProgress, o = !t && !n.some((e) => !!e.proposedPlan) ? e.blueprintProgress : void 0, c = !t && U === "summary" ? n.filter((e) => !ta(e) && !(o && e.toolName === "propose_blueprint")) : [], l = !t && U === "debug" ? n : !t && U !== "debug" ? n.filter(ta) : [], u = !t && e.content.trim().length > 0 && !ra(e.content), d = U === "debug" && !!r, f = !t && !!e.streaming && !u && c.length === 0 && l.length === 0 && !d && !a && !o;
2851
+ let t = e.role === "user", n = e.toolInvocations ?? [], r = e.reasoning?.trim(), i = e.sources ?? [], a = t ? void 0 : e.buildProgress, o = !t && !n.some((e) => !!e.proposedPlan) ? e.blueprintProgress : void 0, c = !t && G === "summary" ? n.filter((e) => !ta(e) && !(o && e.toolName === "propose_blueprint")) : [], l = !t && G === "debug" ? n : !t && G !== "debug" ? n.filter(ta) : [], u = !t && e.content.trim().length > 0 && !ra(e.content), d = G === "debug" && !!r, f = !t && !!e.streaming && !u && c.length === 0 && l.length === 0 && !d && !a && !o;
2859
2852
  return /* @__PURE__ */ Q(or, {
2860
2853
  from: Ki(e.role),
2861
2854
  children: /* @__PURE__ */ $("div", {
2862
- className: W("flex w-full gap-2.5", m ? t ? "flex-row-reverse items-start" : "flex-row items-start" : "flex-col"),
2855
+ className: K("flex w-full gap-2.5", m ? t ? "flex-row-reverse items-start" : "flex-row items-start" : "flex-col"),
2863
2856
  children: [m ? /* @__PURE__ */ Q(sa, {
2864
2857
  isUser: t,
2865
2858
  url: t ? h : _,
2866
2859
  fallback: t ? g : v
2867
2860
  }) : null, /* @__PURE__ */ $("div", {
2868
- className: W("flex min-w-0 flex-col gap-2", m && !t && "flex-1"),
2861
+ className: K("flex min-w-0 flex-col gap-2", m && !t && "flex-1"),
2869
2862
  children: [/* @__PURE__ */ $(sr, { children: [
2870
2863
  o ? /* @__PURE__ */ Q(Sa, {
2871
2864
  progress: o,
2872
- designingLabel: q.designingPlanLabel,
2873
- extendLabel: ye,
2874
- waitingLabel: q.connectionWaiting,
2875
- stalledLabel: q.connectionStalledLabel,
2876
- offlineLabel: q.connectionOfflineLabel
2865
+ designingLabel: J.designingPlanLabel,
2866
+ extendLabel: ge,
2867
+ waitingLabel: J.connectionWaiting,
2868
+ stalledLabel: J.connectionStalledLabel,
2869
+ offlineLabel: J.connectionOfflineLabel
2877
2870
  }) : null,
2878
2871
  a ? /* @__PURE__ */ Q(Ca, {
2879
2872
  progress: a,
@@ -2883,20 +2876,20 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2883
2876
  onDesignBuiltApp: R,
2884
2877
  designBuiltAppLabel: ae,
2885
2878
  getArtifactAction: oe,
2886
- onPreviewDraftApp: se,
2887
- previewDraftLabel: z,
2888
- waitingLabel: q.connectionWaiting,
2889
- stalledLabel: q.connectionStalledLabel,
2890
- offlineLabel: q.connectionOfflineLabel
2879
+ onPreviewDraftApp: z,
2880
+ previewDraftLabel: B,
2881
+ waitingLabel: J.connectionWaiting,
2882
+ stalledLabel: J.connectionStalledLabel,
2883
+ offlineLabel: J.connectionOfflineLabel
2891
2884
  }) : null,
2892
- !t && U === "debug" && r ? /* @__PURE__ */ $(Li, {
2885
+ !t && G === "debug" && r ? /* @__PURE__ */ $(Li, {
2893
2886
  isStreaming: !!e.streaming && !e.content,
2894
2887
  className: "mb-2",
2895
2888
  children: [/* @__PURE__ */ Q(zi, {}), /* @__PURE__ */ Q(Bi, { children: r })]
2896
2889
  }) : null,
2897
- !t && U === "summary" && c.length > 0 ? /* @__PURE__ */ Q(wa, {
2890
+ !t && G === "summary" && c.length > 0 ? /* @__PURE__ */ Q(wa, {
2898
2891
  groups: ia(c),
2899
- labels: q
2892
+ labels: J
2900
2893
  }) : null,
2901
2894
  !t && l.length > 0 ? l.map(Et) : null,
2902
2895
  t ? e.content ? /* @__PURE__ */ Q("div", {
@@ -2905,7 +2898,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2905
2898
  }) : null : f ? /* @__PURE__ */ Q(la, {}) : u ? /* @__PURE__ */ Q(vr, { children: e.content }) : !e.streaming && ra(e.content) ? /* @__PURE__ */ Q("span", {
2906
2899
  className: "text-xs italic text-muted-foreground/70",
2907
2900
  title: e.content,
2908
- children: q.agentActivity
2901
+ children: J.agentActivity
2909
2902
  }) : null,
2910
2903
  e.streaming && u ? /* @__PURE__ */ Q("span", {
2911
2904
  "aria-hidden": !0,
@@ -2942,23 +2935,23 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2942
2935
  className: "opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100",
2943
2936
  children: [
2944
2937
  /* @__PURE__ */ Q(lr, {
2945
- label: Re === e.id ? q.copied : q.copy,
2946
- tooltip: Re === e.id ? q.copied : q.copy,
2938
+ label: Le === e.id ? J.copied : J.copy,
2939
+ tooltip: Le === e.id ? J.copied : J.copy,
2947
2940
  onClick: () => xt(e),
2948
- children: Re === e.id ? /* @__PURE__ */ Q(Le, { className: "size-3.5" }) : /* @__PURE__ */ Q(qe, { className: "size-3.5" })
2941
+ children: Le === e.id ? /* @__PURE__ */ Q(Ie, { className: "size-3.5" }) : /* @__PURE__ */ Q(Ke, { className: "size-3.5" })
2949
2942
  }),
2950
2943
  s ? /* @__PURE__ */ Q(lr, {
2951
- label: q.regenerate,
2952
- tooltip: q.regenerate,
2944
+ label: J.regenerate,
2945
+ tooltip: J.regenerate,
2953
2946
  onClick: s,
2954
- children: /* @__PURE__ */ Q(ut, { className: "size-3.5" })
2947
+ children: /* @__PURE__ */ Q(lt, { className: "size-3.5" })
2955
2948
  }) : null,
2956
- U === "debug" && e.traceId ? /* @__PURE__ */ Q("a", {
2949
+ G === "debug" && e.traceId ? /* @__PURE__ */ Q("a", {
2957
2950
  href: `#trace/${e.traceId}`,
2958
2951
  "data-trace-id": e.traceId,
2959
2952
  className: "text-[10px] text-muted-foreground hover:text-foreground ml-1 underline",
2960
- title: q.viewTrace,
2961
- children: q.trace
2953
+ title: J.viewTrace,
2954
+ children: J.trace
2962
2955
  }) : null
2963
2956
  ]
2964
2957
  }) : null]
@@ -2969,32 +2962,32 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
2969
2962
  showAvatar: m,
2970
2963
  assistantAvatarUrl: _,
2971
2964
  assistantAvatarFallback: v,
2972
- waitingLabel: q.connectionWaiting,
2973
- stalledLabel: q.connectionStalledLabel,
2974
- offlineLabel: q.connectionOfflineLabel
2965
+ waitingLabel: J.connectionWaiting,
2966
+ stalledLabel: J.connectionStalledLabel,
2967
+ offlineLabel: J.connectionOfflineLabel
2975
2968
  }) : null]
2976
2969
  }), /* @__PURE__ */ Q(nr, {})]
2977
2970
  }),
2978
2971
  f ? Xn(f) && !Yn(f) ? /* @__PURE__ */ Q(Da, {
2979
2972
  error: f,
2980
- rateLimitedLabel: q.sendFailedRateLimited,
2981
- genericLabel: q.sendFailedGeneric
2973
+ rateLimitedLabel: J.sendFailedRateLimited,
2974
+ genericLabel: J.sendFailedGeneric
2982
2975
  }) : /* @__PURE__ */ Q(Oa, {
2983
2976
  error: f,
2984
2977
  onReload: s,
2985
2978
  onUpgrade: c
2986
2979
  }) : null,
2987
2980
  u ? null : /* @__PURE__ */ $("div", {
2988
- ref: ht,
2989
- className: W("relative", Ie && "mx-auto w-full max-w-2xl px-4 pb-4 sm:px-0"),
2981
+ ref: mt,
2982
+ className: K("relative", Fe && "mx-auto w-full max-w-2xl px-4 pb-4 sm:px-0"),
2990
2983
  children: [j ? /* @__PURE__ */ Q("div", {
2991
2984
  className: "absolute bottom-full left-0 right-0 z-10 px-3 pb-1",
2992
2985
  children: j
2993
2986
  }) : null, /* @__PURE__ */ $(Br, {
2994
2987
  accept: C,
2995
- fileInputLabel: q.uploadFiles,
2988
+ fileInputLabel: J.uploadFiles,
2996
2989
  maxFileSize: w,
2997
- onSubmit: lt,
2990
+ onSubmit: ct,
2998
2991
  onError: (e) => {
2999
2992
  console.warn("[plugin-chatbot] prompt-input error", e);
3000
2993
  },
@@ -3002,13 +2995,13 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
3002
2995
  S ? /* @__PURE__ */ Q(Vr, { children: /* @__PURE__ */ Q(Rr, { children: (e) => /* @__PURE__ */ Q(Lr, { data: e }) }) }) : null,
3003
2996
  /* @__PURE__ */ Q(Hr, {
3004
2997
  placeholder: r,
3005
- disabled: l || G === "streaming",
2998
+ disabled: l || Ne === "streaming",
3006
2999
  onChange: M ? (e) => M(e.currentTarget.value) : void 0
3007
3000
  }),
3008
3001
  /* @__PURE__ */ $(Wr, { children: [/* @__PURE__ */ $(Gr, { children: [
3009
3002
  S ? /* @__PURE__ */ $(qr, { children: [/* @__PURE__ */ Q(Jr, {}), /* @__PURE__ */ Q(Yr, { children: /* @__PURE__ */ Q(zr, {}) })] }) : null,
3010
3003
  D && D.length > 1 ? /* @__PURE__ */ Q("select", {
3011
- "aria-label": q.model,
3004
+ "aria-label": J.model,
3012
3005
  value: O ?? D[0].id,
3013
3006
  onChange: (e) => k?.(e.target.value),
3014
3007
  className: "h-7 rounded-md border bg-background px-2 text-xs text-muted-foreground hover:text-foreground focus:outline-none focus:ring-1 focus:ring-ring",
@@ -3020,17 +3013,17 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
3020
3013
  /* @__PURE__ */ $("span", {
3021
3014
  className: "hidden items-center gap-1 text-[10px] text-muted-foreground sm:inline-flex",
3022
3015
  "aria-hidden": "true",
3023
- children: [/* @__PURE__ */ Q(Ye, { className: "h-3 w-3" }), /* @__PURE__ */ Q("span", {
3016
+ children: [/* @__PURE__ */ Q(Je, { className: "h-3 w-3" }), /* @__PURE__ */ Q("span", {
3024
3017
  className: "opacity-70",
3025
- children: q.sendHint
3018
+ children: J.sendHint
3026
3019
  })]
3027
3020
  })
3028
3021
  ] }), /* @__PURE__ */ Q(Zr, {
3029
- "aria-label": G === "streaming" ? q.stopResponse : q.submit,
3030
- status: G,
3022
+ "aria-label": Ne === "streaming" ? J.stopResponse : J.submit,
3023
+ status: Ne,
3031
3024
  disabled: l,
3032
- onClick: G === "streaming" ? o : void 0,
3033
- type: G === "streaming" ? "button" : "submit"
3025
+ onClick: Ne === "streaming" ? o : void 0,
3026
+ type: Ne === "streaming" ? "button" : "submit"
3034
3027
  })] })
3035
3028
  ]
3036
3029
  })]
@@ -3041,13 +3034,13 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
3041
3034
  oa.displayName = "ChatbotEnhanced";
3042
3035
  function sa({ isUser: e, url: t, fallback: n }) {
3043
3036
  return /* @__PURE__ */ Q("div", {
3044
- className: W("mt-0.5 flex size-7 shrink-0 items-center justify-center overflow-hidden rounded-full text-[11px] font-medium", e ? "bg-secondary text-secondary-foreground" : "bg-primary/10 text-primary"),
3037
+ className: K("mt-0.5 flex size-7 shrink-0 items-center justify-center overflow-hidden rounded-full text-[11px] font-medium", e ? "bg-secondary text-secondary-foreground" : "bg-primary/10 text-primary"),
3045
3038
  "aria-hidden": "true",
3046
3039
  children: t ? /* @__PURE__ */ Q("img", {
3047
3040
  src: t,
3048
3041
  alt: "",
3049
3042
  className: "size-full object-cover"
3050
- }) : e ? n?.trim()?.charAt(0)?.toUpperCase() || "U" : /* @__PURE__ */ Q(Fe, { className: "size-4" })
3043
+ }) : e ? n?.trim()?.charAt(0)?.toUpperCase() || "U" : /* @__PURE__ */ Q(Pe, { className: "size-4" })
3051
3044
  });
3052
3045
  }
3053
3046
  function ca({ showAvatar: e, assistantAvatarUrl: t, assistantAvatarFallback: n, waitingLabel: r, stalledLabel: i, offlineLabel: a }) {
@@ -3055,7 +3048,7 @@ function ca({ showAvatar: e, assistantAvatarUrl: t, assistantAvatarFallback: n,
3055
3048
  from: "assistant",
3056
3049
  "aria-live": "polite",
3057
3050
  children: /* @__PURE__ */ $("div", {
3058
- className: W("flex w-full gap-2.5", e ? "flex-row items-start" : "flex-col"),
3051
+ className: K("flex w-full gap-2.5", e ? "flex-row items-start" : "flex-col"),
3059
3052
  children: [e ? /* @__PURE__ */ Q(sa, {
3060
3053
  isUser: !1,
3061
3054
  url: t,
@@ -3141,19 +3134,19 @@ function pa() {
3141
3134
  function ma({ active: e, activityKey: t, pending: n = !1, waitingLabel: r, stalledLabel: i = "Still working…", offlineLabel: a = "Connection lost — reconnecting…" }) {
3142
3135
  let { elapsedSeconds: o, quietSeconds: s, live: c } = fa(e, t), l = pa() ? "offline" : c ? n ? "waiting" : "receiving" : "stalled", u = ua(o);
3143
3136
  return /* @__PURE__ */ $("span", {
3144
- className: W("inline-flex items-center gap-1.5 text-xs tabular-nums", l === "offline" ? "text-red-600 font-medium" : l === "stalled" ? "text-amber-600 font-medium" : "font-normal text-muted-foreground"),
3137
+ className: K("inline-flex items-center gap-1.5 text-xs tabular-nums", l === "offline" ? "text-red-600 font-medium" : l === "stalled" ? "text-amber-600 font-medium" : "font-normal text-muted-foreground"),
3145
3138
  "aria-live": "polite",
3146
3139
  "data-liveness-tier": l,
3147
3140
  title: l === "offline" ? `${a} · ${u} elapsed` : l === "receiving" ? `Receiving from server · ${u} elapsed` : l === "stalled" ? `${i} (${s}s with no response) · ${u} elapsed` : `${r} · ${u} elapsed`,
3148
3141
  children: [
3149
- l === "offline" ? /* @__PURE__ */ Q(vt, {
3142
+ l === "offline" ? /* @__PURE__ */ Q(_t, {
3150
3143
  className: "size-3 shrink-0",
3151
3144
  "aria-hidden": !0
3152
3145
  }) : /* @__PURE__ */ Q("span", {
3153
3146
  "aria-hidden": !0,
3154
- className: W("size-1.5 shrink-0 rounded-full", l === "receiving" ? "bg-emerald-500 animate-pulse" : l === "stalled" ? "bg-amber-500" : "bg-muted-foreground/50 animate-pulse")
3147
+ className: K("size-1.5 shrink-0 rounded-full", l === "receiving" ? "bg-emerald-500 animate-pulse" : l === "stalled" ? "bg-amber-500" : "bg-muted-foreground/50 animate-pulse")
3155
3148
  }),
3156
- /* @__PURE__ */ Q(Ge, {
3149
+ /* @__PURE__ */ Q(We, {
3157
3150
  className: "size-3 shrink-0",
3158
3151
  "aria-hidden": !0
3159
3152
  }),
@@ -3193,7 +3186,7 @@ function va({ label: t, hints: n, offlineLabel: r }) {
3193
3186
  "data-testid": "build-proposal-progress",
3194
3187
  "aria-live": "polite",
3195
3188
  children: [
3196
- /* @__PURE__ */ Q(mt, {
3189
+ /* @__PURE__ */ Q(pt, {
3197
3190
  className: "size-3 shrink-0 animate-pulse text-primary",
3198
3191
  "aria-hidden": !0
3199
3192
  }),
@@ -3209,7 +3202,7 @@ function va({ label: t, hints: n, offlineLabel: r }) {
3209
3202
  className: "hidden shrink-0 items-center gap-0.5 sm:inline-flex",
3210
3203
  "data-testid": "build-proposal-progress-dots",
3211
3204
  "aria-hidden": !0,
3212
- children: n.map((e, t) => /* @__PURE__ */ Q("span", { className: W("size-1 rounded-full transition-colors", t <= o ? "bg-primary/70" : "bg-muted-foreground/25") }, t))
3205
+ children: n.map((e, t) => /* @__PURE__ */ Q("span", { className: K("size-1 rounded-full transition-colors", t <= o ? "bg-primary/70" : "bg-muted-foreground/25") }, t))
3213
3206
  }) : null,
3214
3207
  /* @__PURE__ */ Q(ya, { offlineLabel: r })
3215
3208
  ]
@@ -3221,11 +3214,11 @@ function ya({ offlineLabel: t }) {
3221
3214
  let e = Date.now(), t = setInterval(() => r(Math.floor((Date.now() - e) / 1e3)), 1e3);
3222
3215
  return () => clearInterval(t);
3223
3216
  }, []), /* @__PURE__ */ $("span", {
3224
- className: W("inline-flex items-center gap-1 text-xs tabular-nums", i ? "text-red-600 font-medium" : "text-muted-foreground"),
3217
+ className: K("inline-flex items-center gap-1 text-xs tabular-nums", i ? "text-red-600 font-medium" : "text-muted-foreground"),
3225
3218
  "aria-live": "polite",
3226
3219
  "data-tool-running-timer": !0,
3227
3220
  children: [
3228
- Q(i ? vt : Ge, {
3221
+ Q(i ? _t : We, {
3229
3222
  className: "size-3 shrink-0",
3230
3223
  "aria-hidden": !0
3231
3224
  }),
@@ -3256,7 +3249,7 @@ function Sa({ progress: e, designingLabel: t = "Designing your app…", extendLa
3256
3249
  /* @__PURE__ */ $("div", {
3257
3250
  className: "mb-2 flex items-center gap-2 font-medium",
3258
3251
  children: [
3259
- p ? /* @__PURE__ */ Q(K, { className: "size-4 shrink-0 text-emerald-600" }) : /* @__PURE__ */ Q(rt, { className: "size-4 shrink-0 animate-spin text-primary" }),
3252
+ p ? /* @__PURE__ */ Q(q, { className: "size-4 shrink-0 text-emerald-600" }) : /* @__PURE__ */ Q(nt, { className: "size-4 shrink-0 animate-spin text-primary" }),
3260
3253
  /* @__PURE__ */ Q("span", {
3261
3254
  className: "min-w-0 truncate",
3262
3255
  children: h
@@ -3295,7 +3288,7 @@ function Sa({ progress: e, designingLabel: t = "Designing your app…", extendLa
3295
3288
  className: "inline-flex animate-in fade-in items-center gap-1 rounded-md border bg-background px-1.5 py-0.5 text-[11px] text-foreground/80 duration-500",
3296
3289
  title: e.name,
3297
3290
  children: [
3298
- /* @__PURE__ */ Q(gt, { className: "size-3 text-foreground/40" }),
3291
+ /* @__PURE__ */ Q(ht, { className: "size-3 text-foreground/40" }),
3299
3292
  e.label || e.name,
3300
3293
  e.fields ? /* @__PURE__ */ $("span", {
3301
3294
  className: "text-foreground/40",
@@ -3328,7 +3321,7 @@ function Ca({ progress: t, appSegment: n, onOpenBuiltApp: r, openBuiltAppLabel:
3328
3321
  /* @__PURE__ */ $("div", {
3329
3322
  className: "mb-2 flex items-center gap-2 font-medium",
3330
3323
  children: [
3331
- y ? /* @__PURE__ */ Q(K, { className: "size-4 shrink-0 text-emerald-600" }) : /* @__PURE__ */ Q(rt, { className: "size-4 shrink-0 animate-spin text-primary" }),
3324
+ y ? /* @__PURE__ */ Q(q, { className: "size-4 shrink-0 text-emerald-600" }) : /* @__PURE__ */ Q(nt, { className: "size-4 shrink-0 animate-spin text-primary" }),
3332
3325
  /* @__PURE__ */ Q("span", { children: y ? `Built ${m ?? "your app"}` : `Building ${m ?? "your app"}…` }),
3333
3326
  !y && p === "data" ? /* @__PURE__ */ Q("span", {
3334
3327
  className: "text-xs font-normal text-muted-foreground",
@@ -3349,7 +3342,7 @@ function Ca({ progress: t, appSegment: n, onOpenBuiltApp: r, openBuiltAppLabel:
3349
3342
  /* @__PURE__ */ Q("div", {
3350
3343
  className: "mb-2 h-1.5 w-full overflow-hidden rounded-full bg-muted",
3351
3344
  children: /* @__PURE__ */ Q("div", {
3352
- className: W("h-full rounded-full transition-all duration-500", y ? "bg-emerald-500" : "bg-primary"),
3345
+ className: K("h-full rounded-full transition-all duration-500", y ? "bg-emerald-500" : "bg-primary"),
3353
3346
  style: { width: `${S}%` }
3354
3347
  })
3355
3348
  }),
@@ -3359,7 +3352,7 @@ function Ca({ progress: t, appSegment: n, onOpenBuiltApp: r, openBuiltAppLabel:
3359
3352
  let r = C.get(t);
3360
3353
  return /* @__PURE__ */ $("li", {
3361
3354
  className: "flex items-start gap-2",
3362
- children: [/* @__PURE__ */ Q(K, { className: "mt-0.5 size-3.5 shrink-0 text-emerald-600" }), /* @__PURE__ */ $("span", {
3355
+ children: [/* @__PURE__ */ Q(q, { className: "mt-0.5 size-3.5 shrink-0 text-emerald-600" }), /* @__PURE__ */ $("span", {
3363
3356
  className: "min-w-0 text-muted-foreground",
3364
3357
  children: [
3365
3358
  /* @__PURE__ */ Q("span", {
@@ -3394,21 +3387,21 @@ function Ca({ progress: t, appSegment: n, onOpenBuiltApp: r, openBuiltAppLabel:
3394
3387
  onClick: () => a(x.name, n),
3395
3388
  className: "inline-flex h-7 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground hover:bg-primary/90",
3396
3389
  "data-testid": "build-progress-design-app",
3397
- children: [o, /* @__PURE__ */ Q(Pe, { className: "size-3.5" })]
3390
+ children: [o, /* @__PURE__ */ Q(Me, { className: "size-3.5" })]
3398
3391
  }) : null,
3399
3392
  r ? /* @__PURE__ */ $("button", {
3400
3393
  type: "button",
3401
3394
  onClick: () => r(x.name),
3402
- className: W("inline-flex h-7 items-center gap-1.5 rounded-md px-3 text-xs font-medium", a ? "border hover:bg-muted" : "bg-primary text-primary-foreground hover:bg-primary/90"),
3395
+ className: K("inline-flex h-7 items-center gap-1.5 rounded-md px-3 text-xs font-medium", a ? "border hover:bg-muted" : "bg-primary text-primary-foreground hover:bg-primary/90"),
3403
3396
  "data-testid": "build-progress-open-app",
3404
- children: [i, /* @__PURE__ */ Q(Pe, { className: "size-3.5" })]
3397
+ children: [i, /* @__PURE__ */ Q(Me, { className: "size-3.5" })]
3405
3398
  }) : null,
3406
3399
  c ? /* @__PURE__ */ $("button", {
3407
3400
  type: "button",
3408
3401
  onClick: () => c(x.name),
3409
3402
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border px-3 text-xs font-medium hover:bg-muted",
3410
3403
  "data-testid": "build-progress-preview-app",
3411
- children: [/* @__PURE__ */ Q(Ze, { className: "size-3.5" }), l]
3404
+ children: [/* @__PURE__ */ Q(Xe, { className: "size-3.5" }), l]
3412
3405
  }) : null
3413
3406
  ]
3414
3407
  }) : null
@@ -3440,7 +3433,7 @@ function wa({ groups: e, labels: t }) {
3440
3433
  hints: t.designingPlanHints,
3441
3434
  offlineLabel: t.connectionOfflineLabel
3442
3435
  }) : /* @__PURE__ */ Q(ya, { offlineLabel: t.connectionOfflineLabel }) : /* @__PURE__ */ Q("span", {
3443
- className: W("shrink-0 text-[10px] font-medium", e.state === "failed" ? "text-destructive" : e.state === "completed" ? "text-emerald-700 dark:text-emerald-400" : "text-muted-foreground"),
3436
+ className: K("shrink-0 text-[10px] font-medium", e.state === "failed" ? "text-destructive" : e.state === "completed" ? "text-emerald-700 dark:text-emerald-400" : "text-muted-foreground"),
3444
3437
  children: Ea(e.state, t)
3445
3438
  })]
3446
3439
  }, e.key))
@@ -3448,7 +3441,7 @@ function wa({ groups: e, labels: t }) {
3448
3441
  });
3449
3442
  }
3450
3443
  function Ta({ state: e }) {
3451
- return e === "failed" ? /* @__PURE__ */ Q(Y, { className: "size-3.5 shrink-0 text-destructive" }) : e === "completed" ? /* @__PURE__ */ Q(K, { className: "size-3.5 shrink-0 text-emerald-600" }) : /* @__PURE__ */ Q(Ge, { className: "size-3.5 shrink-0 text-muted-foreground" });
3444
+ return e === "failed" ? /* @__PURE__ */ Q(X, { className: "size-3.5 shrink-0 text-destructive" }) : e === "completed" ? /* @__PURE__ */ Q(q, { className: "size-3.5 shrink-0 text-emerald-600" }) : /* @__PURE__ */ Q(We, { className: "size-3.5 shrink-0 text-muted-foreground" });
3452
3445
  }
3453
3446
  function Ea(e, t) {
3454
3447
  switch (e) {
@@ -3472,7 +3465,7 @@ function Da({ error: t, rateLimitedLabel: n, genericLabel: r }) {
3472
3465
  className: "rounded-md border border-amber-300/40 bg-amber-50/60 px-3 py-2 text-foreground dark:bg-amber-950/20",
3473
3466
  children: /* @__PURE__ */ $("div", {
3474
3467
  className: "flex items-start gap-2",
3475
- children: [/* @__PURE__ */ Q(_t, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-600" }), /* @__PURE__ */ Q("div", {
3468
+ children: [/* @__PURE__ */ Q(gt, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-600" }), /* @__PURE__ */ Q("div", {
3476
3469
  className: "min-w-0 flex-1 break-words leading-snug",
3477
3470
  children: i
3478
3471
  })]
@@ -3518,7 +3511,7 @@ function Oa({ error: t, onReload: n, onUpgrade: r }) {
3518
3511
  children: [/* @__PURE__ */ $("div", {
3519
3512
  className: "flex items-start gap-2",
3520
3513
  children: [
3521
- /* @__PURE__ */ Q(Me, { className: "mt-0.5 h-4 w-4 shrink-0 text-destructive" }),
3514
+ /* @__PURE__ */ Q(Ae, { className: "mt-0.5 h-4 w-4 shrink-0 text-destructive" }),
3522
3515
  /* @__PURE__ */ $("div", {
3523
3516
  className: "min-w-0 flex-1",
3524
3517
  children: [/* @__PURE__ */ Q("div", {
@@ -3541,7 +3534,7 @@ function Oa({ error: t, onReload: n, onUpgrade: r }) {
3541
3534
  type: "button",
3542
3535
  onClick: n,
3543
3536
  className: "inline-flex h-7 items-center rounded-md border border-destructive/30 bg-background px-2 text-xs font-medium text-destructive hover:bg-destructive/10",
3544
- children: [/* @__PURE__ */ Q(ut, { className: "mr-1 h-3 w-3" }), "Retry"]
3537
+ children: [/* @__PURE__ */ Q(lt, { className: "mr-1 h-3 w-3" }), "Retry"]
3545
3538
  }) : null]
3546
3539
  })
3547
3540
  ]
@@ -4226,7 +4219,7 @@ var ja = ({ size: e = 16 }) => /* @__PURE__ */ $("svg", {
4226
4219
  }) })
4227
4220
  ]
4228
4221
  }), Ma = ({ className: e, size: t = 16, ...n }) => /* @__PURE__ */ Q("div", {
4229
- className: W("inline-flex animate-spin items-center justify-center", e),
4222
+ className: K("inline-flex animate-spin items-center justify-center", e),
4230
4223
  ...n,
4231
4224
  children: /* @__PURE__ */ Q(ja, { size: t })
4232
4225
  }), Na = /* @__PURE__ */ Lt({
@@ -4536,24 +4529,24 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
4536
4529
  } finally {
4537
4530
  E(null);
4538
4531
  }
4539
- }, [F]), se = /* @__PURE__ */ $("div", {
4532
+ }, [F]), z = /* @__PURE__ */ $("div", {
4540
4533
  className: "space-y-3",
4541
4534
  children: [
4542
4535
  /* @__PURE__ */ $("div", {
4543
4536
  className: "flex items-center justify-between gap-2",
4544
- children: [/* @__PURE__ */ Q(Ee, {
4537
+ children: [/* @__PURE__ */ Q(Ce, {
4545
4538
  value: l,
4546
4539
  onValueChange: (e) => u(e),
4547
- children: /* @__PURE__ */ $(De, { children: [
4548
- /* @__PURE__ */ Q(Oe, {
4540
+ children: /* @__PURE__ */ $(we, { children: [
4541
+ /* @__PURE__ */ Q(Te, {
4549
4542
  value: "pending",
4550
4543
  children: "Pending"
4551
4544
  }),
4552
- /* @__PURE__ */ Q(Oe, {
4545
+ /* @__PURE__ */ Q(Te, {
4553
4546
  value: "decided",
4554
4547
  children: "Decided"
4555
4548
  }),
4556
- /* @__PURE__ */ Q(Oe, {
4549
+ /* @__PURE__ */ Q(Te, {
4557
4550
  value: "all",
4558
4551
  children: "All"
4559
4552
  })
@@ -4564,20 +4557,20 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
4564
4557
  onClick: () => void ee(),
4565
4558
  disabled: M,
4566
4559
  "data-testid": "ai-inbox-refresh",
4567
- children: [/* @__PURE__ */ Q(ut, { className: `h-3.5 w-3.5 mr-1.5 ${M ? "animate-spin" : ""}` }), "Refresh"]
4560
+ children: [/* @__PURE__ */ Q(lt, { className: `h-3.5 w-3.5 mr-1.5 ${M ? "animate-spin" : ""}` }), "Refresh"]
4568
4561
  })]
4569
4562
  }),
4570
4563
  N ? /* @__PURE__ */ $(f, {
4571
4564
  variant: "destructive",
4572
- children: [/* @__PURE__ */ Q(Me, { className: "h-4 w-4" }), /* @__PURE__ */ Q(p, { children: N.message })]
4565
+ children: [/* @__PURE__ */ Q(Ae, { className: "h-4 w-4" }), /* @__PURE__ */ Q(p, { children: N.message })]
4573
4566
  }) : null,
4574
4567
  D ? /* @__PURE__ */ $(f, {
4575
4568
  variant: "destructive",
4576
- children: [/* @__PURE__ */ Q(Me, { className: "h-4 w-4" }), /* @__PURE__ */ Q(p, { children: D })]
4569
+ children: [/* @__PURE__ */ Q(Ae, { className: "h-4 w-4" }), /* @__PURE__ */ Q(p, { children: D })]
4577
4570
  }) : null,
4578
4571
  k && !D ? /* @__PURE__ */ $(f, {
4579
4572
  variant: k.ok ? "default" : "destructive",
4580
- children: [k.ok ? /* @__PURE__ */ Q(K, { className: "h-4 w-4" }) : /* @__PURE__ */ Q(Y, { className: "h-4 w-4" }), /* @__PURE__ */ $(p, { children: [
4573
+ children: [k.ok ? /* @__PURE__ */ Q(q, { className: "h-4 w-4" }) : /* @__PURE__ */ Q(X, { className: "h-4 w-4" }), /* @__PURE__ */ $(p, { children: [
4581
4574
  k.kind === "approve" ? "Approve" : "Reject",
4582
4575
  " for",
4583
4576
  " ",
@@ -4593,69 +4586,69 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
4593
4586
  M && I.length === 0 ? /* @__PURE__ */ $("div", {
4594
4587
  className: "space-y-2",
4595
4588
  children: [
4596
- /* @__PURE__ */ Q(xe, { className: "h-10 w-full" }),
4597
- /* @__PURE__ */ Q(xe, { className: "h-10 w-full" }),
4598
- /* @__PURE__ */ Q(xe, { className: "h-10 w-full" })
4589
+ /* @__PURE__ */ Q(ve, { className: "h-10 w-full" }),
4590
+ /* @__PURE__ */ Q(ve, { className: "h-10 w-full" }),
4591
+ /* @__PURE__ */ Q(ve, { className: "h-10 w-full" })
4599
4592
  ]
4600
4593
  }) : I.length === 0 ? /* @__PURE__ */ Q(te, { children: /* @__PURE__ */ $(L, { children: [
4601
- /* @__PURE__ */ Q(re, { children: /* @__PURE__ */ Q(nt, { className: "h-8 w-8 text-muted-foreground" }) }),
4594
+ /* @__PURE__ */ Q(re, { children: /* @__PURE__ */ Q(tt, { className: "h-8 w-8 text-muted-foreground" }) }),
4602
4595
  /* @__PURE__ */ Q(ie, { children: "No actions waiting" }),
4603
4596
  /* @__PURE__ */ Q(ne, { children: "When the AI proposes a sensitive action it will appear here for review." })
4604
4597
  ] }) }) : /* @__PURE__ */ Q("div", {
4605
4598
  className: "rounded-md border",
4606
- children: /* @__PURE__ */ $(Se, { children: [/* @__PURE__ */ Q(we, { children: /* @__PURE__ */ $(Te, { children: [
4607
- /* @__PURE__ */ Q(V, {
4599
+ children: /* @__PURE__ */ $(ye, { children: [/* @__PURE__ */ Q(xe, { children: /* @__PURE__ */ $(Se, { children: [
4600
+ /* @__PURE__ */ Q(W, {
4608
4601
  className: "w-[140px]",
4609
4602
  children: "Tool"
4610
4603
  }),
4611
- /* @__PURE__ */ Q(V, {
4604
+ /* @__PURE__ */ Q(W, {
4612
4605
  className: "w-[140px]",
4613
4606
  children: "Action"
4614
4607
  }),
4615
- /* @__PURE__ */ Q(V, {
4608
+ /* @__PURE__ */ Q(W, {
4616
4609
  className: "w-[120px]",
4617
4610
  children: "Object"
4618
4611
  }),
4619
- /* @__PURE__ */ Q(V, {
4612
+ /* @__PURE__ */ Q(W, {
4620
4613
  className: "w-[110px]",
4621
4614
  children: "Status"
4622
4615
  }),
4623
- /* @__PURE__ */ Q(V, {
4616
+ /* @__PURE__ */ Q(W, {
4624
4617
  className: "w-[110px]",
4625
4618
  children: "Proposed"
4626
4619
  }),
4627
- /* @__PURE__ */ Q(V, {
4620
+ /* @__PURE__ */ Q(W, {
4628
4621
  className: "w-[260px] text-right",
4629
4622
  children: "Decision"
4630
4623
  })
4631
- ] }) }), /* @__PURE__ */ Q(Ce, { children: I.map((e) => {
4624
+ ] }) }), /* @__PURE__ */ Q(be, { children: I.map((e) => {
4632
4625
  let t = e.status === "pending", n = T === e.id;
4633
- return /* @__PURE__ */ $(Te, { children: [
4634
- /* @__PURE__ */ Q(B, {
4626
+ return /* @__PURE__ */ $(Se, { children: [
4627
+ /* @__PURE__ */ Q(U, {
4635
4628
  className: "font-mono text-xs",
4636
4629
  children: e.tool_name
4637
4630
  }),
4638
- /* @__PURE__ */ Q(B, {
4631
+ /* @__PURE__ */ Q(U, {
4639
4632
  className: "text-sm",
4640
4633
  children: e.action_name
4641
4634
  }),
4642
- /* @__PURE__ */ Q(B, {
4635
+ /* @__PURE__ */ Q(U, {
4643
4636
  className: "text-sm",
4644
4637
  children: e.object_name
4645
4638
  }),
4646
- /* @__PURE__ */ Q(B, { children: /* @__PURE__ */ Q(za, { status: e.status }) }),
4647
- /* @__PURE__ */ Q(B, {
4639
+ /* @__PURE__ */ Q(U, { children: /* @__PURE__ */ Q(za, { status: e.status }) }),
4640
+ /* @__PURE__ */ Q(U, {
4648
4641
  className: "text-xs text-muted-foreground",
4649
4642
  children: /* @__PURE__ */ $("span", {
4650
4643
  className: "inline-flex items-center gap-1",
4651
4644
  children: [
4652
- /* @__PURE__ */ Q(We, { className: "h-3 w-3" }),
4645
+ /* @__PURE__ */ Q(Ue, { className: "h-3 w-3" }),
4653
4646
  " ",
4654
4647
  Ba(e.proposed_at)
4655
4648
  ]
4656
4649
  })
4657
4650
  }),
4658
- /* @__PURE__ */ Q(B, {
4651
+ /* @__PURE__ */ Q(U, {
4659
4652
  className: "text-right",
4660
4653
  children: /* @__PURE__ */ $("div", {
4661
4654
  className: "inline-flex gap-1.5",
@@ -4664,14 +4657,14 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
4664
4657
  variant: "ghost",
4665
4658
  onClick: () => m(e.id),
4666
4659
  "data-testid": `ai-inbox-view-${e.id}`,
4667
- children: [/* @__PURE__ */ Q(Ze, { className: "h-3.5 w-3.5 mr-1" }), " View"]
4660
+ children: [/* @__PURE__ */ Q(Xe, { className: "h-3.5 w-3.5 mr-1" }), " View"]
4668
4661
  }), t ? /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ $(v, {
4669
4662
  size: "sm",
4670
4663
  variant: "default",
4671
4664
  disabled: n,
4672
4665
  onClick: () => void ae(e.id),
4673
4666
  "data-testid": `ai-inbox-approve-${e.id}`,
4674
- children: [/* @__PURE__ */ Q(K, { className: "h-3.5 w-3.5 mr-1" }), n ? "Working…" : "Approve"]
4667
+ children: [/* @__PURE__ */ Q(q, { className: "h-3.5 w-3.5 mr-1" }), n ? "Working…" : "Approve"]
4675
4668
  }), /* @__PURE__ */ $(v, {
4676
4669
  size: "sm",
4677
4670
  variant: "destructive",
@@ -4680,7 +4673,7 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
4680
4673
  g(e.id), w("");
4681
4674
  },
4682
4675
  "data-testid": `ai-inbox-reject-${e.id}`,
4683
- children: [/* @__PURE__ */ Q(Y, { className: "h-3.5 w-3.5 mr-1" }), "Reject"]
4676
+ children: [/* @__PURE__ */ Q(X, { className: "h-3.5 w-3.5 mr-1" }), "Reject"]
4684
4677
  })] }) : null]
4685
4678
  })
4686
4679
  })
@@ -4697,27 +4690,27 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
4697
4690
  children: [/* @__PURE__ */ $(C, {
4698
4691
  className: "flex items-center gap-2",
4699
4692
  children: [
4700
- /* @__PURE__ */ Q(Fe, { className: "h-4 w-4" }),
4693
+ /* @__PURE__ */ Q(Pe, { className: "h-4 w-4" }),
4701
4694
  " ",
4702
4695
  o
4703
4696
  ]
4704
4697
  }), s ? /* @__PURE__ */ Q(x, { children: s }) : null]
4705
- }), /* @__PURE__ */ Q(b, { children: se })]
4698
+ }), /* @__PURE__ */ Q(b, { children: z })]
4706
4699
  }) : /* @__PURE__ */ Q("div", {
4707
4700
  className: c,
4708
- children: se
4701
+ children: z
4709
4702
  }),
4710
- /* @__PURE__ */ Q(ge, {
4703
+ /* @__PURE__ */ Q(pe, {
4711
4704
  open: !!d,
4712
4705
  onOpenChange: (e) => {
4713
4706
  e || m(null);
4714
4707
  },
4715
- children: /* @__PURE__ */ $(_e, {
4708
+ children: /* @__PURE__ */ $(me, {
4716
4709
  className: "sm:max-w-[560px] overflow-y-auto",
4717
- children: [/* @__PURE__ */ $(ye, { children: [/* @__PURE__ */ $(be, {
4710
+ children: [/* @__PURE__ */ $(ge, { children: [/* @__PURE__ */ $(_e, {
4718
4711
  className: "flex items-center gap-2",
4719
- children: [/* @__PURE__ */ Q(Fe, { className: "h-4 w-4" }), R ? R.action_name : "Pending action"]
4720
- }), /* @__PURE__ */ Q(ve, { children: R ? /* @__PURE__ */ $(Z, { children: [
4712
+ children: [/* @__PURE__ */ Q(Pe, { className: "h-4 w-4" }), R ? R.action_name : "Pending action"]
4713
+ }), /* @__PURE__ */ Q(he, { children: R ? /* @__PURE__ */ $(Z, { children: [
4721
4714
  "Tool ",
4722
4715
  /* @__PURE__ */ Q("code", {
4723
4716
  className: "text-xs",
@@ -4735,28 +4728,28 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
4735
4728
  /* @__PURE__ */ $("div", {
4736
4729
  className: "grid grid-cols-2 gap-3 text-sm",
4737
4730
  children: [
4738
- /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
4731
+ /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(B, {
4739
4732
  className: "text-xs text-muted-foreground",
4740
4733
  children: "Status"
4741
4734
  }), /* @__PURE__ */ Q("div", {
4742
4735
  className: "mt-1",
4743
4736
  children: /* @__PURE__ */ Q(za, { status: R.status })
4744
4737
  })] }),
4745
- /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
4738
+ /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(B, {
4746
4739
  className: "text-xs text-muted-foreground",
4747
4740
  children: "Proposed"
4748
4741
  }), /* @__PURE__ */ Q("div", {
4749
4742
  className: "mt-1 text-xs",
4750
4743
  children: Ba(R.proposed_at)
4751
4744
  })] }),
4752
- /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
4745
+ /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(B, {
4753
4746
  className: "text-xs text-muted-foreground",
4754
4747
  children: "Proposed by"
4755
4748
  }), /* @__PURE__ */ Q("div", {
4756
4749
  className: "mt-1 text-xs font-mono break-all",
4757
4750
  children: R.proposed_by ?? "—"
4758
4751
  })] }),
4759
- /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
4752
+ /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(B, {
4760
4753
  className: "text-xs text-muted-foreground",
4761
4754
  children: "Decided by"
4762
4755
  }), /* @__PURE__ */ Q("div", {
@@ -4765,7 +4758,7 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
4765
4758
  })] }),
4766
4759
  R.conversation_id ? /* @__PURE__ */ $("div", {
4767
4760
  className: "col-span-2",
4768
- children: [/* @__PURE__ */ Q(z, {
4761
+ children: [/* @__PURE__ */ Q(B, {
4769
4762
  className: "text-xs text-muted-foreground",
4770
4763
  children: "Conversation"
4771
4764
  }), /* @__PURE__ */ Q("div", {
@@ -4775,29 +4768,29 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
4775
4768
  }) : null
4776
4769
  ]
4777
4770
  }),
4778
- /* @__PURE__ */ Q(he, {}),
4779
- /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
4771
+ /* @__PURE__ */ Q(fe, {}),
4772
+ /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(B, {
4780
4773
  className: "text-xs",
4781
4774
  children: "Tool input"
4782
4775
  }), /* @__PURE__ */ Q("div", {
4783
4776
  className: "mt-1.5",
4784
4777
  children: /* @__PURE__ */ Q(Ha, { value: Va(R.tool_input) })
4785
4778
  })] }),
4786
- R.result ? /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
4779
+ R.result ? /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(B, {
4787
4780
  className: "text-xs",
4788
4781
  children: "Result"
4789
4782
  }), /* @__PURE__ */ Q("div", {
4790
4783
  className: "mt-1.5",
4791
4784
  children: /* @__PURE__ */ Q(Ha, { value: Va(R.result) })
4792
4785
  })] }) : null,
4793
- R.error ? /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
4786
+ R.error ? /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(B, {
4794
4787
  className: "text-xs text-destructive",
4795
4788
  children: "Error"
4796
4789
  }), /* @__PURE__ */ Q("div", {
4797
4790
  className: "mt-1.5",
4798
4791
  children: /* @__PURE__ */ Q(Ha, { value: R.error })
4799
4792
  })] }) : null,
4800
- R.rejection_reason ? /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
4793
+ R.rejection_reason ? /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(B, {
4801
4794
  className: "text-xs",
4802
4795
  children: "Rejection reason"
4803
4796
  }), /* @__PURE__ */ Q("div", {
@@ -4810,7 +4803,7 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
4810
4803
  size: "sm",
4811
4804
  onClick: () => void ae(R.id),
4812
4805
  disabled: T === R.id,
4813
- children: [/* @__PURE__ */ Q(K, { className: "h-3.5 w-3.5 mr-1" }), "Approve & Execute"]
4806
+ children: [/* @__PURE__ */ Q(q, { className: "h-3.5 w-3.5 mr-1" }), "Approve & Execute"]
4814
4807
  }), /* @__PURE__ */ $(v, {
4815
4808
  size: "sm",
4816
4809
  variant: "destructive",
@@ -4818,24 +4811,24 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
4818
4811
  g(R.id), w("");
4819
4812
  },
4820
4813
  disabled: T === R.id,
4821
- children: [/* @__PURE__ */ Q(Y, { className: "h-3.5 w-3.5 mr-1" }), "Reject"]
4814
+ children: [/* @__PURE__ */ Q(X, { className: "h-3.5 w-3.5 mr-1" }), "Reject"]
4822
4815
  })]
4823
4816
  }) : null
4824
4817
  ]
4825
4818
  }) : null]
4826
4819
  })
4827
4820
  }),
4828
- /* @__PURE__ */ Q(ge, {
4821
+ /* @__PURE__ */ Q(pe, {
4829
4822
  open: !!h,
4830
4823
  onOpenChange: (e) => {
4831
4824
  e || (g(null), w(""));
4832
4825
  },
4833
- children: /* @__PURE__ */ $(_e, {
4826
+ children: /* @__PURE__ */ $(me, {
4834
4827
  side: "bottom",
4835
4828
  className: "max-h-[40vh]",
4836
- children: [/* @__PURE__ */ $(ye, { children: [/* @__PURE__ */ Q(be, { children: "Reject this action?" }), /* @__PURE__ */ Q(ve, { children: "The reason is shown back to the AI so it can adjust its next response." })] }), /* @__PURE__ */ $("div", {
4829
+ children: [/* @__PURE__ */ $(ge, { children: [/* @__PURE__ */ Q(_e, { children: "Reject this action?" }), /* @__PURE__ */ Q(he, { children: "The reason is shown back to the AI so it can adjust its next response." })] }), /* @__PURE__ */ $("div", {
4837
4830
  className: "px-4 mt-3 space-y-3",
4838
- children: [/* @__PURE__ */ Q(ke, {
4831
+ children: [/* @__PURE__ */ Q(Ee, {
4839
4832
  value: _,
4840
4833
  onChange: (e) => w(e.target.value),
4841
4834
  placeholder: "Optional reason (e.g. 'Wrong record id — please confirm with the user first.')",
@@ -4856,7 +4849,7 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
4856
4849
  onClick: () => h && void oe(h, _),
4857
4850
  disabled: !h || T === h,
4858
4851
  "data-testid": "ai-inbox-reject-confirm",
4859
- children: [/* @__PURE__ */ Q(Y, { className: "h-3.5 w-3.5 mr-1" }), "Reject"]
4852
+ children: [/* @__PURE__ */ Q(X, { className: "h-3.5 w-3.5 mr-1" }), "Reject"]
4860
4853
  })]
4861
4854
  })]
4862
4855
  })]
@@ -5029,10 +5022,10 @@ var Za = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
5029
5022
  };
5030
5023
  return /* @__PURE__ */ $("div", {
5031
5024
  ref: p,
5032
- className: W("flex flex-col border rounded-lg bg-background overflow-hidden", t),
5025
+ className: K("flex flex-col border rounded-lg bg-background overflow-hidden", t),
5033
5026
  style: { maxHeight: d },
5034
5027
  ...f,
5035
- children: [/* @__PURE__ */ Q(ce, {
5028
+ children: [/* @__PURE__ */ Q(V, {
5036
5029
  ref: g,
5037
5030
  className: "flex-1 p-4",
5038
5031
  children: /* @__PURE__ */ Q("div", {
@@ -5053,7 +5046,7 @@ var Za = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
5053
5046
  className: "border-t p-4",
5054
5047
  children: /* @__PURE__ */ $("div", {
5055
5048
  className: "flex gap-2",
5056
- children: [/* @__PURE__ */ Q(se, {
5049
+ children: [/* @__PURE__ */ Q(z, {
5057
5050
  ref: _,
5058
5051
  value: m,
5059
5052
  onChange: (e) => h(e.target.value),
@@ -5065,7 +5058,7 @@ var Za = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
5065
5058
  onClick: y,
5066
5059
  disabled: a || !m.trim(),
5067
5060
  size: "icon",
5068
- children: /* @__PURE__ */ Q(ft, { className: "h-4 w-4" })
5061
+ children: /* @__PURE__ */ Q(dt, { className: "h-4 w-4" })
5069
5062
  })]
5070
5063
  })
5071
5064
  })]
@@ -5083,7 +5076,7 @@ var Qa = ({ message: e, showTimestamp: t, userAvatarUrl: n, userAvatarFallback:
5083
5076
  });
5084
5077
  let s = o ? e.avatar || n : e.avatar || i, c = o ? e.avatarFallback || r : e.avatarFallback || a;
5085
5078
  return /* @__PURE__ */ $("div", {
5086
- className: W("flex gap-3", o ? "flex-row-reverse" : "flex-row"),
5079
+ className: K("flex gap-3", o ? "flex-row-reverse" : "flex-row"),
5087
5080
  children: [/* @__PURE__ */ $(m, {
5088
5081
  className: "h-8 w-8",
5089
5082
  children: [/* @__PURE__ */ Q(g, { src: s }), /* @__PURE__ */ Q(h, {
@@ -5091,9 +5084,9 @@ var Qa = ({ message: e, showTimestamp: t, userAvatarUrl: n, userAvatarFallback:
5091
5084
  children: c
5092
5085
  })]
5093
5086
  }), /* @__PURE__ */ $("div", {
5094
- className: W("flex flex-col gap-1", o ? "items-end" : "items-start"),
5087
+ className: K("flex flex-col gap-1", o ? "items-end" : "items-start"),
5095
5088
  children: [/* @__PURE__ */ Q("div", {
5096
- className: W("rounded-lg px-4 py-2 max-w-[70%] break-words", o ? "bg-primary text-primary-foreground" : "bg-muted"),
5089
+ className: K("rounded-lg px-4 py-2 max-w-[70%] break-words", o ? "bg-primary text-primary-foreground" : "bg-muted"),
5097
5090
  children: /* @__PURE__ */ Q("p", {
5098
5091
  className: "text-sm whitespace-pre-wrap",
5099
5092
  children: e.content
@@ -5106,7 +5099,7 @@ var Qa = ({ message: e, showTimestamp: t, userAvatarUrl: n, userAvatarFallback:
5106
5099
  });
5107
5100
  }, $a = e.forwardRef(({ className: e, avatarSrc: t, avatarFallback: n = "AI", ...r }, i) => /* @__PURE__ */ $("div", {
5108
5101
  ref: i,
5109
- className: W("flex gap-3", e),
5102
+ className: K("flex gap-3", e),
5110
5103
  ...r,
5111
5104
  children: [/* @__PURE__ */ $(m, {
5112
5105
  className: "h-8 w-8",