@deep-eye/core 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -213,7 +213,7 @@ const $g = {
213
213
  minimal: NQ,
214
214
  professional: bQ
215
215
  };
216
- function S4(t) {
216
+ function Y4(t) {
217
217
  return vQ[t] || $g;
218
218
  }
219
219
  function GQ(t, A) {
@@ -359,7 +359,7 @@ function mC(t) {
359
359
  }
360
360
  return t;
361
361
  }
362
- function Y4(t, A) {
362
+ function J4(t, A) {
363
363
  let e = null;
364
364
  return function(...g) {
365
365
  e && clearTimeout(e), e = setTimeout(() => {
@@ -367,7 +367,7 @@ function Y4(t, A) {
367
367
  }, A);
368
368
  };
369
369
  }
370
- function J4(t, A) {
370
+ function U4(t, A) {
371
371
  let e = null, g = 0;
372
372
  return function(...i) {
373
373
  const I = Date.now();
@@ -418,14 +418,14 @@ function JQ(t, A = {}) {
418
418
  }
419
419
  });
420
420
  }
421
- function U4(t, A) {
421
+ function M4(t, A) {
422
422
  const e = URL.createObjectURL(t), g = document.createElement("a");
423
423
  g.href = e, g.download = A, document.body.appendChild(g), g.click(), document.body.removeChild(g), URL.revokeObjectURL(e);
424
424
  }
425
- function M4(t) {
425
+ function x4(t) {
426
426
  return t.includes("gradient");
427
427
  }
428
- function x4(t) {
428
+ function L4(t) {
429
429
  const A = t.match(/#[0-9a-fA-F]{6}|rgb\([^)]+\)/);
430
430
  return A ? A[0] : "#000000";
431
431
  }
@@ -711,12 +711,12 @@ const UQ = {
711
711
  m.parent ? (m.x0 === void 0 || m.y0 === void 0 || nA.has(m.data.id)) && (m.x0 = m.parent.x, m.y0 = m.parent.y) : (m.x0 === void 0 && (m.x0 = m.x), m.y0 === void 0 && (m.y0 = m.y));
712
712
  });
713
713
  const UA = (m, H) => {
714
- var ne;
715
- const EA = ((ne = m.data) == null ? void 0 : ne._nodeWidth) || rA(m), YA = m.x || 0, bA = m.y || 0;
714
+ var re;
715
+ const EA = ((re = m.data) == null ? void 0 : re._nodeWidth) || rA(m), YA = m.x || 0, bA = m.y || 0;
716
716
  return H === "source" ? { x: YA, y: bA + (EA - 18 + wC) } : { x: YA, y: bA - 18 };
717
717
  }, ke = (m, H) => {
718
- const EA = (m.y + H.y) / 2, YA = EA, bA = m.x, ne = EA, ye = H.x;
719
- return `M ${m.y} ${m.x} C ${YA} ${bA}, ${ne} ${ye}, ${H.y} ${H.x}`;
718
+ const EA = (m.y + H.y) / 2, YA = EA, bA = m.x, re = EA, ye = H.x;
719
+ return `M ${m.y} ${m.x} C ${YA} ${bA}, ${re} ${ye}, ${H.y} ${H.x}`;
720
720
  }, Xe = qA.enter().append("path").attr("class", "link").style("opacity", 0).attr("d", (m) => {
721
721
  const H = UA(
722
722
  { ...m.source, x: m.source.x0 ?? m.source.x, y: m.source.y0 ?? m.source.y },
@@ -740,9 +740,9 @@ const UQ = {
740
740
  ), YA = UA(m.source, "source"), bA = UA(m.target, "target");
741
741
  if (Math.abs(H.y - YA.y) < 0.1 && Math.abs(H.x - YA.x) < 0.1 && Math.abs(EA.y - bA.y) < 0.1 && Math.abs(EA.x - bA.x) < 0.1)
742
742
  return () => ke(YA, bA);
743
- const ne = xA.interpolateNumber(H.y, YA.y), ye = xA.interpolateNumber(H.x, YA.x), je = xA.interpolateNumber(EA.y, bA.y), ot = xA.interpolateNumber(EA.x, bA.x);
743
+ const re = xA.interpolateNumber(H.y, YA.y), ye = xA.interpolateNumber(H.x, YA.x), je = xA.interpolateNumber(EA.y, bA.y), ot = xA.interpolateNumber(EA.x, bA.x);
744
744
  return (Be) => {
745
- const aI = { y: ne(Be), x: ye(Be) }, CI = { y: je(Be), x: ot(Be) };
745
+ const aI = { y: re(Be), x: ye(Be) }, CI = { y: je(Be), x: ot(Be) };
746
746
  return ke(aI, CI);
747
747
  };
748
748
  }).style("stroke", (m) => PA(m)).on("end", function(m) {
@@ -757,8 +757,8 @@ const UQ = {
757
757
  const ot = UA(m.parent, "target");
758
758
  YA = ot.y, bA = ot.x;
759
759
  }
760
- const ne = xA.interpolateNumber(H, YA), ye = xA.interpolateNumber(EA, bA), je = xA.interpolateNumber(yA.nodeScaleTo, 0.9);
761
- return (ot) => `translate(${ne(ot)},${ye(ot)}) scale(${je(ot)})`;
760
+ const re = xA.interpolateNumber(H, YA), ye = xA.interpolateNumber(EA, bA), je = xA.interpolateNumber(yA.nodeScaleTo, 0.9);
761
+ return (ot) => `translate(${re(ot)},${ye(ot)}) scale(${je(ot)})`;
762
762
  }).on("end", function() {
763
763
  xA.select(this).style("will-change", "auto"), xA.select(this).remove();
764
764
  });
@@ -808,8 +808,8 @@ const UQ = {
808
808
  const H = m.y0 ?? (m.parent ? m.parent.y : m.y), EA = m.x0 ?? (m.parent ? m.parent.x : m.x), YA = m.y, bA = m.x;
809
809
  if (Math.abs(H - YA) < 0.1 && Math.abs(EA - bA) < 0.1)
810
810
  return () => `translate(${YA},${bA}) scale(1)`;
811
- const ne = m.parent && (m.y0 === void 0 || m.x0 === void 0 || Math.abs(H - m.parent.y) < 2 && Math.abs(EA - m.parent.x) < 2), ye = xA.interpolateNumber(H, YA), je = xA.interpolateNumber(EA, bA), ot = xA.interpolateNumber(
812
- ne ? yA.nodeScaleFrom : yA.nodeScaleTo,
811
+ const re = m.parent && (m.y0 === void 0 || m.x0 === void 0 || Math.abs(H - m.parent.y) < 2 && Math.abs(EA - m.parent.x) < 2), ye = xA.interpolateNumber(H, YA), je = xA.interpolateNumber(EA, bA), ot = xA.interpolateNumber(
812
+ re ? yA.nodeScaleFrom : yA.nodeScaleTo,
813
813
  yA.nodeScaleTo
814
814
  );
815
815
  return (Be) => `translate(${ye(Be)},${je(Be)}) scale(${ot(Be)})`;
@@ -949,8 +949,8 @@ const UQ = {
949
949
  }
950
950
  let qA = 1 / 0, GA = -1 / 0, PA = 1 / 0, UA = -1 / 0;
951
951
  FA.forEach((EA) => {
952
- const YA = EA.x || 0, bA = EA.y || 0, ne = rA(EA), ye = 55;
953
- qA = Math.min(qA, YA - ye / 2), GA = Math.max(GA, YA + ye / 2), PA = Math.min(PA, bA - ne / 2), UA = Math.max(UA, bA + ne / 2);
952
+ const YA = EA.x || 0, bA = EA.y || 0, re = rA(EA), ye = 55;
953
+ qA = Math.min(qA, YA - ye / 2), GA = Math.max(GA, YA + ye / 2), PA = Math.min(PA, bA - re / 2), UA = Math.max(UA, bA + re / 2);
954
954
  });
955
955
  const ke = 100, Xe = UA - PA + ke * 2, bt = GA - qA + ke * 2, We = eA / Xe, Ot = iA / bt, me = Math.min(We, Ot, 1.2), V = U.x || 0, p = U.y || 0, m = eA / 2 - p * me, H = iA / 2 - V * me;
956
956
  if (M && s.value) {
@@ -2094,7 +2094,7 @@ function ra(t) {
2094
2094
  const A = (t.fileType || $i(t.fileName)).toLowerCase();
2095
2095
  return Bl.has(A) ? "image" : A === "pdf" ? "pdf" : A === "docx" ? "docx" : A === "xls" || A === "xlsx" ? "excel" : A === "pptx" ? "pptx" : A === "html" || A === "htm" ? "html" : El.has(A) ? "text" : ll.has(A) ? "audio" : cl.has(A) ? "video" : "unsupported";
2096
2096
  }
2097
- function L4(t, A) {
2097
+ function H4(t, A) {
2098
2098
  const e = Xg.get(t);
2099
2099
  return Xg.set(t, A), () => {
2100
2100
  Xg.get(t) === A && (e ? Xg.set(t, e) : Xg.delete(t));
@@ -2544,7 +2544,7 @@ const as = tc({
2544
2544
  {% ask-option label="Vue" value="vue" /%}
2545
2545
  {% ask-option label="React" value="react" /%}
2546
2546
  {% ask-option label="Svelte" value="svelte" /%}
2547
- {% /ask-form %}`, H4 = Qr(as, {
2547
+ {% /ask-form %}`, K4 = Qr(as, {
2548
2548
  preamble: gc
2549
2549
  }), ic = `当需要产出可下载/可预览的工件(内联生成的内容,或引用的文件)时,使用 {% artifact %} 标签渲染成卡片,不要把工件内容混在普通正文里。
2550
2550
 
@@ -2565,7 +2565,7 @@ def quicksort(arr):
2565
2565
  {% /artifact %}
2566
2566
 
2567
2567
  示例3(文件类,引用 PDF):
2568
- {% artifact title="季度报告.pdf" type="pdf" src="/files/q3.pdf" size="1.2MB" /%}`, K4 = Qr(as, {
2568
+ {% artifact title="季度报告.pdf" type="pdf" src="/files/q3.pdf" size="1.2MB" /%}`, q4 = Qr(as, {
2569
2569
  preamble: ic
2570
2570
  }), Ic = ["src", "alt"], sc = {
2571
2571
  key: 3,
@@ -15138,8 +15138,8 @@ function l0() {
15138
15138
  const EA = N(p) || p.parentNode, YA = v(p) || p.childNodes;
15139
15139
  if (YA && EA) {
15140
15140
  const bA = YA.length;
15141
- for (let ne = bA - 1; ne >= 0; --ne) {
15142
- const ye = u(YA[ne], !0);
15141
+ for (let re = bA - 1; re >= 0; --re) {
15142
+ const ye = u(YA[re], !0);
15143
15143
  EA.insertBefore(ye, D(p));
15144
15144
  }
15145
15145
  }
@@ -15199,7 +15199,7 @@ function l0() {
15199
15199
  for (; EA--; ) {
15200
15200
  const YA = m[EA], {
15201
15201
  name: bA,
15202
- namespaceURI: ne,
15202
+ namespaceURI: re,
15203
15203
  value: ye
15204
15204
  } = YA, je = xe(bA), ot = ye;
15205
15205
  let Be = bA === "value" ? ot : Sh(ot);
@@ -15229,7 +15229,7 @@ function l0() {
15229
15229
  FA(bA, p);
15230
15230
  continue;
15231
15231
  }
15232
- if (y && typeof B == "object" && typeof B.getAttributeType == "function" && !ne)
15232
+ if (y && typeof B == "object" && typeof B.getAttributeType == "function" && !re)
15233
15233
  switch (B.getAttributeType(aI, je)) {
15234
15234
  case "TrustedHTML": {
15235
15235
  Be = y.createHTML(Be);
@@ -15242,7 +15242,7 @@ function l0() {
15242
15242
  }
15243
15243
  if (Be !== ot)
15244
15244
  try {
15245
- ne ? p.setAttributeNS(ne, bA, Be) : p.setAttribute(bA, Be), GA(p) ? iA(p) : lo(A.removed);
15245
+ re ? p.setAttributeNS(re, bA, Be) : p.setAttribute(bA, Be), GA(p) ? iA(p) : lo(A.removed);
15246
15246
  } catch {
15247
15247
  FA(bA, p);
15248
15248
  }
@@ -15298,11 +15298,11 @@ function l0() {
15298
15298
  YA = m;
15299
15299
  return (NA.shadowroot || NA.shadowrootmode) && (YA = lA.call(g, YA, !0)), YA;
15300
15300
  }
15301
- let ne = Qe ? m.outerHTML : m.innerHTML;
15302
- return Qe && mA["!doctype"] && m.ownerDocument && m.ownerDocument.doctype && m.ownerDocument.doctype.name && Pe(B0, m.ownerDocument.doctype.name) && (ne = "<!DOCTYPE " + m.ownerDocument.doctype.name + `>
15303
- ` + ne), pe && Di([sA, dA, IA], (ye) => {
15304
- ne = _g(ne, ye, " ");
15305
- }), y && rA ? y.createHTML(ne) : ne;
15301
+ let re = Qe ? m.outerHTML : m.innerHTML;
15302
+ return Qe && mA["!doctype"] && m.ownerDocument && m.ownerDocument.doctype && m.ownerDocument.doctype.name && Pe(B0, m.ownerDocument.doctype.name) && (re = "<!DOCTYPE " + m.ownerDocument.doctype.name + `>
15303
+ ` + re), pe && Di([sA, dA, IA], (ye) => {
15304
+ re = _g(re, ye, " ");
15305
+ }), y && rA ? y.createHTML(re) : re;
15306
15306
  }, A.setConfig = function() {
15307
15307
  let V = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
15308
15308
  sI(V), Z = !0;
@@ -24338,7 +24338,7 @@ function sQ(t, A, e = {}) {
24338
24338
  o.append("token", A.uptoken), o.append("key", A.fileKey), o.append("file", t, t.name), I.send(o);
24339
24339
  });
24340
24340
  }
24341
- async function q4(t, A, e = {}) {
24341
+ async function T4(t, A, e = {}) {
24342
24342
  const g = await IQ(t, A, e.signal);
24343
24343
  return sQ(t, g, e);
24344
24344
  }
@@ -25782,12 +25782,12 @@ function Kn(t, A = {}) {
25782
25782
  (g) => g.kind === "component" && g.tag === "ask-form" && g.complete
25783
25783
  );
25784
25784
  }
25785
- const PD = 512 * 1024, $D = /* @__PURE__ */ new Set([
25785
+ const PD = 512 * 1024, $D = /* @__PURE__ */ new Set(["session", "end"]), Ap = /* @__PURE__ */ new Set([
25786
25786
  "response.completed",
25787
25787
  "response.incomplete",
25788
25788
  "response.failed",
25789
25789
  "error"
25790
- ]), Ap = /* @__PURE__ */ new Set([
25790
+ ]), ep = /* @__PURE__ */ new Set([
25791
25791
  "response.created",
25792
25792
  "response.in_progress",
25793
25793
  "response.completed",
@@ -25807,23 +25807,23 @@ const PD = 512 * 1024, $D = /* @__PURE__ */ new Set([
25807
25807
  "response.function_call_arguments.done",
25808
25808
  "error"
25809
25809
  ]);
25810
- class re extends Error {
25810
+ class ne extends Error {
25811
25811
  constructor(A, e, g) {
25812
25812
  super(e ? `${e}: ${A}` : A), this.name = "ResponseStreamProtocolError", this.code = e, this.status = g;
25813
25813
  }
25814
25814
  }
25815
- async function ep(t, A) {
25815
+ async function tp(t, A) {
25816
25816
  var B, E, u, h, D, v;
25817
25817
  if ((B = A.signal) != null && B.aborted) return { status: "aborted", response: null };
25818
25818
  const e = await t;
25819
25819
  if (!e.ok)
25820
- throw new re(
25820
+ throw new ne(
25821
25821
  `Responses request failed with HTTP ${e.status}${e.statusText ? ` ${e.statusText}` : ""}`,
25822
25822
  void 0,
25823
25823
  e.status
25824
25824
  );
25825
- if (!e.body) throw new re("Responses SSE body is missing");
25826
- const g = e.body.getReader(), i = new TextDecoder("utf-8", { fatal: !0 }), I = new ip(), s = [];
25825
+ if (!e.body) throw new ne("Responses SSE body is missing");
25826
+ const g = e.body.getReader(), i = new TextDecoder("utf-8", { fatal: !0 }), I = new Ip(), s = [];
25827
25827
  let a = null, C = -1, o = null;
25828
25828
  const n = () => {
25829
25829
  g.cancel().catch(() => {
@@ -25831,17 +25831,19 @@ async function ep(t, A) {
25831
25831
  };
25832
25832
  (E = A.signal) == null || E.addEventListener("abort", n, { once: !0 });
25833
25833
  const r = () => {
25834
- const N = a ? { ...a, output: gp(s) } : null;
25834
+ const N = a ? { ...a, output: ip(s) } : null;
25835
25835
  A.onUpdate(aQ(s), N);
25836
25836
  }, l = (N) => {
25837
25837
  var L;
25838
- const y = tp(N), G = y.sequence_number;
25838
+ const y = gp(N);
25839
+ if (!y) return;
25840
+ const G = y.sequence_number;
25839
25841
  if (!Number.isSafeInteger(G) || G < 0)
25840
- throw new re(
25842
+ throw new ne(
25841
25843
  "Responses SSE sequence_number must be a non-negative safe integer"
25842
25844
  );
25843
25845
  if (G <= C)
25844
- throw new re(
25846
+ throw new ne(
25845
25847
  `Responses SSE sequence_number must be strictly increasing (received ${G} after ${C})`
25846
25848
  );
25847
25849
  switch (C = G, y.type) {
@@ -25916,13 +25918,13 @@ async function ep(t, A) {
25916
25918
  }
25917
25919
  if (CQ(s), r(), (L = A.onEvent) == null || L.call(A, y, N), y.type === "response.failed") {
25918
25920
  const Y = y.response.error;
25919
- throw new re(
25921
+ throw new ne(
25920
25922
  (Y == null ? void 0 : Y.message) || "Responses stream failed",
25921
25923
  (Y == null ? void 0 : Y.code) ?? void 0
25922
25924
  );
25923
25925
  }
25924
25926
  if (y.type === "error")
25925
- throw new re(
25927
+ throw new ne(
25926
25928
  y.message || "Responses stream failed",
25927
25929
  y.code ?? void 0
25928
25930
  );
@@ -25947,7 +25949,7 @@ async function ep(t, A) {
25947
25949
  }
25948
25950
  if ((D = A.signal) != null && D.aborted) return { status: "aborted", response: a };
25949
25951
  if (!o)
25950
- throw new re("Responses SSE ended before a standard terminal event");
25952
+ throw new ne("Responses SSE ended before a standard terminal event");
25951
25953
  return g.cancel().catch(() => {
25952
25954
  }), { status: o, response: a };
25953
25955
  } finally {
@@ -25985,24 +25987,32 @@ function aQ(t) {
25985
25987
  ...I.length ? { resource_files: I } : {}
25986
25988
  };
25987
25989
  }
25988
- function tp(t) {
25989
- if (t.data.trim() === "[DONE]")
25990
- throw new re("[DONE] is not valid in a Responses SSE stream");
25990
+ function gp(t) {
25991
+ if (t.event !== void 0 && $D.has(t.event))
25992
+ return null;
25993
+ const A = t.data.trim();
25994
+ if (!A)
25995
+ throw new ne("Responses SSE data frame is empty");
25996
+ if (A === "[DONE]")
25997
+ throw new ne("[DONE] is not valid in a Responses SSE stream");
25991
25998
  let e;
25992
25999
  try {
25993
- e = JSON.parse(t.data);
26000
+ e = JSON.parse(A);
25994
26001
  } catch {
25995
- throw new re("Responses SSE data is not valid JSON");
26002
+ const I = A.length > 180 ? `${A.slice(0, 180)}…` : A;
26003
+ throw new ne(
26004
+ `Responses SSE data is not valid JSON (frame id=${t.id ?? "none"}, event=${t.event ?? "none"}, ${A.length} chars): ${I}`
26005
+ );
25996
26006
  }
25997
26007
  const g = Pi(e, "event data"), i = Bt(g.type, "type");
25998
- if (!Ap.has(i))
25999
- throw new re(`Unsupported Responses SSE event type: ${i}`);
26008
+ if (!ep.has(i))
26009
+ throw new ne(`Unsupported Responses SSE event type: ${i}`);
26000
26010
  if (t.event !== void 0 && t.event !== i)
26001
- throw new re(
26011
+ throw new ne(
26002
26012
  `SSE event field ${t.event} does not match payload type ${i}`
26003
26013
  );
26004
- if ($D.has(i) && g.sequence_number === void 0)
26005
- throw new re(`${i} is missing sequence_number`);
26014
+ if (Ap.has(i) && g.sequence_number === void 0)
26015
+ throw new ne(`${i} is missing sequence_number`);
26006
26016
  return g;
26007
26017
  }
26008
26018
  function CQ(t) {
@@ -26011,9 +26021,9 @@ function CQ(t) {
26011
26021
  if (new TextEncoder().encode(
26012
26022
  `${A.content ?? ""}${A.reasoning_content ?? ""}${e ?? ""}`
26013
26023
  ).byteLength > PD)
26014
- throw new re("Responses stream content exceeded the 512 KB limit");
26024
+ throw new ne("Responses stream content exceeded the 512 KB limit");
26015
26025
  }
26016
- function gp(t) {
26026
+ function ip(t) {
26017
26027
  return t.filter((A) => A !== void 0);
26018
26028
  }
26019
26029
  function qn(t, A) {
@@ -26022,19 +26032,19 @@ function qn(t, A) {
26022
26032
  function oa(t, A, e) {
26023
26033
  const g = vt(A, "output_index"), i = t[g];
26024
26034
  if (!i || !oQ(i))
26025
- throw new re(`Output item ${g} is not a message`);
26035
+ throw new ne(`Output item ${g} is not a message`);
26026
26036
  return uC(i, e), Array.isArray(i.content) || (i.content = []), i;
26027
26037
  }
26028
26038
  function na(t, A, e) {
26029
26039
  const g = vt(A, "output_index"), i = t[g];
26030
26040
  if (!i || !nQ(i))
26031
- throw new re(`Output item ${g} is not reasoning`);
26041
+ throw new ne(`Output item ${g} is not reasoning`);
26032
26042
  return uC(i, e), i;
26033
26043
  }
26034
26044
  function Tn(t, A, e) {
26035
26045
  const g = vt(A, "output_index"), i = t[g];
26036
26046
  if (!i || !rQ(i))
26037
- throw new re(`Output item ${g} is not a function_call`);
26047
+ throw new ne(`Output item ${g} is not a function_call`);
26038
26048
  return uC(i, e), i;
26039
26049
  }
26040
26050
  function Zn(t, A) {
@@ -26044,7 +26054,7 @@ function Zn(t, A) {
26044
26054
  return t.content[A] = g, g;
26045
26055
  }
26046
26056
  if (e.type !== "output_text" || typeof e.text != "string")
26047
- throw new re(`Content part ${A} is not output_text`);
26057
+ throw new ne(`Content part ${A} is not output_text`);
26048
26058
  return e;
26049
26059
  }
26050
26060
  function Wn(t, A) {
@@ -26054,13 +26064,13 @@ function Wn(t, A) {
26054
26064
  return e[A] = i, i;
26055
26065
  }
26056
26066
  if (g.type !== "summary_text")
26057
- throw new re(`Reasoning summary part ${A} is invalid`);
26067
+ throw new ne(`Reasoning summary part ${A} is invalid`);
26058
26068
  return typeof g.text != "string" && (g.text = ""), g;
26059
26069
  }
26060
26070
  function uC(t, A) {
26061
26071
  const e = Bt(A, "item_id");
26062
26072
  if (t.id !== void 0 && t.id !== e)
26063
- throw new re(
26073
+ throw new ne(
26064
26074
  `SSE item_id ${e} does not match output item id ${t.id}`
26065
26075
  );
26066
26076
  }
@@ -26076,41 +26086,41 @@ function rQ(t) {
26076
26086
  function _n(t) {
26077
26087
  const A = Pi(t, "response");
26078
26088
  if (A.object !== "response")
26079
- throw new re('Response object must have object: "response"');
26089
+ throw new ne('Response object must have object: "response"');
26080
26090
  if (Bt(A.id, "response.id"), Bt(A.model, "response.model"), !Number.isFinite(A.created_at))
26081
- throw new re("response.created_at must be a number");
26091
+ throw new ne("response.created_at must be a number");
26082
26092
  if (A.output !== void 0 && !Array.isArray(A.output))
26083
- throw new re("response.output must be an array");
26093
+ throw new ne("response.output must be an array");
26084
26094
  return Ai(A);
26085
26095
  }
26086
26096
  function On(t) {
26087
26097
  const A = Pi(t, "item");
26088
26098
  if (Bt(A.type, "item.type"), A.type === "message") {
26089
26099
  if (A.content === void 0 && (A.content = []), !Array.isArray(A.content))
26090
- throw new re("message.content must be an array");
26100
+ throw new ne("message.content must be an array");
26091
26101
  if (A.role !== "assistant")
26092
- throw new re("Responses output message role must be assistant");
26102
+ throw new ne("Responses output message role must be assistant");
26093
26103
  }
26094
26104
  return A.type === "function_call" && (Bt(A.call_id, "function_call.call_id"), Bt(A.name, "function_call.name"), A.arguments === void 0 && (A.arguments = ""), Bt(A.arguments, "function_call.arguments")), A;
26095
26105
  }
26096
26106
  function Pi(t, A) {
26097
26107
  if (typeof t != "object" || t === null || Array.isArray(t))
26098
- throw new re(`${A} must be an object`);
26108
+ throw new ne(`${A} must be an object`);
26099
26109
  return t;
26100
26110
  }
26101
26111
  function Bt(t, A) {
26102
- if (typeof t != "string") throw new re(`${A} must be a string`);
26112
+ if (typeof t != "string") throw new ne(`${A} must be a string`);
26103
26113
  return t;
26104
26114
  }
26105
26115
  function vt(t, A) {
26106
26116
  if (!Number.isSafeInteger(t) || t < 0)
26107
- throw new re(`${A} must be a non-negative safe integer`);
26117
+ throw new ne(`${A} must be a non-negative safe integer`);
26108
26118
  return t;
26109
26119
  }
26110
26120
  function Ai(t) {
26111
26121
  return JSON.parse(JSON.stringify(t));
26112
26122
  }
26113
- class ip {
26123
+ class Ip {
26114
26124
  constructor() {
26115
26125
  this.buffer = "", this.raw = "", this.data = [], this.started = !1;
26116
26126
  }
@@ -26148,7 +26158,7 @@ class ip {
26148
26158
  return s.startsWith(" ") && (s = s.slice(1)), I === "data" ? this.data.push(s) : I === "event" ? this.event = s || void 0 : I === "id" && !s.includes("\0") ? this.id = s : I === "retry" && /^\d+$/.test(s) && (this.retry = Number(s)), null;
26149
26159
  }
26150
26160
  dispatch() {
26151
- if (this.data.length === 0)
26161
+ if (this.data.length === 0 || this.data.every((e) => e.trim() === ""))
26152
26162
  return this.reset(), null;
26153
26163
  const A = {
26154
26164
  data: this.data.join(`
@@ -26165,26 +26175,26 @@ class ip {
26165
26175
  }
26166
26176
  }
26167
26177
  function QQ(t) {
26168
- return t.name === "TimeoutError" ? { kind: "timeout", error: t } : t instanceof re ? t.status !== void 0 || t.code !== void 0 ? {
26178
+ return t.name === "TimeoutError" ? { kind: "timeout", error: t } : t instanceof ne ? t.status !== void 0 || t.code !== void 0 ? {
26169
26179
  kind: "api",
26170
26180
  error: t,
26171
26181
  ...t.status !== void 0 ? { status: t.status } : {},
26172
26182
  ...t.code !== void 0 ? { code: t.code } : {}
26173
26183
  } : { kind: "protocol", error: t } : t.name === "TypeError" ? { kind: "network", error: t } : { kind: "unknown", error: t };
26174
26184
  }
26175
- const Ip = ["aria-busy"], sp = {
26185
+ const sp = ["aria-busy"], ap = {
26176
26186
  key: 1,
26177
26187
  class: "ai-conversation__error",
26178
26188
  role: "alert"
26179
- }, ap = {
26189
+ }, Cp = {
26180
26190
  key: 0,
26181
26191
  class: "ai-conversation__error-note"
26182
- }, Cp = {
26192
+ }, op = {
26183
26193
  key: 2,
26184
26194
  class: "ai-conversation__stopped",
26185
26195
  role: "status",
26186
26196
  "aria-live": "polite"
26187
- }, op = { class: "ai-conversation__ask-dock-inner" }, np = /* @__PURE__ */ TA({
26197
+ }, np = { class: "ai-conversation__ask-dock-inner" }, rp = /* @__PURE__ */ TA({
26188
26198
  name: "ConversationList",
26189
26199
  __name: "ConversationList",
26190
26200
  props: {
@@ -26592,17 +26602,17 @@ const Ip = ["aria-busy"], sp = {
26592
26602
  w("span", null, tA(cA.tool_call_id), 1),
26593
26603
  w("pre", null, tA(cA.content), 1)
26594
26604
  ]))), 128)),
26595
- t.responseError ? (b(), S("section", sp, [
26605
+ t.responseError ? (b(), S("section", ap, [
26596
26606
  w("div", null, [
26597
26607
  w("strong", null, tA(sA.value), 1),
26598
26608
  w("p", null, tA(t.responseError.message), 1),
26599
- dA.value ? (b(), S("p", ap, " 以上内容为中断前已生成的部分回复 ")) : QA("", !0)
26609
+ dA.value ? (b(), S("p", Cp, " 以上内容为中断前已生成的部分回复 ")) : QA("", !0)
26600
26610
  ]),
26601
26611
  w("button", {
26602
26612
  type: "button",
26603
26613
  onClick: DA[4] || (DA[4] = (cA) => i("retry"))
26604
26614
  }, "重试")
26605
- ])) : T.value ? (b(), S("section", Cp, [...DA[6] || (DA[6] = [
26615
+ ])) : T.value ? (b(), S("section", op, [...DA[6] || (DA[6] = [
26606
26616
  w("span", null, "已停止生成", -1)
26607
26617
  ])])) : QA("", !0),
26608
26618
  WA(Z.$slots, "append", {}, void 0, !0)
@@ -26616,7 +26626,7 @@ const Ip = ["aria-busy"], sp = {
26616
26626
  class: "ai-conversation__ask-dock",
26617
26627
  "data-testid": "ask-form-dock"
26618
26628
  }, [
26619
- w("div", op, [
26629
+ w("div", np, [
26620
26630
  (b(!0), S($A, null, fe(N.value, (cA, K) => Ii((b(), ZA(jD, {
26621
26631
  key: cA.id,
26622
26632
  node: cA,
@@ -26656,25 +26666,25 @@ const Ip = ["aria-busy"], sp = {
26656
26666
  ]),
26657
26667
  _: 1
26658
26668
  })
26659
- ], 14, Ip));
26669
+ ], 14, sp));
26660
26670
  }
26661
- }), rp = /* @__PURE__ */ zA(np, [["__scopeId", "data-v-a45d3207"]]), Qp = ["aria-label"], Bp = { class: "artifact-preview__toolbar" }, lp = { class: "artifact-preview__identity" }, cp = {
26671
+ }), Qp = /* @__PURE__ */ zA(rp, [["__scopeId", "data-v-a45d3207"]]), Bp = ["aria-label"], lp = { class: "artifact-preview__toolbar" }, cp = { class: "artifact-preview__identity" }, Ep = {
26662
26672
  class: "artifact-preview__view-switch",
26663
26673
  role: "radiogroup",
26664
26674
  "aria-label": "File view mode"
26665
- }, Ep = ["aria-checked", "tabindex"], hp = ["aria-checked", "tabindex"], up = ["title"], dp = { class: "artifact-preview__type" }, fp = { class: "artifact-preview__actions" }, mp = ["disabled", "aria-label"], wp = ["aria-controls", "aria-expanded"], Dp = ["id"], pp = ["disabled"], kp = ["aria-label", "data-tooltip"], yp = { class: "artifact-preview__content" }, Fp = ["title", "srcdoc"], Np = ["title", "src"], bp = {
26675
+ }, hp = ["aria-checked", "tabindex"], up = ["aria-checked", "tabindex"], dp = ["title"], fp = { class: "artifact-preview__type" }, mp = { class: "artifact-preview__actions" }, wp = ["disabled", "aria-label"], Dp = ["aria-controls", "aria-expanded"], pp = ["id"], kp = ["disabled"], yp = ["aria-label", "data-tooltip"], Fp = { class: "artifact-preview__content" }, Np = ["title", "srcdoc"], bp = ["title", "src"], vp = {
26666
26676
  key: 2,
26667
26677
  class: "artifact-preview__document",
26668
26678
  "data-testid": "artifact-preview-document"
26669
- }, vp = {
26679
+ }, Gp = {
26670
26680
  key: 3,
26671
26681
  class: "artifact-preview__code",
26672
26682
  "data-testid": "artifact-preview-code"
26673
- }, Gp = {
26683
+ }, Rp = {
26674
26684
  key: 4,
26675
26685
  class: "artifact-preview__empty",
26676
26686
  role: "status"
26677
- }, Rp = /* @__PURE__ */ TA({
26687
+ }, Sp = /* @__PURE__ */ TA({
26678
26688
  name: "ArtifactPreview",
26679
26689
  __name: "ArtifactPreview",
26680
26690
  props: {
@@ -26771,9 +26781,9 @@ const Ip = ["aria-busy"], sp = {
26771
26781
  class: "artifact-preview",
26772
26782
  "aria-label": `${u.value} preview`
26773
26783
  }, [
26774
- w("header", Bp, [
26775
- w("div", lp, [
26776
- w("div", cp, [
26784
+ w("header", lp, [
26785
+ w("div", cp, [
26786
+ w("div", Ep, [
26777
26787
  w("button", {
26778
26788
  ref_key: "previewButtonRef",
26779
26789
  ref: o,
@@ -26793,7 +26803,7 @@ const Ip = ["aria-busy"], sp = {
26793
26803
  "stroke-width": 1.75,
26794
26804
  "aria-hidden": "true"
26795
26805
  })
26796
- ], 42, Ep),
26806
+ ], 42, hp),
26797
26807
  w("button", {
26798
26808
  ref_key: "codeButtonRef",
26799
26809
  ref: n,
@@ -26813,7 +26823,7 @@ const Ip = ["aria-busy"], sp = {
26813
26823
  "stroke-width": 1.75,
26814
26824
  "aria-hidden": "true"
26815
26825
  })
26816
- ], 42, hp)
26826
+ ], 42, up)
26817
26827
  ]),
26818
26828
  w("h2", {
26819
26829
  class: "artifact-preview__title",
@@ -26824,10 +26834,10 @@ const Ip = ["aria-busy"], sp = {
26824
26834
  class: "artifact-preview__title-separator",
26825
26835
  "aria-hidden": "true"
26826
26836
  }, "·", -1)),
26827
- w("span", dp, tA(D.value), 1)
26828
- ], 8, up)
26837
+ w("span", fp, tA(D.value), 1)
26838
+ ], 8, dp)
26829
26839
  ]),
26830
- w("div", fp, [
26840
+ w("div", mp, [
26831
26841
  w("div", {
26832
26842
  ref_key: "menuRootRef",
26833
26843
  ref: r,
@@ -26855,7 +26865,7 @@ const Ip = ["aria-busy"], sp = {
26855
26865
  "aria-hidden": "true"
26856
26866
  })) : QA("", !0),
26857
26867
  w("span", null, tA(I.value ? "Copied" : s.value ? "Failed" : "Copy"), 1)
26858
- ], 10, mp),
26868
+ ], 10, wp),
26859
26869
  W[6] || (W[6] = w("span", {
26860
26870
  class: "artifact-preview__split-divider",
26861
26871
  "aria-hidden": "true"
@@ -26877,7 +26887,7 @@ const Ip = ["aria-busy"], sp = {
26877
26887
  "stroke-width": 1.75,
26878
26888
  "aria-hidden": "true"
26879
26889
  })
26880
- ], 8, wp),
26890
+ ], 8, Dp),
26881
26891
  OA(si, { name: "artifact-menu" }, {
26882
26892
  default: oe(() => [
26883
26893
  a.value ? (b(), S("div", {
@@ -26902,8 +26912,8 @@ const Ip = ["aria-busy"], sp = {
26902
26912
  "aria-hidden": "true"
26903
26913
  }),
26904
26914
  W[5] || (W[5] = w("span", null, "Download", -1))
26905
- ], 8, pp)
26906
- ], 8, Dp)) : QA("", !0)
26915
+ ], 8, kp)
26916
+ ], 8, pp)) : QA("", !0)
26907
26917
  ]),
26908
26918
  _: 1
26909
26919
  })
@@ -26927,7 +26937,7 @@ const Ip = ["aria-busy"], sp = {
26927
26937
  "stroke-width": 1.75,
26928
26938
  "aria-hidden": "true"
26929
26939
  }))
26930
- ], 8, kp),
26940
+ ], 8, yp),
26931
26941
  w("button", {
26932
26942
  type: "button",
26933
26943
  class: "artifact-preview__icon-button",
@@ -26944,7 +26954,7 @@ const Ip = ["aria-busy"], sp = {
26944
26954
  ])
26945
26955
  ])
26946
26956
  ]),
26947
- w("div", yp, [
26957
+ w("div", Fp, [
26948
26958
  G.value ? (b(), S("iframe", {
26949
26959
  key: 0,
26950
26960
  title: `${u.value} preview`,
@@ -26952,38 +26962,38 @@ const Ip = ["aria-busy"], sp = {
26952
26962
  sandbox: "allow-scripts",
26953
26963
  class: "artifact-preview__iframe",
26954
26964
  "data-testid": "artifact-preview-frame"
26955
- }, null, 8, Fp)) : L.value ? (b(), S("iframe", {
26965
+ }, null, 8, Np)) : L.value ? (b(), S("iframe", {
26956
26966
  key: 1,
26957
26967
  title: `${u.value} preview`,
26958
26968
  src: t.artifact.src,
26959
26969
  class: "artifact-preview__iframe",
26960
26970
  "data-testid": "artifact-preview-frame"
26961
- }, null, 8, Np)) : i.value === "preview" && t.artifact.content ? (b(), S("div", bp, tA(t.artifact.content), 1)) : v.value ? (b(), S("pre", vp, [
26971
+ }, null, 8, bp)) : i.value === "preview" && t.artifact.content ? (b(), S("div", vp, tA(t.artifact.content), 1)) : v.value ? (b(), S("pre", Gp, [
26962
26972
  w("code", null, tA(v.value), 1)
26963
- ])) : (b(), S("div", Gp, "No preview available"))
26973
+ ])) : (b(), S("div", Rp, "No preview available"))
26964
26974
  ])
26965
- ], 8, Qp));
26975
+ ], 8, Bp));
26966
26976
  }
