@glodon-aiot/agent-cli-ui 2.4.7 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/AgentClientUI.mjs +97 -110
- package/dist/es/Dialog/AgentChat/index.mjs +516 -467
- package/dist/es/Dialog/ConnectToNetwork/index.mjs +25 -24
- package/dist/es/Dialog/FileCard/index.mjs +48 -55
- package/dist/es/Dialog/FilePreview/index.mjs +35 -42
- package/dist/es/Dialog/HistoryItem/index.mjs +48 -53
- package/dist/es/Dialog/KnowledgeList/index.mjs +55 -48
- package/dist/es/Dialog/PromptManager/index.mjs +29 -36
- package/dist/es/Dialog/PromptSetting/index.mjs +53 -66
- package/dist/es/Dialog/SessionAction/index.mjs +92 -91
- package/dist/es/Dialog/SessionList/index.mjs +135 -121
- package/dist/es/Dialog/SessionListDrawer/index.mjs +8 -7
- package/dist/es/Dialog/SessionRefer/ReferItem/index.mjs +29 -36
- package/dist/es/Dialog/SessionRefer/index.mjs +29 -36
- package/dist/es/Dialog/SessionRelated/index.mjs +17 -14
- package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +125 -132
- package/dist/es/Dialog/index.mjs +125 -93
- package/dist/es/QuillEditor/index.mjs +91 -86
- package/dist/es/_virtual/index.mjs +2 -2
- package/dist/es/components/Markdown/Image/index.mjs +20 -20
- package/dist/es/components/Markdown/index.mjs +27 -22
- package/dist/es/constant.mjs +8 -5
- package/dist/es/index.mjs +178 -152
- package/dist/es/node_modules/classnames/index.mjs +1 -1
- package/dist/es/node_modules/comma-separated-tokens/index.mjs +13 -0
- package/dist/es/node_modules/devlop/lib/default.mjs +5 -0
- package/dist/es/node_modules/hast-util-from-dom/lib/index.mjs +93 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/create-h.mjs +126 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/index.mjs +8 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/svg-case-sensitive-tag-names.mjs +4 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/index.mjs +12 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/aria.mjs +61 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/find.mjs +33 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/html.mjs +368 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/normalize.mjs +6 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/svg.mjs +566 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-insensitive-transform.mjs +7 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-sensitive-transform.mjs +6 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/create.mjs +14 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/defined-info.mjs +36 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/info.mjs +28 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/merge.mjs +10 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/schema.mjs +21 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/types.mjs +15 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xlink.mjs +19 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xml.mjs +15 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xmlns.mjs +16 -0
- package/dist/es/node_modules/hast-util-from-html-isomorphic/lib/browser.mjs +16 -0
- package/dist/es/node_modules/hast-util-is-element/lib/index.mjs +61 -0
- package/dist/es/node_modules/hast-util-parse-selector/lib/index.mjs +20 -0
- package/dist/es/node_modules/hast-util-to-text/lib/index.mjs +223 -0
- package/dist/es/node_modules/katex/dist/katex.min.css.mjs +4 -0
- package/dist/es/node_modules/katex/dist/katex.mjs +11700 -0
- package/dist/es/node_modules/longest-streak/index.mjs +12 -0
- package/dist/es/node_modules/mdast-util-math/lib/index.mjs +170 -0
- package/dist/es/node_modules/micromark-extension-math/lib/math-flow.mjs +76 -0
- package/dist/es/node_modules/micromark-extension-math/lib/math-text.mjs +48 -0
- package/dist/es/node_modules/micromark-extension-math/lib/syntax.mjs +15 -0
- package/dist/es/node_modules/micromark-factory-space/index.mjs +15 -0
- package/dist/es/node_modules/micromark-util-character/index.mjs +10 -0
- package/dist/es/node_modules/rehype-katex/lib/index.mjs +83 -0
- package/dist/es/node_modules/remark-math/lib/index.mjs +13 -0
- package/dist/es/node_modules/space-separated-tokens/index.mjs +7 -0
- package/dist/es/node_modules/unist-util-find-after/lib/index.mjs +32 -0
- package/dist/es/node_modules/unist-util-is/lib/index.mjs +81 -0
- package/dist/es/node_modules/unist-util-visit-parents/lib/color.mjs +6 -0
- package/dist/es/node_modules/unist-util-visit-parents/lib/index.mjs +56 -0
- package/dist/es/node_modules/web-namespaces/index.mjs +11 -0
- package/dist/es/utils/index.mjs +44 -27
- package/dist/lib/index.js +278 -138
- package/dist/src/Dialog/AgentChat/index.d.ts +4 -2
- package/dist/src/Dialog/ConnectToNetwork/index.d.ts +1 -0
- package/dist/src/Dialog/KnowledgeList/KnowledgeSelect/index.d.ts +1 -1
- package/dist/src/Dialog/KnowledgeList/index.d.ts +2 -3
- package/dist/src/Dialog/PromptSetting/index.d.ts +1 -0
- package/dist/src/Dialog/SessionAction/index.d.ts +2 -0
- package/dist/src/Dialog/SessionList/index.d.ts +5 -4
- package/dist/src/QuillEditor/index.d.ts +1 -0
- package/dist/src/components/Markdown/Text/index.d.ts +8 -0
- package/dist/src/components/MathJaxLoader/index.d.ts +7 -0
- package/dist/src/components/MathJaxRender/index.d.ts +6 -0
- package/dist/src/constant.d.ts +1 -1
- package/dist/src/contexts/MathJaxContext.d.ts +12 -0
- package/dist/src/index.d.ts +4 -1
- package/dist/src/types.d.ts +26 -6
- package/dist/src/utils/index.d.ts +15 -0
- package/package.json +18 -17
- package/dist/es/_virtual/index2.mjs +0 -4
- package/dist/es/_virtual/index3.mjs +0 -4
- package/dist/es/_virtual/index4.mjs +0 -4
- package/dist/es/_virtual/minio-zj.mjs +0 -4
- package/dist/es/node_modules/@glodon-aiot/minio/dist/minio-zj.mjs +0 -26485
- package/dist/es/node_modules/@socket.io/component-emitter/lib/esm/index.mjs +0 -54
- package/dist/es/node_modules/base64-js/index.mjs +0 -47
- package/dist/es/node_modules/buffer/index.mjs +0 -927
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/has-cors.mjs +0 -9
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseqs.mjs +0 -18
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseuri.mjs +0 -24
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/yeast.mjs +0 -19
- package/dist/es/node_modules/engine.io-client/build/esm/globalThis.browser.mjs +0 -4
- package/dist/es/node_modules/engine.io-client/build/esm/socket.mjs +0 -317
- package/dist/es/node_modules/engine.io-client/build/esm/transport.mjs +0 -113
- package/dist/es/node_modules/engine.io-client/build/esm/transports/index.mjs +0 -11
- package/dist/es/node_modules/engine.io-client/build/esm/transports/polling.mjs +0 -273
- package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.mjs +0 -8
- package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket.mjs +0 -87
- package/dist/es/node_modules/engine.io-client/build/esm/transports/webtransport.mjs +0 -52
- package/dist/es/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.mjs +0 -21
- package/dist/es/node_modules/engine.io-client/build/esm/util.mjs +0 -23
- package/dist/es/node_modules/engine.io-parser/build/esm/commons.mjs +0 -21
- package/dist/es/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.mjs +0 -14
- package/dist/es/node_modules/engine.io-parser/build/esm/decodePacket.browser.mjs +0 -39
- package/dist/es/node_modules/engine.io-parser/build/esm/encodePacket.browser.mjs +0 -28
- package/dist/es/node_modules/engine.io-parser/build/esm/index.mjs +0 -105
- package/dist/es/node_modules/ieee754/index.mjs +0 -28
- package/dist/es/node_modules/js-base64/base64.mjs +0 -31
- package/dist/es/node_modules/socket.io-client/build/esm/contrib/backo2.mjs +0 -26
- package/dist/es/node_modules/socket.io-client/build/esm/index.mjs +0 -25
- package/dist/es/node_modules/socket.io-client/build/esm/manager.mjs +0 -242
- package/dist/es/node_modules/socket.io-client/build/esm/on.mjs +0 -8
- package/dist/es/node_modules/socket.io-client/build/esm/socket.mjs +0 -608
- package/dist/es/node_modules/socket.io-client/build/esm/url.mjs +0 -19
- package/dist/es/node_modules/socket.io-parser/build/esm/binary.mjs +0 -52
- package/dist/es/node_modules/socket.io-parser/build/esm/index.mjs +0 -203
- package/dist/es/node_modules/socket.io-parser/build/esm/is-binary.mjs +0 -26
- package/dist/es/packages/agent-cli-sdk/src/AgentSession.mjs +0 -243
- package/dist/es/packages/agent-cli-sdk/src/BotClient.mjs +0 -242
- package/dist/es/packages/agent-cli-sdk/src/Config.mjs +0 -34
- package/dist/es/packages/agent-cli-sdk/src/DialogSession.mjs +0 -281
- package/dist/es/packages/agent-cli-sdk/src/EventBus.mjs +0 -64
- package/dist/es/packages/agent-cli-sdk/src/Logger.mjs +0 -31
- package/dist/es/packages/agent-cli-sdk/src/PayloadTypes.mjs +0 -4
- package/dist/es/packages/agent-cli-sdk/src/Session.mjs +0 -527
- package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/fetch.mjs +0 -112
- package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/parse.mjs +0 -97
- package/dist/es/packages/agent-cli-sdk/src/api/index.mjs +0 -48
- package/dist/es/packages/agent-cli-sdk/src/utils.mjs +0 -11
- package/dist/es/packages/apis/dist/es/aecpilot/cosntant.mjs +0 -5
- package/dist/es/packages/apis/dist/es/aecpilot/model.mjs +0 -9
- package/dist/es/packages/apis/dist/es/aecpilotui/index.mjs +0 -8
- package/dist/es/packages/apis/dist/es/agentcliui/index.mjs +0 -414
- package/dist/es/packages/apis/dist/es/base/index.mjs +0 -154
- package/dist/es/packages/apis/dist/es/cvforce/index.mjs +0 -431
- package/dist/es/packages/apis/dist/es/cvforce/model.mjs +0 -6
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +0 -6
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +0 -10
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +0 -9
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +0 -19
- package/dist/es/packages/apis/dist/es/utils/fetchEventSource/fetch.mjs +0 -106
- package/dist/es/packages/apis/dist/es/utils/fetchEventSource/parse.mjs +0 -97
|
@@ -1,457 +1,502 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Mt = Object.defineProperty, zt = Object.defineProperties;
|
|
2
|
+
var Ut = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var Xe = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
4
|
+
var jt = Object.prototype.hasOwnProperty, Vt = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var ye = (x, s, y) => s in x ? Mt(x, s, { enumerable: !0, configurable: !0, writable: !0, value: y }) : x[s] = y, ve = (x, s) => {
|
|
6
|
+
for (var y in s || (s = {}))
|
|
7
|
+
jt.call(s, y) && ye(x, y, s[y]);
|
|
8
8
|
if (Xe)
|
|
9
|
-
for (var
|
|
10
|
-
|
|
9
|
+
for (var y of Xe(s))
|
|
10
|
+
Vt.call(s, y) && ye(x, y, s[y]);
|
|
11
11
|
return x;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var j = (x,
|
|
15
|
-
var
|
|
12
|
+
}, ke = (x, s) => zt(x, Ut(s));
|
|
13
|
+
var P = (x, s, y) => (ye(x, typeof s != "symbol" ? s + "" : s, y), y);
|
|
14
|
+
var j = (x, s, y) => new Promise((e, w) => {
|
|
15
|
+
var se = (b) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
|
|
17
|
+
O(y.next(b));
|
|
18
|
+
} catch (p) {
|
|
19
|
+
w(p);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, v = (b) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
|
|
23
|
+
O(y.throw(b));
|
|
24
|
+
} catch (p) {
|
|
25
|
+
w(p);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, O = (b) => b.done ? e(b.value) : Promise.resolve(b.value).then(se, v);
|
|
28
|
+
O((y = y.apply(x, s)).next());
|
|
29
29
|
});
|
|
30
|
-
import { jsxs as
|
|
31
|
-
import { memo as
|
|
30
|
+
import { jsxs as q, jsx as d } from "../../_virtual/jsx-runtime.mjs";
|
|
31
|
+
import { memo as At, useState as u, useRef as V, useContext as Bt, useEffect as F } from "react";
|
|
32
32
|
import "./style.less.mjs";
|
|
33
|
-
import { Divider as
|
|
34
|
-
import
|
|
35
|
-
import "
|
|
36
|
-
import "
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import "../../
|
|
40
|
-
import "
|
|
41
|
-
import "../../
|
|
42
|
-
import "../../
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import {
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import ai from "../PromptSetting/index.mjs";
|
|
57
|
-
import ge from "../../node_modules/ahooks/es/useMemoizedFn/index.mjs";
|
|
58
|
-
import li from "../SessionListDrawer/index.mjs";
|
|
59
|
-
import ri from "../../node_modules/react-infinite-scroll-component/dist/index.es.mjs";
|
|
60
|
-
import si from "../ConnectToNetwork/index.mjs";
|
|
61
|
-
import di from "../../assets/icon.svg.mjs";
|
|
33
|
+
import { Divider as $t, Spin as qt, Button as K, Space as oe, Upload as Kt, Tooltip as Wt, message as R, notification as Qt } from "antd";
|
|
34
|
+
import we from "../../Iconfont/index.mjs";
|
|
35
|
+
import { IHistoryRole as W, ChatMessageRole as Yt } from "@glodon-aiot/apis";
|
|
36
|
+
import _t from "../HistoryItem/index.mjs";
|
|
37
|
+
import Gt from "dayjs";
|
|
38
|
+
import Xt from "../../context.mjs";
|
|
39
|
+
import { MB as Zt } from "../../constant.mjs";
|
|
40
|
+
import Jt from "../FilePreview/index.mjs";
|
|
41
|
+
import { getImageExtension as St } from "../../utils/index.mjs";
|
|
42
|
+
import en from "../../QuillEditor/index.mjs";
|
|
43
|
+
import tn from "../Recommend/index.mjs";
|
|
44
|
+
import nn from "../Greeting/index.mjs";
|
|
45
|
+
import on from "../PromptManager/index.mjs";
|
|
46
|
+
import sn from "../../Footer/index.mjs";
|
|
47
|
+
import { CameraOutlined as Ze, PlusOutlined as ln } from "@ant-design/icons";
|
|
48
|
+
import rn from "../UploadKnowledgeFiles/index.mjs";
|
|
49
|
+
import an from "../UploadingPrompt/index.mjs";
|
|
50
|
+
import dn from "../PromptSetting/index.mjs";
|
|
51
|
+
import be from "../../node_modules/ahooks/es/useMemoizedFn/index.mjs";
|
|
52
|
+
import cn from "../SessionListDrawer/index.mjs";
|
|
53
|
+
import fn from "../../node_modules/react-infinite-scroll-component/dist/index.es.mjs";
|
|
54
|
+
import un from "../ConnectToNetwork/index.mjs";
|
|
55
|
+
import pn from "../../assets/icon.svg.mjs";
|
|
62
56
|
import Se from "../../node_modules/uuid/dist/esm-browser/v4.mjs";
|
|
63
|
-
const
|
|
64
|
-
icon:
|
|
57
|
+
const hn = At(_t), gn = {
|
|
58
|
+
icon: pn,
|
|
65
59
|
text: "今天我能帮你什么?"
|
|
66
60
|
};
|
|
67
|
-
class
|
|
68
|
-
constructor(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
this.content =
|
|
61
|
+
class _ {
|
|
62
|
+
constructor(s, y, e, w) {
|
|
63
|
+
P(this, "messageTime");
|
|
64
|
+
P(this, "isWaiting");
|
|
65
|
+
P(this, "messageId");
|
|
66
|
+
P(this, "isContext");
|
|
67
|
+
P(this, "actions");
|
|
68
|
+
P(this, "reference");
|
|
69
|
+
P(this, "isSensitive");
|
|
70
|
+
P(this, "isSuspend");
|
|
71
|
+
P(this, "comment");
|
|
72
|
+
this.content = s, this.sessionId = y, this.role = e, this.files = w, this.content = s, this.role = e, this.sessionId = y, this.files = w, this.messageTime = Gt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = Se(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
|
|
79
73
|
isAgree: 0
|
|
80
74
|
};
|
|
81
75
|
}
|
|
82
76
|
}
|
|
83
|
-
const Je = 10,
|
|
84
|
-
var
|
|
77
|
+
const Je = 10, Kn = (x) => {
|
|
78
|
+
var Ae, Be, $e, qe, Ke, We, Qe, Ye, _e;
|
|
85
79
|
const {
|
|
86
|
-
application:
|
|
87
|
-
docViewerUrl:
|
|
80
|
+
application: s,
|
|
81
|
+
docViewerUrl: y = "",
|
|
88
82
|
currentSession: e,
|
|
89
|
-
onCreateSession:
|
|
90
|
-
embeddingService:
|
|
91
|
-
setCurrentSession:
|
|
92
|
-
networkStatus:
|
|
93
|
-
setNetworkStatus:
|
|
94
|
-
} = x, [
|
|
95
|
-
service:
|
|
96
|
-
agentClient:
|
|
83
|
+
onCreateSession: w,
|
|
84
|
+
embeddingService: se,
|
|
85
|
+
setCurrentSession: v,
|
|
86
|
+
networkStatus: O,
|
|
87
|
+
setNetworkStatus: b
|
|
88
|
+
} = x, [p, I] = u([]), [et, G] = u(), [le, xe] = u(), T = V(null), {
|
|
89
|
+
service: C,
|
|
90
|
+
agentClient: L,
|
|
97
91
|
depId: tt,
|
|
98
|
-
footer:
|
|
99
|
-
transform:
|
|
100
|
-
defaultInput:
|
|
101
|
-
onMessage:
|
|
102
|
-
onHistoryLoad:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
92
|
+
footer: nt,
|
|
93
|
+
transform: f,
|
|
94
|
+
defaultInput: re,
|
|
95
|
+
onMessage: X,
|
|
96
|
+
onHistoryLoad: Ie,
|
|
97
|
+
beforeMessageSend: Z,
|
|
98
|
+
bodyStyle: it,
|
|
99
|
+
disabled: D,
|
|
100
|
+
features: c
|
|
101
|
+
} = Bt(Xt), [Le, ae] = u(!1), h = V(p), Ne = V(), [ot, st] = u(0), [Q, A] = u(), [J, S] = u(""), [Ce, de] = u(!1), ce = V(null), [Fe, lt] = u([]), [Ee, fe] = u(!1), [Te, rt] = u(!1), [at, dt] = u(""), [ct, B] = u(), [ue, ee] = u({}), te = V(null), Pe = V(null), pe = V(null), [Re, ft] = u(!1), [ut, pt] = u([]), [ht, ne] = u(!0), [gt, mt] = u(!0), [Oe, H] = u(!1), [he, M] = u(!1), [De, yt] = u(!1), [E, ie] = u(typeof (c == null ? void 0 : c.promptVariables) == "object" ? c.promptVariables.default || [] : []), [vt, kt] = u(typeof (c == null ? void 0 : c.knowledges) == "object" && c.knowledges.default || void 0), [He, z] = u(!1), [wt, Y] = u(!0), [bt, $] = u(typeof (c == null ? void 0 : c.connectNetwork) == "object" && typeof (c == null ? void 0 : c.connectNetwork.default) == "boolean" ? c.connectNetwork.default : !1), [Me, ze] = u(!1);
|
|
102
|
+
F(() => {
|
|
103
|
+
var l, i;
|
|
104
|
+
e && (h.current = []), I([]);
|
|
105
|
+
const t = T.current;
|
|
109
106
|
if (t && t.scrollTo({
|
|
110
107
|
top: 0
|
|
111
|
-
}), !((
|
|
108
|
+
}), !((l = e == null ? void 0 : e.data) != null && l.id))
|
|
112
109
|
return;
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
115
|
-
|
|
110
|
+
if (M(!1), H(!1), (i = e.messages) != null && i.length) {
|
|
111
|
+
const o = [...e.messages.filter((a) => a == null ? void 0 : a.messageId)].reverse();
|
|
112
|
+
h.current = [...o], I([...o]);
|
|
116
113
|
}
|
|
117
|
-
const
|
|
118
|
-
var
|
|
119
|
-
(
|
|
120
|
-
applicationId:
|
|
114
|
+
const n = (r) => {
|
|
115
|
+
var o;
|
|
116
|
+
(o = e == null ? void 0 : e.data) != null && o.id && (h.current = [...r].reverse(), I([...r].reverse()), !r || r.length < 10 ? Y(!1) : Y(!0), Ie && Ie({
|
|
117
|
+
applicationId: s.id,
|
|
121
118
|
sessionId: e.data.id,
|
|
122
119
|
histories: r
|
|
123
120
|
}));
|
|
124
121
|
};
|
|
125
|
-
return e.addEventListener("history:loaded",
|
|
126
|
-
|
|
122
|
+
return e.addEventListener("history:loaded", n), () => {
|
|
123
|
+
h.current = [], I([]), e == null || e.removeEventListener("history:loaded", n);
|
|
127
124
|
};
|
|
128
|
-
}, [
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
}, [e]), F(() => {
|
|
126
|
+
const t = () => {
|
|
127
|
+
var n;
|
|
128
|
+
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ie(e.promptVariables.sort((l, i) => l.key.localeCompare(i.key))), e.knowledges && kt(e.knowledges), b(e.netOpen));
|
|
129
|
+
};
|
|
130
|
+
return e == null || e.addEventListener("data:updated", t), () => {
|
|
131
|
+
e == null || e.removeEventListener("data:updated", t);
|
|
132
|
+
};
|
|
133
|
+
}, [e]), F(() => {
|
|
134
|
+
var n;
|
|
135
|
+
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
131
136
|
return;
|
|
132
|
-
const t = (
|
|
133
|
-
console.
|
|
137
|
+
const t = (l) => {
|
|
138
|
+
console.error(l.message, l.cause, "e.case");
|
|
134
139
|
};
|
|
135
140
|
return e.addEventListener("error", t), () => {
|
|
136
141
|
e == null || e.removeEventListener("error", t);
|
|
137
142
|
};
|
|
138
|
-
}, [
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
if (!((a = e == null ? void 0 : e.data) != null && a.id) || !(n != null && n.id))
|
|
143
|
+
}, [e]);
|
|
144
|
+
const xt = () => {
|
|
145
|
+
var l;
|
|
146
|
+
if (!((l = e == null ? void 0 : e.data) != null && l.id) || !(s != null && s.id))
|
|
143
147
|
return;
|
|
144
|
-
const t = e.data.id,
|
|
145
|
-
if (
|
|
146
|
-
return
|
|
148
|
+
const t = e.data.id, n = p[p.length - 1];
|
|
149
|
+
if (n && n.isContext)
|
|
150
|
+
return R.success("已开启新话题");
|
|
147
151
|
e.clear().then(() => {
|
|
148
|
-
const
|
|
149
|
-
|
|
152
|
+
const i = new _("", t, W.System);
|
|
153
|
+
i.isContext = !0, I([i, ...p]);
|
|
150
154
|
});
|
|
151
155
|
};
|
|
152
|
-
|
|
153
|
-
|
|
156
|
+
F(() => {
|
|
157
|
+
s != null && s.id && (C == null || C.getRecommendQues(s.id).then((t) => {
|
|
154
158
|
lt(t);
|
|
155
159
|
}));
|
|
156
|
-
}, [tt,
|
|
157
|
-
const
|
|
158
|
-
var
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (!(
|
|
163
|
-
return
|
|
164
|
-
if (
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
160
|
+
}, [tt, s]);
|
|
161
|
+
const Ue = (t) => j(void 0, null, function* () {
|
|
162
|
+
var k, g;
|
|
163
|
+
if (D)
|
|
164
|
+
return R.error("发送功能被禁用");
|
|
165
|
+
const n = t || et;
|
|
166
|
+
if (!(n != null && n.trim()))
|
|
167
|
+
return R.error("请输入你想问的");
|
|
168
|
+
if (!(E == null ? void 0 : E.every((m) => !!(m != null && m.value)))) {
|
|
169
|
+
if (f != null && f.promptVariables)
|
|
170
|
+
return R.error("变量值不能为空");
|
|
171
|
+
console.error("变量值不能为空", E == null ? void 0 : E.map((m) => !!(m != null && m.value)));
|
|
172
|
+
}
|
|
173
|
+
if (he)
|
|
174
|
+
return R.error("正在回复中");
|
|
175
|
+
if (Le)
|
|
176
|
+
return R.error("等待初始化");
|
|
177
|
+
if (!ht)
|
|
178
|
+
return R.error("正在解析文件");
|
|
179
|
+
if (Ce)
|
|
180
|
+
return R.error("正在上传图片");
|
|
181
|
+
A(void 0), S("");
|
|
182
|
+
const i = (k = e == null ? void 0 : e.data) == null ? void 0 : k.id;
|
|
183
|
+
if (!i) {
|
|
184
|
+
w == null || w({
|
|
185
|
+
netOpen: O ? 1 : 2
|
|
186
|
+
}).then((m) => {
|
|
187
|
+
var N, U;
|
|
188
|
+
z(!0), b(!!((N = m.data) != null && N.netOpen)), $(!!((U = m.data) != null && U.enableNetOpen)), It(m).then(() => {
|
|
189
|
+
v == null || v(m), z(!1), xe(n);
|
|
181
190
|
});
|
|
182
191
|
});
|
|
183
192
|
return;
|
|
184
193
|
}
|
|
185
|
-
(
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
194
|
+
ze(!0);
|
|
195
|
+
const r = J ? `
|
|
196
|
+
${n}` : n;
|
|
197
|
+
let o;
|
|
198
|
+
try {
|
|
199
|
+
Z ? o = yield Z == null ? void 0 : Z({
|
|
200
|
+
applicationId: s.id,
|
|
201
|
+
sessionId: i,
|
|
202
|
+
message: {
|
|
203
|
+
content: r,
|
|
204
|
+
sessionId: i,
|
|
205
|
+
role: Yt.User,
|
|
206
|
+
files: ue[i]
|
|
207
|
+
}
|
|
208
|
+
}) : o = !0;
|
|
209
|
+
} catch (m) {
|
|
210
|
+
o = !1;
|
|
211
|
+
}
|
|
212
|
+
if (ze(!1), o === !1)
|
|
213
|
+
return;
|
|
214
|
+
let a = n;
|
|
215
|
+
typeof o == "object" && (a = o.content || n), ((g = ue[i]) == null ? void 0 : g.length) > 0 ? Lt(a) : ge(a);
|
|
216
|
+
}), It = (t) => new Promise((n, l) => j(void 0, null, function* () {
|
|
217
|
+
const o = (t == null ? void 0 : t.promptVariables).filter((a) => a.key !== "query").map((a) => {
|
|
218
|
+
var g;
|
|
219
|
+
const k = (g = E.find((m) => m.key === a.key)) == null ? void 0 : g.value;
|
|
220
|
+
return a.value = k || "", a;
|
|
191
221
|
});
|
|
192
|
-
|
|
193
|
-
})),
|
|
194
|
-
var
|
|
195
|
-
if (
|
|
222
|
+
ie(o.sort((a, k) => a.key.localeCompare(k.key))), yield t == null ? void 0 : t.setPromptVariables(o), n();
|
|
223
|
+
})), Lt = (t) => {
|
|
224
|
+
var o, a, k;
|
|
225
|
+
if (ne(!1), !((o = e == null ? void 0 : e.data) != null && o.id) || !(s != null && s.id))
|
|
196
226
|
return;
|
|
197
|
-
const
|
|
198
|
-
let
|
|
199
|
-
(
|
|
200
|
-
r.has(
|
|
201
|
-
}), Promise.all(
|
|
227
|
+
const n = ((a = e.data) == null ? void 0 : a.id) || "", l = [];
|
|
228
|
+
let i = [], r = /* @__PURE__ */ new Set();
|
|
229
|
+
(k = ue[n]) == null || k.forEach((g) => {
|
|
230
|
+
r.has(g.id) || (i.push(g), r.add(g.id));
|
|
231
|
+
}), Promise.all(i.map((g) => C == null ? void 0 : C.patchApplicationIdKnowledgeIdFileId(s == null ? void 0 : s.id, n, g.id, {
|
|
202
232
|
enabled: 1
|
|
203
|
-
}).then((
|
|
204
|
-
|
|
205
|
-
}))).then((
|
|
206
|
-
|
|
207
|
-
}).catch((
|
|
208
|
-
throw Error(
|
|
233
|
+
}).then((m) => {
|
|
234
|
+
l.push(g);
|
|
235
|
+
}))).then((g) => {
|
|
236
|
+
ne(!0), ge(t, l);
|
|
237
|
+
}).catch((g) => {
|
|
238
|
+
throw Error(g);
|
|
209
239
|
});
|
|
210
240
|
};
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (n.type !== 0 || !O || !((a = e == null ? void 0 : e.data) != null && a.id))
|
|
214
|
-
return;
|
|
215
|
-
const t = O, i = () => {
|
|
216
|
-
ie(void 0), S(t);
|
|
217
|
-
};
|
|
218
|
-
return e.addEventListener("history:loaded", i), () => {
|
|
219
|
-
e == null || e.removeEventListener("history:loaded", i);
|
|
220
|
-
};
|
|
221
|
-
}, [O, e]), b(() => {
|
|
222
|
-
var a;
|
|
223
|
-
if (n.type !== 2 || !O || !((a = e == null ? void 0 : e.data) != null && a.id))
|
|
241
|
+
F(() => {
|
|
242
|
+
if (!le || !e)
|
|
224
243
|
return;
|
|
225
|
-
const t =
|
|
226
|
-
|
|
227
|
-
ie(void 0), S(t);
|
|
228
|
-
}, 1e3);
|
|
244
|
+
const t = le, n = () => {
|
|
245
|
+
ge(t), xe(void 0);
|
|
229
246
|
};
|
|
230
|
-
return e.addEventListener("
|
|
231
|
-
e == null || e.removeEventListener("
|
|
247
|
+
return e.ready ? n() : e.addEventListener("ready", n, !0), () => {
|
|
248
|
+
e == null || e.removeEventListener("ready", n);
|
|
232
249
|
};
|
|
233
|
-
}, [
|
|
234
|
-
const
|
|
235
|
-
var
|
|
236
|
-
const
|
|
237
|
-
if (!
|
|
250
|
+
}, [le, e]);
|
|
251
|
+
const ge = (t, n) => j(void 0, null, function* () {
|
|
252
|
+
var g, m;
|
|
253
|
+
const l = (g = e == null ? void 0 : e.data) == null ? void 0 : g.id;
|
|
254
|
+
if (!l)
|
|
238
255
|
return;
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
${t}` : t;
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
applicationId: n.id,
|
|
246
|
-
sessionId: a,
|
|
256
|
+
M(!0), H(!0);
|
|
257
|
+
const i = J ? `
|
|
258
|
+
${t}` : t, r = new _(i, l, W.User, n);
|
|
259
|
+
G(void 0), B(void 0), h.current = [r, ...p], I(h.current), s.id && X && X({
|
|
260
|
+
applicationId: s.id,
|
|
261
|
+
sessionId: l,
|
|
247
262
|
message: r
|
|
248
263
|
});
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
const
|
|
252
|
-
e.setPromptVariables(E), e.send({
|
|
253
|
-
text: o,
|
|
254
|
-
fileIds: s
|
|
255
|
-
}, {
|
|
264
|
+
const o = new _("", l, W.System);
|
|
265
|
+
o.isWaiting = !0, h.current = [o, ...h.current], I(h.current);
|
|
266
|
+
const a = (n == null ? void 0 : n.map((N) => N.id)) || [], k = {
|
|
256
267
|
stream: !0,
|
|
257
|
-
referenceFirst: !1
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
268
|
+
referenceFirst: !1
|
|
269
|
+
};
|
|
270
|
+
if (f != null && f.promptVariables) {
|
|
271
|
+
const N = E == null ? void 0 : E.reduce((U, Ge) => (U[Ge.key] = Ge.value, U), {});
|
|
272
|
+
k.formatValues = N, e.setPromptVariables(E);
|
|
273
|
+
}
|
|
274
|
+
if (f != null && f.knowledges) {
|
|
275
|
+
const N = vt;
|
|
276
|
+
k.knowledges = N, e.setKnowledges(N);
|
|
277
|
+
}
|
|
278
|
+
yield e.send({
|
|
279
|
+
text: i,
|
|
280
|
+
fileIds: a
|
|
281
|
+
}, k), ee({
|
|
282
|
+
[l]: []
|
|
283
|
+
}), (m = te.current) == null || m.update();
|
|
284
|
+
});
|
|
285
|
+
F(() => {
|
|
286
|
+
var l;
|
|
287
|
+
const t = (l = e == null ? void 0 : e.data) == null ? void 0 : l.id;
|
|
266
288
|
if (!t)
|
|
267
289
|
return;
|
|
268
|
-
const
|
|
269
|
-
if (
|
|
290
|
+
const n = (i) => {
|
|
291
|
+
if (i.sessionId && i.sessionId !== Ne.current || i.role === W.User)
|
|
270
292
|
return;
|
|
271
|
-
if (
|
|
272
|
-
return
|
|
273
|
-
message:
|
|
293
|
+
if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (H(!1), M(!1), h.current = h.current.filter((a) => !a.isWaiting), I([...h.current]), h.current = [...h.current], i.content))
|
|
294
|
+
return Qt.error({
|
|
295
|
+
message: i.content
|
|
274
296
|
});
|
|
275
|
-
const r =
|
|
276
|
-
|
|
277
|
-
applicationId:
|
|
297
|
+
const r = i.actions || [], o = new _(i.content, t, W.Robot);
|
|
298
|
+
o.messageId = i.messageId, o.reasoningContent = i.reasoningContent, o.searchReference = i.searchReference, o.thinkingSecs = i.thinkingSecs, o.thinkingStatus = i.thinkingStatus, o.actions = r, o.isLoading = !0, h.current = h.current.filter((a) => !a.isWaiting).filter((a) => !a.isReplying), i.index === void 0 && I([o, ...h.current]), i.code === 11915 && (H(!1), M(!1), o.isLoading = !1, o.content = "请您换个问题问我吧~", o.isSensitive = !0, I([o, ...h.current])), i.index === -2 && (H(!1), M(!1), o.isLoading = !1, o.content = "回答已中止~", o.isSuspend = !0, I([o, ...h.current])), i.index === -1 && (H(!1), M(!1), o.isLoading = !1, o.reference = i.reference, I([o, ...h.current]), s.id && X && X({
|
|
299
|
+
applicationId: s.id,
|
|
278
300
|
sessionId: t,
|
|
279
|
-
message:
|
|
280
|
-
})),
|
|
301
|
+
message: o
|
|
302
|
+
})), i.index === -3 && (H(!1), M(!1), o.isLoading = !1, o.reference = i.reference, o.relatedQuesion = i.relatedQuesion, I([o, ...h.current]));
|
|
281
303
|
};
|
|
282
|
-
return e.ready ? e.addEventListener("message:updated",
|
|
283
|
-
e.addEventListener("message:updated",
|
|
304
|
+
return e.ready ? e.addEventListener("message:updated", n) : e.addEventListener("ready", () => {
|
|
305
|
+
e.addEventListener("message:updated", n);
|
|
284
306
|
}), () => {
|
|
285
|
-
e == null || e.removeEventListener("message:updated",
|
|
307
|
+
e == null || e.removeEventListener("message:updated", n);
|
|
286
308
|
};
|
|
287
|
-
}, [
|
|
288
|
-
|
|
289
|
-
|
|
309
|
+
}, [e]), F(() => {
|
|
310
|
+
if (!e) {
|
|
311
|
+
ae(!1);
|
|
290
312
|
return;
|
|
291
|
-
|
|
292
|
-
|
|
313
|
+
}
|
|
314
|
+
const t = (n) => {
|
|
315
|
+
ae(n);
|
|
293
316
|
};
|
|
294
|
-
return
|
|
317
|
+
return ae(e.frozen), e.addEventListener("frozen", t), () => {
|
|
295
318
|
e == null || e.removeEventListener("frozen", t);
|
|
296
319
|
};
|
|
297
|
-
}, [
|
|
298
|
-
if (!
|
|
320
|
+
}, [e]), F(() => {
|
|
321
|
+
if (!L)
|
|
299
322
|
return;
|
|
300
|
-
const t =
|
|
301
|
-
|
|
302
|
-
}, [
|
|
303
|
-
|
|
304
|
-
}, [
|
|
305
|
-
const
|
|
306
|
-
const
|
|
307
|
-
return
|
|
323
|
+
const t = L.questionContextMaxLength || 4e3;
|
|
324
|
+
st(t);
|
|
325
|
+
}, [L, C]), F(() => {
|
|
326
|
+
re && B(re.text);
|
|
327
|
+
}, [re]);
|
|
328
|
+
const Nt = (t) => {
|
|
329
|
+
const n = t.size;
|
|
330
|
+
return n <= 0 ? (R.error("该文件为空,请重新上传"), !1) : n > 20 * Zt ? (R.error("图片须小于20M"), !1) : (A(t), !1);
|
|
308
331
|
}, Ct = (t) => j(void 0, null, function* () {
|
|
309
|
-
var
|
|
310
|
-
return
|
|
311
|
-
|
|
312
|
-
netOpen:
|
|
313
|
-
}).then((
|
|
314
|
-
var r,
|
|
315
|
-
|
|
332
|
+
var n;
|
|
333
|
+
return A(t), (n = e == null ? void 0 : e.data) != null && n.id ? je(e, t) : new Promise((l) => {
|
|
334
|
+
z(!0), w == null || w({
|
|
335
|
+
netOpen: O ? 1 : 2
|
|
336
|
+
}).then((i) => {
|
|
337
|
+
var r, o;
|
|
338
|
+
v == null || v(i), z(!1), b(!!((r = i.data) != null && r.netOpen)), $(!!((o = i.data) != null && o.enableNetOpen)), l(je(i, t));
|
|
316
339
|
});
|
|
317
340
|
});
|
|
318
|
-
}),
|
|
319
|
-
const
|
|
320
|
-
return new Promise((
|
|
321
|
-
var
|
|
341
|
+
}), je = (t, n) => {
|
|
342
|
+
const l = St(n.name);
|
|
343
|
+
return new Promise((i) => {
|
|
344
|
+
var o;
|
|
322
345
|
const r = {
|
|
323
|
-
files: [`${Se()}.${
|
|
346
|
+
files: [`${Se()}.${l}`],
|
|
324
347
|
isv: "minio",
|
|
325
|
-
knowledgeId: ((
|
|
348
|
+
knowledgeId: ((o = t.data) == null ? void 0 : o.id) || "",
|
|
326
349
|
type: 1
|
|
327
350
|
};
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
var
|
|
331
|
-
const
|
|
332
|
-
|
|
351
|
+
de(!0), C == null || C.postTicket(r).then((a) => {
|
|
352
|
+
C.uploadMinioFile(a.minio, n).then(() => {
|
|
353
|
+
var N, U;
|
|
354
|
+
const k = (N = a.minio.endpoints) == null ? void 0 : N[0], g = a.minio.bucket, m = (U = a.minio.fileKeys) == null ? void 0 : U[0];
|
|
355
|
+
i(`${location.protocol}//${k}/${g}/${m}`);
|
|
333
356
|
}).catch(() => {
|
|
334
|
-
|
|
357
|
+
S(""), A(void 0);
|
|
335
358
|
}).finally(() => {
|
|
336
|
-
|
|
359
|
+
de(!1);
|
|
337
360
|
});
|
|
338
361
|
}).catch(() => {
|
|
339
|
-
|
|
362
|
+
S(""), A(void 0), de(!1);
|
|
340
363
|
});
|
|
341
364
|
});
|
|
342
365
|
};
|
|
343
|
-
|
|
344
|
-
const t =
|
|
345
|
-
t && !
|
|
366
|
+
F(() => {
|
|
367
|
+
const t = T.current;
|
|
368
|
+
t && !De && t.scrollTo({
|
|
346
369
|
top: t.scrollHeight
|
|
347
370
|
});
|
|
348
|
-
}, [
|
|
349
|
-
const
|
|
350
|
-
if (!
|
|
351
|
-
return
|
|
352
|
-
const
|
|
371
|
+
}, [p]);
|
|
372
|
+
const Ve = (t, n) => new Promise((l) => {
|
|
373
|
+
if (!n.file.url || !(s != null && s.id))
|
|
374
|
+
return l();
|
|
375
|
+
const i = ke(ve({}, n.file), {
|
|
353
376
|
type: 1
|
|
354
377
|
});
|
|
355
|
-
|
|
378
|
+
C == null || C.postApplicationIdSessionKnowledgeSessionFile(s == null ? void 0 : s.id, t, i).finally(() => {
|
|
356
379
|
var r;
|
|
357
|
-
(r =
|
|
380
|
+
(r = te.current) == null || r.update().finally(l);
|
|
358
381
|
});
|
|
359
|
-
}),
|
|
382
|
+
}), Ft = () => {
|
|
360
383
|
var t;
|
|
361
384
|
(t = e == null ? void 0 : e.data) != null && t.id && (H(!1), e.suspend());
|
|
362
|
-
},
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
top:
|
|
385
|
+
}, Et = (t) => {
|
|
386
|
+
const n = T.current;
|
|
387
|
+
n && setTimeout(() => {
|
|
388
|
+
n.scrollTo({
|
|
389
|
+
top: n.scrollHeight,
|
|
367
390
|
behavior: t == null ? void 0 : t.behavior
|
|
368
391
|
});
|
|
369
392
|
}, t == null ? void 0 : t.ms);
|
|
370
|
-
},
|
|
371
|
-
if (!
|
|
393
|
+
}, Tt = () => {
|
|
394
|
+
if (!T.current)
|
|
372
395
|
return;
|
|
373
|
-
const t =
|
|
396
|
+
const t = T.current.scrollTop <= -80;
|
|
374
397
|
yt(t);
|
|
375
|
-
},
|
|
376
|
-
var
|
|
377
|
-
(
|
|
378
|
-
}),
|
|
379
|
-
|
|
380
|
-
}),
|
|
381
|
-
var
|
|
382
|
-
if (!((
|
|
398
|
+
}, Pt = be((t) => {
|
|
399
|
+
var n, l;
|
|
400
|
+
(n = ce.current) == null || n.update(t), (l = ce.current) == null || l.focus();
|
|
401
|
+
}), Rt = be((t) => {
|
|
402
|
+
Ue(t);
|
|
403
|
+
}), Ot = be(() => {
|
|
404
|
+
var n;
|
|
405
|
+
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
383
406
|
return;
|
|
384
|
-
|
|
385
|
-
const t = new
|
|
386
|
-
t.isWaiting = !0,
|
|
407
|
+
h.current = [...p.slice(1, p.length)], I(h.current);
|
|
408
|
+
const t = new _("", e.data.id, W.System);
|
|
409
|
+
t.isWaiting = !0, h.current = [t, ...h.current], I(h.current), M(!0), H(!0), e.answerAgain();
|
|
387
410
|
});
|
|
388
|
-
|
|
389
|
-
var t,
|
|
390
|
-
|
|
391
|
-
}, [
|
|
392
|
-
const
|
|
393
|
-
var
|
|
394
|
-
if (!((
|
|
411
|
+
F(() => {
|
|
412
|
+
var t, n;
|
|
413
|
+
Ne.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !He && ((n = pe.current) == null || n.clear());
|
|
414
|
+
}, [e]);
|
|
415
|
+
const Dt = () => {
|
|
416
|
+
var l;
|
|
417
|
+
if (!((l = e == null ? void 0 : e.data) != null && l.id))
|
|
395
418
|
return;
|
|
396
|
-
const
|
|
419
|
+
const n = p[p.length - 1].messageTime;
|
|
397
420
|
e.fetchMessages({
|
|
398
|
-
endTime:
|
|
421
|
+
endTime: n,
|
|
399
422
|
pageSize: Je
|
|
400
|
-
}).then((
|
|
401
|
-
|
|
402
|
-
const r = o || [];
|
|
423
|
+
}).then((i) => {
|
|
424
|
+
const r = i || [];
|
|
403
425
|
if (!r || !(r != null && r.length)) {
|
|
404
|
-
|
|
426
|
+
Y(!1);
|
|
405
427
|
return;
|
|
406
428
|
}
|
|
407
|
-
r.length < 10 ?
|
|
429
|
+
r.length < 10 ? Y(!1) : Y(!0), I([...p, ...r.reverse()]);
|
|
408
430
|
});
|
|
409
|
-
},
|
|
410
|
-
var
|
|
411
|
-
(
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
var
|
|
421
|
-
(
|
|
422
|
-
}));
|
|
431
|
+
}, Ht = (t) => j(void 0, null, function* () {
|
|
432
|
+
var n, l;
|
|
433
|
+
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
434
|
+
b(t);
|
|
435
|
+
else {
|
|
436
|
+
if (yield e.setNetOpen(t), !((l = e.data) != null && l.id))
|
|
437
|
+
return;
|
|
438
|
+
b(t);
|
|
439
|
+
}
|
|
440
|
+
}), me = () => j(void 0, null, function* () {
|
|
441
|
+
e ? e.fetchData().then((t) => {
|
|
442
|
+
var n;
|
|
443
|
+
(n = e == null ? void 0 : e.data) != null && n.id && (b(t.netOpen), $(t.enableNetOpen));
|
|
444
|
+
}) : (b(!1), $(s.arrange[0].enableNetOpen));
|
|
423
445
|
});
|
|
424
|
-
return
|
|
425
|
-
|
|
426
|
-
}, [
|
|
427
|
-
var t,
|
|
428
|
-
if (
|
|
429
|
-
const
|
|
430
|
-
if (!
|
|
446
|
+
return F(() => {
|
|
447
|
+
me();
|
|
448
|
+
}, [e]), F(() => {
|
|
449
|
+
var t, n;
|
|
450
|
+
if (T.current) {
|
|
451
|
+
const l = document.getElementById("chat-main"), i = (t = T.current) == null ? void 0 : t.querySelector(".infinite-scroll-component__outerdiv"), r = (n = T.current) == null ? void 0 : n.querySelector(".infinite-scroll-component");
|
|
452
|
+
if (!i || !r || !l)
|
|
431
453
|
return;
|
|
432
|
-
const
|
|
433
|
-
if (r.offsetHeight <=
|
|
434
|
-
if (
|
|
454
|
+
const o = l.offsetHeight;
|
|
455
|
+
if (r.offsetHeight <= o) {
|
|
456
|
+
if (i.style.height === "100%")
|
|
435
457
|
return;
|
|
436
|
-
|
|
458
|
+
i.style.height = "100%";
|
|
437
459
|
} else {
|
|
438
|
-
if (
|
|
460
|
+
if (i.style.height === "auto")
|
|
439
461
|
return;
|
|
440
|
-
|
|
462
|
+
i.style.height = "auto";
|
|
441
463
|
}
|
|
442
464
|
}
|
|
443
|
-
}, [
|
|
465
|
+
}, [p]), F(() => {
|
|
466
|
+
if (e)
|
|
467
|
+
return;
|
|
468
|
+
const t = () => {
|
|
469
|
+
const i = ((L == null ? void 0 : L.promptVariables) || []).filter(
|
|
470
|
+
(r) => r.key !== "query" && r.status === 1
|
|
471
|
+
// 只要求输入被引用的变量
|
|
472
|
+
).map((r, o) => {
|
|
473
|
+
var k, g;
|
|
474
|
+
let a = "";
|
|
475
|
+
return typeof (c == null ? void 0 : c.promptVariables) == "object" && (a = ((g = (k = c.promptVariables.default) == null ? void 0 : k.find((m) => m.key === r.key)) == null ? void 0 : g.value) || ""), {
|
|
476
|
+
id: o + "",
|
|
477
|
+
key: r.key,
|
|
478
|
+
name: r.name,
|
|
479
|
+
value: a
|
|
480
|
+
};
|
|
481
|
+
});
|
|
482
|
+
ie([...i].sort((r, o) => r.key.localeCompare(o.key)));
|
|
483
|
+
};
|
|
484
|
+
return L != null && L.ready ? t() : L == null || L.addEventListener("ready", t), () => {
|
|
485
|
+
L == null || L.removeEventListener("ready", t);
|
|
486
|
+
};
|
|
487
|
+
}, [e, L, c == null ? void 0 : c.promptVariables]), /* @__PURE__ */ q("div", {
|
|
444
488
|
className: "agent-chat",
|
|
445
|
-
children: [/* @__PURE__ */ d(
|
|
446
|
-
ref:
|
|
447
|
-
appId:
|
|
489
|
+
children: [(f == null ? void 0 : f.promptVariables) && /* @__PURE__ */ d(dn, {
|
|
490
|
+
ref: Pe,
|
|
491
|
+
appId: s.id,
|
|
448
492
|
currentSession: e,
|
|
449
493
|
promptVariables: E,
|
|
450
|
-
setPromptVariables:
|
|
451
|
-
|
|
494
|
+
setPromptVariables: ie,
|
|
495
|
+
setCurrentSession: v
|
|
496
|
+
}), /* @__PURE__ */ q("div", {
|
|
452
497
|
className: "chat-main",
|
|
453
498
|
id: "chat-main",
|
|
454
|
-
style:
|
|
499
|
+
style: it,
|
|
455
500
|
children: [/* @__PURE__ */ d("div", {
|
|
456
501
|
className: "chat-main-wrapper",
|
|
457
502
|
id: "scrollableDiv",
|
|
@@ -461,100 +506,100 @@ ${t}` : t;
|
|
|
461
506
|
display: "flex",
|
|
462
507
|
flexDirection: "column-reverse"
|
|
463
508
|
},
|
|
464
|
-
ref:
|
|
465
|
-
onScroll:
|
|
466
|
-
children: (
|
|
467
|
-
dataLength:
|
|
468
|
-
next:
|
|
509
|
+
ref: T,
|
|
510
|
+
onScroll: Tt,
|
|
511
|
+
children: (Ae = e == null ? void 0 : e.data) != null && Ae.id && (p != null && p.length) ? /* @__PURE__ */ d(fn, {
|
|
512
|
+
dataLength: p.length,
|
|
513
|
+
next: Dt,
|
|
469
514
|
style: {
|
|
470
515
|
display: "flex",
|
|
471
516
|
flexDirection: "column-reverse",
|
|
472
517
|
overflowX: "hidden"
|
|
473
518
|
},
|
|
474
519
|
inverse: !0,
|
|
475
|
-
endMessage:
|
|
476
|
-
((
|
|
520
|
+
endMessage: p.length > Je && // 少于一页不展示这个提示
|
|
521
|
+
((Be = T.current) != null && Be.scrollTop) && (($e = T.current) == null ? void 0 : $e.scrollTop) < -10 ? /* @__PURE__ */ d($t, {
|
|
477
522
|
plain: !0,
|
|
478
523
|
children: "没有更多数据了"
|
|
479
524
|
}) : null,
|
|
480
|
-
hasMore:
|
|
525
|
+
hasMore: wt,
|
|
481
526
|
loader: /* @__PURE__ */ d("div", {
|
|
482
527
|
style: {
|
|
483
528
|
height: "50px",
|
|
484
529
|
textAlign: "center",
|
|
485
530
|
overflow: "hidden"
|
|
486
531
|
},
|
|
487
|
-
children: /* @__PURE__ */ d(
|
|
532
|
+
children: /* @__PURE__ */ d(qt, {})
|
|
488
533
|
}),
|
|
489
534
|
scrollableTarget: "scrollableDiv",
|
|
490
|
-
children:
|
|
491
|
-
application:
|
|
535
|
+
children: p.map((t, n) => /* @__PURE__ */ d(hn, {
|
|
536
|
+
application: s,
|
|
492
537
|
currentSession: e,
|
|
493
538
|
history: t,
|
|
494
|
-
docViewerUrl:
|
|
495
|
-
isLastHistory:
|
|
496
|
-
onRelatedClick:
|
|
497
|
-
onAgainClick:
|
|
498
|
-
onEditClick:
|
|
499
|
-
}, t.messageId +
|
|
539
|
+
docViewerUrl: y,
|
|
540
|
+
isLastHistory: n === 0,
|
|
541
|
+
onRelatedClick: Rt,
|
|
542
|
+
onAgainClick: Ot,
|
|
543
|
+
onEditClick: Pt
|
|
544
|
+
}, t.messageId + n))
|
|
500
545
|
}) : /* @__PURE__ */ d("div", {
|
|
501
546
|
className: "main-empty",
|
|
502
|
-
children: /* @__PURE__ */ d(
|
|
503
|
-
children: !!
|
|
504
|
-
ref:
|
|
505
|
-
sid: (
|
|
506
|
-
isRecommendClearing:
|
|
507
|
-
data:
|
|
547
|
+
children: /* @__PURE__ */ d(nn, ke(ve({}, gn), {
|
|
548
|
+
children: !!Fe.length && /* @__PURE__ */ d(tn, {
|
|
549
|
+
ref: pe,
|
|
550
|
+
sid: (qe = e == null ? void 0 : e.data) == null ? void 0 : qe.id,
|
|
551
|
+
isRecommendClearing: Ee,
|
|
552
|
+
data: Fe,
|
|
508
553
|
onItemClick: (t) => {
|
|
509
|
-
var
|
|
510
|
-
if (
|
|
554
|
+
var l, i, r;
|
|
555
|
+
if (G(t == null ? void 0 : t.question), B(t == null ? void 0 : t.question), Ee)
|
|
511
556
|
return;
|
|
512
|
-
t != null && t.id &&
|
|
513
|
-
const
|
|
514
|
-
(r = (
|
|
515
|
-
var
|
|
516
|
-
t != null && t.id && (
|
|
517
|
-
|
|
518
|
-
}) : (
|
|
519
|
-
netOpen:
|
|
520
|
-
}).then((
|
|
521
|
-
var
|
|
522
|
-
|
|
523
|
-
const
|
|
524
|
-
|
|
557
|
+
t != null && t.id && fe(!0);
|
|
558
|
+
const n = (l = e == null ? void 0 : e.data) == null ? void 0 : l.id;
|
|
559
|
+
(r = (i = te.current) == null ? void 0 : i.clear()) == null || r.then(() => {
|
|
560
|
+
var o;
|
|
561
|
+
t != null && t.id && (n ? (o = Ve(n, t)) == null || o.finally(() => {
|
|
562
|
+
fe(!1);
|
|
563
|
+
}) : (fe(!1), z(!0), w == null || w({
|
|
564
|
+
netOpen: O ? 1 : 2
|
|
565
|
+
}).then((a) => {
|
|
566
|
+
var g, m, N;
|
|
567
|
+
v == null || v(a), z(!1), b(!!((g = a.data) != null && g.netOpen)), $(!!((m = a.data) != null && m.enableNetOpen));
|
|
568
|
+
const k = ((N = a.data) == null ? void 0 : N.id) || "";
|
|
569
|
+
Ve(k, t);
|
|
525
570
|
})));
|
|
526
571
|
});
|
|
527
572
|
}
|
|
528
573
|
})
|
|
529
574
|
}))
|
|
530
575
|
})
|
|
531
|
-
}),
|
|
576
|
+
}), Oe && /* @__PURE__ */ d("div", {
|
|
532
577
|
className: "session-stop",
|
|
533
|
-
children: /* @__PURE__ */ d(
|
|
578
|
+
children: /* @__PURE__ */ d(K, {
|
|
534
579
|
type: "primary",
|
|
535
580
|
style: {
|
|
536
581
|
background: "white"
|
|
537
582
|
},
|
|
538
583
|
ghost: !0,
|
|
539
584
|
size: "small",
|
|
540
|
-
icon: /* @__PURE__ */ d(
|
|
585
|
+
icon: /* @__PURE__ */ d(we, {
|
|
541
586
|
type: "icon-zantinghuida",
|
|
542
587
|
style: {
|
|
543
588
|
fontSize: 16
|
|
544
589
|
}
|
|
545
590
|
}),
|
|
546
|
-
onClick: () =>
|
|
591
|
+
onClick: () => Ft(),
|
|
547
592
|
children: "停止回答"
|
|
548
593
|
})
|
|
549
|
-
}),
|
|
594
|
+
}), De && (p == null ? void 0 : p.length) > 0 && /* @__PURE__ */ d("div", {
|
|
550
595
|
className: "back-bottom",
|
|
551
|
-
children: /* @__PURE__ */ d(
|
|
596
|
+
children: /* @__PURE__ */ d(K, {
|
|
552
597
|
size: "small",
|
|
553
|
-
onClick: () =>
|
|
598
|
+
onClick: () => Et({
|
|
554
599
|
behavior: "smooth"
|
|
555
600
|
}),
|
|
556
601
|
type: "link",
|
|
557
|
-
icon: /* @__PURE__ */ d(
|
|
602
|
+
icon: /* @__PURE__ */ d(we, {
|
|
558
603
|
type: "icon-yijianhuidaodibu",
|
|
559
604
|
style: {
|
|
560
605
|
fontSize: 24
|
|
@@ -564,32 +609,32 @@ ${t}` : t;
|
|
|
564
609
|
})]
|
|
565
610
|
}), /* @__PURE__ */ d("div", {
|
|
566
611
|
className: "chat-footer",
|
|
567
|
-
children: /* @__PURE__ */
|
|
612
|
+
children: /* @__PURE__ */ q("div", {
|
|
568
613
|
className: "chat-footer-input",
|
|
569
|
-
children: [
|
|
614
|
+
children: [Q && /* @__PURE__ */ d("div", {
|
|
570
615
|
className: "input-files",
|
|
571
|
-
children: /* @__PURE__ */ d(
|
|
572
|
-
file:
|
|
616
|
+
children: /* @__PURE__ */ d(Jt, {
|
|
617
|
+
file: Q,
|
|
573
618
|
actions: {
|
|
574
619
|
upload: Ct,
|
|
575
620
|
remove: () => {
|
|
576
|
-
|
|
621
|
+
A(void 0);
|
|
577
622
|
}
|
|
578
623
|
},
|
|
579
|
-
onUrlChange: (t) =>
|
|
624
|
+
onUrlChange: (t) => S(t)
|
|
580
625
|
})
|
|
581
|
-
}), /* @__PURE__ */
|
|
626
|
+
}), /* @__PURE__ */ q(oe, {
|
|
582
627
|
className: "footer-upload-action",
|
|
583
628
|
onClick: (t) => t.preventDefault(),
|
|
584
|
-
children: [/* @__PURE__ */
|
|
585
|
-
children: [
|
|
586
|
-
disabled: !!
|
|
629
|
+
children: [/* @__PURE__ */ q(oe, {
|
|
630
|
+
children: [s.type === 2 && (f == null ? void 0 : f.imageUpload) && /* @__PURE__ */ d(Kt, {
|
|
631
|
+
disabled: !!Q || D,
|
|
587
632
|
accept: ".jpg, .png, .jpeg,.bmp",
|
|
588
633
|
listType: "picture-card",
|
|
589
|
-
beforeUpload:
|
|
634
|
+
beforeUpload: Nt,
|
|
590
635
|
className: "footer-upload-picture",
|
|
591
636
|
showUploadList: !1,
|
|
592
|
-
children:
|
|
637
|
+
children: Q ? /* @__PURE__ */ d(K, {
|
|
593
638
|
type: "text",
|
|
594
639
|
className: "camera-out-btn",
|
|
595
640
|
style: {
|
|
@@ -597,20 +642,20 @@ ${t}` : t;
|
|
|
597
642
|
position: "relative",
|
|
598
643
|
bottom: "-2px"
|
|
599
644
|
},
|
|
600
|
-
disabled: !!
|
|
645
|
+
disabled: !!Q || D,
|
|
601
646
|
icon: /* @__PURE__ */ d(Ze, {
|
|
602
647
|
className: "icon-tianjia",
|
|
603
648
|
style: {
|
|
604
649
|
fontSize: "22px"
|
|
605
650
|
}
|
|
606
651
|
})
|
|
607
|
-
}) : /* @__PURE__ */ d(
|
|
652
|
+
}) : /* @__PURE__ */ d(Wt, {
|
|
608
653
|
placement: "topLeft",
|
|
609
654
|
overlayClassName: "footer-upload-tooltip",
|
|
610
655
|
title: /* @__PURE__ */ d("div", {
|
|
611
656
|
children: "支持上传.jpg .png .jpeg .bmp格式的图片数据,最大20M,单次仅可上传1个"
|
|
612
657
|
}),
|
|
613
|
-
children: /* @__PURE__ */ d(
|
|
658
|
+
children: /* @__PURE__ */ d(K, {
|
|
614
659
|
type: "text",
|
|
615
660
|
className: "camera-out-btn",
|
|
616
661
|
style: {
|
|
@@ -626,126 +671,130 @@ ${t}` : t;
|
|
|
626
671
|
})
|
|
627
672
|
})
|
|
628
673
|
})
|
|
629
|
-
}),
|
|
630
|
-
appId:
|
|
631
|
-
ref:
|
|
674
|
+
}), se && (f != null && f.fileUpload) && (s != null && s.id) ? /* @__PURE__ */ d(rn, {
|
|
675
|
+
appId: s == null ? void 0 : s.id,
|
|
676
|
+
ref: te,
|
|
632
677
|
isFirstSession: He,
|
|
633
|
-
docViewerUrl:
|
|
678
|
+
docViewerUrl: y,
|
|
634
679
|
onStatusChange: (t) => j(void 0, null, function* () {
|
|
635
|
-
t !== "process" ? (
|
|
680
|
+
t !== "process" ? (ne(!0), me()) : ne(!1);
|
|
636
681
|
}),
|
|
637
682
|
createSession: () => new Promise((t) => {
|
|
638
|
-
|
|
639
|
-
netOpen:
|
|
640
|
-
}).then((
|
|
641
|
-
var
|
|
642
|
-
|
|
643
|
-
const
|
|
644
|
-
t(
|
|
683
|
+
z(!0), w == null || w({
|
|
684
|
+
netOpen: O ? 1 : 2
|
|
685
|
+
}).then((n) => {
|
|
686
|
+
var i, r, o;
|
|
687
|
+
v == null || v(n), z(!1), b(!!((i = n.data) != null && i.netOpen)), $(!!((r = n.data) != null && r.enableNetOpen));
|
|
688
|
+
const l = ((o = n.data) == null ? void 0 : o.id) || "";
|
|
689
|
+
t(l);
|
|
645
690
|
});
|
|
646
691
|
}),
|
|
647
692
|
sid: (Ke = e == null ? void 0 : e.data) == null ? void 0 : Ke.id,
|
|
648
|
-
disabled:
|
|
649
|
-
afterFileAdd: (t,
|
|
650
|
-
|
|
651
|
-
const
|
|
693
|
+
disabled: he || D,
|
|
694
|
+
afterFileAdd: (t, n) => {
|
|
695
|
+
n && ee((l) => {
|
|
696
|
+
const i = l[n] || [];
|
|
652
697
|
return {
|
|
653
|
-
[
|
|
698
|
+
[n]: [...i, t]
|
|
654
699
|
};
|
|
655
700
|
});
|
|
656
701
|
},
|
|
657
702
|
afterFileDelete: (t) => {
|
|
658
|
-
var
|
|
659
|
-
const
|
|
660
|
-
|
|
661
|
-
const r =
|
|
703
|
+
var l;
|
|
704
|
+
const n = (l = e == null ? void 0 : e.data) == null ? void 0 : l.id;
|
|
705
|
+
n && ee((i) => {
|
|
706
|
+
const r = i[n] || [];
|
|
662
707
|
return {
|
|
663
|
-
[
|
|
708
|
+
[n]: r.filter((o) => o.id !== t)
|
|
664
709
|
};
|
|
665
710
|
});
|
|
666
711
|
},
|
|
667
712
|
onFileListChange: (t) => {
|
|
668
|
-
|
|
713
|
+
pt(t);
|
|
669
714
|
},
|
|
670
715
|
shouldContinue: gt,
|
|
671
716
|
afterFilesClear: () => {
|
|
672
|
-
var
|
|
673
|
-
const t = (
|
|
674
|
-
t && (
|
|
717
|
+
var n;
|
|
718
|
+
const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
|
|
719
|
+
t && (ee({
|
|
675
720
|
[t]: []
|
|
676
|
-
}),
|
|
721
|
+
}), me());
|
|
677
722
|
}
|
|
678
|
-
}) : null, (
|
|
679
|
-
appId:
|
|
723
|
+
}) : null, (f == null ? void 0 : f.prompt) && (s == null ? void 0 : s.id) && /* @__PURE__ */ d(on, {
|
|
724
|
+
appId: s.id,
|
|
680
725
|
list: [],
|
|
681
|
-
search:
|
|
726
|
+
search: Te ? at : "",
|
|
682
727
|
onPromptSelect: (t) => {
|
|
683
|
-
|
|
684
|
-
}
|
|
728
|
+
B(t.context), G(t.context);
|
|
729
|
+
},
|
|
730
|
+
disabled: D
|
|
685
731
|
})]
|
|
686
|
-
}), /* @__PURE__ */
|
|
687
|
-
children: [(
|
|
688
|
-
sessionId: (
|
|
689
|
-
netStatus:
|
|
690
|
-
enable:
|
|
732
|
+
}), /* @__PURE__ */ q(oe, {
|
|
733
|
+
children: [(f == null ? void 0 : f.connectNetwork) && s.type === 0 && ((We = s.arrange) == null ? void 0 : We.length) && !!s.arrange[0].enableNetOpen && /* @__PURE__ */ d(un, {
|
|
734
|
+
sessionId: (Qe = e == null ? void 0 : e.data) == null ? void 0 : Qe.id,
|
|
735
|
+
netStatus: O,
|
|
736
|
+
enable: typeof (c == null ? void 0 : c.connectNetwork) == "object" && typeof (c == null ? void 0 : c.connectNetwork.diabled) == "boolean" ? !(c != null && c.connectNetwork.diabled) : bt,
|
|
737
|
+
disabledTip: e ? void 0 : "网络访问已被禁用",
|
|
691
738
|
onNetStatusChange: (t) => {
|
|
692
|
-
|
|
693
|
-
}
|
|
694
|
-
}), (v == null ? void 0 : v.sessionList) && /* @__PURE__ */ d(li, {
|
|
695
|
-
currentSessionId: (_e = e == null ? void 0 : e.data) == null ? void 0 : _e.id,
|
|
696
|
-
onSessionChange: (t, i) => {
|
|
697
|
-
U(void 0), g == null || g(i);
|
|
739
|
+
Ht(t);
|
|
698
740
|
}
|
|
699
|
-
}), (
|
|
700
|
-
|
|
741
|
+
}), (f == null ? void 0 : f.sessionList) && /* @__PURE__ */ d(cn, {
|
|
742
|
+
currentSessionId: (Ye = e == null ? void 0 : e.data) == null ? void 0 : Ye.id,
|
|
743
|
+
onSessionChange: (t, n) => {
|
|
744
|
+
B(void 0), v == null || v(n);
|
|
745
|
+
},
|
|
746
|
+
disabled: D
|
|
747
|
+
}), (f == null ? void 0 : f.sessionOpen) && /* @__PURE__ */ d(K, {
|
|
748
|
+
icon: /* @__PURE__ */ d(ln, {}),
|
|
701
749
|
className: "add-btn",
|
|
702
750
|
type: "primary",
|
|
703
|
-
disabled:
|
|
751
|
+
disabled: Oe || !e || !p.length || D,
|
|
704
752
|
onClick: () => {
|
|
705
|
-
var t,
|
|
706
|
-
|
|
753
|
+
var t, n;
|
|
754
|
+
v == null || v(void 0), b(!1), (t = Pe.current) == null || t.clear(), (n = pe.current) == null || n.clear();
|
|
707
755
|
},
|
|
708
756
|
children: "新会话"
|
|
709
757
|
})]
|
|
710
758
|
})]
|
|
711
759
|
}), /* @__PURE__ */ d("div", {
|
|
712
760
|
className: "footer-textarea",
|
|
713
|
-
children: /* @__PURE__ */ d(
|
|
714
|
-
ref:
|
|
761
|
+
children: /* @__PURE__ */ d(en, {
|
|
762
|
+
ref: ce,
|
|
715
763
|
maxLength: ot,
|
|
716
764
|
text: ct,
|
|
717
765
|
networkStatus: !1,
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
766
|
+
loading: Me,
|
|
767
|
+
disabled: Le || Ce || D || Me,
|
|
768
|
+
onTextSend: Ue,
|
|
769
|
+
onChange: (t, n) => {
|
|
770
|
+
B(t);
|
|
771
|
+
const l = n.getText().replace(/[\n\s]+$/, "");
|
|
772
|
+
G(l), dt(l), Te || rt(!0);
|
|
724
773
|
},
|
|
725
|
-
clearAction: /* @__PURE__ */ d(
|
|
774
|
+
clearAction: /* @__PURE__ */ d(oe, {
|
|
726
775
|
size: 0,
|
|
727
|
-
children: /* @__PURE__ */ d(
|
|
776
|
+
children: /* @__PURE__ */ d(K, {
|
|
728
777
|
type: "link",
|
|
729
|
-
disabled:
|
|
778
|
+
disabled: he || D,
|
|
730
779
|
ghost: !0,
|
|
731
|
-
icon: /* @__PURE__ */ d(
|
|
780
|
+
icon: /* @__PURE__ */ d(we, {
|
|
732
781
|
style: {
|
|
733
782
|
fontSize: 22
|
|
734
783
|
},
|
|
735
784
|
type: "icon-qingchujiyi"
|
|
736
785
|
}),
|
|
737
|
-
onClick: () =>
|
|
786
|
+
onClick: () => xt()
|
|
738
787
|
})
|
|
739
788
|
})
|
|
740
789
|
})
|
|
741
790
|
})]
|
|
742
791
|
})
|
|
743
|
-
}), /* @__PURE__ */ d(
|
|
744
|
-
tips:
|
|
745
|
-
}),
|
|
746
|
-
isvisible:
|
|
747
|
-
files:
|
|
748
|
-
sessionId: (
|
|
792
|
+
}), /* @__PURE__ */ d(sn, {
|
|
793
|
+
tips: nt
|
|
794
|
+
}), Re && /* @__PURE__ */ d(an, {
|
|
795
|
+
isvisible: Re,
|
|
796
|
+
files: ut,
|
|
797
|
+
sessionId: (_e = e == null ? void 0 : e.data) == null ? void 0 : _e.id,
|
|
749
798
|
onClose: (t) => {
|
|
750
799
|
ft(!1), mt(!1);
|
|
751
800
|
}
|
|
@@ -753,5 +802,5 @@ ${t}` : t;
|
|
|
753
802
|
});
|
|
754
803
|
};
|
|
755
804
|
export {
|
|
756
|
-
|
|
805
|
+
Kn as default
|
|
757
806
|
};
|