@somecat/ai-assist-sdk 1.3.2 → 1.3.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.
@@ -1,9 +1,9 @@
1
- import { defineComponent as Se, ref as g, watch as ce, nextTick as me, onUnmounted as Pe, openBlock as v, createElementBlock as m, normalizeClass as se, createElementVNode as o, toDisplayString as G, createVNode as ie, Transition as yn, withCtx as wn, unref as P, createCommentVNode as q, computed as O, Fragment as ye, renderList as xe, reactive as ge, createStaticVNode as kn, withModifiers as fe, createBlock as pe, Teleport as Yt, onMounted as _e, onBeforeUnmount as Nt, withDirectives as Me, withKeys as ct, vModelText as Vt, normalizeStyle as it, vShow as Ve, createApp as Cn } from "vue";
1
+ import { defineComponent as Ee, ref as g, watch as ve, nextTick as me, onUnmounted as Pe, openBlock as v, createElementBlock as m, normalizeClass as se, createElementVNode as o, toDisplayString as z, createVNode as ie, Transition as yn, withCtx as wn, unref as O, createCommentVNode as J, computed as B, Fragment as we, renderList as xe, reactive as ye, createStaticVNode as kn, withModifiers as fe, createBlock as pe, Teleport as Yt, onMounted as be, onBeforeUnmount as Nt, withDirectives as Me, withKeys as ct, vModelText as Vt, normalizeStyle as it, vShow as Ve, createApp as Cn } from "vue";
2
2
  import { a as Xt, r as vt, p as dt, u as _n, V as Qe, c as Mt, g as bn, o as An, s as Sn, b as Rt, e as En, d as Tn, f as qe, h as xn, i as Dn, j as Mn, k as Rn, l as Hn, m as ht, w as $n, n as Ln, q as Pn, t as Ft } from "../chunks/index-5fjEwBkV.mjs";
3
3
  import { t as Ht, r as On, f as Bn, i as Wn, s as Yn, a as Nn, b as Vn, c as Te, d as Xn, e as Qt, g as Fn, h as Qn, m as Jn } from "../chunks/index-2loQl224.mjs";
4
4
  import { BulbOutlined as qn, SearchOutlined as $t, CheckOutlined as zn, CopyOutlined as Kn, RedoOutlined as Gn, CloseOutlined as jn } from "@ant-design/icons-vue";
