@blueking/chat-x 0.0.3-beta.2 → 0.0.3-beta.4

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
@@ -266,6 +266,7 @@ const getCookieByName = (e) => {
266
266
  复制失败: "Copy Failed",
267
267
  返回底部: "Return to bottom",
268
268
  停止生成: "Stop generating",
269
+ 正在停止: "Stopping",
269
270
  耗时: "Duration",
270
271
  参数: "Parameters",
271
272
  描述: "Description",
@@ -318,7 +319,8 @@ const getCookieByName = (e) => {
318
319
  重新加载: "Reload",
319
320
  宽: "W",
320
321
  高: "H",
321
- 上传图片: "Upload Image"
322
+ 上传图片: "Upload Image",
323
+ "上传图片, 最多支持上传 3 个, 最大支持 2.4MB": "Upload Image, up to 3 images supported, max 2.4MB each"
322
324
  }, t = (e) => isEn ? lang[e] : e, CHAT_Z_INDEX = 9999, EDITOR_Z_INDEX = CHAT_Z_INDEX + 1, EDITOR_MENU_Z_INDEX = EDITOR_Z_INDEX + 1, SHORTCUT_MENU_Z_INDEX = EDITOR_MENU_Z_INDEX + 1, SELECTION_Z_INDEX = SHORTCUT_MENU_Z_INDEX + 1, CONST_MESSAGE_TOOLS = [
323
325
  {
324
326
  description: t("复制"),
@@ -1474,12 +1476,12 @@ function preventOverflow$1(e) {
1474
1476
  var j, M = S === "y" ? top$1 : left$1, N = S === "y" ? bottom$1 : right$1, P = S === "y" ? "height" : "width", F = w[S], I = F + v[M], L = F - v[N], R = m ? -E[P] / 2 : 0, z = b === start$1 ? T[P] : E[P], B = b === start$1 ? -E[P] : -T[P], V = n.elements.arrow, H = m && V ? getLayoutRect$1(V) : {
1475
1477
  width: 0,
1476
1478
  height: 0
1477
- }, U = n.modifiersData["arrow#persistent"] ? n.modifiersData["arrow#persistent"].padding : getFreshSideObject$1(), W = U[M], G = U[N], K = within$1(0, T[P], H[P]), q = x ? T[P] / 2 - R - K - W - O.mainAxis : z - K - W - O.mainAxis, Wy = x ? -T[P] / 2 + R + K + G + O.mainAxis : B + K + G + O.mainAxis, J = n.elements.arrow && getOffsetParent$1(n.elements.arrow), Gy = J ? S === "y" ? J.clientTop || 0 : J.clientLeft || 0 : 0, Y = (j = k == null ? void 0 : k[S]) == null ? 0 : j, Ky = F + q - Y - Gy, qy = F + Wy - Y, X = within$1(m ? min$2(I, Ky) : I, F, m ? max$1(L, qy) : L);
1479
+ }, U = n.modifiersData["arrow#persistent"] ? n.modifiersData["arrow#persistent"].padding : getFreshSideObject$1(), W = U[M], G = U[N], K = within$1(0, T[P], H[P]), q = x ? T[P] / 2 - R - K - W - O.mainAxis : z - K - W - O.mainAxis, Uy = x ? -T[P] / 2 + R + K + G + O.mainAxis : B + K + G + O.mainAxis, J = n.elements.arrow && getOffsetParent$1(n.elements.arrow), Wy = J ? S === "y" ? J.clientTop || 0 : J.clientLeft || 0 : 0, Y = (j = k == null ? void 0 : k[S]) == null ? 0 : j, Gy = F + q - Y - Wy, Ky = F + Uy - Y, X = within$1(m ? min$2(I, Gy) : I, F, m ? max$1(L, Ky) : L);
1478
1480
  w[S] = X, A[S] = X - F;
1479
1481
  }
1480
1482
  if (c) {
1481
- var Jy, Yy = S === "x" ? top$1 : left$1, Xy = S === "x" ? bottom$1 : right$1, Z = w[C], Q = C === "y" ? "height" : "width", $ = Z + v[Yy], Zy = Z - v[Xy], Qy = [top$1, left$1].indexOf(y) !== -1, $y = (Jy = k == null ? void 0 : k[C]) == null ? 0 : Jy, eb = Qy ? $ : Z - T[Q] - E[Q] - $y + O.altAxis, tb = Qy ? Z + T[Q] + E[Q] - $y - O.altAxis : Zy, nb = m && Qy ? withinMaxClamp$1(eb, Z, tb) : within$1(m ? eb : $, Z, m ? tb : Zy);
1482
- w[C] = nb, A[C] = nb - Z;
1483
+ var qy, Jy = S === "x" ? top$1 : left$1, Yy = S === "x" ? bottom$1 : right$1, Z = w[C], Q = C === "y" ? "height" : "width", $ = Z + v[Jy], Xy = Z - v[Yy], Zy = [top$1, left$1].indexOf(y) !== -1, Qy = (qy = k == null ? void 0 : k[C]) == null ? 0 : qy, $y = Zy ? $ : Z - T[Q] - E[Q] - Qy + O.altAxis, eb = Zy ? Z + T[Q] + E[Q] - Qy - O.altAxis : Xy, tb = m && Zy ? withinMaxClamp$1($y, Z, eb) : within$1(m ? $y : $, Z, m ? eb : Xy);
1484
+ w[C] = tb, A[C] = tb - Z;
1483
1485
  }
1484
1486
  n.modifiersData[i] = A;
1485
1487
  }
@@ -1956,16 +1958,16 @@ function createTippy$1(e, n) {
1956
1958
  isShown: !1
1957
1959
  },
1958
1960
  plugins: b,
1959
- clearDelayTimeouts: $y,
1960
- setProps: eb,
1961
- setContent: tb,
1962
- show: nb,
1963
- hide: rb,
1964
- hideWithInteractivity: ib,
1965
- enable: Zy,
1966
- disable: Qy,
1967
- unmount: ab,
1968
- destroy: ob
1961
+ clearDelayTimeouts: Qy,
1962
+ setProps: $y,
1963
+ setContent: eb,
1964
+ show: tb,
1965
+ hide: nb,
1966
+ hideWithInteractivity: rb,
1967
+ enable: Xy,
1968
+ disable: Zy,
1969
+ unmount: ib,
1970
+ destroy: ab
1969
1971
  };
1970
1972
  /* istanbul ignore if */
1971
1973
  if (!r.render) return x;
