@glodon-aiot/agent-cli-ui 3.3.5-alpha.20 → 3.3.5-alpha.22

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.
@@ -2,36 +2,36 @@ var Wt = Object.defineProperty, Qt = Object.defineProperties;
2
2
  var _t = Object.getOwnPropertyDescriptors;
3
3
  var nt = Object.getOwnPropertySymbols;
4
4
  var Gt = Object.prototype.hasOwnProperty, Xt = Object.prototype.propertyIsEnumerable;
5
- var xe = (L, o, k) => o in L ? Wt(L, o, { enumerable: !0, configurable: !0, writable: !0, value: k }) : L[o] = k, it = (L, o) => {
6
- for (var k in o || (o = {}))
7
- Gt.call(o, k) && xe(L, k, o[k]);
5
+ var Ie = (L, o, v) => o in L ? Wt(L, o, { enumerable: !0, configurable: !0, writable: !0, value: v }) : L[o] = v, it = (L, o) => {
6
+ for (var v in o || (o = {}))
7
+ Gt.call(o, v) && Ie(L, v, o[v]);
8
8
  if (nt)
9
- for (var k of nt(o))
10
- Xt.call(o, k) && xe(L, k, o[k]);
9
+ for (var v of nt(o))
10
+ Xt.call(o, v) && Ie(L, v, o[v]);
11
11
  return L;
12
12
  }, ot = (L, o) => Qt(L, _t(o));
13
- var D = (L, o, k) => (xe(L, typeof o != "symbol" ? o + "" : o, k), k);
14
- var z = (L, o, k) => new Promise((e, x) => {
15
- var ge = (I) => {
13
+ var D = (L, o, v) => (Ie(L, typeof o != "symbol" ? o + "" : o, v), v);
14
+ var z = (L, o, v) => new Promise((e, w) => {
15
+ var ue = (x) => {
16
16
  try {
17
- H(k.next(I));
17
+ H(v.next(x));
18
18
  } catch (h) {
19
- x(h);
19
+ w(h);
20
20
  }
21
- }, b = (I) => {
21
+ }, k = (x) => {
22
22
  try {
23
- H(k.throw(I));
23
+ H(v.throw(x));
24
24
  } catch (h) {
25
- x(h);
25
+ w(h);
26
26
  }
27
- }, H = (I) => I.done ? e(I.value) : Promise.resolve(I.value).then(ge, b);
28
- H((k = k.apply(L, o)).next());
27
+ }, H = (x) => x.done ? e(x.value) : Promise.resolve(x.value).then(ue, k);
28
+ H((v = v.apply(L, o)).next());
29
29
  });
30
30
  import { jsx as c, jsxs as A } from "react/jsx-runtime";
31
31
  import { memo as Zt, useState as m, useRef as B, useContext as Jt, useEffect as F, useMemo as St } from "react";
32
- /* empty css */import { Divider as en, Spin as tn, Button as _, Space as le, Upload as nn, Tooltip as on, notification as de, message as u } from "antd";
33
- import ce from "../../components/Iconfont/index.mjs";
34
- import { IHistoryRole as G, ChatMessageRole as st, PromptVariableType as fe } from "@glodon-aiot/apis";
32
+ /* empty css */import { Divider as en, Spin as tn, Button as _, Space as de, Upload as nn, Tooltip as on, notification as ce, message as u } from "antd";
33
+ import fe from "../../components/Iconfont/index.mjs";
34
+ import { IHistoryRole as G, ChatMessageRole as st, PromptVariableType as ge } from "@glodon-aiot/apis";
35
35
  import lt from "./HistoryItem/index.mjs";
36
36
  import dt from "dayjs";
37
37
  import { v4 as ct } from "uuid";
@@ -48,9 +48,9 @@ import { CameraOutlined as hn, PlusOutlined as mn } from "@ant-design/icons";
48
48
  import yn from "./Tools/UploadKnowledgeFiles/index.mjs";
49
49
  import pn from "../UploadingPrompt/index.mjs";
50
50
  import vn from "./PromptSetting/index.mjs";
51
- import { useMemoizedFn as Ie } from "ahooks";
52
- import kn from "./Tools/SessionListDrawer/index.mjs";
53
- import bn from "react-infinite-scroll-component";
51
+ import { useMemoizedFn as Le } from "ahooks";
52
+ import bn from "./Tools/SessionListDrawer/index.mjs";
53
+ import kn from "react-infinite-scroll-component";
54
54
  import wn from "./Tools/ConnectToNetwork/index.mjs";
55
55
  import xn from "./Tools/PromptManager/index.mjs";
56
56
  import In from "../../assets/icon.svg.mjs";
@@ -58,8 +58,8 @@ const Ln = Zt(lt), rt = {
58
58
  icon: In,
59
59
  text: "今天我能帮你什么?"
60
60
  };
61
- class J {
62
- constructor(o, k, e, x) {
61
+ class S {
62
+ constructor(o, v, e, w) {
63
63
  D(this, "messageTime");
64
64
  D(this, "isWaiting");
65
65
  D(this, "messageId");
@@ -69,42 +69,42 @@ class J {
69
69
  D(this, "isSensitive");
70
70
  D(this, "isSuspend");
71
71
  D(this, "comment");
72
- this.content = o, this.sessionId = k, this.role = e, this.files = x, this.content = o, this.role = e, this.sessionId = k, this.files = x, this.messageTime = dt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = ct(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
72
+ this.content = o, this.sessionId = v, this.role = e, this.files = w, this.content = o, this.role = e, this.sessionId = v, this.files = w, this.messageTime = dt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = ct(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
73
73
  isAgree: 0
74
74
  };
75
75
  }
76
76
  }
77
77
  const at = 10, ei = (L) => {
78
- var Ye, Ke, We, Qe, _e, Ge, Xe, Ze, Je, Se, et;
78
+ var Ke, We, Qe, _e, Ge, Xe, Ze, Je, Se, et, tt;
79
79
  const {
80
80
  application: o,
81
- docViewerUrl: k = "",
81
+ docViewerUrl: v = "",
82
82
  currentSession: e,
83
- onCreateSession: x,
84
- embeddingService: ge,
85
- setCurrentSession: b,
83
+ onCreateSession: w,
84
+ embeddingService: ue,
85
+ setCurrentSession: k,
86
86
  networkStatus: H,
87
- setNetworkStatus: I
88
- } = L, [h, C] = m([]), [ft, S] = m(), [ue, Le] = m(), E = B(null), {
89
- service: T,
87
+ setNetworkStatus: x
88
+ } = L, [h, C] = m([]), [ft, ee] = m(), [he, Ce] = m(), R = B(null), {
89
+ service: P,
90
90
  agentClient: N,
91
91
  depId: gt,
92
92
  footer: ut,
93
93
  transform: g,
94
- defaultInput: he,
95
- onMessage: ee,
96
- onHistoryLoad: Ce,
94
+ defaultInput: me,
95
+ onMessage: te,
96
+ onHistoryLoad: Ne,
97
97
  beforeMessageSend: j,
98
98
  bodyStyle: ht,
99
99
  disabled: M,
100
100
  features: a,
101
101
  popupContainer: f,
102
102
  icon: mt
103
- } = Jt(sn), [Ne, me] = m(!1), y = B(h), Te = B(), [yt, pt] = m(0), [X, q] = m(), [Y, te] = m(""), [Fe, ye] = m(!1), pe = B(null), [Pe, vt] = m([]), [Ee, K] = m(!1), [Re, kt] = m(!1), [bt, wt] = m(""), [xt, W] = m(), [ne, ie] = m({}), oe = B(null), De = B(null), ve = B(null), [He, It] = m(!1), [Lt, Ct] = m([]), [Nt, se] = m(!0), [Tt, Ft] = m(!0), [Me, O] = m(!1), [ke, V] = m(!1), [Oe, Pt] = m(!1), [P, re] = m(typeof (a == null ? void 0 : a.promptVariables) == "object" ? a.promptVariables.default || [] : []), [Et, Rt] = m(typeof (a == null ? void 0 : a.knowledges) == "object" && a.knowledges.default || void 0), [Ue, U] = m(!1), [ze, Z] = m(!1), [Dt, Q] = m(typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.default) == "boolean" ? a.connectNetwork.default : !1), [je, ae] = m(!1);
103
+ } = Jt(sn), [Pe, ye] = m(!1), y = B(h), Te = B(), [yt, pt] = m(0), [X, q] = m(), [Y, ne] = m(""), [Fe, pe] = m(!1), ve = B(null), [Ee, vt] = m([]), [Re, K] = m(!1), [De, bt] = m(!1), [kt, wt] = m(""), [xt, W] = m(), [ie, oe] = m({}), se = B(null), He = B(null), be = B(null), [Me, It] = m(!1), [Lt, Ct] = m([]), [Nt, re] = m(!0), [Pt, Tt] = m(!0), [Oe, O] = m(!1), [ke, V] = m(!1), [Ue, Ft] = m(!1), [E, ae] = m(typeof (a == null ? void 0 : a.promptVariables) == "object" ? a.promptVariables.default || [] : []), [Et, Rt] = m(typeof (a == null ? void 0 : a.knowledges) == "object" && a.knowledges.default || void 0), [ze, U] = m(!1), [je, Z] = m(!1), [Dt, Q] = m(typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.default) == "boolean" ? a.connectNetwork.default : !1), [Ve, le] = m(!1);
104
104
  F(() => {
105
105
  var r, i;
106
106
  e && (y.current = []), C([]);
107
- const t = E.current;
107
+ const t = R.current;
108
108
  if (t && t.scrollTo({
109
109
  top: 0
110
110
  }), !((r = e == null ? void 0 : e.data) != null && r.id))
@@ -115,7 +115,7 @@ const at = 10, ei = (L) => {
115
115
  }
116
116
  const n = (l) => {
117
117
  var s;
118
- (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), Ce && Ce({
118
+ (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), Ne && Ne({
119
119
  applicationId: o.id,
120
120
  sessionId: e.data.id,
121
121
  histories: l
@@ -127,7 +127,7 @@ const at = 10, ei = (L) => {
127
127
  }, [e]), F(() => {
128
128
  const t = () => {
129
129
  var n;
130
- (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 && Rt(e.knowledges), I(e.netOpen));
130
+ (n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ae(e.promptVariables.sort((r, i) => r.key.localeCompare(i.key))), e.knowledges && Rt(e.knowledges), x(e.netOpen));
131
131
  };
132
132
  return e == null || e.addEventListener("data:updated", t), () => {
133
133
  e == null || e.removeEventListener("data:updated", t);
@@ -138,11 +138,11 @@ const at = 10, ei = (L) => {
138
138
  return;
139
139
  const t = (r) => {
140
140
  var i;
141
- console.error(r.message, r.cause, "e.case"), de.config({
141
+ console.error(r.message, r.cause, "e.case"), ce.config({
142
142
  getContainer: () => (f == null ? void 0 : f.current) || document.body
143
- }), de.error({
143
+ }), ce.error({
144
144
  message: ((i = r.cause) == null ? void 0 : i.message) || r.message
145
- }), de.config({
145
+ }), ce.config({
146
146
  getContainer: void 0
147
147
  });
148
148
  };
@@ -164,17 +164,17 @@ const at = 10, ei = (L) => {
164
164
  return;
165
165
  } else
166
166
  e.clear().then(() => {
167
- const i = new J("", t, G.System);
167
+ const i = new S("", t, G.System);
168
168
  i.isContext = !0, C([i, ...h]);
169
169
  });
170
170
  };
171
171
  F(() => {
172
- o != null && o.id && (T == null || T.getRecommendQues(o.id).then((t) => {
172
+ o != null && o.id && (P == null || P.getRecommendQues(o.id).then((t) => {
173
173
  vt(t);
174
174
  }));
175
175
  }, [gt, o]);
176
- const Ve = (t) => z(void 0, null, function* () {
177
- var w, p;
176
+ const $e = (t) => z(void 0, null, function* () {
177
+ var p, T;
178
178
  if (M) {
179
179
  u.config({
180
180
  getContainer: () => (f == null ? void 0 : f.current) || document.body
@@ -192,7 +192,7 @@ const at = 10, ei = (L) => {
192
192
  });
193
193
  return;
194
194
  }
195
- if (!(P == null ? void 0 : P.every((v) => !!(v != null && v.value))))
195
+ if (!(E == null ? void 0 : E.every((b) => !!(b != null && b.value))))
196
196
  if (g != null && g.promptVariables) {
197
197
  u.config({
198
198
  getContainer: () => (f == null ? void 0 : f.current) || document.body
@@ -201,7 +201,7 @@ const at = 10, ei = (L) => {
201
201
  });
202
202
  return;
203
203
  } else
204
- console.error("变量值不能为空", P == null ? void 0 : P.map((v) => !!(v != null && v.value)));
204
+ console.error("变量值不能为空", E == null ? void 0 : E.map((b) => !!(b != null && b.value)));
205
205
  if (ke) {
206
206
  u.config({
207
207
  getContainer: () => (f == null ? void 0 : f.current) || document.body
@@ -210,7 +210,7 @@ const at = 10, ei = (L) => {
210
210
  });
211
211
  return;
212
212
  }
213
- if (Ne) {
213
+ if (Pe) {
214
214
  u.config({
215
215
  getContainer: () => (f == null ? void 0 : f.current) || document.body
216
216
  }), u.error("等待初始化"), u.config({
@@ -234,20 +234,20 @@ const at = 10, ei = (L) => {
234
234
  });
235
235
  return;
236
236
  }
237
- q(void 0), te("");
238
- const i = (w = e == null ? void 0 : e.data) == null ? void 0 : w.id;
237
+ q(void 0), ne("");
238
+ const i = (p = e == null ? void 0 : e.data) == null ? void 0 : p.id;
239
239
  if (!i) {
240
- x == null || x({
240
+ w == null || w({
241
241
  netOpen: H ? 1 : 2
242
- }).then((v) => {
243
- var R, $;
244
- U(!0), I(!!((R = v.data) != null && R.netOpen)), Q(!!(($ = v.data) != null && $.enableNetOpen)), Mt(v).then(() => {
245
- b == null || b(v), U(!1), Le(n);
242
+ }).then((b) => {
243
+ var $, J;
244
+ U(!0), x(!!(($ = b.data) != null && $.netOpen)), Q(!!((J = b.data) != null && J.enableNetOpen)), Mt(b).then(() => {
245
+ k == null || k(b), U(!1), Ce(n);
246
246
  });
247
247
  });
248
248
  return;
249
249
  }
250
- ae(!0);
250
+ le(!0);
251
251
  const l = Y ? `![](${Y})
252
252
  ${n}` : n;
253
253
  let s;
@@ -259,23 +259,23 @@ ${n}` : n;
259
259
  content: l,
260
260
  sessionId: i,
261
261
  role: st.User,
262
- files: ne[i]
262
+ files: ie[i]
263
263
  }
264
264
  }) : s = !0;
265
- } catch (v) {
265
+ } catch (b) {
266
266
  s = !1;
267
267
  }
268
- if (ae(!1), s === !1)
268
+ if (le(!1), s === !1)
269
269
  return;
270
270
  let d = n;
271
- typeof s == "object" && (d = s.content || n), ((p = ne[i]) == null ? void 0 : p.length) > 0 ? Ot(d) : be(d);
271
+ typeof s == "object" && (d = s.content || n), (yield e.setPromptVariables(E)) && (((T = ie[i]) == null ? void 0 : T.length) > 0 ? Ot(d) : we(d));
272
272
  }), Mt = (t) => new Promise((n, r) => z(void 0, null, function* () {
273
- const s = (t == null ? void 0 : t.promptVariables).filter((d) => !(d.type === fe.User && d.key === "query") && !(d.type === fe.System && d.key === "datetime")).map((d) => {
273
+ const s = (t == null ? void 0 : t.promptVariables).filter((d) => !(d.type === ge.User && d.key === "query") && !(d.type === ge.System && d.key === "datetime")).map((d) => {
274
274
  var p;
275
- const w = (p = P.find((v) => v.key === d.key && v.type === d.type)) == null ? void 0 : p.value;
276
- return d.value = w || "", d;
275
+ const I = (p = E.find((T) => T.key === d.key && T.type === d.type)) == null ? void 0 : p.value;
276
+ return d.value = I || "", d;
277
277
  });
278
- re(s.sort((d, w) => d.key.localeCompare(w.key))), yield t == null ? void 0 : t.setPromptVariables(s).catch((d) => {
278
+ ae(s.sort((d, I) => d.key.localeCompare(I.key))), yield t == null ? void 0 : t.setPromptVariables(s).catch((d) => {
279
279
  console.error(d), u.config({
280
280
  getContainer: () => (f == null ? void 0 : f.current) || document.body
281
281
  }), u.error(d.message), u.config({
@@ -283,28 +283,28 @@ ${n}` : n;
283
283
  });
284
284
  }), n();
285
285
  })), Ot = (t) => {
286
- var s, d, w;
287
- if (se(!1), !((s = e == null ? void 0 : e.data) != null && s.id) || !(o != null && o.id))
286
+ var s, d, I;
287
+ if (re(!1), !((s = e == null ? void 0 : e.data) != null && s.id) || !(o != null && o.id))
288
288
  return;
289
289
  const n = ((d = e.data) == null ? void 0 : d.id) || "", r = [];
290
290
  let i = [], l = /* @__PURE__ */ new Set();
291
- (w = ne[n]) == null || w.forEach((p) => {
291
+ (I = ie[n]) == null || I.forEach((p) => {
292
292
  l.has(p.id) || (i.push(p), l.add(p.id));
293
- }), Promise.all(i.map((p) => T == null ? void 0 : T.patchApplicationIdKnowledgeIdFileId(o == null ? void 0 : o.id, n, p.id, {
293
+ }), Promise.all(i.map((p) => P == null ? void 0 : P.patchApplicationIdKnowledgeIdFileId(o == null ? void 0 : o.id, n, p.id, {
294
294
  enabled: 1
295
- }).then((v) => {
295
+ }).then((T) => {
296
296
  r.push(p);
297
297
  }))).then((p) => {
298
- se(!0), be(t, r);
298
+ re(!0), we(t, r);
299
299
  }).catch((p) => {
300
300
  throw Error(p);
301
301
  });
302
302
  };
303
303
  F(() => {
304
- if (!ue || !e)
304
+ if (!he || !e)
305
305
  return;
306
- const t = ue, n = () => z(void 0, null, function* () {
307
- ae(!0);
306
+ const t = he, n = () => z(void 0, null, function* () {
307
+ le(!0);
308
308
  const r = Y ? `![](${Y})
309
309
  ${t}` : t;
310
310
  let i;
@@ -316,51 +316,51 @@ ${t}` : t;
316
316
  content: r,
317
317
  sessionId: e.id,
318
318
  role: st.User,
319
- files: ne[e.id]
319
+ files: ie[e.id]
320
320
  }
321
321
  }) : i = !0;
322
322
  } catch (l) {
323
323
  i = !1;
324
324
  }
325
- ae(!1), i !== !1 && (be(t), Le(void 0));
325
+ le(!1), i !== !1 && (we(t), Ce(void 0));
326
326
  });
327
327
  return e.ready ? n() : e.addEventListener("ready", n, !0), () => {
328
328
  e == null || e.removeEventListener("ready", n);
329
329
  };
330
- }, [ue, e]);
331
- const be = (t, n) => z(void 0, null, function* () {
332
- var p, v;
330
+ }, [he, e]);
331
+ const we = (t, n) => z(void 0, null, function* () {
332
+ var p, T;
333
333
  const r = (p = e == null ? void 0 : e.data) == null ? void 0 : p.id;
334
334
  if (!r)
335
335
  return;
336
336
  V(!0), O(!0);
337
337
  const i = Y ? `![](${Y})
338
- ${t}` : t, l = new J(i, r, G.User, n);
339
- S(void 0), W(void 0), y.current = [l, ...h], C(y.current), o.id && ee && ee({
338
+ ${t}` : t, l = new S(i, r, G.User, n);
339
+ ee(void 0), W(void 0), y.current = [l, ...h], C(y.current), o.id && te && te({
340
340
  applicationId: o.id,
341
341
  sessionId: r,
342
342
  message: l
343
343
  });
344
- const s = new J("", r, G.System);
344
+ const s = new S("", r, G.System);
345
345
  s.isWaiting = !0, y.current = [s, ...y.current], C(y.current);
346
- const d = (n == null ? void 0 : n.map((R) => R.id)) || [], w = {
346
+ const d = (n == null ? void 0 : n.map((b) => b.id)) || [], I = {
347
347
  stream: rn.stream,
348
348
  referenceFirst: !1
349
349
  };
350
350
  if (g != null && g.promptVariables) {
351
- const R = P == null ? void 0 : P.reduce(($, tt) => ($[tt.key] = tt.value, $), {});
352
- w.formatValues = R, e.setPromptVariables(P);
351
+ const b = E == null ? void 0 : E.reduce(($, J) => ($[J.key] = J.value, $), {});
352
+ I.formatValues = b;
353
353
  }
354
354
  if (g != null && g.knowledges) {
355
- const R = Et;
356
- w.knowledges = R;
355
+ const b = Et;
356
+ I.knowledges = b;
357
357
  }
358
358
  yield e.send({
359
359
  text: i,
360
360
  fileIds: d
361
- }, w), ie({
361
+ }, I), oe({
362
362
  [r]: []
363
- }), (v = oe.current) == null || v.update();
363
+ }), (T = se.current) == null || T.update();
364
364
  });
365
365
  F(() => {
366
366
  var r;
@@ -371,11 +371,11 @@ ${t}` : t, l = new J(i, r, G.User, n);
371
371
  if (!i.sessionId || i.sessionId && i.sessionId !== Te.current || i.role === G.User)
372
372
  return;
373
373
  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))
374
- return de.error({
374
+ return ce.error({
375
375
  message: i.content
376
376
  });
377
- const l = i.actions || [], s = new J(i.content, t, G.Robot);
378
- 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({
377
+ const l = i.actions || [], s = new S(i.content, t, G.Robot);
378
+ 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 && te && te({
379
379
  applicationId: o.id,
380
380
  sessionId: t,
381
381
  message: s
@@ -388,13 +388,13 @@ ${t}` : t, l = new J(i, r, G.User, n);
388
388
  };
389
389
  }, [e]), F(() => {
390
390
  if (!e) {
391
- me(!1);
391
+ ye(!1);
392
392
  return;
393
393
  }
394
394
  const t = (n) => {
395
- me(n);
395
+ ye(n);
396
396
  };
397
- return me(e.frozen), e.addEventListener("frozen", t), () => {
397
+ return ye(e.frozen), e.addEventListener("frozen", t), () => {
398
398
  e == null || e.removeEventListener("frozen", t);
399
399
  };
400
400
  }, [e]), F(() => {
@@ -402,9 +402,9 @@ ${t}` : t, l = new J(i, r, G.User, n);
402
402
  return;
403
403
  const t = N.questionContextMaxLength || 4e3;
404
404
  pt(t);
405
- }, [N, T]), F(() => {
406
- he && W(he.text);
407
- }, [he]);
405
+ }, [N, P]), F(() => {
406
+ me && W(me.text);
407
+ }, [me]);
408
408
  const Ut = (t) => {
409
409
  const n = t.size;
410
410
  return n <= 0 ? (u.config({
@@ -418,15 +418,15 @@ ${t}` : t, l = new J(i, r, G.User, n);
418
418
  }), !1) : (q(t), !1);
419
419
  }, zt = (t) => z(void 0, null, function* () {
420
420
  var n;
421
- return q(t), (n = e == null ? void 0 : e.data) != null && n.id ? $e(e, t) : new Promise((r) => {
422
- U(!0), x == null || x({
421
+ return q(t), (n = e == null ? void 0 : e.data) != null && n.id ? Ae(e, t) : new Promise((r) => {
422
+ U(!0), w == null || w({
423
423
  netOpen: H ? 1 : 2
424
424
  }).then((i) => {
425
425
  var l, s;
426
- b == null || b(i), U(!1), I(!!((l = i.data) != null && l.netOpen)), Q(!!((s = i.data) != null && s.enableNetOpen)), r($e(i, t));
426
+ k == null || k(i), U(!1), x(!!((l = i.data) != null && l.netOpen)), Q(!!((s = i.data) != null && s.enableNetOpen)), r(Ae(i, t));
427
427
  });
428
428
  });
429
- }), $e = (t, n) => {
429
+ }), Ae = (t, n) => {
430
430
  const r = dn(n.name);
431
431
  return new Promise((i) => {
432
432
  var s;
@@ -436,42 +436,42 @@ ${t}` : t, l = new J(i, r, G.User, n);
436
436
  knowledgeId: ((s = t.data) == null ? void 0 : s.id) || "",
437
437
  type: 1
438
438
  };
439
- ye(!0), T == null || T.postTicket(l).then((d) => {
440
- T.uploadMinioFile(d.minio, n).then(() => {
441
- var R, $;
442
- const w = (R = d.minio.endpoints) == null ? void 0 : R[0], p = d.minio.bucket, v = ($ = d.minio.fileKeys) == null ? void 0 : $[0];
443
- i(`${location.protocol}//${w}/${p}/${v}`);
439
+ pe(!0), P == null || P.postTicket(l).then((d) => {
440
+ P.uploadMinioFile(d.minio, n).then(() => {
441
+ var b, $;
442
+ const I = (b = d.minio.endpoints) == null ? void 0 : b[0], p = d.minio.bucket, T = ($ = d.minio.fileKeys) == null ? void 0 : $[0];
443
+ i(`${location.protocol}//${I}/${p}/${T}`);
444
444
  }).catch(() => {
445
- te(""), q(void 0);
445
+ ne(""), q(void 0);
446
446
  }).finally(() => {
447
- ye(!1);
447
+ pe(!1);
448
448
  });
449
449
  }).catch(() => {
450
- te(""), q(void 0), ye(!1);
450
+ ne(""), q(void 0), pe(!1);
451
451
  });
452
452
  });
453
453
  };
454
454
  F(() => {
455
- const t = E.current;
456
- t && !Oe && t.scrollTo({
455
+ const t = R.current;
456
+ t && !Ue && t.scrollTo({
457
457
  top: t.scrollHeight
458
458
  });
459
459
  }, [h]);
460
- const Ae = (t, n) => new Promise((r) => {
460
+ const Be = (t, n) => new Promise((r) => {
461
461
  if (!n.file.url || !(o != null && o.id))
462
462
  return r();
463
463
  const i = ot(it({}, n.file), {
464
464
  type: 1
465
465
  });
466
- T == null || T.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
466
+ P == null || P.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, i).finally(() => {
467
467
  var l;
468
- (l = oe.current) == null || l.update().finally(r);
468
+ (l = se.current) == null || l.update().finally(r);
469
469
  });
470
470
  }), jt = () => {
471
471
  var t;
472
472
  (t = e == null ? void 0 : e.data) != null && t.id && (O(!1), e.suspend());
473
473
  }, Vt = (t) => {
474
- const n = E.current;
474
+ const n = R.current;
475
475
  n && setTimeout(() => {
476
476
  n.scrollTo({
477
477
  top: n.scrollHeight,
@@ -479,26 +479,26 @@ ${t}` : t, l = new J(i, r, G.User, n);
479
479
  });
480
480
  }, t == null ? void 0 : t.ms);
481
481
  }, $t = () => {
482
- if (!E.current)
482
+ if (!R.current)
483
483
  return;
484
- const t = E.current.scrollTop <= -80;
485
- Pt(t);
486
- }, At = Ie((t) => {
484
+ const t = R.current.scrollTop <= -80;
485
+ Ft(t);
486
+ }, At = Le((t) => {
487
487
  var n, r;
488
- (n = pe.current) == null || n.update(t), (r = pe.current) == null || r.focus();
489
- }), Bt = Ie((t) => {
490
- Ve(t);
491
- }), qt = Ie(() => {
488
+ (n = ve.current) == null || n.update(t), (r = ve.current) == null || r.focus();
489
+ }), Bt = Le((t) => {
490
+ $e(t);
491
+ }), qt = Le(() => {
492
492
  var n;
493
493
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
494
494
  return;
495
495
  y.current = [...h.slice(1, h.length)], C(y.current);
496
- const t = new J("", e.data.id, G.System);
496
+ const t = new S("", e.data.id, G.System);
497
497
  t.isWaiting = !0, y.current = [t, ...y.current], C(y.current), V(!0), O(!0), e.answerAgain();
498
498
  });
499
499
  F(() => {
500
500
  var t, n;
501
- Te.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !Ue && ((n = ve.current) == null || n.clear());
501
+ Te.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !ze && ((n = be.current) == null || n.clear());
502
502
  }, [e]);
503
503
  const Yt = () => {
504
504
  var r;
@@ -519,24 +519,24 @@ ${t}` : t, l = new J(i, r, G.User, n);
519
519
  }, Kt = (t) => z(void 0, null, function* () {
520
520
  var n, r;
521
521
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
522
- I(t);
522
+ x(t);
523
523
  else {
524
524
  if (yield e.setNetOpen(t), !((r = e.data) != null && r.id))
525
525
  return;
526
- I(t);
526
+ x(t);
527
527
  }
528
- }), we = () => z(void 0, null, function* () {
528
+ }), xe = () => z(void 0, null, function* () {
529
529
  e ? e.fetchData().then((t) => {
530
530
  var n;
531
- (n = e == null ? void 0 : e.data) != null && n.id && (I(t.netOpen), Q(t.enableNetOpen));
532
- }) : (I(!1), Q(o.arrange[0].enableNetOpen));
531
+ (n = e == null ? void 0 : e.data) != null && n.id && (x(t.netOpen), Q(t.enableNetOpen));
532
+ }) : (x(!1), Q(o.arrange[0].enableNetOpen));
533
533
  });
534
534
  F(() => {
535
- we();
535
+ xe();
536
536
  }, [e]), F(() => {
537
537
  var t, n;
538
- if (E.current) {
539
- const r = document.getElementById("chat-main"), i = (t = E.current) == null ? void 0 : t.querySelector(".infinite-scroll-component__outerdiv"), l = (n = E.current) == null ? void 0 : n.querySelector(".infinite-scroll-component");
538
+ if (R.current) {
539
+ const r = document.getElementById("chat-main"), i = (t = R.current) == null ? void 0 : t.querySelector(".infinite-scroll-component__outerdiv"), l = (n = R.current) == null ? void 0 : n.querySelector(".infinite-scroll-component");
540
540
  if (!i || !l || !r)
541
541
  return;
542
542
  const s = r.offsetHeight;
@@ -555,12 +555,12 @@ ${t}` : t, l = new J(i, r, G.User, n);
555
555
  return;
556
556
  const t = () => {
557
557
  const i = ((N == null ? void 0 : N.promptVariables) || []).filter(
558
- (l) => !(l.type === fe.User && l.key === "query") && !(l.type === fe.System && l.key === "datetime") && l.status === 1
558
+ (l) => !(l.type === ge.User && l.key === "query") && !(l.type === ge.System && l.key === "datetime") && l.status === 1
559
559
  // 只要求输入被引用的变量
560
560
  ).map((l, s) => {
561
- var w, p;
561
+ var I, p;
562
562
  let d = "";
563
- return typeof (a == null ? void 0 : a.promptVariables) == "object" && (d = ((p = (w = a.promptVariables.default) == null ? void 0 : w.find((v) => v.key === l.key && v.type === l.type)) == null ? void 0 : p.value) || ""), {
563
+ return typeof (a == null ? void 0 : a.promptVariables) == "object" && (d = ((p = (I = a.promptVariables.default) == null ? void 0 : I.find((T) => T.key === l.key && T.type === l.type)) == null ? void 0 : p.value) || ""), {
564
564
  id: s + "",
565
565
  key: l.key,
566
566
  name: l.name,
@@ -568,18 +568,18 @@ ${t}` : t, l = new J(i, r, G.User, n);
568
568
  type: l.type
569
569
  };
570
570
  });
571
- re([...i].sort((l, s) => l.key.localeCompare(s.key)));
571
+ ae([...i].sort((l, s) => l.key.localeCompare(s.key)));
572
572
  };
573
573
  return N != null && N.ready ? t() : N == null || N.addEventListener("ready", t), () => {
574
574
  N == null || N.removeEventListener("ready", t);
575
575
  };
576
576
  }, [e, N, a == null ? void 0 : a.promptVariables]);
577
- const Be = () => x == null ? void 0 : x({
577
+ const qe = () => w == null ? void 0 : w({
578
578
  netOpen: H ? 1 : 2
579
579
  }).then((t) => {
580
580
  var n, r;
581
- return b == null || b(t), U(!1), I(!!((n = t.data) != null && n.netOpen)), Q(!!((r = t.data) != null && r.enableNetOpen)), t;
582
- }), qe = St(() => {
581
+ return k == null || k(t), U(!1), x(!!((n = t.data) != null && n.netOpen)), Q(!!((r = t.data) != null && r.enableNetOpen)), t;
582
+ }), Ye = St(() => {
583
583
  var t;
584
584
  return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(lt, {
585
585
  application: o,
@@ -602,12 +602,12 @@ ${t}` : t, l = new J(i, r, G.User, n);
602
602
  return /* @__PURE__ */ A("div", {
603
603
  className: "agent-chat",
604
604
  children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ c(vn, {
605
- ref: De,
605
+ ref: He,
606
606
  appId: o.id,
607
607
  currentSession: e,
608
- promptVariables: P,
609
- setPromptVariables: re,
610
- setCurrentSession: b
608
+ promptVariables: E,
609
+ setPromptVariables: ae,
610
+ setCurrentSession: k
611
611
  }), /* @__PURE__ */ A("div", {
612
612
  className: "chat-main",
613
613
  id: "chat-main",
@@ -621,9 +621,9 @@ ${t}` : t, l = new J(i, r, G.User, n);
621
621
  display: "flex",
622
622
  flexDirection: "column-reverse"
623
623
  },
624
- ref: E,
624
+ ref: R,
625
625
  onScroll: $t,
626
- children: (Ye = e == null ? void 0 : e.data) != null && Ye.id && (h != null && h.length) ? /* @__PURE__ */ A(bn, {
626
+ children: (Ke = e == null ? void 0 : e.data) != null && Ke.id && (h != null && h.length) ? /* @__PURE__ */ A(kn, {
627
627
  dataLength: h.length,
628
628
  next: Yt,
629
629
  style: {
@@ -633,11 +633,11 @@ ${t}` : t, l = new J(i, r, G.User, n);
633
633
  },
634
634
  inverse: !0,
635
635
  endMessage: h.length > at && // 少于一页不展示这个提示
636
- ((Ke = E.current) != null && Ke.scrollTop) && ((We = E.current) == null ? void 0 : We.scrollTop) < -10 ? /* @__PURE__ */ c(en, {
636
+ ((We = R.current) != null && We.scrollTop) && ((Qe = R.current) == null ? void 0 : Qe.scrollTop) < -10 ? /* @__PURE__ */ c(en, {
637
637
  plain: !0,
638
638
  children: "没有更多数据了"
639
639
  }) : null,
640
- hasMore: ze,
640
+ hasMore: je,
641
641
  loader: /* @__PURE__ */ c("div", {
642
642
  style: {
643
643
  height: "50px",
@@ -651,45 +651,45 @@ ${t}` : t, l = new J(i, r, G.User, n);
651
651
  application: o,
652
652
  currentSession: e,
653
653
  history: t,
654
- docViewerUrl: k,
654
+ docViewerUrl: v,
655
655
  isLastHistory: n === 0,
656
656
  onRelatedClick: Bt,
657
657
  onAgainClick: qt,
658
658
  onEditClick: At,
659
659
  markdown: a == null ? void 0 : a.markdown
660
- }, t.messageId + n)), !ze && qe]
660
+ }, t.messageId + n)), !je && Ye]
661
661
  }) : /* @__PURE__ */ A("div", {
662
662
  className: "main-empty",
663
663
  children: [(a == null ? void 0 : a.greeting) !== !1 && /* @__PURE__ */ c(gn, {
664
- text: a === void 0 || a.greeting === !0 || ((Qe = a.greeting) == null ? void 0 : Qe.text) === void 0 ? rt.text : a.greeting.text,
665
- icon: a === void 0 || a.greeting === !0 || ((_e = a.greeting) == null ? void 0 : _e.icon) === void 0 ? mt || rt.icon : a.greeting.icon,
666
- children: !!Pe.length && (((a == null ? void 0 : a.greeting) === void 0 || (a == null ? void 0 : a.greeting)) === !0 || typeof (a == null ? void 0 : a.greeting) == "object" && a.greeting.questions !== !1) && /* @__PURE__ */ c(fn, {
667
- ref: ve,
668
- sid: (Ge = e == null ? void 0 : e.data) == null ? void 0 : Ge.id,
669
- isRecommendClearing: Ee,
670
- data: Pe,
664
+ text: a === void 0 || a.greeting === !0 || ((_e = a.greeting) == null ? void 0 : _e.text) === void 0 ? rt.text : a.greeting.text,
665
+ icon: a === void 0 || a.greeting === !0 || ((Ge = a.greeting) == null ? void 0 : Ge.icon) === void 0 ? mt || rt.icon : a.greeting.icon,
666
+ children: !!Ee.length && (((a == null ? void 0 : a.greeting) === void 0 || (a == null ? void 0 : a.greeting)) === !0 || typeof (a == null ? void 0 : a.greeting) == "object" && a.greeting.questions !== !1) && /* @__PURE__ */ c(fn, {
667
+ ref: be,
668
+ sid: (Xe = e == null ? void 0 : e.data) == null ? void 0 : Xe.id,
669
+ isRecommendClearing: Re,
670
+ data: Ee,
671
671
  onItemClick: (t) => {
672
672
  var r, i, l;
673
- if (S(t == null ? void 0 : t.question), W(t == null ? void 0 : t.question), Ee)
673
+ if (ee(t == null ? void 0 : t.question), W(t == null ? void 0 : t.question), Re)
674
674
  return;
675
675
  t != null && t.id && K(!0);
676
676
  const n = (r = e == null ? void 0 : e.data) == null ? void 0 : r.id;
677
- g != null && g.fileUpload ? (l = (i = oe.current) == null ? void 0 : i.clear()) == null || l.then(() => {
677
+ g != null && g.fileUpload ? (l = (i = se.current) == null ? void 0 : i.clear()) == null || l.then(() => {
678
678
  var s, d;
679
- t != null && t.id && (n ? (s = Ae(n, t)) == null || s.finally(() => {
679
+ t != null && t.id && (n ? (s = Be(n, t)) == null || s.finally(() => {
680
680
  K(!1);
681
- }) : (K(!1), U(!0), (d = Be()) == null || d.then((w) => {
681
+ }) : (K(!1), U(!0), (d = qe()) == null || d.then((I) => {
682
682
  var p;
683
- (p = Ae(w.id, t)) == null || p.finally(() => {
683
+ (p = Be(I.id, t)) == null || p.finally(() => {
684
684
  K(!1);
685
685
  });
686
686
  })));
687
- }) : n ? K(!1) : (K(!1), U(!0), Be());
687
+ }) : n ? K(!1) : (K(!1), U(!0), qe());
688
688
  }
689
689
  })
690
- }), qe]
690
+ }), Ye]
691
691
  })
692
- }), Me && /* @__PURE__ */ c("div", {
692
+ }), Oe && /* @__PURE__ */ c("div", {
693
693
  className: "session-stop",
694
694
  children: /* @__PURE__ */ c(_, {
695
695
  type: "primary",
@@ -698,7 +698,7 @@ ${t}` : t, l = new J(i, r, G.User, n);
698
698
  },
699
699
  ghost: !0,
700
700
  size: "small",
701
- icon: /* @__PURE__ */ c(ce, {
701
+ icon: /* @__PURE__ */ c(fe, {
702
702
  type: "icon-zantinghuida",
703
703
  style: {
704
704
  fontSize: 16
@@ -707,7 +707,7 @@ ${t}` : t, l = new J(i, r, G.User, n);
707
707
  onClick: () => jt(),
708
708
  children: "停止回答"
709
709
  })
710
- }), Oe && (h == null ? void 0 : h.length) > 0 && /* @__PURE__ */ c("div", {
710
+ }), Ue && (h == null ? void 0 : h.length) > 0 && /* @__PURE__ */ c("div", {
711
711
  className: "back-bottom",
712
712
  children: /* @__PURE__ */ c(_, {
713
713
  size: "small",
@@ -715,7 +715,7 @@ ${t}` : t, l = new J(i, r, G.User, n);
715
715
  behavior: "smooth"
716
716
  }),
717
717
  type: "link",
718
- icon: /* @__PURE__ */ c(ce, {
718
+ icon: /* @__PURE__ */ c(fe, {
719
719
  type: "icon-yijianhuidaodibu",
720
720
  style: {
721
721
  fontSize: 24
@@ -737,12 +737,12 @@ ${t}` : t, l = new J(i, r, G.User, n);
737
737
  q(void 0);
738
738
  }
739
739
  },
740
- onUrlChange: (t) => te(t)
740
+ onUrlChange: (t) => ne(t)
741
741
  })
742
- }), /* @__PURE__ */ A(le, {
742
+ }), /* @__PURE__ */ A(de, {
743
743
  className: "footer-upload-action",
744
744
  onClick: (t) => t.preventDefault(),
745
- children: [/* @__PURE__ */ A(le, {
745
+ children: [/* @__PURE__ */ A(de, {
746
746
  children: [o.type === 2 && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ c(nn, {
747
747
  disabled: !!X || M,
748
748
  accept: ".jpg, .png, .jpeg,.bmp",
@@ -779,7 +779,7 @@ ${t}` : t, l = new J(i, r, G.User, n);
779
779
  position: "relative",
780
780
  bottom: "-2px"
781
781
  },
782
- icon: /* @__PURE__ */ c(ce, {
782
+ icon: /* @__PURE__ */ c(fe, {
783
783
  type: "icon-Vector",
784
784
  className: "icon-tianjia",
785
785
  style: {
@@ -788,28 +788,28 @@ ${t}` : t, l = new J(i, r, G.User, n);
788
788
  })
789
789
  })
790
790
  })
791
- }), ge && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ c(yn, {
791
+ }), ue && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ c(yn, {
792
792
  appId: o == null ? void 0 : o.id,
793
- ref: oe,
794
- isFirstSession: Ue,
795
- docViewerUrl: k,
793
+ ref: se,
794
+ isFirstSession: ze,
795
+ docViewerUrl: v,
796
796
  onStatusChange: (t) => z(void 0, null, function* () {
797
- t !== "process" ? (se(!0), we()) : se(!1);
797
+ t !== "process" ? (re(!0), xe()) : re(!1);
798
798
  }),
799
799
  createSession: () => new Promise((t) => {
800
- U(!0), x == null || x({
800
+ U(!0), w == null || w({
801
801
  netOpen: H ? 1 : 2
802
802
  }).then((n) => {
803
803
  var i, l, s;
804
- b == null || b(n), U(!1), I(!!((i = n.data) != null && i.netOpen)), Q(!!((l = n.data) != null && l.enableNetOpen));
804
+ k == null || k(n), U(!1), x(!!((i = n.data) != null && i.netOpen)), Q(!!((l = n.data) != null && l.enableNetOpen));
805
805
  const r = ((s = n.data) == null ? void 0 : s.id) || "";
806
806
  t(r);
807
807
  });
808
808
  }),
809
- sid: (Xe = e == null ? void 0 : e.data) == null ? void 0 : Xe.id,
809
+ sid: (Ze = e == null ? void 0 : e.data) == null ? void 0 : Ze.id,
810
810
  disabled: ke || M,
811
811
  afterFileAdd: (t, n) => {
812
- n && ie((r) => {
812
+ n && oe((r) => {
813
813
  const i = r[n] || [];
814
814
  return {
815
815
  [n]: [...i, t]
@@ -819,7 +819,7 @@ ${t}` : t, l = new J(i, r, G.User, n);
819
819
  afterFileDelete: (t) => {
820
820
  var r;
821
821
  const n = (r = e == null ? void 0 : e.data) == null ? void 0 : r.id;
822
- n && ie((i) => {
822
+ n && oe((i) => {
823
823
  const l = i[n] || [];
824
824
  return {
825
825
  [n]: l.filter((s) => s.id !== t)
@@ -829,46 +829,46 @@ ${t}` : t, l = new J(i, r, G.User, n);
829
829
  onFileListChange: (t) => {
830
830
  Ct(t);
831
831
  },
832
- shouldContinue: Tt,
832
+ shouldContinue: Pt,
833
833
  afterFilesClear: () => {
834
834
  var n;
835
835
  const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
836
- t && (ie({
836
+ t && (oe({
837
837
  [t]: []
838
- }), we());
838
+ }), xe());
839
839
  }
840
840
  }) : null, (g == null ? void 0 : g.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ c(xn, {
841
841
  appId: o.id,
842
842
  list: [],
843
- search: Re ? bt : "",
843
+ search: De ? kt : "",
844
844
  onPromptSelect: (t) => {
845
- W(t.context), S(t.context);
845
+ W(t.context), ee(t.context);
846
846
  },
847
847
  disabled: M
848
848
  })]
849
- }), /* @__PURE__ */ A(le, {
850
- children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((Ze = o.arrange) == null ? void 0 : Ze.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ c(wn, {
851
- sessionId: (Je = e == null ? void 0 : e.data) == null ? void 0 : Je.id,
849
+ }), /* @__PURE__ */ A(de, {
850
+ children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((Je = o.arrange) == null ? void 0 : Je.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ c(wn, {
851
+ sessionId: (Se = e == null ? void 0 : e.data) == null ? void 0 : Se.id,
852
852
  netStatus: H,
853
853
  enable: typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.diabled) == "boolean" ? !(a != null && a.connectNetwork.diabled) : Dt,
854
854
  disabledTip: e ? void 0 : "网络访问已被禁用",
855
855
  onNetStatusChange: (t) => {
856
856
  Kt(t);
857
857
  }
858
- }), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(kn, {
859
- currentSessionId: (Se = e == null ? void 0 : e.data) == null ? void 0 : Se.id,
858
+ }), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(bn, {
859
+ currentSessionId: (et = e == null ? void 0 : e.data) == null ? void 0 : et.id,
860
860
  onSessionChange: (t, n) => {
861
- W(void 0), b == null || b(n);
861
+ W(void 0), k == null || k(n);
862
862
  },
863
863
  disabled: M
864
864
  }), (g == null ? void 0 : g.sessionOpen) && /* @__PURE__ */ c(_, {
865
865
  icon: /* @__PURE__ */ c(mn, {}),
866
866
  className: "add-btn",
867
867
  type: "primary",
868
- disabled: Me || !e || !h.length || M,
868
+ disabled: Oe || !e || !h.length || M,
869
869
  onClick: () => {
870
870
  var t, n;
871
- b == null || b(void 0), I(!1), (t = De.current) == null || t.clear(), (n = ve.current) == null || n.clear();
871
+ k == null || k(void 0), x(!1), (t = He.current) == null || t.clear(), (n = be.current) == null || n.clear();
872
872
  },
873
873
  children: "新会话"
874
874
  })]
@@ -876,25 +876,25 @@ ${t}` : t, l = new J(i, r, G.User, n);
876
876
  }), /* @__PURE__ */ c("div", {
877
877
  className: "footer-textarea",
878
878
  children: /* @__PURE__ */ c(cn, {
879
- ref: pe,
879
+ ref: ve,
880
880
  maxLength: yt,
881
881
  text: xt,
882
882
  networkStatus: !1,
883
- loading: je,
884
- disabled: Ne || Fe || M || je,
885
- onTextSend: Ve,
883
+ loading: Ve,
884
+ disabled: Pe || Fe || M || Ve,
885
+ onTextSend: $e,
886
886
  onChange: (t, n) => {
887
887
  W(t);
888
888
  const r = n.getText().replace(/[\n\s]+$/, "");
889
- S(r), wt(r), Re || kt(!0);
889
+ ee(r), wt(r), De || bt(!0);
890
890
  },
891
- clearAction: /* @__PURE__ */ c(le, {
891
+ clearAction: /* @__PURE__ */ c(de, {
892
892
  size: 0,
893
893
  children: /* @__PURE__ */ c(_, {
894
894
  type: "link",
895
895
  disabled: ke || M,
896
896
  ghost: !0,
897
- icon: /* @__PURE__ */ c(ce, {
897
+ icon: /* @__PURE__ */ c(fe, {
898
898
  style: {
899
899
  fontSize: 22
900
900
  },
@@ -908,12 +908,12 @@ ${t}` : t, l = new J(i, r, G.User, n);
908
908
  })
909
909
  }), /* @__PURE__ */ c(un, {
910
910
  tips: ut
911
- }), He && /* @__PURE__ */ c(pn, {
912
- isvisible: He,
911
+ }), Me && /* @__PURE__ */ c(pn, {
912
+ isvisible: Me,
913
913
  files: Lt,
914
- sessionId: (et = e == null ? void 0 : e.data) == null ? void 0 : et.id,
914
+ sessionId: (tt = e == null ? void 0 : e.data) == null ? void 0 : tt.id,
915
915
  onClose: (t) => {
916
- It(!1), Ft(!1);
916
+ It(!1), Tt(!1);
917
917
  }
918
918
  })]
919
919
  });