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