@glodon-aiot/agent-cli-ui 3.4.0 → 3.4.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.mjs +33 -32
- package/dist/es/Dialog/AgentChat/index.mjs +243 -236
- package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
- package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
- package/dist/es/src/style11.css +1 -1
- package/dist/es/src/style12.css +1 -1
- package/dist/es/src/style13.css +1 -1
- package/dist/es/src/style14.css +1 -1
- package/dist/es/src/style15.css +1 -1
- package/dist/es/src/style16.css +1 -1
- package/dist/es/src/style17.css +1 -1
- package/dist/es/src/style18.css +1 -1
- package/dist/es/src/style19.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style21.css +1 -1
- package/dist/es/src/style23.css +1 -1
- package/dist/es/src/style24.css +1 -1
- package/dist/es/src/style25.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style28.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style31.css +1 -1
- package/dist/es/src/style32.css +1 -1
- package/dist/es/src/style33.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style8.css +1 -1
- package/dist/lib/index.js +55 -55
- package/dist/src/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var ln = Object.defineProperty, dn = Object.defineProperties;
|
|
2
|
+
var cn = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var ct = Object.getOwnPropertySymbols;
|
|
4
|
+
var fn = Object.prototype.hasOwnProperty, gn = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Ee = (x, k, o) => k in x ? ln(x, k, { enumerable: !0, configurable: !0, writable: !0, value: o }) : x[k] = o, ft = (x, k) => {
|
|
6
6
|
for (var o in k || (k = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var o of
|
|
10
|
-
|
|
7
|
+
fn.call(k, o) && Ee(x, o, k[o]);
|
|
8
|
+
if (ct)
|
|
9
|
+
for (var o of ct(k))
|
|
10
|
+
gn.call(k, o) && Ee(x, o, k[o]);
|
|
11
11
|
return x;
|
|
12
|
-
},
|
|
13
|
-
var D = (x, k, o) => (
|
|
14
|
-
var j = (x, k, o) => new Promise((
|
|
12
|
+
}, gt = (x, k) => dn(x, cn(k));
|
|
13
|
+
var D = (x, k, o) => (Ee(x, typeof k != "symbol" ? k + "" : k, o), o);
|
|
14
|
+
var j = (x, k, o) => new Promise((Y, e) => {
|
|
15
15
|
var L = (E) => {
|
|
16
16
|
try {
|
|
17
17
|
p(o.next(E));
|
|
@@ -24,43 +24,43 @@ var j = (x, k, o) => new Promise(($, e) => {
|
|
|
24
24
|
} catch (P) {
|
|
25
25
|
e(P);
|
|
26
26
|
}
|
|
27
|
-
}, p = (E) => E.done ?
|
|
27
|
+
}, p = (E) => E.done ? Y(E.value) : Promise.resolve(E.value).then(L, pe);
|
|
28
28
|
p((o = o.apply(x, k)).next());
|
|
29
29
|
});
|
|
30
|
-
import { jsx as c, jsxs as z, Fragment as
|
|
31
|
-
import { memo as
|
|
32
|
-
/* empty css */import { Spin as
|
|
30
|
+
import { jsx as c, jsxs as z, Fragment as un } from "react/jsx-runtime";
|
|
31
|
+
import { memo as hn, forwardRef as mn, useState as h, useRef as K, useContext as yn, useEffect as C, useMemo as pn, useImperativeHandle as vn } from "react";
|
|
32
|
+
/* empty css */import { Spin as ut, Divider as kn, Button as W, Space as he, Upload as wn, Tooltip as bn, Popover as xn, notification as me, message as u } from "antd";
|
|
33
33
|
import ne from "../../components/Iconfont/index.mjs";
|
|
34
|
-
import { IHistoryRole as J, ChatMessageRole as
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import { v4 as
|
|
38
|
-
import
|
|
39
|
-
import { configuration as
|
|
40
|
-
import { NET_OPEN_STATUS as
|
|
41
|
-
import
|
|
42
|
-
import { getImageExtension as
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import { CameraOutlined as
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import { useMemoizedFn as
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
const
|
|
59
|
-
icon:
|
|
34
|
+
import { IHistoryRole as J, ChatMessageRole as ht, PromptVariableType as ye } from "@glodon-aiot/apis";
|
|
35
|
+
import pt from "./HistoryItem/index.mjs";
|
|
36
|
+
import vt from "dayjs";
|
|
37
|
+
import { v4 as Te } from "uuid";
|
|
38
|
+
import In from "../../context.mjs";
|
|
39
|
+
import { configuration as Nn } from "@glodon-aiot/bot-client-sdk";
|
|
40
|
+
import { NET_OPEN_STATUS as $, MB as Cn } from "../../constant.mjs";
|
|
41
|
+
import Ln from "../../components/FilePreview/index.mjs";
|
|
42
|
+
import { getImageExtension as En } from "../../utils/index.mjs";
|
|
43
|
+
import Pn from "../../QuillEditor/index.mjs";
|
|
44
|
+
import Tn from "../../components/Recommend/index.mjs";
|
|
45
|
+
import Fn from "../../components/Greeting/index.mjs";
|
|
46
|
+
import On from "../../Footer/index.mjs";
|
|
47
|
+
import { CameraOutlined as Hn, PlusOutlined as Rn } from "@ant-design/icons";
|
|
48
|
+
import Dn from "./Tools/UploadKnowledgeFiles/index.mjs";
|
|
49
|
+
import Un from "../UploadingPrompt/index.mjs";
|
|
50
|
+
import Mn from "./PromptSetting/index.mjs";
|
|
51
|
+
import { useMemoizedFn as Pe } from "ahooks";
|
|
52
|
+
import jn from "./Tools/SessionListDrawer/index.mjs";
|
|
53
|
+
import zn from "./Tools/SessionHistoryDrawer/index.mjs";
|
|
54
|
+
import Vn from "react-infinite-scroll-component";
|
|
55
|
+
import An from "./Tools/ConnectToNetwork/index.mjs";
|
|
56
|
+
import qn from "./Tools/PromptManager/index.mjs";
|
|
57
|
+
import Bn from "../../assets/icon.svg.mjs";
|
|
58
|
+
const $n = hn(pt), mt = {
|
|
59
|
+
icon: Bn,
|
|
60
60
|
text: "今天我能帮你什么?"
|
|
61
61
|
};
|
|
62
62
|
class ie {
|
|
63
|
-
constructor(k, o,
|
|
63
|
+
constructor(k, o, Y, e) {
|
|
64
64
|
D(this, "messageTime");
|
|
65
65
|
D(this, "isWaiting");
|
|
66
66
|
D(this, "messageId");
|
|
@@ -70,55 +70,59 @@ class ie {
|
|
|
70
70
|
D(this, "isSensitive");
|
|
71
71
|
D(this, "isSuspend");
|
|
72
72
|
D(this, "comment");
|
|
73
|
-
this.content = k, this.sessionId = o, this.role =
|
|
73
|
+
this.content = k, this.sessionId = o, this.role = Y, this.files = e, this.content = k, this.role = Y, this.sessionId = o, this.files = e, this.messageTime = vt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = Te(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
|
|
74
74
|
isAgree: 0
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
const
|
|
79
|
-
var
|
|
78
|
+
const yt = 10, wi = mn((x, k) => {
|
|
79
|
+
var Se, et, tt, nt, it, ot, st, rt, at, lt, dt;
|
|
80
80
|
const {
|
|
81
81
|
application: o,
|
|
82
|
-
docViewerUrl:
|
|
82
|
+
docViewerUrl: Y = "",
|
|
83
83
|
currentSession: e,
|
|
84
84
|
onCreateSession: L,
|
|
85
85
|
embeddingService: pe,
|
|
86
86
|
setCurrentSession: p,
|
|
87
87
|
networkStatus: E,
|
|
88
88
|
setNetworkStatus: P,
|
|
89
|
-
sessions:
|
|
89
|
+
sessions: kt,
|
|
90
90
|
// 👈 新增
|
|
91
|
-
setSessions:
|
|
91
|
+
setSessions: wt
|
|
92
92
|
// 👈 新增
|
|
93
|
-
} = x, [v, I] = h([]), [bt, oe] = h(), [ve,
|
|
93
|
+
} = x, [v, I] = h([]), [bt, oe] = h(), [ve, Fe] = h(), H = K(null), {
|
|
94
94
|
service: T,
|
|
95
95
|
agentClient: N,
|
|
96
|
-
depId:
|
|
97
|
-
footer:
|
|
96
|
+
depId: xt,
|
|
97
|
+
footer: It,
|
|
98
98
|
transform: g,
|
|
99
99
|
defaultInput: ke,
|
|
100
100
|
onMessage: se,
|
|
101
|
-
onHistoryLoad:
|
|
101
|
+
onHistoryLoad: Oe,
|
|
102
102
|
beforeMessageSend: V,
|
|
103
|
-
bodyStyle:
|
|
103
|
+
bodyStyle: Nt,
|
|
104
104
|
disabled: R,
|
|
105
105
|
features: s,
|
|
106
106
|
popupContainer: f,
|
|
107
|
-
icon:
|
|
108
|
-
sider:
|
|
109
|
-
mode:
|
|
110
|
-
} =
|
|
107
|
+
icon: Ct,
|
|
108
|
+
sider: Lt,
|
|
109
|
+
mode: Et
|
|
110
|
+
} = yn(In), [He, we] = h(!1), m = K(v), Re = K(void 0), [Pt, Tt] = h(0), [S, Q] = h(), [_, re] = h(""), [De, be] = h(!1), ae = K(null), [Ue, Ft] = h([]), [Me, G] = h(!1), [je, Ot] = h(!1), [Ht, Rt] = h(""), [Dt, X] = h(), [le, de] = h({}), ce = K(null), ze = K(null), xe = K(null), [Ve, Ut] = h(!1), [Mt, jt] = h([]), [zt, fe] = h(!0), [Vt, At] = h(!0), [Ae, U] = h(!1), [Ie, A] = h(!1), [qe, qt] = h(!1), [O, ge] = h(typeof (s == null ? void 0 : s.promptVariables) == "object" ? s.promptVariables.default || [] : []), [Bt, $t] = h(typeof (s == null ? void 0 : s.knowledges) == "object" && s.knowledges.default || void 0), [Be, M] = h(!1), [$e, ee] = h(!1), [Yt, Z] = h(typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.default) == "boolean" ? s.connectNetwork.default : !1), [Ye, ue] = h(!1), [Kt, q] = h(!1), [Wt, Qt] = h(null), [Ke, We] = h(!1), [_t, Ne] = h(!1);
|
|
111
111
|
C(() => {
|
|
112
|
-
if (
|
|
113
|
-
|
|
112
|
+
if (Qt(e), e === null)
|
|
113
|
+
q(!1);
|
|
114
114
|
else if (e === void 0)
|
|
115
|
-
|
|
115
|
+
q(!0);
|
|
116
116
|
else {
|
|
117
|
-
if (
|
|
118
|
-
|
|
117
|
+
if (Wt === null) {
|
|
118
|
+
if (_t) {
|
|
119
|
+
q(!0), Ne(!1);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
q(!1);
|
|
119
123
|
return;
|
|
120
124
|
}
|
|
121
|
-
e.ready ?
|
|
125
|
+
e.ready ? q(!1) : q(!0);
|
|
122
126
|
}
|
|
123
127
|
}, [e, e == null ? void 0 : e.ready]), C(() => {
|
|
124
128
|
var a, i;
|
|
@@ -130,11 +134,11 @@ const mt = 10, vi = un((x, k) => {
|
|
|
130
134
|
return;
|
|
131
135
|
if (A(!1), U(!1), (i = e.messages) != null && i.length) {
|
|
132
136
|
const r = [...e.messages.filter((d) => d == null ? void 0 : d.messageId)].reverse();
|
|
133
|
-
m.current = [...r], I([...r]),
|
|
137
|
+
m.current = [...r], I([...r]), q(!1);
|
|
134
138
|
}
|
|
135
139
|
const n = (l) => {
|
|
136
140
|
var r;
|
|
137
|
-
(r = e == null ? void 0 : e.data) != null && r.id && (m.current = [...l].reverse(), I([...l].reverse()), !l || l.length < 10 ? ee(!1) : ee(!0),
|
|
141
|
+
(r = e == null ? void 0 : e.data) != null && r.id && (m.current = [...l].reverse(), I([...l].reverse()), !l || l.length < 10 ? ee(!1) : ee(!0), q(!1), Oe && Oe({
|
|
138
142
|
applicationId: o.id,
|
|
139
143
|
sessionId: e.data.id,
|
|
140
144
|
histories: l
|
|
@@ -146,7 +150,7 @@ const mt = 10, vi = un((x, k) => {
|
|
|
146
150
|
}, [e]), C(() => {
|
|
147
151
|
const t = () => {
|
|
148
152
|
var n;
|
|
149
|
-
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ge(e.promptVariables.sort((a, i) => a.key.localeCompare(i.key))), e.knowledges &&
|
|
153
|
+
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ge(e.promptVariables.sort((a, i) => a.key.localeCompare(i.key))), e.knowledges && $t(e.knowledges), P(e.netOpen));
|
|
150
154
|
};
|
|
151
155
|
return e == null || e.addEventListener("data:updated", t), () => {
|
|
152
156
|
e == null || e.removeEventListener("data:updated", t);
|
|
@@ -169,7 +173,7 @@ const mt = 10, vi = un((x, k) => {
|
|
|
169
173
|
e == null || e.removeEventListener("error", t);
|
|
170
174
|
};
|
|
171
175
|
}, [e]);
|
|
172
|
-
const
|
|
176
|
+
const Gt = () => {
|
|
173
177
|
var a;
|
|
174
178
|
if (!((a = e == null ? void 0 : e.data) != null && a.id) || !(o != null && o.id))
|
|
175
179
|
return;
|
|
@@ -189,10 +193,10 @@ const mt = 10, vi = un((x, k) => {
|
|
|
189
193
|
};
|
|
190
194
|
C(() => {
|
|
191
195
|
o != null && o.id && (T == null || T.getRecommendQues(o.id).then((t) => {
|
|
192
|
-
|
|
196
|
+
Ft(t);
|
|
193
197
|
}));
|
|
194
|
-
}, [
|
|
195
|
-
const
|
|
198
|
+
}, [xt, o]);
|
|
199
|
+
const Qe = (t) => j(void 0, null, function* () {
|
|
196
200
|
var y, F;
|
|
197
201
|
if (R) {
|
|
198
202
|
u.config({
|
|
@@ -211,7 +215,7 @@ const mt = 10, vi = un((x, k) => {
|
|
|
211
215
|
});
|
|
212
216
|
return;
|
|
213
217
|
}
|
|
214
|
-
if (!(O == null ? void 0 : O.every((
|
|
218
|
+
if (!(O == null ? void 0 : O.every((w) => !!(w != null && w.value))))
|
|
215
219
|
if (g != null && g.promptVariables) {
|
|
216
220
|
u.config({
|
|
217
221
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
@@ -220,7 +224,7 @@ const mt = 10, vi = un((x, k) => {
|
|
|
220
224
|
});
|
|
221
225
|
return;
|
|
222
226
|
} else
|
|
223
|
-
console.error("变量值不能为空", O == null ? void 0 : O.map((
|
|
227
|
+
console.error("变量值不能为空", O == null ? void 0 : O.map((w) => !!(w != null && w.value)));
|
|
224
228
|
if (Ie) {
|
|
225
229
|
u.config({
|
|
226
230
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
@@ -229,7 +233,7 @@ const mt = 10, vi = un((x, k) => {
|
|
|
229
233
|
});
|
|
230
234
|
return;
|
|
231
235
|
}
|
|
232
|
-
if (
|
|
236
|
+
if (He) {
|
|
233
237
|
u.config({
|
|
234
238
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
235
239
|
}), u.error("等待初始化"), u.config({
|
|
@@ -237,7 +241,7 @@ const mt = 10, vi = un((x, k) => {
|
|
|
237
241
|
});
|
|
238
242
|
return;
|
|
239
243
|
}
|
|
240
|
-
if (!
|
|
244
|
+
if (!zt) {
|
|
241
245
|
u.config({
|
|
242
246
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
243
247
|
}), u.error("正在解析文件"), u.config({
|
|
@@ -245,7 +249,7 @@ const mt = 10, vi = un((x, k) => {
|
|
|
245
249
|
});
|
|
246
250
|
return;
|
|
247
251
|
}
|
|
248
|
-
if (
|
|
252
|
+
if (De) {
|
|
249
253
|
u.config({
|
|
250
254
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
251
255
|
}), u.error("正在上传图片"), u.config({
|
|
@@ -257,11 +261,11 @@ const mt = 10, vi = un((x, k) => {
|
|
|
257
261
|
const i = (y = e == null ? void 0 : e.data) == null ? void 0 : y.id;
|
|
258
262
|
if (!i) {
|
|
259
263
|
L == null || L({
|
|
260
|
-
netOpen: E ?
|
|
261
|
-
}).then((
|
|
262
|
-
var
|
|
263
|
-
M(!0), P(!!((
|
|
264
|
-
p == null || p(
|
|
264
|
+
netOpen: E ? $.OPEN : $.CLOSE
|
|
265
|
+
}).then((w) => {
|
|
266
|
+
var B, te;
|
|
267
|
+
M(!0), P(!!((B = w.data) != null && B.netOpen)), Z(!!((te = w.data) != null && te.enableNetOpen)), _e(w).then(() => {
|
|
268
|
+
p == null || p(w), M(!1), Fe(n);
|
|
265
269
|
});
|
|
266
270
|
});
|
|
267
271
|
return;
|
|
@@ -277,44 +281,44 @@ ${n}` : n;
|
|
|
277
281
|
message: {
|
|
278
282
|
content: l,
|
|
279
283
|
sessionId: i,
|
|
280
|
-
role:
|
|
284
|
+
role: ht.User,
|
|
281
285
|
files: le[i]
|
|
282
286
|
}
|
|
283
287
|
}) : r = !0;
|
|
284
|
-
} catch (
|
|
288
|
+
} catch (w) {
|
|
285
289
|
r = !1;
|
|
286
290
|
}
|
|
287
291
|
if (ue(!1), r === !1)
|
|
288
292
|
return;
|
|
289
293
|
let d = n;
|
|
290
|
-
typeof r == "object" && (d = r.content || n), (yield e.setPromptVariables(O)) && (((F = le[i]) == null ? void 0 : F.length) > 0 ?
|
|
291
|
-
}),
|
|
294
|
+
typeof r == "object" && (d = r.content || n), (yield e.setPromptVariables(O)) && (((F = le[i]) == null ? void 0 : F.length) > 0 ? Xt(d) : Ce(d));
|
|
295
|
+
}), _e = (t) => new Promise((n, a) => j(void 0, null, function* () {
|
|
292
296
|
const r = (t == null ? void 0 : t.promptVariables).filter((d) => d.type ? !((d.type === ye.User || d.type === void 0) && d.key === "query") && !((d.type === ye.System || d.type === void 0) && d.key === "datetime") : d.key !== "query").map((d) => {
|
|
293
297
|
var y;
|
|
294
|
-
const
|
|
295
|
-
return d.value =
|
|
298
|
+
const b = (y = O.find((F) => F.key === d.key && F.type === d.type)) == null ? void 0 : y.value;
|
|
299
|
+
return d.value = b || "", d;
|
|
296
300
|
});
|
|
297
|
-
ge(r.sort((d,
|
|
301
|
+
ge(r.sort((d, b) => d.key.localeCompare(b.key))), yield t == null ? void 0 : t.setPromptVariables(r).catch((d) => {
|
|
298
302
|
console.error(d), u.config({
|
|
299
303
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
300
304
|
}), u.error(d.message), u.config({
|
|
301
305
|
getContainer: void 0
|
|
302
306
|
});
|
|
303
307
|
}), n();
|
|
304
|
-
})),
|
|
305
|
-
var r, d,
|
|
308
|
+
})), Xt = (t) => {
|
|
309
|
+
var r, d, b;
|
|
306
310
|
if (fe(!1), !((r = e == null ? void 0 : e.data) != null && r.id) || !(o != null && o.id))
|
|
307
311
|
return;
|
|
308
312
|
const n = ((d = e.data) == null ? void 0 : d.id) || "", a = [];
|
|
309
313
|
let i = [], l = /* @__PURE__ */ new Set();
|
|
310
|
-
(
|
|
314
|
+
(b = le[n]) == null || b.forEach((y) => {
|
|
311
315
|
l.has(y.id) || (i.push(y), l.add(y.id));
|
|
312
316
|
}), Promise.all(i.map((y) => T == null ? void 0 : T.patchApplicationIdKnowledgeIdFileId(o == null ? void 0 : o.id, n, y.id, {
|
|
313
317
|
enabled: 1
|
|
314
318
|
}).then((F) => {
|
|
315
319
|
a.push(y);
|
|
316
320
|
}))).then((y) => {
|
|
317
|
-
fe(!0),
|
|
321
|
+
fe(!0), Ce(t, a);
|
|
318
322
|
}).catch((y) => {
|
|
319
323
|
throw Error(y);
|
|
320
324
|
});
|
|
@@ -334,20 +338,20 @@ ${t}` : t;
|
|
|
334
338
|
message: {
|
|
335
339
|
content: a,
|
|
336
340
|
sessionId: e.id,
|
|
337
|
-
role:
|
|
341
|
+
role: ht.User,
|
|
338
342
|
files: le[e.id]
|
|
339
343
|
}
|
|
340
344
|
}) : i = !0;
|
|
341
345
|
} catch (l) {
|
|
342
346
|
i = !1;
|
|
343
347
|
}
|
|
344
|
-
ue(!1), i !== !1 && (
|
|
348
|
+
ue(!1), i !== !1 && (Ce(t), Fe(void 0));
|
|
345
349
|
});
|
|
346
350
|
return e.ready ? n() : e.addEventListener("ready", n, !0), () => {
|
|
347
351
|
e == null || e.removeEventListener("ready", n);
|
|
348
352
|
};
|
|
349
353
|
}, [ve, e]);
|
|
350
|
-
const
|
|
354
|
+
const Ce = (t, n) => j(void 0, null, function* () {
|
|
351
355
|
var y, F;
|
|
352
356
|
const a = (y = e == null ? void 0 : e.data) == null ? void 0 : y.id;
|
|
353
357
|
if (!a)
|
|
@@ -362,23 +366,23 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
362
366
|
});
|
|
363
367
|
const r = new ie("", a, J.System);
|
|
364
368
|
r.isWaiting = !0, m.current = [r, ...m.current], I(m.current);
|
|
365
|
-
const d = (n == null ? void 0 : n.map((
|
|
366
|
-
stream:
|
|
369
|
+
const d = (n == null ? void 0 : n.map((w) => w.id)) || [], b = {
|
|
370
|
+
stream: Nn.stream,
|
|
367
371
|
referenceFirst: !1
|
|
368
372
|
};
|
|
369
373
|
if (g != null && g.promptVariables) {
|
|
370
|
-
const
|
|
371
|
-
|
|
374
|
+
const w = O == null ? void 0 : O.reduce((B, te) => (B[te.key] = te.value, B), {});
|
|
375
|
+
b.formatValues = w;
|
|
372
376
|
}
|
|
373
377
|
if (g != null && g.knowledges) {
|
|
374
|
-
const
|
|
375
|
-
|
|
378
|
+
const w = Bt;
|
|
379
|
+
b.knowledges = w;
|
|
376
380
|
}
|
|
377
381
|
yield e.send({
|
|
378
382
|
text: i,
|
|
379
383
|
fileIds: d,
|
|
380
384
|
files: n
|
|
381
|
-
},
|
|
385
|
+
}, b), de({
|
|
382
386
|
[a]: []
|
|
383
387
|
}), (F = ce.current) == null || F.update();
|
|
384
388
|
});
|
|
@@ -388,14 +392,14 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
388
392
|
if (!t)
|
|
389
393
|
return;
|
|
390
394
|
const n = (i) => {
|
|
391
|
-
if (!i.sessionId || i.sessionId && i.sessionId !==
|
|
395
|
+
if (!i.sessionId || i.sessionId && i.sessionId !== Re.current || i.role === J.User)
|
|
392
396
|
return;
|
|
393
397
|
if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (U(!1), A(!1), m.current = m.current.filter((d) => !d.isWaiting), I([...m.current]), m.current = [...m.current], i.content))
|
|
394
398
|
return me.error({
|
|
395
399
|
message: i.content
|
|
396
400
|
});
|
|
397
401
|
const l = i.actions || [], r = new ie(i.content, t, J.Robot);
|
|
398
|
-
r.messageId = i.messageId ||
|
|
402
|
+
r.messageId = i.messageId || Te(), r.reasoningContent = i.reasoningContent, r.searchReference = i.searchReference, r.thinkingSecs = i.thinkingSecs, r.thinkingStatus = i.thinkingStatus, r.actions = l, r.isLoading = !0, r.searchingStatus = i.searchingStatus, m.current = m.current.filter((d) => !d.isWaiting).filter((d) => !d.isReplying), i.index === void 0 && I([r, ...m.current]), i.code === 11915 && (U(!1), A(!1), r.isLoading = !1, r.content = "请您换个问题问我吧~", r.isSensitive = !0, I([r, ...m.current])), i.index === -2 && (U(!1), A(!1), r.isLoading = !1, r.content = "回答已中止~", r.isSuspend = !0, I([r, ...m.current])), i.index === -1 && (U(!1), A(!1), r.isLoading = !1, r.reference = i.reference, I([r, ...m.current]), o.id && se && se({
|
|
399
403
|
applicationId: o.id,
|
|
400
404
|
sessionId: t,
|
|
401
405
|
message: r
|
|
@@ -408,89 +412,89 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
408
412
|
};
|
|
409
413
|
}, [e]), C(() => {
|
|
410
414
|
if (!e) {
|
|
411
|
-
|
|
415
|
+
we(!1);
|
|
412
416
|
return;
|
|
413
417
|
}
|
|
414
418
|
const t = (n) => {
|
|
415
|
-
|
|
419
|
+
we(n);
|
|
416
420
|
};
|
|
417
|
-
return
|
|
421
|
+
return we(e.frozen), e.addEventListener("frozen", t), () => {
|
|
418
422
|
e == null || e.removeEventListener("frozen", t);
|
|
419
423
|
};
|
|
420
424
|
}, [e]), C(() => {
|
|
421
425
|
if (!N)
|
|
422
426
|
return;
|
|
423
427
|
const t = N.questionContextMaxLength || 4e3;
|
|
424
|
-
|
|
428
|
+
Tt(t);
|
|
425
429
|
}, [N, T]), C(() => {
|
|
426
430
|
ke && X(ke.text);
|
|
427
431
|
}, [ke]);
|
|
428
|
-
const
|
|
432
|
+
const Zt = (t) => {
|
|
429
433
|
const n = t.size;
|
|
430
434
|
return n <= 0 ? (u.config({
|
|
431
435
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
432
436
|
}), u.error("该文件为空,请重新上传"), u.config({
|
|
433
437
|
getContainer: void 0
|
|
434
|
-
}), !1) : n > 20 *
|
|
438
|
+
}), !1) : n > 20 * Cn ? (u.config({
|
|
435
439
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
436
440
|
}), u.error("图片须小于20M"), u.config({
|
|
437
441
|
getContainer: void 0
|
|
438
442
|
}), !1) : (Q(t), !1);
|
|
439
|
-
},
|
|
443
|
+
}, Jt = (t) => j(void 0, null, function* () {
|
|
440
444
|
var n;
|
|
441
|
-
return Q(t), (n = e == null ? void 0 : e.data) != null && n.id ?
|
|
445
|
+
return Q(t), (n = e == null ? void 0 : e.data) != null && n.id ? Ge(e, t) : new Promise((a) => {
|
|
442
446
|
M(!0), L == null || L({
|
|
443
|
-
netOpen: E ?
|
|
447
|
+
netOpen: E ? $.OPEN : $.CLOSE
|
|
444
448
|
}).then((i) => {
|
|
445
449
|
var l, r;
|
|
446
|
-
p == null || p(i), M(!1), P(!!((l = i.data) != null && l.netOpen)), Z(!!((r = i.data) != null && r.enableNetOpen)), a(
|
|
450
|
+
p == null || p(i), M(!1), P(!!((l = i.data) != null && l.netOpen)), Z(!!((r = i.data) != null && r.enableNetOpen)), a(Ge(i, t));
|
|
447
451
|
});
|
|
448
452
|
});
|
|
449
|
-
}),
|
|
450
|
-
const a =
|
|
453
|
+
}), Ge = (t, n) => {
|
|
454
|
+
const a = En(n.name);
|
|
451
455
|
return new Promise((i) => {
|
|
452
456
|
var r;
|
|
453
457
|
const l = {
|
|
454
|
-
files: [`${
|
|
458
|
+
files: [`${Te()}.${a}`],
|
|
455
459
|
isv: "minio",
|
|
456
460
|
knowledgeId: ((r = t.data) == null ? void 0 : r.id) || "",
|
|
457
461
|
type: 1
|
|
458
462
|
};
|
|
459
|
-
|
|
463
|
+
be(!0), T == null || T.postTicket(l).then((d) => {
|
|
460
464
|
T.uploadMinioFile(d.minio, n).then(() => {
|
|
461
|
-
var
|
|
462
|
-
const
|
|
463
|
-
i(`${location.protocol}//${
|
|
465
|
+
var w, B;
|
|
466
|
+
const b = (w = d.minio.endpoints) == null ? void 0 : w[0], y = d.minio.bucket, F = (B = d.minio.fileKeys) == null ? void 0 : B[0];
|
|
467
|
+
i(`${location.protocol}//${b}/${y}/${F}`);
|
|
464
468
|
}).catch(() => {
|
|
465
469
|
re(""), Q(void 0);
|
|
466
470
|
}).finally(() => {
|
|
467
|
-
|
|
471
|
+
be(!1);
|
|
468
472
|
});
|
|
469
473
|
}).catch(() => {
|
|
470
|
-
re(""), Q(void 0),
|
|
474
|
+
re(""), Q(void 0), be(!1);
|
|
471
475
|
});
|
|
472
476
|
});
|
|
473
477
|
};
|
|
474
478
|
C(() => {
|
|
475
479
|
const t = H.current;
|
|
476
|
-
t && !
|
|
480
|
+
t && !qe && t.scrollTo({
|
|
477
481
|
top: t.scrollHeight
|
|
478
482
|
});
|
|
479
483
|
}, [v]);
|
|
480
|
-
const
|
|
484
|
+
const Xe = (t, n) => new Promise((a) => {
|
|
481
485
|
if (!n.file.url || !(o != null && o.id))
|
|
482
486
|
return a();
|
|
483
|
-
const i = ft(
|
|
487
|
+
const i = gt(ft({}, n.file), {
|
|
484
488
|
type: 1
|
|
485
489
|
});
|
|
486
490
|
T == null || T.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
|
|
487
491
|
var l;
|
|
488
492
|
(l = ce.current) == null || l.update().finally(a);
|
|
489
493
|
});
|
|
490
|
-
}),
|
|
494
|
+
}), St = () => {
|
|
491
495
|
var t;
|
|
492
496
|
(t = e == null ? void 0 : e.data) != null && t.id && (U(!1), e.suspend());
|
|
493
|
-
},
|
|
497
|
+
}, en = (t) => {
|
|
494
498
|
const n = H.current;
|
|
495
499
|
n && setTimeout(() => {
|
|
496
500
|
n.scrollTo({
|
|
@@ -498,17 +502,17 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
498
502
|
behavior: t == null ? void 0 : t.behavior
|
|
499
503
|
});
|
|
500
504
|
}, t == null ? void 0 : t.ms);
|
|
501
|
-
},
|
|
505
|
+
}, tn = () => {
|
|
502
506
|
if (!H.current)
|
|
503
507
|
return;
|
|
504
508
|
const t = H.current.scrollTop <= -80;
|
|
505
|
-
|
|
506
|
-
},
|
|
509
|
+
qt(t);
|
|
510
|
+
}, nn = Pe((t) => {
|
|
507
511
|
var n, a;
|
|
508
512
|
(n = ae.current) == null || n.update(t), (a = ae.current) == null || a.focus();
|
|
509
|
-
}),
|
|
510
|
-
|
|
511
|
-
}),
|
|
513
|
+
}), on = Pe((t) => {
|
|
514
|
+
Qe(t);
|
|
515
|
+
}), sn = Pe(() => {
|
|
512
516
|
var n;
|
|
513
517
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
514
518
|
return;
|
|
@@ -518,16 +522,16 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
518
522
|
});
|
|
519
523
|
C(() => {
|
|
520
524
|
var t, n;
|
|
521
|
-
|
|
525
|
+
Re.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !Be && ((n = xe.current) == null || n.clear());
|
|
522
526
|
}, [e]);
|
|
523
|
-
const
|
|
527
|
+
const rn = () => {
|
|
524
528
|
var a;
|
|
525
529
|
if (!((a = e == null ? void 0 : e.data) != null && a.id))
|
|
526
530
|
return;
|
|
527
531
|
const n = v[v.length - 1].messageTime;
|
|
528
532
|
e.fetchMessages({
|
|
529
533
|
endTime: n,
|
|
530
|
-
pageSize:
|
|
534
|
+
pageSize: yt
|
|
531
535
|
}).then((i) => {
|
|
532
536
|
const l = i || [];
|
|
533
537
|
if (!l || !(l != null && l.length)) {
|
|
@@ -536,7 +540,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
536
540
|
}
|
|
537
541
|
l.length < 10 ? ee(!1) : ee(!0), I([...v, ...l.reverse()]);
|
|
538
542
|
});
|
|
539
|
-
},
|
|
543
|
+
}, an = (t) => j(void 0, null, function* () {
|
|
540
544
|
var n, a;
|
|
541
545
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
542
546
|
P(t);
|
|
@@ -545,14 +549,14 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
545
549
|
return;
|
|
546
550
|
P(t);
|
|
547
551
|
}
|
|
548
|
-
}),
|
|
552
|
+
}), Le = () => j(void 0, null, function* () {
|
|
549
553
|
e ? e.fetchData().then((t) => {
|
|
550
554
|
var n;
|
|
551
555
|
(n = e == null ? void 0 : e.data) != null && n.id && (P(t.netOpen), Z(t.enableNetOpen));
|
|
552
556
|
}) : (P(typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.default) == "boolean" ? s.connectNetwork.default : !1), Z(o.arrange[0].enableNetOpen));
|
|
553
557
|
});
|
|
554
558
|
C(() => {
|
|
555
|
-
|
|
559
|
+
Le();
|
|
556
560
|
}, [e]), C(() => {
|
|
557
561
|
requestAnimationFrame(() => {
|
|
558
562
|
var n, a;
|
|
@@ -577,9 +581,9 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
577
581
|
return;
|
|
578
582
|
const t = () => {
|
|
579
583
|
const i = ((N == null ? void 0 : N.promptVariables) || []).filter((l) => l.type ? !(l.type === ye.User && l.key === "query") && !(l.type === ye.System && l.key === "datetime") && l.status === 1 : l.key !== "query" && l.status === 1).map((l, r) => {
|
|
580
|
-
var
|
|
584
|
+
var b, y;
|
|
581
585
|
let d = "";
|
|
582
|
-
return typeof (s == null ? void 0 : s.promptVariables) == "object" && (d = ((y = (
|
|
586
|
+
return typeof (s == null ? void 0 : s.promptVariables) == "object" && (d = ((y = (b = s.promptVariables.default) == null ? void 0 : b.find((F) => F.key === l.key && F.type === l.type)) == null ? void 0 : y.value) || ""), {
|
|
583
587
|
id: r + "",
|
|
584
588
|
key: l.key,
|
|
585
589
|
name: l.name,
|
|
@@ -593,14 +597,14 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
593
597
|
N == null || N.removeEventListener("ready", t);
|
|
594
598
|
};
|
|
595
599
|
}, [e, N, s == null ? void 0 : s.promptVariables]);
|
|
596
|
-
const
|
|
597
|
-
netOpen: E ?
|
|
600
|
+
const Ze = () => L == null ? void 0 : L({
|
|
601
|
+
netOpen: E ? $.OPEN : $.CLOSE
|
|
598
602
|
}).then((t) => {
|
|
599
603
|
var n, a;
|
|
600
|
-
return p == null || p(t), M(!1), P(!!((n = t.data) != null && n.netOpen)), Z(!!((a = t.data) != null && a.enableNetOpen)),
|
|
601
|
-
}),
|
|
604
|
+
return p == null || p(t), M(!1), P(!!((n = t.data) != null && n.netOpen)), Z(!!((a = t.data) != null && a.enableNetOpen)), _e(t), t;
|
|
605
|
+
}), Je = pn(() => {
|
|
602
606
|
var t;
|
|
603
|
-
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(
|
|
607
|
+
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(pt, {
|
|
604
608
|
application: o,
|
|
605
609
|
history: {
|
|
606
610
|
role: 1,
|
|
@@ -610,7 +614,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
610
614
|
sessionId: "",
|
|
611
615
|
reference: [],
|
|
612
616
|
searchReference: [],
|
|
613
|
-
messageTime:
|
|
617
|
+
messageTime: vt(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
|
|
614
618
|
actions: [],
|
|
615
619
|
isLoading: !1
|
|
616
620
|
},
|
|
@@ -618,19 +622,19 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
618
622
|
markdown: s == null ? void 0 : s.markdown
|
|
619
623
|
}) : null;
|
|
620
624
|
}, [o == null ? void 0 : o.arrange, v]);
|
|
621
|
-
return
|
|
625
|
+
return vn(k, () => ({
|
|
622
626
|
getCurrentInputText: () => {
|
|
623
627
|
var t;
|
|
624
628
|
return (t = ae.current) == null ? void 0 : t.getCurrentText();
|
|
625
629
|
}
|
|
626
630
|
})), /* @__PURE__ */ z("div", {
|
|
627
631
|
className: "agent-chat",
|
|
628
|
-
children: [
|
|
632
|
+
children: [Kt ? /* @__PURE__ */ c("div", {
|
|
629
633
|
className: "session-loading",
|
|
630
|
-
children: /* @__PURE__ */ c(
|
|
631
|
-
}) : /* @__PURE__ */ z(
|
|
632
|
-
children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ c(
|
|
633
|
-
ref:
|
|
634
|
+
children: /* @__PURE__ */ c(ut, {})
|
|
635
|
+
}) : /* @__PURE__ */ z(un, {
|
|
636
|
+
children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ c(Mn, {
|
|
637
|
+
ref: ze,
|
|
634
638
|
appId: o.id,
|
|
635
639
|
currentSession: e,
|
|
636
640
|
promptVariables: O,
|
|
@@ -639,7 +643,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
639
643
|
}), /* @__PURE__ */ z("div", {
|
|
640
644
|
className: "chat-main",
|
|
641
645
|
id: "chat-main",
|
|
642
|
-
style:
|
|
646
|
+
style: Nt,
|
|
643
647
|
children: [/* @__PURE__ */ c("div", {
|
|
644
648
|
className: "chat-main-wrapper",
|
|
645
649
|
id: "scrollableDiv",
|
|
@@ -650,75 +654,75 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
650
654
|
flexDirection: "column-reverse"
|
|
651
655
|
},
|
|
652
656
|
ref: H,
|
|
653
|
-
onScroll:
|
|
654
|
-
children: (
|
|
657
|
+
onScroll: tn,
|
|
658
|
+
children: (Se = e == null ? void 0 : e.data) != null && Se.id && (v != null && v.length) ? /* @__PURE__ */ z(Vn, {
|
|
655
659
|
dataLength: v.length,
|
|
656
|
-
next:
|
|
660
|
+
next: rn,
|
|
657
661
|
style: {
|
|
658
662
|
display: "flex",
|
|
659
663
|
flexDirection: "column-reverse",
|
|
660
664
|
overflowX: "hidden"
|
|
661
665
|
},
|
|
662
666
|
inverse: !0,
|
|
663
|
-
endMessage: v.length >
|
|
664
|
-
((
|
|
667
|
+
endMessage: v.length > yt && // 少于一页不展示这个提示
|
|
668
|
+
((et = H.current) != null && et.scrollTop) && ((tt = H.current) == null ? void 0 : tt.scrollTop) < -10 ? /* @__PURE__ */ c(kn, {
|
|
665
669
|
plain: !0,
|
|
666
670
|
children: "没有更多数据了"
|
|
667
671
|
}) : null,
|
|
668
|
-
hasMore:
|
|
672
|
+
hasMore: $e,
|
|
669
673
|
loader: /* @__PURE__ */ c("div", {
|
|
670
674
|
style: {
|
|
671
675
|
height: "50px",
|
|
672
676
|
textAlign: "center",
|
|
673
677
|
overflow: "hidden"
|
|
674
678
|
},
|
|
675
|
-
children: /* @__PURE__ */ c(
|
|
679
|
+
children: /* @__PURE__ */ c(ut, {})
|
|
676
680
|
}),
|
|
677
681
|
scrollableTarget: "scrollableDiv",
|
|
678
|
-
children: [v.map((t, n) => /* @__PURE__ */ c(
|
|
682
|
+
children: [v.map((t, n) => /* @__PURE__ */ c($n, {
|
|
679
683
|
application: o,
|
|
680
684
|
currentSession: e,
|
|
681
685
|
history: t,
|
|
682
|
-
docViewerUrl:
|
|
686
|
+
docViewerUrl: Y,
|
|
683
687
|
isLastHistory: n === 0,
|
|
684
|
-
onRelatedClick:
|
|
685
|
-
onAgainClick:
|
|
686
|
-
onEditClick:
|
|
688
|
+
onRelatedClick: on,
|
|
689
|
+
onAgainClick: sn,
|
|
690
|
+
onEditClick: nn,
|
|
687
691
|
markdown: s == null ? void 0 : s.markdown
|
|
688
|
-
}, t.messageId + n)),
|
|
692
|
+
}, t.messageId + n)), !$e && Je]
|
|
689
693
|
}) : /* @__PURE__ */ z("div", {
|
|
690
694
|
className: "main-empty",
|
|
691
|
-
children: [(s == null ? void 0 : s.greeting) !== !1 && /* @__PURE__ */ c(
|
|
692
|
-
text: s === void 0 || s.greeting === !0 || ((
|
|
693
|
-
icon: s === void 0 || s.greeting === !0 || ((
|
|
694
|
-
children: !!
|
|
695
|
+
children: [(s == null ? void 0 : s.greeting) !== !1 && /* @__PURE__ */ c(Fn, {
|
|
696
|
+
text: s === void 0 || s.greeting === !0 || ((nt = s.greeting) == null ? void 0 : nt.text) === void 0 ? mt.text : s.greeting.text,
|
|
697
|
+
icon: s === void 0 || s.greeting === !0 || ((it = s.greeting) == null ? void 0 : it.icon) === void 0 ? Ct || mt.icon : s.greeting.icon,
|
|
698
|
+
children: !!Ue.length && (((s == null ? void 0 : s.greeting) === void 0 || (s == null ? void 0 : s.greeting)) === !0 || typeof (s == null ? void 0 : s.greeting) == "object" && s.greeting.questions !== !1) && /* @__PURE__ */ c(Tn, {
|
|
695
699
|
ref: xe,
|
|
696
|
-
sid: (
|
|
697
|
-
isRecommendClearing:
|
|
698
|
-
data:
|
|
700
|
+
sid: (ot = e == null ? void 0 : e.data) == null ? void 0 : ot.id,
|
|
701
|
+
isRecommendClearing: Me,
|
|
702
|
+
data: Ue,
|
|
699
703
|
layoutBreakpoints: typeof (s == null ? void 0 : s.greeting) == "object" ? s.greeting.layoutBreakpoints : void 0,
|
|
700
704
|
onItemClick: (t) => {
|
|
701
705
|
var a, i, l;
|
|
702
|
-
if (oe(t == null ? void 0 : t.question), X(t == null ? void 0 : t.question),
|
|
706
|
+
if (oe(t == null ? void 0 : t.question), X(t == null ? void 0 : t.question), Me)
|
|
703
707
|
return;
|
|
704
708
|
t != null && t.id && G(!0);
|
|
705
709
|
const n = (a = e == null ? void 0 : e.data) == null ? void 0 : a.id;
|
|
706
710
|
g != null && g.fileUpload ? (l = (i = ce.current) == null ? void 0 : i.clear()) == null || l.then(() => {
|
|
707
711
|
var r, d;
|
|
708
|
-
t != null && t.id && (n ? (r =
|
|
712
|
+
t != null && t.id && (n ? (r = Xe(n, t)) == null || r.finally(() => {
|
|
709
713
|
G(!1);
|
|
710
|
-
}) : (G(!1), M(!0), (d =
|
|
714
|
+
}) : (G(!1), M(!0), (d = Ze()) == null || d.then((b) => {
|
|
711
715
|
var y;
|
|
712
|
-
(y =
|
|
716
|
+
(y = Xe(b.id, t)) == null || y.finally(() => {
|
|
713
717
|
G(!1);
|
|
714
718
|
});
|
|
715
719
|
})));
|
|
716
|
-
}) : n ? G(!1) : (G(!1), M(!0),
|
|
720
|
+
}) : n ? G(!1) : (G(!1), M(!0), Ze());
|
|
717
721
|
}
|
|
718
722
|
})
|
|
719
|
-
}),
|
|
723
|
+
}), Je]
|
|
720
724
|
})
|
|
721
|
-
}),
|
|
725
|
+
}), Ae && /* @__PURE__ */ c("div", {
|
|
722
726
|
className: "session-stop",
|
|
723
727
|
children: /* @__PURE__ */ c(W, {
|
|
724
728
|
type: "primary",
|
|
@@ -733,14 +737,14 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
733
737
|
fontSize: 16
|
|
734
738
|
}
|
|
735
739
|
}),
|
|
736
|
-
onClick: () =>
|
|
740
|
+
onClick: () => St(),
|
|
737
741
|
children: "停止回答"
|
|
738
742
|
})
|
|
739
|
-
}),
|
|
743
|
+
}), qe && (v == null ? void 0 : v.length) > 0 && /* @__PURE__ */ c("div", {
|
|
740
744
|
className: "back-bottom",
|
|
741
745
|
children: /* @__PURE__ */ c(W, {
|
|
742
746
|
size: "small",
|
|
743
|
-
onClick: () =>
|
|
747
|
+
onClick: () => en({
|
|
744
748
|
behavior: "smooth"
|
|
745
749
|
}),
|
|
746
750
|
type: "link",
|
|
@@ -758,10 +762,10 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
758
762
|
className: "chat-footer-input",
|
|
759
763
|
children: [S && /* @__PURE__ */ c("div", {
|
|
760
764
|
className: "input-files",
|
|
761
|
-
children: /* @__PURE__ */ c(
|
|
765
|
+
children: /* @__PURE__ */ c(Ln, {
|
|
762
766
|
file: S,
|
|
763
767
|
actions: {
|
|
764
|
-
upload:
|
|
768
|
+
upload: Jt,
|
|
765
769
|
remove: () => {
|
|
766
770
|
Q(void 0);
|
|
767
771
|
}
|
|
@@ -772,11 +776,11 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
772
776
|
className: "footer-upload-action",
|
|
773
777
|
onClick: (t) => t.preventDefault(),
|
|
774
778
|
children: [/* @__PURE__ */ z(he, {
|
|
775
|
-
children: [o.type === 2 && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ c(
|
|
779
|
+
children: [o.type === 2 && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ c(wn, {
|
|
776
780
|
disabled: !!S || R,
|
|
777
781
|
accept: ".jpg, .png, .jpeg,.bmp",
|
|
778
782
|
listType: "picture-card",
|
|
779
|
-
beforeUpload:
|
|
783
|
+
beforeUpload: Zt,
|
|
780
784
|
className: "footer-upload-picture",
|
|
781
785
|
showUploadList: !1,
|
|
782
786
|
children: S ? /* @__PURE__ */ c(W, {
|
|
@@ -788,13 +792,13 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
788
792
|
bottom: "-2px"
|
|
789
793
|
},
|
|
790
794
|
disabled: !!S || R,
|
|
791
|
-
icon: /* @__PURE__ */ c(
|
|
795
|
+
icon: /* @__PURE__ */ c(Hn, {
|
|
792
796
|
className: "icon-tianjia",
|
|
793
797
|
style: {
|
|
794
798
|
fontSize: "22px"
|
|
795
799
|
}
|
|
796
800
|
})
|
|
797
|
-
}) : /* @__PURE__ */ c(
|
|
801
|
+
}) : /* @__PURE__ */ c(bn, {
|
|
798
802
|
placement: "topLeft",
|
|
799
803
|
overlayClassName: "footer-upload-tooltip",
|
|
800
804
|
title: /* @__PURE__ */ c("div", {
|
|
@@ -817,17 +821,17 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
817
821
|
})
|
|
818
822
|
})
|
|
819
823
|
})
|
|
820
|
-
}), pe && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ c(
|
|
824
|
+
}), pe && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ c(Dn, {
|
|
821
825
|
appId: o == null ? void 0 : o.id,
|
|
822
826
|
ref: ce,
|
|
823
|
-
isFirstSession:
|
|
824
|
-
docViewerUrl:
|
|
827
|
+
isFirstSession: Be,
|
|
828
|
+
docViewerUrl: Y,
|
|
825
829
|
onStatusChange: (t) => j(void 0, null, function* () {
|
|
826
|
-
t !== "process" ? (fe(!0),
|
|
830
|
+
t !== "process" ? (fe(!0), Le()) : fe(!1);
|
|
827
831
|
}),
|
|
828
832
|
createSession: () => new Promise((t) => {
|
|
829
833
|
M(!0), L == null || L({
|
|
830
|
-
netOpen: E ?
|
|
834
|
+
netOpen: E ? $.OPEN : $.CLOSE
|
|
831
835
|
}).then((n) => {
|
|
832
836
|
var i, l, r;
|
|
833
837
|
p == null || p(n), M(!1), P(!!((i = n.data) != null && i.netOpen)), Z(!!((l = n.data) != null && l.enableNetOpen));
|
|
@@ -835,7 +839,7 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
835
839
|
t(a);
|
|
836
840
|
});
|
|
837
841
|
}),
|
|
838
|
-
sid: (
|
|
842
|
+
sid: (st = e == null ? void 0 : e.data) == null ? void 0 : st.id,
|
|
839
843
|
disabled: Ie || R,
|
|
840
844
|
afterFileAdd: (t, n) => {
|
|
841
845
|
n && de((a) => {
|
|
@@ -856,43 +860,43 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
856
860
|
});
|
|
857
861
|
},
|
|
858
862
|
onFileListChange: (t) => {
|
|
859
|
-
|
|
863
|
+
jt(t);
|
|
860
864
|
},
|
|
861
|
-
shouldContinue:
|
|
865
|
+
shouldContinue: Vt,
|
|
862
866
|
afterFilesClear: () => {
|
|
863
867
|
var n;
|
|
864
868
|
const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
|
|
865
869
|
t && (de({
|
|
866
870
|
[t]: []
|
|
867
|
-
}),
|
|
871
|
+
}), Le());
|
|
868
872
|
}
|
|
869
|
-
}) : null, (g == null ? void 0 : g.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ c(
|
|
873
|
+
}) : null, (g == null ? void 0 : g.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ c(qn, {
|
|
870
874
|
appId: o.id,
|
|
871
875
|
list: [],
|
|
872
|
-
search:
|
|
876
|
+
search: je ? Ht : "",
|
|
873
877
|
onPromptSelect: (t) => {
|
|
874
878
|
X(t.context), oe(t.context);
|
|
875
879
|
},
|
|
876
880
|
disabled: R
|
|
877
881
|
})]
|
|
878
882
|
}), /* @__PURE__ */ z(he, {
|
|
879
|
-
children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((
|
|
880
|
-
sessionId: (
|
|
883
|
+
children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((rt = o.arrange) == null ? void 0 : rt.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ c(An, {
|
|
884
|
+
sessionId: (at = e == null ? void 0 : e.data) == null ? void 0 : at.id,
|
|
881
885
|
netStatus: E,
|
|
882
|
-
enable: typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.diabled) == "boolean" ? !(s != null && s.connectNetwork.diabled) :
|
|
886
|
+
enable: typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.diabled) == "boolean" ? !(s != null && s.connectNetwork.diabled) : Yt,
|
|
883
887
|
disabledTip: e ? void 0 : "网络访问已被禁用",
|
|
884
888
|
onNetStatusChange: (t) => {
|
|
885
|
-
|
|
889
|
+
an(t);
|
|
886
890
|
}
|
|
887
|
-
}), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(
|
|
888
|
-
currentSessionId: (
|
|
891
|
+
}), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(jn, {
|
|
892
|
+
currentSessionId: (lt = e == null ? void 0 : e.data) == null ? void 0 : lt.id,
|
|
889
893
|
onSessionChange: (t, n) => {
|
|
890
|
-
X(void 0), p == null || p(n);
|
|
894
|
+
X(void 0), Ne(!0), p == null || p(n);
|
|
891
895
|
},
|
|
892
896
|
disabled: R
|
|
893
|
-
}),
|
|
897
|
+
}), Lt && Et === "float" && /* @__PURE__ */ c("div", {
|
|
894
898
|
className: "session-history-drawer-component",
|
|
895
|
-
children: /* @__PURE__ */ c(
|
|
899
|
+
children: /* @__PURE__ */ c(xn, {
|
|
896
900
|
placement: "topRight",
|
|
897
901
|
showArrow: !1,
|
|
898
902
|
overlayClassName: "session-history-overlay",
|
|
@@ -911,35 +915,35 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
911
915
|
fontSize: 24
|
|
912
916
|
}
|
|
913
917
|
}),
|
|
914
|
-
onClick: () =>
|
|
918
|
+
onClick: () => We(!0)
|
|
915
919
|
})
|
|
916
920
|
})
|
|
917
921
|
}), (g == null ? void 0 : g.sessionOpen) && /* @__PURE__ */ c(W, {
|
|
918
|
-
icon: /* @__PURE__ */ c(
|
|
922
|
+
icon: /* @__PURE__ */ c(Rn, {}),
|
|
919
923
|
className: "add-btn",
|
|
920
924
|
type: "primary",
|
|
921
|
-
disabled:
|
|
925
|
+
disabled: Ae || !e || !v.length || R,
|
|
922
926
|
onClick: () => {
|
|
923
927
|
var t, n;
|
|
924
|
-
p == null || p(null), P(!1), (t =
|
|
928
|
+
p == null || p(null), P(!1), (t = ze.current) == null || t.clear(), (n = xe.current) == null || n.clear();
|
|
925
929
|
},
|
|
926
930
|
children: "新会话"
|
|
927
931
|
})]
|
|
928
932
|
})]
|
|
929
933
|
}), /* @__PURE__ */ c("div", {
|
|
930
934
|
className: "footer-textarea",
|
|
931
|
-
children: /* @__PURE__ */ c(
|
|
935
|
+
children: /* @__PURE__ */ c(Pn, {
|
|
932
936
|
ref: ae,
|
|
933
|
-
maxLength:
|
|
934
|
-
text:
|
|
937
|
+
maxLength: Pt,
|
|
938
|
+
text: Dt,
|
|
935
939
|
networkStatus: !1,
|
|
936
|
-
loading:
|
|
937
|
-
disabled:
|
|
938
|
-
onTextSend:
|
|
940
|
+
loading: Ye,
|
|
941
|
+
disabled: He || De || R || Ye,
|
|
942
|
+
onTextSend: Qe,
|
|
939
943
|
onChange: (t, n) => {
|
|
940
944
|
X(t);
|
|
941
945
|
const a = n.getText().replace(/[\n\s]+$/, "");
|
|
942
|
-
oe(a),
|
|
946
|
+
oe(a), Rt(a), je || Ot(!0);
|
|
943
947
|
},
|
|
944
948
|
clearAction: /* @__PURE__ */ c(he, {
|
|
945
949
|
size: 0,
|
|
@@ -953,35 +957,38 @@ ${t}` : t, l = new ie(i, a, J.User, n);
|
|
|
953
957
|
},
|
|
954
958
|
type: "icon-qingchujiyi"
|
|
955
959
|
}),
|
|
956
|
-
onClick: () =>
|
|
960
|
+
onClick: () => Gt()
|
|
957
961
|
})
|
|
958
962
|
})
|
|
959
963
|
})
|
|
960
964
|
})]
|
|
961
965
|
})
|
|
962
|
-
}), /* @__PURE__ */ c(
|
|
963
|
-
tips:
|
|
964
|
-
}),
|
|
965
|
-
isvisible:
|
|
966
|
-
files:
|
|
967
|
-
sessionId: (
|
|
966
|
+
}), /* @__PURE__ */ c(On, {
|
|
967
|
+
tips: It
|
|
968
|
+
}), Ve && /* @__PURE__ */ c(Un, {
|
|
969
|
+
isvisible: Ve,
|
|
970
|
+
files: Mt,
|
|
971
|
+
sessionId: (dt = e == null ? void 0 : e.data) == null ? void 0 : dt.id,
|
|
968
972
|
onClose: (t) => {
|
|
969
|
-
|
|
973
|
+
Ut(!1), At(!1);
|
|
970
974
|
}
|
|
971
975
|
})]
|
|
972
|
-
}),
|
|
976
|
+
}), Ke && /* @__PURE__ */ c(zn, {
|
|
973
977
|
currentSession: e,
|
|
974
978
|
application: o,
|
|
975
979
|
networkStatus: E,
|
|
976
980
|
setCurrentSession: p,
|
|
977
|
-
sessions:
|
|
978
|
-
setSessions:
|
|
981
|
+
sessions: kt,
|
|
982
|
+
setSessions: wt,
|
|
979
983
|
disabled: R,
|
|
980
|
-
isSessionHistoryVisible:
|
|
981
|
-
setIsSessionHistoryVisible:
|
|
984
|
+
isSessionHistoryVisible: Ke,
|
|
985
|
+
setIsSessionHistoryVisible: We,
|
|
986
|
+
onSessionChange: (t) => {
|
|
987
|
+
Ne(!0);
|
|
988
|
+
}
|
|
982
989
|
})]
|
|
983
990
|
});
|
|
984
991
|
});
|
|
985
992
|
export {
|
|
986
|
-
|
|
993
|
+
wi as default
|
|
987
994
|
};
|