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