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