@glodon-aiot/agent-cli-ui 3.0.11-alpha.1 → 3.0.11-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/Dialog/HistoryItem/index.mjs +104 -104
- package/dist/es/Dialog/SearchReference/index.mjs +27 -27
- package/dist/es/index.mjs +2 -2
- package/dist/lib/index.js +19 -19
- package/package.json +3 -3
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as d, useContext as
|
|
1
|
+
import { jsxs as s, jsx as e } from "../../_virtual/jsx-runtime.mjs";
|
|
2
|
+
import { memo as d, useContext as le, useState as se } from "react";
|
|
3
3
|
import c from "../../InputProgress/index.mjs";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { IHistoryRole as
|
|
7
|
-
import
|
|
8
|
-
import { Popover as
|
|
9
|
-
import
|
|
4
|
+
import re from "../SessionRefer/index.mjs";
|
|
5
|
+
import ae from "../SessionAction/index.mjs";
|
|
6
|
+
import { IHistoryRole as H, IThinkingStatus as Q } from "@glodon-aiot/apis";
|
|
7
|
+
import oe from "../../FileItem/index.mjs";
|
|
8
|
+
import { Popover as de, Space as q, Button as D, Row as ce, Col as pe, Collapse as V, Divider as me, message as W } from "antd";
|
|
9
|
+
import ue from "../SearchReference/index.mjs";
|
|
10
10
|
import "./style.less.mjs";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
11
|
+
import he from "../HistoryContent/index.mjs";
|
|
12
|
+
import ge from "../../components/Markdown/index.mjs";
|
|
13
|
+
import Ne from "../../node_modules/classnames/index.mjs";
|
|
14
14
|
import p from "../../Iconfont/index.mjs";
|
|
15
|
-
import { CheckOutlined as
|
|
15
|
+
import { CheckOutlined as G, CloseOutlined as K, LoadingOutlined as fe } from "@ant-design/icons";
|
|
16
16
|
import m from "../../components/JsonDisplay/index.mjs";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import { escapeSlash as
|
|
23
|
-
const
|
|
17
|
+
import ye from "../../context.mjs";
|
|
18
|
+
import Le from "../SessionRelated/index.mjs";
|
|
19
|
+
import Ce from "../ReferCollapse/index.mjs";
|
|
20
|
+
import ve from "../../node_modules/copy-to-clipboard/index.mjs";
|
|
21
|
+
import Re from "../../assets/think.svg.mjs";
|
|
22
|
+
import { escapeSlash as Se } from "../../utils/index.mjs";
|
|
23
|
+
const be = (o) => {
|
|
24
24
|
if (!o)
|
|
25
25
|
return o;
|
|
26
26
|
try {
|
|
27
27
|
return JSON.parse(o);
|
|
28
|
-
} catch (
|
|
28
|
+
} catch (r) {
|
|
29
29
|
return o;
|
|
30
30
|
}
|
|
31
|
-
},
|
|
32
|
-
d(
|
|
33
|
-
const
|
|
34
|
-
d(
|
|
31
|
+
}, Ee = d(ue), X = d(re), L = d(ge);
|
|
32
|
+
d(he);
|
|
33
|
+
const ke = d(oe);
|
|
34
|
+
d(Ce);
|
|
35
35
|
const u = (o) => {
|
|
36
36
|
if (!o)
|
|
37
37
|
return !1;
|
|
38
38
|
try {
|
|
39
|
-
const
|
|
40
|
-
return !(
|
|
41
|
-
} catch (
|
|
39
|
+
const r = JSON.parse(o);
|
|
40
|
+
return !(r != null && r.code && (r.code < 200 || r.code > 300));
|
|
41
|
+
} catch (r) {
|
|
42
42
|
return !0;
|
|
43
43
|
}
|
|
44
|
-
},
|
|
44
|
+
}, Y = (o) => {
|
|
45
45
|
var t;
|
|
46
|
-
const
|
|
47
|
-
return
|
|
48
|
-
},
|
|
49
|
-
var b, E,
|
|
46
|
+
const r = JSON.parse(JSON.stringify(o)) || [], a = (t = r == null ? void 0 : r.pop()) == null ? void 0 : t.pop();
|
|
47
|
+
return a ? (a == null ? void 0 : a.type) === "BEFORE_CALL" || (a == null ? void 0 : a.type) === "FUNCTION_CALL" : !1;
|
|
48
|
+
}, Xe = (o) => {
|
|
49
|
+
var S, b, E, k, T, A, x, O, F;
|
|
50
50
|
const {
|
|
51
|
-
application:
|
|
52
|
-
currentSession:
|
|
51
|
+
application: r,
|
|
52
|
+
currentSession: a,
|
|
53
53
|
history: t,
|
|
54
54
|
isLastHistory: h,
|
|
55
|
-
onRelatedClick:
|
|
56
|
-
onAgainClick:
|
|
57
|
-
isLoading:
|
|
55
|
+
onRelatedClick: Z,
|
|
56
|
+
onAgainClick: $,
|
|
57
|
+
isLoading: Te,
|
|
58
58
|
docViewerUrl: g,
|
|
59
59
|
onEditClick: N
|
|
60
60
|
} = o, {
|
|
61
61
|
debug: C,
|
|
62
62
|
transform: i,
|
|
63
63
|
popupContainer: f
|
|
64
|
-
} =
|
|
65
|
-
Panel:
|
|
66
|
-
} =
|
|
67
|
-
|
|
64
|
+
} = le(ye), v = t.role === H.User, R = t.role === H.Robot, {
|
|
65
|
+
Panel: ee
|
|
66
|
+
} = V, [y, te] = se(!0), ne = () => {
|
|
67
|
+
W.config({
|
|
68
68
|
getContainer: () => (f == null ? void 0 : f.current) || document.body
|
|
69
|
-
}),
|
|
69
|
+
}), ve(t.content), W.success("复制成功");
|
|
70
70
|
};
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
className:
|
|
71
|
+
return /* @__PURE__ */ s("div", {
|
|
72
|
+
className: Ne({
|
|
73
73
|
"history-item": !0,
|
|
74
74
|
"history-item__user": v,
|
|
75
75
|
"history-item__bot": R
|
|
76
76
|
}),
|
|
77
|
-
children: [v && /* @__PURE__ */
|
|
77
|
+
children: [v && /* @__PURE__ */ s("div", {
|
|
78
78
|
className: "history-item-user",
|
|
79
79
|
children: [/* @__PURE__ */ e("div", {
|
|
80
80
|
className: "item-user-panel",
|
|
81
|
-
children: /* @__PURE__ */ e(
|
|
81
|
+
children: /* @__PURE__ */ e(de, {
|
|
82
82
|
placement: "topLeft",
|
|
83
83
|
overlayStyle: {
|
|
84
84
|
padding: 4
|
|
85
85
|
},
|
|
86
86
|
overlayClassName: "session-item-overlay-popover",
|
|
87
87
|
getPopupContainer: (n) => n.parentNode,
|
|
88
|
-
content: i != null && i.userEdit || i != null && i.userCopy ? /* @__PURE__ */
|
|
88
|
+
content: i != null && i.userEdit || i != null && i.userCopy ? /* @__PURE__ */ s(q, {
|
|
89
89
|
className: "item-user-popover",
|
|
90
90
|
size: 4,
|
|
91
91
|
children: [(i == null ? void 0 : i.userEdit) && /* @__PURE__ */ e("div", {
|
|
92
92
|
className: "user-pannel-item",
|
|
93
93
|
onClick: () => N == null ? void 0 : N(t.content),
|
|
94
|
-
children: /* @__PURE__ */ e(
|
|
94
|
+
children: /* @__PURE__ */ e(D, {
|
|
95
95
|
type: "link",
|
|
96
96
|
size: "small",
|
|
97
97
|
icon: /* @__PURE__ */ e(p, {
|
|
@@ -100,8 +100,8 @@ const u = (o) => {
|
|
|
100
100
|
})
|
|
101
101
|
}), (i == null ? void 0 : i.userCopy) && /* @__PURE__ */ e("div", {
|
|
102
102
|
className: "user-pannel-item",
|
|
103
|
-
onClick:
|
|
104
|
-
children: /* @__PURE__ */ e(
|
|
103
|
+
onClick: ne,
|
|
104
|
+
children: /* @__PURE__ */ e(D, {
|
|
105
105
|
type: "link",
|
|
106
106
|
size: "small",
|
|
107
107
|
icon: /* @__PURE__ */ e(p, {
|
|
@@ -119,22 +119,22 @@ const u = (o) => {
|
|
|
119
119
|
className: "item-user-content",
|
|
120
120
|
children: /* @__PURE__ */ e(L, {
|
|
121
121
|
showLatex: !1,
|
|
122
|
-
children:
|
|
122
|
+
children: Se(t.content)
|
|
123
123
|
})
|
|
124
124
|
})
|
|
125
125
|
})
|
|
126
126
|
})
|
|
127
127
|
}), /* @__PURE__ */ e("div", {
|
|
128
128
|
className: "item-user-file",
|
|
129
|
-
children: /* @__PURE__ */ e(
|
|
129
|
+
children: /* @__PURE__ */ e(ce, {
|
|
130
130
|
gutter: [12, 12],
|
|
131
131
|
justify: "end",
|
|
132
132
|
wrap: !0,
|
|
133
|
-
children: (
|
|
133
|
+
children: (S = t.files) == null ? void 0 : S.map((n) => /* @__PURE__ */ e(pe, {
|
|
134
134
|
className: "user-file-col",
|
|
135
|
-
children: /* @__PURE__ */ e(
|
|
135
|
+
children: /* @__PURE__ */ e(ke, {
|
|
136
136
|
docViewerUrl: g,
|
|
137
|
-
currentSession:
|
|
137
|
+
currentSession: a,
|
|
138
138
|
file: n
|
|
139
139
|
})
|
|
140
140
|
}, n.id))
|
|
@@ -142,51 +142,51 @@ const u = (o) => {
|
|
|
142
142
|
})]
|
|
143
143
|
}), R && /* @__PURE__ */ e("div", {
|
|
144
144
|
className: "history-item-bot",
|
|
145
|
-
children: /* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ s("div", {
|
|
146
146
|
className: "bot-content-wrapper",
|
|
147
|
-
children: [
|
|
147
|
+
children: [r.type === 2 && /* @__PURE__ */ s("div", {
|
|
148
148
|
className: "item-bot-plugin",
|
|
149
|
-
children: [/* @__PURE__ */ e(
|
|
149
|
+
children: [/* @__PURE__ */ e(V, {
|
|
150
150
|
ghost: !0,
|
|
151
151
|
expandIconPosition: "right",
|
|
152
|
-
children: (
|
|
153
|
-
var I, U, z, j, B, w, M, J, P
|
|
154
|
-
return /* @__PURE__ */
|
|
152
|
+
children: (b = t.actions) == null ? void 0 : b.map((n, ie) => {
|
|
153
|
+
var _, I, U, z, j, B, w, M, J, P;
|
|
154
|
+
return /* @__PURE__ */ s(ee, {
|
|
155
155
|
collapsible: C ? "header" : "icon",
|
|
156
156
|
showArrow: C,
|
|
157
|
-
header: /* @__PURE__ */
|
|
157
|
+
header: /* @__PURE__ */ s(q, {
|
|
158
158
|
size: 8,
|
|
159
159
|
style: {
|
|
160
160
|
width: "100%"
|
|
161
161
|
},
|
|
162
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ s("span", {
|
|
163
163
|
className: "bot-plugin-status",
|
|
164
|
-
children: [(n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && u((
|
|
164
|
+
children: [(n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && u((_ = n.find((l) => l.type === "RESULT")) == null ? void 0 : _.data.result) && /* @__PURE__ */ e("span", {
|
|
165
165
|
className: "plugin-status-success",
|
|
166
|
-
children: /* @__PURE__ */ e(
|
|
166
|
+
children: /* @__PURE__ */ e(G, {})
|
|
167
167
|
}), n[n.length - 1].type === "ABORT" && /* @__PURE__ */ e("span", {
|
|
168
168
|
className: "plugin-status-error",
|
|
169
|
-
children: /* @__PURE__ */ e(
|
|
170
|
-
}), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && !u((
|
|
169
|
+
children: /* @__PURE__ */ e(K, {})
|
|
170
|
+
}), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && !u((I = n.find((l) => l.type === "RESULT")) == null ? void 0 : I.data.result) && /* @__PURE__ */ e("span", {
|
|
171
171
|
className: "plugin-status-error",
|
|
172
|
-
children: /* @__PURE__ */ e(
|
|
172
|
+
children: /* @__PURE__ */ e(K, {})
|
|
173
173
|
}), (n[n.length - 1].type === "BEFORE_CALL" || n[n.length - 1].type === "FUNCTION_CALL") && /* @__PURE__ */ e("span", {
|
|
174
174
|
className: "plugin-status-loading",
|
|
175
|
-
children: /* @__PURE__ */ e(
|
|
175
|
+
children: /* @__PURE__ */ e(fe, {})
|
|
176
176
|
})]
|
|
177
177
|
}), /* @__PURE__ */ e("span", {
|
|
178
178
|
className: "bot-plugin-title",
|
|
179
|
-
children: (
|
|
179
|
+
children: (U = n[n.length - 1].data) == null ? void 0 : U.pluginName
|
|
180
180
|
}), /* @__PURE__ */ e("span", {
|
|
181
181
|
className: "bot-plugin-action",
|
|
182
|
-
children: (
|
|
182
|
+
children: (z = n[n.length - 1].data) == null ? void 0 : z.funcName
|
|
183
183
|
}), (n[n.length - 1].type === "BEFORE_CALL" || n[n.length - 1].type === "FUNCTION_CALL") && /* @__PURE__ */ e("span", {
|
|
184
184
|
className: "bot-plugin-result",
|
|
185
185
|
children: "执行中"
|
|
186
|
-
}), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && u((
|
|
186
|
+
}), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && u((j = n.find((l) => l.type === "RESULT")) == null ? void 0 : j.data.result) && /* @__PURE__ */ e("span", {
|
|
187
187
|
className: "bot-plugin-result",
|
|
188
188
|
children: "执行成功"
|
|
189
|
-
}), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && !u((
|
|
189
|
+
}), (n[n.length - 1].type === "RESULT" || n[n.length - 1].type === "AFTER_CALL") && !u((B = n.find((l) => l.type === "RESULT")) == null ? void 0 : B.data.result) && /* @__PURE__ */ e("span", {
|
|
190
190
|
className: "bot-plugin-result",
|
|
191
191
|
children: "执行失败"
|
|
192
192
|
}), n[n.length - 1].type === "ABORT" && /* @__PURE__ */ e("span", {
|
|
@@ -200,7 +200,7 @@ const u = (o) => {
|
|
|
200
200
|
}), /* @__PURE__ */ e("div", {
|
|
201
201
|
className: "bot-plugin-json",
|
|
202
202
|
children: /* @__PURE__ */ e(m, {
|
|
203
|
-
josn: (
|
|
203
|
+
josn: (w = n.find((l) => l.type === "BEFORE_CALL")) == null ? void 0 : w.data.thought
|
|
204
204
|
})
|
|
205
205
|
}), /* @__PURE__ */ e("div", {
|
|
206
206
|
className: "bot-plugin-content",
|
|
@@ -208,7 +208,7 @@ const u = (o) => {
|
|
|
208
208
|
}), /* @__PURE__ */ e("div", {
|
|
209
209
|
className: "bot-plugin-json",
|
|
210
210
|
children: /* @__PURE__ */ e(m, {
|
|
211
|
-
josn: (
|
|
211
|
+
josn: (M = n.find((l) => l.type === "BEFORE_CALL")) == null ? void 0 : M.data.parameters
|
|
212
212
|
})
|
|
213
213
|
}), /* @__PURE__ */ e("div", {
|
|
214
214
|
className: "bot-plugin-content",
|
|
@@ -216,7 +216,7 @@ const u = (o) => {
|
|
|
216
216
|
}), /* @__PURE__ */ e("div", {
|
|
217
217
|
className: "bot-plugin-json",
|
|
218
218
|
children: /* @__PURE__ */ e(m, {
|
|
219
|
-
josn: (
|
|
219
|
+
josn: (J = n.find((l) => l.type === "BEFORE_CALL")) == null ? void 0 : J.data.requestBody
|
|
220
220
|
})
|
|
221
221
|
}), /* @__PURE__ */ e("div", {
|
|
222
222
|
className: "bot-plugin-content",
|
|
@@ -224,44 +224,44 @@ const u = (o) => {
|
|
|
224
224
|
}), /* @__PURE__ */ e("div", {
|
|
225
225
|
className: "bot-plugin-json",
|
|
226
226
|
children: /* @__PURE__ */ e(m, {
|
|
227
|
-
josn:
|
|
227
|
+
josn: be((P = n.find((l) => l.type === "RESULT")) == null ? void 0 : P.data.result)
|
|
228
228
|
})
|
|
229
229
|
})]
|
|
230
|
-
},
|
|
230
|
+
}, ie);
|
|
231
231
|
})
|
|
232
232
|
}), t.isLoading && /* @__PURE__ */ e("div", {
|
|
233
233
|
className: "history-input-progress",
|
|
234
234
|
style: {
|
|
235
235
|
padding: "4px 0"
|
|
236
236
|
},
|
|
237
|
-
children:
|
|
237
|
+
children: Y(t.actions) ? null : /* @__PURE__ */ e(c, {
|
|
238
238
|
size: 4,
|
|
239
239
|
text: "思考中"
|
|
240
240
|
})
|
|
241
241
|
})]
|
|
242
|
-
}),
|
|
242
|
+
}), /* @__PURE__ */ e("div", {
|
|
243
243
|
className: "item-bot-net",
|
|
244
|
-
children: /* @__PURE__ */ e(
|
|
244
|
+
children: /* @__PURE__ */ e(Ee, {
|
|
245
245
|
history: t
|
|
246
246
|
})
|
|
247
|
-
}), (
|
|
247
|
+
}), (E = t == null ? void 0 : t.reference) != null && E.length && ((k = i == null ? void 0 : i.reference) != null && k.referenceFirst) ? /* @__PURE__ */ e(X, {
|
|
248
248
|
history: t,
|
|
249
249
|
docViewerUrl: g
|
|
250
|
-
}) : null, /* @__PURE__ */
|
|
250
|
+
}) : null, /* @__PURE__ */ s("div", {
|
|
251
251
|
className: "item-bot-content",
|
|
252
|
-
children: [/* @__PURE__ */
|
|
252
|
+
children: [/* @__PURE__ */ s("div", {
|
|
253
253
|
className: "content-think",
|
|
254
|
-
children: [(t == null ? void 0 : t.reasoningContent) && /* @__PURE__ */
|
|
254
|
+
children: [(t == null ? void 0 : t.reasoningContent) && /* @__PURE__ */ s("div", {
|
|
255
255
|
className: "think-top",
|
|
256
256
|
onClick: () => {
|
|
257
|
-
|
|
257
|
+
te(!y);
|
|
258
258
|
},
|
|
259
259
|
children: [/* @__PURE__ */ e("img", {
|
|
260
|
-
src:
|
|
260
|
+
src: Re,
|
|
261
261
|
alt: ""
|
|
262
262
|
}), (t == null ? void 0 : t.reasoningContent) && !(t != null && t.content) && /* @__PURE__ */ e("span", {
|
|
263
263
|
children: "我正在推理思考…"
|
|
264
|
-
}), (t == null ? void 0 : t.reasoningContent) && t.content && /* @__PURE__ */
|
|
264
|
+
}), (t == null ? void 0 : t.reasoningContent) && t.content && /* @__PURE__ */ s("span", {
|
|
265
265
|
children: ["已完成推理(用时 ", (t == null ? void 0 : t.thinkingSecs) || 0, " 秒)"]
|
|
266
266
|
}), /* @__PURE__ */ e("span", {
|
|
267
267
|
className: "think-action",
|
|
@@ -277,15 +277,15 @@ const u = (o) => {
|
|
|
277
277
|
}
|
|
278
278
|
})
|
|
279
279
|
})]
|
|
280
|
-
}), !!((
|
|
280
|
+
}), !!((T = t == null ? void 0 : t.reasoningContent) != null && T.trim()) && y && /* @__PURE__ */ s("div", {
|
|
281
281
|
className: "think-bottom",
|
|
282
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ s("div", {
|
|
283
283
|
className: "bottom-left",
|
|
284
|
-
children: [(t == null ? void 0 : t.thinkingStatus) ===
|
|
284
|
+
children: [(t == null ? void 0 : t.thinkingStatus) === Q.Start && /* @__PURE__ */ e("div", {
|
|
285
285
|
className: "thinking"
|
|
286
|
-
}), (t == null ? void 0 : t.thinkingStatus) ===
|
|
286
|
+
}), (t == null ? void 0 : t.thinkingStatus) === Q.End && /* @__PURE__ */ e("div", {
|
|
287
287
|
className: "thinked",
|
|
288
|
-
children: /* @__PURE__ */ e(
|
|
288
|
+
children: /* @__PURE__ */ e(G, {})
|
|
289
289
|
})]
|
|
290
290
|
}), /* @__PURE__ */ e("div", {
|
|
291
291
|
className: "bottom-right",
|
|
@@ -297,7 +297,7 @@ const u = (o) => {
|
|
|
297
297
|
}), /* @__PURE__ */ e(L, {
|
|
298
298
|
children: t.content
|
|
299
299
|
})]
|
|
300
|
-
}), (
|
|
300
|
+
}), (A = t == null ? void 0 : t.reference) != null && A.length && !((x = i == null ? void 0 : i.reference) != null && x.referenceFirst) ? /* @__PURE__ */ e(X, {
|
|
301
301
|
history: t,
|
|
302
302
|
docViewerUrl: g
|
|
303
303
|
}) : null, t.isRelatedQuestion && h ? /* @__PURE__ */ e("div", {
|
|
@@ -312,23 +312,23 @@ const u = (o) => {
|
|
|
312
312
|
style: {
|
|
313
313
|
padding: "4px 0"
|
|
314
314
|
},
|
|
315
|
-
children:
|
|
315
|
+
children: Y(t.actions) ? null : /* @__PURE__ */ e(c, {
|
|
316
316
|
size: 4,
|
|
317
317
|
text: "思考中"
|
|
318
318
|
})
|
|
319
|
-
}), (i == null ? void 0 : i.relate) && h && !!((
|
|
319
|
+
}), (i == null ? void 0 : i.relate) && h && !!((O = t.relatedQuesion) != null && O.length) && /* @__PURE__ */ e(Le, {
|
|
320
320
|
relatedQuesion: t.relatedQuesion,
|
|
321
|
-
onRelatedClick:
|
|
322
|
-
}), !t.isSensitive && !!t.messageId && /* @__PURE__ */ e(
|
|
323
|
-
appId:
|
|
321
|
+
onRelatedClick: Z
|
|
322
|
+
}), !t.isSensitive && !!t.messageId && /* @__PURE__ */ e(ae, {
|
|
323
|
+
appId: r.id,
|
|
324
324
|
history: t,
|
|
325
|
-
sessionId: (
|
|
326
|
-
onAgainClick:
|
|
325
|
+
sessionId: (F = a == null ? void 0 : a.data) == null ? void 0 : F.id,
|
|
326
|
+
onAgainClick: $,
|
|
327
327
|
isLastHistory: h,
|
|
328
|
-
currentSession:
|
|
328
|
+
currentSession: a
|
|
329
329
|
})]
|
|
330
330
|
})
|
|
331
|
-
}), t.isContext && /* @__PURE__ */
|
|
331
|
+
}), t.isContext && /* @__PURE__ */ s(me, {
|
|
332
332
|
children: [/* @__PURE__ */ e("div", {
|
|
333
333
|
style: {
|
|
334
334
|
color: "#84868C",
|
|
@@ -346,6 +346,6 @@ const u = (o) => {
|
|
|
346
346
|
});
|
|
347
347
|
};
|
|
348
348
|
export {
|
|
349
|
-
|
|
349
|
+
Xe as default,
|
|
350
350
|
u as isResultExec
|
|
351
351
|
};
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import { jsx as e, jsxs as r, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as f } from "../../_virtual/jsx-runtime.mjs";
|
|
2
|
+
import { useState as N } from "react";
|
|
3
|
+
import R from "../../assets/think.svg.mjs";
|
|
4
4
|
import "./style.less.mjs";
|
|
5
|
-
import { CheckOutlined as
|
|
6
|
-
import { Collapse as
|
|
5
|
+
import { CheckOutlined as k, CloseOutlined as x } from "@ant-design/icons";
|
|
6
|
+
import { Collapse as p, Space as S } from "antd";
|
|
7
7
|
const {
|
|
8
|
-
Panel:
|
|
9
|
-
} =
|
|
10
|
-
var t;
|
|
8
|
+
Panel: b
|
|
9
|
+
} = p, E = (m) => {
|
|
10
|
+
var t, a, c, l, i, h;
|
|
11
11
|
const {
|
|
12
12
|
history: n
|
|
13
|
-
} =
|
|
13
|
+
} = m, [u, g] = N(!1), s = n.searchingStatus ? n.searchingStatus : (t = n.searchReference) != null && t.length ? "end" : "";
|
|
14
14
|
return s ? /* @__PURE__ */ e("div", {
|
|
15
15
|
className: "search-reference",
|
|
16
16
|
children: /* @__PURE__ */ r("div", {
|
|
17
17
|
className: "item-bot-plugin",
|
|
18
18
|
onClick: () => {
|
|
19
|
-
|
|
19
|
+
g(!u);
|
|
20
20
|
},
|
|
21
|
-
children: [s === "start" && /* @__PURE__ */ r(
|
|
21
|
+
children: [s === "start" && /* @__PURE__ */ r(f, {
|
|
22
22
|
children: [/* @__PURE__ */ e("img", {
|
|
23
|
-
src:
|
|
23
|
+
src: R,
|
|
24
24
|
alt: ""
|
|
25
25
|
}), /* @__PURE__ */ e("span", {
|
|
26
26
|
children: "正在搜索…"
|
|
27
27
|
})]
|
|
28
|
-
}), s === "end" && /* @__PURE__ */ e(
|
|
28
|
+
}), s === "end" && /* @__PURE__ */ e(p, {
|
|
29
29
|
ghost: !0,
|
|
30
30
|
expandIconPosition: "right",
|
|
31
|
-
children: /* @__PURE__ */ e(
|
|
31
|
+
children: /* @__PURE__ */ e(b, {
|
|
32
32
|
collapsible: "icon",
|
|
33
|
-
showArrow: !!(s === "end" && n.searchReference.length),
|
|
34
|
-
header: /* @__PURE__ */ r(
|
|
33
|
+
showArrow: !!(s === "end" && ((a = n.searchReference) != null && a.length)),
|
|
34
|
+
header: /* @__PURE__ */ r(S, {
|
|
35
35
|
size: 8,
|
|
36
36
|
style: {
|
|
37
37
|
width: "100%"
|
|
38
38
|
},
|
|
39
39
|
children: [/* @__PURE__ */ r("span", {
|
|
40
40
|
className: "bot-plugin-status",
|
|
41
|
-
children: [s === "end" && n.searchReference
|
|
41
|
+
children: [s === "end" && ((c = n.searchReference) == null ? void 0 : c.length) && /* @__PURE__ */ e("span", {
|
|
42
42
|
className: "plugin-status-success",
|
|
43
|
-
children: /* @__PURE__ */ e(
|
|
44
|
-
}), s === "end" && !n.searchReference.length && /* @__PURE__ */ e("span", {
|
|
43
|
+
children: /* @__PURE__ */ e(k, {})
|
|
44
|
+
}), s === "end" && !((l = n.searchReference) != null && l.length) && /* @__PURE__ */ e("span", {
|
|
45
45
|
className: "plugin-status-error",
|
|
46
|
-
children: /* @__PURE__ */ e(
|
|
46
|
+
children: /* @__PURE__ */ e(x, {})
|
|
47
47
|
})]
|
|
48
48
|
}), s === "end" && /* @__PURE__ */ e("span", {
|
|
49
49
|
className: "bot-plugin-title",
|
|
50
|
-
children: n.searchReference.length ? `已搜索到${n.searchReference.length}个网页` : "未找到搜索内容,请检查搜索服务"
|
|
50
|
+
children: (i = n.searchReference) != null && i.length ? `已搜索到${n.searchReference.length}个网页` : "未找到搜索内容,请检查搜索服务"
|
|
51
51
|
})]
|
|
52
52
|
}),
|
|
53
53
|
children: /* @__PURE__ */ e("div", {
|
|
54
54
|
className: "bot-net-main",
|
|
55
|
-
children: (
|
|
55
|
+
children: (h = n.searchReference) == null ? void 0 : h.map((o, d) => /* @__PURE__ */ r("div", {
|
|
56
56
|
className: "text",
|
|
57
57
|
children: [/* @__PURE__ */ r("span", {
|
|
58
|
-
children: [
|
|
58
|
+
children: [d + 1, ". "]
|
|
59
59
|
}), /* @__PURE__ */ e("span", {
|
|
60
60
|
className: "link",
|
|
61
61
|
onClick: () => {
|
|
62
|
-
window.open(
|
|
62
|
+
window.open(o.link);
|
|
63
63
|
},
|
|
64
|
-
children:
|
|
64
|
+
children: o.title
|
|
65
65
|
})]
|
|
66
|
-
},
|
|
66
|
+
}, d))
|
|
67
67
|
})
|
|
68
68
|
}, "")
|
|
69
69
|
})]
|
|
@@ -71,5 +71,5 @@ const {
|
|
|
71
71
|
}) : null;
|
|
72
72
|
};
|
|
73
73
|
export {
|
|
74
|
-
|
|
74
|
+
E as default
|
|
75
75
|
};
|