@burdenoff/fe-libs 2026.1114.12 → 2026.1114.13

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.
@@ -4,420 +4,517 @@ import { useI18n as n } from "../../../providers/shell/I18nProvider.js";
4
4
  import { useAssistantTr as r } from "../../i18n.js";
5
5
  import { languageDisplayName as i } from "../../voice/speechVoices.js";
6
6
  import { resolveAssistantLanguage as ee } from "../../voice/languages.js";
7
- import { useAssistantStore as a } from "../../store.js";
8
- import { useVoiceInput as te } from "../../voice/useVoiceInput.js";
9
- import { useAssistantAttachments as ne } from "../../useAssistantAttachments.js";
10
- import { getSendableAttachments as re } from "../../attachments.js";
11
- import { ATTACHMENT_COMMIT_CODES as ie } from "../../attachmentCommit.js";
12
- import { AssistantAttachmentButton as ae } from "./AssistantAttachmentButton.js";
13
- import { AssistantAttachmentChips as oe } from "./AssistantAttachmentChips.js";
14
- import { AssistantFocusChip as se } from "./AssistantFocusChip.js";
15
- import { useAskAboutStore as o } from "../../askAbout/askAboutStore.js";
16
- import { AssistantVoiceButton as ce, ListeningDot as le } from "./AssistantVoiceButton.js";
17
- import { AssistantVoiceSessionButton as ue } from "../voice/AssistantVoiceSessionButton.js";
18
- import { AssistantModeSelector as de } from "./AssistantModeSelector.js";
19
- import { AssistantModeMenu as fe } from "./AssistantModeMenu.js";
20
- import { AssistantViewSwitchRow as pe } from "../compact/AssistantViewSwitchRow.js";
21
- import { compactEnterSends as me, isImeComposingEnter as he } from "./imeEnter.js";
22
- import { PAGE_COLUMN as ge, useAssistantPageLayout as _e } from "../assistantPageLayout.js";
23
- import { useCallback as s, useEffect as c, useId as l, useLayoutEffect as ve, useMemo as ye, useRef as u, useState as d } from "react";
24
- import { ArrowUp as be, Loader2 as f, Square as xe } from "lucide-react";
25
- import { Fragment as Se, jsx as p, jsxs as m } from "react/jsx-runtime";
7
+ import { useAssistantStore as te } from "../../store.js";
8
+ import { useVoiceInput as ne } from "../../voice/useVoiceInput.js";
9
+ import { useAssistantAttachments as re } from "../../useAssistantAttachments.js";
10
+ import { getSendableAttachments as ie } from "../../attachments.js";
11
+ import { ATTACHMENT_COMMIT_CODES as ae } from "../../attachmentCommit.js";
12
+ import { AssistantAttachmentButton as oe } from "./AssistantAttachmentButton.js";
13
+ import { AssistantAttachmentChips as se } from "./AssistantAttachmentChips.js";
14
+ import { AssistantFocusChip as ce } from "./AssistantFocusChip.js";
15
+ import { useAskAboutStore as a } from "../../askAbout/askAboutStore.js";
16
+ import { AssistantVoiceButton as le, ListeningDot as ue } from "./AssistantVoiceButton.js";
17
+ import { AssistantVoiceSessionButton as de } from "../voice/AssistantVoiceSessionButton.js";
18
+ import { LiveWaveform as fe } from "../voice/LiveWaveform.js";
19
+ import { useLiveLevel as pe } from "../voice/useLiveLevel.js";
20
+ import { AssistantModeSelector as me } from "./AssistantModeSelector.js";
21
+ import { AssistantModeMenu as he } from "./AssistantModeMenu.js";
22
+ import { AssistantViewSwitchRow as ge } from "../compact/AssistantViewSwitchRow.js";
23
+ import { compactEnterSends as _e, isImeComposingEnter as ve } from "./imeEnter.js";
24
+ import { PAGE_COLUMN as ye, useAssistantPageLayout as be } from "../assistantPageLayout.js";
25
+ import { useCallback as o, useEffect as s, useId as c, useLayoutEffect as xe, useMemo as Se, useRef as l, useState as u } from "react";
26
+ import { ArrowUp as Ce, Check as we, Loader2 as d, Square as Te, X as Ee } from "lucide-react";
27
+ import { Fragment as De, jsx as f, jsxs as p } from "react/jsx-runtime";
26
28
  // src/shared/assistant/ui/composer/AssistantComposer.tsx
