@vercel/geistdocs 2.7.10 → 2.9.0
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/assets/icons/icon-fullscreen-close.d.ts +26 -0
- package/dist/assets/icons/icon-fullscreen-close.d.ts.map +1 -0
- package/dist/assets/icons/icon-fullscreen-close.js +25 -0
- package/dist/assets/icons/icon-fullscreen.d.ts +26 -0
- package/dist/assets/icons/icon-fullscreen.d.ts.map +1 -0
- package/dist/assets/icons/icon-fullscreen.js +25 -0
- package/dist/assets/icons/icon-thumb-down.d.ts +26 -0
- package/dist/assets/icons/icon-thumb-down.d.ts.map +1 -0
- package/dist/assets/icons/icon-thumb-down.js +25 -0
- package/dist/assets/icons/index.d.ts +3 -0
- package/dist/assets/icons/index.d.ts.map +1 -1
- package/dist/assets/icons/index.js +3 -0
- package/dist/cli/index.js +1 -1
- package/dist/config.d.ts +67 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/controls.d.ts +23 -1
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +44 -3
- package/dist/footer.js +1 -1
- package/dist/internal/chat/activity.d.ts +5 -1
- package/dist/internal/chat/activity.d.ts.map +1 -1
- package/dist/internal/chat/activity.js +11 -4
- package/dist/internal/chat/chat-user.d.ts +12 -0
- package/dist/internal/chat/chat-user.d.ts.map +1 -0
- package/dist/internal/chat/chat-user.js +27 -0
- package/dist/internal/chat/commands.d.ts +91 -0
- package/dist/internal/chat/commands.d.ts.map +1 -0
- package/dist/internal/chat/commands.js +165 -0
- package/dist/internal/chat/context.d.ts +49 -2
- package/dist/internal/chat/context.d.ts.map +1 -1
- package/dist/internal/chat/context.js +57 -4
- package/dist/internal/chat/message-actions.d.ts +15 -0
- package/dist/internal/chat/message-actions.d.ts.map +1 -0
- package/dist/internal/chat/message-actions.js +113 -0
- package/dist/internal/chat/message-feedback.d.ts +68 -0
- package/dist/internal/chat/message-feedback.d.ts.map +1 -0
- package/dist/internal/chat/message-feedback.js +188 -0
- package/dist/internal/chat/message-metadata.d.ts.map +1 -1
- package/dist/internal/chat/message-metadata.js +7 -1
- package/dist/internal/chat/message-text.d.ts +9 -0
- package/dist/internal/chat/message-text.d.ts.map +1 -0
- package/dist/internal/chat/message-text.js +15 -0
- package/dist/internal/chat/message.d.ts +4 -2
- package/dist/internal/chat/message.d.ts.map +1 -1
- package/dist/internal/chat/message.js +8 -1
- package/dist/internal/chat/options.d.ts +94 -0
- package/dist/internal/chat/options.d.ts.map +1 -0
- package/dist/internal/chat/options.js +171 -0
- package/dist/internal/chat/page-attachment.d.ts +12 -0
- package/dist/internal/chat/page-attachment.d.ts.map +1 -0
- package/dist/internal/chat/page-attachment.js +18 -0
- package/dist/internal/chat/session-provider.d.ts +33 -0
- package/dist/internal/chat/session-provider.d.ts.map +1 -0
- package/dist/internal/chat/session-provider.js +138 -0
- package/dist/internal/chat/session.d.ts +60 -0
- package/dist/internal/chat/session.d.ts.map +1 -0
- package/dist/internal/chat/session.js +85 -0
- package/dist/internal/chat/shell.d.ts.map +1 -1
- package/dist/internal/chat/shell.js +86 -157
- package/dist/internal/chat/use-chat-commands.d.ts +28 -0
- package/dist/internal/chat/use-chat-commands.d.ts.map +1 -0
- package/dist/internal/chat/use-chat-commands.js +62 -0
- package/dist/internal/chat/user-avatar.d.ts +7 -0
- package/dist/internal/chat/user-avatar.d.ts.map +1 -0
- package/dist/internal/chat/user-avatar.js +27 -0
- package/dist/internal/eve-agent-session-cookie.d.ts +68 -0
- package/dist/internal/eve-agent-session-cookie.d.ts.map +1 -0
- package/dist/internal/eve-agent-session-cookie.js +164 -0
- package/dist/internal/eve-agent-session.d.ts +9 -7
- package/dist/internal/eve-agent-session.d.ts.map +1 -1
- package/dist/internal/eve-agent-session.js +10 -13
- package/dist/internal/eve-agent.d.ts +96 -24
- package/dist/internal/eve-agent.d.ts.map +1 -1
- package/dist/internal/eve-agent.js +74 -51
- package/dist/internal/feedback-action.d.ts +14 -0
- package/dist/internal/feedback-action.d.ts.map +1 -1
- package/dist/internal/feedback-action.js +37 -5
- package/dist/internal/mdx-to-markdown.d.ts.map +1 -1
- package/dist/internal/mdx-to-markdown.js +226 -19
- package/dist/internal/page-actions-client.d.ts +9 -0
- package/dist/internal/page-actions-client.d.ts.map +1 -1
- package/dist/internal/page-actions-client.js +8 -4
- package/dist/internal/provider-client.d.ts.map +1 -1
- package/dist/internal/provider-client.js +10 -4
- package/dist/internal/use-mobile.d.ts +7 -0
- package/dist/internal/use-mobile.d.ts.map +1 -1
- package/dist/internal/use-mobile.js +17 -1
- package/dist/internal/webmcp-client.d.ts.map +1 -1
- package/dist/internal/webmcp-client.js +13 -3
- package/dist/internal/webmcp.d.ts +5 -1
- package/dist/internal/webmcp.d.ts.map +1 -1
- package/dist/internal/webmcp.js +31 -1
- package/dist/pages/changelog.d.ts.map +1 -1
- package/dist/pages/changelog.js +4 -0
- package/dist/pages/docs.d.ts.map +1 -1
- package/dist/pages/docs.js +2 -0
- package/dist/routes/chat.d.ts +83 -5
- package/dist/routes/chat.d.ts.map +1 -1
- package/dist/routes/chat.js +517 -80
- package/dist/routes/discovery.d.ts +1 -1
- package/dist/routes/discovery.d.ts.map +1 -1
- package/dist/routes/discovery.js +7 -11
- package/dist/routes/openapi.d.ts.map +1 -1
- package/dist/routes/openapi.js +47 -25
- package/docs/agents.md +3 -3
- package/docs/llms.txt +634 -37
- package/docs/manifest.json +3 -3
- package/docs/pages/agent-readiness.md +1 -1
- package/docs/pages/ask-ai.md +570 -26
- package/docs/pages/configuration.md +21 -1
- package/docs/pages/env.md +17 -3
- package/docs/pages/feedback.md +4 -0
- package/docs/pages/webmcp.md +18 -3
- package/docs/sitemap.md +1 -1
- package/package.json +1 -2
- package/template/.env.example +5 -0
- package/template/AGENTS.md +2 -0
- package/template/content/docs/agent-readiness.mdx +1 -1
- package/template/content/docs/ask-ai.cn.mdx +466 -15
- package/template/content/docs/ask-ai.mdx +570 -26
- package/template/content/docs/configuration.cn.mdx +39 -0
- package/template/content/docs/configuration.mdx +21 -1
- package/template/content/docs/env.cn.mdx +15 -1
- package/template/content/docs/env.mdx +18 -4
- package/template/content/docs/feedback.cn.mdx +4 -0
- package/template/content/docs/feedback.mdx +4 -0
- package/template/content/docs/webmcp.mdx +18 -3
- package/template/package.json +1 -2
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useChat } from "@ai-sdk/react";
|
|
4
|
-
import { DefaultChatTransport } from "ai";
|
|
5
|
-
import { useLiveQuery } from "dexie-react-hooks";
|
|
6
4
|
import { catchError } from "next/error";
|
|
7
|
-
import { usePathname } from "next/navigation";
|
|
8
5
|
import { Portal } from "radix-ui";
|
|
9
|
-
import {
|
|
10
|
-
import { IconChevronDoubleRight,
|
|
11
|
-
import { LogoIconVercelFillSvg } from "#geistdocs-assets/logos";
|
|
6
|
+
import { useEffect, useRef } from "react";
|
|
7
|
+
import { IconChevronDoubleRight, IconFullscreen, IconFullscreenClose, IconTrash, } from "#geistdocs-assets/icons";
|
|
12
8
|
import { Button } from "#geistdocs-ui/components/button";
|
|
13
9
|
import { Drawer, DrawerTitle } from "#geistdocs-ui/components/drawer";
|
|
14
10
|
import { Kbd } from "#geistdocs-ui/components/kbd";
|
|
@@ -16,160 +12,81 @@ import { Spinner } from "#geistdocs-ui/components/spinner";
|
|
|
16
12
|
import { useToasts } from "#geistdocs-ui/components/toasts";
|
|
17
13
|
import { Tooltip } from "#geistdocs-ui/components/tooltip";
|
|
18
14
|
import { cn } from "#geistdocs-ui/utils";
|
|
19
|
-
import {
|
|
20
|
-
import { requestEveAgentPrewarm } from "../eve-agent-session.js";
|
|
21
|
-
import { useIsMobile } from "../use-mobile";
|
|
15
|
+
import { useIsMobileAfterHydration } from "../use-mobile";
|
|
22
16
|
import { isActiveAssistantMessage, shouldShowPendingActivity, } from "./activity";
|
|
23
|
-
import {
|
|
17
|
+
import { useGeistdocsChatContext } from "./context";
|
|
24
18
|
import { Conversation, ConversationContent, ConversationScrollButton, } from "./conversation";
|
|
25
19
|
import { CopyChat } from "./copy-chat";
|
|
26
|
-
import { getChatDatabase } from "./db";
|
|
27
20
|
import { DotsSpinner } from "./dots-spinner";
|
|
28
21
|
import { Message, MessageContent, MessageResponse } from "./message";
|
|
22
|
+
import { MessageActions } from "./message-actions";
|
|
29
23
|
import { MessageMetadata } from "./message-metadata";
|
|
24
|
+
import { ChatMessagePageChip, ChatPageAttachmentCard } from "./page-attachment";
|
|
30
25
|
import { ChatPromptInput } from "./prompt-input";
|
|
26
|
+
import { GeistdocsChatSessionProvider, useChatSession, } from "./session-provider";
|
|
31
27
|
import { Suggestion, Suggestions } from "./suggestion";
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const useChatPersistence = (title) => {
|
|
46
|
-
const saveTimeoutRef = useRef(undefined);
|
|
47
|
-
const db = useMemo(() => getChatDatabase(title), [title]);
|
|
48
|
-
const storedMessages = useLiveQuery(() => db.messages.orderBy("sequence").toArray(), [db]);
|
|
28
|
+
import { useChatCommands } from "./use-chat-commands";
|
|
29
|
+
import { useChatUserAvatar } from "./user-avatar";
|
|
30
|
+
const ChatLoading = () => (_jsx("div", { className: "flex size-full w-full flex-col items-center justify-center overflow-hidden whitespace-nowrap rounded-xl xl:max-w-md xl:border xl:bg-background-100", children: _jsx(Spinner, {}) }));
|
|
31
|
+
// Centers the header, transcript, and composer when the panel fills the
|
|
32
|
+
// viewport, so lines stay readable on wide screens.
|
|
33
|
+
const EXPANDED_COLUMN = "mx-auto w-full max-w-5xl";
|
|
34
|
+
const GeistdocsChatInner = ({ active, expandable = false, isOpen, }) => {
|
|
35
|
+
const state = useChatSession();
|
|
36
|
+
const textareaRef = useRef(null);
|
|
37
|
+
const ready = state.status === "ready";
|
|
38
|
+
// Focus the prompt when the chat opens or finishes loading while open. It
|
|
39
|
+
// lives here rather than in the panel so the panel mounting when this
|
|
40
|
+
// shell becomes active (a breakpoint change) doesn't move focus.
|
|
49
41
|
useEffect(() => {
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
if (firstMessage && isFromPreviousDay(firstMessage.timestamp)) {
|
|
53
|
-
db.messages.clear();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}, [db, storedMessages]);
|
|
57
|
-
const freshMessages = storedMessages?.filter((message) => !isFromPreviousDay(message.timestamp));
|
|
58
|
-
const initialMessages = freshMessages?.map(({ timestamp, sequence, ...message }) => message) ?? [];
|
|
59
|
-
const isLoading = storedMessages === undefined;
|
|
60
|
-
const saveMessages = useCallback((messages) => {
|
|
61
|
-
if (saveTimeoutRef.current) {
|
|
62
|
-
clearTimeout(saveTimeoutRef.current);
|
|
63
|
-
}
|
|
64
|
-
saveTimeoutRef.current = setTimeout(async () => {
|
|
65
|
-
try {
|
|
66
|
-
const baseTimestamp = Date.now();
|
|
67
|
-
const messagesToStore = messages.map((message, index) => ({
|
|
68
|
-
...message,
|
|
69
|
-
timestamp: baseTimestamp + index * 1000,
|
|
70
|
-
sequence: index,
|
|
71
|
-
}));
|
|
72
|
-
await db.transaction("rw", db.messages, async () => {
|
|
73
|
-
await db.messages.clear();
|
|
74
|
-
await db.messages.bulkAdd(messagesToStore);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
catch (error) {
|
|
78
|
-
console.error("Failed to save messages:", error);
|
|
79
|
-
}
|
|
80
|
-
}, 300);
|
|
81
|
-
}, [db]);
|
|
82
|
-
const clearMessages = useCallback(async () => {
|
|
83
|
-
try {
|
|
84
|
-
if (saveTimeoutRef.current) {
|
|
85
|
-
clearTimeout(saveTimeoutRef.current);
|
|
86
|
-
saveTimeoutRef.current = undefined;
|
|
87
|
-
}
|
|
88
|
-
await db.messages.clear();
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
console.error("Failed to clear messages:", error);
|
|
92
|
-
}
|
|
93
|
-
}, [db]);
|
|
94
|
-
useEffect(() => () => {
|
|
95
|
-
if (saveTimeoutRef.current) {
|
|
96
|
-
clearTimeout(saveTimeoutRef.current);
|
|
42
|
+
if (!(isOpen && ready)) {
|
|
43
|
+
return;
|
|
97
44
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
45
|
+
const timer = setTimeout(() => {
|
|
46
|
+
textareaRef.current?.focus();
|
|
47
|
+
}, 100);
|
|
48
|
+
return () => clearTimeout(timer);
|
|
49
|
+
}, [isOpen, ready]);
|
|
50
|
+
// The inactive shell is hidden, so it renders nothing: only the visible
|
|
51
|
+
// shell subscribes to the chat and re-renders as a response streams. When
|
|
52
|
+
// the breakpoint changes, the newly active shell renders the shared
|
|
53
|
+
// conversation in full on its first render.
|
|
54
|
+
if (!active) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
if (state.status === "error") {
|
|
58
|
+
// Thrown here, inside the chat error boundary, so an invalid
|
|
59
|
+
// `ai.endpoint` or unreadable history fails the panel, not the page.
|
|
60
|
+
throw state.error;
|
|
61
|
+
}
|
|
62
|
+
if (state.status === "loading") {
|
|
63
|
+
return _jsx(ChatLoading, {});
|
|
64
|
+
}
|
|
65
|
+
return (_jsx(GeistdocsChatPanel, { clearConversation: state.clearConversation, expandable: expandable, session: state.session, textareaRef: textareaRef }));
|
|
105
66
|
};
|
|
106
|
-
const
|
|
107
|
-
const id = useId();
|
|
108
|
-
const pathname = usePathname();
|
|
109
|
-
const textareaRef = useRef(null);
|
|
110
|
-
const prewarmPromiseRef = useRef(null);
|
|
111
|
-
const [isInitialized, setIsInitialized] = useState(false);
|
|
67
|
+
const GeistdocsChatPanel = ({ clearConversation, expandable, session, textareaRef, }) => {
|
|
112
68
|
const toast = useToasts();
|
|
113
|
-
const { prompt, setPrompt, setIsOpen,
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
currentRoute: pathname,
|
|
128
|
-
eveAgentSession: prewarmedSession ?? undefined,
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
},
|
|
132
|
-
}),
|
|
133
|
-
onError: (error) => {
|
|
134
|
-
toast.error({ text: error.message });
|
|
135
|
-
},
|
|
69
|
+
const { prompt, setPrompt, setIsOpen, chatTitle, commands, commandState, footer, isExpanded: isExpandedState, setIsExpanded, suggestions, } = useGeistdocsChatContext();
|
|
70
|
+
const isExpanded = expandable && isExpandedState;
|
|
71
|
+
const expandLabel = isExpanded ? "Collapse chat" : "Expand chat";
|
|
72
|
+
const userAvatar = useChatUserAvatar();
|
|
73
|
+
const { messages, sendMessage, setMessages, status, stop } = useChat({
|
|
74
|
+
chat: session.chat,
|
|
75
|
+
});
|
|
76
|
+
const submitText = useChatCommands({
|
|
77
|
+
clearConversation,
|
|
78
|
+
commandState,
|
|
79
|
+
commands,
|
|
80
|
+
sendMessage,
|
|
81
|
+
status,
|
|
82
|
+
stop,
|
|
136
83
|
});
|
|
137
|
-
useEffect(() => {
|
|
138
|
-
if (!(isLoading || isInitialized) && initialMessages.length > 0) {
|
|
139
|
-
setMessages(initialMessages);
|
|
140
|
-
setIsInitialized(true);
|
|
141
|
-
}
|
|
142
|
-
else if (!(isLoading || isInitialized)) {
|
|
143
|
-
setIsInitialized(true);
|
|
144
|
-
}
|
|
145
|
-
}, [initialMessages, isInitialized, isLoading, setMessages]);
|
|
146
|
-
useEffect(() => {
|
|
147
|
-
if (prewarmEveAgent &&
|
|
148
|
-
isInitialized &&
|
|
149
|
-
messages.length === 0 &&
|
|
150
|
-
prewarmPromiseRef.current === null) {
|
|
151
|
-
prewarmPromiseRef.current = requestEveAgentPrewarm({ apiUrl: chatApi });
|
|
152
|
-
}
|
|
153
|
-
}, [chatApi, isInitialized, messages.length, prewarmEveAgent]);
|
|
154
|
-
useEffect(() => {
|
|
155
|
-
if (isInitialized && messages.length > 0) {
|
|
156
|
-
saveMessages(messages);
|
|
157
|
-
}
|
|
158
|
-
}, [isInitialized, messages, saveMessages]);
|
|
159
|
-
useEffect(() => {
|
|
160
|
-
if (isOpen) {
|
|
161
|
-
const timer = setTimeout(() => {
|
|
162
|
-
textareaRef.current?.focus();
|
|
163
|
-
}, 100);
|
|
164
|
-
return () => clearTimeout(timer);
|
|
165
|
-
}
|
|
166
|
-
}, [isOpen]);
|
|
167
84
|
const handleSuggestionClick = async (text) => {
|
|
168
85
|
if (status === "streaming" || status === "submitted") {
|
|
169
86
|
return;
|
|
170
87
|
}
|
|
171
88
|
setPrompt("");
|
|
172
|
-
await
|
|
89
|
+
await submitText(text);
|
|
173
90
|
};
|
|
174
91
|
const handleSubmit = async () => {
|
|
175
92
|
if (status === "streaming" || status === "submitted" || !prompt) {
|
|
@@ -177,12 +94,12 @@ const GeistdocsChatInner = ({ isOpen }) => {
|
|
|
177
94
|
}
|
|
178
95
|
const currentPrompt = prompt;
|
|
179
96
|
setPrompt("");
|
|
180
|
-
await
|
|
97
|
+
await submitText(currentPrompt);
|
|
181
98
|
};
|
|
182
99
|
const handleClearChat = async () => {
|
|
183
100
|
try {
|
|
184
|
-
await
|
|
185
|
-
|
|
101
|
+
await clearConversation();
|
|
102
|
+
commands.detachPage();
|
|
186
103
|
toast.success({ text: "Chat cleared" });
|
|
187
104
|
}
|
|
188
105
|
catch (error) {
|
|
@@ -193,33 +110,45 @@ const GeistdocsChatInner = ({ isOpen }) => {
|
|
|
193
110
|
});
|
|
194
111
|
}
|
|
195
112
|
};
|
|
196
|
-
|
|
197
|
-
return (_jsx("div", { className: "flex size-full w-full flex-col items-center justify-center overflow-hidden whitespace-nowrap rounded-xl xl:max-w-md xl:border xl:bg-background-100", children: _jsx(Spinner, {}) }));
|
|
198
|
-
}
|
|
199
|
-
return (_jsxs("aside", { "aria-label": "Ask AI chat", className: "flex size-full w-full flex-col overflow-hidden whitespace-nowrap bg-background-100", children: [_jsxs("div", { className: "sticky top-0 z-10 flex h-16 items-center justify-between bg-background-100 py-2 pr-2 pl-3.5", children: [_jsx("h2", { className: "font-semibold text-sm", children: "Ask AI" }), _jsxs("div", { className: "flex items-center gap-0.5", children: [_jsx(CopyChat, { messages: messages }), _jsx(Tooltip, { position: "bottom", text: "Delete chat", children: _jsx(Button, { "aria-label": "Delete chat", className: "text-gray-800! disabled:bg-gray-alpha-100!", disabled: messages.length === 0 ||
|
|
113
|
+
return (_jsxs("aside", { "aria-label": `${chatTitle} chat`, className: "flex size-full w-full flex-col overflow-hidden whitespace-nowrap bg-background-100", children: [_jsxs("div", { className: cn("sticky top-0 z-10 flex h-16 shrink-0 items-center justify-between bg-background-100 py-2 pr-2 pl-3.5", isExpanded && EXPANDED_COLUMN), children: [_jsx("h2", { className: "font-semibold text-sm", children: chatTitle }), _jsxs("div", { className: "flex items-center gap-0.5", children: [_jsx(CopyChat, { messages: messages }), expandable ? (_jsx(Tooltip, { position: "bottom", text: expandLabel, children: _jsx(Button, { "aria-label": expandLabel, "aria-pressed": isExpanded, className: "text-gray-800! shadow-none", onClick: () => setIsExpanded(!isExpanded), shape: "square", size: "small", svgOnly: true, typeName: "button", variant: "tertiary", children: isExpanded ? (_jsx(IconFullscreenClose, { size: 14 })) : (_jsx(IconFullscreen, { size: 14 })) }) })) : null, _jsx(Tooltip, { position: "bottom", text: "Delete chat", children: _jsx(Button, { "aria-label": "Delete chat", className: "text-gray-800! disabled:bg-gray-alpha-100!", disabled: messages.length === 0 ||
|
|
200
114
|
status === "streaming" ||
|
|
201
|
-
status === "submitted", onClick: handleClearChat, shape: "square", size: "small", svgOnly: true, typeName: "button", variant: "tertiary", children: _jsx(IconTrash, { size: 14 }) }) }), _jsx(Tooltip, { position: "bottom", text: "Close chat", children: _jsx(Button, { "aria-label": "Close chat", className: "text-gray-800! shadow-none", onClick: () => setIsOpen(false), shape: "square", size: "small", svgOnly: true, typeName: "button", variant: "tertiary", children: _jsx(IconChevronDoubleRight, { size: 14 }) }) })] })] }), _jsxs(Conversation, { children: [_jsxs(ConversationContent, { children: [messages.map((message, index) => (_jsxs(Message, { from: message.role, children: [_jsx(MessageMetadata, { inProgress: isActiveAssistantMessage({
|
|
115
|
+
status === "submitted", onClick: handleClearChat, shape: "square", size: "small", svgOnly: true, typeName: "button", variant: "tertiary", children: _jsx(IconTrash, { size: 14 }) }) }), _jsx(Tooltip, { position: "bottom", text: "Close chat", children: _jsx(Button, { "aria-label": "Close chat", className: "text-gray-800! shadow-none", onClick: () => setIsOpen(false), shape: "square", size: "small", svgOnly: true, typeName: "button", variant: "tertiary", children: _jsx(IconChevronDoubleRight, { size: 14 }) }) })] })] }), _jsxs(Conversation, { children: [_jsxs(ConversationContent, { className: cn(isExpanded && EXPANDED_COLUMN), children: [messages.map((message, index) => (_jsxs(Message, { avatar: message.role === "user" ? userAvatar : undefined, from: message.role, children: [_jsx(MessageMetadata, { inProgress: isActiveAssistantMessage({
|
|
202
116
|
index,
|
|
203
117
|
messages,
|
|
204
118
|
status,
|
|
205
|
-
}), parts: message.parts }), message.parts
|
|
119
|
+
}), parts: message.parts }), _jsx(ChatMessagePageChip, { metadata: message.metadata }), message.parts
|
|
206
120
|
.filter((part) => part.type === "text")
|
|
207
|
-
.map((part) => (_jsx(MessageContent, { children: _jsx(MessageResponse, { className: "text-wrap", children: part.text }) }, `${message.id}-${part.type}-${part.text}`)))] }, message.id))), shouldShowPendingActivity({ messages, status }) ? (_jsx("div", { className: "h-12 animate-pulse pt-2 text-gray-900 text-sm", children: _jsx(DotsSpinner, {}) })) : null] }), _jsx(ConversationScrollButton, {})] }), _jsxs("div", { className: "relative grid w-auto shrink-0 gap-3 whitespace-normal p-4 text-left", children: [messages.length ? null : (_jsxs(_Fragment, { children: [_jsx(Suggestions, { className: "w-full cursor-text", children: suggestions.
|
|
121
|
+
.map((part) => (_jsx(MessageContent, { children: _jsx(MessageResponse, { className: "text-wrap", children: part.text }) }, `${message.id}-${part.type}-${part.text}`))), _jsx(MessageActions, { index: index, messages: messages, setMessages: setMessages, status: status })] }, message.id))), shouldShowPendingActivity({ messages, status }) ? (_jsx("div", { className: "h-12 animate-pulse pt-2 text-gray-900 text-sm", children: _jsx(DotsSpinner, {}) })) : null] }), _jsx(ConversationScrollButton, {})] }), _jsxs("div", { className: cn("relative grid w-auto shrink-0 gap-3 whitespace-normal p-4 text-left", isExpanded && EXPANDED_COLUMN), children: [messages.length ? null : (_jsxs(_Fragment, { children: [_jsx(Suggestions, { className: "w-full cursor-text", children: suggestions.map((suggestion) => (_jsx(Suggestion, { className: "w-full", icon: suggestion.icon, onClick: handleSuggestionClick, suggestion: suggestion.text, variant: "tertiary" }, suggestion.key))) }), _jsxs("p", { className: "mb-3 whitespace-normal px-2 text-left text-gray-900 text-label-14", children: ["Tip: You can open and close chat with", _jsx(Kbd, { className: "material-base ml-1.5 text-gray-900", meta: true, small: true }), _jsx(Kbd, { className: "material-base ml-1 font-mono! text-gray-900", small: true, children: "I" })] })] })), commandState.attachedPage ? (_jsx(ChatPageAttachmentCard, { onRemove: commands.detachPage, page: commandState.attachedPage })) : null, _jsx(ChatPromptInput, { onChange: setPrompt, onStop: stop, onSubmit: (event) => {
|
|
208
122
|
event.preventDefault();
|
|
209
123
|
handleSubmit().catch((error) => {
|
|
210
124
|
console.error("Failed to submit chat message:", error);
|
|
211
125
|
});
|
|
212
126
|
}, status: status, textareaRef: textareaRef, value: prompt }), footer ? _jsx("div", { className: "text-gray-800 text-sm", children: footer }) : null] })] }));
|
|
213
127
|
};
|
|
214
|
-
const
|
|
128
|
+
const GeistdocsChatError = ({ chatTitle, onClose, retry, }) => {
|
|
129
|
+
const state = useChatSession();
|
|
130
|
+
const handleRetry = () => {
|
|
131
|
+
// The session error lives above this boundary, so resetting the boundary
|
|
132
|
+
// alone would throw it again: restart the failed load first. Errors
|
|
133
|
+
// without `retry` (an invalid `ai.endpoint`) fail again, by design.
|
|
134
|
+
if (state.status === "error") {
|
|
135
|
+
state.retry?.();
|
|
136
|
+
}
|
|
137
|
+
retry();
|
|
138
|
+
};
|
|
139
|
+
return (_jsxs("div", { className: "flex size-full flex-col items-start justify-center gap-4 p-6", "data-geistdocs-chat-error": true, role: "alert", children: [_jsxs("h2", { className: "font-semibold text-lg", children: [chatTitle, " couldn't load"] }), _jsxs("p", { className: "text-gray-900 text-sm", children: ["Try loading ", chatTitle, " again or close the panel to continue reading."] }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { onClick: handleRetry, typeName: "button", children: "Try again" }), _jsx(Button, { onClick: onClose, typeName: "button", variant: "secondary", children: "Close" })] })] }));
|
|
140
|
+
};
|
|
141
|
+
const GeistdocsChatErrorFallback = ({ chatTitle, onClose }, { retry }) => (_jsx(GeistdocsChatError, { chatTitle: chatTitle, onClose: onClose, retry: retry }));
|
|
215
142
|
const GeistdocsChatErrorBoundary = catchError(GeistdocsChatErrorFallback);
|
|
216
143
|
export const GeistdocsChatShell = () => {
|
|
217
|
-
const { enabled, isOpen, setIsOpen } =
|
|
218
|
-
|
|
144
|
+
const { chatTitle, enabled, isExpanded, isOpen, setIsOpen } = useGeistdocsChatContext();
|
|
145
|
+
// The shell mounts only on the client after hydration, so read the
|
|
146
|
+
// breakpoint now instead of starting as desktop for a frame.
|
|
147
|
+
const isMobile = useIsMobileAfterHydration();
|
|
219
148
|
if (!enabled) {
|
|
220
149
|
return null;
|
|
221
150
|
}
|
|
222
|
-
return (_jsxs(
|
|
151
|
+
return (_jsxs(GeistdocsChatSessionProvider, { children: [isOpen ? (_jsx("style", { children: `
|
|
223
152
|
html {
|
|
224
153
|
scrollbar-width: none !important;
|
|
225
154
|
-ms-overflow-style: none !important;
|
|
@@ -232,5 +161,5 @@ export const GeistdocsChatShell = () => {
|
|
|
232
161
|
// modal surfaces like the search command menu, dialogs, and
|
|
233
162
|
// dropdowns (z-50), so opening the command menu paints over an
|
|
234
163
|
// open chat panel.
|
|
235
|
-
"fixed inset-y-0 right-0 z-45 hidden h-full
|
|
164
|
+
"fixed inset-y-0 right-0 z-45 hidden h-full flex-col gap-4 border-l bg-background-100 transition-transform min-[768px]:flex", isExpanded ? "w-screen border-l-0" : "w-[400px] max-w-[75vw]", "translate-x-full data-[state=open]:translate-x-0"), "data-state": isOpen ? "open" : "closed", children: _jsx(GeistdocsChatErrorBoundary, { chatTitle: chatTitle, onClose: () => setIsOpen(false), children: _jsx(GeistdocsChatInner, { active: !isMobile, expandable: true, isOpen: isOpen }) }) }) }), _jsx("div", { className: "min-[768px]:hidden", children: _jsxs(Drawer, { className: "flex flex-col bg-background-100", height: "80dvh", onDismiss: () => setIsOpen(false), show: isMobile && isOpen, children: [_jsx(DrawerTitle, { className: "sr-only", children: chatTitle }), _jsx(GeistdocsChatErrorBoundary, { chatTitle: chatTitle, onClose: () => setIsOpen(false), children: _jsx(GeistdocsChatInner, { active: isMobile, isOpen: isOpen }) })] }) })] }));
|
|
236
165
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ChatRequestOptions } from "ai";
|
|
2
|
+
import { type ChatCommandQueue, type ChatCommandState } from "./commands";
|
|
3
|
+
/**
|
|
4
|
+
* Render the hook only in the active shell (desktop panel or mobile drawer),
|
|
5
|
+
* once stored history has loaded into the shared chat. Both shells use the
|
|
6
|
+
* same chat, so `sendMessage`, `status`, and `stop` act on one conversation.
|
|
7
|
+
*/
|
|
8
|
+
interface UseChatCommandsOptions {
|
|
9
|
+
/** Clear the stored and displayed conversation. */
|
|
10
|
+
clearConversation: () => Promise<void>;
|
|
11
|
+
commandState: ChatCommandState;
|
|
12
|
+
commands: ChatCommandQueue;
|
|
13
|
+
sendMessage: (message: {
|
|
14
|
+
metadata?: unknown;
|
|
15
|
+
text: string;
|
|
16
|
+
}, options?: ChatRequestOptions) => Promise<void>;
|
|
17
|
+
status: string;
|
|
18
|
+
stop: () => Promise<void> | void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Drains the provider's command queue into the chat: a requested clear runs
|
|
22
|
+
* first (stopping a streaming response), then queued questions are sent one
|
|
23
|
+
* at a time whenever the chat is idle. Returns `submitText`, which every
|
|
24
|
+
* submission path uses so an attached page travels with exactly one message.
|
|
25
|
+
*/
|
|
26
|
+
export declare const useChatCommands: ({ clearConversation, commandState, commands, sendMessage, status, stop, }: UseChatCommandsOptions) => (text: string) => Promise<void>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=use-chat-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-chat-commands.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/use-chat-commands.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AAE7C,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAEtB,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,UAAU,sBAAsB;IAC9B,mDAAmD;IACnD,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,WAAW,EAAE,CACX,OAAO,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAC7C,OAAO,CAAC,EAAE,kBAAkB,KACzB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAClC;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,2EAO7B,sBAAsB,YAER,MAAM,kBA4DtB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useEffect } from "react";
|
|
3
|
+
import { getNextChatCommand, } from "./commands";
|
|
4
|
+
/**
|
|
5
|
+
* Drains the provider's command queue into the chat: a requested clear runs
|
|
6
|
+
* first (stopping a streaming response), then queued questions are sent one
|
|
7
|
+
* at a time whenever the chat is idle. Returns `submitText`, which every
|
|
8
|
+
* submission path uses so an attached page travels with exactly one message.
|
|
9
|
+
*/
|
|
10
|
+
export const useChatCommands = ({ clearConversation, commandState, commands, sendMessage, status, stop, }) => {
|
|
11
|
+
const submitText = useCallback(async (text) => {
|
|
12
|
+
const page = commands.takeAttachedPage();
|
|
13
|
+
if (!page) {
|
|
14
|
+
await sendMessage({ text });
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
await sendMessage({ metadata: { page }, text }, { body: { pageContext: { url: page.url } } });
|
|
18
|
+
}, [commands, sendMessage]);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
// Holds the shared queue until the command settles: `sendMessage`
|
|
21
|
+
// resolves only after the response finishes, so the next question waits
|
|
22
|
+
// its turn even if the other shell becomes active meanwhile. The shells
|
|
23
|
+
// share one chat, so the next question carries the full history either
|
|
24
|
+
// way.
|
|
25
|
+
const run = (task, onSettled) => {
|
|
26
|
+
task()
|
|
27
|
+
.catch((error) => {
|
|
28
|
+
console.error("Failed to run chat command:", error);
|
|
29
|
+
})
|
|
30
|
+
.finally(() => {
|
|
31
|
+
onSettled?.();
|
|
32
|
+
commands.endCommand();
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
switch (getNextChatCommand({ state: commandState, status })) {
|
|
36
|
+
case "stop":
|
|
37
|
+
Promise.resolve(stop()).catch(() => undefined);
|
|
38
|
+
break;
|
|
39
|
+
case "clear":
|
|
40
|
+
if (commands.beginCommand()) {
|
|
41
|
+
run(clearConversation, commands.completeClear);
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
case "ask": {
|
|
45
|
+
if (!commands.beginCommand()) {
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
const next = commands.takeNextAsk();
|
|
49
|
+
if (next) {
|
|
50
|
+
run(() => submitText(next.text));
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
commands.endCommand();
|
|
54
|
+
}
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
default:
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}, [clearConversation, commandState, commands, status, stop, submitText]);
|
|
61
|
+
return submitText;
|
|
62
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The avatar shown beside user messages, or `undefined` when no reader with
|
|
4
|
+
* a valid avatar URL is set with `<AskAIUser />`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useChatUserAvatar: () => ReactNode;
|
|
7
|
+
//# sourceMappingURL=user-avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-avatar.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/user-avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AA+BjD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAO,SAKpC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { resolveChatUserAvatarUrl } from "./chat-user";
|
|
5
|
+
import { useGeistdocsChatContext } from "./context";
|
|
6
|
+
const ChatUserAvatar = ({ name, src }) => {
|
|
7
|
+
const [failedSrc, setFailedSrc] = useState(null);
|
|
8
|
+
// A broken avatar is hidden rather than shown as a broken image.
|
|
9
|
+
if (failedSrc === src) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return (
|
|
13
|
+
// External avatar hosts vary per site, so next/image remote patterns
|
|
14
|
+
// can't be configured for them.
|
|
15
|
+
// biome-ignore lint/performance/noImgElement: arbitrary avatar hosts
|
|
16
|
+
// biome-ignore lint/a11y/noNoninteractiveElementInteractions: onError is a load event, not an interaction
|
|
17
|
+
_jsx("img", { alt: name?.trim() ?? "", className: "size-6 shrink-0 rounded-full bg-gray-alpha-200 object-cover", decoding: "async", height: 24, loading: "lazy", onError: () => setFailedSrc(src), referrerPolicy: "no-referrer", src: src, width: 24 }));
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The avatar shown beside user messages, or `undefined` when no reader with
|
|
21
|
+
* a valid avatar URL is set with `<AskAIUser />`.
|
|
22
|
+
*/
|
|
23
|
+
export const useChatUserAvatar = () => {
|
|
24
|
+
const { user } = useGeistdocsChatContext();
|
|
25
|
+
const src = resolveChatUserAvatarUrl(user?.avatarUrl);
|
|
26
|
+
return src ? _jsx(ChatUserAvatar, { name: user?.name, src: src }) : undefined;
|
|
27
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-only binding between a browser and its eve session.
|
|
3
|
+
*
|
|
4
|
+
* The chat route talks to the eve agent with the site's own credentials, so
|
|
5
|
+
* it must only ever contact a session this browser created through the
|
|
6
|
+
* route. The session ID lives in an HMAC-signed, httpOnly cookie that page
|
|
7
|
+
* scripts cannot read; the browser only stores a non-reversible tag of the
|
|
8
|
+
* session in message metadata so the route can tell which conversation a
|
|
9
|
+
* session belongs to.
|
|
10
|
+
*
|
|
11
|
+
* Cookie value: `base64url(JSON payload) + "." + base64url(HMAC-SHA256)`.
|
|
12
|
+
* The MAC covers a versioned domain-separation prefix, the agent URL (kept
|
|
13
|
+
* out of the payload so the browser never sees it), and the encoded payload.
|
|
14
|
+
*/
|
|
15
|
+
export declare const CHAT_SECRET_ENV = "GEISTDOCS_CHAT_SECRET";
|
|
16
|
+
export declare const MIN_CHAT_SECRET_BYTES = 32;
|
|
17
|
+
export declare const EVE_AGENT_SESSION_COOKIE = "geistdocs_eve_session";
|
|
18
|
+
export declare const EVE_AGENT_SESSION_MAX_AGE_SECONDS: number;
|
|
19
|
+
export interface EveAgentCookieSession {
|
|
20
|
+
/** Created by a prewarm request and not yet used for a turn. */
|
|
21
|
+
prewarmed: boolean;
|
|
22
|
+
sessionId: string;
|
|
23
|
+
}
|
|
24
|
+
export interface EveAgentSessionCookieCodec {
|
|
25
|
+
/**
|
|
26
|
+
* Return the session a cookie value carries, or `null` for anything that
|
|
27
|
+
* is not a valid, unexpired cookie issued for this agent with this secret.
|
|
28
|
+
*/
|
|
29
|
+
open: (value: string) => EveAgentCookieSession | null;
|
|
30
|
+
/** Seal a session into a cookie value with a fresh expiry. */
|
|
31
|
+
seal: (session: EveAgentCookieSession) => string;
|
|
32
|
+
/**
|
|
33
|
+
* Short, non-reversible tag for a session ID. Stored in assistant message
|
|
34
|
+
* metadata so the route can match a conversation to the cookie's session
|
|
35
|
+
* without exposing the session ID to page scripts.
|
|
36
|
+
*/
|
|
37
|
+
tag: (sessionId: string) => string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Validate a chat secret. Throws for secrets too short to resist guessing
|
|
41
|
+
* so a misconfigured deployment fails loudly instead of signing cookies
|
|
42
|
+
* with a weak key. A base64 value that decodes to 32 bytes (44 characters)
|
|
43
|
+
* passes, because the raw string is used as the key.
|
|
44
|
+
*/
|
|
45
|
+
export declare const assertChatSecret: (secret: string) => void;
|
|
46
|
+
export declare const createEveAgentSessionCookieCodec: ({ agentUrl, now, secret, ttlMs, }: {
|
|
47
|
+
/** Normalized agent URL the sessions belong to. */
|
|
48
|
+
agentUrl: string;
|
|
49
|
+
/** Clock override for tests. */
|
|
50
|
+
now?: () => number;
|
|
51
|
+
secret: string;
|
|
52
|
+
ttlMs?: number;
|
|
53
|
+
}) => EveAgentSessionCookieCodec;
|
|
54
|
+
/** Compare two session tags without leaking where they differ. */
|
|
55
|
+
export declare const isSameSessionTag: (actual: string, expected: string) => boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Every value sent for `name` in a `Cookie` header, in header order.
|
|
58
|
+
* Browsers send one value per matching path, most specific first, so
|
|
59
|
+
* callers should try each value rather than trusting the first.
|
|
60
|
+
*/
|
|
61
|
+
export declare const readCookieValues: (header: string | null, name: string) => string[];
|
|
62
|
+
/**
|
|
63
|
+
* `Set-Cookie` header for the eve session. The cookie is scoped to the
|
|
64
|
+
* chat route's own path, so it follows any endpoint or base path without
|
|
65
|
+
* configuration, and is never sent with page or asset requests.
|
|
66
|
+
*/
|
|
67
|
+
export declare const serializeEveAgentSessionCookie: (value: string, req: Request) => string;
|
|
68
|
+
//# sourceMappingURL=eve-agent-session-cookie.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eve-agent-session-cookie.d.ts","sourceRoot":"","sources":["../../src/internal/eve-agent-session-cookie.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,eAAe,0BAA0B,CAAC;AACvD,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MAAM,wBAAwB,0BAA0B,CAAC;AAChE,eAAO,MAAM,iCAAiC,QAAmB,CAAC;AAYlE,MAAM,WAAW,qBAAqB;IACpC,gEAAgE;IAChE,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAYD,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,qBAAqB,GAAG,IAAI,CAAC;IACtD,8DAA8D;IAC9D,IAAI,EAAE,CAAC,OAAO,EAAE,qBAAqB,KAAK,MAAM,CAAC;IACjD;;;;OAIG;IACH,GAAG,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CACpC;AAcD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,SAM9C,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAAI,mCAK9C;IACD,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,KAAG,0BA6EH,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,EAAE,UAAU,MAAM,YAQhE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,GAAG,IAAI,EAAE,MAAM,MAAM,aAwBnE,CAAC;AAgBF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,GAAI,OAAO,MAAM,EAAE,KAAK,OAAO,WAczE,CAAC"}
|