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