27
- var Ce = 200;
28
- function we(e) {
29
+ var Oe = 200;
30
+ function ke(e) {
29
31
  if (!e) return !1;
30
32
  let t = e.ownerDocument.activeElement;
31
33
  return !t || t === e.ownerDocument.body ? !1 : e.contains(t) ? !0 : e.closest("[data-assistant-panel]")?.contains(t) ?? !1;
32
34
  }
33
- var Te = ({ children: e }) => e(l()), h = ({ writeAccessDenied: l = !1, onSend: h, disabled: Ee = !1, readOnly: De = !1, placeholder: Oe, mode: ke, availableModes: g, attachmentCharsPerFile: Ae, onModeChange: je, auto: Me, onStartVoiceSession: _, onDraftStart: Ne, onDraftChange: Pe, suspendDictation: Fe = !1, onVoiceStateChange: Ie, presentation: Le = "classic", turnInFlight: v = !1, onStop: y, turnId: Re, modeDisabledReason: ze = null, inputRef: b, aboveCard: Be, viewSwitch: Ve, modeReadOnly: He = !1, voiceSessionActive: x = !1 }) => {
34
- let S = r(), Ue = _e(), { locale: C } = n(), w = Ee || De, T = Le === "compact", E = u(null), We = s((e) => {
35
- E.current = e, typeof b == "function" ? b(e) : b && (b.current = e);
36
- }, [b]), [D, O] = d(""), [k, A] = d(!1), [j, Ge] = d(!1), M = u(!1), [N, P] = d(null), [Ke, F] = d(null), [I, L] = d(null), [qe, Je] = d(v);
37
- qe === v ? I !== null && v && Re != null && Re !== I && L(null) : (Je(v), v ? (F(null), L(null)) : I !== null && (F(I), L(null)));
38
- let Ye = u(!1), R = u(null), Xe = u(!1), Ze = u(!1), Qe = u(null), z = u(!1), B = u(0), { attachments: V, isBusy: $e, preparingCount: et, sendBlocker: tt, rejection: nt, addFiles: H, remove: rt, retry: it, clear: at, clearRejection: ot, canAddMore: st, commit: ct, cancelCommit: lt } = ne({ perFileChars: Ae }), U = D.trim() !== "" || V.length > 0, ut = u(!1), dt = u(!1);
39
- c(() => {
40
- U && !ut.current ? (ut.current = !0, Ne?.()) : U || (ut.current = !1);
41
- }, [U, Ne]), c(() => {
42
- U || (dt.current = !1), Pe?.({
43
- text: D,
44
- hasAttachments: V.length > 0,
45
- dictated: dt.current
35
+ var Ae = ({ children: e }) => e(c()), m = ({ writeAccessDenied: c = !1, onSend: m, disabled: je = !1, readOnly: Me = !1, placeholder: Ne, mode: Pe, availableModes: h, attachmentCharsPerFile: Fe, onModeChange: Ie, auto: Le, onStartVoiceSession: g, onDraftStart: Re, onDraftChange: ze, suspendDictation: Be = !1, onVoiceStateChange: Ve, presentation: He = "classic", turnInFlight: _ = !1, onStop: Ue, turnId: We, modeDisabledReason: Ge = null, inputRef: v, aboveCard: Ke, viewSwitch: qe, modeReadOnly: Je = !1, voiceSessionActive: y = !1, concealed: Ye = !1 }) => {
36
+ let b = r(), Xe = be(), { locale: x } = n(), S = je || Me, C = He === "compact", w = l(null), Ze = o((e) => {
37
+ w.current = e, typeof v == "function" ? v(e) : v && (v.current = e);
38
+ }, [v]), [T, E] = u(""), [D, Qe] = u(!1), [O, $e] = u(!1), et = l(!1), [tt, k] = u(null), [nt, A] = u(null), [j, M] = u(null), [rt, it] = u(_);
39
+ rt === _ ? j !== null && _ && We != null && We !== j && M(null) : (it(_), _ ? (A(null), M(null)) : j !== null && (A(j), M(null)));
40
+ let at = l(!1), N = l(null), ot = l(!1), st = l(!1), ct = l(null), P = l(!1), F = l(0), { attachments: I, isBusy: lt, preparingCount: ut, sendBlocker: dt, rejection: ft, addFiles: L, remove: pt, retry: mt, clear: ht, clearRejection: gt, canAddMore: _t, commit: vt, cancelCommit: yt } = re({ perFileChars: Fe }), R = T.trim() !== "" || I.length > 0, bt = l(!1), z = l(!1);
41
+ s(() => {
42
+ R && !bt.current ? (bt.current = !0, Re?.()) : R || (bt.current = !1);
43
+ }, [R, Re]), s(() => {
44
+ R || (z.current = !1), ze?.({
45
+ text: T,
46
+ hasAttachments: I.length > 0,
47
+ dictated: z.current
46
48
  });
47
49
  }, [
48
- D,
49
- V.length,
50
- U,
51
- Pe
50
+ T,
51
+ I.length,
52
+ R,
53
+ ze
52
54
  ]);
53
- let ft = s((e) => {
54
- dt.current = !0, O((t) => t ? `${t.replace(/\s+$/, "")} ${e}` : e);
55
- }, []), pt = a((e) => e.assistantLanguage), mt = ye(() => ee(pt, C), [pt, C]), W = te({
56
- onFinalize: ft,
57
- language: mt.tag
58
- }), G = W.isActive, ht = W.interim, gt = W.stop;
59
- c(() => {
60
- Fe && G && (ht.trim() !== "" && ft(ht.trim()), gt());
55
+ let B = o((e) => {
56
+ z.current = !0, E((t) => t ? `${t.replace(/\s+$/, "")} ${e}` : e);
57
+ }, []), xt = te((e) => e.assistantLanguage), St = Se(() => ee(xt, x), [xt, x]), V = ne({
58
+ onFinalize: B,
59
+ language: St.tag
60
+ }), H = V.isActive, Ct = V.interim, wt = V.stop;
61
+ s(() => {
62
+ Be && H && (Ct.trim() !== "" && B(Ct.trim()), wt());
61
63
  }, [
62
- Fe,
63
- G,
64
- ht,
65
- gt,
66
- ft
67
- ]), c(() => {
68
- Ie?.({
69
- committing: j,
70
- dictating: G
64
+ Be,
65
+ H,
66
+ Ct,
67
+ wt,
68
+ B
69
+ ]), s(() => {
70
+ Ve?.({
71
+ committing: O,
72
+ dictating: H
71
73
  });
72
74
  }, [
73
- Ie,
74
- j,
75
- G
75
+ Ve,
76
+ O,
77
+ H
76
78
  ]);
77
- let _t = o((e) => e.pending), vt = _t ? S("askAbout.placeholder", "Ask about {{name}}…", { name: _t.label }) : Oe ?? S("composer.placeholder", "Ask me anything…"), yt = o((e) => e.focusRequested), bt = (e) => {
78
- O(e), requestAnimationFrame(() => {
79
- let t = E.current;
79
+ let U = l(null), Tt = o(() => {
80
+ U.current = {
81
+ text: T,
82
+ dictated: z.current
83
+ }, V.start();
84
+ }, [T, V]), W = o(() => {
85
+ w.current?.focus();
86
+ }, []), Et = o(() => {
87
+ let e = V.interim.trim();
88
+ e !== "" && B(e), V.stop(), U.current = null, W();
89
+ }, [
90
+ V,
91
+ B,
92
+ W
93
+ ]), Dt = o(() => {
94
+ let e = U.current;
95
+ V.stop(), U.current = null, e && (E(e.text), z.current = e.dictated), W();
96
+ }, [V, W]);
97
+ s(() => {
98
+ H || (U.current = null);
99
+ }, [H]);
100
+ let [Ot, kt] = u(0), G = V.isListening, [At, jt] = u(G);
101
+ At !== G && (jt(G), kt(0)), s(() => {
102
+ if (!G) return;
103
+ let e = Date.now(), t = setInterval(() => {
104
+ kt(Math.floor((Date.now() - e) / 1e3));
105
+ }, 1e3);
106
+ return () => clearInterval(t);
107
+ }, [G]);
108
+ let Mt = pe({
109
+ active: C && G,
110
+ mic: !0,
111
+ pulseKey: V.interim
112
+ }), Nt = a((e) => e.pending), Pt = Nt ? b("askAbout.placeholder", "Ask about {{name}}…", { name: Nt.label }) : Ne ?? b("composer.placeholder", "Ask me anything…"), Ft = a((e) => e.focusRequested), It = (e) => {
113
+ E(e), requestAnimationFrame(() => {
114
+ let t = w.current;
80
115
  t && (t.focus({ preventScroll: !0 }), t.setSelectionRange(e.length, e.length));
81
116
  });
82
117
  };
83
- c(() => {
84
- if (!yt || w) return;
85
- let e = E.current;
86
- e && (e.focus({ preventScroll: !0 }), o.getState().actions.composerFocused());
87
- }, [yt, w]);
88
- let K = D.trim(), q = re(V), xt = V.filter((e) => e.status === "error"), J = (K.length > 0 || q.length > 0) && !w && !j && tt === null, St = q.some((e) => !(e.fileId && e.downloadUrl) && !e.inlineOnly), Ct = u(w);
89
- Ct.current = w;
90
- let Y = u(!0);
91
- c(() => (Y.current = !0, () => {
118
+ s(() => {
119
+ if (!Ft || S) return;
120
+ let e = w.current;
121
+ e && (e.focus({ preventScroll: !0 }), a.getState().actions.composerFocused());
122
+ }, [Ft, S]);
123
+ let K = T.trim(), q = ie(I), Lt = I.filter((e) => e.status === "error"), J = (K.length > 0 || q.length > 0) && !S && !O && dt === null, Rt = q.some((e) => !(e.fileId && e.downloadUrl) && !e.inlineOnly), zt = l(S);
124
+ zt.current = S;
125
+ let Y = l(!0);
126
+ s(() => (Y.current = !0, () => {
92
127
  Y.current = !1;
93
- }), []), ve(() => {
94
- let e = E.current;
95
- e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, Ce)}px`);
96
- }, [D]);
97
- let X = s(async () => {
98
- if (!J || M.current) return;
99
- W.isActive && W.stop();
100
- let e = D.trim();
101
- P(null);
102
- let t = T && we(Qe.current);
103
- if (!St) {
104
- z.current = t, h(e, q), O(""), at();
128
+ }), []), xe(() => {
129
+ let e = w.current;
130
+ e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, Oe)}px`);
131
+ }, [T]);
132
+ let X = o(async () => {
133
+ if (!J || et.current) return;
134
+ V.isActive && V.stop();
135
+ let e = T.trim();
136
+ k(null);
137
+ let t = C && ke(ct.current);
138
+ if (!Rt) {
139
+ P.current = t, m(e, q), E(""), ht();
105
140
  return;
106
141
  }
107
- let n = a.getState().activeConversationId;
108
- M.current = !0, Ge(!0);
142
+ let n = te.getState().activeConversationId;
143
+ et.current = !0, $e(!0);
109
144
  try {
110
- let r = await ct();
145
+ let r = await vt();
111
146
  if (!Y.current) {
112
147
  r.ok && await r.rollback();
113
148
  return;
114
149
  }
115
150
  if (!r.ok) {
116
- r.cancelled || P({
151
+ r.cancelled || k({
117
152
  kind: "failed",
118
153
  failures: r.failures
119
154
  });
120
155
  return;
121
156
  }
122
- if (Ct.current) {
123
- await r.rollback(), Y.current && P({
157
+ if (zt.current) {
158
+ await r.rollback(), Y.current && k({
124
159
  kind: "busy",
125
160
  failures: []
126
161
  });
127
162
  return;
128
163
  }
129
- let i = a.getState();
164
+ let i = te.getState();
130
165
  if (i.activeConversationId !== n || n !== null && !i.conversations.some((e) => e.id === n)) {
131
- await r.rollback(), Y.current && P({
166
+ await r.rollback(), Y.current && k({
132
167
  kind: "moved",
133
168
  failures: []
134
169
  });
135
170
  return;
136
171
  }
137
- z.current = t, h(e, re(r.attachments)), r.handedOver(), O(""), at();
172
+ P.current = t, m(e, ie(r.attachments)), r.handedOver(), E(""), ht();
138
173
  } finally {
139
- M.current = !1, Y.current && Ge(!1);
174
+ et.current = !1, Y.current && $e(!1);
140
175
  }
141
176
  }, [
142
177
  J,
143
- St,
144
- ct,
145
- h,
146
- D,
178
+ Rt,
179
+ vt,
180
+ m,
181
+ T,
147
182
  q,
148
- at,
149
- W,
150
- T
151
- ]), wt = s(() => {
152
- lt(), E.current?.focus();
153
- }, [lt]), Z = s(() => {
154
- Ct.current ? Ye.current = !0 : E.current?.focus();
155
- }, []), Tt = s(() => {
156
- if (Ze.current) return;
157
- let e = y?.() ?? null;
158
- e !== null && (Ze.current = !0, L(e)), Z();
159
- }, [y, Z]);
160
- c(() => {
161
- !w && Ye.current && (Ye.current = !1, E.current?.focus());
162
- }, [w]);
163
- let Et = s((e) => {
183
+ ht,
184
+ V,
185
+ C
186
+ ]), Bt = o(() => {
187
+ yt(), w.current?.focus();
188
+ }, [yt]), Z = o(() => {
189
+ zt.current ? at.current = !0 : w.current?.focus();
190
+ }, []), Vt = o(() => {
191
+ if (st.current) return;
192
+ let e = Ue?.() ?? null;
193
+ e !== null && (st.current = !0, M(e)), Z();
194
+ }, [Ue, Z]);
195
+ s(() => {
196
+ !S && at.current && (at.current = !1, w.current?.focus());
197
+ }, [S]);
198
+ let Ht = o((e) => {
164
199
  if (e !== null) {
165
- R.current = e;
200
+ N.current = e;
166
201
  return;
167
202
  }
168
- let t = R.current;
169
- R.current = null, t !== null && t.ownerDocument.activeElement === t && (Xe.current = !0);
170
- }, []), Q = T && v && y !== void 0;
171
- ve(() => {
172
- !Q && Xe.current && (Xe.current = !1, Z());
173
- }, [Q, Z]), c(() => {
174
- I === null && (Ze.current = !1);
175
- }, [I]), ve(() => {
203
+ let t = N.current;
204
+ N.current = null, t !== null && t.ownerDocument.activeElement === t && (ot.current = !0);
205
+ }, []), Q = C && _ && Ue !== void 0;
206
+ xe(() => {
207
+ !Q && ot.current && (ot.current = !1, Z());
208
+ }, [Q, Z]), s(() => {
209
+ j === null && (st.current = !1);
210
+ }, [j]), xe(() => {
176
211
  if (!Q) return;
177
- let e = z.current;
178
- if (z.current = !1, !e) return;
179
- let t = R.current;
212
+ let e = P.current;
213
+ if (P.current = !1, !e) return;
214
+ let t = N.current;
180
215
  if (t === null) return;
181
216
  let n = t.ownerDocument, r = n.activeElement;
182
- (r === null || r === n.body || r === E.current) && t.focus({ preventScroll: !0 });
217
+ (r === null || r === n.body || r === w.current) && t.focus({ preventScroll: !0 });
183
218
  }, [Q]);
184
- let Dt = s((e) => {
185
- O(e), F(null);
219
+ let Ut = o((e) => {
220
+ E(e), A(null);
186
221
  }, []);
187
- c(() => {
188
- P(null);
189
- }, [V.length]);
190
- let Ot = (t) => {
191
- if (t.kind === "busy") return S("attachments.saveBusy", "The assistant started another reply, so nothing was sent. Your message and files are still here.");
192
- if (t.kind === "moved") return S("attachments.saveMoved", "You switched conversations while the files were being saved, so nothing was sent. Your message and files are still here.");
222
+ s(() => {
223
+ k(null);
224
+ }, [I.length]);
225
+ let Wt = (t) => {
226
+ if (t.kind === "busy") return b("attachments.saveBusy", "The assistant started another reply, so nothing was sent. Your message and files are still here.");
227
+ if (t.kind === "moved") return b("attachments.saveMoved", "You switched conversations while the files were being saved, so nothing was sent. Your message and files are still here.");
193
228
  let { failures: n } = t;
194
- if (n.some((e) => e.code === ie.editorAccessRequired)) return e(S, C);
195
- if (n.some((e) => e.code === ie.quotaExceeded || e.code === ie.quotaNotProvisioned)) return `${S("attachments.quotaFull", "File storage is full or not set up for this workspace, so the attachments couldn't be saved. Nothing was sent.")} ${S("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
196
- let r = n[0], i = V.find((e) => e.id === r?.id)?.filename ?? "";
197
- return `${n.length <= 1 ? S("attachments.saveFailedOne", "{{name}} couldn't be saved, so nothing was sent.", { name: i }) : S("attachments.saveFailedMany", "{{count}} attachments couldn't be saved, so nothing was sent.", { count: n.length })} ${S("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
198
- }, kt = s((e) => {
229
+ if (n.some((e) => e.code === ae.editorAccessRequired)) return e(b, x);
230
+ if (n.some((e) => e.code === ae.quotaExceeded || e.code === ae.quotaNotProvisioned)) return `${b("attachments.quotaFull", "File storage is full or not set up for this workspace, so the attachments couldn't be saved. Nothing was sent.")} ${b("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
231
+ let r = n[0], i = I.find((e) => e.id === r?.id)?.filename ?? "";
232
+ return `${n.length <= 1 ? b("attachments.saveFailedOne", "{{name}} couldn't be saved, so nothing was sent.", { name: i }) : b("attachments.saveFailedMany", "{{count}} attachments couldn't be saved, so nothing was sent.", { count: n.length })} ${b("attachments.retrySend", "Press Send to try again, or remove the file.")}`;
233
+ }, Gt = o((e) => {
199
234
  e.key === "Enter" && !e.shiftKey && (e.preventDefault(), X());
200
- }, [X]), At = s((e) => {
201
- e.key === "Escape" ? he(e) && e.stopPropagation() : me(e) && (e.preventDefault(), F(null), X());
202
- }, [X]), jt = s((e) => {
235
+ }, [X]), Kt = o((e) => {
236
+ e.key === "Escape" ? ve(e) && e.stopPropagation() : _e(e) && (e.preventDefault(), A(null), X());
237
+ }, [X]), qt = o((e) => {
203
238
  let t = Array.from(e.clipboardData?.files ?? []);
204
- t.length !== 0 && (e.preventDefault(), H(t));
205
- }, [H]), Mt = s((e) => {
206
- Array.from(e.dataTransfer?.types ?? []).includes("Files") && (B.current += 1, A(!0));
207
- }, []), Nt = s(() => {
208
- B.current = Math.max(0, B.current - 1), B.current === 0 && A(!1);
209
- }, []), Pt = s((e) => {
239
+ t.length !== 0 && (e.preventDefault(), L(t));
240
+ }, [L]), Jt = o((e) => {
241
+ Array.from(e.dataTransfer?.types ?? []).includes("Files") && (F.current += 1, Qe(!0));
242
+ }, []), Yt = o(() => {
243
+ F.current = Math.max(0, F.current - 1), F.current === 0 && Qe(!1);
244
+ }, []), Xt = o((e) => {
210
245
  Array.from(e.dataTransfer?.types ?? []).includes("Files") && e.preventDefault();
211
- }, []), Ft = s((e) => {
212
- e.preventDefault(), B.current = 0, A(!1), H(e.dataTransfer?.files ?? null);
213
- }, [H]), It = (e) => {
246
+ }, []), Zt = o((e) => {
247
+ e.preventDefault(), F.current = 0, Qe(!1), L(e.dataTransfer?.files ?? null);
248
+ }, [L]), Qt = (e) => {
214
249
  switch (e) {
215
- case "too-many": return S("attachments.tooMany", "You can attach up to {{max}} files per message.", { max: 5 });
216
- case "too-large": return S("attachments.tooLarge", "That file is larger than 10 MB.");
217
- case "empty": return S("attachments.empty", "That file is empty.");
218
- case "unreadable": return S("attachments.unreadable", "That file could not be read.");
219
- case "unsupported-image": return S("attachments.unsupportedImage", "This device can't read that image format, so it can't be resized to send. Save it as JPEG and try again.");
220
- case "too-large-to-save": return S("attachments.tooLargeToSave", "That file is over 5 MB, so it can't be saved to Files, and no text could be read from it.");
250
+ case "too-many": return b("attachments.tooMany", "You can attach up to {{max}} files per message.", { max: 5 });
251
+ case "too-large": return b("attachments.tooLarge", "That file is larger than 10 MB.");
252
+ case "empty": return b("attachments.empty", "That file is empty.");
253
+ case "unreadable": return b("attachments.unreadable", "That file could not be read.");
254
+ case "unsupported-image": return b("attachments.unsupportedImage", "This device can't read that image format, so it can't be resized to send. Save it as JPEG and try again.");
255
+ case "too-large-to-save": return b("attachments.tooLargeToSave", "That file is over 5 MB, so it can't be saved to Files, and no text could be read from it.");
221
256
  }
222
257
  }, $ = (() => {
223
- switch (W.error) {
224
- case "not-allowed": return S("voice.denied", "Microphone access is blocked. Allow it in your browser settings to dictate.");
225
- case "audio-capture": return S("voice.noMic", "No microphone was found.");
226
- case "network": return S("voice.network", "Speech recognition is offline right now.");
227
- case "language-not-supported": return S("voice.languageNotSupported", "This browser cannot recognise spoken {{language}}. Try a different browser, or type instead.", { language: i(W.language, C) });
228
- case "unknown": return S("voice.failed", "Dictation stopped unexpectedly.");
258
+ switch (V.error) {
259
+ case "not-allowed": return b("voice.denied", "Microphone access is blocked. Allow it in your browser settings to dictate.");
260
+ case "audio-capture": return b("voice.noMic", "No microphone was found.");
261
+ case "network": return b("voice.network", "Speech recognition is offline right now.");
262
+ case "language-not-supported": return b("voice.languageNotSupported", "This browser cannot recognise spoken {{language}}. Try a different browser, or type instead.", { language: i(V.language, x) });
263
+ case "unknown": return b("voice.failed", "Dictation stopped unexpectedly.");
229
264
  default: return null;
230
265
  }
231
- })(), Lt = (e, n) => j ? /* @__PURE__ */ p(t, {
232
- onDismiss: wt,
233
- children: /* @__PURE__ */ m("p", {
266
+ })(), $t = (e, n, r = !1) => O ? /* @__PURE__ */ f(t, {
267
+ onDismiss: Bt,
268
+ children: /* @__PURE__ */ p("p", {
234
269
  className: "flex items-center justify-center gap-2 text-text-muted",
235
270
  "data-testid": "assistant-commit-status",
236
271
  children: [
237
- /* @__PURE__ */ p(f, {
272
+ /* @__PURE__ */ f(d, {
238
273
  className: "size-3 motion-safe:animate-spin",
239
274
  "aria-hidden": "true"
240
275
  }),
241
- /* @__PURE__ */ p("span", { children: S("attachments.saving", "Saving your attachments…") }),
242
- /* @__PURE__ */ p("button", {
276
+ /* @__PURE__ */ f("span", { children: b("attachments.saving", "Saving your attachments…") }),
277
+ /* @__PURE__ */ f("button", {
243
278
  type: "button",
244
- onClick: wt,
279
+ onClick: Bt,
245
280
  className: "rounded text-text-primary underline underline-offset-2 hover:text-action-primary-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong",
246
281
  "data-testid": "assistant-commit-cancel",
247
- children: S("attachments.cancelSaving", "Cancel")
282
+ children: b("attachments.cancelSaving", "Cancel")
248
283
  })
249
284
  ]
250
285
  })
251
- }) : N ? /* @__PURE__ */ p("p", {
286
+ }) : tt ? /* @__PURE__ */ f("p", {
252
287
  className: "text-status-error-text",
253
288
  role: "alert",
254
289
  "data-testid": "assistant-commit-failed",
255
- children: Ot(N)
256
- }) : W.isStarting && !W.isListening ? /* @__PURE__ */ p("p", {
290
+ children: Wt(tt)
291
+ }) : !r && V.isStarting && !V.isListening ? /* @__PURE__ */ f("p", {
257
292
  className: "text-text-muted",
258
293
  "data-testid": "assistant-voice-starting",
259
- children: S("voice.starting", "Starting the microphone…")
260
- }) : W.isListening ? /* @__PURE__ */ m("p", {
294
+ children: b("voice.starting", "Starting the microphone…")
295
+ }) : !r && V.isListening ? /* @__PURE__ */ p("p", {
261
296
  className: "text-status-error-text",
262
297
  "data-testid": "assistant-voice-status",
263
- children: [/* @__PURE__ */ p(le, {}), W.interim || S("voice.listening", "Listening… speak now, tap the square to stop")]
264
- }) : $ ? /* @__PURE__ */ p("p", {
298
+ children: [/* @__PURE__ */ f(ue, {}), V.interim || b("voice.listening", "Listening… speak now, tap the square to stop")]
299
+ }) : $ ? /* @__PURE__ */ f("p", {
265
300
  className: "text-status-error-text",
266
301
  "data-testid": "assistant-voice-error",
267
302
  children: $
268
- }) : nt ? /* @__PURE__ */ p("button", {
303
+ }) : ft ? /* @__PURE__ */ f("button", {
269
304
  type: "button",
270
- onClick: ot,
305
+ onClick: gt,
271
306
  className: "text-status-error-text underline-offset-2 hover:underline",
272
307
  "data-testid": "assistant-attachment-rejection",
273
- children: It(nt)
274
- }) : tt === "failed" ? /* @__PURE__ */ p("p", {
308
+ children: Qt(ft)
309
+ }) : dt === "failed" ? /* @__PURE__ */ f("p", {
275
310
  className: "text-status-error-text",
276
311
  "data-testid": "assistant-attachment-blocked",
277
- children: xt.length === 1 ? S("attachments.blockedOne", "{{name}} didn't upload. Retry or remove it before sending.", { name: xt[0].filename }) : S("attachments.blockedMany", "{{count}} attachments didn't upload. Retry or remove them before sending.", { count: xt.length })
278
- }) : n ? /* @__PURE__ */ p("p", {
312
+ children: Lt.length === 1 ? b("attachments.blockedOne", "{{name}} didn't upload. Retry or remove it before sending.", { name: Lt[0].filename }) : b("attachments.blockedMany", "{{count}} attachments didn't upload. Retry or remove them before sending.", { count: Lt.length })
313
+ }) : n ? /* @__PURE__ */ f("p", {
279
314
  className: "text-text-muted",
280
315
  "data-testid": "assistant-stopping-status",
281
- children: S("composer.stopping", "Stopping the reply…")
282
- }) : e ? /* @__PURE__ */ p("p", {
316
+ children: b("composer.stopping", "Stopping the reply…")
317
+ }) : e ? /* @__PURE__ */ f("p", {
283
318
  className: "text-text-muted",
284
319
  "data-testid": "assistant-stop-status",
285
- children: S("composer.stopped", "Reply stopped.")
286
- }) : /* @__PURE__ */ p("p", {
320
+ children: b("composer.stopped", "Reply stopped.")
321
+ }) : /* @__PURE__ */ f("p", {
287
322
  className: "text-text-muted",
288
- children: S("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach")
323
+ children: b("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach")
289
324
  });
290
- if (T) {
291
- let e = _ !== void 0 && K.length === 0 && V.length === 0 && !W.isActive, t = S("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach"), n = !!(j || N || W.isStarting || W.isListening || $ || nt || tt === "failed" || Ke !== null || I !== null), r = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-elevated)]";
292
- return /* @__PURE__ */ p(Te, { children: (i) => /* @__PURE__ */ m("div", {
293
- ref: Qe,
294
- className: Ue ? `flex-shrink-0 px-3 pt-1.5 ${ge}` : "flex-shrink-0 px-3 pt-1.5",
325
+ if (C) {
326
+ let e = g !== void 0 && K.length === 0 && I.length === 0 && !V.isActive, t = b("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach"), n = V.isSupported && V.isActive && !y, r = !!(O || tt || $ || ft || dt === "failed" || nt !== null || j !== null), i = "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--color-bg-elevated)]";
327
+ return /* @__PURE__ */ f(Ae, { children: (ee) => /* @__PURE__ */ p("div", {
328
+ ref: ct,
329
+ className: `${Xe ? `flex-shrink-0 px-3 pt-1.5 ${ye}` : "flex-shrink-0 px-3 pt-1.5"}${Ye ? " hidden" : ""}`,
295
330
  children: [
296
- Be,
297
- Ve ? /* @__PURE__ */ p(pe, {
298
- voiceLive: x,
299
- children: Ve
331
+ Ke,
332
+ qe ? /* @__PURE__ */ f(ge, {
333
+ voiceLive: y,
334
+ children: qe
300
335
  }) : null,
301
- /* @__PURE__ */ m("div", {
302
- className: n || l ? "mb-1.5 px-1 text-center text-xs" : "",
336
+ /* @__PURE__ */ p("div", {
337
+ className: r || c ? "mb-1.5 px-1 text-center text-xs" : "",
303
338
  "aria-live": "polite",
304
339
  "data-testid": "assistant-composer-status",
305
- children: [l ? /* @__PURE__ */ p("p", {
306
- className: "text-status-warning",
307
- "data-testid": "assistant-write-access-warning",
308
- children: S("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
309
- }) : null, n ? Lt(Ke !== null, I !== null) : null]
340
+ children: [
341
+ c ? /* @__PURE__ */ f("p", {
342
+ className: "text-status-warning",
343
+ "data-testid": "assistant-write-access-warning",
344
+ children: b("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
345
+ }) : null,
346
+ r ? $t(nt !== null, j !== null, !0) : null,
347
+ n && V.isListening ? /* @__PURE__ */ f("span", {
348
+ className: "sr-only",
349
+ "data-testid": "assistant-dictation-announced",
350
+ children: b("voiceSession.listening", "Listening…")
351
+ }) : null
352
+ ]
310
353
  }),
311
- /* @__PURE__ */ p("p", {
312
- id: i,
354
+ /* @__PURE__ */ f("p", {
355
+ id: ee,
313
356
  hidden: !0,
314
357
  "data-testid": "assistant-composer-hint",
315
358
  children: t
316
359
  }),
317
- /* @__PURE__ */ m("div", {
318
- onDragEnter: Mt,
319
- onDragLeave: Nt,
320
- onDragOver: Pt,
321
- onDrop: Ft,
322
- className: `flex flex-col rounded-3xl border transition-colors focus-within:border-[var(--color-focus-ring)] focus-within:ring-1 focus-within:ring-[var(--color-focus-ring)] ${He ? "bg-bg-surface" : "bg-bg-elevated"} ${k ? "border-dashed border-[var(--color-focus-ring)]" : "border-[var(--color-text-muted)]"}`,
360
+ /* @__PURE__ */ p("div", {
361
+ onDragEnter: Jt,
362
+ onDragLeave: Yt,
363
+ onDragOver: Xt,
364
+ onDrop: Zt,
365
+ className: `flex flex-col rounded-3xl border transition-colors focus-within:border-[var(--color-focus-ring)] focus-within:ring-1 focus-within:ring-[var(--color-focus-ring)] ${Je ? "bg-bg-surface" : "bg-bg-elevated"} ${D ? "border-dashed border-[var(--color-focus-ring)]" : "border-[var(--color-text-muted)]"}`,
323
366
  "data-testid": "assistant-composer",
324
367
  "data-presentation": "compact",
325
368
  children: [
326
- /* @__PURE__ */ p("div", {
369
+ /* @__PURE__ */ f("div", {
327
370
  className: "px-3 pt-3 empty:hidden",
328
- children: /* @__PURE__ */ m(Se, { children: [/* @__PURE__ */ p(se, {
329
- disabled: j,
371
+ children: /* @__PURE__ */ p(De, { children: [/* @__PURE__ */ f(ce, {
372
+ disabled: O,
330
373
  showSuggestions: K.length === 0,
331
- onSuggest: bt
332
- }), /* @__PURE__ */ p(oe, {
333
- attachments: V,
334
- onRemove: rt,
335
- onRetry: it,
336
- disabled: w || j,
337
- preparingCount: et
374
+ onSuggest: It
375
+ }), /* @__PURE__ */ f(se, {
376
+ attachments: I,
377
+ onRemove: pt,
378
+ onRetry: mt,
379
+ disabled: S || O,
380
+ preparingCount: ut
338
381
  })] })
339
382
  }),
340
- /* @__PURE__ */ p("textarea", {
341
- ref: We,
342
- value: D,
343
- onChange: (e) => Dt(e.target.value),
344
- onKeyDown: At,
345
- onPaste: jt,
346
- disabled: w,
347
- readOnly: j,
348
- "aria-busy": j || void 0,
349
- placeholder: k ? S("composer.dropHere", "Drop files to attach") : vt,
383
+ /* @__PURE__ */ f("textarea", {
384
+ ref: Ze,
385
+ value: T,
386
+ onChange: (e) => Ut(e.target.value),
387
+ onKeyDown: Kt,
388
+ onPaste: qt,
389
+ disabled: S,
390
+ readOnly: O,
391
+ "aria-busy": O || void 0,
392
+ placeholder: D ? b("composer.dropHere", "Drop files to attach") : Pt,
350
393
  rows: 1,
351
394
  className: "min-h-10 w-full resize-none bg-transparent px-4 pb-1 pt-3 text-base leading-6 text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50",
352
- "aria-describedby": i,
395
+ "aria-describedby": ee,
353
396
  title: t,
354
- "aria-label": S("chatInput.ariaLabel", "Message input"),
397
+ "aria-label": b("chatInput.ariaLabel", "Message input"),
355
398
  "data-testid": "assistant-input"
356
399
  }),
357
- /* @__PURE__ */ m("div", {
400
+ n && V.interim ? /* @__PURE__ */ f("p", {
401
+ className: "-mt-1 line-clamp-2 px-4 pb-1 text-base leading-6 text-text-muted",
402
+ "aria-hidden": "true",
403
+ "data-testid": "assistant-dictation-interim",
404
+ children: V.interim
405
+ }) : null,
406
+ n ? /* @__PURE__ */ p("div", {
407
+ className: "flex flex-nowrap items-center gap-2 px-1.5 pb-1.5 pt-1",
408
+ "data-testid": "assistant-composer-controls",
409
+ "data-dictating": "true",
410
+ children: [
411
+ /* @__PURE__ */ f("button", {
412
+ type: "button",
413
+ onClick: Dt,
414
+ className: "flex size-11 shrink-0 items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] sm:size-10",
415
+ "aria-label": b("composer.dictationCancel", "Cancel dictation"),
416
+ title: b("composer.dictationCancel", "Cancel dictation"),
417
+ "data-testid": "assistant-voice-cancel",
418
+ children: /* @__PURE__ */ f(Ee, {
419
+ className: "size-5",
420
+ "aria-hidden": "true"
421
+ })
422
+ }),
423
+ V.isListening ? /* @__PURE__ */ f(fe, {
424
+ source: Mt,
425
+ tone: "listening",
426
+ className: "h-8 flex-1",
427
+ testId: "assistant-dictation-waveform"
428
+ }) : /* @__PURE__ */ f("p", {
429
+ className: "min-w-0 flex-1 truncate text-sm text-text-muted",
430
+ "data-testid": "assistant-voice-starting",
431
+ children: b("voice.starting", "Starting the microphone…")
432
+ }),
433
+ /* @__PURE__ */ f("span", {
434
+ className: "shrink-0 text-xs tabular-nums text-text-muted",
435
+ "aria-hidden": "true",
436
+ "data-testid": "assistant-dictation-time",
437
+ children: `${Math.floor(Ot / 60)}:${String(Ot % 60).padStart(2, "0")}`
438
+ }),
439
+ /* @__PURE__ */ f("button", {
440
+ type: "button",
441
+ onClick: Et,
442
+ className: `flex size-11 shrink-0 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover sm:size-10 ${i}`,
443
+ "aria-label": b("composer.dictationDone", "Finish dictation"),
444
+ title: b("composer.dictationDone", "Finish dictation"),
445
+ "aria-pressed": "true",
446
+ "data-testid": "assistant-voice",
447
+ "data-state": V.isListening ? "listening" : "starting",
448
+ children: /* @__PURE__ */ f(we, {
449
+ className: "size-5",
450
+ "aria-hidden": "true"
451
+ })
452
+ })
453
+ ]
454
+ }) : /* @__PURE__ */ p("div", {
358
455
  className: "flex flex-nowrap items-center gap-1 px-1.5 pb-1.5 pt-1",
359
456
  "data-testid": "assistant-composer-controls",
360
457
  children: [
361
- /* @__PURE__ */ p(ae, {
362
- onFiles: H,
363
- canAddMore: st,
364
- disabled: w || j,
458
+ /* @__PURE__ */ f(oe, {
459
+ onFiles: L,
460
+ canAddMore: _t,
461
+ disabled: S || O,
365
462
  compact: !0,
366
463
  capMenuHeight: !0
367
464
  }),
368
- /* @__PURE__ */ p(fe, {
465
+ /* @__PURE__ */ f(he, {
369
466
  chip: !0,
370
- readOnly: He,
371
- mode: ke,
372
- availableModes: g,
373
- onModeChange: je,
374
- auto: Me,
375
- disabled: w || j,
376
- disabledReason: I === null ? v ? "replying" : ze ?? "busy" : "busy"
467
+ readOnly: Je,
468
+ mode: Pe,
469
+ availableModes: h,
470
+ onModeChange: Ie,
471
+ auto: Le,
472
+ disabled: S || O,
473
+ disabledReason: j === null ? _ ? "replying" : Ge ?? "busy" : "busy"
377
474
  }),
378
- /* @__PURE__ */ p("div", { className: "min-w-0 flex-1" }),
379
- W.isSupported && !x && /* @__PURE__ */ p(ce, {
475
+ /* @__PURE__ */ f("div", { className: "min-w-0 flex-1" }),
476
+ V.isSupported && !y && /* @__PURE__ */ f(le, {
380
477
  compact: !0,
381
- isListening: W.isListening,
382
- isStarting: W.isStarting,
383
- onToggle: W.toggle,
384
- disabled: w || j
478
+ isListening: V.isListening,
479
+ isStarting: V.isStarting,
480
+ onToggle: Tt,
481
+ disabled: S || O
385
482
  }),
386
- Q ? /* @__PURE__ */ p("button", {
387
- ref: Et,
483
+ Q ? /* @__PURE__ */ f("button", {
484
+ ref: Ht,
388
485
  type: "button",
389
- onClick: Tt,
390
- className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover ${r} ${I === null ? "" : "cursor-default opacity-60"}`,
391
- "aria-label": I === null ? S("composer.stop", "Stop the reply") : S("composer.stopping", "Stopping the reply…"),
392
- title: I === null ? S("composer.stop", "Stop the reply") : S("composer.stopping", "Stopping the reply…"),
393
- "aria-disabled": I === null ? void 0 : "true",
394
- "aria-busy": I === null ? void 0 : "true",
486
+ onClick: Vt,
487
+ className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover ${i} ${j === null ? "" : "cursor-default opacity-60"}`,
488
+ "aria-label": j === null ? b("composer.stop", "Stop the reply") : b("composer.stopping", "Stopping the reply…"),
489
+ title: j === null ? b("composer.stop", "Stop the reply") : b("composer.stopping", "Stopping the reply…"),
490
+ "aria-disabled": j === null ? void 0 : "true",
491
+ "aria-busy": j === null ? void 0 : "true",
395
492
  "data-testid": "assistant-stop",
396
- children: I === null ? /* @__PURE__ */ p(xe, {
493
+ children: j === null ? /* @__PURE__ */ f(Te, {
397
494
  className: "size-4 fill-current",
398
495
  "aria-hidden": "true"
399
- }) : /* @__PURE__ */ p(f, {
496
+ }) : /* @__PURE__ */ f(d, {
400
497
  className: "size-4 motion-safe:animate-spin",
401
498
  "aria-hidden": "true"
402
499
  })
403
- }) : e ? /* @__PURE__ */ p(ue, {
500
+ }) : e ? /* @__PURE__ */ f(de, {
404
501
  compact: !0,
405
- invisible: x,
406
- onStart: _,
407
- disabled: w || j
408
- }) : /* @__PURE__ */ p("button", {
502
+ invisible: y,
503
+ onStart: g,
504
+ disabled: S || O
505
+ }) : /* @__PURE__ */ f("button", {
409
506
  type: "button",
410
507
  onClick: () => {
411
- F(null), X();
508
+ A(null), X();
412
509
  },
413
510
  disabled: !J,
414
- className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full transition-colors ${r} ${J ? "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover" : "bg-[var(--color-bg-disabled)] text-[var(--color-text-disabled)]"}`,
415
- "aria-label": S("chatInput.send", "Send message"),
511
+ className: `flex size-11 sm:size-10 flex-shrink-0 items-center justify-center rounded-full transition-colors ${i} ${J ? "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover" : "bg-[var(--color-bg-disabled)] text-[var(--color-text-disabled)]"}`,
512
+ "aria-label": b("chatInput.send", "Send message"),
416
513
  "data-testid": "assistant-send",
417
- children: Ee || $e || j ? /* @__PURE__ */ p(f, {
514
+ children: je || lt || O ? /* @__PURE__ */ f(d, {
418
515
  className: "size-5 motion-safe:animate-spin",
419
516
  "aria-hidden": "true"
420
- }) : /* @__PURE__ */ p(be, {
517
+ }) : /* @__PURE__ */ f(Ce, {
421
518
  className: "size-5",
422
519
  "aria-hidden": "true"
423
520
  })
@@ -429,95 +526,95 @@ var Te = ({ children: e }) => e(l()), h = ({ writeAccessDenied: l = !1, onSend:
429
526
  ]
430
527
  }) });
431
528
  }
432
- return /* @__PURE__ */ m("div", {
529
+ return /* @__PURE__ */ p("div", {
433
530
  className: "flex-shrink-0 px-3 pb-3 pt-1.5",
434
531
  children: [
435
- /* @__PURE__ */ m("div", {
436
- onDragEnter: Mt,
437
- onDragLeave: Nt,
438
- onDragOver: Pt,
439
- onDrop: Ft,
440
- className: `rounded-2xl border p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15 ${k ? "border-action-primary-bg border-dashed bg-action-primary-bg/5" : "border-border-default bg-bg-sunken"}`,
532
+ /* @__PURE__ */ p("div", {
533
+ onDragEnter: Jt,
534
+ onDragLeave: Yt,
535
+ onDragOver: Xt,
536
+ onDrop: Zt,
537
+ className: `rounded-2xl border p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15 ${D ? "border-action-primary-bg border-dashed bg-action-primary-bg/5" : "border-border-default bg-bg-sunken"}`,
441
538
  "data-testid": "assistant-composer",
442
539
  children: [
443
- /* @__PURE__ */ m(Se, { children: [/* @__PURE__ */ p(se, {
444
- disabled: j,
540
+ /* @__PURE__ */ p(De, { children: [/* @__PURE__ */ f(ce, {
541
+ disabled: O,
445
542
  showSuggestions: K.length === 0,
446
- onSuggest: bt
447
- }), /* @__PURE__ */ p(oe, {
448
- attachments: V,
449
- onRemove: rt,
450
- onRetry: it,
451
- disabled: w || j,
452
- preparingCount: et
543
+ onSuggest: It
544
+ }), /* @__PURE__ */ f(se, {
545
+ attachments: I,
546
+ onRemove: pt,
547
+ onRetry: mt,
548
+ disabled: S || O,
549
+ preparingCount: ut
453
550
  })] }),
454
- /* @__PURE__ */ m("div", {
551
+ /* @__PURE__ */ p("div", {
455
552
  className: "flex items-end gap-2",
456
553
  children: [
457
- /* @__PURE__ */ p(ae, {
458
- onFiles: H,
459
- canAddMore: st,
460
- disabled: w || j,
554
+ /* @__PURE__ */ f(oe, {
555
+ onFiles: L,
556
+ canAddMore: _t,
557
+ disabled: S || O,
461
558
  showLabel: !0
462
559
  }),
463
- /* @__PURE__ */ p("textarea", {
464
- ref: E,
465
- value: D,
466
- onChange: (e) => O(e.target.value),
467
- onKeyDown: kt,
468
- onPaste: jt,
469
- disabled: w,
470
- readOnly: j,
471
- "aria-busy": j || void 0,
472
- placeholder: k ? S("composer.dropHere", "Drop files to attach") : vt,
560
+ /* @__PURE__ */ f("textarea", {
561
+ ref: w,
562
+ value: T,
563
+ onChange: (e) => E(e.target.value),
564
+ onKeyDown: Gt,
565
+ onPaste: qt,
566
+ disabled: S,
567
+ readOnly: O,
568
+ "aria-busy": O || void 0,
569
+ placeholder: D ? b("composer.dropHere", "Drop files to attach") : Pt,
473
570
  rows: 1,
474
571
  className: "min-h-[36px] flex-1 resize-none self-center bg-transparent px-1 py-2 text-[15px] leading-relaxed text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50",
475
- "aria-label": S("chatInput.ariaLabel", "Message input"),
572
+ "aria-label": b("chatInput.ariaLabel", "Message input"),
476
573
  "data-testid": "assistant-input"
477
574
  }),
478
- W.isSupported && /* @__PURE__ */ p(ce, {
479
- isListening: W.isListening,
480
- isStarting: W.isStarting,
481
- onToggle: W.toggle,
482
- disabled: w || j
575
+ V.isSupported && /* @__PURE__ */ f(le, {
576
+ isListening: V.isListening,
577
+ isStarting: V.isStarting,
578
+ onToggle: V.toggle,
579
+ disabled: S || O
483
580
  }),
484
- _ && K.length === 0 && V.length === 0 && !W.isActive ? /* @__PURE__ */ p(ue, {
485
- onStart: _,
486
- disabled: w || j
487
- }) : /* @__PURE__ */ p("button", {
581
+ g && K.length === 0 && I.length === 0 && !V.isActive ? /* @__PURE__ */ f(de, {
582
+ onStart: g,
583
+ disabled: S || O
584
+ }) : /* @__PURE__ */ f("button", {
488
585
  type: "button",
489
586
  onClick: () => void X(),
490
587
  disabled: !J,
491
588
  className: `flex size-9 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${J ? "bg-action-primary-bg text-action-primary-text hover:scale-105 hover:bg-action-primary-bg-hover" : "bg-bg-elevated text-text-muted"}`,
492
- "aria-label": S("chatInput.send", "Send message"),
589
+ "aria-label": b("chatInput.send", "Send message"),
493
590
  "data-testid": "assistant-send",
494
- children: Ee || $e || j ? /* @__PURE__ */ p(f, { className: "size-4 motion-safe:animate-spin" }) : /* @__PURE__ */ p(be, { className: "size-4" })
591
+ children: je || lt || O ? /* @__PURE__ */ f(d, { className: "size-4 motion-safe:animate-spin" }) : /* @__PURE__ */ f(Ce, { className: "size-4" })
495
592
  })
496
593
  ]
497
594
  }),
498
- (g.length > 1 || g.some((e) => e.writeCapable)) && /* @__PURE__ */ p("div", {
595
+ (h.length > 1 || h.some((e) => e.writeCapable)) && /* @__PURE__ */ f("div", {
499
596
  className: "mt-2 px-0.5",
500
- children: /* @__PURE__ */ p(de, {
501
- mode: ke,
502
- availableModes: g,
503
- onModeChange: je,
504
- disabled: w || j,
505
- auto: Me
597
+ children: /* @__PURE__ */ f(me, {
598
+ mode: Pe,
599
+ availableModes: h,
600
+ onModeChange: Ie,
601
+ disabled: S || O,
602
+ auto: Le
506
603
  })
507
604
  })
508
605
  ]
509
606
  }),
510
- l ? /* @__PURE__ */ p("p", {
607
+ c ? /* @__PURE__ */ f("p", {
511
608
  className: "mt-1.5 px-1 text-center text-[11px] text-status-warning",
512
609
  "data-testid": "assistant-write-access-warning",
513
- children: S("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
610
+ children: b("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
514
611
  }) : null,
515
- /* @__PURE__ */ p("div", {
612
+ /* @__PURE__ */ f("div", {
516
613
  className: "mt-1.5 px-1 text-center text-[11px]",
517
614
  "aria-live": "polite",
518
- children: Lt(!1, !1)
615
+ children: $t(!1, !1)
519
616
  })
520
617
  ]
521
618
  });
522
619
  };
523
- export { h as AssistantComposer };
620
+ export { m as AssistantComposer };