5
- import { Icon as re } from "@iconify/vue";
6
- const Un = "data:image/png;base64,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", Zn = { class: "thinking-block__title" }, In = ["innerHTML"], eo = /* @__PURE__ */ Se({
5
+ import { Icon as ce } from "@iconify/vue";
6
+ const Un = "data:image/png;base64,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", Zn = { class: "thinking-block__title" }, In = ["innerHTML"], eo = /* @__PURE__ */ Ee({
7
7
  __name: "ThinkingBlock",
8
8
  props: {
9
9
  content: {},
@@ -13,10 +13,10 @@ const Un = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
13
13
  setup(t) {
14
14
  const w = t, i = g(!!w.isStreaming || !!w.messageDone);
15
15
  let u = 0;
16
- function l(d = 600) {
16
+ function l(p = 600) {
17
17
  clearTimeout(u), u = window.setTimeout(() => {
18
18
  u = 0, i.value = !1;
19
- }, d);
19
+ }, p);
20
20
  }
21
21
  function h() {
22
22
  u && (clearTimeout(u), u = 0);
@@ -24,41 +24,41 @@ const Un = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
24
24
  function s() {
25
25
  h(), i.value = !i.value;
26
26
  }
27
- ce(
27
+ ve(
28
28
  () => w.isStreaming,
29
- (d) => {
30
- d ? (h(), i.value = !0) : w.messageDone || l();
29
+ (p) => {
30
+ p ? (h(), i.value = !0) : w.messageDone || l();
31
31
  },
32
32
  { immediate: !0 }
33
- ), ce(
33
+ ), ve(
34
34
  () => w.messageDone,
35
- (d) => {
36
- d && (h(), i.value = !0);
35
+ (p) => {
36
+ p && (h(), i.value = !0);
37
37
  },
38
38
  { immediate: !0 }
39
39
  );
40
40
  const a = g(null);
41
41
  let r = !1;
42
42
  function f() {
43
- const d = a.value;
44
- if (!d) return;
45
- r = d.scrollHeight - d.scrollTop - d.clientHeight > 12;
43
+ const p = a.value;
44
+ if (!p) return;
45
+ r = p.scrollHeight - p.scrollTop - p.clientHeight > 12;
46
46
  }
47
47
  function k() {
48
- const d = a.value;
49
- !d || !i.value || r || (d.scrollTop = d.scrollHeight);
48
+ const p = a.value;
49
+ !p || !i.value || r || (p.scrollTop = p.scrollHeight);
50
50
  }
51
- function N() {
51
+ function V() {
52
52
  w.isStreaming && k();
53
53
  }
54
- return ce(
54
+ return ve(
55
55
  () => w.content,
56
56
  () => {
57
57
  w.isStreaming && me(k);
58
58
  }
59
59
  ), Pe(() => {
60
60
  h();
61
- }), (d, D) => (v(), m("div", {
61
+ }), (p, R) => (v(), m("div", {
62
62
  class: se(["thinking-block", {
63
63
  "thinking-block--expanded": i.value,
64
64
  "thinking-block--active": t.isStreaming
@@ -68,8 +68,8 @@ const Un = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
68
68
  class: "thinking-block__header",
69
69
  onClick: s
70
70
  }, [
71
- D[1] || (D[1] = o("span", { class: "thinking-block__indicator" }, null, -1)),
72
- o("span", Zn, G(t.isStreaming ? "深度思考中" : "深度思考"), 1),
71
+ R[1] || (R[1] = o("span", { class: "thinking-block__indicator" }, null, -1)),
72
+ o("span", Zn, z(t.isStreaming ? "深度思考中" : "深度思考"), 1),
73
73
  (v(), m("svg", {
74
74
  class: se(["thinking-block__arrow", { "thinking-block__arrow--down": i.value }]),
75
75
  viewBox: "0 0 24 24",
@@ -80,13 +80,13 @@ const Un = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
80
80
  "stroke-width": "2.5",
81
81
  "stroke-linecap": "round",
82
82
  "stroke-linejoin": "round"
83
- }, [...D[0] || (D[0] = [
83
+ }, [...R[0] || (R[0] = [
84
84
  o("polyline", { points: "6 9 12 15 18 9" }, null, -1)
85
85
  ])], 2))
86
86
  ]),
87
87
  ie(yn, {
88
88
  name: "thinking-expand",
89
- onAfterEnter: N
89
+ onAfterEnter: V
90
90
  }, {
91
91
  default: wn(() => [
92
92
  i.value ? (v(), m("div", {
@@ -98,9 +98,9 @@ const Un = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
98
98
  }, [
99
99
  o("div", {
100
100
  class: "thinking-block__markdown",
101
- innerHTML: P(Xt)(P(vt)(P(dt)(w.content)), t.isStreaming)
101
+ innerHTML: O(Xt)(O(vt)(O(dt)(w.content)), t.isStreaming)
102
102
  }, null, 8, In)
103
- ], 544)) : q("", !0)
103
+ ], 544)) : J("", !0)
104
104
  ]),
105
105
  _: 1
106
106
  })
@@ -144,13 +144,13 @@ const Un = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
144
144
  }, po = {
145
145
  key: 0,
146
146
  class: "step-item__content"
147
- }, mo = /* @__PURE__ */ Se({
147
+ }, mo = /* @__PURE__ */ Ee({
148
148
  __name: "StepBlock",
149
149
  props: {
150
150
  steps: {}
151
151
  },
152
152
  setup(t) {
153
- const w = t, i = O(() => w.steps.some((h) => h.state !== "done")), u = O(
153
+ const w = t, i = B(() => w.steps.some((h) => h.state !== "done")), u = B(
154
154
  () => w.steps.reduce((h, s) => h + (s.duration ?? 0), 0)
155
155
  );
156
156
  function l(h) {
@@ -162,11 +162,11 @@ const Un = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
162
162
  t.steps.length > 1 ? (v(), m("div", to, [
163
163
  s[0] || (s[0] = o("span", { class: "step-block__indicator" }, null, -1)),
164
164
  s[1] || (s[1] = o("span", { class: "step-block__title" }, "执行步骤", -1)),
165
- i.value ? q("", !0) : (v(), m("span", no, G(t.steps.length) + " 步", 1)),
166
- !i.value && u.value > 0 ? (v(), m("span", oo, G(l(u.value)), 1)) : q("", !0)
167
- ])) : q("", !0),
165
+ i.value ? J("", !0) : (v(), m("span", no, z(t.steps.length) + " 步", 1)),
166
+ !i.value && u.value > 0 ? (v(), m("span", oo, z(l(u.value)), 1)) : J("", !0)
167
+ ])) : J("", !0),
168
168
  o("ul", so, [
169
- (v(!0), m(ye, null, xe(t.steps, (a, r) => (v(), m("li", {
169
+ (v(!0), m(we, null, xe(t.steps, (a, r) => (v(), m("li", {
170
170
  key: r,
171
171
  class: se(["step-item", `step-item--${a.state}`])
172
172
  }, [
@@ -185,10 +185,10 @@ const Un = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
185
185
  ]),
186
186
  o("div", ro, [
187
187
  o("div", co, [
188
- o("span", vo, G(a.title || "处理中"), 1),
189
- a.state === "done" && a.duration != null && a.duration > 0 ? (v(), m("span", ho, G(l(a.duration)), 1)) : q("", !0)
188
+ o("span", vo, z(a.title || "处理中"), 1),
189
+ a.state === "done" && a.duration != null && a.duration > 0 ? (v(), m("span", ho, z(l(a.duration)), 1)) : J("", !0)
190
190
  ]),
191
- a.content ? (v(), m("div", po, G(a.content), 1)) : q("", !0)
191
+ a.content ? (v(), m("div", po, z(a.content), 1)) : J("", !0)
192
192
  ])
193
193
  ], 2))), 128))
194
194
  ])
@@ -196,7 +196,7 @@ const Un = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
196
196
  }
197
197
  });
198
198
  function fo(t, w) {
199
- const i = O(() => t().segments), u = O(() => Ht(i.value)), l = O(() => !!t().streamed), h = O(() => {
199
+ const i = B(() => t().segments), u = B(() => Ht(i.value)), l = B(() => !!t().streamed), h = B(() => {
200
200
  const _ = t().status;
201
201
  return _ === "stop" || _ === "error";
202
202
  }), s = g(t().streamed ? 0 : Ht(t().segments)), a = g(0);
@@ -204,16 +204,16 @@ function fo(t, w) {
204
204
  function k(_) {
205
205
  s.value !== _ && (s.value = _);
206
206
  }
207
- function N() {
207
+ function V() {
208
208
  if (r) return;
209
- const _ = (X) => {
209
+ const _ = (E) => {
210
210
  if (f === 0) {
211
- f = X, r = requestAnimationFrame(_);
211
+ f = E, r = requestAnimationFrame(_);
212
212
  return;
213
213
  }
214
- const B = Math.min(X - f, 100);
215
- f = X;
216
- const n = u.value, p = Yn(i.value, s.value), C = Nn(s.value, n, a.value, B, p);
214
+ const te = Math.min(E - f, 100);
215
+ f = E;
216
+ const n = u.value, d = Yn(i.value, s.value), C = Nn(s.value, n, a.value, te, d);
217
217
  if (a.value = C.frac, C.reveal !== s.value && (s.value = C.reveal, w == null || w()), s.value >= n) {
218
218
  r = 0, f = 0;
219
219
  return;
@@ -222,34 +222,34 @@ function fo(t, w) {
222
222
  };
223
223
  f = 0, r = requestAnimationFrame(_);
224
224
  }
225
- function d() {
225
+ function p() {
226
226
  r && (cancelAnimationFrame(r), r = 0);
227
227
  }
228
- ce(
228
+ ve(
229
229
  [l, u],
230
230
  () => {
231
231
  if (!l.value || h.value) {
232
232
  k(u.value);
233
233
  return;
234
234
  }
235
- s.value < u.value && N();
235
+ s.value < u.value && V();
236
236
  },
237
237
  { immediate: !0 }
238
- ), ce(h, (_) => {
238
+ ), ve(h, (_) => {
239
239
  _ && l.value && k(u.value);
240
- }), ce(
240
+ }), ve(
241
241
  () => t().status,
242
- (_, X) => {
243
- _ === "rethinking" && X !== "rethinking" && (a.value = 0, k(0), u.value > 0 && N());
242
+ (_, E) => {
243
+ _ === "rethinking" && E !== "rethinking" && (a.value = 0, k(0), u.value > 0 && V());
244
244
  }
245
- ), Pe(d);
246
- const D = O(() => On(i.value, s.value)), J = O(
245
+ ), Pe(p);
246
+ const R = B(() => On(i.value, s.value)), X = B(
247
247
  () => l.value ? Bn(i.value, s.value) : -1
248
- ), K = O(() => !l.value || s.value >= u.value);
249
- function I(_) {
248
+ ), K = B(() => !l.value || s.value >= u.value);
249
+ function G(_) {
250
250
  return Wn(i.value, _, s.value);
251
251
  }
252
- return { reveal: s, segmentContents: D, frontier: J, revealDone: K, isSegRevealed: I, stopLoop: d };
252
+ return { reveal: s, segmentContents: R, frontier: X, revealDone: K, isSegRevealed: G, stopLoop: p };
253
253
  }
254
254
  const go = {
255
255
  key: 0,
@@ -275,7 +275,7 @@ const go = {
275
275
  }, Ho = {
276
276
  key: 1,
277
277
  class: "message-content"
278
- }, $o = ["src"], Lo = /* @__PURE__ */ Se({
278
+ }, $o = ["src"], Lo = /* @__PURE__ */ Ee({
279
279
  __name: "MessageItem",
280
280
  props: {
281
281
  msg: {},
@@ -289,80 +289,80 @@ const go = {
289
289
  const i = t, { reveal: u, segmentContents: l, frontier: h, revealDone: s } = fo(
290
290
  () => i.msg,
291
291
  () => i.scrollToBottom()
292
- ), a = O(
292
+ ), a = B(
293
293
  () => i.msg.status === i.STATUS.COMPLETED || i.msg.status === i.STATUS.STOP
294
- ), r = O(() => a.value && s.value), f = g(!1);
295
- ce(r, (y) => {
294
+ ), r = B(() => a.value && s.value), f = g(!1);
295
+ ve(r, (y) => {
296
296
  y && (f.value = !1);
297
297
  });
298
- const k = O(() => Vn(i.msg.segments, u.value)), N = O(() => k.value.length > 0), d = O(() => k.value.some((y) => y.kind === "thinking")), D = O(() => k.value.some((y) => y.kind === "tools")), J = O(() => k.value.some((y) => y.kind === "steps")), K = O(() => {
298
+ const k = B(() => Vn(i.msg.segments, u.value)), V = B(() => k.value.length > 0), p = B(() => k.value.some((y) => y.kind === "thinking")), R = B(() => k.value.some((y) => y.kind === "tools")), X = B(() => k.value.some((y) => y.kind === "steps")), K = B(() => {
299
299
  const y = [];
300
- return d.value && y.push("深度思考"), D.value && y.push("工具调用"), J.value && y.push("执行步骤"), y.join(" · ") || "思考过程";
301
- }), I = O(() => !r.value || f.value), _ = O(
300
+ return p.value && y.push("深度思考"), R.value && y.push("工具调用"), X.value && y.push("执行步骤"), y.join(" · ") || "思考过程";
301
+ }), G = B(() => !r.value || f.value), _ = B(
302
302
  () => (i.msg.segments ?? []).reduce(
303
- (y, $) => $.type === "thinking" || $.type === "agent_thought" || $.type === "step" ? y + ($.duration ?? 0) : y,
303
+ (y, L) => L.type === "thinking" || L.type === "agent_thought" || L.type === "step" ? y + (L.duration ?? 0) : y,
304
304
  0
305
305
  )
306
- ), X = O(
306
+ ), E = B(
307
307
  () => (i.msg.segments ?? []).some(
308
- (y, $) => y.type === "answer" && (l.value[$] || "").length > 0
308
+ (y, L) => y.type === "answer" && (l.value[L] || "").length > 0
309
309
  )
310
- ), B = O(
311
- () => !r.value && i.msg.status !== i.STATUS.ERROR && i.msg.status !== i.STATUS.PAUSED && k.value.length === 0 && !X.value
310
+ ), te = B(
311
+ () => !r.value && i.msg.status !== i.STATUS.ERROR && i.msg.status !== i.STATUS.PAUSED && k.value.length === 0 && !E.value
312
312
  );
313
313
  function n(y) {
314
314
  return y == null || y <= 0 ? "" : y < 1 ? `${Math.round(y * 1e3)}ms` : y < 60 ? `${y.toFixed(1)}s` : `${Math.floor(y / 60)}m${Math.round(y % 60)}s`;
315
315
  }
316
- const p = ge(/* @__PURE__ */ new Map()), C = g("");
317
- function M(y) {
318
- const $ = y.target;
319
- $.tagName === "IMG" && (C.value = $.src);
316
+ const d = ye(/* @__PURE__ */ new Map()), C = g("");
317
+ function D(y) {
318
+ const L = y.target;
319
+ L.tagName === "IMG" && (C.value = L.src);
320
320
  }
321
- function E() {
321
+ function T() {
322
322
  C.value = "";
323
323
  }
324
- function W(y, $) {
324
+ function W(y, L) {
325
325
  var ne;
326
326
  try {
327
327
  let S = y.content;
328
- if (!S && ((ne = y.segments) != null && ne.length) && (S = y.segments.filter((z) => z.type === "answer").map((z) => z.content).join(`
328
+ if (!S && ((ne = y.segments) != null && ne.length) && (S = y.segments.filter((q) => q.type === "answer").map((q) => q.content).join(`
329
329
  `)), S) {
330
- const { copy: z } = _n();
331
- z(S), p.set($, !0), setTimeout(() => p.set($, !1), 2e3);
330
+ const { copy: q } = _n();
331
+ q(S), d.set(L, !0), setTimeout(() => d.set(L, !1), 2e3);
332
332
  }
333
333
  } catch {
334
334
  }
335
335
  }
336
- return (y, $) => {
336
+ return (y, L) => {
337
337
  var ne;
338
338
  return v(), m("div", {
339
339
  class: se(["message", `${t.msg.type}-message`])
340
340
  }, [
341
- t.msg.type === "ai" ? (v(), m(ye, { key: 0 }, [
342
- B.value ? (v(), m("div", go, [...$[4] || ($[4] = [
341
+ t.msg.type === "ai" ? (v(), m(we, { key: 0 }, [
342
+ te.value ? (v(), m("div", go, [...L[4] || (L[4] = [
343
343
  kn('<div class="scale-animation-container"><span class="scale-dot"></span><span class="scale-dot"></span><span class="scale-dot"></span><span class="scale-dot"></span></div>', 1)
344
- ])])) : q("", !0),
344
+ ])])) : J("", !0),
345
345
  t.msg.segments && t.msg.segments.length ? (v(), m("div", {
346
346
  key: 1,
347
347
  class: "message-content ba-markdown",
348
348
  ref: (S) => t.setMessageRef(S, t.index),
349
- onClick: M
349
+ onClick: D
350
350
  }, [
351
- r.value && N.value ? (v(), m("div", {
351
+ r.value && V.value ? (v(), m("div", {
352
352
  key: 0,
353
353
  class: se(["thought-collapse-bar", { "thought-collapse-bar--expanded": f.value }]),
354
- onClick: $[0] || ($[0] = fe((S) => f.value = !f.value, ["stop"]))
354
+ onClick: L[0] || (L[0] = fe((S) => f.value = !f.value, ["stop"]))
355
355
  }, [
356
- d.value ? (v(), pe(P(qn), {
356
+ p.value ? (v(), pe(O(qn), {
357
357
  key: 0,
358
358
  class: "thought-collapse-bar__icon"
359
- })) : (v(), pe(P($t), {
359
+ })) : (v(), pe(O($t), {
360
360
  key: 1,
361
361
  class: "thought-collapse-bar__icon"
362
362
  })),
363
- o("span", yo, G(K.value), 1),
364
- _.value > 0 ? (v(), m("span", wo, G(n(_.value)), 1)) : q("", !0),
365
- o("span", ko, G(f.value ? "收起" : "查看"), 1),
363
+ o("span", yo, z(K.value), 1),
364
+ _.value > 0 ? (v(), m("span", wo, z(n(_.value)), 1)) : J("", !0),
365
+ o("span", ko, z(f.value ? "收起" : "查看"), 1),
366
366
  (v(), m("svg", {
367
367
  class: se(["thought-collapse-bar__arrow", { "thought-collapse-bar__arrow--down": f.value }]),
368
368
  viewBox: "0 0 24 24",
@@ -373,11 +373,11 @@ const go = {
373
373
  "stroke-width": "2.5",
374
374
  "stroke-linecap": "round",
375
375
  "stroke-linejoin": "round"
376
- }, [...$[5] || ($[5] = [
376
+ }, [...L[5] || (L[5] = [
377
377
  o("polyline", { points: "6 9 12 15 18 9" }, null, -1)
378
378
  ])], 2))
379
- ], 2)) : q("", !0),
380
- I.value ? (v(!0), m(ye, { key: 1 }, xe(k.value, (S, z) => (v(), m(ye, { key: z }, [
379
+ ], 2)) : J("", !0),
380
+ G.value ? (v(!0), m(we, { key: 1 }, xe(k.value, (S, q) => (v(), m(we, { key: q }, [
381
381
  S.kind === "steps" ? (v(), pe(mo, {
382
382
  key: 0,
383
383
  steps: S.items
@@ -391,77 +391,77 @@ const go = {
391
391
  class: se(["agent-thought", { "agent-thought--done": !S.calling }])
392
392
  }, [
393
393
  o("span", Co, [
394
- ie(P($t))
394
+ ie(O($t))
395
395
  ]),
396
- o("span", _o, G(S.calling ? "工具调用中" : "工具调用"), 1),
397
- !S.calling && S.count > 1 ? (v(), m("span", bo, " 已调用 " + G(S.count) + " 次 ", 1)) : q("", !0),
398
- !S.calling && S.duration > 0 ? (v(), m("span", Ao, G(n(S.duration)), 1)) : q("", !0)
396
+ o("span", _o, z(S.calling ? "工具调用中" : "工具调用"), 1),
397
+ !S.calling && S.count > 1 ? (v(), m("span", bo, " 已调用 " + z(S.count) + " 次 ", 1)) : J("", !0),
398
+ !S.calling && S.duration > 0 ? (v(), m("span", Ao, z(n(S.duration)), 1)) : J("", !0)
399
399
  ], 2))
400
- ], 64))), 128)) : q("", !0),
401
- (v(!0), m(ye, null, xe(t.msg.segments, (S, z) => (v(), m(ye, { key: z }, [
400
+ ], 64))), 128)) : J("", !0),
401
+ (v(!0), m(we, null, xe(t.msg.segments, (S, q) => (v(), m(we, { key: q }, [
402
402
  S.type === "answer" ? (v(), m("div", So, [
403
403
  o("div", {
404
- innerHTML: P(Xt)(
405
- P(vt)(P(dt)(P(l)[z] ?? "")),
406
- !P(s) && P(h) === z && t.msg.status !== t.STATUS.STOP
404
+ innerHTML: O(Xt)(
405
+ O(vt)(O(dt)(O(l)[q] ?? "")),
406
+ !O(s) && O(h) === q && t.msg.status !== t.STATUS.STOP
407
407
  )
408
408
  }, null, 8, Eo)
409
- ])) : q("", !0)
409
+ ])) : J("", !0)
410
410
  ], 64))), 128))
411
- ], 512)) : q("", !0),
411
+ ], 512)) : J("", !0),
412
412
  !((ne = t.msg.segments) != null && ne.length) && t.msg.content ? (v(), m("div", {
413
413
  key: 2,
414
414
  class: "message-content ba-markdown",
415
415
  ref: (S) => t.setMessageRef(S, t.index),
416
- onClick: M
416
+ onClick: D
417
417
  }, [
418
418
  o("div", {
419
- innerHTML: P(vt)(P(dt)(t.msg.content))
419
+ innerHTML: O(vt)(O(dt)(t.msg.content))
420
420
  }, null, 8, To)
421
- ], 512)) : q("", !0),
421
+ ], 512)) : J("", !0),
422
422
  t.msg.errorMessage ? (v(), m("div", xo, [
423
- $[6] || ($[6] = o("span", { class: "message-error__icon" }, "⚠️", -1)),
424
- o("span", null, G(t.msg.errorMessage), 1)
425
- ])) : q("", !0),
423
+ L[6] || (L[6] = o("span", { class: "message-error__icon" }, "⚠️", -1)),
424
+ o("span", null, z(t.msg.errorMessage), 1)
425
+ ])) : J("", !0),
426
426
  r.value ? (v(), m("div", Do, [
427
427
  o("div", {
428
428
  class: "tooltip-enhanced",
429
- "data-tooltip": p.get(t.index) ? "已复制" : "复制回答"
429
+ "data-tooltip": d.get(t.index) ? "已复制" : "复制回答"
430
430
  }, [
431
- p.get(t.index) ? (v(), pe(P(zn), {
431
+ d.get(t.index) ? (v(), pe(O(zn), {
432
432
  key: 0,
433
433
  class: "message-toolbar__check"
434
- })) : (v(), pe(P(Kn), {
434
+ })) : (v(), pe(O(Kn), {
435
435
  key: 1,
436
- onClick: $[1] || ($[1] = (S) => W(t.msg, t.index))
436
+ onClick: L[1] || (L[1] = (S) => W(t.msg, t.index))
437
437
  }))
438
438
  ], 8, Mo),
439
439
  o("div", Ro, [
440
- ie(P(Gn), {
441
- onClick: $[2] || ($[2] = (S) => y.$emit("regenerate"))
440
+ ie(O(Gn), {
441
+ onClick: L[2] || (L[2] = (S) => y.$emit("regenerate"))
442
442
  })
443
443
  ])
444
- ])) : q("", !0)
445
- ], 64)) : (v(), m("div", Ho, G(t.msg.content), 1)),
444
+ ])) : J("", !0)
445
+ ], 64)) : (v(), m("div", Ho, z(t.msg.content), 1)),
446
446
  (v(), pe(Yt, { to: "#ai-assist-root" }, [
447
447
  C.value ? (v(), m("div", {
448
448
  key: 0,
449
449
  class: "ai-image-preview-overlay",
450
- onClick: E
450
+ onClick: T
451
451
  }, [
452
452
  o("img", {
453
453
  src: C.value,
454
454
  class: "ai-image-preview-overlay__img",
455
- onClick: $[3] || ($[3] = fe(() => {
455
+ onClick: L[3] || (L[3] = fe(() => {
456
456
  }, ["stop"]))
457
457
  }, null, 8, $o),
458
458
  o("button", {
459
459
  class: "ai-image-preview-overlay__close",
460
- onClick: fe(E, ["stop"])
460
+ onClick: fe(T, ["stop"])
461
461
  }, [
462
- ie(P(jn))
462
+ ie(O(jn))
463
463
  ])
464
- ])) : q("", !0)
464
+ ])) : J("", !0)
465
465
  ]))
466
466
  ], 2);
467
467
  };
@@ -481,14 +481,17 @@ const go = {
481
481
  }, Yo = ["onKeydown"], No = ["data-tooltip"], Vo = {
482
482
  key: 2,
483
483
  class: "moveTB"
484
- }, Xo = ["value", "placeholder", "disabled"], Fo = {
484
+ }, Xo = {
485
+ key: 1,
486
+ class: "input-container"
487
+ }, Fo = ["value", "placeholder", "disabled"], Qo = {
485
488
  key: 0,
486
489
  class: "tooltip-enhanced stop",
487
490
  "data-tooltip": "停止生成"
488
- }, Qo = ["data-tooltip"], Jo = {
491
+ }, Jo = ["data-tooltip"], qo = {
489
492
  key: 3,
490
493
  class: "moveTB"
491
- }, qo = 400, zo = 10, Ko = /* @__PURE__ */ Se({
494
+ }, zo = 400, Ko = 10, Go = /* @__PURE__ */ Ee({
492
495
  __name: "ChatInput",
493
496
  props: {
494
497
  modelValue: {},
@@ -498,196 +501,202 @@ const go = {
498
501
  },
499
502
  emits: ["update:modelValue", "send", "stop", "scroll-to-bottom"],
500
503
  setup(t, { emit: w }) {
501
- const i = t, u = w, l = g(!1), h = g(""), s = g(""), a = g("idle"), r = g(""), f = g(null), k = g(null), N = g(!1), d = g(!1), D = g(!1);
502
- let J = !1, K = null, I = null, _ = !1, X = !1, B = null;
503
- const n = O(() => a.value === "connecting"), p = O(
504
+ const i = t, u = w, l = g(!1), h = g(""), s = g(""), a = g("idle"), r = g(""), f = g(null), k = g(null), V = g(!1), p = g(!1);
505
+ let R = !1, X = null, K = null, G = !1, _ = !1, E = null;
506
+ const te = B(() => a.value === "connecting"), n = B(
504
507
  () => a.value === "recording" || a.value === "stopping"
505
- ), C = O(
508
+ ), d = B(
506
509
  () => a.value === "connecting" || a.value === "recording" || a.value === "stopping"
507
- ), M = O(() => l.value && !C.value), E = O(
508
- () => M.value ? !!r.value.trim() : !!(h.value.trim() || s.value.trim())
509
- ), W = O(
510
+ ), C = B(() => l.value && !d.value), D = B(
511
+ () => C.value ? !!r.value.trim() : !!(h.value.trim() || s.value.trim())
512
+ ), T = B(
510
513
  () => Qe.isSupported() && !i.modelValue.trim() && !i.isGenerating
511
- ), y = O(() => D.value ? "正在请求麦克风权限…" : N.value ? "继续按住,开始语音输入…" : W.value ? "给AI助手发送消息...(按住可语音)" : "给AI助手发送消息..."), $ = O(
512
- () => d.value ? "正在聆听…松手结束" : "正在聆听…点击结束"
514
+ ), W = g(!1);
515
+ function y(P) {
516
+ P.pointerType === "mouse" && (W.value = !0);
517
+ }
518
+ function L(P) {
519
+ P.pointerType === "mouse" && (W.value = !1);
520
+ }
521
+ const ne = B(() => p.value ? "正在请求麦克风权限…" : W.value && T.value ? "发消息...(按住可语音输入)" : "发消息..."), S = B(
522
+ () => V.value ? "正在聆听…松手结束" : "正在聆听…点击结束"
513
523
  );
514
- function ne() {
515
- B = new Qe({}, {
516
- onStatusChange: (V) => {
517
- a.value = V;
524
+ function q() {
525
+ E = new Qe({}, {
526
+ onStatusChange: (P) => {
527
+ a.value = P;
518
528
  },
519
- onInterim: (V) => {
520
- s.value = V;
529
+ onInterim: (P) => {
530
+ s.value = P;
521
531
  },
522
- onFinal: (V) => {
523
- h.value += V, s.value = "";
532
+ onFinal: (P) => {
533
+ h.value += P, s.value = "";
524
534
  },
525
535
  onError: () => {
526
536
  l.value = !1;
527
537
  }
528
538
  });
529
539
  }
530
- _e(ne), Nt(() => {
531
- L(), B == null || B.destroy(), B = null;
532
- }), ce([h, s], () => {
540
+ be(q), Nt(() => {
541
+ x(), E == null || E.destroy(), E = null;
542
+ }), ve([h, s], () => {
533
543
  me(() => {
534
544
  f.value && (f.value.scrollTop = f.value.scrollHeight);
535
545
  });
536
- }), ce(a, (V) => {
537
- if (V === "recording" && X) {
538
- X = !1, B == null || B.stop();
546
+ }), ve(a, (P) => {
547
+ if (P === "recording" && _) {
548
+ _ = !1, E == null || E.stop();
539
549
  return;
540
550
  }
541
- V === "idle" && l.value && (r.value = (h.value + s.value).trim(), me(() => {
551
+ P === "idle" && l.value && (r.value = (h.value + s.value).trim(), me(() => {
542
552
  var Q;
543
553
  return (Q = k.value) == null ? void 0 : Q.focus();
544
554
  }));
545
555
  });
546
- function S() {
547
- C.value && (B == null || B.stop());
556
+ function N() {
557
+ d.value && (E == null || E.stop());
548
558
  }
549
- function z() {
550
- window.removeEventListener("pointerup", R), window.removeEventListener("pointercancel", R), window.removeEventListener("pointermove", x), window.removeEventListener("blur", Y);
559
+ function b() {
560
+ window.removeEventListener("pointerup", H), window.removeEventListener("pointercancel", H), window.removeEventListener("pointermove", Y), window.removeEventListener("blur", F);
551
561
  }
552
- function L() {
553
- K !== null && (clearTimeout(K), K = null), N.value = !1, I = null, z();
562
+ function x() {
563
+ X !== null && (clearTimeout(X), X = null), K = null, b();
554
564
  }
555
- function b() {
556
- a.value === "recording" ? B == null || B.stop() : (a.value === "connecting" || a.value === "stopping") && (X = !0);
565
+ function M() {
566
+ a.value === "recording" ? E == null || E.stop() : (a.value === "connecting" || a.value === "stopping") && (_ = !0);
557
567
  }
558
- function T() {
559
- const V = _;
560
- _ = !1, L(), V && b();
568
+ function $() {
569
+ const P = G;
570
+ G = !1, x(), P && M();
561
571
  }
562
- function x(V) {
563
- if (!I) return;
564
- if (_) {
565
- V.buttons === 0 && T();
572
+ function Y(P) {
573
+ if (!K) return;
574
+ if (G) {
575
+ P.buttons === 0 && $();
566
576
  return;
567
577
  }
568
- const Q = V.clientX - I.x, ee = V.clientY - I.y;
569
- Math.hypot(Q, ee) > zo && L();
570
- }
571
- function R() {
572
- T();
573
- }
574
- function Y() {
575
- _ && T();
576
- }
577
- function H(V) {
578
- W.value && (V.pointerType === "mouse" && V.button !== 0 || (I = { x: V.clientX, y: V.clientY }, _ = !1, X = !1, N.value = !0, K !== null && clearTimeout(K), K = setTimeout(() => {
579
- var ee, ve, de;
580
- K = null, _ = !0, N.value = !1;
581
- const Q = V.target;
582
- Q && typeof Q.blur == "function" && Q.blur(), (de = (ve = (ee = window.getSelection) == null ? void 0 : ee.call(window)) == null ? void 0 : ve.removeAllRanges) == null || de.call(ve), F(!0);
583
- }, qo), window.addEventListener("pointerup", R), window.addEventListener("pointercancel", R), window.addEventListener("pointermove", x), window.addEventListener("blur", Y)));
584
- }
585
- async function F(V = !1) {
586
- if (!B || J) return;
587
- D.value = !0, J = !0;
588
- const { granted: Q, prompted: ee } = await Qe.ensurePermission();
589
- if (D.value = !1, J = !1, !Q) {
578
+ const Q = P.clientX - K.x, I = P.clientY - K.y;
579
+ Math.hypot(Q, I) > Ko && x();
580
+ }
581
+ function H() {
582
+ $();
583
+ }
584
+ function F() {
585
+ G && $();
586
+ }
587
+ function oe(P) {
588
+ T.value && (P.pointerType === "mouse" && P.button !== 0 || (K = { x: P.clientX, y: P.clientY }, G = !1, _ = !1, X !== null && clearTimeout(X), X = setTimeout(() => {
589
+ var I, ue, ge;
590
+ X = null, G = !0;
591
+ const Q = P.target;
592
+ Q && typeof Q.blur == "function" && Q.blur(), (ge = (ue = (I = window.getSelection) == null ? void 0 : I.call(window)) == null ? void 0 : ue.removeAllRanges) == null || ge.call(ue), le(!0);
593
+ }, zo), window.addEventListener("pointerup", H), window.addEventListener("pointercancel", H), window.addEventListener("pointermove", Y), window.addEventListener("blur", F)));
594
+ }
595
+ async function le(P = !1) {
596
+ if (!E || R) return;
597
+ p.value = !0, R = !0;
598
+ const { granted: Q, prompted: I } = await Qe.ensurePermission();
599
+ if (p.value = !1, R = !1, !Q) {
590
600
  Te("麦克风不可用,请允许浏览器使用麦克风后重试");
591
601
  return;
592
602
  }
593
- if (V && !_) {
594
- ee && Te("麦克风已开启,请重新按住输入框开始说话", "info");
603
+ if (P && !G) {
604
+ I && Te("麦克风已开启,请重新按住输入框开始说话", "info");
595
605
  return;
596
606
  }
597
- d.value = V, h.value = "", s.value = "", r.value = "", l.value = !0;
607
+ V.value = P, h.value = "", s.value = "", r.value = "", l.value = !0;
598
608
  try {
599
- await B.start();
609
+ await E.start();
600
610
  } catch {
601
611
  l.value = !1;
602
612
  }
603
613
  }
604
- function oe() {
605
- B == null || B.cancel(), l.value = !1, d.value = !1, X = !1, h.value = "", s.value = "", r.value = "";
614
+ function de() {
615
+ E == null || E.cancel(), l.value = !1, V.value = !1, _ = !1, h.value = "", s.value = "", r.value = "";
606
616
  }
607
- function le() {
608
- const V = (M.value ? r.value : h.value + s.value).trim();
609
- V && (B == null || B.stop(), l.value = !1, d.value = !1, X = !1, u("update:modelValue", V), setTimeout(() => u("send"), 0));
617
+ function ke() {
618
+ const P = (C.value ? r.value : h.value + s.value).trim();
619
+ P && (E == null || E.stop(), l.value = !1, V.value = !1, _ = !1, u("update:modelValue", P), setTimeout(() => u("send"), 0));
610
620
  }
611
- return (V, Q) => l.value ? (v(), m("div", Po, [
621
+ return (P, Q) => l.value ? (v(), m("div", Po, [
612
622
  o("div", {
613
- class: se(["voice-visual", { recording: p.value }])
623
+ class: se(["voice-visual", { recording: n.value }])
614
624
  }, null, 2),
615
- C.value ? (v(), m("div", {
625
+ d.value ? (v(), m("div", {
616
626
  key: 0,
617
627
  class: "voice-text",
618
628
  ref_key: "voiceTextEl",
619
629
  ref: f,
620
- onClick: S
630
+ onClick: N
621
631
  }, [
622
- h.value ? (v(), m("span", Oo, G(h.value), 1)) : q("", !0),
623
- s.value ? (v(), m("span", Bo, G(s.value), 1)) : q("", !0),
624
- !h.value && !s.value ? (v(), m("span", Wo, G(n.value ? "启动中…" : $.value), 1)) : q("", !0)
632
+ h.value ? (v(), m("span", Oo, z(h.value), 1)) : J("", !0),
633
+ s.value ? (v(), m("span", Bo, z(s.value), 1)) : J("", !0),
634
+ !h.value && !s.value ? (v(), m("span", Wo, z(te.value ? "启动中…" : S.value), 1)) : J("", !0)
625
635
  ], 512)) : Me((v(), m("input", {
626
636
  key: 1,
627
637
  ref_key: "editorEl",
628
638
  ref: k,
629
- "onUpdate:modelValue": Q[0] || (Q[0] = (ee) => r.value = ee),
639
+ "onUpdate:modelValue": Q[0] || (Q[0] = (I) => r.value = I),
630
640
  type: "text",
631
641
  class: "voice-editor",
632
642
  placeholder: "识别结果,可点击直接修改…",
633
- onKeydown: ct(fe(oe, ["prevent"]), ["esc"]),
634
- onKeyup: Q[1] || (Q[1] = ct((ee) => E.value && le(), ["enter"]))
643
+ onKeydown: ct(fe(de, ["prevent"]), ["esc"]),
644
+ onKeyup: Q[1] || (Q[1] = ct((I) => D.value && ke(), ["enter"]))
635
645
  }, null, 40, Yo)), [
636
646
  [Vt, r.value]
637
647
  ]),
638
648
  o("div", {
639
649
  class: "tooltip-enhanced voice-close",
640
650
  "data-tooltip": "关闭",
641
- onClick: oe
651
+ onClick: de
642
652
  }, [
643
- ie(P(re), {
653
+ ie(O(ce), {
644
654
  class: "op-icon",
645
655
  icon: "heroicons-solid:x-mark"
646
656
  })
647
657
  ]),
648
658
  o("div", {
649
- class: se(["tooltip-enhanced voice-send", { disabled: !E.value }]),
650
- "data-tooltip": E.value ? "发送" : "未识别到文字",
651
- onClick: Q[2] || (Q[2] = (ee) => E.value && le())
659
+ class: se(["tooltip-enhanced voice-send", { disabled: !D.value }]),
660
+ "data-tooltip": D.value ? "发送" : "未识别到文字",
661
+ onClick: Q[2] || (Q[2] = (I) => D.value && ke())
652
662
  }, [
653
- ie(P(re), {
663
+ ie(O(ce), {
654
664
  class: "op-icon",
655
665
  icon: "fluent-color:send-16"
656
666
  })
657
667
  ], 10, No),
658
668
  t.hasScroll && !t.isAtBottom ? (v(), m("div", Vo, [
659
- ie(P(re), {
669
+ ie(O(ce), {
660
670
  class: "op-icon",
661
671
  icon: "ep:bottom",
662
- onClick: Q[3] || (Q[3] = (ee) => V.$emit("scroll-to-bottom"))
672
+ onClick: Q[3] || (Q[3] = (I) => P.$emit("scroll-to-bottom"))
663
673
  })
664
- ])) : q("", !0)
665
- ])) : (v(), m("div", {
666
- key: 1,
667
- class: se(["input-container", { holding: N.value }])
668
- }, [
674
+ ])) : J("", !0)
675
+ ])) : (v(), m("div", Xo, [
669
676
  o("input", {
670
677
  value: t.modelValue,
671
678
  type: "text",
672
- placeholder: y.value,
673
- onInput: Q[4] || (Q[4] = (ee) => V.$emit("update:modelValue", ee.target.value)),
674
- onKeyup: Q[5] || (Q[5] = ct((ee) => t.modelValue.trim() && V.$emit("send"), ["enter"])),
679
+ placeholder: ne.value,
680
+ onInput: Q[4] || (Q[4] = (I) => P.$emit("update:modelValue", I.target.value)),
681
+ onKeyup: Q[5] || (Q[5] = ct((I) => t.modelValue.trim() && P.$emit("send"), ["enter"])),
675
682
  disabled: t.isGenerating,
676
- onPointerdown: H
677
- }, null, 40, Xo),
678
- t.isGenerating ? (v(), m("div", Fo, [
679
- ie(P(re), {
683
+ onPointerdown: oe,
684
+ onPointerenter: y,
685
+ onPointerleave: L
686
+ }, null, 40, Fo),
687
+ t.isGenerating ? (v(), m("div", Qo, [
688
+ ie(O(ce), {
680
689
  class: "op-icon stop-icon",
681
690
  icon: "heroicons-solid:stop",
682
- onClick: Q[6] || (Q[6] = (ee) => V.$emit("stop"))
691
+ onClick: Q[6] || (Q[6] = (I) => P.$emit("stop"))
683
692
  })
684
- ])) : W.value ? (v(), m("div", {
693
+ ])) : T.value ? (v(), m("div", {
685
694
  key: 1,
686
695
  class: "tooltip-enhanced send voice",
687
696
  "data-tooltip": "语音输入(也可按住输入框说话)",
688
- onClick: Q[7] || (Q[7] = (ee) => F())
697
+ onClick: Q[7] || (Q[7] = (I) => le())
689
698
  }, [
690
- ie(P(re), {
699
+ ie(O(ce), {
691
700
  class: "op-icon",
692
701
  icon: "mingcute:voice-line"
693
702
  })
@@ -696,23 +705,23 @@ const go = {
696
705
  class: se(["tooltip-enhanced send", { disabled: !t.modelValue.trim() }]),
697
706
  "data-tooltip": t.modelValue.trim() ? "开始回答" : "请输入你的问题"
698
707
  }, [
699
- ie(P(re), {
708
+ ie(O(ce), {
700
709
  class: "op-icon",
701
710
  icon: "fluent-color:send-16",
702
- onClick: Q[8] || (Q[8] = (ee) => t.modelValue.trim() && V.$emit("send"))
711
+ onClick: Q[8] || (Q[8] = (I) => t.modelValue.trim() && P.$emit("send"))
703
712
  })
704
- ], 10, Qo)),
705
- t.hasScroll && !t.isAtBottom ? (v(), m("div", Jo, [
706
- ie(P(re), {
713
+ ], 10, Jo)),
714
+ t.hasScroll && !t.isAtBottom ? (v(), m("div", qo, [
715
+ ie(O(ce), {
707
716
  class: "op-icon",
708
717
  icon: "ep:bottom",
709
- onClick: Q[9] || (Q[9] = (ee) => V.$emit("scroll-to-bottom"))
718
+ onClick: Q[9] || (Q[9] = (I) => P.$emit("scroll-to-bottom"))
710
719
  })
711
- ])) : q("", !0)
712
- ], 2));
720
+ ])) : J("", !0)
721
+ ]));
713
722
  }
714
723
  });
715
- function Go(t) {
724
+ function jo(t) {
716
725
  const w = g(!0), i = g(!1);
717
726
  function u(s) {
718
727
  const a = s.closest(".chat-wrap") || s, r = s.scrollHeight, f = s.clientHeight;
@@ -720,8 +729,8 @@ function Go(t) {
720
729
  a.style.setProperty("--ai-thumb-height", "0px"), a.style.setProperty("--ai-thumb-top", "0px");
721
730
  return;
722
731
  }
723
- const k = Math.max(f * f / r, 32), N = f - k, d = s.scrollTop / (r - f);
724
- a.style.setProperty("--ai-thumb-height", `${k}px`), a.style.setProperty("--ai-thumb-top", `${d * N}px`);
732
+ const k = Math.max(f * f / r, 32), V = f - k, p = s.scrollTop / (r - f);
733
+ a.style.setProperty("--ai-thumb-height", `${k}px`), a.style.setProperty("--ai-thumb-top", `${p * V}px`);
725
734
  }
726
735
  function l() {
727
736
  me(() => {
@@ -735,7 +744,7 @@ function Go(t) {
735
744
  }
736
745
  return { isAtBottom: w, hasScroll: i, scrollToBottom: l, checkScrollStatus: h };
737
746
  }
738
- function jo() {
747
+ function Uo() {
739
748
  function t(w) {
740
749
  w.querySelectorAll("pre").forEach((u) => {
741
750
  if (u.querySelector(".copy-button")) return;
@@ -758,7 +767,7 @@ function jo() {
758
767
  }
759
768
  return { enhanceCodeBlocks: t };
760
769
  }
761
- function Uo(t) {
770
+ function Zo(t) {
762
771
  let w = null, i = 0;
763
772
  function u(h) {
764
773
  w = h(w || [...t.value]), i || (i = requestAnimationFrame(() => {
@@ -770,7 +779,7 @@ function Uo(t) {
770
779
  }
771
780
  return { batchMessagesUpdate: u, flushMessagesBatch: l };
772
781
  }
773
- function Zo({
782
+ function Io({
774
783
  messages: t,
775
784
  isGenerating: w,
776
785
  lastUserMessage: i,
@@ -779,73 +788,73 @@ function Zo({
779
788
  STATUS: h,
780
789
  cfg: s
781
790
  }) {
782
- const a = g(/* @__PURE__ */ new Map()), r = g(/* @__PURE__ */ new Map()), f = g(/* @__PURE__ */ new Map()), k = g(/* @__PURE__ */ new Map()), N = g(!1), d = g(/* @__PURE__ */ new Map()), D = g(/* @__PURE__ */ new Map()), J = g(!1);
783
- function K(X) {
784
- const B = a.value.get(X) || [];
791
+ const a = g(/* @__PURE__ */ new Map()), r = g(/* @__PURE__ */ new Map()), f = g(/* @__PURE__ */ new Map()), k = g(/* @__PURE__ */ new Map()), V = g(!1), p = g(/* @__PURE__ */ new Map()), R = g(/* @__PURE__ */ new Map()), X = g(!1);
792
+ function K(E) {
793
+ const te = a.value.get(E) || [];
785
794
  u((n) => {
786
- if (n[X]) {
787
- const p = [...n];
788
- return p[X] = { ...p[X], segments: B.map((C) => ({ ...C })) }, p;
795
+ if (n[E]) {
796
+ const d = [...n];
797
+ return d[E] = { ...d[E], segments: te.map((C) => ({ ...C })) }, d;
789
798
  }
790
799
  return n;
791
800
  });
792
801
  }
793
- function I(X) {
794
- const B = a.value.get(X) || [], n = f.value.get(X), p = D.value.get(X);
795
- let C = 0, M = !1;
796
- B.forEach((E) => {
797
- if ((E.type === "thinking" || E.type === "step") && E.duration == null) {
798
- const y = (E.id != null ? p == null ? void 0 : p.get(E.id) : void 0) ?? n, $ = y ? Math.round((Date.now() - y) / 1e3 * 10) / 10 : 0;
799
- E.duration = $, E.type === "thinking" && (C += $), M = !0;
802
+ function G(E) {
803
+ const te = a.value.get(E) || [], n = f.value.get(E), d = R.value.get(E);
804
+ let C = 0, D = !1;
805
+ te.forEach((T) => {
806
+ if ((T.type === "thinking" || T.type === "step") && T.duration == null) {
807
+ const y = (T.id != null ? d == null ? void 0 : d.get(T.id) : void 0) ?? n, L = y ? Math.round((Date.now() - y) / 1e3 * 10) / 10 : 0;
808
+ T.duration = L, T.type === "thinking" && (C += L), D = !0;
800
809
  }
801
- }), M && (a.value.set(X, B), u((E) => {
802
- if (E[X]) {
803
- const W = [...E];
804
- return W[X] = {
805
- ...W[X],
806
- segments: B.map((y) => ({ ...y })),
807
- thinkingDuration: (W[X].thinkingDuration || 0) + C
810
+ }), D && (a.value.set(E, te), u((T) => {
811
+ if (T[E]) {
812
+ const W = [...T];
813
+ return W[E] = {
814
+ ...W[E],
815
+ segments: te.map((y) => ({ ...y })),
816
+ thinkingDuration: (W[E].thinkingDuration || 0) + C
808
817
  }, W;
809
818
  }
810
- return E;
819
+ return T;
811
820
  }));
812
821
  }
813
- async function _(X, B, n, p, C = !1) {
814
- J.value = !1, N.value = !1, a.value.set(n, []), d.value.set(n, /* @__PURE__ */ new Map()), D.value.set(n, /* @__PURE__ */ new Map()), w.value = !0;
822
+ async function _(E, te, n, d, C = !1) {
823
+ X.value = !1, V.value = !1, a.value.set(n, []), p.value.set(n, /* @__PURE__ */ new Map()), R.value.set(n, /* @__PURE__ */ new Map()), w.value = !0;
815
824
  try {
816
- const M = s.baseUrl.replace(/\/+$/, "") + "/" + X.replace(/^\/+/, "");
817
- await Xn(M, {
825
+ const D = s.baseUrl.replace(/\/+$/, "") + "/" + E.replace(/^\/+/, "");
826
+ await Xn(D, {
818
827
  method: "POST",
819
828
  headers: {
820
829
  "Content-Type": "application/json",
821
830
  Authorization: `Bearer ${s.token}`
822
831
  },
823
- body: JSON.stringify({ app: s.app ?? 1, data: B }),
824
- signal: p,
832
+ body: JSON.stringify({ app: s.app ?? 1, data: te }),
833
+ signal: d,
825
834
  openWhenHidden: !0,
826
- async onopen(E) {
827
- E.ok || console.error("[ai-assist-sdk] ❌ SSE 连接失败:", E.status, E.statusText);
835
+ async onopen(T) {
836
+ T.ok || console.error("[ai-assist-sdk] ❌ SSE 连接失败:", T.status, T.statusText);
828
837
  },
829
- onmessage(E) {
830
- var W, y, $, ne, S;
838
+ onmessage(T) {
839
+ var W, y, L, ne, S;
831
840
  try {
832
- let z = E.data || "";
833
- for (; z.startsWith("data:"); )
834
- z = z.replace(/^data:\s*/, "");
835
- if (!z) return;
836
- let L;
841
+ let q = T.data || "";
842
+ for (; q.startsWith("data:"); )
843
+ q = q.replace(/^data:\s*/, "");
844
+ if (!q) return;
845
+ let N;
837
846
  try {
838
- L = JSON.parse(z);
847
+ N = JSON.parse(q);
839
848
  } catch {
840
849
  return;
841
850
  }
842
- switch (L.event) {
851
+ switch (N.event) {
843
852
  case "message_start":
844
- C || (i.value = L.id), r.value.set(n, "answer");
853
+ C || (i.value = N.id), r.value.set(n, "answer");
845
854
  break;
846
855
  // ── 对话流型智能体:流程开始,标记进入 flow 协议 ──
847
856
  case "flow_start":
848
- N.value = !0;
857
+ V.value = !0;
849
858
  break;
850
859
  case "think_message_output_start": {
851
860
  f.value.set(n, Date.now()), r.value.set(n, "thinking");
@@ -854,46 +863,46 @@ function Zo({
854
863
  break;
855
864
  }
856
865
  case "agent_thought": {
857
- const b = L.thought || L.thinking || "", T = a.value.get(n) || [], x = T[T.length - 1];
858
- x && x.type === "agent_thought" && x.duration == null ? x.content += b : (r.value.set(n, "agent_thought"), T.push({ type: "agent_thought", content: b }), k.value.set(n, Date.now())), a.value.set(n, T), u((R) => {
859
- if (R[n]) {
860
- const Y = [...R];
866
+ const b = N.thought || N.thinking || "", x = a.value.get(n) || [], M = x[x.length - 1];
867
+ M && M.type === "agent_thought" && M.duration == null ? M.content += b : (r.value.set(n, "agent_thought"), x.push({ type: "agent_thought", content: b }), k.value.set(n, Date.now())), a.value.set(n, x), u(($) => {
868
+ if ($[n]) {
869
+ const Y = [...$];
861
870
  return Y[n] = {
862
871
  ...Y[n],
863
- segments: T.map((H) => ({ ...H })),
872
+ segments: x.map((H) => ({ ...H })),
864
873
  thinkingContent: (Y[n].thinkingContent || "") + b,
865
874
  status: h.THINKING
866
875
  }, Y;
867
876
  }
868
- return R;
877
+ return $;
869
878
  });
870
879
  break;
871
880
  }
872
881
  case "think_message": {
873
- const b = L.thinking || L.answer || L.text || "", T = a.value.get(n) || [], x = T[T.length - 1];
874
- x && x.type === "thinking" ? x.content += b : (T.push({ type: "thinking", content: b }), f.value.set(n, Date.now())), a.value.set(n, T), u((R) => {
875
- if (R[n]) {
876
- const Y = [...R];
882
+ const b = N.thinking || N.answer || N.text || "", x = a.value.get(n) || [], M = x[x.length - 1];
883
+ M && M.type === "thinking" ? M.content += b : (x.push({ type: "thinking", content: b }), f.value.set(n, Date.now())), a.value.set(n, x), u(($) => {
884
+ if ($[n]) {
885
+ const Y = [...$];
877
886
  return Y[n] = {
878
887
  ...Y[n],
879
- segments: T.map((H) => ({ ...H })),
888
+ segments: x.map((H) => ({ ...H })),
880
889
  thinkingContent: (Y[n].thinkingContent || "") + b,
881
890
  status: h.THINKING
882
891
  }, Y;
883
892
  }
884
- return R;
893
+ return $;
885
894
  });
886
895
  break;
887
896
  }
888
897
  case "agent_thought_end": {
889
- const b = k.value.get(n), T = b ? Math.round((Date.now() - b) / 1e3 * 10) / 10 : 0, x = a.value.get(n) || [], R = x[x.length - 1];
890
- R && R.type === "agent_thought" && (R.duration = T), a.value.set(n, x), u((Y) => {
898
+ const b = k.value.get(n), x = b ? Math.round((Date.now() - b) / 1e3 * 10) / 10 : 0, M = a.value.get(n) || [], $ = M[M.length - 1];
899
+ $ && $.type === "agent_thought" && ($.duration = x), a.value.set(n, M), u((Y) => {
891
900
  if (Y[n]) {
892
901
  const H = [...Y];
893
902
  return H[n] = {
894
903
  ...H[n],
895
- segments: x.map((F) => ({ ...F })),
896
- thinkingDuration: (H[n].thinkingDuration || 0) + T
904
+ segments: M.map((F) => ({ ...F })),
905
+ thinkingDuration: (H[n].thinkingDuration || 0) + x
897
906
  }, H;
898
907
  }
899
908
  return Y;
@@ -901,14 +910,14 @@ function Zo({
901
910
  break;
902
911
  }
903
912
  case "think_message_output_end": {
904
- const b = f.value.get(n), T = b ? Math.round((Date.now() - b) / 1e3 * 10) / 10 : 0, x = a.value.get(n) || [], R = x[x.length - 1];
905
- R && R.type === "thinking" && (R.duration = T), a.value.set(n, x), u((Y) => {
913
+ const b = f.value.get(n), x = b ? Math.round((Date.now() - b) / 1e3 * 10) / 10 : 0, M = a.value.get(n) || [], $ = M[M.length - 1];
914
+ $ && $.type === "thinking" && ($.duration = x), a.value.set(n, M), u((Y) => {
906
915
  if (Y[n]) {
907
916
  const H = [...Y];
908
917
  return H[n] = {
909
918
  ...H[n],
910
- segments: x.map((F) => ({ ...F })),
911
- thinkingDuration: (H[n].thinkingDuration || 0) + T
919
+ segments: M.map((F) => ({ ...F })),
920
+ thinkingDuration: (H[n].thinkingDuration || 0) + x
912
921
  }, H;
913
922
  }
914
923
  return Y;
@@ -919,54 +928,54 @@ function Zo({
919
928
  // message_config.reasoning === true 的步骤(如「正在思考」)归入深度思考,
920
929
  // 其余(執行準備/資料獲取/...)归入流程步骤。
921
930
  case "tool_message_output_start": {
922
- N.value = !0;
923
- const b = ((W = L.message_config) == null ? void 0 : W.reasoning) === !0 || L.reasoning === !0, T = Date.now(), x = a.value.get(n) || [];
924
- x.push({
931
+ V.value = !0;
932
+ const b = ((W = N.message_config) == null ? void 0 : W.reasoning) === !0 || N.reasoning === !0, x = Date.now(), M = a.value.get(n) || [];
933
+ M.push({
925
934
  type: b ? "thinking" : "step",
926
- title: L.message_title || "",
927
- id: L.id,
935
+ title: N.message_title || "",
936
+ id: N.id,
928
937
  content: "",
929
938
  reasoning: b
930
939
  });
931
- const R = x.length - 1;
932
- if (a.value.set(n, x), r.value.set(n, b ? "thinking" : "step"), L.id != null) {
933
- const Y = d.value.get(n) || /* @__PURE__ */ new Map();
934
- Y.set(String(L.id), R), d.value.set(n, Y);
935
- const H = D.value.get(n) || /* @__PURE__ */ new Map();
936
- H.set(String(L.id), T), D.value.set(n, H);
940
+ const $ = M.length - 1;
941
+ if (a.value.set(n, M), r.value.set(n, b ? "thinking" : "step"), N.id != null) {
942
+ const Y = p.value.get(n) || /* @__PURE__ */ new Map();
943
+ Y.set(String(N.id), $), p.value.set(n, Y);
944
+ const H = R.value.get(n) || /* @__PURE__ */ new Map();
945
+ H.set(String(N.id), x), R.value.set(n, H);
937
946
  }
938
- b && f.value.set(n, T), K(n);
947
+ b && f.value.set(n, x), K(n);
939
948
  break;
940
949
  }
941
950
  case "tool_message": {
942
- const b = L.answer || L.text || L.content || "";
951
+ const b = N.answer || N.text || N.content || "";
943
952
  if (!b) break;
944
- const T = a.value.get(n) || [];
945
- if (N.value) {
946
- const x = L.id != null ? String(L.id) : null, R = d.value.get(n);
947
- let Y = x != null ? R == null ? void 0 : R.get(x) : void 0;
948
- if (Y == null || !T[Y]) {
949
- const H = ((y = L.message_config) == null ? void 0 : y.reasoning) === !0 || L.reasoning === !0;
950
- if (T.push({
953
+ const x = a.value.get(n) || [];
954
+ if (V.value) {
955
+ const M = N.id != null ? String(N.id) : null, $ = p.value.get(n);
956
+ let Y = M != null ? $ == null ? void 0 : $.get(M) : void 0;
957
+ if (Y == null || !x[Y]) {
958
+ const H = ((y = N.message_config) == null ? void 0 : y.reasoning) === !0 || N.reasoning === !0;
959
+ if (x.push({
951
960
  type: H ? "thinking" : "step",
952
- title: L.message_title || "",
953
- id: L.id,
961
+ title: N.message_title || "",
962
+ id: N.id,
954
963
  content: b,
955
964
  reasoning: H
956
- }), Y = T.length - 1, x != null) {
957
- const F = R || /* @__PURE__ */ new Map();
958
- F.set(x, Y), d.value.set(n, F), H && f.value.set(n, Date.now());
965
+ }), Y = x.length - 1, M != null) {
966
+ const F = $ || /* @__PURE__ */ new Map();
967
+ F.set(M, Y), p.value.set(n, F), H && f.value.set(n, Date.now());
959
968
  }
960
969
  } else {
961
- const H = T[Y];
962
- T[Y] = { ...H, content: H.content + b };
970
+ const H = x[Y];
971
+ x[Y] = { ...H, content: H.content + b };
963
972
  }
964
- a.value.set(n, T), u((H) => {
973
+ a.value.set(n, x), u((H) => {
965
974
  if (H[n]) {
966
975
  const F = [...H];
967
976
  return F[n] = {
968
977
  ...F[n],
969
- segments: T.map((oe) => ({ ...oe })),
978
+ segments: x.map((oe) => ({ ...oe })),
970
979
  status: h.THINKING
971
980
  }, F;
972
981
  }
@@ -974,23 +983,23 @@ function Zo({
974
983
  });
975
984
  break;
976
985
  }
977
- T.push({ type: "answer", content: b }), a.value.set(n, T), K(n);
986
+ x.push({ type: "answer", content: b }), a.value.set(n, x), K(n);
978
987
  break;
979
988
  }
980
989
  // ── 对话流型智能体:步骤/推理消息结束,记录该步骤耗时 ──
981
990
  case "tool_message_output_end": {
982
- const b = a.value.get(n) || [], T = L.id != null ? String(L.id) : null;
983
- let x = T != null ? ($ = d.value.get(n)) == null ? void 0 : $.get(T) : b.length - 1;
984
- (x == null || !b[x]) && (x = b.length - 1);
985
- const R = (T != null ? (ne = D.value.get(n)) == null ? void 0 : ne.get(T) : void 0) ?? f.value.get(n), Y = R ? Math.round((Date.now() - R) / 1e3 * 10) / 10 : 0;
991
+ const b = a.value.get(n) || [], x = N.id != null ? String(N.id) : null;
992
+ let M = x != null ? (L = p.value.get(n)) == null ? void 0 : L.get(x) : b.length - 1;
993
+ (M == null || !b[M]) && (M = b.length - 1);
994
+ const $ = (x != null ? (ne = R.value.get(n)) == null ? void 0 : ne.get(x) : void 0) ?? f.value.get(n), Y = $ ? Math.round((Date.now() - $) / 1e3 * 10) / 10 : 0;
986
995
  let H = 0;
987
- const F = b[x];
988
- F && F.duration == null && (b[x] = { ...F, duration: Y }, F.type === "thinking" && (H = Y)), a.value.set(n, b), u((oe) => {
996
+ const F = b[M];
997
+ F && F.duration == null && (b[M] = { ...F, duration: Y }, F.type === "thinking" && (H = Y)), a.value.set(n, b), u((oe) => {
989
998
  if (oe[n]) {
990
999
  const le = [...oe];
991
1000
  return le[n] = {
992
1001
  ...le[n],
993
- segments: b.map((V) => ({ ...V })),
1002
+ segments: b.map((de) => ({ ...de })),
994
1003
  ...H ? { thinkingDuration: (le[n].thinkingDuration || 0) + H } : {}
995
1004
  }, le;
996
1005
  }
@@ -999,24 +1008,24 @@ function Zo({
999
1008
  break;
1000
1009
  }
1001
1010
  case "message_output_start":
1002
- r.value.set(n, "answer"), I(n);
1011
+ r.value.set(n, "answer"), G(n);
1003
1012
  break;
1004
1013
  // 对话流型智能体:回答输出结束 / 流程结束(状态统一由 message_end 收尾)
1005
1014
  case "message_output_end":
1006
1015
  case "flow_end":
1007
1016
  break;
1008
1017
  case "message": {
1009
- const b = L.answer || "", T = r.value.get(n), x = a.value.get(n) || [], R = x[x.length - 1];
1010
- T === "answer" && R && R.type === "answer" ? R.content += b : (I(n), r.value.set(n, "answer"), x.push({ type: "answer", content: b })), a.value.set(n, x);
1011
- const Y = x.filter((H) => H.type === "answer").map((H) => H.content).join("");
1018
+ const b = N.answer || "", x = r.value.get(n), M = a.value.get(n) || [], $ = M[M.length - 1];
1019
+ x === "answer" && $ && $.type === "answer" ? $.content += b : (G(n), r.value.set(n, "answer"), M.push({ type: "answer", content: b })), a.value.set(n, M);
1020
+ const Y = M.filter((H) => H.type === "answer").map((H) => H.content).join("");
1012
1021
  u((H) => {
1013
1022
  if (H[n]) {
1014
1023
  const F = [...H];
1015
1024
  return F[n] = {
1016
1025
  ...F[n],
1017
- segments: x.map((oe) => ({ ...oe })),
1026
+ segments: M.map((oe) => ({ ...oe })),
1018
1027
  content: Y,
1019
- status: J.value ? h.STOP : h.ANSWERING
1028
+ status: X.value ? h.STOP : h.ANSWERING
1020
1029
  }, F;
1021
1030
  }
1022
1031
  return H;
@@ -1026,7 +1035,7 @@ function Zo({
1026
1035
  case "message_end": {
1027
1036
  l();
1028
1037
  const b = [...t.value];
1029
- b[n] && (b[n] = { ...b[n], status: J.value ? h.STOP : h.COMPLETED }), t.value = b, w.value = !1;
1038
+ b[n] && (b[n] = { ...b[n], status: X.value ? h.STOP : h.COMPLETED }), t.value = b, w.value = !1;
1030
1039
  break;
1031
1040
  }
1032
1041
  case "agent_error":
@@ -1036,73 +1045,73 @@ function Zo({
1036
1045
  b[n] && (b[n] = {
1037
1046
  ...b[n],
1038
1047
  status: h.ERROR,
1039
- content: L.error_msg || L.message || "请求失败",
1040
- errorMessage: L.error_msg || L.message || "请求失败"
1048
+ content: N.error_msg || N.message || "请求失败",
1049
+ errorMessage: N.error_msg || N.message || "请求失败"
1041
1050
  }, t.value = b), w.value = !1;
1042
1051
  break;
1043
1052
  }
1044
1053
  case "message_replace": {
1045
- const b = L.answer || "", T = a.value.get(n) || [], x = (S = T.map((R, Y) => ({ s: R, i: Y })).reverse().find((R) => R.s.type === "answer")) == null ? void 0 : S.i;
1046
- x != null ? T[x] = { ...T[x], content: b } : T.push({ type: "answer", content: b }), a.value.set(n, T), u((R) => {
1047
- if (R[n]) {
1048
- const Y = [...R];
1054
+ const b = N.answer || "", x = a.value.get(n) || [], M = (S = x.map(($, Y) => ({ s: $, i: Y })).reverse().find(($) => $.s.type === "answer")) == null ? void 0 : S.i;
1055
+ M != null ? x[M] = { ...x[M], content: b } : x.push({ type: "answer", content: b }), a.value.set(n, x), u(($) => {
1056
+ if ($[n]) {
1057
+ const Y = [...$];
1049
1058
  return Y[n] = {
1050
1059
  ...Y[n],
1051
- segments: T.map((H) => ({ ...H })),
1060
+ segments: x.map((H) => ({ ...H })),
1052
1061
  content: b
1053
1062
  }, Y;
1054
1063
  }
1055
- return R;
1064
+ return $;
1056
1065
  });
1057
1066
  break;
1058
1067
  }
1059
1068
  case "message_cost": {
1060
1069
  const b = {
1061
- inputTokens: L.input_tokens || 0,
1062
- outputTokens: L.output_tokens || 0,
1063
- latency: L.latency || 0,
1064
- latencyFirstResp: L.latency_first_resp
1070
+ inputTokens: N.input_tokens || 0,
1071
+ outputTokens: N.output_tokens || 0,
1072
+ latency: N.latency || 0,
1073
+ latencyFirstResp: N.latency_first_resp
1065
1074
  };
1066
- u((T) => {
1067
- if (T[n]) {
1068
- const x = [...T];
1069
- return x[n] = { ...x[n], cost: b }, x;
1075
+ u((x) => {
1076
+ if (x[n]) {
1077
+ const M = [...x];
1078
+ return M[n] = { ...M[n], cost: b }, M;
1070
1079
  }
1071
- return T;
1080
+ return x;
1072
1081
  });
1073
1082
  break;
1074
1083
  }
1075
1084
  default:
1076
1085
  }
1077
- } catch (z) {
1078
- console.error("[ai-assist-sdk] onmessage 解析失败:", z);
1086
+ } catch (q) {
1087
+ console.error("[ai-assist-sdk] onmessage 解析失败:", q);
1079
1088
  }
1080
1089
  },
1081
1090
  onclose() {
1082
- l(), I(n), l();
1083
- const W = (a.value.get(n) || []).filter(($) => $.type === "answer").map(($) => $.content).join(""), y = [...t.value];
1091
+ l(), G(n), l();
1092
+ const W = (a.value.get(n) || []).filter((L) => L.type === "answer").map((L) => L.content).join(""), y = [...t.value];
1084
1093
  y[n] && y[n].status !== h.ERROR && (y[n] = {
1085
1094
  ...y[n],
1086
- content: J.value && !W ? "已停止回答" : W,
1087
- status: J.value ? h.STOP : h.COMPLETED
1095
+ content: X.value && !W ? "已停止回答" : W,
1096
+ status: X.value ? h.STOP : h.COMPLETED
1088
1097
  }), t.value = y, w.value = !1;
1089
1098
  },
1090
- onerror(E) {
1091
- console.error("[ai-assist-sdk] ❌ 连接错误:", E), l();
1099
+ onerror(T) {
1100
+ console.error("[ai-assist-sdk] ❌ 连接错误:", T), l();
1092
1101
  const W = [...t.value];
1093
1102
  W[n] && (W[n] = { ...W[n], content: `
1094
1103
  ⚠️ 请求异常,已终止`, status: h.ERROR }), t.value = W, w.value = !1;
1095
1104
  }
1096
1105
  });
1097
- } catch (M) {
1098
- if (console.error("[ai-assist-sdk] doStreamRequest error:", M), !J.value) {
1106
+ } catch (D) {
1107
+ if (console.error("[ai-assist-sdk] doStreamRequest error:", D), !X.value) {
1099
1108
  l();
1100
- const E = [...t.value];
1101
- E[n] && (E[n] = { ...E[n], content: "服务连接失败,请稍后重试", status: h.ERROR }), t.value = E, w.value = !1;
1109
+ const T = [...t.value];
1110
+ T[n] && (T[n] = { ...T[n], content: "服务连接失败,请稍后重试", status: h.ERROR }), t.value = T, w.value = !1;
1102
1111
  }
1103
1112
  }
1104
1113
  }
1105
- return { doStreamRequest: _, issTop: J };
1114
+ return { doStreamRequest: _, issTop: X };
1106
1115
  }
1107
1116
  function Lt(t) {
1108
1117
  var w;
@@ -1123,10 +1132,10 @@ function Lt(t) {
1123
1132
  }
1124
1133
  return (t == null ? void 0 : t.answer) || ((w = t == null ? void 0 : t.data) == null ? void 0 : w.answer) || String(t || "");
1125
1134
  }
1126
- function Io(t) {
1135
+ function es(t) {
1127
1136
  return t.queryAgainStreamApi || t.queryAgainApi || t.chatQueryStreamApi || t.chatQueryApi;
1128
1137
  }
1129
- function es({
1138
+ function ts({
1130
1139
  messages: t,
1131
1140
  userInput: w,
1132
1141
  isGenerating: i,
@@ -1139,136 +1148,136 @@ function es({
1139
1148
  cfg: f,
1140
1149
  onTitleGenerated: k
1141
1150
  }) {
1142
- const N = f.apis, d = ge({
1151
+ const V = f.apis, p = ye({
1143
1152
  first: new AbortController(),
1144
1153
  again: new AbortController()
1145
- }), D = g(!1);
1146
- async function J(p, C) {
1147
- var E;
1148
- if (!f.titleGenerateApp || !N.updateConversationApi || D.value) return;
1149
- let M = l.value;
1150
- if (!M)
1154
+ }), R = g(!1);
1155
+ async function X(d, C) {
1156
+ var T;
1157
+ if (!f.titleGenerateApp || !V.updateConversationApi || R.value) return;
1158
+ let D = l.value;
1159
+ if (!D)
1151
1160
  try {
1152
- const W = await Mt(N);
1153
- (E = W == null ? void 0 : W.conversation) != null && E.appConversationID && (M = W.conversation.appConversationID, l.value = M);
1161
+ const W = await Mt(V);
1162
+ (T = W == null ? void 0 : W.conversation) != null && T.appConversationID && (D = W.conversation.appConversationID, l.value = D);
1154
1163
  } catch (W) {
1155
1164
  console.error("[ai-assist-sdk] 创建会话失败:", W);
1156
1165
  return;
1157
1166
  }
1158
- if (M)
1167
+ if (D)
1159
1168
  try {
1160
- const W = await En(N, f.titleGenerateApp);
1169
+ const W = await En(V, f.titleGenerateApp);
1161
1170
  if (!W) return;
1162
- const y = C.length > 500 ? C.slice(0, 500) : C, $ = `用户提问:${p}
1163
- AI回答:${y}`, S = await Rt().post(N.chatQueryApi, {
1171
+ const y = C.length > 500 ? C.slice(0, 500) : C, L = `用户提问:${d}
1172
+ AI回答:${y}`, S = await Rt().post(V.chatQueryApi, {
1164
1173
  app: f.titleGenerateApp,
1165
- data: { Query: $, AppConversationID: W }
1166
- }), z = Lt(S.data.data);
1167
- z && (await Tn(N, M, z), D.value = !0, k == null || k(z));
1174
+ data: { Query: L, AppConversationID: W }
1175
+ }), q = Lt(S.data.data);
1176
+ q && (await Tn(V, D, q), R.value = !0, k == null || k(q));
1168
1177
  } catch (W) {
1169
1178
  console.error("[ai-assist-sdk] 生成对话标题失败:", W);
1170
1179
  }
1171
1180
  }
1172
1181
  async function K() {
1173
1182
  var W;
1174
- const p = w.value.trim();
1175
- if (!p || i.value) return;
1176
- if (!l.value && (await B(), !l.value)) {
1183
+ const d = w.value.trim();
1184
+ if (!d || i.value) return;
1185
+ if (!l.value && (await te(), !l.value)) {
1177
1186
  Te("创建会话失败,请重试");
1178
1187
  return;
1179
1188
  }
1180
1189
  const C = t.value.length === 0;
1181
1190
  try {
1182
- (W = f.onMessageSend) == null || W.call(f, { text: p, isFirstMessage: C, conversationId: l.value });
1191
+ (W = f.onMessageSend) == null || W.call(f, { text: d, isFirstMessage: C, conversationId: l.value });
1183
1192
  } catch {
1184
1193
  }
1185
- const M = [
1194
+ const D = [
1186
1195
  ...t.value,
1187
- { type: "user", content: p },
1196
+ { type: "user", content: d },
1188
1197
  // streamed:标记该条由实时流产生,前端按序逐字揭示(后端批量转发,终态可能早于渲染)
1189
1198
  { type: "ai", content: "", status: r.THINKING, streamed: !0 }
1190
1199
  ];
1191
- t.value = M, w.value = "", a();
1192
- const E = M.length - 1;
1193
- if (N.chatQueryStreamApi) {
1194
- if (console.log("[ai-assist-sdk] ✅ 使用流式 SSE:", N.chatQueryStreamApi), await h(N.chatQueryStreamApi, {
1195
- Query: p,
1200
+ t.value = D, w.value = "", a();
1201
+ const T = D.length - 1;
1202
+ if (V.chatQueryStreamApi) {
1203
+ if (console.log("[ai-assist-sdk] ✅ 使用流式 SSE:", V.chatQueryStreamApi), await h(V.chatQueryStreamApi, {
1204
+ Query: d,
1196
1205
  AppConversationID: l.value,
1197
1206
  ResponseMode: "streaming"
1198
- }, E, d.first.signal), C && !D.value) {
1199
- const y = t.value[E];
1200
- y && y.status !== r.ERROR && J(p, y.content);
1207
+ }, T, p.first.signal), C && !R.value) {
1208
+ const y = t.value[T];
1209
+ y && y.status !== r.ERROR && X(d, y.content);
1201
1210
  }
1202
1211
  return;
1203
1212
  }
1204
1213
  console.warn("[ai-assist-sdk] ⚠️ 未配置 chatQueryStreamApi,降级为非流式请求");
1205
1214
  try {
1206
- const $ = await Rt().post(N.chatQueryApi, {
1215
+ const L = await Rt().post(V.chatQueryApi, {
1207
1216
  app: f.app ?? 1,
1208
- data: { Query: p, AppConversationID: l.value }
1209
- }), ne = Lt($.data);
1210
- t.value = [...t.value.slice(0, -1), { type: "ai", content: ne, status: r.COMPLETED }], C && !D.value && J(p, ne);
1217
+ data: { Query: d, AppConversationID: l.value }
1218
+ }), ne = Lt(L.data);
1219
+ t.value = [...t.value.slice(0, -1), { type: "ai", content: ne, status: r.COMPLETED }], C && !R.value && X(d, ne);
1211
1220
  } catch (y) {
1212
1221
  t.value = [...t.value.slice(0, -1), { type: "ai", content: (y == null ? void 0 : y.message) || "服务连接失败,请稍后重试", status: r.ERROR }];
1213
1222
  }
1214
1223
  }
1215
- async function I() {
1224
+ async function G() {
1216
1225
  if (!u.value || i.value) return;
1217
- d.again.abort(), d.again = new AbortController();
1218
- const p = [...t.value];
1219
- p.length > 0 && p[p.length - 1].type === "ai" && p.pop(), p.push({ type: "ai", content: "", status: r.RETHINKING, streamed: !0 }), t.value = p, a();
1220
- const C = t.value.length - 1, M = Io(N);
1221
- await h(M, {
1226
+ p.again.abort(), p.again = new AbortController();
1227
+ const d = [...t.value];
1228
+ d.length > 0 && d[d.length - 1].type === "ai" && d.pop(), d.push({ type: "ai", content: "", status: r.RETHINKING, streamed: !0 }), t.value = d, a();
1229
+ const C = t.value.length - 1, D = es(V);
1230
+ await h(D, {
1222
1231
  MessageID: u.value,
1223
1232
  AppConversationID: l.value,
1224
1233
  ResponseMode: "streaming"
1225
- }, C, d.again.signal, !0);
1234
+ }, C, p.again.signal, !0);
1226
1235
  }
1227
1236
  async function _() {
1228
1237
  if (!i.value) return;
1229
- const p = t.value.length - 1 - 1;
1230
- if (u.value && N.stopMessageApi)
1238
+ const d = t.value.length - 1 - 1;
1239
+ if (u.value && V.stopMessageApi)
1231
1240
  try {
1232
- await Sn(N, u.value);
1233
- } catch (M) {
1234
- const E = [...t.value];
1235
- E[p] && (E[p] = { ...E[p], content: (M == null ? void 0 : M.message) || "系统繁忙,请稍后再试", status: r.ERROR }), t.value = E;
1241
+ await Sn(V, u.value);
1242
+ } catch (D) {
1243
+ const T = [...t.value];
1244
+ T[d] && (T[d] = { ...T[d], content: (D == null ? void 0 : D.message) || "系统繁忙,请稍后再试", status: r.ERROR }), t.value = T;
1236
1245
  return;
1237
1246
  }
1238
1247
  const C = [...t.value];
1239
- C[p] && (C[p] = { ...C[p], content: C[p].content || "已停止回答", status: r.STOP }), t.value = C, i.value = !1, d.first.abort(), d.first = new AbortController(), d.again.abort(), d.again = new AbortController(), s.value = !0;
1248
+ C[d] && (C[d] = { ...C[d], content: C[d].content || "已停止回答", status: r.STOP }), t.value = C, i.value = !1, p.first.abort(), p.first = new AbortController(), p.again.abort(), p.again = new AbortController(), s.value = !0;
1240
1249
  }
1241
- async function X(p) {
1250
+ async function E(d) {
1242
1251
  var C;
1243
- l.value = p, D.value = !0;
1252
+ l.value = d, R.value = !0;
1244
1253
  try {
1245
- const M = await bn(N, p), E = [], W = An(M == null ? void 0 : M.messages);
1254
+ const D = await bn(V, d), T = [], W = An(D == null ? void 0 : D.messages);
1246
1255
  for (const y of W)
1247
- y.query && E.push({ type: "user", content: y.query }), (C = y.answerInfo) != null && C.answer && E.push({ type: "ai", content: y.answerInfo.answer, status: r.COMPLETED });
1248
- t.value = E, a();
1249
- } catch (M) {
1250
- Te((M == null ? void 0 : M.message) || "加载历史会话失败");
1256
+ y.query && T.push({ type: "user", content: y.query }), (C = y.answerInfo) != null && C.answer && T.push({ type: "ai", content: y.answerInfo.answer, status: r.COMPLETED });
1257
+ t.value = T, a();
1258
+ } catch (D) {
1259
+ Te((D == null ? void 0 : D.message) || "加载历史会话失败");
1251
1260
  }
1252
1261
  }
1253
- async function B() {
1254
- var p;
1255
- D.value = !1;
1262
+ async function te() {
1263
+ var d;
1264
+ R.value = !1;
1256
1265
  try {
1257
- const C = await Mt(N);
1258
- (p = C == null ? void 0 : C.conversation) != null && p.appConversationID && (l.value = C.conversation.appConversationID);
1266
+ const C = await Mt(V);
1267
+ (d = C == null ? void 0 : C.conversation) != null && d.appConversationID && (l.value = C.conversation.appConversationID);
1259
1268
  } catch (C) {
1260
1269
  Te((C == null ? void 0 : C.message) || "创建会话失败");
1261
1270
  }
1262
1271
  }
1263
1272
  function n() {
1264
- l.value = "", D.value = !1;
1273
+ l.value = "", R.value = !1;
1265
1274
  }
1266
- return { sendMessage: K, regenerateResponse: I, toggleStop: _, goHistoryMessage: X, initConversation: B, resetConversation: n, controllers: d };
1275
+ return { sendMessage: K, regenerateResponse: G, toggleStop: _, goHistoryMessage: E, initConversation: te, resetConversation: n, controllers: p };
1267
1276
  }
1268
- const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "message ai-message greet-message" }, ss = { class: "ai-greet" }, as = ["src"], is = {
1277
+ const ns = { class: "container" }, os = { class: "chat-wrap" }, ss = { class: "message ai-message greet-message" }, as = { class: "ai-greet" }, is = ["src"], ls = {
1269
1278
  key: 0,
1270
1279
  class: "message ai-message recommend-message"
1271
- }, ls = { class: "ai-recommend" }, us = { class: "recommend-header" }, rs = ["src"], cs = ["onClick"], vs = /* @__PURE__ */ Se({
1280
+ }, us = { class: "ai-recommend" }, rs = { class: "recommend-header" }, cs = ["src"], vs = ["onClick"], ds = /* @__PURE__ */ Ee({
1272
1281
  __name: "Answer",
1273
1282
  props: {
1274
1283
  defaultSayhello: {},
@@ -1284,259 +1293,259 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
1284
1293
  COMPLETED: "completed",
1285
1294
  STOP: "stop",
1286
1295
  ERROR: "error"
1287
- }, l = t, h = i, s = qe(), a = g([]), r = g(""), f = g(!1), k = g(""), N = g(""), d = g(null), D = ge({ text1: "", text2: "" }), J = g([]), K = g(0), I = O(
1288
- () => J.value[K.value % (J.value.length || 1)]
1296
+ }, l = t, h = i, s = qe(), a = g([]), r = g(""), f = g(!1), k = g(""), V = g(""), p = g(null), R = ye({ text1: "", text2: "" }), X = g([]), K = g(0), G = B(
1297
+ () => X.value[K.value % (X.value.length || 1)]
1289
1298
  );
1290
1299
  function _() {
1291
1300
  K.value++;
1292
1301
  }
1293
- function X(j) {
1302
+ function E(j) {
1294
1303
  r.value = j;
1295
1304
  }
1296
- const { isAtBottom: B, hasScroll: n, scrollToBottom: p, checkScrollStatus: C } = Go(d), { enhanceCodeBlocks: M } = jo(), { batchMessagesUpdate: E, flushMessagesBatch: W } = Uo(a), { doStreamRequest: y, issTop: $ } = Zo({
1305
+ const { isAtBottom: te, hasScroll: n, scrollToBottom: d, checkScrollStatus: C } = jo(p), { enhanceCodeBlocks: D } = Uo(), { batchMessagesUpdate: T, flushMessagesBatch: W } = Zo(a), { doStreamRequest: y, issTop: L } = Io({
1297
1306
  messages: a,
1298
1307
  isGenerating: f,
1299
1308
  lastUserMessage: k,
1300
- batchMessagesUpdate: E,
1309
+ batchMessagesUpdate: T,
1301
1310
  flushMessagesBatch: W,
1302
1311
  STATUS: u,
1303
1312
  cfg: s
1304
- }), { sendMessage: ne, regenerateResponse: S, toggleStop: z, goHistoryMessage: L, resetConversation: b } = es({
1313
+ }), { sendMessage: ne, regenerateResponse: S, toggleStop: q, goHistoryMessage: N, resetConversation: b } = ts({
1305
1314
  messages: a,
1306
1315
  userInput: r,
1307
1316
  isGenerating: f,
1308
1317
  lastUserMessage: k,
1309
- conversationId: N,
1318
+ conversationId: V,
1310
1319
  doStreamRequest: y,
1311
- issTop: $,
1312
- scrollToBottom: p,
1320
+ issTop: L,
1321
+ scrollToBottom: d,
1313
1322
  STATUS: u,
1314
1323
  cfg: s,
1315
1324
  onTitleGenerated: (j) => h("title-generated", j)
1316
1325
  });
1317
- function T() {
1326
+ function x() {
1318
1327
  a.value = [], k.value = "", b();
1319
1328
  }
1320
- const x = O(() => a.value.length === 0);
1321
- w({ goHistoryMessage: L, createNewConversation: T, isEmptyConversation: x });
1322
- const R = g(/* @__PURE__ */ new Map());
1329
+ const M = B(() => a.value.length === 0);
1330
+ w({ goHistoryMessage: N, createNewConversation: x, isEmptyConversation: M });
1331
+ const $ = g(/* @__PURE__ */ new Map());
1323
1332
  function Y(j, Z) {
1324
- j ? R.value.set(Z, j) : R.value.delete(Z);
1333
+ j ? $.value.set(Z, j) : $.value.delete(Z);
1325
1334
  }
1326
- ce(a, () => {
1335
+ ve(a, () => {
1327
1336
  me(() => {
1328
- R.value.forEach((j) => {
1329
- M(j);
1337
+ $.value.forEach((j) => {
1338
+ D(j);
1330
1339
  }), C();
1331
1340
  });
1332
1341
  }, { deep: !0 });
1333
1342
  let H = null;
1334
- _e(() => {
1335
- l.defaultSayhello && (D.text1 = l.defaultSayhello.text1, D.text2 = l.defaultSayhello.text2), l.defaultRecommend && (J.value = xn(l.defaultRecommend));
1336
- }), _e(() => {
1337
- d.value && (H = () => C(), d.value.addEventListener("scroll", H), C());
1343
+ be(() => {
1344
+ l.defaultSayhello && (R.text1 = l.defaultSayhello.text1, R.text2 = l.defaultSayhello.text2), l.defaultRecommend && (X.value = xn(l.defaultRecommend));
1345
+ }), be(() => {
1346
+ p.value && (H = () => C(), p.value.addEventListener("scroll", H), C());
1338
1347
  });
1339
1348
  const F = g(null);
1340
- let oe = !1, le = 0, V = 0;
1341
- function Q(j) {
1349
+ let oe = !1, le = 0, de = 0;
1350
+ function ke(j) {
1342
1351
  var ae;
1343
- const Z = (ae = d.value) == null ? void 0 : ae.closest(".chat-wrap");
1352
+ const Z = (ae = p.value) == null ? void 0 : ae.closest(".chat-wrap");
1344
1353
  return parseFloat((Z == null ? void 0 : Z.style.getPropertyValue(j)) ?? "") || 0;
1345
1354
  }
1346
- function ee(j) {
1355
+ function P(j) {
1347
1356
  return "touches" in j ? j.touches[0].clientY : j.clientY;
1348
1357
  }
1349
- function ve(j) {
1350
- const Z = d.value;
1351
- Z && (j.preventDefault(), oe = !0, le = ee(j), Z.scrollTop, V = Q("--ai-thumb-top"), window.addEventListener("mousemove", de), window.addEventListener("mouseup", we), window.addEventListener("touchmove", de, { passive: !1 }), window.addEventListener("touchend", we));
1358
+ function Q(j) {
1359
+ const Z = p.value;
1360
+ Z && (j.preventDefault(), oe = !0, le = P(j), Z.scrollTop, de = ke("--ai-thumb-top"), window.addEventListener("mousemove", I), window.addEventListener("mouseup", ue), window.addEventListener("touchmove", I, { passive: !1 }), window.addEventListener("touchend", ue));
1352
1361
  }
1353
- function de(j) {
1354
- const Z = d.value;
1362
+ function I(j) {
1363
+ const Z = p.value;
1355
1364
  if (!oe || !Z) return;
1356
1365
  j.preventDefault();
1357
- const ae = ee(j) - le, te = Z.clientHeight, ke = Z.scrollHeight, Re = Q("--ai-thumb-height"), ze = te - Re, lt = Math.min(Math.max(V + ae, 0), ze);
1358
- Z.scrollTop = lt / ze * (ke - te);
1366
+ const ae = P(j) - le, ee = Z.clientHeight, Ce = Z.scrollHeight, Re = ke("--ai-thumb-height"), ze = ee - Re, lt = Math.min(Math.max(de + ae, 0), ze);
1367
+ Z.scrollTop = lt / ze * (Ce - ee);
1359
1368
  }
1360
- function we() {
1361
- oe = !1, window.removeEventListener("mousemove", de), window.removeEventListener("mouseup", we), window.removeEventListener("touchmove", de), window.removeEventListener("touchend", we);
1369
+ function ue() {
1370
+ oe = !1, window.removeEventListener("mousemove", I), window.removeEventListener("mouseup", ue), window.removeEventListener("touchmove", I), window.removeEventListener("touchend", ue);
1362
1371
  }
1363
- function Ee(j) {
1364
- const Z = d.value, ae = F.value;
1372
+ function ge(j) {
1373
+ const Z = p.value, ae = F.value;
1365
1374
  if (!Z || !ae) return;
1366
1375
  j.preventDefault();
1367
- const te = ae.getBoundingClientRect(), Re = (ee(j) - te.top) / te.height;
1376
+ const ee = ae.getBoundingClientRect(), Re = (P(j) - ee.top) / ee.height;
1368
1377
  Z.scrollTop = Re * (Z.scrollHeight - Z.clientHeight);
1369
1378
  }
1370
1379
  return Pe(() => {
1371
- d.value && H && d.value.removeEventListener("scroll", H), we();
1380
+ p.value && H && p.value.removeEventListener("scroll", H), ue();
1372
1381
  }), (j, Z) => {
1373
1382
  var ae;
1374
- return v(), m("div", ts, [
1375
- o("div", ns, [
1383
+ return v(), m("div", ns, [
1384
+ o("div", os, [
1376
1385
  o("div", {
1377
1386
  class: "chat-box scrollWrap",
1378
1387
  ref_key: "chatBoxRef",
1379
- ref: d
1388
+ ref: p
1380
1389
  }, [
1381
- o("div", os, [
1382
- o("div", ss, [
1383
- o("img", { src: P(Qt) }, null, 8, as),
1384
- o("h1", null, G(D.text1), 1),
1385
- o("p", null, G(D.text2), 1)
1390
+ o("div", ss, [
1391
+ o("div", as, [
1392
+ o("img", { src: O(Qt) }, null, 8, is),
1393
+ o("h1", null, z(R.text1), 1),
1394
+ o("p", null, z(R.text2), 1)
1386
1395
  ])
1387
1396
  ]),
1388
- (ae = I.value) != null && ae.length ? (v(), m("div", is, [
1389
- o("div", ls, [
1390
- o("div", us, [
1397
+ (ae = G.value) != null && ae.length ? (v(), m("div", ls, [
1398
+ o("div", us, [
1399
+ o("div", rs, [
1391
1400
  Z[2] || (Z[2] = o("span", null, "你可以尝试这样问我:", -1)),
1392
1401
  o("p", {
1393
1402
  class: "refresh-btn",
1394
1403
  onClick: _
1395
1404
  }, [
1396
- o("img", { src: P(Un) }, null, 8, rs),
1405
+ o("img", { src: O(Un) }, null, 8, cs),
1397
1406
  Z[1] || (Z[1] = o("span", null, "换一换", -1))
1398
1407
  ])
1399
1408
  ]),
1400
1409
  o("ul", null, [
1401
- (v(!0), m(ye, null, xe(I.value, (te, ke) => (v(), m("li", {
1402
- key: ke,
1403
- onClick: (Re) => X(te)
1404
- }, G(te), 9, cs))), 128))
1410
+ (v(!0), m(we, null, xe(G.value, (ee, Ce) => (v(), m("li", {
1411
+ key: Ce,
1412
+ onClick: (Re) => E(ee)
1413
+ }, z(ee), 9, vs))), 128))
1405
1414
  ])
1406
1415
  ])
1407
- ])) : q("", !0),
1408
- (v(!0), m(ye, null, xe(a.value, (te, ke) => (v(), pe(Lo, {
1409
- key: ke,
1410
- msg: te,
1411
- index: ke,
1416
+ ])) : J("", !0),
1417
+ (v(!0), m(we, null, xe(a.value, (ee, Ce) => (v(), pe(Lo, {
1418
+ key: Ce,
1419
+ msg: ee,
1420
+ index: Ce,
1412
1421
  STATUS: u,
1413
1422
  setMessageRef: Y,
1414
- scrollToBottom: P(p),
1415
- onRegenerate: P(S)
1423
+ scrollToBottom: O(d),
1424
+ onRegenerate: O(S)
1416
1425
  }, null, 8, ["msg", "index", "scrollToBottom", "onRegenerate"]))), 128))
1417
1426
  ], 512),
1418
1427
  o("div", {
1419
1428
  ref_key: "scrollbarRef",
1420
1429
  ref: F,
1421
1430
  class: "chat-box__scrollbar",
1422
- onMousedown: fe(Ee, ["prevent"]),
1423
- onTouchstart: fe(Ee, ["prevent"])
1431
+ onMousedown: fe(ge, ["prevent"]),
1432
+ onTouchstart: fe(ge, ["prevent"])
1424
1433
  }, [
1425
1434
  o("div", {
1426
1435
  class: "chat-box__scrollbar-thumb",
1427
- onMousedown: fe(ve, ["stop", "prevent"]),
1428
- onTouchstart: fe(ve, ["stop", "prevent"])
1436
+ onMousedown: fe(Q, ["stop", "prevent"]),
1437
+ onTouchstart: fe(Q, ["stop", "prevent"])
1429
1438
  }, null, 32)
1430
1439
  ], 544)
1431
1440
  ]),
1432
- ie(Ko, {
1441
+ ie(Go, {
1433
1442
  modelValue: r.value,
1434
- "onUpdate:modelValue": Z[0] || (Z[0] = (te) => r.value = te),
1443
+ "onUpdate:modelValue": Z[0] || (Z[0] = (ee) => r.value = ee),
1435
1444
  isGenerating: f.value,
1436
- hasScroll: P(n),
1437
- isAtBottom: P(B),
1438
- onSend: P(ne),
1439
- onRegenerate: P(S),
1440
- onStop: P(z),
1441
- onScrollToBottom: P(p)
1445
+ hasScroll: O(n),
1446
+ isAtBottom: O(te),
1447
+ onSend: O(ne),
1448
+ onRegenerate: O(S),
1449
+ onStop: O(q),
1450
+ onScrollToBottom: O(d)
1442
1451
  }, null, 8, ["modelValue", "isGenerating", "hasScroll", "isAtBottom", "onSend", "onRegenerate", "onStop", "onScrollToBottom"]),
1443
1452
  Z[3] || (Z[3] = o("div", { class: "ai-mistake-tip" }, "AI也会犯错,请核实重要信息", -1))
1444
1453
  ]);
1445
1454
  };
1446
1455
  }
1447
- }), ds = { class: "ai-history" }, hs = { class: "content" }, ps = {
1456
+ }), hs = { class: "ai-history" }, ps = { class: "content" }, ms = {
1448
1457
  key: 0,
1449
1458
  class: "ai-history-loading"
1450
- }, ms = { class: "ai-history-group-title" }, fs = ["onClick"], gs = { class: "ai-history-item-title" }, ys = ["onClick"], ws = {
1459
+ }, fs = { class: "ai-history-group-title" }, gs = ["onClick"], ys = { class: "ai-history-item-title" }, ws = ["onClick"], ks = {
1451
1460
  key: 2,
1452
1461
  class: "ai-history-empty"
1453
- }, ks = ["src"], Cs = { class: "ai-modal" }, _s = { class: "ai-modal-footer" }, bs = /* @__PURE__ */ Se({
1462
+ }, Cs = ["src"], _s = { class: "ai-modal" }, bs = { class: "ai-modal-footer" }, As = /* @__PURE__ */ Ee({
1454
1463
  __name: "History",
1455
1464
  emits: ["history-detail", "new-conversation"],
1456
1465
  setup(t, { emit: w }) {
1457
- const u = qe().apis, l = g([]), h = g(!0), s = g(!1), a = g(""), r = O(() => Dn(l.value));
1466
+ const u = qe().apis, l = g([]), h = g(!0), s = g(!1), a = g(""), r = B(() => Dn(l.value));
1458
1467
  async function f() {
1459
1468
  try {
1460
- const d = await Mn(u);
1461
- d != null && d.conversationList && (l.value = d.conversationList.filter((D) => D !== null).map((D) => ({ ...D, selected: !1 })));
1462
- } catch (d) {
1463
- Te((d == null ? void 0 : d.message) || "获取历史记录失败");
1469
+ const p = await Mn(u);
1470
+ p != null && p.conversationList && (l.value = p.conversationList.filter((R) => R !== null).map((R) => ({ ...R, selected: !1 })));
1471
+ } catch (p) {
1472
+ Te((p == null ? void 0 : p.message) || "获取历史记录失败");
1464
1473
  } finally {
1465
1474
  h.value = !1;
1466
1475
  }
1467
1476
  }
1468
- function k(d) {
1469
- a.value = d, s.value = !0;
1477
+ function k(p) {
1478
+ a.value = p, s.value = !0;
1470
1479
  }
1471
- async function N() {
1480
+ async function V() {
1472
1481
  s.value = !1;
1473
1482
  try {
1474
1483
  await Rn(u, a.value), await f();
1475
- } catch (d) {
1476
- Te((d == null ? void 0 : d.message) || "删除失败"), await f();
1484
+ } catch (p) {
1485
+ Te((p == null ? void 0 : p.message) || "删除失败"), await f();
1477
1486
  }
1478
1487
  }
1479
- return _e(() => {
1488
+ return be(() => {
1480
1489
  f();
1481
- }), (d, D) => (v(), m("div", ds, [
1482
- o("div", hs, [
1483
- h.value ? (v(), m("div", ps, [...D[3] || (D[3] = [
1490
+ }), (p, R) => (v(), m("div", hs, [
1491
+ o("div", ps, [
1492
+ h.value ? (v(), m("div", ms, [...R[3] || (R[3] = [
1484
1493
  o("div", { class: "ai-history-spinner" }, null, -1)
1485
- ])])) : r.value.length > 0 ? (v(!0), m(ye, { key: 1 }, xe(r.value, (J) => (v(), m("div", {
1486
- key: J.label,
1494
+ ])])) : r.value.length > 0 ? (v(!0), m(we, { key: 1 }, xe(r.value, (X) => (v(), m("div", {
1495
+ key: X.label,
1487
1496
  class: "ai-history-group"
1488
1497
  }, [
1489
- o("div", ms, G(J.label), 1),
1490
- (v(!0), m(ye, null, xe(J.items, (K, I) => (v(), m("div", {
1498
+ o("div", fs, z(X.label), 1),
1499
+ (v(!0), m(we, null, xe(X.items, (K, G) => (v(), m("div", {
1491
1500
  key: K.appConversationID,
1492
1501
  class: "ai-history-item",
1493
- style: it({ "--i": I }),
1494
- onClick: (_) => d.$emit("history-detail", K.appConversationID)
1502
+ style: it({ "--i": G }),
1503
+ onClick: (_) => p.$emit("history-detail", K.appConversationID)
1495
1504
  }, [
1496
- o("div", gs, G(K.conversationName), 1),
1505
+ o("div", ys, z(K.conversationName), 1),
1497
1506
  o("div", {
1498
1507
  class: "ai-history-item-delete",
1499
1508
  onClick: fe((_) => k(K.appConversationID), ["stop"])
1500
- }, "删除", 8, ys)
1501
- ], 12, fs))), 128))
1502
- ]))), 128)) : (v(), m("div", ws, "暂无历史记录"))
1509
+ }, "删除", 8, ws)
1510
+ ], 12, gs))), 128))
1511
+ ]))), 128)) : (v(), m("div", ks, "暂无历史记录"))
1503
1512
  ]),
1504
1513
  o("div", {
1505
1514
  class: "ai-add",
1506
- onClick: D[0] || (D[0] = (J) => d.$emit("new-conversation"))
1515
+ onClick: R[0] || (R[0] = (X) => p.$emit("new-conversation"))
1507
1516
  }, [
1508
- o("img", { src: P(Fn) }, null, 8, ks),
1509
- D[4] || (D[4] = o("span", null, "新建AI对话", -1))
1517
+ o("img", { src: O(Fn) }, null, 8, Cs),
1518
+ R[4] || (R[4] = o("span", null, "新建AI对话", -1))
1510
1519
  ]),
1511
1520
  (v(), pe(Yt, { to: "#ai-assist-root" }, [
1512
1521
  s.value ? (v(), m("div", {
1513
1522
  key: 0,
1514
1523
  class: "ai-modal-overlay",
1515
- onClick: D[2] || (D[2] = fe((J) => s.value = !1, ["self"]))
1524
+ onClick: R[2] || (R[2] = fe((X) => s.value = !1, ["self"]))
1516
1525
  }, [
1517
- o("div", Cs, [
1518
- D[5] || (D[5] = o("div", { class: "ai-modal-header" }, "确定要删除该历史记录吗?", -1)),
1519
- D[6] || (D[6] = o("div", { class: "ai-modal-body" }, "一旦删除,数据将无法恢复。", -1)),
1520
- o("div", _s, [
1526
+ o("div", _s, [
1527
+ R[5] || (R[5] = o("div", { class: "ai-modal-header" }, "确定要删除该历史记录吗?", -1)),
1528
+ R[6] || (R[6] = o("div", { class: "ai-modal-body" }, "一旦删除,数据将无法恢复。", -1)),
1529
+ o("div", bs, [
1521
1530
  o("button", {
1522
1531
  class: "ai-modal-btn cancel",
1523
- onClick: D[1] || (D[1] = (J) => s.value = !1)
1532
+ onClick: R[1] || (R[1] = (X) => s.value = !1)
1524
1533
  }, "取消"),
1525
1534
  o("button", {
1526
1535
  class: "ai-modal-btn confirm",
1527
- onClick: N
1536
+ onClick: V
1528
1537
  }, "确定")
1529
1538
  ])
1530
1539
  ])
1531
- ])) : q("", !0)
1540
+ ])) : J("", !0)
1532
1541
  ]))
1533
1542
  ]));
1534
1543
  }
1535
- }), As = { class: "container info" }, Ss = { class: "info-item" }, Es = { class: "basic-content" }, Ts = { class: "basic-content-text" }, xs = { class: "basic-content" }, Ds = { class: "basic-content-text" }, Ms = { class: "info-item" }, Rs = { class: "permission-content" }, Hs = { class: "info-item" }, $s = { class: "basic-content" }, Ls = { class: "basic-content-text" }, Ps = { class: "basic-content" }, Os = { class: "basic-content-text" }, Bs = /* @__PURE__ */ Se({
1544
+ }), Ss = { class: "container info" }, Es = { class: "info-item" }, Ts = { class: "basic-content" }, xs = { class: "basic-content-text" }, Ds = { class: "basic-content" }, Ms = { class: "basic-content-text" }, Rs = { class: "info-item" }, Hs = { class: "permission-content" }, $s = { class: "info-item" }, Ls = { class: "basic-content" }, Ps = { class: "basic-content-text" }, Os = { class: "basic-content" }, Bs = { class: "basic-content-text" }, Ws = /* @__PURE__ */ Ee({
1536
1545
  __name: "Info",
1537
1546
  setup(t) {
1538
1547
  const w = qe(), i = g(null);
1539
- return _e(async () => {
1548
+ return be(async () => {
1540
1549
  try {
1541
1550
  i.value = await Hn(w.apis);
1542
1551
  } catch (u) {
@@ -1544,87 +1553,87 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
1544
1553
  }
1545
1554
  }), (u, l) => {
1546
1555
  var h, s, a, r, f;
1547
- return v(), m("div", As, [
1548
- o("div", Ss, [
1556
+ return v(), m("div", Ss, [
1557
+ o("div", Es, [
1549
1558
  l[2] || (l[2] = o("div", { class: "heading" }, [
1550
1559
  o("div", { class: "heading-column" }),
1551
1560
  o("div", { class: "heading-title" }, "基本信息")
1552
1561
  ], -1)),
1553
- o("div", Es, [
1562
+ o("div", Ts, [
1554
1563
  l[0] || (l[0] = o("div", { class: "basic-content-text basic-content-key" }, "姓名", -1)),
1555
- o("div", Ts, G(((h = i.value) == null ? void 0 : h.name) || ""), 1)
1564
+ o("div", xs, z(((h = i.value) == null ? void 0 : h.name) || ""), 1)
1556
1565
  ]),
1557
- o("div", xs, [
1566
+ o("div", Ds, [
1558
1567
  l[1] || (l[1] = o("div", { class: "basic-content-text basic-content-key" }, "用户名", -1)),
1559
- o("div", Ds, G(((s = i.value) == null ? void 0 : s.userName) || ""), 1)
1568
+ o("div", Ms, z(((s = i.value) == null ? void 0 : s.userName) || ""), 1)
1560
1569
  ])
1561
1570
  ]),
1562
- o("div", Ms, [
1571
+ o("div", Rs, [
1563
1572
  l[3] || (l[3] = o("div", { class: "heading" }, [
1564
1573
  o("div", { class: "heading-column" }),
1565
1574
  o("div", { class: "heading-title" }, "数据权限")
1566
1575
  ], -1)),
1567
- o("div", Rs, [
1568
- (v(!0), m(ye, null, xe((a = i.value) == null ? void 0 : a.ptnameList, (k, N) => (v(), m("div", {
1569
- key: N,
1576
+ o("div", Hs, [
1577
+ (v(!0), m(we, null, xe((a = i.value) == null ? void 0 : a.ptnameList, (k, V) => (v(), m("div", {
1578
+ key: V,
1570
1579
  class: "permission-content-text"
1571
- }, G(k), 1))), 128))
1580
+ }, z(k), 1))), 128))
1572
1581
  ])
1573
1582
  ]),
1574
- o("div", Hs, [
1583
+ o("div", $s, [
1575
1584
  l[6] || (l[6] = o("div", { class: "heading" }, [
1576
1585
  o("div", { class: "heading-column" }),
1577
1586
  o("div", { class: "heading-title" }, "帮助信息")
1578
1587
  ], -1)),
1579
- o("div", $s, [
1588
+ o("div", Ls, [
1580
1589
  l[4] || (l[4] = o("div", { class: "basic-content-text basic-content-key" }, "部门", -1)),
1581
- o("div", Ls, G(((r = i.value) == null ? void 0 : r.dept) || ""), 1)
1590
+ o("div", Ps, z(((r = i.value) == null ? void 0 : r.dept) || ""), 1)
1582
1591
  ]),
1583
- o("div", Ps, [
1592
+ o("div", Os, [
1584
1593
  l[5] || (l[5] = o("div", { class: "basic-content-text basic-content-key" }, "邮箱", -1)),
1585
- o("div", Os, G(((f = i.value) == null ? void 0 : f.email) || ""), 1)
1594
+ o("div", Bs, z(((f = i.value) == null ? void 0 : f.email) || ""), 1)
1586
1595
  ])
1587
1596
  ])
1588
1597
  ]);
1589
1598
  };
1590
1599
  }
1591
- }), Ws = { key: 1 }, Ys = ["src"], Ns = { class: "header-title" }, Vs = ["title"], Xs = { class: "ai-history-drawer-panel" }, Fs = { class: "ai-history-drawer-header" }, Qs = { class: "setTitle" }, Js = { class: "content" }, qs = { class: "main" }, zs = { class: "btn" }, Ks = ["src"], Gs = 78, Xe = 78, he = 8, Fe = 26, Le = 490, Pt = "aiPanelPosition", Ot = "aiPanelDocked", Bt = "aiDockWidth", js = 60, Us = 150, Wt = 400, Zs = 320, Jt = /* @__PURE__ */ Se({
1600
+ }), Ys = { key: 1 }, Ns = ["src"], Vs = { class: "header-title" }, Xs = ["title"], Fs = { class: "ai-history-drawer-panel" }, Qs = { class: "ai-history-drawer-header" }, Js = { class: "setTitle" }, qs = { class: "content" }, zs = { class: "main" }, Ks = { class: "btn" }, Gs = ["src"], js = 78, Xe = 78, he = 8, Fe = 26, Le = 490, Pt = "aiPanelPosition", Ot = "aiPanelDocked", Bt = "aiDockWidth", Us = 60, Zs = 150, Wt = 400, Is = 320, Jt = /* @__PURE__ */ Ee({
1592
1601
  __name: "AiAssist",
1593
1602
  setup(t) {
1594
1603
  var xt;
1595
- const w = Gs / 2, i = qe(), u = g(!1), l = g("idle"), h = g(!1), s = ge({ x: 0, y: 0, w: 78, h: 78, radius: "14px" }), a = g(!1), r = g(window.innerWidth < 768), f = g(window.innerWidth < 768), k = g("answer"), N = g(!1), d = g(""), D = g(""), J = g(""), K = g(!1), I = g(!1), _ = ge({
1604
+ const w = js / 2, i = qe(), u = g(!1), l = g("idle"), h = g(!1), s = ye({ x: 0, y: 0, w: 78, h: 78, radius: "14px" }), a = g(!1), r = g(window.innerWidth < 768), f = g(window.innerWidth < 768), k = g("answer"), V = g(!1), p = g(""), R = g(""), X = g(""), K = g(!1), G = g(!1), _ = ye({
1596
1605
  x: window.innerWidth - w,
1597
1606
  y: window.innerHeight / 2 - Xe / 2
1598
- }), X = g(!1), B = g(!1), n = g("right"), p = g("left"), C = g(null), M = ge({ x: 0, y: 0 }), E = g(!1), W = g(!1), y = ge({ x: 0, y: 0 }), $ = g(!1), ne = ge({ x: 0, y: 0 }), S = g(!1), z = g(!1), L = g(!1), b = ge({ x: 0, width: 0 }), T = g(!1);
1599
- let x = 0;
1600
- const R = g("idle"), Y = g(!1), H = g("none"), F = ge({ x: 0, y: 0, w: Le, h: 0, radius: "14px" });
1601
- let oe = null, le = !1, V = !1;
1602
- const Q = ge({ x: 0, y: 0 }), ee = g(!1), ve = g(null);
1603
- let de = null, we = null, Ee = null;
1604
- const j = O(() => {
1607
+ }), E = g(!1), te = g(!1), n = g("right"), d = g("left"), C = g(null), D = ye({ x: 0, y: 0 }), T = g(!1), W = g(!1), y = ye({ x: 0, y: 0 }), L = g(!1), ne = ye({ x: 0, y: 0 }), S = g(!1), q = g(!1), N = g(!1), b = ye({ x: 0, width: 0 }), x = g(!1);
1608
+ let M = 0;
1609
+ const $ = g("idle"), Y = g(!1), H = g("none"), F = ye({ x: 0, y: 0, w: Le, h: 0, radius: "14px" });
1610
+ let oe = null, le = !1, de = !1;
1611
+ const ke = ye({ x: 0, y: 0 }), P = g(!1), Q = g(null);
1612
+ let I = null, ue = null, ge = null;
1613
+ const j = B(() => {
1605
1614
  const e = window.innerWidth / 2;
1606
1615
  return _.x + w < e ? 5 : -5;
1607
- }), Z = O(() => f.value || S.value || R.value !== "idle" ? "" : `panel-${n.value}`), ae = O(() => {
1616
+ }), Z = B(() => f.value || S.value || $.value !== "idle" ? "" : `panel-${n.value}`), ae = B(() => {
1608
1617
  var e;
1609
1618
  return !!((e = i.dock) != null && e.containerId) && !r.value;
1610
- }), te = g(((xt = i.dock) == null ? void 0 : xt.width) || Le), ke = O(() => i.panelDraggable !== !1), Re = O(() => {
1619
+ }), ee = g(((xt = i.dock) == null ? void 0 : xt.width) || Le), Ce = B(() => i.panelDraggable !== !1), Re = B(() => {
1611
1620
  var e;
1612
- return !((e = ve.value) != null && e.isEmptyConversation);
1613
- }), ze = O(() => ({
1621
+ return !((e = Q.value) != null && e.isEmptyConversation);
1622
+ }), ze = B(() => ({
1614
1623
  left: `${_.x}px`,
1615
1624
  top: `${_.y}px`,
1616
- transition: X.value ? "none" : "all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1)",
1625
+ transition: E.value ? "none" : "all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1)",
1617
1626
  "--direction": String(j.value)
1618
- })), lt = O(() => i.characterImage || Qn), qt = O(() => l.value === "idle" ? {} : {
1627
+ })), lt = B(() => i.characterImage || Qn), qt = B(() => l.value === "idle" ? {} : {
1619
1628
  left: `${s.x}px`,
1620
1629
  top: `${s.y}px`,
1621
1630
  width: `${s.w}px`,
1622
1631
  height: `${s.h}px`,
1623
1632
  borderRadius: s.radius
1624
- }), zt = O(() => {
1633
+ }), zt = B(() => {
1625
1634
  const e = {};
1626
- return E.value && !f.value && !r.value && !S.value && (e["--ai-panel-x"] = `${M.x}px`, e["--ai-panel-y"] = `${M.y}px`), S.value && (e["--ai-dock-width"] = `${te.value}px`), e;
1627
- }), Kt = O(() => R.value === "idle" ? {} : {
1635
+ return T.value && !f.value && !r.value && !S.value && (e["--ai-panel-x"] = `${D.x}px`, e["--ai-panel-y"] = `${D.y}px`), S.value && (e["--ai-dock-width"] = `${ee.value}px`), e;
1636
+ }), Kt = B(() => $.value === "idle" ? {} : {
1628
1637
  left: `${F.x}px`,
1629
1638
  top: `${F.y}px`,
1630
1639
  width: `${F.w}px`,
@@ -1633,22 +1642,22 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
1633
1642
  });
1634
1643
  function Ke() {
1635
1644
  const e = window.innerWidth / 2;
1636
- _.x + w < e ? (n.value = "left", p.value = "right") : (n.value = "right", p.value = "left");
1645
+ _.x + w < e ? (n.value = "left", d.value = "right") : (n.value = "right", d.value = "left");
1637
1646
  }
1638
1647
  function Gt() {
1639
1648
  const e = window.innerWidth, c = Math.max(0, Math.min(_.y, window.innerHeight - Xe));
1640
1649
  return { x: _.x + w >= e / 2 ? e - w : -w, y: c };
1641
1650
  }
1642
1651
  function pt() {
1643
- B.value = !0;
1652
+ te.value = !0;
1644
1653
  const e = Gt();
1645
1654
  _.x = e.x, _.y = e.y, setTimeout(() => {
1646
- B.value = !1, Ke(), jt();
1655
+ te.value = !1, Ke(), jt();
1647
1656
  }, 400);
1648
1657
  }
1649
1658
  function jt() {
1650
1659
  try {
1651
- localStorage.setItem("characterPosition", JSON.stringify({ x: _.x, y: _.y })), localStorage.setItem("panelPosition", n.value), localStorage.setItem("backPosition", p.value);
1660
+ localStorage.setItem("characterPosition", JSON.stringify({ x: _.x, y: _.y })), localStorage.setItem("panelPosition", n.value), localStorage.setItem("backPosition", d.value);
1652
1661
  } catch {
1653
1662
  }
1654
1663
  }
@@ -1660,20 +1669,20 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
1660
1669
  } else
1661
1670
  _.x = window.innerWidth - w, _.y = window.innerHeight / 2 - Xe / 2;
1662
1671
  const c = localStorage.getItem("panelPosition"), A = localStorage.getItem("backPosition");
1663
- c && (n.value = c), A && (p.value = A);
1672
+ c && (n.value = c), A && (d.value = A);
1664
1673
  }
1665
1674
  function Ge(e) {
1666
- if (!X.value) return;
1667
- const c = "touches" in e ? e.touches[0].clientX : e.clientX, A = "touches" in e ? e.touches[0].clientY : e.clientY, U = c - Q.x, ue = Math.max(0, Math.min(A - Q.y, window.innerHeight - Xe)), Ce = Math.abs(U - _.x), be = Math.abs(ue - _.y);
1668
- Ce + be > 5 && (ee.value = !0), _.x = U, _.y = ue;
1675
+ if (!E.value) return;
1676
+ const c = "touches" in e ? e.touches[0].clientX : e.clientX, A = "touches" in e ? e.touches[0].clientY : e.clientY, U = c - ke.x, re = Math.max(0, Math.min(A - ke.y, window.innerHeight - Xe)), _e = Math.abs(U - _.x), Ae = Math.abs(re - _.y);
1677
+ _e + Ae > 5 && (P.value = !0), _.x = U, _.y = re;
1669
1678
  }
1670
1679
  function je() {
1671
- X.value && (X.value = !1, ee.value && (pt(), ee.value = !1));
1680
+ E.value && (E.value = !1, P.value && (pt(), P.value = !1));
1672
1681
  }
1673
1682
  function mt(e) {
1674
- B.value = !1, X.value = !0, ee.value = !1;
1683
+ te.value = !1, E.value = !0, P.value = !1;
1675
1684
  const c = "touches" in e ? e.touches[0].clientX : e.clientX, A = "touches" in e ? e.touches[0].clientY : e.clientY;
1676
- Q.x = c - _.x, Q.y = A - _.y;
1685
+ ke.x = c - _.x, ke.y = A - _.y;
1677
1686
  }
1678
1687
  function Zt() {
1679
1688
  const e = C.value, c = (e == null ? void 0 : e.offsetWidth) || Le, A = (e == null ? void 0 : e.offsetHeight) || window.innerHeight - 78;
@@ -1683,48 +1692,48 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
1683
1692
  };
1684
1693
  }
1685
1694
  function Ue(e, c) {
1686
- const A = C.value, U = e ?? (A == null ? void 0 : A.offsetWidth) ?? Le, ue = c ?? (A == null ? void 0 : A.offsetHeight) ?? window.innerHeight - 78, Ce = Math.max(he, window.innerWidth - U - he), be = Math.max(Fe, window.innerHeight - ue - he);
1687
- M.x = Math.min(Math.max(M.x, he), Ce), M.y = Math.min(Math.max(M.y, Fe), be);
1695
+ const A = C.value, U = e ?? (A == null ? void 0 : A.offsetWidth) ?? Le, re = c ?? (A == null ? void 0 : A.offsetHeight) ?? window.innerHeight - 78, _e = Math.max(he, window.innerWidth - U - he), Ae = Math.max(Fe, window.innerHeight - re - he);
1696
+ D.x = Math.min(Math.max(D.x, he), _e), D.y = Math.min(Math.max(D.y, Fe), Ae);
1688
1697
  }
1689
1698
  function ft(e) {
1690
- if (!ke.value || f.value || r.value || S.value || l.value !== "idle") return;
1691
- if (V = !1, W.value = !0, $.value = !1, !E.value) {
1699
+ if (!Ce.value || f.value || r.value || S.value || l.value !== "idle") return;
1700
+ if (de = !1, W.value = !0, L.value = !1, !T.value) {
1692
1701
  const U = C.value;
1693
1702
  if (U) {
1694
- const ue = U.getBoundingClientRect();
1695
- M.x = ue.left, M.y = ue.top, E.value = !0;
1703
+ const re = U.getBoundingClientRect();
1704
+ D.x = re.left, D.y = re.top, T.value = !0;
1696
1705
  }
1697
1706
  }
1698
1707
  const c = "touches" in e ? e.touches[0].clientX : e.clientX, A = "touches" in e ? e.touches[0].clientY : e.clientY;
1699
- ne.x = c, ne.y = A, y.x = c - M.x, y.y = A - M.y;
1708
+ ne.x = c, ne.y = A, y.x = c - D.x, y.y = A - D.y;
1700
1709
  }
1701
1710
  function Ze(e) {
1702
- var Ae, Dt;
1711
+ var Se, Dt;
1703
1712
  if (!W.value) return;
1704
1713
  const c = "touches" in e ? e.touches[0].clientX : e.clientX, A = "touches" in e ? e.touches[0].clientY : e.clientY;
1705
- if (!$.value) {
1714
+ if (!L.value) {
1706
1715
  const fn = Math.abs(c - ne.x), gn = Math.abs(A - ne.y);
1707
1716
  if (fn + gn <= 5) return;
1708
- $.value = !0;
1717
+ L.value = !0;
1709
1718
  }
1710
- const { maxX: U, maxY: ue } = Zt(), Ce = ae.value ? U + Us : U, be = Math.min(Math.max(c - y.x, he), Ce), $e = Math.min(Math.max(A - y.y, Fe), ue), De = ae.value && be > U + js;
1711
- De !== V && (V = De, (Dt = (Ae = i.dock) == null ? void 0 : Ae.onDockChange) == null || Dt.call(Ae, De)), z.value = De, M.x = be, M.y = $e;
1719
+ const { maxX: U, maxY: re } = Zt(), _e = ae.value ? U + Zs : U, Ae = Math.min(Math.max(c - y.x, he), _e), $e = Math.min(Math.max(A - y.y, Fe), re), De = ae.value && Ae > U + Us;
1720
+ De !== de && (de = De, (Dt = (Se = i.dock) == null ? void 0 : Se.onDockChange) == null || Dt.call(Se, De)), q.value = De, D.x = Ae, D.y = $e;
1712
1721
  }
1713
1722
  function Ie() {
1714
1723
  var c, A;
1715
1724
  if (!W.value) return;
1716
1725
  W.value = !1;
1717
1726
  let e = !1;
1718
- $.value && ($.value = !1, le = !0, setTimeout(() => {
1727
+ L.value && (L.value = !1, le = !0, setTimeout(() => {
1719
1728
  le = !1;
1720
- }, 0), z.value && ae.value ? (kt(), e = !0) : (Ue(), It())), V && !e && (V = !1, (A = (c = i.dock) == null ? void 0 : c.onDockChange) == null || A.call(c, !1)), z.value = !1;
1729
+ }, 0), q.value && ae.value ? (kt(), e = !0) : (Ue(), It())), de && !e && (de = !1, (A = (c = i.dock) == null ? void 0 : c.onDockChange) == null || A.call(c, !1)), q.value = !1;
1721
1730
  }
1722
1731
  function gt(e) {
1723
1732
  le && (e.preventDefault(), e.stopPropagation(), le = !1);
1724
1733
  }
1725
1734
  function It() {
1726
1735
  try {
1727
- localStorage.setItem(Pt, JSON.stringify({ x: M.x, y: M.y }));
1736
+ localStorage.setItem(Pt, JSON.stringify({ x: D.x, y: D.y }));
1728
1737
  } catch {
1729
1738
  }
1730
1739
  }
@@ -1733,7 +1742,7 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
1733
1742
  const e = localStorage.getItem(Pt);
1734
1743
  if (e) {
1735
1744
  const c = JSON.parse(e);
1736
- typeof c.x == "number" && typeof c.y == "number" && (M.x = c.x, M.y = c.y, E.value = !0);
1745
+ typeof c.x == "number" && typeof c.y == "number" && (D.x = c.x, D.y = c.y, T.value = !0);
1737
1746
  }
1738
1747
  } catch {
1739
1748
  }
@@ -1756,9 +1765,9 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
1756
1765
  }
1757
1766
  function et() {
1758
1767
  return {
1759
- x: window.innerWidth - te.value,
1768
+ x: window.innerWidth - ee.value,
1760
1769
  y: 0,
1761
- w: te.value,
1770
+ w: ee.value,
1762
1771
  h: window.innerHeight,
1763
1772
  radius: "0px"
1764
1773
  };
@@ -1786,19 +1795,19 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
1786
1795
  f.value ? (He(wt(), bt()), f.value = !1) : (He(Oe(), wt()), f.value = !0);
1787
1796
  }
1788
1797
  function He(e, c, A, U = "none") {
1789
- oe && clearTimeout(oe), R.value = "switching", Y.value = !0, H.value = U, F.x = e.x, F.y = e.y, F.w = e.w, F.h = e.h, F.radius = e.radius, me(() => {
1798
+ oe && clearTimeout(oe), $.value = "switching", Y.value = !0, H.value = U, F.x = e.x, F.y = e.y, F.w = e.w, F.h = e.h, F.radius = e.radius, me(() => {
1790
1799
  requestAnimationFrame(() => {
1791
1800
  Y.value = !1, F.x = c.x, F.y = c.y, F.w = c.w, F.h = c.h, F.radius = c.radius;
1792
1801
  });
1793
1802
  }), oe = setTimeout(() => {
1794
- R.value = "idle", H.value = "none", oe = null, A == null || A();
1803
+ $.value = "idle", H.value = "none", oe = null, A == null || A();
1795
1804
  }, 400);
1796
1805
  }
1797
1806
  function kt() {
1798
- var ue, Ce, be, $e, De;
1807
+ var re, _e, Ae, $e, De;
1799
1808
  if (!ae.value || S.value) return;
1800
1809
  f.value && (f.value = !1);
1801
- const e = (ue = i.dock) == null ? void 0 : ue.containerId;
1810
+ const e = (re = i.dock) == null ? void 0 : re.containerId;
1802
1811
  if (e && !document.getElementById(e)) {
1803
1812
  console.warn(`[ai-assist-sdk] dock container "#${e}" not found, dock feature disabled`);
1804
1813
  return;
@@ -1806,21 +1815,21 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
1806
1815
  const c = C.value;
1807
1816
  let A = Oe();
1808
1817
  if (c) {
1809
- const Ae = c.getBoundingClientRect();
1810
- A = { x: Ae.left, y: Ae.top, w: Ae.width, h: Ae.height, radius: getComputedStyle(c).borderRadius };
1818
+ const Se = c.getBoundingClientRect();
1819
+ A = { x: Se.left, y: Se.top, w: Se.width, h: Se.height, radius: getComputedStyle(c).borderRadius };
1811
1820
  }
1812
1821
  const U = et();
1813
- He(A, U), S.value = !0, l.value = "idle", z.value = !1, yt(), (be = (Ce = i.dock) == null ? void 0 : Ce.onDockChange) == null || be.call(Ce, !0), (De = ($e = i.dock) == null ? void 0 : $e.onDockWidthChange) == null || De.call($e, te.value);
1822
+ He(A, U), S.value = !0, l.value = "idle", q.value = !1, yt(), (Ae = (_e = i.dock) == null ? void 0 : _e.onDockChange) == null || Ae.call(_e, !0), (De = ($e = i.dock) == null ? void 0 : $e.onDockWidthChange) == null || De.call($e, ee.value);
1814
1823
  }
1815
1824
  function sn() {
1816
- return Math.max(Wt, window.innerWidth - Zs);
1825
+ return Math.max(Wt, window.innerWidth - Is);
1817
1826
  }
1818
1827
  function ut(e) {
1819
1828
  return Math.min(Math.max(e, Wt), sn());
1820
1829
  }
1821
1830
  function an() {
1822
1831
  try {
1823
- localStorage.setItem(Bt, String(te.value));
1832
+ localStorage.setItem(Bt, String(ee.value));
1824
1833
  } catch {
1825
1834
  }
1826
1835
  }
@@ -1829,39 +1838,39 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
1829
1838
  const e = localStorage.getItem(Bt);
1830
1839
  if (e) {
1831
1840
  const c = parseFloat(e);
1832
- Number.isFinite(c) && (te.value = ut(c));
1841
+ Number.isFinite(c) && (ee.value = ut(c));
1833
1842
  }
1834
1843
  } catch {
1835
1844
  }
1836
1845
  }
1837
1846
  function Ct(e) {
1838
1847
  if (!S.value) return;
1839
- L.value = !0, T.value = !1;
1848
+ N.value = !0, x.value = !1;
1840
1849
  const c = "touches" in e ? e.touches[0].clientX : e.clientX;
1841
- b.x = c, b.width = te.value;
1850
+ b.x = c, b.width = ee.value;
1842
1851
  }
1843
1852
  function tt(e) {
1844
- if (!L.value) return;
1853
+ if (!N.value) return;
1845
1854
  const c = "touches" in e ? e.touches[0].clientX : e.clientX, A = ut(b.width + (b.x - c));
1846
- Math.abs(A - b.width) > 3 && (T.value = !0), te.value = A, x || (x = requestAnimationFrame(() => {
1847
- var U, ue;
1848
- x = 0, (ue = (U = i.dock) == null ? void 0 : U.onDockWidthChange) == null || ue.call(U, te.value);
1855
+ Math.abs(A - b.width) > 3 && (x.value = !0), ee.value = A, M || (M = requestAnimationFrame(() => {
1856
+ var U, re;
1857
+ M = 0, (re = (U = i.dock) == null ? void 0 : U.onDockWidthChange) == null || re.call(U, ee.value);
1849
1858
  }));
1850
1859
  }
1851
1860
  function nt() {
1852
1861
  var e, c;
1853
- L.value && (L.value = !1, T.value && (T.value = !1, an(), (c = (e = i.dock) == null ? void 0 : e.onDockWidthChange) == null || c.call(e, te.value)));
1862
+ N.value && (N.value = !1, x.value && (x.value = !1, an(), (c = (e = i.dock) == null ? void 0 : e.onDockWidthChange) == null || c.call(e, ee.value)));
1854
1863
  }
1855
1864
  function _t() {
1856
1865
  var e, c;
1857
- S.value && (E.value ? Ue(Le, window.innerHeight - 78) : Ke(), He(et(), Oe()), S.value = !1, yt(), (c = (e = i.dock) == null ? void 0 : e.onDockChange) == null || c.call(e, !1));
1866
+ S.value && (T.value ? Ue(Le, window.innerHeight - 78) : Ke(), He(et(), Oe()), S.value = !1, yt(), (c = (e = i.dock) == null ? void 0 : e.onDockChange) == null || c.call(e, !1));
1858
1867
  }
1859
1868
  function un() {
1860
1869
  var e, c;
1861
- if (!ee.value && !B.value) {
1870
+ if (!P.value && !te.value) {
1862
1871
  if (S.value) {
1863
1872
  He(
1864
- { x: window.innerWidth, y: 0, w: te.value, h: window.innerHeight, radius: "0px" },
1873
+ { x: window.innerWidth, y: 0, w: ee.value, h: window.innerHeight, radius: "0px" },
1865
1874
  et(),
1866
1875
  void 0,
1867
1876
  "in"
@@ -1878,7 +1887,7 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
1878
1887
  l.value = "idle";
1879
1888
  }, 400);
1880
1889
  } else
1881
- ee.value = !1;
1890
+ P.value = !1;
1882
1891
  }
1883
1892
  function Oe() {
1884
1893
  if (window.innerWidth < 768)
@@ -1912,7 +1921,7 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
1912
1921
  function bt() {
1913
1922
  const e = Le, c = window.innerHeight - 78;
1914
1923
  let A = 54, U;
1915
- return E.value ? (U = Math.min(Math.max(M.x, he), Math.max(he, window.innerWidth - e - he)), A = Math.min(Math.max(M.y, Fe), Math.max(he, c - he))) : U = n.value === "left" ? 24 : window.innerWidth - e - 24, { x: U, y: A, w: e, h: c, radius: "14px" };
1924
+ return T.value ? (U = Math.min(Math.max(D.x, he), Math.max(he, window.innerWidth - e - he)), A = Math.min(Math.max(D.y, Fe), Math.max(he, c - he))) : U = n.value === "left" ? 24 : window.innerWidth - e - 24, { x: U, y: A, w: e, h: c, radius: "14px" };
1916
1925
  }
1917
1926
  function rn() {
1918
1927
  var c, A;
@@ -1939,36 +1948,36 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
1939
1948
  function cn(e) {
1940
1949
  Be(), k.value = "answer", me(() => {
1941
1950
  var c;
1942
- (c = ve.value) == null || c.goHistoryMessage(e);
1951
+ (c = Q.value) == null || c.goHistoryMessage(e);
1943
1952
  });
1944
1953
  }
1945
1954
  function vn() {
1946
- J.value = "", k.value = "answer", me(() => {
1955
+ X.value = "", k.value = "answer", me(() => {
1947
1956
  var e;
1948
- (e = ve.value) == null || e.createNewConversation();
1957
+ (e = Q.value) == null || e.createNewConversation();
1949
1958
  });
1950
1959
  }
1951
1960
  function dn() {
1952
- Be(), J.value = "", me(() => {
1961
+ Be(), X.value = "", me(() => {
1953
1962
  var e;
1954
- (e = ve.value) == null || e.createNewConversation();
1963
+ (e = Q.value) == null || e.createNewConversation();
1955
1964
  });
1956
1965
  }
1957
1966
  function hn() {
1958
- I.value = !1, K.value = !0;
1967
+ G.value = !1, K.value = !0;
1959
1968
  }
1960
1969
  function Be() {
1961
- I.value = !0, setTimeout(() => {
1962
- K.value = !1, I.value = !1;
1970
+ G.value = !0, setTimeout(() => {
1971
+ K.value = !1, G.value = !1;
1963
1972
  }, 300);
1964
1973
  }
1965
1974
  function pn() {
1966
- D.value = d.value, N.value = !1;
1975
+ R.value = p.value, V.value = !1;
1967
1976
  }
1968
- ce(f, (e) => {
1977
+ ve(f, (e) => {
1969
1978
  e ? n.value = "center" : Ke();
1970
- }), ce(u, (e) => {
1971
- e && E.value && me(() => Ue());
1979
+ }), ve(u, (e) => {
1980
+ e && T.value && me(() => Ue());
1972
1981
  });
1973
1982
  const mn = Math.max(1e3, Number(i.activityInterval) || 3e4);
1974
1983
  let ot = null, We = 0, st = 0, at = 0;
@@ -2006,31 +2015,31 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
2006
2015
  function Et() {
2007
2016
  !u.value || document.visibilityState === "hidden" || (We = Date.now(), rt());
2008
2017
  }
2009
- ce(u, (e) => {
2018
+ ve(u, (e) => {
2010
2019
  e ? (Ye("open"), document.visibilityState !== "hidden" && rt()) : (Ne(), Ye("close"));
2011
- }), _e(() => {
2020
+ }), be(() => {
2012
2021
  document.addEventListener("visibilitychange", At), window.addEventListener("pagehide", St), window.addEventListener("pageshow", Et);
2013
2022
  }), Pe(() => {
2014
2023
  Ne(), document.removeEventListener("visibilitychange", At), window.removeEventListener("pagehide", St), window.removeEventListener("pageshow", Et);
2015
- }), _e(() => {
2024
+ }), be(() => {
2016
2025
  Ut(), en(), tn(), ln();
2017
2026
  const e = i.theme || "light";
2018
- ht(e), e === "auto" && (we = $n(() => ht("auto"))), Ee = Jn(() => C.value);
2027
+ ht(e), e === "auto" && (ue = $n(() => ht("auto"))), ge = Jn(() => C.value);
2019
2028
  });
2020
2029
  function Tt() {
2021
- de && clearTimeout(de), de = setTimeout(() => {
2030
+ I && clearTimeout(I), I = setTimeout(() => {
2022
2031
  const e = window.innerWidth < 768;
2023
- r.value = e, e && (f.value = !0, S.value && _t()), pt(), E.value && Ue(), S.value && (te.value = ut(te.value));
2032
+ r.value = e, e && (f.value = !0, S.value && _t()), pt(), T.value && Ue(), S.value && (ee.value = ut(ee.value));
2024
2033
  }, 100);
2025
2034
  }
2026
- return _e(() => {
2035
+ return be(() => {
2027
2036
  window.addEventListener("resize", Tt);
2028
2037
  }), Pe(() => {
2029
- window.removeEventListener("resize", Tt), de && clearTimeout(de), we == null || we(), Ee == null || Ee(), Ee = null;
2030
- }), _e(() => {
2038
+ window.removeEventListener("resize", Tt), I && clearTimeout(I), ue == null || ue(), ge == null || ge(), ge = null;
2039
+ }), be(() => {
2031
2040
  document.addEventListener("mousemove", Ge), document.addEventListener("touchmove", Ge, { passive: !0 }), document.addEventListener("mouseup", je), document.addEventListener("touchend", je), document.addEventListener("mousemove", Ze), document.addEventListener("touchmove", Ze, { passive: !0 }), document.addEventListener("mouseup", Ie), document.addEventListener("touchend", Ie), document.addEventListener("click", gt, !0), document.addEventListener("mousemove", tt), document.addEventListener("touchmove", tt, { passive: !0 }), document.addEventListener("mouseup", nt), document.addEventListener("touchend", nt);
2032
2041
  }), Pe(() => {
2033
- document.removeEventListener("mousemove", Ge), document.removeEventListener("touchmove", Ge), document.removeEventListener("mouseup", je), document.removeEventListener("touchend", je), document.removeEventListener("mousemove", Ze), document.removeEventListener("touchmove", Ze), document.removeEventListener("mouseup", Ie), document.removeEventListener("touchend", Ie), document.removeEventListener("click", gt, !0), document.removeEventListener("mousemove", tt), document.removeEventListener("touchmove", tt), document.removeEventListener("mouseup", nt), document.removeEventListener("touchend", nt), oe && clearTimeout(oe), x && cancelAnimationFrame(x);
2042
+ document.removeEventListener("mousemove", Ge), document.removeEventListener("touchmove", Ge), document.removeEventListener("mouseup", je), document.removeEventListener("touchend", je), document.removeEventListener("mousemove", Ze), document.removeEventListener("touchmove", Ze), document.removeEventListener("mouseup", Ie), document.removeEventListener("touchend", Ie), document.removeEventListener("click", gt, !0), document.removeEventListener("mousemove", tt), document.removeEventListener("touchmove", tt), document.removeEventListener("mouseup", nt), document.removeEventListener("touchend", nt), oe && clearTimeout(oe), M && cancelAnimationFrame(M);
2034
2043
  }), (e, c) => (v(), m("div", null, [
2035
2044
  Me(o("div", {
2036
2045
  ref_key: "panelRef",
@@ -2040,16 +2049,16 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
2040
2049
  f.value ? "maxWrap" : "minWrap",
2041
2050
  Z.value,
2042
2051
  {
2043
- "panel-custom": E.value && !f.value && !r.value && !S.value && R.value === "idle",
2052
+ "panel-custom": T.value && !f.value && !r.value && !S.value && $.value === "idle",
2044
2053
  dragging: W.value,
2045
- "dock-preview": z.value,
2054
+ "dock-preview": q.value,
2046
2055
  docked: S.value,
2047
- "dock-resizing": L.value,
2048
- "dock-switching": R.value !== "idle",
2056
+ "dock-resizing": N.value,
2057
+ "dock-switching": $.value !== "idle",
2049
2058
  "dock-switch-instant": Y.value,
2050
2059
  "dock-switch-fade-in": H.value === "in",
2051
2060
  "dock-switch-fade-out": H.value === "out",
2052
- "no-drag": !ke.value
2061
+ "no-drag": !Ce.value
2053
2062
  },
2054
2063
  l.value !== "idle" ? l.value : "",
2055
2064
  { morphing: l.value !== "idle", "morph-instant": h.value }
@@ -2061,7 +2070,7 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
2061
2070
  class: "ai-dock-resizer",
2062
2071
  onMousedown: fe(Ct, ["stop"]),
2063
2072
  onTouchstart: fe(Ct, ["stop"])
2064
- }, null, 32)) : q("", !0),
2073
+ }, null, 32)) : J("", !0),
2065
2074
  o("div", {
2066
2075
  class: "header",
2067
2076
  onMousedown: ft,
@@ -2069,159 +2078,159 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
2069
2078
  }, [
2070
2079
  k.value === "info" ? (v(), m("span", {
2071
2080
  key: 0,
2072
- class: se(["back", p.value]),
2081
+ class: se(["back", d.value]),
2073
2082
  onClick: c[0] || (c[0] = (A) => k.value = "answer")
2074
2083
  }, [...c[5] || (c[5] = [
2075
2084
  o("span", { style: { "font-size": "14px" } }, "←", -1)
2076
- ])], 2)) : (v(), m("p", Ws, [
2085
+ ])], 2)) : (v(), m("p", Ys, [
2077
2086
  o("img", {
2078
- src: P(Qt),
2087
+ src: O(Qt),
2079
2088
  draggable: "false"
2080
- }, null, 8, Ys)
2089
+ }, null, 8, Ns)
2081
2090
  ])),
2082
- o("div", Ns, [
2091
+ o("div", Vs, [
2083
2092
  o("span", {
2084
- title: k.value === "info" ? "个人信息" : J.value || P(i).name
2085
- }, G(k.value === "info" ? "个人信息" : J.value || P(i).name), 9, Vs)
2093
+ title: k.value === "info" ? "个人信息" : X.value || O(i).name
2094
+ }, z(k.value === "info" ? "个人信息" : X.value || O(i).name), 9, Xs)
2086
2095
  ]),
2087
2096
  o("p", null, [
2088
- Me(ie(P(re), {
2097
+ Me(ie(O(ce), {
2089
2098
  class: "op-icon",
2090
2099
  icon: "ic:round-add",
2091
2100
  onClick: vn
2092
2101
  }, null, 512), [
2093
2102
  [Ve, Re.value]
2094
2103
  ]),
2095
- ie(P(re), {
2104
+ ie(O(ce), {
2096
2105
  class: se(["mute", { active: K.value }]),
2097
2106
  icon: "ic:round-history",
2098
2107
  onClick: c[1] || (c[1] = (A) => K.value ? Be() : hn())
2099
2108
  }, null, 8, ["class"]),
2100
- !r.value && !S.value ? (v(), pe(P(re), {
2109
+ !r.value && !S.value ? (v(), pe(O(ce), {
2101
2110
  key: 0,
2102
2111
  onClick: on,
2103
2112
  icon: f.value ? "ic:round-fullscreen-exit" : "ic:round-fullscreen"
2104
- }, null, 8, ["icon"])) : q("", !0),
2105
- S.value ? (v(), pe(P(re), {
2113
+ }, null, 8, ["icon"])) : J("", !0),
2114
+ S.value ? (v(), pe(O(ce), {
2106
2115
  key: 1,
2107
2116
  icon: "material-symbols:float-landscape-2-outline-rounded",
2108
2117
  onClick: _t
2109
- })) : q("", !0),
2110
- ae.value && !S.value ? (v(), pe(P(re), {
2118
+ })) : J("", !0),
2119
+ ae.value && !S.value ? (v(), pe(O(ce), {
2111
2120
  key: 2,
2112
2121
  icon: "boxicons:arrow-in-up-right-stroke-square",
2113
2122
  onClick: kt,
2114
2123
  class: "__minimize"
2115
- })) : q("", !0),
2116
- ie(P(re), {
2124
+ })) : J("", !0),
2125
+ ie(O(ce), {
2117
2126
  onClick: rn,
2118
2127
  icon: "ic:round-close"
2119
2128
  })
2120
2129
  ])
2121
2130
  ], 32),
2122
- Me(ie(vs, {
2131
+ Me(ie(ds, {
2123
2132
  ref_key: "answerRef",
2124
- ref: ve,
2125
- defaultSayhello: P(i).defaultSayhello,
2126
- defaultRecommend: P(i).defaultRecommend,
2127
- onTitleGenerated: c[2] || (c[2] = (A) => J.value = A)
2133
+ ref: Q,
2134
+ defaultSayhello: O(i).defaultSayhello,
2135
+ defaultRecommend: O(i).defaultRecommend,
2136
+ onTitleGenerated: c[2] || (c[2] = (A) => X.value = A)
2128
2137
  }, null, 8, ["defaultSayhello", "defaultRecommend"]), [
2129
2138
  [Ve, k.value === "answer"]
2130
2139
  ]),
2131
- k.value === "info" ? (v(), pe(Bs, { key: 1 })) : q("", !0),
2140
+ k.value === "info" ? (v(), pe(Ws, { key: 1 })) : J("", !0),
2132
2141
  K.value ? (v(), m("div", {
2133
2142
  key: 2,
2134
- class: se(["ai-history-drawer", { closing: I.value }])
2143
+ class: se(["ai-history-drawer", { closing: G.value }])
2135
2144
  }, [
2136
2145
  o("div", {
2137
2146
  class: "ai-history-backdrop",
2138
2147
  onClick: Be
2139
2148
  }),
2140
- o("div", Xs, [
2141
- o("div", Fs, [
2149
+ o("div", Fs, [
2150
+ o("div", Qs, [
2142
2151
  c[6] || (c[6] = o("span", null, "对话记录", -1)),
2143
- ie(P(re), {
2152
+ ie(O(ce), {
2144
2153
  icon: "ic:round-close",
2145
2154
  class: "ai-history-drawer-close",
2146
2155
  onClick: Be
2147
2156
  })
2148
2157
  ]),
2149
- ie(bs, {
2158
+ ie(As, {
2150
2159
  onHistoryDetail: cn,
2151
2160
  onNewConversation: dn
2152
2161
  })
2153
2162
  ])
2154
- ], 2)) : q("", !0),
2155
- Me(o("div", Qs, [
2156
- o("div", Js, [
2157
- o("div", qs, [
2163
+ ], 2)) : J("", !0),
2164
+ Me(o("div", Js, [
2165
+ o("div", qs, [
2166
+ o("div", zs, [
2158
2167
  c[7] || (c[7] = o("p", { class: "title" }, "修改标题", -1)),
2159
2168
  Me(o("textarea", {
2160
- "onUpdate:modelValue": c[3] || (c[3] = (A) => d.value = A),
2169
+ "onUpdate:modelValue": c[3] || (c[3] = (A) => p.value = A),
2161
2170
  placeholder: "请输入新标题"
2162
2171
  }, null, 512), [
2163
- [Vt, d.value]
2172
+ [Vt, p.value]
2164
2173
  ]),
2165
- o("p", zs, [
2174
+ o("p", Ks, [
2166
2175
  o("span", {
2167
- onClick: c[4] || (c[4] = (A) => N.value = !1)
2176
+ onClick: c[4] || (c[4] = (A) => V.value = !1)
2168
2177
  }, "取消"),
2169
2178
  o("span", { onClick: pn }, "确定")
2170
2179
  ])
2171
2180
  ])
2172
2181
  ])
2173
2182
  ], 512), [
2174
- [Ve, N.value]
2183
+ [Ve, V.value]
2175
2184
  ])
2176
2185
  ], 6), [
2177
2186
  [Ve, u.value || l.value !== "idle"]
2178
2187
  ]),
2179
- z.value && ae.value ? (v(), m("div", {
2188
+ q.value && ae.value ? (v(), m("div", {
2180
2189
  key: 0,
2181
2190
  class: "ai-dock-preview",
2182
- style: it({ width: te.value + "px" })
2191
+ style: it({ width: ee.value + "px" })
2183
2192
  }, [...c[8] || (c[8] = [
2184
2193
  o("span", { class: "ai-dock-preview__text" }, "松开以停靠到右侧", -1)
2185
- ])], 4)) : q("", !0),
2194
+ ])], 4)) : J("", !0),
2186
2195
  Me(o("div", {
2187
- class: se(["character", { dragging: X.value, recycling: B.value, "hover-preview": a.value }]),
2196
+ class: se(["character", { dragging: E.value, recycling: te.value, "hover-preview": a.value }]),
2188
2197
  style: it(ze.value),
2189
2198
  onMousedown: mt,
2190
2199
  onTouchstart: mt,
2191
2200
  onClick: un
2192
2201
  }, [
2193
- o("img", { src: lt.value }, null, 8, Ks)
2202
+ o("img", { src: lt.value }, null, 8, Gs)
2194
2203
  ], 38), [
2195
2204
  [Ve, !u.value]
2196
2205
  ])
2197
2206
  ]));
2198
2207
  }
2199
- }), Is = ["data-theme"], ea = {
2208
+ }), ea = ["data-theme"], ta = {
2200
2209
  key: 0,
2201
2210
  class: "ai-voice-input-final"
2202
- }, ta = {
2211
+ }, na = {
2203
2212
  key: 1,
2204
2213
  class: "ai-voice-input-interim"
2205
- }, na = {
2214
+ }, oa = {
2206
2215
  key: 2,
2207
2216
  class: "ai-voice-input-cursor"
2208
- }, oa = {
2217
+ }, sa = {
2209
2218
  key: 3,
2210
2219
  class: "ai-voice-input-placeholder"
2211
- }, sa = ["disabled"], aa = {
2220
+ }, aa = ["disabled"], ia = {
2212
2221
  key: 0,
2213
2222
  class: "ai-voice-input-pulse"
2214
- }, ia = {
2223
+ }, la = {
2215
2224
  key: 1,
2216
2225
  class: "ai-voice-input-wave"
2217
- }, la = {
2226
+ }, ua = {
2218
2227
  key: 2,
2219
2228
  class: "ai-voice-input-btn-icon",
2220
2229
  viewBox: "0 0 24 24",
2221
2230
  fill: "currentColor",
2222
2231
  width: "16",
2223
2232
  height: "16"
2224
- }, ua = /* @__PURE__ */ Se({
2233
+ }, ra = /* @__PURE__ */ Ee({
2225
2234
  __name: "VoiceInput",
2226
2235
  props: {
2227
2236
  lang: {},
@@ -2245,34 +2254,34 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
2245
2254
  error: "重试"
2246
2255
  }, s = g(""), a = g(""), r = g("idle"), f = Qe.isSupported();
2247
2256
  let k = null;
2248
- const N = O(() => Ln(u.theme)), d = () => ({
2257
+ const V = B(() => Ln(u.theme)), p = () => ({
2249
2258
  lang: u.lang,
2250
2259
  continuous: u.continuous,
2251
2260
  interimResults: u.interimResults
2252
- }), D = () => {
2253
- f && (k = new Qe(d(), {
2254
- onStatusChange: (p) => {
2255
- r.value = p, l("statusChange", p), p === "idle" && l("complete", s.value);
2261
+ }), R = () => {
2262
+ f && (k = new Qe(p(), {
2263
+ onStatusChange: (d) => {
2264
+ r.value = d, l("statusChange", d), d === "idle" && l("complete", s.value);
2256
2265
  },
2257
- onInterim: (p) => {
2258
- a.value = p;
2266
+ onInterim: (d) => {
2267
+ a.value = d;
2259
2268
  },
2260
- onFinal: (p, C) => {
2261
- s.value += p, a.value = "", l("final", p, C);
2269
+ onFinal: (d, C) => {
2270
+ s.value += d, a.value = "", l("final", d, C);
2262
2271
  },
2263
- onResult: (p) => l("result", p),
2264
- onError: (p) => l("error", p)
2272
+ onResult: (d) => l("result", d),
2273
+ onError: (d) => l("error", d)
2265
2274
  }));
2266
2275
  };
2267
- _e(D), Nt(() => {
2276
+ be(R), Nt(() => {
2268
2277
  k == null || k.destroy(), k = null;
2269
- }), ce(
2278
+ }), ve(
2270
2279
  () => [u.lang, u.continuous, u.interimResults],
2271
2280
  () => {
2272
- k == null || k.destroy(), D();
2281
+ k == null || k.destroy(), R();
2273
2282
  }
2274
2283
  );
2275
- const J = async () => {
2284
+ const X = async () => {
2276
2285
  if (k)
2277
2286
  if (r.value === "idle" || r.value === "error")
2278
2287
  try {
@@ -2282,12 +2291,12 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
2282
2291
  else r.value === "recording" && k.stop();
2283
2292
  }, K = () => {
2284
2293
  s.value = "", a.value = "";
2285
- }, I = O(() => !s.value && !a.value), _ = O(
2294
+ }, G = B(() => !s.value && !a.value), _ = B(
2286
2295
  () => f ? u.placeholder || "点击按钮开始语音输入…" : "当前浏览器不支持语音识别"
2287
- ), X = O(() => f ? r.value === "connecting" ? u.connectingText || h.connecting : r.value === "recording" ? u.stopText || h.recording : r.value === "stopping" ? u.stoppingText || h.stopping : r.value === "error" ? h.error : u.startText || h.idle : "不支持"), B = O(() => {
2288
- const p = ["ai-voice-input-btn"];
2289
- return r.value === "recording" && p.push("is-recording"), r.value === "connecting" && p.push("is-connecting"), r.value === "stopping" && p.push("is-stopping"), p.join(" ");
2290
- }), n = O(
2296
+ ), E = B(() => f ? r.value === "connecting" ? u.connectingText || h.connecting : r.value === "recording" ? u.stopText || h.recording : r.value === "stopping" ? u.stoppingText || h.stopping : r.value === "error" ? h.error : u.startText || h.idle : "不支持"), te = B(() => {
2297
+ const d = ["ai-voice-input-btn"];
2298
+ return r.value === "recording" && d.push("is-recording"), r.value === "connecting" && d.push("is-connecting"), r.value === "stopping" && d.push("is-stopping"), d.join(" ");
2299
+ }), n = B(
2291
2300
  () => !f || r.value === "connecting" || r.value === "stopping"
2292
2301
  );
2293
2302
  return w({
@@ -2301,73 +2310,73 @@ const ts = { class: "container" }, ns = { class: "chat-wrap" }, os = { class: "m
2301
2310
  s.value = "", a.value = "";
2302
2311
  },
2303
2312
  getStatus: () => (k == null ? void 0 : k.getStatus()) ?? "idle"
2304
- }), (p, C) => (v(), m("div", {
2313
+ }), (d, C) => (v(), m("div", {
2305
2314
  class: se(["ai-voice-input", t.className]),
2306
- "data-theme": N.value
2315
+ "data-theme": V.value
2307
2316
  }, [
2308
2317
  o("div", {
2309
- class: se(["ai-voice-input-display", { "is-empty": I.value }])
2318
+ class: se(["ai-voice-input-display", { "is-empty": G.value }])
2310
2319
  }, [
2311
- s.value ? (v(), m("span", ea, G(s.value), 1)) : q("", !0),
2312
- a.value ? (v(), m("span", ta, G(a.value), 1)) : q("", !0),
2313
- r.value === "recording" && !a.value ? (v(), m("span", na)) : q("", !0),
2314
- I.value ? (v(), m("span", oa, G(_.value), 1)) : q("", !0)
2320
+ s.value ? (v(), m("span", ta, z(s.value), 1)) : J("", !0),
2321
+ a.value ? (v(), m("span", na, z(a.value), 1)) : J("", !0),
2322
+ r.value === "recording" && !a.value ? (v(), m("span", oa)) : J("", !0),
2323
+ G.value ? (v(), m("span", sa, z(_.value), 1)) : J("", !0)
2315
2324
  ], 2),
2316
2325
  o("button", {
2317
2326
  type: "button",
2318
- class: se(B.value),
2327
+ class: se(te.value),
2319
2328
  disabled: n.value,
2320
- onClick: J
2329
+ onClick: X
2321
2330
  }, [
2322
- r.value === "recording" ? (v(), m("span", aa)) : r.value === "connecting" || r.value === "stopping" ? (v(), m("span", ia, [...C[0] || (C[0] = [
2331
+ r.value === "recording" ? (v(), m("span", ia)) : r.value === "connecting" || r.value === "stopping" ? (v(), m("span", la, [...C[0] || (C[0] = [
2323
2332
  o("span", null, null, -1),
2324
2333
  o("span", null, null, -1),
2325
2334
  o("span", null, null, -1),
2326
2335
  o("span", null, null, -1),
2327
2336
  o("span", null, null, -1)
2328
- ])])) : (v(), m("svg", la, [...C[1] || (C[1] = [
2337
+ ])])) : (v(), m("svg", ua, [...C[1] || (C[1] = [
2329
2338
  o("path", { d: "M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3z" }, null, -1),
2330
2339
  o("path", { d: "M19 11a7 7 0 0 1-14 0H3a9 9 0 0 0 8 8.94V23h2v-3.06A9 9 0 0 0 21 11h-2z" }, null, -1)
2331
2340
  ])])),
2332
- o("span", null, G(X.value), 1)
2333
- ], 10, sa),
2334
- I.value ? q("", !0) : (v(), m("button", {
2341
+ o("span", null, z(E.value), 1)
2342
+ ], 10, aa),
2343
+ G.value ? J("", !0) : (v(), m("button", {
2335
2344
  key: 0,
2336
2345
  type: "button",
2337
2346
  class: "ai-voice-input-btn ai-voice-input-clear-btn",
2338
2347
  title: "清空",
2339
2348
  onClick: K
2340
2349
  }, " 清空 "))
2341
- ], 10, Is));
2350
+ ], 10, ea));
2342
2351
  }
2343
- }), ra = (t, w) => {
2352
+ }), ca = (t, w) => {
2344
2353
  const i = t.__vccOpts || t;
2345
2354
  for (const [u, l] of w)
2346
2355
  i[u] = l;
2347
2356
  return i;
2348
- }, ca = /* @__PURE__ */ ra(ua, [["__scopeId", "data-v-53d3cc6e"]]);
2357
+ }, va = /* @__PURE__ */ ca(ra, [["__scopeId", "data-v-53d3cc6e"]]);
2349
2358
  let Je = null;
2350
- const fa = (t) => {
2359
+ const ga = (t) => {
2351
2360
  Ft(t);
2352
- }, ga = (t) => {
2361
+ }, ya = (t) => {
2353
2362
  const w = t || document.body, i = document.createElement("div");
2354
2363
  i.id = "ai-assist-root";
2355
2364
  const u = qe();
2356
2365
  ht(u.theme), Pn(), w.appendChild(i), Je = Cn(Jt), Je.mount(i);
2357
- }, ya = () => {
2366
+ }, wa = () => {
2358
2367
  Je && (Je.unmount(), Je = null);
2359
2368
  const t = document.getElementById("ai-assist-root");
2360
2369
  t && t.remove();
2361
- }, wa = {
2370
+ }, ka = {
2362
2371
  install(t, w) {
2363
- Ft(w), t.component("AiAssist", Jt), t.component("VoiceInput", ca);
2372
+ Ft(w), t.component("AiAssist", Jt), t.component("VoiceInput", va);
2364
2373
  }
2365
2374
  };
2366
2375
  export {
2367
2376
  Jt as AiAssist,
2368
- ca as VoiceInput,
2369
- wa as default,
2370
- fa as initAiAssist,
2371
- ga as mountAiAssist,
2372
- ya as unmountAiAssist
2377
+ va as VoiceInput,
2378
+ ka as default,
2379
+ ga as initAiAssist,
2380
+ ya as mountAiAssist,
2381
+ wa as unmountAiAssist
2373
2382
  };