26967
- }), Sp = /* @__PURE__ */ zA(Rp, [["__scopeId", "data-v-9270a8aa"]]), Yp = {
26977
+ }), Yp = /* @__PURE__ */ zA(Sp, [["__scopeId", "data-v-9270a8aa"]]), Jp = {
26968
26978
  key: 0,
26969
26979
  class: "chat-queue",
26970
26980
  "aria-label": "待发送队列"
26971
- }, Jp = { class: "chat-queue__header" }, Up = {
26981
+ }, Up = { class: "chat-queue__header" }, Mp = {
26972
26982
  class: "chat-queue__count",
26973
26983
  "aria-hidden": "true"
26974
- }, Mp = { class: "chat-queue__list" }, xp = ["draggable", "onDragstart", "onDragover", "onDragleave", "onDrop"], Lp = {
26984
+ }, xp = { class: "chat-queue__list" }, Lp = ["draggable", "onDragstart", "onDragover", "onDragleave", "onDrop"], Hp = {
26975
26985
  key: 0,
26976
26986
  class: "chat-queue__edit-row"
26977
- }, Hp = { class: "chat-queue__edit-actions" }, Kp = {
26987
+ }, Kp = { class: "chat-queue__edit-actions" }, qp = {
26978
26988
  class: "chat-queue__grip",
26979
26989
  "aria-hidden": "true"
26980
- }, qp = {
26990
+ }, Tp = {
26981
26991
  class: "chat-queue__index",
26982
26992
  "aria-hidden": "true"
26983
- }, Tp = { class: "chat-queue__body" }, Zp = { class: "chat-queue__content" }, Wp = {
26993
+ }, Zp = { class: "chat-queue__body" }, Wp = { class: "chat-queue__content" }, _p = {
26984
26994
  key: 0,
26985
26995
  class: "chat-queue__meta"
26986
- }, _p = { class: "chat-queue__actions" }, Op = ["onClick"], Vp = ["onClick"], Xp = /* @__PURE__ */ TA({
26996
+ }, Op = { class: "chat-queue__actions" }, Vp = ["onClick"], Xp = ["onClick"], zp = /* @__PURE__ */ TA({
26987
26997
  name: "ChatQueue",
26988
26998
  __name: "ChatQueue",
26989
26999
  props: {
@@ -27027,12 +27037,12 @@ const Ip = ["aria-busy"], sp = {
27027
27037
  function v(N) {
27028
27038
  N.key === "Enter" && !N.shiftKey ? (N.preventDefault(), r()) : N.key === "Escape" && (N.preventDefault(), l());
27029
27039
  }
27030
- return (N, y) => t.items.length ? (b(), S("section", Yp, [
27031
- w("header", Jp, [
27040
+ return (N, y) => t.items.length ? (b(), S("section", Jp, [
27041
+ w("header", Up, [
27032
27042
  y[1] || (y[1] = w("span", { class: "chat-queue__label" }, "待发送", -1)),
27033
- w("span", Up, tA(t.items.length), 1)
27043
+ w("span", Mp, tA(t.items.length), 1)
27034
27044
  ]),
27035
- w("ol", Mp, [
27045
+ w("ol", xp, [
27036
27046
  (b(!0), S($A, null, fe(e.items, (G, L) => (b(), S("li", {
27037
27047
  key: G.id,
27038
27048
  class: _A(["chat-queue__item", {
@@ -27047,7 +27057,7 @@ const Ip = ["aria-busy"], sp = {
27047
27057
  onDrop: Gt((Y) => h(L), ["prevent"]),
27048
27058
  onDragend: D
27049
27059
  }, [
27050
- i.value === G.id ? (b(), S("div", Lp, [
27060
+ i.value === G.id ? (b(), S("div", Hp, [
27051
27061
  Ii(w("textarea", {
27052
27062
  ref_for: !0,
27053
27063
  ref_key: "editRef",
@@ -27060,7 +27070,7 @@ const Ip = ["aria-busy"], sp = {
27060
27070
  }, null, 544), [
27061
27071
  [is, I.value]
27062
27072
  ]),
27063
- w("div", Hp, [
27073
+ w("div", Kp, [
27064
27074
  w("button", {
27065
27075
  type: "button",
27066
27076
  class: "chat-queue__icon-btn",
@@ -27087,18 +27097,18 @@ const Ip = ["aria-busy"], sp = {
27087
27097
  ])
27088
27098
  ])
27089
27099
  ])) : (b(), S($A, { key: 1 }, [
27090
- w("span", Kp, [
27100
+ w("span", qp, [
27091
27101
  OA(pA(FB), {
27092
27102
  size: 14,
27093
27103
  "stroke-width": 1.75
27094
27104
  })
27095
27105
  ]),
27096
- w("span", qp, tA(L + 1), 1),
27097
- w("div", Tp, [
27098
- w("p", Zp, tA(o(G) || "仅附件消息"), 1),
27099
- G.payload.attachments.length ? (b(), S("span", Wp, tA(G.payload.attachments.length) + " 个附件 ", 1)) : QA("", !0)
27106
+ w("span", Tp, tA(L + 1), 1),
27107
+ w("div", Zp, [
27108
+ w("p", Wp, tA(o(G) || "仅附件消息"), 1),
27109
+ G.payload.attachments.length ? (b(), S("span", _p, tA(G.payload.attachments.length) + " 个附件 ", 1)) : QA("", !0)
27100
27110
  ]),
27101
- w("div", _p, [
27111
+ w("div", Op, [
27102
27112
  w("button", {
27103
27113
  type: "button",
27104
27114
  class: "chat-queue__icon-btn",
@@ -27110,7 +27120,7 @@ const Ip = ["aria-busy"], sp = {
27110
27120
  "stroke-width": 1.75,
27111
27121
  "aria-hidden": "true"
27112
27122
  })
27113
- ], 8, Op),
27123
+ ], 8, Vp),
27114
27124
  w("button", {
27115
27125
  type: "button",
27116
27126
  class: "chat-queue__icon-btn chat-queue__icon-btn--danger",
@@ -27122,18 +27132,18 @@ const Ip = ["aria-busy"], sp = {
27122
27132
  "stroke-width": 1.75,
27123
27133
  "aria-hidden": "true"
27124
27134
  })
27125
- ], 8, Vp)
27135
+ ], 8, Xp)
27126
27136
  ])
27127
27137
  ], 64))
27128
- ], 42, xp))), 128))
27138
+ ], 42, Lp))), 128))
27129
27139
  ])
27130
27140
  ])) : QA("", !0);
27131
27141
  }
27132
- }), zp = /* @__PURE__ */ zA(Xp, [["__scopeId", "data-v-de7ffd50"]]), jp = {
27142
+ }), jp = /* @__PURE__ */ zA(zp, [["__scopeId", "data-v-de7ffd50"]]), Pp = {
27133
27143
  key: 1,
27134
27144
  class: "chat-media-preview__loading",
27135
27145
  role: "status"
27136
- }, Pp = /* @__PURE__ */ TA({
27146
+ }, $p = /* @__PURE__ */ TA({
27137
27147
  __name: "ChatMediaPreview",
27138
27148
  props: {
27139
27149
  resource: {},
@@ -27162,10 +27172,10 @@ const Ip = ["aria-busy"], sp = {
27162
27172
  (b(), ZA(Kt("media-community-skin")))
27163
27173
  ]),
27164
27174
  _: 1
27165
- }, 8, ["src", "title"])) : (b(), S("div", jp, "正在加载播放器..."))
27175
+ }, 8, ["src", "title"])) : (b(), S("div", Pp, "正在加载播放器..."))
27166
27176
  ], 2));
27167
27177
  }
27168
- }), $p = /* @__PURE__ */ zA(Pp, [["__scopeId", "data-v-003e1844"]]), A4 = /* @__PURE__ */ TA({
27178
+ }), A4 = /* @__PURE__ */ zA($p, [["__scopeId", "data-v-003e1844"]]), e4 = /* @__PURE__ */ TA({
27169
27179
  __name: "ChatOfficePreview",
27170
27180
  props: {
27171
27181
  resource: {},
@@ -27194,10 +27204,10 @@ const Ip = ["aria-busy"], sp = {
27194
27204
  _: 1
27195
27205
  }));
27196
27206
  }
27197
- }), e4 = /* @__PURE__ */ zA(A4, [["__scopeId", "data-v-e422d916"]]), t4 = ["data-preview-kind"], g4 = {
27207
+ }), t4 = /* @__PURE__ */ zA(e4, [["__scopeId", "data-v-e422d916"]]), g4 = ["data-preview-kind"], i4 = {
27198
27208
  key: 1,
27199
27209
  class: "chat-file-preview__unsupported"
27200
- }, i4 = ["href"], I4 = /* @__PURE__ */ TA({
27210
+ }, I4 = ["href"], s4 = /* @__PURE__ */ TA({
27201
27211
  name: "ChatFilePreview",
27202
27212
  __name: "ChatFilePreview",
27203
27213
  props: {
@@ -27229,8 +27239,8 @@ const Ip = ["aria-busy"], sp = {
27229
27239
  if (g.value === "image") return i;
27230
27240
  if (g.value === "html") return I;
27231
27241
  if (g.value === "text") return s;
27232
- if (g.value === "audio" || g.value === "video") return $p;
27233
- if (["pdf", "docx", "excel", "pptx"].includes(g.value)) return e4;
27242
+ if (g.value === "audio" || g.value === "video") return A4;
27243
+ if (["pdf", "docx", "excel", "pptx"].includes(g.value)) return t4;
27234
27244
  }), C = J(
27235
27245
  () => A.renderer ?? e.previewRenderers.value[g.value] ?? hl(g.value) ?? a.value
27236
27246
  ), o = J(() => {
@@ -27246,18 +27256,18 @@ const Ip = ["aria-busy"], sp = {
27246
27256
  kind: g.value,
27247
27257
  renderer: C.value
27248
27258
  }, () => [
27249
- C.value ? (b(), ZA(Kt(C.value), Lt(Ug({ key: 0 }, o.value)), null, 16)) : (b(), S("div", g4, [
27259
+ C.value ? (b(), ZA(Kt(C.value), Lt(Ug({ key: 0 }, o.value)), null, 16)) : (b(), S("div", i4, [
27250
27260
  r[0] || (r[0] = w("p", null, "此文件暂不支持在线预览", -1)),
27251
27261
  w("a", {
27252
27262
  href: t.resource.url,
27253
27263
  target: "_blank",
27254
27264
  rel: "noopener noreferrer"
27255
- }, "下载文件", 8, i4)
27265
+ }, "下载文件", 8, I4)
27256
27266
  ]))
27257
27267
  ], !0)
27258
- ], 8, t4));
27268
+ ], 8, g4));
27259
27269
  }
