@burdenoff/fe-libs 2026.726.1 → 2026.730.1
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/components/assistantWidget/AssistantWidget.d.ts +12 -0
- package/dist/shared/components/assistantWidget/AssistantWidget.d.ts.map +1 -1
- package/dist/shared/components/assistantWidget/AssistantWidget.js +241 -200
- package/dist/shared/components/assistantWidget/types.d.ts +8 -0
- package/dist/shared/components/assistantWidget/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -63,6 +63,18 @@ export interface AssistantWidgetProps {
|
|
|
63
63
|
* covers the top nav. Defaults to 0 (full height) for hosts with no header.
|
|
64
64
|
*/
|
|
65
65
|
topOffsetPx?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Show a file-upload (paperclip) button in the composer so users can attach a
|
|
68
|
+
* data file (JSON / CSV / Excel / PDF) as a source. Off by default → every
|
|
69
|
+
* product that mounts this widget keeps its current UI untouched. Only hosts
|
|
70
|
+
* whose transport can actually ingest attachments (BigConsole) turn it on.
|
|
71
|
+
*/
|
|
72
|
+
enableAttachments?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* `accept` filter for the attachment input. Defaults to the data-file types the
|
|
75
|
+
* BigConsole assistant understands.
|
|
76
|
+
*/
|
|
77
|
+
attachmentAccept?: string;
|
|
66
78
|
}
|
|
67
79
|
/** External toggle hook so command palettes / plugins can open the widget. */
|
|
68
80
|
export declare const ASSISTANT_WIDGET_TOGGLE_EVENT = "bf:toggle-assistant-widget";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantWidget.d.ts","sourceRoot":"","sources":["../../../../src/shared/components/assistantWidget/AssistantWidget.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAML,KAAK,EAAE,EAER,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantWidget.d.ts","sourceRoot":"","sources":["../../../../src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E,OAAO,CAAC;IAC5B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,8EAA8E;AAC9E,eAAO,MAAM,6BAA6B,+BAA+B,CAAC;AA0D1E,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA22BpD,CAAC"}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import { cn as e } from "../../utils/cn.js";
|
|
2
2
|
import { useVoiceInput as t } from "./useVoiceInput.js";
|
|
3
3
|
import { MessageContent as n } from "./MessageContent.js";
|
|
4
|
-
import { useCallback as r, useEffect as i, useMemo as
|
|
5
|
-
import { Download as
|
|
6
|
-
import { Fragment as
|
|
4
|
+
import { useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
5
|
+
import { Download as ee, FileArchive as te, History as ne, Loader2 as c, MessageCircle as re, Mic as ie, PanelLeftClose as ae, PanelLeftOpen as oe, Paperclip as se, Plus as ce, Send as le, Sparkles as ue, Trash2 as de, X as l } from "lucide-react";
|
|
6
|
+
import { Fragment as fe, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
7
|
//#region src/shared/components/assistantWidget/AssistantWidget.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
8
|
+
var f = "bf:toggle-assistant-widget", p = "bf:assistant-widget:isOpen", m = "bf:assistant-widget:railOpen";
|
|
9
|
+
function pe() {
|
|
10
10
|
if (typeof window > "u") return !0;
|
|
11
11
|
try {
|
|
12
|
-
return window.sessionStorage.getItem(
|
|
12
|
+
return window.sessionStorage.getItem(m) !== "0";
|
|
13
13
|
} catch {
|
|
14
14
|
return !0;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function me(e) {
|
|
18
18
|
if (!(typeof window > "u")) try {
|
|
19
|
-
window.sessionStorage.setItem(
|
|
19
|
+
window.sessionStorage.setItem(m, e ? "1" : "0");
|
|
20
20
|
} catch {}
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function he() {
|
|
23
23
|
if (typeof window > "u") return !1;
|
|
24
24
|
try {
|
|
25
|
-
return window.sessionStorage.getItem(
|
|
25
|
+
return window.sessionStorage.getItem(p) === "1";
|
|
26
26
|
} catch {
|
|
27
27
|
return !1;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function h(e) {
|
|
31
31
|
if (!(typeof window > "u")) try {
|
|
32
|
-
window.sessionStorage.setItem(
|
|
32
|
+
window.sessionStorage.setItem(p, e ? "1" : "0");
|
|
33
33
|
} catch {}
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function ge() {
|
|
36
36
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function _e(e) {
|
|
39
39
|
if (!Number.isFinite(e) || e <= 0) return "";
|
|
40
40
|
let t = [
|
|
41
41
|
"B",
|
|
@@ -46,90 +46,90 @@ function ve(e) {
|
|
|
46
46
|
for (; n >= 1024 && r < t.length - 1;) n /= 1024, r += 1;
|
|
47
47
|
return `${n >= 10 || r === 0 ? Math.round(n) : n.toFixed(1)} ${t[r]}`;
|
|
48
48
|
}
|
|
49
|
-
var
|
|
50
|
-
let
|
|
49
|
+
var ve = ({ transport: p, modes: m, defaultModeId: ve, title: g = "AI Assistant", subtitle: _ = "Ask me to do things on this screen — I can run them for you.", placeholder: v = "Ask anything, or describe what to create…", launcherClassName: ye, voiceLang: be = "en-US", layout: xe = "floating", showSessionPanel: Se = !1, onNavigate: Ce, topOffsetPx: we = 0, enableAttachments: y = !1, attachmentAccept: Te = ".json,.csv,.xlsx,.xls,.pdf,application/json,text/csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf" }) => {
|
|
50
|
+
let b = a(() => m && m.length > 0 ? m : [{
|
|
51
51
|
id: "__default__",
|
|
52
|
-
label:
|
|
53
|
-
transport:
|
|
54
|
-
title:
|
|
55
|
-
subtitle:
|
|
56
|
-
placeholder:
|
|
52
|
+
label: g,
|
|
53
|
+
transport: p,
|
|
54
|
+
title: g,
|
|
55
|
+
subtitle: _,
|
|
56
|
+
placeholder: v
|
|
57
57
|
}], [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
h,
|
|
58
|
+
m,
|
|
59
|
+
p,
|
|
61
60
|
g,
|
|
62
|
-
_
|
|
63
|
-
|
|
61
|
+
_,
|
|
62
|
+
v
|
|
63
|
+
]), [x, Ee] = s(() => ve ?? b[0]?.id ?? "__default__"), S = b.find((e) => e.id === x) ?? b[0], C = S.transport, De = S.title ?? g, Oe = S.subtitle ?? _, ke = S.placeholder ?? v;
|
|
64
64
|
i(() => {
|
|
65
|
-
|
|
66
|
-
}, [
|
|
67
|
-
let w = !!
|
|
65
|
+
b.some((e) => e.id === x) || Ee(b[0]?.id ?? "__default__");
|
|
66
|
+
}, [b, x]);
|
|
67
|
+
let w = !!C;
|
|
68
68
|
i(() => {
|
|
69
69
|
w || console.error("[AssistantWidget] No transport available — supply `transport`, or a non-empty `modes` where each entry has a transport.");
|
|
70
70
|
}, [w]);
|
|
71
|
-
let [T, E] =
|
|
72
|
-
|
|
71
|
+
let [T, E] = s(() => he()), [D, O] = s([]), [k, A] = s(""), [j, M] = s([]), [N, P] = s(!1), [Ae, F] = s(!1), [I, L] = s([]), [R, z] = s(!1), [je, Me] = s(!1), [Ne, Pe] = s(() => pe()), [Fe, B] = s([]), [V, Ie] = s(null), H = o(null), U = o(null), W = o(null), G = o(!1), Le = o(null), K = xe === "sidebar", Re = Se && !!C?.newSession, ze = r(() => {
|
|
72
|
+
Pe((e) => {
|
|
73
73
|
let t = !e;
|
|
74
|
-
return
|
|
74
|
+
return me(t), t;
|
|
75
75
|
});
|
|
76
|
-
}, []), q = t(be),
|
|
77
|
-
|
|
78
|
-
}, [
|
|
79
|
-
|
|
80
|
-
}, [
|
|
76
|
+
}, []), q = t(be), Be = r(() => {
|
|
77
|
+
h(!0), E(!0), C.prewarm?.("full");
|
|
78
|
+
}, [C]), J = r(() => {
|
|
79
|
+
h(!1), E(!1), C.suspend?.();
|
|
80
|
+
}, [C]), Y = r(() => {
|
|
81
81
|
E((e) => {
|
|
82
82
|
let t = !e;
|
|
83
|
-
return
|
|
83
|
+
return h(t), t ? C.prewarm?.("full") : C.suspend?.(), t;
|
|
84
84
|
});
|
|
85
|
-
}, [
|
|
85
|
+
}, [C]);
|
|
86
86
|
i(() => {
|
|
87
87
|
let e = (e) => {
|
|
88
88
|
let t = e.detail;
|
|
89
|
-
t?.open === !0 ?
|
|
89
|
+
t?.open === !0 ? Be() : t?.open === !1 ? J() : Y();
|
|
90
90
|
};
|
|
91
|
-
return window.addEventListener(
|
|
91
|
+
return window.addEventListener(f, e), () => window.removeEventListener(f, e);
|
|
92
92
|
}, [
|
|
93
|
-
|
|
93
|
+
Be,
|
|
94
94
|
J,
|
|
95
95
|
Y
|
|
96
96
|
]), i(() => {
|
|
97
97
|
q.isListening && q.transcript && A(q.transcript);
|
|
98
98
|
}, [q.transcript, q.isListening]);
|
|
99
99
|
let X = r(async () => {
|
|
100
|
-
if (
|
|
101
|
-
|
|
100
|
+
if (C.listArtifacts) try {
|
|
101
|
+
B(await C.listArtifacts());
|
|
102
102
|
} catch {
|
|
103
|
-
|
|
103
|
+
B([]);
|
|
104
104
|
}
|
|
105
|
-
}, [
|
|
105
|
+
}, [C]), Ve = o(x);
|
|
106
106
|
i(() => {
|
|
107
|
-
|
|
108
|
-
}, [
|
|
109
|
-
if (!T ||
|
|
110
|
-
let e =
|
|
107
|
+
Ve.current !== x && (Ve.current = x, W.current?.abort(), W.current = null, P(!1), O([]), A(""), L([]), z(!1), F(!1), B([]), G.current = !1);
|
|
108
|
+
}, [x]), i(() => {
|
|
109
|
+
if (!T || G.current) return;
|
|
110
|
+
let e = C.loadHistory;
|
|
111
111
|
if (!e) {
|
|
112
|
-
|
|
112
|
+
G.current = !0;
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
|
|
115
|
+
G.current = !0;
|
|
116
116
|
let t = !1;
|
|
117
|
-
return
|
|
117
|
+
return F(!0), (async () => {
|
|
118
118
|
try {
|
|
119
119
|
let n = await e();
|
|
120
120
|
!t && n.length > 0 && (O((e) => e.length === 0 ? n : e), X());
|
|
121
121
|
} catch {} finally {
|
|
122
|
-
t ||
|
|
122
|
+
t || F(!1);
|
|
123
123
|
}
|
|
124
124
|
})(), () => {
|
|
125
125
|
t = !0;
|
|
126
126
|
};
|
|
127
127
|
}, [
|
|
128
128
|
T,
|
|
129
|
-
|
|
129
|
+
C,
|
|
130
130
|
X
|
|
131
131
|
]), i(() => {
|
|
132
|
-
T &&
|
|
132
|
+
T && U.current && (U.current.scrollTop = U.current.scrollHeight);
|
|
133
133
|
}, [D, T]);
|
|
134
134
|
let Z = r((e, t) => {
|
|
135
135
|
O((n) => n.map((n) => n.id === e ? {
|
|
@@ -137,340 +137,381 @@ var m = ({ transport: d, modes: f, defaultModeId: m, title: h = "AI Assistant",
|
|
|
137
137
|
...t
|
|
138
138
|
} : n));
|
|
139
139
|
}, []), Q = r(async () => {
|
|
140
|
-
if (
|
|
141
|
-
|
|
140
|
+
if (C.listSessions) {
|
|
141
|
+
Me(!0);
|
|
142
142
|
try {
|
|
143
|
-
|
|
143
|
+
L(await C.listSessions());
|
|
144
144
|
} catch {
|
|
145
|
-
|
|
145
|
+
L([]);
|
|
146
146
|
} finally {
|
|
147
|
-
|
|
147
|
+
Me(!1);
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
}, [
|
|
151
|
-
if (!(!
|
|
152
|
-
|
|
150
|
+
}, [C]), He = r(async (e) => {
|
|
151
|
+
if (!(!C.downloadArtifact || V)) {
|
|
152
|
+
Ie(e.path);
|
|
153
153
|
try {
|
|
154
|
-
await
|
|
154
|
+
await C.downloadArtifact(e);
|
|
155
155
|
} catch {} finally {
|
|
156
|
-
|
|
156
|
+
Ie(null);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
}, [
|
|
160
|
-
!
|
|
161
|
-
}, [
|
|
162
|
-
if (!(!
|
|
163
|
-
|
|
159
|
+
}, [C, V]), Ue = r(async () => {
|
|
160
|
+
!C.newSession || N || (O([]), A(""), z(!1), B([]), await C.newSession());
|
|
161
|
+
}, [C, N]), We = r(async (e, t) => {
|
|
162
|
+
if (!(!C.deleteSession || N)) {
|
|
163
|
+
L((t) => t.filter((t) => t.id !== e)), t && (O([]), A(""));
|
|
164
164
|
try {
|
|
165
|
-
await
|
|
165
|
+
await C.deleteSession(e);
|
|
166
166
|
} finally {
|
|
167
167
|
Q();
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
}, [
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
C,
|
|
172
|
+
N,
|
|
173
173
|
Q
|
|
174
|
-
]),
|
|
175
|
-
|
|
176
|
-
}, [Q]),
|
|
177
|
-
if (!(!
|
|
178
|
-
|
|
174
|
+
]), Ge = r(() => {
|
|
175
|
+
z((e) => (e || Q(), !e));
|
|
176
|
+
}, [Q]), Ke = r(async (e) => {
|
|
177
|
+
if (!(!C.selectSession || N)) {
|
|
178
|
+
F(!0);
|
|
179
179
|
try {
|
|
180
|
-
O(await
|
|
180
|
+
O(await C.selectSession(e)), z(!1), Q(), X();
|
|
181
181
|
} catch {} finally {
|
|
182
|
-
|
|
182
|
+
F(!1);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
}, [
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
C,
|
|
187
|
+
N,
|
|
188
188
|
Q,
|
|
189
189
|
X
|
|
190
190
|
]), $ = r(async () => {
|
|
191
|
-
let e = k.trim();
|
|
192
|
-
if (!e ||
|
|
193
|
-
q.isListening && q.stop(), q.reset(), A(""),
|
|
194
|
-
let t = {
|
|
195
|
-
id:
|
|
191
|
+
let e = k.trim(), t = j;
|
|
192
|
+
if (!e && t.length === 0 || N) return;
|
|
193
|
+
q.isListening && q.stop(), q.reset(), A(""), M([]), H.current && (H.current.style.height = "auto");
|
|
194
|
+
let n = t.length > 0 ? `📎 ${t.map((e) => e.name).join(", ")}` : "", r = {
|
|
195
|
+
id: ge(),
|
|
196
196
|
role: "user",
|
|
197
|
-
content: e
|
|
198
|
-
},
|
|
197
|
+
content: [e, n].filter(Boolean).join("\n")
|
|
198
|
+
}, i = ge();
|
|
199
199
|
O((e) => [
|
|
200
200
|
...e,
|
|
201
|
-
|
|
201
|
+
r,
|
|
202
202
|
{
|
|
203
|
-
id:
|
|
203
|
+
id: i,
|
|
204
204
|
role: "assistant",
|
|
205
205
|
content: "",
|
|
206
206
|
pending: !0
|
|
207
207
|
}
|
|
208
|
-
]),
|
|
209
|
-
let
|
|
210
|
-
|
|
208
|
+
]), P(!0);
|
|
209
|
+
let a = new AbortController();
|
|
210
|
+
W.current = a;
|
|
211
211
|
try {
|
|
212
|
-
let { text:
|
|
212
|
+
let { text: n } = await C.sendPrompt({
|
|
213
213
|
prompt: e,
|
|
214
|
-
|
|
215
|
-
|
|
214
|
+
attachments: t.length > 0 ? t : void 0,
|
|
215
|
+
signal: a.signal,
|
|
216
|
+
onProgress: (e) => Z(i, { content: e })
|
|
216
217
|
});
|
|
217
|
-
Z(
|
|
218
|
-
content:
|
|
218
|
+
Z(i, {
|
|
219
|
+
content: n,
|
|
219
220
|
pending: !1
|
|
220
221
|
}), X();
|
|
221
222
|
} catch (e) {
|
|
222
|
-
Z(
|
|
223
|
+
Z(i, {
|
|
223
224
|
content: `Sorry, I couldn't complete that: ${e instanceof Error ? e.message : "Something went wrong. Please try again."}`,
|
|
224
225
|
pending: !1,
|
|
225
226
|
error: !0
|
|
226
227
|
});
|
|
227
228
|
} finally {
|
|
228
|
-
|
|
229
|
+
P(!1), W.current = null, R && Q();
|
|
229
230
|
}
|
|
230
231
|
}, [
|
|
231
232
|
k,
|
|
232
233
|
j,
|
|
234
|
+
N,
|
|
233
235
|
Z,
|
|
234
|
-
|
|
236
|
+
C,
|
|
235
237
|
q,
|
|
236
|
-
|
|
238
|
+
R,
|
|
237
239
|
Q,
|
|
238
240
|
X
|
|
239
|
-
]),
|
|
241
|
+
]), qe = r((e) => {
|
|
240
242
|
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), $());
|
|
241
|
-
}, [$]),
|
|
242
|
-
let e =
|
|
243
|
+
}, [$]), Je = r(() => {
|
|
244
|
+
let e = H.current;
|
|
243
245
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 120)}px`);
|
|
244
|
-
}, []),
|
|
246
|
+
}, []), Ye = r(() => {
|
|
245
247
|
q.isListening ? q.stop() : q.start();
|
|
246
|
-
}, [q]),
|
|
248
|
+
}, [q]), Xe = a(() => /* @__PURE__ */ u("button", {
|
|
247
249
|
type: "button",
|
|
248
250
|
onClick: Y,
|
|
249
|
-
onMouseEnter: () => !T &&
|
|
250
|
-
onFocus: () => !T &&
|
|
251
|
+
onMouseEnter: () => !T && C.prewarm?.("probe"),
|
|
252
|
+
onFocus: () => !T && C.prewarm?.("probe"),
|
|
251
253
|
"aria-label": T ? "Close AI assistant" : "Open AI assistant",
|
|
252
254
|
"aria-expanded": T,
|
|
253
255
|
"data-testid": "assistant-widget-launcher",
|
|
254
256
|
className: e("fixed bottom-6 right-6 z-[100] inline-flex size-14 items-center justify-center rounded-full", "bg-action-primary-bg text-action-primary-text shadow-xl transition-transform duration-200", "hover:scale-105 hover:bg-action-primary-bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer", ye),
|
|
255
|
-
children:
|
|
257
|
+
children: u(T ? l : ue, { className: "size-6" })
|
|
256
258
|
}), [
|
|
257
259
|
T,
|
|
258
260
|
Y,
|
|
259
261
|
ye,
|
|
260
|
-
|
|
262
|
+
C
|
|
261
263
|
]);
|
|
262
|
-
return w ? /* @__PURE__ */
|
|
264
|
+
return w ? /* @__PURE__ */ d(fe, { children: [Xe, T ? /* @__PURE__ */ d("div", {
|
|
263
265
|
role: "dialog",
|
|
264
|
-
"aria-label":
|
|
266
|
+
"aria-label": De,
|
|
265
267
|
"data-testid": "assistant-widget-window",
|
|
266
|
-
"data-layout":
|
|
267
|
-
style:
|
|
268
|
-
top:
|
|
269
|
-
height: `calc(100vh - ${String(
|
|
268
|
+
"data-layout": xe,
|
|
269
|
+
style: K ? {
|
|
270
|
+
top: we,
|
|
271
|
+
height: `calc(100vh - ${String(we)}px)`
|
|
270
272
|
} : void 0,
|
|
271
|
-
className: e("fixed z-[100] flex overflow-hidden border-border-default bg-bg-surface shadow-2xl",
|
|
272
|
-
children: [
|
|
273
|
+
className: e("fixed z-[100] flex overflow-hidden border-border-default bg-bg-surface shadow-2xl", K ? "bottom-0 right-0 w-full border-l sm:w-[480px] lg:w-[560px] animate-in slide-in-from-right duration-200" : "flex-col rounded-xl border bottom-24 right-6 h-[560px] max-h-[calc(100vh-7rem)] w-[calc(100vw-3rem)] sm:w-[400px] animate-in slide-in-from-bottom-2 fade-in duration-200"),
|
|
274
|
+
children: [K && Re && Ne ? /* @__PURE__ */ d("aside", {
|
|
273
275
|
"data-testid": "assistant-session-panel",
|
|
274
276
|
className: "flex w-[168px] shrink-0 flex-col gap-1 border-r border-border-subtle bg-bg-sunken p-2",
|
|
275
277
|
children: [
|
|
276
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ d("button", {
|
|
277
279
|
type: "button",
|
|
278
|
-
onClick:
|
|
280
|
+
onClick: ze,
|
|
279
281
|
"aria-label": "Hide chats",
|
|
280
282
|
"aria-expanded": !0,
|
|
281
283
|
title: "Hide chats",
|
|
282
284
|
"data-testid": "assistant-rail-toggle",
|
|
283
285
|
className: "mb-1 flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-secondary transition-colors hover:bg-bg-surface hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
284
|
-
children: [/* @__PURE__ */
|
|
286
|
+
children: [/* @__PURE__ */ u(ae, { className: "size-4 shrink-0" }), "Hide chats"]
|
|
285
287
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ d("button", {
|
|
287
289
|
type: "button",
|
|
288
|
-
onClick: () => void
|
|
289
|
-
disabled:
|
|
290
|
+
onClick: () => void Ue(),
|
|
291
|
+
disabled: N,
|
|
290
292
|
"data-testid": "assistant-new-chat",
|
|
291
293
|
className: "flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-primary transition-colors hover:bg-bg-surface disabled:opacity-50 cursor-pointer",
|
|
292
|
-
children: [/* @__PURE__ */
|
|
294
|
+
children: [/* @__PURE__ */ u(ce, { className: "size-4 shrink-0" }), "New chat"]
|
|
293
295
|
}),
|
|
294
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ d("button", {
|
|
295
297
|
type: "button",
|
|
296
|
-
onClick:
|
|
297
|
-
"aria-expanded":
|
|
298
|
+
onClick: Ge,
|
|
299
|
+
"aria-expanded": R,
|
|
298
300
|
"data-testid": "assistant-history-toggle",
|
|
299
301
|
className: "flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-primary transition-colors hover:bg-bg-surface cursor-pointer",
|
|
300
|
-
children: [/* @__PURE__ */
|
|
302
|
+
children: [/* @__PURE__ */ u(ne, { className: "size-4 shrink-0" }), "History"]
|
|
301
303
|
}),
|
|
302
|
-
|
|
304
|
+
R ? /* @__PURE__ */ u("div", {
|
|
303
305
|
"data-testid": "assistant-history-list",
|
|
304
306
|
className: "mt-1 flex-1 space-y-0.5 overflow-y-auto border-t border-border-subtle pt-2",
|
|
305
|
-
children:
|
|
307
|
+
children: je && I.length === 0 ? /* @__PURE__ */ d("p", {
|
|
306
308
|
className: "flex items-center gap-1.5 px-2 py-1 text-[11px] text-text-muted",
|
|
307
|
-
children: [/* @__PURE__ */ c
|
|
308
|
-
}) :
|
|
309
|
+
children: [/* @__PURE__ */ u(c, { className: "size-3 animate-spin" }), "Loading…"]
|
|
310
|
+
}) : I.length === 0 ? /* @__PURE__ */ u("p", {
|
|
309
311
|
className: "px-2 py-1 text-[11px] leading-relaxed text-text-muted",
|
|
310
312
|
children: "No past chats yet."
|
|
311
|
-
}) :
|
|
313
|
+
}) : I.map((t) => /* @__PURE__ */ d("div", {
|
|
312
314
|
"data-testid": "assistant-history-row",
|
|
313
315
|
className: e("group flex items-center gap-1 rounded pr-1 transition-colors", t.active ? "bg-bg-surface" : "hover:bg-bg-surface"),
|
|
314
|
-
children: [/* @__PURE__ */
|
|
316
|
+
children: [/* @__PURE__ */ u("button", {
|
|
315
317
|
type: "button",
|
|
316
|
-
onClick: () => void
|
|
318
|
+
onClick: () => void Ke(t.id),
|
|
317
319
|
title: t.title,
|
|
318
320
|
"data-testid": "assistant-history-item",
|
|
319
321
|
className: e("min-w-0 flex-1 truncate rounded px-2 py-1.5 text-left text-[11px] leading-relaxed cursor-pointer", t.active ? "font-medium text-text-primary" : "text-text-secondary group-hover:text-text-primary"),
|
|
320
322
|
children: t.title
|
|
321
|
-
}),
|
|
323
|
+
}), C.deleteSession ? /* @__PURE__ */ u("button", {
|
|
322
324
|
type: "button",
|
|
323
|
-
onClick: () => void
|
|
324
|
-
disabled:
|
|
325
|
+
onClick: () => void We(t.id, !!t.active),
|
|
326
|
+
disabled: N,
|
|
325
327
|
"aria-label": `Delete chat: ${t.title}`,
|
|
326
328
|
title: "Delete this chat",
|
|
327
329
|
"data-testid": "assistant-delete-chat",
|
|
328
330
|
className: "inline-flex size-6 shrink-0 items-center justify-center rounded text-text-muted opacity-0 transition-opacity hover:text-status-error-bg focus-visible:opacity-100 group-hover:opacity-100 disabled:opacity-30 cursor-pointer",
|
|
329
|
-
children: /* @__PURE__ */
|
|
331
|
+
children: /* @__PURE__ */ u(de, { className: "size-3.5" })
|
|
330
332
|
}) : null]
|
|
331
333
|
}, t.id))
|
|
332
334
|
}) : null
|
|
333
335
|
]
|
|
334
|
-
}) : null, /* @__PURE__ */
|
|
336
|
+
}) : null, /* @__PURE__ */ d("div", {
|
|
335
337
|
className: "flex min-h-0 min-w-0 flex-1 flex-col",
|
|
336
338
|
children: [
|
|
337
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ d("div", {
|
|
338
340
|
className: "flex shrink-0 items-center justify-between gap-2 border-b border-border-subtle bg-bg-surface px-4 py-3",
|
|
339
|
-
children: [/* @__PURE__ */
|
|
341
|
+
children: [/* @__PURE__ */ d("div", {
|
|
340
342
|
className: "flex min-w-0 items-center gap-2",
|
|
341
|
-
children: [
|
|
343
|
+
children: [K && Re && !Ne ? /* @__PURE__ */ d("button", {
|
|
342
344
|
type: "button",
|
|
343
|
-
onClick:
|
|
345
|
+
onClick: ze,
|
|
344
346
|
"aria-label": "Show chats",
|
|
345
347
|
"aria-expanded": !1,
|
|
346
348
|
title: "Show chats",
|
|
347
349
|
"data-testid": "assistant-rail-toggle",
|
|
348
350
|
className: "inline-flex shrink-0 items-center gap-1.5 rounded-md border border-border-subtle px-2 py-1.5 text-xs font-medium text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
349
|
-
children: [/* @__PURE__ */
|
|
350
|
-
}) : /* @__PURE__ */
|
|
351
|
+
children: [/* @__PURE__ */ u(oe, { className: "size-4" }), "Chats"]
|
|
352
|
+
}) : /* @__PURE__ */ u("span", {
|
|
351
353
|
className: "inline-flex size-7 shrink-0 items-center justify-center rounded-full bg-action-primary-bg/10 text-action-primary-bg",
|
|
352
|
-
children: /* @__PURE__ */
|
|
353
|
-
}), /* @__PURE__ */
|
|
354
|
+
children: /* @__PURE__ */ u(ue, { className: "size-4" })
|
|
355
|
+
}), /* @__PURE__ */ u("h2", {
|
|
354
356
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
355
|
-
children:
|
|
357
|
+
children: De
|
|
356
358
|
})]
|
|
357
|
-
}), /* @__PURE__ */
|
|
359
|
+
}), /* @__PURE__ */ u("button", {
|
|
358
360
|
type: "button",
|
|
359
361
|
onClick: J,
|
|
360
362
|
"aria-label": "Close AI assistant",
|
|
361
363
|
"data-testid": "assistant-widget-close",
|
|
362
364
|
className: "inline-flex size-8 shrink-0 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
363
|
-
children: /* @__PURE__ */
|
|
365
|
+
children: /* @__PURE__ */ u(l, { className: "size-4" })
|
|
364
366
|
})]
|
|
365
367
|
}),
|
|
366
|
-
|
|
368
|
+
b.length > 1 ? /* @__PURE__ */ u("div", {
|
|
367
369
|
role: "tablist",
|
|
368
370
|
"aria-label": "Assistant mode",
|
|
369
371
|
"data-testid": "assistant-mode-switcher",
|
|
370
372
|
className: "flex shrink-0 items-center gap-1 border-b border-border-subtle bg-bg-surface px-3 py-2",
|
|
371
|
-
children:
|
|
372
|
-
let n = t.id ===
|
|
373
|
-
return /* @__PURE__ */
|
|
373
|
+
children: b.map((t) => {
|
|
374
|
+
let n = t.id === x;
|
|
375
|
+
return /* @__PURE__ */ u("button", {
|
|
374
376
|
type: "button",
|
|
375
377
|
role: "tab",
|
|
376
378
|
"aria-selected": n,
|
|
377
379
|
tabIndex: n ? 0 : -1,
|
|
378
|
-
onClick: () =>
|
|
379
|
-
disabled:
|
|
380
|
-
title:
|
|
380
|
+
onClick: () => Ee(t.id),
|
|
381
|
+
disabled: N,
|
|
382
|
+
title: N ? "Finish the current turn before switching" : t.label,
|
|
381
383
|
"data-testid": `assistant-mode-${t.id}`,
|
|
382
384
|
className: e("rounded-md px-2.5 py-1 text-xs font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer", n ? "bg-action-primary-bg text-action-primary-text" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
|
|
383
385
|
children: t.label
|
|
384
386
|
}, t.id);
|
|
385
387
|
})
|
|
386
388
|
}) : null,
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
ref:
|
|
389
|
+
/* @__PURE__ */ u("div", {
|
|
390
|
+
ref: U,
|
|
389
391
|
className: "min-h-0 flex-1 space-y-3 overflow-y-auto px-4 py-4",
|
|
390
392
|
"data-testid": "assistant-widget-messages",
|
|
391
|
-
children: D.length === 0 &&
|
|
393
|
+
children: D.length === 0 && Ae ? /* @__PURE__ */ d("div", {
|
|
392
394
|
"data-testid": "assistant-widget-restoring",
|
|
393
395
|
className: "flex h-full flex-col items-center justify-center gap-3 text-center",
|
|
394
|
-
children: [/* @__PURE__ */ c
|
|
396
|
+
children: [/* @__PURE__ */ u(c, { className: "size-5 animate-spin text-text-secondary" }), /* @__PURE__ */ u("p", {
|
|
395
397
|
className: "text-xs leading-relaxed text-text-secondary",
|
|
396
398
|
children: "Restoring your conversation…"
|
|
397
399
|
})]
|
|
398
|
-
}) : D.length === 0 ? /* @__PURE__ */
|
|
400
|
+
}) : D.length === 0 ? /* @__PURE__ */ d("div", {
|
|
399
401
|
className: "flex h-full flex-col items-center justify-center gap-3 text-center",
|
|
400
|
-
children: [/* @__PURE__ */
|
|
402
|
+
children: [/* @__PURE__ */ u("span", {
|
|
401
403
|
className: "inline-flex size-12 items-center justify-center rounded-full bg-bg-sunken text-action-primary-bg",
|
|
402
|
-
children: /* @__PURE__ */
|
|
403
|
-
}), /* @__PURE__ */
|
|
404
|
+
children: /* @__PURE__ */ u(re, { className: "size-6" })
|
|
405
|
+
}), /* @__PURE__ */ u("p", {
|
|
404
406
|
className: "max-w-[16rem] text-xs leading-relaxed text-text-secondary",
|
|
405
|
-
children:
|
|
407
|
+
children: Oe
|
|
406
408
|
})]
|
|
407
|
-
}) : D.map((t) => /* @__PURE__ */
|
|
409
|
+
}) : D.map((t) => /* @__PURE__ */ u("div", {
|
|
408
410
|
className: e("flex", t.role === "user" ? "justify-end" : "justify-start"),
|
|
409
|
-
children: /* @__PURE__ */
|
|
411
|
+
children: /* @__PURE__ */ d("div", {
|
|
410
412
|
"data-testid": `assistant-widget-message-${t.role}`,
|
|
411
|
-
className: e("whitespace-pre-wrap break-words rounded-lg px-3 py-2 text-xs leading-relaxed",
|
|
412
|
-
children: [t.content ? /* @__PURE__ */
|
|
413
|
+
className: e("whitespace-pre-wrap break-words rounded-lg px-3 py-2 text-xs leading-relaxed", K ? "max-w-[92%]" : "max-w-[85%]", t.role === "user" ? "bg-action-primary-bg text-action-primary-text" : t.error ? "bg-status-error-bg/10 text-status-error-bg" : "bg-bg-sunken text-text-primary"),
|
|
414
|
+
children: [t.content ? /* @__PURE__ */ u(n, {
|
|
413
415
|
content: t.content,
|
|
414
|
-
onNavigate:
|
|
415
|
-
}) : null, t.pending ? /* @__PURE__ */
|
|
416
|
+
onNavigate: Ce
|
|
417
|
+
}) : null, t.pending ? /* @__PURE__ */ d("span", {
|
|
416
418
|
"data-testid": "assistant-widget-working",
|
|
417
419
|
className: e("inline-flex items-center gap-1 text-text-secondary", t.content ? "mt-1" : ""),
|
|
418
|
-
children: [/* @__PURE__ */ c
|
|
420
|
+
children: [/* @__PURE__ */ u(c, { className: "size-3 animate-spin" }), t.content ? null : /* @__PURE__ */ u("span", { children: "Working on it…" })]
|
|
419
421
|
}) : null]
|
|
420
422
|
})
|
|
421
423
|
}, t.id))
|
|
422
424
|
}),
|
|
423
|
-
|
|
425
|
+
C.downloadArtifact && Fe.length > 0 ? /* @__PURE__ */ u("div", {
|
|
424
426
|
"data-testid": "assistant-widget-artifacts",
|
|
425
427
|
className: "flex shrink-0 flex-wrap gap-1.5 border-t border-border-subtle bg-bg-sunken px-3 py-2",
|
|
426
|
-
children:
|
|
427
|
-
let t =
|
|
428
|
-
return /* @__PURE__ */
|
|
428
|
+
children: Fe.map((e) => {
|
|
429
|
+
let t = V === e.path;
|
|
430
|
+
return /* @__PURE__ */ d("button", {
|
|
429
431
|
type: "button",
|
|
430
|
-
onClick: () => void
|
|
431
|
-
disabled: !!
|
|
432
|
-
title: `Download ${e.name}${e.size ? ` (${
|
|
432
|
+
onClick: () => void He(e),
|
|
433
|
+
disabled: !!V,
|
|
434
|
+
title: `Download ${e.name}${e.size ? ` (${_e(e.size)})` : ""}`,
|
|
433
435
|
"data-testid": "assistant-widget-artifact",
|
|
434
436
|
className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border-default bg-bg-surface px-2 py-1 text-[11px] font-medium text-text-primary transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:opacity-50 cursor-pointer",
|
|
435
|
-
children: [t ? /* @__PURE__ */ c
|
|
437
|
+
children: [t ? /* @__PURE__ */ u(c, { className: "size-3.5 shrink-0 animate-spin" }) : e.type === "directory" ? /* @__PURE__ */ u(te, { className: "size-3.5 shrink-0 text-action-primary-bg" }) : /* @__PURE__ */ u(ee, { className: "size-3.5 shrink-0 text-action-primary-bg" }), /* @__PURE__ */ u("span", {
|
|
436
438
|
className: "truncate",
|
|
437
439
|
children: e.name
|
|
438
440
|
})]
|
|
439
441
|
}, e.path);
|
|
440
442
|
})
|
|
441
443
|
}) : null,
|
|
442
|
-
/* @__PURE__ */
|
|
443
|
-
className: "flex
|
|
444
|
+
y && j.length > 0 ? /* @__PURE__ */ u("div", {
|
|
445
|
+
className: "flex flex-wrap gap-1.5 border-t border-border-default bg-bg-surface px-3 pt-2",
|
|
446
|
+
children: j.map((e, t) => /* @__PURE__ */ d("span", {
|
|
447
|
+
"data-testid": "assistant-widget-attachment",
|
|
448
|
+
className: "flex items-center gap-1 rounded-md bg-bg-sunken px-2 py-1 text-[11px] text-text-secondary",
|
|
449
|
+
children: [
|
|
450
|
+
/* @__PURE__ */ u(se, { className: "size-3" }),
|
|
451
|
+
/* @__PURE__ */ u("span", {
|
|
452
|
+
className: "max-w-[140px] truncate",
|
|
453
|
+
children: e.name
|
|
454
|
+
}),
|
|
455
|
+
/* @__PURE__ */ u("button", {
|
|
456
|
+
type: "button",
|
|
457
|
+
onClick: () => M((e) => e.filter((e, n) => n !== t)),
|
|
458
|
+
"aria-label": `Remove ${e.name}`,
|
|
459
|
+
className: "text-text-muted hover:text-text-primary cursor-pointer",
|
|
460
|
+
children: /* @__PURE__ */ u(l, { className: "size-3" })
|
|
461
|
+
})
|
|
462
|
+
]
|
|
463
|
+
}, `${e.name}-${t}`))
|
|
464
|
+
}) : null,
|
|
465
|
+
/* @__PURE__ */ d("div", {
|
|
466
|
+
className: e("flex shrink-0 items-end gap-2 bg-bg-surface px-3 py-2.5", y && j.length > 0 ? "" : "border-t border-border-default"),
|
|
444
467
|
children: [
|
|
445
|
-
|
|
468
|
+
y ? /* @__PURE__ */ d(fe, { children: [/* @__PURE__ */ u("input", {
|
|
469
|
+
ref: Le,
|
|
470
|
+
type: "file",
|
|
471
|
+
accept: Te,
|
|
472
|
+
multiple: !0,
|
|
473
|
+
className: "hidden",
|
|
474
|
+
onChange: (e) => {
|
|
475
|
+
let t = Array.from(e.target.files ?? []);
|
|
476
|
+
t.length > 0 && M((e) => [...e, ...t]), e.target.value = "";
|
|
477
|
+
}
|
|
478
|
+
}), /* @__PURE__ */ u("button", {
|
|
479
|
+
type: "button",
|
|
480
|
+
onClick: () => Le.current?.click(),
|
|
481
|
+
"aria-label": "Attach a data file",
|
|
482
|
+
"data-testid": "assistant-widget-upload",
|
|
483
|
+
className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary transition-colors hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
484
|
+
children: /* @__PURE__ */ u(se, { className: "size-4" })
|
|
485
|
+
})] }) : null,
|
|
486
|
+
q.isSupported ? /* @__PURE__ */ u("button", {
|
|
446
487
|
type: "button",
|
|
447
|
-
onClick:
|
|
488
|
+
onClick: Ye,
|
|
448
489
|
"aria-label": q.isListening ? "Stop voice input" : "Start voice input",
|
|
449
490
|
"aria-pressed": q.isListening,
|
|
450
491
|
"data-testid": "assistant-widget-mic",
|
|
451
492
|
className: e("flex size-9 shrink-0 items-center justify-center rounded-lg transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer", q.isListening ? "animate-pulse bg-status-error-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:text-text-primary"),
|
|
452
|
-
children: /* @__PURE__ */
|
|
493
|
+
children: /* @__PURE__ */ u(ie, { className: "size-4" })
|
|
453
494
|
}) : null,
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
-
ref:
|
|
495
|
+
/* @__PURE__ */ u("textarea", {
|
|
496
|
+
ref: H,
|
|
456
497
|
value: k,
|
|
457
498
|
onChange: (e) => A(e.target.value),
|
|
458
|
-
onKeyDown:
|
|
459
|
-
onInput:
|
|
499
|
+
onKeyDown: qe,
|
|
500
|
+
onInput: Je,
|
|
460
501
|
rows: 1,
|
|
461
|
-
placeholder:
|
|
502
|
+
placeholder: ke,
|
|
462
503
|
"aria-label": "Message the assistant",
|
|
463
504
|
"data-testid": "assistant-widget-input",
|
|
464
505
|
className: "flex-1 resize-none rounded-lg border border-border-default bg-bg-sunken px-3 py-2 text-xs leading-relaxed text-text-primary placeholder:text-text-muted focus:border-action-primary-bg focus:outline-none"
|
|
465
506
|
}),
|
|
466
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ u("button", {
|
|
467
508
|
type: "button",
|
|
468
509
|
onClick: () => void $(),
|
|
469
|
-
disabled:
|
|
510
|
+
disabled: N || k.trim().length === 0 && j.length === 0,
|
|
470
511
|
"aria-label": "Send message",
|
|
471
512
|
"data-testid": "assistant-widget-send",
|
|
472
513
|
className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:opacity-50 cursor-pointer",
|
|
473
|
-
children:
|
|
514
|
+
children: N ? /* @__PURE__ */ u(c, { className: "size-4 animate-spin" }) : /* @__PURE__ */ u(le, { className: "size-4" })
|
|
474
515
|
})
|
|
475
516
|
]
|
|
476
517
|
})
|
|
@@ -479,4 +520,4 @@ var m = ({ transport: d, modes: f, defaultModeId: m, title: h = "AI Assistant",
|
|
|
479
520
|
}) : null] }) : null;
|
|
480
521
|
};
|
|
481
522
|
//#endregion
|
|
482
|
-
export {
|
|
523
|
+
export { f as ASSISTANT_WIDGET_TOGGLE_EVENT, ve as AssistantWidget };
|
|
@@ -21,6 +21,14 @@ export interface AssistantWidgetMessage {
|
|
|
21
21
|
export interface AssistantSendArgs {
|
|
22
22
|
/** The user's prompt text. */
|
|
23
23
|
prompt: string;
|
|
24
|
+
/**
|
|
25
|
+
* Files the user attached via the upload button, if any. The widget stays
|
|
26
|
+
* parsing-free (Layer 1): it only carries the raw `File`s through. The host
|
|
27
|
+
* transport is responsible for extracting text/rows (JSON/CSV natively,
|
|
28
|
+
* Excel/PDF via its own deps) and folding a capped preview into the prompt it
|
|
29
|
+
* sends to the agent. Omitted/empty when the host disables `enableAttachments`.
|
|
30
|
+
*/
|
|
31
|
+
attachments?: File[];
|
|
24
32
|
/**
|
|
25
33
|
* Called repeatedly with the latest partial assistant text while the turn
|
|
26
34
|
* streams. The widget renders this live so users see progress.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/shared/components/assistantWidget/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,WAAW,CAAC;AAEvD,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,mBAAmB,CAAC;IAC1B,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yDAAyD;IACzD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,I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AAsB,EAAE,CAAC,CAAC;IAOtD,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACnD,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnE"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/shared/components/assistantWidget/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,WAAW,CAAC;AAEvD,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,mBAAmB,CAAC;IAC1B,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yDAAyD;IACzD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC;IACrB;;;OAGG;IACH,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,8DAA8D;IAC9D,MAAM,EAAE,WAAW,CAAC;CACrB;AAED;;;GAGG;AACH;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,mDAAmD;AACnD,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD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