@glodon-aiot/agent-cli-ui 3.5.0-beta.1 → 3.5.0

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,32 +2,32 @@ var fn = Object.defineProperty, gn = Object.defineProperties;
2
2
  var un = Object.getOwnPropertyDescriptors;
3
3
  var yt = Object.getOwnPropertySymbols;
4
4
  var mn = Object.prototype.hasOwnProperty, hn = Object.prototype.propertyIsEnumerable;
5
- var Te = (k, h, i) => h in k ? fn(k, h, { enumerable: !0, configurable: !0, writable: !0, value: i }) : k[h] = i, Oe = (k, h) => {
6
- for (var i in h || (h = {}))
7
- mn.call(h, i) && Te(k, i, h[i]);
5
+ var Te = (k, h, o) => h in k ? fn(k, h, { enumerable: !0, configurable: !0, writable: !0, value: o }) : k[h] = o, Oe = (k, h) => {
6
+ for (var o in h || (h = {}))
7
+ mn.call(h, o) && Te(k, o, h[o]);
8
8
  if (yt)
9
- for (var i of yt(h))
10
- hn.call(h, i) && Te(k, i, h[i]);
9
+ for (var o of yt(h))
10
+ hn.call(h, o) && Te(k, o, h[o]);
11
11
  return k;
12
12
  }, He = (k, h) => gn(k, un(h));
13
- var F = (k, h, i) => (Te(k, typeof h != "symbol" ? h + "" : h, i), i);
14
- var z = (k, h, i) => new Promise((j, e) => {
13
+ var F = (k, h, o) => (Te(k, typeof h != "symbol" ? h + "" : h, o), o);
14
+ var z = (k, h, o) => new Promise((j, e) => {
15
15
  var w = (E) => {
16
16
  try {
17
- p(i.next(E));
17
+ v(o.next(E));
18
18
  } catch (P) {
19
19
  e(P);
20
20
  }
21
21
  }, _ = (E) => {
22
22
  try {
23
- p(i.throw(E));
23
+ v(o.throw(E));
24
24
  } catch (P) {
25
25
  e(P);
26
26
  }
27
- }, p = (E) => E.done ? j(E.value) : Promise.resolve(E.value).then(w, _);
28
- p((i = i.apply(k, h)).next());
27
+ }, v = (E) => E.done ? j(E.value) : Promise.resolve(E.value).then(w, _);
28
+ v((o = o.apply(k, h)).next());
29
29
  });
30
- import { jsx as c, jsxs as V, Fragment as yn } from "react/jsx-runtime";
30
+ import { jsx as d, jsxs as V, Fragment as yn } from "react/jsx-runtime";
31
31
  import { memo as pn, forwardRef as vn, useState as m, useRef as K, useContext as bn, useEffect as L, useMemo as xn, useImperativeHandle as kn } from "react";
32
32
  /* empty css */import { Spin as pt, Divider as wn, Button as Q, Space as pe, Upload as Cn, Tooltip as In, Popover as Nn, notification as ee, message as u } from "antd";
33
33
  import re from "../../components/Iconfont/index.mjs";
@@ -61,7 +61,7 @@ const Qn = pn(wt), bt = {
61
61
  text: "今天我能帮你什么?"
62
62
  };
63
63
  class ae {
64
- constructor(h, i, j, e) {
64
+ constructor(h, o, j, e) {
65
65
  F(this, "messageTime");
66
66
  F(this, "isWaiting");
67
67
  F(this, "messageId");
@@ -71,15 +71,15 @@ class ae {
71
71
  F(this, "isSensitive");
72
72
  F(this, "isSuspend");
73
73
  F(this, "comment");
74
- this.content = h, this.sessionId = i, this.role = j, this.files = e, this.content = h, this.role = j, this.sessionId = i, this.files = e, this.messageTime = Ct(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = Fe(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
74
+ this.content = h, this.sessionId = o, this.role = j, this.files = e, this.content = h, this.role = j, this.sessionId = o, this.files = e, this.messageTime = Ct(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = Fe(), 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 xt = 10, De = (k, h, i, j) => {
79
+ const xt = 10, De = (k, h, o, j) => {
80
80
  let e = k;
81
- if (j === kt.Agent && i && i.length > 0) {
82
- const w = i.map((_) => `[${_.name.replace(/\.[^/.]+$/, "")}](${_.url})`).join(`
81
+ if (j === kt.Agent && o && o.length > 0) {
82
+ const w = o.map((_) => `[${_.name.replace(/\.[^/.]+$/, "")}](${_.url})`).join(`
83
83
  `);
84
84
  e = w ? `${w}
85
85
  ${e}` : e;
@@ -89,15 +89,15 @@ ${e}`), e;
89
89
  }, Ni = vn((k, h) => {
90
90
  var ot, st, rt, at, lt, dt, ct, ft, gt, ut, mt, ht;
91
91
  const {
92
- application: i,
92
+ application: o,
93
93
  docViewerUrl: j = "",
94
94
  currentSession: e,
95
95
  onCreateSession: w,
96
96
  embeddingService: _,
97
- setCurrentSession: p,
97
+ setCurrentSession: v,
98
98
  networkStatus: E,
99
99
  setNetworkStatus: P
100
- } = k, [v, C] = m([]), [It, le] = m(), [be, je] = m(), H = K(null), {
100
+ } = k, [b, C] = m([]), [It, le] = m(), [be, je] = m(), H = K(null), {
101
101
  service: R,
102
102
  agentClient: I,
103
103
  depId: Nt,
@@ -109,12 +109,12 @@ ${e}`), e;
109
109
  beforeMessageSend: A,
110
110
  bodyStyle: Et,
111
111
  disabled: D,
112
- features: s,
112
+ features: r,
113
113
  popupContainer: f,
114
114
  icon: Pt,
115
115
  sider: Tt,
116
116
  mode: Ot
117
- } = bn(Ln), [Ue, ke] = m(!1), y = K(v), ze = K(void 0), [Ht, Rt] = m(0), [ne, G] = m(), [we, ce] = m(""), [Ve, Ce] = m(!1), fe = K(null), [Ae, Dt] = m([]), [$e, X] = m(!1), [qe, Ft] = m(!1), [jt, Mt] = m(""), [Ut, Z] = m(), [J, ie] = m({}), ge = K(null), Be = K(null), Ie = K(null), [We, zt] = m(!1), [Vt, At] = m([]), [$t, ue] = m(!0), [qt, Bt] = m(!0), [Ye, M] = m(!1), [Ne, $] = m(!1), [Ke, Wt] = m(!1), [O, me] = m(typeof (s == null ? void 0 : s.promptVariables) == "object" ? s.promptVariables.default || [] : []), [Yt, Kt] = m(typeof (s == null ? void 0 : s.knowledges) == "object" && s.knowledges.default || void 0), [Qe, U] = m(!1), [_e, oe] = m(!1), [Qt, S] = m(typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.default) == "boolean" ? s.connectNetwork.default : !1), [Ge, he] = m(!1), [_t, q] = m(!1), [Gt, Xt] = m(null), [ye, Y] = m(!1), [Xe, Ze] = m(!1), {
117
+ } = bn(Ln), [Ue, ke] = m(!1), y = K(b), ze = K(void 0), [Ht, Rt] = m(0), [ne, G] = m(), [we, ce] = m(""), [Ve, Ce] = m(!1), fe = K(null), [Ae, Dt] = m([]), [$e, X] = m(!1), [qe, Ft] = m(!1), [jt, Mt] = m(""), [Ut, Z] = m(), [J, ie] = m({}), ge = K(null), Be = K(null), Ie = K(null), [We, zt] = m(!1), [Vt, At] = m([]), [$t, ue] = m(!0), [qt, Bt] = m(!0), [Ye, M] = m(!1), [Ne, $] = m(!1), [Ke, Wt] = m(!1), [O, me] = m(typeof (r == null ? void 0 : r.promptVariables) == "object" ? r.promptVariables.default || [] : []), [Yt, Kt] = m(typeof (r == null ? void 0 : r.knowledges) == "object" && r.knowledges.default || void 0), [Qe, U] = m(!1), [_e, oe] = m(!1), [Qt, S] = m(typeof (r == null ? void 0 : r.connectNetwork) == "object" && typeof (r == null ? void 0 : r.connectNetwork.default) == "boolean" ? r.connectNetwork.default : !1), [Ge, he] = m(!1), [_t, q] = m(!1), [Gt, Xt] = m(null), [ye, Y] = m(!1), [Xe, Ze] = m(!1), {
118
118
  isSwitchingToExistingSession: Zt,
119
119
  setIsSwitchingToExistingSession: Le
120
120
  } = Yn();
@@ -135,23 +135,23 @@ ${e}`), e;
135
135
  e.ready ? q(!1) : q(!0);
136
136
  }
137
137
  }, [e, e == null ? void 0 : e.ready]), L(() => {
138
- var a, o;
138
+ var a, l;
139
139
  e && (y.current = []), C([]);
140
140
  const t = H.current;
141
141
  if (t && t.scrollTo({
142
142
  top: 0
143
143
  }), !((a = e == null ? void 0 : e.data) != null && a.id))
144
144
  return;
145
- if ($(!1), M(!1), (o = e.messages) != null && o.length) {
146
- const r = [...e.messages.filter((d) => d == null ? void 0 : d.messageId)].reverse();
147
- y.current = [...r], C([...r]), q(!1);
145
+ if ($(!1), M(!1), (l = e.messages) != null && l.length) {
146
+ const c = [...e.messages.filter((s) => s == null ? void 0 : s.messageId)].reverse();
147
+ y.current = [...c], C([...c]), q(!1);
148
148
  }
149
- const n = (l) => {
150
- var r;
151
- (r = e == null ? void 0 : e.data) != null && r.id && (y.current = [...l].reverse(), C([...l].reverse()), !l || l.length < 10 ? oe(!1) : oe(!0), q(!1), Me && Me({
152
- applicationId: i.id,
149
+ const n = (i) => {
150
+ var c;
151
+ (c = e == null ? void 0 : e.data) != null && c.id && (y.current = [...i].reverse(), C([...i].reverse()), !i || i.length < 10 ? oe(!1) : oe(!0), q(!1), Me && Me({
152
+ applicationId: o.id,
153
153
  sessionId: e.data.id,
154
- histories: l
154
+ histories: i
155
155
  }));
156
156
  };
157
157
  return e.addEventListener("history:loaded", n), () => {
@@ -160,7 +160,7 @@ ${e}`), e;
160
160
  }, [e]), L(() => {
161
161
  const t = () => {
162
162
  var n;
163
- (n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && me(e.promptVariables.sort((a, o) => a.key.localeCompare(o.key))), e.knowledges && Kt(e.knowledges), P(e.netOpen));
163
+ (n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && me(e.promptVariables.sort((a, l) => a.key.localeCompare(l.key))), e.knowledges && Kt(e.knowledges), P(e.netOpen));
164
164
  };
165
165
  return e == null || e.addEventListener("data:updated", t), () => {
166
166
  e == null || e.removeEventListener("data:updated", t);
@@ -170,12 +170,12 @@ ${e}`), e;
170
170
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
171
171
  return;
172
172
  const t = (a) => {
173
- var o;
173
+ var l;
174
174
  console.error(a.message, a.cause, "e.case"), ee.config({
175
175
  getContainer: () => (f == null ? void 0 : f.current) || document.body,
176
176
  prefixCls: "gbot-notification"
177
177
  }), ee.error({
178
- message: ((o = a.cause) == null ? void 0 : o.message) || a.message
178
+ message: ((l = a.cause) == null ? void 0 : l.message) || a.message
179
179
  }), ee.config({
180
180
  getContainer: void 0,
181
181
  prefixCls: "gbot-notification"
@@ -187,9 +187,9 @@ ${e}`), e;
187
187
  }, [e]);
188
188
  const Jt = () => {
189
189
  var a;
190
- if (!((a = e == null ? void 0 : e.data) != null && a.id) || !(i != null && i.id))
190
+ if (!((a = e == null ? void 0 : e.data) != null && a.id) || !(o != null && o.id))
191
191
  return;
192
- const t = e.data.id, n = v[v.length - 1];
192
+ const t = e.data.id, n = b[b.length - 1];
193
193
  if (n && n.isContext) {
194
194
  u.config({
195
195
  getContainer: () => (f == null ? void 0 : f.current) || document.body,
@@ -201,15 +201,15 @@ ${e}`), e;
201
201
  return;
202
202
  } else
203
203
  e.clear().then(() => {
204
- const o = new ae("", t, te.System);
205
- o.isContext = !0, C([o, ...v]);
204
+ const l = new ae("", t, te.System);
205
+ l.isContext = !0, C([l, ...b]);
206
206
  });
207
207
  };
208
208
  L(() => {
209
- i != null && i.id && (R == null || R.getRecommendQues(i.id).then((t) => {
209
+ o != null && o.id && (R == null || R.getRecommendQues(o.id).then((t) => {
210
210
  Dt(t);
211
211
  }));
212
- }, [Nt, i]);
212
+ }, [Nt, o]);
213
213
  const Je = (t) => z(void 0, null, function* () {
214
214
  var N, T;
215
215
  if (D) {
@@ -233,7 +233,7 @@ ${e}`), e;
233
233
  });
234
234
  return;
235
235
  }
236
- if (!(O == null ? void 0 : O.every((b) => !!(b != null && b.value))))
236
+ if (!(O == null ? void 0 : O.every((x) => !!(x != null && x.value))))
237
237
  if (g != null && g.promptVariables) {
238
238
  u.config({
239
239
  getContainer: () => (f == null ? void 0 : f.current) || document.body,
@@ -244,7 +244,7 @@ ${e}`), e;
244
244
  });
245
245
  return;
246
246
  } else
247
- console.error("变量值不能为空", O == null ? void 0 : O.map((b) => !!(b != null && b.value)));
247
+ console.error("变量值不能为空", O == null ? void 0 : O.map((x) => !!(x != null && x.value)));
248
248
  if (Ne) {
249
249
  u.config({
250
250
  getContainer: () => (f == null ? void 0 : f.current) || document.body,
@@ -286,18 +286,18 @@ ${e}`), e;
286
286
  return;
287
287
  }
288
288
  G(void 0), ce("");
289
- const o = (N = e == null ? void 0 : e.data) == null ? void 0 : N.id;
290
- if (!o) {
289
+ const l = (N = e == null ? void 0 : e.data) == null ? void 0 : N.id;
290
+ if (!l) {
291
291
  if (ye)
292
292
  return;
293
293
  Y(!0), w == null || w({
294
294
  netOpen: E ? W.OPEN : W.CLOSE
295
- }).then((b) => {
295
+ }).then((x) => {
296
296
  var B, se;
297
- U(!0), P(!!((B = b.data) != null && B.netOpen)), S(!!((se = b.data) != null && se.enableNetOpen)), Se(b).then(() => {
298
- p == null || p(b), U(!1), je(n);
297
+ U(!0), P(!!((B = x.data) != null && B.netOpen)), S(!!((se = x.data) != null && se.enableNetOpen)), Se(x).then(() => {
298
+ v == null || v(x), U(!1), je(n);
299
299
  });
300
- }).catch((b) => {
300
+ }).catch((x) => {
301
301
  Y(!1);
302
302
  });
303
303
  return;
@@ -305,55 +305,55 @@ ${e}`), e;
305
305
  if (ye)
306
306
  return;
307
307
  Y(!0), he(!0);
308
- const l = De(n, we, J[o], (i == null ? void 0 : i.type) || 0);
309
- let r;
308
+ const i = De(n, we, J[l], (o == null ? void 0 : o.type) || 0);
309
+ let c;
310
310
  try {
311
- A ? r = yield A == null ? void 0 : A({
312
- applicationId: i.id,
313
- sessionId: o,
311
+ A ? c = yield A == null ? void 0 : A({
312
+ applicationId: o.id,
313
+ sessionId: l,
314
314
  message: {
315
- content: l,
316
- sessionId: o,
315
+ content: i,
316
+ sessionId: l,
317
317
  role: vt.User,
318
- files: J[o]
318
+ files: J[l]
319
319
  }
320
- }) : r = !0;
321
- } catch (b) {
322
- r = !1;
320
+ }) : c = !0;
321
+ } catch (x) {
322
+ c = !1;
323
323
  }
324
- if (he(!1), r === !1) {
324
+ if (he(!1), c === !1) {
325
325
  Y(!1);
326
326
  return;
327
327
  }
328
- let d = n;
329
- if (typeof r == "object" && (d = r.content || n), !(yield e.setPromptVariables(O))) {
328
+ let s = n;
329
+ if (typeof c == "object" && (s = c.content || n), !(yield e.setPromptVariables(O))) {
330
330
  Y(!1);
331
331
  return;
332
332
  }
333
- ((T = J[o]) == null ? void 0 : T.length) > 0 ? St(d) : Ee(d);
333
+ ((T = J[l]) == null ? void 0 : T.length) > 0 ? St(s) : Ee(s);
334
334
  }), Se = (t) => new Promise((n, a) => z(void 0, null, function* () {
335
- 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) => {
335
+ const c = (t == null ? void 0 : t.promptVariables).filter((s) => s.type ? !((s.type === ve.User || s.type === void 0) && s.key === "query") && !((s.type === ve.System || s.type === void 0) && s.key === "datetime") : s.key !== "query").map((s) => {
336
336
  var N;
337
- const x = (N = O.find((T) => T.key === d.key && T.type === d.type)) == null ? void 0 : N.value;
338
- return d.value = x || "", d;
337
+ const p = (N = O.find((T) => T.key === s.key && T.type === s.type)) == null ? void 0 : N.value;
338
+ return s.value = p || "", s;
339
339
  });
340
- me(r.sort((d, x) => d.key.localeCompare(x.key))), yield t == null ? void 0 : t.setPromptVariables(r).catch((d) => {
341
- console.error(d), u.config({
340
+ me(c.sort((s, p) => s.key.localeCompare(p.key))), yield t == null ? void 0 : t.setPromptVariables(c).catch((s) => {
341
+ console.error(s), u.config({
342
342
  getContainer: () => (f == null ? void 0 : f.current) || document.body,
343
343
  prefixCls: "gbot-message"
344
- }), u.error(d.message), u.config({
344
+ }), u.error(s.message), u.config({
345
345
  getContainer: void 0,
346
346
  prefixCls: "gbot-message"
347
347
  });
348
348
  }), n();
349
349
  })), St = (t) => {
350
- var l, r, d;
351
- if (ue(!1), !((l = e == null ? void 0 : e.data) != null && l.id) || !(i != null && i.id))
350
+ var i, c, s;
351
+ if (ue(!1), !((i = e == null ? void 0 : e.data) != null && i.id) || !(o != null && o.id))
352
352
  return;
353
- const n = ((r = e.data) == null ? void 0 : r.id) || "";
354
- let a = [], o = /* @__PURE__ */ new Set();
355
- (d = J[n]) == null || d.forEach((x) => {
356
- o.has(x.id) || (a.push(x), o.add(x.id));
353
+ const n = ((c = e.data) == null ? void 0 : c.id) || "";
354
+ let a = [], l = /* @__PURE__ */ new Set();
355
+ (s = J[n]) == null || s.forEach((p) => {
356
+ l.has(p.id) || (a.push(p), l.add(p.id));
357
357
  }), ue(!0), Ee(t, a);
358
358
  };
359
359
  L(() => {
@@ -361,11 +361,11 @@ ${e}`), e;
361
361
  return;
362
362
  const t = be, n = () => z(void 0, null, function* () {
363
363
  he(!0);
364
- const a = De(t, we, J[e.id], (i == null ? void 0 : i.type) || 0);
365
- let o;
364
+ const a = De(t, we, J[e.id], (o == null ? void 0 : o.type) || 0);
365
+ let l;
366
366
  try {
367
- A ? o = yield A == null ? void 0 : A({
368
- applicationId: i.id,
367
+ A ? l = yield A == null ? void 0 : A({
368
+ applicationId: o.id,
369
369
  sessionId: e.id,
370
370
  message: {
371
371
  content: a,
@@ -373,11 +373,11 @@ ${e}`), e;
373
373
  role: vt.User,
374
374
  files: J[e.id]
375
375
  }
376
- }) : o = !0;
377
- } catch (l) {
378
- o = !1;
376
+ }) : l = !0;
377
+ } catch (i) {
378
+ l = !1;
379
379
  }
380
- if (he(!1), o === !1) {
380
+ if (he(!1), l === !1) {
381
381
  Y(!1);
382
382
  return;
383
383
  }
@@ -393,65 +393,65 @@ ${e}`), e;
393
393
  if (!a)
394
394
  return;
395
395
  $(!0), M(!0);
396
- const o = De(t, we, n, (i == null ? void 0 : i.type) || 0), l = new ae(o, a, te.User, n);
397
- le(void 0), Z(void 0), y.current = [l, ...v], C(y.current), i.id && de && de({
398
- applicationId: i.id,
396
+ const l = De(t, we, n, (o == null ? void 0 : o.type) || 0), i = new ae(l, a, te.User, n);
397
+ le(void 0), Z(void 0), y.current = [i, ...b], C(y.current), o.id && de && de({
398
+ applicationId: o.id,
399
399
  sessionId: a,
400
- message: l
400
+ message: i
401
401
  });
402
- const r = new ae("", a, te.System);
403
- r.isWaiting = !0, y.current = [r, ...y.current], C(y.current);
404
- const d = (n == null ? void 0 : n.map((b) => b.id)) || [], x = {
402
+ const c = new ae("", a, te.System);
403
+ c.isWaiting = !0, y.current = [c, ...y.current], C(y.current);
404
+ const s = (n == null ? void 0 : n.map((x) => x.id)) || [], p = {
405
405
  stream: En.stream,
406
406
  referenceFirst: !1
407
407
  };
408
408
  if (g != null && g.promptVariables) {
409
- const b = O == null ? void 0 : O.reduce((B, se) => (B[se.key] = se.value, B), {});
410
- x.formatValues = b;
409
+ const x = O == null ? void 0 : O.reduce((B, se) => (B[se.key] = se.value, B), {});
410
+ p.formatValues = x;
411
411
  }
412
412
  if (g != null && g.knowledges) {
413
- const b = Yt;
414
- x.knowledges = b;
413
+ const x = Yt;
414
+ p.knowledges = x;
415
415
  }
416
416
  yield e.send({
417
- text: o,
418
- fileIds: d,
417
+ text: l,
418
+ fileIds: s,
419
419
  files: n
420
- }, x), ie({
420
+ }, p), ie({
421
421
  [a]: []
422
422
  }), (T = ge.current) == null || T.update(), Y(!1);
423
423
  });
424
424
  L(() => {
425
- var a;
426
- const t = (a = e == null ? void 0 : e.data) == null ? void 0 : a.id;
425
+ var l;
426
+ const t = (l = e == null ? void 0 : e.data) == null ? void 0 : l.id;
427
427
  if (!t)
428
428
  return;
429
- const n = (o) => {
430
- if (!o.sessionId || o.sessionId && o.sessionId !== ze.current || o.role === te.User)
429
+ const n = (i) => {
430
+ if (!i.sessionId || i.sessionId && i.sessionId !== ze.current || i.role === te.User)
431
431
  return;
432
- if (o.index === -1 && o.code !== 200 && o.code !== 11915 && (M(!1), $(!1), y.current = y.current.filter((d) => !d.isWaiting), C([...y.current]), y.current = [...y.current], o.content)) {
432
+ if (i.index === -1 && i.code !== 200 && i.code !== 11915 && (M(!1), $(!1), y.current = y.current.filter((p) => !p.isWaiting), C([...y.current]), y.current = [...y.current], i.content)) {
433
433
  ee.config({
434
434
  getContainer: () => (f == null ? void 0 : f.current) || document.body,
435
435
  prefixCls: "gbot-notification"
436
436
  }), ee.error({
437
- message: o.content
437
+ message: i.content
438
438
  }), ee.config({
439
439
  getContainer: void 0,
440
440
  prefixCls: "gbot-notification"
441
441
  });
442
442
  return;
443
443
  }
444
- const l = o.actions || [], r = new ae(o.content, t, te.Robot);
445
- r.messageId = o.messageId || Fe(), r.reasoningContent = o.reasoningContent, r.searchReference = o.searchReference, r.thinkingSecs = o.thinkingSecs, r.thinkingStatus = o.thinkingStatus, r.actions = l, r.isLoading = !0, r.searchingStatus = o.searchingStatus, y.current = y.current.filter((d) => !d.isWaiting).filter((d) => !d.isReplying), o.index === void 0 && C([r, ...y.current]), o.code === 11915 && (M(!1), $(!1), r.isLoading = !1, r.content = "请您换个问题问我吧~", r.isSensitive = !0, C([r, ...y.current])), o.index === -2 && (M(!1), $(!1), r.isLoading = !1, r.content = "回答已中止~", r.isSuspend = !0, C([r, ...y.current])), o.index === -1 && (M(!1), $(!1), r.isLoading = !1, r.reference = o.reference, C([r, ...y.current]), i.id && de && de({
446
- applicationId: i.id,
444
+ const c = i.actions || [], s = new ae(i.content, t, te.Robot);
445
+ s.messageId = i.messageId || Fe(), s.reasoningContent = i.reasoningContent, s.searchReference = i.searchReference, s.thinkingSecs = i.thinkingSecs, s.thinkingStatus = i.thinkingStatus, s.actions = c, s.isLoading = !0, s.searchingStatus = i.searchingStatus, y.current = y.current.filter((p) => !p.isWaiting).filter((p) => !p.isReplying), i.index === void 0 && C([s, ...y.current]), i.code === 11915 && (M(!1), $(!1), s.isLoading = !1, s.content = "请您换个问题问我吧~", s.isSensitive = !0, C([s, ...y.current])), i.index === -2 && (M(!1), $(!1), s.isLoading = !1, s.content = "回答已中止~", s.isSuspend = !0, C([s, ...y.current])), i.index === -1 && (M(!1), $(!1), s.isLoading = !1, s.reference = i.reference, C([s, ...y.current]), o.id && de && de({
446
+ applicationId: o.id,
447
447
  sessionId: t,
448
- message: r
449
- })), o.index === -3 && (M(!1), $(!1), r.isLoading = !1, r.reference = o.reference, r.relatedQuesion = o.relatedQuesion, C([r, ...y.current]));
450
- };
451
- return e.ready ? e.addEventListener("message:updated", n) : e.addEventListener("ready", () => {
448
+ message: s
449
+ })), i.index === -3 && (M(!1), $(!1), s.isLoading = !1, s.reference = i.reference, s.relatedQuesion = i.relatedQuesion, C([s, ...y.current]));
450
+ }, a = () => {
452
451
  e.addEventListener("message:updated", n);
453
- }), () => {
454
- e == null || e.removeEventListener("message:updated", n);
452
+ };
453
+ return e.ready ? e.addEventListener("message:updated", n) : e.addEventListener("ready", a), () => {
454
+ e == null || e.removeEventListener("message:updated", n), e == null || e.removeEventListener("ready", a);
455
455
  };
456
456
  }, [e]), L(() => {
457
457
  if (!e) {
@@ -492,26 +492,26 @@ ${e}`), e;
492
492
  return G(t), (n = e == null ? void 0 : e.data) != null && n.id ? et(e, t) : new Promise((a) => {
493
493
  U(!0), w == null || w({
494
494
  netOpen: E ? W.OPEN : W.CLOSE
495
- }).then((o) => {
496
- var l, r;
497
- p == null || p(o), U(!1), P(!!((l = o.data) != null && l.netOpen)), S(!!((r = o.data) != null && r.enableNetOpen)), a(et(o, t));
495
+ }).then((l) => {
496
+ var i, c;
497
+ v == null || v(l), U(!1), P(!!((i = l.data) != null && i.netOpen)), S(!!((c = l.data) != null && c.enableNetOpen)), a(et(l, t));
498
498
  });
499
499
  });
500
500
  }), et = (t, n) => {
501
501
  const a = On(n.name);
502
- return new Promise((o) => {
503
- var r;
504
- const l = {
502
+ return new Promise((l) => {
503
+ var c;
504
+ const i = {
505
505
  files: [`${Fe()}.${a}`],
506
506
  isv: "minio",
507
- knowledgeId: ((r = t.data) == null ? void 0 : r.id) || "",
507
+ knowledgeId: ((c = t.data) == null ? void 0 : c.id) || "",
508
508
  type: 1
509
509
  };
510
- Ce(!0), R == null || R.postTicket(l).then((d) => {
511
- R.uploadMinioFile(d.minio, n).then(() => {
512
- var b, B;
513
- const x = (b = d.minio.endpoints) == null ? void 0 : b[0], N = d.minio.bucket, T = (B = d.minio.fileKeys) == null ? void 0 : B[0];
514
- o(`${location.protocol}//${x}/${N}/${T}`);
510
+ Ce(!0), R == null || R.postTicket(i).then((s) => {
511
+ R.uploadMinioFile(s.minio, n).then(() => {
512
+ var x, B;
513
+ const p = (x = s.minio.endpoints) == null ? void 0 : x[0], N = s.minio.bucket, T = (B = s.minio.fileKeys) == null ? void 0 : B[0];
514
+ l(`${location.protocol}//${p}/${N}/${T}`);
515
515
  }).catch(() => {
516
516
  ce(""), G(void 0);
517
517
  }).finally(() => {
@@ -527,16 +527,16 @@ ${e}`), e;
527
527
  t && !Ke && t.scrollTo({
528
528
  top: t.scrollHeight
529
529
  });
530
- }, [v]);
530
+ }, [b]);
531
531
  const tt = (t, n) => new Promise((a) => {
532
- if (!n.file.url || !(i != null && i.id))
532
+ if (!n.file.url || !(o != null && o.id))
533
533
  return a();
534
- const o = He(Oe({}, n.file), {
534
+ const l = He(Oe({}, n.file), {
535
535
  type: 1
536
536
  });
537
- R == null || R.postApplicationIdSessionKnowledgeSessionFile(i == null ? void 0 : i.id, t, o).finally(() => {
538
- var l;
539
- (l = ge.current) == null || l.update().finally(a);
537
+ R == null || R.postApplicationIdSessionKnowledgeSessionFile(o == null ? void 0 : o.id, t, l).finally(() => {
538
+ var i;
539
+ (i = ge.current) == null || i.update().finally(a);
540
540
  });
541
541
  }), nn = () => {
542
542
  var t;
@@ -563,7 +563,7 @@ ${e}`), e;
563
563
  var n;
564
564
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
565
565
  return;
566
- y.current = [...v.slice(1, v.length)], C(y.current);
566
+ y.current = [...b.slice(1, b.length)], C(y.current);
567
567
  const t = new ae("", e.data.id, te.System);
568
568
  t.isWaiting = !0, y.current = [t, ...y.current], C(y.current), $(!0), M(!0), e.answerAgain();
569
569
  });
@@ -575,17 +575,17 @@ ${e}`), e;
575
575
  var a;
576
576
  if (!((a = e == null ? void 0 : e.data) != null && a.id))
577
577
  return;
578
- const n = v[v.length - 1].messageTime;
578
+ const n = b[b.length - 1].messageTime;
579
579
  e.fetchMessages({
580
580
  endTime: n,
581
581
  pageSize: xt
582
- }).then((o) => {
583
- const l = o || [];
584
- if (!l || !(l != null && l.length)) {
582
+ }).then((l) => {
583
+ const i = l || [];
584
+ if (!i || !(i != null && i.length)) {
585
585
  oe(!1);
586
586
  return;
587
587
  }
588
- l.length < 10 ? oe(!1) : oe(!0), C([...v, ...l.reverse()]);
588
+ i.length < 10 ? oe(!1) : oe(!0), C([...b, ...i.reverse()]);
589
589
  });
590
590
  }, cn = (t) => z(void 0, null, function* () {
591
591
  var n, a;
@@ -600,7 +600,7 @@ ${e}`), e;
600
600
  e ? e.fetchData().then((t) => {
601
601
  var n;
602
602
  (n = e == null ? void 0 : e.data) != null && n.id && (P(t.netOpen), S(t.enableNetOpen));
603
- }) : (P(typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.default) == "boolean" ? s.connectNetwork.default : !1), S(i.arrange[0].enableNetOpen));
603
+ }) : (P(typeof (r == null ? void 0 : r.connectNetwork) == "object" && typeof (r == null ? void 0 : r.connectNetwork.default) == "boolean" ? r.connectNetwork.default : !1), S(o.arrange[0].enableNetOpen));
604
604
  });
605
605
  L(() => {
606
606
  Pe();
@@ -608,54 +608,54 @@ ${e}`), e;
608
608
  requestAnimationFrame(() => {
609
609
  var n, a;
610
610
  if (H.current) {
611
- const o = document.getElementById("chat-main"), l = (n = H.current) == null ? void 0 : n.querySelector(".infinite-scroll-component__outerdiv"), r = (a = H.current) == null ? void 0 : a.querySelector(".infinite-scroll-component");
612
- if (!l || !r || !o)
611
+ const l = document.getElementById("chat-main"), i = (n = H.current) == null ? void 0 : n.querySelector(".infinite-scroll-component__outerdiv"), c = (a = H.current) == null ? void 0 : a.querySelector(".infinite-scroll-component");
612
+ if (!i || !c || !l)
613
613
  return;
614
- const d = o.offsetHeight;
615
- if (r.offsetHeight <= d) {
616
- if (l.style.height === "100%")
614
+ const s = l.offsetHeight;
615
+ if (c.offsetHeight <= s) {
616
+ if (i.style.height === "100%")
617
617
  return;
618
- l.style.height = "100%";
618
+ i.style.height = "100%";
619
619
  } else {
620
- if (l.style.height === "auto")
620
+ if (i.style.height === "auto")
621
621
  return;
622
- l.style.height = "auto";
622
+ i.style.height = "auto";
623
623
  }
624
624
  }
625
625
  });
626
- }, [v]), L(() => {
626
+ }, [b]), L(() => {
627
627
  if (e)
628
628
  return;
629
629
  const t = () => {
630
- const o = ((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) => {
631
- var x, N;
632
- let d = "";
633
- return typeof (s == null ? void 0 : s.promptVariables) == "object" && (d = ((N = (x = s.promptVariables.default) == null ? void 0 : x.find((T) => T.key === l.key && T.type === l.type)) == null ? void 0 : N.value) || ""), {
634
- id: r + "",
635
- key: l.key,
636
- name: l.name,
637
- value: d,
638
- type: l.type
630
+ const l = ((I == null ? void 0 : I.promptVariables) || []).filter((i) => i.type ? !(i.type === ve.User && i.key === "query") && !(i.type === ve.System && i.key === "datetime") && i.status === 1 : i.key !== "query" && i.status === 1).map((i, c) => {
631
+ var p, N;
632
+ let s = "";
633
+ return typeof (r == null ? void 0 : r.promptVariables) == "object" && (s = ((N = (p = r.promptVariables.default) == null ? void 0 : p.find((T) => T.key === i.key && T.type === i.type)) == null ? void 0 : N.value) || ""), {
634
+ id: c + "",
635
+ key: i.key,
636
+ name: i.name,
637
+ value: s,
638
+ type: i.type
639
639
  };
640
640
  });
641
- me([...o].sort((l, r) => l.key.localeCompare(r.key)));
641
+ me([...l].sort((i, c) => i.key.localeCompare(c.key)));
642
642
  };
643
643
  return I != null && I.ready ? t() : I == null || I.addEventListener("ready", t), () => {
644
644
  I == null || I.removeEventListener("ready", t);
645
645
  };
646
- }, [e, I, s == null ? void 0 : s.promptVariables]);
646
+ }, [e, I, r == null ? void 0 : r.promptVariables]);
647
647
  const nt = () => w == null ? void 0 : w({
648
648
  netOpen: E ? W.OPEN : W.CLOSE
649
649
  }).then((t) => {
650
650
  var n, a;
651
- return p == null || p(t), U(!1), P(!!((n = t.data) != null && n.netOpen)), S(!!((a = t.data) != null && a.enableNetOpen)), Se(t), t;
651
+ return v == null || v(t), U(!1), P(!!((n = t.data) != null && n.netOpen)), S(!!((a = t.data) != null && a.enableNetOpen)), Se(t), t;
652
652
  }), it = xn(() => {
653
653
  var t;
654
- return i.arrange && ((t = i.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ c(wt, {
655
- application: i,
654
+ return o.arrange && ((t = o.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ d(wt, {
655
+ application: o,
656
656
  history: {
657
657
  role: 1,
658
- content: i.arrange[0].openingContent,
658
+ content: o.arrange[0].openingContent,
659
659
  code: 200,
660
660
  messageId: "opening-message",
661
661
  sessionId: "",
@@ -665,10 +665,10 @@ ${e}`), e;
665
665
  actions: [],
666
666
  isLoading: !1
667
667
  },
668
- actions: !!v.length,
669
- markdown: s == null ? void 0 : s.markdown
668
+ actions: !!b.length,
669
+ markdown: r == null ? void 0 : r.markdown
670
670
  }) : null;
671
- }, [i == null ? void 0 : i.arrange, v]);
671
+ }, [o == null ? void 0 : o.arrange, b]);
672
672
  return kn(h, () => ({
673
673
  getCurrentInputText: () => {
674
674
  var t;
@@ -682,22 +682,22 @@ ${e}`), e;
682
682
  }));
683
683
  }, [(ot = e == null ? void 0 : e.data) == null ? void 0 : ot.id]), /* @__PURE__ */ V("div", {
684
684
  className: "agent-chat",
685
- children: [_t ? /* @__PURE__ */ c("div", {
685
+ children: [_t ? /* @__PURE__ */ d("div", {
686
686
  className: "session-loading",
687
- children: /* @__PURE__ */ c(pt, {})
687
+ children: /* @__PURE__ */ d(pt, {})
688
688
  }) : /* @__PURE__ */ V(yn, {
689
- children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ c(Vn, {
689
+ children: [(g == null ? void 0 : g.promptVariables) && /* @__PURE__ */ d(Vn, {
690
690
  ref: Be,
691
- appId: i.id,
691
+ appId: o.id,
692
692
  currentSession: e,
693
693
  promptVariables: O,
694
694
  setPromptVariables: me,
695
- setCurrentSession: p
695
+ setCurrentSession: v
696
696
  }), /* @__PURE__ */ V("div", {
697
697
  className: "chat-main",
698
698
  id: "chat-main",
699
699
  style: Et,
700
- children: [/* @__PURE__ */ c("div", {
700
+ children: [/* @__PURE__ */ d("div", {
701
701
  className: "chat-main-wrapper",
702
702
  id: "scrollableDiv",
703
703
  style: {
@@ -708,8 +708,8 @@ ${e}`), e;
708
708
  },
709
709
  ref: H,
710
710
  onScroll: sn,
711
- children: (st = e == null ? void 0 : e.data) != null && st.id && (v != null && v.length) ? /* @__PURE__ */ V(qn, {
712
- dataLength: v.length,
711
+ children: (st = e == null ? void 0 : e.data) != null && st.id && (b != null && b.length) ? /* @__PURE__ */ V(qn, {
712
+ dataLength: b.length,
713
713
  next: dn,
714
714
  style: {
715
715
  display: "flex",
@@ -717,23 +717,23 @@ ${e}`), e;
717
717
  overflowX: "hidden"
718
718
  },
719
719
  inverse: !0,
720
- endMessage: v.length > xt && // 少于一页不展示这个提示
721
- ((rt = H.current) != null && rt.scrollTop) && ((at = H.current) == null ? void 0 : at.scrollTop) < -10 ? /* @__PURE__ */ c(wn, {
720
+ endMessage: b.length > xt && // 少于一页不展示这个提示
721
+ ((rt = H.current) != null && rt.scrollTop) && ((at = H.current) == null ? void 0 : at.scrollTop) < -10 ? /* @__PURE__ */ d(wn, {
722
722
  plain: !0,
723
723
  children: "没有更多数据了"
724
724
  }) : null,
725
725
  hasMore: _e,
726
- loader: /* @__PURE__ */ c("div", {
726
+ loader: /* @__PURE__ */ d("div", {
727
727
  style: {
728
728
  height: "50px",
729
729
  textAlign: "center",
730
730
  overflow: "hidden"
731
731
  },
732
- children: /* @__PURE__ */ c(pt, {})
732
+ children: /* @__PURE__ */ d(pt, {})
733
733
  }),
734
734
  scrollableTarget: "scrollableDiv",
735
- children: [v.map((t, n) => /* @__PURE__ */ c(Qn, {
736
- application: i,
735
+ children: [b.map((t, n) => /* @__PURE__ */ d(Qn, {
736
+ application: o,
737
737
  currentSession: e,
738
738
  history: t,
739
739
  docViewerUrl: j,
@@ -741,32 +741,32 @@ ${e}`), e;
741
741
  onRelatedClick: an,
742
742
  onAgainClick: ln,
743
743
  onEditClick: rn,
744
- markdown: s == null ? void 0 : s.markdown
744
+ markdown: r == null ? void 0 : r.markdown
745
745
  }, t.messageId + n)), !_e && it]
746
746
  }) : /* @__PURE__ */ V("div", {
747
747
  className: "main-empty",
748
- children: [(s == null ? void 0 : s.greeting) !== !1 && /* @__PURE__ */ c(Dn, {
749
- text: s === void 0 || s.greeting === !0 || ((lt = s.greeting) == null ? void 0 : lt.text) === void 0 ? bt.text : s.greeting.text,
750
- icon: s === void 0 || s.greeting === !0 || ((dt = s.greeting) == null ? void 0 : dt.icon) === void 0 ? Pt || bt.icon : s.greeting.icon,
751
- children: !!Ae.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(Rn, {
748
+ children: [(r == null ? void 0 : r.greeting) !== !1 && /* @__PURE__ */ d(Dn, {
749
+ text: r === void 0 || r.greeting === !0 || ((lt = r.greeting) == null ? void 0 : lt.text) === void 0 ? bt.text : r.greeting.text,
750
+ icon: r === void 0 || r.greeting === !0 || ((dt = r.greeting) == null ? void 0 : dt.icon) === void 0 ? Pt || bt.icon : r.greeting.icon,
751
+ children: !!Ae.length && (((r == null ? void 0 : r.greeting) === void 0 || (r == null ? void 0 : r.greeting)) === !0 || typeof (r == null ? void 0 : r.greeting) == "object" && r.greeting.questions !== !1) && /* @__PURE__ */ d(Rn, {
752
752
  ref: Ie,
753
753
  sid: (ct = e == null ? void 0 : e.data) == null ? void 0 : ct.id,
754
754
  isRecommendClearing: $e,
755
755
  data: Ae,
756
- layoutBreakpoints: typeof (s == null ? void 0 : s.greeting) == "object" ? s.greeting.layoutBreakpoints : void 0,
756
+ layoutBreakpoints: typeof (r == null ? void 0 : r.greeting) == "object" ? r.greeting.layoutBreakpoints : void 0,
757
757
  onItemClick: (t) => {
758
- var a, o, l;
758
+ var a, l, i;
759
759
  if (le(t == null ? void 0 : t.question), Z(t == null ? void 0 : t.question), $e)
760
760
  return;
761
761
  t != null && t.id && X(!0);
762
762
  const n = (a = e == null ? void 0 : e.data) == null ? void 0 : a.id;
763
- g != null && g.fileUpload ? (l = (o = ge.current) == null ? void 0 : o.clear()) == null || l.then(() => {
764
- var r, d;
765
- t != null && t.id && (n ? (r = tt(n, t)) == null || r.finally(() => {
763
+ g != null && g.fileUpload ? (i = (l = ge.current) == null ? void 0 : l.clear()) == null || i.then(() => {
764
+ var c, s;
765
+ t != null && t.id && (n ? (c = tt(n, t)) == null || c.finally(() => {
766
766
  X(!1);
767
- }) : (X(!1), U(!0), (d = nt()) == null || d.then((x) => {
767
+ }) : (X(!1), U(!0), (s = nt()) == null || s.then((p) => {
768
768
  var N;
769
- (N = tt(x.id, t)) == null || N.finally(() => {
769
+ (N = tt(p.id, t)) == null || N.finally(() => {
770
770
  X(!1);
771
771
  });
772
772
  })));
@@ -775,16 +775,16 @@ ${e}`), e;
775
775
  })
776
776
  }), it]
777
777
  })
778
- }), Ye && /* @__PURE__ */ c("div", {
778
+ }), Ye && /* @__PURE__ */ d("div", {
779
779
  className: "session-stop",
780
- children: /* @__PURE__ */ c(Q, {
780
+ children: /* @__PURE__ */ d(Q, {
781
781
  type: "primary",
782
782
  style: {
783
783
  background: "white"
784
784
  },
785
785
  ghost: !0,
786
786
  size: "small",
787
- icon: /* @__PURE__ */ c(re, {
787
+ icon: /* @__PURE__ */ d(re, {
788
788
  type: "icon-zantinghuida",
789
789
  style: {
790
790
  fontSize: 16
@@ -793,15 +793,15 @@ ${e}`), e;
793
793
  onClick: () => nn(),
794
794
  children: "停止回答"
795
795
  })
796
- }), Ke && (v == null ? void 0 : v.length) > 0 && /* @__PURE__ */ c("div", {
796
+ }), Ke && (b == null ? void 0 : b.length) > 0 && /* @__PURE__ */ d("div", {
797
797
  className: "back-bottom",
798
- children: /* @__PURE__ */ c(Q, {
798
+ children: /* @__PURE__ */ d(Q, {
799
799
  size: "small",
800
800
  onClick: () => on({
801
801
  behavior: "smooth"
802
802
  }),
803
803
  type: "link",
804
- icon: /* @__PURE__ */ c(re, {
804
+ icon: /* @__PURE__ */ d(re, {
805
805
  type: "icon-yijianhuidaodibu",
806
806
  style: {
807
807
  fontSize: 24
@@ -809,13 +809,13 @@ ${e}`), e;
809
809
  })
810
810
  })
811
811
  })]
812
- }), /* @__PURE__ */ c("div", {
812
+ }), /* @__PURE__ */ d("div", {
813
813
  className: "chat-footer",
814
814
  children: /* @__PURE__ */ V("div", {
815
815
  className: "chat-footer-input",
816
- children: [ne && /* @__PURE__ */ c("div", {
816
+ children: [ne && /* @__PURE__ */ d("div", {
817
817
  className: "input-files",
818
- children: /* @__PURE__ */ c(Tn, {
818
+ children: /* @__PURE__ */ d(Tn, {
819
819
  file: ne,
820
820
  actions: {
821
821
  upload: tn,
@@ -829,14 +829,14 @@ ${e}`), e;
829
829
  className: "footer-upload-action",
830
830
  onClick: (t) => t.preventDefault(),
831
831
  children: [/* @__PURE__ */ V(pe, {
832
- children: [i.type === kt.Agent && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ c(Cn, {
832
+ children: [o.type === kt.Agent && (g == null ? void 0 : g.imageUpload) && /* @__PURE__ */ d(Cn, {
833
833
  disabled: !!ne || D,
834
834
  accept: ".jpg, .png, .jpeg,.bmp",
835
835
  listType: "picture-card",
836
836
  beforeUpload: en,
837
837
  className: "footer-upload-picture",
838
838
  showUploadList: !1,
839
- children: ne ? /* @__PURE__ */ c(Q, {
839
+ children: ne ? /* @__PURE__ */ d(Q, {
840
840
  type: "text",
841
841
  className: "camera-out-btn",
842
842
  style: {
@@ -845,19 +845,19 @@ ${e}`), e;
845
845
  bottom: "-2px"
846
846
  },
847
847
  disabled: !!ne || D,
848
- icon: /* @__PURE__ */ c(jn, {
848
+ icon: /* @__PURE__ */ d(jn, {
849
849
  className: "icon-tianjia",
850
850
  style: {
851
851
  fontSize: "22px"
852
852
  }
853
853
  })
854
- }) : /* @__PURE__ */ c(In, {
854
+ }) : /* @__PURE__ */ d(In, {
855
855
  placement: "topLeft",
856
856
  overlayClassName: "footer-upload-tooltip",
857
- title: /* @__PURE__ */ c("div", {
857
+ title: /* @__PURE__ */ d("div", {
858
858
  children: "支持上传.jpg .png .jpeg .bmp格式的图片数据,最大20M,单次仅可上传1个"
859
859
  }),
860
- children: /* @__PURE__ */ c(Q, {
860
+ children: /* @__PURE__ */ d(Q, {
861
861
  type: "text",
862
862
  className: "camera-out-btn",
863
863
  style: {
@@ -865,7 +865,7 @@ ${e}`), e;
865
865
  position: "relative",
866
866
  bottom: "-2px"
867
867
  },
868
- icon: /* @__PURE__ */ c(re, {
868
+ icon: /* @__PURE__ */ d(re, {
869
869
  type: "icon-Vector",
870
870
  className: "icon-tianjia",
871
871
  style: {
@@ -874,8 +874,8 @@ ${e}`), e;
874
874
  })
875
875
  })
876
876
  })
877
- }), _ && (g != null && g.fileUpload) && (i != null && i.id) ? /* @__PURE__ */ c(Un, {
878
- appId: i == null ? void 0 : i.id,
877
+ }), _ && (g != null && g.fileUpload) && (o != null && o.id) ? /* @__PURE__ */ d(Un, {
878
+ appId: o == null ? void 0 : o.id,
879
879
  ref: ge,
880
880
  isFirstSession: Qe,
881
881
  docViewerUrl: j,
@@ -886,9 +886,9 @@ ${e}`), e;
886
886
  U(!0), w == null || w({
887
887
  netOpen: E ? W.OPEN : W.CLOSE
888
888
  }).then((n) => {
889
- var o, l, r;
890
- p == null || p(n), U(!1), P(!!((o = n.data) != null && o.netOpen)), S(!!((l = n.data) != null && l.enableNetOpen));
891
- const a = ((r = n.data) == null ? void 0 : r.id) || "";
889
+ var l, i, c;
890
+ v == null || v(n), U(!1), P(!!((l = n.data) != null && l.netOpen)), S(!!((i = n.data) != null && i.enableNetOpen));
891
+ const a = ((c = n.data) == null ? void 0 : c.id) || "";
892
892
  t(a);
893
893
  });
894
894
  }),
@@ -896,19 +896,19 @@ ${e}`), e;
896
896
  disabled: Ne || D,
897
897
  afterFileAdd: (t, n) => {
898
898
  n && ie((a) => {
899
- const o = a[n] || [];
899
+ const l = a[n] || [];
900
900
  return {
901
- [n]: [...o, t]
901
+ [n]: [...l, t]
902
902
  };
903
903
  });
904
904
  },
905
905
  afterFileDelete: (t) => {
906
906
  var a;
907
907
  const n = (a = e == null ? void 0 : e.data) == null ? void 0 : a.id;
908
- n && ie((o) => {
909
- const l = o[n] || [];
908
+ n && ie((l) => {
909
+ const i = l[n] || [];
910
910
  return {
911
- [n]: l.filter((r) => r.id !== t)
911
+ [n]: i.filter((c) => c.id !== t)
912
912
  };
913
913
  });
914
914
  },
@@ -923,8 +923,8 @@ ${e}`), e;
923
923
  [t]: []
924
924
  }), Pe());
925
925
  }
926
- }) : null, (g == null ? void 0 : g.prompt) && (i == null ? void 0 : i.id) && /* @__PURE__ */ c(Wn, {
927
- appId: i.id,
926
+ }) : null, (g == null ? void 0 : g.prompt) && (o == null ? void 0 : o.id) && /* @__PURE__ */ d(Wn, {
927
+ appId: o.id,
928
928
  list: [],
929
929
  search: qe ? jt : "",
930
930
  onPromptSelect: (t) => {
@@ -933,23 +933,23 @@ ${e}`), e;
933
933
  disabled: D
934
934
  })]
935
935
  }), /* @__PURE__ */ V(pe, {
936
- children: [(g == null ? void 0 : g.connectNetwork) && i.type === 0 && ((gt = i.arrange) == null ? void 0 : gt.length) && !!i.arrange[0].enableNetOpen && /* @__PURE__ */ c(Bn, {
936
+ children: [(g == null ? void 0 : g.connectNetwork) && o.type === 0 && ((gt = o.arrange) == null ? void 0 : gt.length) && !!o.arrange[0].enableNetOpen && /* @__PURE__ */ d(Bn, {
937
937
  sessionId: (ut = e == null ? void 0 : e.data) == null ? void 0 : ut.id,
938
938
  netStatus: E,
939
- enable: typeof (s == null ? void 0 : s.connectNetwork) == "object" && typeof (s == null ? void 0 : s.connectNetwork.diabled) == "boolean" ? !(s != null && s.connectNetwork.diabled) : Qt,
939
+ enable: typeof (r == null ? void 0 : r.connectNetwork) == "object" && typeof (r == null ? void 0 : r.connectNetwork.diabled) == "boolean" ? !(r != null && r.connectNetwork.diabled) : Qt,
940
940
  disabledTip: e ? void 0 : "网络访问已被禁用",
941
941
  onNetStatusChange: (t) => {
942
942
  cn(t);
943
943
  }
944
- }), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ c(An, {
944
+ }), (g == null ? void 0 : g.sessionList) && /* @__PURE__ */ d(An, {
945
945
  currentSessionId: (mt = e == null ? void 0 : e.data) == null ? void 0 : mt.id,
946
946
  onSessionChange: (t, n) => {
947
- Z(void 0), Le(!0), p == null || p(n);
947
+ Z(void 0), Le(!0), v == null || v(n);
948
948
  },
949
949
  disabled: D
950
- }), Tt && Ot === "float" && /* @__PURE__ */ c("div", {
950
+ }), Tt && Ot === "float" && /* @__PURE__ */ d("div", {
951
951
  className: "session-history-drawer-component",
952
- children: /* @__PURE__ */ c(Nn, {
952
+ children: /* @__PURE__ */ d(Nn, {
953
953
  placement: "topRight",
954
954
  showArrow: !1,
955
955
  overlayClassName: "session-history-overlay",
@@ -958,11 +958,11 @@ ${e}`), e;
958
958
  },
959
959
  getPopupContainer: (t) => t.parentNode,
960
960
  content: "会话历史记录",
961
- children: /* @__PURE__ */ c(Q, {
961
+ children: /* @__PURE__ */ d(Q, {
962
962
  className: "history-overlay-action",
963
963
  disabled: D,
964
964
  type: "text",
965
- icon: /* @__PURE__ */ c(re, {
965
+ icon: /* @__PURE__ */ d(re, {
966
966
  type: "icon-lishijilu",
967
967
  style: {
968
968
  fontSize: 24
@@ -971,21 +971,21 @@ ${e}`), e;
971
971
  onClick: () => Ze(!0)
972
972
  })
973
973
  })
974
- }), (g == null ? void 0 : g.sessionOpen) && /* @__PURE__ */ c(Q, {
975
- icon: /* @__PURE__ */ c(Mn, {}),
974
+ }), (g == null ? void 0 : g.sessionOpen) && /* @__PURE__ */ d(Q, {
975
+ icon: /* @__PURE__ */ d(Mn, {}),
976
976
  className: "add-btn",
977
977
  type: "primary",
978
- disabled: Ye || !e || !v.length || D,
978
+ disabled: Ye || !e || !b.length || D,
979
979
  onClick: () => {
980
980
  var t, n;
981
- p == null || p(null), P(!1), (t = Be.current) == null || t.clear(), (n = Ie.current) == null || n.clear();
981
+ v == null || v(null), P(!1), (t = Be.current) == null || t.clear(), (n = Ie.current) == null || n.clear();
982
982
  },
983
983
  children: "新会话"
984
984
  })]
985
985
  })]
986
- }), /* @__PURE__ */ c("div", {
986
+ }), /* @__PURE__ */ d("div", {
987
987
  className: "footer-textarea",
988
- children: /* @__PURE__ */ c(Hn, {
988
+ children: /* @__PURE__ */ d(Hn, {
989
989
  ref: fe,
990
990
  maxLength: Ht,
991
991
  text: Ut,
@@ -998,13 +998,13 @@ ${e}`), e;
998
998
  const a = n.getText().replace(/[\n\s]+$/, "");
999
999
  le(a), Mt(a), qe || Ft(!0);
1000
1000
  },
1001
- clearAction: /* @__PURE__ */ c(pe, {
1001
+ clearAction: /* @__PURE__ */ d(pe, {
1002
1002
  size: 0,
1003
- children: /* @__PURE__ */ c(Q, {
1003
+ children: /* @__PURE__ */ d(Q, {
1004
1004
  type: "link",
1005
1005
  disabled: Ne || D,
1006
1006
  ghost: !0,
1007
- icon: /* @__PURE__ */ c(re, {
1007
+ icon: /* @__PURE__ */ d(re, {
1008
1008
  style: {
1009
1009
  fontSize: 22
1010
1010
  },
@@ -1016,9 +1016,9 @@ ${e}`), e;
1016
1016
  })
1017
1017
  })]
1018
1018
  })
1019
- }), /* @__PURE__ */ c(Fn, {
1019
+ }), /* @__PURE__ */ d(Fn, {
1020
1020
  tips: Lt
1021
- }), We && /* @__PURE__ */ c(zn, {
1021
+ }), We && /* @__PURE__ */ d(zn, {
1022
1022
  isvisible: We,
1023
1023
  files: Vt,
1024
1024
  sessionId: (ht = e == null ? void 0 : e.data) == null ? void 0 : ht.id,
@@ -1026,11 +1026,11 @@ ${e}`), e;
1026
1026
  zt(!1), Bt(!1);
1027
1027
  }
1028
1028
  })]
1029
- }), Xe && /* @__PURE__ */ c($n, {
1029
+ }), Xe && /* @__PURE__ */ d($n, {
1030
1030
  currentSession: e,
1031
- application: i,
1031
+ application: o,
1032
1032
  networkStatus: E,
1033
- setCurrentSession: p,
1033
+ setCurrentSession: v,
1034
1034
  disabled: D,
1035
1035
  isSessionHistoryVisible: Xe,
1036
1036
  setIsSessionHistoryVisible: Ze,