wi-chat 0.3.0 → 0.4.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.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +59 -54
- package/dist/mobile-ui/chat/ChatContainer.vue.d.ts +5 -0
- package/dist/mobile-ui/chat/ChatMessagesView.vue.d.ts +5 -0
- package/dist/mobile-ui/index.cjs +1 -1
- package/dist/mobile-ui/index.d.ts +2 -2
- package/dist/mobile-ui/index.js +78 -71
- package/dist/mobile-ui/style.css +1 -1
- package/dist/parser/answerCom/outputFile/parseOutputFile.d.ts +43 -0
- package/dist/parser/answerCom/outputFile/types.d.ts +17 -0
- package/dist/parser/index.cjs +2 -2
- package/dist/parser/index.d.ts +3 -0
- package/dist/parser/index.js +220 -180
- package/dist/parser/registry.d.ts +1 -1
- package/dist/renderers/index.cjs +1 -1
- package/dist/renderers/index.d.ts +3 -0
- package/dist/renderers/index.js +512 -146
- package/dist/renderers/outputFile/OutputFile.vue.d.ts +19 -0
- package/dist/renderers/outputFile/useOutputFile.d.ts +85 -0
- package/dist/renderers/style.css +1 -1
- package/dist/web-ui/chat/ChatContainer.vue.d.ts +5 -0
- package/dist/web-ui/chat/ChatMessagesView.vue.d.ts +5 -0
- package/dist/web-ui/index.cjs +1 -1
- package/dist/web-ui/index.d.ts +2 -2
- package/dist/web-ui/index.js +402 -388
- package/dist/web-ui/style.css +1 -1
- package/package.json +1 -1
package/dist/web-ui/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createAnswerContentMap as re,
|
|
2
|
-
import { AiAnswerBubble as
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
import { ElImage as
|
|
5
|
-
import { isImageAttachment as
|
|
1
|
+
import { createAnswerContentMap as re, provideOutputFileConfig as de, DeepThinkingSteps as ce, AiAnswerBubble as ue } from "wi-chat/renderers";
|
|
2
|
+
import { AiAnswerBubble as xo, DeepThinkingSteps as Oo, IframePage as Do, KnowledgeStreamResult as Qo, OutputFile as No, createAnswerContentMap as jo, injectIframeResizerChild as Ho, provideIframePageConfig as Wo, provideOutputFileConfig as qo, resolveIframePlaceholders as Ko, useIframePage as Yo } from "wi-chat/renderers";
|
|
3
|
+
import { defineComponent as O, computed as $, openBlock as s, createElementBlock as n, normalizeClass as z, createElementVNode as e, renderSlot as S, createBlock as V, unref as I, withModifiers as te, withCtx as C, createTextVNode as W, toDisplayString as A, createCommentVNode as g, createStaticVNode as le, pushScopeId as q, popScopeId as K, Fragment as x, renderList as N, normalizeProps as Z, guardReactiveProps as G, ref as E, onBeforeUnmount as pe, createVNode as L, withKeys as he, defineAsyncComponent as _e, watch as ae, Transition as ve, resolveComponent as J, normalizeStyle as we } from "vue";
|
|
4
|
+
import { ElImage as be, ElPopover as me, ElCheckbox as fe, ElInput as ge, ElTooltip as ee } from "element-plus";
|
|
5
|
+
import { isImageAttachment as ye, resolveAttachPreviewUrl as ke, normalizeAttachment as $e, resolveRemoteFileUrl as Ce, parseRealtimeAttachment as Ue } from "wi-chat/parser";
|
|
6
6
|
import { downloadAttachment as Ae, useAutoScroll as Be } from "wi-chat/tools";
|
|
7
|
-
const j = (
|
|
7
|
+
const j = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-attach-card__icon" }, Fe = /* @__PURE__ */ j(() => /* @__PURE__ */ e("div", { class: "wi-web-attach-card__image-fallback" }, [
|
|
8
8
|
/* @__PURE__ */ e("svg", {
|
|
9
9
|
viewBox: "0 0 24 24",
|
|
10
10
|
width: "16",
|
|
@@ -60,8 +60,8 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
60
60
|
fill: "none",
|
|
61
61
|
stroke: "currentColor",
|
|
62
62
|
"stroke-width": "2"
|
|
63
|
-
},
|
|
64
|
-
|
|
63
|
+
}, Ve = /* @__PURE__ */ le('<rect x="3" y="3" width="18" height="18" rx="2" data-v-dc2d5f2b></rect><path d="M3 9h18" data-v-dc2d5f2b></path><path d="M3 15h18" data-v-dc2d5f2b></path><path d="M9 3v18" data-v-dc2d5f2b></path><path d="M15 3v18" data-v-dc2d5f2b></path>', 5), Le = [
|
|
64
|
+
Ve
|
|
65
65
|
], Te = {
|
|
66
66
|
key: 2,
|
|
67
67
|
viewBox: "0 0 24 24",
|
|
@@ -70,11 +70,11 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
70
70
|
fill: "none",
|
|
71
71
|
stroke: "currentColor",
|
|
72
72
|
"stroke-width": "2"
|
|
73
|
-
},
|
|
74
|
-
Le,
|
|
73
|
+
}, Me = /* @__PURE__ */ j(() => /* @__PURE__ */ e("path", { d: "M18 20V10" }, null, -1)), ze = /* @__PURE__ */ j(() => /* @__PURE__ */ e("path", { d: "M12 20V4" }, null, -1)), Pe = /* @__PURE__ */ j(() => /* @__PURE__ */ e("path", { d: "M6 20v-6" }, null, -1)), Ee = [
|
|
75
74
|
Me,
|
|
76
|
-
ze
|
|
77
|
-
|
|
75
|
+
ze,
|
|
76
|
+
Pe
|
|
77
|
+
], xe = {
|
|
78
78
|
key: 3,
|
|
79
79
|
viewBox: "0 0 24 24",
|
|
80
80
|
width: "20",
|
|
@@ -82,12 +82,12 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
82
82
|
fill: "none",
|
|
83
83
|
stroke: "currentColor",
|
|
84
84
|
"stroke-width": "2"
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
],
|
|
85
|
+
}, Oe = /* @__PURE__ */ le('<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-dc2d5f2b></path><polyline points="14 2 14 8 20 8" data-v-dc2d5f2b></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-dc2d5f2b></line><line x1="16" y1="17" x2="8" y2="17" data-v-dc2d5f2b></line><polyline points="10 9 9 9 8 9" data-v-dc2d5f2b></polyline>', 5), De = [
|
|
86
|
+
Oe
|
|
87
|
+
], Qe = { class: "wi-web-attach-card__info" }, Ne = ["title"], je = {
|
|
88
88
|
key: 0,
|
|
89
89
|
class: "wi-web-attach-card__size"
|
|
90
|
-
},
|
|
90
|
+
}, He = { class: "wi-web-attach-card__actions" }, We = /* @__PURE__ */ j(() => /* @__PURE__ */ e("svg", {
|
|
91
91
|
viewBox: "0 0 24 24",
|
|
92
92
|
width: "14",
|
|
93
93
|
height: "14",
|
|
@@ -103,9 +103,9 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
103
103
|
x2: "12",
|
|
104
104
|
y2: "3"
|
|
105
105
|
})
|
|
106
|
-
], -1)),
|
|
107
|
-
|
|
108
|
-
],
|
|
106
|
+
], -1)), qe = [
|
|
107
|
+
We
|
|
108
|
+
], Ke = /* @__PURE__ */ O({
|
|
109
109
|
__name: "AttachmentCard",
|
|
110
110
|
props: {
|
|
111
111
|
item: {},
|
|
@@ -116,36 +116,36 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
116
116
|
getFileUrl: { type: Function, default: void 0 }
|
|
117
117
|
},
|
|
118
118
|
emits: ["click", "remove", "download"],
|
|
119
|
-
setup(
|
|
120
|
-
const
|
|
121
|
-
var
|
|
122
|
-
return ((
|
|
123
|
-
}),
|
|
124
|
-
if (
|
|
119
|
+
setup(c, { emit: U }) {
|
|
120
|
+
const a = c, i = U, h = $(() => {
|
|
121
|
+
var o;
|
|
122
|
+
return ((o = a.item) == null ? void 0 : o.attachContent) || {};
|
|
123
|
+
}), m = $(() => ye(a.item)), f = $(() => ke(a.item, a.baseURL, a.getFileUrl)), l = $(() => {
|
|
124
|
+
if (a.removable)
|
|
125
125
|
return !1;
|
|
126
|
-
if (
|
|
127
|
-
return
|
|
128
|
-
if (
|
|
126
|
+
if (a.downloadable !== void 0)
|
|
127
|
+
return a.downloadable;
|
|
128
|
+
if (a.item.type && a.item.type !== "file")
|
|
129
129
|
return !1;
|
|
130
|
-
const
|
|
131
|
-
return !!(
|
|
132
|
-
}),
|
|
133
|
-
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
baseURL:
|
|
139
|
-
getFileUrl:
|
|
130
|
+
const o = h.value;
|
|
131
|
+
return !!(o.fileId || o.raw);
|
|
132
|
+
}), d = () => {
|
|
133
|
+
i("click", a.item);
|
|
134
|
+
}, r = () => {
|
|
135
|
+
i("remove", a.item);
|
|
136
|
+
}, u = async () => {
|
|
137
|
+
i("download", a.item), await Ae(a.item, {
|
|
138
|
+
baseURL: a.baseURL,
|
|
139
|
+
getFileUrl: a.getFileUrl
|
|
140
140
|
});
|
|
141
141
|
};
|
|
142
|
-
return (
|
|
143
|
-
class: z(["wi-web-attach-card", { "is-clickable":
|
|
144
|
-
onClick:
|
|
142
|
+
return (o, p) => (s(), n("div", {
|
|
143
|
+
class: z(["wi-web-attach-card", { "is-clickable": o.clickable || !!o.$attrs.onClick }]),
|
|
144
|
+
onClick: d
|
|
145
145
|
}, [
|
|
146
|
-
e("div",
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
e("div", Ie, [
|
|
147
|
+
S(o.$slots, "icon", { item: o.item }, () => [
|
|
148
|
+
m.value && f.value ? (s(), V(I(be), {
|
|
149
149
|
key: 0,
|
|
150
150
|
src: f.value,
|
|
151
151
|
"preview-src-list": [f.value],
|
|
@@ -157,59 +157,59 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
157
157
|
}, ["stop"]))
|
|
158
158
|
}, {
|
|
159
159
|
placeholder: C(() => [
|
|
160
|
-
|
|
160
|
+
Fe
|
|
161
161
|
]),
|
|
162
162
|
error: C(() => [
|
|
163
163
|
Re
|
|
164
164
|
]),
|
|
165
165
|
_: 1
|
|
166
|
-
}, 8, ["src", "preview-src-list"])) :
|
|
166
|
+
}, 8, ["src", "preview-src-list"])) : o.item.type === "table" ? (s(), n("svg", Se, Le)) : o.item.type === "metric" ? (s(), n("svg", Te, Ee)) : (s(), n("svg", xe, De))
|
|
167
167
|
], !0)
|
|
168
168
|
]),
|
|
169
|
-
e("div",
|
|
169
|
+
e("div", Qe, [
|
|
170
170
|
e("div", {
|
|
171
171
|
class: "wi-web-attach-card__name",
|
|
172
|
-
title:
|
|
172
|
+
title: o.item.name
|
|
173
173
|
}, [
|
|
174
|
-
|
|
175
|
-
W(
|
|
174
|
+
S(o.$slots, "title", { item: o.item }, () => [
|
|
175
|
+
W(A(o.item.name), 1)
|
|
176
176
|
], !0)
|
|
177
|
-
], 8,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
W(
|
|
177
|
+
], 8, Ne),
|
|
178
|
+
o.item.description || o.$slots.description ? (s(), n("div", je, [
|
|
179
|
+
S(o.$slots, "description", { item: o.item }, () => [
|
|
180
|
+
W(A(o.item.description), 1)
|
|
181
181
|
], !0)
|
|
182
182
|
])) : g("", !0)
|
|
183
183
|
]),
|
|
184
|
-
e("div",
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
e("div", He, [
|
|
185
|
+
S(o.$slots, "actions", { item: o.item }, () => [
|
|
186
|
+
l.value ? (s(), n("button", {
|
|
187
187
|
key: 0,
|
|
188
188
|
type: "button",
|
|
189
189
|
class: "wi-web-attach-card__action-btn wi-web-attach-card__download",
|
|
190
190
|
title: "下载附件",
|
|
191
|
-
onClick: te(
|
|
192
|
-
},
|
|
193
|
-
|
|
191
|
+
onClick: te(u, ["stop"])
|
|
192
|
+
}, qe)) : g("", !0),
|
|
193
|
+
o.removable ? (s(), n("button", {
|
|
194
194
|
key: 1,
|
|
195
195
|
type: "button",
|
|
196
196
|
class: "wi-web-attach-card__action-btn wi-web-attach-card__delete",
|
|
197
197
|
title: "删除附件",
|
|
198
|
-
onClick: te(
|
|
198
|
+
onClick: te(r, ["stop"])
|
|
199
199
|
}, " × ")) : g("", !0)
|
|
200
200
|
], !0)
|
|
201
201
|
])
|
|
202
202
|
], 2));
|
|
203
203
|
}
|
|
204
|
-
}),
|
|
205
|
-
const
|
|
206
|
-
for (const [
|
|
207
|
-
|
|
208
|
-
return
|
|
209
|
-
},
|
|
204
|
+
}), D = (c, U) => {
|
|
205
|
+
const a = c.__vccOpts || c;
|
|
206
|
+
for (const [i, h] of U)
|
|
207
|
+
a[i] = h;
|
|
208
|
+
return a;
|
|
209
|
+
}, Ye = /* @__PURE__ */ D(Ke, [["__scopeId", "data-v-dc2d5f2b"]]), Xe = {
|
|
210
210
|
key: 0,
|
|
211
211
|
class: "wi-web-attachment-list"
|
|
212
|
-
},
|
|
212
|
+
}, Ze = /* @__PURE__ */ O({
|
|
213
213
|
__name: "AttachmentList",
|
|
214
214
|
props: {
|
|
215
215
|
items: { default: () => [] },
|
|
@@ -220,82 +220,82 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
220
220
|
getFileUrl: { type: Function, default: void 0 }
|
|
221
221
|
},
|
|
222
222
|
emits: ["remove", "click", "download"],
|
|
223
|
-
setup(
|
|
224
|
-
const
|
|
223
|
+
setup(c, { emit: U }) {
|
|
224
|
+
const a = c, i = U, h = $(() => (a.items || []).map((r, u) => {
|
|
225
225
|
var _, y;
|
|
226
|
-
const
|
|
226
|
+
const o = $e(r), p = (_ = o.attachContent) == null ? void 0 : _.raw, b = ((y = o.attachContent) == null ? void 0 : y.fileId) || (p ? `${p.name}_${p.size}_${u}` : `${o.name}_${u}`);
|
|
227
227
|
return {
|
|
228
|
-
...
|
|
229
|
-
key:
|
|
228
|
+
...o,
|
|
229
|
+
key: b
|
|
230
230
|
};
|
|
231
|
-
})),
|
|
232
|
-
|
|
233
|
-
}, f = (
|
|
234
|
-
|
|
235
|
-
},
|
|
236
|
-
|
|
231
|
+
})), m = (d, r) => {
|
|
232
|
+
i("remove", d, r);
|
|
233
|
+
}, f = (d, r) => {
|
|
234
|
+
i("click", d, r);
|
|
235
|
+
}, l = (d, r) => {
|
|
236
|
+
i("download", d, r);
|
|
237
237
|
};
|
|
238
|
-
return (
|
|
239
|
-
(
|
|
240
|
-
key:
|
|
241
|
-
item:
|
|
242
|
-
removable:
|
|
243
|
-
downloadable:
|
|
244
|
-
clickable:
|
|
245
|
-
"base-u-r-l":
|
|
246
|
-
"get-file-url":
|
|
247
|
-
onClick: (p) => f(
|
|
248
|
-
onRemove: (p) =>
|
|
249
|
-
onDownload: (p) =>
|
|
238
|
+
return (d, r) => h.value.length > 0 ? (s(), n("div", Xe, [
|
|
239
|
+
(s(!0), n(x, null, N(h.value, (u, o) => (s(), V(Ye, {
|
|
240
|
+
key: u.key || o,
|
|
241
|
+
item: u,
|
|
242
|
+
removable: d.removable,
|
|
243
|
+
downloadable: d.downloadable,
|
|
244
|
+
clickable: d.clickable || !!d.$attrs.onClick,
|
|
245
|
+
"base-u-r-l": d.baseURL,
|
|
246
|
+
"get-file-url": d.getFileUrl,
|
|
247
|
+
onClick: (p) => f(u, o),
|
|
248
|
+
onRemove: (p) => m(o, u),
|
|
249
|
+
onDownload: (p) => l(u, o)
|
|
250
250
|
}, {
|
|
251
251
|
icon: C((p) => [
|
|
252
|
-
|
|
252
|
+
S(d.$slots, "icon", Z(G(p)), void 0, !0)
|
|
253
253
|
]),
|
|
254
254
|
title: C((p) => [
|
|
255
|
-
|
|
255
|
+
S(d.$slots, "title", Z(G(p)), void 0, !0)
|
|
256
256
|
]),
|
|
257
257
|
description: C((p) => [
|
|
258
|
-
|
|
258
|
+
S(d.$slots, "description", Z(G(p)), void 0, !0)
|
|
259
259
|
]),
|
|
260
260
|
actions: C((p) => [
|
|
261
|
-
|
|
261
|
+
S(d.$slots, "actions", Z(G(p)), void 0, !0)
|
|
262
262
|
]),
|
|
263
263
|
_: 2
|
|
264
264
|
}, 1032, ["item", "removable", "downloadable", "clickable", "base-u-r-l", "get-file-url", "onClick", "onRemove", "onDownload"]))), 128))
|
|
265
265
|
])) : g("", !0);
|
|
266
266
|
}
|
|
267
|
-
}), ne = /* @__PURE__ */
|
|
267
|
+
}), ne = /* @__PURE__ */ D(Ze, [["__scopeId", "data-v-ff76d134"]]), T = (c) => (q("data-v-e3cdddb7"), c = c(), K(), c), Ge = { class: "wi-web-inputbox" }, Je = {
|
|
268
268
|
key: 0,
|
|
269
269
|
class: "wi-web-inputbox__top-bar"
|
|
270
|
-
},
|
|
270
|
+
}, et = {
|
|
271
271
|
key: 0,
|
|
272
272
|
class: "wi-web-inputbox__agent-bar"
|
|
273
|
-
},
|
|
273
|
+
}, tt = { class: "wi-web-inputbox__agent-icon-wrapper" }, ot = ["src"], st = {
|
|
274
274
|
key: 1,
|
|
275
275
|
class: "wi-web-inputbox__agent-svg",
|
|
276
276
|
viewBox: "0 0 24 24",
|
|
277
277
|
fill: "none",
|
|
278
278
|
stroke: "currentColor",
|
|
279
279
|
"stroke-width": "2"
|
|
280
|
-
},
|
|
280
|
+
}, lt = /* @__PURE__ */ T(() => /* @__PURE__ */ e("circle", {
|
|
281
281
|
cx: "12",
|
|
282
282
|
cy: "8",
|
|
283
283
|
r: "4"
|
|
284
|
-
}, null, -1)), at = /* @__PURE__ */
|
|
285
|
-
|
|
284
|
+
}, null, -1)), at = /* @__PURE__ */ T(() => /* @__PURE__ */ e("path", { d: "M4 20c0-4 4-6 8-6s8 2 8 6" }, null, -1)), nt = [
|
|
285
|
+
lt,
|
|
286
286
|
at
|
|
287
|
-
],
|
|
287
|
+
], it = { class: "wi-web-inputbox__agent-title" }, rt = /* @__PURE__ */ T(() => /* @__PURE__ */ e("path", {
|
|
288
288
|
d: "M840.4 300H183.6c-19.7 0-30.7 22.7-18.5 37.1l328.4 388.7c9.5 11.2 27.5 11.2 37 0l328.4-388.7c12.2-14.4 1.2-37.1-18.5-37.1z",
|
|
289
289
|
fill: "currentColor"
|
|
290
|
-
}, null, -1)),
|
|
291
|
-
|
|
292
|
-
],
|
|
290
|
+
}, null, -1)), dt = [
|
|
291
|
+
rt
|
|
292
|
+
], ct = { class: "wi-web-agent-list" }, ut = /* @__PURE__ */ T(() => /* @__PURE__ */ e("div", { class: "wi-web-agent-list__header" }, "切换智能体", -1)), pt = {
|
|
293
293
|
key: 0,
|
|
294
294
|
class: "wi-web-agent-list__empty"
|
|
295
|
-
},
|
|
295
|
+
}, ht = ["onClick"], _t = { class: "wi-web-agent-item__left" }, vt = ["src"], wt = {
|
|
296
296
|
key: 1,
|
|
297
297
|
class: "wi-web-agent-item__avatar-fallback"
|
|
298
|
-
},
|
|
298
|
+
}, bt = /* @__PURE__ */ T(() => /* @__PURE__ */ e("svg", {
|
|
299
299
|
viewBox: "0 0 24 24",
|
|
300
300
|
fill: "none",
|
|
301
301
|
stroke: "currentColor",
|
|
@@ -308,29 +308,29 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
308
308
|
}),
|
|
309
309
|
/* @__PURE__ */ e("path", { d: "M4 20c0-4 4-6 8-6s8 2 8 6" })
|
|
310
310
|
], -1)), mt = [
|
|
311
|
-
|
|
312
|
-
],
|
|
311
|
+
bt
|
|
312
|
+
], ft = { class: "wi-web-agent-item__title" }, gt = {
|
|
313
313
|
key: 0,
|
|
314
314
|
class: "wi-web-agent-item__check"
|
|
315
|
-
},
|
|
315
|
+
}, yt = {
|
|
316
316
|
key: 1,
|
|
317
317
|
class: "wi-web-inputbox__options"
|
|
318
|
-
},
|
|
318
|
+
}, kt = { class: "wi-web-inputbox__main" }, $t = {
|
|
319
319
|
key: 0,
|
|
320
320
|
class: "wi-web-inputbox__attachments"
|
|
321
|
-
},
|
|
321
|
+
}, Ct = { class: "wi-web-inputbox__footer" }, Ut = { class: "wi-web-inputbox__footer-left" }, At = { class: "wi-web-inputbox__footer-right" }, Bt = {
|
|
322
322
|
key: 0,
|
|
323
323
|
class: "wi-web-inputbox__counter"
|
|
324
|
-
},
|
|
324
|
+
}, It = /* @__PURE__ */ T(() => /* @__PURE__ */ e("svg", {
|
|
325
325
|
viewBox: "0 0 1024 1024",
|
|
326
326
|
width: "16",
|
|
327
327
|
height: "16",
|
|
328
328
|
fill: "currentColor"
|
|
329
329
|
}, [
|
|
330
330
|
/* @__PURE__ */ e("path", { d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896z m0 85.333333a362.666667 362.666667 0 1 0 0 725.333334 362.666667 362.666667 0 0 0 0-725.333334z m120.746667 181.333334a42.666667 42.666667 0 0 1 54.826666 4.693333l5.546667 6.357334a42.666667 42.666667 0 0 1-4.693333 54.826666l-6.357334 5.546667-114.730666 114.773333 114.730666 114.730667a42.666667 42.666667 0 0 1 5.461334 54.826666l-5.461334 6.357334a42.666667 42.666667 0 0 1-54.826666 5.461333l-6.357334-5.461333-114.730666-114.730667-114.730667 114.730667a42.666667 42.666667 0 0 1-54.826667 5.461333l-6.357333-5.461333a42.666667 42.666667 0 0 1-5.461333-54.826667l5.461333-6.357333 114.730667-114.730667-114.730667-114.773333a42.666667 42.666667 0 0 1-5.461333-54.826667l5.461333-6.357333a42.666667 42.666667 0 0 1 54.826667-5.461334l6.357333 5.461334 114.730667 114.730666 114.730666-114.730666a42.666667 42.666667 0 0 1 24.32-11.434667z" })
|
|
331
|
-
], -1)),
|
|
332
|
-
|
|
333
|
-
], Rt = ["disabled"], St = /* @__PURE__ */
|
|
331
|
+
], -1)), Ft = [
|
|
332
|
+
It
|
|
333
|
+
], Rt = ["disabled"], St = /* @__PURE__ */ T(() => /* @__PURE__ */ e("svg", {
|
|
334
334
|
viewBox: "0 0 24 24",
|
|
335
335
|
width: "18",
|
|
336
336
|
height: "18",
|
|
@@ -339,9 +339,9 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
339
339
|
"stroke-width": "2"
|
|
340
340
|
}, [
|
|
341
341
|
/* @__PURE__ */ e("path", { d: "M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48" })
|
|
342
|
-
], -1)),
|
|
342
|
+
], -1)), Vt = [
|
|
343
343
|
St
|
|
344
|
-
],
|
|
344
|
+
], Lt = ["accept"], Tt = /* @__PURE__ */ T(() => /* @__PURE__ */ e("div", { class: "wi-web-inputbox__divider" }, null, -1)), Mt = /* @__PURE__ */ T(() => /* @__PURE__ */ e("svg", {
|
|
345
345
|
viewBox: "0 0 24 24",
|
|
346
346
|
width: "16",
|
|
347
347
|
height: "16",
|
|
@@ -354,18 +354,18 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
354
354
|
height: "12",
|
|
355
355
|
rx: "2"
|
|
356
356
|
})
|
|
357
|
-
], -1)),
|
|
358
|
-
|
|
359
|
-
],
|
|
357
|
+
], -1)), zt = [
|
|
358
|
+
Mt
|
|
359
|
+
], Pt = /* @__PURE__ */ T(() => /* @__PURE__ */ e("svg", {
|
|
360
360
|
viewBox: "0 0 24 24",
|
|
361
361
|
width: "18",
|
|
362
362
|
height: "18",
|
|
363
363
|
fill: "currentColor"
|
|
364
364
|
}, [
|
|
365
365
|
/* @__PURE__ */ e("path", { d: "M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" })
|
|
366
|
-
], -1)),
|
|
367
|
-
|
|
368
|
-
],
|
|
366
|
+
], -1)), Et = [
|
|
367
|
+
Pt
|
|
368
|
+
], xt = /* @__PURE__ */ O({
|
|
369
369
|
__name: "Inputbox",
|
|
370
370
|
props: {
|
|
371
371
|
modelValue: { default: "" },
|
|
@@ -387,140 +387,140 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
387
387
|
showIncPrevQuestion: { type: Boolean, default: !0 }
|
|
388
388
|
},
|
|
389
389
|
emits: ["update:modelValue", "submit", "stop", "selectAgent", "update:files", "update:attachments", "update:incPrevQuestion"],
|
|
390
|
-
setup(
|
|
391
|
-
const
|
|
392
|
-
h("selectAgent", t),
|
|
393
|
-
},
|
|
390
|
+
setup(c, { expose: U, emit: a }) {
|
|
391
|
+
const i = c, h = a, m = E(null), f = E(null), l = E(!1), d = (t) => Ue(t), r = E([]), u = $(() => !!!(i.modelValue && i.modelValue.trim())), o = (t) => t ? i.getFileUrl ? i.getFileUrl(t) : Ce(t, i.baseURL, "/algorithm/get_file_data") : "", p = (t) => {
|
|
392
|
+
h("selectAgent", t), l.value = !1;
|
|
393
|
+
}, b = (t) => {
|
|
394
394
|
h("update:incPrevQuestion", t ? "N" : "Y");
|
|
395
395
|
}, _ = () => {
|
|
396
396
|
h("update:modelValue", "");
|
|
397
397
|
}, y = () => {
|
|
398
398
|
f.value && (f.value.value = "", f.value.click());
|
|
399
|
-
},
|
|
399
|
+
}, B = (t) => {
|
|
400
400
|
const w = t.target;
|
|
401
401
|
if (w.files && w.files.length > 0) {
|
|
402
402
|
const v = Array.from(w.files);
|
|
403
403
|
for (const k of v)
|
|
404
|
-
|
|
405
|
-
var
|
|
406
|
-
const X = ((
|
|
404
|
+
r.value.some((H) => {
|
|
405
|
+
var se;
|
|
406
|
+
const X = ((se = H.attachContent) == null ? void 0 : se.raw) || H.raw;
|
|
407
407
|
return X && X.name === k.name && X.size === k.size && X.lastModified === k.lastModified;
|
|
408
|
-
}) ||
|
|
409
|
-
const
|
|
408
|
+
}) || r.value.push(d(k));
|
|
409
|
+
const R = r.value.map((k) => {
|
|
410
410
|
var P;
|
|
411
411
|
return ((P = k.attachContent) == null ? void 0 : P.raw) || k.raw;
|
|
412
412
|
}).filter(Boolean);
|
|
413
|
-
h("update:files",
|
|
413
|
+
h("update:files", R), h("update:attachments", [...r.value]);
|
|
414
414
|
}
|
|
415
415
|
}, M = (t) => {
|
|
416
416
|
var k;
|
|
417
|
-
const w =
|
|
417
|
+
const w = r.value.splice(t, 1)[0], v = ((k = w == null ? void 0 : w.attachContent) == null ? void 0 : k.url) || (w == null ? void 0 : w.url);
|
|
418
418
|
v && v.startsWith("blob:") && URL.revokeObjectURL(v);
|
|
419
|
-
const
|
|
419
|
+
const R = r.value.map((P) => {
|
|
420
420
|
var H;
|
|
421
421
|
return ((H = P.attachContent) == null ? void 0 : H.raw) || P.raw;
|
|
422
422
|
}).filter(Boolean);
|
|
423
|
-
h("update:files",
|
|
423
|
+
h("update:files", R), h("update:attachments", [...r.value]);
|
|
424
424
|
}, Q = () => {
|
|
425
|
-
|
|
425
|
+
r.value.forEach((t) => {
|
|
426
426
|
var v;
|
|
427
427
|
const w = ((v = t == null ? void 0 : t.attachContent) == null ? void 0 : v.url) || (t == null ? void 0 : t.url);
|
|
428
428
|
w && w.startsWith("blob:") && URL.revokeObjectURL(w);
|
|
429
|
-
}),
|
|
429
|
+
}), r.value = [], h("update:files", []), h("update:attachments", []);
|
|
430
430
|
}, Y = () => {
|
|
431
|
-
if (
|
|
431
|
+
if (i.disabled || u.value)
|
|
432
432
|
return;
|
|
433
|
-
const t =
|
|
433
|
+
const t = i.modelValue || "", w = r.value.map((R) => {
|
|
434
434
|
var k;
|
|
435
|
-
return ((k =
|
|
436
|
-
}).filter(Boolean), v = [...
|
|
437
|
-
h("submit", { text: t, files: w, attachments: v, agent:
|
|
438
|
-
},
|
|
435
|
+
return ((k = R.attachContent) == null ? void 0 : k.raw) || R.raw;
|
|
436
|
+
}).filter(Boolean), v = [...r.value];
|
|
437
|
+
h("submit", { text: t, files: w, attachments: v, agent: i.currentAgent }), r.value = [], h("update:files", []), h("update:attachments", []);
|
|
438
|
+
}, F = (t) => {
|
|
439
439
|
t.isComposing || t.keyCode === 229 || (t.preventDefault(), Y());
|
|
440
440
|
};
|
|
441
|
-
return
|
|
441
|
+
return pe(() => {
|
|
442
442
|
Q();
|
|
443
|
-
}),
|
|
443
|
+
}), U({
|
|
444
444
|
/** 手动清空所有附件 */
|
|
445
445
|
clearFiles: Q,
|
|
446
446
|
/** 获取当前附件原生 File 列表 */
|
|
447
|
-
getFiles: () =>
|
|
447
|
+
getFiles: () => r.value.map((t) => {
|
|
448
448
|
var w;
|
|
449
449
|
return ((w = t.attachContent) == null ? void 0 : w.raw) || t.raw;
|
|
450
450
|
}).filter(Boolean),
|
|
451
451
|
/** 获取当前附件标准化对象列表 */
|
|
452
|
-
getAttachments: () =>
|
|
452
|
+
getAttachments: () => r.value,
|
|
453
453
|
/** 聚焦输入框 */
|
|
454
454
|
focus: () => {
|
|
455
455
|
var t;
|
|
456
|
-
(t =
|
|
456
|
+
(t = m.value) == null || t.focus();
|
|
457
457
|
}
|
|
458
|
-
}), (t, w) => (
|
|
459
|
-
t.showAgentBar || t.showIncPrevQuestion ? (
|
|
460
|
-
t.showAgentBar ? (
|
|
461
|
-
|
|
462
|
-
visible:
|
|
463
|
-
"onUpdate:visible": w[0] || (w[0] = (v) =>
|
|
458
|
+
}), (t, w) => (s(), n("div", Ge, [
|
|
459
|
+
t.showAgentBar || t.showIncPrevQuestion ? (s(), n("div", Je, [
|
|
460
|
+
t.showAgentBar ? (s(), n("div", et, [
|
|
461
|
+
L(I(me), {
|
|
462
|
+
visible: l.value,
|
|
463
|
+
"onUpdate:visible": w[0] || (w[0] = (v) => l.value = v),
|
|
464
464
|
placement: "top-start",
|
|
465
465
|
width: 260,
|
|
466
466
|
trigger: "click",
|
|
467
467
|
"popper-class": "wi-web-agent-popover"
|
|
468
468
|
}, {
|
|
469
469
|
reference: C(() => {
|
|
470
|
-
var v,
|
|
470
|
+
var v, R, k;
|
|
471
471
|
return [
|
|
472
472
|
e("div", {
|
|
473
473
|
class: z(["wi-web-inputbox__agent-btn", { "is-disabled": t.disabled || t.talking }])
|
|
474
474
|
}, [
|
|
475
|
-
e("div",
|
|
476
|
-
(v = t.currentAgent) != null && v.image_id &&
|
|
475
|
+
e("div", tt, [
|
|
476
|
+
(v = t.currentAgent) != null && v.image_id && o(t.currentAgent.image_id) ? (s(), n("img", {
|
|
477
477
|
key: 0,
|
|
478
|
-
src:
|
|
478
|
+
src: o(t.currentAgent.image_id),
|
|
479
479
|
class: "wi-web-inputbox__agent-avatar"
|
|
480
|
-
}, null, 8,
|
|
480
|
+
}, null, 8, ot)) : (s(), n("svg", st, nt))
|
|
481
481
|
]),
|
|
482
|
-
e("span",
|
|
483
|
-
(
|
|
484
|
-
class: z(["wi-web-inputbox__agent-arrow", { "is-active":
|
|
482
|
+
e("span", it, " @" + A(((R = t.currentAgent) == null ? void 0 : R.entry_title) || ((k = t.currentAgent) == null ? void 0 : k.entry_id) || t.defaultAgentTitle), 1),
|
|
483
|
+
(s(), n("svg", {
|
|
484
|
+
class: z(["wi-web-inputbox__agent-arrow", { "is-active": l.value }]),
|
|
485
485
|
viewBox: "0 0 1024 1024",
|
|
486
486
|
width: "12",
|
|
487
487
|
height: "12"
|
|
488
|
-
},
|
|
488
|
+
}, dt, 2))
|
|
489
489
|
], 2)
|
|
490
490
|
];
|
|
491
491
|
}),
|
|
492
492
|
default: C(() => [
|
|
493
|
-
e("div",
|
|
494
|
-
|
|
495
|
-
!t.agentList || t.agentList.length === 0 ? (
|
|
496
|
-
(
|
|
497
|
-
var
|
|
498
|
-
return
|
|
493
|
+
e("div", ct, [
|
|
494
|
+
ut,
|
|
495
|
+
!t.agentList || t.agentList.length === 0 ? (s(), n("div", pt, " 暂无可选智能体 ")) : g("", !0),
|
|
496
|
+
(s(!0), n(x, null, N(t.agentList, (v) => {
|
|
497
|
+
var R, k;
|
|
498
|
+
return s(), n("div", {
|
|
499
499
|
key: v.entry_id,
|
|
500
|
-
class: z(["wi-web-agent-item", { "is-active": v.entry_id === ((
|
|
500
|
+
class: z(["wi-web-agent-item", { "is-active": v.entry_id === ((R = t.currentAgent) == null ? void 0 : R.entry_id) }]),
|
|
501
501
|
onClick: (P) => p(v)
|
|
502
502
|
}, [
|
|
503
|
-
e("div",
|
|
504
|
-
v.image_id &&
|
|
503
|
+
e("div", _t, [
|
|
504
|
+
v.image_id && o(v.image_id) ? (s(), n("img", {
|
|
505
505
|
key: 0,
|
|
506
|
-
src:
|
|
506
|
+
src: o(v.image_id),
|
|
507
507
|
class: "wi-web-agent-item__avatar"
|
|
508
|
-
}, null, 8,
|
|
509
|
-
e("span",
|
|
508
|
+
}, null, 8, vt)) : (s(), n("div", wt, mt)),
|
|
509
|
+
e("span", ft, A(v.entry_title || v.entry_id), 1)
|
|
510
510
|
]),
|
|
511
|
-
v.entry_id === ((k = t.currentAgent) == null ? void 0 : k.entry_id) ? (
|
|
512
|
-
], 10,
|
|
511
|
+
v.entry_id === ((k = t.currentAgent) == null ? void 0 : k.entry_id) ? (s(), n("span", gt, "✓")) : g("", !0)
|
|
512
|
+
], 10, ht);
|
|
513
513
|
}), 128))
|
|
514
514
|
])
|
|
515
515
|
]),
|
|
516
516
|
_: 1
|
|
517
517
|
}, 8, ["visible"])
|
|
518
518
|
])) : g("", !0),
|
|
519
|
-
t.showIncPrevQuestion ? (
|
|
520
|
-
|
|
519
|
+
t.showIncPrevQuestion ? (s(), n("div", yt, [
|
|
520
|
+
L(I(fe), {
|
|
521
521
|
class: "wi-web-inputbox__ignore-prev",
|
|
522
522
|
"model-value": t.incPrevQuestion === "N",
|
|
523
|
-
"onUpdate:modelValue":
|
|
523
|
+
"onUpdate:modelValue": b
|
|
524
524
|
}, {
|
|
525
525
|
default: C(() => [
|
|
526
526
|
W(" 忽略之前对话 ")
|
|
@@ -529,19 +529,19 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
529
529
|
}, 8, ["model-value"])
|
|
530
530
|
])) : g("", !0)
|
|
531
531
|
])) : g("", !0),
|
|
532
|
-
e("div",
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
items:
|
|
532
|
+
e("div", kt, [
|
|
533
|
+
r.value.length > 0 ? (s(), n("div", $t, [
|
|
534
|
+
L(ne, {
|
|
535
|
+
items: r.value,
|
|
536
536
|
"base-u-r-l": t.baseURL,
|
|
537
537
|
"get-file-url": t.getFileUrl,
|
|
538
538
|
removable: "",
|
|
539
539
|
onRemove: M
|
|
540
540
|
}, null, 8, ["items", "base-u-r-l", "get-file-url"])
|
|
541
541
|
])) : g("", !0),
|
|
542
|
-
|
|
542
|
+
L(I(ge), {
|
|
543
543
|
ref_key: "textareaRef",
|
|
544
|
-
ref:
|
|
544
|
+
ref: m,
|
|
545
545
|
"model-value": t.modelValue,
|
|
546
546
|
type: "textarea",
|
|
547
547
|
resize: "none",
|
|
@@ -551,15 +551,15 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
551
551
|
disabled: t.disabled || t.talking,
|
|
552
552
|
class: "wi-web-inputbox__textarea",
|
|
553
553
|
"onUpdate:modelValue": w[1] || (w[1] = (v) => h("update:modelValue", v)),
|
|
554
|
-
onKeydown:
|
|
554
|
+
onKeydown: he(te(F, ["exact"]), ["enter"])
|
|
555
555
|
}, null, 8, ["model-value", "maxlength", "autosize", "placeholder", "disabled", "onKeydown"]),
|
|
556
|
-
e("div",
|
|
557
|
-
e("div",
|
|
558
|
-
|
|
556
|
+
e("div", Ct, [
|
|
557
|
+
e("div", Ut, [
|
|
558
|
+
S(t.$slots, "footer-left", {}, void 0, !0)
|
|
559
559
|
]),
|
|
560
560
|
e("div", At, [
|
|
561
|
-
t.showWordLimit ? (
|
|
562
|
-
t.modelValue && !t.disabled && !t.talking ? (
|
|
561
|
+
t.showWordLimit ? (s(), n("div", Bt, A((t.modelValue || "").length) + "/" + A(t.maxlength), 1)) : g("", !0),
|
|
562
|
+
t.modelValue && !t.disabled && !t.talking ? (s(), V(I(ee), {
|
|
563
563
|
key: 1,
|
|
564
564
|
content: "清除",
|
|
565
565
|
placement: "top"
|
|
@@ -569,11 +569,11 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
569
569
|
type: "button",
|
|
570
570
|
class: "wi-web-inputbox__icon-btn",
|
|
571
571
|
onClick: _
|
|
572
|
-
},
|
|
572
|
+
}, Ft)
|
|
573
573
|
]),
|
|
574
574
|
_: 1
|
|
575
575
|
})) : g("", !0),
|
|
576
|
-
t.showUpload ? (
|
|
576
|
+
t.showUpload ? (s(), V(I(ee), {
|
|
577
577
|
key: 2,
|
|
578
578
|
content: "上传附件",
|
|
579
579
|
placement: "top"
|
|
@@ -584,7 +584,7 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
584
584
|
class: "wi-web-inputbox__icon-btn",
|
|
585
585
|
disabled: t.disabled || t.talking,
|
|
586
586
|
onClick: y
|
|
587
|
-
},
|
|
587
|
+
}, Vt, 8, Rt)
|
|
588
588
|
]),
|
|
589
589
|
_: 1
|
|
590
590
|
})) : g("", !0),
|
|
@@ -595,10 +595,10 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
595
595
|
multiple: "",
|
|
596
596
|
accept: t.accept,
|
|
597
597
|
class: "wi-web-inputbox__hidden-file",
|
|
598
|
-
onChange:
|
|
599
|
-
}, null, 40,
|
|
598
|
+
onChange: B
|
|
599
|
+
}, null, 40, Lt),
|
|
600
600
|
Tt,
|
|
601
|
-
t.talking ? (
|
|
601
|
+
t.talking ? (s(), V(I(ee), {
|
|
602
602
|
key: 3,
|
|
603
603
|
content: "停止生成",
|
|
604
604
|
placement: "top"
|
|
@@ -607,19 +607,19 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
607
607
|
e("div", {
|
|
608
608
|
class: "wi-web-inputbox__action-btn wi-web-inputbox__action-btn--stop",
|
|
609
609
|
onClick: w[2] || (w[2] = (v) => h("stop"))
|
|
610
|
-
},
|
|
610
|
+
}, zt)
|
|
611
611
|
]),
|
|
612
612
|
_: 1
|
|
613
|
-
})) : (
|
|
613
|
+
})) : (s(), V(I(ee), {
|
|
614
614
|
key: 4,
|
|
615
615
|
content: "发送",
|
|
616
616
|
placement: "top"
|
|
617
617
|
}, {
|
|
618
618
|
default: C(() => [
|
|
619
619
|
e("div", {
|
|
620
|
-
class: z(["wi-web-inputbox__action-btn wi-web-inputbox__action-btn--send", { "is-disabled": t.disabled || !t.talking &&
|
|
620
|
+
class: z(["wi-web-inputbox__action-btn wi-web-inputbox__action-btn--send", { "is-disabled": t.disabled || !t.talking && u.value }]),
|
|
621
621
|
onClick: Y
|
|
622
|
-
},
|
|
622
|
+
}, Et, 2)
|
|
623
623
|
]),
|
|
624
624
|
_: 1
|
|
625
625
|
}))
|
|
@@ -628,104 +628,115 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
628
628
|
])
|
|
629
629
|
]));
|
|
630
630
|
}
|
|
631
|
-
}),
|
|
632
|
-
{ id: "recordset", answerType: "recordset", component:
|
|
633
|
-
],
|
|
631
|
+
}), Ot = /* @__PURE__ */ D(xt, [["__scopeId", "data-v-e3cdddb7"]]), Dt = [
|
|
632
|
+
{ id: "recordset", answerType: "recordset", component: _e(() => Promise.resolve().then(() => ho)) }
|
|
633
|
+
], Qt = (c) => re([...Dt, ...c ?? []]), Nt = (c) => (q("data-v-bcad9562"), c = c(), K(), c), jt = {
|
|
634
634
|
key: 0,
|
|
635
635
|
class: "wi-web-chat-messages__loading"
|
|
636
|
-
},
|
|
636
|
+
}, Ht = {
|
|
637
637
|
key: 1,
|
|
638
638
|
class: "wi-web-chat-messages__empty"
|
|
639
|
-
},
|
|
639
|
+
}, Wt = /* @__PURE__ */ Nt(() => /* @__PURE__ */ e("div", { class: "wi-web-chat-messages__empty-logo" }, "WI", -1)), qt = { class: "wi-web-chat-messages__empty-title" }, Kt = { class: "wi-web-chat-messages__empty-description" }, Yt = {
|
|
640
640
|
key: 0,
|
|
641
641
|
class: "wi-web-chat-messages__user"
|
|
642
|
-
},
|
|
642
|
+
}, Xt = { class: "wi-web-chat-messages__user-wrapper" }, Zt = { class: "wi-web-chat-messages__user-bubble" }, Gt = {
|
|
643
643
|
key: 1,
|
|
644
644
|
class: "wi-web-chat-messages__assistant"
|
|
645
|
-
},
|
|
645
|
+
}, Jt = /* @__PURE__ */ O({
|
|
646
646
|
__name: "ChatMessagesView",
|
|
647
647
|
props: {
|
|
648
648
|
messages: {},
|
|
649
649
|
parsers: { default: () => [] },
|
|
650
650
|
baseURL: { default: "" },
|
|
651
651
|
getFileUrl: { type: Function, default: void 0 },
|
|
652
|
+
outputFileConfig: {},
|
|
652
653
|
loading: { type: Boolean, default: !1 },
|
|
653
654
|
emptyTitle: { default: "输入问题,开始与 AI 对话" },
|
|
654
655
|
emptyDescription: { default: "回答内容由共享渲染层统一分发" }
|
|
655
656
|
},
|
|
656
657
|
emits: ["loadOlder", "updateThinkingExpanded"],
|
|
657
|
-
setup(
|
|
658
|
-
const
|
|
659
|
-
|
|
660
|
-
|
|
658
|
+
setup(c, { expose: U, emit: a }) {
|
|
659
|
+
const i = c, h = a;
|
|
660
|
+
de(
|
|
661
|
+
i.outputFileConfig ?? {
|
|
662
|
+
getFileUrl: (o) => {
|
|
663
|
+
var p;
|
|
664
|
+
return ((p = i.getFileUrl) == null ? void 0 : p.call(i, o)) ?? (i.baseURL ? `${i.baseURL.replace(/\/$/, "")}/algorithm/get_file_data?file_id=${encodeURIComponent(o)}` : "");
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
);
|
|
668
|
+
const m = E(), { showScrollToBottom: f, forceScrollToBottom: l, requestScrollToBottom: d, onReachTop: r } = Be(m), u = $(() => Qt(i.parsers));
|
|
669
|
+
return ae(
|
|
670
|
+
() => i.messages[i.messages.length - 1],
|
|
661
671
|
() => {
|
|
662
|
-
|
|
672
|
+
d();
|
|
663
673
|
},
|
|
664
674
|
{ deep: !0 }
|
|
665
|
-
),
|
|
675
|
+
), r(() => h("loadOlder")), U({
|
|
666
676
|
/** 强制滚动到底部 */
|
|
667
|
-
forceScrollToBottom:
|
|
677
|
+
forceScrollToBottom: l,
|
|
668
678
|
/** 自动滚动开启时请求滚动到底部 */
|
|
669
|
-
requestScrollToBottom:
|
|
670
|
-
}), (
|
|
679
|
+
requestScrollToBottom: d
|
|
680
|
+
}), (o, p) => (s(), n("div", {
|
|
671
681
|
ref_key: "scrollEl",
|
|
672
|
-
ref:
|
|
682
|
+
ref: m,
|
|
673
683
|
class: "wi-web-chat-messages"
|
|
674
684
|
}, [
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
e("div",
|
|
678
|
-
e("div",
|
|
685
|
+
o.loading ? (s(), n("div", jt, "历史加载中...")) : o.messages.length === 0 ? (s(), n("div", Ht, [
|
|
686
|
+
Wt,
|
|
687
|
+
e("div", qt, A(o.emptyTitle), 1),
|
|
688
|
+
e("div", Kt, A(o.emptyDescription), 1)
|
|
679
689
|
])) : g("", !0),
|
|
680
|
-
(
|
|
681
|
-
key:
|
|
690
|
+
(s(!0), n(x, null, N(o.messages, (b) => (s(), n(x, {
|
|
691
|
+
key: b.id
|
|
682
692
|
}, [
|
|
683
|
-
|
|
684
|
-
e("div",
|
|
685
|
-
|
|
693
|
+
b.role === "user" ? (s(), n("div", Yt, [
|
|
694
|
+
e("div", Xt, [
|
|
695
|
+
b.attachments && b.attachments.length > 0 ? (s(), V(ne, {
|
|
686
696
|
key: 0,
|
|
687
697
|
class: "wi-web-chat-messages__attachments",
|
|
688
|
-
items:
|
|
689
|
-
"base-u-r-l":
|
|
690
|
-
"get-file-url":
|
|
698
|
+
items: b.attachments,
|
|
699
|
+
"base-u-r-l": o.baseURL,
|
|
700
|
+
"get-file-url": o.getFileUrl
|
|
691
701
|
}, null, 8, ["items", "base-u-r-l", "get-file-url"])) : g("", !0),
|
|
692
|
-
e("div",
|
|
702
|
+
e("div", Zt, A(b.content), 1)
|
|
693
703
|
])
|
|
694
|
-
])) : (
|
|
695
|
-
|
|
696
|
-
steps:
|
|
697
|
-
expanded:
|
|
698
|
-
"onUpdate:expanded": (_) => h("updateThinkingExpanded",
|
|
704
|
+
])) : (s(), n("div", Gt, [
|
|
705
|
+
L(I(ce), {
|
|
706
|
+
steps: b.thinking.steps,
|
|
707
|
+
expanded: b.thinking.expanded,
|
|
708
|
+
"onUpdate:expanded": (_) => h("updateThinkingExpanded", b, _)
|
|
699
709
|
}, null, 8, ["steps", "expanded", "onUpdate:expanded"]),
|
|
700
|
-
|
|
701
|
-
answer:
|
|
702
|
-
error:
|
|
703
|
-
stopped:
|
|
704
|
-
"content-map":
|
|
710
|
+
L(I(ue), {
|
|
711
|
+
answer: b.answer,
|
|
712
|
+
error: b.error,
|
|
713
|
+
stopped: b.stopped,
|
|
714
|
+
"content-map": u.value
|
|
705
715
|
}, null, 8, ["answer", "error", "stopped", "content-map"])
|
|
706
716
|
]))
|
|
707
717
|
], 64))), 128)),
|
|
708
|
-
|
|
718
|
+
L(ve, { name: "wi-web-chat-messages-fade" }, {
|
|
709
719
|
default: C(() => [
|
|
710
|
-
I(f) ? (
|
|
720
|
+
I(f) ? (s(), n("button", {
|
|
711
721
|
key: 0,
|
|
712
722
|
type: "button",
|
|
713
723
|
class: "wi-web-chat-messages__bottom",
|
|
714
724
|
onClick: p[0] || (p[0] = //@ts-ignore
|
|
715
|
-
(...
|
|
725
|
+
(...b) => I(l) && I(l)(...b))
|
|
716
726
|
}, " 回到底部 ")) : g("", !0)
|
|
717
727
|
]),
|
|
718
728
|
_: 1
|
|
719
729
|
})
|
|
720
730
|
], 512));
|
|
721
731
|
}
|
|
722
|
-
}),
|
|
732
|
+
}), eo = /* @__PURE__ */ D(Jt, [["__scopeId", "data-v-bcad9562"]]), to = { class: "wi-web-chat-container" }, oo = { class: "wi-web-chat-container__footer" }, so = /* @__PURE__ */ O({
|
|
723
733
|
__name: "ChatContainer",
|
|
724
734
|
props: {
|
|
725
735
|
messages: {},
|
|
726
736
|
parsers: { default: () => [] },
|
|
727
737
|
baseURL: { default: "" },
|
|
728
738
|
getFileUrl: { type: Function, default: void 0 },
|
|
739
|
+
outputFileConfig: {},
|
|
729
740
|
loading: { type: Boolean, default: !1 },
|
|
730
741
|
talking: { type: Boolean, default: !1 },
|
|
731
742
|
session: { default: "" },
|
|
@@ -740,53 +751,54 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
740
751
|
disabled: { type: Boolean, default: !1 }
|
|
741
752
|
},
|
|
742
753
|
emits: ["update:question", "update:incPrevQuestion", "submit", "stop", "selectAgent", "loadOlder", "updateThinkingExpanded"],
|
|
743
|
-
setup(
|
|
744
|
-
const
|
|
745
|
-
|
|
746
|
-
},
|
|
747
|
-
|
|
748
|
-
}, f = (
|
|
749
|
-
|
|
754
|
+
setup(c, { emit: U }) {
|
|
755
|
+
const a = c, i = U, h = (l) => {
|
|
756
|
+
i("submit", l);
|
|
757
|
+
}, m = () => {
|
|
758
|
+
a.hasMore && i("loadOlder");
|
|
759
|
+
}, f = (l) => {
|
|
760
|
+
i("selectAgent", l);
|
|
750
761
|
};
|
|
751
|
-
return (
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
messages:
|
|
755
|
-
parsers:
|
|
756
|
-
"base-u-r-l":
|
|
757
|
-
"get-file-url":
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
"empty-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
762
|
+
return (l, d) => (s(), n("section", to, [
|
|
763
|
+
S(l.$slots, "messages", {}, () => [
|
|
764
|
+
L(eo, {
|
|
765
|
+
messages: l.messages,
|
|
766
|
+
parsers: l.parsers,
|
|
767
|
+
"base-u-r-l": l.baseURL,
|
|
768
|
+
"get-file-url": l.getFileUrl,
|
|
769
|
+
"output-file-config": l.outputFileConfig,
|
|
770
|
+
loading: l.loading,
|
|
771
|
+
"empty-title": l.emptyTitle,
|
|
772
|
+
"empty-description": l.emptyDescription,
|
|
773
|
+
onLoadOlder: m,
|
|
774
|
+
onUpdateThinkingExpanded: d[0] || (d[0] = (r, u) => i("updateThinkingExpanded", r, u))
|
|
775
|
+
}, null, 8, ["messages", "parsers", "base-u-r-l", "get-file-url", "output-file-config", "loading", "empty-title", "empty-description"])
|
|
764
776
|
], !0),
|
|
765
|
-
|
|
766
|
-
e("footer",
|
|
767
|
-
|
|
768
|
-
"model-value":
|
|
769
|
-
"onUpdate:modelValue":
|
|
770
|
-
"inc-prev-question":
|
|
771
|
-
"onUpdate:incPrevQuestion":
|
|
772
|
-
"base-u-r-l":
|
|
773
|
-
disabled:
|
|
774
|
-
talking:
|
|
775
|
-
"agent-list":
|
|
776
|
-
"current-agent":
|
|
777
|
-
placeholder:
|
|
778
|
-
"get-file-url":
|
|
777
|
+
S(l.$slots, "above-input", {}, void 0, !0),
|
|
778
|
+
e("footer", oo, [
|
|
779
|
+
L(Ot, {
|
|
780
|
+
"model-value": l.question,
|
|
781
|
+
"onUpdate:modelValue": d[1] || (d[1] = (r) => i("update:question", r)),
|
|
782
|
+
"inc-prev-question": l.incPrevQuestion,
|
|
783
|
+
"onUpdate:incPrevQuestion": d[2] || (d[2] = (r) => i("update:incPrevQuestion", r)),
|
|
784
|
+
"base-u-r-l": l.baseURL,
|
|
785
|
+
disabled: l.disabled || !l.session,
|
|
786
|
+
talking: l.talking,
|
|
787
|
+
"agent-list": l.agentList,
|
|
788
|
+
"current-agent": l.currentAgent,
|
|
789
|
+
placeholder: l.placeholder,
|
|
790
|
+
"get-file-url": l.getFileUrl,
|
|
779
791
|
onSelectAgent: f,
|
|
780
792
|
onSubmit: h,
|
|
781
|
-
onStop:
|
|
793
|
+
onStop: d[3] || (d[3] = (r) => i("stop"))
|
|
782
794
|
}, null, 8, ["model-value", "inc-prev-question", "base-u-r-l", "disabled", "talking", "agent-list", "current-agent", "placeholder", "get-file-url"])
|
|
783
795
|
])
|
|
784
796
|
]));
|
|
785
797
|
}
|
|
786
|
-
}),
|
|
798
|
+
}), Mo = /* @__PURE__ */ D(so, [["__scopeId", "data-v-8663b501"]]), ie = (c) => (q("data-v-96941d57"), c = c(), K(), c), lo = {
|
|
787
799
|
key: 0,
|
|
788
800
|
class: "wi-web-recordset"
|
|
789
|
-
},
|
|
801
|
+
}, ao = { class: "wi-web-recordset__header" }, no = { class: "wi-web-recordset__title" }, io = /* @__PURE__ */ ie(() => /* @__PURE__ */ e("button", {
|
|
790
802
|
type: "button",
|
|
791
803
|
class: "wi-web-recordset__columns-btn",
|
|
792
804
|
title: "选择展示列"
|
|
@@ -808,67 +820,67 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
808
820
|
/* @__PURE__ */ e("path", { d: "M9 4v16M15 4v16" })
|
|
809
821
|
]),
|
|
810
822
|
/* @__PURE__ */ e("span", null, "列")
|
|
811
|
-
], -1)),
|
|
823
|
+
], -1)), ro = { class: "wi-web-recordset__columns-panel" }, co = /* @__PURE__ */ ie(() => /* @__PURE__ */ e("div", { class: "wi-web-recordset__columns-panel-title" }, "选择展示列", -1)), uo = /* @__PURE__ */ O({
|
|
812
824
|
__name: "RecordsetTable",
|
|
813
825
|
props: {
|
|
814
826
|
report: {},
|
|
815
827
|
maxHeight: { default: 420 }
|
|
816
828
|
},
|
|
817
|
-
setup(
|
|
818
|
-
const
|
|
829
|
+
setup(c) {
|
|
830
|
+
const U = c, a = $(() => {
|
|
819
831
|
var _;
|
|
820
|
-
return ((_ =
|
|
821
|
-
}),
|
|
822
|
-
key: `c${
|
|
823
|
-
title: (y == null ? void 0 : y.title) || (y == null ? void 0 : y.name) || `列${
|
|
832
|
+
return ((_ = U.report) == null ? void 0 : _.values) ?? {};
|
|
833
|
+
}), i = $(() => a.value.chart === "table"), h = $(() => a.value.title ?? ""), m = $(() => (Array.isArray(a.value.cols) ? a.value.cols : []).map((y, B) => ({
|
|
834
|
+
key: `c${B}`,
|
|
835
|
+
title: (y == null ? void 0 : y.title) || (y == null ? void 0 : y.name) || `列${B + 1}`
|
|
824
836
|
}))), f = $(() => {
|
|
825
|
-
const _ = Number(
|
|
837
|
+
const _ = Number(a.value.max_cols);
|
|
826
838
|
return Number.isFinite(_) && _ > 0 ? _ : 1 / 0;
|
|
827
|
-
}),
|
|
828
|
-
|
|
829
|
-
() =>
|
|
839
|
+
}), l = $(() => m.value.length > f.value), d = E([]), r = $(() => new Set(d.value)), u = $(() => m.value.filter((_) => r.value.has(_.key)));
|
|
840
|
+
ae(
|
|
841
|
+
() => m.value.map((_) => _.key).join("|"),
|
|
830
842
|
() => {
|
|
831
|
-
|
|
843
|
+
d.value = m.value.slice(0, f.value).map((_) => _.key);
|
|
832
844
|
},
|
|
833
845
|
{ immediate: !0 }
|
|
834
846
|
);
|
|
835
|
-
const
|
|
836
|
-
const
|
|
837
|
-
return
|
|
838
|
-
|
|
839
|
-
}),
|
|
840
|
-
})), p = E(!1),
|
|
841
|
-
const
|
|
842
|
-
y ?
|
|
847
|
+
const o = $(() => (Array.isArray(a.value.values) ? a.value.values : []).map((y) => {
|
|
848
|
+
const B = {};
|
|
849
|
+
return m.value.forEach((M, Q) => {
|
|
850
|
+
B[M.key] = Array.isArray(y) ? y[Q] : void 0;
|
|
851
|
+
}), B;
|
|
852
|
+
})), p = E(!1), b = (_, y) => {
|
|
853
|
+
const B = new Set(d.value);
|
|
854
|
+
y ? B.add(_) : B.delete(_), d.value = m.value.filter((M) => B.has(M.key)).map((M) => M.key);
|
|
843
855
|
};
|
|
844
856
|
return (_, y) => {
|
|
845
|
-
const
|
|
846
|
-
return
|
|
847
|
-
e("div",
|
|
848
|
-
e("div",
|
|
849
|
-
|
|
857
|
+
const B = J("el-checkbox"), M = J("el-popover"), Q = J("el-table-column"), Y = J("el-table");
|
|
858
|
+
return i.value ? (s(), n("div", lo, [
|
|
859
|
+
e("div", ao, [
|
|
860
|
+
e("div", no, A(h.value), 1),
|
|
861
|
+
l.value ? (s(), V(M, {
|
|
850
862
|
key: 0,
|
|
851
863
|
visible: p.value,
|
|
852
|
-
"onUpdate:visible": y[0] || (y[0] = (
|
|
864
|
+
"onUpdate:visible": y[0] || (y[0] = (F) => p.value = F),
|
|
853
865
|
placement: "bottom-end",
|
|
854
866
|
width: 220,
|
|
855
867
|
trigger: "click",
|
|
856
868
|
"popper-class": "wi-web-recordset-columns-popper"
|
|
857
869
|
}, {
|
|
858
870
|
reference: C(() => [
|
|
859
|
-
|
|
871
|
+
io
|
|
860
872
|
]),
|
|
861
873
|
default: C(() => [
|
|
862
|
-
e("div",
|
|
863
|
-
|
|
864
|
-
(
|
|
865
|
-
key:
|
|
874
|
+
e("div", ro, [
|
|
875
|
+
co,
|
|
876
|
+
(s(!0), n(x, null, N(m.value, (F) => (s(), V(B, {
|
|
877
|
+
key: F.key,
|
|
866
878
|
class: "wi-web-recordset__column-item",
|
|
867
|
-
"model-value":
|
|
868
|
-
"onUpdate:modelValue": (t) =>
|
|
879
|
+
"model-value": r.value.has(F.key),
|
|
880
|
+
"onUpdate:modelValue": (t) => b(F.key, !!t)
|
|
869
881
|
}, {
|
|
870
882
|
default: C(() => [
|
|
871
|
-
W(
|
|
883
|
+
W(A(F.title), 1)
|
|
872
884
|
]),
|
|
873
885
|
_: 2
|
|
874
886
|
}, 1032, ["model-value", "onUpdate:modelValue"]))), 128))
|
|
@@ -877,18 +889,18 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
877
889
|
_: 1
|
|
878
890
|
}, 8, ["visible"])) : g("", !0)
|
|
879
891
|
]),
|
|
880
|
-
|
|
881
|
-
data:
|
|
892
|
+
L(Y, {
|
|
893
|
+
data: o.value,
|
|
882
894
|
border: "",
|
|
883
895
|
size: "small",
|
|
884
896
|
class: "wi-web-recordset__table",
|
|
885
897
|
"max-height": _.maxHeight
|
|
886
898
|
}, {
|
|
887
899
|
default: C(() => [
|
|
888
|
-
(
|
|
889
|
-
key:
|
|
890
|
-
prop:
|
|
891
|
-
label:
|
|
900
|
+
(s(!0), n(x, null, N(u.value, (F) => (s(), V(Q, {
|
|
901
|
+
key: F.key,
|
|
902
|
+
prop: F.key,
|
|
903
|
+
label: F.title,
|
|
892
904
|
"min-width": "120",
|
|
893
905
|
"show-overflow-tooltip": ""
|
|
894
906
|
}, null, 8, ["prop", "label"]))), 128))
|
|
@@ -898,10 +910,10 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
898
910
|
])) : g("", !0);
|
|
899
911
|
};
|
|
900
912
|
}
|
|
901
|
-
}),
|
|
913
|
+
}), po = /* @__PURE__ */ D(uo, [["__scopeId", "data-v-96941d57"]]), ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
902
914
|
__proto__: null,
|
|
903
|
-
default:
|
|
904
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
915
|
+
default: po
|
|
916
|
+
}, Symbol.toStringTag, { value: "Module" })), oe = (c) => (q("data-v-94659445"), c = c(), K(), c), _o = { class: "wi-web-env-switch__track" }, vo = { class: "wi-web-env-switch__items" }, wo = ["disabled", "onClick"], bo = { class: "wi-web-env-switch__icon" }, mo = {
|
|
905
917
|
key: 0,
|
|
906
918
|
viewBox: "0 0 24 24",
|
|
907
919
|
fill: "none",
|
|
@@ -909,32 +921,32 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
909
921
|
"stroke-width": "1.8",
|
|
910
922
|
"stroke-linecap": "round",
|
|
911
923
|
"stroke-linejoin": "round"
|
|
912
|
-
},
|
|
913
|
-
|
|
914
|
-
],
|
|
924
|
+
}, fo = /* @__PURE__ */ oe(() => /* @__PURE__ */ e("path", { d: "M17.5 19a4.5 4.5 0 0 0 .6-8.96 6 6 0 0 0-11.63 1.4A3.8 3.8 0 0 0 7 19z" }, null, -1)), go = [
|
|
925
|
+
fo
|
|
926
|
+
], yo = {
|
|
915
927
|
key: 1,
|
|
916
928
|
viewBox: "0 0 24 24",
|
|
917
929
|
fill: "none",
|
|
918
930
|
stroke: "currentColor",
|
|
919
931
|
"stroke-width": "1.8",
|
|
920
932
|
"stroke-linecap": "round"
|
|
921
|
-
},
|
|
933
|
+
}, ko = /* @__PURE__ */ oe(() => /* @__PURE__ */ e("rect", {
|
|
922
934
|
x: "2.5",
|
|
923
935
|
y: "4",
|
|
924
936
|
width: "19",
|
|
925
937
|
height: "12",
|
|
926
938
|
rx: "2",
|
|
927
939
|
"stroke-linejoin": "round"
|
|
928
|
-
}, null, -1)),
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
],
|
|
940
|
+
}, null, -1)), $o = /* @__PURE__ */ oe(() => /* @__PURE__ */ e("path", { d: "M8.5 20h7M12 16v4" }, null, -1)), Co = [
|
|
941
|
+
ko,
|
|
942
|
+
$o
|
|
943
|
+
], Uo = { class: "wi-web-env-switch__label" }, Ao = {
|
|
932
944
|
key: 0,
|
|
933
945
|
class: "wi-web-env-switch__hint"
|
|
934
|
-
},
|
|
946
|
+
}, Bo = { class: "wi-web-env-switch__hint-text" }, Io = {
|
|
935
947
|
key: 0,
|
|
936
948
|
class: "wi-web-env-switch__hint-status"
|
|
937
|
-
},
|
|
949
|
+
}, Fo = /* @__PURE__ */ O({
|
|
938
950
|
__name: "EnvSwitch",
|
|
939
951
|
props: {
|
|
940
952
|
modelValue: { default: "local" },
|
|
@@ -944,8 +956,8 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
944
956
|
showHint: { type: Boolean, default: !0 }
|
|
945
957
|
},
|
|
946
958
|
emits: ["update:modelValue", "change"],
|
|
947
|
-
setup(
|
|
948
|
-
const
|
|
959
|
+
setup(c, { emit: U }) {
|
|
960
|
+
const a = c, i = U, h = [
|
|
949
961
|
{
|
|
950
962
|
value: "local",
|
|
951
963
|
label: "本地电脑",
|
|
@@ -960,75 +972,77 @@ const j = (d) => (q("data-v-dc2d5f2b"), d = d(), K(), d), Ue = { class: "wi-web-
|
|
|
960
972
|
status: "未连接",
|
|
961
973
|
online: !1
|
|
962
974
|
}
|
|
963
|
-
],
|
|
964
|
-
const
|
|
965
|
-
return
|
|
966
|
-
}),
|
|
967
|
-
if (!
|
|
975
|
+
], m = { default: 3, small: 2 }, f = $(() => {
|
|
976
|
+
const u = a.options ?? [];
|
|
977
|
+
return u.length > 0 ? u : h;
|
|
978
|
+
}), l = $(() => {
|
|
979
|
+
if (!a.showHint)
|
|
968
980
|
return null;
|
|
969
|
-
const
|
|
970
|
-
return
|
|
971
|
-
}),
|
|
972
|
-
const
|
|
981
|
+
const u = f.value;
|
|
982
|
+
return u.find((o) => o.value === a.modelValue) ?? u[0] ?? null;
|
|
983
|
+
}), d = $(() => {
|
|
984
|
+
const u = f.value, o = u.length || 1, p = Math.max(u.findIndex((_) => _.value === a.modelValue), 0), b = m[a.size] ?? m.default;
|
|
973
985
|
return {
|
|
974
|
-
width: `calc(${100 /
|
|
986
|
+
width: `calc(${100 / o}% - ${2 * b / o}px)`,
|
|
975
987
|
transform: `translateX(${p * 100}%)`
|
|
976
988
|
};
|
|
977
|
-
}),
|
|
978
|
-
|
|
989
|
+
}), r = (u) => {
|
|
990
|
+
a.disabled || u.disabled || u.value !== a.modelValue && (i("update:modelValue", u.value), i("change", u));
|
|
979
991
|
};
|
|
980
|
-
return (
|
|
981
|
-
class: z(["wi-web-env-switch", [`is-${
|
|
992
|
+
return (u, o) => (s(), n("div", {
|
|
993
|
+
class: z(["wi-web-env-switch", [`is-${u.size}`, { "is-disabled": u.disabled }]])
|
|
982
994
|
}, [
|
|
983
|
-
e("div",
|
|
995
|
+
e("div", _o, [
|
|
984
996
|
e("span", {
|
|
985
997
|
class: "wi-web-env-switch__thumb",
|
|
986
|
-
style:
|
|
998
|
+
style: we(d.value)
|
|
987
999
|
}, null, 4),
|
|
988
|
-
e("div",
|
|
989
|
-
(
|
|
1000
|
+
e("div", vo, [
|
|
1001
|
+
(s(!0), n(x, null, N(f.value, (p) => (s(), n("button", {
|
|
990
1002
|
key: p.value,
|
|
991
1003
|
type: "button",
|
|
992
|
-
class: z(["wi-web-env-switch__item", { "is-active": p.value ===
|
|
993
|
-
disabled:
|
|
994
|
-
onClick: (
|
|
1004
|
+
class: z(["wi-web-env-switch__item", { "is-active": p.value === u.modelValue, "is-disabled": p.disabled }]),
|
|
1005
|
+
disabled: u.disabled || p.disabled,
|
|
1006
|
+
onClick: (b) => r(p)
|
|
995
1007
|
}, [
|
|
996
|
-
e("span",
|
|
997
|
-
p.value === "cloud" ? (
|
|
1008
|
+
e("span", bo, [
|
|
1009
|
+
p.value === "cloud" ? (s(), n("svg", mo, go)) : (s(), n("svg", yo, Co))
|
|
998
1010
|
]),
|
|
999
|
-
e("span",
|
|
1000
|
-
], 10,
|
|
1011
|
+
e("span", Uo, A(p.label), 1)
|
|
1012
|
+
], 10, wo))), 128))
|
|
1001
1013
|
])
|
|
1002
1014
|
]),
|
|
1003
|
-
|
|
1004
|
-
e("span",
|
|
1005
|
-
|
|
1015
|
+
l.value ? (s(), n("div", Ao, [
|
|
1016
|
+
e("span", Bo, A(l.value.description), 1),
|
|
1017
|
+
l.value.status ? (s(), n("span", Io, [
|
|
1006
1018
|
e("i", {
|
|
1007
|
-
class: z(["wi-web-env-switch__dot", { "is-online":
|
|
1019
|
+
class: z(["wi-web-env-switch__dot", { "is-online": l.value.online }])
|
|
1008
1020
|
}, null, 2),
|
|
1009
|
-
W(" " +
|
|
1021
|
+
W(" " + A(l.value.status), 1)
|
|
1010
1022
|
])) : g("", !0)
|
|
1011
1023
|
])) : g("", !0)
|
|
1012
1024
|
], 2));
|
|
1013
1025
|
}
|
|
1014
|
-
}),
|
|
1026
|
+
}), zo = /* @__PURE__ */ D(Fo, [["__scopeId", "data-v-94659445"]]);
|
|
1015
1027
|
export {
|
|
1016
|
-
|
|
1017
|
-
|
|
1028
|
+
xo as AiAnswerBubble,
|
|
1029
|
+
Ye as AttachmentCard,
|
|
1018
1030
|
ne as AttachmentList,
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1031
|
+
Mo as ChatContainer,
|
|
1032
|
+
eo as ChatMessagesView,
|
|
1033
|
+
Oo as DeepThinkingSteps,
|
|
1034
|
+
zo as EnvSwitch,
|
|
1035
|
+
Do as IframePage,
|
|
1036
|
+
Ot as Inputbox,
|
|
1037
|
+
Qo as KnowledgeStreamResult,
|
|
1038
|
+
No as OutputFile,
|
|
1039
|
+
po as RecordsetTable,
|
|
1040
|
+
jo as createAnswerContentMap,
|
|
1041
|
+
Qt as createWebAnswerContentMap,
|
|
1042
|
+
Ho as injectIframeResizerChild,
|
|
1043
|
+
Wo as provideIframePageConfig,
|
|
1044
|
+
qo as provideOutputFileConfig,
|
|
1045
|
+
Ko as resolveIframePlaceholders,
|
|
1046
|
+
Yo as useIframePage
|
|
1033
1047
|
};
|
|
1034
1048
|
//# sourceMappingURL=index.js.map
|