@burdenoff/fe-libs 2026.1112.3 → 2026.1112.5
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/api.d.ts +7 -0
- package/dist/shared/assistant/api.js +47 -45
- package/dist/shared/assistant/createSandboxAssistantTransport.js +2 -1
- package/dist/shared/assistant/gatewayClient.js +1 -0
- package/dist/shared/assistant/index.d.ts +4 -0
- package/dist/shared/assistant/keepAlive.d.ts +74 -0
- package/dist/shared/assistant/keepAlive.js +77 -0
- package/dist/shared/assistant/prewarm.d.ts +20 -0
- package/dist/shared/assistant/prewarm.js +25 -4
- package/dist/shared/assistant/runtime.d.ts +7 -2
- package/dist/shared/assistant/runtime.js +23 -22
- package/dist/shared/assistant/signInWarm.d.ts +60 -0
- package/dist/shared/assistant/signInWarm.js +111 -0
- package/dist/shared/assistant/snapshotPoller.d.ts +16 -0
- package/dist/shared/assistant/snapshotPoller.js +29 -22
- package/dist/shared/assistant/staleSession.d.ts +27 -0
- package/dist/shared/assistant/staleSession.js +15 -0
- package/dist/shared/assistant/turnProgress.d.ts +16 -0
- package/dist/shared/assistant/turnProgress.js +30 -4
- package/dist/shared/assistant/ui/AssistantChatArea.js +1286 -1271
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts +7 -0
- package/dist/shared/assistant/ui/AssistantOverlay.js +256 -248
- package/dist/shared/assistant/usageReporting.d.ts +18 -0
- package/dist/shared/assistant/usageReporting.js +17 -5
- package/dist/shared/assistant/useAssistantHeartbeat.d.ts +24 -4
- package/dist/shared/assistant/useAssistantHeartbeat.js +43 -24
- package/dist/shared/assistant/useAssistantSignInWarm.d.ts +19 -0
- package/dist/shared/assistant/useAssistantSignInWarm.js +55 -0
- package/dist/shared/assistant/writeProposals.d.ts +9 -0
- package/dist/shared/components/assistantWidget/AssistantWidget.d.ts +7 -0
- package/dist/shared/components/assistantWidget/AssistantWidget.js +289 -285
- package/dist/shared/providers/shell/AuthTokenProvider.d.ts +6 -0
- package/dist/shared/providers/shell/AuthTokenProvider.js +4 -1
- package/dist/shared/providers/shell/index.d.ts +1 -1
- package/dist/shared-assistant.js +374 -370
- package/dist/shared-providers-shell.js +12 -12
- package/dist/storage/index.d.ts +2 -0
- package/dist/storage/index.js +6 -5
- package/dist/storage/uploadBlob.d.ts +3 -0
- package/dist/storage/uploadBlob.js +39 -37
- package/dist/storage/uploadVisibility.d.ts +3 -0
- package/dist/storage/uploadVisibility.js +6 -0
- package/dist/storage/useSaveToFiles.d.ts +3 -0
- package/dist/storage/useSaveToFiles.js +57 -53
- package/package.json +1 -1
|
@@ -7,441 +7,449 @@ import { useAssistantVisualViewport as a } from "./useAssistantVisualViewport.js
|
|
|
7
7
|
import { assistantPanelOwnsEscape as o } from "./panelOverlays.js";
|
|
8
8
|
import { AssistantPanelPlaceholder as s } from "./AssistantPanelPlaceholder.js";
|
|
9
9
|
import { scheduleAssistantPanelPreload as c, useAssistantPanelLoaded as l, useAssistantPanelModule as u } from "./assistantPanelLoader.js";
|
|
10
|
-
import { ASSISTANT_COMPACT_DOCKED_DEFAULT_QUERY as d, ASSISTANT_DOCK_WIDTH_VAR as f, ASSISTANT_OVERLAY_DESKTOP_QUERY as p, ASSISTANT_OVERLAY_TOP_VAR as ee, ASSISTANT_PANEL_INSET_VAR as te, ASSISTANT_SHEET_BOTTOM_VAR as ne, ASSISTANT_WINDOW_BOTTOM_VAR as m, assistantCompactLauncherBottom as h, assistantCompactLauncherVisibility as re, assistantCompactOverlayClassName as ie, assistantCompactOverlayKeys as ae, assistantLauncherBottom as g, assistantLauncherRight as oe, assistantOverlayClassName as _, assistantOverlayEscapeAction as se, assistantOverlayKeys as v, assistantQuotaKindOf as
|
|
11
|
-
import { AskAboutLayer as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
10
|
+
import { ASSISTANT_COMPACT_DOCKED_DEFAULT_QUERY as d, ASSISTANT_DOCK_WIDTH_VAR as f, ASSISTANT_OVERLAY_DESKTOP_QUERY as p, ASSISTANT_OVERLAY_TOP_VAR as ee, ASSISTANT_PANEL_INSET_VAR as te, ASSISTANT_SHEET_BOTTOM_VAR as ne, ASSISTANT_WINDOW_BOTTOM_VAR as m, assistantCompactLauncherBottom as h, assistantCompactLauncherVisibility as re, assistantCompactOverlayClassName as ie, assistantCompactOverlayKeys as ae, assistantLauncherBottom as g, assistantLauncherRight as oe, assistantOverlayClassName as _, assistantOverlayEscapeAction as se, assistantOverlayKeys as v, assistantQuotaKindOf as ce, assistantWindowBottom as le, closestAround as ue, createAssistantNavigate as y, isAssistantSurface as de, isAssistantToggleShortcut as fe, nextAssistantOpenState as b, publishedAssistantDockWidth as pe, publishedAssistantPanelInset as me, publishedCompactDockWidth as x, publishedCompactPanelInset as he, readAssistantLayoutChoice as ge, readAssistantLegacyDockChoice as _e, readAssistantOverlayFlag as S, readAssistantWindowView as C, requestedAssistantOpenState as w, resolveCompactDocked as ve, writeAssistantLayoutChoice as T, writeAssistantOverlayFlag as E, writeAssistantWindowView as ye } from "./assistantOverlayState.js";
|
|
11
|
+
import { AskAboutLayer as be } from "../askAbout/AskAboutLayer.js";
|
|
12
|
+
import { useAssistantSignInWarm as xe } from "../useAssistantSignInWarm.js";
|
|
13
|
+
import { useAssistantProductOrNull as D } from "../product.js";
|
|
14
|
+
import { createContext as O, useCallback as k, useContext as A, useEffect as j, useMemo as M, useRef as N, useState as P, useSyncExternalStore as F } from "react";
|
|
15
|
+
import { Sparkles as I } from "lucide-react";
|
|
16
|
+
import { jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
15
17
|
// src/shared/assistant/ui/AssistantOverlay.tsx
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
return
|
|
18
|
+
var z = O(null);
|
|
19
|
+
function B() {
|
|
20
|
+
return A(z);
|
|
19
21
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
22
|
+
function V() {
|
|
23
|
+
return A(z)?.dockWidthPx ?? 0;
|
|
22
24
|
}
|
|
23
|
-
function
|
|
24
|
-
return
|
|
25
|
+
function H() {
|
|
26
|
+
return A(z)?.panelInsetPx ?? 0;
|
|
25
27
|
}
|
|
26
|
-
var
|
|
27
|
-
function
|
|
28
|
+
var U = () => typeof window > "u" ? void 0 : window.sessionStorage, W = () => typeof window > "u" ? void 0 : window.localStorage;
|
|
29
|
+
function G(e) {
|
|
28
30
|
if (typeof window > "u" || typeof window.matchMedia != "function") return () => {};
|
|
29
31
|
let t = window.matchMedia(p);
|
|
30
32
|
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
31
33
|
}
|
|
32
|
-
function
|
|
34
|
+
function K() {
|
|
33
35
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(min-width: 640px)").matches;
|
|
34
36
|
}
|
|
35
|
-
function
|
|
36
|
-
return
|
|
37
|
+
function Se() {
|
|
38
|
+
return F(G, K, () => !1);
|
|
37
39
|
}
|
|
38
|
-
function
|
|
39
|
-
let r =
|
|
40
|
-
|
|
40
|
+
function Ce(t, n) {
|
|
41
|
+
let r = N(n);
|
|
42
|
+
j(() => {
|
|
41
43
|
r.current = n;
|
|
42
|
-
}, [n]),
|
|
44
|
+
}, [n]), j(() => {
|
|
43
45
|
if (!t || typeof window > "u") return;
|
|
44
|
-
let n = e(t), i = (e) => r.current(
|
|
46
|
+
let n = e(t), i = (e) => r.current(ce(e), e);
|
|
45
47
|
return window.addEventListener(n, i), () => window.removeEventListener(n, i);
|
|
46
48
|
}, [t]);
|
|
47
49
|
}
|
|
48
|
-
var
|
|
49
|
-
function
|
|
50
|
+
var we = () => {};
|
|
51
|
+
function q(e) {
|
|
50
52
|
if (typeof window > "u" || typeof window.matchMedia != "function") return () => {};
|
|
51
53
|
let t = window.matchMedia(d);
|
|
52
54
|
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
53
55
|
}
|
|
54
|
-
function
|
|
56
|
+
function J() {
|
|
55
57
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(min-width: 1280px)").matches;
|
|
56
58
|
}
|
|
57
|
-
var
|
|
58
|
-
function
|
|
59
|
-
return
|
|
59
|
+
var Y = () => () => {}, X = () => !1;
|
|
60
|
+
function Te(e) {
|
|
61
|
+
return F(e ? q : Y, e ? J : X, X);
|
|
60
62
|
}
|
|
61
|
-
function
|
|
62
|
-
let i =
|
|
63
|
-
|
|
63
|
+
function Ee({ keyPrefix: e, quota: t, presentation: n = "classic", children: r }) {
|
|
64
|
+
let i = M(() => v(e), [e]), a = M(() => ae(e), [e]), o = n === "compact", s = N(o);
|
|
65
|
+
j(() => {
|
|
64
66
|
s.current = o;
|
|
65
67
|
}, [o]);
|
|
66
|
-
let [c, l] =
|
|
68
|
+
let [c, l] = P(() => S(U, i.openStorageKey)), [u, d] = P(() => S(W, i.dockStorageKey)), [p, ee] = P(() => {
|
|
67
69
|
if (!o) return "panel";
|
|
68
70
|
try {
|
|
69
|
-
let e =
|
|
70
|
-
return
|
|
71
|
+
let e = U()?.getItem(a.surfaceStorageKey);
|
|
72
|
+
return de(e) ? e : "panel";
|
|
71
73
|
} catch {
|
|
72
74
|
return "panel";
|
|
73
75
|
}
|
|
74
|
-
}), [ne, m] =
|
|
76
|
+
}), [ne, m] = P(() => o && S(U, a.minimizedStorageKey)), h = o && c && p === "window" && ne, [re, ie] = P(!1), g = o && c && p === "panel" && re, [oe] = P(() => o ? C(W, a.windowViewStorageKey) : null), [_, se] = P(null), ce = _ ?? oe, le = k((e) => {
|
|
75
77
|
s.current && se(e);
|
|
76
|
-
}, []), [
|
|
77
|
-
explicit:
|
|
78
|
-
legacy:
|
|
78
|
+
}, []), [ue] = P(() => o ? {
|
|
79
|
+
explicit: ge(W, a.layoutStorageKey),
|
|
80
|
+
legacy: _e(W, i.dockStorageKey)
|
|
79
81
|
} : {
|
|
80
82
|
explicit: null,
|
|
81
83
|
legacy: null
|
|
82
|
-
}), [
|
|
83
|
-
explicit:
|
|
84
|
-
legacy:
|
|
85
|
-
wideViewport:
|
|
86
|
-
}) : u,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, [
|
|
90
|
-
let
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
}), [y, be] = P(null), xe = Te(o), D = o ? ve({
|
|
85
|
+
explicit: y ?? ue.explicit,
|
|
86
|
+
legacy: ue.legacy,
|
|
87
|
+
wideViewport: xe
|
|
88
|
+
}) : u, O = N(D);
|
|
89
|
+
j(() => {
|
|
90
|
+
O.current = D;
|
|
91
|
+
}, [D]);
|
|
92
|
+
let A = N(null), F = N(c);
|
|
93
|
+
j(() => {
|
|
94
|
+
F.current = c;
|
|
93
95
|
}, [c]);
|
|
94
|
-
let
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}, [
|
|
98
|
-
let
|
|
99
|
-
let e =
|
|
96
|
+
let I = N(!1), R = c && (!o || p === "panel" && !h);
|
|
97
|
+
j(() => {
|
|
98
|
+
I.current = R;
|
|
99
|
+
}, [R]);
|
|
100
|
+
let B = k(() => {
|
|
101
|
+
let e = A.current?.() === !0;
|
|
100
102
|
return e && s.current && m(!1), e;
|
|
101
|
-
}, []),
|
|
102
|
-
|
|
103
|
-
}), []),
|
|
103
|
+
}, []), V = k((e) => (A.current = e, () => {
|
|
104
|
+
A.current === e && (A.current = null);
|
|
105
|
+
}), []), H = k(() => {
|
|
104
106
|
l(!0), ee("panel"), m(!1);
|
|
105
|
-
}, []),
|
|
106
|
-
l(!1), m(!1), ie(!1),
|
|
107
|
-
}, []),
|
|
108
|
-
s.current ?
|
|
109
|
-
}, [
|
|
110
|
-
|
|
111
|
-
}, [
|
|
107
|
+
}, []), G = k(() => {
|
|
108
|
+
l(!1), m(!1), ie(!1), Ee(0);
|
|
109
|
+
}, []), K = k(() => {
|
|
110
|
+
s.current ? H() : l(!0);
|
|
111
|
+
}, [H]), q = k(() => {
|
|
112
|
+
B() || (s.current ? G() : l(!1));
|
|
113
|
+
}, [B, G]), J = k(() => {
|
|
112
114
|
if (s.current) {
|
|
113
|
-
if (
|
|
114
|
-
if (
|
|
115
|
-
|
|
116
|
-
} else
|
|
117
|
-
} else
|
|
115
|
+
if (I.current) {
|
|
116
|
+
if (B()) return;
|
|
117
|
+
G();
|
|
118
|
+
} else H();
|
|
119
|
+
} else F.current && B() || l((e) => !e);
|
|
118
120
|
}, [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
]),
|
|
121
|
+
B,
|
|
122
|
+
G,
|
|
123
|
+
H
|
|
124
|
+
]), Y = k(() => {
|
|
123
125
|
if (s.current) {
|
|
124
|
-
let e =
|
|
125
|
-
|
|
126
|
+
let e = O.current ? "floating" : "docked";
|
|
127
|
+
O.current = e === "docked", be(e);
|
|
126
128
|
} else d((e) => !e);
|
|
127
|
-
}, []), [
|
|
128
|
-
|
|
129
|
-
}, [
|
|
130
|
-
s.current ?
|
|
131
|
-
}, []),
|
|
132
|
-
s.current &&
|
|
129
|
+
}, []), [X, Ee] = P(0), Z = k((e) => {
|
|
130
|
+
K(), s.current && e?.menu === "settings/avatar" && Ee((e) => e + 1);
|
|
131
|
+
}, [K]), De = k(() => {
|
|
132
|
+
s.current ? I.current || (l(!0), ee("window"), m(!1)) : l(!0);
|
|
133
|
+
}, []), Oe = k(() => {
|
|
134
|
+
s.current && F.current && !I.current && m(!0);
|
|
133
135
|
}, []);
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}, [i.openStorageKey, c]),
|
|
137
|
-
o ||
|
|
136
|
+
j(() => {
|
|
137
|
+
E(U, i.openStorageKey, c);
|
|
138
|
+
}, [i.openStorageKey, c]), j(() => {
|
|
139
|
+
o || E(W, i.dockStorageKey, u);
|
|
138
140
|
}, [
|
|
139
141
|
o,
|
|
140
142
|
i.dockStorageKey,
|
|
141
143
|
u
|
|
142
|
-
]),
|
|
143
|
-
o &&
|
|
144
|
+
]), j(() => {
|
|
145
|
+
o && y !== null && T(W, a.layoutStorageKey, y);
|
|
144
146
|
}, [
|
|
145
147
|
o,
|
|
146
148
|
a.layoutStorageKey,
|
|
147
|
-
|
|
148
|
-
]),
|
|
149
|
-
o && _ !== null &&
|
|
149
|
+
y
|
|
150
|
+
]), j(() => {
|
|
151
|
+
o && _ !== null && ye(W, a.windowViewStorageKey, _);
|
|
150
152
|
}, [
|
|
151
153
|
o,
|
|
152
154
|
a.windowViewStorageKey,
|
|
153
155
|
_
|
|
154
|
-
]),
|
|
156
|
+
]), j(() => {
|
|
155
157
|
if (o) try {
|
|
156
|
-
|
|
158
|
+
U()?.setItem(a.surfaceStorageKey, p);
|
|
157
159
|
} catch {}
|
|
158
160
|
}, [
|
|
159
161
|
o,
|
|
160
162
|
a.surfaceStorageKey,
|
|
161
163
|
p
|
|
162
|
-
]),
|
|
163
|
-
o &&
|
|
164
|
+
]), j(() => {
|
|
165
|
+
o && E(U, a.minimizedStorageKey, h);
|
|
164
166
|
}, [
|
|
165
167
|
o,
|
|
166
168
|
a.minimizedStorageKey,
|
|
167
169
|
h
|
|
168
|
-
]),
|
|
170
|
+
]), j(() => {
|
|
169
171
|
if (typeof window > "u") return;
|
|
170
172
|
let e = (e) => {
|
|
171
|
-
let t =
|
|
172
|
-
s.current ? t === !0 ?
|
|
173
|
+
let t = w(e);
|
|
174
|
+
s.current ? t === !0 ? H() : t === !1 ? F.current && !B() && G() : I.current ? B() || G() : H() : (!F.current || b(!0, t) || A.current?.() !== !0) && l((e) => b(e, t));
|
|
173
175
|
};
|
|
174
176
|
return window.addEventListener(i.toggleEvent, e), () => window.removeEventListener(i.toggleEvent, e);
|
|
175
177
|
}, [
|
|
176
178
|
i.toggleEvent,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
]),
|
|
179
|
+
H,
|
|
180
|
+
G,
|
|
181
|
+
B
|
|
182
|
+
]), j(() => {
|
|
181
183
|
if (typeof document > "u") return;
|
|
182
184
|
let e = (e) => {
|
|
183
|
-
|
|
185
|
+
fe(e) && (e.preventDefault(), s.current ? I.current ? B() || G() : H() : F.current && A.current?.() === !0 || l((e) => !e));
|
|
184
186
|
};
|
|
185
187
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
186
188
|
}, [
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
]),
|
|
191
|
-
let
|
|
189
|
+
H,
|
|
190
|
+
G,
|
|
191
|
+
B
|
|
192
|
+
]), Ce(t?.product ?? null, t?.onExhausted ?? we);
|
|
193
|
+
let Q = Se(), ke = o ? x({
|
|
192
194
|
isOpen: c,
|
|
193
|
-
docked:
|
|
194
|
-
isDesktop:
|
|
195
|
+
docked: D,
|
|
196
|
+
isDesktop: Q,
|
|
195
197
|
surface: p,
|
|
196
198
|
expanded: g
|
|
197
|
-
}) :
|
|
199
|
+
}) : pe({
|
|
198
200
|
isOpen: c,
|
|
199
201
|
docked: u,
|
|
200
|
-
isDesktop:
|
|
201
|
-
}),
|
|
202
|
+
isDesktop: Q
|
|
203
|
+
}), $ = o ? he({
|
|
202
204
|
isOpen: c,
|
|
203
|
-
docked:
|
|
204
|
-
isDesktop:
|
|
205
|
+
docked: D,
|
|
206
|
+
isDesktop: Q,
|
|
205
207
|
surface: p,
|
|
206
208
|
expanded: g
|
|
207
|
-
}) :
|
|
209
|
+
}) : me({
|
|
208
210
|
isOpen: c,
|
|
209
211
|
docked: u,
|
|
210
|
-
isDesktop:
|
|
212
|
+
isDesktop: Q
|
|
211
213
|
});
|
|
212
|
-
|
|
214
|
+
j(() => {
|
|
213
215
|
if (typeof document > "u") return;
|
|
214
216
|
let e = document.documentElement.style;
|
|
215
|
-
return e.setProperty(f, `${
|
|
217
|
+
return e.setProperty(f, `${ke}px`), () => {
|
|
216
218
|
e.removeProperty(f);
|
|
217
219
|
};
|
|
218
|
-
}, [
|
|
220
|
+
}, [ke]), j(() => {
|
|
219
221
|
if (typeof document > "u") return;
|
|
220
222
|
let e = document.documentElement.style;
|
|
221
|
-
return e.setProperty(te, `${
|
|
223
|
+
return e.setProperty(te, `${$}px`), () => {
|
|
222
224
|
e.removeProperty(te);
|
|
223
225
|
};
|
|
224
|
-
}, [
|
|
225
|
-
let Ae =
|
|
226
|
+
}, [$]);
|
|
227
|
+
let Ae = M(() => ({
|
|
226
228
|
isOpen: c,
|
|
227
|
-
open:
|
|
228
|
-
close:
|
|
229
|
-
toggle:
|
|
230
|
-
docked:
|
|
231
|
-
toggleDock:
|
|
232
|
-
dockWidthPx:
|
|
233
|
-
panelInsetPx:
|
|
229
|
+
open: K,
|
|
230
|
+
close: q,
|
|
231
|
+
toggle: J,
|
|
232
|
+
docked: D,
|
|
233
|
+
toggleDock: Y,
|
|
234
|
+
dockWidthPx: ke,
|
|
235
|
+
panelInsetPx: $,
|
|
234
236
|
keys: i,
|
|
235
|
-
registerCloseGuard:
|
|
237
|
+
registerCloseGuard: V,
|
|
236
238
|
presentation: n,
|
|
237
239
|
surface: p,
|
|
238
240
|
minimized: h,
|
|
239
|
-
fullOpen:
|
|
240
|
-
openFull:
|
|
241
|
-
avatarSettingsRequest:
|
|
242
|
-
openWindow:
|
|
243
|
-
minimize:
|
|
241
|
+
fullOpen: R,
|
|
242
|
+
openFull: Z,
|
|
243
|
+
avatarSettingsRequest: X,
|
|
244
|
+
openWindow: De,
|
|
245
|
+
minimize: Oe,
|
|
244
246
|
expanded: g,
|
|
245
247
|
setExpanded: ie,
|
|
246
|
-
windowView: o ?
|
|
247
|
-
setWindowView:
|
|
248
|
+
windowView: o ? ce : null,
|
|
249
|
+
setWindowView: le
|
|
248
250
|
}), [
|
|
249
251
|
c,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
Oe,
|
|
252
|
+
K,
|
|
253
|
+
q,
|
|
254
|
+
J,
|
|
255
|
+
D,
|
|
256
|
+
Y,
|
|
256
257
|
ke,
|
|
258
|
+
$,
|
|
257
259
|
i,
|
|
258
|
-
|
|
260
|
+
V,
|
|
259
261
|
n,
|
|
260
262
|
p,
|
|
261
263
|
h,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
264
|
+
R,
|
|
265
|
+
Z,
|
|
266
|
+
X,
|
|
267
|
+
De,
|
|
268
|
+
Oe,
|
|
267
269
|
g,
|
|
268
270
|
o,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
+
ce,
|
|
272
|
+
le
|
|
271
273
|
]);
|
|
272
|
-
return /* @__PURE__ */ z
|
|
274
|
+
return /* @__PURE__ */ L(z.Provider, {
|
|
273
275
|
value: Ae,
|
|
274
276
|
children: r
|
|
275
277
|
});
|
|
276
278
|
}
|
|
277
|
-
function
|
|
279
|
+
function Z(e) {
|
|
278
280
|
let { state: t, retry: n } = u();
|
|
279
|
-
if (t.status !== "ready") return /* @__PURE__ */
|
|
281
|
+
if (t.status !== "ready") return /* @__PURE__ */ L(s, {
|
|
280
282
|
failed: t.status === "failed",
|
|
281
283
|
onRetry: n
|
|
282
284
|
});
|
|
283
285
|
let { AIAssistantPanel: r } = t.module;
|
|
284
|
-
return /* @__PURE__ */
|
|
286
|
+
return /* @__PURE__ */ L(r, { ...e });
|
|
285
287
|
}
|
|
286
|
-
var
|
|
288
|
+
var De = (e, t) => /* @__PURE__ */ L(Z, {
|
|
287
289
|
...e,
|
|
288
290
|
...t
|
|
289
291
|
});
|
|
290
|
-
function
|
|
291
|
-
let t =
|
|
292
|
-
return t ? /* @__PURE__ */
|
|
292
|
+
function Oe(e) {
|
|
293
|
+
let t = B();
|
|
294
|
+
return t ? /* @__PURE__ */ L(Q, {
|
|
293
295
|
state: t,
|
|
294
296
|
...e
|
|
295
297
|
}) : null;
|
|
296
298
|
}
|
|
297
|
-
function
|
|
298
|
-
let { isOpen:
|
|
299
|
+
function Q({ state: e, panelId: s = "ai-assistant", panelProps: u, renderPanel: d, navigate: f, isShellLessTarget: p, topOffsetPx: te = 56, launcherIcon: ae, launcherBottomInset: v = "1.5rem", showLauncher: ce = !0, closeOnEscape: de = !0, warmOnSignIn: fe = !0 }) {
|
|
300
|
+
let { isOpen: b, close: pe, toggle: me, docked: x, toggleDock: he, dockWidthPx: ge } = e, _e = D()?.product ?? "";
|
|
301
|
+
xe({
|
|
302
|
+
product: _e,
|
|
303
|
+
enabled: fe,
|
|
304
|
+
panelOpen: b
|
|
305
|
+
});
|
|
306
|
+
let S = e.presentation === "compact", { surface: C, minimized: w, setExpanded: ve } = e, T = t();
|
|
299
307
|
r(u?.serverHistory === !0);
|
|
300
|
-
let [
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}, [
|
|
308
|
+
let [E, ye] = P(!1), O = N(null), A = N(null), F = Se(), [z, B] = P(0), [V, H] = P(0), U = l();
|
|
309
|
+
j(() => {
|
|
310
|
+
z !== 0 && O.current?.querySelector("[data-testid=\"assistant-input\"]")?.focus({ preventScroll: !0 });
|
|
311
|
+
}, [z, U]);
|
|
304
312
|
let W = !d;
|
|
305
|
-
|
|
313
|
+
j(() => {
|
|
306
314
|
if (W) return c();
|
|
307
|
-
}, [W]),
|
|
308
|
-
V !== 0 &&
|
|
309
|
-
}, [V, U]), a(
|
|
310
|
-
let G =
|
|
311
|
-
|
|
315
|
+
}, [W]), j(() => {
|
|
316
|
+
V !== 0 && O.current?.querySelector("[data-testid=\"assistant-window-language\"]")?.focus({ preventScroll: !0 });
|
|
317
|
+
}, [V, U]), a(O, S && b && !w && !F);
|
|
318
|
+
let G = N(u?.onExpandedChange);
|
|
319
|
+
j(() => {
|
|
312
320
|
G.current = u?.onExpandedChange;
|
|
313
321
|
});
|
|
314
|
-
let
|
|
315
|
-
|
|
316
|
-
}, [
|
|
322
|
+
let Ce = k((e) => {
|
|
323
|
+
ve(e), G.current?.(e);
|
|
324
|
+
}, [ve]), we = M(() => f ? y({
|
|
317
325
|
navigate: f,
|
|
318
326
|
isShellLessTarget: p,
|
|
319
|
-
isDesktop:
|
|
320
|
-
collapseSheet: () =>
|
|
327
|
+
isDesktop: K,
|
|
328
|
+
collapseSheet: () => ye(!1),
|
|
321
329
|
openInNewTab: (e) => window.open(e, "_blank", "noopener,noreferrer")
|
|
322
|
-
}) : void 0, [f, p]),
|
|
323
|
-
|
|
324
|
-
if (!
|
|
330
|
+
}) : void 0, [f, p]), q = S && C === "window" ? e.minimize : pe;
|
|
331
|
+
j(() => {
|
|
332
|
+
if (!b || !de || w) return;
|
|
325
333
|
let e = (e) => {
|
|
326
334
|
se({
|
|
327
335
|
key: e.key,
|
|
328
|
-
isOpen:
|
|
336
|
+
isOpen: b,
|
|
329
337
|
alreadyHandled: e.defaultPrevented,
|
|
330
338
|
dialogOpen: document.querySelector("[role=\"dialog\"],[role=\"alertdialog\"],dialog[open]") !== null,
|
|
331
|
-
pressedInsideDialog:
|
|
339
|
+
pressedInsideDialog: ue(e.target, "[role=\"dialog\"],[role=\"alertdialog\"],dialog[open]") !== null,
|
|
332
340
|
panelOwnsEscape: o()
|
|
333
|
-
}) === "close" && (e.preventDefault(),
|
|
341
|
+
}) === "close" && (e.preventDefault(), q());
|
|
334
342
|
};
|
|
335
343
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
336
344
|
}, [
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
345
|
+
b,
|
|
346
|
+
w,
|
|
347
|
+
q,
|
|
348
|
+
de
|
|
341
349
|
]);
|
|
342
|
-
let
|
|
343
|
-
|
|
344
|
-
if (
|
|
350
|
+
let J = N(w);
|
|
351
|
+
j(() => {
|
|
352
|
+
if (S && w && !J.current) {
|
|
345
353
|
let e = document.activeElement;
|
|
346
|
-
(!e || e === document.body ||
|
|
354
|
+
(!e || e === document.body || O.current?.contains(e)) && A.current?.focus({ preventScroll: !0 });
|
|
347
355
|
}
|
|
348
|
-
|
|
349
|
-
}, [
|
|
350
|
-
let
|
|
356
|
+
J.current = w;
|
|
357
|
+
}, [S, w]);
|
|
358
|
+
let Y = {
|
|
351
359
|
panelId: s,
|
|
352
|
-
visible: !
|
|
353
|
-
onClose:
|
|
354
|
-
docked:
|
|
355
|
-
onToggleDock:
|
|
356
|
-
onNavigate:
|
|
360
|
+
visible: !w,
|
|
361
|
+
onClose: pe,
|
|
362
|
+
docked: x,
|
|
363
|
+
onToggleDock: he,
|
|
364
|
+
onNavigate: we,
|
|
357
365
|
isShellLessTarget: p,
|
|
358
|
-
...
|
|
366
|
+
...S ? {
|
|
359
367
|
presentation: "compact",
|
|
360
|
-
surface:
|
|
368
|
+
surface: C,
|
|
361
369
|
onOpenFull: e.openFull,
|
|
362
370
|
avatarSettingsRequest: e.avatarSettingsRequest,
|
|
363
371
|
onMinimize: e.minimize,
|
|
364
|
-
onExpandedChange:
|
|
372
|
+
onExpandedChange: Ce,
|
|
365
373
|
windowView: e.windowView,
|
|
366
374
|
onWindowViewChange: e.setWindowView
|
|
367
375
|
} : {}
|
|
368
|
-
},
|
|
376
|
+
}, X = S ? T("overlay.launcherQuick", "Open quick assistant") : T("overlay.launcher", "AI Assistant"), Te = {
|
|
369
377
|
[ee]: `${te}px`,
|
|
370
378
|
[ne]: "var(--mobile-tabbar-height, 0px)"
|
|
371
|
-
},
|
|
372
|
-
...
|
|
373
|
-
[m]:
|
|
374
|
-
},
|
|
375
|
-
isOpen:
|
|
376
|
-
surface:
|
|
377
|
-
minimized:
|
|
378
|
-
}) :
|
|
379
|
-
!
|
|
379
|
+
}, Ee = {
|
|
380
|
+
...Te,
|
|
381
|
+
[m]: le(v)
|
|
382
|
+
}, Z = S ? re({
|
|
383
|
+
isOpen: b,
|
|
384
|
+
surface: C,
|
|
385
|
+
minimized: w
|
|
386
|
+
}) : b ? "desktop-only" : "always", Oe = (t) => {
|
|
387
|
+
!S || e.fullOpen ? me() : b && !w ? e.minimize() : (e.openWindow(), F || t.detail === 0 ? B((e) => e + 1) : H((e) => e + 1));
|
|
380
388
|
};
|
|
381
|
-
return /* @__PURE__ */
|
|
389
|
+
return /* @__PURE__ */ R(n, {
|
|
382
390
|
preview: u?.preview,
|
|
383
391
|
children: [
|
|
384
|
-
|
|
385
|
-
ref:
|
|
386
|
-
className:
|
|
387
|
-
surface:
|
|
388
|
-
minimized:
|
|
389
|
-
docked:
|
|
392
|
+
b && /* @__PURE__ */ R("div", {
|
|
393
|
+
ref: O,
|
|
394
|
+
className: S ? ie({
|
|
395
|
+
surface: C,
|
|
396
|
+
minimized: w,
|
|
397
|
+
docked: x,
|
|
390
398
|
expanded: e.expanded,
|
|
391
|
-
sheetExpanded:
|
|
399
|
+
sheetExpanded: E
|
|
392
400
|
}) : _({
|
|
393
|
-
expanded:
|
|
394
|
-
docked:
|
|
401
|
+
expanded: E,
|
|
402
|
+
docked: x
|
|
395
403
|
}),
|
|
396
|
-
style:
|
|
404
|
+
style: S ? Ee : Te,
|
|
397
405
|
"data-testid": "assistant-overlay",
|
|
398
|
-
...
|
|
406
|
+
...S ? {
|
|
399
407
|
id: s,
|
|
400
|
-
"data-surface":
|
|
401
|
-
...
|
|
408
|
+
"data-surface": C,
|
|
409
|
+
...w ? {
|
|
402
410
|
hidden: !0,
|
|
403
411
|
inert: !0,
|
|
404
412
|
"data-minimized": ""
|
|
405
413
|
} : {}
|
|
406
414
|
} : {},
|
|
407
|
-
children: [/* @__PURE__ */
|
|
415
|
+
children: [/* @__PURE__ */ L("button", {
|
|
408
416
|
type: "button",
|
|
409
|
-
onClick: () =>
|
|
417
|
+
onClick: () => ye((e) => !e),
|
|
410
418
|
className: "flex w-full shrink-0 justify-center pt-2 pb-1 sm:hidden",
|
|
411
|
-
"aria-label":
|
|
412
|
-
"aria-expanded":
|
|
419
|
+
"aria-label": E ? T("sheet.collapse", "Shrink the assistant") : T("sheet.expand", "Expand the assistant"),
|
|
420
|
+
"aria-expanded": E,
|
|
413
421
|
"data-testid": "assistant-sheet-handle",
|
|
414
|
-
children: /* @__PURE__ */
|
|
415
|
-
}), /* @__PURE__ */
|
|
422
|
+
children: /* @__PURE__ */ L("span", { className: "h-1.5 w-10 rounded-full bg-border-strong" })
|
|
423
|
+
}), /* @__PURE__ */ L("div", {
|
|
416
424
|
className: "flex min-h-0 flex-1 flex-col",
|
|
417
|
-
children: /* @__PURE__ */
|
|
425
|
+
children: /* @__PURE__ */ L(i.Provider, {
|
|
418
426
|
value: e.registerCloseGuard ?? null,
|
|
419
|
-
children: d ? d(
|
|
427
|
+
children: d ? d(Y) : De(u, Y)
|
|
420
428
|
})
|
|
421
429
|
})]
|
|
422
430
|
}),
|
|
423
|
-
|
|
424
|
-
ref:
|
|
431
|
+
ce && /* @__PURE__ */ L("button", {
|
|
432
|
+
ref: A,
|
|
425
433
|
type: "button",
|
|
426
|
-
onClick:
|
|
427
|
-
title:
|
|
428
|
-
"aria-label":
|
|
429
|
-
"aria-haspopup":
|
|
430
|
-
"aria-expanded":
|
|
431
|
-
...
|
|
434
|
+
onClick: Oe,
|
|
435
|
+
title: S ? X : T("overlay.launcherTitle", "AI Assistant ({{shortcut}})", { shortcut: "Ctrl+Shift+A" }),
|
|
436
|
+
"aria-label": X,
|
|
437
|
+
"aria-haspopup": S ? void 0 : "dialog",
|
|
438
|
+
"aria-expanded": S ? b && !w : b,
|
|
439
|
+
...S && b ? { "aria-controls": s } : {},
|
|
432
440
|
"data-testid": "assistant-fab",
|
|
433
441
|
style: {
|
|
434
|
-
bottom:
|
|
435
|
-
right: oe(
|
|
442
|
+
bottom: S ? h(v) : g(v),
|
|
443
|
+
right: oe(ge)
|
|
436
444
|
},
|
|
437
|
-
className: "fixed z-30 size-14 items-center justify-center rounded-full border border-border-strong bg-[var(--color-accent-soft)] text-action-primary-bg shadow-float transition-colors duration-200 hover:border-action-primary-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] cursor-pointer " + (
|
|
438
|
-
children: ae ?? /* @__PURE__ */
|
|
445
|
+
className: "fixed z-30 size-14 items-center justify-center rounded-full border border-border-strong bg-[var(--color-accent-soft)] text-action-primary-bg shadow-float transition-colors duration-200 hover:border-action-primary-bg focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] cursor-pointer " + (Z === "hidden" ? "hidden" : Z === "desktop-only" ? "hidden sm:inline-flex" : "inline-flex") + (S ? " max-[480px]:[--assistant-consent-clearance:var(--bf-consent-banner-offset,0px)]" : ""),
|
|
446
|
+
children: ae ?? /* @__PURE__ */ L(I, {
|
|
439
447
|
className: "size-6",
|
|
440
448
|
"aria-hidden": "true"
|
|
441
449
|
})
|
|
442
450
|
}),
|
|
443
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ L(be, { onOpenAssistant: e.openFull })
|
|
444
452
|
]
|
|
445
453
|
});
|
|
446
454
|
}
|
|
447
|
-
export {
|
|
455
|
+
export { Oe as AssistantOverlay, Ee as AssistantOverlayProvider, V as useAssistantDockWidth, B as useAssistantOverlayOrNull, H as useAssistantPanelInset, Ce as useAssistantQuotaExhausted };
|