@glodon-aiot/agent-cli-ui 3.19.0-alpha.20 → 3.19.0-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.
Files changed (32) hide show
  1. package/dist/es/Dialog/AgentChat/HistoryItem/FileItem/index.mjs +52 -59
  2. package/dist/es/Dialog/AgentChat/HistoryItem/SessionAction/index.mjs +67 -70
  3. package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +100 -103
  4. package/dist/es/Dialog/AgentChat/Tools/SessionListDrawer/HistorySessionList/index.mjs +76 -87
  5. package/dist/es/Dialog/AgentChat/Tools/UploadKnowledgeFiles/index.mjs +121 -124
  6. package/dist/es/Dialog/AgentChat/index.mjs +393 -382
  7. package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +150 -157
  8. package/dist/es/components/Recommend/RecommendItem.mjs +33 -36
  9. package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
  10. package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
  11. package/dist/es/src/style11.css +1 -1
  12. package/dist/es/src/style12.css +1 -1
  13. package/dist/es/src/style13.css +1 -1
  14. package/dist/es/src/style14.css +1 -1
  15. package/dist/es/src/style15.css +1 -1
  16. package/dist/es/src/style17.css +1 -1
  17. package/dist/es/src/style18.css +1 -1
  18. package/dist/es/src/style19.css +1 -1
  19. package/dist/es/src/style24.css +1 -1
  20. package/dist/es/src/style25.css +1 -1
  21. package/dist/es/src/style27.css +1 -1
  22. package/dist/es/src/style28.css +1 -1
  23. package/dist/es/src/style29.css +1 -1
  24. package/dist/es/src/style30.css +1 -1
  25. package/dist/es/src/style31.css +1 -1
  26. package/dist/es/src/style32.css +1 -1
  27. package/dist/es/src/style7.css +1 -1
  28. package/dist/es/src/style9.css +1 -1
  29. package/dist/es/utils/scopedMessage.mjs +29 -0
  30. package/dist/lib/index.js +53 -53
  31. package/dist/src/utils/scopedMessage.d.ts +7 -0
  32. package/package.json +3 -3
@@ -1,67 +1,68 @@
1
- var jn = Object.defineProperty, $n = Object.defineProperties;
2
- var zn = Object.getOwnPropertyDescriptors;
1
+ var Hn = Object.defineProperty, jn = Object.defineProperties;
2
+ var $n = Object.getOwnPropertyDescriptors;
3
3
  var jt = Object.getOwnPropertySymbols;
