@next-bricks/ai 1.18.2 → 1.19.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/bricks.json +1 -1
- package/dist/chunks/22.58f5dd77.js +2 -0
- package/dist/chunks/{22.3b5f5afa.js.map → 22.58f5dd77.js.map} +1 -1
- package/dist/chunks/{main.a638d17b.js → main.d4f1e095.js} +2 -2
- package/dist/chunks/{main.a638d17b.js.map → main.d4f1e095.js.map} +1 -1
- package/dist/{index.16b98e74.js → index.8c37c19c.js} +2 -2
- package/dist/{index.16b98e74.js.map → index.8c37c19c.js.map} +1 -1
- package/package.json +2 -2
- package/dist/chunks/22.3b5f5afa.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/22.3b5f5afa.js","mappings":"qJA8DaA,GAAkBC,EAAAA,EAAAA,eAC7B,CAAC,GAGUC,EAAqBA,KAChCC,EAAAA,EAAAA,YAAWH,E,4EC5DPI,GAAcC,E,QAAAA,WAAyC,WAEtD,SAASC,IACd,OAAOC,IAAAA,cAAA,OAAKC,UAAU,gCACxB,CAEO,SAASC,IACd,OACEF,IAAAA,cAAA,OAAKC,UAAU,8BACbD,IAAAA,cAAA,OAAKC,UAAU,QACbD,IAAAA,cAAA,YACAA,IAAAA,cAAA,YACAA,IAAAA,cAAA,YACAA,IAAAA,cAAA,aAIR,CAEO,SAASG,IACd,OACEH,IAAAA,cAAA,OAAKC,UAAU,0BACbD,IAAAA,cAACH,EAAW,CAACO,KAAK,UAAUC,IAAI,OAAOC,UAAQ,IAGrD,C,sFCxBMT,GAAcC,EAAAA,EAAAA,WAAyC,WAEtD,SAASS,EAAMC,GAMF,IANG,KACrBC,EAAI,QACJC,GAIDF,EACOG,GAASC,EAAAA,EAAAA,UAAQ,IAAe,SAATH,GAAiB,CAACA,KACzC,kBAAEI,IAAsBlB,EAAAA,EAAAA,KAExBmB,GAAYF,EAAAA,EAAAA,UAChB,SAAAG,EA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H,EAAOriB,GAAI,s1DAC6Q,KAEtT,S,4FCJIsiB,EAAgC,IAAIC,IAAI,aACxCH,EAA0B,IAA4B,KACtDI,EAAqC,IAAgCF,GAEzEF,EAAwBvH,KAAK,CAACwH,EAAOriB,GAAI,uHAAuHwiB,+hCAAikC,KAEjuC,S,kECPIJ,E,MAA0B,GAA4B,KAE1DA,EAAwBvH,KAAK,CAACwH,EAAOriB,GAAI,gUAC+H,KAExK,S,6HCAIoiB,EAA0B,IAA4B,KAC1DA,EAAwB5P,EAAE,KAC1B4P,EAAwB5P,EAAE,KAC1B4P,EAAwB5P,EAAE,KAC1B4P,EAAwB5P,EAAE,KAC1B4P,EAAwB5P,EAAE,KAE1B4P,EAAwBvH,KAAK,CAACwH,EAAOriB,GAAI,GAAI,KAE7C,S,4FCbIsiB,EAAgC,IAAIC,IAAI,aACxCE,EAAgC,IAAIF,IAAI,YACxCH,EAA0B,IAA4B,KACtDI,EAAqC,IAAgCF,GACrEI,EAAqC,IAAgCD,GAEzEL,EAAwBvH,KAAK,CAACwH,EAAOriB,GAAI,+nJAC2hEwiB,uFAAwHE,4zLAKh9D,KAE5O,S,gJCPIC,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKJ,KAAW,IAAQM,QAAS,IAAQA,M,gJCftDN,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKJ,KAAW,IAAQM,QAAS,IAAQA,M","sources":["webpack:///./src/chat-view/ChatViewContext.ts","webpack:///./src/chat-view/components/Loading.tsx","webpack:///./src/chat-view/components/MessageItem/Avatar.tsx","webpack:///./src/chat-view/components/MessageItem/GuideItem.tsx","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/ProgressText.tsx","webpack:///./src/chat-view/components/MessageItem/MsgItemContext.ts","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/CustomComponent.tsx","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/index.tsx","webpack:///./src/chat-view/components/MessageItem/Markdown/index.tsx","webpack:///./src/chat-view/components/MessageItem/TableItem.tsx","webpack:///./src/chat-view/components/MessageItem/TextItem.tsx","webpack:///./src/chat-view/components/MessageItem/Toolbar.tsx","webpack:///./src/chat-view/components/MessageItem/Time.tsx","webpack:///./src/chat-view/components/MessageItem/ContentTip.tsx","webpack:///./src/chat-view/components/MessageItem/index.tsx","webpack:///./src/chat-view/components/QuickAnswerList/index.tsx","webpack:///./src/chat-view/components/StopBtn.tsx","webpack:///./src/chat-view/components/MessageList.tsx","webpack:///./src/chat-view/components/utils/calculateAutoSizeStyle.ts","webpack:///./src/chat-view/components/SearchInput.tsx","webpack:///./src/chat-view/components/SessionList.tsx","webpack:///./src/chat-view/ChatService.ts","webpack:///./src/chat-view/hooks/useChatViewInfo.ts","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/CodeBlock.shadow.css","webpack:///./src/chat-view/components/MessageItem/Markdown/markdown.shadow.css","webpack:///./src/chat-view/components/QuickAnswerList/quickAnswerList.shadow.css","webpack:///./src/chat-view/components/loading.shadow.css","webpack:///./src/chat-view/host-context.css","webpack:///./src/chat-view/index.css","webpack:///./src/chat-view/styles.shadow.css","webpack:///./src/chat-view/host-context.css?1beb","webpack:///./src/chat-view/index.css?7225"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport { AgentDetailItem } from \"./components/QuickAnswerList/index.js\";\nimport { SessionItem } from \"./ChatService.js\";\nimport { UseBrickConf } from \"@next-core/types\";\n\nexport type Role = \"guide\" | \"user\" | \"assistant\";\n\nexport type commandBrickConf = Record<\n string,\n { useBrick: UseBrickConf; showOriginData?: boolean }\n>;\n\nexport interface MessageItemContent {\n type: \"guide\" | \"text\" | \"markdown\" | \"table\" | \"load\";\n text: string;\n examplePrompts?: string[];\n}\n\nexport interface MessageItem {\n role: Role;\n content: MessageItemContent;\n created?: number | string;\n key?: number | string;\n conversationId?: string;\n taskId?: string;\n agentId?: string;\n chatting?: boolean;\n tag?: {\n isLike?: boolean;\n };\n}\n\nexport interface QuickAnswerConfig {\n tip: string;\n list: AgentDetailItem[];\n}\ninterface ChatViewContextProps {\n sessionEnd: boolean;\n sessionLoading: boolean;\n activeSessionId?: string;\n sessionList: SessionItem[];\n msgEnd: boolean;\n msgLoading: boolean;\n msgList: MessageItem[];\n loading: boolean;\n chatting: boolean;\n searchStr: string;\n showLike: boolean;\n readonly: boolean;\n quickAnswerConfig?: QuickAnswerConfig;\n commandBricks?: commandBrickConf;\n setAgent: (id: string) => void;\n handleIsLike: (id: string, isLike: boolean) => Promise<boolean>;\n handleChat: (str: string) => void;\n stopChat: () => void;\n checkSession: (id?: string, isInit?: boolean) => void;\n createSession: () => void;\n deleteSession: (ids: string[]) => Promise<boolean>;\n setSearchStr: (str: string) => void;\n querySessionHistory: (limit?: number) => void;\n}\n\nexport const ChatViewContext = createContext<ChatViewContextProps>(\n {} as ChatViewContextProps\n);\n\nexport const useChatViewContext = (): ChatViewContextProps =>\n useContext(ChatViewContext);\n","import React from \"react\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { wrapBrick } from \"@next-core/react-element\";\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nexport function MessageListLoading() {\n return <div className=\"message-list-loading-wrapper\"></div>;\n}\n\nexport function ChatItemLoading() {\n return (\n <div className=\"chart-item-loading-wrapper\">\n <div className=\"load\">\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n </div>\n </div>\n );\n}\n\nexport function CommonLoading() {\n return (\n <div className=\"common-loading-wrapper\">\n <WrappedIcon icon=\"loading\" lib=\"antd\" spinning />\n </div>\n );\n}\n","import React, { useMemo } from \"react\";\nimport { useChatViewContext, type Role } from \"../../ChatViewContext.js\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { wrapBrick } from \"@next-core/react-element\";\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nexport function Avatar({\n role,\n agentId,\n}: {\n role: Role;\n agentId?: string;\n}): React.ReactNode {\n const isUser = useMemo(() => role === \"user\", [role]);\n const { quickAnswerConfig } = useChatViewContext();\n\n const agentList = useMemo(\n () => quickAnswerConfig?.list ?? [],\n [quickAnswerConfig]\n );\n\n const matchAgent = useMemo(() => {\n return agentList.find((item) => item.id === agentId);\n }, [agentList, agentId]);\n\n return !isUser && matchAgent ? (\n <WrappedIcon\n className=\"avatar\"\n {...matchAgent.icon}\n style={{\n color: `var(--theme-${matchAgent.icon.color}-color)`,\n background: `var(--theme-${matchAgent.icon.color}-background)`,\n }}\n />\n ) : (\n <div className={`avatar ${isUser ? \"user\" : \"robot\"}`} />\n );\n}\n","import React from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\n\ninterface GuideItemProps {\n text: string;\n prompts?: string[];\n}\n\nconst WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\n\nexport function GuideItem({ text, prompts }: GuideItemProps) {\n return (\n <div className=\"guide-item\">\n {text}\n <div className=\"prompts-list\">\n {prompts\n ? prompts.map((item, index) => (\n <WrappedLink key={index}>{item}</WrappedLink>\n ))\n : null}\n </div>\n </div>\n );\n}\n","import React, { useMemo } from \"react\";\n\nexport function ProgressText({ text }: { text: string }): React.ReactNode {\n const renderText = useMemo(() => {\n // 文本末尾存在 \\n ```, 会导致在渲染快结束的时候突然有一个换行,在结束的时候,换行被干掉,导致页面闪动的情况\n // 所以在这里计算,如果文本将要关闭,则默认不然 \\n ``` 显示\n const newText = text.replace(/\\n[`]{0,3}$/, \"\");\n return newText;\n }, [text]);\n\n return <div className=\"progress-text\">{renderText}</div>;\n}\n","import { createContext, useContext } from \"react\";\nimport { MessageItem } from \"../../ChatViewContext\";\n\nexport const MsgItemContext = createContext<MessageItem>({} as MessageItem);\n\nexport const useMsgItemContext = (): MessageItem => useContext(MsgItemContext);\n","import React, { useEffect, useMemo, useRef, useState } from \"react\";\nimport { useMsgItemContext } from \"../../MsgItemContext.js\";\nimport { ReactUseMultipleBricks } from \"@next-core/react-runtime\";\nimport { useChatViewContext } from \"../../../../ChatViewContext.js\";\n\ninterface UseDataProps {\n text: string;\n chatting: boolean;\n}\n\nfunction useData({ text, chatting }: UseDataProps) {\n const cahceTextRef = useRef<string>(\"\");\n const [isEnd, setIsEnd] = useState<boolean>(false);\n const [isError, setIsError] = useState<boolean>(false);\n const [parseData, setParseData] = useState<any>();\n\n useEffect(() => {\n if (cahceTextRef.current !== text) {\n cahceTextRef.current = text;\n let data: any;\n try {\n data = JSON.parse(text);\n } catch {\n setIsError(true);\n return;\n }\n setParseData(data);\n }\n }, [text]);\n\n useEffect(() => {\n if (chatting) {\n if (text.match(/\\n[`]{0,3}$/)) {\n setIsEnd(true);\n }\n } else {\n setIsEnd(true);\n }\n }, [text, chatting]);\n\n return {\n parseData,\n isError: isEnd && isError,\n };\n}\n\nexport default function CustomComponent({\n text,\n language,\n}: {\n text: string;\n language: string;\n}) {\n const { commandBricks } = useChatViewContext();\n const { chatting, agentId, conversationId, taskId } = useMsgItemContext();\n\n const { parseData, isError } = useData({\n text,\n chatting: !!chatting,\n });\n\n const commandBrickConf = useMemo(() => {\n const config = commandBricks?.[language];\n if (config) {\n const data = {\n data: parseData,\n agentId,\n conversationId,\n taskId,\n };\n return {\n component: (\n <ReactUseMultipleBricks useBrick={config.useBrick} data={data} />\n ),\n ...config,\n };\n }\n return {\n component: null,\n showOriginData: true,\n };\n }, [commandBricks, language, parseData, agentId, conversationId, taskId]);\n\n return (\n <div className=\"custom-component-wrapper\">\n {commandBrickConf?.showOriginData ? (\n <>\n <div className=\"params\">\n <div className=\"params-tip\">【查询语句】: </div>\n <pre>\n <code>{text}</code>\n </pre>\n </div>\n {isError ? (\n <div className=\"error-tip\">【查询失败】</div>\n ) : (\n <>\n <div className=\"result-tip\">【查询结果】:</div>\n <div className=\"custom-component\">\n {commandBrickConf.component}\n </div>\n </>\n )}\n </>\n ) : (\n commandBrickConf.component\n )}\n </div>\n );\n}\n","import React, { useEffect, useMemo, useState } from \"react\";\nimport { useNodeViewContext } from \"@prosemirror-adapter/react\";\nimport { ProgressText } from \"./ProgressText.js\";\nimport CustomComponent from \"./CustomComponent.js\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport { GeneralIcon, GeneralIconProps } from \"@next-bricks/icons/general-icon\";\nimport { Tooltip, message } from \"antd\";\nimport { useChatViewContext } from \"../../../../ChatViewContext\";\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nconst copyIcon: GeneralIconProps = {\n lib: \"antd\",\n icon: \"copy\",\n theme: \"outlined\",\n};\n\nexport const CodeBlock = () => {\n const [language, setLanguage] = useState(\"\");\n const { contentRef, node, view } = useNodeViewContext();\n const { commandBricks } = useChatViewContext();\n const [messageApi, contextHolder] = message.useMessage();\n\n const handleCopy = async () => {\n const text = node.content.firstChild?.text;\n try {\n if (text) {\n await navigator.clipboard.writeText(text);\n messageApi.success(\"复制成功\");\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(\"Failed to copy: \", err);\n messageApi.error(\"复制失败\");\n }\n };\n\n const defaultContent = useMemo(\n () => (\n <div className=\"default-container\">\n {contextHolder}\n <pre spellCheck={false}>\n <code ref={contentRef} style={{ position: \"relative\" }}>\n <div className=\"default-toolbar-container\">\n <Tooltip title=\"复制\" color=\"#474747\" arrow={false}>\n <WrappedIcon\n {...(copyIcon as GeneralIconProps)}\n onClick={handleCopy}\n style={{ cursor: \"pointer\" }}\n />\n </Tooltip>\n </div>\n </code>\n </pre>\n </div>\n ),\n [contentRef]\n );\n\n const renderContent = useMemo(() => {\n if (!node.firstChild?.text) return null;\n const text = node.firstChild?.textContent;\n if (commandBricks && commandBricks[language]) {\n // 使 markdown 默认样式不生效, 防止样式穿透\n view.dom.classList.contains(\"prose\") &&\n view.dom.classList.replace(\"prose\", \"not-prose\");\n return <CustomComponent text={text} language={language} />;\n }\n switch (language) {\n case \"easy_cmd_progress\":\n return <ProgressText text={text} />;\n default:\n return defaultContent;\n }\n }, [node, language, view, defaultContent, commandBricks]);\n\n useEffect(() => {\n if (!language) {\n const {\n attrs: { language },\n } = node;\n if (language) {\n setLanguage(language);\n }\n }\n }, [node, language]);\n\n return renderContent;\n};\n","import React, { useEffect } from \"react\";\nimport {\n defaultValueCtx,\n Editor,\n rootCtx,\n editorViewOptionsCtx,\n} from \"@milkdown/core\";\nimport { EditorView } from \"prosemirror-view\";\nimport { Milkdown, useEditor, MilkdownProvider } from \"@milkdown/react\";\nimport { commonmark, codeBlockSchema } from \"@milkdown/preset-commonmark\";\nimport { nord } from \"@milkdown/theme-nord\";\nimport { gfm } from \"@milkdown/preset-gfm\";\nimport { prism } from \"@milkdown/plugin-prism\";\nimport { $view, replaceAll } from \"@milkdown/utils\";\nimport {\n ProsemirrorAdapterProvider,\n useNodeViewFactory,\n} from \"@prosemirror-adapter/react\";\nimport { CodeBlock } from \"./CodeBlock/index.js\";\n\nexport function MarkdownItem({ text }: { text: string }) {\n return (\n <div className=\"markdown-item\">\n <MilkdownProvider>\n <ProsemirrorAdapterProvider>\n <MarkdownDisplay value={text} />\n </ProsemirrorAdapterProvider>\n </MilkdownProvider>\n </div>\n );\n}\n\nfunction hasURLProtocol(url: any) {\n return (\n url.startsWith(\"http://\") ||\n url.startsWith(\"https://\") ||\n url.startsWith(\"file://\") ||\n url.startsWith(\"data:\") ||\n url.startsWith(\"ts://?ts\") ||\n url.startsWith(\"ts:?ts\")\n );\n}\n\nexport function MarkdownDisplay({ value }: { value: string }): React.ReactNode {\n const nodeViewFactory = useNodeViewFactory();\n\n const handleClick = (view: EditorView, pos: number) => {\n const found = view.state.tr.doc.nodeAt(pos);\n\n if (found && found.marks.length > 0) {\n const mark = found.marks.find((m) => m.type.name === \"link\");\n const href = mark?.attrs.href;\n let path: string;\n\n if (hasURLProtocol(href)) {\n path = href;\n } else {\n path = encodeURIComponent(href);\n }\n\n window.open(path, \"_blank\");\n }\n return true;\n };\n\n const { get } = useEditor((root) => {\n return Editor.make()\n .config((ctx) => {\n ctx.set(rootCtx, root);\n ctx.update(editorViewOptionsCtx, (prev: any) => ({\n ...prev,\n editable: () => false,\n handleClickOn: (view: EditorView, pos: number) =>\n handleClick(view, pos),\n }));\n value && ctx.set(defaultValueCtx, value);\n //拦截link的默认点击事件以支持通过新窗口弹出页面,如果后续有其他的定制化需求可以改用custom widget的方式写link widget\n const observer = new MutationObserver(() => {\n const links = Array.from(root.querySelectorAll(\"a\"));\n links.forEach((link) => {\n link.onclick = () => false;\n });\n });\n observer.observe(root, {\n childList: true,\n subtree: true,\n });\n })\n .config(nord)\n .use(prism)\n .use(gfm)\n .use(commonmark)\n .use(\n $view(codeBlockSchema.node, () =>\n nodeViewFactory({ component: CodeBlock })\n )\n );\n }, []);\n\n useEffect(() => {\n if (value !== undefined) {\n get()?.action(replaceAll(value));\n }\n }, [get, value]);\n\n return <Milkdown />;\n}\n","import React from \"react\";\n// import { wrapBrick } from \"@next-core/react-element\";\n// import type {\n// EoNextTable,\n// NextTableComponentProps,\n// } from \"@next-bricks/advanced/next-table\";\n\ninterface MarkdownItemProps {\n text: string;\n}\n\n// const WrappedNextTable = wrapBrick<EoNextTable, NextTableComponentProps>(\n// \"eo-next-table\"\n// );\n\nexport function TableItem({ text }: MarkdownItemProps) {\n // const parseContent = useMemo((): NextTableComponentProps => {\n // let content: NextTableComponentProps;\n // try {\n // content = JSON.parse(text);\n // } catch {\n // content = {} as NextTableComponentProps;\n // }\n // return content;\n // }, [text]);\n\n // return (\n // <div className=\"table-item\">\n // <WrappedNextTable pagination={false} {...parseContent} />\n // </div>\n // );\n return <div className=\"table-item\">{text}</div>;\n}\n","import React from \"react\";\n\ninterface TextItem {\n text: string;\n}\n\nexport function TextItem({ text }: TextItem) {\n return <div className=\"text-item\">{text}</div>;\n}\n","import React, { useCallback, useMemo } from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type { copyToClipboard as _copyToClipboard } from \"@next-bricks/basic/data-providers/copy-to-clipboard\";\nimport type { showNotification as _showNotification } from \"@next-bricks/basic/data-providers/show-notification/show-notification\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { EoTooltip, ToolTipProps } from \"@next-bricks/basic/tooltip\";\nimport { MessageItem, useChatViewContext } from \"../../ChatViewContext\";\nimport { unwrapProvider } from \"@next-core/utils/general\";\nimport classNames from \"classnames\";\n\nconst WrapperIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nconst WrappedToolTip = wrapBrick<EoTooltip, ToolTipProps>(\"eo-tooltip\");\nconst copyToClipboard = unwrapProvider<typeof _copyToClipboard>(\n \"basic.copy-to-clipboard\"\n);\nconst showNotification = unwrapProvider<typeof _showNotification>(\n \"basic.show-notification\"\n);\n\nexport function Toolbar({\n role,\n content,\n chatting,\n taskId,\n tag,\n}: MessageItem): React.ReactNode {\n const isAssistant = useMemo(\n () => role === \"assistant\" && content.type !== \"load\",\n [role, content.type]\n );\n const isChattingItem = useMemo(() => chatting, [chatting]);\n const { showLike, readonly, handleIsLike } = useChatViewContext();\n\n const handleCopy = () => {\n copyToClipboard(content.text)\n .then(() => showNotification({ type: \"success\", message: \"复制成功\" }))\n .catch(() => showNotification({ type: \"error\", message: \"复制失败\" }));\n };\n\n const handleLikeOrIsLike = useCallback(\n async (islike: boolean) => {\n const result = await handleIsLike(taskId!, islike);\n showNotification({\n message: `${islike ? \"点赞\" : \"操作\"}${result ? \"成功\" : \"失败\"}`,\n type: result ? \"success\" : \"error\",\n });\n },\n [taskId, handleIsLike]\n );\n\n return isAssistant && !isChattingItem ? (\n <div className=\"message-toolbar\">\n {showLike && !readonly && (\n <>\n <WrappedToolTip content=\"点赞\" hoist>\n <WrapperIcon\n className={classNames(\"like\", {\n active: tag?.isLike === true,\n })}\n lib=\"easyops\"\n icon=\"like\"\n onClick={() => handleLikeOrIsLike(true)}\n />\n </WrappedToolTip>\n <WrappedToolTip content=\"还不够好\" hoist>\n <WrapperIcon\n className={classNames(\"unlike\", {\n active: tag?.isLike === false,\n })}\n lib=\"easyops\"\n icon=\"unlike\"\n onClick={() => handleLikeOrIsLike(false)}\n />\n </WrappedToolTip>\n <div className=\"split\" />\n </>\n )}\n <WrappedToolTip content=\"点击复制\" hoist>\n <WrapperIcon lib=\"antd\" icon=\"copy\" onClick={handleCopy} />\n </WrappedToolTip>\n </div>\n ) : null;\n}\n","import moment from \"moment\";\nimport React from \"react\";\n\nexport function Time({ time }: { time?: string | number }) {\n return (\n <div className=\"time\">\n {time\n ? typeof time === \"string\"\n ? time\n : moment(time).format(\"YYYY-MM-DD HH:mm:ss\")\n : null}\n </div>\n );\n}\n","import React, { useMemo } from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { EoTooltip, ToolTipProps } from \"@next-bricks/basic/tooltip\";\nimport { useChatViewContext, type MessageItem } from \"../../ChatViewContext\";\n\nconst WrappedToolTip = wrapBrick<EoTooltip, ToolTipProps>(\"eo-tooltip\");\nconst WrapperIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nexport function ContentTip({ role, content }: MessageItem): React.ReactNode {\n const isUser = useMemo(() => role === \"user\", [role]);\n\n const { chatting, readonly, setSearchStr } = useChatViewContext();\n\n const handleCopy = () => {\n setSearchStr(content.text);\n };\n\n return !readonly && isUser && !chatting ? (\n <div className=\"content-tip\">\n <WrappedToolTip content=\"点击再次提问\" hoist>\n <WrapperIcon lib=\"antd\" icon=\"edit\" onClick={handleCopy} />\n </WrappedToolTip>\n </div>\n ) : null;\n}\n","import React, { useCallback, useMemo } from \"react\";\nimport {\n MessageItem,\n MessageItemContent,\n useChatViewContext,\n} from \"../../ChatViewContext.js\";\nimport { GuideItem } from \"./GuideItem.js\";\nimport { MarkdownItem } from \"./Markdown/index.js\";\nimport { TableItem } from \"./TableItem.js\";\nimport { ChatItemLoading } from \"../Loading.js\";\nimport { TextItem } from \"./TextItem.js\";\nimport { Toolbar } from \"./Toolbar.js\";\nimport { Time } from \"./Time.js\";\nimport { ContentTip } from \"./ContentTip.js\";\nimport { MsgItemContext } from \"./MsgItemContext.js\";\n\nconst NOT_AGENT_MATCH = \"no_agent\";\n\nexport function MessageNode(props: MessageItem): React.ReactNode {\n const { content, created, role, agentId } = props;\n const isUser = useMemo(() => role === \"user\", [role]);\n const { quickAnswerConfig } = useChatViewContext();\n\n const getContentNode = useCallback((content: MessageItemContent) => {\n const { type, text, examplePrompts } = content;\n switch (type) {\n case \"guide\":\n return <GuideItem text={text} prompts={examplePrompts} />;\n case \"text\":\n return <TextItem text={text} />;\n case \"table\":\n return <TableItem text={text} />;\n case \"load\":\n return <ChatItemLoading />;\n case \"markdown\":\n default:\n return <MarkdownItem text={text} />;\n }\n }, []);\n\n const messageNode = useMemo(\n () => getContentNode(content),\n [content, getContentNode]\n );\n\n const agentList = useMemo(\n () => quickAnswerConfig?.list ?? [],\n [quickAnswerConfig]\n );\n\n const matchAgent = useMemo(() => {\n return agentList.find((item) => item.id === agentId);\n }, [agentList, agentId]);\n\n return (\n <MsgItemContext.Provider value={props}>\n <div className=\"message-box\">\n <div className=\"message-top\">\n {isUser\n ? \"我\"\n : !agentId || agentId === NOT_AGENT_MATCH || !matchAgent\n ? \"AI助手\"\n : matchAgent.name}\n <Time time={created} />\n </div>\n <div className=\"message-content\">\n <div className=\"wrapper\">\n <div className=\"content\">{messageNode}</div>\n\n <ContentTip {...props} />\n <Toolbar {...props} />\n </div>\n </div>\n </div>\n </MsgItemContext.Provider>\n );\n}\n","import React, { useEffect, useMemo, useRef, useState } from \"react\";\nimport { useChatViewContext } from \"../../ChatViewContext\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nconst WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\n\nexport interface AgentDetailItem {\n name: string;\n description: string;\n icon: GeneralIconProps & { color: string };\n starterPrompts?: string[];\n instanceId: string;\n id: string;\n [key: string]: any;\n}\n\nconst CARD_ITEM_HEIGHT = 85;\nconst HEIGHT_GAP = 24;\n\nfunction QuickAnswerCardItem({\n name,\n description,\n icon,\n starterPrompts,\n}: AgentDetailItem) {\n const { setSearchStr } = useChatViewContext();\n\n const handleCardClick = () => {\n starterPrompts?.length && setSearchStr(starterPrompts[0]);\n };\n\n const iconColor = useMemo(() => icon?.color ?? \"geekblue\", [icon]);\n\n return (\n <div\n className=\"quick-answer-card-item\"\n style={{\n height: CARD_ITEM_HEIGHT,\n background: `linear-gradient(rgba(var(--theme-${iconColor}-color-rgb-channel), 0.1), rgba(var(--theme-${iconColor}-color-rgb-channel), 0.08))`,\n }}\n onClick={handleCardClick}\n >\n <div className=\"left\">\n <WrappedIcon\n className=\"icon\"\n {...(icon ?? {\n icon: \"default-app\",\n lib: \"easyops\",\n category: \"app\",\n })}\n style={{\n background: `rgba(var(--theme-${iconColor}-color-rgb-channel), 0.5)`,\n }}\n />\n </div>\n <div className=\"content\">\n <div className=\"title\">{name}</div>\n <div className=\"description\">{description}</div>\n </div>\n </div>\n );\n}\n\nexport function QuickAnswerList() {\n const { quickAnswerConfig, msgList, loading } = useChatViewContext();\n const [showMoreBtn, setShowMoreBtn] = useState<boolean>(false);\n const listRef = useRef<HTMLDivElement>(null);\n const hadClickShowMoreBtn = useRef<boolean>(false);\n\n const handleShowMoreClick = () => {\n hadClickShowMoreBtn.current = true;\n setShowMoreBtn(false);\n };\n\n useEffect(() => {\n const element = listRef.current;\n if (element) {\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (\n entry.contentRect.height >\n CARD_ITEM_HEIGHT * 3 + HEIGHT_GAP * 2\n ) {\n if (!hadClickShowMoreBtn.current) {\n setShowMoreBtn(true);\n }\n } else {\n setShowMoreBtn(false);\n }\n }\n });\n observer.observe(element);\n return () => observer.disconnect();\n }\n }, [showMoreBtn, quickAnswerConfig?.list]);\n\n return quickAnswerConfig?.list.length && msgList.length === 0 && !loading ? (\n <div className=\"quick-answer-wrapper\">\n <div className=\"tip\">\n {quickAnswerConfig.tip ??\n \"你好,我是运维数智人 — Murphy,我能为你提供以下服务:\"}\n </div>\n <div\n className=\"quick-answer-list\"\n style={{\n ...(showMoreBtn\n ? {\n maxHeight: CARD_ITEM_HEIGHT * 3 + HEIGHT_GAP * 2 + 10,\n overflow: \"hidden\",\n }\n : {}),\n }}\n ref={listRef}\n >\n {quickAnswerConfig.list.map((item) => (\n <QuickAnswerCardItem key={item.instanceId} {...item} />\n ))}\n </div>\n {showMoreBtn ? (\n <div className=\"show-more-wrapper\">\n <WrappedLink\n icon={{\n lib: \"antd\",\n icon: \"down\",\n }}\n className=\"show-more-btn\"\n onClick={handleShowMoreClick}\n >\n 显示更多\n </WrappedLink>\n </div>\n ) : null}\n </div>\n ) : null;\n}\n","import React from \"react\";\nimport { useChatViewContext } from \"../ChatViewContext\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\n\nconst WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\n\nexport function StopBtn() {\n const { stopChat } = useChatViewContext();\n\n const handleStopChat = () => {\n stopChat();\n };\n return (\n <div className=\"stop-responding-wrapper\">\n <WrappedLink className=\"stop-btn\" onClick={handleStopChat}>\n 停止生成\n </WrappedLink>\n </div>\n );\n}\n","import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { MessageItem, useChatViewContext } from \"../ChatViewContext\";\nimport { Avatar } from \"./MessageItem/Avatar.js\";\nimport classNames from \"classnames\";\nimport { CommonLoading, MessageListLoading } from \"./Loading.js\";\nimport { MessageNode } from \"./MessageItem/index.js\";\nimport { QuickAnswerList } from \"./QuickAnswerList/index.js\";\nimport { debounce } from \"lodash\";\nimport { StopBtn } from \"./StopBtn.js\";\n\ninterface MessageListProps {\n showAvatar?: boolean;\n}\n\nconst DEFAULT_OFFSET_HEIGHT = 80;\nconst CACHE_HEIGHT = 200;\n\nexport function MessageList({\n showAvatar = true,\n}: MessageListProps): React.ReactNode {\n const chatViewRef = useRef<HTMLDivElement>(null);\n const messgetListBoxRef = useRef<HTMLDivElement>(null);\n const [preHeight, setPreHeight] = useState<number>(0);\n const isCustomScroll = useRef<boolean>(false);\n\n const {\n msgLoading,\n msgEnd,\n msgList,\n loading,\n activeSessionId,\n chatting,\n checkSession,\n } = useChatViewContext();\n\n const getMsgItemNode = useCallback(\n (item: MessageItem, index: number = 0) => {\n return (\n <div\n className={classNames(\"message-item\", { user: item.role === \"user\" })}\n key={index}\n >\n {showAvatar && <Avatar role={item.role} agentId={item.agentId} />}\n <MessageNode {...item} />\n </div>\n );\n },\n [showAvatar]\n );\n\n const msgListNode = useMemo(() => {\n return msgList.map((item, index) => {\n if (item.chatting) {\n return (\n <>\n {getMsgItemNode(item, index)}\n {chatting && index === msgList.length - 1 ? <StopBtn /> : null}\n </>\n );\n } else {\n return getMsgItemNode(item, index);\n }\n });\n }, [msgList, chatting, getMsgItemNode]);\n\n const handleScroll = useCallback(() => {\n const messageList = chatViewRef.current;\n if (messageList) {\n const { scrollHeight, clientHeight, scrollTop } = messageList;\n // 滚动到底部所需的高度 = 总高度 - 视图高度\n const isBottom = scrollHeight - clientHeight === scrollTop;\n if (!isBottom) {\n isCustomScroll.current = true;\n } else if (isBottom && isCustomScroll.current) {\n // 自动吸低\n isCustomScroll.current = false;\n }\n if (\n !msgLoading &&\n !msgEnd &&\n scrollTop < CACHE_HEIGHT &&\n activeSessionId\n ) {\n checkSession();\n }\n }\n }, [msgEnd, msgLoading, activeSessionId, checkSession]);\n\n const debounceHandleScroll = debounce(handleScroll, 200);\n\n useEffect(() => {\n if (chatting || activeSessionId) {\n // 聊天或者会话变更时,重置滚动状态\n isCustomScroll.current = false;\n }\n }, [chatting, activeSessionId]);\n\n useEffect(() => {\n const element = messgetListBoxRef.current;\n if (element) {\n const observer = new ResizeObserver((entries) => {\n let newHeight: number = 0;\n // 如果存在用户行为,不触发自动滚动行为\n if (isCustomScroll.current) return;\n for (const entry of entries) {\n newHeight = entry.contentRect.height - DEFAULT_OFFSET_HEIGHT;\n }\n if (!loading && !chatting) {\n // 高度变化,代表消息新增,自动滚动到最下\n chatViewRef.current!.scroll({\n top: Number.MAX_SAFE_INTEGER,\n });\n }\n if (newHeight > preHeight && chatting) {\n chatViewRef.current!.scroll({\n top: Number.MAX_SAFE_INTEGER,\n });\n setPreHeight(Math.max(preHeight, newHeight));\n }\n });\n observer.observe(element);\n return () => observer.disconnect();\n }\n }, [chatting, loading, preHeight]);\n\n return (\n <div\n className=\"chat-view\"\n ref={chatViewRef}\n onScroll={debounceHandleScroll}\n >\n <div className=\"message-list\">\n <div className=\"message-list-box\" ref={messgetListBoxRef}>\n {msgEnd && msgList.length ? (\n <div className=\"message-start-tip\">会话开始</div>\n ) : null}\n {msgLoading && <CommonLoading />}\n <QuickAnswerList />\n {msgListNode}\n </div>\n {loading && <MessageListLoading />}\n </div>\n </div>\n );\n}\n","const HIDDEN_TEXTAREA_STYLE = `\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n padding: 10px !important;\n pointer-events: none !important;\n`;\n\nconst SIZING_STYLE = [\n \"letter-spacing\",\n \"line-height\",\n \"padding-top\",\n \"padding-bottom\",\n \"font-family\",\n \"font-weight\",\n \"font-size\",\n \"font-variant\",\n \"text-rendering\",\n \"text-transform\",\n \"width\",\n \"text-indent\",\n \"padding-left\",\n \"padding-right\",\n \"border-width\",\n \"box-sizing\",\n \"word-break\",\n \"white-space\",\n];\nlet hiddenTextarea: HTMLTextAreaElement;\n\n/**\n * 计算 textare 高度\n * https://github.com/react-component/textarea/blob/1c0026fbe30e5f7dff1fca695b2cf262246381ca/src/calculateNodeHeight.tsx\n * */\nexport default function calculateAutoSizeStyle(\n uiTextNode: HTMLTextAreaElement,\n minRows: number | null = null,\n maxRows: number | null = null\n): React.CSSProperties {\n if (!hiddenTextarea) {\n hiddenTextarea = document.createElement(\"textarea\");\n hiddenTextarea.setAttribute(\"tab-index\", \"-1\");\n hiddenTextarea.setAttribute(\"aria-hidden\", \"true\");\n document.body.appendChild(hiddenTextarea);\n }\n\n const uiTextNodeStyle = window.getComputedStyle(uiTextNode);\n const sizingStyle = SIZING_STYLE.map(\n (name) => `${name}:${uiTextNodeStyle.getPropertyValue(name)}`\n ).join(\";\");\n\n // equal style\n hiddenTextarea.setAttribute(\n \"style\",\n `${sizingStyle};${HIDDEN_TEXTAREA_STYLE}`\n );\n hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || \"\";\n\n let minHeight: number | undefined = undefined;\n let maxHeight: number | undefined = undefined;\n // let overflowY: any;\n\n const borderSize = 2;\n const paddingSize = 20;\n let height = hiddenTextarea.scrollHeight - paddingSize + borderSize;\n\n if (minRows !== null || maxRows !== null) {\n // measure height of a textarea with a single row\n hiddenTextarea.value = \" \";\n const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;\n if (minRows !== null) {\n minHeight = singleRowHeight * minRows - paddingSize + borderSize;\n height = Math.max(paddingSize, height);\n }\n if (maxRows !== null) {\n maxHeight = singleRowHeight * maxRows - paddingSize + borderSize;\n // overflowY = height > maxHeight ? \"\" : \"hidden\";\n height = Math.min(maxHeight, height);\n }\n }\n\n const style: React.CSSProperties = {\n height,\n overflowY: \"scroll\",\n resize: \"none\",\n };\n\n if (minHeight) {\n style.minHeight = minHeight;\n }\n if (maxHeight) {\n style.maxHeight = maxHeight;\n }\n\n return style;\n}\n","import React, {\n ChangeEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport type { EoTooltip, ToolTipProps } from \"@next-bricks/basic/tooltip\";\nimport calculateAutoSizeStyle from \"./utils/calculateAutoSizeStyle.js\";\nimport classNames from \"classnames\";\nimport { useChatViewContext } from \"../ChatViewContext.js\";\nimport { AgentDetailItem } from \"./QuickAnswerList/index\";\n\nconst WrappedToolTip = wrapBrick<EoTooltip, ToolTipProps>(\"eo-tooltip\");\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nconst PREFIX_WORD = \"@\";\n\nexport function SearchInput(): React.ReactNode {\n const [value, setValue] = useState<string>(\"\");\n const [active, setActive] = useState<boolean>(false);\n const [expand, setExpand] = useState<boolean>(false);\n const [autoSizeStyle, setAutoSizeStyle] = useState<React.CSSProperties>();\n const [isFillContent, setIsFillContent] = useState<boolean>(false);\n\n // mention\n const [mentionOpen, setMentionOpen] = useState<boolean>(false);\n const [matchPrefixIndex, setMatchPrefixIndex] = useState<number>(-1);\n const [matchAgentList, setMatchMentionList] = useState<AgentDetailItem[]>([]);\n const [matchMentionsIndex, setMatchMentionsIndex] = useState<number>(0);\n\n const mentionsRef = useRef<HTMLDivElement>(null);\n const searchInputBoxRef = useRef<HTMLDivElement>(null);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const hadExpanded = useRef<boolean>(false);\n const inputEndRef = useRef<boolean>(false);\n\n const {\n chatting,\n loading,\n searchStr,\n quickAnswerConfig,\n createSession,\n setSearchStr,\n handleChat,\n setAgent,\n } = useChatViewContext();\n\n const agentList = useMemo(\n () => quickAnswerConfig?.list ?? [],\n [quickAnswerConfig]\n );\n\n const hadValue = useMemo(() => !!value, [value]);\n const defaultSize = useMemo(() => [1, 5], []);\n const disabled = useMemo(() => loading || chatting, [chatting, loading]);\n\n const matchPrefixInfo = useMemo(() => {\n const textareaElement = textareaRef.current!;\n if (matchPrefixIndex >= 0 && value) {\n const currentFocusIndex = textareaElement.selectionStart;\n let matchWord = \"\";\n for (let i = matchPrefixIndex + 1; i < currentFocusIndex; i++) {\n // 匹配中文英文数字\n if (/[\\u4e00-\\u9fa5]|\\w|\\d/.test(value[i]) || inputEndRef.current) {\n matchWord = matchWord + value[i];\n } else {\n setMatchPrefixIndex(-1);\n return false;\n }\n }\n return {\n start: matchPrefixIndex + 1,\n end: currentFocusIndex,\n word: matchWord,\n };\n }\n return false;\n }, [matchPrefixIndex, value]);\n\n const handleAgentItemSelect = useCallback(\n (item: AgentDetailItem) => {\n if (matchPrefixInfo) {\n const { start, end } = matchPrefixInfo;\n const valueList = value.split(\"\");\n const trimName = item.name.replace(/\\s+/g, \"\") + \" \";\n const focusIndex = start + trimName.length;\n valueList.splice(start, end - start, trimName);\n setValue(valueList.join(\"\"));\n setMatchPrefixIndex(-1);\n\n setTimeout(() => {\n textareaRef.current!.selectionStart = focusIndex;\n textareaRef.current!.selectionEnd = focusIndex;\n textareaRef.current!.focus();\n }, 0);\n }\n },\n [matchPrefixInfo, value]\n );\n\n const isShowMentions = useMemo(() => {\n return matchAgentList.length && mentionOpen;\n }, [matchAgentList, mentionOpen]);\n\n const mentions = useMemo(() => {\n return isShowMentions ? (\n <div className=\"mentions-list-wrapper\" ref={mentionsRef}>\n <div className=\"content\">\n <div className=\"mentions-title\">Agents</div>\n <div className=\"mentions-list\">\n {matchAgentList.slice(0, 10).map((item, index) => {\n return (\n <div\n className={classNames(\"mentions-item\", {\n active: index === matchMentionsIndex,\n })}\n key={index}\n onClick={() => handleAgentItemSelect(item)}\n >\n <WrappedIcon\n className=\"icon\"\n {...item.icon}\n style={{\n color: `var(--theme-${item.icon.color}-color)`,\n background: `var(--theme-${item.icon.color}-background)`,\n }}\n />\n <div className=\"name\">{item.name}</div>\n <div className=\"description\">{item.description}</div>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n ) : null;\n }, [\n matchAgentList,\n matchMentionsIndex,\n isShowMentions,\n handleAgentItemSelect,\n ]);\n\n const computedAutoSize = useCallback(\n (size = defaultSize) => {\n if (hadExpanded.current && expand) return;\n const textareaElement = textareaRef.current as HTMLTextAreaElement;\n if (textareaElement) {\n const textareaStyles = calculateAutoSizeStyle(\n textareaElement,\n size[0],\n size[1]\n );\n\n setAutoSizeStyle(textareaStyles);\n }\n hadExpanded.current = expand;\n },\n [defaultSize, expand]\n );\n\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLTextAreaElement> | string): void => {\n const value = typeof e === \"string\" ? e : e.target.value;\n setValue(value);\n textareaRef.current!.value = value;\n },\n []\n );\n\n const handleCompositionStart = () => {\n inputEndRef.current = true;\n };\n\n const handleCompositionEnd = () => {\n inputEndRef.current = false;\n };\n\n const hanldeCreateSession = () => {\n createSession();\n };\n\n const handleExpand = useCallback(() => {\n setExpand((value) => {\n return !value;\n });\n }, []);\n\n const matchFirstAgent = useCallback(\n (value: string) => {\n const regex = /@([\\u4e00-\\u9fa5|\\w|\\d]+)/g;\n\n // 在字符串中循环匹配正则表达式\n let match: RegExpExecArray | null;\n while ((match = regex.exec(value)) !== null) {\n if (match) {\n const agent = agentList?.find(\n (item) => item.name.replace(/\\s+/g, \"\") === match![1]\n );\n agent && setAgent(agent.id);\n if (agent) break;\n }\n }\n },\n [agentList, setAgent]\n );\n\n const handleSubmit = useCallback(() => {\n if (!hadValue || !textareaRef.current || disabled) return;\n\n matchFirstAgent(value);\n handleChat(value);\n\n setActive(false);\n setExpand(false);\n handleChange(\"\");\n textareaRef.current.blur();\n }, [value, hadValue, disabled, handleChat, handleChange, matchFirstAgent]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === \"Enter\" && !e.shiftKey && !inputEndRef.current) {\n e.preventDefault();\n if (isShowMentions) {\n handleAgentItemSelect(matchAgentList[matchMentionsIndex]);\n } else {\n handleSubmit();\n }\n }\n if (isShowMentions) {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n setMatchMentionsIndex((index) => Math.max(0, index - 1));\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n setMatchMentionsIndex((index) =>\n Math.min(matchAgentList.length - 1, index + 1)\n );\n }\n }\n },\n [\n handleSubmit,\n handleAgentItemSelect,\n isShowMentions,\n matchAgentList,\n matchMentionsIndex,\n ]\n );\n\n const handleKeyUp = useCallback(\n (e: React.KeyboardEvent) => {\n const textareaElement = textareaRef.current!;\n\n const selectionIndex = textareaElement.selectionStart;\n const prefixWord = textareaElement.value[selectionIndex - 1];\n const beforeSelectionText = textareaElement.value.slice(\n 0,\n selectionIndex\n );\n const index = beforeSelectionText.lastIndexOf(PREFIX_WORD);\n\n if (\n e.key === \"Escape\" ||\n (!isShowMentions &&\n [\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"].indexOf(e.key) !==\n -1)\n ) {\n setMatchPrefixIndex(-1);\n return;\n }\n\n if (prefixWord === PREFIX_WORD) {\n setMatchPrefixIndex(selectionIndex - 1);\n } else {\n setMatchPrefixIndex(index);\n }\n },\n [isShowMentions]\n );\n\n useEffect(() => {\n if (searchStr) {\n handleChange(searchStr.trim());\n textareaRef.current?.focus();\n setSearchStr(\"\");\n }\n }, [searchStr, disabled, setSearchStr, handleChange]);\n\n useEffect(() => {\n computedAutoSize(expand ? [20, 20] : undefined);\n }, [value, expand, computedAutoSize]);\n\n useEffect(() => {\n const searchInputBox = searchInputBoxRef.current;\n if (searchInputBox) {\n const observe = new ResizeObserver(() => {\n const { width: currentWidth } = searchInputBox.getBoundingClientRect();\n const FIT_CONTENT_WIDTH = 900;\n\n setIsFillContent(currentWidth < FIT_CONTENT_WIDTH);\n });\n\n observe.observe(searchInputBox);\n\n return () => {\n observe.disconnect();\n };\n }\n }, []);\n\n useEffect(() => {\n if (!chatting && textareaRef.current) {\n textareaRef.current?.focus();\n }\n }, [chatting]);\n\n useEffect(() => {\n if (agentList?.length && matchPrefixInfo) {\n const filterList =\n matchPrefixInfo.word === \"\"\n ? agentList\n : agentList.filter((item) =>\n item.name.includes(matchPrefixInfo.word)\n );\n\n setMatchMentionList(filterList);\n setMatchMentionsIndex(0);\n setMentionOpen(true);\n } else {\n setMatchMentionList([]);\n setMentionOpen(false);\n }\n }, [matchPrefixInfo, agentList]);\n\n useEffect(() => {\n if (matchMentionsIndex >= 0 && mentionsRef.current) {\n const element = mentionsRef.current.querySelector(\n \".mentions-item.active\"\n );\n element?.scrollIntoView({ block: \"nearest\" });\n }\n }, [matchMentionsIndex]);\n\n useEffect(() => {\n const handleDocumentClick = (e: any) => {\n const mentionsElemnt = mentionsRef.current;\n if (mentionsElemnt && !mentionsElemnt.contains(e.composedPath()[0])) {\n setMentionOpen(false);\n }\n };\n\n document.addEventListener(\"click\", handleDocumentClick);\n\n return () => {\n document.removeEventListener(\"click\", handleDocumentClick);\n };\n }, []);\n\n return (\n <div\n className={classNames(\"search-input-box\", {\n \"fill-content\": isFillContent,\n })}\n ref={searchInputBoxRef}\n >\n {mentions}\n <div\n className={classNames(\"input-box\", {\n active,\n disabled,\n expand,\n })}\n >\n <textarea\n value={value}\n ref={textareaRef}\n style={{\n ...autoSizeStyle,\n paddingRight: expand ? \"50px\" : \"140px\",\n }}\n placeholder={chatting ? \"回复中,请稍等...\" : \"提出你的想法...\"}\n onFocus={() => setActive(true)}\n onBlur={() => setActive(false)}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onKeyUpCapture={handleKeyUp}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n />\n <span className=\"suffix-icon\">\n <WrappedToolTip content=\"新增会话\">\n <WrappedIcon\n lib=\"antd\"\n icon=\"plus-circle\"\n onClick={hanldeCreateSession}\n />\n </WrappedToolTip>\n {!expand && (\n <WrappedToolTip content=\"放大\">\n <WrappedIcon\n lib=\"antd\"\n icon=\"arrows-alt\"\n onClick={handleExpand}\n />\n </WrappedToolTip>\n )}\n <div className=\"submit-split\"></div>\n <WrappedToolTip content=\"提交\">\n <WrappedIcon\n className={classNames(\"submit-btn\", {\n active: hadValue,\n disabled: !hadValue || disabled,\n })}\n lib={chatting ? \"antd\" : \"easyops\"}\n icon={chatting ? \"loading\" : \"release-management-fill\"}\n category={chatting ? \"\" : \"menu\"}\n spinning={chatting}\n onClick={handleSubmit}\n />\n </WrappedToolTip>\n </span>\n <span className=\"toolbar-icon\">\n {expand && (\n <WrappedToolTip content=\"缩小\">\n <WrappedIcon lib=\"antd\" icon=\"shrink\" onClick={handleExpand} />\n </WrappedToolTip>\n )}\n </span>\n </div>\n {hadValue && (\n <div className=\"search-input-toolbar\">\n <div className=\"input-tip\">Shift + Enter 换行</div>\n </div>\n )}\n </div>\n );\n}\n","import React, { useCallback, useEffect, useRef } from \"react\";\nimport { useChatViewContext } from \"../ChatViewContext\";\nimport classNames from \"classnames\";\nimport { debounce } from \"lodash\";\nimport { SessionItem as SessionItemProps } from \"../ChatService\";\nimport { CommonLoading } from \"./Loading.js\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport { unwrapProvider } from \"@next-core/utils/general\";\nimport type { showDialog as _showDialog } from \"@next-bricks/basic/data-providers/show-dialog/show-dialog\";\nimport type { showNotification as _showNotification } from \"@next-bricks/basic/data-providers/show-notification/show-notification\";\n\nconst showNotification = unwrapProvider<typeof _showNotification>(\n \"basic.show-notification\"\n);\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nconst showDialog = unwrapProvider<typeof _showDialog>(\"basic.show-dialog\");\n\nconst SESSION_ITEM_HEIGHT = 42;\nconst BUFFER_NUMBER = 5;\nconst CACHE_HEIGHT = 100;\n\nexport function SessionList(): React.ReactNode {\n const { sessionEnd, sessionLoading, sessionList, querySessionHistory } =\n useChatViewContext();\n const sessionWrapperRef = useRef<HTMLDivElement>(null);\n const sessionListRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n // 计算视图内可以展示多少条会话历史数据\n let limit = 20;\n const sessionWrapper = sessionWrapperRef.current;\n if (sessionWrapper) {\n // limit = 视图高度 % 单条高度 + 缓冲长度\n limit =\n Math.floor(sessionWrapper.clientHeight / SESSION_ITEM_HEIGHT) +\n BUFFER_NUMBER;\n }\n querySessionHistory(limit);\n }, []);\n\n const checkSessionList = useCallback(() => {\n if (sessionLoading || sessionEnd) return;\n const sessionList = sessionListRef.current;\n if (sessionList) {\n const { scrollTop, scrollHeight, clientHeight } = sessionList;\n // 如果滚动的高度 + 视图高度 + 缓冲高度 > 视图的滚动高度,请求新的数据\n if (scrollTop + clientHeight + CACHE_HEIGHT > scrollHeight) {\n querySessionHistory();\n }\n }\n }, [querySessionHistory, sessionLoading, sessionEnd]);\n\n const handleScroll = debounce(checkSessionList, 200);\n\n return (\n <div className=\"session-list-wrapper\" ref={sessionWrapperRef}>\n <div className=\"session-title\">历史对话</div>\n <div\n className=\"session-list\"\n ref={sessionListRef}\n onScroll={handleScroll}\n >\n {sessionList.map((item, index) => {\n return <SessionItem key={index} {...item} />;\n })}\n {sessionLoading && <CommonLoading />}\n {/* {sessionEnd && <div className=\"session-end-tip\">到底啦</div>} */}\n </div>\n </div>\n );\n}\n\nfunction SessionItem({ title, conversationId }: SessionItemProps) {\n const { activeSessionId, checkSession, deleteSession } = useChatViewContext();\n\n const handleCheckSession = useCallback(() => {\n checkSession(conversationId, true);\n }, [conversationId, checkSession]);\n\n const handleDeleteSession = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation();\n showDialog({\n type: \"confirm\",\n title: \"会话删除确认\",\n content: `请输入 {{ expect }} 以确认删除`,\n expect: title.replace(/\\s+/g, \"\"),\n }).then(async () => {\n const result = await deleteSession([conversationId]);\n showNotification({\n message: `删除会话${result ? \"成功\" : \"失败\"}`,\n type: result ? \"success\" : \"error\",\n });\n });\n },\n [conversationId, deleteSession, title]\n );\n\n return (\n <div\n key={title}\n className={classNames(\"session-item\", {\n active: conversationId === activeSessionId,\n })}\n onClick={handleCheckSession}\n >\n <div className=\"content\">\n <div className=\"title\" title={title}>\n {title}\n </div>\n </div>\n\n <div className=\"session-close-btn\" onClick={handleDeleteSession}>\n <WrappedIcon icon=\"close\" lib=\"antd\" />\n </div>\n </div>\n );\n}\n","import { fetchEventSource } from \"@microsoft/fetch-event-source\";\nimport { http } from \"@next-core/http\";\nimport { getBasePath } from \"@next-core/runtime\";\nimport moment from \"moment\";\n\nexport interface SSEMessageItem {\n conversationId?: string;\n created: number | string;\n delta: {\n content: string;\n role: string;\n };\n taskId?: string;\n agentId?: string;\n}\n\nexport interface QueueItem {\n topic: string;\n message?: SSEMessageItem;\n}\n\nexport interface SessionItem {\n conversationId: string;\n isDelete: boolean;\n time: number;\n title: string;\n user: string;\n _row_id: string;\n}\n\nexport interface ChatItem {\n agentId: string;\n conversationId: string;\n input: string;\n output: string;\n taskId: string;\n time: number;\n inputTime: number;\n user: string;\n _row_id: string;\n tag: {\n isLike?: boolean;\n };\n}\n\nexport class ChatService {\n #debug: boolean;\n #ctrl?: AbortController;\n #agentId: string;\n #enterInterval: number;\n #charting = false;\n #isStartEmitEvent = false;\n #emitTimer: NodeJS.Timeout | undefined;\n #messageQueue: Array<QueueItem> = [];\n #subscribers: Record<string, Array<(msg?: SSEMessageItem) => void>> = {};\n #conversationId?: string;\n\n // 会话\n #sessionNextToken?: string;\n #cacheLimit?: number;\n\n // 消息\n #messageNextToken?: string;\n\n constructor({\n agentId,\n enterInterval = 50,\n debug = false,\n }: {\n agentId: string;\n enterInterval: number;\n debug: boolean;\n }) {\n this.#agentId = agentId;\n this.#enterInterval = enterInterval;\n this.#debug = debug;\n }\n\n enqueue(data: QueueItem) {\n this.#messageQueue.push(data);\n this.#startEmitEvent();\n }\n\n dequeue() {\n return this.#messageQueue.shift();\n }\n\n #clear() {\n this.#messageQueue.length = 0;\n }\n\n getMessageQueue() {\n return this.#messageQueue;\n }\n\n subscribe(topic: string, callback: (msg?: SSEMessageItem) => void) {\n if (!this.#subscribers[topic]) {\n this.#subscribers[topic] = [];\n }\n this.#subscribers[topic].push(callback);\n }\n\n unsubscribe(topic: string, callback: (msg?: SSEMessageItem) => void) {\n if (this.#subscribers[topic]) {\n this.#subscribers[topic] = this.#subscribers[topic].filter(\n (cb) => cb !== callback\n );\n }\n }\n\n notifySubscribers(data: QueueItem) {\n const topic = data.topic;\n if (this.#subscribers[topic]) {\n this.#subscribers[topic].forEach((callback) => {\n callback(data?.message);\n });\n }\n }\n\n async setChatItemIsLike(id: string, isLike: boolean): Promise<boolean> {\n let flag: boolean = false;\n try {\n const { code } = await http.request<{ code: number }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.CommentDialogue/conversation/comment`,\n {\n method: \"POST\",\n body: JSON.stringify({\n taskId: id,\n isLike,\n }),\n }\n );\n if (code === 0) {\n flag = true;\n }\n } catch {\n flag = false;\n }\n return flag;\n }\n\n setAgentId(id: string) {\n this.#agentId = id;\n }\n\n setConversationId(id?: string) {\n this.#conversationId = id;\n }\n\n async getSessionHistory(limit?: number): Promise<SessionItem[]> {\n if (limit) {\n this.#cacheLimit = limit;\n }\n try {\n const {\n data: { conversations, next_token },\n } = await http.request<{\n data: {\n conversations: SessionItem[];\n next_token: string;\n previous_token: string;\n };\n }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.ListConversation/conversation/list`,\n {\n method: \"POST\",\n body: JSON.stringify({\n limit: this.#cacheLimit ?? 20,\n next_token: this.#sessionNextToken,\n }),\n }\n );\n this.#sessionNextToken = next_token;\n if (!next_token) {\n this.notifySubscribers({ topic: \"session.fetch.end\" });\n }\n return conversations;\n } catch {\n // eslint-disable-next-line no-console\n console.error(\"获取会话历史失败\");\n }\n return [];\n }\n\n async getChatHistory(id?: string): Promise<ChatItem[]> {\n if (id) {\n this.setConversationId(id);\n this.#messageNextToken = \"\";\n }\n if (!this.#conversationId) return [];\n try {\n const {\n data: { conversations, next_token },\n } = await http.request<{\n data: {\n conversations: ChatItem[];\n next_token: string;\n previous_token: string;\n };\n }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.GetAllDialogue/conversation/get/${this.#conversationId}`,\n {\n method: \"POST\",\n body: JSON.stringify({\n limit: 15,\n next_token: this.#messageNextToken,\n }),\n }\n );\n this.#messageNextToken = next_token;\n if (!next_token) {\n this.notifySubscribers({ topic: \"message.fetch.end\" });\n }\n return conversations;\n } catch {\n // eslint-disable-next-line no-console\n console.error(\"获取消息历史失败\");\n }\n return [];\n }\n\n async deleteSession(id: string[]): Promise<boolean> {\n if (!id.length) return false;\n let flag: boolean = false;\n try {\n const { code } = await http.request<{ code: number }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.DeleteConversation/conversation/delete`,\n {\n method: \"POST\",\n body: JSON.stringify({\n conversationIds: id,\n }),\n }\n );\n if (code === 0) {\n flag = true;\n }\n } catch {\n flag = false;\n }\n return flag;\n }\n\n splitWord(str: string): string[] {\n if (!str) return [];\n // 单词长度小于 5 直接返回, 否则做单词分割处理\n if (str?.length < 5) return [str];\n const list = [];\n\n // TODO: 特殊逻辑,临时处理 debug 内容\n if (this.#debug && /easy_cmd_flow_debug/.test(str)) {\n return [str];\n }\n\n if (window.Intl) {\n const segmenterFr = new Intl.Segmenter(\"zh-Hans-CN\", {\n granularity: \"word\",\n });\n const iterator = segmenterFr.segment(str)[Symbol.iterator]();\n\n let nextWord = iterator.next();\n while (!nextWord.done) {\n list.push(nextWord.value.segment);\n nextWord = iterator.next();\n }\n } else {\n const customSplit = {\n [Symbol.split](str: string) {\n let pos = 0;\n const result = [];\n let cache = \"\";\n while (pos < str.length) {\n const matchStr = str.substring(pos, pos + 1);\n // 如果是中文,单个输出\n if (/[\\u4e00-\\u9fa5]/.test(matchStr)) {\n result.push(cache + matchStr);\n cache = \"\";\n } else {\n // 否则,遇到空格或者标点符号再分词\n if (!/\\s|[,。;《》?!,.:<>?!]]/.test(matchStr)) {\n cache = cache + matchStr;\n } else {\n result.push(cache + matchStr);\n cache = \"\";\n }\n }\n pos++;\n }\n if (cache) result.push(cache);\n return result;\n },\n };\n\n str.split(customSplit).forEach((word) => {\n list.push(word);\n });\n }\n\n return list;\n }\n\n async chat(str: string): Promise<void> {\n this.#ctrl = new AbortController();\n let hadMatchMessage = false;\n this.#charting = true;\n await fetchEventSource(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.manage.LLMChatProxy@1.0.0/api/aiops_chat/v1/chat/completions`,\n {\n method: \"POST\",\n signal: this.#ctrl.signal,\n body: JSON.stringify({\n agentId: this.#agentId,\n conversationId: this.#conversationId,\n input: str,\n stream: true,\n config: {\n debug: this.#debug,\n },\n }),\n headers: {\n \"giraffe-contract-name\": \"easyops.api.aiops_chat.manage.LLMChatProxy\",\n },\n onopen: async (response) => {\n if (response.ok) {\n // eslint-disable-next-line no-console\n console.log(\"open sse service success!\");\n } else {\n // eslint-disable-next-line no-console\n console.log(\"open sse service fail!\");\n }\n },\n onmessage: (msg) => {\n const { data } = msg;\n hadMatchMessage = true;\n if (data === \"[DONE]\") {\n this.#ctrl!.abort();\n return;\n }\n let result = {} as SSEMessageItem;\n try {\n result = JSON.parse(data);\n } catch {\n this.enqueue({\n topic: \"add\",\n message: {\n created: moment().format(\"YYYY-MM-DD HH:mm:ss\"),\n delta: {\n role: \"assistant\",\n content: `\\`【数据格式错误】:\\` ${data}`,\n },\n agentId: this.#agentId,\n },\n });\n return;\n }\n if (!this.#conversationId) {\n this.setConversationId(result.conversationId);\n }\n const wordList = this.splitWord(result.delta.content);\n wordList.forEach((word) => {\n this.enqueue({\n topic: \"add\",\n message: {\n ...result,\n delta: {\n role: \"assistant\",\n content: word,\n },\n },\n });\n });\n },\n onclose: () => {\n // eslint-disable-next-line no-console\n console.log(\"close\");\n // 兜底逻辑,连接结束,并且没有数据返回\n if (!hadMatchMessage) {\n this.enqueue({\n topic: \"add\",\n message: {\n delta: {\n role: \"assistant\",\n content: \"`无法识别`\",\n },\n agentId: this.#agentId,\n created: moment().format(\"YYYY-MM-DD HH:mm:ss\"),\n },\n });\n }\n this.#ctrl!.abort();\n },\n onerror: (err) => {\n // eslint-disable-next-line no-console\n console.log(\"err\", err);\n this.#ctrl!.abort();\n },\n }\n );\n\n this.#charting = false;\n }\n\n stop() {\n clearInterval(this.#emitTimer);\n this.#ctrl && this.#ctrl?.abort();\n this.#charting = false;\n this.#emitTimer = undefined;\n this.#isStartEmitEvent = false;\n this.#clear();\n this.notifySubscribers({ topic: \"stop\" });\n }\n\n #startEmitEvent() {\n if (this.#isStartEmitEvent) return;\n this.#isStartEmitEvent = true;\n // 轮训队列,每隔 #enterInterval(默认 50ms) 推出第一条数据,获取到 text,推送给组件,组件接受后进行渲染\n // 直到聊天结束,并且消息队列数据为空时,停止 emit\n this.#emitTimer = setInterval(() => {\n if (this.#charting || this.getMessageQueue().length) {\n const messageItem = this.dequeue()!;\n messageItem && this.notifySubscribers(messageItem);\n } else {\n clearInterval(this.#emitTimer);\n this.#emitTimer = undefined;\n this.#isStartEmitEvent = false;\n this.notifySubscribers({ topic: \"finish\" });\n }\n }, this.#enterInterval);\n }\n}\n\n// export const chartService = new ChatService();\n","import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { MessageItem } from \"../ChatViewContext.js\";\nimport moment from \"moment\";\nimport {\n ChatItem,\n ChatService,\n SessionItem,\n SSEMessageItem,\n} from \"../ChatService.js\";\n\nconst NEW_SESSION_ID = \"new_session_id\";\n\nexport function useChatViewInfo({\n agentId,\n sessionId,\n enterInterval = 50,\n debug,\n}: {\n agentId: string;\n sessionId?: string;\n enterInterval?: number;\n debug: boolean;\n}) {\n const [sessionEnd, setSessionEnd] = useState<boolean>(false);\n const [sessionLoading, setSessionLoading] = useState<boolean>(false);\n const [activeSessionId, setActiveSessionId] = useState<string>();\n const [loading, setLoading] = useState<boolean>(false);\n const [chatting, setChatting] = useState<boolean>(false);\n const [sessionList, setSessionList] = useState<SessionItem[]>([]);\n\n const [msgLoading, setMsgLoading] = useState<boolean>(false);\n const [msgEnd, setMsgEnd] = useState<boolean>(false);\n const [msgList, setMsgList] = useState<MessageItem[]>([]);\n const [searchStr, setSearchStr] = useState<string>(\"\");\n const chatingText = useRef<string>(\"\");\n const chatingMessageItem = useRef<MessageItem>();\n const chatService = useMemo(\n () =>\n new ChatService({\n agentId,\n enterInterval,\n debug,\n }),\n [agentId, enterInterval, debug]\n );\n\n const defaultNewSessionItem = useMemo(\n () =>\n ({\n conversationId: NEW_SESSION_ID,\n title: \"新建会话\",\n }) as SessionItem,\n []\n );\n\n const stopChat = useCallback(() => {\n chatService.stop();\n }, [chatService]);\n\n const setAgent = useCallback(\n (id: string) => {\n chatService.setAgentId(id);\n },\n [chatService]\n );\n\n const checkSession = useCallback(\n async (id?: string, isInit = false) => {\n if (isInit && id) {\n // 切换聊天,重制状态\n setMsgEnd(false);\n setMsgLoading(false);\n setLoading(true);\n setMsgList([]);\n setActiveSessionId(id);\n if (chatting) {\n stopChat();\n }\n } else {\n setMsgLoading(true);\n }\n // 如果是新建会话,不需要查询历史\n if (id === NEW_SESSION_ID) {\n // 重置会话id\n chatService.setConversationId();\n setMsgEnd(true);\n setLoading(false);\n return;\n }\n const list = await chatService.getChatHistory(id);\n const computedList = (list: ChatItem[]) => {\n const newList: MessageItem[] = [];\n list.forEach((item) => {\n newList.unshift(\n {\n agentId: item.agentId,\n taskId: item.taskId,\n conversationId: item.conversationId,\n role: \"user\",\n content: {\n type: \"text\",\n text: item.input,\n },\n key: `user_${item.taskId}`,\n created: item.time,\n },\n {\n agentId: item.agentId,\n taskId: item.taskId,\n conversationId: item.conversationId,\n role: \"assistant\",\n content: {\n type: \"markdown\",\n text: item.output,\n },\n key: `assistant_${item.taskId}`,\n created: item.inputTime,\n tag: item.tag,\n }\n );\n });\n return newList.filter((item) => item.content.text);\n };\n setMsgList((preList) => {\n return computedList(list).concat(preList);\n });\n setMsgLoading(false);\n setLoading(false);\n },\n [chatService, chatting, stopChat]\n );\n\n const deleteSession = useCallback(\n async (ids: string[]): Promise<boolean> => {\n // 需要过滤新建会话, 因为新建会话在本地,还没上报到远端\n const filterIds = ids.filter((item) => item !== NEW_SESSION_ID);\n const result = await chatService.deleteSession(filterIds);\n if (result) {\n let deleteActiveSession = false;\n if (\n activeSessionId &&\n filterIds.includes(activeSessionId) &&\n activeSessionId !== NEW_SESSION_ID\n ) {\n // 如果删除会话包含当前会话,需要重置状态\n deleteActiveSession = true;\n // 清除会话id\n chatService.setConversationId();\n\n setMsgEnd(false);\n setMsgLoading(false);\n setMsgList([]);\n\n if (chatting) {\n stopChat();\n }\n }\n\n setSessionList((list) => {\n const newList = list.filter(\n (item) => !filterIds.includes(item.conversationId!)\n );\n if (deleteActiveSession) {\n // 已经选中的当前会话被删除,新建会话\n const hasNewOne = list.find(\n (item) => item.conversationId === NEW_SESSION_ID\n );\n setLoading(false);\n\n setActiveSessionId(NEW_SESSION_ID);\n if (hasNewOne) {\n return newList;\n } else {\n return [defaultNewSessionItem].concat(newList);\n }\n }\n return newList;\n });\n }\n return result;\n },\n [activeSessionId, chatService, chatting, defaultNewSessionItem, stopChat]\n );\n\n const querySessionHistory = useCallback(\n async (limit?: number) => {\n setSessionLoading(true);\n const list = await chatService.getSessionHistory(limit);\n if (!activeSessionId) {\n // 如果没有 activeSessionId, 默认新增会话\n setActiveSessionId(NEW_SESSION_ID);\n }\n setSessionList((preList) => {\n return !activeSessionId\n ? [defaultNewSessionItem].concat([...preList, ...list])\n : preList.concat(list);\n });\n setSessionLoading(false);\n },\n [chatService, activeSessionId, defaultNewSessionItem]\n );\n\n const handleChat = useCallback(\n async (str: string) => {\n if (activeSessionId === NEW_SESSION_ID) {\n // 如果当前会话属于新建会话,更新会话历史数据\n setSessionList((list) => {\n return list.map((item) => ({\n ...item,\n title: item.conversationId === NEW_SESSION_ID ? str : item.title,\n }));\n });\n }\n setChatting(true);\n chatService.chat(str);\n setMsgList((list) => {\n return list.concat([\n {\n role: \"user\",\n content: {\n type: \"text\",\n text: str,\n },\n created: moment().format(\"YYYY-MM-DD HH:mm:ss\"),\n },\n {\n role: \"assistant\",\n content: {\n type: \"load\",\n text: \"\",\n },\n chatting: true,\n created: \"Now\",\n },\n ]);\n });\n },\n [chatService, activeSessionId]\n );\n\n const createSession = useCallback(() => {\n chatService.setConversationId();\n setMsgList([]);\n setActiveSessionId(NEW_SESSION_ID);\n const hasNewOne = sessionList.find(\n (item) => item.conversationId === NEW_SESSION_ID\n );\n if (!hasNewOne) {\n setSessionList((preList) => {\n return [defaultNewSessionItem].concat(preList);\n });\n }\n }, [chatService, sessionList, defaultNewSessionItem]);\n\n const handleIsLike = useCallback(\n async (id: string, isLike: boolean): Promise<boolean> => {\n const result = await chatService.setChatItemIsLike(id, isLike);\n if (result) {\n setMsgList((list) => {\n return list.map((item) => ({\n ...item,\n tag:\n id === item.taskId\n ? {\n isLike,\n }\n : item.tag,\n }));\n });\n }\n return result;\n },\n [chatService]\n );\n\n useEffect(() => {\n if (sessionId) {\n checkSession(sessionId);\n }\n }, [sessionId]);\n\n useEffect(() => {\n // session listener\n const handleSessionEnd = () => {\n setSessionEnd(true);\n };\n chatService.subscribe(\"session.fetch.end\", handleSessionEnd);\n\n return () => {\n chatService.subscribe(\"session.fetch.end\", handleSessionEnd);\n };\n }, [chatService]);\n\n useEffect(() => {\n // chat listener\n const listener = (msgItem?: SSEMessageItem) => {\n if (!msgItem) return;\n chatingText.current = chatingText.current + msgItem.delta.content;\n if (activeSessionId === NEW_SESSION_ID && msgItem.conversationId) {\n // 如果当前会话属于新建会话,更新会话历史数据\n setSessionList((list) => {\n return list.map((item) => ({\n ...item,\n conversationId:\n item.conversationId === NEW_SESSION_ID\n ? msgItem.conversationId!\n : item.conversationId,\n }));\n });\n setActiveSessionId(msgItem.conversationId);\n }\n // eslint-disable-next-line no-console\n // console.log(chatingText.current);\n chatingMessageItem.current = {\n ...msgItem,\n role: \"assistant\",\n content: {\n type: \"markdown\",\n text: chatingText.current,\n },\n chatting: true,\n created: moment(msgItem?.created).format(\"YYYY-MM-DD HH:mm:ss\"),\n };\n setMsgList((list) => {\n list.pop();\n return list.concat(chatingMessageItem.current!);\n });\n };\n const reset = () => {\n chatingText.current = \"\";\n setChatting(false);\n setLoading(false);\n chatingMessageItem.current = undefined;\n };\n const finishListener = () => {\n setMsgList((list) => {\n return list.map((item) => ({\n ...item,\n chatting: false,\n }));\n });\n reset();\n };\n const fetchEndListener = () => {\n setMsgEnd(true);\n };\n const stopListener = () => {\n if (chatingMessageItem.current) {\n const stopMessageItem: MessageItem = {\n ...chatingMessageItem.current,\n content: {\n type: \"markdown\",\n text:\n chatingMessageItem.current.content.text +\n \" \\\\\\n ` 对话被中断了 `\",\n },\n };\n setMsgList((list) => {\n list.pop();\n return msgList.concat(stopMessageItem);\n });\n } else {\n setMsgList((list) => {\n return list.filter((item) => item.content.type !== \"load\");\n });\n }\n reset();\n };\n chatService.subscribe(\"add\", listener);\n chatService.subscribe(\"finish\", finishListener);\n chatService.subscribe(\"stop\", stopListener);\n chatService.subscribe(\"message.fetch.end\", fetchEndListener);\n return () => {\n chatService.unsubscribe(\"add\", listener);\n chatService.unsubscribe(\"finish\", finishListener);\n chatService.unsubscribe(\"stop\", stopListener);\n chatService.unsubscribe(\"message.fetch.end\", fetchEndListener);\n };\n }, [chatService, activeSessionId, msgList]);\n\n return {\n sessionEnd,\n sessionLoading,\n loading,\n chatting,\n activeSessionId,\n sessionList,\n searchStr,\n msgEnd,\n msgLoading,\n msgList,\n setAgent,\n handleChat,\n stopChat,\n createSession,\n deleteSession,\n checkSession,\n setSearchStr,\n querySessionHistory,\n handleIsLike,\n };\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.progress-text{position:relative;margin-left:12px;font-size:12px;color:var(--palette-gray-7);line-height:22px;min-height:22px}.progress-text::before{content:\"·\";font-size:16px;position:absolute;left:-10px;top:-4px}.custom-component-wrapper .params{margin-top:6px;border-radius:3px}.custom-component-wrapper .params pre{margin:4px 0}.custom-component-wrapper .params-tip,\n .custom-component-wrapper .error-tip,\n .custom-component-wrapper .result-tip{font-size:0.875em;color:rgb(94 129 172)}.custom-component-wrapper .empty-tip{font-size:12px;color:var(--palette-gray-7)}.custom-component-wrapper .table-wrapper .table-container{position:relative;box-sizing:border-box;margin:0;padding:0;font-size:14px;clear:both;max-width:100%;overflow:hidden}.custom-component-wrapper .table-wrapper .table-container .table-content{overflow-x:auto}.custom-component-wrapper .table-wrapper .table-container .table-content table{margin:4px 0}.custom-component-wrapper .table-wrapper .table-container .table-content table tr td{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.custom-component-wrapper .table-wrapper .open-more{margin-top:4px;font-size:12px;display:flex;justify-content:end}.custom-component-wrapper .chart-wrapper{background:#fff;margin-top:12px}.default-container .default-toolbar-container{visibility:hidden;position:absolute;top:0;right:0}.default-container:hover .default-toolbar-container{visibility:visible}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;font-variant-ligatures:none;font-feature-settings:\"liga\" 0,none}.ProseMirror pre{white-space:pre-wrap}.ProseMirror li{position:relative}.ProseMirror-hideselection *::selection{background:transparent}.ProseMirror-hideselection *::-moz-selection{background:transparent}.ProseMirror-hideselection{caret-color:transparent}.ProseMirror-selectednode{outline:2px solid #8cf}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:\"\";position:absolute;left:-32px;right:-2px;top:-2px;bottom:-2px;border:2px solid #8cf;pointer-events:none}img.ProseMirror-separator{display:inline!important;border:none!important;margin:0!important}.ProseMirror .tableWrapper{overflow-x:auto}.ProseMirror table{border-collapse:collapse;table-layout:fixed;width:100%;overflow:hidden}.ProseMirror td,\n.ProseMirror th{vertical-align:top;box-sizing:border-box;position:relative}.ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;z-index:20;background-color:#adf;pointer-events:none}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}.ProseMirror .selectedCell:after{z-index:2;position:absolute;content:\"\";left:0;right:0;top:0;bottom:0;background:rgba(200,200,255,0.4);pointer-events:none}.milkdown-theme-nord blockquote{border-left-width:4px;--tw-border-opacity:1;border-color:rgb(94 129 172/var(--tw-border-opacity));padding-left:1rem;font-family:ui-serif,Georgia,Cambria,Times New Roman,Times,serif;font-style:normal}.milkdown-theme-nord code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-weight:400;--tw-text-opacity:1;color:rgb(94 129 172/var(--tw-text-opacity))}.milkdown-theme-nord pre code{color:inherit}.milkdown-theme-nord img{margin-top:0!important;margin-bottom:0!important;display:inline-block;max-width:100%}.milkdown-theme-nord.prose\n :where(blockquote):not(:where([class~=\"not-prose\"] *)){font-weight:400}.milkdown-theme-nord.prose\n :where(ol > li):not(:where([class~=\"not-prose\"] *))::marker,\n.milkdown-theme-nord.prose\n :where(ul > li):not(:where([class~=\"not-prose\"] *))::marker{--tw-text-opacity:1;color:rgb(94 129 172/var(--tw-text-opacity))}.milkdown-theme-nord.prose\n :where(blockquote p:first-of-type):not(:where([class~=\"not-prose\"] *)):before,\n.milkdown-theme-nord.prose\n :where(blockquote p:first-of-type):not(:where([class~=\"not-prose\"] *)):after{content:\"\"}.milkdown-theme-nord.prose\n :where(code):not(:where([class~=\"not-prose\"] *)):before,\n.milkdown-theme-nord.prose\n :where(code):not(:where([class~=\"not-prose\"] *)):after{content:\"\"}.milkdown-theme-nord.prose .tableWrapper{position:relative;margin-bottom:0.5rem;overflow-x:auto}.milkdown-theme-nord.prose table{font-size:0.875rem;line-height:1.25rem;--tw-shadow:0 4px 6px -1px rgb(0 0 0/0.1),0 2px 4px -2px rgb(0 0 0/0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}@media (min-width: 640px){.milkdown-theme-nord.prose table{border-radius:0.5rem}}.milkdown-theme-nord.prose td,\n.milkdown-theme-nord.prose th{padding:0.75rem 1.5rem!important}.milkdown-theme-nord.prose tr{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.dark .milkdown-theme-nord.prose tr{--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity))}.milkdown-theme-nord.prose :where(td, th) p{margin:0!important}.milkdown-theme-nord.prose :where(td, th):nth-child(odd){background-color:var(--color-fill-bg-base-1)}.dark .milkdown-theme-nord.prose :where(td, th):nth-child(odd){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}.milkdown-theme-nord.prose.ProseMirror .selectedCell:after{background-color:#88c0d04d}.milkdown-theme-nord.prose br[data-is-inline=\"true\"],\n.milkdown-theme-nord.prose br[data-is-inline=\"true\"]:after{content:\" \"}.prose{color:var(--color-normal-text)}.prose :where(p):not(:where([class~=\"not-prose\"] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=\"lead\"]):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=\"not-prose\"] *)){color:var(--color-info);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600}.prose :where(a strong):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(ol):not(:where([class~=\"not-prose\"] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol[type=\"A\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-alpha}.prose :where(ol[type=\"a\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-alpha}.prose :where(ol[type=\"A\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-alpha}.prose :where(ol[type=\"a\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-alpha}.prose :where(ol[type=\"I\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-roman}.prose :where(ol[type=\"i\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-roman}.prose :where(ol[type=\"I\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-roman}.prose :where(ol[type=\"i\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-roman}.prose :where(ol[type=\"1\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=\"not-prose\"] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol > li):not(:where([class~=\"not-prose\"] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul > li):not(:where([class~=\"not-prose\"] *))::marker{color:var(--tw-prose-bullets)}.prose :where(hr):not(:where([class~=\"not-prose\"] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=\"not-prose\"] *)){font-weight:500;font-style:italic;color:var(--color-auxiliary-text);border-left-width:0.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:\"\\\\201C\" \"\\\\201D\" \"\\\\2018\" \"\\\\2019\";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.prose\n :where(blockquote p:first-of-type):not(\n :where([class~=\"not-prose\"] *)\n )::before{content:open-quote}.prose\n :where(blockquote p:last-of-type):not(:where([class~=\"not-prose\"] *))::after{content:close-quote}.prose :where(h1):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:0.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=\"not-prose\"] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=\"not-prose\"] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:0.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=\"not-prose\"] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600;margin-top:1.5em;margin-bottom:0.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=\"not-prose\"] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=\"not-prose\"] *)){margin-top:2em;margin-bottom:2em}.prose :where(figure > *):not(:where([class~=\"not-prose\"] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-captions);font-size:0.875em;line-height:1.4285714;margin-top:0.8571429em}.prose :where(code):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-code);font-weight:600;font-size:0.875em}.prose :where(code):not(:where([class~=\"not-prose\"] *))::before{content:\"\\`\"}.prose :where(code):not(:where([class~=\"not-prose\"] *))::after{content:\"\\`\"}.prose :where(a code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(h1 code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(h2 code):not(:where([class~=\"not-prose\"] *)){color:inherit;font-size:0.875em}.prose :where(h3 code):not(:where([class~=\"not-prose\"] *)){color:inherit;font-size:0.9em}.prose :where(h4 code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(thead th code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(pre):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:0.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:0.375rem;padding-top:0.8571429em;padding-right:1.1428571em;padding-bottom:0.8571429em;padding-left:1.1428571em}.prose :where(pre code):not(:where([class~=\"not-prose\"] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=\"not-prose\"] *))::before{content:none}.prose :where(pre code):not(:where([class~=\"not-prose\"] *))::after{content:none}.prose :where(table):not(:where([class~=\"not-prose\"] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:0.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=\"not-prose\"] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600;vertical-align:bottom;padding-right:0.5714286em;padding-bottom:0.5714286em;padding-left:0.5714286em}.prose :where(tbody tr):not(:where([class~=\"not-prose\"] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=\"not-prose\"] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=\"not-prose\"] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=\"not-prose\"] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=\"not-prose\"] *)){vertical-align:top}.prose{--tw-prose-body:#374151;--tw-prose-headings:#111827;--tw-prose-lead:#4b5563;--tw-prose-links:#111827;--tw-prose-bold:#111827;--tw-prose-counters:#6b7280;--tw-prose-bullets:#d1d5db;--tw-prose-hr:#e5e7eb;--tw-prose-quotes:#111827;--tw-prose-quote-borders:#e5e7eb;--tw-prose-captions:#6b7280;--tw-prose-code:#111827;--tw-prose-pre-code:#e5e7eb;--tw-prose-pre-bg:#1f2937;--tw-prose-th-borders:#d1d5db;--tw-prose-td-borders:#e5e7eb;--tw-prose-invert-body:#d1d5db;--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:#9ca3af;--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:#9ca3af;--tw-prose-invert-bullets:#4b5563;--tw-prose-invert-hr:#374151;--tw-prose-invert-quotes:#f3f4f6;--tw-prose-invert-quote-borders:#374151;--tw-prose-invert-captions:#9ca3af;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:#d1d5db;--tw-prose-invert-pre-bg:rgb(0 0 0/50%);--tw-prose-invert-th-borders:#4b5563;--tw-prose-invert-td-borders:#374151;font-size:1rem;line-height:1.75}.prose :where(video):not(:where([class~=\"not-prose\"] *)){margin-top:2em;margin-bottom:2em}.prose :where(figure):not(:where([class~=\"not-prose\"] *)){margin-top:2em;margin-bottom:2em}.prose :where(li):not(:where([class~=\"not-prose\"] *)){margin-top:0.5em;margin-bottom:0.5em}.prose :where(ol > li):not(:where([class~=\"not-prose\"] *)){padding-left:0.375em}.prose :where(ul > li):not(:where([class~=\"not-prose\"] *)){padding-left:0.375em}.prose :where(.prose > ul > li p):not(:where([class~=\"not-prose\"] *)){margin-top:0.75em;margin-bottom:0.75em}.prose\n :where(.prose > ul > li > *:first-child):not(:where([class~=\"not-prose\"] *)){margin-top:1.25em}.prose\n :where(.prose > ul > li > *:last-child):not(:where([class~=\"not-prose\"] *)){margin-bottom:1.25em}.prose\n :where(.prose > ol > li > *:first-child):not(:where([class~=\"not-prose\"] *)){margin-top:1.25em}.prose\n :where(.prose > ol > li > *:last-child):not(:where([class~=\"not-prose\"] *)){margin-bottom:1.25em}.prose :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~=\"not-prose\"] *)){margin-top:0.75em;margin-bottom:0.75em}.prose :where(hr + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(h2 + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(h3 + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(h4 + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=\"not-prose\"] *)){padding-left:0}.prose :where(thead th:last-child):not(:where([class~=\"not-prose\"] *)){padding-right:0}.prose :where(tbody td, tfoot td):not(:where([class~=\"not-prose\"] *)){padding-top:0.5714286em;padding-right:0.5714286em;padding-bottom:0.5714286em;padding-left:0.5714286em}.prose\n :where(tbody td:first-child, tfoot td:first-child):not(\n :where([class~=\"not-prose\"] *)\n ){padding-left:0}.prose\n :where(tbody td:last-child, tfoot td:last-child):not(\n :where([class~=\"not-prose\"] *)\n ){padding-right:0}.prose :where(.prose > :first-child):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(.prose > :last-child):not(:where([class~=\"not-prose\"] *)){margin-bottom:0}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:-webkit-sticky;position:sticky}.isolate{isolation:isolate}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.\\\\!table{display:table!important}.table{display:table}.inline-table{display:inline-table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row-group{display:table-row-group}.table-row{display:table-row}.flow-root{display:flow-root}.grid{display:grid}.inline-grid{display:inline-grid}.contents{display:contents}.list-item{display:list-item}.hidden{display:none}.flex-shrink{flex-shrink:1}.shrink{flex-shrink:1}.flex-grow{flex-grow:1}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.\\\\!transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.flex-wrap{flex-wrap:wrap}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.break-all{word-break:break-all}.rounded{border-radius:0.25rem}.border{border-width:1px}.text-justify{text-align:justify}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.ordinal{--tw-ordinal:ordinal;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.lining-nums{--tw-numeric-figure:lining-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.underline{-webkit-text-decoration-line:underline;text-decoration-line:underline}.overline{-webkit-text-decoration-line:overline;text-decoration-line:overline}.line-through{-webkit-text-decoration-line:line-through;text-decoration-line:line-through}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0/0.1),0 1px 2px -1px rgb(0 0 0/0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.sepia{--tw-sepia:sepia(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4,0,0.2,1);transition-duration:150ms}.ease-in{transition-timing-function:cubic-bezier(0.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(0.4,0,0.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,0.2,1)}.milkdown{border-radius:0.25rem;margin:0;padding:0}.editor{margin-left:auto;margin-right:auto}:is(.dark .dark\\\\:prose-invert){--tw-prose-body:var(--tw-prose-invert-body);--tw-prose-headings:var(--tw-prose-invert-headings);--tw-prose-lead:var(--tw-prose-invert-lead);--tw-prose-links:var(--tw-prose-invert-links);--tw-prose-bold:var(--tw-prose-invert-bold);--tw-prose-counters:var(--tw-prose-invert-counters);--tw-prose-bullets:var(--tw-prose-invert-bullets);--tw-prose-hr:var(--tw-prose-invert-hr);--tw-prose-quotes:var(--tw-prose-invert-quotes);--tw-prose-quote-borders:var(--tw-prose-invert-quote-borders);--tw-prose-captions:var(--tw-prose-invert-captions);--tw-prose-code:var(--tw-prose-invert-code);--tw-prose-pre-code:var(--tw-prose-invert-pre-code);--tw-prose-pre-bg:var(--tw-prose-invert-pre-bg);--tw-prose-th-borders:var(--tw-prose-invert-th-borders);--tw-prose-td-borders:var(--tw-prose-invert-td-borders)}code[class*=\"language-\"],\npre[class*=\"language-\"]{color:#f8f8f2;background:none;font-family:\"Fira Code\",Consolas,Monaco,\"Andale Mono\",\"Ubuntu Mono\",monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none}pre[class*=\"language-\"]{padding:1em;margin:0.5em 0;overflow:auto;border-radius:0.3em}:not(pre) > code[class*=\"language-\"],\npre[class*=\"language-\"]{background:#2e3440}:not(pre) > code[class*=\"language-\"]{padding:0.1em;border-radius:0.3em;white-space:normal}.token.comment,\n.token.prolog,\n.token.doctype,\n.token.cdata{color:#636f88}.token.punctuation{color:#81a1c1}.namespace{opacity:0.7}.token.property,\n.token.tag,\n.token.constant,\n.token.symbol,\n.token.deleted{color:#81a1c1}.token.number{color:#b48ead}.token.boolean{color:#81a1c1}.token.selector,\n.token.attr-name,\n.token.string,\n.token.char,\n.token.builtin,\n.token.inserted{color:#a3be8c}.token.operator,\n.token.entity,\n.token.url,\n.language-css .token.string,\n.style .token.string,\n.token.variable{color:#81a1c1}.token.atrule,\n.token.attr-value,\n.token.function,\n.token.class-name{color:#88c0d0}.token.keyword{color:#81a1c1}.token.regex,\n.token.important{color:#ebcb8b}.token.important,\n.token.bold{font-weight:bold}.token.italic{font-style:italic}.token.entity{cursor:help}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.quick-answer-wrapper{margin-top:20px;border-radius:6px;border:1px solid var(--color-border-divider-line);padding:16px 24px}.quick-answer-wrapper .tip{font-size:18px;margin-bottom:30px}.quick-answer-wrapper .quick-answer-list{display:grid;grid-gap:24px 16px;gap:24px 16px;border-radius:3px;grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item{position:relative;padding:16px;border-radius:6px;cursor:pointer;display:flex;padding:10px 20px;gap:12px;width:auto;box-sizing:border-box}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item:hover{box-shadow:var(--quick-answer-card-item-hover)}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .left .icon{font-size:20px;color:#fff;padding:8px;border-radius:6px;margin-top:4px}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .content{flex:1;min-width:0}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .content .title{font-size:16px;font-weight:bold;color:var(--color-normal-text);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .content .description{color:var(--color-auxiliary-text);font-size:12px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.quick-answer-wrapper .show-more-wrapper{text-align:center;margin-top:20px}.quick-answer-wrapper .show-more-wrapper .show-more-btn{line-height:24px}.quick-answer-wrapper .show-more-wrapper .show-more-btn::after,\n .quick-answer-wrapper .show-more-wrapper .show-more-btn::before{content:\"- - - - -\";color:var(--color-text-divider-line);position:absolute}.quick-answer-wrapper .show-more-wrapper .show-more-btn::before{margin-left:-60px}.quick-answer-wrapper .show-more-wrapper .show-more-btn::after{margin-left:10px}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"../assets/loading.gif\", import.meta.url);\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\nvar ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.message-list-loading-wrapper{width:140px;height:140px;background-repeat:no-repeat;margin:auto;background-image:url(${___CSS_LOADER_URL_REPLACEMENT_0___})}.chart-item-loading-wrapper{display:flex;padding:10px;font-size:40px;align-items:center;justify-content:center;color:#d2d3d4;border-radius:6px}.chart-item-loading-wrapper .load{display:inline-block;position:relative;width:64px;height:64px}.chart-item-loading-wrapper .load div{position:absolute;top:27px;width:11px;height:11px;border-radius:50%;background:#aaa8a8;animation-timing-function:cubic-bezier(0,1,1,0)}.chart-item-loading-wrapper .load div:nth-child(1){left:6px;animation:load1 0.6s infinite}.chart-item-loading-wrapper .load div:nth-child(2){left:6px;animation:load2 0.6s infinite}.chart-item-loading-wrapper .load div:nth-child(3){left:26px;animation:load2 0.6s infinite}.chart-item-loading-wrapper .load div:nth-child(4){left:45px;animation:load3 0.6s infinite}@keyframes load1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes load2{0%{transform:translate(0,0)}100%{transform:translate(19px,0)}}@keyframes load3{0%{transform:scale(1)}100%{transform:scale(0)}}.common-loading-wrapper{text-align:center;font-size:30px;color:#ddd}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--message-box-bg:#f1f3f4;--search-input-icon-hover:#ddd;--quick-answer-card-item-hover:0px 7px 8px 0px rgba(0,0,0,0.15)}html[data-theme=\"dark\"],\nhtml[data-theme=\"dark-v2\"]{--message-box-bg:rgba(255,255,255,0.16);--search-input-icon-hover:#383838;--quick-answer-card-item-hover:0px 7px 8px 0px rgba(0,0,0,0.24)}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_0___ from \"-!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./styles.shadow.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_1___ from \"-!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./components/loading.shadow.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_2___ from \"-!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./components/MessageItem/Markdown/markdown.shadow.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_3___ from \"-!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./components/QuickAnswerList/quickAnswerList.shadow.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_4___ from \"-!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./components/MessageItem/Markdown/CodeBlock/CodeBlock.shadow.css\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_2___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_3___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_4___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, ``, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"./assets/user.png\", import.meta.url);\nvar ___CSS_LOADER_URL_IMPORT_1___ = new URL(\"./assets/robot.png\", import.meta.url);\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\nvar ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);\nvar ___CSS_LOADER_URL_REPLACEMENT_1___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_1___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host{display:block;height:100%}:host([hidden]){display:none}@media only screen and (min-width: 1920px){.chat-view-container .chat-view-content .chat-view .message-list{width:1556px}.chat-view-container .chat-view-content .search-input-box{width:1556px}}@media only screen and (min-width: 1440px) and (max-width: 1920px){.chat-view-container .chat-view-content .chat-view .message-list{width:1156px}.chat-view-container .chat-view-content .search-input-box{width:1156px}}@media only screen and (min-width: 804px) and (max-width: 1440px){.chat-view-container .chat-view-content .chat-view .message-list{width:804px}.chat-view-container .chat-view-content .search-input-box{width:804px}}@media only screen and (max-width: 804px){.chat-view-container .chat-view-content .chat-view .message-list{width:100%}.chat-view-container .chat-view-content .search-input-box{width:100%}}.chat-view-container{display:flex;flex-direction:row;width:100%;height:100%}.chat-view-selector{width:200px;padding:14px;border-right:1px solid var(--color-border-divider-line)}.chat-view-content{flex:1;display:flex;flex-direction:column;width:100%;gap:8px}.chat-view-content .chat-view-toolbar{background:#e0e4e5;padding:18px;display:flex;justify-content:space-between;align-items:center}.chat-view-content .chat-view-toolbar .username{color:#333333;font-weight:500;line-height:22px;font-size:16px}.chat-view-content .chat-view{max-width:100%;position:relative;display:flex;flex:1;flex-direction:column;box-sizing:border-box;overflow-y:auto}.session-list-wrapper{display:flex;flex-direction:column;height:100%}.session-list-wrapper .session-title{font-size:16px;color:var(--color-header-text);margin-bottom:16px}.session-list-wrapper .session-list{overflow-y:auto}.session-list-wrapper .session-list .session-item{display:flex;justify-content:space-between;cursor:pointer;border-radius:var(--small-border-radius);background-color:var(--third-menu-default-bg);padding:6px 16px;color:var(--color-header-text);margin-top:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-list-wrapper .session-list .session-item .content{width:0;flex:1}.session-list-wrapper .session-list .session-item .content .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-list-wrapper .session-list .session-item:hover .session-close-btn eo-icon{display:block}.session-list-wrapper .session-list .session-item:first-child{margin-top:0px}.session-list-wrapper .session-list .session-item.active{background-color:var(--third-menu-item-selected-bg);color:var(--color-brand)}.session-list-wrapper .session-list .session-item:hover,\n .session-list-wrapper .session-list .session-item.active:hover{color:var(--color-header-text);background-color:var(--third-menu-item-hover-bg)}.session-list-wrapper .session-list .session-item .session-close-btn{display:flex;align-items:center;cursor:pointer;font-size:12px}.session-list-wrapper .session-list .session-item .session-close-btn:hover{color:var(--color-error)}.session-list-wrapper .session-list .session-item .session-close-btn eo-icon{display:none}.message-list{display:flex;flex-direction:column;padding-bottom:30px;padding:12px;flex:1;margin:0 auto;max-width:100%;box-sizing:border-box}.message-list .message-list-box{display:flex;flex-direction:column;position:relative;gap:36px}.message-list .message-list-box .message-item{display:flex;gap:8px;padding-right:40px}.message-list .message-list-box .message-item.user{flex-direction:row-reverse;padding:0;padding-left:40px}.message-list .message-list-box .message-item.user .message-box{margin-bottom:0;overflow:hidden}.message-list .message-list-box .message-item.user .message-box .message-top{flex-direction:row-reverse}.message-list .message-list-box .message-item.user .message-box .message-content{justify-content:end}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper{display:flex;flex-direction:row-reverse}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper .content{background-color:#606f7c;color:#fff}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper:hover .content-tip{display:block}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper .content-tip{display:none}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper .content-tip eo-icon{padding:4px;color:#606f7c;cursor:pointer}.message-list .message-list-box .message-item .avatar{width:36px;height:36px;margin-top:32px;border-radius:50%;font-size:20px;display:flex;align-items:center;justify-content:center}.message-list .message-list-box .message-item .avatar.user{background-image:url(${___CSS_LOADER_URL_REPLACEMENT_0___})}.message-list .message-list-box .message-item .avatar.robot{background-image:url(${___CSS_LOADER_URL_REPLACEMENT_1___})}.message-list .message-list-box .message-item .message-box{position:relative;flex:1;overflow:hidden}.message-list .message-list-box .message-item .message-box .message-content{display:flex;justify-content:start;position:relative}.message-list .message-list-box .message-item .message-box .message-content .wrapper{position:relative;overflow:hidden}.message-list .message-list-box .message-item .message-box .message-content .wrapper .content{position:relative;padding:14px;border-radius:6px;overflow:hidden;background:var(--message-box-bg)}.message-list .message-list-box .message-item .message-box .message-content .wrapper .content .text-item{white-space:pre-wrap}.message-list .message-list-box .message-item .message-box .message-content .wrapper .message-toolbar{display:flex;gap:12px;justify-content:end;margin-top:4px}.message-list .message-list-box .message-item .message-box .message-content .wrapper .message-toolbar eo-icon{cursor:pointer;color:#606f7c}.message-list .message-list-box .message-item .message-box .message-content .wrapper .message-toolbar eo-icon.active{color:var(--color-brand)}.message-list .message-list-box .message-item .message-box .message-content .wrapper .message-toolbar .split{width:1px;height:16px;background-color:#d9d9d9;margin-bottom:1px}.message-list .message-list-box .message-item .message-box .message-top{display:flex;margin-bottom:4px;color:#bec8ce;gap:8px}.message-list .message-list-box .message-item .message-box .message-top .time{min-height:22px}.message-list .message-list-box .stop-responding-wrapper{position:absolute;left:44px;bottom:-28px}.search-input-box{display:flex;flex-direction:column;height:75px;padding:12px;position:relative;margin:0 auto;max-width:100%;box-sizing:border-box}.search-input-box .mentions-list-wrapper{position:absolute;bottom:100%;left:12px;right:12px}.search-input-box .mentions-list-wrapper .content{background-color:var(--antd-input-bg);border-radius:6px;border:1px solid var(--palette-gray-4);padding:8px}.search-input-box .mentions-list-wrapper .content .mentions-title{font-size:14px;font-weight:bold;color:var(--color-strong-text);padding-bottom:8px}.search-input-box .mentions-list-wrapper .content .mentions-list{display:flex;flex-direction:column;gap:8px;max-height:300px;overflow-y:auto}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item{display:flex;flex-direction:row;align-items:center;gap:12px;padding:8px;border-radius:6px;cursor:pointer}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item .icon{font-size:18px;padding:8px;border-radius:50%}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item .name{color:var(--color-normal-text)}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item .description{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--color-disabled-text)}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item:hover,\n .search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item.active{background:var(--palette-gray-3)}.search-input-box.fill-content{border-top:1px solid rgba(197,197,197,0.5)}.search-input-box .input-box{position:absolute;bottom:20px;left:12px;right:12px;display:inline-flex;padding:var(--input-affix-wrapper-padding);border-radius:var(--small-border-radius);height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;color:var(--text-color-default);background-color:var(--antd-input-bg);border:1px solid var(--color-border-divider-line);transition:border-color 0.3s;overflow:visible}.search-input-box .input-box.active{border-color:var(--antd-input-focus-border-color)}.search-input-box .input-box.disabled{pointer-events:none;background:var(--input-outline-disabled);cursor:not-allowed}.search-input-box .input-box.expand textarea{padding-right:50px;margin-bottom:50px}.search-input-box .input-box textarea{width:100%;height:22px;font-size:18px;resize:none;padding:10px 50px 10px 10px;outline:none;border:none;line-height:20px;color:var(--color-normal-text);background-color:transparent;cursor:inherit;transition:all 300ms ease-out;box-sizing:content-box}.search-input-box .input-box textarea::placeholder{color:#b0b1b8}.search-input-box .input-box .suffix-icon{display:flex;align-items:center;gap:8px;position:absolute;right:12px;bottom:6px}.search-input-box .input-box .suffix-icon eo-tooltip{display:flex}.search-input-box .input-box .suffix-icon eo-icon{font-size:20px;cursor:pointer;padding:6px;border-radius:3px}.search-input-box .input-box .suffix-icon eo-icon:not(.disabled):hover{background:var(--search-input-icon-hover)}.search-input-box .input-box .suffix-icon .submit-split{width:1px;height:20px;background:#d1d1d1}.search-input-box .input-box .suffix-icon .submit-btn.active{color:var(--color-brand)}.search-input-box .input-box .suffix-icon .submit-btn.disabled{color:var(--color-disabled-text);cursor:not-allowed}.search-input-box .input-box .toolbar-icon{position:absolute;top:12px;right:14px}.search-input-box .input-box .toolbar-icon eo-icon{font-size:20px;cursor:pointer;padding:6px;border-radius:3px}.search-input-box .input-box .toolbar-icon eo-icon:hover{background:var(--search-input-icon-hover)}.search-input-box .search-input-toolbar{display:flex;justify-content:end;position:absolute;right:12px;bottom:0px}.search-input-box .search-input-toolbar .input-tip{font-size:12px;color:var(--color-secondary-text)}.message-start-tip,\n.session-end-tip{color:var(--color-disabled-text);font-size:12px;text-align:center;margin-top:12px;position:relative}.message-start-tip::after,\n .session-end-tip::after,\n .message-start-tip::before,\n .session-end-tip::before{content:\"- - -\";color:var(--color-disabled-text);position:absolute}.message-start-tip::before, .session-end-tip::before{margin-left:-35px}.message-start-tip::after, .session-end-tip::after{margin-left:10px}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./host-context.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./host-context.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./index.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./index.css\";\n export default content && content.locals ? content.locals : undefined;\n"],"names":["ChatViewContext","createContext","useChatViewContext","useContext","WrappedIcon","wrapBrick","MessageListLoading","React","className","ChatItemLoading","CommonLoading","icon","lib","spinning","Avatar","_ref","role","agentId","isUser","useMemo","quickAnswerConfig","agentList","_quickAnswerConfig$li","list","matchAgent","find","item","id","_extends","style","color","concat","background","WrappedLink","GuideItem","text","prompts","map","index","key","ProgressText","renderText","replace","MsgItemContext","CustomComponent","_ref2","language","commandBricks","chatting","conversationId","taskId","parseData","isError","cahceTextRef","useRef","isEnd","setIsEnd","useState","setIsError","setParseData","useEffect","current","data","JSON","parse","_unused","match","useData","commandBrickConf","config","_objectSpread","component","ReactUseMultipleBricks","useBrick","showOriginData","copyIcon","theme","CodeBlock","setLanguage","contentRef","node","view","useNodeViewContext","messageApi","contextHolder","message","useMessage","handleCopy","_asyncToGenerator","_node$content$firstCh","content","firstChild","navigator","clipboard","writeText","success","err","console","error","apply","arguments","defaultContent","spellCheck","ref","position","Tooltip","title","arrow","onClick","cursor","renderContent","_node$firstChild","_node$firstChild2","textContent","dom","classList","contains","attrs","MarkdownItem","MilkdownProvider","ProsemirrorAdapterProvider","MarkdownDisplay","value","nodeViewFactory","useNodeViewFactory","get","useEditor","root","Editor","make","ctx","set","rootCtx","update","editorViewOptionsCtx","prev","editable","handleClickOn","pos","handleClick","url","found","state","tr","doc","nodeAt","marks","length","path","mark","m","type","name","href","startsWith","encodeURIComponent","window","open","defaultValueCtx","MutationObserver","Array","from","querySelectorAll","forEach","link","onclick","observe","childList","subtree","nord","use","prism","gfm","commonmark","$view","codeBlockSchema","_get","undefined","action","replaceAll","Milkdown","TableItem","TextItem","WrapperIcon","WrappedToolTip","copyToClipboard","unwrapProvider","showNotification","Toolbar","tag","isAssistant","isChattingItem","showLike","readonly","handleIsLike","handleLikeOrIsLike","useCallback","islike","result","_x","hoist","classNames","active","isLike","then","catch","Time","time","moment","format","ContentTip","setSearchStr","NOT_AGENT_MATCH","MessageNode","props","created","getContentNode","examplePrompts","messageNode","Provider","CARD_ITEM_HEIGHT","HEIGHT_GAP","QuickAnswerCardItem","description","starterPrompts","iconColor","_icon$color","height","handleCardClick","category","QuickAnswerList","_quickAnswerConfig$ti","msgList","loading","showMoreBtn","setShowMoreBtn","listRef","hadClickShowMoreBtn","element","observer","ResizeObserver","entries","entry","contentRect","disconnect","tip","maxHeight","overflow","instanceId","handleShowMoreClick","StopBtn","stopChat","handleStopChat","DEFAULT_OFFSET_HEIGHT","CACHE_HEIGHT","MessageList","showAvatar","chatViewRef","messgetListBoxRef","preHeight","setPreHeight","isCustomScroll","msgLoading","msgEnd","activeSessionId","checkSession","getMsgItemNode","user","msgListNode","handleScroll","messageList","scrollHeight","clientHeight","scrollTop","isBottom","debounceHandleScroll","debounce","newHeight","scroll","top","Number","MAX_SAFE_INTEGER","Math","max","onScroll","hiddenTextarea","HIDDEN_TEXTAREA_STYLE","SIZING_STYLE","PREFIX_WORD","SearchInput","setValue","setActive","expand","setExpand","autoSizeStyle","setAutoSizeStyle","isFillContent","setIsFillContent","mentionOpen","setMentionOpen","matchPrefixIndex","setMatchPrefixIndex","matchAgentList","setMatchMentionList","matchMentionsIndex","setMatchMentionsIndex","mentionsRef","searchInputBoxRef","textareaRef","hadExpanded","inputEndRef","searchStr","createSession","handleChat","setAgent","hadValue","defaultSize","disabled","matchPrefixInfo","textareaElement","currentFocusIndex","selectionStart","matchWord","i","test","start","end","word","handleAgentItemSelect","valueList","split","trimName","focusIndex","splice","join","setTimeout","selectionEnd","focus","isShowMentions","mentions","slice","computedAutoSize","size","textareaStyles","uiTextNode","minRows","maxRows","document","createElement","setAttribute","body","appendChild","uiTextNodeStyle","getComputedStyle","sizingStyle","getPropertyValue","placeholder","minHeight","singleRowHeight","min","overflowY","resize","calculateAutoSizeStyle","handleChange","e","target","handleExpand","matchFirstAgent","regex","exec","agent","handleSubmit","blur","handleKeyDown","shiftKey","preventDefault","handleKeyUp","selectionIndex","prefixWord","lastIndexOf","indexOf","_textareaRef$current","trim","searchInputBox","width","currentWidth","getBoundingClientRect","_textareaRef$current2","filterList","filter","includes","querySelector","scrollIntoView","block","handleDocumentClick","mentionsElemnt","composedPath","addEventListener","removeEventListener","paddingRight","onFocus","onBlur","onChange","onKeyDown","onKeyUpCapture","onCompositionStart","handleCompositionStart","onCompositionEnd","handleCompositionEnd","hanldeCreateSession","showDialog","SESSION_ITEM_HEIGHT","BUFFER_NUMBER","SessionList","sessionEnd","sessionLoading","sessionList","querySessionHistory","sessionWrapperRef","sessionListRef","limit","sessionWrapper","floor","checkSessionList","SessionItem","deleteSession","handleCheckSession","handleDeleteSession","stopPropagation","expect","_debug","WeakMap","_ctrl","_agentId","_enterInterval","_charting","_isStartEmitEvent","_emitTimer","_messageQueue","_subscribers","_conversationId","_sessionNextToken","_cacheLimit","_messageNextToken","_ChatService_brand","WeakSet","ChatService","constructor","enterInterval","debug","_classPrivateMethodInitSpec","_classPrivateFieldInitSpec","_classPrivateFieldSet","this","enqueue","_classPrivateFieldGet","push","_assertClassBrand","_startEmitEvent","call","dequeue","shift","getMessageQueue","subscribe","topic","callback","unsubscribe","cb","notifySubscribers","setChatItemIsLike","flag","code","http","request","getBasePath","method","stringify","setAgentId","setConversationId","getSessionHistory","_this","_classPrivateFieldGet2","conversations","next_token","_unused2","getChatHistory","_this2","_unused3","conversationIds","_unused4","splitWord","str","Intl","iterator","Segmenter","granularity","segment","Symbol","nextWord","next","done","customSplit","cache","matchStr","substring","chat","_this3","AbortController","hadMatchMessage","fetchEventSource","signal","input","stream","headers","onopen","response","ok","log","onmessage","msg","_unused5","delta","abort","onclose","onerror","stop","_classPrivateFieldGet3","clearInterval","_clear","setInterval","messageItem","NEW_SESSION_ID","useChatViewInfo","sessionId","setSessionEnd","setSessionLoading","setActiveSessionId","setLoading","setChatting","setSessionList","setMsgLoading","setMsgEnd","setMsgList","chatingText","chatingMessageItem","chatService","defaultNewSessionItem","preList","newList","unshift","output","inputTime","computedList","_ref3","ids","filterIds","deleteActiveSession","hasNewOne","_x2","_ref4","_x3","_ref5","_x4","_ref6","_x5","_x6","handleSessionEnd","listener","msgItem","pop","reset","finishListener","fetchEndListener","stopListener","stopMessageItem","___CSS_LOADER_EXPORT___","module","___CSS_LOADER_URL_IMPORT_0___","URL","___CSS_LOADER_URL_REPLACEMENT_0___","___CSS_LOADER_URL_IMPORT_1___","___CSS_LOADER_URL_REPLACEMENT_1___","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"chunks/22.58f5dd77.js","mappings":"qJA8DaA,GAAkBC,EAAAA,EAAAA,eAC7B,CAAC,GAGUC,EAAqBA,KAChCC,EAAAA,EAAAA,YAAWH,E,4EC5DPI,GAAcC,E,QAAAA,WAAyC,WAEtD,SAASC,IACd,OAAOC,IAAAA,cAAA,OAAKC,UAAU,gCACxB,CAEO,SAASC,IACd,OACEF,IAAAA,cAAA,OAAKC,UAAU,8BACbD,IAAAA,cAAA,OAAKC,UAAU,QACbD,IAAAA,cAAA,YACAA,IAAAA,cAAA,YACAA,IAAAA,cAAA,YACAA,IAAAA,cAAA,aAIR,CAEO,SAASG,IACd,OACEH,IAAAA,cAAA,OAAKC,UAAU,0BACbD,IAAAA,cAACH,EAAW,CAACO,KAAK,UAAUC,IAAI,OAAOC,UAAQ,IAGrD,C,sFCxBMT,GAAcC,EAAAA,EAAAA,WAAyC,WAEtD,SAASS,EAAMC,GAMF,IANG,KACrBC,EAAI,QACJC,GAIDF,EACOG,GAASC,EAAAA,EAAAA,UAAQ,IAAe,SAATH,GAAiB,CAACA,KACzC,kBAAEI,IAAsBlB,EAAAA,EAAAA,KAExBmB,GAAYF,EAAAA,EAAAA,UAChB,SAAAG,EAAA,OAA6B,QAA7BA,EAAMF,aAAiB,EAAjBA,EAAmBG,YAAI,IAAAD,EAAAA,EAAI,EAAE,GACnC,CAACF,IAGGI,GAAaL,EAAAA,EAAAA,UAAQ,IAClBE,EAAUI,MAAMC,GAASA,EAAKC,KAAOV,KAC3C,CAACI,EAAWJ,IAEf,OAAQC,GAAUM,EAChBjB,IAAAA,cAACH,GAAWwB,EAAAA,EAAAA,GAAA,CACVpB,UAAU,UACNgB,EAA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EAA0B,IAA4B,KAC1DA,EAAwB5P,EAAE,KAC1B4P,EAAwB5P,EAAE,KAC1B4P,EAAwB5P,EAAE,KAC1B4P,EAAwB5P,EAAE,KAC1B4P,EAAwB5P,EAAE,KAE1B4P,EAAwBvH,KAAK,CAACwH,EAAOriB,GAAI,GAAI,KAE7C,S,4FCbIsiB,EAAgC,IAAIC,IAAI,aACxCE,EAAgC,IAAIF,IAAI,YACxCH,EAA0B,IAA4B,KACtDI,EAAqC,IAAgCF,GACrEI,EAAqC,IAAgCD,GAEzEL,EAAwBvH,KAAK,CAACwH,EAAOriB,GAAI,gwJAC4pEwiB,uFAAwHE,4zLAKjlE,KAE5O,S,gJCPIC,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKJ,KAAW,IAAQM,QAAS,IAAQA,M,gJCftDN,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKJ,KAAW,IAAQM,QAAS,IAAQA,M","sources":["webpack:///./src/chat-view/ChatViewContext.ts","webpack:///./src/chat-view/components/Loading.tsx","webpack:///./src/chat-view/components/MessageItem/Avatar.tsx","webpack:///./src/chat-view/components/MessageItem/GuideItem.tsx","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/ProgressText.tsx","webpack:///./src/chat-view/components/MessageItem/MsgItemContext.ts","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/CustomComponent.tsx","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/index.tsx","webpack:///./src/chat-view/components/MessageItem/Markdown/index.tsx","webpack:///./src/chat-view/components/MessageItem/TableItem.tsx","webpack:///./src/chat-view/components/MessageItem/TextItem.tsx","webpack:///./src/chat-view/components/MessageItem/Toolbar.tsx","webpack:///./src/chat-view/components/MessageItem/Time.tsx","webpack:///./src/chat-view/components/MessageItem/ContentTip.tsx","webpack:///./src/chat-view/components/MessageItem/index.tsx","webpack:///./src/chat-view/components/QuickAnswerList/index.tsx","webpack:///./src/chat-view/components/StopBtn.tsx","webpack:///./src/chat-view/components/MessageList.tsx","webpack:///./src/chat-view/components/utils/calculateAutoSizeStyle.ts","webpack:///./src/chat-view/components/SearchInput.tsx","webpack:///./src/chat-view/components/SessionList.tsx","webpack:///./src/chat-view/ChatService.ts","webpack:///./src/chat-view/hooks/useChatViewInfo.ts","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/CodeBlock.shadow.css","webpack:///./src/chat-view/components/MessageItem/Markdown/markdown.shadow.css","webpack:///./src/chat-view/components/QuickAnswerList/quickAnswerList.shadow.css","webpack:///./src/chat-view/components/loading.shadow.css","webpack:///./src/chat-view/host-context.css","webpack:///./src/chat-view/index.css","webpack:///./src/chat-view/styles.shadow.css","webpack:///./src/chat-view/host-context.css?1beb","webpack:///./src/chat-view/index.css?7225"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport { AgentDetailItem } from \"./components/QuickAnswerList/index.js\";\nimport { SessionItem } from \"./ChatService.js\";\nimport { UseBrickConf } from \"@next-core/types\";\n\nexport type Role = \"guide\" | \"user\" | \"assistant\";\n\nexport type commandBrickConf = Record<\n string,\n { useBrick: UseBrickConf; showOriginData?: boolean }\n>;\n\nexport interface MessageItemContent {\n type: \"guide\" | \"text\" | \"markdown\" | \"table\" | \"load\";\n text: string;\n examplePrompts?: string[];\n}\n\nexport interface MessageItem {\n role: Role;\n content: MessageItemContent;\n created?: number | string;\n key?: number | string;\n conversationId?: string;\n taskId?: string;\n agentId?: string;\n chatting?: boolean;\n tag?: {\n isLike?: boolean;\n };\n}\n\nexport interface QuickAnswerConfig {\n tip: string;\n list: AgentDetailItem[];\n}\ninterface ChatViewContextProps {\n sessionEnd: boolean;\n sessionLoading: boolean;\n activeSessionId?: string;\n sessionList: SessionItem[];\n msgEnd: boolean;\n msgLoading: boolean;\n msgList: MessageItem[];\n loading: boolean;\n chatting: boolean;\n searchStr: string;\n showLike: boolean;\n readonly: boolean;\n quickAnswerConfig?: QuickAnswerConfig;\n commandBricks?: commandBrickConf;\n setAgent: (id: string) => void;\n handleIsLike: (id: string, isLike: boolean) => Promise<boolean>;\n handleChat: (str: string) => void;\n stopChat: () => void;\n checkSession: (id?: string, isInit?: boolean) => void;\n createSession: () => void;\n deleteSession: (ids: string[]) => Promise<boolean>;\n setSearchStr: (str: string) => void;\n querySessionHistory: (limit?: number) => void;\n}\n\nexport const ChatViewContext = createContext<ChatViewContextProps>(\n {} as ChatViewContextProps\n);\n\nexport const useChatViewContext = (): ChatViewContextProps =>\n useContext(ChatViewContext);\n","import React from \"react\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { wrapBrick } from \"@next-core/react-element\";\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nexport function MessageListLoading() {\n return <div className=\"message-list-loading-wrapper\"></div>;\n}\n\nexport function ChatItemLoading() {\n return (\n <div className=\"chart-item-loading-wrapper\">\n <div className=\"load\">\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n </div>\n </div>\n );\n}\n\nexport function CommonLoading() {\n return (\n <div className=\"common-loading-wrapper\">\n <WrappedIcon icon=\"loading\" lib=\"antd\" spinning />\n </div>\n );\n}\n","import React, { useMemo } from \"react\";\nimport { useChatViewContext, type Role } from \"../../ChatViewContext.js\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { wrapBrick } from \"@next-core/react-element\";\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nexport function Avatar({\n role,\n agentId,\n}: {\n role: Role;\n agentId?: string;\n}): React.ReactNode {\n const isUser = useMemo(() => role === \"user\", [role]);\n const { quickAnswerConfig } = useChatViewContext();\n\n const agentList = useMemo(\n () => quickAnswerConfig?.list ?? [],\n [quickAnswerConfig]\n );\n\n const matchAgent = useMemo(() => {\n return agentList.find((item) => item.id === agentId);\n }, [agentList, agentId]);\n\n return !isUser && matchAgent ? (\n <WrappedIcon\n className=\"avatar\"\n {...matchAgent.icon}\n style={{\n color: `var(--theme-${matchAgent.icon.color}-color)`,\n background: `var(--theme-${matchAgent.icon.color}-background)`,\n }}\n />\n ) : (\n <div className={`avatar ${isUser ? \"user\" : \"robot\"}`} />\n );\n}\n","import React from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\n\ninterface GuideItemProps {\n text: string;\n prompts?: string[];\n}\n\nconst WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\n\nexport function GuideItem({ text, prompts }: GuideItemProps) {\n return (\n <div className=\"guide-item\">\n {text}\n <div className=\"prompts-list\">\n {prompts\n ? prompts.map((item, index) => (\n <WrappedLink key={index}>{item}</WrappedLink>\n ))\n : null}\n </div>\n </div>\n );\n}\n","import React, { useMemo } from \"react\";\n\nexport function ProgressText({ text }: { text: string }): React.ReactNode {\n const renderText = useMemo(() => {\n // 文本末尾存在 \\n ```, 会导致在渲染快结束的时候突然有一个换行,在结束的时候,换行被干掉,导致页面闪动的情况\n // 所以在这里计算,如果文本将要关闭,则默认不然 \\n ``` 显示\n const newText = text.replace(/\\n[`]{0,3}$/, \"\");\n return newText;\n }, [text]);\n\n return <div className=\"progress-text\">{renderText}</div>;\n}\n","import { createContext, useContext } from \"react\";\nimport { MessageItem } from \"../../ChatViewContext\";\n\nexport const MsgItemContext = createContext<MessageItem>({} as MessageItem);\n\nexport const useMsgItemContext = (): MessageItem => useContext(MsgItemContext);\n","import React, { useEffect, useMemo, useRef, useState } from \"react\";\nimport { useMsgItemContext } from \"../../MsgItemContext.js\";\nimport { ReactUseMultipleBricks } from \"@next-core/react-runtime\";\nimport { useChatViewContext } from \"../../../../ChatViewContext.js\";\n\ninterface UseDataProps {\n text: string;\n chatting: boolean;\n}\n\nfunction useData({ text, chatting }: UseDataProps) {\n const cahceTextRef = useRef<string>(\"\");\n const [isEnd, setIsEnd] = useState<boolean>(false);\n const [isError, setIsError] = useState<boolean>(false);\n const [parseData, setParseData] = useState<any>();\n\n useEffect(() => {\n if (cahceTextRef.current !== text) {\n cahceTextRef.current = text;\n let data: any;\n try {\n data = JSON.parse(text);\n } catch {\n setIsError(true);\n return;\n }\n setParseData(data);\n }\n }, [text]);\n\n useEffect(() => {\n if (chatting) {\n if (text.match(/\\n[`]{0,3}$/)) {\n setIsEnd(true);\n }\n } else {\n setIsEnd(true);\n }\n }, [text, chatting]);\n\n return {\n parseData,\n isError: isEnd && isError,\n };\n}\n\nexport default function CustomComponent({\n text,\n language,\n}: {\n text: string;\n language: string;\n}) {\n const { commandBricks } = useChatViewContext();\n const { chatting, agentId, conversationId, taskId } = useMsgItemContext();\n\n const { parseData, isError } = useData({\n text,\n chatting: !!chatting,\n });\n\n const commandBrickConf = useMemo(() => {\n const config = commandBricks?.[language];\n if (config) {\n const data = {\n data: parseData,\n agentId,\n conversationId,\n taskId,\n };\n return {\n component: (\n <ReactUseMultipleBricks useBrick={config.useBrick} data={data} />\n ),\n ...config,\n };\n }\n return {\n component: null,\n showOriginData: true,\n };\n }, [commandBricks, language, parseData, agentId, conversationId, taskId]);\n\n return (\n <div className=\"custom-component-wrapper\">\n {commandBrickConf?.showOriginData ? (\n <>\n <div className=\"params\">\n <div className=\"params-tip\">【查询语句】: </div>\n <pre>\n <code>{text}</code>\n </pre>\n </div>\n {isError ? (\n <div className=\"error-tip\">【查询失败】</div>\n ) : (\n <>\n <div className=\"result-tip\">【查询结果】:</div>\n <div className=\"custom-component\">\n {commandBrickConf.component}\n </div>\n </>\n )}\n </>\n ) : (\n commandBrickConf.component\n )}\n </div>\n );\n}\n","import React, { useEffect, useMemo, useState } from \"react\";\nimport { useNodeViewContext } from \"@prosemirror-adapter/react\";\nimport { ProgressText } from \"./ProgressText.js\";\nimport CustomComponent from \"./CustomComponent.js\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport { GeneralIcon, GeneralIconProps } from \"@next-bricks/icons/general-icon\";\nimport { Tooltip, message } from \"antd\";\nimport { useChatViewContext } from \"../../../../ChatViewContext\";\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nconst copyIcon: GeneralIconProps = {\n lib: \"antd\",\n icon: \"copy\",\n theme: \"outlined\",\n};\n\nexport const CodeBlock = () => {\n const [language, setLanguage] = useState(\"\");\n const { contentRef, node, view } = useNodeViewContext();\n const { commandBricks } = useChatViewContext();\n const [messageApi, contextHolder] = message.useMessage();\n\n const handleCopy = async () => {\n const text = node.content.firstChild?.text;\n try {\n if (text) {\n await navigator.clipboard.writeText(text);\n messageApi.success(\"复制成功\");\n }\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(\"Failed to copy: \", err);\n messageApi.error(\"复制失败\");\n }\n };\n\n const defaultContent = useMemo(\n () => (\n <div className=\"default-container\">\n {contextHolder}\n <pre spellCheck={false}>\n <code ref={contentRef} style={{ position: \"relative\" }}>\n <div className=\"default-toolbar-container\">\n <Tooltip title=\"复制\" color=\"#474747\" arrow={false}>\n <WrappedIcon\n {...(copyIcon as GeneralIconProps)}\n onClick={handleCopy}\n style={{ cursor: \"pointer\" }}\n />\n </Tooltip>\n </div>\n </code>\n </pre>\n </div>\n ),\n [contentRef]\n );\n\n const renderContent = useMemo(() => {\n if (!node.firstChild?.text) return null;\n const text = node.firstChild?.textContent;\n if (commandBricks && commandBricks[language]) {\n // 使 markdown 默认样式不生效, 防止样式穿透\n view.dom.classList.contains(\"prose\") &&\n view.dom.classList.replace(\"prose\", \"not-prose\");\n return <CustomComponent text={text} language={language} />;\n }\n switch (language) {\n case \"easy_cmd_progress\":\n return <ProgressText text={text} />;\n default:\n return defaultContent;\n }\n }, [node, language, view, defaultContent, commandBricks]);\n\n useEffect(() => {\n if (!language) {\n const {\n attrs: { language },\n } = node;\n if (language) {\n setLanguage(language);\n }\n }\n }, [node, language]);\n\n return renderContent;\n};\n","import React, { useEffect } from \"react\";\nimport {\n defaultValueCtx,\n Editor,\n rootCtx,\n editorViewOptionsCtx,\n} from \"@milkdown/core\";\nimport { EditorView } from \"prosemirror-view\";\nimport { Milkdown, useEditor, MilkdownProvider } from \"@milkdown/react\";\nimport { commonmark, codeBlockSchema } from \"@milkdown/preset-commonmark\";\nimport { nord } from \"@milkdown/theme-nord\";\nimport { gfm } from \"@milkdown/preset-gfm\";\nimport { prism } from \"@milkdown/plugin-prism\";\nimport { $view, replaceAll } from \"@milkdown/utils\";\nimport {\n ProsemirrorAdapterProvider,\n useNodeViewFactory,\n} from \"@prosemirror-adapter/react\";\nimport { CodeBlock } from \"./CodeBlock/index.js\";\n\nexport function MarkdownItem({ text }: { text: string }) {\n return (\n <div className=\"markdown-item\">\n <MilkdownProvider>\n <ProsemirrorAdapterProvider>\n <MarkdownDisplay value={text} />\n </ProsemirrorAdapterProvider>\n </MilkdownProvider>\n </div>\n );\n}\n\nfunction hasURLProtocol(url: any) {\n return (\n url.startsWith(\"http://\") ||\n url.startsWith(\"https://\") ||\n url.startsWith(\"file://\") ||\n url.startsWith(\"data:\") ||\n url.startsWith(\"ts://?ts\") ||\n url.startsWith(\"ts:?ts\")\n );\n}\n\nexport function MarkdownDisplay({ value }: { value: string }): React.ReactNode {\n const nodeViewFactory = useNodeViewFactory();\n\n const handleClick = (view: EditorView, pos: number) => {\n const found = view.state.tr.doc.nodeAt(pos);\n\n if (found && found.marks.length > 0) {\n const mark = found.marks.find((m) => m.type.name === \"link\");\n const href = mark?.attrs.href;\n let path: string;\n\n if (hasURLProtocol(href)) {\n path = href;\n } else {\n path = encodeURIComponent(href);\n }\n\n window.open(path, \"_blank\");\n }\n return true;\n };\n\n const { get } = useEditor((root) => {\n return Editor.make()\n .config((ctx) => {\n ctx.set(rootCtx, root);\n ctx.update(editorViewOptionsCtx, (prev: any) => ({\n ...prev,\n editable: () => false,\n handleClickOn: (view: EditorView, pos: number) =>\n handleClick(view, pos),\n }));\n value && ctx.set(defaultValueCtx, value);\n //拦截link的默认点击事件以支持通过新窗口弹出页面,如果后续有其他的定制化需求可以改用custom widget的方式写link widget\n const observer = new MutationObserver(() => {\n const links = Array.from(root.querySelectorAll(\"a\"));\n links.forEach((link) => {\n link.onclick = () => false;\n });\n });\n observer.observe(root, {\n childList: true,\n subtree: true,\n });\n })\n .config(nord)\n .use(prism)\n .use(gfm)\n .use(commonmark)\n .use(\n $view(codeBlockSchema.node, () =>\n nodeViewFactory({ component: CodeBlock })\n )\n );\n }, []);\n\n useEffect(() => {\n if (value !== undefined) {\n get()?.action(replaceAll(value));\n }\n }, [get, value]);\n\n return <Milkdown />;\n}\n","import React from \"react\";\n// import { wrapBrick } from \"@next-core/react-element\";\n// import type {\n// EoNextTable,\n// NextTableComponentProps,\n// } from \"@next-bricks/advanced/next-table\";\n\ninterface MarkdownItemProps {\n text: string;\n}\n\n// const WrappedNextTable = wrapBrick<EoNextTable, NextTableComponentProps>(\n// \"eo-next-table\"\n// );\n\nexport function TableItem({ text }: MarkdownItemProps) {\n // const parseContent = useMemo((): NextTableComponentProps => {\n // let content: NextTableComponentProps;\n // try {\n // content = JSON.parse(text);\n // } catch {\n // content = {} as NextTableComponentProps;\n // }\n // return content;\n // }, [text]);\n\n // return (\n // <div className=\"table-item\">\n // <WrappedNextTable pagination={false} {...parseContent} />\n // </div>\n // );\n return <div className=\"table-item\">{text}</div>;\n}\n","import React from \"react\";\n\ninterface TextItem {\n text: string;\n}\n\nexport function TextItem({ text }: TextItem) {\n return <div className=\"text-item\">{text}</div>;\n}\n","import React, { useCallback, useMemo } from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type { copyToClipboard as _copyToClipboard } from \"@next-bricks/basic/data-providers/copy-to-clipboard\";\nimport type { showNotification as _showNotification } from \"@next-bricks/basic/data-providers/show-notification/show-notification\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { EoTooltip, ToolTipProps } from \"@next-bricks/basic/tooltip\";\nimport { MessageItem, useChatViewContext } from \"../../ChatViewContext\";\nimport { unwrapProvider } from \"@next-core/utils/general\";\nimport classNames from \"classnames\";\n\nconst WrapperIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nconst WrappedToolTip = wrapBrick<EoTooltip, ToolTipProps>(\"eo-tooltip\");\nconst copyToClipboard = unwrapProvider<typeof _copyToClipboard>(\n \"basic.copy-to-clipboard\"\n);\nconst showNotification = unwrapProvider<typeof _showNotification>(\n \"basic.show-notification\"\n);\n\nexport function Toolbar({\n role,\n content,\n chatting,\n taskId,\n tag,\n}: MessageItem): React.ReactNode {\n const isAssistant = useMemo(\n () => role === \"assistant\" && content.type !== \"load\",\n [role, content.type]\n );\n const isChattingItem = useMemo(() => chatting, [chatting]);\n const { showLike, readonly, handleIsLike } = useChatViewContext();\n\n const handleCopy = () => {\n copyToClipboard(content.text)\n .then(() => showNotification({ type: \"success\", message: \"复制成功\" }))\n .catch(() => showNotification({ type: \"error\", message: \"复制失败\" }));\n };\n\n const handleLikeOrIsLike = useCallback(\n async (islike: boolean) => {\n const result = await handleIsLike(taskId!, islike);\n showNotification({\n message: `${islike ? \"点赞\" : \"操作\"}${result ? \"成功\" : \"失败\"}`,\n type: result ? \"success\" : \"error\",\n });\n },\n [taskId, handleIsLike]\n );\n\n return isAssistant && !isChattingItem ? (\n <div className=\"message-toolbar\">\n {showLike && !readonly && (\n <>\n <WrappedToolTip content=\"点赞\" hoist>\n <WrapperIcon\n className={classNames(\"like\", {\n active: tag?.isLike === true,\n })}\n lib=\"easyops\"\n icon=\"like\"\n onClick={() => handleLikeOrIsLike(true)}\n />\n </WrappedToolTip>\n <WrappedToolTip content=\"还不够好\" hoist>\n <WrapperIcon\n className={classNames(\"unlike\", {\n active: tag?.isLike === false,\n })}\n lib=\"easyops\"\n icon=\"unlike\"\n onClick={() => handleLikeOrIsLike(false)}\n />\n </WrappedToolTip>\n <div className=\"split\" />\n </>\n )}\n <WrappedToolTip content=\"点击复制\" hoist>\n <WrapperIcon lib=\"antd\" icon=\"copy\" onClick={handleCopy} />\n </WrappedToolTip>\n </div>\n ) : null;\n}\n","import moment from \"moment\";\nimport React from \"react\";\n\nexport function Time({ time }: { time?: string | number }) {\n return (\n <div className=\"time\">\n {time\n ? typeof time === \"string\"\n ? time\n : moment(time).format(\"YYYY-MM-DD HH:mm:ss\")\n : null}\n </div>\n );\n}\n","import React, { useMemo } from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { EoTooltip, ToolTipProps } from \"@next-bricks/basic/tooltip\";\nimport { useChatViewContext, type MessageItem } from \"../../ChatViewContext\";\n\nconst WrappedToolTip = wrapBrick<EoTooltip, ToolTipProps>(\"eo-tooltip\");\nconst WrapperIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nexport function ContentTip({ role, content }: MessageItem): React.ReactNode {\n const isUser = useMemo(() => role === \"user\", [role]);\n\n const { chatting, readonly, setSearchStr } = useChatViewContext();\n\n const handleCopy = () => {\n setSearchStr(content.text);\n };\n\n return !readonly && isUser && !chatting ? (\n <div className=\"content-tip\">\n <WrappedToolTip content=\"点击再次提问\" hoist>\n <WrapperIcon lib=\"antd\" icon=\"edit\" onClick={handleCopy} />\n </WrappedToolTip>\n </div>\n ) : null;\n}\n","import React, { useCallback, useMemo } from \"react\";\nimport {\n MessageItem,\n MessageItemContent,\n useChatViewContext,\n} from \"../../ChatViewContext.js\";\nimport { GuideItem } from \"./GuideItem.js\";\nimport { MarkdownItem } from \"./Markdown/index.js\";\nimport { TableItem } from \"./TableItem.js\";\nimport { ChatItemLoading } from \"../Loading.js\";\nimport { TextItem } from \"./TextItem.js\";\nimport { Toolbar } from \"./Toolbar.js\";\nimport { Time } from \"./Time.js\";\nimport { ContentTip } from \"./ContentTip.js\";\nimport { MsgItemContext } from \"./MsgItemContext.js\";\n\nconst NOT_AGENT_MATCH = \"no_agent\";\n\nexport function MessageNode(props: MessageItem): React.ReactNode {\n const { content, created, role, agentId } = props;\n const isUser = useMemo(() => role === \"user\", [role]);\n const { quickAnswerConfig } = useChatViewContext();\n\n const getContentNode = useCallback((content: MessageItemContent) => {\n const { type, text, examplePrompts } = content;\n switch (type) {\n case \"guide\":\n return <GuideItem text={text} prompts={examplePrompts} />;\n case \"text\":\n return <TextItem text={text} />;\n case \"table\":\n return <TableItem text={text} />;\n case \"load\":\n return <ChatItemLoading />;\n case \"markdown\":\n default:\n return <MarkdownItem text={text} />;\n }\n }, []);\n\n const messageNode = useMemo(\n () => getContentNode(content),\n [content, getContentNode]\n );\n\n const agentList = useMemo(\n () => quickAnswerConfig?.list ?? [],\n [quickAnswerConfig]\n );\n\n const matchAgent = useMemo(() => {\n return agentList.find((item) => item.id === agentId);\n }, [agentList, agentId]);\n\n return (\n <MsgItemContext.Provider value={props}>\n <div className=\"message-box\">\n <div className=\"message-top\">\n {isUser\n ? \"我\"\n : !agentId || agentId === NOT_AGENT_MATCH || !matchAgent\n ? \"AI助手\"\n : matchAgent.name}\n <Time time={created} />\n </div>\n <div className=\"message-content\">\n <div className=\"wrapper\">\n <div className=\"content\">{messageNode}</div>\n\n <ContentTip {...props} />\n <Toolbar {...props} />\n </div>\n </div>\n </div>\n </MsgItemContext.Provider>\n );\n}\n","import React, { useEffect, useMemo, useRef, useState } from \"react\";\nimport { useChatViewContext } from \"../../ChatViewContext\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nconst WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\n\nexport interface AgentDetailItem {\n name: string;\n description: string;\n icon: GeneralIconProps & { color: string };\n starterPrompts?: string[];\n instanceId: string;\n id: string;\n [key: string]: any;\n}\n\nconst CARD_ITEM_HEIGHT = 85;\nconst HEIGHT_GAP = 24;\n\nfunction QuickAnswerCardItem({\n name,\n description,\n icon,\n starterPrompts,\n}: AgentDetailItem) {\n const { setSearchStr } = useChatViewContext();\n\n const handleCardClick = () => {\n starterPrompts?.length && setSearchStr(starterPrompts[0]);\n };\n\n const iconColor = useMemo(() => icon?.color ?? \"geekblue\", [icon]);\n\n return (\n <div\n className=\"quick-answer-card-item\"\n style={{\n height: CARD_ITEM_HEIGHT,\n background: `linear-gradient(rgba(var(--theme-${iconColor}-color-rgb-channel), 0.1), rgba(var(--theme-${iconColor}-color-rgb-channel), 0.08))`,\n }}\n onClick={handleCardClick}\n >\n <div className=\"left\">\n <WrappedIcon\n className=\"icon\"\n {...(icon ?? {\n icon: \"default-app\",\n lib: \"easyops\",\n category: \"app\",\n })}\n style={{\n background: `rgba(var(--theme-${iconColor}-color-rgb-channel), 0.5)`,\n }}\n />\n </div>\n <div className=\"content\">\n <div className=\"title\">{name}</div>\n <div className=\"description\">{description}</div>\n </div>\n </div>\n );\n}\n\nexport function QuickAnswerList() {\n const { quickAnswerConfig, msgList, loading } = useChatViewContext();\n const [showMoreBtn, setShowMoreBtn] = useState<boolean>(false);\n const listRef = useRef<HTMLDivElement>(null);\n const hadClickShowMoreBtn = useRef<boolean>(false);\n\n const handleShowMoreClick = () => {\n hadClickShowMoreBtn.current = true;\n setShowMoreBtn(false);\n };\n\n useEffect(() => {\n const element = listRef.current;\n if (element) {\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (\n entry.contentRect.height >\n CARD_ITEM_HEIGHT * 3 + HEIGHT_GAP * 2\n ) {\n if (!hadClickShowMoreBtn.current) {\n setShowMoreBtn(true);\n }\n } else {\n setShowMoreBtn(false);\n }\n }\n });\n observer.observe(element);\n return () => observer.disconnect();\n }\n }, [showMoreBtn, quickAnswerConfig?.list]);\n\n return quickAnswerConfig?.list.length && msgList.length === 0 && !loading ? (\n <div className=\"quick-answer-wrapper\">\n <div className=\"tip\">\n {quickAnswerConfig.tip ??\n \"你好,我是运维数智人 — Murphy,我能为你提供以下服务:\"}\n </div>\n <div\n className=\"quick-answer-list\"\n style={{\n ...(showMoreBtn\n ? {\n maxHeight: CARD_ITEM_HEIGHT * 3 + HEIGHT_GAP * 2 + 10,\n overflow: \"hidden\",\n }\n : {}),\n }}\n ref={listRef}\n >\n {quickAnswerConfig.list.map((item) => (\n <QuickAnswerCardItem key={item.instanceId} {...item} />\n ))}\n </div>\n {showMoreBtn ? (\n <div className=\"show-more-wrapper\">\n <WrappedLink\n icon={{\n lib: \"antd\",\n icon: \"down\",\n }}\n className=\"show-more-btn\"\n onClick={handleShowMoreClick}\n >\n 显示更多\n </WrappedLink>\n </div>\n ) : null}\n </div>\n ) : null;\n}\n","import React from \"react\";\nimport { useChatViewContext } from \"../ChatViewContext\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\n\nconst WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\n\nexport function StopBtn() {\n const { stopChat } = useChatViewContext();\n\n const handleStopChat = () => {\n stopChat();\n };\n return (\n <div className=\"stop-responding-wrapper\">\n <WrappedLink className=\"stop-btn\" onClick={handleStopChat}>\n 停止生成\n </WrappedLink>\n </div>\n );\n}\n","import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { MessageItem, useChatViewContext } from \"../ChatViewContext\";\nimport { Avatar } from \"./MessageItem/Avatar.js\";\nimport classNames from \"classnames\";\nimport { CommonLoading, MessageListLoading } from \"./Loading.js\";\nimport { MessageNode } from \"./MessageItem/index.js\";\nimport { QuickAnswerList } from \"./QuickAnswerList/index.js\";\nimport { debounce } from \"lodash\";\nimport { StopBtn } from \"./StopBtn.js\";\n\ninterface MessageListProps {\n showAvatar?: boolean;\n}\n\nconst DEFAULT_OFFSET_HEIGHT = 80;\nconst CACHE_HEIGHT = 200;\n\nexport function MessageList({\n showAvatar = true,\n}: MessageListProps): React.ReactNode {\n const chatViewRef = useRef<HTMLDivElement>(null);\n const messgetListBoxRef = useRef<HTMLDivElement>(null);\n const [preHeight, setPreHeight] = useState<number>(0);\n const isCustomScroll = useRef<boolean>(false);\n\n const {\n msgLoading,\n msgEnd,\n msgList,\n loading,\n activeSessionId,\n chatting,\n checkSession,\n } = useChatViewContext();\n\n const getMsgItemNode = useCallback(\n (item: MessageItem, index: number = 0) => {\n return (\n <div\n className={classNames(\"message-item\", { user: item.role === \"user\" })}\n key={index}\n >\n {showAvatar && <Avatar role={item.role} agentId={item.agentId} />}\n <MessageNode {...item} />\n </div>\n );\n },\n [showAvatar]\n );\n\n const msgListNode = useMemo(() => {\n return msgList.map((item, index) => {\n if (item.chatting) {\n return (\n <>\n {getMsgItemNode(item, index)}\n {chatting && index === msgList.length - 1 ? <StopBtn /> : null}\n </>\n );\n } else {\n return getMsgItemNode(item, index);\n }\n });\n }, [msgList, chatting, getMsgItemNode]);\n\n const handleScroll = useCallback(() => {\n const messageList = chatViewRef.current;\n if (messageList) {\n const { scrollHeight, clientHeight, scrollTop } = messageList;\n // 滚动到底部所需的高度 = 总高度 - 视图高度\n const isBottom = scrollHeight - clientHeight === scrollTop;\n if (!isBottom) {\n isCustomScroll.current = true;\n } else if (isBottom && isCustomScroll.current) {\n // 自动吸低\n isCustomScroll.current = false;\n }\n if (\n !msgLoading &&\n !msgEnd &&\n scrollTop < CACHE_HEIGHT &&\n activeSessionId\n ) {\n checkSession();\n }\n }\n }, [msgEnd, msgLoading, activeSessionId, checkSession]);\n\n const debounceHandleScroll = debounce(handleScroll, 200);\n\n useEffect(() => {\n if (chatting || activeSessionId) {\n // 聊天或者会话变更时,重置滚动状态\n isCustomScroll.current = false;\n }\n }, [chatting, activeSessionId]);\n\n useEffect(() => {\n const element = messgetListBoxRef.current;\n if (element) {\n const observer = new ResizeObserver((entries) => {\n let newHeight: number = 0;\n // 如果存在用户行为,不触发自动滚动行为\n if (isCustomScroll.current) return;\n for (const entry of entries) {\n newHeight = entry.contentRect.height - DEFAULT_OFFSET_HEIGHT;\n }\n if (!loading && !chatting) {\n // 高度变化,代表消息新增,自动滚动到最下\n chatViewRef.current!.scroll({\n top: Number.MAX_SAFE_INTEGER,\n });\n }\n if (newHeight > preHeight && chatting) {\n chatViewRef.current!.scroll({\n top: Number.MAX_SAFE_INTEGER,\n });\n setPreHeight(Math.max(preHeight, newHeight));\n }\n });\n observer.observe(element);\n return () => observer.disconnect();\n }\n }, [chatting, loading, preHeight]);\n\n return (\n <div\n className=\"chat-view\"\n ref={chatViewRef}\n onScroll={debounceHandleScroll}\n >\n <div className=\"message-list\">\n <div className=\"message-list-box\" ref={messgetListBoxRef}>\n {msgEnd && msgList.length ? (\n <div className=\"message-start-tip\">会话开始</div>\n ) : null}\n {msgLoading && <CommonLoading />}\n <QuickAnswerList />\n {msgListNode}\n </div>\n {loading && <MessageListLoading />}\n </div>\n </div>\n );\n}\n","const HIDDEN_TEXTAREA_STYLE = `\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n padding: 10px !important;\n pointer-events: none !important;\n`;\n\nconst SIZING_STYLE = [\n \"letter-spacing\",\n \"line-height\",\n \"padding-top\",\n \"padding-bottom\",\n \"font-family\",\n \"font-weight\",\n \"font-size\",\n \"font-variant\",\n \"text-rendering\",\n \"text-transform\",\n \"width\",\n \"text-indent\",\n \"padding-left\",\n \"padding-right\",\n \"border-width\",\n \"box-sizing\",\n \"word-break\",\n \"white-space\",\n];\nlet hiddenTextarea: HTMLTextAreaElement;\n\n/**\n * 计算 textare 高度\n * https://github.com/react-component/textarea/blob/1c0026fbe30e5f7dff1fca695b2cf262246381ca/src/calculateNodeHeight.tsx\n * */\nexport default function calculateAutoSizeStyle(\n uiTextNode: HTMLTextAreaElement,\n minRows: number | null = null,\n maxRows: number | null = null\n): React.CSSProperties {\n if (!hiddenTextarea) {\n hiddenTextarea = document.createElement(\"textarea\");\n hiddenTextarea.setAttribute(\"tab-index\", \"-1\");\n hiddenTextarea.setAttribute(\"aria-hidden\", \"true\");\n document.body.appendChild(hiddenTextarea);\n }\n\n const uiTextNodeStyle = window.getComputedStyle(uiTextNode);\n const sizingStyle = SIZING_STYLE.map(\n (name) => `${name}:${uiTextNodeStyle.getPropertyValue(name)}`\n ).join(\";\");\n\n // equal style\n hiddenTextarea.setAttribute(\n \"style\",\n `${sizingStyle};${HIDDEN_TEXTAREA_STYLE}`\n );\n hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || \"\";\n\n let minHeight: number | undefined = undefined;\n let maxHeight: number | undefined = undefined;\n // let overflowY: any;\n\n const borderSize = 2;\n const paddingSize = 20;\n let height = hiddenTextarea.scrollHeight - paddingSize + borderSize;\n\n if (minRows !== null || maxRows !== null) {\n // measure height of a textarea with a single row\n hiddenTextarea.value = \" \";\n const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;\n if (minRows !== null) {\n minHeight = singleRowHeight * minRows - paddingSize + borderSize;\n height = Math.max(paddingSize, height);\n }\n if (maxRows !== null) {\n maxHeight = singleRowHeight * maxRows - paddingSize + borderSize;\n // overflowY = height > maxHeight ? \"\" : \"hidden\";\n height = Math.min(maxHeight, height);\n }\n }\n\n const style: React.CSSProperties = {\n height,\n overflowY: \"scroll\",\n resize: \"none\",\n };\n\n if (minHeight) {\n style.minHeight = minHeight;\n }\n if (maxHeight) {\n style.maxHeight = maxHeight;\n }\n\n return style;\n}\n","import React, {\n ChangeEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport type { EoTooltip, ToolTipProps } from \"@next-bricks/basic/tooltip\";\nimport calculateAutoSizeStyle from \"./utils/calculateAutoSizeStyle.js\";\nimport classNames from \"classnames\";\nimport { useChatViewContext } from \"../ChatViewContext.js\";\nimport { AgentDetailItem } from \"./QuickAnswerList/index\";\n\nconst WrappedToolTip = wrapBrick<EoTooltip, ToolTipProps>(\"eo-tooltip\");\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nconst PREFIX_WORD = \"@\";\n\nexport function SearchInput(): React.ReactNode {\n const [value, setValue] = useState<string>(\"\");\n const [active, setActive] = useState<boolean>(false);\n const [expand, setExpand] = useState<boolean>(false);\n const [autoSizeStyle, setAutoSizeStyle] = useState<React.CSSProperties>();\n const [isFillContent, setIsFillContent] = useState<boolean>(false);\n\n // mention\n const [mentionOpen, setMentionOpen] = useState<boolean>(false);\n const [matchPrefixIndex, setMatchPrefixIndex] = useState<number>(-1);\n const [matchAgentList, setMatchMentionList] = useState<AgentDetailItem[]>([]);\n const [matchMentionsIndex, setMatchMentionsIndex] = useState<number>(0);\n\n const mentionsRef = useRef<HTMLDivElement>(null);\n const searchInputBoxRef = useRef<HTMLDivElement>(null);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const hadExpanded = useRef<boolean>(false);\n const inputEndRef = useRef<boolean>(false);\n\n const {\n chatting,\n loading,\n searchStr,\n quickAnswerConfig,\n createSession,\n setSearchStr,\n handleChat,\n setAgent,\n } = useChatViewContext();\n\n const agentList = useMemo(\n () => quickAnswerConfig?.list ?? [],\n [quickAnswerConfig]\n );\n\n const hadValue = useMemo(() => !!value, [value]);\n const defaultSize = useMemo(() => [1, 5], []);\n const disabled = useMemo(() => loading || chatting, [chatting, loading]);\n\n const matchPrefixInfo = useMemo(() => {\n const textareaElement = textareaRef.current!;\n if (matchPrefixIndex >= 0 && value) {\n const currentFocusIndex = textareaElement.selectionStart;\n let matchWord = \"\";\n for (let i = matchPrefixIndex + 1; i < currentFocusIndex; i++) {\n // 匹配中文英文数字\n if (/[\\u4e00-\\u9fa5]|\\w|\\d/.test(value[i]) || inputEndRef.current) {\n matchWord = matchWord + value[i];\n } else {\n setMatchPrefixIndex(-1);\n return false;\n }\n }\n return {\n start: matchPrefixIndex + 1,\n end: currentFocusIndex,\n word: matchWord,\n };\n }\n return false;\n }, [matchPrefixIndex, value]);\n\n const handleAgentItemSelect = useCallback(\n (item: AgentDetailItem) => {\n if (matchPrefixInfo) {\n const { start, end } = matchPrefixInfo;\n const valueList = value.split(\"\");\n const trimName = item.name.replace(/\\s+/g, \"\") + \" \";\n const focusIndex = start + trimName.length;\n valueList.splice(start, end - start, trimName);\n setValue(valueList.join(\"\"));\n setMatchPrefixIndex(-1);\n\n setTimeout(() => {\n textareaRef.current!.selectionStart = focusIndex;\n textareaRef.current!.selectionEnd = focusIndex;\n textareaRef.current!.focus();\n }, 0);\n }\n },\n [matchPrefixInfo, value]\n );\n\n const isShowMentions = useMemo(() => {\n return matchAgentList.length && mentionOpen;\n }, [matchAgentList, mentionOpen]);\n\n const mentions = useMemo(() => {\n return isShowMentions ? (\n <div className=\"mentions-list-wrapper\" ref={mentionsRef}>\n <div className=\"content\">\n <div className=\"mentions-title\">Agents</div>\n <div className=\"mentions-list\">\n {matchAgentList.slice(0, 10).map((item, index) => {\n return (\n <div\n className={classNames(\"mentions-item\", {\n active: index === matchMentionsIndex,\n })}\n key={index}\n onClick={() => handleAgentItemSelect(item)}\n >\n <WrappedIcon\n className=\"icon\"\n {...item.icon}\n style={{\n color: `var(--theme-${item.icon.color}-color)`,\n background: `var(--theme-${item.icon.color}-background)`,\n }}\n />\n <div className=\"name\">{item.name}</div>\n <div className=\"description\">{item.description}</div>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n ) : null;\n }, [\n matchAgentList,\n matchMentionsIndex,\n isShowMentions,\n handleAgentItemSelect,\n ]);\n\n const computedAutoSize = useCallback(\n (size = defaultSize) => {\n if (hadExpanded.current && expand) return;\n const textareaElement = textareaRef.current as HTMLTextAreaElement;\n if (textareaElement) {\n const textareaStyles = calculateAutoSizeStyle(\n textareaElement,\n size[0],\n size[1]\n );\n\n setAutoSizeStyle(textareaStyles);\n }\n hadExpanded.current = expand;\n },\n [defaultSize, expand]\n );\n\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLTextAreaElement> | string): void => {\n const value = typeof e === \"string\" ? e : e.target.value;\n setValue(value);\n textareaRef.current!.value = value;\n },\n []\n );\n\n const handleCompositionStart = () => {\n inputEndRef.current = true;\n };\n\n const handleCompositionEnd = () => {\n inputEndRef.current = false;\n };\n\n const hanldeCreateSession = () => {\n createSession();\n };\n\n const handleExpand = useCallback(() => {\n setExpand((value) => {\n return !value;\n });\n }, []);\n\n const matchFirstAgent = useCallback(\n (value: string) => {\n const regex = /@([\\u4e00-\\u9fa5|\\w|\\d]+)/g;\n\n // 在字符串中循环匹配正则表达式\n let match: RegExpExecArray | null;\n while ((match = regex.exec(value)) !== null) {\n if (match) {\n const agent = agentList?.find(\n (item) => item.name.replace(/\\s+/g, \"\") === match![1]\n );\n agent && setAgent(agent.id);\n if (agent) break;\n }\n }\n },\n [agentList, setAgent]\n );\n\n const handleSubmit = useCallback(() => {\n if (!hadValue || !textareaRef.current || disabled) return;\n\n matchFirstAgent(value);\n handleChat(value);\n\n setActive(false);\n setExpand(false);\n handleChange(\"\");\n textareaRef.current.blur();\n }, [value, hadValue, disabled, handleChat, handleChange, matchFirstAgent]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === \"Enter\" && !e.shiftKey && !inputEndRef.current) {\n e.preventDefault();\n if (isShowMentions) {\n handleAgentItemSelect(matchAgentList[matchMentionsIndex]);\n } else {\n handleSubmit();\n }\n }\n if (isShowMentions) {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n setMatchMentionsIndex((index) => Math.max(0, index - 1));\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n setMatchMentionsIndex((index) =>\n Math.min(matchAgentList.length - 1, index + 1)\n );\n }\n }\n },\n [\n handleSubmit,\n handleAgentItemSelect,\n isShowMentions,\n matchAgentList,\n matchMentionsIndex,\n ]\n );\n\n const handleKeyUp = useCallback(\n (e: React.KeyboardEvent) => {\n const textareaElement = textareaRef.current!;\n\n const selectionIndex = textareaElement.selectionStart;\n const prefixWord = textareaElement.value[selectionIndex - 1];\n const beforeSelectionText = textareaElement.value.slice(\n 0,\n selectionIndex\n );\n const index = beforeSelectionText.lastIndexOf(PREFIX_WORD);\n\n if (\n e.key === \"Escape\" ||\n (!isShowMentions &&\n [\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"].indexOf(e.key) !==\n -1)\n ) {\n setMatchPrefixIndex(-1);\n return;\n }\n\n if (prefixWord === PREFIX_WORD) {\n setMatchPrefixIndex(selectionIndex - 1);\n } else {\n setMatchPrefixIndex(index);\n }\n },\n [isShowMentions]\n );\n\n useEffect(() => {\n if (searchStr) {\n handleChange(searchStr.trim());\n textareaRef.current?.focus();\n setSearchStr(\"\");\n }\n }, [searchStr, disabled, setSearchStr, handleChange]);\n\n useEffect(() => {\n computedAutoSize(expand ? [20, 20] : undefined);\n }, [value, expand, computedAutoSize]);\n\n useEffect(() => {\n const searchInputBox = searchInputBoxRef.current;\n if (searchInputBox) {\n const observe = new ResizeObserver(() => {\n const { width: currentWidth } = searchInputBox.getBoundingClientRect();\n const FIT_CONTENT_WIDTH = 900;\n\n setIsFillContent(currentWidth < FIT_CONTENT_WIDTH);\n });\n\n observe.observe(searchInputBox);\n\n return () => {\n observe.disconnect();\n };\n }\n }, []);\n\n useEffect(() => {\n if (!chatting && textareaRef.current) {\n textareaRef.current?.focus();\n }\n }, [chatting]);\n\n useEffect(() => {\n if (agentList?.length && matchPrefixInfo) {\n const filterList =\n matchPrefixInfo.word === \"\"\n ? agentList\n : agentList.filter((item) =>\n item.name.includes(matchPrefixInfo.word)\n );\n\n setMatchMentionList(filterList);\n setMatchMentionsIndex(0);\n setMentionOpen(true);\n } else {\n setMatchMentionList([]);\n setMentionOpen(false);\n }\n }, [matchPrefixInfo, agentList]);\n\n useEffect(() => {\n if (matchMentionsIndex >= 0 && mentionsRef.current) {\n const element = mentionsRef.current.querySelector(\n \".mentions-item.active\"\n );\n element?.scrollIntoView({ block: \"nearest\" });\n }\n }, [matchMentionsIndex]);\n\n useEffect(() => {\n const handleDocumentClick = (e: any) => {\n const mentionsElemnt = mentionsRef.current;\n if (mentionsElemnt && !mentionsElemnt.contains(e.composedPath()[0])) {\n setMentionOpen(false);\n }\n };\n\n document.addEventListener(\"click\", handleDocumentClick);\n\n return () => {\n document.removeEventListener(\"click\", handleDocumentClick);\n };\n }, []);\n\n return (\n <div\n className={classNames(\"search-input-box\", {\n \"fill-content\": isFillContent,\n })}\n ref={searchInputBoxRef}\n >\n {mentions}\n <div\n className={classNames(\"input-box\", {\n active,\n disabled,\n expand,\n })}\n >\n <textarea\n value={value}\n ref={textareaRef}\n style={{\n ...autoSizeStyle,\n paddingRight: expand ? \"50px\" : \"140px\",\n }}\n placeholder={chatting ? \"回复中,请稍等...\" : \"提出你的想法...\"}\n onFocus={() => setActive(true)}\n onBlur={() => setActive(false)}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onKeyUpCapture={handleKeyUp}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n />\n <span className=\"suffix-icon\">\n <WrappedToolTip content=\"新增会话\">\n <WrappedIcon\n lib=\"antd\"\n icon=\"plus-circle\"\n onClick={hanldeCreateSession}\n />\n </WrappedToolTip>\n {!expand && (\n <WrappedToolTip content=\"放大\">\n <WrappedIcon\n lib=\"antd\"\n icon=\"arrows-alt\"\n onClick={handleExpand}\n />\n </WrappedToolTip>\n )}\n <div className=\"submit-split\"></div>\n <WrappedToolTip content=\"提交\">\n <WrappedIcon\n className={classNames(\"submit-btn\", {\n active: hadValue,\n disabled: !hadValue || disabled,\n })}\n lib={chatting ? \"antd\" : \"easyops\"}\n icon={chatting ? \"loading\" : \"release-management-fill\"}\n category={chatting ? \"\" : \"menu\"}\n spinning={chatting}\n onClick={handleSubmit}\n />\n </WrappedToolTip>\n </span>\n <span className=\"toolbar-icon\">\n {expand && (\n <WrappedToolTip content=\"缩小\">\n <WrappedIcon lib=\"antd\" icon=\"shrink\" onClick={handleExpand} />\n </WrappedToolTip>\n )}\n </span>\n </div>\n {hadValue && (\n <div className=\"search-input-toolbar\">\n <div className=\"input-tip\">Shift + Enter 换行</div>\n </div>\n )}\n </div>\n );\n}\n","import React, { useCallback, useEffect, useRef } from \"react\";\nimport { useChatViewContext } from \"../ChatViewContext\";\nimport classNames from \"classnames\";\nimport { debounce } from \"lodash\";\nimport { SessionItem as SessionItemProps } from \"../ChatService\";\nimport { CommonLoading } from \"./Loading.js\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport { unwrapProvider } from \"@next-core/utils/general\";\nimport type { showDialog as _showDialog } from \"@next-bricks/basic/data-providers/show-dialog/show-dialog\";\nimport type { showNotification as _showNotification } from \"@next-bricks/basic/data-providers/show-notification/show-notification\";\n\nconst showNotification = unwrapProvider<typeof _showNotification>(\n \"basic.show-notification\"\n);\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nconst showDialog = unwrapProvider<typeof _showDialog>(\"basic.show-dialog\");\n\nconst SESSION_ITEM_HEIGHT = 42;\nconst BUFFER_NUMBER = 5;\nconst CACHE_HEIGHT = 100;\n\nexport function SessionList(): React.ReactNode {\n const { sessionEnd, sessionLoading, sessionList, querySessionHistory } =\n useChatViewContext();\n const sessionWrapperRef = useRef<HTMLDivElement>(null);\n const sessionListRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n // 计算视图内可以展示多少条会话历史数据\n let limit = 20;\n const sessionWrapper = sessionWrapperRef.current;\n if (sessionWrapper) {\n // limit = 视图高度 % 单条高度 + 缓冲长度\n limit =\n Math.floor(sessionWrapper.clientHeight / SESSION_ITEM_HEIGHT) +\n BUFFER_NUMBER;\n }\n querySessionHistory(limit);\n }, []);\n\n const checkSessionList = useCallback(() => {\n if (sessionLoading || sessionEnd) return;\n const sessionList = sessionListRef.current;\n if (sessionList) {\n const { scrollTop, scrollHeight, clientHeight } = sessionList;\n // 如果滚动的高度 + 视图高度 + 缓冲高度 > 视图的滚动高度,请求新的数据\n if (scrollTop + clientHeight + CACHE_HEIGHT > scrollHeight) {\n querySessionHistory();\n }\n }\n }, [querySessionHistory, sessionLoading, sessionEnd]);\n\n const handleScroll = debounce(checkSessionList, 200);\n\n return (\n <div className=\"session-list-wrapper\" ref={sessionWrapperRef}>\n <div className=\"session-title\">历史对话</div>\n <div\n className=\"session-list\"\n ref={sessionListRef}\n onScroll={handleScroll}\n >\n {sessionList.map((item, index) => {\n return <SessionItem key={index} {...item} />;\n })}\n {sessionLoading && <CommonLoading />}\n {/* {sessionEnd && <div className=\"session-end-tip\">到底啦</div>} */}\n </div>\n </div>\n );\n}\n\nfunction SessionItem({ title, conversationId }: SessionItemProps) {\n const { activeSessionId, checkSession, deleteSession } = useChatViewContext();\n\n const handleCheckSession = useCallback(() => {\n checkSession(conversationId, true);\n }, [conversationId, checkSession]);\n\n const handleDeleteSession = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation();\n showDialog({\n type: \"confirm\",\n title: \"会话删除确认\",\n content: `请输入 {{ expect }} 以确认删除`,\n expect: title.replace(/\\s+/g, \"\"),\n }).then(async () => {\n const result = await deleteSession([conversationId]);\n showNotification({\n message: `删除会话${result ? \"成功\" : \"失败\"}`,\n type: result ? \"success\" : \"error\",\n });\n });\n },\n [conversationId, deleteSession, title]\n );\n\n return (\n <div\n key={title}\n className={classNames(\"session-item\", {\n active: conversationId === activeSessionId,\n })}\n onClick={handleCheckSession}\n >\n <div className=\"content\">\n <div className=\"title\" title={title}>\n {title}\n </div>\n </div>\n\n <div className=\"session-close-btn\" onClick={handleDeleteSession}>\n <WrappedIcon icon=\"close\" lib=\"antd\" />\n </div>\n </div>\n );\n}\n","import { fetchEventSource } from \"@microsoft/fetch-event-source\";\nimport { http } from \"@next-core/http\";\nimport { getBasePath } from \"@next-core/runtime\";\nimport moment from \"moment\";\n\nexport interface SSEMessageItem {\n conversationId?: string;\n created: number | string;\n delta: {\n content: string;\n role: string;\n };\n taskId?: string;\n agentId?: string;\n}\n\nexport interface QueueItem {\n topic: string;\n message?: SSEMessageItem;\n}\n\nexport interface SessionItem {\n conversationId: string;\n isDelete: boolean;\n time: number;\n title: string;\n user: string;\n _row_id: string;\n}\n\nexport interface ChatItem {\n agentId: string;\n conversationId: string;\n input: string;\n output: string;\n taskId: string;\n time: number;\n inputTime: number;\n user: string;\n _row_id: string;\n tag: {\n isLike?: boolean;\n };\n}\n\nexport class ChatService {\n #debug: boolean;\n #ctrl?: AbortController;\n #agentId: string;\n #enterInterval: number;\n #charting = false;\n #isStartEmitEvent = false;\n #emitTimer: NodeJS.Timeout | undefined;\n #messageQueue: Array<QueueItem> = [];\n #subscribers: Record<string, Array<(msg?: SSEMessageItem) => void>> = {};\n #conversationId?: string;\n\n // 会话\n #sessionNextToken?: string;\n #cacheLimit?: number;\n\n // 消息\n #messageNextToken?: string;\n\n constructor({\n agentId,\n enterInterval = 50,\n debug = false,\n }: {\n agentId: string;\n enterInterval: number;\n debug: boolean;\n }) {\n this.#agentId = agentId;\n this.#enterInterval = enterInterval;\n this.#debug = debug;\n }\n\n enqueue(data: QueueItem) {\n this.#messageQueue.push(data);\n this.#startEmitEvent();\n }\n\n dequeue() {\n return this.#messageQueue.shift();\n }\n\n #clear() {\n this.#messageQueue.length = 0;\n }\n\n getMessageQueue() {\n return this.#messageQueue;\n }\n\n subscribe(topic: string, callback: (msg?: SSEMessageItem) => void) {\n if (!this.#subscribers[topic]) {\n this.#subscribers[topic] = [];\n }\n this.#subscribers[topic].push(callback);\n }\n\n unsubscribe(topic: string, callback: (msg?: SSEMessageItem) => void) {\n if (this.#subscribers[topic]) {\n this.#subscribers[topic] = this.#subscribers[topic].filter(\n (cb) => cb !== callback\n );\n }\n }\n\n notifySubscribers(data: QueueItem) {\n const topic = data.topic;\n if (this.#subscribers[topic]) {\n this.#subscribers[topic].forEach((callback) => {\n callback(data?.message);\n });\n }\n }\n\n async setChatItemIsLike(id: string, isLike: boolean): Promise<boolean> {\n let flag: boolean = false;\n try {\n const { code } = await http.request<{ code: number }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.CommentDialogue/conversation/comment`,\n {\n method: \"POST\",\n body: JSON.stringify({\n taskId: id,\n isLike,\n }),\n }\n );\n if (code === 0) {\n flag = true;\n }\n } catch {\n flag = false;\n }\n return flag;\n }\n\n setAgentId(id: string) {\n this.#agentId = id;\n }\n\n setConversationId(id?: string) {\n this.#conversationId = id;\n }\n\n async getSessionHistory(limit?: number): Promise<SessionItem[]> {\n if (limit) {\n this.#cacheLimit = limit;\n }\n try {\n const {\n data: { conversations, next_token },\n } = await http.request<{\n data: {\n conversations: SessionItem[];\n next_token: string;\n previous_token: string;\n };\n }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.ListConversation/conversation/list`,\n {\n method: \"POST\",\n body: JSON.stringify({\n limit: this.#cacheLimit ?? 20,\n next_token: this.#sessionNextToken,\n }),\n }\n );\n this.#sessionNextToken = next_token;\n if (!next_token) {\n this.notifySubscribers({ topic: \"session.fetch.end\" });\n }\n return conversations;\n } catch {\n // eslint-disable-next-line no-console\n console.error(\"获取会话历史失败\");\n }\n return [];\n }\n\n async getChatHistory(id?: string): Promise<ChatItem[]> {\n if (id) {\n this.setConversationId(id);\n this.#messageNextToken = \"\";\n }\n if (!this.#conversationId) return [];\n try {\n const {\n data: { conversations, next_token },\n } = await http.request<{\n data: {\n conversations: ChatItem[];\n next_token: string;\n previous_token: string;\n };\n }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.GetAllDialogue/conversation/get/${this.#conversationId}`,\n {\n method: \"POST\",\n body: JSON.stringify({\n limit: 15,\n next_token: this.#messageNextToken,\n }),\n }\n );\n this.#messageNextToken = next_token;\n if (!next_token) {\n this.notifySubscribers({ topic: \"message.fetch.end\" });\n }\n return conversations;\n } catch {\n // eslint-disable-next-line no-console\n console.error(\"获取消息历史失败\");\n }\n return [];\n }\n\n async deleteSession(id: string[]): Promise<boolean> {\n if (!id.length) return false;\n let flag: boolean = false;\n try {\n const { code } = await http.request<{ code: number }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.DeleteConversation/conversation/delete`,\n {\n method: \"POST\",\n body: JSON.stringify({\n conversationIds: id,\n }),\n }\n );\n if (code === 0) {\n flag = true;\n }\n } catch {\n flag = false;\n }\n return flag;\n }\n\n splitWord(str: string): string[] {\n if (!str) return [];\n // 单词长度小于 5 直接返回, 否则做单词分割处理\n if (str?.length < 5) return [str];\n const list = [];\n\n // TODO: 特殊逻辑,临时处理 debug 内容\n if (this.#debug && /easy_cmd_flow_debug/.test(str)) {\n return [str];\n }\n\n if (window.Intl) {\n const segmenterFr = new Intl.Segmenter(\"zh-Hans-CN\", {\n granularity: \"word\",\n });\n const iterator = segmenterFr.segment(str)[Symbol.iterator]();\n\n let nextWord = iterator.next();\n while (!nextWord.done) {\n list.push(nextWord.value.segment);\n nextWord = iterator.next();\n }\n } else {\n const customSplit = {\n [Symbol.split](str: string) {\n let pos = 0;\n const result = [];\n let cache = \"\";\n while (pos < str.length) {\n const matchStr = str.substring(pos, pos + 1);\n // 如果是中文,单个输出\n if (/[\\u4e00-\\u9fa5]/.test(matchStr)) {\n result.push(cache + matchStr);\n cache = \"\";\n } else {\n // 否则,遇到空格或者标点符号再分词\n if (!/\\s|[,。;《》?!,.:<>?!]]/.test(matchStr)) {\n cache = cache + matchStr;\n } else {\n result.push(cache + matchStr);\n cache = \"\";\n }\n }\n pos++;\n }\n if (cache) result.push(cache);\n return result;\n },\n };\n\n str.split(customSplit).forEach((word) => {\n list.push(word);\n });\n }\n\n return list;\n }\n\n async chat(str: string): Promise<void> {\n this.#ctrl = new AbortController();\n let hadMatchMessage = false;\n this.#charting = true;\n await fetchEventSource(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.manage.LLMChatProxy@1.0.0/api/aiops_chat/v1/chat/completions`,\n {\n method: \"POST\",\n signal: this.#ctrl.signal,\n body: JSON.stringify({\n agentId: this.#agentId,\n conversationId: this.#conversationId,\n input: str,\n stream: true,\n config: {\n debug: this.#debug,\n },\n }),\n headers: {\n \"giraffe-contract-name\": \"easyops.api.aiops_chat.manage.LLMChatProxy\",\n },\n onopen: async (response) => {\n if (response.ok) {\n // eslint-disable-next-line no-console\n console.log(\"open sse service success!\");\n } else {\n // eslint-disable-next-line no-console\n console.log(\"open sse service fail!\");\n }\n },\n onmessage: (msg) => {\n const { data } = msg;\n hadMatchMessage = true;\n if (data === \"[DONE]\") {\n this.#ctrl!.abort();\n return;\n }\n let result = {} as SSEMessageItem;\n try {\n result = JSON.parse(data);\n } catch {\n this.enqueue({\n topic: \"add\",\n message: {\n created: moment().format(\"YYYY-MM-DD HH:mm:ss\"),\n delta: {\n role: \"assistant\",\n content: `\\`【数据格式错误】:\\` ${data}`,\n },\n agentId: this.#agentId,\n },\n });\n return;\n }\n if (!this.#conversationId) {\n this.setConversationId(result.conversationId);\n }\n const wordList = this.splitWord(result.delta.content);\n wordList.forEach((word) => {\n this.enqueue({\n topic: \"add\",\n message: {\n ...result,\n delta: {\n role: \"assistant\",\n content: word,\n },\n },\n });\n });\n },\n onclose: () => {\n // eslint-disable-next-line no-console\n console.log(\"close\");\n // 兜底逻辑,连接结束,并且没有数据返回\n if (!hadMatchMessage) {\n this.enqueue({\n topic: \"add\",\n message: {\n delta: {\n role: \"assistant\",\n content: \"`无法识别`\",\n },\n agentId: this.#agentId,\n created: moment().format(\"YYYY-MM-DD HH:mm:ss\"),\n },\n });\n }\n this.#ctrl!.abort();\n },\n onerror: (err) => {\n // eslint-disable-next-line no-console\n console.log(\"err\", err);\n this.#ctrl!.abort();\n },\n }\n );\n\n this.#charting = false;\n }\n\n stop() {\n clearInterval(this.#emitTimer);\n this.#ctrl && this.#ctrl?.abort();\n this.#charting = false;\n this.#emitTimer = undefined;\n this.#isStartEmitEvent = false;\n this.#clear();\n this.notifySubscribers({ topic: \"stop\" });\n }\n\n #startEmitEvent() {\n if (this.#isStartEmitEvent) return;\n this.#isStartEmitEvent = true;\n // 轮训队列,每隔 #enterInterval(默认 50ms) 推出第一条数据,获取到 text,推送给组件,组件接受后进行渲染\n // 直到聊天结束,并且消息队列数据为空时,停止 emit\n this.#emitTimer = setInterval(() => {\n if (this.#charting || this.getMessageQueue().length) {\n const messageItem = this.dequeue()!;\n messageItem && this.notifySubscribers(messageItem);\n } else {\n clearInterval(this.#emitTimer);\n this.#emitTimer = undefined;\n this.#isStartEmitEvent = false;\n this.notifySubscribers({ topic: \"finish\" });\n }\n }, this.#enterInterval);\n }\n}\n\n// export const chartService = new ChatService();\n","import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { MessageItem } from \"../ChatViewContext.js\";\nimport moment from \"moment\";\nimport {\n ChatItem,\n ChatService,\n SessionItem,\n SSEMessageItem,\n} from \"../ChatService.js\";\n\nconst NEW_SESSION_ID = \"new_session_id\";\n\nexport function useChatViewInfo({\n agentId,\n sessionId,\n enterInterval = 50,\n debug,\n}: {\n agentId: string;\n sessionId?: string;\n enterInterval?: number;\n debug: boolean;\n}) {\n const [sessionEnd, setSessionEnd] = useState<boolean>(false);\n const [sessionLoading, setSessionLoading] = useState<boolean>(false);\n const [activeSessionId, setActiveSessionId] = useState<string>();\n const [loading, setLoading] = useState<boolean>(false);\n const [chatting, setChatting] = useState<boolean>(false);\n const [sessionList, setSessionList] = useState<SessionItem[]>([]);\n\n const [msgLoading, setMsgLoading] = useState<boolean>(false);\n const [msgEnd, setMsgEnd] = useState<boolean>(false);\n const [msgList, setMsgList] = useState<MessageItem[]>([]);\n const [searchStr, setSearchStr] = useState<string>(\"\");\n const chatingText = useRef<string>(\"\");\n const chatingMessageItem = useRef<MessageItem>();\n const chatService = useMemo(\n () =>\n new ChatService({\n agentId,\n enterInterval,\n debug,\n }),\n [agentId, enterInterval, debug]\n );\n\n const defaultNewSessionItem = useMemo(\n () =>\n ({\n conversationId: NEW_SESSION_ID,\n title: \"新建会话\",\n }) as SessionItem,\n []\n );\n\n const stopChat = useCallback(() => {\n chatService.stop();\n }, [chatService]);\n\n const setAgent = useCallback(\n (id: string) => {\n chatService.setAgentId(id);\n },\n [chatService]\n );\n\n const checkSession = useCallback(\n async (id?: string, isInit = false) => {\n if (isInit && id) {\n // 切换聊天,重制状态\n setMsgEnd(false);\n setMsgLoading(false);\n setLoading(true);\n setMsgList([]);\n setActiveSessionId(id);\n if (chatting) {\n stopChat();\n }\n } else {\n setMsgLoading(true);\n }\n // 如果是新建会话,不需要查询历史\n if (id === NEW_SESSION_ID) {\n // 重置会话id\n chatService.setConversationId();\n setMsgEnd(true);\n setLoading(false);\n return;\n }\n const list = await chatService.getChatHistory(id);\n const computedList = (list: ChatItem[]) => {\n const newList: MessageItem[] = [];\n list.forEach((item) => {\n newList.unshift(\n {\n agentId: item.agentId,\n taskId: item.taskId,\n conversationId: item.conversationId,\n role: \"user\",\n content: {\n type: \"markdown\",\n text: item.input,\n },\n key: `user_${item.taskId}`,\n created: item.time,\n },\n {\n agentId: item.agentId,\n taskId: item.taskId,\n conversationId: item.conversationId,\n role: \"assistant\",\n content: {\n type: \"markdown\",\n text: item.output,\n },\n key: `assistant_${item.taskId}`,\n created: item.inputTime,\n tag: item.tag,\n }\n );\n });\n return newList.filter((item) => item.content.text);\n };\n setMsgList((preList) => {\n return computedList(list).concat(preList);\n });\n setMsgLoading(false);\n setLoading(false);\n },\n [chatService, chatting, stopChat]\n );\n\n const deleteSession = useCallback(\n async (ids: string[]): Promise<boolean> => {\n // 需要过滤新建会话, 因为新建会话在本地,还没上报到远端\n const filterIds = ids.filter((item) => item !== NEW_SESSION_ID);\n const result = await chatService.deleteSession(filterIds);\n if (result) {\n let deleteActiveSession = false;\n if (\n activeSessionId &&\n filterIds.includes(activeSessionId) &&\n activeSessionId !== NEW_SESSION_ID\n ) {\n // 如果删除会话包含当前会话,需要重置状态\n deleteActiveSession = true;\n // 清除会话id\n chatService.setConversationId();\n\n setMsgEnd(false);\n setMsgLoading(false);\n setMsgList([]);\n\n if (chatting) {\n stopChat();\n }\n }\n\n setSessionList((list) => {\n const newList = list.filter(\n (item) => !filterIds.includes(item.conversationId!)\n );\n if (deleteActiveSession) {\n // 已经选中的当前会话被删除,新建会话\n const hasNewOne = list.find(\n (item) => item.conversationId === NEW_SESSION_ID\n );\n setLoading(false);\n\n setActiveSessionId(NEW_SESSION_ID);\n if (hasNewOne) {\n return newList;\n } else {\n return [defaultNewSessionItem].concat(newList);\n }\n }\n return newList;\n });\n }\n return result;\n },\n [activeSessionId, chatService, chatting, defaultNewSessionItem, stopChat]\n );\n\n const querySessionHistory = useCallback(\n async (limit?: number) => {\n setSessionLoading(true);\n const list = await chatService.getSessionHistory(limit);\n if (!activeSessionId) {\n // 如果没有 activeSessionId, 默认新增会话\n setActiveSessionId(NEW_SESSION_ID);\n }\n setSessionList((preList) => {\n return !activeSessionId\n ? [defaultNewSessionItem].concat([...preList, ...list])\n : preList.concat(list);\n });\n setSessionLoading(false);\n },\n [chatService, activeSessionId, defaultNewSessionItem]\n );\n\n const handleChat = useCallback(\n async (str: string) => {\n if (activeSessionId === NEW_SESSION_ID) {\n // 如果当前会话属于新建会话,更新会话历史数据\n setSessionList((list) => {\n return list.map((item) => ({\n ...item,\n title: item.conversationId === NEW_SESSION_ID ? str : item.title,\n }));\n });\n }\n setChatting(true);\n chatService.chat(str);\n setMsgList((list) => {\n return list.concat([\n {\n role: \"user\",\n content: {\n type: \"markdown\",\n text: str,\n },\n created: moment().format(\"YYYY-MM-DD HH:mm:ss\"),\n },\n {\n role: \"assistant\",\n content: {\n type: \"load\",\n text: \"\",\n },\n chatting: true,\n created: \"Now\",\n },\n ]);\n });\n },\n [chatService, activeSessionId]\n );\n\n const createSession = useCallback(() => {\n chatService.setConversationId();\n setMsgList([]);\n setActiveSessionId(NEW_SESSION_ID);\n const hasNewOne = sessionList.find(\n (item) => item.conversationId === NEW_SESSION_ID\n );\n if (!hasNewOne) {\n setSessionList((preList) => {\n return [defaultNewSessionItem].concat(preList);\n });\n }\n }, [chatService, sessionList, defaultNewSessionItem]);\n\n const handleIsLike = useCallback(\n async (id: string, isLike: boolean): Promise<boolean> => {\n const result = await chatService.setChatItemIsLike(id, isLike);\n if (result) {\n setMsgList((list) => {\n return list.map((item) => ({\n ...item,\n tag:\n id === item.taskId\n ? {\n isLike,\n }\n : item.tag,\n }));\n });\n }\n return result;\n },\n [chatService]\n );\n\n useEffect(() => {\n if (sessionId) {\n checkSession(sessionId);\n }\n }, [sessionId]);\n\n useEffect(() => {\n // session listener\n const handleSessionEnd = () => {\n setSessionEnd(true);\n };\n chatService.subscribe(\"session.fetch.end\", handleSessionEnd);\n\n return () => {\n chatService.subscribe(\"session.fetch.end\", handleSessionEnd);\n };\n }, [chatService]);\n\n useEffect(() => {\n // chat listener\n const listener = (msgItem?: SSEMessageItem) => {\n if (!msgItem) return;\n chatingText.current = chatingText.current + msgItem.delta.content;\n if (activeSessionId === NEW_SESSION_ID && msgItem.conversationId) {\n // 如果当前会话属于新建会话,更新会话历史数据\n setSessionList((list) => {\n return list.map((item) => ({\n ...item,\n conversationId:\n item.conversationId === NEW_SESSION_ID\n ? msgItem.conversationId!\n : item.conversationId,\n }));\n });\n setActiveSessionId(msgItem.conversationId);\n }\n // eslint-disable-next-line no-console\n // console.log(chatingText.current);\n chatingMessageItem.current = {\n ...msgItem,\n role: \"assistant\",\n content: {\n type: \"markdown\",\n text: chatingText.current,\n },\n chatting: true,\n created: moment(msgItem?.created).format(\"YYYY-MM-DD HH:mm:ss\"),\n };\n setMsgList((list) => {\n list.pop();\n return list.concat(chatingMessageItem.current!);\n });\n };\n const reset = () => {\n chatingText.current = \"\";\n setChatting(false);\n setLoading(false);\n chatingMessageItem.current = undefined;\n };\n const finishListener = () => {\n setMsgList((list) => {\n return list.map((item) => ({\n ...item,\n chatting: false,\n }));\n });\n reset();\n };\n const fetchEndListener = () => {\n setMsgEnd(true);\n };\n const stopListener = () => {\n if (chatingMessageItem.current) {\n const stopMessageItem: MessageItem = {\n ...chatingMessageItem.current,\n content: {\n type: \"markdown\",\n text:\n chatingMessageItem.current.content.text +\n \" \\\\\\n ` 对话被中断了 `\",\n },\n };\n setMsgList((list) => {\n list.pop();\n return msgList.concat(stopMessageItem);\n });\n } else {\n setMsgList((list) => {\n return list.filter((item) => item.content.type !== \"load\");\n });\n }\n reset();\n };\n chatService.subscribe(\"add\", listener);\n chatService.subscribe(\"finish\", finishListener);\n chatService.subscribe(\"stop\", stopListener);\n chatService.subscribe(\"message.fetch.end\", fetchEndListener);\n return () => {\n chatService.unsubscribe(\"add\", listener);\n chatService.unsubscribe(\"finish\", finishListener);\n chatService.unsubscribe(\"stop\", stopListener);\n chatService.unsubscribe(\"message.fetch.end\", fetchEndListener);\n };\n }, [chatService, activeSessionId, msgList]);\n\n return {\n sessionEnd,\n sessionLoading,\n loading,\n chatting,\n activeSessionId,\n sessionList,\n searchStr,\n msgEnd,\n msgLoading,\n msgList,\n setAgent,\n handleChat,\n stopChat,\n createSession,\n deleteSession,\n checkSession,\n setSearchStr,\n querySessionHistory,\n handleIsLike,\n };\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.progress-text{position:relative;margin-left:12px;font-size:12px;color:var(--palette-gray-7);line-height:22px;min-height:22px}.progress-text::before{content:\"·\";font-size:16px;position:absolute;left:-10px;top:-4px}.custom-component-wrapper .params{margin-top:6px;border-radius:3px}.custom-component-wrapper .params pre{margin:4px 0}.custom-component-wrapper .params-tip,\n .custom-component-wrapper .error-tip,\n .custom-component-wrapper .result-tip{font-size:0.875em;color:rgb(94 129 172)}.custom-component-wrapper .empty-tip{font-size:12px;color:var(--palette-gray-7)}.custom-component-wrapper .table-wrapper .table-container{position:relative;box-sizing:border-box;margin:0;padding:0;font-size:14px;clear:both;max-width:100%;overflow:hidden}.custom-component-wrapper .table-wrapper .table-container .table-content{overflow-x:auto}.custom-component-wrapper .table-wrapper .table-container .table-content table{margin:4px 0}.custom-component-wrapper .table-wrapper .table-container .table-content table tr td{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.custom-component-wrapper .table-wrapper .open-more{margin-top:4px;font-size:12px;display:flex;justify-content:end}.custom-component-wrapper .chart-wrapper{background:#fff;margin-top:12px}.default-container .default-toolbar-container{visibility:hidden;position:absolute;top:0;right:0}.default-container:hover .default-toolbar-container{visibility:visible}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;font-variant-ligatures:none;font-feature-settings:\"liga\" 0,none}.ProseMirror pre{white-space:pre-wrap}.ProseMirror li{position:relative}.ProseMirror-hideselection *::selection{background:transparent}.ProseMirror-hideselection *::-moz-selection{background:transparent}.ProseMirror-hideselection{caret-color:transparent}.ProseMirror-selectednode{outline:2px solid #8cf}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:\"\";position:absolute;left:-32px;right:-2px;top:-2px;bottom:-2px;border:2px solid #8cf;pointer-events:none}img.ProseMirror-separator{display:inline!important;border:none!important;margin:0!important}.ProseMirror .tableWrapper{overflow-x:auto}.ProseMirror table{border-collapse:collapse;table-layout:fixed;width:100%;overflow:hidden}.ProseMirror td,\n.ProseMirror th{vertical-align:top;box-sizing:border-box;position:relative}.ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;z-index:20;background-color:#adf;pointer-events:none}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}.ProseMirror .selectedCell:after{z-index:2;position:absolute;content:\"\";left:0;right:0;top:0;bottom:0;background:rgba(200,200,255,0.4);pointer-events:none}.milkdown-theme-nord blockquote{border-left-width:4px;--tw-border-opacity:1;border-color:rgb(94 129 172/var(--tw-border-opacity));padding-left:1rem;font-family:ui-serif,Georgia,Cambria,Times New Roman,Times,serif;font-style:normal}.milkdown-theme-nord code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-weight:400;--tw-text-opacity:1;color:rgb(94 129 172/var(--tw-text-opacity))}.milkdown-theme-nord pre code{color:inherit}.milkdown-theme-nord img{margin-top:0!important;margin-bottom:0!important;display:inline-block;max-width:100%}.milkdown-theme-nord.prose\n :where(blockquote):not(:where([class~=\"not-prose\"] *)){font-weight:400}.milkdown-theme-nord.prose\n :where(ol > li):not(:where([class~=\"not-prose\"] *))::marker,\n.milkdown-theme-nord.prose\n :where(ul > li):not(:where([class~=\"not-prose\"] *))::marker{--tw-text-opacity:1;color:rgb(94 129 172/var(--tw-text-opacity))}.milkdown-theme-nord.prose\n :where(blockquote p:first-of-type):not(:where([class~=\"not-prose\"] *)):before,\n.milkdown-theme-nord.prose\n :where(blockquote p:first-of-type):not(:where([class~=\"not-prose\"] *)):after{content:\"\"}.milkdown-theme-nord.prose\n :where(code):not(:where([class~=\"not-prose\"] *)):before,\n.milkdown-theme-nord.prose\n :where(code):not(:where([class~=\"not-prose\"] *)):after{content:\"\"}.milkdown-theme-nord.prose .tableWrapper{position:relative;margin-bottom:0.5rem;overflow-x:auto}.milkdown-theme-nord.prose table{font-size:0.875rem;line-height:1.25rem;--tw-shadow:0 4px 6px -1px rgb(0 0 0/0.1),0 2px 4px -2px rgb(0 0 0/0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}@media (min-width: 640px){.milkdown-theme-nord.prose table{border-radius:0.5rem}}.milkdown-theme-nord.prose td,\n.milkdown-theme-nord.prose th{padding:0.75rem 1.5rem!important}.milkdown-theme-nord.prose tr{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.dark .milkdown-theme-nord.prose tr{--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity))}.milkdown-theme-nord.prose :where(td, th) p{margin:0!important}.milkdown-theme-nord.prose :where(td, th):nth-child(odd){background-color:var(--color-fill-bg-base-1)}.dark .milkdown-theme-nord.prose :where(td, th):nth-child(odd){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}.milkdown-theme-nord.prose.ProseMirror .selectedCell:after{background-color:#88c0d04d}.milkdown-theme-nord.prose br[data-is-inline=\"true\"],\n.milkdown-theme-nord.prose br[data-is-inline=\"true\"]:after{content:\" \"}.prose{color:var(--color-normal-text)}.prose :where(p):not(:where([class~=\"not-prose\"] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=\"lead\"]):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=\"not-prose\"] *)){color:var(--color-info);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600}.prose :where(a strong):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(ol):not(:where([class~=\"not-prose\"] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol[type=\"A\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-alpha}.prose :where(ol[type=\"a\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-alpha}.prose :where(ol[type=\"A\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-alpha}.prose :where(ol[type=\"a\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-alpha}.prose :where(ol[type=\"I\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-roman}.prose :where(ol[type=\"i\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-roman}.prose :where(ol[type=\"I\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-roman}.prose :where(ol[type=\"i\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-roman}.prose :where(ol[type=\"1\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=\"not-prose\"] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol > li):not(:where([class~=\"not-prose\"] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul > li):not(:where([class~=\"not-prose\"] *))::marker{color:var(--tw-prose-bullets)}.prose :where(hr):not(:where([class~=\"not-prose\"] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=\"not-prose\"] *)){font-weight:500;font-style:italic;color:var(--color-auxiliary-text);border-left-width:0.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:\"\\\\201C\" \"\\\\201D\" \"\\\\2018\" \"\\\\2019\";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.prose\n :where(blockquote p:first-of-type):not(\n :where([class~=\"not-prose\"] *)\n )::before{content:open-quote}.prose\n :where(blockquote p:last-of-type):not(:where([class~=\"not-prose\"] *))::after{content:close-quote}.prose :where(h1):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:0.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=\"not-prose\"] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=\"not-prose\"] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:0.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=\"not-prose\"] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600;margin-top:1.5em;margin-bottom:0.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=\"not-prose\"] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=\"not-prose\"] *)){margin-top:2em;margin-bottom:2em}.prose :where(figure > *):not(:where([class~=\"not-prose\"] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-captions);font-size:0.875em;line-height:1.4285714;margin-top:0.8571429em}.prose :where(code):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-code);font-weight:600;font-size:0.875em}.prose :where(code):not(:where([class~=\"not-prose\"] *))::before{content:\"\\`\"}.prose :where(code):not(:where([class~=\"not-prose\"] *))::after{content:\"\\`\"}.prose :where(a code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(h1 code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(h2 code):not(:where([class~=\"not-prose\"] *)){color:inherit;font-size:0.875em}.prose :where(h3 code):not(:where([class~=\"not-prose\"] *)){color:inherit;font-size:0.9em}.prose :where(h4 code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(thead th code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(pre):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:0.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:0.375rem;padding-top:0.8571429em;padding-right:1.1428571em;padding-bottom:0.8571429em;padding-left:1.1428571em}.prose :where(pre code):not(:where([class~=\"not-prose\"] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=\"not-prose\"] *))::before{content:none}.prose :where(pre code):not(:where([class~=\"not-prose\"] *))::after{content:none}.prose :where(table):not(:where([class~=\"not-prose\"] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:0.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=\"not-prose\"] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600;vertical-align:bottom;padding-right:0.5714286em;padding-bottom:0.5714286em;padding-left:0.5714286em}.prose :where(tbody tr):not(:where([class~=\"not-prose\"] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=\"not-prose\"] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=\"not-prose\"] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=\"not-prose\"] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=\"not-prose\"] *)){vertical-align:top}.prose{--tw-prose-body:#374151;--tw-prose-headings:#111827;--tw-prose-lead:#4b5563;--tw-prose-links:#111827;--tw-prose-bold:#111827;--tw-prose-counters:#6b7280;--tw-prose-bullets:#d1d5db;--tw-prose-hr:#e5e7eb;--tw-prose-quotes:#111827;--tw-prose-quote-borders:#e5e7eb;--tw-prose-captions:#6b7280;--tw-prose-code:#111827;--tw-prose-pre-code:#e5e7eb;--tw-prose-pre-bg:#1f2937;--tw-prose-th-borders:#d1d5db;--tw-prose-td-borders:#e5e7eb;--tw-prose-invert-body:#d1d5db;--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:#9ca3af;--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:#9ca3af;--tw-prose-invert-bullets:#4b5563;--tw-prose-invert-hr:#374151;--tw-prose-invert-quotes:#f3f4f6;--tw-prose-invert-quote-borders:#374151;--tw-prose-invert-captions:#9ca3af;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:#d1d5db;--tw-prose-invert-pre-bg:rgb(0 0 0/50%);--tw-prose-invert-th-borders:#4b5563;--tw-prose-invert-td-borders:#374151;font-size:1rem;line-height:1.75}.prose :where(video):not(:where([class~=\"not-prose\"] *)){margin-top:2em;margin-bottom:2em}.prose :where(figure):not(:where([class~=\"not-prose\"] *)){margin-top:2em;margin-bottom:2em}.prose :where(li):not(:where([class~=\"not-prose\"] *)){margin-top:0.5em;margin-bottom:0.5em}.prose :where(ol > li):not(:where([class~=\"not-prose\"] *)){padding-left:0.375em}.prose :where(ul > li):not(:where([class~=\"not-prose\"] *)){padding-left:0.375em}.prose :where(.prose > ul > li p):not(:where([class~=\"not-prose\"] *)){margin-top:0.75em;margin-bottom:0.75em}.prose\n :where(.prose > ul > li > *:first-child):not(:where([class~=\"not-prose\"] *)){margin-top:1.25em}.prose\n :where(.prose > ul > li > *:last-child):not(:where([class~=\"not-prose\"] *)){margin-bottom:1.25em}.prose\n :where(.prose > ol > li > *:first-child):not(:where([class~=\"not-prose\"] *)){margin-top:1.25em}.prose\n :where(.prose > ol > li > *:last-child):not(:where([class~=\"not-prose\"] *)){margin-bottom:1.25em}.prose :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~=\"not-prose\"] *)){margin-top:0.75em;margin-bottom:0.75em}.prose :where(hr + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(h2 + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(h3 + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(h4 + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=\"not-prose\"] *)){padding-left:0}.prose :where(thead th:last-child):not(:where([class~=\"not-prose\"] *)){padding-right:0}.prose :where(tbody td, tfoot td):not(:where([class~=\"not-prose\"] *)){padding-top:0.5714286em;padding-right:0.5714286em;padding-bottom:0.5714286em;padding-left:0.5714286em}.prose\n :where(tbody td:first-child, tfoot td:first-child):not(\n :where([class~=\"not-prose\"] *)\n ){padding-left:0}.prose\n :where(tbody td:last-child, tfoot td:last-child):not(\n :where([class~=\"not-prose\"] *)\n ){padding-right:0}.prose :where(.prose > :first-child):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(.prose > :last-child):not(:where([class~=\"not-prose\"] *)){margin-bottom:0}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:-webkit-sticky;position:sticky}.isolate{isolation:isolate}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.\\\\!table{display:table!important}.table{display:table}.inline-table{display:inline-table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row-group{display:table-row-group}.table-row{display:table-row}.flow-root{display:flow-root}.grid{display:grid}.inline-grid{display:inline-grid}.contents{display:contents}.list-item{display:list-item}.hidden{display:none}.flex-shrink{flex-shrink:1}.shrink{flex-shrink:1}.flex-grow{flex-grow:1}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.\\\\!transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.flex-wrap{flex-wrap:wrap}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.break-all{word-break:break-all}.rounded{border-radius:0.25rem}.border{border-width:1px}.text-justify{text-align:justify}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.ordinal{--tw-ordinal:ordinal;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.lining-nums{--tw-numeric-figure:lining-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.underline{-webkit-text-decoration-line:underline;text-decoration-line:underline}.overline{-webkit-text-decoration-line:overline;text-decoration-line:overline}.line-through{-webkit-text-decoration-line:line-through;text-decoration-line:line-through}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0/0.1),0 1px 2px -1px rgb(0 0 0/0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.sepia{--tw-sepia:sepia(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4,0,0.2,1);transition-duration:150ms}.ease-in{transition-timing-function:cubic-bezier(0.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(0.4,0,0.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,0.2,1)}.milkdown{border-radius:0.25rem;margin:0;padding:0}.editor{margin-left:auto;margin-right:auto}:is(.dark .dark\\\\:prose-invert){--tw-prose-body:var(--tw-prose-invert-body);--tw-prose-headings:var(--tw-prose-invert-headings);--tw-prose-lead:var(--tw-prose-invert-lead);--tw-prose-links:var(--tw-prose-invert-links);--tw-prose-bold:var(--tw-prose-invert-bold);--tw-prose-counters:var(--tw-prose-invert-counters);--tw-prose-bullets:var(--tw-prose-invert-bullets);--tw-prose-hr:var(--tw-prose-invert-hr);--tw-prose-quotes:var(--tw-prose-invert-quotes);--tw-prose-quote-borders:var(--tw-prose-invert-quote-borders);--tw-prose-captions:var(--tw-prose-invert-captions);--tw-prose-code:var(--tw-prose-invert-code);--tw-prose-pre-code:var(--tw-prose-invert-pre-code);--tw-prose-pre-bg:var(--tw-prose-invert-pre-bg);--tw-prose-th-borders:var(--tw-prose-invert-th-borders);--tw-prose-td-borders:var(--tw-prose-invert-td-borders)}code[class*=\"language-\"],\npre[class*=\"language-\"]{color:#f8f8f2;background:none;font-family:\"Fira Code\",Consolas,Monaco,\"Andale Mono\",\"Ubuntu Mono\",monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none}pre[class*=\"language-\"]{padding:1em;margin:0.5em 0;overflow:auto;border-radius:0.3em}:not(pre) > code[class*=\"language-\"],\npre[class*=\"language-\"]{background:#2e3440}:not(pre) > code[class*=\"language-\"]{padding:0.1em;border-radius:0.3em;white-space:normal}.token.comment,\n.token.prolog,\n.token.doctype,\n.token.cdata{color:#636f88}.token.punctuation{color:#81a1c1}.namespace{opacity:0.7}.token.property,\n.token.tag,\n.token.constant,\n.token.symbol,\n.token.deleted{color:#81a1c1}.token.number{color:#b48ead}.token.boolean{color:#81a1c1}.token.selector,\n.token.attr-name,\n.token.string,\n.token.char,\n.token.builtin,\n.token.inserted{color:#a3be8c}.token.operator,\n.token.entity,\n.token.url,\n.language-css .token.string,\n.style .token.string,\n.token.variable{color:#81a1c1}.token.atrule,\n.token.attr-value,\n.token.function,\n.token.class-name{color:#88c0d0}.token.keyword{color:#81a1c1}.token.regex,\n.token.important{color:#ebcb8b}.token.important,\n.token.bold{font-weight:bold}.token.italic{font-style:italic}.token.entity{cursor:help}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.quick-answer-wrapper{margin-top:20px;border-radius:6px;border:1px solid var(--color-border-divider-line);padding:16px 24px}.quick-answer-wrapper .tip{font-size:18px;margin-bottom:30px}.quick-answer-wrapper .quick-answer-list{display:grid;grid-gap:24px 16px;gap:24px 16px;border-radius:3px;grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item{position:relative;padding:16px;border-radius:6px;cursor:pointer;display:flex;padding:10px 20px;gap:12px;width:auto;box-sizing:border-box}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item:hover{box-shadow:var(--quick-answer-card-item-hover)}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .left .icon{font-size:20px;color:#fff;padding:8px;border-radius:6px;margin-top:4px}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .content{flex:1;min-width:0}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .content .title{font-size:16px;font-weight:bold;color:var(--color-normal-text);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .content .description{color:var(--color-auxiliary-text);font-size:12px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.quick-answer-wrapper .show-more-wrapper{text-align:center;margin-top:20px}.quick-answer-wrapper .show-more-wrapper .show-more-btn{line-height:24px}.quick-answer-wrapper .show-more-wrapper .show-more-btn::after,\n .quick-answer-wrapper .show-more-wrapper .show-more-btn::before{content:\"- - - - -\";color:var(--color-text-divider-line);position:absolute}.quick-answer-wrapper .show-more-wrapper .show-more-btn::before{margin-left:-60px}.quick-answer-wrapper .show-more-wrapper .show-more-btn::after{margin-left:10px}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"../assets/loading.gif\", import.meta.url);\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\nvar ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.message-list-loading-wrapper{width:140px;height:140px;background-repeat:no-repeat;margin:auto;background-image:url(${___CSS_LOADER_URL_REPLACEMENT_0___})}.chart-item-loading-wrapper{display:flex;padding:10px;font-size:40px;align-items:center;justify-content:center;color:#d2d3d4;border-radius:6px}.chart-item-loading-wrapper .load{display:inline-block;position:relative;width:64px;height:64px}.chart-item-loading-wrapper .load div{position:absolute;top:27px;width:11px;height:11px;border-radius:50%;background:#aaa8a8;animation-timing-function:cubic-bezier(0,1,1,0)}.chart-item-loading-wrapper .load div:nth-child(1){left:6px;animation:load1 0.6s infinite}.chart-item-loading-wrapper .load div:nth-child(2){left:6px;animation:load2 0.6s infinite}.chart-item-loading-wrapper .load div:nth-child(3){left:26px;animation:load2 0.6s infinite}.chart-item-loading-wrapper .load div:nth-child(4){left:45px;animation:load3 0.6s infinite}@keyframes load1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes load2{0%{transform:translate(0,0)}100%{transform:translate(19px,0)}}@keyframes load3{0%{transform:scale(1)}100%{transform:scale(0)}}.common-loading-wrapper{text-align:center;font-size:30px;color:#ddd}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--message-box-bg:#f1f3f4;--search-input-icon-hover:#ddd;--quick-answer-card-item-hover:0px 7px 8px 0px rgba(0,0,0,0.15)}html[data-theme=\"dark\"],\nhtml[data-theme=\"dark-v2\"]{--message-box-bg:rgba(255,255,255,0.16);--search-input-icon-hover:#383838;--quick-answer-card-item-hover:0px 7px 8px 0px rgba(0,0,0,0.24)}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_0___ from \"-!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./styles.shadow.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_1___ from \"-!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./components/loading.shadow.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_2___ from \"-!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./components/MessageItem/Markdown/markdown.shadow.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_3___ from \"-!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./components/QuickAnswerList/quickAnswerList.shadow.css\";\nimport ___CSS_LOADER_AT_RULE_IMPORT_4___ from \"-!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./components/MessageItem/Markdown/CodeBlock/CodeBlock.shadow.css\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_2___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_3___);\n___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_4___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, ``, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"./assets/user.png\", import.meta.url);\nvar ___CSS_LOADER_URL_IMPORT_1___ = new URL(\"./assets/robot.png\", import.meta.url);\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\nvar ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);\nvar ___CSS_LOADER_URL_REPLACEMENT_1___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_1___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host{display:block;height:100%}:host([hidden]){display:none}@media only screen and (min-width: 1920px){.chat-view-container .chat-view-content .chat-view .message-list{width:1556px}.chat-view-container .chat-view-content .search-input-box{width:1556px}}@media only screen and (min-width: 1440px) and (max-width: 1920px){.chat-view-container .chat-view-content .chat-view .message-list{width:1156px}.chat-view-container .chat-view-content .search-input-box{width:1156px}}@media only screen and (min-width: 804px) and (max-width: 1440px){.chat-view-container .chat-view-content .chat-view .message-list{width:804px}.chat-view-container .chat-view-content .search-input-box{width:804px}}@media only screen and (max-width: 804px){.chat-view-container .chat-view-content .chat-view .message-list{width:100%}.chat-view-container .chat-view-content .search-input-box{width:100%}}.chat-view-container{display:flex;flex-direction:row;width:100%;height:100%}.chat-view-selector{width:200px;padding:14px;border-right:1px solid var(--color-border-divider-line)}.chat-view-content{flex:1;display:flex;flex-direction:column;width:100%;gap:8px}.chat-view-content .chat-view-toolbar{background:#e0e4e5;padding:18px;display:flex;justify-content:space-between;align-items:center}.chat-view-content .chat-view-toolbar .username{color:#333333;font-weight:500;line-height:22px;font-size:16px}.chat-view-content .chat-view{max-width:100%;position:relative;display:flex;flex:1;flex-direction:column;box-sizing:border-box;overflow-y:auto}.session-list-wrapper{display:flex;flex-direction:column;height:100%}.session-list-wrapper .session-title{font-size:16px;color:var(--color-header-text);margin-bottom:16px}.session-list-wrapper .session-list{overflow-y:auto}.session-list-wrapper .session-list .session-item{display:flex;justify-content:space-between;cursor:pointer;border-radius:var(--small-border-radius);background-color:var(--third-menu-default-bg);padding:6px 16px;color:var(--color-header-text);margin-top:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-list-wrapper .session-list .session-item .content{width:0;flex:1}.session-list-wrapper .session-list .session-item .content .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-list-wrapper .session-list .session-item:hover .session-close-btn eo-icon{display:block}.session-list-wrapper .session-list .session-item:first-child{margin-top:0px}.session-list-wrapper .session-list .session-item.active{background-color:var(--third-menu-item-selected-bg);color:var(--color-brand)}.session-list-wrapper .session-list .session-item:hover,\n .session-list-wrapper .session-list .session-item.active:hover{color:var(--color-header-text);background-color:var(--third-menu-item-hover-bg)}.session-list-wrapper .session-list .session-item .session-close-btn{display:flex;align-items:center;cursor:pointer;font-size:12px}.session-list-wrapper .session-list .session-item .session-close-btn:hover{color:var(--color-error)}.session-list-wrapper .session-list .session-item .session-close-btn eo-icon{display:none}.message-list{display:flex;flex-direction:column;padding-bottom:30px;padding:12px;flex:1;margin:0 auto;max-width:100%;box-sizing:border-box}.message-list .message-list-box{display:flex;flex-direction:column;position:relative;gap:36px}.message-list .message-list-box .message-item{display:flex;gap:8px;padding-right:40px}.message-list .message-list-box .message-item.user{flex-direction:row-reverse;padding:0;padding-left:40px}.message-list .message-list-box .message-item.user .message-box{margin-bottom:0;overflow:hidden}.message-list .message-list-box .message-item.user .message-box .message-top{flex-direction:row-reverse}.message-list .message-list-box .message-item.user .message-box .message-content{justify-content:end}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper{display:flex;flex-direction:row-reverse}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper .content{background-color:#606f7c;color:#fff}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper .content .ProseMirror.prose{color:#fff}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper:hover .content-tip{display:block}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper .content-tip{display:none}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper .content-tip eo-icon{padding:4px;color:#606f7c;cursor:pointer}.message-list .message-list-box .message-item .avatar{width:36px;height:36px;margin-top:32px;border-radius:50%;font-size:20px;display:flex;align-items:center;justify-content:center}.message-list .message-list-box .message-item .avatar.user{background-image:url(${___CSS_LOADER_URL_REPLACEMENT_0___})}.message-list .message-list-box .message-item .avatar.robot{background-image:url(${___CSS_LOADER_URL_REPLACEMENT_1___})}.message-list .message-list-box .message-item .message-box{position:relative;flex:1;overflow:hidden}.message-list .message-list-box .message-item .message-box .message-content{display:flex;justify-content:start;position:relative}.message-list .message-list-box .message-item .message-box .message-content .wrapper{position:relative;overflow:hidden}.message-list .message-list-box .message-item .message-box .message-content .wrapper .content{position:relative;padding:14px;border-radius:6px;overflow:hidden;background:var(--message-box-bg)}.message-list .message-list-box .message-item .message-box .message-content .wrapper .content .text-item{white-space:pre-wrap}.message-list .message-list-box .message-item .message-box .message-content .wrapper .message-toolbar{display:flex;gap:12px;justify-content:end;margin-top:4px}.message-list .message-list-box .message-item .message-box .message-content .wrapper .message-toolbar eo-icon{cursor:pointer;color:#606f7c}.message-list .message-list-box .message-item .message-box .message-content .wrapper .message-toolbar eo-icon.active{color:var(--color-brand)}.message-list .message-list-box .message-item .message-box .message-content .wrapper .message-toolbar .split{width:1px;height:16px;background-color:#d9d9d9;margin-bottom:1px}.message-list .message-list-box .message-item .message-box .message-top{display:flex;margin-bottom:4px;color:#bec8ce;gap:8px}.message-list .message-list-box .message-item .message-box .message-top .time{min-height:22px}.message-list .message-list-box .stop-responding-wrapper{position:absolute;left:44px;bottom:-28px}.search-input-box{display:flex;flex-direction:column;height:75px;padding:12px;position:relative;margin:0 auto;max-width:100%;box-sizing:border-box}.search-input-box .mentions-list-wrapper{position:absolute;bottom:100%;left:12px;right:12px}.search-input-box .mentions-list-wrapper .content{background-color:var(--antd-input-bg);border-radius:6px;border:1px solid var(--palette-gray-4);padding:8px}.search-input-box .mentions-list-wrapper .content .mentions-title{font-size:14px;font-weight:bold;color:var(--color-strong-text);padding-bottom:8px}.search-input-box .mentions-list-wrapper .content .mentions-list{display:flex;flex-direction:column;gap:8px;max-height:300px;overflow-y:auto}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item{display:flex;flex-direction:row;align-items:center;gap:12px;padding:8px;border-radius:6px;cursor:pointer}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item .icon{font-size:18px;padding:8px;border-radius:50%}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item .name{color:var(--color-normal-text)}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item .description{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--color-disabled-text)}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item:hover,\n .search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item.active{background:var(--palette-gray-3)}.search-input-box.fill-content{border-top:1px solid rgba(197,197,197,0.5)}.search-input-box .input-box{position:absolute;bottom:20px;left:12px;right:12px;display:inline-flex;padding:var(--input-affix-wrapper-padding);border-radius:var(--small-border-radius);height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;color:var(--text-color-default);background-color:var(--antd-input-bg);border:1px solid var(--color-border-divider-line);transition:border-color 0.3s;overflow:visible}.search-input-box .input-box.active{border-color:var(--antd-input-focus-border-color)}.search-input-box .input-box.disabled{pointer-events:none;background:var(--input-outline-disabled);cursor:not-allowed}.search-input-box .input-box.expand textarea{padding-right:50px;margin-bottom:50px}.search-input-box .input-box textarea{width:100%;height:22px;font-size:18px;resize:none;padding:10px 50px 10px 10px;outline:none;border:none;line-height:20px;color:var(--color-normal-text);background-color:transparent;cursor:inherit;transition:all 300ms ease-out;box-sizing:content-box}.search-input-box .input-box textarea::placeholder{color:#b0b1b8}.search-input-box .input-box .suffix-icon{display:flex;align-items:center;gap:8px;position:absolute;right:12px;bottom:6px}.search-input-box .input-box .suffix-icon eo-tooltip{display:flex}.search-input-box .input-box .suffix-icon eo-icon{font-size:20px;cursor:pointer;padding:6px;border-radius:3px}.search-input-box .input-box .suffix-icon eo-icon:not(.disabled):hover{background:var(--search-input-icon-hover)}.search-input-box .input-box .suffix-icon .submit-split{width:1px;height:20px;background:#d1d1d1}.search-input-box .input-box .suffix-icon .submit-btn.active{color:var(--color-brand)}.search-input-box .input-box .suffix-icon .submit-btn.disabled{color:var(--color-disabled-text);cursor:not-allowed}.search-input-box .input-box .toolbar-icon{position:absolute;top:12px;right:14px}.search-input-box .input-box .toolbar-icon eo-icon{font-size:20px;cursor:pointer;padding:6px;border-radius:3px}.search-input-box .input-box .toolbar-icon eo-icon:hover{background:var(--search-input-icon-hover)}.search-input-box .search-input-toolbar{display:flex;justify-content:end;position:absolute;right:12px;bottom:0px}.search-input-box .search-input-toolbar .input-tip{font-size:12px;color:var(--color-secondary-text)}.message-start-tip,\n.session-end-tip{color:var(--color-disabled-text);font-size:12px;text-align:center;margin-top:12px;position:relative}.message-start-tip::after,\n .session-end-tip::after,\n .message-start-tip::before,\n .session-end-tip::before{content:\"- - -\";color:var(--color-disabled-text);position:absolute}.message-start-tip::before, .session-end-tip::before{margin-left:-35px}.message-start-tip::after, .session-end-tip::after{margin-left:10px}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./host-context.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./host-context.css\";\n export default content && content.locals ? content.locals : undefined;\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./index.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./index.css\";\n export default content && content.locals ? content.locals : undefined;\n"],"names":["ChatViewContext","createContext","useChatViewContext","useContext","WrappedIcon","wrapBrick","MessageListLoading","React","className","ChatItemLoading","CommonLoading","icon","lib","spinning","Avatar","_ref","role","agentId","isUser","useMemo","quickAnswerConfig","agentList","_quickAnswerConfig$li","list","matchAgent","find","item","id","_extends","style","color","concat","background","WrappedLink","GuideItem","text","prompts","map","index","key","ProgressText","renderText","replace","MsgItemContext","CustomComponent","_ref2","language","commandBricks","chatting","conversationId","taskId","parseData","isError","cahceTextRef","useRef","isEnd","setIsEnd","useState","setIsError","setParseData","useEffect","current","data","JSON","parse","_unused","match","useData","commandBrickConf","config","_objectSpread","component","ReactUseMultipleBricks","useBrick","showOriginData","copyIcon","theme","CodeBlock","setLanguage","contentRef","node","view","useNodeViewContext","messageApi","contextHolder","message","useMessage","handleCopy","_asyncToGenerator","_node$content$firstCh","content","firstChild","navigator","clipboard","writeText","success","err","console","error","apply","arguments","defaultContent","spellCheck","ref","position","Tooltip","title","arrow","onClick","cursor","renderContent","_node$firstChild","_node$firstChild2","textContent","dom","classList","contains","attrs","MarkdownItem","MilkdownProvider","ProsemirrorAdapterProvider","MarkdownDisplay","value","nodeViewFactory","useNodeViewFactory","get","useEditor","root","Editor","make","ctx","set","rootCtx","update","editorViewOptionsCtx","prev","editable","handleClickOn","pos","handleClick","url","found","state","tr","doc","nodeAt","marks","length","path","mark","m","type","name","href","startsWith","encodeURIComponent","window","open","defaultValueCtx","MutationObserver","Array","from","querySelectorAll","forEach","link","onclick","observe","childList","subtree","nord","use","prism","gfm","commonmark","$view","codeBlockSchema","_get","undefined","action","replaceAll","Milkdown","TableItem","TextItem","WrapperIcon","WrappedToolTip","copyToClipboard","unwrapProvider","showNotification","Toolbar","tag","isAssistant","isChattingItem","showLike","readonly","handleIsLike","handleLikeOrIsLike","useCallback","islike","result","_x","hoist","classNames","active","isLike","then","catch","Time","time","moment","format","ContentTip","setSearchStr","NOT_AGENT_MATCH","MessageNode","props","created","getContentNode","examplePrompts","messageNode","Provider","CARD_ITEM_HEIGHT","HEIGHT_GAP","QuickAnswerCardItem","description","starterPrompts","iconColor","_icon$color","height","handleCardClick","category","QuickAnswerList","_quickAnswerConfig$ti","msgList","loading","showMoreBtn","setShowMoreBtn","listRef","hadClickShowMoreBtn","element","observer","ResizeObserver","entries","entry","contentRect","disconnect","tip","maxHeight","overflow","instanceId","handleShowMoreClick","StopBtn","stopChat","handleStopChat","DEFAULT_OFFSET_HEIGHT","CACHE_HEIGHT","MessageList","showAvatar","chatViewRef","messgetListBoxRef","preHeight","setPreHeight","isCustomScroll","msgLoading","msgEnd","activeSessionId","checkSession","getMsgItemNode","user","msgListNode","handleScroll","messageList","scrollHeight","clientHeight","scrollTop","isBottom","debounceHandleScroll","debounce","newHeight","scroll","top","Number","MAX_SAFE_INTEGER","Math","max","onScroll","hiddenTextarea","HIDDEN_TEXTAREA_STYLE","SIZING_STYLE","PREFIX_WORD","SearchInput","setValue","setActive","expand","setExpand","autoSizeStyle","setAutoSizeStyle","isFillContent","setIsFillContent","mentionOpen","setMentionOpen","matchPrefixIndex","setMatchPrefixIndex","matchAgentList","setMatchMentionList","matchMentionsIndex","setMatchMentionsIndex","mentionsRef","searchInputBoxRef","textareaRef","hadExpanded","inputEndRef","searchStr","createSession","handleChat","setAgent","hadValue","defaultSize","disabled","matchPrefixInfo","textareaElement","currentFocusIndex","selectionStart","matchWord","i","test","start","end","word","handleAgentItemSelect","valueList","split","trimName","focusIndex","splice","join","setTimeout","selectionEnd","focus","isShowMentions","mentions","slice","computedAutoSize","size","textareaStyles","uiTextNode","minRows","maxRows","document","createElement","setAttribute","body","appendChild","uiTextNodeStyle","getComputedStyle","sizingStyle","getPropertyValue","placeholder","minHeight","singleRowHeight","min","overflowY","resize","calculateAutoSizeStyle","handleChange","e","target","handleExpand","matchFirstAgent","regex","exec","agent","handleSubmit","blur","handleKeyDown","shiftKey","preventDefault","handleKeyUp","selectionIndex","prefixWord","lastIndexOf","indexOf","_textareaRef$current","trim","searchInputBox","width","currentWidth","getBoundingClientRect","_textareaRef$current2","filterList","filter","includes","querySelector","scrollIntoView","block","handleDocumentClick","mentionsElemnt","composedPath","addEventListener","removeEventListener","paddingRight","onFocus","onBlur","onChange","onKeyDown","onKeyUpCapture","onCompositionStart","handleCompositionStart","onCompositionEnd","handleCompositionEnd","hanldeCreateSession","showDialog","SESSION_ITEM_HEIGHT","BUFFER_NUMBER","SessionList","sessionEnd","sessionLoading","sessionList","querySessionHistory","sessionWrapperRef","sessionListRef","limit","sessionWrapper","floor","checkSessionList","SessionItem","deleteSession","handleCheckSession","handleDeleteSession","stopPropagation","expect","_debug","WeakMap","_ctrl","_agentId","_enterInterval","_charting","_isStartEmitEvent","_emitTimer","_messageQueue","_subscribers","_conversationId","_sessionNextToken","_cacheLimit","_messageNextToken","_ChatService_brand","WeakSet","ChatService","constructor","enterInterval","debug","_classPrivateMethodInitSpec","_classPrivateFieldInitSpec","_classPrivateFieldSet","this","enqueue","_classPrivateFieldGet","push","_assertClassBrand","_startEmitEvent","call","dequeue","shift","getMessageQueue","subscribe","topic","callback","unsubscribe","cb","notifySubscribers","setChatItemIsLike","flag","code","http","request","getBasePath","method","stringify","setAgentId","setConversationId","getSessionHistory","_this","_classPrivateFieldGet2","conversations","next_token","_unused2","getChatHistory","_this2","_unused3","conversationIds","_unused4","splitWord","str","Intl","iterator","Segmenter","granularity","segment","Symbol","nextWord","next","done","customSplit","cache","matchStr","substring","chat","_this3","AbortController","hadMatchMessage","fetchEventSource","signal","input","stream","headers","onopen","response","ok","log","onmessage","msg","_unused5","delta","abort","onclose","onerror","stop","_classPrivateFieldGet3","clearInterval","_clear","setInterval","messageItem","NEW_SESSION_ID","useChatViewInfo","sessionId","setSessionEnd","setSessionLoading","setActiveSessionId","setLoading","setChatting","setSessionList","setMsgLoading","setMsgEnd","setMsgList","chatingText","chatingMessageItem","chatService","defaultNewSessionItem","preList","newList","unshift","output","inputTime","computedList","_ref3","ids","filterIds","deleteActiveSession","hasNewOne","_x2","_ref4","_x3","_ref5","_x4","_ref6","_x5","_x6","handleSessionEnd","listener","msgItem","pop","reset","finishListener","fetchEndListener","stopListener","stopMessageItem","___CSS_LOADER_EXPORT___","module","___CSS_LOADER_URL_IMPORT_0___","URL","___CSS_LOADER_URL_REPLACEMENT_0___","___CSS_LOADER_URL_IMPORT_1___","___CSS_LOADER_URL_REPLACEMENT_1___","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals"],"sourceRoot":""}
|