@glodon-aiot/agent-cli-ui 3.11.0 → 3.11.1-shapshot.1765331453

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.
@@ -1,4 +1,4 @@
1
- const e = "@glodon-aiot/agent-cli-ui", t = "3.11.0", s = "./dist/es/index.mjs", i = "./dist/lib/index.js", o = "./dist/src/index.d.ts", n = {
1
+ const e = "@glodon-aiot/agent-cli-ui", t = "3.11.1-shapshot.1765331453", s = "./dist/es/index.mjs", o = "./dist/lib/index.js", i = "./dist/src/index.d.ts", n = {
2
2
  import: "./dist/es/index.mjs",
3
3
  require: "./dist/lib/index.js",
4
4
  types: "./dist/src/index.d.ts"
@@ -25,8 +25,8 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.11.0", s = "./dist/es/index.mjs",
25
25
  webpack: "*"
26
26
  }, p = {
27
27
  "@ant-design/icons": "^5.3.4",
28
- "@glodon-aiot/apis": "^3.11.0",
29
- "@glodon-aiot/bot-client-sdk": "^3.11.0",
28
+ "@glodon-aiot/apis": "^3.11.1-shapshot.1765331453",
29
+ "@glodon-aiot/bot-client-sdk": "^3.11.1-shapshot.1765331453",
30
30
  "@matejmazur/react-mathjax": "^0.1.10",
31
31
  "@react-pdf-viewer/core": "^3.12.0",
32
32
  "@react-pdf-viewer/default-layout": "^3.12.0",
@@ -122,8 +122,8 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.11.0", s = "./dist/es/index.mjs",
122
122
  name: e,
123
123
  version: t,
124
124
  module: s,
125
- main: i,
126
- typings: o,
125
+ main: o,
126
+ typings: i,
127
127
  exports: n,
128
128
  files: r,
129
129
  type: c,
@@ -150,7 +150,7 @@ export {
150
150
  n as exports,
151
151
  r as files,
152
152
  v as husky,
153
- i as main,
153
+ o as main,
154
154
  s as module,
155
155
  e as name,
156
156
  a as peerDependencies,
@@ -159,6 +159,6 @@ export {
159
159
  d as scripts,
160
160
  c as type,
161
161
  l as types,
162
- o as typings,
162
+ i as typings,
163
163
  t as version
164
164
  };
@@ -1 +1 @@
1
- .gbot-dialog-modal .history-item{margin-bottom:16px}.gbot-dialog-modal .history-item .history-item-user{width:100%}.gbot-dialog-modal .history-item .history-item-user .item-user-panel{display:flex;justify-content:flex-end}.gbot-dialog-modal .history-item .history-item-user .item-user-panel .user-panel-main{max-width:100%}.gbot-dialog-modal .history-item .history-item-user .item-user-panel .user-panel-main .item-user-content{background:#f9f2ff;padding:12px;border-radius:12px 2px 12px 12px;border:1px solid #9c24f2;display:inline-block;width:auto;max-width:100%;color:#070c14;word-wrap:break-word}.gbot-dialog-modal .history-item .history-item-user .item-user-file{display:flex-end;margin-top:10px}.gbot-dialog-modal .history-item .history-item-user .item-user-images{display:flex;justify-content:flex-end}.gbot-dialog-modal .history-item .history-item-user ::selection{background-color:#b1d7ffb3;color:#fff}.gbot-dialog-modal .history-item .history-item-bot{width:100%;border-radius:2px 12px 12px;background:white;padding:0 12px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin{padding-top:12px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-status .plugin-status-success{display:inline-block;width:14px;height:14px;color:#fff;background:#47d1cb;border-radius:50%;font-size:10px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-status .plugin-status-error{display:inline-block;width:14px;height:14px;color:#fff;background:#f95b81;border-radius:50%;font-size:10px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-status .plugin-status-loading{display:inline-block;width:14px;height:14px;color:#477bff;border-radius:50%;font-size:10px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-title{font-weight:700;color:#000000a6}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-action{border:1px solid #00000026;border-radius:4px;color:#000000e0;padding:1px 8px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .gbot-collapse-header{padding:0;height:38px;display:flex;align-items:center}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .gbot-collapse-content-box{padding:0}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-content{height:32px;line-height:32px;font-weight:700}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-json{background:white}.gbot-dialog-modal .history-item .history-item-bot .item-bot-net{padding-top:12px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content{width:100%;border-radius:2px 12px 12px;background:white;padding:12px 0;word-wrap:break-word}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think{margin-bottom:12px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-top{font-size:14px;line-height:24px;color:#070c14;display:flex;align-items:center;margin-bottom:12px;cursor:pointer}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-top img{width:24px;margin-right:4px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-top .think-action{margin-left:8px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-bottom{font-size:14px;line-height:150%;color:#999;position:relative}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-bottom .bottom-left{background:#d9d9d9;width:1px;position:absolute;left:10px;top:4px;bottom:4px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-bottom .bottom-left .thinking{position:absolute;left:-5px;top:0;width:12px;height:12px;background:#b752ea;border-radius:50%}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-bottom .bottom-left .thinked{position:absolute;z-index:100;left:-5px;top:0;width:12px;height:12px;background:#04d68d;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-size:8px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-bottom .bottom-right{padding-left:22px}.gbot-dialog-modal .history-item .gbot-collapse-item{border-radius:4px;background-color:#f5f5f5;margin-bottom:8px;padding:0 0 0 8px}.gbot-dialog-modal .history-item .gbot-collapse-item .gbot-collapse-content{padding-bottom:8px}.gbot-dialog-modal .history-item .gbot-collapse-item:last-child{margin-bottom:0}.gbot-dialog-modal .history-item .gbot-collapse-header-text{width:100%}.gbot-dialog-modal.inlay .history-item__user{display:flex;justify-content:flex-end}.gbot-dialog-modal.inlay .history-item-user,.gbot-dialog-modal.inlay .history-item-bot{max-width:calc(100% - 64px)}.gbot-dialog-modal .session-item-overlay-popover .gbot-popover-inner-content{padding:6px}.gbot-dialog-modal .session-item-overlay-popover .gbot-popover-arrow{display:none}
1
+ .gbot-dialog-modal .home-footer{background:#f5f5f5;width:100%;max-width:824px;margin:0 auto}.gbot-dialog-modal .home-footer .footer-warning{display:flex;justify-content:center;align-items:center;font-size:12px;font-weight:400;line-height:18px;text-align:left;color:#999}
@@ -1 +1 @@
1
- .gbot-dialog-modal .file-preview{width:auto;border-radius:6px;border:1px solid #e8e9eb;background:#ffffff;position:relative;display:inline-block;max-height:80px}.gbot-dialog-modal .file-preview .file-icon{height:100%;width:48px}.gbot-dialog-modal .file-preview.small{height:30px;width:150px;padding:3px 6px 3px 3px}.gbot-dialog-modal .file-preview.small .file-icon{width:24px}.gbot-dialog-modal .file-preview .file-desc{flex:1;overflow:hidden}.gbot-dialog-modal .file-preview .file-desc .file-desc-name{color:#5c5f66;font-size:12px;font-style:normal;font-weight:700;line-height:150%;margin-bottom:4px}.gbot-dialog-modal .file-preview .file-action{position:absolute;right:-8px;top:-8px}.gbot-dialog-modal .file-preview .file-process{background-color:#f7f7f9;border-radius:8px;width:16px;height:16px;line-height:16px;text-align:center;display:inline-flex;align-items:center;justify-content:center}.gbot-dialog-modal .file-preview .file-remove{display:inline-block;border-radius:10px;width:20px;height:20px;line-height:20px;text-align:center;color:#84868c;border:1px solid #e8e9eb;display:inline-flex;align-items:center;justify-content:center;background-color:#f7f7f9}.gbot-dialog-modal .file-preview .file-remove:hover{background-color:#fff;color:#b452ff}.gbot-dialog-modal .file-remove-tooltip .gbot-tooltip-content .gbot-tooltip-inner{padding:12px}
1
+ .gbot-dialog-modal .greeting{display:flex;flex-direction:column;align-items:center;flex:1;margin:0 auto;max-width:824px;width:100%;padding:16px 0}.gbot-dialog-modal .greeting-icon{width:74px;height:74px;border-radius:50%;box-shadow:0 6px 16px 2px #070c1414;padding:5px;margin-bottom:24px}.gbot-dialog-modal .greeting-icon img{width:64px;height:64px}.gbot-dialog-modal .greeting-word{font-weight:700;font-size:24px;line-height:30px;margin-bottom:24px}.gbot-dialog-modal .greeting-questions{width:100%;padding:0 12px}.gbot-dialog-modal.inlay .greeting{margin-top:40px}.gbot-dialog-modal.float .greeting{overflow-y:auto;flex:none}
@@ -1 +1 @@
1
- .gbot-dialog-modal .home-footer{background:#f5f5f5;width:100%;max-width:824px;margin:0 auto}.gbot-dialog-modal .home-footer .footer-warning{display:flex;justify-content:center;align-items:center;font-size:12px;font-weight:400;line-height:18px;text-align:left;color:#999}
1
+ .gbot-dialog-modal.inlay .questions,.gbot-dialog-modal.float .questions{width:100%}.gbot-dialog-modal .questions .question-tip{display:flex;align-items:center;margin-bottom:10px;height:24px;color:#84868c}.gbot-dialog-modal .questions .question-tip img{width:24px;height:24px}.gbot-dialog-modal .questions .question-row{max-height:260px;overflow-y:auto}.gbot-dialog-modal .questions .question-pannel{background:white;padding:12px;border-radius:8px;width:100%;cursor:pointer;border:1px solid transparent}.gbot-dialog-modal .questions .question-pannel .question-top{font-size:16px;height:32px;color:#070c14;font-weight:700;display:flex;width:100%}.gbot-dialog-modal .questions .question-pannel .question-top .question-top-tip{flex:0 0 24px;margin-right:8px}.gbot-dialog-modal .questions .question-pannel .question-top .question-top-title{flex:0 0 1;overflow:hidden;display:flex;align-items:center}.gbot-dialog-modal .questions .question-pannel .question-top .question-top-type{margin-left:8px;flex:0 0 24px}.gbot-dialog-modal .questions .question-pannel .question-top .question-only-plus-file{margin-left:0}.gbot-dialog-modal .questions .question-pannel .question-top img{width:24px}.gbot-dialog-modal .questions .question-pannel .not-have-top{display:none}.gbot-dialog-modal .questions .question-pannel .question-bottom{font-size:14px;color:#070c14;line-height:21px}.gbot-dialog-modal .questions .question-pannel .multiline-question{height:56px;margin-top:-7px}.gbot-dialog-modal .questions .question-pannel__active{border:1px solid #b452ff;transition:all .25s}.gbot-dialog-modal .questions .multiline-question-pannel{padding:16px 12px}.gbot-dialog-modal .recommend-tooltip-overlay .gbot-tooltip-inner{max-width:400px;max-height:300px;overflow-y:auto}
@@ -1 +1 @@
1
- .gbot-dialog-modal .quill-editor{position:relative}.gbot-dialog-modal .quill-editor .ql-container{border-radius:4px}.gbot-dialog-modal .quill-editor .ql-container:hover{border:1px solid none;outline:0}.gbot-dialog-modal .quill-editor .quill-editor-send{position:absolute;left:8px;right:8px;bottom:34px;height:0;display:flex;justify-content:space-between}.gbot-dialog-modal .quill-editor .ql-editor:before{font-style:normal;font-weight:400}.gbot-dialog-modal .quill-editor .ql-editor.hide-placeholder:before{display:none!important}.gbot-dialog-modal .quill-editor .shortcut-direct{width:15px;height:15px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .quill-editor .shortcut-direct .gbot-popover-inner-content{padding:0}.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel{width:180px;padding:4px 0}.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel .shortcut-direct-item{display:flex;align-items:center;justify-content:space-between;padding:4px 12px;cursor:pointer}.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel .shortcut-direct-item .title{color:#393939}.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel .shortcut-direct-item .text{color:#84868c}.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel .shortcut-direct-item:hover{background:#f9f2ff}.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel .shortcut-direct-item__disabled{display:flex;align-items:center;justify-content:space-between;padding:4px 12px;cursor:not-allowed}.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel .shortcut-direct-item__disabled .title,.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel .shortcut-direct-item__disabled .text{color:#b8babf}.gbot-dialog-modal .quill-editor__active .ql-container{transition:all .3s,height 0;border:1px solid #b452ff;outline:0;box-shadow:none}.gbot-dialog-modal.inlay .quill-editor .quill-editor-wrapper{max-height:344px;position:relative}.gbot-dialog-modal.inlay .quill-editor .quill-editor-wrapper .ql-editor{min-height:134px;padding-bottom:32px}.gbot-dialog-modal.inlay .quill-editor .quill-editor-wrapper__scroll{overflow-y:auto;scrollbar-width:none}.gbot-dialog-modal.float .quill-editor .quill-editor-wrapper{max-height:200px;position:relative}.gbot-dialog-modal.float .quill-editor .quill-editor-wrapper .ql-editor{min-height:134px;padding-bottom:24px}.gbot-dialog-modal.float .quill-editor .quill-editor-wrapper__scroll{overflow-y:auto;scrollbar-width:none}
1
+ .gbot-dialog-modal .session-history-drawer .gbot-drawer-content-wrapper{height:calc(100% - 54px)!important;border-radius:12px 12px 0 0}.gbot-dialog-modal .session-history-drawer .gbot-drawer-content-wrapper .gbot-drawer-header{padding:12px 16px;border-bottom:none}.gbot-dialog-modal .session-history-drawer .gbot-drawer-content-wrapper .gbot-drawer-header .gbot-drawer-header-title{justify-content:space-between;flex-direction:row-reverse;font-size:16px;color:#393939}.gbot-dialog-modal .session-history-drawer .gbot-drawer-content-wrapper .gbot-drawer-header .gbot-drawer-header-title .gbot-drawer-close{margin:0;padding:0}.gbot-dialog-modal .session-history-drawer .gbot-drawer-content-wrapper .gbot-drawer-body{padding:0 16px 26px}.gbot-dialog-modal .session-history-drawer.loading-panel .gbot-drawer-body{display:flex;justify-content:center;align-items:center}.gbot-dialog-modal .session-history-drawer .bot-session-container .agent-sessions{width:100%}.gbot-dialog-modal .session-history-drawer .bot-session-container .agent-sessions .sessions-main{border:none}
@@ -1 +1 @@
1
- .gbot-dialog-modal .greeting{display:flex;flex-direction:column;align-items:center;flex:1;margin:0 auto;max-width:824px;width:100%;padding:16px 0}.gbot-dialog-modal .greeting-icon{width:74px;height:74px;border-radius:50%;box-shadow:0 6px 16px 2px #070c1414;padding:5px;margin-bottom:24px}.gbot-dialog-modal .greeting-icon img{width:64px;height:64px}.gbot-dialog-modal .greeting-word{font-weight:700;font-size:24px;line-height:30px;margin-bottom:24px}.gbot-dialog-modal .greeting-questions{width:100%;padding:0 12px}.gbot-dialog-modal.inlay .greeting{margin-top:40px}.gbot-dialog-modal.float .greeting{overflow-y:auto;flex:none}
1
+ .gbot-dialog-modal .history-item{margin-bottom:16px}.gbot-dialog-modal .history-item .history-item-user{width:100%}.gbot-dialog-modal .history-item .history-item-user .item-user-panel{display:flex;justify-content:flex-end}.gbot-dialog-modal .history-item .history-item-user .item-user-panel .user-panel-main{max-width:100%}.gbot-dialog-modal .history-item .history-item-user .item-user-panel .user-panel-main .item-user-content{background:#f9f2ff;padding:12px;border-radius:12px 2px 12px 12px;border:1px solid #9c24f2;display:inline-block;width:auto;max-width:100%;color:#070c14;word-wrap:break-word}.gbot-dialog-modal .history-item .history-item-user .item-user-file{display:flex-end;margin-top:10px}.gbot-dialog-modal .history-item .history-item-user .item-user-images{display:flex;justify-content:flex-end}.gbot-dialog-modal .history-item .history-item-user ::selection{background-color:#b1d7ffb3;color:#fff}.gbot-dialog-modal .history-item .history-item-bot{width:100%;border-radius:2px 12px 12px;background:white;padding:0 12px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin{padding-top:12px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-status .plugin-status-success{display:inline-block;width:14px;height:14px;color:#fff;background:#47d1cb;border-radius:50%;font-size:10px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-status .plugin-status-error{display:inline-block;width:14px;height:14px;color:#fff;background:#f95b81;border-radius:50%;font-size:10px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-status .plugin-status-loading{display:inline-block;width:14px;height:14px;color:#477bff;border-radius:50%;font-size:10px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-title{font-weight:700;color:#000000a6}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-action{border:1px solid #00000026;border-radius:4px;color:#000000e0;padding:1px 8px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .gbot-collapse-header{padding:0;height:38px;display:flex;align-items:center}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .gbot-collapse-content-box{padding:0}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-content{height:32px;line-height:32px;font-weight:700}.gbot-dialog-modal .history-item .history-item-bot .item-bot-plugin .bot-plugin-json{background:white}.gbot-dialog-modal .history-item .history-item-bot .item-bot-net{padding-top:12px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content{width:100%;border-radius:2px 12px 12px;background:white;padding:12px 0;word-wrap:break-word}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think{margin-bottom:12px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-top{font-size:14px;line-height:24px;color:#070c14;display:flex;align-items:center;margin-bottom:12px;cursor:pointer}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-top img{width:24px;margin-right:4px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-top .think-action{margin-left:8px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-bottom{font-size:14px;line-height:150%;color:#999;position:relative}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-bottom .bottom-left{background:#d9d9d9;width:1px;position:absolute;left:10px;top:4px;bottom:4px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-bottom .bottom-left .thinking{position:absolute;left:-5px;top:0;width:12px;height:12px;background:#b752ea;border-radius:50%}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-bottom .bottom-left .thinked{position:absolute;z-index:100;left:-5px;top:0;width:12px;height:12px;background:#04d68d;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-size:8px}.gbot-dialog-modal .history-item .history-item-bot .item-bot-content .content-think .think-bottom .bottom-right{padding-left:22px}.gbot-dialog-modal .history-item .gbot-collapse-item{border-radius:4px;background-color:#f5f5f5;margin-bottom:8px;padding:0 0 0 8px}.gbot-dialog-modal .history-item .gbot-collapse-item .gbot-collapse-content{padding-bottom:8px}.gbot-dialog-modal .history-item .gbot-collapse-item:last-child{margin-bottom:0}.gbot-dialog-modal .history-item .gbot-collapse-header-text{width:100%}.gbot-dialog-modal.inlay .history-item__user{display:flex;justify-content:flex-end}.gbot-dialog-modal.inlay .history-item-user,.gbot-dialog-modal.inlay .history-item-bot{max-width:calc(100% - 64px)}.gbot-dialog-modal .session-item-overlay-popover .gbot-popover-inner-content{padding:6px}.gbot-dialog-modal .session-item-overlay-popover .gbot-popover-arrow{display:none}
@@ -1 +1 @@
1
- .gbot-dialog-modal.inlay .questions,.gbot-dialog-modal.float .questions{width:100%}.gbot-dialog-modal .questions .question-tip{display:flex;align-items:center;margin-bottom:10px;height:24px;color:#84868c}.gbot-dialog-modal .questions .question-tip img{width:24px;height:24px}.gbot-dialog-modal .questions .question-row{max-height:260px;overflow-y:auto}.gbot-dialog-modal .questions .question-pannel{background:white;padding:12px;border-radius:8px;width:100%;cursor:pointer;border:1px solid transparent}.gbot-dialog-modal .questions .question-pannel .question-top{font-size:16px;height:32px;color:#070c14;font-weight:700;display:flex;width:100%}.gbot-dialog-modal .questions .question-pannel .question-top .question-top-tip{flex:0 0 24px;margin-right:8px}.gbot-dialog-modal .questions .question-pannel .question-top .question-top-title{flex:0 0 1;overflow:hidden;display:flex;align-items:center}.gbot-dialog-modal .questions .question-pannel .question-top .question-top-type{margin-left:8px;flex:0 0 24px}.gbot-dialog-modal .questions .question-pannel .question-top .question-only-plus-file{margin-left:0}.gbot-dialog-modal .questions .question-pannel .question-top img{width:24px}.gbot-dialog-modal .questions .question-pannel .not-have-top{display:none}.gbot-dialog-modal .questions .question-pannel .question-bottom{font-size:14px;color:#070c14;line-height:21px}.gbot-dialog-modal .questions .question-pannel .multiline-question{height:56px;margin-top:-7px}.gbot-dialog-modal .questions .question-pannel__active{border:1px solid #b452ff;transition:all .25s}.gbot-dialog-modal .questions .multiline-question-pannel{padding:16px 12px}.gbot-dialog-modal .recommend-tooltip-overlay .gbot-tooltip-inner{max-width:400px;max-height:300px;overflow-y:auto}
1
+ .gbot-dialog-modal .quill-editor{position:relative}.gbot-dialog-modal .quill-editor .ql-container{border-radius:4px}.gbot-dialog-modal .quill-editor .ql-container:hover{border:1px solid none;outline:0}.gbot-dialog-modal .quill-editor .quill-editor-send{position:absolute;left:8px;right:8px;bottom:34px;height:0;display:flex;justify-content:space-between}.gbot-dialog-modal .quill-editor .ql-editor:before{font-style:normal;font-weight:400}.gbot-dialog-modal .quill-editor .ql-editor.hide-placeholder:before{display:none!important}.gbot-dialog-modal .quill-editor .shortcut-direct{width:15px;height:15px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .quill-editor .shortcut-direct .gbot-popover-inner-content{padding:0}.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel{width:180px;padding:4px 0}.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel .shortcut-direct-item{display:flex;align-items:center;justify-content:space-between;padding:4px 12px;cursor:pointer}.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel .shortcut-direct-item .title{color:#393939}.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel .shortcut-direct-item .text{color:#84868c}.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel .shortcut-direct-item:hover{background:#f9f2ff}.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel .shortcut-direct-item__disabled{display:flex;align-items:center;justify-content:space-between;padding:4px 12px;cursor:not-allowed}.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel .shortcut-direct-item__disabled .title,.gbot-dialog-modal .quill-editor .shortcut-direct .shortcut-direct-pannel .shortcut-direct-item__disabled .text{color:#b8babf}.gbot-dialog-modal .quill-editor__active .ql-container{transition:all .3s,height 0;border:1px solid #b452ff;outline:0;box-shadow:none}.gbot-dialog-modal.inlay .quill-editor .quill-editor-wrapper{max-height:344px;position:relative}.gbot-dialog-modal.inlay .quill-editor .quill-editor-wrapper .ql-editor{min-height:134px;padding-bottom:32px}.gbot-dialog-modal.inlay .quill-editor .quill-editor-wrapper__scroll{overflow-y:auto;scrollbar-width:none}.gbot-dialog-modal.float .quill-editor .quill-editor-wrapper{max-height:200px;position:relative}.gbot-dialog-modal.float .quill-editor .quill-editor-wrapper .ql-editor{min-height:134px;padding-bottom:24px}.gbot-dialog-modal.float .quill-editor .quill-editor-wrapper__scroll{overflow-y:auto;scrollbar-width:none}
@@ -1 +1 @@
1
- .gbot-dialog-modal .prompt-setting-panel{display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .agent-prompt{margin:12px 12px 0;padding:12px;border-radius:4px;border:1px solid #e8e9eb;background:#fff;flex:1;max-width:824px}.gbot-dialog-modal .agent-prompt .prompt-header{font-size:16px;line-height:24px;font-weight:600;color:#84868c}.gbot-dialog-modal .agent-prompt .prompt-header .prompt-btn{color:#84868c}.gbot-dialog-modal .agent-prompt .prompt-header .prompt-title{color:#5c5f66;font-style:normal;line-height:150%}.gbot-dialog-modal .agent-prompt .prompt-form{margin:12px 12px 0}.gbot-dialog-modal .agent-prompt .prompt-form .gbot-form-item{margin-left:15px}.gbot-dialog-modal .agent-prompt .prompt-form .gbot-collapse{max-height:254px;overflow:auto}.gbot-dialog-modal .agent-prompt .prompt-form .prompt-variables-collapse{border-radius:4px;opacity:1;background:#FFFFFF;width:100%}.gbot-dialog-modal .agent-prompt .prompt-form .gbot-collapse-ghost>.gbot-collapse-item>.gbot-collapse-content>.gbot-collapse-content-box{padding-top:0;padding-bottom:0}.gbot-dialog-modal .agent-prompt .icon-prompt-question{cursor:pointer}.gbot-dialog-modal .prompt-form{margin:12px 12px 0}.gbot-dialog-modal .prompt-form .gbot-form-item{margin-left:15px}.gbot-dialog-modal .prompt-form .gbot-collapse{max-height:254px;overflow:auto}.gbot-dialog-modal .prompt-form .prompt-variables-collapse{border-radius:4px;opacity:1;background:#FFFFFF;width:100%}.gbot-dialog-modal .prompt-form .gbot-collapse-ghost>.gbot-collapse-item>.gbot-collapse-content>.gbot-collapse-content-box{padding-top:0;padding-bottom:0}.gbot-dialog-modal .icon-prompt-question{cursor:pointer}
1
+ .gbot-dialog-modal .file-preview{width:auto;border-radius:6px;border:1px solid #e8e9eb;background:#ffffff;position:relative;display:inline-block;max-height:80px}.gbot-dialog-modal .file-preview .file-icon{height:100%;width:48px}.gbot-dialog-modal .file-preview.small{height:30px;width:150px;padding:3px 6px 3px 3px}.gbot-dialog-modal .file-preview.small .file-icon{width:24px}.gbot-dialog-modal .file-preview .file-desc{flex:1;overflow:hidden}.gbot-dialog-modal .file-preview .file-desc .file-desc-name{color:#5c5f66;font-size:12px;font-style:normal;font-weight:700;line-height:150%;margin-bottom:4px}.gbot-dialog-modal .file-preview .file-action{position:absolute;right:-8px;top:-8px}.gbot-dialog-modal .file-preview .file-process{background-color:#f7f7f9;border-radius:8px;width:16px;height:16px;line-height:16px;text-align:center;display:inline-flex;align-items:center;justify-content:center}.gbot-dialog-modal .file-preview .file-remove{display:inline-block;border-radius:10px;width:20px;height:20px;line-height:20px;text-align:center;color:#84868c;border:1px solid #e8e9eb;display:inline-flex;align-items:center;justify-content:center;background-color:#f7f7f9}.gbot-dialog-modal .file-preview .file-remove:hover{background-color:#fff;color:#b452ff}.gbot-dialog-modal .file-remove-tooltip .gbot-tooltip-content .gbot-tooltip-inner{padding:12px}
@@ -1 +1 @@
1
- .gbot-dialog-modal .footer-upload{display:flex;justify-content:center;align-items:center}.gbot-dialog-modal .footer-upload .upload-enter{padding:0;height:24px;width:24px;display:flex;justify-content:center;align-items:center;cursor:pointer}.gbot-dialog-modal .footer-upload .upload-enter.disabled{color:#b8babf;cursor:not-allowed}.gbot-dialog-modal .footer-upload .upload-enter:hover{background:#ebebeb;border-radius:4px}.gbot-dialog-modal .file-upload{width:100%;display:flex;flex-direction:column}.gbot-dialog-modal .file-upload .gbot-upload-drag{background-color:#fff;border:unset}.gbot-dialog-modal .file-upload .gbot-upload-drag .gbot-upload-btn{padding:0}.gbot-dialog-modal .file-upload .file-upload-icon{font-size:35px;color:#d3d3d3}.gbot-dialog-modal .file-upload .file-upload-action{display:flex;justify-content:center;align-items:center;margin-bottom:12px}.gbot-dialog-modal .file-upload .file-upload-desc{text-align:left;display:flex;flex-direction:column;font-weight:400;font-size:12px;margin:0 auto;color:#84868c;width:232px;line-height:18px;padding-left:20px}.gbot-dialog-modal .file-upload .file-upload-desc .item-upload-desc{line-height:150%}.gbot-dialog-modal .file-upload .file-upload-desc .item-upload-desc__1{display:flex;align-items:center}.gbot-dialog-modal .file-upload .upload-wrapper{height:300px;overflow-y:auto;overflow-x:hidden}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main{flex:1;width:100%;overflow-y:auto;margin-bottom:16px}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-pannel{width:100%}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-empty{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-item{cursor:pointer}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-item .upload-item-file-icon{display:inline-block;width:10px}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-item .upload-item-name{margin-left:10px;display:inline-block;max-width:230px;word-break:break-all}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-item .upload-item-upload-delete{display:inline-block;width:10px;color:#9c24f2;display:none}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-item:hover{background:rgba(0,0,0,.04)}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-item:hover .upload-item-upload-delete{display:inline-block}.gbot-dialog-modal .card-title{display:flex;justify-content:space-between;align-items:center;color:#393939;font-size:14px}.gbot-dialog-modal .card-title .name{font-weight:500}.gbot-dialog-modal .card-title .actions{font-weight:400;display:flex;gap:12px}.gbot-dialog-modal .card-title .actions .action{padding:4px 2px;cursor:pointer}.gbot-dialog-modal .card-title .actions .action .detail{display:flex;gap:6px;align-items:center}.gbot-dialog-modal .split-line{width:100%;height:1px;border:.5px solid #e8e9eb}.gbot-dialog-modal .upload-popover{z-index:1}
1
+ .gbot-dialog-modal .prompt-setting-panel{display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .agent-prompt{margin:12px 12px 0;padding:12px;border-radius:4px;border:1px solid #e8e9eb;background:#fff;flex:1;max-width:824px}.gbot-dialog-modal .agent-prompt .prompt-header{font-size:16px;line-height:24px;font-weight:600;color:#84868c}.gbot-dialog-modal .agent-prompt .prompt-header .prompt-btn{color:#84868c}.gbot-dialog-modal .agent-prompt .prompt-header .prompt-title{color:#5c5f66;font-style:normal;line-height:150%}.gbot-dialog-modal .agent-prompt .prompt-form{margin:12px 12px 0}.gbot-dialog-modal .agent-prompt .prompt-form .gbot-form-item{margin-left:15px}.gbot-dialog-modal .agent-prompt .prompt-form .gbot-collapse{max-height:254px;overflow:auto}.gbot-dialog-modal .agent-prompt .prompt-form .prompt-variables-collapse{border-radius:4px;opacity:1;background:#FFFFFF;width:100%}.gbot-dialog-modal .agent-prompt .prompt-form .gbot-collapse-ghost>.gbot-collapse-item>.gbot-collapse-content>.gbot-collapse-content-box{padding-top:0;padding-bottom:0}.gbot-dialog-modal .agent-prompt .icon-prompt-question{cursor:pointer}.gbot-dialog-modal .prompt-form{margin:12px 12px 0}.gbot-dialog-modal .prompt-form .gbot-form-item{margin-left:15px}.gbot-dialog-modal .prompt-form .gbot-collapse{max-height:254px;overflow:auto}.gbot-dialog-modal .prompt-form .prompt-variables-collapse{border-radius:4px;opacity:1;background:#FFFFFF;width:100%}.gbot-dialog-modal .prompt-form .gbot-collapse-ghost>.gbot-collapse-item>.gbot-collapse-content>.gbot-collapse-content-box{padding-top:0;padding-bottom:0}.gbot-dialog-modal .icon-prompt-question{cursor:pointer}
@@ -1 +1 @@
1
- .gbot-dialog-modal .session-history-drawer .gbot-drawer-content-wrapper{height:calc(100% - 54px)!important;border-radius:12px 12px 0 0}.gbot-dialog-modal .session-history-drawer .gbot-drawer-content-wrapper .gbot-drawer-header{padding:12px 16px;border-bottom:none}.gbot-dialog-modal .session-history-drawer .gbot-drawer-content-wrapper .gbot-drawer-header .gbot-drawer-header-title{justify-content:space-between;flex-direction:row-reverse;font-size:16px;color:#393939}.gbot-dialog-modal .session-history-drawer .gbot-drawer-content-wrapper .gbot-drawer-header .gbot-drawer-header-title .gbot-drawer-close{margin:0;padding:0}.gbot-dialog-modal .session-history-drawer .gbot-drawer-content-wrapper .gbot-drawer-body{padding:0 16px 26px}.gbot-dialog-modal .session-history-drawer.loading-panel .gbot-drawer-body{display:flex;justify-content:center;align-items:center}.gbot-dialog-modal .session-history-drawer .bot-session-container .agent-sessions{width:100%}.gbot-dialog-modal .session-history-drawer .bot-session-container .agent-sessions .sessions-main{border:none}
1
+ .gbot-dialog-modal .footer-upload{display:flex;justify-content:center;align-items:center}.gbot-dialog-modal .footer-upload .upload-enter{padding:0;height:24px;width:24px;display:flex;justify-content:center;align-items:center;cursor:pointer}.gbot-dialog-modal .footer-upload .upload-enter.disabled{color:#b8babf;cursor:not-allowed}.gbot-dialog-modal .footer-upload .upload-enter:hover{background:#ebebeb;border-radius:4px}.gbot-dialog-modal .file-upload{width:100%;display:flex;flex-direction:column}.gbot-dialog-modal .file-upload .gbot-upload-drag{background-color:#fff;border:unset}.gbot-dialog-modal .file-upload .gbot-upload-drag .gbot-upload-btn{padding:0}.gbot-dialog-modal .file-upload .file-upload-icon{font-size:35px;color:#d3d3d3}.gbot-dialog-modal .file-upload .file-upload-action{display:flex;justify-content:center;align-items:center;margin-bottom:12px}.gbot-dialog-modal .file-upload .file-upload-desc{text-align:left;display:flex;flex-direction:column;font-weight:400;font-size:12px;margin:0 auto;color:#84868c;width:232px;line-height:18px;padding-left:20px}.gbot-dialog-modal .file-upload .file-upload-desc .item-upload-desc{line-height:150%}.gbot-dialog-modal .file-upload .file-upload-desc .item-upload-desc__1{display:flex;align-items:center}.gbot-dialog-modal .file-upload .upload-wrapper{height:300px;overflow-y:auto;overflow-x:hidden}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main{flex:1;width:100%;overflow-y:auto;margin-bottom:16px}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-pannel{width:100%}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-empty{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-item{cursor:pointer}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-item .upload-item-file-icon{display:inline-block;width:10px}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-item .upload-item-name{margin-left:10px;display:inline-block;max-width:230px;word-break:break-all}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-item .upload-item-upload-delete{display:inline-block;width:10px;color:#9c24f2;display:none}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-item:hover{background:rgba(0,0,0,.04)}.gbot-dialog-modal .file-upload .upload-wrapper .upload-main .upload-item:hover .upload-item-upload-delete{display:inline-block}.gbot-dialog-modal .card-title{display:flex;justify-content:space-between;align-items:center;color:#393939;font-size:14px}.gbot-dialog-modal .card-title .name{font-weight:500}.gbot-dialog-modal .card-title .actions{font-weight:400;display:flex;gap:12px}.gbot-dialog-modal .card-title .actions .action{padding:4px 2px;cursor:pointer}.gbot-dialog-modal .card-title .actions .action .detail{display:flex;gap:6px;align-items:center}.gbot-dialog-modal .split-line{width:100%;height:1px;border:.5px solid #e8e9eb}.gbot-dialog-modal .upload-popover{z-index:1}
@@ -1 +1 @@
1
- .gbot-dialog-modal .prompt-btn:hover,.gbot-dialog-modal .prompt-btn:active,.gbot-dialog-modal .prompt-btn.active{color:#9c24f2}.gbot-dialog-modal .propmt-manage-popover .gbot-popover-title{display:flex;align-items:center;font-size:16px;border:none}.gbot-dialog-modal .propmt-manage-popover .gbot-popover-title .prompt-popover-title{width:100%;display:flex;justify-content:space-between}.gbot-dialog-modal .propmt-manage-popover .gbot-popover-inner-content{padding:0;width:100%}.gbot-dialog-modal .propmt-manage-popover .gbot-popover-arrow{display:none}.gbot-dialog-modal .propmt-manage-popover .gbot-tabs-nav:before{border:0}
1
+ .gbot-dialog-modal .connect{position:relative}.gbot-dialog-modal .connect .net-tip{position:absolute;top:-45px;left:50%;transform:translate(-88%);white-space:nowrap;background:#ffffff;padding:8px;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:10}
@@ -1 +1 @@
1
- .gbot-dialog-modal .connect{position:relative}.gbot-dialog-modal .connect .net-tip{position:absolute;top:-45px;left:50%;transform:translate(-88%);white-space:nowrap;background:#ffffff;padding:8px;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:10}
1
+ .gbot-dialog-modal .prompt-btn:hover,.gbot-dialog-modal .prompt-btn:active,.gbot-dialog-modal .prompt-btn.active{color:#9c24f2}.gbot-dialog-modal .propmt-manage-popover .gbot-popover-title{display:flex;align-items:center;font-size:16px;border:none}.gbot-dialog-modal .propmt-manage-popover .gbot-popover-title .prompt-popover-title{width:100%;display:flex;justify-content:space-between}.gbot-dialog-modal .propmt-manage-popover .gbot-popover-inner-content{padding:0;width:100%}.gbot-dialog-modal .propmt-manage-popover .gbot-popover-arrow{display:none}.gbot-dialog-modal .propmt-manage-popover .gbot-tabs-nav:before{border:0}
@@ -1 +1 @@
1
- .gbot-dialog-modal .json-display{margin:0;padding:4px}
1
+ .gbot-dialog-modal .input-progress{display:flex}.gbot-dialog-modal .input-progress .progress-point{display:flex;align-items:center;margin-right:8px}.gbot-dialog-modal .input-progress .progress-point .point{width:6px;height:6px;border-radius:50%}.gbot-dialog-modal .input-progress .progress-point .point1{background:#9c24f2;animation:gbot-animation1 1s ease-in infinite}.gbot-dialog-modal .input-progress .progress-point .point2{background:#c47dff;margin:0 3px;animation:gbot-animation2 1s ease-in infinite}.gbot-dialog-modal .input-progress .progress-point .point3{background:#ead4ff;animation:gbot-animation3 1s ease-in infinite}.gbot-dialog-modal .input-progress .progress-waiting{color:#9c24f2}@keyframes gbot-animation1{0%{opacity:0}33%{opacity:1}to{opacity:1}}@keyframes gbot-animation2{0%,33%{opacity:0}67%{opacity:1}to{opacity:1}}@keyframes gbot-animation3{0%,67%{opacity:0}to{opacity:1}}
@@ -1 +1 @@
1
- .gbot-dialog-modal .input-progress{display:flex}.gbot-dialog-modal .input-progress .progress-point{display:flex;align-items:center;margin-right:8px}.gbot-dialog-modal .input-progress .progress-point .point{width:6px;height:6px;border-radius:50%}.gbot-dialog-modal .input-progress .progress-point .point1{background:#9c24f2;animation:gbot-animation1 1s ease-in infinite}.gbot-dialog-modal .input-progress .progress-point .point2{background:#c47dff;margin:0 3px;animation:gbot-animation2 1s ease-in infinite}.gbot-dialog-modal .input-progress .progress-point .point3{background:#ead4ff;animation:gbot-animation3 1s ease-in infinite}.gbot-dialog-modal .input-progress .progress-waiting{color:#9c24f2}@keyframes gbot-animation1{0%{opacity:0}33%{opacity:1}to{opacity:1}}@keyframes gbot-animation2{0%,33%{opacity:0}67%{opacity:1}to{opacity:1}}@keyframes gbot-animation3{0%,67%{opacity:0}to{opacity:1}}
1
+ .gbot-dialog-modal .json-display{margin:0;padding:4px}
@@ -1 +1 @@
1
- .gbot-dialog-modal .search-reference .bot-net-panel{user-select:none;margin-bottom:10px;width:180px;height:32px;background:white;line-height:32px;display:flex;justify-content:space-between;padding:0 12px;cursor:pointer}.gbot-dialog-modal .search-reference .bot-net-main{background:white;padding:12px;line-height:22px}.gbot-dialog-modal .search-reference .bot-net-main .text .link{cursor:pointer;color:#0f64ff}.gbot-dialog-modal .search-reference .think-top{font-size:14px;line-height:24px;color:#070c14;display:flex;align-items:center;margin-bottom:12px;cursor:pointer}.gbot-dialog-modal .search-reference .think-top img{width:24px;margin-right:4px}.gbot-dialog-modal .search-reference .think-top .think-action{margin-left:8px}.gbot-dialog-modal .search-reference .thinking{width:12px;height:12px;background:#b752ea;border-radius:50%;margin:6px}.gbot-dialog-modal .search-reference .thinked{width:12px;height:12px;background:#04d68d;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-size:8px;margin:6px}.gbot-dialog-modal .search-reference .thinked.error{background:#f33e3e}.gbot-dialog-modal .search-reference .item-bot-plugin{line-height:24px}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-status .icon-search{font-size:24px}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-status .plugin-status-success{display:inline-block;width:14px;height:14px;color:#fff;background:#47d1cb;border-radius:50%;font-size:10px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-status .plugin-status-error{display:inline-block;width:14px;height:14px;color:#fff;background:#f95b81;border-radius:50%;font-size:10px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-status .plugin-status-loading{display:inline-block;width:14px;height:14px;color:#477bff;border-radius:50%;font-size:10px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-title{font-weight:700;color:#000000a6}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-action{border:1px solid #00000026;border-radius:4px;color:#000000e0;padding:1px 8px}.gbot-dialog-modal .search-reference .item-bot-plugin .gbot-collapse-header{padding:0;height:38px;display:flex;align-items:center}.gbot-dialog-modal .search-reference .item-bot-plugin .gbot-collapse-content-box{padding:0}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-content{height:32px;line-height:32px;font-weight:700}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-json{background:white}.gbot-dialog-modal .search-reference .gbot-collapse-item{padding:0 8px}.gbot-dialog-modal .search-reference-list{margin-right:8px;border-radius:6px}.gbot-dialog-modal .search-reference-list-item{display:flex;flex-direction:column;padding:12px 8px 8px;gap:0px 10px;flex-wrap:wrap;align-content:flex-start;border-radius:6px;background:#ffffff;box-sizing:border-box;border:1px solid #e5e7eb;margin-bottom:8px}.gbot-dialog-modal .search-reference-list-item :last-child{margin-bottom:0}.gbot-dialog-modal .search-reference-list-item :hover{cursor:pointer}.gbot-dialog-modal .search-reference-list-item-footer{display:flex;justify-content:space-between;padding:0;row-gap:0px;flex-wrap:wrap;align-content:flex-start;z-index:0;line-height:24px;align-items:center}.gbot-dialog-modal .search-reference-list-item-footer .logo{width:24px;height:24px}.gbot-dialog-modal .search-reference-list-item-footer .name{font-family:Roboto;font-size:12x;font-weight:400;line-height:24px;letter-spacing:normal;color:#4b5563}.gbot-dialog-modal .search-reference-list-item-footer .time{font-family:Roboto;font-size:12x;font-weight:400;line-height:24px;letter-spacing:normal;color:#9ca3af}.gbot-dialog-modal .search-reference-list-item-title{font-family:Roboto;font-size:16px;font-weight:600;line-height:28px;letter-spacing:normal;color:#000}.gbot-dialog-modal .search-reference-list-item-title .number{margin-right:4px}.gbot-dialog-modal .search-reference-list-item-content{font-family:Roboto;font-size:14px;font-weight:400;line-height:24px;letter-spacing:normal;color:#4b5563;padding:0 8px;display:inline-block}
1
+ .gbot-dialog-modal .file-item{height:64px;border-radius:6px;overflow:hidden;padding:12px;display:flex;background:white;cursor:pointer}.gbot-dialog-modal .file-item .item-left{flex:0 0 40px;margin-right:8px}.gbot-dialog-modal .file-item .item-left .file-icon{width:100%}.gbot-dialog-modal .file-item .item-main{flex:1;overflow:hidden}.gbot-dialog-modal .file-item .item-main .file-name{width:100%;font-size:14px;color:#070c14;font-weight:700;line-height:18px;margin-bottom:4px}.gbot-dialog-modal .file-item .item-main .file-desc{font-size:12px;height:15px;color:#84868c}
@@ -1 +1 @@
1
- .gbot-dialog-modal .file-item{height:64px;border-radius:6px;overflow:hidden;padding:12px;display:flex;background:white;cursor:pointer}.gbot-dialog-modal .file-item .item-left{flex:0 0 40px;margin-right:8px}.gbot-dialog-modal .file-item .item-left .file-icon{width:100%}.gbot-dialog-modal .file-item .item-main{flex:1;overflow:hidden}.gbot-dialog-modal .file-item .item-main .file-name{width:100%;font-size:14px;color:#070c14;font-weight:700;line-height:18px;margin-bottom:4px}.gbot-dialog-modal .file-item .item-main .file-desc{font-size:12px;height:15px;color:#84868c}
1
+ .gbot-dialog-modal .session-action{display:flex;justify-content:space-between;align-items:center;border-top:1px solid #e8e9eb;color:#84868c}.gbot-dialog-modal .session-action .session-action-again{cursor:pointer;user-select:none}.gbot-dialog-modal .session-action .session-action-again:hover{color:#b452ff}.gbot-dialog-modal .session-action .session-action-comment{border-radius:4px;padding:4px}.gbot-dialog-modal .session-action .session-action-comment .action-comment-feedback{font-size:16px}.gbot-dialog-modal .session-action .session-action-comment .action-comment-feedback .comment-feedback-item{display:inline-block;width:100%;height:100%;cursor:pointer}.gbot-dialog-modal .session-action .session-action-comment .action-comment-feedback .comment-feedback-item:hover{color:#b452ff}.gbot-dialog-modal .session-action .session-action-comment .action-comment-feedback .comment-feedback-item__active{color:#9c24f2}.gbot-dialog-modal .cai-pannel{width:260px;overflow:hidden}.gbot-dialog-modal .cai-pannel .cai-error{color:#f33e3e;margin-bottom:12px}.gbot-dialog-modal .cai-pannel .cai-title{margin-bottom:12px}.gbot-dialog-modal .cai-pannel .cai-title .cai-require{color:#f33e3e}.gbot-dialog-modal .cai-pannel .cai-title .cai-question{color:#070c14;text-align:center;font-size:14px}.gbot-dialog-modal .cai-pannel .cai-list{display:flex;flex-wrap:wrap}.gbot-dialog-modal .cai-pannel .cai-list .cai-item{padding:6px 8px;border-radius:4px;border:1px solid #e8e9eb;margin-bottom:12px;margin-right:12px;cursor:pointer}.gbot-dialog-modal .cai-pannel .cai-list .cai-item:hover{color:#b452ff;border:1px solid #b452ff}.gbot-dialog-modal .cai-pannel .cai-list .cai-item__active{color:#8614cc;border:1px solid #8614cc}.gbot-dialog-modal .chat-item:last-child{margin-bottom:0}
@@ -1 +1 @@
1
- .gbot-dialog-modal .session-action{display:flex;justify-content:space-between;align-items:center;border-top:1px solid #e8e9eb;color:#84868c}.gbot-dialog-modal .session-action .session-action-again{cursor:pointer;user-select:none}.gbot-dialog-modal .session-action .session-action-again:hover{color:#b452ff}.gbot-dialog-modal .session-action .session-action-comment{border-radius:4px;padding:4px}.gbot-dialog-modal .session-action .session-action-comment .action-comment-feedback{font-size:16px}.gbot-dialog-modal .session-action .session-action-comment .action-comment-feedback .comment-feedback-item{display:inline-block;width:100%;height:100%;cursor:pointer}.gbot-dialog-modal .session-action .session-action-comment .action-comment-feedback .comment-feedback-item:hover{color:#b452ff}.gbot-dialog-modal .session-action .session-action-comment .action-comment-feedback .comment-feedback-item__active{color:#9c24f2}.gbot-dialog-modal .cai-pannel{width:260px;overflow:hidden}.gbot-dialog-modal .cai-pannel .cai-error{color:#f33e3e;margin-bottom:12px}.gbot-dialog-modal .cai-pannel .cai-title{margin-bottom:12px}.gbot-dialog-modal .cai-pannel .cai-title .cai-require{color:#f33e3e}.gbot-dialog-modal .cai-pannel .cai-title .cai-question{color:#070c14;text-align:center;font-size:14px}.gbot-dialog-modal .cai-pannel .cai-list{display:flex;flex-wrap:wrap}.gbot-dialog-modal .cai-pannel .cai-list .cai-item{padding:6px 8px;border-radius:4px;border:1px solid #e8e9eb;margin-bottom:12px;margin-right:12px;cursor:pointer}.gbot-dialog-modal .cai-pannel .cai-list .cai-item:hover{color:#b452ff;border:1px solid #b452ff}.gbot-dialog-modal .cai-pannel .cai-list .cai-item__active{color:#8614cc;border:1px solid #8614cc}.gbot-dialog-modal .chat-item:last-child{margin-bottom:0}
1
+ .gbot-dialog-modal .search-reference .bot-net-panel{user-select:none;margin-bottom:10px;width:180px;height:32px;background:white;line-height:32px;display:flex;justify-content:space-between;padding:0 12px;cursor:pointer}.gbot-dialog-modal .search-reference .bot-net-main{background:white;padding:12px;line-height:22px}.gbot-dialog-modal .search-reference .bot-net-main .text .link{cursor:pointer;color:#0f64ff}.gbot-dialog-modal .search-reference .think-top{font-size:14px;line-height:24px;color:#070c14;display:flex;align-items:center;margin-bottom:12px;cursor:pointer}.gbot-dialog-modal .search-reference .think-top img{width:24px;margin-right:4px}.gbot-dialog-modal .search-reference .think-top .think-action{margin-left:8px}.gbot-dialog-modal .search-reference .thinking{width:12px;height:12px;background:#b752ea;border-radius:50%;margin:6px}.gbot-dialog-modal .search-reference .thinked{width:12px;height:12px;background:#04d68d;border-radius:50%;color:#fff;display:flex;align-items:center;justify-content:center;font-size:8px;margin:6px}.gbot-dialog-modal .search-reference .thinked.error{background:#f33e3e}.gbot-dialog-modal .search-reference .item-bot-plugin{line-height:24px}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-status .icon-search{font-size:24px}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-status .plugin-status-success{display:inline-block;width:14px;height:14px;color:#fff;background:#47d1cb;border-radius:50%;font-size:10px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-status .plugin-status-error{display:inline-block;width:14px;height:14px;color:#fff;background:#f95b81;border-radius:50%;font-size:10px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-status .plugin-status-loading{display:inline-block;width:14px;height:14px;color:#477bff;border-radius:50%;font-size:10px;display:flex;align-items:center;justify-content:center}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-title{font-weight:700;color:#000000a6}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-action{border:1px solid #00000026;border-radius:4px;color:#000000e0;padding:1px 8px}.gbot-dialog-modal .search-reference .item-bot-plugin .gbot-collapse-header{padding:0;height:38px;display:flex;align-items:center}.gbot-dialog-modal .search-reference .item-bot-plugin .gbot-collapse-content-box{padding:0}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-content{height:32px;line-height:32px;font-weight:700}.gbot-dialog-modal .search-reference .item-bot-plugin .bot-plugin-json{background:white}.gbot-dialog-modal .search-reference .gbot-collapse-item{padding:0 8px}.gbot-dialog-modal .search-reference-list{margin-right:8px;border-radius:6px}.gbot-dialog-modal .search-reference-list-item{display:flex;flex-direction:column;padding:12px 8px 8px;gap:0px 10px;flex-wrap:wrap;align-content:flex-start;border-radius:6px;background:#ffffff;box-sizing:border-box;border:1px solid #e5e7eb;margin-bottom:8px}.gbot-dialog-modal .search-reference-list-item :last-child{margin-bottom:0}.gbot-dialog-modal .search-reference-list-item :hover{cursor:pointer}.gbot-dialog-modal .search-reference-list-item-footer{display:flex;justify-content:space-between;padding:0;row-gap:0px;flex-wrap:wrap;align-content:flex-start;z-index:0;line-height:24px;align-items:center}.gbot-dialog-modal .search-reference-list-item-footer .logo{width:24px;height:24px}.gbot-dialog-modal .search-reference-list-item-footer .name{font-family:Roboto;font-size:12x;font-weight:400;line-height:24px;letter-spacing:normal;color:#4b5563}.gbot-dialog-modal .search-reference-list-item-footer .time{font-family:Roboto;font-size:12x;font-weight:400;line-height:24px;letter-spacing:normal;color:#9ca3af}.gbot-dialog-modal .search-reference-list-item-title{font-family:Roboto;font-size:16px;font-weight:600;line-height:28px;letter-spacing:normal;color:#000}.gbot-dialog-modal .search-reference-list-item-title .number{margin-right:4px}.gbot-dialog-modal .search-reference-list-item-content{font-family:Roboto;font-size:14px;font-weight:400;line-height:24px;letter-spacing:normal;color:#4b5563;padding:0 8px;display:inline-block}
@@ -1 +1 @@
1
- .gbot-dialog-modal .file-card{height:38px;min-width:232px;max-width:600px;display:flex;padding:6px 12px 6px 6px;align-items:center;gap:4px;border-radius:6px;background:#ffffff;position:relative}.gbot-dialog-modal .file-card .analysis{display:flex;justify-content:center;align-items:center;gap:8px;font-size:12px;font-weight:400;line-height:22px;text-align:left;color:#84868c}.gbot-dialog-modal .file-card .file-icon{height:100%;width:24px}.gbot-dialog-modal .file-card.small{height:30px;width:150px;padding:3px 6px 3px 3px}.gbot-dialog-modal .file-card.small .file-icon{width:24px}.gbot-dialog-modal .file-card .file-desc{flex:1;overflow:hidden}.gbot-dialog-modal .file-card .file-desc .file-desc-name{color:#5c5f66;font-size:12px;font-style:normal;font-weight:700;line-height:150%}.gbot-dialog-modal .file-card .file-desc .file-desc-name:hover{cursor:pointer}.gbot-dialog-modal .file-card .file-desc .file-desc-name:hover .gbot-typography{color:#b452ff}.gbot-dialog-modal .file-card .file-desc .file-desc-size{color:#84868c;font-size:10px;font-style:normal;font-weight:400;line-height:150%}.gbot-dialog-modal .file-card .file-process{background-color:#f7f7f9;border-radius:8px;width:16px;height:16px;line-height:16px;text-align:center;display:inline-flex;align-items:center;justify-content:center}.gbot-dialog-modal .file-card .file-remove{cursor:pointer;display:inline-block;width:16px;height:16px;line-height:16px;text-align:center;color:#151b26;display:inline-flex;align-items:center;justify-content:center}.gbot-dialog-modal .file-card .file-remove:hover{background-color:#fff;color:#b452ff}.gbot-dialog-modal .file-card .file-failed{display:inline-block;width:16px;height:16px;line-height:16px;text-align:center;color:#dc4446;display:inline-flex;align-items:center;justify-content:center}
1
+ .gbot-dialog-modal .gbot-drawer-content-wrapper{height:calc(100% - 54px)!important;border-radius:12px 12px 0 0}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-header{padding:12px 16px;border-bottom:none}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-header .gbot-drawer-header-title{justify-content:space-between;flex-direction:row-reverse;font-size:16px;color:#393939}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-header .gbot-drawer-header-title .gbot-drawer-close{margin:0;padding:0}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body{padding:0 16px 26px}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel{max-height:124px;width:100%;padding:2px 0;border-bottom:1px solid #e8e9eb}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .session-item-space{padding:10px 0;overflow:hidden}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel:hover{cursor:pointer}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .gbot-space{width:100%}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question{font-size:14px;font-weight:700;line-height:21px;color:#070c14;width:100%;display:flex;align-items:center;justify-content:space-between}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .gbot-tag{width:58px;height:24px;padding:1px 8px;border-radius:4px;font-size:14px;font-weight:400;background-color:#9c24f2;color:#fff}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .session-item-name{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .icons-bar{display:flex}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .icons-bar .gbot-btn{margin:0 3px}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .gbot-btn{width:20px;height:20px;padding:0;font-size:12px;color:#000}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .name-edit-panel{width:100%;position:relative}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .name-edit-panel .name-edit-input{width:100%}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .name-edit-panel .name-edit-input .gbot-input-show-count-suffix{font-size:12px;font-weight:400;color:#e0e0e0;margin-right:60px}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .name-edit-panel .gbot-btn{position:absolute;right:12px;top:7px;z-index:999}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .name-edit-panel .gbot-btn .anticon{font-size:14px}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-answer{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#84868c}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file{font-size:12px;color:#84868c}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file .file-icon{width:16px;height:16px}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file .file-name{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file .gbot-tag{font-size:10px;border:1px solid #84868c;background-color:transparent;color:#84868c}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file .file-status-icon{position:absolute;left:6px;top:-2px;border-radius:10px;border:1px solid #fff}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file .success-file-icon{color:#45cc27}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file .failed-file-icon{color:#dc4446}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file .loading-file-icon{height:12px;width:12px;font-size:10px;background-color:#fff}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .current-item{margin:2px 0}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .current-item .session-item-space{border-radius:8px;background-color:#f9f2ff;padding:8px}.gbot-dialog-modal .loading-panel .gbot-drawer-body{display:flex;justify-content:center;align-items:center}
@@ -1 +1 @@
1
- .gbot-dialog-modal .gbot-drawer-content-wrapper{height:calc(100% - 54px)!important;border-radius:12px 12px 0 0}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-header{padding:12px 16px;border-bottom:none}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-header .gbot-drawer-header-title{justify-content:space-between;flex-direction:row-reverse;font-size:16px;color:#393939}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-header .gbot-drawer-header-title .gbot-drawer-close{margin:0;padding:0}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body{padding:0 16px 26px}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel{max-height:124px;width:100%;padding:2px 0;border-bottom:1px solid #e8e9eb}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .session-item-space{padding:10px 0;overflow:hidden}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel:hover{cursor:pointer}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .gbot-space{width:100%}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question{font-size:14px;font-weight:700;line-height:21px;color:#070c14;width:100%;display:flex;align-items:center;justify-content:space-between}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .gbot-tag{width:58px;height:24px;padding:1px 8px;border-radius:4px;font-size:14px;font-weight:400;background-color:#9c24f2;color:#fff}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .session-item-name{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .icons-bar{display:flex}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .icons-bar .gbot-btn{margin:0 3px}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .gbot-btn{width:20px;height:20px;padding:0;font-size:12px;color:#000}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .name-edit-panel{width:100%;position:relative}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .name-edit-panel .name-edit-input{width:100%}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .name-edit-panel .name-edit-input .gbot-input-show-count-suffix{font-size:12px;font-weight:400;color:#e0e0e0;margin-right:60px}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .name-edit-panel .gbot-btn{position:absolute;right:12px;top:7px;z-index:999}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-question .name-edit-panel .gbot-btn .anticon{font-size:14px}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-answer{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#84868c}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file{font-size:12px;color:#84868c}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file .file-icon{width:16px;height:16px}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file .file-name{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file .gbot-tag{font-size:10px;border:1px solid #84868c;background-color:transparent;color:#84868c}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file .file-status-icon{position:absolute;left:6px;top:-2px;border-radius:10px;border:1px solid #fff}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file .success-file-icon{color:#45cc27}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file .failed-file-icon{color:#dc4446}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .session-item-panel .item-file .loading-file-icon{height:12px;width:12px;font-size:10px;background-color:#fff}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .current-item{margin:2px 0}.gbot-dialog-modal .gbot-drawer-content-wrapper .gbot-drawer-body .current-item .session-item-space{border-radius:8px;background-color:#f9f2ff;padding:8px}.gbot-dialog-modal .loading-panel .gbot-drawer-body{display:flex;justify-content:center;align-items:center}
1
+ .gbot-dialog-modal .file-card{height:38px;min-width:232px;max-width:600px;display:flex;padding:6px 12px 6px 6px;align-items:center;gap:4px;border-radius:6px;background:#ffffff;position:relative}.gbot-dialog-modal .file-card .analysis{display:flex;justify-content:center;align-items:center;gap:8px;font-size:12px;font-weight:400;line-height:22px;text-align:left;color:#84868c}.gbot-dialog-modal .file-card .file-icon{height:100%;width:24px}.gbot-dialog-modal .file-card.small{height:30px;width:150px;padding:3px 6px 3px 3px}.gbot-dialog-modal .file-card.small .file-icon{width:24px}.gbot-dialog-modal .file-card .file-desc{flex:1;overflow:hidden}.gbot-dialog-modal .file-card .file-desc .file-desc-name{color:#5c5f66;font-size:12px;font-style:normal;font-weight:700;line-height:150%}.gbot-dialog-modal .file-card .file-desc .file-desc-name:hover{cursor:pointer}.gbot-dialog-modal .file-card .file-desc .file-desc-name:hover .gbot-typography{color:#b452ff}.gbot-dialog-modal .file-card .file-desc .file-desc-size{color:#84868c;font-size:10px;font-style:normal;font-weight:400;line-height:150%}.gbot-dialog-modal .file-card .file-process{background-color:#f7f7f9;border-radius:8px;width:16px;height:16px;line-height:16px;text-align:center;display:inline-flex;align-items:center;justify-content:center}.gbot-dialog-modal .file-card .file-remove{cursor:pointer;display:inline-block;width:16px;height:16px;line-height:16px;text-align:center;color:#151b26;display:inline-flex;align-items:center;justify-content:center}.gbot-dialog-modal .file-card .file-remove:hover{background-color:#fff;color:#b452ff}.gbot-dialog-modal .file-card .file-failed{display:inline-block;width:16px;height:16px;line-height:16px;text-align:center;color:#dc4446;display:inline-flex;align-items:center;justify-content:center}
@@ -1 +1 @@
1
- .gbot-dialog-modal .knowledge-select{width:204px;height:28px;border-radius:10px;border:1px solid}.gbot-dialog-modal .knowledge-select .select-popover{cursor:pointer;width:100%;height:100%;padding:0 8px;display:flex;align-items:center;justify-content:space-between;font-size:14px;font-weight:400}.gbot-dialog-modal .knowledge-select .select-popover .select-icon{color:#84868c}.gbot-dialog-modal .knowledge-select .select-popover .title{line-height:22px;color:#84868c}.gbot-dialog-modal .knowledge-select .select-popover .content{padding:2px 8px;border-radius:4px;background:#f7f7f9;line-height:18px;color:#84868c}.gbot-dialog-modal .knowledge-select .gbot-popover-placement-bottomRight{padding-top:5px!important}.gbot-dialog-modal .knowledge-select .gbot-popover-placement-bottomRight .gbot-popover-arrow{display:none}.gbot-dialog-modal .knowledge-select .gbot-popover-placement-bottomRight .gbot-popover-inner .gbot-popover-inner-content{height:200px;overflow-y:auto;font-size:14px;font-weight:400;line-height:21px;color:#84868c}
1
+ .gbot-dialog-modal .session-refer{padding:12px 0;border-top:1px solid #e8e9eb}.gbot-dialog-modal .session-refer .session-refer-header{color:#070c14;margin-bottom:12px;height:18px;display:flex;align-items:center}.gbot-dialog-modal .session-refer .session-refer-header .refer-header-title{font-style:normal;font-weight:400;line-height:150%}.gbot-dialog-modal .session-refer .session-refer-content .refer-markdown p{color:#84868c;line-height:150%}.gbot-dialog-modal .session-refer .gbot-collapse-header{padding:4px 0!important}.gbot-dialog-modal .session-refer .gbot-collapse-content-box{padding:4px 10px 4px 24px!important}
@@ -1 +1 @@
1
- .gbot-dialog-modal .session-refer{padding:12px 0;border-top:1px solid #e8e9eb}.gbot-dialog-modal .session-refer .session-refer-header{color:#070c14;margin-bottom:12px;height:18px;display:flex;align-items:center}.gbot-dialog-modal .session-refer .session-refer-header .refer-header-title{font-style:normal;font-weight:400;line-height:150%}.gbot-dialog-modal .session-refer .session-refer-content .refer-markdown p{color:#84868c;line-height:150%}.gbot-dialog-modal .session-refer .gbot-collapse-header{padding:4px 0!important}.gbot-dialog-modal .session-refer .gbot-collapse-content-box{padding:4px 10px 4px 24px!important}
1
+ .gbot-dialog-modal .knowledge-select{width:204px;height:28px;border-radius:10px;border:1px solid}.gbot-dialog-modal .knowledge-select .select-popover{cursor:pointer;width:100%;height:100%;padding:0 8px;display:flex;align-items:center;justify-content:space-between;font-size:14px;font-weight:400}.gbot-dialog-modal .knowledge-select .select-popover .select-icon{color:#84868c}.gbot-dialog-modal .knowledge-select .select-popover .title{line-height:22px;color:#84868c}.gbot-dialog-modal .knowledge-select .select-popover .content{padding:2px 8px;border-radius:4px;background:#f7f7f9;line-height:18px;color:#84868c}.gbot-dialog-modal .knowledge-select .gbot-popover-placement-bottomRight{padding-top:5px!important}.gbot-dialog-modal .knowledge-select .gbot-popover-placement-bottomRight .gbot-popover-arrow{display:none}.gbot-dialog-modal .knowledge-select .gbot-popover-placement-bottomRight .gbot-popover-inner .gbot-popover-inner-content{height:200px;overflow-y:auto;font-size:14px;font-weight:400;line-height:21px;color:#84868c}
package/dist/lib/index.js CHANGED
@@ -316,7 +316,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
316
316
  `)})}),N.jsx("div",{className:"item-user-panel",children:N.jsx(R.Popover,{placement:"topLeft",overlayStyle:{padding:4},overlayClassName:"session-item-overlay-popover",getPopupContainer:te=>te.parentNode,content:g!=null&&g.userEdit||g!=null&&g.userCopy?N.jsxs(R.Space,{className:"item-user-popover",size:4,children:[(g==null?void 0:g.userEdit)&&N.jsx("div",{className:"user-pannel-item",onClick:()=>l==null?void 0:l(r.content),children:N.jsx(R.Button,{type:"link",size:"small",icon:N.jsx(ct,{type:"icon-bianji2"})})}),(g==null?void 0:g.userCopy)&&N.jsx("div",{className:"user-pannel-item",onClick:z,children:N.jsx(R.Button,{type:"link",size:"small",icon:N.jsx(ct,{type:"icon-fuzhi",style:{fontSize:"16px"}})})})]}):null,children:N.jsx("div",{className:"user-panel-main",children:N.jsx("span",{className:"item-user-content",children:N.jsx(Su,{showLatex:!1,children:Bte(r.content)})})})})}),N.jsx("div",{className:"item-user-file",children:N.jsx(R.Row,{gutter:[12,12],justify:"end",wrap:!0,children:(j=r.files)==null?void 0:j.map(te=>N.jsx(R.Col,{className:"user-file-col",children:N.jsx(Vte,{docViewerUrl:u,currentSession:n,file:te})},te.id))})})]}),I&&N.jsx("div",{className:"history-item-bot",children:N.jsxs("div",{className:"bot-content-wrapper",children:[t.type===2&&N.jsxs("div",{className:"item-bot-plugin",children:[N.jsx(R.Collapse,{ghost:!0,expandIconPosition:"right",children:(F=r.actions)==null?void 0:F.map((te,Re)=>{var he,Ae,_,je,we,E,X,ge,Le,K,ee,ce;return N.jsxs(A,{collapsible:M?"header":"icon",showArrow:M,header:N.jsxs(R.Space,{size:8,style:{width:"100%"},children:[N.jsxs("span",{className:"bot-plugin-status",children:[(te[te.length-1].type==="RESULT"||te[te.length-1].type==="AFTER_CALL")&&Ou((he=te.find(ue=>ue.type==="RESULT"))==null?void 0:he.data.result)&&N.jsx("span",{className:"plugin-status-success",children:N.jsx(At.CheckOutlined,{})}),te[te.length-1].type==="ABORT"&&N.jsx("span",{className:"plugin-status-error",children:N.jsx(At.CloseOutlined,{})}),(te[te.length-1].type==="RESULT"||te[te.length-1].type==="AFTER_CALL")&&!Ou((Ae=te.find(ue=>ue.type==="RESULT"))==null?void 0:Ae.data.result)&&N.jsx("span",{className:"plugin-status-error",children:N.jsx(At.CloseOutlined,{})}),(te[te.length-1].type==="BEFORE_CALL"||te[te.length-1].type==="FUNCTION_CALL")&&N.jsx("span",{className:"plugin-status-loading",children:N.jsx(At.LoadingOutlined,{})})]}),N.jsx("span",{className:"bot-plugin-title",children:((_=te[te.length-1].data)==null?void 0:_.pluginName)||((je=te[te.length-1].data)==null?void 0:je.pluginCode)}),N.jsx("span",{className:"bot-plugin-action",children:((we=te[te.length-1].data)==null?void 0:we.funcName)||((E=te[te.length-1].data)==null?void 0:E.funcCode)}),(te[te.length-1].type==="BEFORE_CALL"||te[te.length-1].type==="FUNCTION_CALL")&&N.jsx("span",{className:"bot-plugin-result",children:"执行中"}),(te[te.length-1].type==="RESULT"||te[te.length-1].type==="AFTER_CALL")&&Ou((X=te.find(ue=>ue.type==="RESULT"))==null?void 0:X.data.result)&&N.jsx("span",{className:"bot-plugin-result",children:"执行成功"}),(te[te.length-1].type==="RESULT"||te[te.length-1].type==="AFTER_CALL")&&!Ou((ge=te.find(ue=>ue.type==="RESULT"))==null?void 0:ge.data.result)&&N.jsx("span",{className:"bot-plugin-result",children:"执行失败"}),te[te.length-1].type==="ABORT"&&N.jsx("span",{className:"bot-plugin-result",children:"执行中止"})]}),children:[N.jsx("div",{className:"bot-plugin-content",children:"thought"}),N.jsx("div",{className:"bot-plugin-json",children:N.jsx(xu,{josn:(Le=te.find(ue=>ue.type==="BEFORE_CALL"))==null?void 0:Le.data.thought})}),N.jsx("div",{className:"bot-plugin-content",children:"parameters"}),N.jsx("div",{className:"bot-plugin-json",children:N.jsx(xu,{josn:(K=te.find(ue=>ue.type==="BEFORE_CALL"))==null?void 0:K.data.parameters})}),N.jsx("div",{className:"bot-plugin-content",children:"requestBody"}),N.jsx("div",{className:"bot-plugin-json",children:N.jsx(xu,{josn:(ee=te.find(ue=>ue.type==="BEFORE_CALL"))==null?void 0:ee.data.requestBody})}),N.jsx("div",{className:"bot-plugin-content",children:"Response"}),N.jsx("div",{className:"bot-plugin-json",children:N.jsx(xu,{josn:qte((ce=te.find(ue=>ue.type==="RESULT"))==null?void 0:ce.data.result)})})]},Re)})}),r.isLoading&&N.jsx("div",{className:"history-input-progress",style:{padding:"4px 0"},children:r.content||T2(r.actions)?null:N.jsx(cu,{size:4,text:"思考中"})})]}),!!((H=r.searchReference)!=null&&H.length)&&N.jsx("div",{className:"item-bot-net",children:N.jsx($te,{history:r})}),(S=r==null?void 0:r.reference)!=null&&S.length&&((O=g==null?void 0:g.reference)!=null&&O.referenceFirst)?N.jsx(m2,{history:r,docViewerUrl:u,markdown:d}):null,N.jsxs("div",{className:"item-bot-content",children:[(r==null?void 0:r.reasoningContent)&&N.jsxs("div",{className:"content-think",children:[(r==null?void 0:r.reasoningContent)&&N.jsxs("div",{className:"think-top",onClick:()=>{D(!y)},children:[N.jsx("img",{src:R2,alt:""}),(r==null?void 0:r.reasoningContent)&&!(r!=null&&r.content)&&N.jsx("span",{children:"我正在推理思考…"}),(r==null?void 0:r.reasoningContent)&&r.content&&N.jsxs("span",{children:["已完成推理(用时 ",(r==null?void 0:r.thinkingSecs)||0," 秒)"]}),N.jsx("span",{className:"think-action",children:y?N.jsx(ct,{type:"icon-zhankai",style:{fontSize:16}}):N.jsx(ct,{type:"icon-shouqi",style:{fontSize:16}})})]}),!!((B=r==null?void 0:r.reasoningContent)!=null&&B.trim())&&y&&N.jsxs("div",{className:"think-bottom",children:[N.jsxs("div",{className:"bottom-left",children:[(r==null?void 0:r.thinkingStatus)===Ge.IThinkingStatus.Start&&N.jsx("div",{className:"thinking"}),(r==null?void 0:r.thinkingStatus)===Ge.IThinkingStatus.End&&N.jsx("div",{className:"thinked",children:N.jsx(At.CheckOutlined,{})})]}),N.jsx("div",{className:"bottom-right",children:N.jsx(Su,Et(re({},d),{children:(r==null?void 0:r.reasoningContent)||""}))})]})]}),N.jsx(Su,Et(re({},d),{children:r.content}))]}),(Y=r==null?void 0:r.reference)!=null&&Y.length&&!((W=g==null?void 0:g.reference)!=null&&W.referenceFirst)?N.jsx(m2,{history:r,docViewerUrl:u,markdown:d}):null,r.isRelatedQuestion&&a?N.jsx("div",{style:{paddingBottom:12},children:N.jsx(cu,{size:4})}):null,r.isRelateLoading&&N.jsx("div",{className:"history-input-progress",style:{padding:"4px 0"},children:T2(r.actions)?null:N.jsx(cu,{size:4,text:"思考中"})}),t.arrange[0].recommendQuestionOpen&&(g==null?void 0:g.relate)&&a&&!!((ne=r.relatedQuesion)!=null&&ne.length)&&N.jsx(Wte,{relatedQuesion:r.relatedQuesion,onRelatedClick:i}),c&&!r.isSensitive&&!!r.messageId&&N.jsx(kte,{appId:t.id,history:r,sessionId:(se=n==null?void 0:n.data)==null?void 0:se.id,onAgainClick:s,isLastHistory:a,currentSession:n})]})}),r.isContext&&N.jsxs(R.Divider,{children:[N.jsx("div",{style:{color:"#84868C",fontSize:"12px"},children:"已开启新话题"})," "]}),r.isWaiting&&N.jsx("div",{className:"history-input-progress",children:N.jsx(cu,{size:4,text:"思考中"})})]})};const Zte=e=>{const{className:t,style:n,id:r,file:a,actions:{upload:i,remove:s,checkStatus:o}={},onUrlChange:u,onStatusChange:l}=e,[c,d]=L.useState(e.uploading),[M,g]=L.useState(!1);L.useEffect(()=>{d(e.uploading)},[e.uploading]);const[f,m]=L.useState(e.url);L.useEffect(()=>{m(e.url)},[e.url]),L.useEffect(()=>{i&&a instanceof File&&(f||c||(d(!0),i(a).then(D=>{m(D),u&&u(D)}).catch(D=>g(D)).finally(()=>d(!1))))},[i,f,a]);const[I,A]=L.useState(a instanceof File||a==null?void 0:a.status);L.useEffect(()=>{A(a instanceof File||a==null?void 0:a.status)},[a]);const y=()=>{r&&o&&I===Ge.AecKnowledgeFileStatus.Processing&&o(r).then(D=>{D!==I&&(I!==void 0&&l&&l(D),A(D))}).catch(D=>A(Ge.AecKnowledgeFileStatus.Failed))};return L.useEffect(()=>{y()},[r,o,I]),L.useEffect(()=>{Ute(a).then(D=>{m(D)})},[a]),a?N.jsxs("div",{className:`file-preview ${t}`,style:n,children:[N.jsx(R.Image,{src:f,className:"file-icon"}),c&&N.jsx(R.Spin,{className:"file-action file-process",indicator:N.jsx(At.LoadingOutlined,{style:{fontSize:16},spin:!0})}),!c&&s&&N.jsx(R.Tooltip,{overlayClassName:"file-remove-tooltip",title:"删除文件",getPopupContainer:D=>D.parentNode,children:N.jsx(R.Button,{className:"file-action file-remove",icon:N.jsx(ct,{style:{fontSize:"10px"},type:"icon-shanchu"}),onClick:()=>{s(a,r)}})})]}):N.jsx(N.Fragment,{})};const Gx=L.forwardRef((e,t)=>{var _,je,we;const{text:n,onTextSend:r,disabled:a,maxLength:i=0,onChange:s,networkStatus:o,clearAction:u,loading:l}=e,[c,d]=L.useState(!0),[M,g]=L.useState(),[f,m]=L.useState(),[I,A]=L.useState(15),[y,D]=L.useState(12),[z,w]=L.useState(0),[j,F]=L.useState(!1),H=L.useRef(null),S=L.useRef(null);L.useImperativeHandle(t,()=>({clear:Y,prevent:W,focus:ne,update:B,getCurrentText:()=>f})),L.useEffect(()=>{if(g(n),n){const E=document.createElement("div");E.innerHTML=n;const X=E.textContent||E.innerText||"";m(X.replace(/[\n\s]+$/,""))}else m(void 0);S.current&&(se(),ne())},[n]),L.useEffect(()=>{if(!S.current)return;const E=S.current.getEditor();if(E&&E.bounds!==document.body)try{console.log("设置 bounds"),E.bounds=document.body}catch(X){console.warn("设置 bounds 失败:",X)}},[S.current]);const O=()=>{var K;if(!S.current)return;const E=S.current.getEditor(),X=E.root;let Le=E.getText().trim().length>0;if(!Le){const ee=X.querySelectorAll("p");for(const ce of Array.from(ee)){const ue=Array.from(ce.childNodes);if(ue.length>1||ue.length===1&&((K=ue[0].nodeName)==null?void 0:K.toLowerCase())!=="br"){Le=!0;break}}}Le?X.classList.add("hide-placeholder"):X.classList.remove("hide-placeholder")};L.useEffect(()=>{O()},[M]),L.useEffect(()=>{if(!S.current)return;const E=S.current.getEditor().root,X=()=>{E.classList.add("hide-placeholder")},ge=()=>{setTimeout(()=>{O()},0)};return E.addEventListener("compositionstart",X),E.addEventListener("compositionend",ge),()=>{E.removeEventListener("compositionstart",X),E.removeEventListener("compositionend",ge)}},[S.current]);const B=E=>{g(E),setTimeout(()=>{O()},0)},Y=()=>{g(void 0),m(void 0),S.current&&S.current.getEditor().root.classList.remove("hide-placeholder")},W=()=>{},ne=()=>{if(!S.current||c)return;const E=S.current.getEditor();E.focus(),setTimeout(()=>{E.getLength()>0&&E.setSelection(E.getLength(),E.getLength())})};L.useEffect(()=>{if(!S.current)return;const E=S.current.getEditor();i&&(E.on("text-change",()=>{E.getLength()>i&&E.deleteText(i,E.getLength()),se(),te(),ne()}),E.on("selection-change",te))},[S,i]);const se=()=>{if(!S.current)return;const E=S.current.getEditor(),X=E.getBounds(E.getLength()-1,E.getLength());X&&(A(X.left),D(X.top))},te=E=>{if(!S.current)return;const X=S.current.getEditor(),ge=E||X.getSelection();(ge==null?void 0:ge.index)!==void 0&&w(ge==null?void 0:ge.index)};Hr.useKeyPress("1",()=>{var X;const E=(X=S.current)==null?void 0:X.getEditor();j&&o&&(E==null||E.blur(),setTimeout(()=>Re()))}),Hr.useKeyPress("2",()=>{var X;const E=(X=S.current)==null?void 0:X.getEditor();j&&(E==null||E.blur(),setTimeout(()=>he()))});const Re=()=>{var X;if(!o)return;const E=(X=S.current)==null?void 0:X.getEditor();E==null||E.focus(),F(!1),setTimeout(()=>E==null?void 0:E.insertText(z,Js.NETWORK))},he=()=>{var X;const E=(X=S.current)==null?void 0:X.getEditor();E==null||E.focus(),F(!1),setTimeout(()=>E==null?void 0:E.insertText(z,Js.DOCUMENT))},Ae=()=>{var X,ge,Le;const E=(X=S.current)==null?void 0:X.getEditor();return E&&(E==null?void 0:E.getLength())>2&&!((ge=E.getText())!=null&&ge.includes(Js.NETWORK))&&!((Le=E.getText())!=null&&Le.includes(Js.DOCUMENT))};return L.useEffect(()=>{var E,X;l?(E=S.current)==null||E.getEditor().disable():(X=S.current)==null||X.getEditor().enable()},[l]),L.useEffect(()=>(window.addEventListener("resize",se),()=>{window.removeEventListener("resize",se)}),[]),N.jsxs("div",{className:wn({"quill-editor":!0,"quill-editor__active":c}),children:[N.jsxs("div",{className:wn({"quill-editor-wrapper":!0,"quill-editor-wrapper__scroll":y>=200}),onKeyDownCapture:E=>{!E.shiftKey&&E.code==="Enter"&&E.preventDefault()},children:[N.jsx(dO,{theme:"snow",placeholder:"输入你想问的,shift+enter 换行。",ref:S,bounds:document.body,onFocus:()=>d(!0),onBlur:()=>d(!1),onKeyDown:E=>{if(!E.shiftKey&&E.keyCode==13){const X=M==null?void 0:M.replace(/[\n\s]+$/,"");g(X),r&&r(f)}},value:M,modules:{toolbar:!1},onChange:(E,X,ge,Le)=>{if(!X)return;g(E);const K=Le.getText().replace(/[\n\s]+$/,"");m(K),s&&s(E,Le)}}),N.jsx("div",{className:"shortcut-direct",ref:H,style:{position:"absolute",left:I+4,top:y,cursor:"pointer",visibility:Ae()?"visible":"hidden"},children:N.jsx(R.Popover,{autoAdjustOverflow:!0,placement:"top",trigger:"hover",getPopupContainer:E=>E.parentNode,onVisibleChange:E=>{F(E)},content:N.jsxs("div",{className:"shortcut-direct-pannel",children:[N.jsxs("div",{className:wn({"shortcut-direct-item":o,"shortcut-direct-item__disabled":!o}),onClick:Re,children:[N.jsx("span",{className:"title",children:"指定联网回答"}),N.jsx("span",{className:"text",children:"快捷键1"})]}),N.jsxs("div",{className:"shortcut-direct-item",onClick:he,children:[N.jsx("span",{className:"title",children:"指定文档回答"}),N.jsx("span",{className:"text",children:"快捷键2"})]})]})})})]}),N.jsxs("div",{className:"quill-editor-send",children:[N.jsx("div",{style:{height:32},children:u||N.jsx("span",{})}),N.jsxs("div",{style:{height:32,display:"flex",alignItems:"center"},children:[N.jsxs(R.Space,{size:2,style:{color:"#84868C"},children:[N.jsx("span",{children:((_=S.current)==null?void 0:_.getEditor())&&((we=(je=S.current)==null?void 0:je.getEditor())==null?void 0:we.getLength())-1}),N.jsx("span",{children:"/"}),N.jsx("span",{children:i})]}),N.jsx(R.Button,{type:"link",ghost:!0,disabled:a||!f,loading:l,icon:N.jsx(ct,{className:"icon-sendMsg",style:{fontSize:24},type:"icon-fasong"}),onClick:()=>{r&&r(f)}})]})]})]})});Gx.displayName="QuillEditor";const Xte="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMuNzUgNS43ODE0N0MzLjc1IDQuNzgyNzcgNC4xMTQwMiA0LjIxMjA2IDQuNTM2NDggMy45NTQ4QzQuOTYyNTUgMy42OTUzNSA1LjY1NTQzIDMuNjI4MTkgNi41NzYgNC4wNzg3NUw2LjU3NjMyIDQuMDc4OTFMMTAuNTcxNiA2LjA0MDUxTDEwLjU3MjQgNi4wNDA4OEMxMC44NTIgNi4xNzc3OSAxMS4xNDk1IDYuNDU0NjcgMTEuMzc5MiA2LjgxOTA4QzExLjYwOTIgNy4xODM5NyAxMS43MjcyIDcuNTY2NzMgMTEuNzI3MiA3Ljg2OTM2VjEwLjU1MzhDMTEuNzI2OSAxMC41NjE5IDExLjcyNjggMTAuNTcwMSAxMS43MjY4IDEwLjU3ODRWMjAuMjUwN0g0Ljg5OTA0QzQuMjU1MTkgMjAuMjUwNyAzLjc1IDE5LjczNTUgMy43NSAxOS4xMzc2VjUuNzgxNDdaTTEyLjQ4NzIgMjEuNzUwN0gxOC4xNTU5QzE5LjIyOSAyMS43NTA3IDIwLjE3MiAyMS41MDMzIDIwLjgzNzMgMjAuODM4QzIxLjUwMjYgMjAuMTcyNyAyMS43NSAxOS4yMjk4IDIxLjc1IDE4LjE1NjdWMTQuNzU0NkwyMS43NSAxNC43NDM0QzIxLjc1MDEgMTQuNjk3NSAyMS43NTAzIDE0LjYxNCAyMS43MzkyIDE0LjUxOTlDMjEuNzAwOCAxMy41MjkxIDIxLjM5MzkgMTIuNzYxNiAyMC44NDE4IDEyLjIwNDhDMjAuMjk5MyAxMS42NTc3IDE5LjU5OTEgMTEuMzk1MyAxOC45Mzg2IDExLjI1MDFMMTguOTM3OSAxMS4yNDk5TDE3LjExNDIgMTAuODQ1N0wxNy4xMTIyIDEwLjg0NTJMMTMuMjI3MiA5Ljk3MzI3VjcuODY5MzZDMTMuMjI3MiA3LjIxNzk2IDEyLjk4OTcgNi41NjExOSAxMi42NDgyIDYuMDE5MjlDMTIuMzA2NCA1LjQ3Njk5IDExLjgxNjUgNC45Nzk5MSAxMS4yMzIyIDQuNjkzNzlMMTEuMjMyIDQuNjkzNjdMNy4yMzY2MiAyLjczMjA2TDcuMjM1ODQgMi43MzE2OEM2LjAwNTUzIDIuMTI5MzkgNC43NDU0OCAyLjA3MTMgMy43NTYzMiAyLjY3MzY1QzIuNzYzNDkgMy4yNzgyMyAyLjI1IDQuNDIyMTEgMi4yNSA1Ljc4MTQ3VjE5LjEzNzZDMi4yNSAyMC41OTE4IDMuNDU0ODQgMjEuNzUwNyA0Ljg5OTA0IDIxLjc1MDdIMTIuNDc3MkMxMi40ODA1IDIxLjc1MDcgMTIuNDgzOSAyMS43NTA3IDEyLjQ4NzIgMjEuNzUwN1pNMTMuMjI3MiAyMC4yNTA3VjExLjUxMDZMMTYuNzg1NyAxMi4zMDkzTDE2Ljc4NzYgMTIuMzA5N0wxOC42MTQ2IDEyLjcxNDdMMTguNjE2IDEyLjcxNUMxOS4xNDMzIDEyLjgzMDggMTkuNTIyOCAxMy4wMDUgMTkuNzc2NiAxMy4yNjFDMjAuMDEzNiAxMy41IDIwLjIxODkgMTMuODg5MyAyMC4yNDE0IDE0LjYwN0MyMC4yNDIzIDE0LjYzNjkgMjAuMjQ1IDE0LjY2NjYgMjAuMjQ5NSAxNC42OTYyQzIwLjI0OTYgMTQuNzAwMSAyMC4yNDk4IDE0LjcwNjIgMjAuMjQ5OSAxNC43MTZMMjAuMjUgMTQuNzU0NlYxOC4xNTY3QzIwLjI1IDE5LjAyNzYgMjAuMDQ3MyAxOS41MDY3IDE5Ljc3NjcgMTkuNzc3M0MxOS41MDYgMjAuMDQ4IDE5LjAyNjkgMjAuMjUwNyAxOC4xNTU5IDIwLjI1MDdIMTMuMjI3MloiIGZpbGw9IiMwNzBDMTQiLz4KPHBhdGggZD0iTTUuNDI2NzYgOS4zMDA1NEM1LjQyNjc2IDguODg2MzIgNS43NjI1NCA4LjU1MDU0IDYuMTc2NzYgOC41NTA1NEg5LjI5OTgzQzkuNzE0MDQgOC41NTA1NCAxMC4wNDk4IDguODg2MzIgMTAuMDQ5OCA5LjMwMDU0QzEwLjA0OTggOS43MTQ3NSA5LjcxNDA0IDEwLjA1MDUgOS4yOTk4MyAxMC4wNTA1SDYuMTc2NzZDNS43NjI1NCAxMC4wNTA1IDUuNDI2NzYgOS43MTQ3NSA1LjQyNjc2IDkuMzAwNTRaTTUuNDI2NzYgMTIuOTAwNUM1LjQyNjc2IDEyLjQ4NjMgNS43NjI1NCAxMi4xNTA1IDYuMTc2NzYgMTIuMTUwNUg5LjI5OTgzQzkuNzE0MDQgMTIuMTUwNSAxMC4wNDk4IDEyLjQ4NjMgMTAuMDQ5OCAxMi45MDA1QzEwLjA0OTggMTMuMzE0NyA5LjcxNDA0IDEzLjY1MDUgOS4yOTk4MyAxMy42NTA1SDYuMTc2NzZDNS43NjI1NCAxMy42NTA1IDUuNDI2NzYgMTMuMzE0NyA1LjQyNjc2IDEyLjkwMDVaTTE0LjkyNTIgMTYuNTAwNkMxNi4wNDEyIDE2LjUwMDYgMTYuOTUwMiAxNS41OTE1IDE2Ljk1MDIgMTQuNDc1NVYxMS41Nzc1TDEyLjkwMDEgMTAuNjY4NVYxNC40NzU1QzEyLjkwMDEgMTUuNTkxNSAxMy44MDgzIDE2LjUwMDYgMTQuOTI1MiAxNi41MDA2WiIgZmlsbD0iI0I0NTJGRiIvPgo8cGF0aCBkPSJNMTguOTc1MiAxNi41MDA4QzE3Ljg1ODMgMTYuNTAwOCAxNi45NTAyIDE1LjU5MTggMTYuOTUwMiAxNC40NzU3VjExLjU3NzdMMTguNzc3MiAxMS45ODI3QzE5Ljk2NTMgMTIuMjQzNyAyMC45MzczIDEyLjg1NTggMjAuOTkxMyAxNC41ODM4QzIwLjkzNzMgMTUuNjQ1OSAyMC4wNTUzIDE2LjUwMDggMTguOTc1MiAxNi41MDA4WiIgZmlsbD0iI0Q3QThGRiIvPgo8L3N2Zz4K",Jte=e=>{var c;const{item:t,isRecommendClearing:n,isOnlyQuestion:r,question:a,setQuestion:i,onItemClick:s}=e,[o,u]=L.useState(!1),{popupContainer:l}=L.useContext(an);return L.useEffect(()=>{t&&(!t.icon&&!t.file.url&&!t.name?u(!0):u(!1))},[t]),N.jsxs(R.Space,{direction:"vertical",size:r||!r&&o?0:4,className:wn({"question-pannel":!0,"question-pannel__active":(a==null?void 0:a.id)===t.id,"multiline-question-pannel":!r&&o}),onClick:()=>{if(n){R.message.config({getContainer:()=>(l==null?void 0:l.current)||document.body,prefixCls:"gbot-message"}),R.message.error("请稍后"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}(a==null?void 0:a.id)===t.id?(i(void 0),s==null||s(void 0)):(i(t),s==null||s(t))},children:[N.jsxs("div",{className:wn({"question-top":!0,"not-have-top":r||!r&&o}),children:[!!(t!=null&&t.icon)&&N.jsx("div",{className:"question-top-tip",children:N.jsx("img",{src:t.icon,alt:""})}),N.jsx("div",{className:"question-top-title",children:N.jsx(R.Typography.Paragraph,{style:{margin:0,width:"100%"},ellipsis:{rows:1,tooltip:t==null?void 0:t.name},children:t.name})}),N.jsx("div",{className:wn({"question-top-type":!0,"question-only-plus-file":!r&&!t.icon&&!t.name}),children:!!((c=t.file)!=null&&c.url)&&N.jsx("img",{className:"file-icon",src:xl[bl(t.file.url)||""]})})]}),N.jsx("div",{className:wn({"question-bottom":!0,"multiline-question":!r&&o}),children:N.jsx(R.Typography.Paragraph,{style:{margin:0,width:"100%"},ellipsis:{rows:!r&&o?3:1,tooltip:{overlayClassName:"recommend-tooltip-overlay"}},children:t==null?void 0:t.question})})]})},Hx=L.forwardRef((e,t)=>{const{onItemClick:n,data:r,isRecommendClearing:a,layoutBreakpoints:i=[450]}=e,[s,o]=L.useState(),[u,l]=L.useState(),[c,d]=L.useState(!1),[M,g]=L.useState(2);return L.useImperativeHandle(t,()=>({clear(){l(void 0)}})),L.useEffect(()=>{const f=document.getElementById("dialog-modal");if(!f)return;const m=y=>{const D=[...i].sort((w,j)=>w-j),z=D.findIndex(w=>y<w);return z===-1?D.length+1:z+1},I=()=>{const y=f.clientWidth;g(m(y))};I();let A=null;return window.ResizeObserver?(A=new ResizeObserver(I),A.observe(f)):window.addEventListener("resize",I),()=>{A==null||A.disconnect(),window.removeEventListener("resize",I)}},[i]),L.useEffect(()=>{if(r!=null&&r.length){o(r);return}},[r]),L.useEffect(()=>{if(!s)return;const f=s.find(m=>m.file.url||m.icon||m.name);d(!f)},[s]),N.jsxs("div",{className:"questions",children:[N.jsxs(R.Space,{size:8,className:"question-tip",children:[N.jsx("img",{src:Xte,alt:""}),N.jsx("span",{children:"请试试这样提问:"})]}),N.jsx(R.Row,{gutter:[12,12],wrap:!0,className:"question-row",children:s==null?void 0:s.map((f,m)=>N.jsx(R.Col,{span:24/M,children:N.jsx(Jte,{item:f,isRecommendClearing:a,isOnlyQuestion:c,question:u,setQuestion:l,onItemClick:n})},m))})]})});Hx.displayName="Recommend";const Kte=e=>{const{transform:t}=L.useContext(an),{icon:n,text:r,children:a}=e;return N.jsxs("div",{className:"greeting",children:[(t==null?void 0:t.greet)&&n&&N.jsx("div",{className:"greeting-icon",children:N.jsx("img",{src:n})}),(t==null?void 0:t.greet)&&r&&N.jsx("div",{className:"greeting-word",children:r}),N.jsx("div",{className:"greeting-questions",children:a})]})};const ene=({visible:e=!0,text:t="所有内容均由人工智能模型生成,请仔细甄别。",element:n})=>{if(!e)return null;const r=L.useRef(null);return L.useEffect(()=>{var a;n&&((a=r.current)==null||a.replaceWith(n))},[n]),n?N.jsx("div",{ref:r}):N.jsx("div",{className:"footer-warning",ref:r,children:t})},tne=({className:e,tips:t,children:n})=>N.jsxs("div",{className:`home-footer ${e||""}`,children:[n,N.jsx(ene,{visible:t!==!1,text:typeof t=="string"?t:void 0,element:typeof t!="string"&&typeof t!="boolean"?t:void 0})]});const nne=e=>{const{className:t,style:n,id:r,file:a,actions:{upload:i,remove:s,download:o,checkStatus:u,preview:l}={},onUrlChange:c,onStatusChange:d}=e,M=bl((a==null?void 0:a.name)||""),[g,f]=L.useState(e.uploading),[m,I]=L.useState(!1);L.useEffect(()=>{f(e.uploading)},[e.uploading]);const[A,y]=L.useState(e.url);L.useEffect(()=>{y(e.url)},[e.url]),L.useEffect(()=>{i&&a instanceof File&&(A||(f(!0),setTimeout(()=>{f(!1)},2e3),i(a).then(j=>{y(j),c&&c(j)}).catch(j=>I(j)).finally(()=>{f(!1)})))},[i,A,a]);const[D,z]=L.useState(a instanceof File||a==null?void 0:a.status);L.useEffect(()=>{z(a instanceof File||a==null?void 0:a.status)},[a]);const w=()=>{r&&u&&D===Ge.KnowledgeFileStatus.Processing&&u(r).then(j=>{j!==D&&(D!==void 0&&d&&d(j),z(j))}).catch(j=>z(Ge.KnowledgeFileStatus.Failed))};return L.useEffect(()=>{w()},[r,u,D]),a?N.jsxs("div",{className:`file-card ${t}`,style:n,children:[M&&N.jsx("img",{className:"file-icon",src:xl[M]}),N.jsx("div",{className:"file-desc",children:N.jsx("div",{className:"file-desc-name",onClick:()=>l==null?void 0:l(a),children:N.jsx(R.Typography.Paragraph,{style:{margin:0},ellipsis:{rows:1,tooltip:a.name},children:a.name})})}),(a==null?void 0:a.status)===1?N.jsxs("div",{className:"analysis",children:[N.jsx(R.Spin,{indicator:N.jsx(At.LoadingOutlined,{style:{fontSize:16},spin:!0})}),N.jsx("span",{children:"解析中"})]}):(a==null?void 0:a.status)===3?s&&N.jsxs("div",{style:{display:"flex",gap:6},children:[N.jsx("div",{className:"file-action file-failed",children:N.jsx(At.CloseCircleFilled,{})}),N.jsx("div",{className:"file-action file-remove",onClick:()=>{s(a,r)},children:N.jsx(At.CloseOutlined,{})})]}):s&&o&&N.jsxs("div",{style:{display:"flex",gap:6},children:[N.jsx("div",{className:"file-action file-remove",onClick:()=>{o(a,r)},children:N.jsx(ct,{type:"icon-xiazai",style:{fontSize:16}})}),N.jsx("div",{className:"file-action file-remove",onClick:()=>{s(a,r)},children:N.jsx(At.CloseOutlined,{})})]})]}):N.jsx(N.Fragment,{})};const rne=e=>{const{isvisible:t,onClose:n}=e,r=N.jsxs("div",{className:"title",children:[N.jsx(At.CloseCircleFilled,{style:{color:"#F33E3E",fontSize:20}}),N.jsx("span",{children:"确认清空所有文件"})]});return N.jsx(R.Modal,{className:"clear-modal",width:340,open:t,title:r,centered:!0,maskClosable:!1,onCancel:()=>{n("cancel")},getContainer:document.getElementById("dialog-modal")||!1,footer:[N.jsx(R.Button,{onClick:()=>{n("cancel")},children:"暂时保留"},"cancel"),N.jsx(R.Button,{type:"primary",onClick:()=>{n("clear")},children:"继续清空"},"confirm")],children:N.jsx("div",{className:"content",children:"列表中的文件清空后不能恢复,请确认是否清空所有文件。"})})},Wx=L.forwardRef((e,t)=>{const{appId:n,sid:r,onStatusChange:a,createSession:i,disabled:s=!1,afterFileAdd:o,afterFileDelete:u,onFileListChange:l,shouldContinue:c=!0,afterFilesClear:d,docViewerUrl:M,isFirstSession:g}=e,[f,m]=L.useState([]),I=L.useRef(f),[A,y]=L.useState([]),[D,z]=L.useState(!1),[w,j]=L.useState(""),F=L.useRef(c),[H,S]=L.useState(!1),{Dragger:O}=R.Upload,{service:B,popupContainer:Y}=L.useContext(an);L.useEffect(()=>{F.current=c},[c]),L.useImperativeHandle(t,()=>({update:W,clear:Le})),L.useEffect(()=>{g||(y([]),m([]),W())},[r]);const W=()=>r?new Promise((K,ee)=>{B==null||B.getApplicationIdSessionKnowledgeFiles(n,r,{enabled:1}).then(ce=>{y(ce),m(ce),ne(ce)}).finally(()=>{K()})}):Promise.resolve(),ne=K=>et(exports,null,function*(){r&&(K==null||K.map(ee=>et(exports,null,function*(){var ce;try{if(yield B==null?void 0:B.checkFileReady(n,r,ee.id)){const Ne=[...I.current],Ce=K.findIndex(Ue=>Ue.id===ee.id);Ce!==-1&&(Ne[Ce].status=2),m(Ne),o&&o(ee,r)}}catch(ue){if(((ce=ue.cause)==null?void 0:ce.code)===-101){const Ne=[...I.current],Ce=K.findIndex(Ue=>Ue.id===ee.id);Ce!==-1&&(Ne[Ce].status=3),m(Ne);return}}})))});L.useEffect(()=>{a&&a(w)},[w]);const se=K=>et(exports,null,function*(){if(K.size<=0)return R.message.config({getContainer:()=>(Y==null?void 0:Y.current)||document.body,prefixCls:"gbot-message"}),R.message.error("该文件为空,请重新上传文档"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"}),!1;if(K.name.length>N2)return R.message.config({getContainer:()=>(Y==null?void 0:Y.current)||document.body,prefixCls:"gbot-message"}),R.message.error(`文件名称不能超过${N2}字符`),R.message.config({getContainer:void 0,prefixCls:"gbot-message"}),!1;if(K.size>50*Zu)return R.message.config({getContainer:()=>(Y==null?void 0:Y.current)||document.body,prefixCls:"gbot-message"}),R.message.error(`${K.name}文件大小不能超过 50M`),R.message.config({getContainer:void 0,prefixCls:"gbot-message"}),!1;if(Qte.some(ue=>ue===K.type)){const ue=K;ue.status=1,m(Ne=>Ne.length>=10?Ne:[...Ne,ue])}else je("存在文件格式不正确的文件,已自动去除");return!1});L.useEffect(()=>{if(f.length<10?z(!1):z(!0),!f.length){j("");return}const K=f.find(ue=>ue.status===1),ee=f.find(ue=>ue.status===3);f.every(ue=>ue.status===2)?j("successed"):K?j("process"):ee&&j("failed"),l&&l(f)},[f]),L.useEffect(()=>{I.current=f;const K=f.filter(ee=>!A.includes(ee));he(K),y(f)},[f]);const te=(K,ee,ce)=>et(exports,null,function*(){var Ce;const ue=[...I.current],Ne=I.current.findIndex(Ue=>Ue===ce);Ne!==-1&&(ue[Ne].id=ee),m(ue);try{const Ue=yield B==null?void 0:B.checkFileReady(n,K,ee,()=>F.current,void 0,Fe=>{const Be=[...I.current],mt=I.current.findIndex(bt=>bt===ce);Be[mt].url=Fe.url,m(Be)});if(Ue){const Fe=[...I.current],Be=I.current.findIndex(mt=>mt===ce);Be!==-1&&(Fe[Be].status=2,Fe[Be].url=Ue.url),m(Fe),o&&o(Ue,K)}}catch(Ue){if(((Ce=Ue.cause)==null?void 0:Ce.code)===-101){const Fe=[...I.current],Be=I.current.findIndex(mt=>mt===ce);Be!==-1&&(Fe[Be].status=3),m(Fe);return}}}),Re=()=>r?Promise.resolve(r):i(),he=K=>{K.length&&Re().then(ee=>{K==null||K.forEach(ce=>{var ue;F.current=!0,(ue=X(ee,ce))==null||ue.then(Ne=>{var Ue;if(!Ne)return;const Ce={url:Ne,name:ce.name,size:ce.size,type:1,origin:Ge.IFileOrigin.AECPILOT};F.current&&((Ue=Ae(ee,Ce))==null||Ue.then(Fe=>te(ee,Fe,ce)))})})})},Ae=(K,ee)=>B==null?void 0:B.postApplicationIdSessionKnowledgeSessionFile(n,K,ee),je=MO(K=>{R.message.config({getContainer:()=>(Y==null?void 0:Y.current)||document.body,prefixCls:"gbot-message"}),R.message.error(K),R.message.config({getContainer:void 0,prefixCls:"gbot-message"})},300),we=K=>{r&&K!=null&&K.id&&(B==null||B.delApplicationIdSessionKnowledgeFileId(n,r,K.id).then(ee=>{const ce=f.filter(ue=>ue.id!==K.id);m(ce),R.message.config({getContainer:()=>(Y==null?void 0:Y.current)||document.body,prefixCls:"gbot-message"}),R.message.success("删除成功"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"}),u&&u(K.id)}))},E=N.jsx(N.Fragment,{children:N.jsxs("div",{className:"card-title",children:[N.jsx("span",{className:"name",children:"上传列表"}),N.jsxs("div",{className:"actions",children:[N.jsx(R.Upload,{accept:".doc, .docx, .pdf",beforeUpload:se,showUploadList:!1,style:{margin:0},multiple:!0,children:N.jsx(R.Button,{className:"action",type:"link",disabled:D,children:N.jsxs("div",{className:"detail",children:[N.jsx(ct,{type:"icon-tianjia",style:{fontSize:16}}),N.jsx("div",{children:"添加"})]})})}),N.jsx(R.Button,{className:"action",type:"link",disabled:!f.length,onClick:()=>{S(!0)},children:N.jsxs("div",{className:"detail",children:[N.jsx(ct,{type:"icon-shanchu",style:{fontSize:16}}),N.jsx("span",{children:"清空"})]})})]})]})}),X=(K,ee)=>{if(!K)throw Error("session is not exist.");return B==null?void 0:B.uploadFile(K,ee).catch(()=>(R.message.config({getContainer:()=>(Y==null?void 0:Y.current)||document.body,prefixCls:"gbot-message"}),R.message.error("服务异常,请稍后再试"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"}),""))},ge=N.jsx("div",{className:`upload-enter ${s?"disabled":""}`,children:N.jsx(R.Badge,{size:"small",color:"#9C24F2",count:w==="successed"?f.length:w==="process"?N.jsx(R.Spin,{className:"file-action file-process",indicator:N.jsx(At.LoadingOutlined,{style:{fontSize:14},spin:!0})}):w==="failed"?N.jsx(At.CloseCircleFilled,{style:{color:"#dc4446",fontSize:14}}):0,children:N.jsx(ct,{type:"icon-shangchuanwenjian",style:{fontSize:24}})})}),Le=()=>new Promise(K=>{const ee=I.current;if(!r)return K();const ce=[];ee.filter(ue=>ue.id).forEach(ue=>ce.push({id:ue.id,status:ue.status})),B==null||B.delApplicationIdSessionKnowledgeFile(n,r,{files:ce}).then(()=>{y([]),m([]),I.current=[],d&&d(),F.current=!1,K()})});return N.jsxs("div",{className:"footer-upload",children:[s?ge:N.jsx(R.Popover,{overlayClassName:"upload-popover",overlayInnerStyle:{width:264,minHeight:211,maxHeight:356,borderRadius:12,zIndex:1},placement:"topLeft",getPopupContainer:()=>(Y==null?void 0:Y.current)||document.body,content:N.jsx("div",{className:"file-upload",children:f.length>0?N.jsx("div",{className:"upload-wrapper",children:N.jsx("div",{className:"input-files",style:{display:"flex",flexDirection:"column"},children:f==null?void 0:f.map((K,ee)=>N.jsx(nne,{file:K,actions:{preview:()=>{if(!(K!=null&&K.url)){R.message.config({getContainer:()=>(Y==null?void 0:Y.current)||document.body,prefixCls:"gbot-message"}),R.message.error("正在上传中"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}if(!Bx(K.url)){R.message.config({getContainer:()=>(Y==null?void 0:Y.current)||document.body,prefixCls:"gbot-message"}),R.message.error("链接格式不正确"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}window.open(`${M}?url=${encodeURIComponent(K==null?void 0:K.url)}`)},remove:()=>{we(K)},download:()=>{r&&(B==null||B.getApplicationIdSessionKnowledgeFileId(n,r,K.id).then(ce=>{if(!(ce!=null&&ce.url)){R.message.config({getContainer:()=>(Y==null?void 0:Y.current)||document.body,prefixCls:"gbot-message"}),R.message.error("下载失败"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}const ue=document.createElement("a");ue.href=ce.url,ue.download=ce.name||"",ue.click()}))}}},ee))})}):N.jsxs(O,{name:"file",showUploadList:!1,multiple:!0,beforeUpload:se,accept:".pdf, .doc, .docx",maxCount:10,listType:"picture",children:[N.jsx("span",{className:"file-upload-icon",children:N.jsx(At.CloudUploadOutlined,{})}),N.jsxs(R.Space,{className:"file-upload-action",children:["拖拽文件至此,或者",N.jsx(R.Button,{type:"link",style:{padding:0},children:"上传文件"})]}),N.jsxs("div",{className:"file-upload-desc",children:[N.jsx("div",{className:"item-upload-desc",children:N.jsx("span",{children:"1.支持 doc、pdf、docx 格式;"})}),N.jsx("div",{className:"item-upload-desc",children:"2.单个文件不超过 50 M;"}),N.jsx("div",{className:"item-upload-desc",children:"3.最多上传 10 个文件。"})]})]})}),title:E,trigger:"click",children:ge}),H&&N.jsx(rne,{isvisible:H,onClose:K=>{K==="clear"&&Le(),S(!1)}})]})});Wx.displayName="UploadFiles";const ane=e=>{const{files:t,sessionId:n,isvisible:r,onClose:a}=e,{service:i}=L.useContext(an),s=N.jsxs("div",{className:"title",children:[N.jsx(At.ExclamationCircleFilled,{style:{color:"#FF9326",fontSize:20}}),N.jsx("span",{children:"文件任务正在处理"})]}),o=()=>{if(!n)return;const u=[];t.filter(l=>l.id).forEach(l=>u.push({id:l.id,status:l.status})),i==null||i.deleteSessionKnowledgeFiles(n,{files:u}),a("abandon")};return N.jsx(R.Modal,{className:"prompt-modal",width:340,open:r,title:s,centered:!0,maskClosable:!1,onCancel:()=>a("close"),getContainer:document.getElementById("dialog-modal")||!1,footer:[N.jsx(R.Button,{onClick:()=>{o()},children:"放弃文件"},"cancel"),N.jsx(R.Button,{type:"primary",onClick:()=>{a("continue")},children:"继续上传"},"confirm")],children:N.jsx("div",{className:"content",children:"你可以选择后台继续上传,也可以直接离开放弃上传中的文件。"})})};const{Panel:y2}=R.Collapse,qx=L.forwardRef((e,t)=>{const{promptVariables:n,setPromptVariables:r,currentSession:a}=e,[i]=R.Form.useForm(),{agentClient:s}=L.useContext(an);L.useImperativeHandle(t,()=>({clear(){i.resetFields()}})),L.useEffect(()=>{if(!a)return;const c=()=>{const M=a.promptVariables.filter(g=>!(g.type===Ge.PromptVariableType.User&&g.key==="query")&&!(g.type===Ge.PromptVariableType.System&&g.key==="datetime"));r(M.sort((g,f)=>g.key.localeCompare(f.key)))};return a.addEventListener("activated",c),()=>{a==null||a.removeEventListener("activated",c)}},[a]),L.useEffect(()=>{if(!n)return;const c={},d={};n.forEach(M=>{M.type===Ge.PromptVariableType.System?d[M.key]=M.value:c[M.key]=M.value}),i.setFieldsValue({userPrompts:c,systemPrompts:d})},[n]);const o=(c,d)=>{n.map(M=>{M.id===c&&(M.value=d.target.value)}),r([...n].sort((M,g)=>M.key.localeCompare(g.key)))},u=(n==null?void 0:n.filter(c=>c.type===Ge.PromptVariableType.System))||[],l=(n==null?void 0:n.filter(c=>c.type===Ge.PromptVariableType.User))||[];return n!=null&&n.length?N.jsx(R.Form,{autoComplete:"off",form:i,labelWrap:!0,labelAlign:"left",labelCol:{style:{width:120}},className:"prompt-form",children:N.jsxs(R.Collapse,{bordered:!1,ghost:!0,className:"prompt-variables-collapse",defaultActiveKey:[Ge.PromptVariableType.System,Ge.PromptVariableType.User],children:[u.length&&N.jsx(y2,{header:"角色设定变量",children:u.map(c=>N.jsx(R.Form.Item,{label:c.name,name:["systemPrompts",c.key],style:{marginBottom:8},rules:[{required:!0,message:"请输入"}],children:N.jsx(R.Input,{placeholder:"请输入",maxLength:s==null?void 0:s.questionContextMaxLength,onBlur:d=>o(c.id,d)})},c.key))},Ge.PromptVariableType.System),l.length&&N.jsx(y2,{header:"用户指令变量",children:l.map(c=>N.jsx(R.Form.Item,{label:c.name,name:["userPrompts",c.key],style:{marginBottom:8},rules:[{required:!0,message:"请输入"}],children:N.jsx(R.Input,{placeholder:"请输入",maxLength:s==null?void 0:s.questionContextMaxLength,onBlur:d=>o(c.id,d)})},c.key))},Ge.PromptVariableType.User)]})}):null});qx.displayName="PromptSetting";const ine=e=>{const{session:t,onChangeEditStatus:n,onEditNameConfirm:r}=e,[a,i]=L.useState("");L.useEffect(()=>{var l,c;const u=((c=(l=t.data)==null?void 0:l.name)==null?void 0:c.slice(0,20))||"";i(u)},[t]);const s=()=>{r(t,a),n("",!1)},o=()=>{n("",!1)};return N.jsxs("div",{className:"name-edit-panel",children:[N.jsx(R.Input,{value:a,showCount:!0,className:"name-edit-input",maxLength:20,onChange:u=>i(u.target.value)}),N.jsx(R.Button,{type:"link",icon:N.jsx(At.CheckOutlined,{}),style:{color:"#30BF13",right:40},onClick:s}),N.jsx(R.Button,{type:"link",icon:N.jsx(At.CloseOutlined,{}),style:{color:"#84868C"},onClick:o})]})},sne=e=>{var m,I,A,y,D,z,w,j,F,H,S,O;const{session:t,index:n,currentSessionId:r,onChangeSession:a,onDelSession:i,onTopSession:s,onEditNameConfirm:o,editSessionId:u,isEdit:l,onChangeEditStatus:c}=e,[d,M]=L.useState(-1),[g,f]=L.useState("");return L.useEffect(()=>{var B,Y,W;if((B=t.data)!=null&&B.lastFileName){const ne=t.data.lastFileName.lastIndexOf(".");f((W=(Y=t.data)==null?void 0:Y.lastFileName)==null?void 0:W.slice(ne+1))}},[t]),N.jsx("div",{id:(m=t.data)==null?void 0:m.id,className:`session-item-panel ${((I=t.data)==null?void 0:I.id)===r?"current-item":""}`,onMouseEnter:()=>M(n),onMouseLeave:()=>M(-1),onClick:()=>!l&&a(t),children:N.jsxs(R.Space,{direction:"vertical",size:12,className:"session-item-space",children:[N.jsxs("div",{className:"item-question",children:[((A=t.data)==null?void 0:A.id)===r&&N.jsx(R.Tag,{children:"当前的"}),l&&u===((y=t.data)==null?void 0:y.id)?N.jsx(ine,{session:t,onChangeEditStatus:c,onEditNameConfirm:o}):N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"session-item-name",children:(D=t.data)==null?void 0:D.name}),d!==n&&((z=t.data)==null?void 0:z.top)&&N.jsx(ct,{type:"icon-sheweihuihuaqian",style:{color:"#9C24F2",fontSize:16}}),d===n&&N.jsxs("div",{className:"icons-bar",children:[(w=t.data)!=null&&w.top?N.jsx(R.Button,{type:"link",icon:N.jsx(ct,{type:"icon-sheweihuihuaqian"}),onClick:B=>{s(t,!1),B.stopPropagation()},style:{color:"#9C24F2"}}):N.jsx(R.Button,{type:"link",icon:N.jsx(ct,{type:"icon-weisheweihuihuaqian"}),onClick:B=>{s(t,!0),B.stopPropagation()}}),N.jsx(R.Button,{type:"link",icon:N.jsx(ct,{type:"icon-bianji2"}),onClick:B=>{var Y;c((Y=t.data)==null?void 0:Y.id,!0),B.stopPropagation()}}),N.jsx(R.Button,{type:"link",icon:N.jsx(ct,{type:"icon-shanchu1"}),onClick:B=>i(t,B)})]})]})]}),(j=t.data)!=null&&j.finialMessage?N.jsx("div",{className:"item-answer",children:t.data.finialMessage}):N.jsx("div",{style:{height:"22px"}}),!!((F=t.data)!=null&&F.fileCount)&&N.jsx("div",{className:"item-file",children:N.jsxs(R.Space,{children:[g&&N.jsxs("div",{style:{position:"relative"},children:[N.jsx("img",{className:"file-icon",src:xl[g]}),t.data.fileStatus===10?N.jsx(At.CheckCircleFilled,{className:"file-status-icon success-file-icon"}):t.data.fileStatus===20?N.jsx(At.CloseCircleFilled,{className:"file-status-icon failed-file-icon"}):t.data.fileStatus===30?N.jsx(R.Spin,{indicator:N.jsx(At.LoadingOutlined,{className:"file-status-icon loading-file-icon",spin:!0})}):N.jsx(N.Fragment,{})]}),N.jsx("span",{className:"file-name",children:(H=t.data)==null?void 0:H.lastFileName}),N.jsxs(R.Tag,{children:["共 ",(S=t.data)==null?void 0:S.fileCount," 个"]})]})})]})},(O=t.data)==null?void 0:O.id)},one=e=>{const{currentSessionId:t,onSessionChange:n,onClose:r}=e,{agentClient:a,popupContainer:i}=L.useContext(an),[s,o]=L.useState(!1),[u,l]=L.useState(!1),[c,d]=L.useState(""),[M,g]=L.useState([]),f=L.useRef(M);L.useEffect(()=>{f.current=[],g(f.current),o(!0),a==null||a.getSessions().then(z=>et(exports,null,function*(){o(!1),f.current=[...z],g(f.current)}))},[]),L.useEffect(()=>{M.length&&t&&setTimeout(()=>{var z;(z=document.getElementById(t))==null||z.scrollIntoView(!0)},100)},[M]);const m=(z,w)=>{a==null||a.removeSession(z,!0).then(()=>et(exports,null,function*(){const j=M.filter(F=>{var H,S;return((H=F.data)==null?void 0:H.id)!==((S=z.data)==null?void 0:S.id)});z.data.id===t&&n&&n("",null),R.message.config({getContainer:()=>(i==null?void 0:i.current)||document.body,prefixCls:"gbot-message"}),R.message.success("删除成功"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"}),f.current=[...j],g(f.current)})),w==null||w.stopPropagation()},I=z=>{z&&(n&&n(z.sessionId,z),r())},A=(z,w)=>et(exports,null,function*(){try{yield a==null?void 0:a.setTop(z.data.id,w),R.message.config({getContainer:()=>(i==null?void 0:i.current)||document.body,prefixCls:"gbot-message"}),R.message.success(`${w?"":"取消"}置顶成功`),R.message.config({getContainer:void 0,prefixCls:"gbot-message"})}catch(j){R.message.config({getContainer:()=>(i==null?void 0:i.current)||document.body,prefixCls:"gbot-message"}),R.message.error(`${w?"":"取消"}置顶失败`),R.message.config({getContainer:void 0,prefixCls:"gbot-message"})}a==null||a.getSessions({order:"top_time desc, sort_status desc, updated_at desc"}).then(j=>et(exports,null,function*(){f.current=[...j],g(f.current)}))}),y=(z,w)=>{w&&(z.rename(w),z==null||z.addEventListener("data:updated",()=>{const j=f.current.map(F=>{var H,S;return((H=F.data)==null?void 0:H.id)===((S=F.data)==null?void 0:S.id),F});f.current=[...j],g(f.current)}))},D=(z,w)=>{l(w),d(z)};return N.jsx(R.Drawer,{title:"会话历史记录",open:!0,placement:"bottom",onClose:r,className:`session-list-drawer ${s?"loading-panel":""}`,size:"large",getContainer:()=>(i==null?void 0:i.current)||document.body,destroyOnClose:!0,style:{position:"absolute"},children:s?N.jsx(R.Spin,{indicator:N.jsx(At.LoadingOutlined,{style:{fontSize:24},spin:!0})}):M.map((z,w)=>{var j;return N.jsx(sne,{session:z,index:w,currentSessionId:t,onChangeSession:I,onDelSession:m,onTopSession:A,onEditNameConfirm:y,editSessionId:c,isEdit:u,onChangeEditStatus:D},(j=z.data)==null?void 0:j.id)})})};const une=e=>{const{currentSessionId:t,disabled:n=!1,onSessionChange:r}=e,[a,i]=L.useState(!1);return N.jsxs("div",{className:"session-list-component",children:[N.jsx(R.Popover,{placement:"topRight",showArrow:!1,overlayClassName:"session-list-overlay",overlayStyle:{padding:"4px"},getPopupContainer:s=>s.parentNode,content:"会话历史记录",children:N.jsx(R.Button,{className:"list-overlay-action",disabled:n,type:"text",icon:N.jsx(ct,{type:"icon-lishijilu",style:{fontSize:24}}),onClick:()=>i(!0)})}),a&&N.jsx(one,{currentSessionId:t||"",onSessionChange:r,onClose:()=>i(!1)})]})};const $x=L.createContext(void 0),lne=({children:e})=>{const[t,n]=L.useState([]),[r,a]=L.useState(!1),i={sessions:t,setSessions:n,isSwitchingToExistingSession:r,setIsSwitchingToExistingSession:a};return N.jsx($x.Provider,{value:i,children:e})},cne=()=>{const e=L.useContext($x);if(e===void 0)throw new Error("useSessionContext must be used within a SessionProvider");return e},km=()=>cne(),jf=15,Vx=L.forwardRef((e,t)=>{const{currentSession:n,setCurrentSession:r,checkKnowledges:a,application:i,networkStatus:s,isShowHeader:o=!0,afterSessionClick:u,sessionId:l}=e,[c,d]=L.useState(),{agentClient:M,mode:g,features:f,popupContainer:m}=L.useContext(an),[I,A]=L.useState(a),{sessions:y,setSessions:D}=km(),[z,w]=L.useState(0),[j,F]=L.useState(""),[H,S]=L.useState(null),O=Hr.useMemoizedFn(E=>{E.id&&D(X=>[...X.map(K=>{var ee;return((ee=K.data)==null?void 0:ee.id)===E.id&&(K.data=re({},E)),K})].sort((K,ee)=>{var Ne,Ce;const ce=fn((Ne=K.data)==null?void 0:Ne.createdAt).valueOf();return fn((Ce=ee.data)==null?void 0:Ce.createdAt).valueOf()-ce}))});L.useEffect(()=>{M==null||M.getSessions().then(E=>et(exports,null,function*(){var X;if(D([...E]),!((X=n==null?void 0:n.data)!=null&&X.id)&&(E!=null&&E.length)&&g==="inlay"){const ge=E[0];l||r==null||r(ge)}else n===void 0&&(l||r==null||r(null))}))},[]),L.useEffect(()=>{var E;if(!((E=n==null?void 0:n.data)!=null&&E.id)&&a===void 0){const X=typeof(f==null?void 0:f.knowledges)=="object"&&f.knowledges.default||void 0;if(Array.isArray(X)&&X.some(K=>Array.isArray(K.fileIds)&&K.fileIds.length===0))throw Error("fileIds cannot be an empty array");if(El(X||[])>Ua)throw Error(`knowledges and fileIds total count cannot exceed ${Ua}`);A(X);return}A(a)},[a]),L.useEffect(()=>{n==null||n.addEventListener("data:updated",O)},[n]),L.useImperativeHandle(t,()=>({create(E){return B(E).then(X=>(r==null||r(X),X))},list:()=>Promise.resolve(y)}));const B=E=>{const X=typeof(f==null?void 0:f.connectNetwork)=="object"&&typeof(f==null?void 0:f.connectNetwork.default)=="boolean"?f.connectNetwork.default:!1;return new Promise(ge=>et(exports,null,function*(){var ce;const Le=typeof(f==null?void 0:f.promptVariables)=="object"?(f==null?void 0:f.promptVariables.default)||[]:void 0,K=yield M==null?void 0:M.loadSession("",{name:E==null?void 0:E.name,netOpen:(i==null?void 0:i.type)===0?E!=null&&E.netOpen?E.netOpen:X?_r.OPEN:_r.CLOSE:void 0,knowledges:(ce=n==null?void 0:n.data)!=null&&ce.id?E==null?void 0:E.knowledges:I,promptVariables:Le}),ee=ue=>{var Ne;R.notification.config({getContainer:()=>(m==null?void 0:m.current)||document.body,prefixCls:"gbot-notification"}),R.notification.error({message:((Ne=ue.cause)==null?void 0:Ne.message)||ue.message}),R.notification.config({getContainer:void 0,prefixCls:"gbot-notification"})};K==null||K.addEventListener("error",ee),K==null||K.addEventListener("data:created",()=>et(exports,null,function*(){K==null||K.removeEventListener("error",ee),D([K,...y]),ge(K)}))}))},Y=()=>{B({knowledges:I}).then(E=>{r==null||r(E)})},W=E=>{M==null||M.removeSession(E,!0).then(()=>et(exports,null,function*(){var ge,Le;const X=y.filter(K=>{var ee,ce;return((ee=K.data)==null?void 0:ee.id)!==((ce=E.data)==null?void 0:ce.id)});((ge=E.data)==null?void 0:ge.id)===((Le=n==null?void 0:n.data)==null?void 0:Le.id)&&(X!=null&&X.length?r==null||r(X[0]):r==null||r(null)),D([...X])}))},ne=E=>{var X,ge;d((X=E.data)==null?void 0:X.name),F(""),S(((ge=E.data)==null?void 0:ge.id)||null)},se=E=>{const X=he(c||"");if(X){F(X);return}E.rename(c.trim()),E==null||E.addEventListener("data:updated",O),Re()},te=()=>{Re()},Re=()=>{S(null),d(""),F(""),w(E=>E+1)},he=E=>!E||E.trim().length===0?"会话名称不能为空":E.length>jf?`不能超过${jf}个字符`:"",Ae=E=>et(exports,null,function*(){r==null||r(E),u==null||u(E)}),_=E=>{const X=E.target.value;d(X),F(he(X))};L.useEffect(()=>{var X,ge,Le,K;if(!(n!=null&&n.id))return;const E={};if(typeof(f==null?void 0:f.knowledges)=="object"&&((X=f==null?void 0:f.knowledges)!=null&&X.default)){if(E.knowledges=(ge=f==null?void 0:f.knowledges)==null?void 0:ge.default,Array.isArray(E.knowledges)&&E.knowledges.some(ue=>Array.isArray(ue.fileIds)&&ue.fileIds.length===0))throw Error("fileIds cannot be an empty array");if(El(E.knowledges)>Ua)throw Error(`knowledges and fileIds total count cannot exceed ${Ua}`)}typeof(f==null?void 0:f.promptVariables)=="object"&&((Le=f==null?void 0:f.promptVariables)!=null&&Le.default)&&(E.promptVariables=(K=f==null?void 0:f.promptVariables)==null?void 0:K.default),M==null||M.loadSession(n.id,E)},[n]);const je=Hr.useMemoizedFn(E=>{const X=fn().endOf("day"),ge=X.subtract(1,"day"),Le=X.subtract(7,"day"),K=X.subtract(30,"day"),ee=[],ce=[],ue=[],Ne=[],Ce={};return E.forEach(Fe=>{var mt;const Be=fn((mt=Fe.data)==null?void 0:mt.createdAt);if(Be.isAfter(ge))ce.push(Fe);else if(Be.isAfter(Le))ue.push(Fe);else if(Be.isAfter(K))Ne.push(Fe);else{const bt=Be.format("YYYY-MM");Ce[bt]||(Ce[bt]=[]),Ce[bt].push(Fe)}}),ce.length>0&&ee.push({title:"今天",sessions:ce.sort((Fe,Be)=>{var mt,bt;return fn((mt=Be.data)==null?void 0:mt.createdAt).valueOf()-fn((bt=Fe.data)==null?void 0:bt.createdAt).valueOf()}),key:"today"}),ue.length>0&&ee.push({title:"7天内",sessions:ue.sort((Fe,Be)=>{var mt,bt;return fn((mt=Be.data)==null?void 0:mt.createdAt).valueOf()-fn((bt=Fe.data)==null?void 0:bt.createdAt).valueOf()}),key:"seven-days"}),Ne.length>0&&ee.push({title:"30天内",sessions:Ne.sort((Fe,Be)=>{var mt,bt;return fn((mt=Be.data)==null?void 0:mt.createdAt).valueOf()-fn((bt=Fe.data)==null?void 0:bt.createdAt).valueOf()}),key:"thirty-days"}),Object.keys(Ce).sort((Fe,Be)=>Be.localeCompare(Fe)).forEach(Fe=>{const Be=Ce[Fe].sort((mt,bt)=>{var pn,$t;return fn((pn=bt.data)==null?void 0:pn.createdAt).valueOf()-fn(($t=mt.data)==null?void 0:$t.createdAt).valueOf()});ee.push({title:fn(Fe).format("YYYY年MM月"),sessions:Be,key:`month-${Fe}`})}),ee}),we=L.useMemo(()=>je(y),[y,je]);return N.jsx("div",{className:"bot-session-container",children:N.jsxs("div",{className:"agent-sessions",children:[o&&(f==null?void 0:f.siderTitle)&&N.jsx("div",{className:"sessions-header",children:N.jsx("div",{className:"session-header-title",children:(i==null?void 0:i.name)||"-"})}),N.jsxs("div",{className:"sessions-main",children:[o&&N.jsx("div",{className:"session-header-btn-wrapper",children:N.jsx(R.Button,{className:"session-header-btn",onClick:Y,type:"primary",children:"+ 新会话"})}),we==null?void 0:we.map(E=>{var X;return N.jsxs("div",{className:"session-group",children:[N.jsx("div",{className:"group-header",style:{top:o?48:0},children:E.title}),(X=E.sessions)==null?void 0:X.map(ge=>{var Le,K,ee,ce,ue,Ne,Ce,Ue,Fe;return N.jsx("div",{className:wn({"session-item":!0,"session-item__active":((Le=ge.data)==null?void 0:Le.id)===((K=n==null?void 0:n.data)==null?void 0:K.id)}),onClick:()=>Ae(ge),children:N.jsx("div",{className:"session-item-wrapper",children:N.jsxs("div",{className:"session-item-top",children:[N.jsx(R.Typography.Paragraph,{className:"item-top-title",style:{margin:0,width:"100%"},ellipsis:{rows:1,tooltip:{title:((ee=ge.data)==null?void 0:ee.name)||"-",placement:"topLeft"}},children:((ce=ge.data)==null?void 0:ce.name)||"-"}),N.jsxs(R.Space,{children:[N.jsx("span",{className:"item-top-time",children:fn((ue=ge.data)==null?void 0:ue.createdAt).format("MM/DD HH:mm:ss")}),N.jsxs("div",{className:"item-top-action",onClick:Be=>Be.stopPropagation(),children:[N.jsx(R.Popconfirm,{open:H===((Ne=ge.data)==null?void 0:Ne.id),getPopupContainer:Be=>Be.parentNode,icon:!1,title:N.jsx(R.Input,{placeholder:"请输入内容",autoComplete:"off",showCount:!0,value:c,onChange:_,maxLength:jf,status:j?"error":""}),onConfirm:()=>se(ge),onCancel:te,children:N.jsx(ct,{type:"icon-bianji2",onClick:()=>ne(ge),className:"icon-action",style:{marginRight:"8px"}})},`edit-${(Ce=ge.data)==null?void 0:Ce.id}-${z}`),N.jsx(R.Popconfirm,{getPopupContainer:Be=>Be.parentNode,icon:!1,title:N.jsxs(R.Space,{direction:"vertical",children:[N.jsx("div",{children:"删除确认?"}),N.jsx("div",{children:"会话删除后不可恢复,请确认是否删除!"})]}),onConfirm:()=>{W(ge),w(Be=>Be+1)},onCancel:()=>{w(Be=>Be+1)},children:N.jsx(ct,{style:{fontSize:"18px"},className:"icon-action",type:"icon-del"})},`delete-${(Ue=ge.data)==null?void 0:Ue.id}-${z}`)]})]})]})})},(Fe=ge.data)==null?void 0:Fe.id)})]},E.key)})]})]})})});Vx.displayName="SessionList";const _m=L.forwardRef((e,t)=>N.jsx("div",{className:"sider-container",children:N.jsx(Vx,re({ref:t},e))}));_m.displayName="Sider";const dne=e=>{const{currentSession:t,disabled:n=!1,application:r,networkStatus:a,setCurrentSession:i,isSessionHistoryVisible:s,setIsSessionHistoryVisible:o,onSessionChange:u}=e,{popupContainer:l}=L.useContext(an),c=M=>{var g,f;((g=M.data)==null?void 0:g.id)!==((f=t==null?void 0:t.data)==null?void 0:f.id)&&(o(!1),u==null||u(M))},d=()=>{o(!1)};return N.jsx(R.Drawer,{title:"会话历史",open:!0,placement:"bottom",onClose:d,className:"session-history-drawer",size:"large",getContainer:()=>(l==null?void 0:l.current)||document.body,destroyOnClose:!0,style:{position:"absolute"},children:N.jsx(_m,{isShowHeader:!1,application:r,networkStatus:a,currentSession:t,setCurrentSession:i,afterSessionClick:c})})};const Mne=e=>{const{sessionId:t,netStatus:n,enable:r,disabledTip:a="上传文件后,该会话自动停止网络访问",onNetStatusChange:i}=e,[s,o]=L.useState(!1),[u,l]=L.useState(!1),[c,d]=L.useState("#070C14");L.useEffect(()=>{l(!r),r||d("#070C14")},[t,r]);const M=()=>{l(!1)};L.useEffect(()=>{o(u)},[u]);const g=f=>{i(f)};return N.jsx(N.Fragment,{children:N.jsxs("div",{className:"connect",onMouseEnter:()=>{o(!0)},onMouseLeave:()=>{u||o(!1)},children:[N.jsx(R.Button,{type:"link",icon:n?N.jsx(ct,{className:"link-btn",type:"icon-yilianwang",style:{fontSize:22}}):N.jsx(ct,{className:"link-not-btn",type:"icon-lianwangguanbi",style:{color:c,fontSize:22},onMouseEnter:()=>{d(r?"#B452FF":"#070C14")},onMouseLeave:()=>d("#070C14")}),disabled:!r,onClick:()=>{g(!n)}}),s&&N.jsx("div",{className:"net-tip",children:r?n?"网络访问已开启":"网络访问已关闭":u?N.jsxs("div",{style:{display:"flex",gap:6},children:[N.jsx("span",{children:a}),N.jsx("div",{children:N.jsx(At.CloseOutlined,{onClick:M})})]}):a})]})})};const{Text:gne}=R.Typography,pne=()=>N.jsxs(R.Space,{children:[N.jsx(R.Spin,{indicator:N.jsx(At.LoadingOutlined,{style:{fontSize:12}}),spinning:!0}),"正在生成标题"]}),fne=e=>{const{appId:t,data:n,highlight:r,onEdit:a,onDelete:i,onClick:s,onStatusChange:o}=e,{service:u}=L.useContext(an),[l,c]=L.useState(n.status!=="finish"),[d,M]=L.useState(n),[g,f]=L.useState(n.title);L.useEffect(()=>{d.status!=="finish"&&c(!0)},[d.status,l]),L.useEffect(()=>{M(n)},[n]);const m=()=>{u==null||u.getPrompt(t,d.id).then(I=>{M(I),o&&o(I.status,I),I.status==="finish"?c(!1):(c(!0),setTimeout(()=>m(),2e3))})};return L.useEffect(()=>{l&&m()},[l]),L.useEffect(()=>{if(r){const I=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),A=new RegExp(`(${I})`,"g"),y=d.title.split(A);f(y.map((D,z)=>r===D?N.jsx("span",{className:"hightlight",children:D},z):D))}else f(d.title)},[r,d.title]),N.jsxs("div",{className:"prompt-list-item",onClick:()=>s&&s(n),children:[N.jsxs("div",{className:"prompt-list-item-body",children:[N.jsx("div",{className:"prompt-list-item-title",children:d.title?g:N.jsx(pne,{})}),N.jsx("div",{className:"prompt-list-item-context",children:N.jsx(gne,{ellipsis:!0,children:d.context})})]}),N.jsxs("div",{className:"prompt-list-item-actions",onClick:I=>I.stopPropagation(),children:[a&&N.jsx(R.Button,{type:"text",disabled:l,icon:N.jsx(ct,{type:"icon-bianji2"}),onClick:()=>a(n)}),i&&N.jsx(R.Button,{type:"text",disabled:l,icon:N.jsx(ct,{type:"icon-shanchu"}),onClick:()=>i(n.id)})]})]})};const hne="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDMiIGhlaWdodD0iNDciIHZpZXdCb3g9IjAgMCA0MyA0NyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS41NiAzMS4xNTVDMTUuNTIgMzEuNDMgMTUuNSAzMS43MTUgMTUuNSAzMkMxNS41IDM1LjMxNSAxOC4xODUgMzggMjEuNSAzOEMyNC44MTUgMzggMjcuNSAzNS4zMTUgMjcuNSAzMkMyNy41IDMxLjcxNSAyNy40OCAzMS40MyAyNy40NCAzMS4xNTVINDJWNDQuNUM0MiA0NS4zMyA0MS4zMyA0NiA0MC41IDQ2SDIuNUMxLjY3IDQ2IDEgNDUuMzMgMSA0NC41VjMxLjE1NUgxNS41NloiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjggMzFDMjggMzQuNTkgMjUuMDkgMzcuNSAyMS41IDM3LjVDMTcuOTEgMzcuNSAxNSAzNC41OSAxNSAzMUMxNSAzMC44ODUgMTUuMDA1IDMwLjc3IDE1LjAxIDMwLjY1NUgxTDUuNzgwMDMgMTYuNTJDNS45ODUwMyAxNS45MSA2LjU2MDAxIDE1LjUgNy4yMDAwMSAxNS41SDM1LjhDMzYuNDQgMTUuNSAzNy4wMTUgMTUuOTEgMzcuMjIgMTYuNTJMNDIgMzAuNjU1SDI3Ljk5QzI3Ljk5NSAzMC43NyAyOCAzMC44ODUgMjggMzFaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTI3LjA1IDMxLjQ3NUMyNy4wNSAzNC4yNSAyNC41NjUgMzcgMjEuNSAzN0MxOC40MzUgMzcgMTUuOTUgMzQuMjUgMTUuOTUgMzEuNDc1QzE1Ljk1IDMxLjM4NSAxNS45NTUgMzAuOCAxNS45NiAzMC43MUg1LjVMOS41ODAwMiAyMC43OUM5Ljc1NTAyIDIwLjMxNSAxMC4yNDUgMjAgMTAuNzk1IDIwSDMyLjIwNUMzMi43NTUgMjAgMzMuMjQ1IDIwLjMxNSAzMy40MiAyMC43OUwzNy41IDMwLjcxSDI3LjA0QzI3LjA0NSAzMC44IDI3LjA1IDMxLjM4NSAyNy4wNSAzMS40NzVaIiBmaWxsPSIjRDhEQkZCIi8+CjxwYXRoIGQ9Ik0zMyAzNS41TDMzLjY2NjUgMzYuODQ1NEMzMy44Nzg3IDM3LjI3NDEgMzQuMjI1OSAzNy42MjEzIDM0LjY1NDYgMzcuODMzNUwzNiAzOC41TDM0LjY1NDYgMzkuMTY2NUMzNC4yMjU5IDM5LjM3ODcgMzMuODc4NyAzOS43MjU5IDMzLjY2NjUgNDAuMTU0NkwzMyA0MS41TDMyLjMzMzUgNDAuMTU0NkMzMi4xMjEzIDM5LjcyNTkgMzEuNzc0MSAzOS4zNzg3IDMxLjM0NTQgMzkuMTY2NUwzMCAzOC41TDMxLjM0NTQgMzcuODMzNUMzMS43NzQxIDM3LjYyMTMgMzIuMTIxMyAzNy4yNzQxIDMyLjMzMzUgMzYuODQ1NEwzMyAzNS41WiIgZmlsbD0idXJsKCNwYWludDBfbGluZWFyXzExMDI5XzM5MTYpIi8+CjxwYXRoIGQ9Ik0xLjYyNSA0NEMxLjYyNSA0NC40ODUgMi4wMTUgNDQuODc1IDIuNSA0NC44NzVINDAuNUM0MC45ODUgNDQuODc1IDQxLjM3NSA0NC40ODUgNDEuMzc1IDQ0VjMwLjc1NUwzNi42MyAxNi43MkMzNi41MSAxNi4zNjUgMzYuMTc1IDE2LjEyNSAzNS44IDE2LjEyNUg3LjIwMDAxQzYuODI1MDEgMTYuMTI1IDYuNDkgMTYuMzY1IDYuMzcgMTYuNzJMMS42MjUgMzAuNzU1VjQ0WiIgc3Ryb2tlPSIjOTY5OUI3IiBzdHJva2Utd2lkdGg9IjIuNSIvPgo8cGF0aCBkPSJNNS40OTk5NCAzMC41SDQuMjg0OTFNNy45OTk5NCAzMC41QzkuOTY5OTQgMzAuNSAxMi4wODk5IDMwLjUgMTQuMzY5OSAzMC41QzE1LjMwOTkgMzAuNSAxNS4zMDk5IDMxLjE2IDE1LjMwOTkgMzEuNUMxNS4zMDk5IDM0LjgxNSAxOC4wNiAzNy41IDIxLjQ1IDM3LjVDMjQuODQgMzcuNSAyNy41ODUgMzQuODE1IDI3LjU4NSAzMS41QzI3LjU4NSAzMS4xNiAyNy41ODUgMzAuNSAyOC41MjUgMzAuNUg0MC45OTk5IiBzdHJva2U9IiM5Njk5QjciIHN0cm9rZS13aWR0aD0iMi41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTIxLjA1IDEwLjM4VjJNMTMuNTUgMTAuMzhMOCA0LjE1MDAyTTM0LjA1IDQuMTUwMDJMMjguNSAxMC4zOCIgc3Ryb2tlPSIjOUMyNEYyIiBzdHJva2Utd2lkdGg9IjIuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfMTEwMjlfMzkxNiIgeDE9IjMwLjE3ODYiIHkxPSIzOC41IiB4Mj0iMzYuMzEyNiIgeTI9IjM4LjUiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iIzIwNUVGOSIvPgo8c3RvcCBvZmZzZXQ9IjAuNiIgc3RvcC1jb2xvcj0iIzgzNUFGRSIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNGRDYyRDkiLz4KPC9saW5lYXJHcmFkaWVudD4KPC9kZWZzPgo8L3N2Zz4K",Nne=e=>{const{appId:t,data:n=[],search:r,onItemClick:a,onChange:i,onRefresh:s}=e,o=()=>N.jsx("div",{className:"prompt-list-empty",children:N.jsx(R.Empty,{image:hne,imageStyle:{height:44},description:N.jsx("span",{children:"暂无快捷指令"})})});return N.jsx("div",{className:"prompt-list-wrap",children:n.length?N.jsx(N.Fragment,{children:N.jsx(R.List,{className:"prompt-list",dataSource:n,renderItem:u=>N.jsx(fne,{appId:t,data:u,highlight:r,onClick:a,onStatusChange:(l,c)=>{const d=n.findIndex(M=>M.id===c.id);d>-1&&(n[d]=c,i&&i([...n]))}})})}):N.jsx(o,{})})},mne=e=>{var O;const{appId:t,list:n,search:r,disabled:a=!1,open:i=!1,onClose:s,onPromptSelect:o}=e,[u,l]=L.useState(i),[c,d]=L.useState(),{service:M,popupContainer:g,mode:f}=L.useContext(an),[m,I]=L.useState((n==null?void 0:n.filter(B=>B.type==="me"))||[]),[A,y]=L.useState((n==null?void 0:n.filter(B=>B.type==="system"))||[]),[D,z]=L.useState((n==null?void 0:n.filter(B=>B.type==="system"))||[]),[w,j]=L.useState("system"),[F,H]=L.useState(!1);L.useEffect(()=>{u&&M&&(r&&r.length>Ge.PROMPT_TITLE_MAX_LENGTH?(I([]),y([])):(M.listPrompt(t,{type:"system"}).then(B=>H(!!B.length)),M.listPrompt(t,r?{title:r}:void 0).then(B=>{const Y=B.filter(ne=>ne.type==="me"),W=B.filter(ne=>ne.type==="system");I(Y),y(W)})))},[u]),L.useEffect(()=>{S()},[r]),L.useEffect(()=>{i&&S()},[i]),L.useEffect(()=>{let B=g==null?void 0:g.current;B?B.clientWidth>900?d(520):d(B.clientWidth-80):d(400)},[(O=g==null?void 0:g.current)==null?void 0:O.clientWidth]),L.useEffect(()=>{M==null||M.listPrompt(t).then(B=>{const Y=B.filter(W=>W.type==="system");z(Y)})},[M]);const S=()=>{if(r&&r.length>Ge.PROMPT_TITLE_MAX_LENGTH){I([]),y([]);return}M==null||M.listPrompt(t,r?{title:r}:void 0).then(B=>{const Y=B.filter(ne=>ne.type==="me"),W=B.filter(ne=>ne.type==="system");I(Y),y(W),l(!!(W.length&&(r!=null&&r.length))),r||z(W)})};return N.jsx(R.Popover,{title:null,placement:"topLeft",overlayClassName:"propmt-manage-popover",open:u,zIndex:1e4,arrowPointAtCenter:!0,trigger:["click"],autoAdjustOverflow:{adjustX:0},overlayStyle:{width:"260px"},getPopupContainer:()=>(g==null?void 0:g.current)||document.body,onOpenChange:B=>{l(B),!B&&s&&s()},content:N.jsx(N.Fragment,{children:N.jsx(R.Tabs,{activeKey:w,style:{padding:"0 16px"},onTabClick:B=>{j(B)},children:N.jsx(R.Tabs.TabPane,{tab:"快捷指令",children:N.jsx(Nne,{appId:t,data:A,search:r,onItemClick:B=>{o&&o(B),l(!1)}})},"system")})}),children:D!=null&&D.length?N.jsx(R.Button,{disabled:a,style:{width:"24px"},className:wn({"prompt-btn":!0,active:u}),type:"text",icon:N.jsx(ct,{type:"icon-tishiyu1",style:{fontSize:24}}),onClick:()=>l(!0)}):null})},Tne=L.memo(Fx),I2={icon:_2,text:"今天我能帮你什么?"};class Fs{constructor(t,n,r,a,i){Dt(this,"messageTime");Dt(this,"isWaiting");Dt(this,"messageId");Dt(this,"isContext");Dt(this,"actions");Dt(this,"reference");Dt(this,"isSensitive");Dt(this,"isSuspend");Dt(this,"imageContent");Dt(this,"comment");this.content=t,this.sessionId=n,this.role=r,this.files=a,this.content=t,this.role=r,this.sessionId=n,this.files=a,this.imageContent=i,this.messageTime=fn(new Date).format("YYYY-MM-DD HH:mm:ss"),this.isWaiting=!1,this.messageId=fo.v4(),this.isContext=!1,this.actions=[],this.reference=[],this.isSensitive=!1,this.isSuspend=!1,this.comment={isAgree:0}}}const D2=10,zf=(e,t,n,r)=>{let a=e;if(r===Ge.ApplicationTypes.Agent){if(n&&n.length>0){const i=n.map(s=>`[${s.name.replace(/\.[^/.]+$/,"")}](${s.url})`).join(`
317
317
  `);a=i?`${i}
318
318
  ${a}`:a}t&&(a=`![](${t})
319
- ${a}`)}return a},yne=L.forwardRef((e,t)=>{var hT,NT,mT,TT,yT,IT,DT,AT,bT,ET,jT,zT,LT,wT;const{application:n,docViewerUrl:r="",currentSession:a,onCreateSession:i,embeddingService:s,setCurrentSession:o,networkStatus:u,setNetworkStatus:l}=e,[c,d]=L.useState([]),[M,g]=L.useState(),[f,m]=L.useState(),I=L.useRef(null),{service:A,agentClient:y,depId:D,footer:z,transform:w,defaultInput:j,onMessage:F,onHistoryLoad:H,beforeMessageSend:S,bodyStyle:O,disabled:B,features:Y,popupContainer:W,icon:ne,sider:se,mode:te}=L.useContext(an),[Re,he]=L.useState(!1),Ae=L.useRef(c),_=L.useRef(void 0),[je,we]=L.useState(0),[E,X]=L.useState(),[ge,Le]=L.useState(""),[K,ee]=L.useState(!1),ce=L.useRef(null),[ue,Ne]=L.useState([]),[Ce,Ue]=L.useState(!1),[Fe,Be]=L.useState(!1),[mt,bt]=L.useState(""),[pn,$t]=L.useState(),[yr,vr]=L.useState({}),ra=L.useRef(null),hn=L.useRef(null),rr=L.useRef(null),[aa,Z]=L.useState(!1),[ie,be]=L.useState([]),[Pe,nt]=L.useState(!0),[Pt,lt]=L.useState(!0),[We,wt]=L.useState(!1),[Gn,_t]=L.useState(!1),[ia,Ir]=L.useState(!1),[Dr,zs]=L.useState(typeof(Y==null?void 0:Y.promptVariables)=="object"?Y.promptVariables.default||[]:[]),[FS,GS]=L.useState(()=>{const $=typeof(Y==null?void 0:Y.knowledges)=="object"&&Y.knowledges.default||void 0;if($){if(Array.isArray($)&&$.some(Qe=>Array.isArray(Qe.fileIds)&&Qe.fileIds.length===0))throw Error("fileIds cannot be an empty array");if(El($)>Ua)throw Error(`knowledges and fileIds total count cannot exceed ${Ua}`)}return $}),[iT,sa]=L.useState(!1),[sT,Ls]=L.useState(!1),[HS,wi]=L.useState(typeof(Y==null?void 0:Y.connectNetwork)=="object"&&typeof(Y==null?void 0:Y.connectNetwork.default)=="boolean"?Y.connectNetwork.default:!1),[oT,iu]=L.useState(!1),[WS,Ca]=L.useState(!1),[qS,$S]=L.useState(null),[su,ai]=L.useState(!1),[uT,lT]=L.useState(!1),{isSwitchingToExistingSession:cT,setIsSwitchingToExistingSession:ou}=km();L.useEffect(()=>{if($S(a),a===null)Ca(!1);else if(a===void 0)Ca(!0);else{if(qS===null){if(cT){Ca(!0),ou(!1);return}Ca(!1);return}a.ready?Ca(!1):Ca(!0)}},[a,a==null?void 0:a.ready,cT]),L.useEffect(()=>{var ke,Qe;a&&(Ae.current=[]),d([]);const $=I.current;if($&&$.scrollTo({top:0}),!((ke=a==null?void 0:a.data)!=null&&ke.id))return;if(_t(!1),wt(!1),(Qe=a.messages)!=null&&Qe.length){const Ke=[...a.messages.filter(Oe=>Oe==null?void 0:Oe.messageId)].reverse();Ae.current=[...Ke],d([...Ke]),Ca(!1)}const ae=pe=>{var Ke;(Ke=a==null?void 0:a.data)!=null&&Ke.id&&(Ae.current=[...pe].reverse(),d([...pe].reverse()),!pe||pe.length<10?Ls(!1):Ls(!0),Ca(!1),H&&H({applicationId:n.id,sessionId:a.data.id,histories:pe}))};return a.addEventListener("history:loaded",ae),()=>{Ae.current=[],d([]),a==null||a.removeEventListener("history:loaded",ae)}},[a]),L.useEffect(()=>{const $=()=>{var ae;(ae=a==null?void 0:a.data)!=null&&ae.id&&(a.promptVariables&&zs(a.promptVariables.sort((ke,Qe)=>ke.key.localeCompare(Qe.key))),a.knowledges&&GS(a.knowledges),l(a.netOpen))};return a==null||a.addEventListener("data:updated",$),()=>{a==null||a.removeEventListener("data:updated",$)}},[a]),L.useEffect(()=>{var ae;if(!((ae=a==null?void 0:a.data)!=null&&ae.id))return;const $=ke=>{var Qe;console.error(ke.message,ke.cause,"e.case"),R.notification.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-notification"}),R.notification.error({message:((Qe=ke.cause)==null?void 0:Qe.message)||ke.message}),R.notification.config({getContainer:void 0,prefixCls:"gbot-notification"})};return a.addEventListener("error",$),()=>{a==null||a.removeEventListener("error",$)}},[a]);const VS=()=>{var ke;if(!((ke=a==null?void 0:a.data)!=null&&ke.id)||!(n!=null&&n.id))return;const $=a.data.id,ae=c[c.length-1];if(ae&&ae.isContext){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.success("已开启新话题"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}else a.clear().then(()=>{const Qe=new Fs("",$,Ge.IHistoryRole.System);Qe.isContext=!0,d([Qe,...c])})};L.useEffect(()=>{n!=null&&n.id&&(A==null||A.getRecommendQues(n.id).then($=>{Ne($)}))},[D,n]);const dT=$=>et(exports,null,function*(){var xa,Sa;if(B){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("发送功能被禁用"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}const ae=$||M;if(!(ae!=null&&ae.trim())){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("请输入你想问的"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}if(!(Dr==null?void 0:Dr.every(on=>!!(on!=null&&on.value))))if(w!=null&&w.promptVariables){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("变量值不能为空"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}else console.error("变量值不能为空",Dr==null?void 0:Dr.map(on=>!!(on!=null&&on.value)));if(Gn){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("正在回复中"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}if(Re){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("等待初始化"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}if(!Pe){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("正在解析文件"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}if(K){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("正在上传图片"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}X(void 0),Le("");const Qe=(xa=a==null?void 0:a.data)==null?void 0:xa.id;if(!Qe){if(su)return;ai(!0),i==null||i({netOpen:u?_r.OPEN:_r.CLOSE}).then(on=>{var br,ws;sa(!0),l(!!((br=on.data)!=null&&br.netOpen)),wi(!!((ws=on.data)!=null&&ws.enableNetOpen)),uu(on).then(()=>{o==null||o(on),sa(!1),m(ae)})}).catch(on=>{ai(!1)});return}if(su)return;ai(!0),iu(!0);const pe=zf(ae,ge,yr[Qe],(n==null?void 0:n.type)||0);let Ke;try{S?Ke=yield S==null?void 0:S({applicationId:n.id,sessionId:Qe,message:{content:pe,sessionId:Qe,role:Ge.ChatMessageRole.User,files:yr[Qe]}}):Ke=!0}catch(on){Ke=!1}if(iu(!1),Ke===!1){ai(!1);return}let Oe=ae;typeof Ke=="object"&&(Oe=Ke.content||ae);const Nn=yield(()=>new Promise(on=>{zs(br=>(on(br),br))}))();if(!(yield a.setPromptVariables(Nn))){ai(!1);return}((Sa=yr[Qe])==null?void 0:Sa.length)>0?ZS(Oe):Ac(Oe)}),uu=$=>new Promise((ae,ke)=>et(exports,null,function*(){const Ke=($==null?void 0:$.promptVariables).filter(Oe=>Oe.type?!((Oe.type===Ge.PromptVariableType.User||Oe.type===void 0)&&Oe.key==="query")&&!((Oe.type===Ge.PromptVariableType.System||Oe.type===void 0)&&Oe.key==="datetime"):Oe.key!=="query").map(Oe=>{var Nn;const Qt=(Nn=Dr.find(Ar=>Ar.key===Oe.key&&Ar.type===Oe.type))==null?void 0:Nn.value;return Oe.value=Qt||"",Oe});zs(Ke.sort((Oe,Qt)=>Oe.key.localeCompare(Qt.key))),yield $==null?void 0:$.setPromptVariables(Ke).catch(Oe=>{console.error(Oe),R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error(Oe.message),R.message.config({getContainer:void 0,prefixCls:"gbot-message"})}),ae()})),ZS=$=>{var pe,Ke,Oe;if(nt(!1),!((pe=a==null?void 0:a.data)!=null&&pe.id)||!(n!=null&&n.id))return;const ae=((Ke=a.data)==null?void 0:Ke.id)||"";let ke=[],Qe=new Set;(Oe=yr[ae])==null||Oe.forEach(Qt=>{Qe.has(Qt.id)||(ke.push(Qt),Qe.add(Qt.id))}),nt(!0),Ac($,ke)};L.useEffect(()=>{if(!f||!a)return;const $=f,ae=()=>et(exports,null,function*(){iu(!0);const ke=zf($,ge,yr[a.id],(n==null?void 0:n.type)||0);let Qe;try{S?Qe=yield S==null?void 0:S({applicationId:n.id,sessionId:a.id,message:{content:ke,sessionId:a.id,role:Ge.ChatMessageRole.User,files:yr[a.id]}}):Qe=!0}catch(pe){Qe=!1}if(iu(!1),Qe===!1){ai(!1);return}Ac($),m(void 0)});return a.ready?ae():a.addEventListener("ready",ae,!0),()=>{a==null||a.removeEventListener("ready",ae)}},[f,a]);const Ac=($,ae)=>et(exports,null,function*(){var xa,Sa,on;const ke=(xa=a==null?void 0:a.data)==null?void 0:xa.id;if(!ke)return;_t(!0),wt(!0);const Qe=zf($,ge,ae,(n==null?void 0:n.type)||0);let pe;n.type===Ge.ApplicationTypes.Agent?pe=void 0:n.type===Ge.ApplicationTypes.Dialog&&((Sa=n.arrange)!=null&&Sa.length)&&n.arrange[0].visionOpen?pe=ge?[ge]:void 0:pe=void 0;const Ke=new Fs(Qe,ke,Ge.IHistoryRole.User,ae,pe);g(void 0),$t(void 0),Ae.current=[Ke,...c],d(Ae.current),n.id&&F&&F({applicationId:n.id,sessionId:ke,message:Ke});const Oe=new Fs("",ke,Ge.IHistoryRole.System);Oe.isWaiting=!0,Ae.current=[Oe,...Ae.current],d(Ae.current);const Qt=(ae==null?void 0:ae.map(br=>br.id))||[],Nn={stream:Ws.configuration.stream,referenceFirst:!1};if(w!=null&&w.promptVariables){const br=Dr==null?void 0:Dr.reduce((ws,CT)=>(ws[CT.key]=CT.value,ws),{});Nn.formatValues=br}if(w!=null&&w.knowledges){const br=FS;Nn.knowledges=br}const Ar={text:Qe,fileIds:Qt,files:ae};pe&&pe.length>0&&(Ar.imageContent=pe),yield a.send(Ar,Nn),vr({[ke]:[]}),(on=ra.current)==null||on.update(),ai(!1)});L.useEffect(()=>{var Qe;const $=(Qe=a==null?void 0:a.data)==null?void 0:Qe.id;if(!$)return;const ae=pe=>{if(!pe.sessionId||pe.sessionId&&pe.sessionId!==_.current||pe.role===Ge.IHistoryRole.User)return;if(pe.index===-1&&pe.code!==200&&pe.code!==11915&&(wt(!1),_t(!1),Ae.current=Ae.current.filter(Qt=>!Qt.isWaiting),d([...Ae.current]),Ae.current=[...Ae.current],pe.content)){R.notification.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-notification"}),R.notification.error({message:pe.content}),R.notification.config({getContainer:void 0,prefixCls:"gbot-notification"});return}const Ke=pe.actions||[],Oe=new Fs(pe.content,$,Ge.IHistoryRole.Robot);Oe.messageId=pe.messageId||fo.v4(),Oe.reasoningContent=pe.reasoningContent,Oe.searchReference=pe.searchReference,Oe.thinkingSecs=pe.thinkingSecs,Oe.thinkingStatus=pe.thinkingStatus,Oe.actions=Ke,Oe.isLoading=!0,Oe.searchingStatus=pe.searchingStatus,Ae.current=Ae.current.filter(Qt=>!Qt.isWaiting).filter(Qt=>!Qt.isReplying),pe.index===void 0&&d([Oe,...Ae.current]),pe.code===11915&&(wt(!1),_t(!1),Oe.isLoading=!1,Oe.content="请您换个问题问我吧~",Oe.isSensitive=!0,d([Oe,...Ae.current])),pe.index===-2&&(wt(!1),_t(!1),Oe.isLoading=!1,Oe.content="回答已中止~",Oe.isSuspend=!0,d([Oe,...Ae.current])),pe.index===-1&&(wt(!1),_t(!1),Oe.isLoading=!1,Oe.reference=pe.reference,d([Oe,...Ae.current]),n.id&&F&&F({applicationId:n.id,sessionId:$,message:Oe})),pe.index===-3&&(wt(!1),_t(!1),Oe.isLoading=!1,Oe.reference=pe.reference,Oe.relatedQuesion=pe.relatedQuesion,d([Oe,...Ae.current]))},ke=()=>{a.addEventListener("message:updated",ae)};return a.ready?a.addEventListener("message:updated",ae):a.addEventListener("ready",ke),()=>{a==null||a.removeEventListener("message:updated",ae),a==null||a.removeEventListener("ready",ke)}},[a]),L.useEffect(()=>{if(!a){he(!1);return}const $=ae=>{he(ae)};return he(a.frozen),a.addEventListener("frozen",$),()=>{a==null||a.removeEventListener("frozen",$)}},[a]),L.useEffect(()=>{if(!y)return;const $=y.questionContextMaxLength||4e3;we($)},[y,A]),L.useEffect(()=>{j&&$t(j.text)},[j]);const XS=$=>{const ae=$.size;return ae<=0?(R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("该文件为空,请重新上传"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"}),!1):ae>20*Zu?(R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("图片须小于20M"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"}),!1):(X($),!1)},JS=$=>et(exports,null,function*(){var ae;return X($),(ae=a==null?void 0:a.data)!=null&&ae.id?MT(a,$):new Promise(ke=>{sa(!0),i==null||i({netOpen:u?_r.OPEN:_r.CLOSE}).then(Qe=>{var pe,Ke;o==null||o(Qe),sa(!1),l(!!((pe=Qe.data)!=null&&pe.netOpen)),wi(!!((Ke=Qe.data)!=null&&Ke.enableNetOpen)),uu(Qe),ke(MT(Qe,$))})})}),MT=($,ae)=>{const ke=_te(ae.name);return new Promise(Qe=>{var Ke;const pe={files:[`${fo.v4()}.${ke}`],isv:"minio",knowledgeId:((Ke=$.data)==null?void 0:Ke.id)||"",type:1};ee(!0),A==null||A.postTicket(pe).then(Oe=>{A.uploadMinioFile(Oe.minio,ae).then(()=>{var xa,Sa;const Qt=(xa=Oe.minio.endpoints)==null?void 0:xa[0],Nn=Oe.minio.bucket,Ar=(Sa=Oe.minio.fileKeys)==null?void 0:Sa[0];Qe(`${location.protocol}//${Qt}/${Nn}/${Ar}`)}).catch(()=>{Le(""),X(void 0)}).finally(()=>{ee(!1)})}).catch(()=>{Le(""),X(void 0),ee(!1)})})};L.useEffect(()=>{const $=I.current;$&&!ia&&$.scrollTo({top:$.scrollHeight})},[c]);const gT=($,ae)=>new Promise(ke=>{if(!ae.file.url||!(n!=null&&n.id))return ke();const Qe=Et(re({},ae.file),{type:1});A==null||A.postApplicationIdSessionKnowledgeSessionFile(n==null?void 0:n.id,$,Qe).finally(()=>{var pe;(pe=ra.current)==null||pe.update().finally(ke)})}),KS=()=>{var $;($=a==null?void 0:a.data)!=null&&$.id&&(wt(!1),a.suspend())},eO=$=>{const ae=I.current;ae&&setTimeout(()=>{ae.scrollTo({top:ae.scrollHeight,behavior:$==null?void 0:$.behavior})},$==null?void 0:$.ms)},tO=()=>{if(!I.current)return;const $=I.current.scrollTop<=-80;Ir($)},nO=Hr.useMemoizedFn($=>{var ae,ke;(ae=ce.current)==null||ae.update($),(ke=ce.current)==null||ke.focus()}),rO=Hr.useMemoizedFn($=>{dT($)}),aO=Hr.useMemoizedFn(()=>{var ae;if(!((ae=a==null?void 0:a.data)!=null&&ae.id))return;Ae.current=[...c.slice(1,c.length)],d(Ae.current);const $=new Fs("",a.data.id,Ge.IHistoryRole.System);$.isWaiting=!0,Ae.current=[$,...Ae.current],d(Ae.current),_t(!0),wt(!0),a.answerAgain()});L.useEffect(()=>{var $,ae;_.current=($=a==null?void 0:a.data)==null?void 0:$.id,!iT&&((ae=rr.current)==null||ae.clear())},[a]);const iO=()=>{var ke;if(!((ke=a==null?void 0:a.data)!=null&&ke.id))return;const ae=c[c.length-1].messageTime;a.fetchMessages({endTime:ae,pageSize:D2}).then(Qe=>{const pe=Qe||[];if(!pe||!(pe!=null&&pe.length)){Ls(!1);return}pe.length<10?Ls(!1):Ls(!0),d([...c,...pe.reverse()])})},sO=$=>et(exports,null,function*(){var ae,ke;if(!((ae=a==null?void 0:a.data)!=null&&ae.id))l($);else{if(yield a.setNetOpen($),!((ke=a.data)!=null&&ke.id))return;l($)}}),bc=()=>et(exports,null,function*(){a?a.fetchData().then($=>{var ae;(ae=a==null?void 0:a.data)!=null&&ae.id&&(l($.netOpen),wi($.enableNetOpen))}):(l(typeof(Y==null?void 0:Y.connectNetwork)=="object"&&typeof(Y==null?void 0:Y.connectNetwork.default)=="boolean"?Y.connectNetwork.default:!1),wi(n.arrange[0].enableNetOpen))});L.useEffect(()=>{bc()},[a]),L.useEffect(()=>{requestAnimationFrame(()=>{var ae,ke;if(I.current){const Qe=document.getElementById("chat-main"),pe=(ae=I.current)==null?void 0:ae.querySelector(".infinite-scroll-component__outerdiv"),Ke=(ke=I.current)==null?void 0:ke.querySelector(".infinite-scroll-component");if(!pe||!Ke||!Qe)return;const Oe=Qe.offsetHeight;if(Ke.offsetHeight<=Oe){if(pe.style.height==="100%")return;pe.style.height="100%"}else{if(pe.style.height==="auto")return;pe.style.height="auto"}}})},[c]),L.useEffect(()=>{if(a)return;const $=()=>{const Qe=((y==null?void 0:y.promptVariables)||[]).filter(pe=>pe.type?!(pe.type===Ge.PromptVariableType.User&&pe.key==="query")&&!(pe.type===Ge.PromptVariableType.System&&pe.key==="datetime")&&pe.status===1:pe.key!=="query"&&pe.status===1).map((pe,Ke)=>{var Qt,Nn;let Oe="";return typeof(Y==null?void 0:Y.promptVariables)=="object"&&(Oe=((Nn=(Qt=Y.promptVariables.default)==null?void 0:Qt.find(Ar=>Ar.key===pe.key&&Ar.type===pe.type))==null?void 0:Nn.value)||""),{id:Ke+"",key:pe.key,name:pe.name,value:Oe,type:pe.type}});zs([...Qe].sort((pe,Ke)=>pe.key.localeCompare(Ke.key)))};return y!=null&&y.ready?$():y==null||y.addEventListener("ready",$),()=>{y==null||y.removeEventListener("ready",$)}},[a,y,Y==null?void 0:Y.promptVariables]);const pT=()=>i==null?void 0:i({netOpen:u?_r.OPEN:_r.CLOSE}).then($=>{var ae,ke;return o==null||o($),sa(!1),l(!!((ae=$.data)!=null&&ae.netOpen)),wi(!!((ke=$.data)!=null&&ke.enableNetOpen)),uu($),$}),fT=L.useMemo(()=>{var $;return n.arrange&&(($=n.arrange[0])!=null&&$.openingContent)?N.jsx(Fx,{application:n,history:{role:1,content:n.arrange[0].openingContent,code:200,messageId:"opening-message",sessionId:"",reference:[],searchReference:[],messageTime:fn(Date.now()).format("YYYY-MM-DD HH:mm:ss"),actions:[],isLoading:!1},actions:!!c.length,markdown:Y==null?void 0:Y.markdown}):null},[n==null?void 0:n.arrange,c]);return L.useImperativeHandle(t,()=>({getCurrentInputText:()=>{var $;return($=ce.current)==null?void 0:$.getCurrentText()}})),L.useEffect(()=>{var ae;const $=(ae=a==null?void 0:a.data)==null?void 0:ae.id;$&&vr(ke=>Et(re({},ke),{[$]:[]}))},[(hT=a==null?void 0:a.data)==null?void 0:hT.id]),N.jsxs("div",{className:"agent-chat",children:[WS?N.jsx("div",{className:"session-loading",children:N.jsx(R.Spin,{})}):N.jsxs(N.Fragment,{children:[(w==null?void 0:w.promptVariables)&&N.jsx(qx,{ref:hn,appId:n.id,currentSession:a,promptVariables:Dr,setPromptVariables:zs,setCurrentSession:o}),N.jsxs("div",{className:"chat-main",id:"chat-main",style:O,children:[N.jsx("div",{className:"chat-main-wrapper",id:"scrollableDiv",style:{height:"100%",overflowY:"auto",display:"flex",flexDirection:"column-reverse"},ref:I,onScroll:tO,children:(NT=a==null?void 0:a.data)!=null&&NT.id&&(c!=null&&c.length)?N.jsxs(gO,{dataLength:c.length,next:iO,style:{display:"flex",flexDirection:"column-reverse",overflowX:"hidden"},inverse:!0,endMessage:c.length>D2&&((mT=I.current)!=null&&mT.scrollTop)&&((TT=I.current)==null?void 0:TT.scrollTop)<-10?N.jsx(R.Divider,{plain:!0,children:"没有更多数据了"}):null,hasMore:sT,loader:N.jsx("div",{style:{height:"50px",textAlign:"center",overflow:"hidden"},children:N.jsx(R.Spin,{})}),scrollableTarget:"scrollableDiv",children:[c.map(($,ae)=>N.jsx(Tne,{application:n,currentSession:a,history:$,docViewerUrl:r,isLastHistory:ae===0,onRelatedClick:rO,onAgainClick:aO,onEditClick:nO,markdown:Y==null?void 0:Y.markdown},$.messageId+ae)),!sT&&fT]}):N.jsxs("div",{className:"main-empty",children:[(Y==null?void 0:Y.greeting)!==!1&&N.jsx(Kte,{text:Y!=null&&Y.greeting&&typeof Y.greeting=="object"&&Y.greeting.text!==void 0?Y.greeting.text:(yT=n.arrange)!=null&&yT.length&&((IT=n.arrange[0])!=null&&IT.greetings)?n.arrange[0].greetings:I2.text,icon:Y===void 0||Y.greeting===!0||((DT=Y.greeting)==null?void 0:DT.icon)===void 0?ne||I2.icon:Y.greeting.icon,children:!!ue.length&&(((Y==null?void 0:Y.greeting)===void 0||(Y==null?void 0:Y.greeting))===!0||typeof(Y==null?void 0:Y.greeting)=="object"&&Y.greeting.questions!==!1)&&N.jsx(Hx,{ref:rr,sid:(AT=a==null?void 0:a.data)==null?void 0:AT.id,isRecommendClearing:Ce,data:ue,layoutBreakpoints:typeof(Y==null?void 0:Y.greeting)=="object"?Y.greeting.layoutBreakpoints:void 0,onItemClick:$=>{var ke,Qe,pe;if(g($==null?void 0:$.question),$t($==null?void 0:$.question),Ce)return;$!=null&&$.id&&Ue(!0);const ae=(ke=a==null?void 0:a.data)==null?void 0:ke.id;w!=null&&w.fileUpload?(pe=(Qe=ra.current)==null?void 0:Qe.clear())==null||pe.then(()=>{var Ke,Oe;$!=null&&$.id&&(ae?(Ke=gT(ae,$))==null||Ke.finally(()=>{Ue(!1)}):(Ue(!1),sa(!0),(Oe=pT())==null||Oe.then(Qt=>{var Nn;(Nn=gT(Qt.id,$))==null||Nn.finally(()=>{Ue(!1)})})))}):ae?Ue(!1):(Ue(!1),sa(!0),pT())}})}),fT]})}),We&&N.jsx("div",{className:"session-stop",children:N.jsx(R.Button,{type:"primary",style:{background:"white"},ghost:!0,size:"small",icon:N.jsx(ct,{type:"icon-zantinghuida",style:{fontSize:16}}),onClick:()=>KS(),children:"停止回答"})}),ia&&(c==null?void 0:c.length)>0&&N.jsx("div",{className:"back-bottom",children:N.jsx(R.Button,{size:"small",onClick:()=>eO({behavior:"smooth"}),type:"link",icon:N.jsx(ct,{type:"icon-yijianhuidaodibu",style:{fontSize:24}})})})]}),N.jsx("div",{className:"chat-footer",children:N.jsxs("div",{className:"chat-footer-input",children:[E&&N.jsx("div",{className:"input-files",children:N.jsx(Zte,{file:E,actions:{upload:JS,remove:()=>{Le(""),X(void 0)}},onUrlChange:$=>Le($)})}),N.jsxs(R.Space,{className:"footer-upload-action",onClick:$=>$.preventDefault(),children:[N.jsxs(R.Space,{children:[(n.type===Ge.ApplicationTypes.Agent&&(w==null?void 0:w.imageUpload)||n.type===Ge.ApplicationTypes.Dialog&&((bT=n.arrange)==null?void 0:bT.length)&&!!n.arrange[0].visionOpen&&(w==null?void 0:w.imageUpload))&&N.jsx(R.Upload,{disabled:!!E||B,accept:".jpg, .png, .jpeg,.bmp",listType:"picture-card",beforeUpload:XS,className:"footer-upload-picture",showUploadList:!1,children:E?N.jsx(R.Button,{type:"text",className:"camera-out-btn",style:{width:"22px",position:"relative",bottom:"-2px"},disabled:!!E||B,icon:N.jsx(At.CameraOutlined,{className:"icon-tianjia",style:{fontSize:"22px"}})}):N.jsx(R.Tooltip,{placement:"topLeft",overlayClassName:"footer-upload-tooltip",title:N.jsx("div",{children:"支持上传.jpg .png .jpeg .bmp格式的图片数据,最大20M,单次仅可上传1个"}),children:N.jsx(R.Button,{type:"text",className:"camera-out-btn",style:{width:"22px",position:"relative",bottom:"-2px"},icon:N.jsx(ct,{type:"icon-Vector",className:"icon-tianjia",style:{fontSize:"22px"}})})})}),s&&(w!=null&&w.fileUpload)&&(n!=null&&n.id)?N.jsx(Wx,{appId:n==null?void 0:n.id,ref:ra,isFirstSession:iT,docViewerUrl:r,onStatusChange:$=>et(exports,null,function*(){$!=="process"?(nt(!0),bc()):nt(!1)}),createSession:()=>new Promise($=>{sa(!0),i==null||i({netOpen:u?_r.OPEN:_r.CLOSE}).then(ae=>{var Qe,pe,Ke;o==null||o(ae),sa(!1),l(!!((Qe=ae.data)!=null&&Qe.netOpen)),wi(!!((pe=ae.data)!=null&&pe.enableNetOpen)),uu(ae);const ke=((Ke=ae.data)==null?void 0:Ke.id)||"";$(ke)})}),sid:(ET=a==null?void 0:a.data)==null?void 0:ET.id,disabled:Gn||B,afterFileAdd:($,ae)=>{ae&&vr(ke=>{const Qe=ke[ae]||[];return{[ae]:[...Qe,$]}})},afterFileDelete:$=>{var ke;const ae=(ke=a==null?void 0:a.data)==null?void 0:ke.id;ae&&vr(Qe=>{const pe=Qe[ae]||[];return{[ae]:pe.filter(Ke=>Ke.id!==$)}})},onFileListChange:$=>{be($)},shouldContinue:Pt,afterFilesClear:()=>{var ae;const $=(ae=a==null?void 0:a.data)==null?void 0:ae.id;$&&(vr({[$]:[]}),bc())}}):null,(w==null?void 0:w.prompt)&&(n==null?void 0:n.id)&&N.jsx(mne,{appId:n.id,list:[],search:Fe?mt:"",onPromptSelect:$=>{$t($.context),g($.context)},disabled:B})]}),N.jsxs(R.Space,{children:[(w==null?void 0:w.connectNetwork)&&n.type===Ge.ApplicationTypes.Dialog&&((jT=n.arrange)==null?void 0:jT.length)&&!!n.arrange[0].enableNetOpen&&N.jsx(Mne,{sessionId:(zT=a==null?void 0:a.data)==null?void 0:zT.id,netStatus:u,enable:typeof(Y==null?void 0:Y.connectNetwork)=="object"&&typeof(Y==null?void 0:Y.connectNetwork.diabled)=="boolean"?!(Y!=null&&Y.connectNetwork.diabled):HS,disabledTip:a?void 0:"网络访问已被禁用",onNetStatusChange:$=>{sO($)}}),(w==null?void 0:w.sessionList)&&N.jsx(une,{currentSessionId:(LT=a==null?void 0:a.data)==null?void 0:LT.id,onSessionChange:($,ae)=>{$t(void 0),ou(!0),o==null||o(ae)},disabled:B}),se&&te==="float"&&N.jsx("div",{className:"session-history-drawer-component",children:N.jsx(R.Popover,{placement:"topRight",showArrow:!1,overlayClassName:"session-history-overlay",overlayStyle:{padding:"4px"},getPopupContainer:$=>$.parentNode,content:"会话历史记录",children:N.jsx(R.Button,{className:"history-overlay-action",disabled:B,type:"text",icon:N.jsx(ct,{type:"icon-lishijilu",style:{fontSize:24}}),onClick:()=>lT(!0)})})}),(w==null?void 0:w.sessionOpen)&&N.jsx(R.Button,{icon:N.jsx(At.PlusOutlined,{}),className:"add-btn",type:"primary",disabled:We||!a||!c.length||B,onClick:()=>{var $,ae;ou(!1),o==null||o(null),l(!1),($=hn.current)==null||$.clear(),(ae=rr.current)==null||ae.clear()},children:"新会话"})]})]}),N.jsx("div",{className:"footer-textarea",children:N.jsx(Gx,{ref:ce,maxLength:je,text:pn,networkStatus:!1,loading:oT||su,disabled:Re||K||B||oT||su,onTextSend:dT,onChange:($,ae)=>{$t($);const ke=ae.getText().replace(/[\n\s]+$/,"");g(ke),bt(ke),Fe||Be(!0)},clearAction:N.jsx(R.Space,{size:0,children:N.jsx(R.Button,{type:"link",disabled:Gn||B,ghost:!0,icon:N.jsx(ct,{style:{fontSize:22},type:"icon-qingchujiyi"}),onClick:()=>VS()})})})})]})}),N.jsx(tne,{tips:z}),aa&&N.jsx(ane,{isvisible:aa,files:ie,sessionId:(wT=a==null?void 0:a.data)==null?void 0:wT.id,onClose:$=>{Z(!1),lt(!1)}})]}),uT&&N.jsx(dne,{currentSession:a,application:n,networkStatus:u,setCurrentSession:o,disabled:B,isSessionHistoryVisible:uT,setIsSessionHistoryVisible:lT,onSessionChange:$=>{ou(!0)}})]})});const Zx=e=>{const{disabled:t,checkedValues:n,currKnowledgeList:r,selectCount:a,onSelectChange:i}=e,[s,o]=L.useState(!1),u=N.jsx(R.Checkbox.Group,{style:{width:"100%"},onChange:i,value:n,disabled:t,children:N.jsx(R.Row,{gutter:[20,12],children:r==null?void 0:r.map(c=>N.jsx(R.Col,{span:24,children:N.jsx(R.Checkbox,{value:c.id,children:c.name})},c.id))})}),l=c=>{o(c)};return N.jsx("div",{className:"knowledge-select",style:{borderColor:s?"#9C24F2":"#84868C"},children:N.jsx(R.Popover,{className:"select-popover",placement:"bottomRight",title:null,content:u,trigger:"click",overlayStyle:{width:280},onOpenChange:l,getPopupContainer:c=>c.parentNode,children:N.jsxs("div",{className:"",onClick:c=>c.preventDefault(),children:[N.jsx(ct,{className:"select-icon",type:"icon-open"}),N.jsx("span",{className:"title",children:"参考知识库"}),N.jsxs("span",{className:"content",children:["已选 ",a," 个"]})]})})})},Ine=e=>{var I,A;const{currentSession:t,application:n,setCheckKnowledges:r}=e,{mode:a,transform:i,features:s}=L.useContext(an),[o,u]=L.useState([]),[l,c]=L.useState(typeof(s==null?void 0:s.knowledges)=="object"?((I=s.knowledges.default)==null?void 0:I.map(y=>y.id))||[]:[]),[d,M]=L.useState(0),[g,f]=L.useState(!1);L.useEffect(()=>{if(!(n!=null&&n.id))return;const y=n.arrange;if(!(y!=null&&y.length))return;const z=y[0].knowledges||[];u(z);const w=typeof(s==null?void 0:s.knowledges)=="object"&&s.knowledges.default||z;if(Array.isArray(w)&&w.some(S=>Array.isArray(S.fileIds)&&S.fileIds.length===0))throw Error("fileIds cannot be an empty array");if(El(w||[])>Ua)throw Error(`knowledges and fileIds total count cannot exceed ${Ua}`);if(!t){c(w.map(H=>H.id)),M(w.length),r==null||r(w);return}const F=()=>{const H=t.knowledges||w;M(H.length);const S=H.map(O=>O.id);c(S)};return F(),t.addEventListener("data:updated",F),()=>{t==null||t.removeEventListener("data:updated",F)}},[n,t]),L.useEffect(()=>{var D;if(!g||(f(!1),!(n!=null&&n.id)))return;const y=[];l==null||l.map(z=>{const w=o==null?void 0:o.find(j=>j.id===z);y.push(w)}),(D=t==null?void 0:t.data)!=null&&D.id&&t.setKnowledges(y)},[g]);const m=y=>{f(!0),c(y);const D=[];y==null||y.map(z=>{const w=o==null?void 0:o.find(j=>j.id===z);D.push(w)}),r==null||r(D),M(y.length)};return N.jsxs("div",{className:"chat-header",children:[N.jsxs(R.Space,{className:"header-title",children:[a==="inlay"&&((A=t==null?void 0:t.data)==null?void 0:A.name),a==="float"&&(n==null?void 0:n.name)]}),(i==null?void 0:i.knowledges)&&o.length!==0&&N.jsx(Zx,{disabled:typeof(s==null?void 0:s.knowledges)=="object"&&(s==null?void 0:s.knowledges.diabled)||!1,checkedValues:l,currKnowledgeList:o,selectCount:d,onSelectChange:m})]})};const Dne=L.forwardRef((e,t)=>{const{sessionId:n,appId:r,docViewerUrl:a}=e,[i,s]=L.useState(),{showHeader:o,agentClient:u,sider:l,onSessionLoad:c,features:d,mode:M}=L.useContext(an),[g,f]=L.useState(),m=L.useRef(null),[I,A]=L.useState(""),[y,D]=L.useState(),z=L.useRef(null),[w,j]=L.useState(!1);L.useState([]);const{setIsSwitchingToExistingSession:F}=km();L.useEffect(()=>{var S;j(i?!!((S=i.data)!=null&&S.netOpen):typeof(d==null?void 0:d.connectNetwork)=="object"&&typeof(d==null?void 0:d.connectNetwork.default)=="boolean"?d.connectNetwork.default:!1)},[i]),L.useEffect(()=>{const S=()=>et(exports,null,function*(){const O=u==null?void 0:u.application;if(!(O!=null&&O.id))return;const B=O==null?void 0:O.arrange;if(!(B!=null&&B.length))return;const W=B[0].embeddingService;A(W),f(O)});if(u!=null&&u.ready){S();return}return u==null||u.addEventListener("ready",()=>S()),()=>{u==null||u.removeEventListener("ready",S)}},[u]),L.useEffect(()=>{u&&n&&(u.ready?u==null||u.getSessions().then(S=>et(exports,null,function*(){s==null||s(S.find(O=>O.id===n))})):u.addEventListener("ready",()=>et(exports,null,function*(){u==null||u.getSessions().then(S=>et(exports,null,function*(){s==null||s(S.find(O=>O.id===n))}))}),!0))},[u,n]),L.useEffect(()=>{if(!i){c&&c({applicationId:r,sessionId:"",session:null,sessionInstance:null});return}i.data&&c&&c({applicationId:r,sessionId:i.data.id,session:i.data,sessionInstance:i}),i.addEventListener("data:loaded",()=>{i!=null&&i.data&&c&&c({applicationId:r,sessionId:i.data.id,session:i.data,sessionInstance:i})},!0)},[i]);const H=S=>{var O;return(O=m.current)==null?void 0:O.create(Et(re({},S),{knowledges:y}))};return L.useImperativeHandle(t,()=>({createSession:S=>H(S),getSessionList:()=>{var O;const S=((O=m.current)==null?void 0:O.list())||[];return Promise.resolve(S)},getCurrentInputText:()=>{var S;return(S=z.current)==null?void 0:S.getCurrentInputText()}})),N.jsx("div",{className:"dialog",children:N.jsxs("div",{className:"dialog-pannel",children:[N.jsx("div",{className:"dialog-sider",style:{display:l&&M==="inlay"?"block":"none"},children:N.jsx(_m,{ref:m,appId:r,networkStatus:w,currentSession:i,application:g,setCurrentSession:s,checkKnowledges:y,setCheckKnowledges:o?D:void 0,sessionId:n,afterSessionClick:S=>{var O,B;((O=S.data)==null?void 0:O.id)!==((B=i==null?void 0:i.data)==null?void 0:B.id)&&F(!0)}})}),N.jsx("div",{className:"dialog-content",children:N.jsxs("div",{className:"dialog-chat",children:[o&&N.jsx("div",{className:"dialog-chat-header",children:N.jsx(Ine,{setCheckKnowledges:D,application:g,currentSession:i})}),N.jsx("div",{className:"dialog-chat-content",children:(g==null?void 0:g.id)&&N.jsx(yne,{setNetworkStatus:j,networkStatus:w,application:g,currentSession:i,onCreateSession:H,docViewerUrl:a,embeddingService:I,setCurrentSession:s,ref:z})})]})})]})})}),Ane=L.forwardRef((e,t)=>{const{className:n,triggerButton:r,size:a,theme:i,icon:s,docViewerUrl:o,token:u,debug:l,env:c,plugins:d,mcp:M,footer:g,defaultInput:f,onComment:m,onSessionLoad:I,onSessionUnload:A,onMessage:y,beforeMessageSend:D,bodyStyle:z,apiUrl:w,sessionId:j,disabled:F,transform:H,features:S,stream:O,agentClient:B,application:Y}=e,W=L.useRef(null),[ne,se]=L.useState(!1),[te,Re]=L.useState(),[he,Ae]=L.useState(a),[_,je]=L.useState(e.open),we=L.useRef(null);L.useEffect(()=>{Y&&(console.log("[AgentClientUI] token",B,Y),Re(Y.id))},[Y]),R.ConfigProvider.config({theme:i}),L.useEffect(()=>{a&&Ae(a)},[a]);const E=(X,{element:ge,size:Le})=>{Ae({width:Number(Le.width),height:Le.height})};return L.useImperativeHandle(t,()=>({createSession:X=>{var ge;return(ge=we.current)==null?void 0:ge.createSession(X)},getSessionList:()=>{var X;return(X=we.current)==null?void 0:X.getSessionList()},getCurrentInputText:()=>{var X;return(X=we.current)==null?void 0:X.getCurrentInputText()}})),N.jsx(R.ConfigProvider,{locale:v2,children:N.jsxs(Y2,{value:Et(re({},e),{popupContainer:W,agentClient:B,footer:g,defaultInput:f,onComment:m,onSessionLoad:I,onSessionUnload:A,onMessage:y,beforeMessageSend:D,bodyStyle:z,disabled:F,transform:H,features:S}),children:[N.jsx(cO.Resizable,{height:(he==null?void 0:he.height)||"100%",width:(he==null?void 0:he.width)||"100%",maxConstraints:[document.body.clientWidth-45],minConstraints:[Number(a==null?void 0:a.minWidth)],onResize:E,handle:N.jsx("span",{className:"resize-handle-ew"}),resizeHandles:n=="float"?["w"]:[],children:N.jsxs("div",{id:"dialog-modal",className:`gbot-dialog-modal ${n} ${_?"opened":"closed"}`,style:Et(re({},a),{width:n=="float"?he==null?void 0:he.width:a==null?void 0:a.width,height:n==="float"?he==null?void 0:he.height:a==null?void 0:a.height,maxHeight:"100vh"}),ref:W,children:[ne?N.jsx("div",{className:"loading",children:N.jsx(R.Spin,{})}):te&&B?N.jsx(lne,{children:N.jsx(Dne,{ref:we,appId:te,docViewerUrl:o,bodyStyle:z,sessionId:j})}):null,(r==null?void 0:r.visible)&&N.jsx(R.Button,{className:"trigger-btn close-btn",icon:N.jsx("img",{src:s}),onClick:()=>je(!1)})]})}),(r==null?void 0:r.visible)&&!_&&N.jsx(R.Button,{className:`${n}-trigger-btn open-btn`,style:r.style,icon:N.jsx("img",{src:s}),onClick:()=>je(!0)})]})})}),bne="@glodon-aiot/agent-cli-ui",Ene="3.11.0",jne="./dist/es/index.mjs",zne="./dist/lib/index.js",Lne="./dist/src/index.d.ts",wne={import:"./dist/es/index.mjs",require:"./dist/lib/index.js",types:"./dist/src/index.d.ts"},Cne=["dist"],xne="module",Sne="dist/src/index.d.ts",One={dev:"vite",start:"vite",build:"tsc && node --max-old-space-size=4096 ./node_modules/vite/bin/vite.js build --mode prod && yarn build:cdn","build:pre":"tsc && node --max-old-space-size=4096 ./node_modules/vite/bin/vite.js build --mode prod","build:cdn":"tsc && vite build --mode prod --config ./vite.config.cdn.ts",preview:"vite preview",check:"yarn prettier --check .",write:"yarn prettier --write .",lint:"eslint --ext .tsx,.ts --fix ./example -c .eslintrc.js",storybook:"start-storybook -p 6006 -s public","build-storybook":"build-storybook -s public",docs:"start-storybook -p 6006",commit:"cz"},vne={antd:">=4.0.0",react:">=16.9.0","react-dom":">=16.9.0",webpack:"*"},kne={"@ant-design/icons":"^5.3.4","@glodon-aiot/apis":"^3.11.0","@glodon-aiot/bot-client-sdk":"^3.11.0","@matejmazur/react-mathjax":"^0.1.10","@react-pdf-viewer/core":"^3.12.0","@react-pdf-viewer/default-layout":"^3.12.0","@react-pdf-viewer/locales":"^1.0.0","@react-pdf-viewer/toolbar":"^3.12.0",ahooks:"^3.8.5",axios:"0.24.0",classnames:"^2.5.1","copy-to-clipboard":"^3.3.3",dayjs:"^1.11.13",lodash:"^4.17.21","quill-delta":"^5.1.0","react-infinite-scroll-component":"^6.1.0","react-quill-new":"^3.6.0","react-resizable":"^3.0.5",uuid:"^11.1.0"},_ne={"@babel/core":"^7.20.12","@commitlint/cli":"^17.0.3","@commitlint/config-conventional":"^17.0.3","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^28.0.0","@rollup/plugin-typescript":"^11.1.6","@storybook/addon-actions":"6.3.6","@storybook/addon-essentials":"6.4.9","@storybook/addon-interactions":"^6.5.16","@storybook/addon-links":"6.3.5","@storybook/addon-postcss":"2.0.0","@storybook/builder-vite":"^0.4.0","@storybook/node-logger":"6.4.9","@storybook/react":"6.4.9","@storybook/testing-library":"^0.0.13","@types/lodash":"^4","@types/react":"^16.9.0 || ^17.0.0 || ^18.0.0","@types/react-dom":"^16.9.0 || ^17.0.0 || ^18.0.0","@typescript-eslint/eslint-plugin":"^5.35.1","@typescript-eslint/parser":"^5.35.1","@vitejs/plugin-react":"^3.1.0",antd:"^4.24.0","babel-loader":"^8.3.0","babel-plugin-import":"^1.13.8",commitizen:"^4.3.0","css-loader":"^6.7.3","cz-conventional-changelog":"^3.3.0","cz-customizable":"^7.0.0",eslint:"^8.0.1","eslint-config-prettier":"^8.5.0","eslint-config-standard-with-typescript":"^22.0.0","eslint-plugin-import":"^2.25.2","eslint-plugin-n":"^15.0.0","eslint-plugin-promise":"^6.0.0","eslint-plugin-react":"^7.31.0","eslint-plugin-storybook":"^0.6.10",husky:">=6",less:"^4.1.2","less-loader":"^11.1.0","lint-staged":">=10","postcss-loader":"^7.2.4",prettier:"2.7.1",react:"^17.0.2","react-dom":"^17.0.2","require-from-string":"^2.0.2","rollup-plugin-visualizer":"^6.0.1","storybook-less-loader":"^0.1.0",typescript:"*",vite:"^4.1.1","vite-plugin-css-injected-by-js":"^3.5.0","vite-plugin-dts":"^4.3.0","vite-plugin-externalize-deps":"^0.9.0"},Rne=[">0.2%","not dead","not op_mini all"],Yne=["last 1 chrome version","last 1 firefox version","last 1 safari version"],Une={commitizen:{path:"node_modules/cz-customizable"},"cz-customizable":{config:".cz-config.cjs"}},Pne={access:"public",registry:"https://registry.npmjs.org/"},Qne={hooks:{"commit-msg":"validate-commit-msg"}},Bne={name:bne,version:Ene,module:jne,main:zne,typings:Lne,exports:wne,files:Cne,type:xne,types:Sne,scripts:One,peerDependencies:vne,dependencies:kne,devDependencies:_ne,"lint-staged":{"*.{js,css,md,jsx,less,ts,tsx,json}":"prettier --write"},production:Rne,development:Yne,config:Une,publishConfig:Pne,husky:Qne};var Xx=(e=>(e.dev="https://aiot-dev.glodon.com/api/cvforcepd",e.test="https://aiot-dev.glodon.com/api/cvforce",e.prod="https://copilot.glodon.com/api/cvforce",e.local="http://localhost:3000/api/cvforcepd",e))(Xx||{});//! moment.js
319
+ ${a}`)}return a},yne=L.forwardRef((e,t)=>{var hT,NT,mT,TT,yT,IT,DT,AT,bT,ET,jT,zT,LT,wT;const{application:n,docViewerUrl:r="",currentSession:a,onCreateSession:i,embeddingService:s,setCurrentSession:o,networkStatus:u,setNetworkStatus:l}=e,[c,d]=L.useState([]),[M,g]=L.useState(),[f,m]=L.useState(),I=L.useRef(null),{service:A,agentClient:y,depId:D,footer:z,transform:w,defaultInput:j,onMessage:F,onHistoryLoad:H,beforeMessageSend:S,bodyStyle:O,disabled:B,features:Y,popupContainer:W,icon:ne,sider:se,mode:te}=L.useContext(an),[Re,he]=L.useState(!1),Ae=L.useRef(c),_=L.useRef(void 0),[je,we]=L.useState(0),[E,X]=L.useState(),[ge,Le]=L.useState(""),[K,ee]=L.useState(!1),ce=L.useRef(null),[ue,Ne]=L.useState([]),[Ce,Ue]=L.useState(!1),[Fe,Be]=L.useState(!1),[mt,bt]=L.useState(""),[pn,$t]=L.useState(),[yr,vr]=L.useState({}),ra=L.useRef(null),hn=L.useRef(null),rr=L.useRef(null),[aa,Z]=L.useState(!1),[ie,be]=L.useState([]),[Pe,nt]=L.useState(!0),[Pt,lt]=L.useState(!0),[We,wt]=L.useState(!1),[Gn,_t]=L.useState(!1),[ia,Ir]=L.useState(!1),[Dr,zs]=L.useState(typeof(Y==null?void 0:Y.promptVariables)=="object"?Y.promptVariables.default||[]:[]),[FS,GS]=L.useState(()=>{const $=typeof(Y==null?void 0:Y.knowledges)=="object"&&Y.knowledges.default||void 0;if($){if(Array.isArray($)&&$.some(Qe=>Array.isArray(Qe.fileIds)&&Qe.fileIds.length===0))throw Error("fileIds cannot be an empty array");if(El($)>Ua)throw Error(`knowledges and fileIds total count cannot exceed ${Ua}`)}return $}),[iT,sa]=L.useState(!1),[sT,Ls]=L.useState(!1),[HS,wi]=L.useState(typeof(Y==null?void 0:Y.connectNetwork)=="object"&&typeof(Y==null?void 0:Y.connectNetwork.default)=="boolean"?Y.connectNetwork.default:!1),[oT,iu]=L.useState(!1),[WS,Ca]=L.useState(!1),[qS,$S]=L.useState(null),[su,ai]=L.useState(!1),[uT,lT]=L.useState(!1),{isSwitchingToExistingSession:cT,setIsSwitchingToExistingSession:ou}=km();L.useEffect(()=>{if($S(a),a===null)Ca(!1);else if(a===void 0)Ca(!0);else{if(qS===null){if(cT){Ca(!0),ou(!1);return}Ca(!1);return}a.ready?Ca(!1):Ca(!0)}},[a,a==null?void 0:a.ready,cT]),L.useEffect(()=>{var ke,Qe;a&&(Ae.current=[]),d([]);const $=I.current;if($&&$.scrollTo({top:0}),!((ke=a==null?void 0:a.data)!=null&&ke.id))return;if(_t(!1),wt(!1),(Qe=a.messages)!=null&&Qe.length){const Ke=[...a.messages.filter(Oe=>Oe==null?void 0:Oe.messageId)].reverse();Ae.current=[...Ke],d([...Ke]),Ca(!1)}const ae=pe=>{var Ke;(Ke=a==null?void 0:a.data)!=null&&Ke.id&&(Ae.current=[...pe].reverse(),d([...pe].reverse()),!pe||pe.length<10?Ls(!1):Ls(!0),Ca(!1),H&&H({applicationId:n.id,sessionId:a.data.id,histories:pe}))};return a.addEventListener("history:loaded",ae),()=>{Ae.current=[],d([]),a==null||a.removeEventListener("history:loaded",ae)}},[a]),L.useEffect(()=>{const $=()=>{var ae;(ae=a==null?void 0:a.data)!=null&&ae.id&&(a.promptVariables&&zs(a.promptVariables.sort((ke,Qe)=>ke.key.localeCompare(Qe.key))),a.knowledges&&GS(a.knowledges),l(a.netOpen))};return a==null||a.addEventListener("data:updated",$),()=>{a==null||a.removeEventListener("data:updated",$)}},[a]),L.useEffect(()=>{var ae;if(!((ae=a==null?void 0:a.data)!=null&&ae.id))return;const $=ke=>{var Qe;console.error(ke.message,ke.cause,"e.case"),R.notification.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-notification"}),R.notification.error({message:((Qe=ke.cause)==null?void 0:Qe.message)||ke.message}),R.notification.config({getContainer:void 0,prefixCls:"gbot-notification"})};return a.addEventListener("error",$),()=>{a==null||a.removeEventListener("error",$)}},[a]);const VS=()=>{var ke;if(!((ke=a==null?void 0:a.data)!=null&&ke.id)||!(n!=null&&n.id))return;const $=a.data.id,ae=c[c.length-1];if(ae&&ae.isContext){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.success("已开启新话题"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}else a.clear().then(()=>{const Qe=new Fs("",$,Ge.IHistoryRole.System);Qe.isContext=!0,d([Qe,...c])})};L.useEffect(()=>{n!=null&&n.id&&(A==null||A.getRecommendQues(n.id).then($=>{Ne($)}))},[D,n]);const dT=$=>et(exports,null,function*(){var xa,Sa;if(B){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("发送功能被禁用"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}const ae=$||M;if(!(ae!=null&&ae.trim())){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("请输入你想问的"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}if(!(Dr==null?void 0:Dr.every(on=>!!(on!=null&&on.value))))if(w!=null&&w.promptVariables){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("变量值不能为空"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}else console.error("变量值不能为空",Dr==null?void 0:Dr.map(on=>!!(on!=null&&on.value)));if(Gn){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("正在回复中"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}if(Re){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("等待初始化"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}if(!Pe){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("正在解析文件"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}if(K){R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("正在上传图片"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"});return}X(void 0),Le("");const Qe=(xa=a==null?void 0:a.data)==null?void 0:xa.id;if(!Qe){if(su)return;ai(!0),i==null||i({netOpen:u?_r.OPEN:_r.CLOSE}).then(on=>{var br,ws;sa(!0),l(!!((br=on.data)!=null&&br.netOpen)),wi(!!((ws=on.data)!=null&&ws.enableNetOpen)),uu(on).then(()=>{o==null||o(on),sa(!1),m(ae)})}).catch(on=>{ai(!1)});return}if(su)return;ai(!0),iu(!0);const pe=zf(ae,ge,yr[Qe],(n==null?void 0:n.type)||0);let Ke;try{S?Ke=yield S==null?void 0:S({applicationId:n.id,sessionId:Qe,message:{content:pe,sessionId:Qe,role:Ge.ChatMessageRole.User,files:yr[Qe]}}):Ke=!0}catch(on){Ke=!1}if(iu(!1),Ke===!1){ai(!1);return}let Oe=ae;typeof Ke=="object"&&(Oe=Ke.content||ae);const Nn=yield(()=>new Promise(on=>{zs(br=>(on(br),br))}))();if(!(yield a.setPromptVariables(Nn))){ai(!1);return}((Sa=yr[Qe])==null?void 0:Sa.length)>0?ZS(Oe):Ac(Oe)}),uu=$=>new Promise((ae,ke)=>et(exports,null,function*(){const Ke=($==null?void 0:$.promptVariables).filter(Oe=>Oe.type?!((Oe.type===Ge.PromptVariableType.User||Oe.type===void 0)&&Oe.key==="query")&&!((Oe.type===Ge.PromptVariableType.System||Oe.type===void 0)&&Oe.key==="datetime"):Oe.key!=="query").map(Oe=>{var Nn;const Qt=(Nn=Dr.find(Ar=>Ar.key===Oe.key&&Ar.type===Oe.type))==null?void 0:Nn.value;return Oe.value=Qt||"",Oe});zs(Ke.sort((Oe,Qt)=>Oe.key.localeCompare(Qt.key))),yield $==null?void 0:$.setPromptVariables(Ke).catch(Oe=>{console.error(Oe),R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error(Oe.message),R.message.config({getContainer:void 0,prefixCls:"gbot-message"})}),ae()})),ZS=$=>{var pe,Ke,Oe;if(nt(!1),!((pe=a==null?void 0:a.data)!=null&&pe.id)||!(n!=null&&n.id))return;const ae=((Ke=a.data)==null?void 0:Ke.id)||"";let ke=[],Qe=new Set;(Oe=yr[ae])==null||Oe.forEach(Qt=>{Qe.has(Qt.id)||(ke.push(Qt),Qe.add(Qt.id))}),nt(!0),Ac($,ke)};L.useEffect(()=>{if(!f||!a)return;const $=f,ae=()=>et(exports,null,function*(){iu(!0);const ke=zf($,ge,yr[a.id],(n==null?void 0:n.type)||0);let Qe;try{S?Qe=yield S==null?void 0:S({applicationId:n.id,sessionId:a.id,message:{content:ke,sessionId:a.id,role:Ge.ChatMessageRole.User,files:yr[a.id]}}):Qe=!0}catch(pe){Qe=!1}if(iu(!1),Qe===!1){ai(!1);return}Ac($),m(void 0)});return a.ready?ae():a.addEventListener("ready",ae,!0),()=>{a==null||a.removeEventListener("ready",ae)}},[f,a]);const Ac=($,ae)=>et(exports,null,function*(){var xa,Sa,on;const ke=(xa=a==null?void 0:a.data)==null?void 0:xa.id;if(!ke)return;_t(!0),wt(!0);const Qe=zf($,ge,ae,(n==null?void 0:n.type)||0);let pe;n.type===Ge.ApplicationTypes.Agent?pe=void 0:n.type===Ge.ApplicationTypes.Dialog&&((Sa=n.arrange)!=null&&Sa.length)&&n.arrange[0].visionOpen?pe=ge?[ge]:void 0:pe=void 0;const Ke=new Fs(Qe,ke,Ge.IHistoryRole.User,ae,pe);g(void 0),$t(void 0),Ae.current=[Ke,...c],d(Ae.current),n.id&&F&&F({applicationId:n.id,sessionId:ke,message:Ke});const Oe=new Fs("",ke,Ge.IHistoryRole.System);Oe.isWaiting=!0,Ae.current=[Oe,...Ae.current],d(Ae.current);const Qt=(ae==null?void 0:ae.map(br=>br.id))||[],Nn={stream:Ws.configuration.stream,referenceFirst:!1};if(w!=null&&w.promptVariables){const br=Dr==null?void 0:Dr.reduce((ws,CT)=>(ws[CT.key]=CT.value,ws),{});Nn.formatValues=br}if(w!=null&&w.knowledges){const br=FS;Nn.knowledges=br}const Ar={text:Qe,fileIds:Qt,files:ae};pe&&pe.length>0&&(Ar.imageContent=pe),yield a.send(Ar,Nn),vr({[ke]:[]}),(on=ra.current)==null||on.update(),ai(!1)});L.useEffect(()=>{var Qe;const $=(Qe=a==null?void 0:a.data)==null?void 0:Qe.id;if(!$)return;const ae=pe=>{if(!pe.sessionId||pe.sessionId&&pe.sessionId!==_.current||pe.role===Ge.IHistoryRole.User)return;if(pe.index===-1&&pe.code!==200&&pe.code!==11915&&(wt(!1),_t(!1),Ae.current=Ae.current.filter(Qt=>!Qt.isWaiting),d([...Ae.current]),Ae.current=[...Ae.current],pe.content)){R.notification.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-notification"}),R.notification.error({message:pe.content}),R.notification.config({getContainer:void 0,prefixCls:"gbot-notification"});return}const Ke=pe.actions||[],Oe=new Fs(pe.content,$,Ge.IHistoryRole.Robot);Oe.messageId=pe.messageId||fo.v4(),Oe.reasoningContent=pe.reasoningContent,Oe.searchReference=pe.searchReference,Oe.thinkingSecs=pe.thinkingSecs,Oe.thinkingStatus=pe.thinkingStatus,Oe.actions=Ke,Oe.isLoading=!0,Oe.searchingStatus=pe.searchingStatus,Ae.current=Ae.current.filter(Qt=>!Qt.isWaiting).filter(Qt=>!Qt.isReplying),pe.index===void 0&&d([Oe,...Ae.current]),pe.code===11915&&(wt(!1),_t(!1),Oe.isLoading=!1,Oe.content="请您换个问题问我吧~",Oe.isSensitive=!0,d([Oe,...Ae.current])),pe.index===-2&&(wt(!1),_t(!1),Oe.isLoading=!1,Oe.content="回答已中止~",Oe.isSuspend=!0,d([Oe,...Ae.current])),pe.index===-1&&(wt(!1),_t(!1),Oe.isLoading=!1,Oe.reference=pe.reference,d([Oe,...Ae.current]),n.id&&F&&F({applicationId:n.id,sessionId:$,message:Oe})),pe.index===-3&&(wt(!1),_t(!1),Oe.isLoading=!1,Oe.reference=pe.reference,Oe.relatedQuesion=pe.relatedQuesion,d([Oe,...Ae.current]))},ke=()=>{a.addEventListener("message:updated",ae)};return a.ready?a.addEventListener("message:updated",ae):a.addEventListener("ready",ke),()=>{a==null||a.removeEventListener("message:updated",ae),a==null||a.removeEventListener("ready",ke)}},[a]),L.useEffect(()=>{if(!a){he(!1);return}const $=ae=>{he(ae)};return he(a.frozen),a.addEventListener("frozen",$),()=>{a==null||a.removeEventListener("frozen",$)}},[a]),L.useEffect(()=>{if(!y)return;const $=y.questionContextMaxLength||4e3;we($)},[y,A]),L.useEffect(()=>{j&&$t(j.text)},[j]);const XS=$=>{const ae=$.size;return ae<=0?(R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("该文件为空,请重新上传"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"}),!1):ae>20*Zu?(R.message.config({getContainer:()=>(W==null?void 0:W.current)||document.body,prefixCls:"gbot-message"}),R.message.error("图片须小于20M"),R.message.config({getContainer:void 0,prefixCls:"gbot-message"}),!1):(X($),!1)},JS=$=>et(exports,null,function*(){var ae;return X($),(ae=a==null?void 0:a.data)!=null&&ae.id?MT(a,$):new Promise(ke=>{sa(!0),i==null||i({netOpen:u?_r.OPEN:_r.CLOSE}).then(Qe=>{var pe,Ke;o==null||o(Qe),sa(!1),l(!!((pe=Qe.data)!=null&&pe.netOpen)),wi(!!((Ke=Qe.data)!=null&&Ke.enableNetOpen)),uu(Qe),ke(MT(Qe,$))})})}),MT=($,ae)=>{const ke=_te(ae.name);return new Promise(Qe=>{var Ke;const pe={files:[`${fo.v4()}.${ke}`],isv:"minio",knowledgeId:((Ke=$.data)==null?void 0:Ke.id)||"",type:1};ee(!0),A==null||A.postTicket(pe).then(Oe=>{A.uploadMinioFile(Oe.minio,ae).then(()=>{var xa,Sa;const Qt=(xa=Oe.minio.endpoints)==null?void 0:xa[0],Nn=Oe.minio.bucket,Ar=(Sa=Oe.minio.fileKeys)==null?void 0:Sa[0];Qe(`${location.protocol}//${Qt}/${Nn}/${Ar}`)}).catch(()=>{Le(""),X(void 0)}).finally(()=>{ee(!1)})}).catch(()=>{Le(""),X(void 0),ee(!1)})})};L.useEffect(()=>{const $=I.current;$&&!ia&&$.scrollTo({top:$.scrollHeight})},[c]);const gT=($,ae)=>new Promise(ke=>{if(!ae.file.url||!(n!=null&&n.id))return ke();const Qe=Et(re({},ae.file),{type:1});A==null||A.postApplicationIdSessionKnowledgeSessionFile(n==null?void 0:n.id,$,Qe).finally(()=>{var pe;(pe=ra.current)==null||pe.update().finally(ke)})}),KS=()=>{var $;($=a==null?void 0:a.data)!=null&&$.id&&(wt(!1),a.suspend())},eO=$=>{const ae=I.current;ae&&setTimeout(()=>{ae.scrollTo({top:ae.scrollHeight,behavior:$==null?void 0:$.behavior})},$==null?void 0:$.ms)},tO=()=>{if(!I.current)return;const $=I.current.scrollTop<=-80;Ir($)},nO=Hr.useMemoizedFn($=>{var ae,ke;(ae=ce.current)==null||ae.update($),(ke=ce.current)==null||ke.focus()}),rO=Hr.useMemoizedFn($=>{dT($)}),aO=Hr.useMemoizedFn(()=>{var ae;if(!((ae=a==null?void 0:a.data)!=null&&ae.id))return;Ae.current=[...c.slice(1,c.length)],d(Ae.current);const $=new Fs("",a.data.id,Ge.IHistoryRole.System);$.isWaiting=!0,Ae.current=[$,...Ae.current],d(Ae.current),_t(!0),wt(!0),a.answerAgain()});L.useEffect(()=>{var $,ae;_.current=($=a==null?void 0:a.data)==null?void 0:$.id,!iT&&((ae=rr.current)==null||ae.clear())},[a]);const iO=()=>{var ke;if(!((ke=a==null?void 0:a.data)!=null&&ke.id))return;const ae=c[c.length-1].messageTime;a.fetchMessages({endTime:ae,pageSize:D2}).then(Qe=>{const pe=Qe||[];if(!pe||!(pe!=null&&pe.length)){Ls(!1);return}pe.length<10?Ls(!1):Ls(!0),d([...c,...pe.reverse()])})},sO=$=>et(exports,null,function*(){var ae,ke;if(!((ae=a==null?void 0:a.data)!=null&&ae.id))l($);else{if(yield a.setNetOpen($),!((ke=a.data)!=null&&ke.id))return;l($)}}),bc=()=>et(exports,null,function*(){a?a.fetchData().then($=>{var ae;(ae=a==null?void 0:a.data)!=null&&ae.id&&(l($.netOpen),wi($.enableNetOpen))}):(l(typeof(Y==null?void 0:Y.connectNetwork)=="object"&&typeof(Y==null?void 0:Y.connectNetwork.default)=="boolean"?Y.connectNetwork.default:!1),wi(n.arrange[0].enableNetOpen))});L.useEffect(()=>{bc()},[a]),L.useEffect(()=>{requestAnimationFrame(()=>{var ae,ke;if(I.current){const Qe=document.getElementById("chat-main"),pe=(ae=I.current)==null?void 0:ae.querySelector(".infinite-scroll-component__outerdiv"),Ke=(ke=I.current)==null?void 0:ke.querySelector(".infinite-scroll-component");if(!pe||!Ke||!Qe)return;const Oe=Qe.offsetHeight;if(Ke.offsetHeight<=Oe){if(pe.style.height==="100%")return;pe.style.height="100%"}else{if(pe.style.height==="auto")return;pe.style.height="auto"}}})},[c]),L.useEffect(()=>{if(a)return;const $=()=>{const Qe=((y==null?void 0:y.promptVariables)||[]).filter(pe=>pe.type?!(pe.type===Ge.PromptVariableType.User&&pe.key==="query")&&!(pe.type===Ge.PromptVariableType.System&&pe.key==="datetime")&&pe.status===1:pe.key!=="query"&&pe.status===1).map((pe,Ke)=>{var Qt,Nn;let Oe="";return typeof(Y==null?void 0:Y.promptVariables)=="object"&&(Oe=((Nn=(Qt=Y.promptVariables.default)==null?void 0:Qt.find(Ar=>Ar.key===pe.key&&Ar.type===pe.type))==null?void 0:Nn.value)||""),{id:Ke+"",key:pe.key,name:pe.name,value:Oe,type:pe.type}});zs([...Qe].sort((pe,Ke)=>pe.key.localeCompare(Ke.key)))};return y!=null&&y.ready?$():y==null||y.addEventListener("ready",$),()=>{y==null||y.removeEventListener("ready",$)}},[a,y,Y==null?void 0:Y.promptVariables]);const pT=()=>i==null?void 0:i({netOpen:u?_r.OPEN:_r.CLOSE}).then($=>{var ae,ke;return o==null||o($),sa(!1),l(!!((ae=$.data)!=null&&ae.netOpen)),wi(!!((ke=$.data)!=null&&ke.enableNetOpen)),uu($),$}),fT=L.useMemo(()=>{var $;return n.arrange&&(($=n.arrange[0])!=null&&$.openingContent)?N.jsx(Fx,{application:n,history:{role:1,content:n.arrange[0].openingContent,code:200,messageId:"opening-message",sessionId:"",reference:[],searchReference:[],messageTime:fn(Date.now()).format("YYYY-MM-DD HH:mm:ss"),actions:[],isLoading:!1},actions:!!c.length,markdown:Y==null?void 0:Y.markdown}):null},[n==null?void 0:n.arrange,c]);return L.useImperativeHandle(t,()=>({getCurrentInputText:()=>{var $;return($=ce.current)==null?void 0:$.getCurrentText()}})),L.useEffect(()=>{var ae;const $=(ae=a==null?void 0:a.data)==null?void 0:ae.id;$&&vr(ke=>Et(re({},ke),{[$]:[]}))},[(hT=a==null?void 0:a.data)==null?void 0:hT.id]),N.jsxs("div",{className:"agent-chat",children:[WS?N.jsx("div",{className:"session-loading",children:N.jsx(R.Spin,{})}):N.jsxs(N.Fragment,{children:[(w==null?void 0:w.promptVariables)&&N.jsx(qx,{ref:hn,appId:n.id,currentSession:a,promptVariables:Dr,setPromptVariables:zs,setCurrentSession:o}),N.jsxs("div",{className:"chat-main",id:"chat-main",style:O,children:[N.jsx("div",{className:"chat-main-wrapper",id:"scrollableDiv",style:{height:"100%",overflowY:"auto",display:"flex",flexDirection:"column-reverse"},ref:I,onScroll:tO,children:(NT=a==null?void 0:a.data)!=null&&NT.id&&(c!=null&&c.length)?N.jsxs(gO,{dataLength:c.length,next:iO,style:{display:"flex",flexDirection:"column-reverse",overflowX:"hidden"},inverse:!0,endMessage:c.length>D2&&((mT=I.current)!=null&&mT.scrollTop)&&((TT=I.current)==null?void 0:TT.scrollTop)<-10?N.jsx(R.Divider,{plain:!0,children:"没有更多数据了"}):null,hasMore:sT,loader:N.jsx("div",{style:{height:"50px",textAlign:"center",overflow:"hidden"},children:N.jsx(R.Spin,{})}),scrollableTarget:"scrollableDiv",children:[c.map(($,ae)=>N.jsx(Tne,{application:n,currentSession:a,history:$,docViewerUrl:r,isLastHistory:ae===0,onRelatedClick:rO,onAgainClick:aO,onEditClick:nO,markdown:Y==null?void 0:Y.markdown},$.messageId+ae)),!sT&&fT]}):N.jsxs("div",{className:"main-empty",children:[(Y==null?void 0:Y.greeting)!==!1&&N.jsx(Kte,{text:Y!=null&&Y.greeting&&typeof Y.greeting=="object"&&Y.greeting.text!==void 0?Y.greeting.text:(yT=n.arrange)!=null&&yT.length&&((IT=n.arrange[0])!=null&&IT.greetings)?n.arrange[0].greetings:I2.text,icon:Y===void 0||Y.greeting===!0||((DT=Y.greeting)==null?void 0:DT.icon)===void 0?ne||I2.icon:Y.greeting.icon,children:!!ue.length&&(((Y==null?void 0:Y.greeting)===void 0||(Y==null?void 0:Y.greeting))===!0||typeof(Y==null?void 0:Y.greeting)=="object"&&Y.greeting.questions!==!1)&&N.jsx(Hx,{ref:rr,sid:(AT=a==null?void 0:a.data)==null?void 0:AT.id,isRecommendClearing:Ce,data:ue,layoutBreakpoints:typeof(Y==null?void 0:Y.greeting)=="object"?Y.greeting.layoutBreakpoints:void 0,onItemClick:$=>{var ke,Qe,pe;if(g($==null?void 0:$.question),$t($==null?void 0:$.question),Ce)return;$!=null&&$.id&&Ue(!0);const ae=(ke=a==null?void 0:a.data)==null?void 0:ke.id;w!=null&&w.fileUpload?(pe=(Qe=ra.current)==null?void 0:Qe.clear())==null||pe.then(()=>{var Ke,Oe;$!=null&&$.id&&(ae?(Ke=gT(ae,$))==null||Ke.finally(()=>{Ue(!1)}):(Ue(!1),sa(!0),(Oe=pT())==null||Oe.then(Qt=>{var Nn;(Nn=gT(Qt.id,$))==null||Nn.finally(()=>{Ue(!1)})})))}):ae?Ue(!1):(Ue(!1),sa(!0),pT())}})}),fT]})}),We&&N.jsx("div",{className:"session-stop",children:N.jsx(R.Button,{type:"primary",style:{background:"white"},ghost:!0,size:"small",icon:N.jsx(ct,{type:"icon-zantinghuida",style:{fontSize:16}}),onClick:()=>KS(),children:"停止回答"})}),ia&&(c==null?void 0:c.length)>0&&N.jsx("div",{className:"back-bottom",children:N.jsx(R.Button,{size:"small",onClick:()=>eO({behavior:"smooth"}),type:"link",icon:N.jsx(ct,{type:"icon-yijianhuidaodibu",style:{fontSize:24}})})})]}),N.jsx("div",{className:"chat-footer",children:N.jsxs("div",{className:"chat-footer-input",children:[E&&N.jsx("div",{className:"input-files",children:N.jsx(Zte,{file:E,actions:{upload:JS,remove:()=>{Le(""),X(void 0)}},onUrlChange:$=>Le($)})}),N.jsxs(R.Space,{className:"footer-upload-action",onClick:$=>$.preventDefault(),children:[N.jsxs(R.Space,{children:[(n.type===Ge.ApplicationTypes.Agent&&(w==null?void 0:w.imageUpload)||n.type===Ge.ApplicationTypes.Dialog&&((bT=n.arrange)==null?void 0:bT.length)&&!!n.arrange[0].visionOpen&&(w==null?void 0:w.imageUpload))&&N.jsx(R.Upload,{disabled:!!E||B,accept:".jpg, .png, .jpeg,.bmp",listType:"picture-card",beforeUpload:XS,className:"footer-upload-picture",showUploadList:!1,children:E?N.jsx(R.Button,{type:"text",className:"camera-out-btn",style:{width:"22px",position:"relative",bottom:"-2px"},disabled:!!E||B,icon:N.jsx(At.CameraOutlined,{className:"icon-tianjia",style:{fontSize:"22px"}})}):N.jsx(R.Tooltip,{placement:"topLeft",overlayClassName:"footer-upload-tooltip",title:N.jsx("div",{children:"支持上传.jpg .png .jpeg .bmp格式的图片数据,最大20M,单次仅可上传1个"}),children:N.jsx(R.Button,{type:"text",className:"camera-out-btn",style:{width:"22px",position:"relative",bottom:"-2px"},icon:N.jsx(ct,{type:"icon-Vector",className:"icon-tianjia",style:{fontSize:"22px"}})})})}),s&&(w!=null&&w.fileUpload)&&(n!=null&&n.id)?N.jsx(Wx,{appId:n==null?void 0:n.id,ref:ra,isFirstSession:iT,docViewerUrl:r,onStatusChange:$=>et(exports,null,function*(){$!=="process"?(nt(!0),bc()):nt(!1)}),createSession:()=>new Promise($=>{sa(!0),i==null||i({netOpen:u?_r.OPEN:_r.CLOSE}).then(ae=>{var Qe,pe,Ke;o==null||o(ae),sa(!1),l(!!((Qe=ae.data)!=null&&Qe.netOpen)),wi(!!((pe=ae.data)!=null&&pe.enableNetOpen)),uu(ae);const ke=((Ke=ae.data)==null?void 0:Ke.id)||"";$(ke)})}),sid:(ET=a==null?void 0:a.data)==null?void 0:ET.id,disabled:Gn||B,afterFileAdd:($,ae)=>{ae&&vr(ke=>{const Qe=ke[ae]||[];return{[ae]:[...Qe,$]}})},afterFileDelete:$=>{var ke;const ae=(ke=a==null?void 0:a.data)==null?void 0:ke.id;ae&&vr(Qe=>{const pe=Qe[ae]||[];return{[ae]:pe.filter(Ke=>Ke.id!==$)}})},onFileListChange:$=>{be($)},shouldContinue:Pt,afterFilesClear:()=>{var ae;const $=(ae=a==null?void 0:a.data)==null?void 0:ae.id;$&&(vr({[$]:[]}),bc())}}):null,(w==null?void 0:w.prompt)&&(n==null?void 0:n.id)&&N.jsx(mne,{appId:n.id,list:[],search:Fe?mt:"",onPromptSelect:$=>{$t($.context),g($.context)},disabled:B})]}),N.jsxs(R.Space,{children:[(w==null?void 0:w.connectNetwork)&&n.type===Ge.ApplicationTypes.Dialog&&((jT=n.arrange)==null?void 0:jT.length)&&!!n.arrange[0].enableNetOpen&&N.jsx(Mne,{sessionId:(zT=a==null?void 0:a.data)==null?void 0:zT.id,netStatus:u,enable:typeof(Y==null?void 0:Y.connectNetwork)=="object"&&typeof(Y==null?void 0:Y.connectNetwork.diabled)=="boolean"?!(Y!=null&&Y.connectNetwork.diabled):HS,disabledTip:a?void 0:"网络访问已被禁用",onNetStatusChange:$=>{sO($)}}),(w==null?void 0:w.sessionList)&&N.jsx(une,{currentSessionId:(LT=a==null?void 0:a.data)==null?void 0:LT.id,onSessionChange:($,ae)=>{$t(void 0),ou(!0),o==null||o(ae)},disabled:B}),se&&te==="float"&&N.jsx("div",{className:"session-history-drawer-component",children:N.jsx(R.Popover,{placement:"topRight",showArrow:!1,overlayClassName:"session-history-overlay",overlayStyle:{padding:"4px"},getPopupContainer:$=>$.parentNode,content:"会话历史记录",children:N.jsx(R.Button,{className:"history-overlay-action",disabled:B,type:"text",icon:N.jsx(ct,{type:"icon-lishijilu",style:{fontSize:24}}),onClick:()=>lT(!0)})})}),(w==null?void 0:w.sessionOpen)&&N.jsx(R.Button,{icon:N.jsx(At.PlusOutlined,{}),className:"add-btn",type:"primary",disabled:We||!a||!c.length||B,onClick:()=>{var $,ae;ou(!1),o==null||o(null),l(!1),($=hn.current)==null||$.clear(),(ae=rr.current)==null||ae.clear()},children:"新会话"})]})]}),N.jsx("div",{className:"footer-textarea",children:N.jsx(Gx,{ref:ce,maxLength:je,text:pn,networkStatus:!1,loading:oT||su,disabled:Re||K||B||oT||su,onTextSend:dT,onChange:($,ae)=>{$t($);const ke=ae.getText().replace(/[\n\s]+$/,"");g(ke),bt(ke),Fe||Be(!0)},clearAction:N.jsx(R.Space,{size:0,children:N.jsx(R.Button,{type:"link",disabled:Gn||B,ghost:!0,icon:N.jsx(ct,{style:{fontSize:22},type:"icon-qingchujiyi"}),onClick:()=>VS()})})})})]})}),N.jsx(tne,{tips:z}),aa&&N.jsx(ane,{isvisible:aa,files:ie,sessionId:(wT=a==null?void 0:a.data)==null?void 0:wT.id,onClose:$=>{Z(!1),lt(!1)}})]}),uT&&N.jsx(dne,{currentSession:a,application:n,networkStatus:u,setCurrentSession:o,disabled:B,isSessionHistoryVisible:uT,setIsSessionHistoryVisible:lT,onSessionChange:$=>{ou(!0)}})]})});const Zx=e=>{const{disabled:t,checkedValues:n,currKnowledgeList:r,selectCount:a,onSelectChange:i}=e,[s,o]=L.useState(!1),u=N.jsx(R.Checkbox.Group,{style:{width:"100%"},onChange:i,value:n,disabled:t,children:N.jsx(R.Row,{gutter:[20,12],children:r==null?void 0:r.map(c=>N.jsx(R.Col,{span:24,children:N.jsx(R.Checkbox,{value:c.id,children:c.name})},c.id))})}),l=c=>{o(c)};return N.jsx("div",{className:"knowledge-select",style:{borderColor:s?"#9C24F2":"#84868C"},children:N.jsx(R.Popover,{className:"select-popover",placement:"bottomRight",title:null,content:u,trigger:"click",overlayStyle:{width:280},onOpenChange:l,getPopupContainer:c=>c.parentNode,children:N.jsxs("div",{className:"",onClick:c=>c.preventDefault(),children:[N.jsx(ct,{className:"select-icon",type:"icon-open"}),N.jsx("span",{className:"title",children:"参考知识库"}),N.jsxs("span",{className:"content",children:["已选 ",a," 个"]})]})})})},Ine=e=>{var I,A;const{currentSession:t,application:n,setCheckKnowledges:r}=e,{mode:a,transform:i,features:s}=L.useContext(an),[o,u]=L.useState([]),[l,c]=L.useState(typeof(s==null?void 0:s.knowledges)=="object"?((I=s.knowledges.default)==null?void 0:I.map(y=>y.id))||[]:[]),[d,M]=L.useState(0),[g,f]=L.useState(!1);L.useEffect(()=>{if(!(n!=null&&n.id))return;const y=n.arrange;if(!(y!=null&&y.length))return;const z=y[0].knowledges||[];u(z);const w=typeof(s==null?void 0:s.knowledges)=="object"&&s.knowledges.default||z;if(Array.isArray(w)&&w.some(S=>Array.isArray(S.fileIds)&&S.fileIds.length===0))throw Error("fileIds cannot be an empty array");if(El(w||[])>Ua)throw Error(`knowledges and fileIds total count cannot exceed ${Ua}`);if(!t){c(w.map(H=>H.id)),M(w.length),r==null||r(w);return}const F=()=>{const H=t.knowledges||w;M(H.length);const S=H.map(O=>O.id);c(S)};return F(),t.addEventListener("data:updated",F),()=>{t==null||t.removeEventListener("data:updated",F)}},[n,t]),L.useEffect(()=>{var D;if(!g||(f(!1),!(n!=null&&n.id)))return;const y=[];l==null||l.map(z=>{const w=o==null?void 0:o.find(j=>j.id===z);y.push(w)}),(D=t==null?void 0:t.data)!=null&&D.id&&t.setKnowledges(y)},[g]);const m=y=>{f(!0),c(y);const D=[];y==null||y.map(z=>{const w=o==null?void 0:o.find(j=>j.id===z);D.push(w)}),r==null||r(D),M(y.length)};return N.jsxs("div",{className:"chat-header",children:[N.jsxs(R.Space,{className:"header-title",children:[a==="inlay"&&((A=t==null?void 0:t.data)==null?void 0:A.name),a==="float"&&(n==null?void 0:n.name)]}),(i==null?void 0:i.knowledges)&&o.length!==0&&N.jsx(Zx,{disabled:typeof(s==null?void 0:s.knowledges)=="object"&&(s==null?void 0:s.knowledges.diabled)||!1,checkedValues:l,currKnowledgeList:o,selectCount:d,onSelectChange:m})]})};const Dne=L.forwardRef((e,t)=>{const{sessionId:n,appId:r,docViewerUrl:a}=e,[i,s]=L.useState(),{showHeader:o,agentClient:u,sider:l,onSessionLoad:c,features:d,mode:M}=L.useContext(an),[g,f]=L.useState(),m=L.useRef(null),[I,A]=L.useState(""),[y,D]=L.useState(),z=L.useRef(null),[w,j]=L.useState(!1);L.useState([]);const{setIsSwitchingToExistingSession:F}=km();L.useEffect(()=>{var S;j(i?!!((S=i.data)!=null&&S.netOpen):typeof(d==null?void 0:d.connectNetwork)=="object"&&typeof(d==null?void 0:d.connectNetwork.default)=="boolean"?d.connectNetwork.default:!1)},[i]),L.useEffect(()=>{const S=()=>et(exports,null,function*(){const O=u==null?void 0:u.application;if(!(O!=null&&O.id))return;const B=O==null?void 0:O.arrange;if(!(B!=null&&B.length))return;const W=B[0].embeddingService;A(W),f(O)});if(u!=null&&u.ready){S();return}return u==null||u.addEventListener("ready",()=>S()),()=>{u==null||u.removeEventListener("ready",S)}},[u]),L.useEffect(()=>{u&&n&&(u.ready?u==null||u.getSessions().then(S=>et(exports,null,function*(){s==null||s(S.find(O=>O.id===n))})):u.addEventListener("ready",()=>et(exports,null,function*(){u==null||u.getSessions().then(S=>et(exports,null,function*(){s==null||s(S.find(O=>O.id===n))}))}),!0))},[u,n]),L.useEffect(()=>{if(!i){c&&c({applicationId:r,sessionId:"",session:null,sessionInstance:null});return}i.data&&c&&c({applicationId:r,sessionId:i.data.id,session:i.data,sessionInstance:i}),i.addEventListener("data:loaded",()=>{i!=null&&i.data&&c&&c({applicationId:r,sessionId:i.data.id,session:i.data,sessionInstance:i})},!0)},[i]);const H=S=>{var O;return(O=m.current)==null?void 0:O.create(Et(re({},S),{knowledges:y}))};return L.useImperativeHandle(t,()=>({createSession:S=>H(S),getSessionList:()=>{var O;const S=((O=m.current)==null?void 0:O.list())||[];return Promise.resolve(S)},getCurrentInputText:()=>{var S;return(S=z.current)==null?void 0:S.getCurrentInputText()}})),N.jsx("div",{className:"dialog",children:N.jsxs("div",{className:"dialog-pannel",children:[N.jsx("div",{className:"dialog-sider",style:{display:l&&M==="inlay"?"block":"none"},children:N.jsx(_m,{ref:m,appId:r,networkStatus:w,currentSession:i,application:g,setCurrentSession:s,checkKnowledges:y,setCheckKnowledges:o?D:void 0,sessionId:n,afterSessionClick:S=>{var O,B;((O=S.data)==null?void 0:O.id)!==((B=i==null?void 0:i.data)==null?void 0:B.id)&&F(!0)}})}),N.jsx("div",{className:"dialog-content",children:N.jsxs("div",{className:"dialog-chat",children:[o&&N.jsx("div",{className:"dialog-chat-header",children:N.jsx(Ine,{setCheckKnowledges:D,application:g,currentSession:i})}),N.jsx("div",{className:"dialog-chat-content",children:(g==null?void 0:g.id)&&N.jsx(yne,{setNetworkStatus:j,networkStatus:w,application:g,currentSession:i,onCreateSession:H,docViewerUrl:a,embeddingService:I,setCurrentSession:s,ref:z})})]})})]})})}),Ane=L.forwardRef((e,t)=>{const{className:n,triggerButton:r,size:a,theme:i,icon:s,docViewerUrl:o,token:u,debug:l,env:c,plugins:d,mcp:M,footer:g,defaultInput:f,onComment:m,onSessionLoad:I,onSessionUnload:A,onMessage:y,beforeMessageSend:D,bodyStyle:z,apiUrl:w,sessionId:j,disabled:F,transform:H,features:S,stream:O,agentClient:B,application:Y}=e,W=L.useRef(null),[ne,se]=L.useState(!1),[te,Re]=L.useState(),[he,Ae]=L.useState(a),[_,je]=L.useState(e.open),we=L.useRef(null);L.useEffect(()=>{Y&&(console.log("[AgentClientUI] token",B,Y),Re(Y.id))},[Y]),R.ConfigProvider.config({theme:i}),L.useEffect(()=>{a&&Ae(a)},[a]);const E=(X,{element:ge,size:Le})=>{Ae({width:Number(Le.width),height:Le.height})};return L.useImperativeHandle(t,()=>({createSession:X=>{var ge;return(ge=we.current)==null?void 0:ge.createSession(X)},getSessionList:()=>{var X;return(X=we.current)==null?void 0:X.getSessionList()},getCurrentInputText:()=>{var X;return(X=we.current)==null?void 0:X.getCurrentInputText()}})),N.jsx(R.ConfigProvider,{locale:v2,children:N.jsxs(Y2,{value:Et(re({},e),{popupContainer:W,agentClient:B,footer:g,defaultInput:f,onComment:m,onSessionLoad:I,onSessionUnload:A,onMessage:y,beforeMessageSend:D,bodyStyle:z,disabled:F,transform:H,features:S}),children:[N.jsx(cO.Resizable,{height:(he==null?void 0:he.height)||"100%",width:(he==null?void 0:he.width)||"100%",maxConstraints:[document.body.clientWidth-45],minConstraints:[Number(a==null?void 0:a.minWidth)],onResize:E,handle:N.jsx("span",{className:"resize-handle-ew"}),resizeHandles:n=="float"?["w"]:[],children:N.jsxs("div",{id:"dialog-modal",className:`gbot-dialog-modal ${n} ${_?"opened":"closed"}`,style:Et(re({},a),{width:n=="float"?he==null?void 0:he.width:a==null?void 0:a.width,height:n==="float"?he==null?void 0:he.height:a==null?void 0:a.height,maxHeight:"100vh"}),ref:W,children:[ne?N.jsx("div",{className:"loading",children:N.jsx(R.Spin,{})}):te&&B?N.jsx(lne,{children:N.jsx(Dne,{ref:we,appId:te,docViewerUrl:o,bodyStyle:z,sessionId:j})}):null,(r==null?void 0:r.visible)&&N.jsx(R.Button,{className:"trigger-btn close-btn",icon:N.jsx("img",{src:s}),onClick:()=>je(!1)})]})}),(r==null?void 0:r.visible)&&!_&&N.jsx(R.Button,{className:`${n}-trigger-btn open-btn`,style:r.style,icon:N.jsx("img",{src:s}),onClick:()=>je(!0)})]})})}),bne="@glodon-aiot/agent-cli-ui",Ene="3.11.1-shapshot.1765331453",jne="./dist/es/index.mjs",zne="./dist/lib/index.js",Lne="./dist/src/index.d.ts",wne={import:"./dist/es/index.mjs",require:"./dist/lib/index.js",types:"./dist/src/index.d.ts"},Cne=["dist"],xne="module",Sne="dist/src/index.d.ts",One={dev:"vite",start:"vite",build:"tsc && node --max-old-space-size=4096 ./node_modules/vite/bin/vite.js build --mode prod && yarn build:cdn","build:pre":"tsc && node --max-old-space-size=4096 ./node_modules/vite/bin/vite.js build --mode prod","build:cdn":"tsc && vite build --mode prod --config ./vite.config.cdn.ts",preview:"vite preview",check:"yarn prettier --check .",write:"yarn prettier --write .",lint:"eslint --ext .tsx,.ts --fix ./example -c .eslintrc.js",storybook:"start-storybook -p 6006 -s public","build-storybook":"build-storybook -s public",docs:"start-storybook -p 6006",commit:"cz"},vne={antd:">=4.0.0",react:">=16.9.0","react-dom":">=16.9.0",webpack:"*"},kne={"@ant-design/icons":"^5.3.4","@glodon-aiot/apis":"^3.11.1-shapshot.1765331453","@glodon-aiot/bot-client-sdk":"^3.11.1-shapshot.1765331453","@matejmazur/react-mathjax":"^0.1.10","@react-pdf-viewer/core":"^3.12.0","@react-pdf-viewer/default-layout":"^3.12.0","@react-pdf-viewer/locales":"^1.0.0","@react-pdf-viewer/toolbar":"^3.12.0",ahooks:"^3.8.5",axios:"0.24.0",classnames:"^2.5.1","copy-to-clipboard":"^3.3.3",dayjs:"^1.11.13",lodash:"^4.17.21","quill-delta":"^5.1.0","react-infinite-scroll-component":"^6.1.0","react-quill-new":"^3.6.0","react-resizable":"^3.0.5",uuid:"^11.1.0"},_ne={"@babel/core":"^7.20.12","@commitlint/cli":"^17.0.3","@commitlint/config-conventional":"^17.0.3","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^28.0.0","@rollup/plugin-typescript":"^11.1.6","@storybook/addon-actions":"6.3.6","@storybook/addon-essentials":"6.4.9","@storybook/addon-interactions":"^6.5.16","@storybook/addon-links":"6.3.5","@storybook/addon-postcss":"2.0.0","@storybook/builder-vite":"^0.4.0","@storybook/node-logger":"6.4.9","@storybook/react":"6.4.9","@storybook/testing-library":"^0.0.13","@types/lodash":"^4","@types/react":"^16.9.0 || ^17.0.0 || ^18.0.0","@types/react-dom":"^16.9.0 || ^17.0.0 || ^18.0.0","@typescript-eslint/eslint-plugin":"^5.35.1","@typescript-eslint/parser":"^5.35.1","@vitejs/plugin-react":"^3.1.0",antd:"^4.24.0","babel-loader":"^8.3.0","babel-plugin-import":"^1.13.8",commitizen:"^4.3.0","css-loader":"^6.7.3","cz-conventional-changelog":"^3.3.0","cz-customizable":"^7.0.0",eslint:"^8.0.1","eslint-config-prettier":"^8.5.0","eslint-config-standard-with-typescript":"^22.0.0","eslint-plugin-import":"^2.25.2","eslint-plugin-n":"^15.0.0","eslint-plugin-promise":"^6.0.0","eslint-plugin-react":"^7.31.0","eslint-plugin-storybook":"^0.6.10",husky:">=6",less:"^4.1.2","less-loader":"^11.1.0","lint-staged":">=10","postcss-loader":"^7.2.4",prettier:"2.7.1",react:"^17.0.2","react-dom":"^17.0.2","require-from-string":"^2.0.2","rollup-plugin-visualizer":"^6.0.1","storybook-less-loader":"^0.1.0",typescript:"*",vite:"^4.1.1","vite-plugin-css-injected-by-js":"^3.5.0","vite-plugin-dts":"^4.3.0","vite-plugin-externalize-deps":"^0.9.0"},Rne=[">0.2%","not dead","not op_mini all"],Yne=["last 1 chrome version","last 1 firefox version","last 1 safari version"],Une={commitizen:{path:"node_modules/cz-customizable"},"cz-customizable":{config:".cz-config.cjs"}},Pne={access:"public",registry:"https://registry.npmjs.org/"},Qne={hooks:{"commit-msg":"validate-commit-msg"}},Bne={name:bne,version:Ene,module:jne,main:zne,typings:Lne,exports:wne,files:Cne,type:xne,types:Sne,scripts:One,peerDependencies:vne,dependencies:kne,devDependencies:_ne,"lint-staged":{"*.{js,css,md,jsx,less,ts,tsx,json}":"prettier --write"},production:Rne,development:Yne,config:Une,publishConfig:Pne,husky:Qne};var Xx=(e=>(e.dev="https://aiot-dev.glodon.com/api/cvforcepd",e.test="https://aiot-dev.glodon.com/api/cvforce",e.prod="https://copilot.glodon.com/api/cvforce",e.local="http://localhost:3000/api/cvforcepd",e))(Xx||{});//! moment.js
320
320
  //! version : 2.30.1
321
321
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
322
322
  //! license : MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glodon-aiot/agent-cli-ui",
3
- "version": "3.11.0",
3
+ "version": "3.11.1-shapshot.1765331453",
4
4
  "module": "./dist/es/index.mjs",
5
5
  "main": "./dist/lib/index.js",
6
6
  "typings": "./dist/src/index.d.ts",
@@ -37,8 +37,8 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@ant-design/icons": "^5.3.4",
40
- "@glodon-aiot/apis": "^3.11.0",
41
- "@glodon-aiot/bot-client-sdk": "^3.11.0",
40
+ "@glodon-aiot/apis": "^3.11.1-shapshot.1765331453",
41
+ "@glodon-aiot/bot-client-sdk": "^3.11.1-shapshot.1765331453",
42
42
  "@matejmazur/react-mathjax": "^0.1.10",
43
43
  "@react-pdf-viewer/core": "^3.12.0",
44
44
  "@react-pdf-viewer/default-layout": "^3.12.0",