@next-bricks/ai-portal 0.54.0 → 0.55.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/bricks.json +34 -33
  2. package/dist/chunks/1080.c0cb398b.js +2 -0
  3. package/dist/chunks/1080.c0cb398b.js.map +1 -0
  4. package/dist/chunks/1864.4bd403fd.js +2 -0
  5. package/dist/chunks/1864.4bd403fd.js.map +1 -0
  6. package/dist/chunks/{2084.0e9751e7.js → 2084.778e8126.js} +3 -3
  7. package/dist/chunks/2084.778e8126.js.map +1 -0
  8. package/dist/chunks/2761.561a580a.js +2 -0
  9. package/dist/chunks/2761.561a580a.js.map +1 -0
  10. package/dist/chunks/3227.77ba4968.js +2 -0
  11. package/dist/chunks/3227.77ba4968.js.map +1 -0
  12. package/dist/chunks/4888.42dd29a2.js +3 -0
  13. package/dist/chunks/4888.42dd29a2.js.map +1 -0
  14. package/dist/chunks/{6593.1afe9a04.js → 6593.58eda50f.js} +2 -2
  15. package/dist/chunks/6593.58eda50f.js.map +1 -0
  16. package/dist/chunks/7279.af201b60.js +3 -0
  17. package/dist/chunks/{6947.1cec7258.js.LICENSE.txt → 7279.af201b60.js.LICENSE.txt} +0 -6
  18. package/dist/chunks/7279.af201b60.js.map +1 -0
  19. package/dist/chunks/8717.462ca5c9.js +2 -0
  20. package/dist/chunks/8717.462ca5c9.js.map +1 -0
  21. package/dist/chunks/9388.e48bb229.js +2 -0
  22. package/dist/chunks/9388.e48bb229.js.map +1 -0
  23. package/dist/chunks/chat-box.8e064684.js +2 -0
  24. package/dist/chunks/chat-box.8e064684.js.map +1 -0
  25. package/dist/chunks/chat-input.dd3d2035.js +2 -0
  26. package/dist/chunks/chat-input.dd3d2035.js.map +1 -0
  27. package/dist/chunks/{cruise-canvas.60fa24a3.js → cruise-canvas.c494563b.js} +2 -2
  28. package/dist/chunks/{cruise-canvas.60fa24a3.js.map → cruise-canvas.c494563b.js.map} +1 -1
  29. package/dist/chunks/elevo-card.49b42ed0.js +3 -0
  30. package/dist/chunks/elevo-card.49b42ed0.js.map +1 -0
  31. package/dist/chunks/flow-tabs.ce40cc92.js +2 -0
  32. package/dist/chunks/flow-tabs.ce40cc92.js.map +1 -0
  33. package/dist/chunks/main.9f2b6ec7.js +2 -0
  34. package/dist/chunks/main.9f2b6ec7.js.map +1 -0
  35. package/dist/chunks/stage-flow.4c7ea7d9.js +2 -0
  36. package/dist/chunks/stage-flow.4c7ea7d9.js.map +1 -0
  37. package/dist/examples.json +16 -16
  38. package/dist/images/0e7e6764.png +0 -0
  39. package/dist/images/7944ebaf.png +0 -0
  40. package/dist/images/c7ec12fe.png +0 -0
  41. package/dist/index.fe56261d.js +2 -0
  42. package/dist/index.fe56261d.js.map +1 -0
  43. package/dist/manifest.json +309 -295
  44. package/dist/types.json +1167 -1024
  45. package/dist-types/chat-box/FileListComponent.d.ts +8 -0
  46. package/dist-types/chat-box/UploadButton.d.ts +9 -0
  47. package/dist-types/chat-box/bricks.d.ts +8 -0
  48. package/dist-types/chat-box/index.d.ts +3 -0
  49. package/dist-types/chat-box/interfaces.d.ts +8 -0
  50. package/dist-types/chat-stream/UserMessage/UserMessage.d.ts +3 -1
  51. package/dist-types/chat-stream/interfaces.d.ts +2 -1
  52. package/dist-types/cruise-canvas/NodeRequirement/NodeRequirement.d.ts +3 -1
  53. package/dist-types/cruise-canvas/interfaces.d.ts +2 -1
  54. package/dist-types/shared/ReadableCommand/ReadableCommand.d.ts +7 -0
  55. package/dist-types/shared/interfaces.d.ts +3 -0
  56. package/dist-types/stage-flow/index.d.ts +2 -0
  57. package/package.json +2 -2
  58. package/dist/chunks/1334.aae33a33.js +0 -2
  59. package/dist/chunks/1334.aae33a33.js.map +0 -1
  60. package/dist/chunks/2084.0e9751e7.js.map +0 -1
  61. package/dist/chunks/2142.0599aecd.js +0 -2
  62. package/dist/chunks/2142.0599aecd.js.map +0 -1
  63. package/dist/chunks/3020.acf9607e.js +0 -2
  64. package/dist/chunks/3020.acf9607e.js.map +0 -1
  65. package/dist/chunks/6201.610c66e3.js +0 -2
  66. package/dist/chunks/6201.610c66e3.js.map +0 -1
  67. package/dist/chunks/6593.1afe9a04.js.map +0 -1
  68. package/dist/chunks/6947.1cec7258.js +0 -3
  69. package/dist/chunks/6947.1cec7258.js.map +0 -1
  70. package/dist/chunks/7713.278cfb8b.js +0 -2
  71. package/dist/chunks/7713.278cfb8b.js.map +0 -1
  72. package/dist/chunks/8717.1e5ad2b1.js +0 -2
  73. package/dist/chunks/8717.1e5ad2b1.js.map +0 -1
  74. package/dist/chunks/chat-box.279647b5.js +0 -2
  75. package/dist/chunks/chat-box.279647b5.js.map +0 -1
  76. package/dist/chunks/chat-input.b09e4ba0.js +0 -3
  77. package/dist/chunks/chat-input.b09e4ba0.js.map +0 -1
  78. package/dist/chunks/elevo-card.731505e0.js +0 -3
  79. package/dist/chunks/elevo-card.731505e0.js.map +0 -1
  80. package/dist/chunks/flow-tabs.222a11ea.js +0 -3
  81. package/dist/chunks/flow-tabs.222a11ea.js.LICENSE.txt +0 -5
  82. package/dist/chunks/flow-tabs.222a11ea.js.map +0 -1
  83. package/dist/chunks/main.72d51c8f.js +0 -2
  84. package/dist/chunks/main.72d51c8f.js.map +0 -1
  85. package/dist/chunks/stage-flow.1ece0479.js +0 -2
  86. package/dist/chunks/stage-flow.1ece0479.js.map +0 -1
  87. package/dist/index.6e1371ec.js +0 -2
  88. package/dist/index.6e1371ec.js.map +0 -1
  89. /package/dist/chunks/{2084.0e9751e7.js.LICENSE.txt → 2084.778e8126.js.LICENSE.txt} +0 -0
  90. /package/dist/chunks/{chat-input.b09e4ba0.js.LICENSE.txt → 4888.42dd29a2.js.LICENSE.txt} +0 -0
  91. /package/dist/chunks/{elevo-card.731505e0.js.LICENSE.txt → elevo-card.49b42ed0.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunks/1864.4bd403fd.js","mappings":"gMAKA,MAAMA,E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EAAME,eAAe,GAAGC,WACvBH,EAAME,eACJC,WACLH,EAAMI,YAAYjG,MACtB,QACwB3E,IAAtByK,GACAA,IAAsBL,EACtB,CACA,MAAMS,GAAaT,EACnBA,EAAqBK,EAChBI,GACHC,sBAAsBvC,EAE1B,CACF,CACF,IAGF,OADA8B,EAASU,QAAQZ,GACV,KACLE,EAASW,YAAY,CACtB,GACA,CAACjE,EAAYM,EAAckB,IAG5BnJ,EAAAA,cAAA,YAAA+F,EAAAA,EAAAA,GAAA,GACM2C,EAAK,CACTnJ,IAAKqJ,EACL/H,MAAOA,EACPsH,MAAO,IACFA,KACAU,GAELrJ,SAhHFY,IAEAuI,EAASvI,EAAEE,OAAOO,OAClBrB,SAAAA,EAAWY,EAAE,EA8GXoI,mBAAoB6B,EACpB5B,iBAAkB6B,EAClB/B,UAAWgC,IAGjB,C","sources":["webpack:///./src/chat-box/UploadButton.tsx","webpack:///./src/chat-box/i18n.ts","webpack:///./src/chat-box/bricks.ts","webpack:///./src/chat-box/styles.shadow.css","webpack:///../../src/getCaretPositionInTextarea.ts","webpack:///../../../src/utils/getMirroredStyle.ts","webpack:///../../src/getContentRectsInTextarea.ts","webpack:///./src/chat-box/FileListComponent.tsx","webpack:///../../../src/utils/calculateAutoSizeStyle.ts","webpack:///../../src/TextareaAutoResize.tsx"],"sourcesContent":["import React, { forwardRef, useImperativeHandle, useRef } from \"react\";\nimport type { GeneralIconProps } from \"@next-bricks/icons/general-icon\";\nimport { WrappedIconButton } from \"./bricks\";\nimport type { FileItem } from \"./interfaces\";\n\nconst ICON_UPLOAD: GeneralIconProps = {\n lib: \"lucide\",\n icon: \"paperclip\",\n};\n\nlet uid = 0;\n\nexport interface UploadButtonProps {\n onChange?: (files: FileItem[] | undefined) => void;\n}\n\nexport interface UploadButtonRef {\n requestUpload: () => void;\n}\n\nexport const UploadButton = forwardRef(LegacyUploadButton);\n\nfunction LegacyUploadButton(\n { onChange }: UploadButtonProps,\n ref: React.Ref<UploadButtonRef>\n) {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const files = e.target.files;\n onChange?.(\n files\n ? Array.from(files).map((file) => ({\n uid: uid++,\n file,\n status: \"ready\",\n }))\n : undefined\n );\n e.target.value = \"\";\n };\n\n useImperativeHandle(ref, () => ({\n requestUpload: () => {\n inputRef.current?.click();\n },\n }));\n\n return (\n <>\n <input\n type=\"file\"\n multiple\n hidden\n ref={inputRef}\n onChange={handleInputChange}\n />\n <WrappedIconButton\n variant=\"light\"\n className=\"btn-upload\"\n icon={ICON_UPLOAD}\n tooltip=\"Upload files\"\n onClick={() => inputRef.current?.click()}\n />\n </>\n );\n}\n","import { i18n } from \"@next-core/i18n\";\n\nexport enum K {\n ASK_ANY_THING = \"ASK_ANYTHING\",\n COMMON_TASKS = \"COMMON_TASKS\",\n}\n\nconst en: Locale = {\n [K.ASK_ANY_THING]: \"Ask anything\",\n [K.COMMON_TASKS]: \"Common tasks\",\n};\n\nconst zh: Locale = {\n [K.ASK_ANY_THING]: \"询问任何问题\",\n [K.COMMON_TASKS]: \"常用任务\",\n};\n\nexport const NS = \"bricks/ai-portal/chat-box\";\n\nexport const locales = { en, zh };\n\nexport const t = i18n.getFixedT(null, NS);\n\ntype Locale = { [k in K]: string } & {\n [k in K as `${k}_plural`]?: string;\n};\n","import { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport type {\n ActionsEvents,\n ActionsEventsMapping,\n ActionsProps,\n EoActions,\n} from \"@next-bricks/basic/actions\";\nimport type { IconButton, IconButtonProps } from \"../icon-button\";\n\nexport const WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nexport const WrappedActions = wrapBrick<\n EoActions,\n ActionsProps & { activeKeys?: (string | number)[] },\n ActionsEvents,\n ActionsEventsMapping\n>(\"eo-actions\", {\n onActionClick: \"action.click\",\n onItemDragEnd: \"item.drag.end\",\n onItemDragStart: \"item.drag.start\",\n});\nexport const WrappedIconButton = wrapBrick<IconButton, IconButtonProps>(\n \"ai-portal.icon-button\"\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\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"./images/bg.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___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.root{color:#262626;background:url(${___CSS_LOADER_URL_REPLACEMENT_0___}) no-repeat center bottom;background-size:100% 104px;padding:12px 12px 29px;margin:0 -12px}.container{position:relative;background:#ffffff;box-shadow:0px 2px 4px 0px rgba(38,45,65,0.1);border-radius:16px;border:1px solid #dadfe8}.container:has(textarea:focus){border-color:#b7c3d8}textarea{display:block;width:100%;padding:10px 16px 50px;color:var(--antd-input-color);border-radius:16px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,0.5);font:inherit;font-size:14px;line-height:22px;height:120px}textarea::placeholder{color:rgba(0,0,0,0.4)}button:focus,\ntextarea:focus{outline:none}button{margin:0;padding:0;font:inherit;background:none;border:none}.actions-bar{position:absolute;bottom:12px;left:14px;right:14px;display:flex;align-items:flex-end;justify-content:space-between;gap:6px}.btn-send{width:28px;height:28px;display:flex;align-items:center;justify-content:center;background:var(--elevo-color-brand);border:none;border-radius:8px;color:#fff;flex-shrink:0}.btn-send[disabled]{background:rgba(0,0,0,0.15)}.btn-send:not([disabled]){cursor:pointer}.btn-send:not([disabled]):hover{background:#5166ff}.btn-send:not([disabled]):active{background:#1e33cc}.mention-overlay{position:absolute;border-radius:4px;pointer-events:none;background:rgba(38,45,65,0.1)}.buttons{display:flex;align-items:center;gap:12px}.btn-divider{width:1px;height:16px;background:rgba(0,0,0,0.1)}.files{list-style:none;margin:0;padding:4px 0 0;position:absolute;display:flex;gap:8px;top:10px;left:16px;right:16px;overflow-x:auto}.file{background:rgba(0,0,0,0.04);border-radius:8px;display:flex;width:200px;height:60px;align-items:center;padding:0 8px;position:relative}.file-content{min-width:0;flex:1}.file-icon{margin:0 11px 0 6px}.file-image{margin-right:8px;object-fit:cover;border-radius:4px;max-width:44px;max-height:44px}.file-name,\n.file-metadata{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-name{color:rgba(0,0,0,0.88)}.file-metadata{color:rgba(0,0,0,0.45);font-size:12px;margin-top:3px}.file-remove{position:absolute;top:-4px;right:-4px;font-size:12px;padding:1px;display:flex;color:rgba(0,0,0,0.88);cursor:pointer;background:#fff;border-radius:14px}.file:not(:hover) .file-remove{display:none}.btn-add-file{border-radius:8px;border:1px dashed rgba(0,0,0,0.1);color:rgba(0,0,0,0.45);font-size:16px;display:flex;width:60px;height:60px;align-items:center;justify-content:center;cursor:pointer}.btn-add-file:hover{background:rgba(0,0,0,0.04)}.file.failed .file-status{color:var(--color-error)}.file.as-image{width:60px;border:1px solid rgba(0,0,0,0.1);padding:0;background:none;justify-content:center}.file.as-image .file-image{max-width:100%;max-height:100%;margin:0;border-radius:6px}.file.as-image.failed{border-color:#f24c25}.file-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,10,26,0.45);border-radius:6px;color:#fff;display:flex;align-items:center;justify-content:center;text-align:center;font-size:20px}.file.failed .file-overlay{color:#ff754f;font-size:12px}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","import { getMirroredStyle } from \"./utils/getMirroredStyle.js\";\n\nlet hiddenElement: HTMLDivElement | undefined;\n\nexport function getCaretPositionInTextarea(\n textarea: HTMLTextAreaElement,\n index: number\n) {\n if (!hiddenElement) {\n hiddenElement = document.createElement(\"div\");\n hiddenElement.setAttribute(\"tab-index\", \"-1\");\n hiddenElement.setAttribute(\"aria-hidden\", \"true\");\n document.body.appendChild(hiddenElement);\n }\n\n hiddenElement.setAttribute(\"style\", getMirroredStyle(textarea));\n hiddenElement.textContent = textarea.value.slice(0, index);\n\n const span = document.createElement(\"span\");\n span.textContent = \"\\u200b\"; // 占位符\n hiddenElement.appendChild(span);\n\n const rect = span.getBoundingClientRect();\n span.remove();\n return {\n top: rect.top,\n left: rect.left,\n };\n}\n","const HIDDEN_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 left: 0!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];\n\n/**\n * 创建一个镜像元素,用于计算光标位置或文本尺寸。\n */\nexport function getMirroredStyle(element: HTMLElement) {\n const uiTextNodeStyle = window.getComputedStyle(element);\n const sizingStyle = SIZING_STYLE.map(\n (name) => `${name}:${uiTextNodeStyle.getPropertyValue(name)}`\n ).join(\";\");\n return `${sizingStyle};${HIDDEN_STYLE}`;\n}\n","import { getMirroredStyle } from \"./utils/getMirroredStyle.js\";\n\nlet hiddenElement: HTMLDivElement | undefined;\n\nexport function getContentRectsInTextarea(\n textarea: HTMLTextAreaElement,\n prefix: string,\n measureContent: string\n): DOMRect[] {\n if (!hiddenElement) {\n hiddenElement = document.createElement(\"div\");\n hiddenElement.setAttribute(\"tab-index\", \"-1\");\n hiddenElement.setAttribute(\"aria-hidden\", \"true\");\n document.body.appendChild(hiddenElement);\n }\n hiddenElement.setAttribute(\"style\", getMirroredStyle(textarea));\n\n hiddenElement.textContent = prefix;\n\n const span = document.createElement(\"span\");\n span.textContent = measureContent;\n hiddenElement.appendChild(span);\n\n const fullRect = span.getBoundingClientRect();\n span.remove();\n\n if (measureContent.length <= 1) {\n return [fullRect];\n }\n\n const leadingChar = measureContent[0];\n const leadingSpan = document.createElement(\"span\");\n leadingSpan.textContent = leadingChar;\n hiddenElement.appendChild(leadingSpan);\n const leadingRect = leadingSpan.getBoundingClientRect();\n leadingSpan.remove();\n\n hiddenElement.textContent = `${prefix}${measureContent.slice(0, -1)}`;\n const trailingChar = measureContent[measureContent.length - 1];\n const trailingSpan = document.createElement(\"span\");\n trailingSpan.textContent = trailingChar;\n hiddenElement.appendChild(trailingSpan);\n const trailingRect = trailingSpan.getBoundingClientRect();\n trailingSpan.remove();\n\n if (leadingRect.top === trailingRect.top) {\n return [fullRect];\n }\n\n const rects: DOMRect[] = [];\n\n // Leading rect\n rects.push(\n new DOMRect(\n leadingRect.left,\n leadingRect.top,\n fullRect.right - leadingRect.left,\n leadingRect.bottom - leadingRect.top\n )\n );\n\n // Middle rect\n const height = trailingRect.top - leadingRect.bottom;\n if (height >= 10) {\n rects.push(\n new DOMRect(fullRect.left, leadingRect.bottom, fullRect.width, height)\n );\n }\n\n // Trailing rect\n rects.push(\n new DOMRect(\n fullRect.left,\n trailingRect.top,\n trailingRect.right - fullRect.left,\n trailingRect.bottom - trailingRect.top\n )\n );\n\n return rects;\n}\n","import React, { useEffect, useState } from \"react\";\nimport classNames from \"classnames\";\nimport { WrappedIcon } from \"./bricks\";\nimport type { FileItem } from \"./interfaces\";\nimport {\n formatFileSize,\n getFileTypeAndIcon,\n} from \"../cruise-canvas/utils/file\";\n\nexport interface FileListComponentProps {\n files: FileItem[];\n onRemove: (uid: number, abortController: AbortController | undefined) => void;\n onAdd: () => void;\n}\n\nexport function FileListComponent({\n files,\n onRemove,\n onAdd,\n}: FileListComponentProps) {\n const showAsImage = files.every((file) =>\n file.file.type.startsWith(\"image/\")\n );\n\n return (\n <ul className=\"files\">\n {files.map((file) => (\n <FileComponent\n {...file}\n key={file.uid}\n showAsImage={showAsImage}\n onRemove={onRemove}\n />\n ))}\n <li>\n <button className=\"btn-add-file\" onClick={onAdd}>\n <WrappedIcon lib=\"antd\" icon=\"plus\" />\n </button>\n </li>\n </ul>\n );\n}\n\ninterface FileComponentProps extends FileItem {\n showAsImage?: boolean;\n onRemove: (uid: number, abortController: AbortController | undefined) => void;\n}\n\nfunction FileComponent({\n uid,\n file,\n status,\n abortController,\n showAsImage,\n onRemove,\n}: FileComponentProps) {\n const [type, icon] = getFileTypeAndIcon(file.type, file.name);\n const size = formatFileSize(file.size);\n const isImage = file.type.startsWith(\"image/\");\n const [image, setImage] = useState<string | undefined>();\n\n useEffect(() => {\n if (isImage) {\n const url = URL.createObjectURL(file);\n setImage(url);\n return () => {\n URL.revokeObjectURL(url);\n };\n } else {\n setImage(undefined);\n }\n }, [file, isImage]);\n\n const buttonRemove = (\n <button\n className=\"file-remove\"\n onClick={() => {\n onRemove(uid, abortController);\n }}\n >\n <WrappedIcon lib=\"antd\" theme=\"filled\" icon=\"close-circle\" />\n </button>\n );\n\n if (showAsImage) {\n return (\n <li\n className={classNames(\"file as-image\", { failed: status === \"failed\" })}\n >\n <img className=\"file-image\" src={image} />\n {status === \"uploading\" && (\n <div className=\"file-overlay\">\n <WrappedIcon lib=\"antd\" icon=\"loading-3-quarters\" spinning />\n </div>\n )}\n {status === \"failed\" && (\n <div className=\"file-overlay\">Upload failed</div>\n )}\n {buttonRemove}\n </li>\n );\n }\n\n return (\n <li className={classNames(\"file\", { failed: status === \"failed\" })}>\n {isImage ? (\n <img className=\"file-image\" src={image} />\n ) : (\n <img className=\"file-icon\" src={icon} width={26} height={32} />\n )}\n <div className=\"file-content\">\n <div className=\"file-name\">{file.name}</div>\n <div className=\"file-metadata\">\n <span className=\"file-status\">\n {`${status === \"uploading\" ? \"Uploading...\" : status === \"failed\" ? \"Upload failed\" : type}`}\n </span>\n {` · ${size}`}\n </div>\n </div>\n {buttonRemove}\n </li>\n );\n}\n","// istanbul ignore file\nimport type React from \"react\";\nimport { getMirroredStyle } from \"./getMirroredStyle.js\";\n\nlet hiddenTextarea: HTMLTextAreaElement | undefined;\n\nexport interface AutoSizeOptions {\n minRows?: number | null;\n maxRows?: number | null;\n borderSize?: number;\n paddingSize?: number;\n}\n\n/**\n * 计算 textarea 高度\n * https://github.com/react-component/textarea/blob/1c0026fbe30e5f7dff1fca695b2cf262246381ca/src/calculateNodeHeight.tsx\n */\nexport default function calculateAutoSizeStyle(\n uiTextNode: HTMLTextAreaElement,\n options?: AutoSizeOptions\n): React.CSSProperties {\n const {\n minRows = null,\n maxRows = null,\n borderSize = 2,\n paddingSize = 8,\n } = options ?? {};\n\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 // equal style\n hiddenTextarea.setAttribute(\"style\", getMirroredStyle(uiTextNode));\n hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || \"\";\n\n let minHeight: number | undefined;\n let maxHeight: number | undefined;\n let overflowY: React.CSSProperties[\"overflowY\"];\n\n let height = hiddenTextarea.scrollHeight + borderSize;\n\n if (minRows !== null || maxRows !== null) {\n const singleRowHeight =\n process.env.NODE_ENV === \"test\"\n ? 22\n : parseFloat(\n window\n .getComputedStyle(hiddenTextarea)\n .getPropertyValue(\"line-height\")\n );\n if (minRows !== null) {\n minHeight = singleRowHeight * minRows + paddingSize + borderSize;\n height = Math.max(minHeight, height);\n }\n if (maxRows !== null) {\n maxHeight = singleRowHeight * maxRows + paddingSize + borderSize;\n if (height <= maxHeight) {\n overflowY = \"hidden\";\n }\n height = Math.min(maxHeight, height);\n }\n }\n\n const style: React.CSSProperties = {\n height,\n overflowY,\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 useCallback,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\nimport { flushSync } from \"react-dom\";\nimport ResizeObserver from \"resize-observer-polyfill\";\nimport calculateAutoSizeStyle from \"./utils/calculateAutoSizeStyle.js\";\n\n// istanbul ignore next\nconst modKey = /Mac|iPod|iPhone|iPad/.test(navigator.platform)\n ? \"metaKey\"\n : \"ctrlKey\";\n\nexport interface TextareaAutoResizeProps\n extends React.DetailedHTMLProps<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n HTMLTextAreaElement\n > {\n /** @default true */\n autoResize?: boolean;\n minRows?: number | null;\n maxRows?: number | null;\n /** @default 2 */\n borderSize?: number;\n /** @default 8 */\n paddingSize?: number;\n containerRef?: React.RefObject<HTMLElement>;\n submitWhen?: \"enter-without-shift\" | \"enter-with-mod\";\n desiredSelectionRef?: React.MutableRefObject<{\n start: number;\n end: number;\n } | null>;\n onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\n /**\n * The handler can return false to prevent default behavior (submit)\n */\n onKeyDown?: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void | false;\n}\n\nexport interface TextareaAutoResizeRef {\n focus(): void;\n element: HTMLTextAreaElement | null;\n}\n\nexport const TextareaAutoResize = React.forwardRef<\n TextareaAutoResizeRef,\n TextareaAutoResizeProps\n>(LegacyTextareaAutoResize);\n\nfunction LegacyTextareaAutoResize(\n {\n autoResize: _autoResize,\n minRows,\n maxRows,\n borderSize,\n paddingSize,\n containerRef,\n value: propValue,\n style,\n submitWhen,\n desiredSelectionRef,\n onChange,\n onSubmit,\n onKeyDown,\n onCompositionStart,\n onCompositionEnd,\n ...props\n }: TextareaAutoResizeProps,\n ref: React.ForwardedRef<TextareaAutoResizeRef>\n): React.JSX.Element {\n const autoResize = _autoResize ?? true;\n const [value, setValue] = useState(propValue ?? \"\");\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const [autoStyle, setAutoStyle] = useState<React.CSSProperties | null>(null);\n\n useImperativeHandle(\n ref,\n () => ({\n focus: () => {\n const textarea = textareaRef.current;\n // istanbul ignore else: defensive check\n if (textarea) {\n const valueLength = textarea.value?.length;\n textarea.focus();\n valueLength && textarea.setSelectionRange(valueLength, valueLength);\n }\n },\n element: textareaRef.current,\n }),\n []\n );\n\n const doAutoResize = useCallback(() => {\n const textarea = textareaRef.current;\n if (textarea && autoResize) {\n const style = calculateAutoSizeStyle(textarea, {\n minRows,\n maxRows,\n borderSize,\n paddingSize,\n });\n // istanbul ignore next\n if (process.env.NODE_ENV === \"test\") {\n setAutoStyle(style);\n } else {\n flushSync(() => {\n setAutoStyle(style);\n });\n }\n }\n }, [autoResize, maxRows, minRows, borderSize, paddingSize]);\n\n const handleInputChange = (\n e: React.ChangeEvent<HTMLTextAreaElement>\n ): void => {\n setValue(e.target.value);\n onChange?.(e);\n };\n\n useEffect(() => {\n setValue(propValue ?? \"\");\n }, [propValue]);\n\n useEffect(() => {\n doAutoResize();\n }, [doAutoResize, value]);\n\n const compositionRef = useRef(false);\n\n const handleCompositionStart = useCallback(\n (e: React.CompositionEvent<HTMLTextAreaElement>) => {\n compositionRef.current = true;\n onCompositionStart?.(e);\n },\n [onCompositionStart]\n );\n\n const handleCompositionEnd = useCallback(\n (e: React.CompositionEvent<HTMLTextAreaElement>) => {\n compositionRef.current = false;\n onCompositionEnd?.(e);\n },\n [onCompositionEnd]\n );\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (compositionRef.current) {\n // Ignore key events during composition\n return;\n }\n\n if (onKeyDown?.(e) === false) {\n return;\n }\n\n if (\n e.key === \"Enter\" &&\n (submitWhen === \"enter-without-shift\"\n ? !e.shiftKey\n : submitWhen === \"enter-with-mod\" && e[modKey])\n ) {\n e.preventDefault();\n e.stopPropagation();\n onSubmit?.(e);\n }\n },\n [onKeyDown, onSubmit, submitWhen]\n );\n\n useLayoutEffect(() => {\n const desiredSelection = desiredSelectionRef?.current;\n const textarea = textareaRef.current;\n if (desiredSelection && textarea) {\n const { start, end } = desiredSelection;\n desiredSelectionRef.current = null;\n textarea.setSelectionRange(start, end);\n }\n }, [desiredSelectionRef, value]);\n\n // istanbul ignore next\n useEffect(() => {\n const container = containerRef?.current;\n if (!container || !autoResize) {\n return;\n }\n let previousInlineSize: number | undefined;\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (entry.target === container) {\n // istanbul ignore next: compatibility\n const currentInlineSize = entry.contentBoxSize\n ? entry.contentBoxSize[0]\n ? entry.contentBoxSize[0].inlineSize\n : (entry.contentBoxSize as unknown as ResizeObserverSize)\n .inlineSize\n : entry.contentRect.width;\n if (\n currentInlineSize !== undefined &&\n currentInlineSize !== previousInlineSize\n ) {\n const isInitial = !previousInlineSize;\n previousInlineSize = currentInlineSize;\n if (!isInitial) {\n requestAnimationFrame(doAutoResize);\n }\n }\n }\n }\n });\n observer.observe(container);\n return () => {\n observer.disconnect();\n };\n }, [autoResize, containerRef, doAutoResize]);\n\n return (\n <textarea\n {...props}\n ref={textareaRef}\n value={value}\n style={{\n ...style,\n ...autoStyle,\n }}\n onChange={handleInputChange}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n onKeyDown={handleKeyDown}\n />\n );\n}\n"],"names":["ICON_UPLOAD","lib","icon","uid","UploadButton","forwardRef","LegacyUploadButton","_ref","ref","onChange","inputRef","useRef","useImperativeHandle","requestUpload","_inputRef$current","current","click","React","type","multiple","hidden","e","files","target","Array","from","map","file","status","undefined","value","WrappedIconButton","variant","className","tooltip","onClick","_inputRef$current2","K","en","ASK_ANY_THING","COMMON_TASKS","zh","NS","locales","t","i18n","getFixedT","WrappedIcon","wrapBrick","WrappedActions","onActionClick","onItemDragEnd","onItemDragStart","___CSS_LOADER_URL_IMPORT_0___","URL","___CSS_LOADER_EXPORT___","___CSS_LOADER_URL_REPLACEMENT_0___","push","module","id","toString","hiddenElement","getCaretPositionInTextarea","textarea","index","document","createElement","setAttribute","body","appendChild","getMirroredStyle","textContent","slice","span","rect","getBoundingClientRect","remove","top","left","HIDDEN_STYLE","SIZING_STYLE","element","uiTextNodeStyle","window","getComputedStyle","name","getPropertyValue","join","getContentRectsInTextarea","prefix","measureContent","fullRect","length","leadingChar","leadingSpan","leadingRect","trailingChar","trailingSpan","trailingRect","rects","DOMRect","right","bottom","height","width","FileListComponent","onRemove","onAdd","showAsImage","every","startsWith","FileComponent","_extends","key","_ref2","abortController","getFileTypeAndIcon","size","formatFileSize","isImage","image","setImage","useState","useEffect","url","createObjectURL","revokeObjectURL","buttonRemove","theme","classNames","failed","src","spinning","hiddenTextarea","modKey","test","navigator","platform","TextareaAutoResize","LegacyTextareaAutoResize","autoResize","_autoResize","minRows","maxRows","borderSize","paddingSize","containerRef","propValue","style","submitWhen","desiredSelectionRef","onSubmit","onKeyDown","onCompositionStart","onCompositionEnd","props","setValue","textareaRef","autoStyle","setAutoStyle","focus","_textarea$value","valueLength","setSelectionRange","doAutoResize","useCallback","uiTextNode","options","minHeight","maxHeight","overflowY","placeholder","scrollHeight","singleRowHeight","parseFloat","Math","max","min","resize","calculateAutoSizeStyle","flushSync","compositionRef","handleCompositionStart","handleCompositionEnd","handleKeyDown","shiftKey","preventDefault","stopPropagation","useLayoutEffect","desiredSelection","start","end","container","previousInlineSize","observer","ResizeObserver","entries","entry","currentInlineSize","contentBoxSize","inlineSize","contentRect","isInitial","requestAnimationFrame","observe","disconnect"],"sourceRoot":""}
@@ -1,3 +1,3 @@
1
- /*! For license information please see 2084.0e9751e7.js.LICENSE.txt */
2
- "use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[2084],{5813:(e,t,i)=>{i.d(t,{I:()=>s,K:()=>o,NS:()=>l,t:()=>c});var n=i(52616);let o=function(e){return e.NEW_CHAT="NEW_CHAT",e.LOGOUT="LOGOUT",e.TODAY="TODAY",e.YESTERDAY="YESTERDAY",e.PREVIOUS_7_DAYS="PREVIOUS_7_DAYS",e.PREVIOUS_30_DAYS="PREVIOUS_30_DAYS",e.SWITCH_LANGUAGE="SWITCH_LANGUAGE",e.MY="MY",e.PROJECTS="PROJECTS",e.HISTORY="HISTORY",e.CREATE_PROJECT="CREATE_PROJECT",e.MOVE_TO_PROJECT="MOVE_TO_PROJECT",e.UNTITLED="UNTITLED",e.UNNAMED="UNNAMED",e}({});const r={[o.NEW_CHAT]:"New chat",[o.LOGOUT]:"Logout",[o.TODAY]:"Today",[o.YESTERDAY]:"Yesterday",[o.PREVIOUS_7_DAYS]:"Previous 7 days",[o.PREVIOUS_30_DAYS]:"Previous 30 days",[o.SWITCH_LANGUAGE]:"中文",[o.MY]:"My",[o.PROJECTS]:"Projects",[o.HISTORY]:"Chats",[o.CREATE_PROJECT]:"Create project",[o.MOVE_TO_PROJECT]:"Move to project",[o.UNTITLED]:"Untitled",[o.UNNAMED]:"Unnamed"},a={[o.NEW_CHAT]:"新对话",[o.LOGOUT]:"登出",[o.TODAY]:"今天",[o.YESTERDAY]:"昨天",[o.PREVIOUS_7_DAYS]:"过去7天",[o.PREVIOUS_30_DAYS]:"过去30天",[o.SWITCH_LANGUAGE]:"English",[o.MY]:"我的",[o.PROJECTS]:"项目",[o.HISTORY]:"对话",[o.CREATE_PROJECT]:"创建项目",[o.MOVE_TO_PROJECT]:"移动到项目",[o.UNTITLED]:"无标题",[o.UNNAMED]:"未命名"},l="bricks/ai-portal/elevo-sidebar",s={en:r,zh:a},c=n.i18n.getFixedT(null,l)},61408:(e,t,i)=>{i.d(t,{A:()=>l});var n=i(36758),o=i.n(n),r=i(40935),a=i.n(r)()(o());a.push([e.id,':host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.sidebar{position:relative;z-index:2;width:260px;height:100%;background:rgba(246,247,249,0.5);border:1px solid rgba(255,255,255,0.3);border-radius:12px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:23px 11px 0;display:flex;flex-direction:column;transition:transform 0.3s ease-in-out}.logo-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px;margin-left:4px}.logo-link::part(link){display:block}.logo{vertical-align:middle}.new-chat::part(link){display:flex;gap:0;align-items:center;color:var(--elevo-color-brand);font-size:14px;text-align:left;cursor:pointer}.sidebar .new-chat::part(link){background:#f0f4ff;border-radius:8px;border:1px solid #c9d7ff;padding:9px 13px;font-weight:500;margin-bottom:16px}.sidebar .new-chat::part(link):hover{background:rgba(201,215,255,0.5)}.new-chat-icon{font-size:16px;margin-right:5px}.footer{border-top:1px solid rgba(0,0,0,0.04);padding:9px 12px;margin:0 -12px}.dropdown{display:block}.account{background:none;border:none;border-radius:8px;padding:6px 10px;display:block;width:100%;text-align:left;cursor:pointer}.account:hover{background:rgba(0,0,0,0.04)}.alternative{position:fixed;top:12px;left:8px;padding:6px 10px 6px 8px;display:flex;align-items:center;opacity:0;z-index:2;transition:opacity 0.2s ease-in-out;background:rgba(255,255,255,0);border-radius:8px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.alternative .new-chat::part(link){padding:4px;margin-left:16px;font-size:12px}.alternative .new-chat::part(link):hover{color:#7891ff}.alternative .new-chat::part(link):active{color:#0911b3}.container{width:270px;padding:10px 0 10px 10px;height:100%;transition:width 0.3s ease-in-out,padding 0.3s ease-in-out}.container.collapsed{width:0;padding:10px 0;overflow:visible}.container.collapsed .sidebar{transform:translateX(-100%)}.container.collapsed .alternative{opacity:1}:host([behavior="drawer"]){z-index:2;width:0}:host(:not([behavior="drawer"])) .alternative .new-chat{display:none}.mask{position:fixed;top:0;right:0;bottom:0;left:0}.links{border-bottom:1px solid rgba(0,0,0,0.06);padding-bottom:16px;margin-bottom:16px}.link{display:block}.link + .link{margin-top:4px}.link::part(link){display:flex;gap:0;align-items:center;padding:7px 10px;border-radius:8px;color:#000}.link.active::part(link),.link::part(link):hover{background:rgba(0,0,0,0.04)}.link .icon{font-size:16px;margin-right:10px}.link .title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history{flex:1;min-height:0;overflow-y:auto;margin:0 -12px;padding:0 12px}.history ul{list-style:none;margin:0;padding:0}.history .section + .section{margin-top:14px}.history .section-title{display:flex;align-items:center;justify-content:space-between;height:30px;margin-bottom:6px;padding:0 8px;position:sticky;top:0}.history .section-title.sticky::before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgb(229,228,234);border-radius:8px;z-index:-1}.history .section-label{display:flex;align-items:center;height:24px;padding:0 8px;margin-left:-8px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;font-size:12px;color:#8c8c8c;border-radius:8px}.history .section-label eo-icon{vertical-align:middle;margin-left:6px;transition:transform 0.2s ease-in-out}.history .section-label:hover{background:rgba(0,0,0,0.04)}.history .collapsed > ul{display:none}.history .collapsed .section-label eo-icon{transform:rotate(-90deg)}.history .error,.history .loading{display:flex;align-items:center;height:36px;padding:0 8px}.history .loading{justify-content:center}.history .error{color:var(--color-error)}.history .group + .group{margin-top:15px}.history .group-title{font-weight:500;font-size:12px;color:#000;padding:8px;height:36px;line-height:20px}.history .item{display:block}.history .item::part(link){display:flex;align-items:center;padding:0 8px;height:36px;border-radius:8px;color:#000}.history .item.active::part(link){background:rgba(0,0,0,0.06)}.history .item.actions-active::part(link),.history .item::part(link):hover{background:rgba(0,0,0,0.04)}.history .item-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history .actions{cursor:auto}.history .item:not(:hover):not(.actions-active) .actions{display:none}.history .working{width:8px;height:8px;border-radius:8px;background:var(--elevo-color-brand);margin:0 7px}.history .item.actions-active .working,.history .item:hover .working,.history .item.active .working{display:none}.history .load-more{display:flex;justify-content:center;align-items:center;height:36px}.button{display:flex}',""]);const l=a.toString()},70579:(e,t,i)=>{i.d(t,{Bj:()=>o,EM:()=>r,JQ:()=>l,Py:()=>c,qb:()=>a,qu:()=>s});var n=i(30981);const o=(0,n.wrapBrick)("eo-icon"),r=(0,n.wrapBrick)("eo-link"),a=(0,n.wrapBrick)("eo-dropdown-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),l=(0,n.wrapBrick)("eo-easyops-avatar"),s=(0,n.wrapBrick)("eo-mini-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),c=(0,n.wrapBrick)("ai-portal.icon-button")},75197:(e,t,i)=>{i.d(t,{D:()=>b});var n=i(89575),o=i(18769),r=i.n(o),a=i(53373),l=i.n(a),s=i(22919);const c=async(e,t)=>(await s.http.get("api/gateway/logic.llm.aiops_service/api/v1/elevo/conversations",{...t,params:e})).data;var d=i(41030),p=i(5813),u=i(70579),m=i(40177),g=i(65549),h=i(94504);const E={lib:"fa",icon:"plus"},b=(0,o.forwardRef)(x);function x(e,t){let{historyActions:i,historyUrlTemplate:a,projectUrlTemplate:b,projectActions:x,canAddProject:v,myLinks:k,onActionClick:y,onHistoryClick:T,onProjectActionClick:w,onAddProject:O}=e;const A=(0,o.useRef)(null),[C,S]=(0,o.useState)(!1),[_,N]=(0,o.useState)(null),[R,I]=(0,o.useState)(!1),[P,U]=(0,o.useState)(!1),[Y,D]=(0,o.useState)(null),[j,M]=(0,o.useState)(!1),[L,V]=(0,o.useState)(),[H,B]=(0,o.useState)(),[J,z]=(0,o.useState)(!1),G=(0,o.useRef)(!0),[q,K]=(0,o.useState)([]),W=(0,o.useMemo)((()=>[...null!=i?i:[],{isDropdown:!0,text:(0,p.t)(p.K.MOVE_TO_PROJECT),disabled:!(null!=_&&_.length),items:null==_?void 0:_.map((e=>({event:"move",key:e.instanceId,text:e.name,project:e})))}]),[i,_]);(0,o.useEffect)((()=>{(async()=>{try{const e=await(async()=>(await s.http.get("api/gateway/logic.llm.aiops_service/api/v1/elevo/projects",{params:{page:1,page_size:3e3}})).data)();N(e.list)}catch(e){console.error("Error loading projects:",e),U(!0),N([])}})()}),[]),(0,o.useEffect)((()=>{Promise.all([c({token:H,limit:30,onlyOwner:!0,onlyUnrelatedProject:!0},{interceptorParams:{ignoreLoadingBar:!0}}),...G.current?[]:[new Promise((e=>setTimeout(e,500)))]]).then((e=>{let[t]=e;G.current=!1,D((e=>[...null!=e?e:[],...t.conversations])),V(t.nextToken)})).catch((e=>{console.error("Error loading chat history:",e),D([]),z(!0)}))}),[H]);const[Q,F]=(0,o.useState)(null),X=(0,o.useRef)(null);(0,o.useEffect)((()=>{const e=X.current,t=A.current;if(!e||!L||!t||j)return;const i=new IntersectionObserver((e=>{for(const t of e)t.isIntersecting&&B(L)}),{root:t});return i.observe(e),()=>{i.disconnect()}}),[L,j]);const Z=(0,o.useRef)(0),$=(0,o.useCallback)((async()=>{try{const e=++Z.current,t=await c({limit:30,onlyOwner:!0,onlyUnrelatedProject:!0},{interceptorParams:{ignoreLoadingBar:!0}});if(e!==Z.current)return;D((e=>{const i=null!=e?e:[],n=t.conversations,o=new Set(n.map((e=>e.conversationId))),r=new Map(n.map((e=>[e.conversationId,e])));let a=!1,l=!1,s=!0;for(const e of i){const t=r.get(e.conversationId);if(!t)break;if(a=!0,l=s&&t!==n[0]||!(0,d.isEqual)(t,e),l)break;s=!1}return a?l?[...n,...i.filter((e=>!o.has(e.conversationId)))]:e:(V(t.nextToken),n)}))}catch(e){console.error("Error pulling chat history:",e)}}),[]);(0,o.useImperativeHandle)(t,(()=>({pull:$,removeProject:e=>{N((t=>t?t.filter((t=>t.instanceId!==e)):t))},addProject:e=>{N((t=>t?[...t,e]:[e]))},moveConversation:e=>{K((t=>[...t,e]))}})),[$]);const ee=(0,o.useMemo)((()=>Y&&Y.length?Y.filter((e=>!q.includes(e.conversationId))):Y),[Y,q]);return r().createElement("div",{className:"history",ref:A},null!=k&&k.length?r().createElement("div",{className:l()("section",{collapsed:C})},r().createElement(f,{rootRef:A,title:(0,p.t)(p.K.MY),onToggle:()=>S((e=>!e))}),r().createElement("ul",{className:"items"},k.map(((e,t)=>r().createElement("li",{key:t},r().createElement(h.k,{url:e.url,activeIncludes:e.activeIncludes,render:t=>{let{active:i}=t;return r().createElement(u.EM,{className:l()("item",{active:i}),url:e.url},r().createElement("div",{className:"item-title"},e.title))}})))))):null,r().createElement("div",{className:l()("section",{collapsed:R})},r().createElement(f,{rootRef:A,title:(0,p.t)(p.K.PROJECTS),onToggle:()=>I((e=>!e))},v&&r().createElement(u.Py,{icon:E,variant:"mini-light",tooltip:(0,p.t)(p.K.CREATE_PROJECT),tooltipHoist:!0,className:"button",onClick:O})),r().createElement("ul",{className:"items"},P?r().createElement("li",{className:"error"},"Failed to load project"):_?_.map((e=>{const t=b?(0,g.Q)(b,e):void 0;return r().createElement("li",{key:e.instanceId},r().createElement(h.k,{url:t,render:i=>{let{active:o}=i;return r().createElement(u.EM,(0,n.A)({className:l()("item",{"actions-active":e.instanceId===Q,active:o}),onClick:T},t?{url:t}:null),r().createElement("div",{className:"item-title",title:e.name},e.name||(0,p.t)(p.K.UNNAMED)),r().createElement(u.qu,{className:"actions",actions:x,themeVariant:"elevo",onActionClick:t=>{w({action:t.detail,project:e})},onVisibleChange:t=>{F(t.detail?e.instanceId:null)}}))}}))})):r().createElement("li",{className:"loading"},r().createElement(u.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})))),r().createElement("div",{className:l()("section",{collapsed:j})},r().createElement(f,{rootRef:A,title:(0,p.t)(p.K.HISTORY),onToggle:()=>M((e=>!e))}),r().createElement("ul",{className:"items"},ee?ee.map((e=>{const t=a?(0,g.Q)(a,e):void 0;return r().createElement("li",{key:e.conversationId},r().createElement(h.k,{url:t,render:t=>{let{active:i}=t;return r().createElement(u.EM,(0,n.A)({className:l()("item",{"actions-active":e.conversationId===Q,active:i}),onClick:T},a?{url:(0,g.Q)(a,e)}:null),r().createElement("div",{className:"item-title",title:e.title},e.title||(0,p.t)(p.K.UNTITLED)),r().createElement(u.qu,{className:"actions",actions:W,onActionClick:t=>{y({action:t.detail,item:e})},onVisibleChange:t=>{F(t.detail?e.conversationId:null)}}),!m.QB.includes(e.state)&&r().createElement("div",{className:"working"}))}}))})):r().createElement("li",{className:"loading"},r().createElement(u.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})),J?r().createElement("li",{className:"error"},"Failed to load chat history"):null),!j&&L&&r().createElement("div",{className:"load-more",ref:X},r().createElement(u.Bj,{lib:"antd",icon:"loading-3-quarters",spinning:!0}))))}function f(e){let{rootRef:t,title:i,children:n,onToggle:a}=e;const s=(0,o.useRef)(null),[c,p]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{const e=t.current,i=s.current,n=null==i?void 0:i.nextElementSibling;if(!e||!i||!n)return;const o=(0,d.throttle)((()=>{const e=i.getBoundingClientRect(),t=n.getBoundingClientRect().top-e.top-e.height;p(t<1)}),100);return e.addEventListener("scroll",o),()=>{e.removeEventListener("scroll",o)}}),[t]),r().createElement("div",{className:l()("section-title",{sticky:c}),ref:s},r().createElement("div",{className:"section-label",onClick:a},i,r().createElement(u.Bj,{lib:"fa",icon:"angle-down"})),n)}},94504:(e,t,i)=>{i.d(t,{k:()=>r});var n=i(18769),o=i(30348);function r(e){let{url:t,activeIncludes:i,render:r}=e;const[a,l]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{function e(e){if(t){for(const n of[t,...null!=i?i:[]])if((0,o.matchPath)(e.pathname,{path:n,exact:!1}))return void l(!0);l(!1)}else l(!1)}const n=(0,o.getHistory)();return e(n.location),n.listen(e)}),[t,i]),r({active:a})}}}]);
3
- //# sourceMappingURL=2084.0e9751e7.js.map
1
+ /*! For license information please see 2084.778e8126.js.LICENSE.txt */
2
+ "use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[2084],{5813:(e,t,i)=>{i.d(t,{I:()=>s,K:()=>o,NS:()=>l,t:()=>c});var n=i(52616);let o=function(e){return e.NEW_CHAT="NEW_CHAT",e.LOGOUT="LOGOUT",e.TODAY="TODAY",e.YESTERDAY="YESTERDAY",e.PREVIOUS_7_DAYS="PREVIOUS_7_DAYS",e.PREVIOUS_30_DAYS="PREVIOUS_30_DAYS",e.SWITCH_LANGUAGE="SWITCH_LANGUAGE",e.MY="MY",e.PROJECTS="PROJECTS",e.HISTORY="HISTORY",e.CREATE_PROJECT="CREATE_PROJECT",e.MOVE_TO_PROJECT="MOVE_TO_PROJECT",e.UNTITLED="UNTITLED",e.UNNAMED="UNNAMED",e}({});const r={[o.NEW_CHAT]:"New chat",[o.LOGOUT]:"Logout",[o.TODAY]:"Today",[o.YESTERDAY]:"Yesterday",[o.PREVIOUS_7_DAYS]:"Previous 7 days",[o.PREVIOUS_30_DAYS]:"Previous 30 days",[o.SWITCH_LANGUAGE]:"中文",[o.MY]:"My",[o.PROJECTS]:"Projects",[o.HISTORY]:"Chats",[o.CREATE_PROJECT]:"Create project",[o.MOVE_TO_PROJECT]:"Move to project",[o.UNTITLED]:"Untitled",[o.UNNAMED]:"Unnamed"},a={[o.NEW_CHAT]:"新对话",[o.LOGOUT]:"登出",[o.TODAY]:"今天",[o.YESTERDAY]:"昨天",[o.PREVIOUS_7_DAYS]:"过去7天",[o.PREVIOUS_30_DAYS]:"过去30天",[o.SWITCH_LANGUAGE]:"English",[o.MY]:"我的",[o.PROJECTS]:"项目",[o.HISTORY]:"对话",[o.CREATE_PROJECT]:"创建项目",[o.MOVE_TO_PROJECT]:"移动到项目",[o.UNTITLED]:"无标题",[o.UNNAMED]:"未命名"},l="bricks/ai-portal/elevo-sidebar",s={en:r,zh:a},c=n.i18n.getFixedT(null,l)},61408:(e,t,i)=>{i.d(t,{A:()=>l});var n=i(36758),o=i.n(n),r=i(40935),a=i.n(r)()(o());a.push([e.id,':host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.sidebar{position:relative;z-index:2;width:260px;height:100%;background:rgba(246,247,249,0.5);border:1px solid rgba(255,255,255,0.3);border-radius:12px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:23px 11px 0;display:flex;flex-direction:column;transition:transform 0.3s ease-in-out}.logo-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px;margin-left:4px}.logo-link::part(link){display:block}.logo{vertical-align:middle}.new-chat::part(link){display:flex;gap:0;align-items:center;color:var(--elevo-color-brand);font-size:14px;text-align:left;cursor:pointer}.sidebar .new-chat::part(link){background:#f0f4ff;border-radius:8px;border:1px solid #c9d7ff;padding:9px 13px;font-weight:500;margin-bottom:16px}.sidebar .new-chat::part(link):hover{background:rgba(201,215,255,0.5)}.new-chat-icon{font-size:16px;margin-right:5px}.footer{border-top:1px solid rgba(0,0,0,0.04);padding:9px 12px;margin:0 -12px}.dropdown{display:block}.account{background:none;border:none;border-radius:8px;padding:6px 10px;display:block;width:100%;text-align:left;cursor:pointer}.account:hover{background:rgba(0,0,0,0.04)}.alternative{position:fixed;top:12px;left:8px;padding:6px 10px 6px 8px;display:flex;align-items:center;opacity:0;z-index:2;transition:opacity 0.2s ease-in-out;background:rgba(255,255,255,0);border-radius:8px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.alternative .new-chat::part(link){padding:4px;margin-left:16px;font-size:12px}.alternative .new-chat::part(link):hover{color:#7891ff}.alternative .new-chat::part(link):active{color:#0911b3}.container{width:270px;padding:10px 0 10px 10px;height:100%;transition:width 0.3s ease-in-out,padding 0.3s ease-in-out}.container.collapsed{width:0;padding:10px 0;overflow:visible}.container.collapsed .sidebar{transform:translateX(-100%)}.container.collapsed .alternative{opacity:1}:host([behavior="drawer"]){z-index:2;width:0}:host(:not([behavior="drawer"])) .alternative .new-chat{display:none}.mask{position:fixed;top:0;right:0;bottom:0;left:0}.links{border-bottom:1px solid rgba(0,0,0,0.06);padding-bottom:16px;margin-bottom:16px}.link{display:block}.link + .link{margin-top:4px}.link::part(link){display:flex;gap:0;align-items:center;padding:7px 10px;border-radius:8px;color:#000}.link.active::part(link),.link::part(link):hover{background:rgba(0,0,0,0.04)}.link .icon{font-size:16px;margin-right:10px}.link .title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history{flex:1;min-height:0;overflow-y:auto;margin:0 -12px;padding:0 12px}.history ul{list-style:none;margin:0;padding:0}.history .section + .section{margin-top:14px}.history .section-title{display:flex;align-items:center;justify-content:space-between;height:30px;margin-bottom:6px;padding:0 8px;position:sticky;top:0}.history .section-title.sticky::before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgb(229,228,234);border-radius:8px;z-index:-1}.history .section-label{display:flex;align-items:center;height:24px;padding:0 8px;margin-left:-8px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;font-size:12px;color:#8c8c8c;border-radius:8px}.history .section-label eo-icon{vertical-align:middle;margin-left:6px;transition:transform 0.2s ease-in-out}.history .section-label:hover{background:rgba(0,0,0,0.04)}.history .collapsed > ul{display:none}.history .collapsed .section-label eo-icon{transform:rotate(-90deg)}.history .error,.history .loading{display:flex;align-items:center;height:36px;padding:0 8px}.history .loading{justify-content:center}.history .error{color:var(--color-error)}.history .group + .group{margin-top:15px}.history .group-title{font-weight:500;font-size:12px;color:#000;padding:8px;height:36px;line-height:20px}.history .item{display:block}.history .item::part(link){display:flex;align-items:center;padding:0 8px;height:36px;border-radius:8px;color:#000}.history .item.active::part(link){background:rgba(0,0,0,0.06)}.history .item.actions-active::part(link),.history .item::part(link):hover{background:rgba(0,0,0,0.04)}.history .item-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history .actions{cursor:auto}.history .item:not(:hover):not(.actions-active) .actions{display:none}.history .working{width:8px;height:8px;border-radius:8px;background:var(--elevo-color-brand);margin:0 7px}.history .item.actions-active .working,.history .item:hover .working,.history .item.active .working{display:none}.history .load-more{display:flex;justify-content:center;align-items:center;height:36px}.button{display:flex}',""]);const l=a.toString()},70579:(e,t,i)=>{i.d(t,{Bj:()=>o,EM:()=>r,JQ:()=>l,Py:()=>c,qb:()=>a,qu:()=>s});var n=i(30981);const o=(0,n.wrapBrick)("eo-icon"),r=(0,n.wrapBrick)("eo-link"),a=(0,n.wrapBrick)("eo-dropdown-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),l=(0,n.wrapBrick)("eo-easyops-avatar"),s=(0,n.wrapBrick)("eo-mini-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),c=(0,n.wrapBrick)("ai-portal.icon-button")},75197:(e,t,i)=>{i.d(t,{D:()=>b});var n=i(89575),o=i(18769),r=i.n(o),a=i(53373),l=i.n(a),s=i(22919);const c=async(e,t)=>(await s.http.get("api/gateway/logic.llm.aiops_service/api/v1/elevo/conversations",{...t,params:e})).data;var d=i(41030),p=i(5813),u=i(70579),m=i(40177),g=i(65549),h=i(94504);const E={lib:"fa",icon:"plus"},b=(0,o.forwardRef)(x);function x(e,t){let{historyActions:i,historyUrlTemplate:a,projectUrlTemplate:b,projectActions:x,canAddProject:v,myLinks:k,onActionClick:y,onHistoryClick:T,onProjectActionClick:w,onAddProject:O}=e;const A=(0,o.useRef)(null),[C,S]=(0,o.useState)(!1),[_,N]=(0,o.useState)(null),[R,I]=(0,o.useState)(!1),[P,U]=(0,o.useState)(!1),[Y,D]=(0,o.useState)(null),[j,M]=(0,o.useState)(!1),[L,V]=(0,o.useState)(),[H,B]=(0,o.useState)(),[J,z]=(0,o.useState)(!1),G=(0,o.useRef)(!0),[q,K]=(0,o.useState)([]),W=(0,o.useMemo)((()=>[...null!=i?i:[],{isDropdown:!0,text:(0,p.t)(p.K.MOVE_TO_PROJECT),disabled:!(null!=_&&_.length),items:null==_?void 0:_.map((e=>({event:"move",key:e.instanceId,text:e.name,project:e})))}]),[i,_]);(0,o.useEffect)((()=>{(async()=>{try{const e=await(async()=>(await s.http.get("api/gateway/logic.llm.aiops_service/api/v1/elevo/projects",{params:{page:1,page_size:3e3}})).data)();N(e.list)}catch(e){console.error("Error loading projects:",e),U(!0),N([])}})()}),[]),(0,o.useEffect)((()=>{Promise.all([c({token:H,limit:30,onlyOwner:!0,onlyUnrelatedProject:!0},{interceptorParams:{ignoreLoadingBar:!0}}),...G.current?[]:[new Promise((e=>setTimeout(e,500)))]]).then((e=>{let[t]=e;G.current=!1,D((e=>[...null!=e?e:[],...t.conversations])),V(t.nextToken)})).catch((e=>{console.error("Error loading chat history:",e),D([]),z(!0)}))}),[H]);const[Q,F]=(0,o.useState)(null),X=(0,o.useRef)(null);(0,o.useEffect)((()=>{const e=X.current,t=A.current;if(!e||!L||!t||j)return;const i=new IntersectionObserver((e=>{for(const t of e)t.isIntersecting&&B(L)}),{root:t});return i.observe(e),()=>{i.disconnect()}}),[L,j]);const Z=(0,o.useRef)(0),$=(0,o.useCallback)((async()=>{try{const e=++Z.current,t=await c({limit:30,onlyOwner:!0,onlyUnrelatedProject:!0},{interceptorParams:{ignoreLoadingBar:!0}});if(e!==Z.current)return;D((e=>{const i=null!=e?e:[],n=t.conversations,o=new Set(n.map((e=>e.conversationId))),r=new Map(n.map((e=>[e.conversationId,e])));let a=!1,l=!1,s=!0;for(const e of i){const t=r.get(e.conversationId);if(!t)break;if(a=!0,l=s&&t!==n[0]||!(0,d.isEqual)(t,e),l)break;s=!1}return a?l?[...n,...i.filter((e=>!o.has(e.conversationId)))]:e:(V(t.nextToken),n)}))}catch(e){console.error("Error pulling chat history:",e)}}),[]);(0,o.useImperativeHandle)(t,(()=>({pull:$,removeProject:e=>{N((t=>t?t.filter((t=>t.instanceId!==e)):t))},addProject:e=>{N((t=>t?[...t,e]:[e]))},moveConversation:e=>{K((t=>[...t,e]))}})),[$]);const ee=(0,o.useMemo)((()=>Y&&Y.length?Y.filter((e=>!q.includes(e.conversationId))):Y),[Y,q]);return r().createElement("div",{className:"history",ref:A},null!=k&&k.length?r().createElement("div",{className:l()("section",{collapsed:C})},r().createElement(f,{rootRef:A,title:(0,p.t)(p.K.MY),collapsed:C,onToggle:()=>S((e=>!e))}),r().createElement("ul",{className:"items"},k.map(((e,t)=>r().createElement("li",{key:t},r().createElement(h.k,{url:e.url,activeIncludes:e.activeIncludes,render:t=>{let{active:i}=t;return r().createElement(u.EM,{className:l()("item",{active:i}),url:e.url},r().createElement("div",{className:"item-title"},e.title))}})))))):null,r().createElement("div",{className:l()("section",{collapsed:R})},r().createElement(f,{rootRef:A,title:(0,p.t)(p.K.PROJECTS),collapsed:R,onToggle:()=>I((e=>!e))},v&&r().createElement(u.Py,{icon:E,variant:"mini-light",tooltip:(0,p.t)(p.K.CREATE_PROJECT),tooltipHoist:!0,className:"button",onClick:O})),r().createElement("ul",{className:"items"},P?r().createElement("li",{className:"error"},"Failed to load project"):_?_.map((e=>{const t=b?(0,g.Q)(b,e):void 0;return r().createElement("li",{key:e.instanceId},r().createElement(h.k,{url:t,render:i=>{let{active:o}=i;return r().createElement(u.EM,(0,n.A)({className:l()("item",{"actions-active":e.instanceId===Q,active:o}),onClick:T},t?{url:t}:null),r().createElement("div",{className:"item-title",title:e.name},e.name||(0,p.t)(p.K.UNNAMED)),r().createElement(u.qu,{className:"actions",actions:x,themeVariant:"elevo",onActionClick:t=>{w({action:t.detail,project:e})},onVisibleChange:t=>{F(t.detail?e.instanceId:null)}}))}}))})):r().createElement("li",{className:"loading"},r().createElement(u.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})))),r().createElement("div",{className:l()("section",{collapsed:j})},r().createElement(f,{rootRef:A,title:(0,p.t)(p.K.HISTORY),collapsed:j,onToggle:()=>M((e=>!e))}),r().createElement("ul",{className:"items"},ee?ee.map((e=>{const t=a?(0,g.Q)(a,e):void 0;return r().createElement("li",{key:e.conversationId},r().createElement(h.k,{url:t,render:t=>{let{active:i}=t;return r().createElement(u.EM,(0,n.A)({className:l()("item",{"actions-active":e.conversationId===Q,active:i}),onClick:T},a?{url:(0,g.Q)(a,e)}:null),r().createElement("div",{className:"item-title",title:e.title},e.title||(0,p.t)(p.K.UNTITLED)),r().createElement(u.qu,{className:"actions",actions:W,onActionClick:t=>{y({action:t.detail,item:e})},onVisibleChange:t=>{F(t.detail?e.conversationId:null)}}),!m.QB.includes(e.state)&&r().createElement("div",{className:"working"}))}}))})):r().createElement("li",{className:"loading"},r().createElement(u.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})),J?r().createElement("li",{className:"error"},"Failed to load chat history"):null),!j&&L&&r().createElement("div",{className:"load-more",ref:X},r().createElement(u.Bj,{lib:"antd",icon:"loading-3-quarters",spinning:!0}))))}function f(e){let{rootRef:t,title:i,collapsed:n,children:a,onToggle:s}=e;const c=(0,o.useRef)(null),[p,m]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{if(n)return void m(!1);const e=t.current,i=c.current,o=null==i?void 0:i.nextElementSibling;if(!e||!i||!o)return;const r=(0,d.throttle)((()=>{const e=i.getBoundingClientRect(),t=o.getBoundingClientRect().top-e.top-e.height;m(t<1)}),100);return e.addEventListener("scroll",r),()=>{e.removeEventListener("scroll",r)}}),[n,t]),r().createElement("div",{className:l()("section-title",{sticky:p}),ref:c},r().createElement("div",{className:"section-label",onClick:s},i,r().createElement(u.Bj,{lib:"fa",icon:"angle-down"})),a)}},94504:(e,t,i)=>{i.d(t,{k:()=>r});var n=i(18769),o=i(30348);function r(e){let{url:t,activeIncludes:i,render:r}=e;const[a,l]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{function e(e){if(t){for(const n of[t,...null!=i?i:[]])if((0,o.matchPath)(e.pathname,{path:n,exact:!1}))return void l(!0);l(!1)}else l(!1)}const n=(0,o.getHistory)();return e(n.location),n.listen(e)}),[t,i]),r({active:a})}}}]);
3
+ //# sourceMappingURL=2084.778e8126.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunks/2084.778e8126.js","mappings":";qMAEO,IAAKA,EAAC,SAADA,GAAC,OAADA,EAAC,oBAADA,EAAC,gBAADA,EAAC,cAADA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AMG,OAAO,IAGrD,YADAN,GAAU,GAIdA,GAAU,EARV,MAFEA,GAAU,EAWd,CACA,MAAMO,GAAUC,EAAAA,EAAAA,cAEhB,OADAP,EAAgBM,EAAQE,UACjBF,EAAQG,OAAOT,EAAgB,GACrC,CAAC1C,EAAKC,IAEFC,EAAO,CAAEE,UAClB","sources":["webpack:///./src/elevo-sidebar/i18n.ts","webpack:///./src/elevo-sidebar/styles.shadow.css","webpack:///./src/elevo-sidebar/bricks.ts","webpack:///../../node_modules/@next-api-sdk/llm-sdk/dist/esm/api/llm/elevo/getElevoProjects.js","webpack:///../../node_modules/@next-api-sdk/llm-sdk/dist/esm/api/llm/elevo/listElevoConversations.js","webpack:///./src/elevo-sidebar/ChatHistory.tsx","webpack:///./src/elevo-sidebar/NavLink.tsx"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\n\nexport enum K {\n NEW_CHAT = \"NEW_CHAT\",\n LOGOUT = \"LOGOUT\",\n TODAY = \"TODAY\",\n YESTERDAY = \"YESTERDAY\",\n PREVIOUS_7_DAYS = \"PREVIOUS_7_DAYS\",\n PREVIOUS_30_DAYS = \"PREVIOUS_30_DAYS\",\n SWITCH_LANGUAGE = \"SWITCH_LANGUAGE\",\n MY = \"MY\",\n PROJECTS = \"PROJECTS\",\n HISTORY = \"HISTORY\",\n CREATE_PROJECT = \"CREATE_PROJECT\",\n MOVE_TO_PROJECT = \"MOVE_TO_PROJECT\",\n UNTITLED = \"UNTITLED\",\n UNNAMED = \"UNNAMED\",\n}\n\nconst en: Locale = {\n [K.NEW_CHAT]: \"New chat\",\n [K.LOGOUT]: \"Logout\",\n [K.TODAY]: \"Today\",\n [K.YESTERDAY]: \"Yesterday\",\n [K.PREVIOUS_7_DAYS]: \"Previous 7 days\",\n [K.PREVIOUS_30_DAYS]: \"Previous 30 days\",\n [K.SWITCH_LANGUAGE]: \"中文\",\n [K.MY]: \"My\",\n [K.PROJECTS]: \"Projects\",\n [K.HISTORY]: \"Chats\",\n [K.CREATE_PROJECT]: \"Create project\",\n [K.MOVE_TO_PROJECT]: \"Move to project\",\n [K.UNTITLED]: \"Untitled\",\n [K.UNNAMED]: \"Unnamed\",\n};\n\nconst zh: Locale = {\n [K.NEW_CHAT]: \"新对话\",\n [K.LOGOUT]: \"登出\",\n [K.TODAY]: \"今天\",\n [K.YESTERDAY]: \"昨天\",\n [K.PREVIOUS_7_DAYS]: \"过去7天\",\n [K.PREVIOUS_30_DAYS]: \"过去30天\",\n [K.SWITCH_LANGUAGE]: \"English\",\n [K.MY]: \"我的\",\n [K.PROJECTS]: \"项目\",\n [K.HISTORY]: \"对话\",\n [K.CREATE_PROJECT]: \"创建项目\",\n [K.MOVE_TO_PROJECT]: \"移动到项目\",\n [K.UNTITLED]: \"无标题\",\n [K.UNNAMED]: \"未命名\",\n};\n\nexport const NS = \"bricks/ai-portal/elevo-sidebar\";\n\nexport const locales = { en, zh };\n\nexport const t = i18n.getFixedT(null, NS);\n\ntype Locale = { [k in K]: string } & {\n [k in K as `${k}_plural`]?: string;\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, `:host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.sidebar{position:relative;z-index:2;width:260px;height:100%;background:rgba(246,247,249,0.5);border:1px solid rgba(255,255,255,0.3);border-radius:12px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:23px 11px 0;display:flex;flex-direction:column;transition:transform 0.3s ease-in-out}.logo-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px;margin-left:4px}.logo-link::part(link){display:block}.logo{vertical-align:middle}.new-chat::part(link){display:flex;gap:0;align-items:center;color:var(--elevo-color-brand);font-size:14px;text-align:left;cursor:pointer}.sidebar .new-chat::part(link){background:#f0f4ff;border-radius:8px;border:1px solid #c9d7ff;padding:9px 13px;font-weight:500;margin-bottom:16px}.sidebar .new-chat::part(link):hover{background:rgba(201,215,255,0.5)}.new-chat-icon{font-size:16px;margin-right:5px}.footer{border-top:1px solid rgba(0,0,0,0.04);padding:9px 12px;margin:0 -12px}.dropdown{display:block}.account{background:none;border:none;border-radius:8px;padding:6px 10px;display:block;width:100%;text-align:left;cursor:pointer}.account:hover{background:rgba(0,0,0,0.04)}.alternative{position:fixed;top:12px;left:8px;padding:6px 10px 6px 8px;display:flex;align-items:center;opacity:0;z-index:2;transition:opacity 0.2s ease-in-out;background:rgba(255,255,255,0);border-radius:8px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.alternative .new-chat::part(link){padding:4px;margin-left:16px;font-size:12px}.alternative .new-chat::part(link):hover{color:#7891ff}.alternative .new-chat::part(link):active{color:#0911b3}.container{width:270px;padding:10px 0 10px 10px;height:100%;transition:width 0.3s ease-in-out,padding 0.3s ease-in-out}.container.collapsed{width:0;padding:10px 0;overflow:visible}.container.collapsed .sidebar{transform:translateX(-100%)}.container.collapsed .alternative{opacity:1}:host([behavior=\"drawer\"]){z-index:2;width:0}:host(:not([behavior=\"drawer\"])) .alternative .new-chat{display:none}.mask{position:fixed;top:0;right:0;bottom:0;left:0}.links{border-bottom:1px solid rgba(0,0,0,0.06);padding-bottom:16px;margin-bottom:16px}.link{display:block}.link + .link{margin-top:4px}.link::part(link){display:flex;gap:0;align-items:center;padding:7px 10px;border-radius:8px;color:#000}.link.active::part(link),.link::part(link):hover{background:rgba(0,0,0,0.04)}.link .icon{font-size:16px;margin-right:10px}.link .title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history{flex:1;min-height:0;overflow-y:auto;margin:0 -12px;padding:0 12px}.history ul{list-style:none;margin:0;padding:0}.history .section + .section{margin-top:14px}.history .section-title{display:flex;align-items:center;justify-content:space-between;height:30px;margin-bottom:6px;padding:0 8px;position:sticky;top:0}.history .section-title.sticky::before{content:\"\";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgb(229,228,234);border-radius:8px;z-index:-1}.history .section-label{display:flex;align-items:center;height:24px;padding:0 8px;margin-left:-8px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;font-size:12px;color:#8c8c8c;border-radius:8px}.history .section-label eo-icon{vertical-align:middle;margin-left:6px;transition:transform 0.2s ease-in-out}.history .section-label:hover{background:rgba(0,0,0,0.04)}.history .collapsed > ul{display:none}.history .collapsed .section-label eo-icon{transform:rotate(-90deg)}.history .error,.history .loading{display:flex;align-items:center;height:36px;padding:0 8px}.history .loading{justify-content:center}.history .error{color:var(--color-error)}.history .group + .group{margin-top:15px}.history .group-title{font-weight:500;font-size:12px;color:#000;padding:8px;height:36px;line-height:20px}.history .item{display:block}.history .item::part(link){display:flex;align-items:center;padding:0 8px;height:36px;border-radius:8px;color:#000}.history .item.active::part(link){background:rgba(0,0,0,0.06)}.history .item.actions-active::part(link),.history .item::part(link):hover{background:rgba(0,0,0,0.04)}.history .item-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history .actions{cursor:auto}.history .item:not(:hover):not(.actions-active) .actions{display:none}.history .working{width:8px;height:8px;border-radius:8px;background:var(--elevo-color-brand);margin:0 7px}.history .item.actions-active .working,.history .item:hover .working,.history .item.active .working{display:none}.history .load-more{display:flex;justify-content:center;align-items:center;height:36px}.button{display:flex}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","import { 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\";\nimport type {\n EoDropdownActions,\n DropdownActionsProps,\n DropdownActionsEvents,\n DropdownActionsEventsMapping,\n} from \"@next-bricks/basic/dropdown-actions\";\nimport type {\n EoEasyopsAvatar,\n EoEasyopsAvatarProps,\n} from \"@next-bricks/basic/easyops-avatar\";\nimport type {\n EoMiniActions,\n EoMiniActionsEvents,\n EoMiniActionsEventsMapping,\n EoMiniActionsProps,\n} from \"@next-bricks/basic/mini-actions\";\nimport type { IconButton, IconButtonProps } from \"../icon-button\";\n\nexport const WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nexport const WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\nexport const WrappedDropdownActions = wrapBrick<\n EoDropdownActions,\n DropdownActionsProps,\n DropdownActionsEvents,\n DropdownActionsEventsMapping\n>(\"eo-dropdown-actions\", {\n onActionClick: \"action.click\",\n onVisibleChange: \"visible.change\",\n});\nexport const WrappedEasyopsAvatar = wrapBrick<\n EoEasyopsAvatar,\n EoEasyopsAvatarProps\n>(\"eo-easyops-avatar\");\nexport const WrappedMiniActions = wrapBrick<\n EoMiniActions,\n EoMiniActionsProps & { themeVariant?: \"default\" | \"elevo\" },\n EoMiniActionsEvents,\n EoMiniActionsEventsMapping\n>(\"eo-mini-actions\", {\n onActionClick: \"action.click\",\n onVisibleChange: \"visible.change\",\n});\nexport const WrappedIconButton = wrapBrick<IconButton, IconButtonProps>(\n \"ai-portal.icon-button\"\n);\n","import { http } from \"@next-core/http\";\n/**\n * @description 获取elevo项目列表\n * @endpoint list /api/v1/elevo/projects\n */\nexport const ElevoApi_getElevoProjects = async (params, options) => /**! @contract easyops.api.llm.elevo.GetElevoProjects@1.0.0 */(await http.get(\"api/gateway/logic.llm.aiops_service/api/v1/elevo/projects\", {\n ...options,\n params\n})).data;\n//# sourceMappingURL=getElevoProjects.js.map","import { http } from \"@next-core/http\";\n/**\n * @description 获取elevo会话列表\n * @endpoint GET /api/v1/elevo/conversations\n */\nexport const ElevoApi_listElevoConversations = async (params, options) => /**! @contract easyops.api.llm.elevo.ListElevoConversations@1.0.0 */(await http.get(\"api/gateway/logic.llm.aiops_service/api/v1/elevo/conversations\", {\n ...options,\n params\n})).data;\n//# sourceMappingURL=listElevoConversations.js.map","import React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type MutableRefObject,\n type PropsWithChildren,\n} from \"react\";\nimport classNames from \"classnames\";\nimport {\n ElevoApi_listElevoConversations,\n ElevoApi_getElevoProjects,\n type ElevoApi_ListElevoConversationsRequestParams,\n} from \"@next-api-sdk/llm-sdk\";\nimport type {\n ActionType,\n SimpleActionType,\n} from \"@next-bricks/basic/mini-actions\";\nimport type { GeneralIconProps } from \"@next-bricks/icons/general-icon\";\nimport { isEqual, throttle } from \"lodash\";\nimport { K, t } from \"./i18n.js\";\nimport {\n WrappedIcon,\n WrappedLink,\n WrappedMiniActions,\n WrappedIconButton,\n} from \"./bricks.js\";\nimport { DONE_STATES } from \"../shared/constants.js\";\nimport { parseTemplate } from \"../shared/parseTemplate.js\";\nimport type { ConversationState } from \"../shared/interfaces.js\";\nimport type { SidebarLink } from \"./index.js\";\nimport { NavLink } from \"./NavLink.js\";\n\nconst ADD_ICON: GeneralIconProps = {\n lib: \"fa\",\n icon: \"plus\",\n};\n\nexport interface HistoryItem {\n conversationId: string;\n title: string;\n startTime: number;\n state?: ConversationState;\n}\n\nexport interface GroupedHistory {\n title: string;\n items: HistoryItem[];\n}\n\nexport interface ActionClickDetail {\n action: SimpleActionType;\n item: HistoryItem;\n project?: Project;\n}\n\nexport interface ProjectActionClickDetail {\n action: SimpleActionType;\n project: Project;\n}\n\nexport interface Project {\n /** 实例ID */\n instanceId: string;\n /** 项目名称 */\n name: string;\n /** 项目描述 */\n description: string;\n /** 状态 */\n state: \"active\" | \"inactive\";\n /** 默认数字人ID */\n defaultAiEmployeeId: string;\n /** 创建者 */\n creator: string;\n /** 创建时间 */\n ctime: string;\n /** 修改时间 */\n mtime: string;\n /** 修改者 */\n modifier: string;\n}\n\nexport interface ChatHistoryProps {\n historyUrlTemplate?: string;\n historyActions?: ActionType[];\n projectUrlTemplate?: string;\n projectActions?: ActionType[];\n canAddProject?: boolean;\n myLinks?: SidebarLink[];\n onActionClick: (detail: ActionClickDetail) => void;\n onHistoryClick: () => void;\n onProjectActionClick: (detail: ProjectActionClickDetail) => void;\n onAddProject: () => void;\n}\n\nexport interface ChatHistoryRef {\n pull: () => void;\n removeProject?: (projectId: string) => void;\n addProject?: (project: Project) => void;\n moveConversation?: (conversationId: string) => void;\n}\n\nexport const ChatHistory = forwardRef(LowLevelChatHistory);\n\nexport function LowLevelChatHistory(\n {\n historyActions,\n historyUrlTemplate,\n projectUrlTemplate,\n projectActions,\n canAddProject,\n myLinks,\n onActionClick,\n onHistoryClick,\n onProjectActionClick,\n onAddProject,\n }: ChatHistoryProps,\n ref: React.Ref<ChatHistoryRef>\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [myCollapsed, setMyCollapsed] = useState(false);\n const [projects, setProjects] = useState<Project[] | null>(null);\n const [projectsCollapsed, setProjectsCollapsed] = useState(false);\n const [projectsError, setProjectsError] = useState(false);\n const [historyList, setHistoryList] = useState<HistoryItem[] | null>(null);\n const [historyCollapsed, setHistoryCollapsed] = useState(false);\n const [nextToken, setNextToken] = useState<string | undefined>();\n const [loadNextToken, setLoadNextToken] = useState<string | undefined>();\n const [historyError, setHistoryError] = useState(false);\n const initialRef = useRef(true);\n const [movedConversations, setMovedConversations] = useState<string[]>([]);\n\n const mergedHistoryActions = useMemo(\n () =>\n [\n ...(historyActions ?? []),\n {\n isDropdown: true,\n text: t(K.MOVE_TO_PROJECT),\n disabled: !projects?.length,\n items: projects?.map((project) => ({\n event: \"move\",\n key: project.instanceId,\n text: project.name,\n project,\n })),\n },\n ] as ActionType[],\n [historyActions, projects]\n );\n\n useEffect(() => {\n (async () => {\n try {\n const projects = await ElevoApi_getElevoProjects({\n page: 1,\n page_size: 3000,\n });\n setProjects(projects.list as Project[]);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Error loading projects:\", error);\n setProjectsError(true);\n setProjects([]);\n }\n })();\n }, []);\n\n useEffect(() => {\n Promise.all([\n ElevoApi_listElevoConversations(\n {\n token: loadNextToken,\n limit: 30,\n onlyOwner: true,\n onlyUnrelatedProject: true,\n } as ElevoApi_ListElevoConversationsRequestParams,\n {\n interceptorParams: {\n ignoreLoadingBar: true,\n },\n }\n ),\n ...(initialRef.current\n ? []\n : [\n new Promise((resolve) => setTimeout(resolve, 500)), // Force a minimum delay\n ]),\n ])\n .then(([data]) => {\n initialRef.current = false;\n setHistoryList((prev) => [\n ...(prev ?? []),\n ...(data.conversations as HistoryItem[]),\n ]);\n setNextToken(data.nextToken);\n })\n .catch((error) => {\n // eslint-disable-next-line no-console\n console.error(\"Error loading chat history:\", error);\n setHistoryList([]);\n setHistoryError(true);\n });\n }, [loadNextToken]);\n\n const [actionsVisible, setActionsVisible] = useState<string | null>(null);\n\n const nextRef = useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n const next = nextRef.current;\n const root = rootRef.current;\n if (!next || !nextToken || !root || historyCollapsed) {\n return;\n }\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n setLoadNextToken(nextToken);\n }\n }\n },\n { root }\n );\n observer.observe(next);\n return () => {\n observer.disconnect();\n };\n }, [nextToken, historyCollapsed]);\n\n const pullIdRef = useRef(0);\n\n const pull = useCallback(async () => {\n try {\n const pullId = ++pullIdRef.current;\n const tempList = await ElevoApi_listElevoConversations(\n {\n limit: 30,\n onlyOwner: true,\n onlyUnrelatedProject: true,\n } as ElevoApi_ListElevoConversationsRequestParams,\n {\n interceptorParams: {\n ignoreLoadingBar: true,\n },\n }\n );\n if (pullId !== pullIdRef.current) {\n // Ignore this pull if a newer one has been triggered\n return;\n }\n setHistoryList((prev) => {\n const prevList = prev ?? [];\n const newList = tempList.conversations as HistoryItem[];\n const newIds = new Set(newList.map((item) => item.conversationId));\n const newItemsMap = new Map(\n newList.map((item) => [item.conversationId, item])\n );\n\n let foundIntersection = false;\n let foundChanged = false;\n let isFirst = true;\n for (const item of prevList) {\n const newItem = newItemsMap.get(item.conversationId);\n if (newItem) {\n foundIntersection = true;\n foundChanged =\n (isFirst && newItem !== newList[0]) || !isEqual(newItem, item);\n if (foundChanged) {\n break;\n }\n } else {\n break;\n }\n isFirst = false;\n }\n\n if (!foundIntersection) {\n setNextToken(tempList.nextToken);\n return newList;\n }\n\n if (foundChanged) {\n return [\n ...newList,\n ...prevList.filter((item) => !newIds.has(item.conversationId)),\n ];\n }\n\n return prev;\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Error pulling chat history:\", error);\n }\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n pull,\n removeProject: (projectId: string) => {\n setProjects((prev) =>\n prev ? prev.filter((p) => p.instanceId !== projectId) : prev\n );\n },\n addProject: (project: Project) => {\n setProjects((prev) => (prev ? [...prev, project] : [project]));\n },\n moveConversation: (conversationId: string) => {\n setMovedConversations((prev) => [...prev, conversationId]);\n },\n }),\n [pull]\n );\n\n const filteredHistoryList = useMemo(() => {\n if (!historyList || !historyList.length) {\n return historyList;\n }\n return historyList.filter(\n (item) => !movedConversations.includes(item.conversationId)\n );\n }, [historyList, movedConversations]);\n\n return (\n <div className=\"history\" ref={rootRef}>\n {myLinks?.length ? (\n <div className={classNames(\"section\", { collapsed: myCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.MY)}\n collapsed={myCollapsed}\n onToggle={() => setMyCollapsed((prev) => !prev)}\n />\n <ul className=\"items\">\n {myLinks.map((link, index) => (\n <li key={index}>\n <NavLink\n url={link.url}\n activeIncludes={link.activeIncludes}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", { active })}\n url={link.url}\n >\n <div className=\"item-title\">{link.title}</div>\n </WrappedLink>\n )}\n />\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n <div className={classNames(\"section\", { collapsed: projectsCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.PROJECTS)}\n collapsed={projectsCollapsed}\n onToggle={() => setProjectsCollapsed((prev) => !prev)}\n >\n {canAddProject && (\n <WrappedIconButton\n icon={ADD_ICON}\n variant=\"mini-light\"\n tooltip={t(K.CREATE_PROJECT)}\n tooltipHoist={true}\n className=\"button\"\n onClick={onAddProject}\n />\n )}\n </SectionTitle>\n <ul className=\"items\">\n {projectsError ? (\n <li className=\"error\">Failed to load project</li>\n ) : projects ? (\n projects.map((project) => {\n const url = projectUrlTemplate\n ? parseTemplate(projectUrlTemplate, project)\n : undefined;\n return (\n <li key={project.instanceId}>\n <NavLink\n url={url}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", {\n \"actions-active\":\n project.instanceId === actionsVisible,\n active,\n })}\n onClick={onHistoryClick}\n {...(url ? { url } : null)}\n >\n <div className=\"item-title\" title={project.name}>\n {project.name || t(K.UNNAMED)}\n </div>\n <WrappedMiniActions\n className=\"actions\"\n actions={projectActions}\n themeVariant=\"elevo\"\n onActionClick={(e) => {\n onProjectActionClick({ action: e.detail, project });\n }}\n onVisibleChange={(e) => {\n setActionsVisible(\n e.detail ? project.instanceId : null\n );\n }}\n />\n </WrappedLink>\n )}\n />\n </li>\n );\n })\n ) : (\n <li className=\"loading\">\n <WrappedIcon\n lib=\"antd\"\n theme=\"outlined\"\n icon=\"loading-3-quarters\"\n spinning\n />\n </li>\n )}\n </ul>\n </div>\n <div className={classNames(\"section\", { collapsed: historyCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.HISTORY)}\n collapsed={historyCollapsed}\n onToggle={() => setHistoryCollapsed((prev) => !prev)}\n />\n <ul className=\"items\">\n {filteredHistoryList ? (\n filteredHistoryList.map((item) => {\n const url = historyUrlTemplate\n ? parseTemplate(historyUrlTemplate, item)\n : undefined;\n return (\n <li key={item.conversationId}>\n <NavLink\n url={url}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", {\n \"actions-active\":\n item.conversationId === actionsVisible,\n active,\n })}\n onClick={onHistoryClick}\n {...(historyUrlTemplate\n ? { url: parseTemplate(historyUrlTemplate, item) }\n : null)}\n >\n <div className=\"item-title\" title={item.title}>\n {item.title || t(K.UNTITLED)}\n </div>\n <WrappedMiniActions\n className=\"actions\"\n actions={mergedHistoryActions}\n onActionClick={(e) => {\n onActionClick({ action: e.detail, item });\n }}\n onVisibleChange={(e) => {\n setActionsVisible(\n e.detail ? item.conversationId : null\n );\n }}\n />\n {!DONE_STATES.includes(item.state!) && (\n <div className=\"working\"></div>\n )}\n </WrappedLink>\n )}\n />\n </li>\n );\n })\n ) : (\n <li className=\"loading\">\n <WrappedIcon\n lib=\"antd\"\n theme=\"outlined\"\n icon=\"loading-3-quarters\"\n spinning\n />\n </li>\n )}\n {historyError ? (\n <li className=\"error\">Failed to load chat history</li>\n ) : null}\n </ul>\n {!historyCollapsed && nextToken && (\n <div className=\"load-more\" ref={nextRef}>\n <WrappedIcon lib=\"antd\" icon=\"loading-3-quarters\" spinning />\n </div>\n )}\n </div>\n </div>\n );\n}\n\ninterface SectionTitleProps {\n rootRef: MutableRefObject<HTMLDivElement | null>;\n title: string;\n collapsed: boolean;\n onToggle: () => void;\n}\n\nfunction SectionTitle({\n rootRef,\n title,\n collapsed,\n children,\n onToggle,\n}: PropsWithChildren<SectionTitleProps>) {\n const ref = useRef<HTMLDivElement | null>(null);\n const [stickyActive, setStickyActive] = useState(false);\n\n useEffect(() => {\n if (collapsed) {\n setStickyActive(false);\n return;\n }\n const parent = rootRef.current;\n const element = ref.current;\n const sibling = element?.nextElementSibling as HTMLElement | null;\n if (!parent || !element || !sibling) {\n return;\n }\n const onScroll = throttle(() => {\n const rect = element.getBoundingClientRect();\n const siblingRect = sibling.getBoundingClientRect();\n const diff = siblingRect.top - rect.top - rect.height;\n setStickyActive(diff < 1);\n }, 100);\n parent.addEventListener(\"scroll\", onScroll);\n return () => {\n parent.removeEventListener(\"scroll\", onScroll);\n };\n }, [collapsed, rootRef]);\n\n return (\n <div\n className={classNames(\"section-title\", { sticky: stickyActive })}\n ref={ref}\n >\n <div className=\"section-label\" onClick={onToggle}>\n {title}\n <WrappedIcon lib=\"fa\" icon=\"angle-down\" />\n </div>\n {children}\n </div>\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { getHistory, matchPath } from \"@next-core/runtime\";\nimport type { Location } from \"history\";\n\nexport interface NavLinkProps {\n url?: string;\n activeIncludes?: string[];\n render: (props: { active: boolean }) => React.ReactElement;\n}\n\nexport function NavLink({ url, activeIncludes, render }: NavLinkProps) {\n const [active, setActive] = useState(false);\n\n useEffect(() => {\n function checkLinkActive(loc: Location) {\n if (!url) {\n setActive(false);\n return;\n }\n for (const path of [url, ...(activeIncludes ?? [])]) {\n const matched = matchPath(loc.pathname, { path, exact: false });\n if (matched) {\n setActive(true);\n return;\n }\n }\n setActive(false);\n }\n const history = getHistory();\n checkLinkActive(history.location);\n return history.listen(checkLinkActive);\n }, [url, activeIncludes]);\n\n return render({ active });\n}\n"],"names":["K","en","NEW_CHAT","LOGOUT","TODAY","YESTERDAY","PREVIOUS_7_DAYS","PREVIOUS_30_DAYS","SWITCH_LANGUAGE","MY","PROJECTS","HISTORY","CREATE_PROJECT","MOVE_TO_PROJECT","UNTITLED","UNNAMED","zh","NS","locales","t","i18n","getFixedT","___CSS_LOADER_EXPORT___","push","module","id","toString","WrappedIcon","wrapBrick","WrappedLink","WrappedDropdownActions","onActionClick","onVisibleChange","WrappedEasyopsAvatar","WrappedMiniActions","WrappedIconButton","ElevoApi_listElevoConversations","async","params","options","http","get","data","ADD_ICON","lib","icon","ChatHistory","forwardRef","LowLevelChatHistory","_ref","ref","historyActions","historyUrlTemplate","projectUrlTemplate","projectActions","canAddProject","myLinks","onHistoryClick","onProjectActionClick","onAddProject","rootRef","useRef","myCollapsed","setMyCollapsed","useState","projects","setProjects","projectsCollapsed","setProjectsCollapsed","projectsError","setProjectsError","historyList","setHistoryList","historyCollapsed","setHistoryCollapsed","nextToken","setNextToken","loadNextToken","setLoadNextToken","historyError","setHistoryError","initialRef","movedConversations","setMovedConversations","mergedHistoryActions","useMemo","isDropdown","text","disabled","length","items","map","project","event","key","instanceId","name","useEffect","page","page_size","ElevoApi_getElevoProjects","list","error","console","Promise","all","token","limit","onlyOwner","onlyUnrelatedProject","interceptorParams","ignoreLoadingBar","current","resolve","setTimeout","then","_ref2","prev","conversations","catch","actionsVisible","setActionsVisible","nextRef","next","root","observer","IntersectionObserver","entries","entry","isIntersecting","observe","disconnect","pullIdRef","pull","useCallback","pullId","tempList","prevList","newList","newIds","Set","item","conversationId","newItemsMap","Map","foundIntersection","foundChanged","isFirst","newItem","isEqual","filter","has","useImperativeHandle","removeProject","projectId","p","addProject","moveConversation","filteredHistoryList","includes","React","className","classNames","collapsed","SectionTitle","title","onToggle","link","index","NavLink","url","activeIncludes","render","_ref3","active","variant","tooltip","tooltipHoist","onClick","parseTemplate","undefined","_ref4","_extends","actions","themeVariant","e","action","detail","theme","spinning","_ref5","DONE_STATES","state","_ref6","children","stickyActive","setStickyActive","parent","element","sibling","nextElementSibling","onScroll","throttle","rect","getBoundingClientRect","diff","top","height","addEventListener","removeEventListener","sticky","setActive","checkLinkActive","loc","path","matchPath","pathname","exact","history","getHistory","location","listen"],"sourceRoot":""}