27260
- }), s4 = /* @__PURE__ */ zA(I4, [["__scopeId", "data-v-e956d790"]]), a4 = ["aria-label"], C4 = { class: "chat-file-preview-panel__header" }, o4 = ["href"], n4 = { class: "chat-file-preview-panel__body" }, r4 = /* @__PURE__ */ TA({
27270
+ }), a4 = /* @__PURE__ */ zA(s4, [["__scopeId", "data-v-e956d790"]]), C4 = ["aria-label"], o4 = { class: "chat-file-preview-panel__header" }, n4 = ["href"], r4 = { class: "chat-file-preview-panel__body" }, Q4 = /* @__PURE__ */ TA({
27261
27271
  __name: "ChatFilePreviewPanel",
27262
27272
  props: {
27263
27273
  resource: {}
@@ -27284,7 +27294,7 @@ const Ip = ["aria-busy"], sp = {
27284
27294
  "aria-label": `${t.resource.fileName} 预览`,
27285
27295
  onKeydown: s
27286
27296
  }, [
27287
- w("header", C4, [
27297
+ w("header", o4, [
27288
27298
  w("div", null, [
27289
27299
  w("strong", null, tA(t.resource.fileName), 1),
27290
27300
  w("span", null, tA(t.resource.fileType.toUpperCase()), 1)
@@ -27300,7 +27310,7 @@ const Ip = ["aria-busy"], sp = {
27300
27310
  "stroke-width": 1.75,
27301
27311
  "aria-hidden": "true"
27302
27312
  })
27303
- ], 8, o4),
27313
+ ], 8, n4),
27304
27314
  w("button", {
27305
27315
  ref_key: "closeButtonRef",
27306
27316
  ref: i,
@@ -27315,14 +27325,14 @@ const Ip = ["aria-busy"], sp = {
27315
27325
  })
27316
27326
  ], 512)
27317
27327
  ]),
27318
- w("div", n4, [
27328
+ w("div", r4, [
27319
27329
  WA(a.$slots, "default", { resource: t.resource }, () => [
27320
- OA(s4, { resource: t.resource }, null, 8, ["resource"])
27330
+ OA(a4, { resource: t.resource }, null, 8, ["resource"])
27321
27331
  ], !0)
27322
27332
  ])
27323
- ], 40, a4));
27333
+ ], 40, C4));
27324
27334
  }
