@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.
- package/dist/shared/assistant/i18nManifest.d.ts +2 -0
- package/dist/shared/assistant/i18nManifest.js +2 -0
- package/dist/shared/assistant/index.d.ts +4 -0
- package/dist/shared/assistant/ui/AssistantChatArea.js +290 -277
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +6 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +425 -328
- package/dist/shared/assistant/ui/voice/AssistantPageVoiceBar.d.ts +64 -0
- package/dist/shared/assistant/ui/voice/AssistantPageVoiceBar.js +183 -0
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +9 -1
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +233 -187
- package/dist/shared/assistant/ui/voice/LiveWaveform.d.ts +31 -0
- package/dist/shared/assistant/ui/voice/LiveWaveform.js +52 -0
- package/dist/shared/assistant/ui/voice/useLiveLevel.d.ts +21 -0
- package/dist/shared/assistant/ui/voice/useLiveLevel.js +52 -0
- package/dist/shared/assistant/voice/liveLevel.d.ts +84 -0
- package/dist/shared/assistant/voice/liveLevel.js +75 -0
- package/dist/shared-assistant.js +387 -383
- package/package.json +1 -1
|
@@ -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
|
|
8
|
-
import { useVoiceInput as
|
|
9
|
-
import { useAssistantAttachments as
|
|
10
|
-
import { getSendableAttachments as
|
|
11
|
-
import { ATTACHMENT_COMMIT_CODES as
|
|
12
|
-
import { AssistantAttachmentButton as
|
|
13
|
-
import { AssistantAttachmentChips as
|
|
14
|
-
import { AssistantFocusChip as
|
|
15
|
-
import { useAskAboutStore as
|
|
16
|
-
import { AssistantVoiceButton as
|
|
17
|
-
import { AssistantVoiceSessionButton as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
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
|
|
28
|
-
function
|
|
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
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
}, [
|
|
37
|
-
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, [
|
|
42
|
-
|
|
43
|
-
text:
|
|
44
|
-
hasAttachments:
|
|
45
|
-
dictated:
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
T,
|
|
51
|
+
I.length,
|
|
52
|
+
R,
|
|
53
|
+
ze
|
|
52
54
|
]);
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
}, []),
|
|
56
|
-
onFinalize:
|
|
57
|
-
language:
|
|
58
|
-
}),
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
]),
|
|
68
|
-
|
|
69
|
-
committing:
|
|
70
|
-
dictating:
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
Ve,
|
|
76
|
+
O,
|
|
77
|
+
H
|
|
76
78
|
]);
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
84
|
-
if (!
|
|
85
|
-
let e =
|
|
86
|
-
e && (e.focus({ preventScroll: !0 }),
|
|
87
|
-
}, [
|
|
88
|
-
let K =
|
|
89
|
-
|
|
90
|
-
let Y =
|
|
91
|
-
|
|
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
|
-
}), []),
|
|
94
|
-
let e =
|
|
95
|
-
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight,
|
|
96
|
-
}, [
|
|
97
|
-
let X =
|
|
98
|
-
if (!J ||
|
|
99
|
-
|
|
100
|
-
let e =
|
|
101
|
-
|
|
102
|
-
let t =
|
|
103
|
-
if (!
|
|
104
|
-
|
|
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 =
|
|
108
|
-
|
|
142
|
+
let n = te.getState().activeConversationId;
|
|
143
|
+
et.current = !0, $e(!0);
|
|
109
144
|
try {
|
|
110
|
-
let r = await
|
|
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 ||
|
|
151
|
+
r.cancelled || k({
|
|
117
152
|
kind: "failed",
|
|
118
153
|
failures: r.failures
|
|
119
154
|
});
|
|
120
155
|
return;
|
|
121
156
|
}
|
|
122
|
-
if (
|
|
123
|
-
await r.rollback(), Y.current &&
|
|
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 =
|
|
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 &&
|
|
166
|
+
await r.rollback(), Y.current && k({
|
|
132
167
|
kind: "moved",
|
|
133
168
|
failures: []
|
|
134
169
|
});
|
|
135
170
|
return;
|
|
136
171
|
}
|
|
137
|
-
|
|
172
|
+
P.current = t, m(e, ie(r.attachments)), r.handedOver(), E(""), ht();
|
|
138
173
|
} finally {
|
|
139
|
-
|
|
174
|
+
et.current = !1, Y.current && $e(!1);
|
|
140
175
|
}
|
|
141
176
|
}, [
|
|
142
177
|
J,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
178
|
+
Rt,
|
|
179
|
+
vt,
|
|
180
|
+
m,
|
|
181
|
+
T,
|
|
147
182
|
q,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
]),
|
|
152
|
-
|
|
153
|
-
}, [
|
|
154
|
-
|
|
155
|
-
}, []),
|
|
156
|
-
if (
|
|
157
|
-
let e =
|
|
158
|
-
e !== null && (
|
|
159
|
-
}, [
|
|
160
|
-
|
|
161
|
-
!
|
|
162
|
-
}, [
|
|
163
|
-
let
|
|
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
|
-
|
|
200
|
+
N.current = e;
|
|
166
201
|
return;
|
|
167
202
|
}
|
|
168
|
-
let t =
|
|
169
|
-
|
|
170
|
-
}, []), Q =
|
|
171
|
-
|
|
172
|
-
!Q &&
|
|
173
|
-
}, [Q, Z]),
|
|
174
|
-
|
|
175
|
-
}, [
|
|
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 =
|
|
178
|
-
if (
|
|
179
|
-
let t =
|
|
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 ===
|
|
217
|
+
(r === null || r === n.body || r === w.current) && t.focus({ preventScroll: !0 });
|
|
183
218
|
}, [Q]);
|
|
184
|
-
let
|
|
185
|
-
|
|
219
|
+
let Ut = o((e) => {
|
|
220
|
+
E(e), A(null);
|
|
186
221
|
}, []);
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}, [
|
|
190
|
-
let
|
|
191
|
-
if (t.kind === "busy") return
|
|
192
|
-
if (t.kind === "moved") return
|
|
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 ===
|
|
195
|
-
if (n.some((e) => e.code ===
|
|
196
|
-
let r = n[0], i =
|
|
197
|
-
return `${n.length <= 1 ?
|
|
198
|
-
},
|
|
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]),
|
|
201
|
-
e.key === "Escape" ?
|
|
202
|
-
}, [X]),
|
|
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(),
|
|
205
|
-
}, [
|
|
206
|
-
Array.from(e.dataTransfer?.types ?? []).includes("Files") && (
|
|
207
|
-
}, []),
|
|
208
|
-
|
|
209
|
-
}, []),
|
|
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
|
-
}, []),
|
|
212
|
-
e.preventDefault(),
|
|
213
|
-
}, [
|
|
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
|
|
216
|
-
case "too-large": return
|
|
217
|
-
case "empty": return
|
|
218
|
-
case "unreadable": return
|
|
219
|
-
case "unsupported-image": return
|
|
220
|
-
case "too-large-to-save": return
|
|
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 (
|
|
224
|
-
case "not-allowed": return
|
|
225
|
-
case "audio-capture": return
|
|
226
|
-
case "network": return
|
|
227
|
-
case "language-not-supported": return
|
|
228
|
-
case "unknown": return
|
|
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
|
-
})(),
|
|
232
|
-
onDismiss:
|
|
233
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
272
|
+
/* @__PURE__ */ f(d, {
|
|
238
273
|
className: "size-3 motion-safe:animate-spin",
|
|
239
274
|
"aria-hidden": "true"
|
|
240
275
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ f("span", { children: b("attachments.saving", "Saving your attachments…") }),
|
|
277
|
+
/* @__PURE__ */ f("button", {
|
|
243
278
|
type: "button",
|
|
244
|
-
onClick:
|
|
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:
|
|
282
|
+
children: b("attachments.cancelSaving", "Cancel")
|
|
248
283
|
})
|
|
249
284
|
]
|
|
250
285
|
})
|
|
251
|
-
}) :
|
|
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:
|
|
256
|
-
}) :
|
|
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:
|
|
260
|
-
}) :
|
|
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__ */
|
|
264
|
-
}) : $ ? /* @__PURE__ */
|
|
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
|
-
}) :
|
|
303
|
+
}) : ft ? /* @__PURE__ */ f("button", {
|
|
269
304
|
type: "button",
|
|
270
|
-
onClick:
|
|
305
|
+
onClick: gt,
|
|
271
306
|
className: "text-status-error-text underline-offset-2 hover:underline",
|
|
272
307
|
"data-testid": "assistant-attachment-rejection",
|
|
273
|
-
children:
|
|
274
|
-
}) :
|
|
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:
|
|
278
|
-
}) : n ? /* @__PURE__ */
|
|
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:
|
|
282
|
-
}) : e ? /* @__PURE__ */
|
|
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:
|
|
286
|
-
}) : /* @__PURE__ */
|
|
320
|
+
children: b("composer.stopped", "Reply stopped.")
|
|
321
|
+
}) : /* @__PURE__ */ f("p", {
|
|
287
322
|
className: "text-text-muted",
|
|
288
|
-
children:
|
|
323
|
+
children: b("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach")
|
|
289
324
|
});
|
|
290
|
-
if (
|
|
291
|
-
let e =
|
|
292
|
-
return /* @__PURE__ */
|
|
293
|
-
ref:
|
|
294
|
-
className:
|
|
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
|
-
|
|
297
|
-
|
|
298
|
-
voiceLive:
|
|
299
|
-
children:
|
|
331
|
+
Ke,
|
|
332
|
+
qe ? /* @__PURE__ */ f(ge, {
|
|
333
|
+
voiceLive: y,
|
|
334
|
+
children: qe
|
|
300
335
|
}) : null,
|
|
301
|
-
/* @__PURE__ */
|
|
302
|
-
className:
|
|
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: [
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
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__ */
|
|
312
|
-
id:
|
|
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__ */
|
|
318
|
-
onDragEnter:
|
|
319
|
-
onDragLeave:
|
|
320
|
-
onDragOver:
|
|
321
|
-
onDrop:
|
|
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)] ${
|
|
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__ */
|
|
369
|
+
/* @__PURE__ */ f("div", {
|
|
327
370
|
className: "px-3 pt-3 empty:hidden",
|
|
328
|
-
children: /* @__PURE__ */
|
|
329
|
-
disabled:
|
|
371
|
+
children: /* @__PURE__ */ p(De, { children: [/* @__PURE__ */ f(ce, {
|
|
372
|
+
disabled: O,
|
|
330
373
|
showSuggestions: K.length === 0,
|
|
331
|
-
onSuggest:
|
|
332
|
-
}), /* @__PURE__ */
|
|
333
|
-
attachments:
|
|
334
|
-
onRemove:
|
|
335
|
-
onRetry:
|
|
336
|
-
disabled:
|
|
337
|
-
preparingCount:
|
|
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__ */
|
|
341
|
-
ref:
|
|
342
|
-
value:
|
|
343
|
-
onChange: (e) =>
|
|
344
|
-
onKeyDown:
|
|
345
|
-
onPaste:
|
|
346
|
-
disabled:
|
|
347
|
-
readOnly:
|
|
348
|
-
"aria-busy":
|
|
349
|
-
placeholder:
|
|
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":
|
|
395
|
+
"aria-describedby": ee,
|
|
353
396
|
title: t,
|
|
354
|
-
"aria-label":
|
|
397
|
+
"aria-label": b("chatInput.ariaLabel", "Message input"),
|
|
355
398
|
"data-testid": "assistant-input"
|
|
356
399
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
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__ */
|
|
362
|
-
onFiles:
|
|
363
|
-
canAddMore:
|
|
364
|
-
disabled:
|
|
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__ */
|
|
465
|
+
/* @__PURE__ */ f(he, {
|
|
369
466
|
chip: !0,
|
|
370
|
-
readOnly:
|
|
371
|
-
mode:
|
|
372
|
-
availableModes:
|
|
373
|
-
onModeChange:
|
|
374
|
-
auto:
|
|
375
|
-
disabled:
|
|
376
|
-
disabledReason:
|
|
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__ */
|
|
379
|
-
|
|
475
|
+
/* @__PURE__ */ f("div", { className: "min-w-0 flex-1" }),
|
|
476
|
+
V.isSupported && !y && /* @__PURE__ */ f(le, {
|
|
380
477
|
compact: !0,
|
|
381
|
-
isListening:
|
|
382
|
-
isStarting:
|
|
383
|
-
onToggle:
|
|
384
|
-
disabled:
|
|
478
|
+
isListening: V.isListening,
|
|
479
|
+
isStarting: V.isStarting,
|
|
480
|
+
onToggle: Tt,
|
|
481
|
+
disabled: S || O
|
|
385
482
|
}),
|
|
386
|
-
Q ? /* @__PURE__ */
|
|
387
|
-
ref:
|
|
483
|
+
Q ? /* @__PURE__ */ f("button", {
|
|
484
|
+
ref: Ht,
|
|
388
485
|
type: "button",
|
|
389
|
-
onClick:
|
|
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 ${
|
|
391
|
-
"aria-label":
|
|
392
|
-
title:
|
|
393
|
-
"aria-disabled":
|
|
394
|
-
"aria-busy":
|
|
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:
|
|
493
|
+
children: j === null ? /* @__PURE__ */ f(Te, {
|
|
397
494
|
className: "size-4 fill-current",
|
|
398
495
|
"aria-hidden": "true"
|
|
399
|
-
}) : /* @__PURE__ */
|
|
496
|
+
}) : /* @__PURE__ */ f(d, {
|
|
400
497
|
className: "size-4 motion-safe:animate-spin",
|
|
401
498
|
"aria-hidden": "true"
|
|
402
499
|
})
|
|
403
|
-
}) : e ? /* @__PURE__ */
|
|
500
|
+
}) : e ? /* @__PURE__ */ f(de, {
|
|
404
501
|
compact: !0,
|
|
405
|
-
invisible:
|
|
406
|
-
onStart:
|
|
407
|
-
disabled:
|
|
408
|
-
}) : /* @__PURE__ */
|
|
502
|
+
invisible: y,
|
|
503
|
+
onStart: g,
|
|
504
|
+
disabled: S || O
|
|
505
|
+
}) : /* @__PURE__ */ f("button", {
|
|
409
506
|
type: "button",
|
|
410
507
|
onClick: () => {
|
|
411
|
-
|
|
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 ${
|
|
415
|
-
"aria-label":
|
|
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:
|
|
514
|
+
children: je || lt || O ? /* @__PURE__ */ f(d, {
|
|
418
515
|
className: "size-5 motion-safe:animate-spin",
|
|
419
516
|
"aria-hidden": "true"
|
|
420
|
-
}) : /* @__PURE__ */
|
|
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__ */
|
|
529
|
+
return /* @__PURE__ */ p("div", {
|
|
433
530
|
className: "flex-shrink-0 px-3 pb-3 pt-1.5",
|
|
434
531
|
children: [
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
-
onDragEnter:
|
|
437
|
-
onDragLeave:
|
|
438
|
-
onDragOver:
|
|
439
|
-
onDrop:
|
|
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 ${
|
|
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__ */
|
|
444
|
-
disabled:
|
|
540
|
+
/* @__PURE__ */ p(De, { children: [/* @__PURE__ */ f(ce, {
|
|
541
|
+
disabled: O,
|
|
445
542
|
showSuggestions: K.length === 0,
|
|
446
|
-
onSuggest:
|
|
447
|
-
}), /* @__PURE__ */
|
|
448
|
-
attachments:
|
|
449
|
-
onRemove:
|
|
450
|
-
onRetry:
|
|
451
|
-
disabled:
|
|
452
|
-
preparingCount:
|
|
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__ */
|
|
551
|
+
/* @__PURE__ */ p("div", {
|
|
455
552
|
className: "flex items-end gap-2",
|
|
456
553
|
children: [
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
onFiles:
|
|
459
|
-
canAddMore:
|
|
460
|
-
disabled:
|
|
554
|
+
/* @__PURE__ */ f(oe, {
|
|
555
|
+
onFiles: L,
|
|
556
|
+
canAddMore: _t,
|
|
557
|
+
disabled: S || O,
|
|
461
558
|
showLabel: !0
|
|
462
559
|
}),
|
|
463
|
-
/* @__PURE__ */
|
|
464
|
-
ref:
|
|
465
|
-
value:
|
|
466
|
-
onChange: (e) =>
|
|
467
|
-
onKeyDown:
|
|
468
|
-
onPaste:
|
|
469
|
-
disabled:
|
|
470
|
-
readOnly:
|
|
471
|
-
"aria-busy":
|
|
472
|
-
placeholder:
|
|
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":
|
|
572
|
+
"aria-label": b("chatInput.ariaLabel", "Message input"),
|
|
476
573
|
"data-testid": "assistant-input"
|
|
477
574
|
}),
|
|
478
|
-
|
|
479
|
-
isListening:
|
|
480
|
-
isStarting:
|
|
481
|
-
onToggle:
|
|
482
|
-
disabled:
|
|
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
|
-
|
|
485
|
-
onStart:
|
|
486
|
-
disabled:
|
|
487
|
-
}) : /* @__PURE__ */
|
|
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":
|
|
589
|
+
"aria-label": b("chatInput.send", "Send message"),
|
|
493
590
|
"data-testid": "assistant-send",
|
|
494
|
-
children:
|
|
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
|
-
(
|
|
595
|
+
(h.length > 1 || h.some((e) => e.writeCapable)) && /* @__PURE__ */ f("div", {
|
|
499
596
|
className: "mt-2 px-0.5",
|
|
500
|
-
children: /* @__PURE__ */
|
|
501
|
-
mode:
|
|
502
|
-
availableModes:
|
|
503
|
-
onModeChange:
|
|
504
|
-
disabled:
|
|
505
|
-
auto:
|
|
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
|
-
|
|
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:
|
|
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__ */
|
|
612
|
+
/* @__PURE__ */ f("div", {
|
|
516
613
|
className: "mt-1.5 px-1 text-center text-[11px]",
|
|
517
614
|
"aria-live": "polite",
|
|
518
|
-
children:
|
|
615
|
+
children: $t(!1, !1)
|
|
519
616
|
})
|
|
520
617
|
]
|
|
521
618
|
});
|
|
522
619
|
};
|
|
523
|
-
export {
|
|
620
|
+
export { m as AssistantComposer };
|