@glodon-aiot/agent-cli-ui 3.4.2 → 3.4.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/HistoryItem/FileItem/index.mjs +52 -48
- package/dist/es/Dialog/AgentChat/HistoryItem/SessionAction/index.mjs +26 -23
- package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +26 -24
- package/dist/es/Dialog/AgentChat/Tools/SessionListDrawer/HistorySessionList/index.mjs +65 -59
- package/dist/es/Dialog/AgentChat/Tools/UploadKnowledgeFiles/index.mjs +179 -161
- package/dist/es/Dialog/AgentChat/index.mjs +183 -159
- package/dist/es/QuillEditor/index.mjs +72 -65
- package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +129 -125
- package/dist/es/components/Recommend/RecommendItem.mjs +20 -18
- package/dist/es/index.mjs +223 -214
- 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/style.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/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/style22.css +1 -1
- package/dist/es/src/style23.css +1 -1
- package/dist/es/src/style24.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style28.css +1 -1
- package/dist/es/src/style3.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style31.css +1 -1
- package/dist/es/src/style33.css +1 -1
- package/dist/es/src/style4.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/es/utils/antdConfig.mjs +15 -0
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +56 -56
- package/dist/src/utils/antdConfig.d.ts +7 -0
- package/dist/src/utils/testAntdPrefix.d.ts +3 -0
- package/package.json +3 -3
|
@@ -2,42 +2,42 @@ var ln = Object.defineProperty, dn = Object.defineProperties;
|
|
|
2
2
|
var cn = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var gt = Object.getOwnPropertySymbols;
|
|
4
4
|
var fn = Object.prototype.hasOwnProperty, gn = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var Te = (
|
|
6
|
-
for (var o in
|
|
7
|
-
fn.call(
|
|
5
|
+
var Te = (w, b, o) => b in w ? ln(w, b, { enumerable: !0, configurable: !0, writable: !0, value: o }) : w[b] = o, ut = (w, b) => {
|
|
6
|
+
for (var o in b || (b = {}))
|
|
7
|
+
fn.call(b, o) && Te(w, o, b[o]);
|
|
8
8
|
if (gt)
|
|
9
|
-
for (var o of gt(
|
|
10
|
-
gn.call(
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var D = (
|
|
14
|
-
var j = (
|
|
9
|
+
for (var o of gt(b))
|
|
10
|
+
gn.call(b, o) && Te(w, o, b[o]);
|
|
11
|
+
return w;
|
|
12
|
+
}, mt = (w, b) => dn(w, cn(b));
|
|
13
|
+
var D = (w, b, o) => (Te(w, typeof b != "symbol" ? b + "" : b, o), o);
|
|
14
|
+
var j = (w, b, o) => new Promise((Y, e) => {
|
|
15
15
|
var L = (E) => {
|
|
16
16
|
try {
|
|
17
17
|
p(o.next(E));
|
|
18
18
|
} catch (P) {
|
|
19
19
|
e(P);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, be = (E) => {
|
|
22
22
|
try {
|
|
23
23
|
p(o.throw(E));
|
|
24
24
|
} catch (P) {
|
|
25
25
|
e(P);
|
|
26
26
|
}
|
|
27
|
-
}, p = (E) => E.done ? Y(E.value) : Promise.resolve(E.value).then(L,
|
|
28
|
-
p((o = o.apply(
|
|
27
|
+
}, p = (E) => E.done ? Y(E.value) : Promise.resolve(E.value).then(L, be);
|
|
28
|
+
p((o = o.apply(w, b)).next());
|
|
29
29
|
});
|
|
30
30
|
import { jsx as c, jsxs as z, Fragment as un } from "react/jsx-runtime";
|
|
31
|
-
import { memo as
|
|
32
|
-
/* empty css */import { Spin as
|
|
31
|
+
import { memo as mn, forwardRef as hn, useState as m, useRef as W, useContext as yn, useEffect as N, useMemo as pn, useImperativeHandle as vn } from "react";
|
|
32
|
+
/* empty css */import { Spin as ht, Divider as bn, Button as Q, Space as ye, Upload as xn, Tooltip as kn, Popover as wn, notification as pe, message as u } from "antd";
|
|
33
33
|
import ie from "../../components/Iconfont/index.mjs";
|
|
34
34
|
import { IHistoryRole as S, ChatMessageRole as yt, PromptVariableType as ve } from "@glodon-aiot/apis";
|
|
35
|
-
import
|
|
36
|
-
import
|
|
35
|
+
import bt from "./HistoryItem/index.mjs";
|
|
36
|
+
import xt from "dayjs";
|
|
37
37
|
import { v4 as Oe } from "uuid";
|
|
38
|
-
import
|
|
39
|
-
import { configuration as
|
|
40
|
-
import { NET_OPEN_STATUS as $, MB as
|
|
38
|
+
import Cn from "../../context.mjs";
|
|
39
|
+
import { configuration as In } from "@glodon-aiot/bot-client-sdk";
|
|
40
|
+
import { NET_OPEN_STATUS as $, MB as Nn } from "../../constant.mjs";
|
|
41
41
|
import Ln from "../../components/FilePreview/index.mjs";
|
|
42
42
|
import { getImageExtension as En } from "../../utils/index.mjs";
|
|
43
43
|
import Pn from "../../QuillEditor/index.mjs";
|
|
@@ -56,12 +56,12 @@ import An from "./Tools/ConnectToNetwork/index.mjs";
|
|
|
56
56
|
import qn from "./Tools/PromptManager/index.mjs";
|
|
57
57
|
import { useSessionState as Bn } from "../../hooks/useSessionState.mjs";
|
|
58
58
|
import $n from "../../assets/icon.svg.mjs";
|
|
59
|
-
const Yn =
|
|
59
|
+
const Yn = mn(bt), pt = {
|
|
60
60
|
icon: $n,
|
|
61
61
|
text: "今天我能帮你什么?"
|
|
62
62
|
};
|
|
63
63
|
class oe {
|
|
64
|
-
constructor(
|
|
64
|
+
constructor(b, o, Y, e) {
|
|
65
65
|
D(this, "messageTime");
|
|
66
66
|
D(this, "isWaiting");
|
|
67
67
|
D(this, "messageId");
|
|
@@ -71,44 +71,44 @@ class oe {
|
|
|
71
71
|
D(this, "isSensitive");
|
|
72
72
|
D(this, "isSuspend");
|
|
73
73
|
D(this, "comment");
|
|
74
|
-
this.content =
|
|
74
|
+
this.content = b, this.sessionId = o, this.role = Y, this.files = e, this.content = b, this.role = Y, this.sessionId = o, this.files = e, this.messageTime = xt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = Oe(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
|
|
75
75
|
isAgree: 0
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
const vt = 10,
|
|
79
|
+
const vt = 10, wi = hn((w, b) => {
|
|
80
80
|
var tt, nt, it, ot, st, rt, at, lt, dt, ct, ft;
|
|
81
81
|
const {
|
|
82
82
|
application: o,
|
|
83
83
|
docViewerUrl: Y = "",
|
|
84
84
|
currentSession: e,
|
|
85
85
|
onCreateSession: L,
|
|
86
|
-
embeddingService:
|
|
86
|
+
embeddingService: be,
|
|
87
87
|
setCurrentSession: p,
|
|
88
88
|
networkStatus: E,
|
|
89
89
|
setNetworkStatus: P
|
|
90
|
-
} =
|
|
90
|
+
} = w, [v, C] = m([]), [kt, se] = m(), [xe, He] = m(), H = W(null), {
|
|
91
91
|
service: T,
|
|
92
|
-
agentClient:
|
|
93
|
-
depId:
|
|
94
|
-
footer:
|
|
92
|
+
agentClient: I,
|
|
93
|
+
depId: wt,
|
|
94
|
+
footer: Ct,
|
|
95
95
|
transform: g,
|
|
96
|
-
defaultInput:
|
|
96
|
+
defaultInput: ke,
|
|
97
97
|
onMessage: re,
|
|
98
98
|
onHistoryLoad: Re,
|
|
99
99
|
beforeMessageSend: V,
|
|
100
|
-
bodyStyle:
|
|
100
|
+
bodyStyle: It,
|
|
101
101
|
disabled: R,
|
|
102
102
|
features: s,
|
|
103
103
|
popupContainer: f,
|
|
104
|
-
icon:
|
|
104
|
+
icon: Nt,
|
|
105
105
|
sider: Lt,
|
|
106
106
|
mode: Et
|
|
107
|
-
} = yn(
|
|
107
|
+
} = yn(Cn), [De, we] = m(!1), h = W(v), Ue = W(void 0), [Pt, Tt] = m(0), [ee, _] = m(), [G, ae] = m(""), [Me, Ce] = m(!1), le = W(null), [je, Ft] = m([]), [ze, X] = m(!1), [Ve, Ot] = m(!1), [Ht, Rt] = m(""), [Dt, Z] = m(), [de, ce] = m({}), fe = W(null), Ae = W(null), Ie = W(null), [qe, Ut] = m(!1), [Mt, jt] = m([]), [zt, ge] = m(!0), [Vt, At] = m(!0), [Be, U] = m(!1), [Ne, A] = m(!1), [$e, qt] = m(!1), [O, ue] = m(typeof (s == null ? void 0 : s.promptVariables) == "object" ? s.promptVariables.default || [] : []), [Bt, $t] = m(typeof (s == null ? void 0 : s.knowledges) == "object" && s.knowledges.default || void 0), [Ye, M] = m(!1), [Ke, te] = m(!1), [Yt, J] = m(typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.default) == "boolean" ? s.connectNetwork.default : !1), [We, me] = m(!1), [Kt, q] = m(!1), [Wt, Qt] = m(null), [he, K] = m(!1), [Qe, _e] = m(!1), {
|
|
108
108
|
isSwitchingToExistingSession: _t,
|
|
109
109
|
setIsSwitchingToExistingSession: Le
|
|
110
110
|
} = Bn();
|
|
111
|
-
|
|
111
|
+
N(() => {
|
|
112
112
|
if (Qt(e), e === null)
|
|
113
113
|
q(!1);
|
|
114
114
|
else if (e === void 0)
|
|
@@ -124,9 +124,9 @@ const vt = 10, xi = mn((x, k) => {
|
|
|
124
124
|
}
|
|
125
125
|
e.ready ? q(!1) : q(!0);
|
|
126
126
|
}
|
|
127
|
-
}, [e, e == null ? void 0 : e.ready]),
|
|
127
|
+
}, [e, e == null ? void 0 : e.ready]), N(() => {
|
|
128
128
|
var a, i;
|
|
129
|
-
e && (
|
|
129
|
+
e && (h.current = []), C([]);
|
|
130
130
|
const t = H.current;
|
|
131
131
|
if (t && t.scrollTo({
|
|
132
132
|
top: 0
|
|
@@ -134,20 +134,20 @@ const vt = 10, xi = mn((x, k) => {
|
|
|
134
134
|
return;
|
|
135
135
|
if (A(!1), U(!1), (i = e.messages) != null && i.length) {
|
|
136
136
|
const r = [...e.messages.filter((d) => d == null ? void 0 : d.messageId)].reverse();
|
|
137
|
-
|
|
137
|
+
h.current = [...r], C([...r]), q(!1);
|
|
138
138
|
}
|
|
139
139
|
const n = (l) => {
|
|
140
140
|
var r;
|
|
141
|
-
(r = e == null ? void 0 : e.data) != null && r.id && (
|
|
141
|
+
(r = e == null ? void 0 : e.data) != null && r.id && (h.current = [...l].reverse(), C([...l].reverse()), !l || l.length < 10 ? te(!1) : te(!0), q(!1), Re && Re({
|
|
142
142
|
applicationId: o.id,
|
|
143
143
|
sessionId: e.data.id,
|
|
144
144
|
histories: l
|
|
145
145
|
}));
|
|
146
146
|
};
|
|
147
147
|
return e.addEventListener("history:loaded", n), () => {
|
|
148
|
-
|
|
148
|
+
h.current = [], C([]), e == null || e.removeEventListener("history:loaded", n);
|
|
149
149
|
};
|
|
150
|
-
}, [e]),
|
|
150
|
+
}, [e]), N(() => {
|
|
151
151
|
const t = () => {
|
|
152
152
|
var n;
|
|
153
153
|
(n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ue(e.promptVariables.sort((a, i) => a.key.localeCompare(i.key))), e.knowledges && $t(e.knowledges), P(e.netOpen));
|
|
@@ -155,18 +155,20 @@ const vt = 10, xi = mn((x, k) => {
|
|
|
155
155
|
return e == null || e.addEventListener("data:updated", t), () => {
|
|
156
156
|
e == null || e.removeEventListener("data:updated", t);
|
|
157
157
|
};
|
|
158
|
-
}, [e]),
|
|
158
|
+
}, [e]), N(() => {
|
|
159
159
|
var n;
|
|
160
160
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
161
161
|
return;
|
|
162
162
|
const t = (a) => {
|
|
163
163
|
var i;
|
|
164
164
|
console.error(a.message, a.cause, "e.case"), pe.config({
|
|
165
|
-
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
165
|
+
getContainer: () => (f == null ? void 0 : f.current) || document.body,
|
|
166
|
+
prefixCls: "gbot-notification"
|
|
166
167
|
}), pe.error({
|
|
167
168
|
message: ((i = a.cause) == null ? void 0 : i.message) || a.message
|
|
168
169
|
}), pe.config({
|
|
169
|
-
getContainer: void 0
|
|
170
|
+
getContainer: void 0,
|
|
171
|
+
prefixCls: "gbot-notification"
|
|
170
172
|
});
|
|
171
173
|
};
|
|
172
174
|
return e.addEventListener("error", t), () => {
|
|
@@ -180,103 +182,119 @@ const vt = 10, xi = mn((x, k) => {
|
|
|
180
182
|
const t = e.data.id, n = v[v.length - 1];
|
|
181
183
|
if (n && n.isContext) {
|
|
182
184
|
u.config({
|
|
183
|
-
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
185
|
+
getContainer: () => (f == null ? void 0 : f.current) || document.body,
|
|
186
|
+
prefixCls: "gbot-message"
|
|
184
187
|
}), u.success("已开启新话题"), u.config({
|
|
185
|
-
getContainer: void 0
|
|
188
|
+
getContainer: void 0,
|
|
189
|
+
prefixCls: "gbot-message"
|
|
186
190
|
});
|
|
187
191
|
return;
|
|
188
192
|
} else
|
|
189
193
|
e.clear().then(() => {
|
|
190
194
|
const i = new oe("", t, S.System);
|
|
191
|
-
i.isContext = !0,
|
|
195
|
+
i.isContext = !0, C([i, ...v]);
|
|
192
196
|
});
|
|
193
197
|
};
|
|
194
|
-
|
|
198
|
+
N(() => {
|
|
195
199
|
o != null && o.id && (T == null || T.getRecommendQues(o.id).then((t) => {
|
|
196
200
|
Ft(t);
|
|
197
201
|
}));
|
|
198
|
-
}, [
|
|
202
|
+
}, [wt, o]);
|
|
199
203
|
const Ge = (t) => j(void 0, null, function* () {
|
|
200
204
|
var y, F;
|
|
201
205
|
if (R) {
|
|
202
206
|
u.config({
|
|
203
|
-
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
207
|
+
getContainer: () => (f == null ? void 0 : f.current) || document.body,
|
|
208
|
+
prefixCls: "gbot-message"
|
|
204
209
|
}), u.error("发送功能被禁用"), u.config({
|
|
205
|
-
getContainer: void 0
|
|
210
|
+
getContainer: void 0,
|
|
211
|
+
prefixCls: "gbot-message"
|
|
206
212
|
});
|
|
207
213
|
return;
|
|
208
214
|
}
|
|
209
|
-
const n = t ||
|
|
215
|
+
const n = t || kt;
|
|
210
216
|
if (!(n != null && n.trim())) {
|
|
211
217
|
u.config({
|
|
212
|
-
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
218
|
+
getContainer: () => (f == null ? void 0 : f.current) || document.body,
|
|
219
|
+
prefixCls: "gbot-message"
|
|
213
220
|
}), u.error("请输入你想问的"), u.config({
|
|
214
|
-
getContainer: void 0
|
|
221
|
+
getContainer: void 0,
|
|
222
|
+
prefixCls: "gbot-message"
|
|
215
223
|
});
|
|
216
224
|
return;
|
|
217
225
|
}
|
|
218
|
-
if (!(O == null ? void 0 : O.every((
|
|
226
|
+
if (!(O == null ? void 0 : O.every((x) => !!(x != null && x.value))))
|
|
219
227
|
if (g != null && g.promptVariables) {
|
|
220
228
|
u.config({
|
|
221
|
-
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
229
|
+
getContainer: () => (f == null ? void 0 : f.current) || document.body,
|
|
230
|
+
prefixCls: "gbot-message"
|
|
222
231
|
}), u.error("变量值不能为空"), u.config({
|
|
223
|
-
getContainer: void 0
|
|
232
|
+
getContainer: void 0,
|
|
233
|
+
prefixCls: "gbot-message"
|
|
224
234
|
});
|
|
225
235
|
return;
|
|
226
236
|
} else
|
|
227
|
-
console.error("变量值不能为空", O == null ? void 0 : O.map((
|
|
228
|
-
if (
|
|
237
|
+
console.error("变量值不能为空", O == null ? void 0 : O.map((x) => !!(x != null && x.value)));
|
|
238
|
+
if (Ne) {
|
|
229
239
|
u.config({
|
|
230
|
-
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
240
|
+
getContainer: () => (f == null ? void 0 : f.current) || document.body,
|
|
241
|
+
prefixCls: "gbot-message"
|
|
231
242
|
}), u.error("正在回复中"), u.config({
|
|
232
|
-
getContainer: void 0
|
|
243
|
+
getContainer: void 0,
|
|
244
|
+
prefixCls: "gbot-message"
|
|
233
245
|
});
|
|
234
246
|
return;
|
|
235
247
|
}
|
|
236
248
|
if (De) {
|
|
237
249
|
u.config({
|
|
238
|
-
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
250
|
+
getContainer: () => (f == null ? void 0 : f.current) || document.body,
|
|
251
|
+
prefixCls: "gbot-message"
|
|
239
252
|
}), u.error("等待初始化"), u.config({
|
|
240
|
-
getContainer: void 0
|
|
253
|
+
getContainer: void 0,
|
|
254
|
+
prefixCls: "gbot-message"
|
|
241
255
|
});
|
|
242
256
|
return;
|
|
243
257
|
}
|
|
244
258
|
if (!zt) {
|
|
245
259
|
u.config({
|
|
246
|
-
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
260
|
+
getContainer: () => (f == null ? void 0 : f.current) || document.body,
|
|
261
|
+
prefixCls: "gbot-message"
|
|
247
262
|
}), u.error("正在解析文件"), u.config({
|
|
248
|
-
getContainer: void 0
|
|
263
|
+
getContainer: void 0,
|
|
264
|
+
prefixCls: "gbot-message"
|
|
249
265
|
});
|
|
250
266
|
return;
|
|
251
267
|
}
|
|
252
268
|
if (Me) {
|
|
253
269
|
u.config({
|
|
254
|
-
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
270
|
+
getContainer: () => (f == null ? void 0 : f.current) || document.body,
|
|
271
|
+
prefixCls: "gbot-message"
|
|
255
272
|
}), u.error("正在上传图片"), u.config({
|
|
256
|
-
getContainer: void 0
|
|
273
|
+
getContainer: void 0,
|
|
274
|
+
prefixCls: "gbot-message"
|
|
257
275
|
});
|
|
258
276
|
return;
|
|
259
277
|
}
|
|
260
278
|
_(void 0), ae("");
|
|
261
279
|
const i = (y = e == null ? void 0 : e.data) == null ? void 0 : y.id;
|
|
262
280
|
if (!i) {
|
|
263
|
-
if (
|
|
281
|
+
if (he)
|
|
264
282
|
return;
|
|
265
283
|
K(!0), L == null || L({
|
|
266
284
|
netOpen: E ? $.OPEN : $.CLOSE
|
|
267
|
-
}).then((
|
|
285
|
+
}).then((x) => {
|
|
268
286
|
var B, ne;
|
|
269
|
-
M(!0), P(!!((B =
|
|
270
|
-
p == null || p(
|
|
287
|
+
M(!0), P(!!((B = x.data) != null && B.netOpen)), J(!!((ne = x.data) != null && ne.enableNetOpen)), Xe(x).then(() => {
|
|
288
|
+
p == null || p(x), M(!1), He(n);
|
|
271
289
|
});
|
|
272
|
-
}).catch((
|
|
290
|
+
}).catch((x) => {
|
|
273
291
|
K(!1);
|
|
274
292
|
});
|
|
275
293
|
return;
|
|
276
294
|
}
|
|
277
|
-
if (
|
|
295
|
+
if (he)
|
|
278
296
|
return;
|
|
279
|
-
K(!0),
|
|
297
|
+
K(!0), me(!0);
|
|
280
298
|
const l = G ? `
|
|
281
299
|
${n}` : n;
|
|
282
300
|
let r;
|
|
@@ -291,10 +309,10 @@ ${n}` : n;
|
|
|
291
309
|
files: de[i]
|
|
292
310
|
}
|
|
293
311
|
}) : r = !0;
|
|
294
|
-
} catch (
|
|
312
|
+
} catch (x) {
|
|
295
313
|
r = !1;
|
|
296
314
|
}
|
|
297
|
-
if (
|
|
315
|
+
if (me(!1), r === !1) {
|
|
298
316
|
K(!1);
|
|
299
317
|
return;
|
|
300
318
|
}
|
|
@@ -307,23 +325,25 @@ ${n}` : n;
|
|
|
307
325
|
}), Xe = (t) => new Promise((n, a) => j(void 0, null, function* () {
|
|
308
326
|
const r = (t == null ? void 0 : t.promptVariables).filter((d) => d.type ? !((d.type === ve.User || d.type === void 0) && d.key === "query") && !((d.type === ve.System || d.type === void 0) && d.key === "datetime") : d.key !== "query").map((d) => {
|
|
309
327
|
var y;
|
|
310
|
-
const
|
|
311
|
-
return d.value =
|
|
328
|
+
const k = (y = O.find((F) => F.key === d.key && F.type === d.type)) == null ? void 0 : y.value;
|
|
329
|
+
return d.value = k || "", d;
|
|
312
330
|
});
|
|
313
|
-
ue(r.sort((d,
|
|
331
|
+
ue(r.sort((d, k) => d.key.localeCompare(k.key))), yield t == null ? void 0 : t.setPromptVariables(r).catch((d) => {
|
|
314
332
|
console.error(d), u.config({
|
|
315
|
-
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
333
|
+
getContainer: () => (f == null ? void 0 : f.current) || document.body,
|
|
334
|
+
prefixCls: "gbot-message"
|
|
316
335
|
}), u.error(d.message), u.config({
|
|
317
|
-
getContainer: void 0
|
|
336
|
+
getContainer: void 0,
|
|
337
|
+
prefixCls: "gbot-message"
|
|
318
338
|
});
|
|
319
339
|
}), n();
|
|
320
340
|
})), Xt = (t) => {
|
|
321
|
-
var r, d,
|
|
341
|
+
var r, d, k;
|
|
322
342
|
if (ge(!1), !((r = e == null ? void 0 : e.data) != null && r.id) || !(o != null && o.id))
|
|
323
343
|
return;
|
|
324
344
|
const n = ((d = e.data) == null ? void 0 : d.id) || "", a = [];
|
|
325
345
|
let i = [], l = /* @__PURE__ */ new Set();
|
|
326
|
-
(
|
|
346
|
+
(k = de[n]) == null || k.forEach((y) => {
|
|
327
347
|
l.has(y.id) || (i.push(y), l.add(y.id));
|
|
328
348
|
}), Promise.all(i.map((y) => T == null ? void 0 : T.patchApplicationIdKnowledgeIdFileId(o == null ? void 0 : o.id, n, y.id, {
|
|
329
349
|
enabled: 1
|
|
@@ -335,11 +355,11 @@ ${n}` : n;
|
|
|
335
355
|
throw Error(y);
|
|
336
356
|
});
|
|
337
357
|
};
|
|
338
|
-
|
|
339
|
-
if (!
|
|
358
|
+
N(() => {
|
|
359
|
+
if (!xe || !e)
|
|
340
360
|
return;
|
|
341
|
-
const t =
|
|
342
|
-
|
|
361
|
+
const t = xe, n = () => j(void 0, null, function* () {
|
|
362
|
+
me(!0);
|
|
343
363
|
const a = G ? `
|
|
344
364
|
${t}` : t;
|
|
345
365
|
let i;
|
|
@@ -357,7 +377,7 @@ ${t}` : t;
|
|
|
357
377
|
} catch (l) {
|
|
358
378
|
i = !1;
|
|
359
379
|
}
|
|
360
|
-
if (
|
|
380
|
+
if (me(!1), i === !1) {
|
|
361
381
|
K(!1);
|
|
362
382
|
return;
|
|
363
383
|
}
|
|
@@ -366,7 +386,7 @@ ${t}` : t;
|
|
|
366
386
|
return e.ready ? n() : e.addEventListener("ready", n, !0), () => {
|
|
367
387
|
e == null || e.removeEventListener("ready", n);
|
|
368
388
|
};
|
|
369
|
-
}, [
|
|
389
|
+
}, [xe, e]);
|
|
370
390
|
const Ee = (t, n) => j(void 0, null, function* () {
|
|
371
391
|
var y, F;
|
|
372
392
|
const a = (y = e == null ? void 0 : e.data) == null ? void 0 : y.id;
|
|
@@ -375,34 +395,34 @@ ${t}` : t;
|
|
|
375
395
|
A(!0), U(!0);
|
|
376
396
|
const i = G ? `
|
|
377
397
|
${t}` : t, l = new oe(i, a, S.User, n);
|
|
378
|
-
se(void 0), Z(void 0),
|
|
398
|
+
se(void 0), Z(void 0), h.current = [l, ...v], C(h.current), o.id && re && re({
|
|
379
399
|
applicationId: o.id,
|
|
380
400
|
sessionId: a,
|
|
381
401
|
message: l
|
|
382
402
|
});
|
|
383
403
|
const r = new oe("", a, S.System);
|
|
384
|
-
r.isWaiting = !0,
|
|
385
|
-
const d = (n == null ? void 0 : n.map((
|
|
386
|
-
stream:
|
|
404
|
+
r.isWaiting = !0, h.current = [r, ...h.current], C(h.current);
|
|
405
|
+
const d = (n == null ? void 0 : n.map((x) => x.id)) || [], k = {
|
|
406
|
+
stream: In.stream,
|
|
387
407
|
referenceFirst: !1
|
|
388
408
|
};
|
|
389
409
|
if (g != null && g.promptVariables) {
|
|
390
|
-
const
|
|
391
|
-
|
|
410
|
+
const x = O == null ? void 0 : O.reduce((B, ne) => (B[ne.key] = ne.value, B), {});
|
|
411
|
+
k.formatValues = x;
|
|
392
412
|
}
|
|
393
413
|
if (g != null && g.knowledges) {
|
|
394
|
-
const
|
|
395
|
-
|
|
414
|
+
const x = Bt;
|
|
415
|
+
k.knowledges = x;
|
|
396
416
|
}
|
|
397
417
|
yield e.send({
|
|
398
418
|
text: i,
|
|
399
419
|
fileIds: d,
|
|
400
420
|
files: n
|
|
401
|
-
},
|
|
421
|
+
}, k), ce({
|
|
402
422
|
[a]: []
|
|
403
423
|
}), (F = fe.current) == null || F.update(), K(!1);
|
|
404
424
|
});
|
|
405
|
-
|
|
425
|
+
N(() => {
|
|
406
426
|
var a;
|
|
407
427
|
const t = (a = e == null ? void 0 : e.data) == null ? void 0 : a.id;
|
|
408
428
|
if (!t)
|
|
@@ -410,51 +430,55 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
410
430
|
const n = (i) => {
|
|
411
431
|
if (!i.sessionId || i.sessionId && i.sessionId !== Ue.current || i.role === S.User)
|
|
412
432
|
return;
|
|
413
|
-
if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (U(!1), A(!1),
|
|
433
|
+
if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (U(!1), A(!1), h.current = h.current.filter((d) => !d.isWaiting), C([...h.current]), h.current = [...h.current], i.content))
|
|
414
434
|
return pe.error({
|
|
415
435
|
message: i.content
|
|
416
436
|
});
|
|
417
437
|
const l = i.actions || [], r = new oe(i.content, t, S.Robot);
|
|
418
|
-
r.messageId = i.messageId || Oe(), 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,
|
|
438
|
+
r.messageId = i.messageId || Oe(), 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, h.current = h.current.filter((d) => !d.isWaiting).filter((d) => !d.isReplying), i.index === void 0 && C([r, ...h.current]), i.code === 11915 && (U(!1), A(!1), r.isLoading = !1, r.content = "请您换个问题问我吧~", r.isSensitive = !0, C([r, ...h.current])), i.index === -2 && (U(!1), A(!1), r.isLoading = !1, r.content = "回答已中止~", r.isSuspend = !0, C([r, ...h.current])), i.index === -1 && (U(!1), A(!1), r.isLoading = !1, r.reference = i.reference, C([r, ...h.current]), o.id && re && re({
|
|
419
439
|
applicationId: o.id,
|
|
420
440
|
sessionId: t,
|
|
421
441
|
message: r
|
|
422
|
-
})), i.index === -3 && (U(!1), A(!1), r.isLoading = !1, r.reference = i.reference, r.relatedQuesion = i.relatedQuesion,
|
|
442
|
+
})), i.index === -3 && (U(!1), A(!1), r.isLoading = !1, r.reference = i.reference, r.relatedQuesion = i.relatedQuesion, C([r, ...h.current]));
|
|
423
443
|
};
|
|
424
444
|
return e.ready ? e.addEventListener("message:updated", n) : e.addEventListener("ready", () => {
|
|
425
445
|
e.addEventListener("message:updated", n);
|
|
426
446
|
}), () => {
|
|
427
447
|
e == null || e.removeEventListener("message:updated", n);
|
|
428
448
|
};
|
|
429
|
-
}, [e]),
|
|
449
|
+
}, [e]), N(() => {
|
|
430
450
|
if (!e) {
|
|
431
|
-
|
|
451
|
+
we(!1);
|
|
432
452
|
return;
|
|
433
453
|
}
|
|
434
454
|
const t = (n) => {
|
|
435
|
-
|
|
455
|
+
we(n);
|
|
436
456
|
};
|
|
437
|
-
return
|
|
457
|
+
return we(e.frozen), e.addEventListener("frozen", t), () => {
|
|
438
458
|
e == null || e.removeEventListener("frozen", t);
|
|
439
459
|
};
|
|
440
|
-
}, [e]),
|
|
441
|
-
if (!
|
|
460
|
+
}, [e]), N(() => {
|
|
461
|
+
if (!I)
|
|
442
462
|
return;
|
|
443
|
-
const t =
|
|
463
|
+
const t = I.questionContextMaxLength || 4e3;
|
|
444
464
|
Tt(t);
|
|
445
|
-
}, [
|
|
446
|
-
|
|
447
|
-
}, [
|
|
465
|
+
}, [I, T]), N(() => {
|
|
466
|
+
ke && Z(ke.text);
|
|
467
|
+
}, [ke]);
|
|
448
468
|
const Zt = (t) => {
|
|
449
469
|
const n = t.size;
|
|
450
470
|
return n <= 0 ? (u.config({
|
|
451
|
-
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
471
|
+
getContainer: () => (f == null ? void 0 : f.current) || document.body,
|
|
472
|
+
prefixCls: "gbot-message"
|
|
452
473
|
}), u.error("该文件为空,请重新上传"), u.config({
|
|
453
|
-
getContainer: void 0
|
|
454
|
-
|
|
455
|
-
|
|
474
|
+
getContainer: void 0,
|
|
475
|
+
prefixCls: "gbot-message"
|
|
476
|
+
}), !1) : n > 20 * Nn ? (u.config({
|
|
477
|
+
getContainer: () => (f == null ? void 0 : f.current) || document.body,
|
|
478
|
+
prefixCls: "gbot-message"
|
|
456
479
|
}), u.error("图片须小于20M"), u.config({
|
|
457
|
-
getContainer: void 0
|
|
480
|
+
getContainer: void 0,
|
|
481
|
+
prefixCls: "gbot-message"
|
|
458
482
|
}), !1) : (_(t), !1);
|
|
459
483
|
}, Jt = (t) => j(void 0, null, function* () {
|
|
460
484
|
var n;
|
|
@@ -476,22 +500,22 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
476
500
|
knowledgeId: ((r = t.data) == null ? void 0 : r.id) || "",
|
|
477
501
|
type: 1
|
|
478
502
|
};
|
|
479
|
-
|
|
503
|
+
Ce(!0), T == null || T.postTicket(l).then((d) => {
|
|
480
504
|
T.uploadMinioFile(d.minio, n).then(() => {
|
|
481
|
-
var
|
|
482
|
-
const
|
|
483
|
-
i(`${location.protocol}//${
|
|
505
|
+
var x, B;
|
|
506
|
+
const k = (x = d.minio.endpoints) == null ? void 0 : x[0], y = d.minio.bucket, F = (B = d.minio.fileKeys) == null ? void 0 : B[0];
|
|
507
|
+
i(`${location.protocol}//${k}/${y}/${F}`);
|
|
484
508
|
}).catch(() => {
|
|
485
509
|
ae(""), _(void 0);
|
|
486
510
|
}).finally(() => {
|
|
487
|
-
|
|
511
|
+
Ce(!1);
|
|
488
512
|
});
|
|
489
513
|
}).catch(() => {
|
|
490
|
-
ae(""), _(void 0),
|
|
514
|
+
ae(""), _(void 0), Ce(!1);
|
|
491
515
|
});
|
|
492
516
|
});
|
|
493
517
|
};
|
|
494
|
-
|
|
518
|
+
N(() => {
|
|
495
519
|
const t = H.current;
|
|
496
520
|
t && !$e && t.scrollTo({
|
|
497
521
|
top: t.scrollHeight
|
|
@@ -500,7 +524,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
500
524
|
const Je = (t, n) => new Promise((a) => {
|
|
501
525
|
if (!n.file.url || !(o != null && o.id))
|
|
502
526
|
return a();
|
|
503
|
-
const i =
|
|
527
|
+
const i = mt(ut({}, n.file), {
|
|
504
528
|
type: 1
|
|
505
529
|
});
|
|
506
530
|
T == null || T.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
|
|
@@ -532,13 +556,13 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
532
556
|
var n;
|
|
533
557
|
if (!((n = e == null ? void 0 : e.data) != null && n.id))
|
|
534
558
|
return;
|
|
535
|
-
|
|
559
|
+
h.current = [...v.slice(1, v.length)], C(h.current);
|
|
536
560
|
const t = new oe("", e.data.id, S.System);
|
|
537
|
-
t.isWaiting = !0,
|
|
561
|
+
t.isWaiting = !0, h.current = [t, ...h.current], C(h.current), A(!0), U(!0), e.answerAgain();
|
|
538
562
|
});
|
|
539
|
-
|
|
563
|
+
N(() => {
|
|
540
564
|
var t, n;
|
|
541
|
-
Ue.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !Ye && ((n =
|
|
565
|
+
Ue.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !Ye && ((n = Ie.current) == null || n.clear());
|
|
542
566
|
}, [e]);
|
|
543
567
|
const rn = () => {
|
|
544
568
|
var a;
|
|
@@ -554,7 +578,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
554
578
|
te(!1);
|
|
555
579
|
return;
|
|
556
580
|
}
|
|
557
|
-
l.length < 10 ? te(!1) : te(!0),
|
|
581
|
+
l.length < 10 ? te(!1) : te(!0), C([...v, ...l.reverse()]);
|
|
558
582
|
});
|
|
559
583
|
}, an = (t) => j(void 0, null, function* () {
|
|
560
584
|
var n, a;
|
|
@@ -571,9 +595,9 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
571
595
|
(n = e == null ? void 0 : e.data) != null && n.id && (P(t.netOpen), J(t.enableNetOpen));
|
|
572
596
|
}) : (P(typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.default) == "boolean" ? s.connectNetwork.default : !1), J(o.arrange[0].enableNetOpen));
|
|
573
597
|
});
|
|
574
|
-
|
|
598
|
+
N(() => {
|
|
575
599
|
Pe();
|
|
576
|
-
}, [e]),
|
|
600
|
+
}, [e]), N(() => {
|
|
577
601
|
requestAnimationFrame(() => {
|
|
578
602
|
var n, a;
|
|
579
603
|
if (H.current) {
|
|
@@ -592,14 +616,14 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
592
616
|
}
|
|
593
617
|
}
|
|
594
618
|
});
|
|
595
|
-
}, [v]),
|
|
619
|
+
}, [v]), N(() => {
|
|
596
620
|
if (e)
|
|
597
621
|
return;
|
|
598
622
|
const t = () => {
|
|
599
|
-
const i = ((
|
|
600
|
-
var
|
|
623
|
+
const i = ((I == null ? void 0 : I.promptVariables) || []).filter((l) => l.type ? !(l.type === ve.User && l.key === "query") && !(l.type === ve.System && l.key === "datetime") && l.status === 1 : l.key !== "query" && l.status === 1).map((l, r) => {
|
|
624
|
+
var k, y;
|
|
601
625
|
let d = "";
|
|
602
|
-
return typeof (s == null ? void 0 : s.promptVariables) == "object" && (d = ((y = (
|
|
626
|
+
return typeof (s == null ? void 0 : s.promptVariables) == "object" && (d = ((y = (k = s.promptVariables.default) == null ? void 0 : k.find((F) => F.key === l.key && F.type === l.type)) == null ? void 0 : y.value) || ""), {
|
|
603
627
|
id: r + "",
|
|
604
628
|
key: l.key,
|
|
605
629
|
name: l.name,
|
|
@@ -609,10 +633,10 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
609
633
|
});
|
|
610
634
|
ue([...i].sort((l, r) => l.key.localeCompare(r.key)));
|
|
611
635
|
};
|
|
612
|
-
return
|
|
613
|
-
|
|
636
|
+
return I != null && I.ready ? t() : I == null || I.addEventListener("ready", t), () => {
|
|
637
|
+
I == null || I.removeEventListener("ready", t);
|
|
614
638
|
};
|
|
615
|
-
}, [e,
|
|
639
|
+
}, [e, I, s == null ? void 0 : s.promptVariables]);
|
|
616
640
|
const Se = () => L == null ? void 0 : L({
|
|
617
641
|
netOpen: E ? $.OPEN : $.CLOSE
|
|
618
642
|
}).then((t) => {
|
|
@@ -620,7 +644,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
620
644
|
return p == null || p(t), M(!1), P(!!((n = t.data) != null && n.netOpen)), J(!!((a = t.data) != null && a.enableNetOpen)), Xe(t), t;
|
|
621
645
|
}), et = pn(() => {
|
|
622
646
|
var t;
|
|
623
|
-
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(
|
|
647
|
+
return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(bt, {
|
|
624
648
|
application: o,
|
|
625
649
|
history: {
|
|
626
650
|
role: 1,
|
|
@@ -630,7 +654,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
630
654
|
sessionId: "",
|
|
631
655
|
reference: [],
|
|
632
656
|
searchReference: [],
|
|
633
|
-
messageTime:
|
|
657
|
+
messageTime: xt(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
|
|
634
658
|
actions: [],
|
|
635
659
|
isLoading: !1
|
|
636
660
|
},
|
|
@@ -638,7 +662,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
638
662
|
markdown: s == null ? void 0 : s.markdown
|
|
639
663
|
}) : null;
|
|
640
664
|
}, [o == null ? void 0 : o.arrange, v]);
|
|
641
|
-
return vn(
|
|
665
|
+
return vn(b, () => ({
|
|
642
666
|
getCurrentInputText: () => {
|
|
643
667
|
var t;
|
|
644
668
|
return (t = le.current) == null ? void 0 : t.getCurrentText();
|
|
@@ -647,7 +671,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
647
671
|
className: "agent-chat",
|
|
648
672
|
children: [Kt ? /* @__PURE__ */ c("div", {
|
|
649
673
|
className: "session-loading",
|
|
650
|
-
children: /* @__PURE__ */ c(
|
|
674
|
+
children: /* @__PURE__ */ c(ht, {})
|
|
651
675
|
}) : /* @__PURE__ */ z(un, {
|
|
652
676
|
children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ c(Mn, {
|
|
653
677
|
ref: Ae,
|
|
@@ -659,7 +683,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
659
683
|
}), /* @__PURE__ */ z("div", {
|
|
660
684
|
className: "chat-main",
|
|
661
685
|
id: "chat-main",
|
|
662
|
-
style:
|
|
686
|
+
style: It,
|
|
663
687
|
children: [/* @__PURE__ */ c("div", {
|
|
664
688
|
className: "chat-main-wrapper",
|
|
665
689
|
id: "scrollableDiv",
|
|
@@ -681,7 +705,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
681
705
|
},
|
|
682
706
|
inverse: !0,
|
|
683
707
|
endMessage: v.length > vt && // 少于一页不展示这个提示
|
|
684
|
-
((nt = H.current) != null && nt.scrollTop) && ((it = H.current) == null ? void 0 : it.scrollTop) < -10 ? /* @__PURE__ */ c(
|
|
708
|
+
((nt = H.current) != null && nt.scrollTop) && ((it = H.current) == null ? void 0 : it.scrollTop) < -10 ? /* @__PURE__ */ c(bn, {
|
|
685
709
|
plain: !0,
|
|
686
710
|
children: "没有更多数据了"
|
|
687
711
|
}) : null,
|
|
@@ -692,7 +716,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
692
716
|
textAlign: "center",
|
|
693
717
|
overflow: "hidden"
|
|
694
718
|
},
|
|
695
|
-
children: /* @__PURE__ */ c(
|
|
719
|
+
children: /* @__PURE__ */ c(ht, {})
|
|
696
720
|
}),
|
|
697
721
|
scrollableTarget: "scrollableDiv",
|
|
698
722
|
children: [v.map((t, n) => /* @__PURE__ */ c(Yn, {
|
|
@@ -710,9 +734,9 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
710
734
|
className: "main-empty",
|
|
711
735
|
children: [(s == null ? void 0 : s.greeting) !== !1 && /* @__PURE__ */ c(Fn, {
|
|
712
736
|
text: s === void 0 || s.greeting === !0 || ((ot = s.greeting) == null ? void 0 : ot.text) === void 0 ? pt.text : s.greeting.text,
|
|
713
|
-
icon: s === void 0 || s.greeting === !0 || ((st = s.greeting) == null ? void 0 : st.icon) === void 0 ?
|
|
737
|
+
icon: s === void 0 || s.greeting === !0 || ((st = s.greeting) == null ? void 0 : st.icon) === void 0 ? Nt || pt.icon : s.greeting.icon,
|
|
714
738
|
children: !!je.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, {
|
|
715
|
-
ref:
|
|
739
|
+
ref: Ie,
|
|
716
740
|
sid: (rt = e == null ? void 0 : e.data) == null ? void 0 : rt.id,
|
|
717
741
|
isRecommendClearing: ze,
|
|
718
742
|
data: je,
|
|
@@ -727,9 +751,9 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
727
751
|
var r, d;
|
|
728
752
|
t != null && t.id && (n ? (r = Je(n, t)) == null || r.finally(() => {
|
|
729
753
|
X(!1);
|
|
730
|
-
}) : (X(!1), M(!0), (d = Se()) == null || d.then((
|
|
754
|
+
}) : (X(!1), M(!0), (d = Se()) == null || d.then((k) => {
|
|
731
755
|
var y;
|
|
732
|
-
(y = Je(
|
|
756
|
+
(y = Je(k.id, t)) == null || y.finally(() => {
|
|
733
757
|
X(!1);
|
|
734
758
|
});
|
|
735
759
|
})));
|
|
@@ -792,7 +816,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
792
816
|
className: "footer-upload-action",
|
|
793
817
|
onClick: (t) => t.preventDefault(),
|
|
794
818
|
children: [/* @__PURE__ */ z(ye, {
|
|
795
|
-
children: [o.type === 2 && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ c(
|
|
819
|
+
children: [o.type === 2 && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ c(xn, {
|
|
796
820
|
disabled: !!ee || R,
|
|
797
821
|
accept: ".jpg, .png, .jpeg,.bmp",
|
|
798
822
|
listType: "picture-card",
|
|
@@ -814,7 +838,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
814
838
|
fontSize: "22px"
|
|
815
839
|
}
|
|
816
840
|
})
|
|
817
|
-
}) : /* @__PURE__ */ c(
|
|
841
|
+
}) : /* @__PURE__ */ c(kn, {
|
|
818
842
|
placement: "topLeft",
|
|
819
843
|
overlayClassName: "footer-upload-tooltip",
|
|
820
844
|
title: /* @__PURE__ */ c("div", {
|
|
@@ -837,7 +861,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
837
861
|
})
|
|
838
862
|
})
|
|
839
863
|
})
|
|
840
|
-
}),
|
|
864
|
+
}), be && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ c(Dn, {
|
|
841
865
|
appId: o == null ? void 0 : o.id,
|
|
842
866
|
ref: fe,
|
|
843
867
|
isFirstSession: Ye,
|
|
@@ -856,7 +880,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
856
880
|
});
|
|
857
881
|
}),
|
|
858
882
|
sid: (at = e == null ? void 0 : e.data) == null ? void 0 : at.id,
|
|
859
|
-
disabled:
|
|
883
|
+
disabled: Ne || R,
|
|
860
884
|
afterFileAdd: (t, n) => {
|
|
861
885
|
n && ce((a) => {
|
|
862
886
|
const i = a[n] || [];
|
|
@@ -912,7 +936,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
912
936
|
disabled: R
|
|
913
937
|
}), Lt && Et === "float" && /* @__PURE__ */ c("div", {
|
|
914
938
|
className: "session-history-drawer-component",
|
|
915
|
-
children: /* @__PURE__ */ c(
|
|
939
|
+
children: /* @__PURE__ */ c(wn, {
|
|
916
940
|
placement: "topRight",
|
|
917
941
|
showArrow: !1,
|
|
918
942
|
overlayClassName: "session-history-overlay",
|
|
@@ -941,7 +965,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
941
965
|
disabled: Be || !e || !v.length || R,
|
|
942
966
|
onClick: () => {
|
|
943
967
|
var t, n;
|
|
944
|
-
p == null || p(null), P(!1), (t = Ae.current) == null || t.clear(), (n =
|
|
968
|
+
p == null || p(null), P(!1), (t = Ae.current) == null || t.clear(), (n = Ie.current) == null || n.clear();
|
|
945
969
|
},
|
|
946
970
|
children: "新会话"
|
|
947
971
|
})]
|
|
@@ -953,8 +977,8 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
953
977
|
maxLength: Pt,
|
|
954
978
|
text: Dt,
|
|
955
979
|
networkStatus: !1,
|
|
956
|
-
loading: We ||
|
|
957
|
-
disabled: De || Me || R || We ||
|
|
980
|
+
loading: We || he,
|
|
981
|
+
disabled: De || Me || R || We || he,
|
|
958
982
|
onTextSend: Ge,
|
|
959
983
|
onChange: (t, n) => {
|
|
960
984
|
Z(t);
|
|
@@ -965,7 +989,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
965
989
|
size: 0,
|
|
966
990
|
children: /* @__PURE__ */ c(Q, {
|
|
967
991
|
type: "link",
|
|
968
|
-
disabled:
|
|
992
|
+
disabled: Ne || R,
|
|
969
993
|
ghost: !0,
|
|
970
994
|
icon: /* @__PURE__ */ c(ie, {
|
|
971
995
|
style: {
|
|
@@ -980,7 +1004,7 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
980
1004
|
})]
|
|
981
1005
|
})
|
|
982
1006
|
}), /* @__PURE__ */ c(On, {
|
|
983
|
-
tips:
|
|
1007
|
+
tips: Ct
|
|
984
1008
|
}), qe && /* @__PURE__ */ c(Un, {
|
|
985
1009
|
isvisible: qe,
|
|
986
1010
|
files: Mt,
|
|
@@ -1004,5 +1028,5 @@ ${t}` : t, l = new oe(i, a, S.User, n);
|
|
|
1004
1028
|
});
|
|
1005
1029
|
});
|
|
1006
1030
|
export {
|
|
1007
|
-
|
|
1031
|
+
wi as default
|
|
1008
1032
|
};
|