27325
- }), Q4 = /* @__PURE__ */ zA(r4, [["__scopeId", "data-v-6f031562"]]), B4 = ["aria-label"], l4 = /* @__PURE__ */ TA({
27335
+ }), B4 = /* @__PURE__ */ zA(Q4, [["__scopeId", "data-v-6f031562"]]), l4 = ["aria-label"], c4 = /* @__PURE__ */ TA({
27326
27336
  __name: "ChatSidebarResizeHandle",
27327
27337
  props: {
27328
27338
  ariaLabel: { default: "调整预览宽度" }
@@ -27356,34 +27366,34 @@ const Ip = ["aria-busy"], sp = {
27356
27366
  class: "chat-sidebar-resize-handle__grip",
27357
27367
  "aria-hidden": "true"
27358
27368
  }, null, -1)
27359
- ])], 40, B4));
27369
+ ])], 40, l4));
27360
27370
  }
27361
- }), c4 = /* @__PURE__ */ zA(l4, [["__scopeId", "data-v-b7bace8d"]]);
27371
+ }), E4 = /* @__PURE__ */ zA(c4, [["__scopeId", "data-v-b7bace8d"]]);
27362
27372
  let Vn = 0;
27363
- function E4(t, A) {
27364
- return [...t, { id: f4(), payload: A }];
27373
+ function h4(t, A) {
27374
+ return [...t, { id: m4(), payload: A }];
27365
27375
  }
27366
- function h4(t, A, e) {
27376
+ function u4(t, A, e) {
27367
27377
  return t.map(
27368
27378
  (g) => g.id === A ? { ...g, payload: La(e, g.payload.attachments) } : g
27369
27379
  );
27370
27380
  }
27371
- function u4(t, A) {
27381
+ function d4(t, A) {
27372
27382
  return t.filter((e) => e.id !== A);
27373
27383
  }
27374
- function d4(t, A, e) {
27384
+ function f4(t, A, e) {
27375
27385
  if (A === e || A < 0 || e < 0 || A >= t.length || e >= t.length)
27376
27386
  return [...t];
27377
27387
  const g = [...t], [i] = g.splice(A, 1);
27378
27388
  return g.splice(e, 0, i), g;
27379
27389
  }
27380
- function f4() {
27390
+ function m4() {
27381
27391
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : (Vn += 1, `chat-queue-${Vn}`);
27382
27392
  }
27383
- const m4 = ["data-chat-color-mode"], w4 = { class: "chat-bot__main" }, D4 = { class: "chat-bot__conversation" }, p4 = { class: "chat-bot__sender" }, k4 = {
27393
+ const w4 = ["data-chat-color-mode"], D4 = { class: "chat-bot__main" }, p4 = { class: "chat-bot__conversation" }, k4 = { class: "chat-bot__sender" }, y4 = {
27384
27394
  key: 2,
27385
27395
  class: "chat-bot__sidebar-placeholder"
27386
- }, y4 = /* @__PURE__ */ TA({
27396
+ }, F4 = /* @__PURE__ */ TA({
27387
27397
  name: "ChatBot",
27388
27398
  __name: "ChatBot",
27389
27399
  props: {
@@ -27463,7 +27473,7 @@ const m4 = ["data-chat-color-mode"], w4 = { class: "chat-bot__main" }, D4 = { cl
27463
27473
  function W(K) {
27464
27474
  if (C.value === "streaming") {
27465
27475
  if (!g.enableQueue) return;
27466
- O(E4(N.value, K));
27476
+ O(h4(N.value, K));
27467
27477
  return;
27468
27478
  }
27469
27479
  kA(K);
@@ -27479,13 +27489,13 @@ const m4 = ["data-chat-color-mode"], w4 = { class: "chat-bot__main" }, D4 = { cl
27479
27489
  N.value = [...K], i("update:queue", N.value);
27480
27490
  }
27481
27491
  function nA(K, rA) {
27482
- O(h4(N.value, K, rA));
27492
+ O(u4(N.value, K, rA));
27483
27493
  }
27484
27494
  function mA(K) {
27485
- O(u4(N.value, K));
27495
+ O(d4(N.value, K));
27486
27496
  }
27487
27497
  function MA(K, rA) {
27488
- O(d4(N.value, K, rA));
27498
+ O(f4(N.value, K, rA));
27489
27499
  }
27490
27500
  function NA(K) {
27491
27501
  var rA;
@@ -27507,7 +27517,7 @@ const m4 = ["data-chat-color-mode"], w4 = { class: "chat-bot__main" }, D4 = { cl
27507
27517
  const Me = () => Ue.abort();
27508
27518
  (q = rA.signal) == null || q.addEventListener("abort", Me, { once: !0 }), (AA = rA.signal) != null && AA.aborted && Ue.abort();
27509
27519
  try {
27510
- const ge = await ep(K, {
27520
+ const ge = await tp(K, {
27511
27521
  signal: Ue.signal,
27512
27522
  onUpdate(ae, Ze) {
27513
27523
  if (ie !== L) return;
@@ -27582,9 +27592,9 @@ const m4 = ["data-chat-color-mode"], w4 = { class: "chat-bot__main" }, D4 = { cl
27582
27592
  style: $e(_.value),
27583
27593
  "data-chat-color-mode": M.value
27584
27594
  }, [
27585
- w("div", w4, [
27586
- w("div", D4, [
27587
- OA(rp, Ug({
27595
+ w("div", D4, [
27596
+ w("div", p4, [
27597
+ OA(Qp, Ug({
27588
27598
  ref_key: "conversationRef",
27589
27599
  ref: B,
27590
27600
  messages: a.value,
@@ -27658,9 +27668,9 @@ const m4 = ["data-chat-color-mode"], w4 = { class: "chat-bot__main" }, D4 = { cl
27658
27668
  } : void 0
27659
27669
  ]), 1040, ["messages", "status", "streaming-message-index", "theme", "response-error", "tool-states"])
27660
27670
  ]),
27661
- w("div", p4, [
27671
+ w("div", k4, [
27662
27672
  WA(K.$slots, "sender-prepend", {}, void 0, !0),
27663
- t.enableQueue ? (b(), ZA(zp, {
27673
+ t.enableQueue ? (b(), ZA(jp, {
27664
27674
  key: 0,
27665
27675
  items: N.value,
27666
27676
  onEdit: nA,
@@ -27685,7 +27695,7 @@ const m4 = ["data-chat-color-mode"], w4 = { class: "chat-bot__main" }, D4 = { cl
27685
27695
  "chat-bot__sidebar--expanded": h.value
27686
27696
  }])
27687
27697
  }, [
27688
- h.value ? QA("", !0) : (b(), ZA(c4, {
27698
+ h.value ? QA("", !0) : (b(), ZA(E4, {
27689
27699
  key: 0,
27690
27700
  onResize: DA
27691
27701
  })),
@@ -27698,7 +27708,7 @@ const m4 = ["data-chat-color-mode"], w4 = { class: "chat-bot__main" }, D4 = { cl
27698
27708
  artifact: E.value,
27699
27709
  file: u.value
27700
27710
  }, () => [
27701
- u.value ? (b(), ZA(Q4, {
27711
+ u.value ? (b(), ZA(B4, {
27702
27712
  key: 0,
27703
27713
  resource: u.value,
27704
27714
  onClose: Z
@@ -27710,13 +27720,13 @@ const m4 = ["data-chat-color-mode"], w4 = { class: "chat-bot__main" }, D4 = { cl
27710
27720
  ]),
27711
27721
  key: "0"
27712
27722
  } : void 0
27713
- ]), 1032, ["resource"])) : E.value ? (b(), ZA(Sp, {
27723
+ ]), 1032, ["resource"])) : E.value ? (b(), ZA(Yp, {
27714
27724
  key: 1,
27715
27725
  artifact: E.value,
27716
27726
  expanded: h.value,
27717
27727
  onClose: Z,
27718
27728
  onToggleExpanded: cA
27719
- }, null, 8, ["artifact", "expanded"])) : (b(), S("div", k4, [...rA[3] || (rA[3] = [
27729
+ }, null, 8, ["artifact", "expanded"])) : (b(), S("div", y4, [...rA[3] || (rA[3] = [
27720
27730
  w("svg", {
27721
27731
  viewBox: "0 0 24 24",
27722
27732
  fill: "none",
@@ -27745,9 +27755,9 @@ const m4 = ["data-chat-color-mode"], w4 = { class: "chat-bot__main" }, D4 = { cl
27745
27755
  ], !0)
27746
27756
  ], 2)
27747
27757
  ], 2)) : QA("", !0)
27748
- ], 12, m4));
27758
+ ], 12, w4));
27749
27759
  }
27750
- }), T4 = /* @__PURE__ */ zA(y4, [["__scopeId", "data-v-d0456c29"]]), F4 = ["data-chat-color-mode"], N4 = /* @__PURE__ */ TA({
27760
+ }), Z4 = /* @__PURE__ */ zA(F4, [["__scopeId", "data-v-d0456c29"]]), N4 = ["data-chat-color-mode"], b4 = /* @__PURE__ */ TA({
27751
27761
  name: "ChatProvider",
27752
27762
  __name: "ChatProvider",
27753
27763
  props: {
@@ -27778,10 +27788,10 @@ const m4 = ["data-chat-color-mode"], w4 = { class: "chat-bot__main" }, D4 = { cl
27778
27788
  "data-chat-color-mode": s.value
27779
27789
  }, [
27780
27790
  WA(o.$slots, "default", {}, void 0, !0)
27781
- ], 8, F4));
27791
+ ], 8, N4));
27782
27792
  }
27783
- }), Z4 = /* @__PURE__ */ zA(N4, [["__scopeId", "data-v-32922048"]]);
27784
- function W4(t = []) {
27793
+ }), W4 = /* @__PURE__ */ zA(b4, [["__scopeId", "data-v-32922048"]]);
27794
+ function _4(t = []) {
27785
27795
  const A = gA(Xn(t));
27786
27796
  function e(I) {
27787
27797
  A.value = [...A.value, BQ(I)];
@@ -27801,24 +27811,24 @@ function BQ(t) {
27801
27811
  return JSON.parse(JSON.stringify(t));
27802
27812
  }
27803
27813
  export {
27804
- K4 as ARTIFACT_BLOCK_SYSTEM_PROMPT,
27805
- H4 as ASK_USER_FORM_SYSTEM_PROMPT,
27814
+ q4 as ARTIFACT_BLOCK_SYSTEM_PROMPT,
27815
+ K4 as ASK_USER_FORM_SYSTEM_PROMPT,
27806
27816
  Gu as ChartToolRenderer,
27807
27817
  al as ChatActionbar,
27808
27818
  vl as ChatAttachments,
27809
- T4 as ChatBot,
27810
- s4 as ChatFilePreview,
27811
- Q4 as ChatFilePreviewPanel,
27819
+ Z4 as ChatBot,
27820
+ a4 as ChatFilePreview,
27821
+ B4 as ChatFilePreviewPanel,
27812
27822
  Ul as ChatFollowUps,
27813
27823
  fl as ChatImageLightbox,
27814
27824
  k2 as ChatMessage,
27815
- Z4 as ChatProvider,
27816
- zp as ChatQueue,
27825
+ W4 as ChatProvider,
27826
+ jp as ChatQueue,
27817
27827
  Du as ChatReasoning,
27818
27828
  pD as ChatSender,
27819
27829
  jw as ChatToolGroup,
27820
27830
  Hu as CodeToolRenderer,
27821
- rp as ConversationList,
27831
+ Qp as ConversationList,
27822
27832
  ZQ as D3MindMap,
27823
27833
  Is as DEFAULT_CHAT_ATTACHMENT_LIMITS,
27824
27834
  bD as EmptyState,
@@ -27840,27 +27850,27 @@ export {
27840
27850
  y2 as createChatAttachmentController,
27841
27851
  Cr as createChatMessageId,
27842
27852
  yQ as darkTheme,
27843
- Y4 as debounce,
27853
+ J4 as debounce,
27844
27854
  mC as deepClone,
27845
27855
  $g as defaultTheme,
27846
- U4 as downloadBlob,
27847
- h4 as editChatQueueItem,
27848
- E4 as enqueueChatPayload,
27856
+ M4 as downloadBlob,
27857
+ u4 as editChatQueueItem,
27858
+ h4 as enqueueChatPayload,
27849
27859
  ra as getChatPreviewKind,
27850
27860
  $i as getFileExtension,
27851
27861
  IQ as getQiniuUploadCredential,
27852
27862
  ys as getTextWidth,
27853
- S4 as getTheme,
27854
- M4 as isGradient,
27863
+ Y4 as getTheme,
27864
+ x4 as isGradient,
27855
27865
  GQ as mergeTheme,
27856
27866
  NQ as minimalTheme,
27857
- d4 as moveChatQueueItem,
27858
- x4 as parseGradientColor,
27867
+ f4 as moveChatQueueItem,
27868
+ L4 as parseGradientColor,
27859
27869
  ar as parseQiniuUploadResult,
27860
27870
  bQ as professionalTheme,
27861
- L4 as registerChatPreviewRenderer,
27871
+ H4 as registerChatPreviewRenderer,
27862
27872
  Wt as registerToolRenderer,
27863
- u4 as removeChatQueueItem,
27873
+ d4 as removeChatQueueItem,
27864
27874
  hC as resolveChatAttachmentLimits,
27865
27875
  hl as resolveChatPreviewRenderer,
27866
27876
  Ew as resolveToolRenderer,
@@ -27868,12 +27878,12 @@ export {
27868
27878
  YQ as svgToBlob,
27869
27879
  JQ as svgToPng,
27870
27880
  vQ as themes,
27871
- J4 as throttle,
27881
+ U4 as throttle,
27872
27882
  nl as toChatResourceFile,
27873
- q4 as uploadFile,
27883
+ T4 as uploadFile,
27874
27884
  sQ as uploadFileToQiniu,
27875
27885
  iI as useChatContext,
27876
- W4 as useConversation,
27886
+ _4 as useConversation,
27877
27887
  SQ as useMindMapLayout,
27878
27888
  RQ as useMindMapTheme,
27879
27889
  ol as validateAttachmentFile