4
- var Vn = Object.prototype.hasOwnProperty, Bn = Object.prototype.propertyIsEnumerable;
5
- var Me = (k, h, i) => h in k ? jn(k, h, { enumerable: !0, configurable: !0, writable: !0, value: i }) : k[h] = i, je = (k, h) => {
4
+ var zn = Object.prototype.hasOwnProperty, Vn = Object.prototype.propertyIsEnumerable;
5
+ var He = (b, h, i) => h in b ? Hn(b, h, { enumerable: !0, configurable: !0, writable: !0, value: i }) : b[h] = i, je = (b, h) => {
6
6
  for (var i in h || (h = {}))
7
- Vn.call(h, i) && Me(k, i, h[i]);
7
+ zn.call(h, i) && He(b, i, h[i]);
8
8
  if (jt)
9
9
  for (var i of jt(h))
10
- Bn.call(h, i) && Me(k, i, h[i]);
11
- return k;
12
- }, $e = (k, h) => $n(k, zn(h));
13
- var j = (k, h, i) => (Me(k, typeof h != "symbol" ? h + "" : h, i), i);
14
- var $ = (k, h, i) => new Promise((U, e) => {
15
- var C = (D) => {
10
+ Vn.call(h, i) && He(b, i, h[i]);
11
+ return b;
12
+ }, $e = (b, h) => jn(b, $n(h));
13
+ var j = (b, h, i) => (He(b, typeof h != "symbol" ? h + "" : h, i), i);
14
+ var $ = (b, h, i) => new Promise((A, e) => {
15
+ var I = (T) => {
16
16
  try {
17
- b(i.next(D));
18
- } catch (O) {
19
- e(O);
17
+ x(i.next(T));
18
+ } catch (R) {
19
+ e(R);
20
20
  }
21
- }, V = (D) => {
21
+ }, z = (T) => {
22
22
  try {
23
- b(i.throw(D));
24
- } catch (O) {
25
- e(O);
23
+ x(i.throw(T));
24
+ } catch (R) {
25
+ e(R);
26
26
  }
27
- }, b = (D) => D.done ? U(D.value) : Promise.resolve(D.value).then(C, V);
28
- b((i = i.apply(k, h)).next());
27
+ }, x = (T) => T.done ? A(T.value) : Promise.resolve(T.value).then(I, z);
28
+ x((i = i.apply(b, h)).next());
29
29
  });
30
- import { jsx as g, jsxs as F, Fragment as _n } from "react/jsx-runtime";
31
- import { memo as qn, forwardRef as Wn, useState as p, useRef as Y, useContext as Kn, useEffect as E, useMemo as Yn, useImperativeHandle as Sn } from "react";
32
- /* empty css */import { message as $t, Spin as zt, Divider as Qn, Button as G, Space as Ne, Upload as Xn, Tooltip as Gn, Popover as Zn, notification as se } from "antd";
30
+ import { jsx as g, jsxs as U, Fragment as Bn } from "react/jsx-runtime";
31
+ import { memo as _n, forwardRef as qn, useState as p, useRef as K, useContext as Wn, useEffect as N, useMemo as Kn, useImperativeHandle as Sn } from "react";
32
+ /* empty css */import { Spin as $t, Divider as Yn, Button as G, Space as Ee, Upload as Qn, Tooltip as Xn, Popover as Gn, notification as se, message as Zn } from "antd";
33
33
  import re from "../../components/Iconfont/index.mjs";
34
- import { IHistoryRole as ae, ApplicationTypes as S, ChatMessageRole as Vt, PromptVariableType as Ee } from "@glodon-aiot/apis";
35
- import Kt from "./HistoryItem/index.mjs";
36
- import Yt from "dayjs";
34
+ import { IHistoryRole as ae, ApplicationTypes as S, ChatMessageRole as zt, PromptVariableType as Ne } from "@glodon-aiot/apis";
35
+ import Wt from "./HistoryItem/index.mjs";
36
+ import Kt from "dayjs";
37
37
  import { v4 as _e } from "uuid";
38
38
  import Jn from "../../context.mjs";
39
39
  import { configuration as ei } from "@glodon-aiot/bot-client-sdk";
40
- import { MAX_KNOWLEDGES_AND_FILES_COUNT as Bt, NET_OPEN_STATUS as le, MB as ti } from "../../constant.mjs";
40
+ import { MAX_KNOWLEDGES_AND_FILES_COUNT as Vt, NET_OPEN_STATUS as le, MB as ti } from "../../constant.mjs";
41
41
  import ni from "../../components/FilePreview/index.mjs";
42
- import { calcKnowledgesLeafCount as ii, getImageExtension as _t, fileTypes as oi } from "../../utils/index.mjs";
43
- import si from "../../QuillEditor/index.mjs";
44
- import ri from "../../components/Recommend/index.mjs";
45
- import ai from "../../components/Greeting/index.mjs";
46
- import li from "../../Footer/index.mjs";
47
- import { PlusOutlined as ci } from "@ant-design/icons";
48
- import di from "./Tools/UploadKnowledgeFiles/index.mjs";
49
- import fi from "../UploadingPrompt/index.mjs";
50
- import gi from "./PromptSetting/index.mjs";
42
+ import { calcKnowledgesLeafCount as ii, getImageExtension as Bt, fileTypes as oi } from "../../utils/index.mjs";
43
+ import { withAgentCliMessage as si } from "../../utils/scopedMessage.mjs";
44
+ import ri from "../../QuillEditor/index.mjs";
45
+ import ai from "../../components/Recommend/index.mjs";
46
+ import li from "../../components/Greeting/index.mjs";
47
+ import ci from "../../Footer/index.mjs";
48
+ import { PlusOutlined as di } from "@ant-design/icons";
49
+ import fi from "./Tools/UploadKnowledgeFiles/index.mjs";
50
+ import gi from "../UploadingPrompt/index.mjs";
51
+ import ui from "./PromptSetting/index.mjs";
51
52
  import { useMemoizedFn as ze } from "ahooks";
52
- import ui from "./Tools/SessionListDrawer/index.mjs";
53
- import pi from "./Tools/SessionHistoryDrawer/index.mjs";
54
- import hi from "react-infinite-scroll-component";
55
- import mi from "./Tools/ConnectToNetwork/index.mjs";
56
- import yi from "./Tools/PromptManager/index.mjs";
57
- import { useSessionState as vi } from "../../hooks/useSessionState.mjs";
58
- import wi from "../../assets/icon.svg.mjs";
59
- const ki = qn(Kt), qt = {
60
- icon: wi,
53
+ import pi from "./Tools/SessionListDrawer/index.mjs";
54
+ import hi from "./Tools/SessionHistoryDrawer/index.mjs";
55
+ import mi from "react-infinite-scroll-component";
56
+ import yi from "./Tools/ConnectToNetwork/index.mjs";
57
+ import vi from "./Tools/PromptManager/index.mjs";
58
+ import { useSessionState as wi } from "../../hooks/useSessionState.mjs";
59
+ import ki from "../../assets/icon.svg.mjs";
60
+ const bi = _n(Wt), _t = {
61
+ icon: ki,
61
62
  text: "今天我能帮你什么?"
62
63
  };
63
64
  class he {
64
- constructor(h, i, U, e, C) {
65
+ constructor(h, i, A, e, I) {
65
66
  j(this, "messageTime");
66
67
  j(this, "isWaiting");
67
68
  j(this, "messageId");
@@ -73,113 +74,113 @@ class he {
73
74
  j(this, "imageContent");
74
75
  // 新增:支持对话型应用的图片内容
75
76
  j(this, "comment");
76
- this.content = h, this.sessionId = i, this.role = U, this.files = e, this.content = h, this.role = U, this.sessionId = i, this.files = e, this.imageContent = C, this.messageTime = Yt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = _e(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
77
+ this.content = h, this.sessionId = i, this.role = A, this.files = e, this.content = h, this.role = A, this.sessionId = i, this.files = e, this.imageContent = I, this.messageTime = Kt(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = _e(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
77
78
  isAgree: 0
78
79
  };
79
80
  }
80
81
  }
81
- const Wt = 10, Z = 5, Ve = 20, Be = (k, h, i, U) => {
82
- let e = k;
83
- if (U === S.Agent) {
82
+ const qt = 10, Z = 5, Ve = 20, Be = (b, h, i, A) => {
83
+ let e = b;
84
+ if (A === S.Agent) {
84
85
  if (i && i.length > 0) {
85
- const C = i.map((V) => `[${V.name.replace(/\.[^/.]+$/, "")}](${V.url})`).join(`
86
+ const I = i.map((z) => `[${z.name.replace(/\.[^/.]+$/, "")}](${z.url})`).join(`
86
87
  `);
87
- e = C ? `${C}
88
+ e = I ? `${I}
88
89
  ${e}` : e;
89
90
  }
90
91
  if (h && h.length > 0) {
91
- const C = h.filter(Boolean).map((V) => `![](${V})`).join(`
92
+ const I = h.filter(Boolean).map((z) => `![](${z})`).join(`
92
93
  `);
93
- e = C ? `${C}
94
+ e = I ? `${I}
94
95
  ${e}` : e;
95
96
  }
96
97
  }
97
98
  return e;
98
- }, bi = (k) => {
99
- const h = Math.floor(k / 3600), i = Math.floor(k % 3600 / 60), U = k % 60, e = (C) => String(C).padStart(2, "0");
100
- return `${e(h)}:${e(i)}:${e(U)}`;
101
- }, eo = Wn((k, h) => {
102
- var bt, xt, Ct, It, Nt, Et, Lt, Pt, Tt, Dt, Ot, Rt, Ft, Ut;
99
+ }, xi = (b) => {
100
+ const h = Math.floor(b / 3600), i = Math.floor(b % 3600 / 60), A = b % 60, e = (I) => String(I).padStart(2, "0");
101
+ return `${e(h)}:${e(i)}:${e(A)}`;
102
+ }, no = qn((b, h) => {
103
+ var bt, xt, Ct, It, Et, Nt, Lt, Pt, Dt, Tt, Rt, Ot, Ft, Ut;
103
104
  const {
104
105
  application: i,
105
- docViewerUrl: U = "",
106
+ docViewerUrl: A = "",
106
107
  currentSession: e,
107
- onCreateSession: C,
108
- embeddingService: V,
109
- setCurrentSession: b,
110
- networkStatus: D,
111
- setNetworkStatus: O
112
- } = k, [w, L] = p([]), [St, me] = p(), [Le, qe] = p(), H = Y(null), {
113
- service: A,
108
+ onCreateSession: I,
109
+ embeddingService: z,
110
+ setCurrentSession: x,
111
+ networkStatus: T,
112
+ setNetworkStatus: R
113
+ } = b, [w, L] = p([]), [St, me] = p(), [Le, qe] = p(), O = K(null), {
114
+ service: M,
114
115
  agentClient: P,
115
- depId: Qt,
116
- footer: Xt,
116
+ depId: Yt,
117
+ footer: Qt,
117
118
  transform: f,
118
119
  defaultInput: Pe,
119
120
  onMessage: ye,
120
121
  onHistoryLoad: We,
121
- beforeMessageSend: q,
122
- bodyStyle: Gt,
123
- disabled: R,
122
+ beforeMessageSend: _,
123
+ bodyStyle: Xt,
124
+ disabled: F,
124
125
  features: a,
125
- popupContainer: z,
126
- icon: Zt,
127
- sider: Jt,
128
- mode: en,
129
- silencedSeconds: Te
130
- } = Kn(Jn), [Ke, De] = p(!1), y = Y(w), Ye = Y(void 0), [tn, nn] = p(0), [ce, ve] = p([]), [J, we] = p([]), [Se, Qe] = p(0), [Xe, on] = p(!1);
131
- E(() => {
132
- on(Se > 0);
133
- }, [Se]);
134
- const ke = Y(null), [Ge, sn] = p([]), [Ze, ee] = p(!1), [Je, rn] = p(!1), [an, ln] = p(""), [cn, te] = p(), [ne, de] = p({}), fe = Y(null), et = Y(null), Oe = Y(null), [tt, dn] = p(!1), [fn, gn] = p([]), [un, be] = p(!0), [pn, hn] = p(!0), [nt, B] = p(!1), [Re, W] = p(!1), [it, mn] = p(!1), [M, ge] = p(typeof (a == null ? void 0 : a.promptVariables) == "object" ? a.promptVariables.default || [] : []), [yn, vn] = p(() => {
126
+ popupContainer: Y,
127
+ icon: Gt,
128
+ sider: Zt,
129
+ mode: Jt,
130
+ silencedSeconds: De
131
+ } = Wn(Jn), [Ke, Te] = p(!1), y = K(w), Se = K(void 0), [en, tn] = p(0), [ce, ve] = p([]), [J, we] = p([]), [Ye, Qe] = p(0), [Xe, nn] = p(!1);
132
+ N(() => {
133
+ nn(Ye > 0);
134
+ }, [Ye]);
135
+ const ke = K(null), [Ge, on] = p([]), [Ze, ee] = p(!1), [Je, sn] = p(!1), [rn, an] = p(""), [ln, te] = p(), [ne, de] = p({}), fe = K(null), et = K(null), Re = K(null), [tt, cn] = p(!1), [dn, fn] = p([]), [gn, be] = p(!0), [un, pn] = p(!0), [nt, V] = p(!1), [Oe, q] = p(!1), [it, hn] = p(!1), [H, ge] = p(typeof (a == null ? void 0 : a.promptVariables) == "object" ? a.promptVariables.default || [] : []), [mn, yn] = p(() => {
135
136
  const t = typeof (a == null ? void 0 : a.knowledges) == "object" && a.knowledges.default || void 0;
136
137
  if (t) {
137
138
  if (Array.isArray(t) && t.some((r) => Array.isArray(r.fileIds) && r.fileIds.length === 0))
138
139
  throw Error("fileIds cannot be an empty array");
139
- if (ii(t) > Bt)
140
- throw Error(`knowledges and fileIds total count cannot exceed ${Bt}`);
140
+ if (ii(t) > Vt)
141
+ throw Error(`knowledges and fileIds total count cannot exceed ${Vt}`);
141
142
  }
142
143
  return t;
143
- }), [ot, Q] = p(!1), [st, ue] = p(!1), [wn, pe] = p(typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.default) == "boolean" ? a.connectNetwork.default : !1), [rt, xe] = p(!1), [kn, K] = p(!1), [bn, xn] = p(null), [Ce, X] = p(!1), [at, lt] = p(!1), {
144
+ }), [ot, Q] = p(!1), [st, ue] = p(!1), [vn, pe] = p(typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.default) == "boolean" ? a.connectNetwork.default : !1), [rt, xe] = p(!1), [wn, W] = p(!1), [kn, bn] = p(null), [Ce, X] = p(!1), [at, lt] = p(!1), {
144
145
  isSwitchingToExistingSession: ct,
145
146
  setIsSwitchingToExistingSession: Ie
146
- } = vi(), ie = Y(null), [Fe, Cn] = p("");
147
- E(() => {
148
- if (!Te)
147
+ } = wi(), ie = K(null), [Fe, xn] = p("");
148
+ N(() => {
149
+ if (!De)
149
150
  return;
150
- let t = bi(Te);
151
- Cn(t);
152
- }, [Te]), E(() => {
153
- if (xn(e), e === null)
154
- K(!1);
151
+ let t = xi(De);
152
+ xn(t);
153
+ }, [De]), N(() => {
154
+ if (bn(e), e === null)
155
+ W(!1);
155
156
  else if (e === void 0)
156
- K(!0);
157
+ W(!0);
157
158
  else {
158
- if (bn === null) {
159
+ if (kn === null) {
159
160
  if (ct) {
160
- K(!0), Ie(!1);
161
+ W(!0), Ie(!1);
161
162
  return;
162
163
  }
163
- K(!1);
164
+ W(!1);
164
165
  return;
165
166
  }
166
- e.ready ? K(!1) : K(!0);
167
+ e.ready ? W(!1) : W(!0);
167
168
  }
168
- }, [e, e == null ? void 0 : e.ready, ct]), E(() => {
169
+ }, [e, e == null ? void 0 : e.ready, ct]), N(() => {
169
170
  var o, r;
170
171
  e && (y.current = []), L([]);
171
- const t = H.current;
172
+ const t = O.current;
172
173
  if (t && t.scrollTo({
173
174
  top: 0
174
175
  }), !((o = e == null ? void 0 : e.data) != null && o.id))
175
176
  return;
176
- if (W(!1), B(!1), (r = e.messages) != null && r.length) {
177
- const d = [...e.messages.filter((l) => l == null ? void 0 : l.messageId)].reverse();
178
- y.current = [...d], L([...d]), K(!1);
177
+ if (q(!1), V(!1), (r = e.messages) != null && r.length) {
178
+ const c = [...e.messages.filter((l) => l == null ? void 0 : l.messageId)].reverse();
179
+ y.current = [...c], L([...c]), W(!1);
179
180
  }
180
181
  const n = (s) => {
181
- var d;
182
- (d = e == null ? void 0 : e.data) != null && d.id && (y.current = [...s].reverse(), L([...s].reverse()), !s || s.length < 10 ? ue(!1) : ue(!0), K(!1), We && We({
182
+ var c;
183
+ (c = e == null ? void 0 : e.data) != null && c.id && (y.current = [...s].reverse(), L([...s].reverse()), !s || s.length < 10 ? ue(!1) : ue(!0), W(!1), We && We({
183
184
  applicationId: i.id,
184
185
  sessionId: e.data.id,
185
186
  histories: s
@@ -188,22 +189,22 @@ ${e}` : e;
188
189
  return e.addEventListener("history:loaded", n), () => {
189
190
  y.current = [], L([]), e == null || e.removeEventListener("history:loaded", n);
190
191
  };
191
- }, [e]), E(() => {
192
+ }, [e]), N(() => {
192
193
  const t = () => {
193
194
  var n;
194
- (n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ge(e.promptVariables.sort((o, r) => o.key.localeCompare(r.key))), e.knowledges && vn(e.knowledges), O(e.netOpen));
195
+ (n = e == null ? void 0 : e.data) != null && n.id && (e.promptVariables && ge(e.promptVariables.sort((o, r) => o.key.localeCompare(r.key))), e.knowledges && yn(e.knowledges), R(e.netOpen));
195
196
  };
196
197
  return e == null || e.addEventListener("data:updated", t), () => {
197
198
  e == null || e.removeEventListener("data:updated", t);
198
199
  };
199
- }, [e]), E(() => {
200
+ }, [e]), N(() => {
200
201
  var n;
201
202
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
202
203
  return;
203
204
  const t = (o) => {
204
205
  var r;
205
206
  console.error(o.message, o.cause, "e.case"), se.config({
206
- getContainer: () => (z == null ? void 0 : z.current) || document.body,
207
+ getContainer: () => (Y == null ? void 0 : Y.current) || document.body,
207
208
  prefixCls: "gbot-notification"
208
209
  }), se.error({
209
210
  message: ((r = o.cause) == null ? void 0 : r.message) || o.message
@@ -216,13 +217,13 @@ ${e}` : e;
216
217
  e == null || e.removeEventListener("error", t);
217
218
  };
218
219
  }, [e]);
219
- const In = () => {
220
+ const Cn = () => {
220
221
  var o;
221
222
  if (!((o = e == null ? void 0 : e.data) != null && o.id) || !(i != null && i.id))
222
223
  return;
223
224
  const t = e.data.id, n = w[w.length - 1];
224
225
  if (n && n.isContext) {
225
- T("success", "已开启新话题");
226
+ D("success", "已开启新话题");
226
227
  return;
227
228
  } else
228
229
  e.clear().then(() => {
@@ -230,42 +231,42 @@ ${e}` : e;
230
231
  r.isContext = !0, L([r, ...w]);
231
232
  });
232
233
  };
233
- E(() => {
234
- i != null && i.id && (A == null || A.getRecommendQues(i.id).then((t) => {
235
- sn(t);
234
+ N(() => {
235
+ i != null && i.id && (M == null || M.getRecommendQues(i.id).then((t) => {
236
+ on(t);
236
237
  }));
237
- }, [Qt, i]);
238
+ }, [Yt, i]);
238
239
  const dt = (t) => $(void 0, null, function* () {
239
- var u, N;
240
- if (R) {
241
- T("error", "发送功能被禁用");
240
+ var u, E;
241
+ if (F) {
242
+ D("error", "发送功能被禁用");
242
243
  return;
243
244
  }
244
245
  const n = t || St;
245
246
  if (!(n != null && n.trim())) {
246
- T("error", "请输入你想问的");
247
+ D("error", "请输入你想问的");
247
248
  return;
248
249
  }
249
- if (!(M == null ? void 0 : M.every((x) => !!(x != null && x.value))))
250
+ if (!(H == null ? void 0 : H.every((C) => !!(C != null && C.value))))
250
251
  if (f != null && f.promptVariables) {
251
- T("error", "变量值不能为空");
252
+ D("error", "变量值不能为空");
252
253
  return;
253
254
  } else
254
- console.error("变量值不能为空", M == null ? void 0 : M.map((x) => !!(x != null && x.value)));
255
- if (Re) {
256
- T("error", "正在回复中");
255
+ console.error("变量值不能为空", H == null ? void 0 : H.map((C) => !!(C != null && C.value)));
256
+ if (Oe) {
257
+ D("error", "正在回复中");
257
258
  return;
258
259
  }
259
260
  if (Ke) {
260
- T("error", "等待初始化");
261
+ D("error", "等待初始化");
261
262
  return;
262
263
  }
263
- if (!un) {
264
- T("error", "正在解析文件");
264
+ if (!gn) {
265
+ D("error", "正在解析文件");
265
266
  return;
266
267
  }
267
268
  if (Xe) {
268
- T("error", "正在上传图片");
269
+ D("error", "正在上传图片");
269
270
  return;
270
271
  }
271
272
  ve([]), we([]);
@@ -273,14 +274,14 @@ ${e}` : e;
273
274
  if (!r) {
274
275
  if (Ce)
275
276
  return;
276
- X(!0), C == null || C({
277
- netOpen: D ? le.OPEN : le.CLOSE
278
- }).then((x) => {
279
- var m, _;
280
- Q(!0), O(!!((m = x.data) != null && m.netOpen)), pe(!!((_ = x.data) != null && _.enableNetOpen)), Ue(x).then(() => {
281
- b == null || b(x), Q(!1), qe(n);
277
+ X(!0), I == null || I({
278
+ netOpen: T ? le.OPEN : le.CLOSE
279
+ }).then((C) => {
280
+ var m, B;
281
+ Q(!0), R(!!((m = C.data) != null && m.netOpen)), pe(!!((B = C.data) != null && B.enableNetOpen)), Ue(C).then(() => {
282
+ x == null || x(C), Q(!1), qe(n);
282
283
  });
283
- }).catch((x) => {
284
+ }).catch((C) => {
284
285
  X(!1);
285
286
  });
286
287
  return;
@@ -289,55 +290,55 @@ ${e}` : e;
289
290
  return;
290
291
  X(!0), xe(!0);
291
292
  const s = Be(n, J, ne[r], (i == null ? void 0 : i.type) || 0);
292
- let d;
293
+ let c;
293
294
  try {
294
- q ? d = yield q == null ? void 0 : q({
295
+ _ ? c = yield _ == null ? void 0 : _({
295
296
  applicationId: i.id,
296
297
  sessionId: r,
297
298
  message: {
298
299
  content: s,
299
300
  sessionId: r,
300
- role: Vt.User,
301
+ role: zt.User,
301
302
  files: ne[r]
302
303
  }
303
- }) : d = !0;
304
- } catch (x) {
305
- d = !1;
304
+ }) : c = !0;
305
+ } catch (C) {
306
+ c = !1;
306
307
  }
307
- if (xe(!1), d === !1) {
308
+ if (xe(!1), c === !1) {
308
309
  X(!1);
309
310
  return;
310
311
  }
311
312
  let l = n;
312
- typeof d == "object" && (l = d.content || n);
313
- const c = yield (() => new Promise((x) => {
314
- ge((m) => (x(m), m));
313
+ typeof c == "object" && (l = c.content || n);
314
+ const d = yield (() => new Promise((C) => {
315
+ ge((m) => (C(m), m));
315
316
  }))();
316
- if (!(yield e.setPromptVariables(c))) {
317
+ if (!(yield e.setPromptVariables(d))) {
317
318
  X(!1);
318
319
  return;
319
320
  }
320
- ((N = ne[r]) == null ? void 0 : N.length) > 0 ? Nn(l) : He(l);
321
+ ((E = ne[r]) == null ? void 0 : E.length) > 0 ? In(l) : Ae(l);
321
322
  }), Ue = (t) => new Promise((n, o) => $(void 0, null, function* () {
322
- const d = (t == null ? void 0 : t.promptVariables).filter((l) => l.type ? !((l.type === Ee.User || l.type === void 0) && l.key === "query") && !((l.type === Ee.System || l.type === void 0) && l.key === "datetime") : l.key !== "query").map((l) => {
323
- var c;
324
- const v = (c = M.find((I) => I.key === l.key && I.type === l.type)) == null ? void 0 : c.value;
323
+ const c = (t == null ? void 0 : t.promptVariables).filter((l) => l.type ? !((l.type === Ne.User || l.type === void 0) && l.key === "query") && !((l.type === Ne.System || l.type === void 0) && l.key === "datetime") : l.key !== "query").map((l) => {
324
+ var d;
325
+ const v = (d = H.find((k) => k.key === l.key && k.type === l.type)) == null ? void 0 : d.value;
325
326
  return l.value = v || "", l;
326
327
  });
327
- ge(d.sort((l, v) => l.key.localeCompare(v.key))), yield t == null ? void 0 : t.setPromptVariables(d).catch((l) => {
328
- console.error(l), T("error", l.message);
328
+ ge(c.sort((l, v) => l.key.localeCompare(v.key))), yield t == null ? void 0 : t.setPromptVariables(c).catch((l) => {
329
+ console.error(l), D("error", l.message);
329
330
  }), n();
330
- })), Nn = (t) => {
331
- var s, d, l;
331
+ })), In = (t) => {
332
+ var s, c, l;
332
333
  if (be(!1), !((s = e == null ? void 0 : e.data) != null && s.id) || !(i != null && i.id))
333
334
  return;
334
- const n = ((d = e.data) == null ? void 0 : d.id) || "";
335
+ const n = ((c = e.data) == null ? void 0 : c.id) || "";
335
336
  let o = [], r = /* @__PURE__ */ new Set();
336
337
  (l = ne[n]) == null || l.forEach((v) => {
337
338
  r.has(v.id) || (o.push(v), r.add(v.id));
338
- }), be(!0), He(t, o);
339
+ }), be(!0), Ae(t, o);
339
340
  };
340
- E(() => {
341
+ N(() => {
341
342
  if (!Le || !e)
342
343
  return;
343
344
  const t = Le, n = () => $(void 0, null, function* () {
@@ -345,13 +346,13 @@ ${e}` : e;
345
346
  const o = Be(t, J, ne[e.id], (i == null ? void 0 : i.type) || 0);
346
347
  let r;
347
348
  try {
348
- q ? r = yield q == null ? void 0 : q({
349
+ _ ? r = yield _ == null ? void 0 : _({
349
350
  applicationId: i.id,
350
351
  sessionId: e.id,
351
352
  message: {
352
353
  content: o,
353
354
  sessionId: e.id,
354
- role: Vt.User,
355
+ role: zt.User,
355
356
  files: ne[e.id]
356
357
  }
357
358
  }) : r = !0;
@@ -362,28 +363,28 @@ ${e}` : e;
362
363
  X(!1);
363
364
  return;
364
365
  }
365
- He(t), qe(void 0);
366
+ Ae(t), qe(void 0);
366
367
  });
367
368
  return e.ready ? n() : e.addEventListener("ready", n, !0), () => {
368
369
  e == null || e.removeEventListener("ready", n);
369
370
  };
370
371
  }, [Le, e]);
371
- const He = (t, n) => $(void 0, null, function* () {
372
- var u, N, x;
372
+ const Ae = (t, n) => $(void 0, null, function* () {
373
+ var u, E, C;
373
374
  const o = (u = e == null ? void 0 : e.data) == null ? void 0 : u.id;
374
375
  if (!o)
375
376
  return;
376
- W(!0), B(!0);
377
+ q(!0), V(!0);
377
378
  const r = Be(t, J, n, (i == null ? void 0 : i.type) || 0);
378
379
  let s;
379
380
  if (i.type === S.Agent)
380
381
  s = void 0;
381
- else if (i.type === S.Dialog && ((N = i.arrange) != null && N.length) && i.arrange[0].visionOpen) {
382
+ else if (i.type === S.Dialog && ((E = i.arrange) != null && E.length) && i.arrange[0].visionOpen) {
382
383
  const m = J && J.length ? J.filter(Boolean) : [];
383
384
  s = m.length ? m : void 0;
384
385
  } else
385
386
  s = void 0;
386
- const d = new he(
387
+ const c = new he(
387
388
  r,
388
389
  o,
389
390
  ae.User,
@@ -391,35 +392,35 @@ ${e}` : e;
391
392
  s
392
393
  // 新增:传入图片内容
393
394
  );
394
- me(void 0), te(void 0), y.current = [d, ...w], L(y.current), i.id && ye && ye({
395
+ me(void 0), te(void 0), y.current = [c, ...w], L(y.current), i.id && ye && ye({
395
396
  applicationId: i.id,
396
397
  sessionId: o,
397
- message: d
398
+ message: c
398
399
  });
399
400
  const l = new he("", o, ae.System);
400
401
  l.isWaiting = !0, y.current = [l, ...y.current], L(y.current);
401
- const v = (n == null ? void 0 : n.map((m) => m.id)) || [], c = {
402
+ const v = (n == null ? void 0 : n.map((m) => m.id)) || [], d = {
402
403
  stream: ei.stream,
403
404
  referenceFirst: !1
404
405
  };
405
406
  if (f != null && f.promptVariables) {
406
- const m = M == null ? void 0 : M.reduce((_, oe) => (_[oe.key] = oe.value, _), {});
407
- c.formatValues = m;
407
+ const m = H == null ? void 0 : H.reduce((B, oe) => (B[oe.key] = oe.value, B), {});
408
+ d.formatValues = m;
408
409
  }
409
410
  if (f != null && f.knowledges) {
410
- const m = yn;
411
- c.knowledges = m;
411
+ const m = mn;
412
+ d.knowledges = m;
412
413
  }
413
- const I = {
414
+ const k = {
414
415
  text: r,
415
416
  fileIds: v,
416
417
  files: n
417
418
  };
418
- s && s.length > 0 && (I.imageContent = s), yield e.send(I, c), de({
419
+ s && s.length > 0 && (k.imageContent = s), yield e.send(k, d), de({
419
420
  [o]: []
420
- }), (x = fe.current) == null || x.update(), ve([]), we([]), X(!1);
421
+ }), (C = fe.current) == null || C.update(), ve([]), we([]), X(!1);
421
422
  });
422
- E(() => {
423
+ N(() => {
423
424
  var v;
424
425
  const t = (v = e == null ? void 0 : e.data) == null ? void 0 : v.id;
425
426
  if (!t)
@@ -429,110 +430,106 @@ ${e}` : e;
429
430
  n = null, o && (L([o, ...y.current]), o = null);
430
431
  }, s = () => {
431
432
  n !== null && (cancelAnimationFrame(n), n = null, o = null);
432
- }, d = (c) => {
433
- if (!c.sessionId || c.sessionId && c.sessionId !== Ye.current || c.role === ae.User)
433
+ }, c = (d) => {
434
+ if (!d.sessionId || d.sessionId && d.sessionId !== Se.current || d.role === ae.User)
434
435
  return;
435
- if (c.index === -1 && c.code !== 200 && c.code !== 11915 && (s(), B(!1), W(!1), y.current = y.current.filter((N) => !N.isWaiting), L([...y.current]), y.current = [...y.current], c.content)) {
436
+ if (d.index === -1 && d.code !== 200 && d.code !== 11915 && (s(), V(!1), q(!1), y.current = y.current.filter((E) => !E.isWaiting), L([...y.current]), y.current = [...y.current], d.content)) {
436
437
  se.config({
437
- getContainer: () => (z == null ? void 0 : z.current) || document.body,
438
+ getContainer: () => (Y == null ? void 0 : Y.current) || document.body,
438
439
  prefixCls: "gbot-notification"
439
440
  }), se.error({
440
- message: c.content
441
+ message: d.content
441
442
  }), se.config({
442
443
  getContainer: void 0,
443
444
  prefixCls: "gbot-notification"
444
445
  });
445
446
  return;
446
447
  }
447
- const I = c.actions || [], u = new he(c.content, t, ae.Robot);
448
- if (u.messageId = c.messageId || _e(), u.reasoningContent = c.reasoningContent, u.searchReference = c.searchReference, u.thinkingSecs = c.thinkingSecs, u.thinkingStatus = c.thinkingStatus, u.actions = I, u.isLoading = !0, u.searchingStatus = c.searchingStatus, y.current = y.current.filter((N) => !N.isWaiting).filter((N) => !N.isReplying), c.index === void 0) {
448
+ const k = d.actions || [], u = new he(d.content, t, ae.Robot);
449
+ if (u.messageId = d.messageId || _e(), u.reasoningContent = d.reasoningContent, u.searchReference = d.searchReference, u.thinkingSecs = d.thinkingSecs, u.thinkingStatus = d.thinkingStatus, u.actions = k, u.isLoading = !0, u.searchingStatus = d.searchingStatus, y.current = y.current.filter((E) => !E.isWaiting).filter((E) => !E.isReplying), d.index === void 0) {
449
450
  o = u, n === null && (n = requestAnimationFrame(r));
450
451
  return;
451
452
  }
452
- s(), c.code === 11915 && (B(!1), W(!1), u.isLoading = !1, u.content = "请您换个问题问我吧~", u.isSensitive = !0, L([u, ...y.current])), c.index === -2 && (B(!1), W(!1), u.isLoading = !1, u.content = "回答已中止~", u.isSuspend = !0, L([u, ...y.current])), c.index === -1 && (B(!1), W(!1), u.isLoading = !1, u.reference = c.reference, L([u, ...y.current]), i.id && ye && ye({
453
+ s(), d.code === 11915 && (V(!1), q(!1), u.isLoading = !1, u.content = "请您换个问题问我吧~", u.isSensitive = !0, L([u, ...y.current])), d.index === -2 && (V(!1), q(!1), u.isLoading = !1, u.content = "回答已中止~", u.isSuspend = !0, L([u, ...y.current])), d.index === -1 && (V(!1), q(!1), u.isLoading = !1, u.reference = d.reference, L([u, ...y.current]), i.id && ye && ye({
453
454
  applicationId: i.id,
454
455
  sessionId: t,
455
456
  message: u
456
- })), c.index === -3 && (B(!1), W(!1), u.isLoading = !1, u.reference = c.reference, u.relatedQuesion = c.relatedQuesion, L([u, ...y.current]));
457
+ })), d.index === -3 && (V(!1), q(!1), u.isLoading = !1, u.reference = d.reference, u.relatedQuesion = d.relatedQuesion, L([u, ...y.current]));
457
458
  }, l = () => {
458
- e.addEventListener("message:updated", d);
459
+ e.addEventListener("message:updated", c);
459
460
  };
460
- return e.ready ? e.addEventListener("message:updated", d) : e.addEventListener("ready", l), () => {
461
- s(), e == null || e.removeEventListener("message:updated", d), e == null || e.removeEventListener("ready", l);
461
+ return e.ready ? e.addEventListener("message:updated", c) : e.addEventListener("ready", l), () => {
462
+ s(), e == null || e.removeEventListener("message:updated", c), e == null || e.removeEventListener("ready", l);
462
463
  };
463
- }, [e]), E(() => {
464
+ }, [e]), N(() => {
464
465
  if (!e) {
465
- De(!1);
466
+ Te(!1);
466
467
  return;
467
468
  }
468
469
  const t = (n) => {
469
- De(n);
470
+ Te(n);
470
471
  };
471
- return De(e.frozen), e.addEventListener("frozen", t), () => {
472
+ return Te(e.frozen), e.addEventListener("frozen", t), () => {
472
473
  e == null || e.removeEventListener("frozen", t);
473
474
  };
474
- }, [e]), E(() => {
475
+ }, [e]), N(() => {
475
476
  if (!P)
476
477
  return;
477
478
  const t = P.questionContextMaxLength || 4e3;
478
- nn(t);
479
- }, [P, A]), E(() => {
479
+ tn(t);
480
+ }, [P, M]), N(() => {
480
481
  Pe && te(Pe.text);
481
- }, [Pe]), E(() => {
482
- $t.config({
483
- getContainer: () => (z == null ? void 0 : z.current) || document.body,
484
- prefixCls: "gbot-message",
485
- maxCount: 5
486
- });
487
- }, [z]);
488
- const T = (t, n, o) => {
489
- $t.open({
490
- type: t,
491
- content: n,
492
- key: o
482
+ }, [Pe]);
483
+ const D = (t, n, o) => {
484
+ si(Y, () => {
485
+ Zn.open({
486
+ type: t,
487
+ content: n,
488
+ key: o
489
+ });
493
490
  });
494
491
  }, ft = (t) => {
495
492
  const n = t.size;
496
- return n <= 0 ? (T("error", "该文件为空,请重新上传"), !1) : n > Ve * ti ? (T("error", `图片须小于${Ve}M`), !1) : (ve((o) => o.length >= Z ? (T("warning", `图片最多上传${Z}张`), o) : [...o, t]), !1);
493
+ return n <= 0 ? (D("error", "该文件为空,请重新上传"), !1) : n > Ve * ti ? (D("error", `图片须小于${Ve}M`), !1) : (ve((o) => o.length >= Z ? (D("warning", `图片最多上传${Z}张`), o) : [...o, t]), !1);
497
494
  }, En = () => {
498
495
  var t;
499
- return (i.type === S.Agent && (f == null ? void 0 : f.imageUpload) || i.type === S.Dialog && ((t = i.arrange) == null ? void 0 : t.length) && !!i.arrange[0].visionOpen && (f == null ? void 0 : f.imageUpload)) && !R;
500
- }, Ln = () => !!V && (f == null ? void 0 : f.fileUpload) && (i == null ? void 0 : i.id) && !R, gt = (t) => {
501
- var N, x;
496
+ return (i.type === S.Agent && (f == null ? void 0 : f.imageUpload) || i.type === S.Dialog && ((t = i.arrange) == null ? void 0 : t.length) && !!i.arrange[0].visionOpen && (f == null ? void 0 : f.imageUpload)) && !F;
497
+ }, Nn = () => !!z && (f == null ? void 0 : f.fileUpload) && (i == null ? void 0 : i.id) && !F, gt = (t) => {
498
+ var E, C;
502
499
  const n = Array.from(t || []).filter(Boolean);
503
500
  if (!n.length)
504
501
  return;
505
- const o = En(), r = Ln(), s = [], d = [];
506
- let l = 0, v = 0, c = 0;
502
+ const o = En(), r = Nn(), s = [], c = [];
503
+ let l = 0, v = 0, d = 0;
507
504
  n.forEach((m) => {
508
- var Ht, At, Mt;
509
- if (((Ht = m.type) == null ? void 0 : Ht.startsWith("image/")) || !!_t(m.name)) {
505
+ var At, Mt, Ht;
506
+ if (((At = m.type) == null ? void 0 : At.startsWith("image/")) || !!Bt(m.name)) {
510
507
  o ? s.push(m) : l++;
511
508
  return;
512
509
  }
513
- const oe = (Mt = (At = m.name) == null ? void 0 : At.split(".").pop()) == null ? void 0 : Mt.toLowerCase();
510
+ const oe = (Ht = (Mt = m.name) == null ? void 0 : Mt.split(".").pop()) == null ? void 0 : Ht.toLowerCase();
514
511
  if (oi.includes(m.type) || ["pdf", "doc", "docx"].includes(oe || "")) {
515
- r ? d.push(m) : v++;
512
+ r ? c.push(m) : v++;
516
513
  return;
517
514
  }
518
- c++;
515
+ d++;
519
516
  });
520
- const I = [], u = l + v + c;
517
+ const k = [], u = l + v + d;
521
518
  if (!r && !o)
522
- u && I.push(`当前不支持上传文件/图片,已忽略${u}个文件`);
519
+ u && k.push(`当前不支持上传文件/图片,已忽略${u}个文件`);
523
520
  else if (r && !o) {
524
- const m = l + c;
525
- m && I.push(`仅支持上传 .doc/.docx/.pdf 文件,已忽略${m}个其他类型文件`);
521
+ const m = l + d;
522
+ m && k.push(`仅支持上传 .doc/.docx/.pdf 文件,已忽略${m}个其他类型文件`);
526
523
  } else if (!r && o) {
527
- const m = v + c;
528
- m && I.push(`仅支持上传图片(.jpg/.jpeg/.png/.bmp),已忽略${m}个其他类型文件`);
524
+ const m = v + d;
525
+ m && k.push(`仅支持上传图片(.jpg/.jpeg/.png/.bmp),已忽略${m}个其他类型文件`);
529
526
  } else
530
- c && I.push(`存在不支持的文件类型,已忽略${c}个文件`);
531
- if (I.length && T("warning", I.join(";"), "precheck-warn"), s.length) {
532
- const m = Math.max(0, Z - ce.length), _ = s.slice(0, m);
533
- _.forEach((oe) => ft(oe)), s.length > _.length && T("warning", `最多上传${Z}张图片`);
527
+ d && k.push(`存在不支持的文件类型,已忽略${d}个文件`);
528
+ if (k.length && D("warning", k.join(";"), "precheck-warn"), s.length) {
529
+ const m = Math.max(0, Z - ce.length), B = s.slice(0, m);
530
+ B.forEach((oe) => ft(oe)), s.length > B.length && D("warning", `最多上传${Z}张图片`);
534
531
  }
535
- d.length && ((x = (N = fe.current) == null ? void 0 : N.appendFiles) == null || x.call(N, d));
532
+ c.length && ((C = (E = fe.current) == null ? void 0 : E.appendFiles) == null || C.call(E, c));
536
533
  }, ut = (t) => {
537
534
  var o;
538
535
  const n = (o = t.clipboardData) == null ? void 0 : o.files;
@@ -547,41 +544,41 @@ ${e}` : e;
547
544
  }, mt = () => $(void 0, null, function* () {
548
545
  var t;
549
546
  return (t = e == null ? void 0 : e.data) != null && t.id ? e : (ie.current || (ie.current = new Promise((n, o) => {
550
- Q(!0), C == null || C({
551
- netOpen: D ? le.OPEN : le.CLOSE
547
+ Q(!0), I == null || I({
548
+ netOpen: T ? le.OPEN : le.CLOSE
552
549
  }).then((r) => {
553
- var s, d;
554
- b == null || b(r), Q(!1), O(!!((s = r.data) != null && s.netOpen)), pe(!!((d = r.data) != null && d.enableNetOpen)), Ue(r), n(r);
550
+ var s, c;
551
+ x == null || x(r), Q(!1), R(!!((s = r.data) != null && s.netOpen)), pe(!!((c = r.data) != null && c.enableNetOpen)), Ue(r), n(r);
555
552
  }).catch((r) => {
556
553
  ie.current = null, o(r);
557
554
  });
558
555
  })), ie.current);
559
- }), Pn = (t) => $(void 0, null, function* () {
556
+ }), Ln = (t) => $(void 0, null, function* () {
560
557
  const n = yield mt();
561
- return Tn(n, t);
562
- }), Tn = (t, n) => {
563
- const o = _t(n.name);
558
+ return Pn(n, t);
559
+ }), Pn = (t, n) => {
560
+ const o = Bt(n.name);
564
561
  return new Promise((r) => {
565
- var d;
562
+ var c;
566
563
  const s = {
567
564
  files: [`${_e()}.${o}`],
568
565
  isv: "minio",
569
- knowledgeId: ((d = t.data) == null ? void 0 : d.id) || "",
566
+ knowledgeId: ((c = t.data) == null ? void 0 : c.id) || "",
570
567
  type: 1
571
568
  };
572
- A == null || A.postTicket(s).then((l) => {
573
- A.uploadMinioFile(l.minio, n).then(() => {
574
- var u, N;
575
- const v = (u = l.minio.endpoints) == null ? void 0 : u[0], c = l.minio.bucket, I = (N = l.minio.fileKeys) == null ? void 0 : N[0];
576
- r(`${l.minio.useSSL ? "https:" : location.protocol}//${v}/${c}/${I}`);
569
+ M == null || M.postTicket(s).then((l) => {
570
+ M.uploadMinioFile(l.minio, n).then(() => {
571
+ var u, E;
572
+ const v = (u = l.minio.endpoints) == null ? void 0 : u[0], d = l.minio.bucket, k = (E = l.minio.fileKeys) == null ? void 0 : E[0];
573
+ r(`${l.minio.useSSL ? "https:" : location.protocol}//${v}/${d}/${k}`);
577
574
  }).catch(() => {
578
575
  });
579
576
  }).catch(() => {
580
577
  });
581
578
  });
582
579
  };
583
- E(() => {
584
- const t = H.current;
580
+ N(() => {
581
+ const t = O.current;
585
582
  t && !it && t.scrollTo({
586
583
  top: t.scrollHeight
587
584
  });
@@ -592,15 +589,15 @@ ${e}` : e;
592
589
  const r = $e(je({}, n.file), {
593
590
  type: 1
594
591
  });
595
- A == null || A.postApplicationIdSessionKnowledgeSessionFile(i == null ? void 0 : i.id, t, r).finally(() => {
592
+ M == null || M.postApplicationIdSessionKnowledgeSessionFile(i == null ? void 0 : i.id, t, r).finally(() => {
596
593
  var s;
597
594
  (s = fe.current) == null || s.update().finally(o);
598
595
  });
599
596
  }), Dn = () => {
600
597
  var t;
601
- (t = e == null ? void 0 : e.data) != null && t.id && (B(!1), e.suspend());
602
- }, On = (t) => {
603
- const n = H.current;
598
+ (t = e == null ? void 0 : e.data) != null && t.id && (V(!1), e.suspend());
599
+ }, Tn = (t) => {
600
+ const n = O.current;
604
601
  n && setTimeout(() => {
605
602
  n.scrollTo({
606
603
  top: n.scrollHeight,
@@ -608,26 +605,26 @@ ${e}` : e;
608
605
  });
609
606
  }, t == null ? void 0 : t.ms);
610
607
  }, Rn = () => {
611
- if (!H.current)
608
+ if (!O.current)
612
609
  return;
613
- const t = H.current.scrollTop <= -80;
614
- mn(t);
615
- }, Fn = ze((t) => {
610
+ const t = O.current.scrollTop <= -80;
611
+ hn(t);
612
+ }, On = ze((t) => {
616
613
  var n, o;
617
614
  (n = ke.current) == null || n.update(t), (o = ke.current) == null || o.focus();
618
- }), Un = ze((t) => {
615
+ }), Fn = ze((t) => {
619
616
  dt(t);
620
- }), Hn = ze(() => {
617
+ }), Un = ze(() => {
621
618
  var n;
622
619
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
623
620
  return;
624
621
  y.current = [...w.slice(1, w.length)], L(y.current);
625
622
  const t = new he("", e.data.id, ae.System);
626
- t.isWaiting = !0, y.current = [t, ...y.current], L(y.current), W(!0), B(!0), e.answerAgain();
623
+ t.isWaiting = !0, y.current = [t, ...y.current], L(y.current), q(!0), V(!0), e.answerAgain();
627
624
  });
628
- E(() => {
625
+ N(() => {
629
626
  var t, n;
630
- Ye.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !ot && ((n = Oe.current) == null || n.clear());
627
+ Se.current = (t = e == null ? void 0 : e.data) == null ? void 0 : t.id, !ot && ((n = Re.current) == null || n.clear());
631
628
  }, [e]);
632
629
  const An = () => {
633
630
  var o;
@@ -636,7 +633,7 @@ ${e}` : e;
636
633
  const n = w[w.length - 1].messageTime;
637
634
  e.fetchMessages({
638
635
  endTime: n,
639
- pageSize: Wt
636
+ pageSize: qt
640
637
  }).then((r) => {
641
638
  const s = r || [];
642
639
  if (!s || !(s != null && s.length)) {
@@ -648,68 +645,82 @@ ${e}` : e;
648
645
  }, Mn = (t) => $(void 0, null, function* () {
649
646
  var n, o;
650
647
  if (!((n = e == null ? void 0 : e.data) != null && n.id))
651
- O(t);
648
+ R(t);
652
649
  else {
653
650
  if (yield e.setNetOpen(t), !((o = e.data) != null && o.id))
654
651
  return;
655
- O(t);
652
+ R(t);
656
653
  }
657
- }), Ae = () => $(void 0, null, function* () {
654
+ }), Me = () => $(void 0, null, function* () {
658
655
  e ? e.fetchData().then((t) => {
659
656
  var n;
660
- (n = e == null ? void 0 : e.data) != null && n.id && (O(t.netOpen), pe(t.enableNetOpen));
661
- }) : (O(typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.default) == "boolean" ? a.connectNetwork.default : !1), pe(i.arrange[0].enableNetOpen));
657
+ (n = e == null ? void 0 : e.data) != null && n.id && (R(t.netOpen), pe(t.enableNetOpen));
658
+ }) : (R(typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.default) == "boolean" ? a.connectNetwork.default : !1), pe(i.arrange[0].enableNetOpen));
662
659
  });
663
- E(() => {
664
- Ae();
665
- }, [e]), E(() => {
666
- requestAnimationFrame(() => {
667
- var n, o;
668
- if (H.current) {
669
- const r = document.getElementById("chat-main"), s = (n = H.current) == null ? void 0 : n.querySelector(".infinite-scroll-component__outerdiv"), d = (o = H.current) == null ? void 0 : o.querySelector(".infinite-scroll-component");
670
- if (!s || !d || !r)
660
+ N(() => {
661
+ Me();
662
+ }, [e]), N(() => {
663
+ let t = null, n = null;
664
+ const o = () => {
665
+ var k, u;
666
+ if (!O.current)
667
+ return;
668
+ const s = document.getElementById("chat-main"), c = (k = O.current) == null ? void 0 : k.querySelector(".infinite-scroll-component__outerdiv"), l = (u = O.current) == null ? void 0 : u.querySelector(".infinite-scroll-component");
669
+ if (!c || !l || !s)
670
+ return;
671
+ const v = s.offsetHeight;
672
+ if (l.offsetHeight <= v) {
673
+ if (c.style.height === "100%")
671
674
  return;
672
- const l = r.offsetHeight;
673
- if (d.offsetHeight <= l) {
674
- if (s.style.height === "100%")
675
- return;
676
- s.style.height = "100%";
677
- } else {
678
- if (s.style.height === "auto")
679
- return;
680
- s.style.height = "auto";
681
- }
675
+ c.style.height = "100%";
676
+ } else {
677
+ if (c.style.height === "auto")
678
+ return;
679
+ c.style.height = "auto";
682
680
  }
683
- });
684
- }, [w]), E(() => {
681
+ }, r = () => {
682
+ var l;
683
+ if (typeof ResizeObserver == "undefined" || !O.current)
684
+ return;
685
+ const s = document.getElementById("chat-main"), c = (l = O.current) == null ? void 0 : l.querySelector(".infinite-scroll-component");
686
+ !c || !s || (n = new ResizeObserver(() => {
687
+ o();
688
+ }), n.observe(c), n.observe(s));
689
+ };
690
+ return t = requestAnimationFrame(() => {
691
+ o(), r();
692
+ }), () => {
693
+ t !== null && cancelAnimationFrame(t), n == null || n.disconnect();
694
+ };
695
+ }, [w]), N(() => {
685
696
  if (e)
686
697
  return;
687
698
  const t = () => {
688
- const r = ((P == null ? void 0 : P.promptVariables) || []).filter((s) => s.type ? !(s.type === Ee.User && s.key === "query") && !(s.type === Ee.System && s.key === "datetime") && s.status === 1 : s.key !== "query" && s.status === 1).map((s, d) => {
689
- var v, c;
699
+ const r = ((P == null ? void 0 : P.promptVariables) || []).filter((s) => s.type ? !(s.type === Ne.User && s.key === "query") && !(s.type === Ne.System && s.key === "datetime") && s.status === 1 : s.key !== "query" && s.status === 1).map((s, c) => {
700
+ var v, d;
690
701
  let l = "";
691
- return typeof (a == null ? void 0 : a.promptVariables) == "object" && (l = ((c = (v = a.promptVariables.default) == null ? void 0 : v.find((I) => I.key === s.key && I.type === s.type)) == null ? void 0 : c.value) || ""), {
692
- id: d + "",
702
+ return typeof (a == null ? void 0 : a.promptVariables) == "object" && (l = ((d = (v = a.promptVariables.default) == null ? void 0 : v.find((k) => k.key === s.key && k.type === s.type)) == null ? void 0 : d.value) || ""), {
703
+ id: c + "",
693
704
  key: s.key,
694
705
  name: s.name,
695
706
  value: l,
696
707
  type: s.type
697
708
  };
698
709
  });
699
- ge([...r].sort((s, d) => s.key.localeCompare(d.key)));
710
+ ge([...r].sort((s, c) => s.key.localeCompare(c.key)));
700
711
  };
701
712
  return P != null && P.ready ? t() : P == null || P.addEventListener("ready", t), () => {
702
713
  P == null || P.removeEventListener("ready", t);
703
714
  };
704
715
  }, [e, P, a == null ? void 0 : a.promptVariables]);
705
- const vt = () => C == null ? void 0 : C({
706
- netOpen: D ? le.OPEN : le.CLOSE
716
+ const vt = () => I == null ? void 0 : I({
717
+ netOpen: T ? le.OPEN : le.CLOSE
707
718
  }).then((t) => {
708
719
  var n, o;
709
- return b == null || b(t), Q(!1), O(!!((n = t.data) != null && n.netOpen)), pe(!!((o = t.data) != null && o.enableNetOpen)), Ue(t), t;
710
- }), wt = !!w.length, kt = Yn(() => {
720
+ return x == null || x(t), Q(!1), R(!!((n = t.data) != null && n.netOpen)), pe(!!((o = t.data) != null && o.enableNetOpen)), Ue(t), t;
721
+ }), wt = !!w.length, kt = Kn(() => {
711
722
  var t;
712
- return i.arrange && ((t = i.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ g(Kt, {
723
+ return i.arrange && ((t = i.arrange[0]) != null && t.openingContent) ? /* @__PURE__ */ g(Wt, {
713
724
  application: i,
714
725
  history: {
715
726
  role: 1,
@@ -719,7 +730,7 @@ ${e}` : e;
719
730
  sessionId: "",
720
731
  reference: [],
721
732
  searchReference: [],
722
- messageTime: Yt(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
733
+ messageTime: Kt(Date.now()).format("YYYY-MM-DD HH:mm:ss"),
723
734
  actions: [],
724
735
  isLoading: !1
725
736
  },
@@ -732,29 +743,29 @@ ${e}` : e;
732
743
  var t;
733
744
  return (t = ke.current) == null ? void 0 : t.getCurrentText();
734
745
  }
735
- })), E(() => {
746
+ })), N(() => {
736
747
  var n;
737
748
  const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
738
749
  t && de((o) => $e(je({}, o), {
739
750
  [t]: []
740
751
  }));
741
- }, [(bt = e == null ? void 0 : e.data) == null ? void 0 : bt.id]), /* @__PURE__ */ F("div", {
752
+ }, [(bt = e == null ? void 0 : e.data) == null ? void 0 : bt.id]), /* @__PURE__ */ U("div", {
742
753
  className: "agent-chat",
743
- children: [kn ? /* @__PURE__ */ g("div", {
754
+ children: [wn ? /* @__PURE__ */ g("div", {
744
755
  className: "session-loading",
745
- children: /* @__PURE__ */ g(zt, {})
746
- }) : /* @__PURE__ */ F(_n, {
747
- children: [(f == null ? void 0 : f.promptVariables) && /* @__PURE__ */ g(gi, {
756
+ children: /* @__PURE__ */ g($t, {})
757
+ }) : /* @__PURE__ */ U(Bn, {
758
+ children: [(f == null ? void 0 : f.promptVariables) && /* @__PURE__ */ g(ui, {
748
759
  ref: et,
749
760
  appId: i.id,
750
761
  currentSession: e,
751
- promptVariables: M,
762
+ promptVariables: H,
752
763
  setPromptVariables: ge,
753
- setCurrentSession: b
754
- }), /* @__PURE__ */ F("div", {
764
+ setCurrentSession: x
765
+ }), /* @__PURE__ */ U("div", {
755
766
  className: "chat-main",
756
767
  id: "chat-main",
757
- style: Gt,
768
+ style: Xt,
758
769
  children: [/* @__PURE__ */ g("div", {
759
770
  className: "chat-main-wrapper",
760
771
  id: "scrollableDiv",
@@ -764,9 +775,9 @@ ${e}` : e;
764
775
  display: "flex",
765
776
  flexDirection: "column-reverse"
766
777
  },
767
- ref: H,
778
+ ref: O,
768
779
  onScroll: Rn,
769
- children: (xt = e == null ? void 0 : e.data) != null && xt.id && (w != null && w.length) ? /* @__PURE__ */ F(hi, {
780
+ children: (xt = e == null ? void 0 : e.data) != null && xt.id && (w != null && w.length) ? /* @__PURE__ */ U(mi, {
770
781
  dataLength: w.length,
771
782
  next: An,
772
783
  style: {
@@ -775,8 +786,8 @@ ${e}` : e;
775
786
  overflowX: "hidden"
776
787
  },
777
788
  inverse: !0,
778
- endMessage: w.length > Wt && // 少于一页不展示这个提示
779
- ((Ct = H.current) != null && Ct.scrollTop) && ((It = H.current) == null ? void 0 : It.scrollTop) < -10 ? /* @__PURE__ */ g(Qn, {
789
+ endMessage: w.length > qt && // 少于一页不展示这个提示
790
+ ((Ct = O.current) != null && Ct.scrollTop) && ((It = O.current) == null ? void 0 : It.scrollTop) < -10 ? /* @__PURE__ */ g(Yn, {
780
791
  plain: !0,
781
792
  children: "没有更多数据了"
782
793
  }) : null,
@@ -787,36 +798,36 @@ ${e}` : e;
787
798
  textAlign: "center",
788
799
  overflow: "hidden"
789
800
  },
790
- children: /* @__PURE__ */ g(zt, {})
801
+ children: /* @__PURE__ */ g($t, {})
791
802
  }),
792
803
  scrollableTarget: "scrollableDiv",
793
- children: [w.map((t, n) => /* @__PURE__ */ g(ki, {
804
+ children: [w.map((t, n) => /* @__PURE__ */ g(bi, {
794
805
  application: i,
795
806
  currentSession: e,
796
807
  history: t,
797
- docViewerUrl: U,
808
+ docViewerUrl: A,
798
809
  isLastHistory: n === 0,
799
- onRelatedClick: Un,
800
- onAgainClick: Hn,
801
- onEditClick: Fn,
810
+ onRelatedClick: Fn,
811
+ onAgainClick: Un,
812
+ onEditClick: On,
802
813
  markdown: a == null ? void 0 : a.markdown
803
814
  }, t.messageId + n)), !st && kt]
804
- }) : /* @__PURE__ */ F("div", {
815
+ }) : /* @__PURE__ */ U("div", {
805
816
  className: "main-empty",
806
- children: [(a == null ? void 0 : a.greeting) !== !1 && /* @__PURE__ */ g(ai, {
817
+ children: [(a == null ? void 0 : a.greeting) !== !1 && /* @__PURE__ */ g(li, {
807
818
  text: (
808
819
  // 第一优先级:features配置
809
820
  a != null && a.greeting && typeof a.greeting == "object" && a.greeting.text !== void 0 ? a.greeting.text : (
810
821
  // 第二优先级:application.arrange[0].greetings
811
- (Nt = i.arrange) != null && Nt.length && ((Et = i.arrange[0]) != null && Et.greetings) ? i.arrange[0].greetings : (
822
+ (Et = i.arrange) != null && Et.length && ((Nt = i.arrange[0]) != null && Nt.greetings) ? i.arrange[0].greetings : (
812
823
  // 第三优先级:默认文本
813
- qt.text
824
+ _t.text
814
825
  )
815
826
  )
816
827
  ),
817
- icon: a === void 0 || a.greeting === !0 || ((Lt = a.greeting) == null ? void 0 : Lt.icon) === void 0 ? Zt || qt.icon : a.greeting.icon,
818
- children: !!Ge.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__ */ g(ri, {
819
- ref: Oe,
828
+ icon: a === void 0 || a.greeting === !0 || ((Lt = a.greeting) == null ? void 0 : Lt.icon) === void 0 ? Gt || _t.icon : a.greeting.icon,
829
+ children: !!Ge.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__ */ g(ai, {
830
+ ref: Re,
820
831
  sid: (Pt = e == null ? void 0 : e.data) == null ? void 0 : Pt.id,
821
832
  isRecommendClearing: Ze,
822
833
  data: Ge,
@@ -828,12 +839,12 @@ ${e}` : e;
828
839
  t != null && t.id && ee(!0);
829
840
  const n = (o = e == null ? void 0 : e.data) == null ? void 0 : o.id;
830
841
  f != null && f.fileUpload ? (s = (r = fe.current) == null ? void 0 : r.clear()) == null || s.then(() => {
831
- var d, l;
832
- t != null && t.id && (n ? (d = yt(n, t)) == null || d.finally(() => {
842
+ var c, l;
843
+ t != null && t.id && (n ? (c = yt(n, t)) == null || c.finally(() => {
833
844
  ee(!1);
834
845
  }) : (ee(!1), Q(!0), (l = vt()) == null || l.then((v) => {
835
- var c;
836
- (c = yt(v.id, t)) == null || c.finally(() => {
846
+ var d;
847
+ (d = yt(v.id, t)) == null || d.finally(() => {
837
848
  ee(!1);
838
849
  });
839
850
  })));
@@ -864,7 +875,7 @@ ${e}` : e;
864
875
  className: "back-bottom",
865
876
  children: /* @__PURE__ */ g(G, {
866
877
  size: "small",
867
- onClick: () => On({
878
+ onClick: () => Tn({
868
879
  behavior: "smooth"
869
880
  }),
870
881
  type: "link",
@@ -878,7 +889,7 @@ ${e}` : e;
878
889
  })]
879
890
  }), /* @__PURE__ */ g("div", {
880
891
  className: "chat-footer",
881
- children: /* @__PURE__ */ F("div", {
892
+ children: /* @__PURE__ */ U("div", {
882
893
  className: "chat-footer-input",
883
894
  children: [ce.length > 0 && /* @__PURE__ */ g("div", {
884
895
  className: "input-files",
@@ -889,7 +900,7 @@ ${e}` : e;
889
900
  upload: (o) => $(void 0, null, function* () {
890
901
  Qe((r) => r + 1);
891
902
  try {
892
- return yield Pn(o);
903
+ return yield Ln(o);
893
904
  } finally {
894
905
  Qe((r) => Math.max(0, r - 1));
895
906
  }
@@ -905,21 +916,21 @@ ${e}` : e;
905
916
  });
906
917
  }
907
918
  }, n))
908
- }), /* @__PURE__ */ F("div", {
919
+ }), /* @__PURE__ */ U("div", {
909
920
  className: "footer-upload-action-wrapper",
910
- children: [/* @__PURE__ */ F(Ne, {
921
+ children: [/* @__PURE__ */ U(Ee, {
911
922
  className: "footer-upload-action",
912
923
  onClick: (t) => t.preventDefault(),
913
- children: [/* @__PURE__ */ F(Ne, {
914
- children: [(i.type === S.Agent && (f == null ? void 0 : f.imageUpload) || i.type === S.Dialog && ((Tt = i.arrange) == null ? void 0 : Tt.length) && !!i.arrange[0].visionOpen && (f == null ? void 0 : f.imageUpload)) && /* @__PURE__ */ g(Xn, {
924
+ children: [/* @__PURE__ */ U(Ee, {
925
+ children: [(i.type === S.Agent && (f == null ? void 0 : f.imageUpload) || i.type === S.Dialog && ((Dt = i.arrange) == null ? void 0 : Dt.length) && !!i.arrange[0].visionOpen && (f == null ? void 0 : f.imageUpload)) && /* @__PURE__ */ g(Qn, {
915
926
  multiple: !0,
916
- disabled: ce.length >= Z || R,
927
+ disabled: ce.length >= Z || F,
917
928
  accept: ".jpg, .png, .jpeg,.bmp",
918
929
  listType: "picture-card",
919
930
  beforeUpload: ft,
920
931
  className: "footer-upload-picture",
921
932
  showUploadList: !1,
922
- children: ce.length < Z ? /* @__PURE__ */ g(Gn, {
933
+ children: ce.length < Z ? /* @__PURE__ */ g(Xn, {
923
934
  placement: "topLeft",
924
935
  overlayClassName: "footer-upload-tooltip",
925
936
  title: /* @__PURE__ */ g("div", {
@@ -959,20 +970,20 @@ ${e}` : e;
959
970
  }
960
971
  })
961
972
  })
962
- }), V && (f != null && f.fileUpload) && (i != null && i.id) ? /* @__PURE__ */ g(di, {
973
+ }), z && (f != null && f.fileUpload) && (i != null && i.id) ? /* @__PURE__ */ g(fi, {
963
974
  appId: i == null ? void 0 : i.id,
964
975
  ref: fe,
965
976
  isFirstSession: ot,
966
- docViewerUrl: U,
977
+ docViewerUrl: A,
967
978
  onStatusChange: (t) => $(void 0, null, function* () {
968
- t !== "process" ? (be(!0), Ae()) : be(!1);
979
+ t !== "process" ? (be(!0), Me()) : be(!1);
969
980
  }),
970
981
  createSession: () => mt().then((t) => {
971
982
  var o;
972
983
  return ((o = t.data) == null ? void 0 : o.id) || "";
973
984
  }),
974
- sid: (Dt = e == null ? void 0 : e.data) == null ? void 0 : Dt.id,
975
- disabled: Re || R,
985
+ sid: (Tt = e == null ? void 0 : e.data) == null ? void 0 : Tt.id,
986
+ disabled: Oe || F,
976
987
  afterFileAdd: (t, n) => {
977
988
  n && de((o) => {
978
989
  const r = o[n] || [];
@@ -987,48 +998,48 @@ ${e}` : e;
987
998
  n && de((r) => {
988
999
  const s = r[n] || [];
989
1000
  return {
990
- [n]: s.filter((d) => d.id !== t)
1001
+ [n]: s.filter((c) => c.id !== t)
991
1002
  };
992
1003
  });
993
1004
  },
994
1005
  onFileListChange: (t) => {
995
- gn(t);
1006
+ fn(t);
996
1007
  },
997
- shouldContinue: pn,
1008
+ shouldContinue: un,
998
1009
  afterFilesClear: () => {
999
1010
  var n;
1000
1011
  const t = (n = e == null ? void 0 : e.data) == null ? void 0 : n.id;
1001
1012
  t && (de({
1002
1013
  [t]: []
1003
- }), Ae());
1014
+ }), Me());
1004
1015
  }
1005
- }) : null, (f == null ? void 0 : f.prompt) && (i == null ? void 0 : i.id) && /* @__PURE__ */ g(yi, {
1016
+ }) : null, (f == null ? void 0 : f.prompt) && (i == null ? void 0 : i.id) && /* @__PURE__ */ g(vi, {
1006
1017
  appId: i.id,
1007
1018
  list: [],
1008
- search: Je ? an : "",
1019
+ search: Je ? rn : "",
1009
1020
  onPromptSelect: (t) => {
1010
1021
  te(t.context), me(t.context);
1011
1022
  },
1012
- disabled: R
1023
+ disabled: F
1013
1024
  })]
1014
- }), /* @__PURE__ */ F(Ne, {
1015
- children: [(f == null ? void 0 : f.connectNetwork) && i.type === S.Dialog && ((Ot = i.arrange) == null ? void 0 : Ot.length) && !!i.arrange[0].enableNetOpen && /* @__PURE__ */ g(mi, {
1016
- sessionId: (Rt = e == null ? void 0 : e.data) == null ? void 0 : Rt.id,
1017
- netStatus: D,
1018
- enable: typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.diabled) == "boolean" ? !(a != null && a.connectNetwork.diabled) : wn,
1025
+ }), /* @__PURE__ */ U(Ee, {
1026
+ children: [(f == null ? void 0 : f.connectNetwork) && i.type === S.Dialog && ((Rt = i.arrange) == null ? void 0 : Rt.length) && !!i.arrange[0].enableNetOpen && /* @__PURE__ */ g(yi, {
1027
+ sessionId: (Ot = e == null ? void 0 : e.data) == null ? void 0 : Ot.id,
1028
+ netStatus: T,
1029
+ enable: typeof (a == null ? void 0 : a.connectNetwork) == "object" && typeof (a == null ? void 0 : a.connectNetwork.diabled) == "boolean" ? !(a != null && a.connectNetwork.diabled) : vn,
1019
1030
  disabledTip: e ? void 0 : "网络访问已被禁用",
1020
1031
  onNetStatusChange: (t) => {
1021
1032
  Mn(t);
1022
1033
  }
1023
- }), (f == null ? void 0 : f.sessionList) && /* @__PURE__ */ g(ui, {
1034
+ }), (f == null ? void 0 : f.sessionList) && /* @__PURE__ */ g(pi, {
1024
1035
  currentSessionId: (Ft = e == null ? void 0 : e.data) == null ? void 0 : Ft.id,
1025
1036
  onSessionChange: (t, n) => {
1026
- te(void 0), Ie(!0), b == null || b(n);
1037
+ te(void 0), Ie(!0), x == null || x(n);
1027
1038
  },
1028
- disabled: R
1029
- }), Jt && en === "float" && /* @__PURE__ */ g("div", {
1039
+ disabled: F
1040
+ }), Zt && Jt === "float" && /* @__PURE__ */ g("div", {
1030
1041
  className: "session-history-drawer-component",
1031
- children: /* @__PURE__ */ g(Zn, {
1042
+ children: /* @__PURE__ */ g(Gn, {
1032
1043
  placement: "topRight",
1033
1044
  showArrow: !1,
1034
1045
  overlayClassName: "session-history-overlay",
@@ -1039,7 +1050,7 @@ ${e}` : e;
1039
1050
  content: "会话历史记录",
1040
1051
  children: /* @__PURE__ */ g(G, {
1041
1052
  className: "history-overlay-action",
1042
- disabled: R,
1053
+ disabled: F,
1043
1054
  type: "text",
1044
1055
  icon: /* @__PURE__ */ g(re, {
1045
1056
  type: "icon-lishijilu",
@@ -1051,13 +1062,13 @@ ${e}` : e;
1051
1062
  })
1052
1063
  })
1053
1064
  }), (f == null ? void 0 : f.sessionOpen) && /* @__PURE__ */ g(G, {
1054
- icon: /* @__PURE__ */ g(ci, {}),
1065
+ icon: /* @__PURE__ */ g(di, {}),
1055
1066
  className: "add-btn",
1056
1067
  type: "primary",
1057
- disabled: nt || !e || !w.length || R,
1068
+ disabled: nt || !e || !w.length || F,
1058
1069
  onClick: () => {
1059
1070
  var t, n;
1060
- Ie(!1), b == null || b(null), ie.current = null, O(!1), (t = et.current) == null || t.clear(), (n = Oe.current) == null || n.clear();
1071
+ Ie(!1), x == null || x(null), ie.current = null, R(!1), (t = et.current) == null || t.clear(), (n = Re.current) == null || n.clear();
1061
1072
  },
1062
1073
  children: "新会话"
1063
1074
  })]
@@ -1065,7 +1076,7 @@ ${e}` : e;
1065
1076
  }), !!Fe && /* @__PURE__ */ g("div", {
1066
1077
  className: "remainingSeconds-mark"
1067
1078
  })]
1068
- }), /* @__PURE__ */ F("div", {
1079
+ }), /* @__PURE__ */ U("div", {
1069
1080
  className: "footer-textarea",
1070
1081
  onPaste: ut,
1071
1082
  onPasteCapture: ut,
@@ -1073,24 +1084,24 @@ ${e}` : e;
1073
1084
  onDropCapture: ht,
1074
1085
  onDragOver: pt,
1075
1086
  onDragOverCapture: pt,
1076
- children: [/* @__PURE__ */ g(si, {
1087
+ children: [/* @__PURE__ */ g(ri, {
1077
1088
  ref: ke,
1078
- maxLength: tn,
1079
- text: cn,
1089
+ maxLength: en,
1090
+ text: ln,
1080
1091
  networkStatus: !1,
1081
1092
  loading: rt || Ce,
1082
- disabled: Ke || Xe || R || rt || Ce,
1093
+ disabled: Ke || Xe || F || rt || Ce,
1083
1094
  onTextSend: dt,
1084
1095
  onChange: (t, n) => {
1085
1096
  te(t);
1086
1097
  const o = n.getText().replace(/[\n\s]+$/, "");
1087
- me(o), ln(o), Je || rn(!0);
1098
+ me(o), an(o), Je || sn(!0);
1088
1099
  },
1089
- clearAction: /* @__PURE__ */ g(Ne, {
1100
+ clearAction: /* @__PURE__ */ g(Ee, {
1090
1101
  size: 0,
1091
1102
  children: /* @__PURE__ */ g(G, {
1092
1103
  type: "link",
1093
- disabled: Re || R,
1104
+ disabled: Oe || F,
1094
1105
  ghost: !0,
1095
1106
  icon: /* @__PURE__ */ g(re, {
1096
1107
  style: {
@@ -1098,31 +1109,31 @@ ${e}` : e;
1098
1109
  },
1099
1110
  type: "icon-qingchujiyi"
1100
1111
  }),
1101
- onClick: () => In()
1112
+ onClick: () => Cn()
1102
1113
  })
1103
1114
  })
1104
- }), !!Fe && /* @__PURE__ */ F("div", {
1115
+ }), !!Fe && /* @__PURE__ */ U("div", {
1105
1116
  className: "remainingSeconds-time",
1106
1117
  children: ["您之前对话触发敏感词拦截,当前处于禁言状态,暂时无法发送消息,剩余禁言时长", Fe]
1107
1118
  })]
1108
1119
  })]
1109
1120
  })
1110
- }), /* @__PURE__ */ g(li, {
1111
- tips: Xt
1112
- }), tt && /* @__PURE__ */ g(fi, {
1121
+ }), /* @__PURE__ */ g(ci, {
1122
+ tips: Qt
1123
+ }), tt && /* @__PURE__ */ g(gi, {
1113
1124
  isvisible: tt,
1114
- files: fn,
1125
+ files: dn,
1115
1126
  sessionId: (Ut = e == null ? void 0 : e.data) == null ? void 0 : Ut.id,
1116
1127
  onClose: (t) => {
1117
- dn(!1), hn(!1);
1128
+ cn(!1), pn(!1);
1118
1129
  }
1119
1130
  })]
1120
- }), at && /* @__PURE__ */ g(pi, {
1131
+ }), at && /* @__PURE__ */ g(hi, {
1121
1132
  currentSession: e,
1122
1133
  application: i,
1123
- networkStatus: D,
1124
- setCurrentSession: b,
1125
- disabled: R,
1134
+ networkStatus: T,
1135
+ setCurrentSession: x,
1136
+ disabled: F,
1126
1137
  isSessionHistoryVisible: at,
1127
1138
  setIsSessionHistoryVisible: lt,
1128
1139
  onSessionChange: (t) => {
@@ -1132,5 +1143,5 @@ ${e}` : e;
1132
1143
  });
1133
1144
  });
1134
1145
  export {
1135
- eo as default
1146
+ no as default
1136
1147
  };