@@ -1974,7 +1976,7 @@ function createTippy$1(e, n) {
1974
1976
  var T = b.map(function(e) {
1975
1977
  return e.fn(x);
1976
1978
  }), E = e.hasAttribute("aria-expanded");
1977
- return Wy(), L(), P(), F("onCreate", [x]), r.showOnCreate && Q(), C.addEventListener("mouseenter", function() {
1979
+ return Uy(), L(), P(), F("onCreate", [x]), r.showOnCreate && Q(), C.addEventListener("mouseenter", function() {
1978
1980
  x.props.interactive && x.state.isVisible && x.clearDelayTimeouts();
1979
1981
  }), C.addEventListener("mouseleave", function() {
1980
1982
  x.props.interactive && x.props.trigger.indexOf("mouseenter") >= 0 && j().addEventListener("mousemove", g);
@@ -2093,17 +2095,17 @@ function createTippy$1(e, n) {
2093
2095
  });
2094
2096
  });
2095
2097
  }
2096
- function Wy() {
2097
- O() && (q("touchstart", Gy, { passive: !0 }), q("touchend", Ky, { passive: !0 })), splitBySpaces$1(x.props.trigger).forEach(function(e) {
2098
- if (e !== "manual") switch (q(e, Gy), e) {
2098
+ function Uy() {
2099
+ O() && (q("touchstart", Wy, { passive: !0 }), q("touchend", Gy, { passive: !0 })), splitBySpaces$1(x.props.trigger).forEach(function(e) {
2100
+ if (e !== "manual") switch (q(e, Wy), e) {
2099
2101
  case "mouseenter":
2100
- q("mouseleave", Ky);
2102
+ q("mouseleave", Gy);
2101
2103
  break;
2102
2104
  case "focus":
2103
- q(isIE11$1 ? "focusout" : "blur", qy);
2105
+ q(isIE11$1 ? "focusout" : "blur", Ky);
2104
2106
  break;
2105
2107
  case "focusin":
2106
- q("focusout", qy);
2108
+ q("focusout", Ky);
2107
2109
  break;
2108
2110
  }
2109
2111
  });
@@ -2114,7 +2116,7 @@ function createTippy$1(e, n) {
2114
2116
  n.removeEventListener(r, i, a);
2115
2117
  }), m = [];
2116
2118
  }
2117
- function Gy(e) {
2119
+ function Wy(e) {
2118
2120
  var n, r = !1;
2119
2121
  if (!(!x.state.isEnabled || X(e) || c)) {
2120
2122
  var i = ((n = d) == null ? void 0 : n.type) === "focus";
@@ -2134,7 +2136,7 @@ function createTippy$1(e, n) {
2134
2136
  } : null;
2135
2137
  }).filter(Boolean), e) && (R(), $(e));
2136
2138
  }
2137
- function Ky(e) {
2139
+ function Gy(e) {
2138
2140
  if (!(X(e) || x.props.trigger.indexOf("click") >= 0 && s)) {
2139
2141
  if (x.props.interactive) {
2140
2142
  x.hideWithInteractivity(e);
@@ -2143,14 +2145,14 @@ function createTippy$1(e, n) {
2143
2145
  $(e);
2144
2146
  }
2145
2147
  }
2146
- function qy(e) {
2148
+ function Ky(e) {
2147
2149
  x.props.trigger.indexOf("focusin") < 0 && e.target !== A() || x.props.interactive && e.relatedTarget && C.contains(e.relatedTarget) || $(e);
2148
2150
  }
2149
2151
  function X(e) {
2150
2152
  return currentInput$1.isTouch ? O() !== e.type.indexOf("touch") >= 0 : !1;
2151
2153
  }
2152
- function Jy() {
2153
- Yy();
2154
+ function qy() {
2155
+ Jy();
2154
2156
  var n = x.props, r = n.popperOptions, i = n.placement, a = n.offset, o = n.getReferenceClientRect, s = n.moveTransition, c = k() ? getChildren$1(C).arrow : null, l = o ? {
2155
2157
  getBoundingClientRect: o,
2156
2158
  contextElement: o.contextElement || A()
@@ -2208,12 +2210,12 @@ function createTippy$1(e, n) {
2208
2210
  modifiers: u
2209
2211
  }));
2210
2212
  }
2211
- function Yy() {
2213
+ function Jy() {
2212
2214
  x.popperInstance && (x.popperInstance.destroy(), x.popperInstance = null);
2213
2215
  }
2214
- function Xy() {
2216
+ function Yy() {
2215
2217
  var e = x.props.appendTo, n, r = A();
2216
- n = x.props.interactive && e === TIPPY_DEFAULT_APPEND_TO$1 || e === "parent" ? r.parentNode : invokeWithArgsOrReturn$1(e, [r]), n.contains(C) || n.appendChild(C), x.state.isMounted = !0, Jy();
2218
+ n = x.props.interactive && e === TIPPY_DEFAULT_APPEND_TO$1 || e === "parent" ? r.parentNode : invokeWithArgsOrReturn$1(e, [r]), n.contains(C) || n.appendChild(C), x.state.isMounted = !0, qy();
2217
2219
  }
2218
2220
  function Z() {
2219
2221
  return arrayFrom$1(C.querySelectorAll("[data-tippy-root]"));
@@ -2239,30 +2241,30 @@ function createTippy$1(e, n) {
2239
2241
  });
2240
2242
  }
2241
2243
  }
2242
- function Zy() {
2244
+ function Xy() {
2243
2245
  x.state.isEnabled = !0;
2244
2246
  }
2245
- function Qy() {
2247
+ function Zy() {
2246
2248
  x.hide(), x.state.isEnabled = !1;
2247
2249
  }
2248
- function $y() {
2250
+ function Qy() {
2249
2251
  clearTimeout(i), clearTimeout(a), cancelAnimationFrame(o);
2250
2252
  }
2251
- function eb(n) {
2253
+ function $y(n) {
2252
2254
  if (!x.state.isDestroyed) {
2253
2255
  F("onBeforeUpdate", [x, n]), J();
2254
2256
  var r = x.props, i = evaluateProps$1(e, Object.assign({}, r, removeUndefinedProps$1(n), { ignoreAttributes: !0 }));
2255
- x.props = i, Wy(), r.interactiveDebounce !== i.interactiveDebounce && (R(), g = debounce$1$1(Y, i.interactiveDebounce)), r.triggerTarget && !i.triggerTarget ? normalizeToArray$1(r.triggerTarget).forEach(function(e) {
2257
+ x.props = i, Uy(), r.interactiveDebounce !== i.interactiveDebounce && (R(), g = debounce$1$1(Y, i.interactiveDebounce)), r.triggerTarget && !i.triggerTarget ? normalizeToArray$1(r.triggerTarget).forEach(function(e) {
2256
2258
  e.removeAttribute("aria-expanded");
2257
- }) : i.triggerTarget && e.removeAttribute("aria-expanded"), L(), P(), w && w(r, i), x.popperInstance && (Jy(), Z().forEach(function(e) {
2259
+ }) : i.triggerTarget && e.removeAttribute("aria-expanded"), L(), P(), w && w(r, i), x.popperInstance && (qy(), Z().forEach(function(e) {
2258
2260
  requestAnimationFrame(e._tippy.popperInstance.forceUpdate);
2259
2261
  })), F("onAfterUpdate", [x, n]);
2260
2262
  }
2261
2263
  }
2262
- function tb(e) {
2264
+ function eb(e) {
2263
2265
  x.setProps({ content: e });
2264
2266
  }
2265
- function nb() {
2267
+ function tb() {
2266
2268
  var e = x.state.isVisible, n = x.state.isDestroyed, r = !x.state.isEnabled, i = currentInput$1.isTouch && !x.props.touch, a = getValueAtIndexOrReturn$1(x.props.duration, 0, defaultProps$1.duration);
2267
2269
  if (!(e || n || r || i) && !A().hasAttribute("disabled") && (F("onShow", [x], !1), x.props.onShow(x) !== !1)) {
2268
2270
  if (x.state.isVisible = !0, k() && (C.style.visibility = "visible"), P(), H(), x.state.isMounted || (C.style.transition = "none"), k()) {
@@ -2280,10 +2282,10 @@ function createTippy$1(e, n) {
2280
2282
  x.state.isShown = !0, F("onShown", [x]);
2281
2283
  });
2282
2284
  }
2283
- }, Xy();
2285
+ }, Yy();
2284
2286
  }
2285
2287
  }
2286
- function rb() {
2288
+ function nb() {
2287
2289
  var e = !x.state.isVisible, n = x.state.isDestroyed, r = !x.state.isEnabled, i = getValueAtIndexOrReturn$1(x.props.duration, 1, defaultProps$1.duration);
2288
2290
  if (!(e || n || r) && (F("onHide", [x], !1), x.props.onHide(x) !== !1)) {
2289
2291
  if (x.state.isVisible = !1, x.state.isShown = !1, u = !1, s = !1, k() && (C.style.visibility = "hidden"), R(), U(), P(!0), k()) {
@@ -2293,17 +2295,17 @@ function createTippy$1(e, n) {
2293
2295
  I(), L(), x.props.animation ? k() && W(i, x.unmount) : x.unmount();
2294
2296
  }
2295
2297
  }
2296
- function ib(e) {
2298
+ function rb(e) {
2297
2299
  j().addEventListener("mousemove", g), pushIfUnique$1(mouseMoveListeners$1, g), g(e);
2298
2300
  }
2299
- function ab() {
2300
- x.state.isVisible && x.hide(), x.state.isMounted && (Yy(), Z().forEach(function(e) {
2301
+ function ib() {
2302
+ x.state.isVisible && x.hide(), x.state.isMounted && (Jy(), Z().forEach(function(e) {
2301
2303
  e._tippy.unmount();
2302
2304
  }), C.parentNode && C.parentNode.removeChild(C), mountedInstances$1 = mountedInstances$1.filter(function(e) {
2303
2305
  return e !== x;
2304
2306
  }), x.state.isMounted = !1, F("onHidden", [x]));
2305
2307
  }
2306
- function ob() {
2308
+ function ab() {
2307
2309
  x.state.isDestroyed || (x.clearDelayTimeouts(), x.unmount(), J(), delete e._tippy, x.state.isDestroyed = !0, F("onDestroy", [x]));
2308
2310
  }
2309
2311
  }
@@ -3022,7 +3024,7 @@ setDefaultProps$1$1({
3022
3024
  animateFill
3023
3025
  ]
3024
3026
  });
3025
- var _hoisted_1$38 = ["src"], shortcut_btn_default = /* @__PURE__ */ defineComponent({
3027
+ var _hoisted_1$37 = ["src"], shortcut_btn_default = /* @__PURE__ */ defineComponent({
3026
3028
  __name: "shortcut-btn",
3027
3029
  props: {
3028
3030
  mode: {},
@@ -3046,7 +3048,7 @@ var _hoisted_1$38 = ["src"], shortcut_btn_default = /* @__PURE__ */ defineCompon
3046
3048
  key: 0,
3047
3049
  class: "ai-common-icon ai-shortcut-btn-icon",
3048
3050
  src: n.shortcut.icon
3049
- }, null, 8, _hoisted_1$38)) : createCommentVNode("", !0), createElementVNode("span", { class: normalizeClass(n.shortcut.icon) }, null, 2)], 64)) : (openBlock(), createBlock(resolveDynamicComponent(typeof ((i = n.shortcut) == null ? void 0 : i.icon) == "function" ? (a = (o = n.shortcut).icon) == null ? void 0 : a.call(o, h) : n.shortcut.icon), {
3051
+ }, null, 8, _hoisted_1$37)) : createCommentVNode("", !0), createElementVNode("span", { class: normalizeClass(n.shortcut.icon) }, null, 2)], 64)) : (openBlock(), createBlock(resolveDynamicComponent(typeof ((i = n.shortcut) == null ? void 0 : i.icon) == "function" ? (a = (o = n.shortcut).icon) == null ? void 0 : a.call(o, h) : n.shortcut.icon), {
3050
3052
  key: 1,
3051
3053
  class: "ai-shortcut-btn-icon"
3052
3054
  }))], 64)) : n.shortcut && !((d = n.shortcut.components) != null && d.length) ? (openBlock(), createBlock(unref(AgentIcon), {
@@ -3055,7 +3057,7 @@ var _hoisted_1$38 = ["src"], shortcut_btn_default = /* @__PURE__ */ defineCompon
3055
3057
  })) : createCommentVNode("", !0), createTextVNode(" " + toDisplayString(((p = n.shortcut) == null ? void 0 : p.alias) || ((m = n.shortcut) == null ? void 0 : m.name)), 1)];
3056
3058
  }), renderSlot(r.$slots, "append")], 2));
3057
3059
  }
3058
- }), _hoisted_1$37 = { class: "ai-selection-popover-content" }, _hoisted_2$26 = {
3060
+ }), _hoisted_1$36 = { class: "ai-selection-popover-content" }, _hoisted_2$26 = {
3059
3061
  key: 0,
3060
3062
  class: "shortcut-menu"
3061
3063
  }, ai_selection_default = /* @__PURE__ */ defineComponent({
@@ -3197,7 +3199,7 @@ var _hoisted_1$38 = ["src"], shortcut_btn_default = /* @__PURE__ */ defineCompon
3197
3199
  zIndex: unref(SELECTION_Z_INDEX)
3198
3200
  }),
3199
3201
  onMousedown: o[2] || (o[2] = withModifiers(() => {}, ["stop"]))
3200
- }, [createElementVNode("div", _hoisted_1$37, [renderSlot(a.$slots, "default", { shortcuts: r.shortcuts }, () => [(openBlock(!0), createElementBlock(Fragment, null, renderList(r.shortcuts.slice(0, r.maxShortcutCount), (n, i) => (openBlock(), createElementBlock(Fragment, { key: n.id }, [i < r.maxShortcutCount ? (openBlock(), createBlock(shortcut_btn_default, {
3202
+ }, [createElementVNode("div", _hoisted_1$36, [renderSlot(a.$slots, "default", { shortcuts: r.shortcuts }, () => [(openBlock(!0), createElementBlock(Fragment, null, renderList(r.shortcuts.slice(0, r.maxShortcutCount), (n, i) => (openBlock(), createElementBlock(Fragment, { key: n.id }, [i < r.maxShortcutCount ? (openBlock(), createBlock(shortcut_btn_default, {
3201
3203
  key: 0,
3202
3204
  shortcut: n,
3203
3205
  onClick: (e) => w(n)
@@ -3275,7 +3277,7 @@ const useObserverVisibleList = (e, n, r) => {
3275
3277
  calculateVisibleMenuItems: a
3276
3278
  };
3277
3279
  };
3278
- var _hoisted_1$36 = { class: "shortcut-menu" }, GAP = 4, shortcut_btns_default = /* @__PURE__ */ defineComponent({
3280
+ var _hoisted_1$35 = { class: "shortcut-menu" }, GAP = 4, shortcut_btns_default = /* @__PURE__ */ defineComponent({
3279
3281
  __name: "shortcut-btns",
3280
3282
  props: { shortcuts: {} },
3281
3283
  emits: ["selectShortcut"],
@@ -3333,7 +3335,7 @@ var _hoisted_1$36 = { class: "shortcut-menu" }, GAP = 4, shortcut_btns_default =
3333
3335
  b.value = !1;
3334
3336
  })
3335
3337
  }, {
3336
- content: withCtx(() => [createElementVNode("div", _hoisted_1$36, [(openBlock(!0), createElementBlock(Fragment, null, renderList(y.value, (e) => (openBlock(), createBlock(shortcut_btn_default, {
3338
+ content: withCtx(() => [createElementVNode("div", _hoisted_1$35, [(openBlock(!0), createElementBlock(Fragment, null, renderList(y.value, (e) => (openBlock(), createBlock(shortcut_btn_default, {
3337
3339
  key: e.id,
3338
3340
  mode: "menu",
3339
3341
  shortcut: e,
@@ -3370,7 +3372,7 @@ function _objectWithoutProperties(e, n) {
3370
3372
  }
3371
3373
  return a;
3372
3374
  }
3373
- var _excluded = ["options"], _excluded2 = ["options"], _hoisted_1$35 = { class: "shortcut-render" }, _hoisted_2$25 = { class: "shortcut-render-header" }, _hoisted_3$17 = { class: "header-name" }, _hoisted_4$17 = { class: "shortcut-render-content" }, _hoisted_5$12 = { class: "shortcut-footer" }, shortcut_render_default = /* @__PURE__ */ defineComponent({
3375
+ var _excluded = ["options"], _excluded2 = ["options"], _hoisted_1$34 = { class: "shortcut-render" }, _hoisted_2$25 = { class: "shortcut-render-header" }, _hoisted_3$17 = { class: "header-name" }, _hoisted_4$17 = { class: "shortcut-render-content" }, _hoisted_5$12 = { class: "shortcut-footer" }, shortcut_render_default = /* @__PURE__ */ defineComponent({
3374
3376
  __name: "shortcut-render",
3375
3377
  props: {
3376
3378
  alias: {},
@@ -3448,7 +3450,7 @@ var _excluded = ["options"], _excluded2 = ["options"], _hoisted_1$35 = { class:
3448
3450
  }, x = () => {
3449
3451
  a("close");
3450
3452
  };
3451
- return (r, i) => (openBlock(), createElementBlock("div", _hoisted_1$35, [createElementVNode("div", _hoisted_2$25, [
3453
+ return (r, i) => (openBlock(), createElementBlock("div", _hoisted_1$34, [createElementVNode("div", _hoisted_2$25, [
3452
3454
  createVNode(unref(ThinkingIcon), { class: "header-icon" }),
3453
3455
  createElementVNode("span", _hoisted_3$17, toDisplayString(n.alias || n.name), 1),
3454
3456
  createVNode(unref(CloseIcon), {
@@ -6890,7 +6892,7 @@ function parseLatexEnvName(e, n) {
6890
6892
  endIdx: r + 1
6891
6893
  };
6892
6894
  }
6893
- var _hoisted_1$34 = { key: 1 }, tool_btn_default = /* @__PURE__ */ defineComponent({
6895
+ var _hoisted_1$33 = { key: 1 }, tool_btn_default = /* @__PURE__ */ defineComponent({
6894
6896
  __name: "tool-btn",
6895
6897
  props: {
6896
6898
  description: {},
@@ -6917,9 +6919,9 @@ var _hoisted_1$34 = { key: 1 }, tool_btn_default = /* @__PURE__ */ defineCompone
6917
6919
  }]),
6918
6920
  style: normalizeStyle({ "--ai-tool-btn-active-color": e.id === "like" || e.id === "activeLike" ? "#3a84ff" : "#E71818" }),
6919
6921
  onClick: c
6920
- }, [e.id in unref(ToolIconsMap) ? (openBlock(), createBlock(resolveDynamicComponent(unref(ToolIconsMap)[e.id]), { key: 0 })) : (openBlock(), createElementBlock("div", _hoisted_1$34, toDisplayString(e.name), 1))], 6)), [[unref(directive), o.value]]);
6922
+ }, [e.id in unref(ToolIconsMap) ? (openBlock(), createBlock(resolveDynamicComponent(unref(ToolIconsMap)[e.id]), { key: 0 })) : (openBlock(), createElementBlock("div", _hoisted_1$33, toDisplayString(e.name), 1))], 6)), [[unref(directive), o.value]]);
6921
6923
  }
6922
- }), _hoisted_1$33 = { class: "code-content-wrapper" }, _hoisted_2$24 = { class: "code-content-header" }, _hoisted_3$16 = { class: "code-header-language" }, _hoisted_4$16 = { class: "hljs-pre" }, _hoisted_5$11 = ["innerHTML"], _hoisted_6$5 = ["innerHTML"], MAX_CACHE_SIZE = 500, code_content_default = /* @__PURE__ */ defineComponent({
6924
+ }), _hoisted_1$32 = { class: "code-content-wrapper" }, _hoisted_2$24 = { class: "code-content-header" }, _hoisted_3$16 = { class: "code-header-language" }, _hoisted_4$16 = { class: "hljs-pre" }, _hoisted_5$11 = ["innerHTML"], _hoisted_6$5 = ["innerHTML"], MAX_CACHE_SIZE = 500, code_content_default = /* @__PURE__ */ defineComponent({
6923
6925
  __name: "code-content",
6924
6926
  props: { token: {} },
6925
6927
  emits: ["mounted"],
@@ -7001,7 +7003,7 @@ var _hoisted_1$34 = { key: 1 }, tool_btn_default = /* @__PURE__ */ defineCompone
7001
7003
  let n = (e = s.value) == null ? void 0 : e.innerText;
7002
7004
  n && m(n);
7003
7005
  };
7004
- return (n, r) => (openBlock(), createElementBlock("div", _hoisted_1$33, [createElementVNode("div", _hoisted_2$24, [createElementVNode("span", _hoisted_3$16, toDisplayString(d.value), 1), createVNode(tool_btn_default, {
7006
+ return (n, r) => (openBlock(), createElementBlock("div", _hoisted_1$32, [createElementVNode("div", _hoisted_2$24, [createElementVNode("span", _hoisted_3$16, toDisplayString(d.value), 1), createVNode(tool_btn_default, {
7005
7007
  id: "copy",
7006
7008
  description: "复制",
7007
7009
  name: "复制",
@@ -7019,7 +7021,7 @@ var _hoisted_1$34 = { key: 1 }, tool_btn_default = /* @__PURE__ */ defineCompone
7019
7021
  innerHTML: v.value
7020
7022
  }, null, 8, _hoisted_6$5)) : createCommentVNode("", !0)], 2)])]));
7021
7023
  }
7022
- }), import_debounce = /* @__PURE__ */ __toESM(require_debounce()), _hoisted_1$32 = { class: "md-image-wrapper" }, _hoisted_2$23 = {
7024
+ }), import_debounce = /* @__PURE__ */ __toESM(require_debounce()), _hoisted_1$31 = { class: "md-image-wrapper" }, _hoisted_2$23 = {
7023
7025
  key: 0,
7024
7026
  class: "md-image-loading"
7025
7027
  }, _hoisted_3$15 = { class: "md-image-loading-text" }, _hoisted_4$15 = {
@@ -7074,7 +7076,7 @@ var _hoisted_1$34 = { key: 1 }, tool_btn_default = /* @__PURE__ */ defineCompone
7074
7076
  c.value = !1, g(), _.value ? v(e) : (o.value = !0, s.value = !1);
7075
7077
  }, { immediate: !0 }), watch(_, (e) => {
7076
7078
  e && r.src && v(r.src);
7077
- }), (n, r) => (openBlock(), createElementBlock("span", _hoisted_1$32, [f.value ? (openBlock(), createElementBlock("span", _hoisted_2$23, [createVNode(unref(Loading), {
7079
+ }), (n, r) => (openBlock(), createElementBlock("span", _hoisted_1$31, [f.value ? (openBlock(), createElementBlock("span", _hoisted_2$23, [createVNode(unref(Loading), {
7078
7080
  mode: "spin",
7079
7081
  size: "mini",
7080
7082
  theme: "primary"
@@ -7310,7 +7312,7 @@ var _hoisted_1$34 = { key: 1 }, tool_btn_default = /* @__PURE__ */ defineCompone
7310
7312
  innerHTML: r.value
7311
7313
  }, null, 8, ["class", "innerHTML"]));
7312
7314
  }
7313
- }), import_throttle$1 = /* @__PURE__ */ __toESM(require_throttle()), _hoisted_1$31 = ["innerHTML"], mermaid_content_default = /* @__PURE__ */ defineComponent({
7315
+ }), import_throttle$1 = /* @__PURE__ */ __toESM(require_throttle()), _hoisted_1$30 = ["innerHTML"], mermaid_content_default = /* @__PURE__ */ defineComponent({
7314
7316
  __name: "mermaid-content",
7315
7317
  props: { token: {} },
7316
7318
  emits: ["mounted"],
@@ -7369,13 +7371,13 @@ var _hoisted_1$34 = { key: 1 }, tool_btn_default = /* @__PURE__ */ defineCompone
7369
7371
  ref: i,
7370
7372
  class: "mermaid-content",
7371
7373
  innerHTML: r.value
7372
- }, null, 8, _hoisted_1$31));
7374
+ }, null, 8, _hoisted_1$30));
7373
7375
  }
7374
- }), _hoisted_1$30 = { class: "ai-error-content" }, _hoisted_2$22 = { class: "ai-error-content-text" }, common_error_content_default = /* @__PURE__ */ defineComponent({
7376
+ }), _hoisted_1$29 = { class: "ai-error-content" }, _hoisted_2$22 = { class: "ai-error-content-text" }, common_error_content_default = /* @__PURE__ */ defineComponent({
7375
7377
  __name: "common-error-content",
7376
7378
  props: { content: {} },
7377
7379
  setup(e) {
7378
- return (n, r) => (openBlock(), createElementBlock("div", _hoisted_1$30, [createVNode(unref(ErrorIcon)), createElementVNode("div", _hoisted_2$22, toDisplayString(e.content), 1)]));
7380
+ return (n, r) => (openBlock(), createElementBlock("div", _hoisted_1$29, [createVNode(unref(ErrorIcon)), createElementVNode("div", _hoisted_2$22, toDisplayString(e.content), 1)]));
7379
7381
  }
7380
7382
  }), keyCounterMap = /* @__PURE__ */ new Map(), resetKeyCounter = () => {
7381
7383
  keyCounterMap = /* @__PURE__ */ new Map();
@@ -7541,7 +7543,7 @@ var vnode_renderer_default = defineComponent({
7541
7543
  setup(e) {
7542
7544
  return () => tokensToVNodes(e.tokens, e.options);
7543
7545
  }
7544
- }), import_throttle = /* @__PURE__ */ __toESM(require_throttle()), _hoisted_1$29 = { class: "markdown-content" }, _hoisted_2$21 = {
7546
+ }), import_throttle = /* @__PURE__ */ __toESM(require_throttle()), _hoisted_1$28 = { class: "markdown-content" }, _hoisted_2$21 = {
7545
7547
  key: 1,
7546
7548
  class: "markdown-body"
7547
7549
  }, markdown_content_default = /* @__PURE__ */ defineComponent({
@@ -7638,7 +7640,7 @@ var vnode_renderer_default = defineComponent({
7638
7640
  leading: !0,
7639
7641
  trailing: !0
7640
7642
  });
7641
- return (r, i) => (openBlock(), createElementBlock("div", _hoisted_1$29, [n.status === unref(MessageStatus).Error ? (openBlock(), createBlock(common_error_content_default, {
7643
+ return (r, i) => (openBlock(), createElementBlock("div", _hoisted_1$28, [n.status === unref(MessageStatus).Error ? (openBlock(), createBlock(common_error_content_default, {
7642
7644
  key: 0,
7643
7645
  content: n.content
7644
7646
  }, null, 8, ["content"])) : (openBlock(), createElementBlock("div", _hoisted_2$21, [(openBlock(!0), createElementBlock(Fragment, null, renderList(o.value, (n, r) => (openBlock(), createElementBlock(Fragment, { key: r }, [d(n) ? (openBlock(), createBlock(unref(mermaid_content_default), {
@@ -7660,7 +7662,7 @@ var vnode_renderer_default = defineComponent({
7660
7662
  onVnodeMounted: unref(g)
7661
7663
  }, null, 8, ["tokens", "onVnodeMounted"]))], 64))), 128))]))]));
7662
7664
  }
7663
- }), _hoisted_1$28 = ["onClick"], reference_content_default = /* @__PURE__ */ defineComponent({
7665
+ }), _hoisted_1$27 = ["onClick"], reference_content_default = /* @__PURE__ */ defineComponent({
7664
7666
  __name: "reference-content",
7665
7667
  props: { content: {} },
7666
7668
  setup(n) {
@@ -7679,7 +7681,7 @@ var vnode_renderer_default = defineComponent({
7679
7681
  createElementVNode("span", {
7680
7682
  class: "ai-reference-item-title",
7681
7683
  onClick: (n) => e.url && i(e.url, n)
7682
- }, toDisplayString(e.title), 9, _hoisted_1$28),
7684
+ }, toDisplayString(e.title), 9, _hoisted_1$27),
7683
7685
  e.url && e.originFileUrl ? withDirectives((openBlock(), createBlock(unref(PreviewIcon), {
7684
7686
  key: 0,
7685
7687
  onClick: (n) => e.url && i(e.url, n)
@@ -8253,7 +8255,7 @@ let UploadStatus = /* @__PURE__ */ function(e) {
8253
8255
  }({}), MessageToolsStatus = /* @__PURE__ */ function(e) {
8254
8256
  return e.Disabled = "disabled", e.Hidden = "hidden", e;
8255
8257
  }({});
8256
- var _hoisted_1$27 = { class: "file-upload-btn" }, _hoisted_2$20 = ["accept"], file_upload_btn_default = /* @__PURE__ */ defineComponent({
8258
+ var _hoisted_1$26 = { class: "file-upload-btn" }, _hoisted_2$20 = ["accept"], file_upload_btn_default = /* @__PURE__ */ defineComponent({
8257
8259
  __name: "file-upload-btn",
8258
8260
  props: {
8259
8261
  accept: { default: "image/*" },
@@ -8283,7 +8285,7 @@ var _hoisted_1$27 = { class: "file-upload-btn" }, _hoisted_2$20 = ["accept"], fi
8283
8285
  }
8284
8286
  n.value = "";
8285
8287
  };
8286
- return (n, r) => (openBlock(), createElementBlock("div", _hoisted_1$27, [createElementVNode("input", {
8288
+ return (n, r) => (openBlock(), createElementBlock("div", _hoisted_1$26, [createElementVNode("input", {
8287
8289
  ref_key: "fileInputRef",
8288
8290
  ref: a,
8289
8291
  accept: e.accept,
@@ -8295,19 +8297,19 @@ var _hoisted_1$27 = { class: "file-upload-btn" }, _hoisted_2$20 = ["accept"], fi
8295
8297
  class: "ai-shortcut-btn file-upload-btn-icon",
8296
8298
  onClick: o
8297
8299
  }, [renderSlot(n.$slots, "default", {}, () => [createVNode(unref(FileUploadIcon))])])), [[unref(directive), _objectSpread2(_objectSpread2({}, e.tippyOptions), {}, {
8298
- content: unref(t)("上传图片"),
8300
+ content: unref(t)("上传图片, 最多支持上传 3 个, 最大支持 2.4MB"),
8299
8301
  theme: "ai-chat-box",
8300
8302
  offset: [0, 16]
8301
8303
  })]])]));
8302
8304
  }
8303
- }), _hoisted_1$26 = { class: "ai-cite-content" }, _hoisted_2$19 = { class: "ai-cite-content-text" }, cite_content_default = /* @__PURE__ */ defineComponent({
8305
+ }), _hoisted_1$25 = { class: "ai-cite-content" }, _hoisted_2$19 = { class: "ai-cite-content-text" }, cite_content_default = /* @__PURE__ */ defineComponent({
8304
8306
  __name: "cite-content",
8305
8307
  props: {
8306
8308
  content: {},
8307
8309
  onClose: { type: Function }
8308
8310
  },
8309
8311
  setup(e) {
8310
- return (n, r) => (openBlock(), createElementBlock("div", _hoisted_1$26, [
8312
+ return (n, r) => (openBlock(), createElementBlock("div", _hoisted_1$25, [
8311
8313
  createVNode(unref(CiteIcon)),
8312
8314
  createElementVNode("span", _hoisted_2$19, toDisplayString(e.content), 1),
8313
8315
  e.onClose ? (openBlock(), createBlock(unref(CloseIcon), {
@@ -8319,7 +8321,7 @@ var _hoisted_1$27 = { class: "file-upload-btn" }, _hoisted_2$20 = ["accept"], fi
8319
8321
  })) : createCommentVNode("", !0)
8320
8322
  ]));
8321
8323
  }
8322
- }), _hoisted_1$25 = { class: "ai-image-preview-toolbar" }, _hoisted_2$18 = { class: "ai-image-preview-toolbar-inner" }, _hoisted_3$14 = {
8324
+ }), _hoisted_1$24 = { class: "ai-image-preview-toolbar" }, _hoisted_2$18 = { class: "ai-image-preview-toolbar-inner" }, _hoisted_3$14 = {
8323
8325
  key: 0,
8324
8326
  class: "ai-image-preview-toolbar-pages"
8325
8327
  }, _hoisted_4$14 = {
@@ -8343,7 +8345,7 @@ var _hoisted_1$27 = { class: "file-upload-btn" }, _hoisted_2$20 = ["accept"], fi
8343
8345
  ],
8344
8346
  setup(n, { emit: r }) {
8345
8347
  let i = r;
8346
- return (r, a) => (openBlock(), createElementBlock("div", _hoisted_1$25, [createElementVNode("div", _hoisted_2$18, [
8348
+ return (r, a) => (openBlock(), createElementBlock("div", _hoisted_1$24, [createElementVNode("div", _hoisted_2$18, [
8347
8349
  n.isMultiple ? (openBlock(), createElementBlock("span", _hoisted_3$14, toDisplayString(n.activeIndex + 1) + " / " + toDisplayString(n.total), 1)) : createCommentVNode("", !0),
8348
8350
  n.isMultiple ? (openBlock(), createElementBlock("span", _hoisted_4$14)) : createCommentVNode("", !0),
8349
8351
  createElementVNode("div", {
@@ -8445,7 +8447,7 @@ function usePreviewKeyboard(e) {
8445
8447
  c();
8446
8448
  });
8447
8449
  }
8448
- var _hoisted_1$24 = ["src"], _hoisted_2$17 = {
8450
+ var _hoisted_1$23 = ["src"], _hoisted_2$17 = {
8449
8451
  key: 1,
8450
8452
  class: "ai-image-preview-error"
8451
8453
  }, _hoisted_3$13 = { class: "ai-image-preview-error-text" }, _hoisted_4$13 = {
@@ -8555,7 +8557,7 @@ var _hoisted_1$24 = ["src"], _hoisted_2$17 = {
8555
8557
  style: normalizeStyle(unref(g)),
8556
8558
  onError: G,
8557
8559
  onLoad: U
8558
- }, null, 44, _hoisted_1$24)),
8560
+ }, null, 44, _hoisted_1$23)),
8559
8561
  C.value === "error" ? (openBlock(), createElementBlock("div", _hoisted_2$17, [createVNode(unref(ImageBrokenIcon), { class: "ai-image-preview-error-icon" }), createElementVNode("p", _hoisted_3$13, toDisplayString(unref(t)("抱歉,图片加载失败,可尝试重新加载")), 1)])) : createCommentVNode("", !0),
8560
8562
  C.value === "loading" ? (openBlock(), createElementBlock("div", _hoisted_4$13, [O.value.thumbnailUrl ? (openBlock(), createElementBlock("img", {
8561
8563
  key: 0,
@@ -8595,7 +8597,7 @@ var _hoisted_1$24 = ["src"], _hoisted_2$17 = {
8595
8597
  _: 3
8596
8598
  })]));
8597
8599
  }
8598
- })), _hoisted_1$23 = { class: "ai-files-content" }, _hoisted_2$16 = [
8600
+ })), _hoisted_1$22 = { class: "ai-files-content" }, _hoisted_2$16 = [
8599
8601
  "alt",
8600
8602
  "src",
8601
8603
  "onClick",
@@ -8628,7 +8630,7 @@ var _hoisted_1$24 = ["src"], _hoisted_2$17 = {
8628
8630
  let n = b.value.indexOf(e);
8629
8631
  n < 0 || (y.value = n, v.value = !0);
8630
8632
  };
8631
- return (r, i) => (openBlock(), createElementBlock("div", _hoisted_1$23, [(openBlock(!0), createElementBlock(Fragment, null, renderList(n.files, (e) => {
8633
+ return (r, i) => (openBlock(), createElementBlock("div", _hoisted_1$22, [(openBlock(!0), createElementBlock(Fragment, null, renderList(n.files, (e) => {
8632
8634
  var r, i, a, o, v;
8633
8635
  return openBlock(), createElementBlock("div", {
8634
8636
  key: (r = e.file) == null ? void 0 : r.name,
@@ -8661,7 +8663,7 @@ var _hoisted_1$24 = ["src"], _hoisted_2$17 = {
8661
8663
  "images"
8662
8664
  ])]));
8663
8665
  }
8664
- }), _hoisted_1$22 = ["onClick"], ai_prompt_list_default = /* @__PURE__ */ defineComponent({
8666
+ }), _hoisted_1$21 = ["onClick"], ai_prompt_list_default = /* @__PURE__ */ defineComponent({
8665
8667
  __name: "ai-prompt-list",
8666
8668
  props: {
8667
8669
  onSelect: { type: Function },
@@ -8681,7 +8683,7 @@ var _hoisted_1$24 = ["src"], _hoisted_2$17 = {
8681
8683
  key: e,
8682
8684
  class: normalizeClass(["ai-prompt-list-item", { "is-active": unref(o) === r }]),
8683
8685
  onClick: (r) => n.onSelect(e)
8684
- }, toDisplayString(e), 11, _hoisted_1$22))), 128))], 512));
8686
+ }, toDisplayString(e), 11, _hoisted_1$21))), 128))], 512));
8685
8687
  }
8686
8688
  }), bottom = "bottom", right = "right", left = "left", auto = "auto", basePlacements = [
8687
8689
  "top",
@@ -9346,12 +9348,12 @@ function preventOverflow(e) {
9346
9348
  var j, M = S === "y" ? "top" : left, N = S === "y" ? bottom : right, P = S === "y" ? "height" : "width", F = w[S], I = F + v[M], L = F - v[N], R = m ? -E[P] / 2 : 0, z = b === "start" ? T[P] : E[P], B = b === "start" ? -E[P] : -T[P], V = n.elements.arrow, H = m && V ? getLayoutRect(V) : {
9347
9349
  width: 0,
9348
9350
  height: 0
9349
- }, U = n.modifiersData["arrow#persistent"] ? n.modifiersData["arrow#persistent"].padding : getFreshSideObject(), W = U[M], G = U[N], K = within(0, T[P], H[P]), q = x ? T[P] / 2 - R - K - W - O.mainAxis : z - K - W - O.mainAxis, Wy = x ? -T[P] / 2 + R + K + G + O.mainAxis : B + K + G + O.mainAxis, J = n.elements.arrow && getOffsetParent(n.elements.arrow), Gy = J ? S === "y" ? J.clientTop || 0 : J.clientLeft || 0 : 0, Y = (j = k == null ? void 0 : k[S]) == null ? 0 : j, Ky = F + q - Y - Gy, qy = F + Wy - Y, X = within(m ? min$1(I, Ky) : I, F, m ? max(L, qy) : L);
9351
+ }, U = n.modifiersData["arrow#persistent"] ? n.modifiersData["arrow#persistent"].padding : getFreshSideObject(), W = U[M], G = U[N], K = within(0, T[P], H[P]), q = x ? T[P] / 2 - R - K - W - O.mainAxis : z - K - W - O.mainAxis, Uy = x ? -T[P] / 2 + R + K + G + O.mainAxis : B + K + G + O.mainAxis, J = n.elements.arrow && getOffsetParent(n.elements.arrow), Wy = J ? S === "y" ? J.clientTop || 0 : J.clientLeft || 0 : 0, Y = (j = k == null ? void 0 : k[S]) == null ? 0 : j, Gy = F + q - Y - Wy, Ky = F + Uy - Y, X = within(m ? min$1(I, Gy) : I, F, m ? max(L, Ky) : L);
9350
9352
  w[S] = X, A[S] = X - F;
9351
9353
  }
9352
9354
  if (c) {
9353
- var Jy, Yy = S === "x" ? "top" : left, Xy = S === "x" ? bottom : right, Z = w[C], Q = C === "y" ? "height" : "width", $ = Z + v[Yy], Zy = Z - v[Xy], Qy = ["top", left].indexOf(y) !== -1, $y = (Jy = k == null ? void 0 : k[C]) == null ? 0 : Jy, eb = Qy ? $ : Z - T[Q] - E[Q] - $y + O.altAxis, tb = Qy ? Z + T[Q] + E[Q] - $y - O.altAxis : Zy, nb = m && Qy ? withinMaxClamp(eb, Z, tb) : within(m ? eb : $, Z, m ? tb : Zy);
9354
- w[C] = nb, A[C] = nb - Z;
9355
+ var qy, Jy = S === "x" ? "top" : left, Yy = S === "x" ? bottom : right, Z = w[C], Q = C === "y" ? "height" : "width", $ = Z + v[Jy], Xy = Z - v[Yy], Zy = ["top", left].indexOf(y) !== -1, Qy = (qy = k == null ? void 0 : k[C]) == null ? 0 : qy, $y = Zy ? $ : Z - T[Q] - E[Q] - Qy + O.altAxis, eb = Zy ? Z + T[Q] + E[Q] - Qy - O.altAxis : Xy, tb = m && Zy ? withinMaxClamp($y, Z, eb) : within(m ? $y : $, Z, m ? eb : Xy);
9356
+ w[C] = tb, A[C] = tb - Z;
9355
9357
  }
9356
9358
  n.modifiersData[i] = A;
9357
9359
  }
@@ -9891,16 +9893,16 @@ function createTippy(e, n) {
9891
9893
  isShown: !1
9892
9894
  },
9893
9895
  plugins: b,
9894
- clearDelayTimeouts: $y,
9895
- setProps: eb,
9896
- setContent: tb,
9897
- show: nb,
9898
- hide: rb,
9899
- hideWithInteractivity: ib,
9900
- enable: Zy,
9901
- disable: Qy,
9902
- unmount: ab,
9903
- destroy: ob
9896
+ clearDelayTimeouts: Qy,
9897
+ setProps: $y,
9898
+ setContent: eb,
9899
+ show: tb,
9900
+ hide: nb,
9901
+ hideWithInteractivity: rb,
9902
+ enable: Xy,
9903
+ disable: Zy,
9904
+ unmount: ib,
9905
+ destroy: ab
9904
9906
  };
9905
9907
  /* istanbul ignore if */
9906
9908
  if (!r.render) return process.env.NODE_ENV !== "production" && errorWhen(!0, "render() function has not been supplied."), x;
@@ -9909,7 +9911,7 @@ function createTippy(e, n) {
9909
9911
  var T = b.map(function(e) {
9910
9912
  return e.fn(x);
9911
9913
  }), E = e.hasAttribute("aria-expanded");
9912
- return Wy(), L(), P(), F("onCreate", [x]), r.showOnCreate && Q(), C.addEventListener("mouseenter", function() {
9914
+ return Uy(), L(), P(), F("onCreate", [x]), r.showOnCreate && Q(), C.addEventListener("mouseenter", function() {
9913
9915
  x.props.interactive && x.state.isVisible && x.clearDelayTimeouts();
9914
9916
  }), C.addEventListener("mouseleave", function() {
9915
9917
  x.props.interactive && x.props.trigger.indexOf("mouseenter") >= 0 && j().addEventListener("mousemove", g);
@@ -10028,17 +10030,17 @@ function createTippy(e, n) {
10028
10030
  });
10029
10031
  });
10030
10032
  }
10031
- function Wy() {
10032
- O() && (q("touchstart", Gy, { passive: !0 }), q("touchend", Ky, { passive: !0 })), splitBySpaces(x.props.trigger).forEach(function(e) {
10033
- if (e !== "manual") switch (q(e, Gy), e) {
10033
+ function Uy() {
10034
+ O() && (q("touchstart", Wy, { passive: !0 }), q("touchend", Gy, { passive: !0 })), splitBySpaces(x.props.trigger).forEach(function(e) {
10035
+ if (e !== "manual") switch (q(e, Wy), e) {
10034
10036
  case "mouseenter":
10035
- q("mouseleave", Ky);
10037
+ q("mouseleave", Gy);
10036
10038
  break;
10037
10039
  case "focus":
10038
- q(isIE11 ? "focusout" : "blur", qy);
10040
+ q(isIE11 ? "focusout" : "blur", Ky);
10039
10041
  break;
10040
10042
  case "focusin":
10041
- q("focusout", qy);
10043
+ q("focusout", Ky);
10042
10044
  break;
10043
10045
  }
10044
10046
  });
@@ -10049,7 +10051,7 @@ function createTippy(e, n) {
10049
10051
  n.removeEventListener(r, i, a);
10050
10052
  }), m = [];
10051
10053
  }
10052
- function Gy(e) {
10054
+ function Wy(e) {
10053
10055
  var n, r = !1;
10054
10056
  if (!(!x.state.isEnabled || X(e) || c)) {
10055
10057
  var i = ((n = d) == null ? void 0 : n.type) === "focus";
@@ -10069,7 +10071,7 @@ function createTippy(e, n) {
10069
10071
  } : null;
10070
10072
  }).filter(Boolean), e) && (R(), $(e));
10071
10073
  }
10072
- function Ky(e) {
10074
+ function Gy(e) {
10073
10075
  if (!(X(e) || x.props.trigger.indexOf("click") >= 0 && s)) {
10074
10076
  if (x.props.interactive) {
10075
10077
  x.hideWithInteractivity(e);
@@ -10078,14 +10080,14 @@ function createTippy(e, n) {
10078
10080
  $(e);
10079
10081
  }
10080
10082
  }
10081
- function qy(e) {
10083
+ function Ky(e) {
10082
10084
  x.props.trigger.indexOf("focusin") < 0 && e.target !== A() || x.props.interactive && e.relatedTarget && C.contains(e.relatedTarget) || $(e);
10083
10085
  }
10084
10086
  function X(e) {
10085
10087
  return currentInput.isTouch ? O() !== e.type.indexOf("touch") >= 0 : !1;
10086
10088
  }
10087
- function Jy() {
10088
- Yy();
10089
+ function qy() {
10090
+ Jy();
10089
10091
  var n = x.props, r = n.popperOptions, i = n.placement, a = n.offset, o = n.getReferenceClientRect, s = n.moveTransition, c = k() ? getChildren(C).arrow : null, l = o ? {
10090
10092
  getBoundingClientRect: o,
10091
10093
  contextElement: o.contextElement || A()
@@ -10143,13 +10145,13 @@ function createTippy(e, n) {
10143
10145
  modifiers: u
10144
10146
  }));
10145
10147
  }
10146
- function Yy() {
10148
+ function Jy() {
10147
10149
  x.popperInstance && (x.popperInstance.destroy(), x.popperInstance = null);
10148
10150
  }
10149
- function Xy() {
10151
+ function Yy() {
10150
10152
  var e = x.props.appendTo, n, r = A();
10151
10153
  /* istanbul ignore else */
10152
- n = x.props.interactive && e === TIPPY_DEFAULT_APPEND_TO || e === "parent" ? r.parentNode : invokeWithArgsOrReturn(e, [r]), n.contains(C) || n.appendChild(C), x.state.isMounted = !0, Jy(), process.env.NODE_ENV !== "production" && warnWhen(x.props.interactive && e === defaultProps.appendTo && r.nextElementSibling !== C, [
10154
+ n = x.props.interactive && e === TIPPY_DEFAULT_APPEND_TO || e === "parent" ? r.parentNode : invokeWithArgsOrReturn(e, [r]), n.contains(C) || n.appendChild(C), x.state.isMounted = !0, qy(), process.env.NODE_ENV !== "production" && warnWhen(x.props.interactive && e === defaultProps.appendTo && r.nextElementSibling !== C, [
10153
10155
  "Interactive tippy element may not be accessible via keyboard",
10154
10156
  "navigation because it is not directly after the reference element",
10155
10157
  "in the DOM source order.",
@@ -10188,31 +10190,31 @@ function createTippy(e, n) {
10188
10190
  });
10189
10191
  }
10190
10192
  }
10191
- function Zy() {
10193
+ function Xy() {
10192
10194
  x.state.isEnabled = !0;
10193
10195
  }
10194
- function Qy() {
10196
+ function Zy() {
10195
10197
  x.hide(), x.state.isEnabled = !1;
10196
10198
  }
10197
- function $y() {
10199
+ function Qy() {
10198
10200
  clearTimeout(i), clearTimeout(a), cancelAnimationFrame(o);
10199
10201
  }
10200
- function eb(n) {
10202
+ function $y(n) {
10201
10203
  /* istanbul ignore else */
10202
10204
  if (process.env.NODE_ENV !== "production" && warnWhen(x.state.isDestroyed, createMemoryLeakWarning("setProps")), !x.state.isDestroyed) {
10203
10205
  F("onBeforeUpdate", [x, n]), J();
10204
10206
  var r = x.props, i = evaluateProps(e, Object.assign({}, r, removeUndefinedProps(n), { ignoreAttributes: !0 }));
10205
- x.props = i, Wy(), r.interactiveDebounce !== i.interactiveDebounce && (R(), g = debounce(Y, i.interactiveDebounce)), r.triggerTarget && !i.triggerTarget ? normalizeToArray(r.triggerTarget).forEach(function(e) {
10207
+ x.props = i, Uy(), r.interactiveDebounce !== i.interactiveDebounce && (R(), g = debounce(Y, i.interactiveDebounce)), r.triggerTarget && !i.triggerTarget ? normalizeToArray(r.triggerTarget).forEach(function(e) {
10206
10208
  e.removeAttribute("aria-expanded");
10207
- }) : i.triggerTarget && e.removeAttribute("aria-expanded"), L(), P(), w && w(r, i), x.popperInstance && (Jy(), Z().forEach(function(e) {
10209
+ }) : i.triggerTarget && e.removeAttribute("aria-expanded"), L(), P(), w && w(r, i), x.popperInstance && (qy(), Z().forEach(function(e) {
10208
10210
  requestAnimationFrame(e._tippy.popperInstance.forceUpdate);
10209
10211
  })), F("onAfterUpdate", [x, n]);
10210
10212
  }
10211
10213
  }
10212
- function tb(e) {
10214
+ function eb(e) {
10213
10215
  x.setProps({ content: e });
10214
10216
  }
10215
- function nb() {
10217
+ function tb() {
10216
10218
  /* istanbul ignore else */
10217
10219
  process.env.NODE_ENV !== "production" && warnWhen(x.state.isDestroyed, createMemoryLeakWarning("show"));
10218
10220
  var e = x.state.isVisible, n = x.state.isDestroyed, r = !x.state.isEnabled, i = currentInput.isTouch && !x.props.touch, a = getValueAtIndexOrReturn(x.props.duration, 0, defaultProps.duration);
@@ -10232,10 +10234,10 @@ function createTippy(e, n) {
10232
10234
  x.state.isShown = !0, F("onShown", [x]);
10233
10235
  });
10234
10236
  }
10235
- }, Xy();
10237
+ }, Yy();
10236
10238
  }
10237
10239
  }
10238
- function rb() {
10240
+ function nb() {
10239
10241
  /* istanbul ignore else */
10240
10242
  process.env.NODE_ENV !== "production" && warnWhen(x.state.isDestroyed, createMemoryLeakWarning("hide"));
10241
10243
  var e = !x.state.isVisible, n = x.state.isDestroyed, r = !x.state.isEnabled, i = getValueAtIndexOrReturn(x.props.duration, 1, defaultProps.duration);
@@ -10247,18 +10249,18 @@ function createTippy(e, n) {
10247
10249
  I(), L(), x.props.animation ? k() && W(i, x.unmount) : x.unmount();
10248
10250
  }
10249
10251
  }
10250
- function ib(e) {
10252
+ function rb(e) {
10251
10253
  process.env.NODE_ENV !== "production" && warnWhen(x.state.isDestroyed, createMemoryLeakWarning("hideWithInteractivity")), j().addEventListener("mousemove", g), pushIfUnique(mouseMoveListeners, g), g(e);
10252
10254
  }
10253
- function ab() {
10255
+ function ib() {
10254
10256
  /* istanbul ignore else */
10255
- process.env.NODE_ENV !== "production" && warnWhen(x.state.isDestroyed, createMemoryLeakWarning("unmount")), x.state.isVisible && x.hide(), x.state.isMounted && (Yy(), Z().forEach(function(e) {
10257
+ process.env.NODE_ENV !== "production" && warnWhen(x.state.isDestroyed, createMemoryLeakWarning("unmount")), x.state.isVisible && x.hide(), x.state.isMounted && (Jy(), Z().forEach(function(e) {
10256
10258
  e._tippy.unmount();
10257
10259
  }), C.parentNode && C.parentNode.removeChild(C), mountedInstances = mountedInstances.filter(function(e) {
10258
10260
  return e !== x;
10259
10261
  }), x.state.isMounted = !1, F("onHidden", [x]));
10260
10262
  }
10261
- function ob() {
10263
+ function ab() {
10262
10264
  /* istanbul ignore else */
10263
10265
  process.env.NODE_ENV !== "production" && warnWhen(x.state.isDestroyed, createMemoryLeakWarning("destroy")), !x.state.isDestroyed && (x.clearDelayTimeouts(), x.unmount(), J(), delete e._tippy, x.state.isDestroyed = !0, F("onDestroy", [x]));
10264
10266
  }
@@ -10345,7 +10347,7 @@ const OverflowTips = {
10345
10347
  e.removeEventListener("mouseenter", e.mouseEnterFunc), e.removeEventListener("mouseleave", e.mouseLeaveFunc), (n = e.unObserverFunc) == null || n.call(e), e.mouseEnterFunc = void 0, e.mouseLeaveFunc = void 0, e.unObserverFunc = void 0;
10346
10348
  }
10347
10349
  };
10348
- var _hoisted_1$21 = { class: "ai-slash-item ai-slash-group-title" }, _hoisted_2$15 = ["onClick"], _hoisted_3$11 = ["onClick"], _hoisted_4$11 = ["title"], ai_slash_menu_default = /* @__PURE__ */ defineComponent({
10350
+ var _hoisted_1$20 = { class: "ai-slash-item ai-slash-group-title" }, _hoisted_2$15 = ["onClick"], _hoisted_3$11 = ["onClick"], _hoisted_4$11 = ["title"], ai_slash_menu_default = /* @__PURE__ */ defineComponent({
10349
10351
  __name: "ai-slash-menu",
10350
10352
  props: {
10351
10353
  onSelect: { type: Function },
@@ -10391,7 +10393,7 @@ var _hoisted_1$21 = { class: "ai-slash-item ai-slash-group-title" }, _hoisted_2$
10391
10393
  }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(s.value, (r, i) => (openBlock(), createElementBlock(Fragment, null, [r.items.length > 0 ? (openBlock(), createElementBlock("div", {
10392
10394
  key: i,
10393
10395
  class: "ai-slash-group"
10394
- }, [createElementVNode("div", _hoisted_1$21, [
10396
+ }, [createElementVNode("div", _hoisted_1$20, [
10395
10397
  (openBlock(), createElementBlock("svg", {
10396
10398
  class: "title-icon",
10397
10399
  style: normalizeStyle({ transform: a.value.includes(r.type) ? "rotate(90deg)" : "rotate(0deg)" }),
@@ -10435,7 +10437,7 @@ const DeleteTag = (e, n, r, i) => new Transaction().delete(r, i), InsertTag = (e
10435
10437
  plain: (e) => e.label
10436
10438
  }) }
10437
10439
  });
10438
- var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-placeholder"], _hoisted_3$10 = { key: 0 }, _hoisted_4$10 = ["data-tag-type"], _hoisted_5$6 = { key: 1 }, ai_slash_input_default = /* @__PURE__ */ defineComponent({
10440
+ var _hoisted_1$19 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-placeholder"], _hoisted_3$10 = { key: 0 }, _hoisted_4$10 = ["data-tag-type"], _hoisted_5$6 = { key: 1 }, ai_slash_input_default = /* @__PURE__ */ defineComponent({
10439
10441
  __name: "ai-slash-input",
10440
10442
  props: {
10441
10443
  modelValue: {},
@@ -10589,7 +10591,7 @@ var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-
10589
10591
  S.command(ReplaceAll, "");
10590
10592
  },
10591
10593
  focus: L
10592
- }), (r, i) => (openBlock(), createElementBlock("div", _hoisted_1$20, [createElementVNode("div", {
10594
+ }), (r, i) => (openBlock(), createElementBlock("div", _hoisted_1$19, [createElementVNode("div", {
10593
10595
  ref_key: "editorRef",
10594
10596
  ref: a,
10595
10597
  "aria-placeholder": n.placeholder,
@@ -10635,7 +10637,7 @@ var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-
10635
10637
  "z-index"
10636
10638
  ])]));
10637
10639
  }
10638
- }), _hoisted_1$19 = { class: "ai-input-attachment" }, input_attachment_default = /* @__PURE__ */ defineComponent({
10640
+ }), _hoisted_1$18 = { class: "ai-input-attachment" }, input_attachment_default = /* @__PURE__ */ defineComponent({
10639
10641
  __name: "input-attachment",
10640
10642
  props: {
10641
10643
  messageState: {},
@@ -10648,7 +10650,7 @@ var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-
10648
10650
  }, o = () => {
10649
10651
  r.messageState === MessageStatus.Disabled || r.messageState === MessageStatus.Pending || r.messageState === MessageStatus.Streaming || i("sendMessage");
10650
10652
  };
10651
- return (n, i) => (openBlock(), createElementBlock("div", _hoisted_1$19, [renderSlot(n.$slots, "default"), renderSlot(n.$slots, "send-icon", {}, () => [createElementVNode("div", { class: normalizeClass(["send-message-icon", { ["send-message-icon__" + e.messageState]: !0 }]) }, [e.messageState === unref(MessageStatus).Streaming || e.messageState === unref(MessageStatus).Pending ? withDirectives((openBlock(), createBlock(unref(LoadingMessageIcon), {
10653
+ return (n, i) => (openBlock(), createElementBlock("div", _hoisted_1$18, [renderSlot(n.$slots, "default"), renderSlot(n.$slots, "send-icon", {}, () => [createElementVNode("div", { class: normalizeClass(["send-message-icon", { ["send-message-icon__" + e.messageState]: !0 }]) }, [e.messageState === unref(MessageStatus).Streaming || e.messageState === unref(MessageStatus).Pending ? withDirectives((openBlock(), createBlock(unref(LoadingMessageIcon), {
10652
10654
  key: 0,
10653
10655
  onClick: a
10654
10656
  }, null, 512)), [[unref(directive), _objectSpread2(_objectSpread2({}, e.tippyOptions), {}, {
@@ -10664,7 +10666,7 @@ var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-
10664
10666
  offset: [0, 16]
10665
10667
  })]])], 2)])]));
10666
10668
  }
10667
- }), _hoisted_1$18 = { class: "chat-input-container" }, _hoisted_2$13 = {
10669
+ }), _hoisted_1$17 = { class: "chat-input-container" }, _hoisted_2$13 = {
10668
10670
  key: 1,
10669
10671
  class: "ai-divider"
10670
10672
  }, chat_input_default = /* @__PURE__ */ defineComponent({
@@ -10677,7 +10679,7 @@ var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-
10677
10679
  onSendMessage: {},
10678
10680
  onStopSending: {},
10679
10681
  onUpload: {},
10680
- placeholder: { default: isEn ? "Input \"/\" to trigger prompt\nInput \"@\" to trigger tool\nUse Shift + Enter to enter a new line" : "输入 “/”唤出 Prompt\n输入“@”唤出工具\n通过 Shift + Enter 进行换行输入" },
10682
+ placeholder: { default: isEn ? "Input \"/\" to trigger prompt\nInput \"@\" to trigger tool and MCP\nUse Shift + Enter to enter a new line" : "输入 “/”唤出 Prompt\n输入“@”唤出 工具 和 MCP\n通过 Shift + Enter 进行换行输入" },
10681
10683
  prompts: { default: () => [] },
10682
10684
  resources: { default: () => [] },
10683
10685
  shortcutId: {},
@@ -10700,7 +10702,7 @@ var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-
10700
10702
  "update:modelValue"
10701
10703
  ], ["update:cite"]),
10702
10704
  setup(e, { expose: n, emit: r }) {
10703
- useCssVars((e) => ({ v2746b57c: unref(CHAT_Z_INDEX) }));
10705
+ useCssVars((e) => ({ v0b2d5a60: unref(CHAT_Z_INDEX) }));
10704
10706
  let i = useTemplateRef("aiSlashInputRef"), o = useTemplateRef("filesRef"), d = useModel(e, "cite"), f = shallowRef(200), m = e, g = r, _ = ref(m.defaultUploadFiles || []), y = computed(() => {
10705
10707
  var e;
10706
10708
  return (e = m.shortcuts) == null ? void 0 : e.find((e) => e.id === m.shortcutId);
@@ -10808,7 +10810,7 @@ var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-
10808
10810
  (e = i.value) == null || (n = e.focus) == null || n.call(e);
10809
10811
  },
10810
10812
  triggerSendMessage: x
10811
- }), (n, r) => (openBlock(), createElementBlock("div", _hoisted_1$18, [renderSlot(n.$slots, "top"), createElementVNode("div", {
10813
+ }), (n, r) => (openBlock(), createElementBlock("div", _hoisted_1$17, [renderSlot(n.$slots, "top"), createElementVNode("div", {
10812
10814
  class: "chat-input",
10813
10815
  style: normalizeStyle({ maxHeight: f.value + "px" })
10814
10816
  }, [
@@ -10877,14 +10879,30 @@ var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-
10877
10879
  }, 8, ["message-state", "tippy-options"])
10878
10880
  ], 4)]));
10879
10881
  }
10880
- }), _hoisted_1$17 = { class: "ai-scroll-btn" }, scroll_btn_default = /* @__PURE__ */ defineComponent({
10882
+ }), scroll_btn_default = /* @__PURE__ */ defineComponent({
10881
10883
  __name: "scroll-btn",
10882
10884
  props: {
10883
10885
  disabled: { type: Boolean },
10886
+ loading: { type: Boolean },
10884
10887
  title: {}
10885
10888
  },
10886
- setup(e) {
10887
- return (n, r) => (openBlock(), createElementBlock("div", _hoisted_1$17, [renderSlot(n.$slots, "icon"), renderSlot(n.$slots, "title", {}, () => [createTextVNode(toDisplayString(e.title), 1)])]));
10889
+ emits: ["click"],
10890
+ setup(e, { emit: n }) {
10891
+ let r = e, i = n, a = (e) => {
10892
+ r.loading || r.disabled || i("click", e);
10893
+ };
10894
+ return (n, r) => (openBlock(), createElementBlock("div", {
10895
+ class: normalizeClass(["ai-scroll-btn", {
10896
+ "is-loading": e.loading,
10897
+ "is-disabled": e.disabled
10898
+ }]),
10899
+ onClick: a
10900
+ }, [e.loading ? (openBlock(), createBlock(unref(Loading), {
10901
+ key: 0,
10902
+ mode: "spin",
10903
+ size: "mini",
10904
+ theme: "primary"
10905
+ })) : renderSlot(n.$slots, "icon", { key: 1 }), renderSlot(n.$slots, "title", {}, () => [createTextVNode(toDisplayString(e.title), 1)])], 2));
10888
10906
  }
10889
10907
  }), _hoisted_1$16 = { class: "ai-delete-confirm" }, _hoisted_2$12 = { class: "ai-delete-confirm__title" }, _hoisted_3$9 = { class: "ai-delete-confirm__desc" }, _hoisted_4$9 = { class: "ai-delete-confirm__actions" }, delete_tool_default = /* @__PURE__ */ defineComponent({
10890
10908
  __name: "delete-tool",
@@ -11730,23 +11748,27 @@ var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-
11730
11748
  onAgentAction: {},
11731
11749
  onAgentFeedback: {},
11732
11750
  onUserAction: {},
11751
+ stopLoading: {
11752
+ type: Boolean,
11753
+ default: !1
11754
+ },
11733
11755
  onUserInputConfirm: {},
11734
11756
  onUserShortcutConfirm: {}
11735
11757
  }, {
11736
- selectedMessages: { required: !1 },
11737
- selectedMessagesModifiers: {}
11758
+ selectedUserMessages: { required: !1 },
11759
+ selectedUserMessagesModifiers: {}
11738
11760
  }),
11739
- emits: /* @__PURE__ */ mergeModels(["stopStreaming"], ["update:selectedMessages"]),
11740
- setup(n) {
11741
- let r = n, i = useModel(n, "selectedMessages"), a = useTemplateRef("messageContainerRef"), o = useTemplateRef("messageContainerBottomRef"), d = ref([]), { toScrollBottom: f, debouncedShowScrollBottomBtn: m } = useContainerScrollProvider(a, o), { copy: g } = useClipboard();
11761
+ emits: /* @__PURE__ */ mergeModels(["stopStreaming"], ["update:selectedUserMessages"]),
11762
+ setup(n, { expose: r }) {
11763
+ let i = n, o = useModel(n, "selectedUserMessages"), d = useTemplateRef("messageContainerRef"), f = useTemplateRef("messageContainerBottomRef"), m = ref([]), { toScrollBottom: g, debouncedShowScrollBottomBtn: _ } = useContainerScrollProvider(d, f), { copy: v } = useClipboard();
11742
11764
  watchEffect(() => {
11743
11765
  var e;
11744
- let n = [], i = [];
11745
- for (let e of r.messages) {
11766
+ let n = [], r = [];
11767
+ for (let e of i.messages) {
11746
11768
  if (e.role === MessageRole.User) {
11747
11769
  if (n.length > 0) {
11748
11770
  var a;
11749
- i.push({
11771
+ r.push({
11750
11772
  messages: n,
11751
11773
  type: MessageRole.Assistant,
11752
11774
  isHover: !1,
@@ -11757,7 +11779,7 @@ var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-
11757
11779
  })) == null ? !1 : a
11758
11780
  }), n = [];
11759
11781
  }
11760
- i.push({
11782
+ r.push({
11761
11783
  messages: [e],
11762
11784
  type: MessageRole.User,
11763
11785
  isHover: !1,
@@ -11766,7 +11788,7 @@ var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-
11766
11788
  continue;
11767
11789
  }
11768
11790
  if (e.role === MessageRole.Tool) {
11769
- let n = r.messages.find((n) => {
11791
+ let n = i.messages.find((n) => {
11770
11792
  var r;
11771
11793
  return n.role === MessageRole.Assistant && ((r = n.toolCalls) == null ? void 0 : r.some((n) => n.id === e.toolCallId));
11772
11794
  });
@@ -11780,7 +11802,7 @@ var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-
11780
11802
  }
11781
11803
  if (n.length > 0) {
11782
11804
  var o;
11783
- i.push({
11805
+ r.push({
11784
11806
  messages: n,
11785
11807
  type: MessageRole.Assistant,
11786
11808
  isHover: !1,
@@ -11791,7 +11813,7 @@ var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-
11791
11813
  })) == null ? !1 : o
11792
11814
  });
11793
11815
  }
11794
- ((e = r.messages.at(-1)) == null ? void 0 : e.role) === MessageRole.User && i.push({
11816
+ ((e = i.messages.at(-1)) == null ? void 0 : e.role) === MessageRole.User && r.push({
11795
11817
  messages: [{
11796
11818
  role: MessageRole.Loading,
11797
11819
  content: "",
@@ -11802,98 +11824,119 @@ var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-
11802
11824
  type: MessageRole.Loading,
11803
11825
  isHover: !1,
11804
11826
  checked: !1
11805
- }), d.value = i;
11806
- }), watch(i, (e) => {
11807
- var n;
11808
- if (d.value.length) {
11809
- for (let i of (n = d.value) == null ? [] : n) if (i) {
11810
- var r;
11811
- i.checked = (r = e == null ? void 0 : e.some((e) => i.messages.some((n) => e.id === n.id))) == null ? !1 : r;
11827
+ }), m.value = r;
11828
+ }), watch(o, (e) => {
11829
+ if (m.value.length) for (let [r, i] of m.value.entries()) {
11830
+ var n;
11831
+ if (i.type === MessageRole.Assistant) continue;
11832
+ let a = (n = e == null ? void 0 : e.some((e) => i.messages.some((n) => e.id === n.id))) == null ? !1 : n;
11833
+ if (i.checked = a, i.type === MessageRole.User) {
11834
+ let e = m.value.at(r + 1);
11835
+ e && (e.checked = a);
11812
11836
  }
11813
11837
  }
11814
11838
  }, {
11815
11839
  immediate: !0,
11816
11840
  flush: "post"
11817
11841
  });
11818
- let _ = function() {
11842
+ let y = function() {
11819
11843
  var e = _asyncToGenerator(function* (e, n) {
11820
- var i;
11821
- return e.id === "copy" && (console.log("messages", n), g(n.filter((e) => e.role !== MessageRole.Reasoning).map((e) => typeof e.content == "string" ? e.content : JSON.stringify(e.content || "")).join("\n"))), (i = r.onAgentAction) == null ? void 0 : i.call(r, e, n);
11844
+ var r;
11845
+ return e.id === "copy" && v(n.filter((e) => e.role !== MessageRole.Reasoning).map((e) => typeof e.content == "string" ? e.content : JSON.stringify(e.content || "")).join("\n")), (r = i.onAgentAction) == null ? void 0 : r.call(i, e, n);
11822
11846
  });
11823
11847
  return function(n, r) {
11824
11848
  return e.apply(this, arguments);
11825
11849
  };
11826
- }(), v = function() {
11850
+ }(), b = function() {
11827
11851
  var e = _asyncToGenerator(function* (e, n) {
11828
- var i;
11829
- (i = r.onUserAction) == null || i.call(r, e, n);
11852
+ var r;
11853
+ (r = i.onUserAction) == null || r.call(i, e, n);
11830
11854
  });
11831
11855
  return function(n, r) {
11832
11856
  return e.apply(this, arguments);
11833
11857
  };
11834
- }(), y = (e) => {
11858
+ }(), x = (e) => {
11835
11859
  e.isHover = !0;
11836
- }, b = (e) => {
11860
+ }, S = (e) => {
11837
11861
  e.isHover = !1;
11838
- }, x = (e, n) => {
11839
- var r, a;
11840
- let o = e.type === MessageRole.User;
11841
- (r = d.value) == null || r.forEach((r, i) => {
11862
+ }, C = () => {
11863
+ var e;
11864
+ o.value = (e = m.value) == null ? void 0 : e.filter((e) => e.checked && e.type === MessageRole.User).map((e) => e.messages).flat();
11865
+ }, w = (e, n) => {
11866
+ var r;
11867
+ let i = e.type === MessageRole.User;
11868
+ (r = m.value) == null || r.forEach((r, a) => {
11842
11869
  if (r === e) {
11843
11870
  r.checked = n;
11844
- let e = o ? d.value.at(i + 1) : d.value.at(i - 1);
11871
+ let e = i ? m.value.at(a + 1) : m.value.at(a - 1);
11845
11872
  e && (e.checked = n);
11846
11873
  }
11847
- }), i.value = (a = d.value) == null ? void 0 : a.filter((e) => e.checked).map((e) => e.messages).flat();
11848
- }, S = function() {
11849
- var e = _asyncToGenerator(function* (e, n, i) {
11874
+ }), C();
11875
+ }, E = computed(() => m.value.filter((e) => e.type !== MessageRole.Loading)), O = computed(() => E.value.length > 0 && E.value.every((e) => e.checked)), A = () => {
11876
+ E.value.forEach((e) => {
11877
+ e.checked = !0;
11878
+ }), C();
11879
+ }, j = () => {
11880
+ m.value.forEach((e) => {
11881
+ e.checked = !1;
11882
+ }), o.value = [];
11883
+ };
11884
+ watch(() => i.enableSelection, (e) => {
11885
+ e || j();
11886
+ }), r({
11887
+ selectAll: A,
11888
+ deselectAll: j,
11889
+ isAllSelected: O
11890
+ });
11891
+ let M = function() {
11892
+ var e = _asyncToGenerator(function* (e, n, r) {
11850
11893
  var a;
11851
- (a = r.onUserInputConfirm) == null || a.call(r, e, n, i);
11894
+ (a = i.onUserInputConfirm) == null || a.call(i, e, n, r);
11852
11895
  });
11853
11896
  return function(n, r, i) {
11854
11897
  return e.apply(this, arguments);
11855
11898
  };
11856
- }(), C = function() {
11899
+ }(), N = function() {
11857
11900
  var e = _asyncToGenerator(function* (e, n) {
11858
- var i;
11859
- (i = r.onUserShortcutConfirm) == null || i.call(r, e, n);
11901
+ var r;
11902
+ (r = i.onUserShortcutConfirm) == null || r.call(i, e, n);
11860
11903
  });
11861
11904
  return function(n, r) {
11862
11905
  return e.apply(this, arguments);
11863
11906
  };
11864
11907
  }();
11865
- return (i, g) => (openBlock(), createElementBlock("div", {
11908
+ return (r, a) => (openBlock(), createElementBlock("div", {
11866
11909
  ref_key: "messageContainerRef",
11867
- ref: a,
11910
+ ref: d,
11868
11911
  class: "ai-message-container"
11869
11912
  }, [
11870
- (openBlock(!0), createElementBlock(Fragment, null, renderList(d.value, (a, o) => (openBlock(), createElementBlock("div", {
11913
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(m.value, (a, o) => (openBlock(), createElementBlock("div", {
11871
11914
  key: o,
11872
11915
  class: "message-group",
11873
11916
  style: normalizeStyle({ backgroundColor: a.checked ? "#f5f7fa" : "transparent" }),
11874
- onMouseenter: (e) => y(a),
11875
- onMouseleave: (e) => b(a)
11917
+ onMouseenter: (e) => x(a),
11918
+ onMouseleave: (e) => S(a)
11876
11919
  }, [n.enableSelection && a.type !== unref(MessageRole).Loading ? (openBlock(), createBlock(unref(Checkbox), {
11877
11920
  key: 0,
11878
11921
  class: "message-group-checkbox",
11879
11922
  "model-value": a.checked,
11880
- "onUpdate:modelValue": (e) => x(a, e)
11923
+ "onUpdate:modelValue": (e) => w(a, e)
11881
11924
  }, null, 8, ["model-value", "onUpdate:modelValue"])) : createCommentVNode("", !0), createElementVNode("div", {
11882
- class: "message-group-messages",
11925
+ class: normalizeClass(["message-group-messages", { "message-group-enabled-selection": n.enableSelection && a.type !== unref(MessageRole).Loading }]),
11883
11926
  style: normalizeStyle({ width: n.enableSelection && a.type !== unref(MessageRole).Loading ? "calc(100% - 16px)" : "100%" })
11884
- }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(a.messages, (e, r) => renderSlot(i.$slots, "default", mergeProps({
11885
- key: r,
11927
+ }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(a.messages, (e, i) => renderSlot(r.$slots, "default", mergeProps({
11928
+ key: i,
11886
11929
  ref_for: !0
11887
11930
  }, {
11888
11931
  message: e,
11889
11932
  messageToolsStatus: n.messageToolsStatus
11890
11933
  }), () => [(openBlock(), createBlock(message_render_default, {
11891
- key: r,
11934
+ key: i,
11892
11935
  message: e,
11893
11936
  "message-tools-status": n.messageToolsStatus,
11894
- "on-action": (n) => v(n, e),
11895
- "on-input-confirm": (n, r) => S(e, n, r),
11896
- "on-shortcut-confirm": (n) => C(e, n),
11937
+ "on-action": (n) => b(n, e),
11938
+ "on-input-confirm": (n, r) => M(e, n, r),
11939
+ "on-shortcut-confirm": (n) => N(e, n),
11897
11940
  "tippy-options": n.messageToolsTippyOptions
11898
11941
  }, null, 8, [
11899
11942
  "message",
@@ -11905,37 +11948,38 @@ var _hoisted_1$20 = { class: "ai-slash-input-wrapper" }, _hoisted_2$14 = ["aria-
11905
11948
  ]))])), 128)), !(n.enableSelection && a.type !== unref(MessageRole).Loading) && !a.pause && a.type === unref(MessageRole).Assistant && n.messageToolsStatus !== unref(MessageToolsStatus).Hidden ? (openBlock(), createBlock(message_tools_default, {
11906
11949
  key: 0,
11907
11950
  "message-tools-status": n.messageToolsStatus,
11908
- "on-action": (e) => _(e, a.messages),
11909
- "tippy-options": r.messageToolsTippyOptions,
11910
- onFeedback: (e, n, i) => {
11951
+ "on-action": (e) => y(e, a.messages),
11952
+ "tippy-options": i.messageToolsTippyOptions,
11953
+ onFeedback: (e, n, r) => {
11911
11954
  var o;
11912
- return (o = r.onAgentFeedback) == null ? void 0 : o.call(r, e, a.messages, n, i);
11955
+ return (o = i.onAgentFeedback) == null ? void 0 : o.call(i, e, a.messages, n, r);
11913
11956
  }
11914
11957
  }, null, 8, [
11915
11958
  "message-tools-status",
11916
11959
  "on-action",
11917
11960
  "tippy-options",
11918
11961
  "onFeedback"
11919
- ])) : createCommentVNode("", !0)], 4)], 44, _hoisted_1$2))), 128)),
11962
+ ])) : createCommentVNode("", !0)], 6)], 44, _hoisted_1$2))), 128)),
11920
11963
  createElementVNode("div", {
11921
11964
  ref_key: "messageContainerBottomRef",
11922
- ref: o,
11965
+ ref: f,
11923
11966
  class: "message-container-bottom",
11924
11967
  tabindex: "0"
11925
11968
  }, null, 512),
11926
11969
  createElementVNode("div", _hoisted_2$1, [withDirectives(createVNode(scroll_btn_default, {
11927
- title: unref(t)("停止生成"),
11928
- onClick: g[0] || (g[0] = (e) => i.$emit("stopStreaming"))
11970
+ loading: n.stopLoading,
11971
+ title: n.stopLoading ? unref(t)("正在停止") : unref(t)("停止生成"),
11972
+ onClick: a[0] || (a[0] = (e) => r.$emit("stopStreaming"))
11929
11973
  }, {
11930
11974
  icon: withCtx(() => [createVNode(unref(CloseCircleIcon))]),
11931
11975
  _: 1
11932
- }, 8, ["title"]), [[vShow, n.messageStatus === unref(MessageStatus).Streaming]]), withDirectives(createVNode(scroll_btn_default, {
11976
+ }, 8, ["loading", "title"]), [[vShow, n.messageStatus === unref(MessageStatus).Streaming]]), withDirectives(createVNode(scroll_btn_default, {
11933
11977
  title: unref(t)("返回底部"),
11934
- onClick: unref(f)
11978
+ onClick: unref(g)
11935
11979
  }, {
11936
11980
  icon: withCtx(() => [createVNode(unref(ArrowDownIcon))]),
11937
11981
  _: 1
11938
- }, 8, ["title", "onClick"]), [[vShow, unref(m)]])])
11982
+ }, 8, ["title", "onClick"]), [[vShow, unref(_)]])])
11939
11983
  ], 512));
11940
11984
  }
11941
11985
  }), _hoisted_1$1 = { class: "ai-image-preview-group" }, image_preview_group_default = /* @__PURE__ */ defineComponent(_objectSpread2(_objectSpread2({}, { name: "ImagePreviewGroup" }), {}, {