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