@ibiz-template-plugin/ai-chat 0.0.102 → 0.0.103

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.es.js CHANGED
@@ -494,9 +494,9 @@ function Vi() {
494
494
  Vi.__r = 0;
495
495
  }
496
496
  function Lu(n, e, t, i, r, s, o, a, l, c, u) {
497
- var d, f, p, m, v, y, g, b = i && i.__k || Ru, k = e.length;
498
- for (l = J0(t, e, b, l, k), d = 0; d < k; d++)
499
- (p = t.__k[d]) != null && (f = p.__i == -1 ? Vn : b[p.__i] || Vn, p.__i = d, y = Co(n, p, f, r, s, o, a, l, c, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && ko(f.ref, null, p), u.push(p.ref, p.__c || m, p)), v == null && m != null && (v = m), (g = !!(4 & p.__u)) || f.__k === p.__k ? l = zu(p, l, n, g) : typeof p.type == "function" && y !== void 0 ? l = y : m && (l = m.nextSibling), p.__u &= -7);
497
+ var d, f, p, m, v, b, g, y = i && i.__k || Ru, k = e.length;
498
+ for (l = J0(t, e, y, l, k), d = 0; d < k; d++)
499
+ (p = t.__k[d]) != null && (f = p.__i == -1 ? Vn : y[p.__i] || Vn, p.__i = d, b = Co(n, p, f, r, s, o, a, l, c, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && ko(f.ref, null, p), u.push(p.ref, p.__c || m, p)), v == null && m != null && (v = m), (g = !!(4 & p.__u)) || f.__k === p.__k ? l = zu(p, l, n, g) : typeof p.type == "function" && b !== void 0 ? l = b : m && (l = m.nextSibling), p.__u &= -7);
500
500
  return t.__e = v, l;
501
501
  }
502
502
  function J0(n, e, t, i, r) {
@@ -581,17 +581,17 @@ function Ha(n) {
581
581
  };
582
582
  }
583
583
  function Co(n, e, t, i, r, s, o, a, l, c) {
584
- var u, d, f, p, m, v, y, g, b, k, w, S, x, T, E, N, R, j = e.type;
584
+ var u, d, f, p, m, v, b, g, y, k, w, S, x, T, E, N, R, j = e.type;
585
585
  if (e.constructor != null)
586
586
  return null;
587
587
  128 & t.__u && (l = !!(32 & t.__u), s = [a = e.__e = t.__e]), (u = P.__b) && u(e);
588
588
  e:
589
589
  if (typeof j == "function")
590
590
  try {
591
- if (g = e.props, b = "prototype" in j && j.prototype.render, k = (u = j.contextType) && i[u.__c], w = u ? k ? k.props.value : u.__ : i, t.__c ? y = (d = e.__c = t.__c).__ = d.__E : (b ? e.__c = d = new j(g, w) : (e.__c = d = new ze(g, w), d.constructor = j, d.render = Y0), k && k.sub(d), d.props = g, d.state || (d.state = {}), d.context = w, d.__n = i, f = d.__d = !0, d.__h = [], d._sb = []), b && d.__s == null && (d.__s = d.state), b && j.getDerivedStateFromProps != null && (d.__s == d.state && (d.__s = ot({}, d.__s)), ot(d.__s, j.getDerivedStateFromProps(g, d.__s))), p = d.props, m = d.state, d.__v = e, f)
592
- b && j.getDerivedStateFromProps == null && d.componentWillMount != null && d.componentWillMount(), b && d.componentDidMount != null && d.__h.push(d.componentDidMount);
591
+ if (g = e.props, y = "prototype" in j && j.prototype.render, k = (u = j.contextType) && i[u.__c], w = u ? k ? k.props.value : u.__ : i, t.__c ? b = (d = e.__c = t.__c).__ = d.__E : (y ? e.__c = d = new j(g, w) : (e.__c = d = new ze(g, w), d.constructor = j, d.render = Y0), k && k.sub(d), d.props = g, d.state || (d.state = {}), d.context = w, d.__n = i, f = d.__d = !0, d.__h = [], d._sb = []), y && d.__s == null && (d.__s = d.state), y && j.getDerivedStateFromProps != null && (d.__s == d.state && (d.__s = ot({}, d.__s)), ot(d.__s, j.getDerivedStateFromProps(g, d.__s))), p = d.props, m = d.state, d.__v = e, f)
592
+ y && j.getDerivedStateFromProps == null && d.componentWillMount != null && d.componentWillMount(), y && d.componentDidMount != null && d.__h.push(d.componentDidMount);
593
593
  else {
594
- if (b && j.getDerivedStateFromProps == null && g !== p && d.componentWillReceiveProps != null && d.componentWillReceiveProps(g, w), !d.__e && d.shouldComponentUpdate != null && d.shouldComponentUpdate(g, d.__s, w) === !1 || e.__v == t.__v) {
594
+ if (y && j.getDerivedStateFromProps == null && g !== p && d.componentWillReceiveProps != null && d.componentWillReceiveProps(g, w), !d.__e && d.shouldComponentUpdate != null && d.shouldComponentUpdate(g, d.__s, w) === !1 || e.__v == t.__v) {
595
595
  for (e.__v != t.__v && (d.props = g, d.state = d.__s, d.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.some(function(te) {
596
596
  te && (te.__ = e);
597
597
  }), S = 0; S < d._sb.length; S++)
@@ -599,11 +599,11 @@ function Co(n, e, t, i, r, s, o, a, l, c) {
599
599
  d._sb = [], d.__h.length && o.push(d);
600
600
  break e;
601
601
  }
602
- d.componentWillUpdate != null && d.componentWillUpdate(g, d.__s, w), b && d.componentDidUpdate != null && d.__h.push(function() {
602
+ d.componentWillUpdate != null && d.componentWillUpdate(g, d.__s, w), y && d.componentDidUpdate != null && d.__h.push(function() {
603
603
  d.componentDidUpdate(p, m, v);
604
604
  });
605
605
  }
606
- if (d.context = w, d.props = g, d.__P = n, d.__e = !1, x = P.__r, T = 0, b) {
606
+ if (d.context = w, d.props = g, d.__P = n, d.__e = !1, x = P.__r, T = 0, y) {
607
607
  for (d.state = d.__s, d.__d = !1, x && x(e), u = d.render(d.props, d.state, d.context), E = 0; E < d._sb.length; E++)
608
608
  d.__h.push(d._sb[E]);
609
609
  d._sb = [];
@@ -611,7 +611,7 @@ function Co(n, e, t, i, r, s, o, a, l, c) {
611
611
  do
612
612
  d.__d = !1, x && x(e), u = d.render(d.props, d.state, d.context), d.state = d.__s;
613
613
  while (d.__d && ++T < 25);
614
- d.state = d.__s, d.getChildContext != null && (i = ot(ot({}, i), d.getChildContext())), b && !f && d.getSnapshotBeforeUpdate != null && (v = d.getSnapshotBeforeUpdate(p, m)), N = u, u != null && u.type === We && u.key == null && (N = Fu(u.props.children)), a = Lu(n, ni(N) ? N : [N], e, t, i, r, s, o, a, l, c), d.base = e.__e, e.__u &= -161, d.__h.length && o.push(d), y && (d.__E = d.__ = null);
614
+ d.state = d.__s, d.getChildContext != null && (i = ot(ot({}, i), d.getChildContext())), y && !f && d.getSnapshotBeforeUpdate != null && (v = d.getSnapshotBeforeUpdate(p, m)), N = u, u != null && u.type === We && u.key == null && (N = Fu(u.props.children)), a = Lu(n, ni(N) ? N : [N], e, t, i, r, s, o, a, l, c), d.base = e.__e, e.__u &= -161, d.__h.length && o.push(d), b && (d.__E = d.__ = null);
615
615
  } catch (te) {
616
616
  if (e.__v = null, l || s != null)
617
617
  if (te.then) {
@@ -651,27 +651,27 @@ function Fu(n) {
651
651
  return typeof n != "object" || n == null || n.__b && n.__b > 0 ? n : ni(n) ? n.map(Fu) : ot({}, n);
652
652
  }
653
653
  function X0(n, e, t, i, r, s, o, a, l) {
654
- var c, u, d, f, p, m, v, y = t.props, g = e.props, b = e.type;
655
- if (b == "svg" ? r = "http://www.w3.org/2000/svg" : b == "math" ? r = "http://www.w3.org/1998/Math/MathML" : r || (r = "http://www.w3.org/1999/xhtml"), s != null) {
654
+ var c, u, d, f, p, m, v, b = t.props, g = e.props, y = e.type;
655
+ if (y == "svg" ? r = "http://www.w3.org/2000/svg" : y == "math" ? r = "http://www.w3.org/1998/Math/MathML" : r || (r = "http://www.w3.org/1999/xhtml"), s != null) {
656
656
  for (c = 0; c < s.length; c++)
657
- if ((p = s[c]) && "setAttribute" in p == !!b && (b ? p.localName == b : p.nodeType == 3)) {
657
+ if ((p = s[c]) && "setAttribute" in p == !!y && (y ? p.localName == y : p.nodeType == 3)) {
658
658
  n = p, s[c] = null;
659
659
  break;
660
660
  }
661
661
  }
662
662
  if (n == null) {
663
- if (b == null)
663
+ if (y == null)
664
664
  return document.createTextNode(g);
665
- n = document.createElementNS(r, b, g.is && g), a && (P.__m && P.__m(e, s), a = !1), s = null;
665
+ n = document.createElementNS(r, y, g.is && g), a && (P.__m && P.__m(e, s), a = !1), s = null;
666
666
  }
667
- if (b == null)
668
- y === g || a && n.data == g || (n.data = g);
667
+ if (y == null)
668
+ b === g || a && n.data == g || (n.data = g);
669
669
  else {
670
- if (s = s && cr.call(n.childNodes), y = t.props || Vn, !a && s != null)
671
- for (y = {}, c = 0; c < n.attributes.length; c++)
672
- y[(p = n.attributes[c]).name] = p.value;
673
- for (c in y)
674
- if (p = y[c], c != "children") {
670
+ if (s = s && cr.call(n.childNodes), b = t.props || Vn, !a && s != null)
671
+ for (b = {}, c = 0; c < n.attributes.length; c++)
672
+ b[(p = n.attributes[c]).name] = p.value;
673
+ for (c in b)
674
+ if (p = b[c], c != "children") {
675
675
  if (c == "dangerouslySetInnerHTML")
676
676
  d = p;
677
677
  else if (!(c in g)) {
@@ -681,13 +681,13 @@ function X0(n, e, t, i, r, s, o, a, l) {
681
681
  }
682
682
  }
683
683
  for (c in g)
684
- p = g[c], c == "children" ? f = p : c == "dangerouslySetInnerHTML" ? u = p : c == "value" ? m = p : c == "checked" ? v = p : a && typeof p != "function" || y[c] === p || gi(n, c, p, y[c], r);
684
+ p = g[c], c == "children" ? f = p : c == "dangerouslySetInnerHTML" ? u = p : c == "value" ? m = p : c == "checked" ? v = p : a && typeof p != "function" || b[c] === p || gi(n, c, p, b[c], r);
685
685
  if (u)
686
686
  a || d && (u.__html == d.__html || u.__html == n.innerHTML) || (n.innerHTML = u.__html), e.__k = [];
687
- else if (d && (n.innerHTML = ""), Lu(e.type == "template" ? n.content : n, ni(f) ? f : [f], e, t, i, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : r, s, o, s ? s[0] : t.__k && gn(t, 0), a, l), s != null)
687
+ else if (d && (n.innerHTML = ""), Lu(e.type == "template" ? n.content : n, ni(f) ? f : [f], e, t, i, y == "foreignObject" ? "http://www.w3.org/1999/xhtml" : r, s, o, s ? s[0] : t.__k && gn(t, 0), a, l), s != null)
688
688
  for (c = s.length; c--; )
689
689
  wo(s[c]);
690
- a || (c = "value", b == "progress" && m == null ? n.removeAttribute("value") : m != null && (m !== n[c] || b == "progress" && !m || b == "option" && m != y[c]) && gi(n, c, m, y[c], r), c = "checked", v != null && v != n[c] && gi(n, c, v, y[c], r));
690
+ a || (c = "value", y == "progress" && m == null ? n.removeAttribute("value") : m != null && (m !== n[c] || y == "progress" && !m || y == "option" && m != b[c]) && gi(n, c, m, b[c], r), c = "checked", v != null && v != n[c] && gi(n, c, v, b[c], r));
691
691
  }
692
692
  return n;
693
693
  }
@@ -4116,16 +4116,16 @@ const n2 = (n) => {
4116
4116
  if (Array.isArray(f)) {
4117
4117
  if (f.length === 0)
4118
4118
  return ["".concat(m, '<span class="array">[]</span>')];
4119
- v.push("".concat(m, '<span class="array">[</span>')), f.forEach((y, g) => {
4120
- const b = l(y, p + 1), k = g < f.length - 1 ? "," : "";
4121
- typeof y == "object" && y !== null ? (v.push(...b.slice(0, -1)), v.push("".concat(b[b.length - 1]).concat(k))) : v.push("".concat(b[0]).concat(k));
4119
+ v.push("".concat(m, '<span class="array">[</span>')), f.forEach((b, g) => {
4120
+ const y = l(b, p + 1), k = g < f.length - 1 ? "," : "";
4121
+ typeof b == "object" && b !== null ? (v.push(...y.slice(0, -1)), v.push("".concat(y[y.length - 1]).concat(k))) : v.push("".concat(y[0]).concat(k));
4122
4122
  }), v.push("".concat(m, '<span class="array">]</span>'));
4123
4123
  } else if (typeof f == "object" && f !== null) {
4124
- const y = Object.keys(f);
4125
- if (y.length === 0)
4124
+ const b = Object.keys(f);
4125
+ if (b.length === 0)
4126
4126
  return ["".concat(m, '<span class="property">{}</span>')];
4127
- v.push("".concat(m, '<span class="property">{</span>')), y.forEach((g, b) => {
4128
- const k = f[g], w = b < y.length - 1 ? "," : "", S = '<span class="json-key">"'.concat(g, '":</span>');
4127
+ v.push("".concat(m, '<span class="property">{</span>')), b.forEach((g, y) => {
4128
+ const k = f[g], w = y < b.length - 1 ? "," : "", S = '<span class="json-key">"'.concat(g, '":</span>');
4129
4129
  if (typeof k == "object" && k !== null) {
4130
4130
  const x = l(k, p + 1);
4131
4131
  v.push("".concat(m, " ").concat(S, " ").concat(x[0].trim())), x.length > 1 && (v.push(...x.slice(1, -1)), v.push("".concat(x[x.length - 1]).concat(w)));
@@ -4187,54 +4187,54 @@ const n2 = (n) => {
4187
4187
  ] });
4188
4188
  };
4189
4189
  const i2 = (n) => {
4190
- var v, y;
4190
+ var v, b;
4191
4191
  const e = new L("chunk-tool-call"), t = $([]), i = $(!1), r = $(!1);
4192
4192
  let s;
4193
4193
  const o = () => {
4194
4194
  var g;
4195
4195
  i.value = !i.value, (g = n.onCollapseChange) == null || g.call(n, i.value);
4196
4196
  }, a = (g) => {
4197
- var b;
4198
- g.stopPropagation(), !r.value && (s && clearTimeout(s), r.value = !0, xn.copy(JSON.stringify(n.item, void 0, 2)), (b = n.controller.opts.utils) == null || b.message.success(C.t.value("copied")), s = setTimeout(() => {
4197
+ var y;
4198
+ g.stopPropagation(), !r.value && (s && clearTimeout(s), r.value = !0, xn.copy(JSON.stringify(n.item, void 0, 2)), (y = n.controller.opts.utils) == null || y.message.success(C.t.value("copied")), s = setTimeout(() => {
4199
4199
  r.value = !1;
4200
4200
  }, 2e3));
4201
4201
  }, l = (g) => {
4202
- const b = /\[(.+?)\]\((.+?)\)/g;
4203
- return g.replace(b, (k, w, S) => '<a href="'.concat(S, '">').concat(w, "</a>"));
4202
+ const y = /\[(.+?)\]\((.+?)\)/g;
4203
+ return g.replace(y, (k, w, S) => '<a href="'.concat(S, '">').concat(w, "</a>"));
4204
4204
  };
4205
4205
  B(() => {
4206
4206
  var w;
4207
- const g = jc(((w = n.item.result) == null ? void 0 : w.chunks) || []), b = g.filter(
4207
+ const g = jc(((w = n.item.result) == null ? void 0 : w.chunks) || []), y = g.filter(
4208
4208
  (S) => S.type === "SOURCE"
4209
4209
  ), k = g.filter(
4210
4210
  (S) => S.type !== "SOURCE"
4211
4211
  );
4212
4212
  k.forEach((S) => {
4213
- S.type === "CLUSTER" && (S.children = b.filter((x) => x.pid === S.id), S.isExpand = !1);
4213
+ S.type === "CLUSTER" && (S.children = y.filter((x) => x.pid === S.id), S.isExpand = !1);
4214
4214
  }), t.value = k;
4215
4215
  }, [n.item]), B(() => () => {
4216
4216
  s && clearTimeout(s);
4217
4217
  }, []);
4218
- const c = (g, b) => {
4219
- g.stopPropagation(), b.isExpand = !b.isExpand, t.value = [...t.value];
4218
+ const c = (g, y) => {
4219
+ g.stopPropagation(), y.isExpand = !y.isExpand, t.value = [...t.value];
4220
4220
  }, u = (g) => {
4221
- const b = l(g);
4221
+ const y = l(g);
4222
4222
  return /* @__PURE__ */ h(
4223
4223
  "div",
4224
4224
  {
4225
4225
  onClick: (k) => n.onLinkClick(k),
4226
- dangerouslySetInnerHTML: { __html: b }
4226
+ dangerouslySetInnerHTML: { __html: y }
4227
4227
  }
4228
4228
  );
4229
4229
  }, d = (g) => /* @__PURE__ */ h("div", { className: e.e("footer"), children: [
4230
4230
  g.type === "CLUSTER" && (g.source_count || g.source_count === 0) && /* @__PURE__ */ h("div", { className: e.em("footer", "description"), children: C.t.value("summaryGeneration", { count: g.source_count }) }),
4231
4231
  /* @__PURE__ */ h("div", { className: e.em("footer", "docname"), children: g.docname })
4232
4232
  ] }), f = (g) => {
4233
- var b;
4233
+ var y;
4234
4234
  return /* @__PURE__ */ h(
4235
4235
  "div",
4236
4236
  {
4237
- className: "".concat(e.e("item"), " ").concat(e.em("item", ((b = g.type) == null ? void 0 : b.toLowerCase()) || "default")),
4237
+ className: "".concat(e.e("item"), " ").concat(e.em("item", ((y = g.type) == null ? void 0 : y.toLowerCase()) || "default")),
4238
4238
  children: [
4239
4239
  g.type === "KBGUIDANCE" ? /* @__PURE__ */ h("div", { className: e.e("kbguidance"), children: C.t.value("guidance") }) : /* @__PURE__ */ h(
4240
4240
  "div",
@@ -4253,7 +4253,7 @@ const i2 = (n) => {
4253
4253
  g.id
4254
4254
  );
4255
4255
  }, p = (g) => {
4256
- var b, k;
4256
+ var y, k;
4257
4257
  return g.type === "CLUSTER" ? /* @__PURE__ */ h("div", { className: "".concat(e.e("chunk"), " ").concat(e.e("cluster")), children: [
4258
4258
  /* @__PURE__ */ h("div", { className: e.em("cluster", "header"), children: [
4259
4259
  /* @__PURE__ */ h(
@@ -4286,7 +4286,7 @@ const i2 = (n) => {
4286
4286
  }
4287
4287
  ),
4288
4288
  C.t.value("hitParagraph", {
4289
- count: ((b = g.children) == null ? void 0 : b.length) || 0
4289
+ count: ((y = g.children) == null ? void 0 : y.length) || 0
4290
4290
  })
4291
4291
  ]
4292
4292
  }
@@ -4309,7 +4309,7 @@ const i2 = (n) => {
4309
4309
  {
4310
4310
  className: e.em("header-left", "desc"),
4311
4311
  title: (v = n.item.result) == null ? void 0 : v.query,
4312
- children: (y = n.item.result) == null ? void 0 : y.query
4312
+ children: (b = n.item.result) == null ? void 0 : b.query
4313
4313
  }
4314
4314
  )
4315
4315
  ] }),
@@ -4406,7 +4406,7 @@ const s2 = (n) => {
4406
4406
  var p;
4407
4407
  (p = n.item.result) != null && p.image_url && (t.value = !t.value);
4408
4408
  }, c = () => {
4409
- var p, m, v, y;
4409
+ var p, m, v, b;
4410
4410
  return n.item.error ? /* @__PURE__ */ h("div", { className: "".concat(e.e("error"), " ").concat(e.e("center-text")), children: n.item.result }) : (p = n.item.result) != null && p.image_url || (m = n.item.result) != null && m.content ? [
4411
4411
  /* @__PURE__ */ h(
4412
4412
  "img",
@@ -4417,7 +4417,7 @@ const s2 = (n) => {
4417
4417
  },
4418
4418
  "image"
4419
4419
  ),
4420
- /* @__PURE__ */ h("div", { className: e.e("description"), children: (y = n.item.result) == null ? void 0 : y.content }, "description")
4420
+ /* @__PURE__ */ h("div", { className: e.e("description"), children: (b = n.item.result) == null ? void 0 : b.content }, "description")
4421
4421
  ] : /* @__PURE__ */ h("div", { className: "".concat(e.e("center-text")), children: C.t.value("noData") });
4422
4422
  };
4423
4423
  return /* @__PURE__ */ h("div", { className: "".concat(e.b(), " ").concat(n.className || ""), children: [
@@ -4591,7 +4591,7 @@ const we = new L("chat-single-select"), Po = (n) => {
4591
4591
  icon: c,
4592
4592
  onChange: u,
4593
4593
  onSearch: d
4594
- } = n, f = !!t.length && !s, p = H(null), m = H(null), v = $(""), [y, g] = U(e), [b, k] = U(t), [w, S] = U(!1), [x, T] = U(!1), E = ((Be = t.find((K) => K.value === y)) == null ? void 0 : Be.label) || l;
4594
+ } = n, f = !!t.length && !s, p = H(null), m = H(null), v = $(""), [b, g] = U(e), [y, k] = U(t), [w, S] = U(!1), [x, T] = U(!1), E = ((Be = t.find((K) => K.value === b)) == null ? void 0 : Be.label) || l;
4595
4595
  B(() => {
4596
4596
  w === !1 && (v.value = "", k(t));
4597
4597
  }, [w]), B(() => {
@@ -4623,12 +4623,12 @@ const we = new L("chat-single-select"), Po = (n) => {
4623
4623
  } finally {
4624
4624
  T(!1);
4625
4625
  }
4626
- }, te = () => x ? /* @__PURE__ */ h(pd, {}) : b.length ? b.map((K) => /* @__PURE__ */ h(
4626
+ }, te = () => x ? /* @__PURE__ */ h(pd, {}) : y.length ? y.map((K) => /* @__PURE__ */ h(
4627
4627
  "li",
4628
4628
  {
4629
4629
  title: K.label,
4630
4630
  onClick: () => N(K),
4631
- className: "".concat(we.em("dropdown", "item"), " ").concat(we.is("active", K.value === y)),
4631
+ className: "".concat(we.em("dropdown", "item"), " ").concat(we.is("active", K.value === b)),
4632
4632
  children: K.label
4633
4633
  },
4634
4634
  K.value
@@ -4686,7 +4686,7 @@ const Te = new L("chat-multiple-select"), md = (n) => {
4686
4686
  icon: o,
4687
4687
  onChange: a,
4688
4688
  onSearch: l
4689
- } = n, c = H(null), u = H(null), d = $(""), [f, p] = U(!1), [m, v] = U(!1), [y, g] = U(e || []), [b, k] = U(t);
4689
+ } = n, c = H(null), u = H(null), d = $(""), [f, p] = U(!1), [m, v] = U(!1), [b, g] = U(e || []), [y, k] = U(t);
4690
4690
  B(() => {
4691
4691
  g(e || []);
4692
4692
  }, [e]), B(() => {
@@ -4701,7 +4701,7 @@ const Te = new L("chat-multiple-select"), md = (n) => {
4701
4701
  };
4702
4702
  }, []);
4703
4703
  const w = (N) => {
4704
- const j = y.includes(N.value) ? y.filter((te) => te !== N.value) : [...y, N.value];
4704
+ const j = b.includes(N.value) ? b.filter((te) => te !== N.value) : [...b, N.value];
4705
4705
  g(j), a == null || a(j);
4706
4706
  }, S = (N) => {
4707
4707
  d.value = N;
@@ -4726,7 +4726,7 @@ const Te = new L("chat-multiple-select"), md = (n) => {
4726
4726
  B(() => {
4727
4727
  f === !0 && (d.value = "", T(d.value));
4728
4728
  }, [f]);
4729
- const E = () => m ? /* @__PURE__ */ h(pd, {}) : b.length ? b.map((N) => /* @__PURE__ */ h(
4729
+ const E = () => m ? /* @__PURE__ */ h(pd, {}) : y.length ? y.map((N) => /* @__PURE__ */ h(
4730
4730
  "li",
4731
4731
  {
4732
4732
  title: N.label,
@@ -4739,7 +4739,7 @@ const Te = new L("chat-multiple-select"), md = (n) => {
4739
4739
  type: "checkbox",
4740
4740
  value: N.value,
4741
4741
  className: Te.em("dropdown", "item-checkbox"),
4742
- checked: y.includes(N.value)
4742
+ checked: b.includes(N.value)
4743
4743
  }
4744
4744
  ),
4745
4745
  /* @__PURE__ */ h("div", { className: Te.em("dropdown", "item-label"), children: N.label })
@@ -5048,7 +5048,7 @@ const Un = ({
5048
5048
  }
5049
5049
  };
5050
5050
  return { ...S, ...x[r] };
5051
- }, y = () => {
5051
+ }, b = () => {
5052
5052
  m.current && n === "hover" && (clearTimeout(m.current), m.current = null);
5053
5053
  }, g = (w) => {
5054
5054
  if (n === "click") {
@@ -5056,14 +5056,14 @@ const Un = ({
5056
5056
  const S = !u;
5057
5057
  d(S), o == null || o(S);
5058
5058
  }
5059
- }, b = (w) => {
5059
+ }, y = (w) => {
5060
5060
  if (n === "hover") {
5061
- w.stopPropagation(), y();
5061
+ w.stopPropagation(), b();
5062
5062
  const S = !0;
5063
5063
  d(S), o == null || o(S);
5064
5064
  }
5065
5065
  }, k = () => {
5066
- n === "hover" && (y(), m.current = setTimeout(() => {
5066
+ n === "hover" && (b(), m.current = setTimeout(() => {
5067
5067
  d(!1), o == null || o(!1);
5068
5068
  }, 100));
5069
5069
  };
@@ -5077,7 +5077,7 @@ const Un = ({
5077
5077
  g(w);
5078
5078
  },
5079
5079
  onMouseEnter: (w) => {
5080
- b(w);
5080
+ y(w);
5081
5081
  },
5082
5082
  onMouseLeave: (w) => {
5083
5083
  w.stopPropagation(), k();
@@ -5091,7 +5091,7 @@ const Un = ({
5091
5091
  {
5092
5092
  className: "".concat(l.b(), " pop-").concat(r),
5093
5093
  style: v(),
5094
- onMouseEnter: y,
5094
+ onMouseEnter: b,
5095
5095
  onMouseLeave: k,
5096
5096
  children: i || (t == null ? void 0 : t.map((w) => /* @__PURE__ */ h(
5097
5097
  "div",
@@ -5137,15 +5137,15 @@ const Z = new L("messsage-toolbar"), k2 = (n) => {
5137
5137
  }
5138
5138
  }
5139
5139
  ], u = (m, v) => {
5140
- var y;
5141
- (y = v.onClick) == null || y.call(v, m, v, e.context, e.params, t);
5140
+ var b;
5141
+ (b = v.onClick) == null || b.call(v, m, v, e.context, e.params, t);
5142
5142
  }, d = (m) => {
5143
- var v, y, g, b;
5143
+ var v, b, g, y;
5144
5144
  if (typeof m.icon == "function")
5145
5145
  return m.icon();
5146
- if ((v = m.icon) != null && v.showIcon && ((y = m.icon) != null && y.cssClass))
5146
+ if ((v = m.icon) != null && v.showIcon && ((b = m.icon) != null && b.cssClass))
5147
5147
  return /* @__PURE__ */ h("i", { className: m.icon.cssClass });
5148
- if ((g = m.icon) != null && g.showIcon && ((b = m.icon) != null && b.imagePath))
5148
+ if ((g = m.icon) != null && g.showIcon && ((y = m.icon) != null && y.imagePath))
5149
5149
  return ii(m.icon.imagePath) ? /* @__PURE__ */ h(
5150
5150
  "div",
5151
5151
  {
@@ -5169,13 +5169,13 @@ const Z = new L("messsage-toolbar"), k2 = (n) => {
5169
5169
  }
5170
5170
  ),
5171
5171
  !p && c.map((m, v) => {
5172
- const y = m.id === "islike" && t.islike === "1" || m.id === "isdislike" && t.isdislike === "1";
5172
+ const b = m.id === "islike" && t.islike === "1" || m.id === "isdislike" && t.isdislike === "1";
5173
5173
  return /* @__PURE__ */ h(
5174
5174
  "div",
5175
5175
  {
5176
5176
  title: m.title,
5177
5177
  onClick: (g) => u(g, m),
5178
- className: "".concat(Z.e("item"), " ").concat(Z.is("actived", y)),
5178
+ className: "".concat(Z.e("item"), " ").concat(Z.is("actived", b)),
5179
5179
  children: d(m)
5180
5180
  },
5181
5181
  v
@@ -5219,8 +5219,8 @@ const Z = new L("messsage-toolbar"), k2 = (n) => {
5219
5219
  const { min: t, max: i, step: r, onChange: s } = n, o = H(null), a = $(n.value), l = Math.max.apply(
5220
5220
  null,
5221
5221
  [t, i, r].map((g) => {
5222
- const b = "".concat(g).split(".")[1];
5223
- return b ? b.length : 0;
5222
+ const y = "".concat(g).split(".")[1];
5223
+ return y ? y.length : 0;
5224
5224
  })
5225
5225
  ), c = H({
5226
5226
  dragging: !1,
@@ -5232,47 +5232,47 @@ const Z = new L("messsage-toolbar"), k2 = (n) => {
5232
5232
  a.value = n.value;
5233
5233
  }, [n.value]);
5234
5234
  const d = (g) => {
5235
- let b, k;
5236
- return g.type.startsWith("touch") ? (k = g.touches[0].clientY, b = g.touches[0].clientX) : (k = g.clientY, b = g.clientX), {
5237
- clientX: b,
5235
+ let y, k;
5236
+ return g.type.startsWith("touch") ? (k = g.touches[0].clientY, y = g.touches[0].clientX) : (k = g.clientY, y = g.clientX), {
5237
+ clientX: y,
5238
5238
  clientY: k
5239
5239
  };
5240
5240
  }, f = async (g) => {
5241
5241
  if (g === null || Number.isNaN(+g))
5242
5242
  return;
5243
5243
  g < 0 ? g = 0 : g > 100 && (g = 100);
5244
- const b = 100 / ((i - t) / r);
5245
- let w = Math.round(g / b) * b * (i - t) * 0.01 + t;
5244
+ const y = 100 / ((i - t) / r);
5245
+ let w = Math.round(g / y) * y * (i - t) * 0.01 + t;
5246
5246
  w = Number.parseFloat(w.toFixed(l)), w !== n.value && s(w);
5247
5247
  }, p = (g) => {
5248
- const { clientX: b } = d(g), k = Number.parseFloat(u.value);
5248
+ const { clientX: y } = d(g), k = Number.parseFloat(u.value);
5249
5249
  Object.assign(c.current, {
5250
5250
  dragging: !0,
5251
- startX: b,
5251
+ startX: y,
5252
5252
  startPosition: k,
5253
5253
  newPosition: k
5254
5254
  });
5255
5255
  }, m = (g) => {
5256
5256
  if (!c.current.dragging)
5257
5257
  return;
5258
- const { clientX: b } = d(g), k = o.current.parentElement.clientWidth, w = (b - c.current.startX) / k * 100;
5258
+ const { clientX: y } = d(g), k = o.current.parentElement.clientWidth, w = (y - c.current.startX) / k * 100;
5259
5259
  c.current.newPosition = c.current.startPosition + w, f(c.current.newPosition);
5260
5260
  }, v = () => {
5261
5261
  c.current.dragging && (c.current.dragging = !1, window.removeEventListener("mousemove", m), window.removeEventListener("touchmove", m), window.removeEventListener("mouseup", v), window.removeEventListener("touchend", v));
5262
- }, y = (g) => {
5262
+ }, b = (g) => {
5263
5263
  g.preventDefault(), p(g), window.addEventListener("mousemove", m), window.addEventListener("touchmove", m), window.addEventListener("mouseup", v), window.addEventListener("touchend", v), o.current.focus();
5264
5264
  };
5265
5265
  return Ju(e, () => ({
5266
5266
  state: c,
5267
- onButtonDown: y,
5267
+ onButtonDown: b,
5268
5268
  setPosition: f
5269
5269
  })), /* @__PURE__ */ h(
5270
5270
  "div",
5271
5271
  {
5272
5272
  ref: o,
5273
5273
  className: gl.e("button-wrapper"),
5274
- onMouseDown: y,
5275
- onTouchStart: y,
5274
+ onMouseDown: b,
5275
+ onTouchStart: b,
5276
5276
  style: { left: u.value },
5277
5277
  children: /* @__PURE__ */ h("div", { className: gl.e("button") })
5278
5278
  }
@@ -5302,8 +5302,8 @@ const bi = new L("chat-slider"), vl = (n) => {
5302
5302
  if (!c.current || c.current.state.current.dragging)
5303
5303
  return;
5304
5304
  let v = 0;
5305
- const y = (S = (w = (k = m.touches) == null ? void 0 : k.item(0)) == null ? void 0 : w.clientX) != null ? S : m.clientX, { left: g, width: b } = l.current.getBoundingClientRect();
5306
- v = (y - g) / b * 100, !(v < 0 || v > 100) && (c.current.setPosition(v), setTimeout(() => {
5305
+ const b = (S = (w = (k = m.touches) == null ? void 0 : k.item(0)) == null ? void 0 : w.clientX) != null ? S : m.clientX, { left: g, width: y } = l.current.getBoundingClientRect();
5306
+ v = (b - g) / y * 100, !(v < 0 || v > 100) && (c.current.setPosition(v), setTimeout(() => {
5307
5307
  c.current.onButtonDown(m);
5308
5308
  }, 0));
5309
5309
  };
@@ -5368,7 +5368,7 @@ const Ke = new L("chat-step-item"), T2 = (n) => {
5368
5368
  e.title ? S = e.title : u.value && (S = u.value), S = S.replace(/<tool_call>[\s\S]*?<\/tool_call>/g, "");
5369
5369
  const x = S.indexOf("<tool_call>");
5370
5370
  x !== -1 && S.indexOf("</tool_call>") === -1 && (S = S.substring(0, x)), i(S);
5371
- }, y = () => {
5371
+ }, b = () => {
5372
5372
  if (m.current) {
5373
5373
  const S = m.current;
5374
5374
  S.style.display = "block";
@@ -5382,7 +5382,7 @@ const Ke = new L("chat-step-item"), T2 = (n) => {
5382
5382
  const S = p.current;
5383
5383
  c(S.clientHeight);
5384
5384
  }
5385
- }, b = () => {
5385
+ }, y = () => {
5386
5386
  let S = "", x = e.content || "";
5387
5387
  const T = x.indexOf("<think>"), E = x.indexOf("</think>");
5388
5388
  T !== -1 && E !== -1 && (S = x.slice(T + 7, E), x = x.slice(E + 8));
@@ -5390,7 +5390,7 @@ const Ke = new L("chat-step-item"), T2 = (n) => {
5390
5390
  x = x.replace(/<tool_call>[\s\S]*?<\/tool_call>/g, ""), f.value.description = S || "", u.value = x || "", d.value = N;
5391
5391
  };
5392
5392
  B(() => {
5393
- g(), y(), b(), v();
5393
+ g(), b(), y(), v();
5394
5394
  }, []), B(() => {
5395
5395
  setTimeout(() => {
5396
5396
  g();
@@ -5549,17 +5549,17 @@ const Zt = new L("common-material"), _2 = (n) => {
5549
5549
  const p = u.downloadAppId, m = { ...n.controller.context };
5550
5550
  if (u.downloadContext)
5551
5551
  try {
5552
- const y = u.downloadContext.split(";").reduce(
5553
- (g, b) => {
5554
- if (b.trim()) {
5555
- const [k, w] = b.split(":");
5552
+ const b = u.downloadContext.split(";").reduce(
5553
+ (g, y) => {
5554
+ if (y.trim()) {
5555
+ const [k, w] = y.split(":");
5556
5556
  k && w && (g[k.trim()] = w.trim());
5557
5557
  }
5558
5558
  return g;
5559
5559
  },
5560
5560
  {}
5561
5561
  );
5562
- y && Object.keys(y).length > 0 && Object.assign(m, y);
5562
+ b && Object.keys(b).length > 0 && Object.assign(m, b);
5563
5563
  } catch (v) {
5564
5564
  throw new Error(C.t.value("downloadExContext"));
5565
5565
  }
@@ -5655,7 +5655,7 @@ const ht = new L("markdown-message"), N2 = (n) => {
5655
5655
  n.controller.handleSuggestionClick(n.message, x, T);
5656
5656
  }, v = (x, T) => {
5657
5657
  n.controller.handleUIActionClick(n.message, x, T);
5658
- }, y = (x) => {
5658
+ }, b = (x) => {
5659
5659
  const T = x.indexOf("<think>"), E = x.indexOf("</think>");
5660
5660
  let N = "", R = "", j = !1;
5661
5661
  return E === -1 ? (j = !1, N = x.slice(T + 7), R = "") : (j = !0, N = x.slice(T + 7, E), R = x.slice(E + 8)), { isThoughtCompleted: j, thoughtContent: N, answerContent: R };
@@ -5686,7 +5686,7 @@ const ht = new L("markdown-message"), N2 = (n) => {
5686
5686
  }
5687
5687
  return !1;
5688
5688
  }
5689
- }, b = () => {
5689
+ }, y = () => {
5690
5690
  let x = "";
5691
5691
  if (e.agent_tag && (x = e.agent_tag), x) {
5692
5692
  const T = n.controller.agentList.value.find(
@@ -5732,17 +5732,17 @@ const ht = new L("markdown-message"), N2 = (n) => {
5732
5732
  };
5733
5733
  (() => {
5734
5734
  if (e.content && e.content.indexOf("<think>") !== -1) {
5735
- const { isThoughtCompleted: x, thoughtContent: T, answerContent: E } = y(e.content);
5735
+ const { isThoughtCompleted: x, thoughtContent: T, answerContent: E } = b(e.content);
5736
5736
  d(x, T), l(E);
5737
5737
  } else
5738
5738
  l(e.content);
5739
- b();
5739
+ y();
5740
5740
  })(), B(() => {
5741
5741
  k();
5742
5742
  }, [a.value.remainingText]), B(() => {
5743
5743
  if (t >= 0 && s.value) {
5744
5744
  if (e.content && e.content.indexOf("<think>") !== -1) {
5745
- const { isThoughtCompleted: x, thoughtContent: T, answerContent: E } = y(e.content);
5745
+ const { isThoughtCompleted: x, thoughtContent: T, answerContent: E } = b(e.content);
5746
5746
  d(x, T), l(E);
5747
5747
  } else
5748
5748
  l(e.content);
@@ -9654,16 +9654,16 @@ class p6 {
9654
9654
  }
9655
9655
  let p = a.size + e - (o.content.size - o.openEnd);
9656
9656
  for (; c < a.childCount; ) {
9657
- let v = a.child(c), y = d.matchType(v.type);
9658
- if (!y)
9657
+ let v = a.child(c), b = d.matchType(v.type);
9658
+ if (!b)
9659
9659
  break;
9660
- c++, (c > 1 || l == 0 || v.content.size) && (d = y, u.push(Yd(v.mark(f.allowedMarks(v.marks)), c == 1 ? l : 0, c == a.childCount ? p : -1)));
9660
+ c++, (c > 1 || l == 0 || v.content.size) && (d = b, u.push(Yd(v.mark(f.allowedMarks(v.marks)), c == 1 ? l : 0, c == a.childCount ? p : -1)));
9661
9661
  }
9662
9662
  let m = c == a.childCount;
9663
9663
  m || (p = -1), this.placed = In(this.placed, t, M.from(u)), this.frontier[t].match = d, m && p < 0 && i && i.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
9664
- for (let v = 0, y = a; v < p; v++) {
9665
- let g = y.lastChild;
9666
- this.frontier.push({ type: g.type, match: g.contentMatchAt(g.childCount) }), y = g.content;
9664
+ for (let v = 0, b = a; v < p; v++) {
9665
+ let g = b.lastChild;
9666
+ this.frontier.push({ type: g.type, match: g.contentMatchAt(g.childCount) }), b = g.content;
9667
9667
  }
9668
9668
  this.unplaced = m ? e == 0 ? A.empty : new A(An(o.content, e - 1, 1), e - 1, p < 0 ? o.openEnd : e - 1) : new A(An(o.content, e, c), o.openStart, o.openEnd);
9669
9669
  }
@@ -9781,11 +9781,11 @@ function v6(n, e, t, i) {
9781
9781
  let p = (f + u + 1) % (i.openStart + 1), m = c[p];
9782
9782
  if (m)
9783
9783
  for (let v = 0; v < o.length; v++) {
9784
- let y = o[(v + l) % o.length], g = !0;
9785
- y < 0 && (g = !1, y = -y);
9786
- let b = r.node(y - 1), k = r.index(y - 1);
9787
- if (b.canReplaceWith(k, k, m.type, m.marks))
9788
- return n.replace(r.before(y), g ? s.after(y) : t, new A(Qd(i.content, 0, i.openStart, p), p, i.openEnd));
9784
+ let b = o[(v + l) % o.length], g = !0;
9785
+ b < 0 && (g = !1, b = -b);
9786
+ let y = r.node(b - 1), k = r.index(b - 1);
9787
+ if (y.canReplaceWith(k, k, m.type, m.marks))
9788
+ return n.replace(r.before(b), g ? s.after(b) : t, new A(Qd(i.content, 0, i.openStart, p), p, i.openEnd));
9789
9789
  }
9790
9790
  }
9791
9791
  let d = n.steps.length;
@@ -11193,8 +11193,8 @@ function ah(n, e, t, i) {
11193
11193
  for (let g = o.length - 1; g >= 0; g--)
11194
11194
  m = M.from(o[g].create(null, m));
11195
11195
  m = M.from(r.copy(m));
11196
- let v = n.tr.step(new de(e.pos - 1, p, e.pos, p, new A(m, 1, 0), o.length, !0)), y = v.doc.resolve(p + 2 * o.length);
11197
- y.nodeAfter && y.nodeAfter.type == r.type && Xt(v.doc, y.pos) && v.join(y.pos), t(v.scrollIntoView());
11196
+ let v = n.tr.step(new de(e.pos - 1, p, e.pos, p, new A(m, 1, 0), o.length, !0)), b = v.doc.resolve(p + 2 * o.length);
11197
+ b.nodeAfter && b.nodeAfter.type == r.type && Xt(v.doc, b.pos) && v.join(b.pos), t(v.scrollIntoView());
11198
11198
  }
11199
11199
  return !0;
11200
11200
  }
@@ -11205,16 +11205,16 @@ function ah(n, e, t, i) {
11205
11205
  let p = r, m = [];
11206
11206
  for (; m.push(p), !p.isTextblock; )
11207
11207
  p = p.lastChild;
11208
- let v = s, y = 1;
11208
+ let v = s, b = 1;
11209
11209
  for (; !v.isTextblock; v = v.firstChild)
11210
- y++;
11210
+ b++;
11211
11211
  if (p.canReplace(p.childCount, p.childCount, v.content)) {
11212
11212
  if (t) {
11213
11213
  let g = M.empty;
11214
11214
  for (let k = m.length - 1; k >= 0; k--)
11215
11215
  g = M.from(m[k].copy(g));
11216
- let b = n.tr.step(new de(e.pos - m.length, e.pos + s.nodeSize, e.pos + y, e.pos + s.nodeSize - y, new A(g, m.length, 0), 0, !0));
11217
- t(b.scrollIntoView());
11216
+ let y = n.tr.step(new de(e.pos - m.length, e.pos + s.nodeSize, e.pos + b, e.pos + s.nodeSize - b, new A(g, m.length, 0), 0, !0));
11217
+ t(y.scrollIntoView());
11218
11218
  }
11219
11219
  return !0;
11220
11220
  }
@@ -11506,8 +11506,8 @@ function Fl(n, e, t) {
11506
11506
  else {
11507
11507
  let p = a.scrollLeft, m = a.scrollTop;
11508
11508
  d && (a.scrollTop += d), u && (a.scrollLeft += u);
11509
- let v = a.scrollLeft - p, y = a.scrollTop - m;
11510
- e = { left: e.left - v, top: e.top - y, right: e.right - v, bottom: e.bottom - y };
11509
+ let v = a.scrollLeft - p, b = a.scrollTop - m;
11510
+ e = { left: e.left - v, top: e.top - b, right: e.right - v, bottom: e.bottom - b };
11511
11511
  }
11512
11512
  let f = l ? "fixed" : getComputedStyle(o).position;
11513
11513
  if (/^(fixed|sticky)$/.test(f))
@@ -11790,12 +11790,12 @@ function v3(n, e, t) {
11790
11790
  return a ? !g3.test(i.parent.textContent) || !a.modify ? t == "left" || t == "backward" ? s : o : vh(n, e, () => {
11791
11791
  let { focusNode: l, focusOffset: c, anchorNode: u, anchorOffset: d } = n.domSelectionRange(), f = a.caretBidiLevel;
11792
11792
  a.modify("move", t, "character");
11793
- let p = i.depth ? n.docView.domAfterPos(i.before()) : n.dom, { focusNode: m, focusOffset: v } = n.domSelectionRange(), y = m && !p.contains(m.nodeType == 1 ? m : m.parentNode) || l == m && c == v;
11793
+ let p = i.depth ? n.docView.domAfterPos(i.before()) : n.dom, { focusNode: m, focusOffset: v } = n.domSelectionRange(), b = m && !p.contains(m.nodeType == 1 ? m : m.parentNode) || l == m && c == v;
11794
11794
  try {
11795
11795
  a.collapse(u, d), l && (l != u || c != d) && a.extend && a.extend(l, c);
11796
11796
  } catch (g) {
11797
11797
  }
11798
- return f != null && (a.caretBidiLevel = f), y;
11798
+ return f != null && (a.caretBidiLevel = f), b;
11799
11799
  }) : i.pos == i.start() || i.pos == i.end();
11800
11800
  }
11801
11801
  let Hl = null, jl = null, Ul = !1;
@@ -12056,19 +12056,19 @@ class ai {
12056
12056
  setSelection(e, t, i, r = !1) {
12057
12057
  let s = Math.min(e, t), o = Math.max(e, t);
12058
12058
  for (let p = 0, m = 0; p < this.children.length; p++) {
12059
- let v = this.children[p], y = m + v.size;
12060
- if (s > m && o < y)
12059
+ let v = this.children[p], b = m + v.size;
12060
+ if (s > m && o < b)
12061
12061
  return v.setSelection(e - m - v.border, t - m - v.border, i, r);
12062
- m = y;
12062
+ m = b;
12063
12063
  }
12064
12064
  let a = this.domFromPos(e, e ? -1 : 1), l = t == e ? a : this.domFromPos(t, t ? -1 : 1), c = i.root.getSelection(), u = i.domSelectionRange(), d = !1;
12065
12065
  if ((je || Se) && e == t) {
12066
12066
  let { node: p, offset: m } = a;
12067
12067
  if (p.nodeType == 3) {
12068
12068
  if (d = !!(m && p.nodeValue[m - 1] == "\n"), d && m == p.nodeValue.length)
12069
- for (let v = p, y; v; v = v.parentNode) {
12070
- if (y = v.nextSibling) {
12071
- y.nodeName == "BR" && (a = l = { node: y.parentNode, offset: me(y) + 1 });
12069
+ for (let v = p, b; v; v = v.parentNode) {
12070
+ if (b = v.nextSibling) {
12071
+ b.nodeName == "BR" && (a = l = { node: b.parentNode, offset: me(b) + 1 });
12072
12072
  break;
12073
12073
  }
12074
12074
  let g = v.pmViewDesc;
@@ -12751,14 +12751,14 @@ function T3(n, e, t, i) {
12751
12751
  for (let c = 0; ; ) {
12752
12752
  let u, d;
12753
12753
  for (; o < r.length && r[o].to == s; ) {
12754
- let y = r[o++];
12755
- y.widget && (u ? (d || (d = [u])).push(y) : u = y);
12754
+ let b = r[o++];
12755
+ b.widget && (u ? (d || (d = [u])).push(b) : u = b);
12756
12756
  }
12757
12757
  if (u)
12758
12758
  if (d) {
12759
12759
  d.sort(x3);
12760
- for (let y = 0; y < d.length; y++)
12761
- t(d[y], c, !!l);
12760
+ for (let b = 0; b < d.length; b++)
12761
+ t(d[b], c, !!l);
12762
12762
  } else
12763
12763
  t(u, c, !!l);
12764
12764
  let f, p;
@@ -12768,21 +12768,21 @@ function T3(n, e, t, i) {
12768
12768
  p = c, f = n.child(c++);
12769
12769
  else
12770
12770
  break;
12771
- for (let y = 0; y < a.length; y++)
12772
- a[y].to <= s && a.splice(y--, 1);
12771
+ for (let b = 0; b < a.length; b++)
12772
+ a[b].to <= s && a.splice(b--, 1);
12773
12773
  for (; o < r.length && r[o].from <= s && r[o].to > s; )
12774
12774
  a.push(r[o++]);
12775
12775
  let m = s + f.nodeSize;
12776
12776
  if (f.isText) {
12777
- let y = m;
12778
- o < r.length && r[o].from < y && (y = r[o].from);
12777
+ let b = m;
12778
+ o < r.length && r[o].from < b && (b = r[o].from);
12779
12779
  for (let g = 0; g < a.length; g++)
12780
- a[g].to < y && (y = a[g].to);
12781
- y < m && (l = f.cut(y - s), f = f.cut(0, y - s), m = y, p = -1);
12780
+ a[g].to < b && (b = a[g].to);
12781
+ b < m && (l = f.cut(b - s), f = f.cut(0, b - s), m = b, p = -1);
12782
12782
  } else
12783
12783
  for (; o < r.length && r[o].to < m; )
12784
12784
  o++;
12785
- let v = f.isInline && !f.isLeaf ? a.filter((y) => !y.inline) : a.slice();
12785
+ let v = f.isInline && !f.isLeaf ? a.filter((b) => !b.inline) : a.slice();
12786
12786
  i(f, v, e.forChild(s, f), p), s = m;
12787
12787
  }
12788
12788
  }
@@ -13247,8 +13247,8 @@ function _h(n, e, t, i, r) {
13247
13247
  else {
13248
13248
  let f = r.marks(), { schema: p } = n.state, m = Gt.fromSchema(p);
13249
13249
  o = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((v) => {
13250
- let y = o.appendChild(document.createElement("p"));
13251
- v && y.appendChild(m.serializeNode(p.text(v, f)));
13250
+ let b = o.appendChild(document.createElement("p"));
13251
+ v && b.appendChild(m.serializeNode(p.text(v, f)));
13252
13252
  });
13253
13253
  }
13254
13254
  } else
@@ -13806,7 +13806,7 @@ function h4(n, e, t) {
13806
13806
  l.setSelection(new D(f));
13807
13807
  else {
13808
13808
  let p = l.mapping.map(a);
13809
- l.mapping.maps[l.mapping.maps.length - 1].forEach((m, v, y, g) => p = g), l.setSelection(Uo(n, f, l.doc.resolve(p)));
13809
+ l.mapping.maps[l.mapping.maps.length - 1].forEach((m, v, b, g) => p = g), l.setSelection(Uo(n, f, l.doc.resolve(p)));
13810
13810
  }
13811
13811
  n.focus(), n.dispatch(l.setMeta("uiEvent", "drop"));
13812
13812
  }
@@ -14212,15 +14212,15 @@ function f4(n, e, t, i, r, s, o) {
14212
14212
  for (let c = 0, u = s; c < t.maps.length; c++) {
14213
14213
  let d = 0;
14214
14214
  t.maps[c].forEach((f, p, m, v) => {
14215
- let y = v - m - (p - f);
14215
+ let b = v - m - (p - f);
14216
14216
  for (let g = 0; g < a.length; g += 3) {
14217
- let b = a[g + 1];
14218
- if (b < 0 || f > b + u - d)
14217
+ let y = a[g + 1];
14218
+ if (y < 0 || f > y + u - d)
14219
14219
  continue;
14220
14220
  let k = a[g] + u - d;
14221
- p >= k ? a[g + 1] = f <= k ? -2 : -1 : f >= u && y && (a[g] += y, a[g + 1] += y);
14221
+ p >= k ? a[g + 1] = f <= k ? -2 : -1 : f >= u && b && (a[g] += b, a[g + 1] += b);
14222
14222
  }
14223
- d += y;
14223
+ d += b;
14224
14224
  }), u = t.maps[c].map(u, -1);
14225
14225
  }
14226
14226
  let l = !1;
@@ -14235,9 +14235,9 @@ function f4(n, e, t, i, r, s, o) {
14235
14235
  l = !0;
14236
14236
  continue;
14237
14237
  }
14238
- let f = t.map(n[c + 1] + s, -1), p = f - r, { index: m, offset: v } = i.content.findIndex(d), y = i.maybeChild(m);
14239
- if (y && v == d && v + y.nodeSize == p) {
14240
- let g = a[c + 2].mapInner(t, y, u + 1, n[c] + s + 1, o);
14238
+ let f = t.map(n[c + 1] + s, -1), p = f - r, { index: m, offset: v } = i.content.findIndex(d), b = i.maybeChild(m);
14239
+ if (b && v == d && v + b.nodeSize == p) {
14240
+ let g = a[c + 2].mapInner(t, b, u + 1, n[c] + s + 1, o);
14241
14241
  g != Ce ? (a[c] = d, a[c + 1] = p, a[c + 2] = g) : (a[c + 1] = -2, l = !0);
14242
14242
  } else
14243
14243
  l = !0;
@@ -14547,13 +14547,13 @@ function C4(n, e) {
14547
14547
  function k4(n, e, t) {
14548
14548
  let { node: i, fromOffset: r, toOffset: s, from: o, to: a } = n.docView.parseRange(e, t), l = n.domSelectionRange(), c, u = l.anchorNode;
14549
14549
  if (u && n.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (c = [{ node: u, offset: l.anchorOffset }], yr(l) || c.push({ node: l.focusNode, offset: l.focusOffset })), ue && n.input.lastKeyCode === 8)
14550
- for (let y = s; y > r; y--) {
14551
- let g = i.childNodes[y - 1], b = g.pmViewDesc;
14552
- if (g.nodeName == "BR" && !b) {
14553
- s = y;
14550
+ for (let b = s; b > r; b--) {
14551
+ let g = i.childNodes[b - 1], y = g.pmViewDesc;
14552
+ if (g.nodeName == "BR" && !y) {
14553
+ s = b;
14554
14554
  break;
14555
14555
  }
14556
- if (!b || b.size)
14556
+ if (!y || y.size)
14557
14557
  break;
14558
14558
  }
14559
14559
  let d = n.state.doc, f = n.someProp("domParser") || Pn.fromSchema(n.state.schema), p = d.resolve(o), m = null, v = f.parse(i, {
@@ -14568,8 +14568,8 @@ function k4(n, e, t) {
14568
14568
  context: p
14569
14569
  });
14570
14570
  if (c && c[0].pos != null) {
14571
- let y = c[0].pos, g = c[1] && c[1].pos;
14572
- g == null && (g = y), m = { anchor: y + o, head: g + o };
14571
+ let b = c[0].pos, g = c[1] && c[1].pos;
14572
+ g == null && (g = b), m = { anchor: b + o, head: g + o };
14573
14573
  }
14574
14574
  return { doc: v, sel: m, from: o, to: a };
14575
14575
  }
@@ -14623,16 +14623,16 @@ function T4(n, e, t, i, r) {
14623
14623
  return;
14624
14624
  }
14625
14625
  n.state.selection.from < n.state.selection.to && m.start == m.endB && n.state.selection instanceof F && (m.start > n.state.selection.from && m.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? m.start = n.state.selection.from : m.endA < n.state.selection.to && m.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (m.endB += n.state.selection.to - m.endA, m.endA = n.state.selection.to)), De && Ct <= 11 && m.endB == m.start + 1 && m.endA == m.start && m.start > c.from && c.doc.textBetween(m.start - c.from - 1, m.start - c.from + 1) == "  " && (m.start--, m.endA--, m.endB--);
14626
- let v = c.doc.resolveNoCache(m.start - c.from), y = c.doc.resolveNoCache(m.endB - c.from), g = u.resolve(m.start), b = v.sameParent(y) && v.parent.inlineContent && g.end() >= m.endA;
14627
- if ((Cn && n.input.lastIOSEnter > Date.now() - 225 && (!b || r.some((T) => T.nodeName == "DIV" || T.nodeName == "P")) || !b && v.pos < c.doc.content.size && (!v.sameParent(y) || !v.parent.inlineContent) && v.pos < y.pos && !/\S/.test(c.doc.textBetween(v.pos, y.pos, "", ""))) && n.someProp("handleKeyDown", (T) => T(n, Dt(13, "Enter")))) {
14626
+ let v = c.doc.resolveNoCache(m.start - c.from), b = c.doc.resolveNoCache(m.endB - c.from), g = u.resolve(m.start), y = v.sameParent(b) && v.parent.inlineContent && g.end() >= m.endA;
14627
+ if ((Cn && n.input.lastIOSEnter > Date.now() - 225 && (!y || r.some((T) => T.nodeName == "DIV" || T.nodeName == "P")) || !y && v.pos < c.doc.content.size && (!v.sameParent(b) || !v.parent.inlineContent) && v.pos < b.pos && !/\S/.test(c.doc.textBetween(v.pos, b.pos, "", ""))) && n.someProp("handleKeyDown", (T) => T(n, Dt(13, "Enter")))) {
14628
14628
  n.input.lastIOSEnter = 0;
14629
14629
  return;
14630
14630
  }
14631
- if (n.state.selection.anchor > m.start && _4(u, m.start, m.endA, v, y) && n.someProp("handleKeyDown", (T) => T(n, Dt(8, "Backspace")))) {
14631
+ if (n.state.selection.anchor > m.start && _4(u, m.start, m.endA, v, b) && n.someProp("handleKeyDown", (T) => T(n, Dt(8, "Backspace")))) {
14632
14632
  at && ue && n.domObserver.suppressSelectionUpdates();
14633
14633
  return;
14634
14634
  }
14635
- ue && m.endB == m.start && (n.input.lastChromeDelete = Date.now()), at && !b && v.start() != y.start() && y.parentOffset == 0 && v.depth == y.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == m.endA && (m.endB -= 2, y = c.doc.resolveNoCache(m.endB - c.from), setTimeout(() => {
14635
+ ue && m.endB == m.start && (n.input.lastChromeDelete = Date.now()), at && !y && v.start() != b.start() && b.parentOffset == 0 && v.depth == b.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == m.endA && (m.endB -= 2, b = c.doc.resolveNoCache(m.endB - c.from), setTimeout(() => {
14636
14636
  n.someProp("handleKeyDown", function(T) {
14637
14637
  return T(n, Dt(13, "Enter"));
14638
14638
  });
@@ -14645,19 +14645,19 @@ function T4(n, e, t, i, r) {
14645
14645
  }
14646
14646
  return s && E.setMeta("composition", s), E.scrollIntoView();
14647
14647
  }, x;
14648
- if (b)
14649
- if (v.pos == y.pos) {
14648
+ if (y)
14649
+ if (v.pos == b.pos) {
14650
14650
  De && Ct <= 11 && v.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => ct(n), 20));
14651
14651
  let T = S(n.state.tr.delete(k, w)), E = u.resolve(m.start).marksAcross(u.resolve(m.endA));
14652
14652
  E && T.ensureMarks(E), n.dispatch(T);
14653
14653
  } else if (
14654
14654
  // Adding or removing a mark
14655
- m.endA == m.endB && (x = M4(v.parent.content.cut(v.parentOffset, y.parentOffset), g.parent.content.cut(g.parentOffset, m.endA - g.start())))
14655
+ m.endA == m.endB && (x = M4(v.parent.content.cut(v.parentOffset, b.parentOffset), g.parent.content.cut(g.parentOffset, m.endA - g.start())))
14656
14656
  ) {
14657
14657
  let T = S(n.state.tr);
14658
14658
  x.type == "add" ? T.addMark(k, w, x.mark) : T.removeMark(k, w, x.mark), n.dispatch(T);
14659
- } else if (v.parent.child(v.index()).isText && v.index() == y.index() - (y.textOffset ? 0 : 1)) {
14660
- let T = v.parent.textBetween(v.parentOffset, y.parentOffset), E = () => S(n.state.tr.insertText(T, k, w));
14659
+ } else if (v.parent.child(v.index()).isText && v.index() == b.index() - (b.textOffset ? 0 : 1)) {
14660
+ let T = v.parent.textBetween(v.parentOffset, b.parentOffset), E = () => S(n.state.tr.insertText(T, k, w));
14661
14661
  n.someProp("handleTextInput", (N) => N(n, k, w, T, E)) || n.dispatch(E());
14662
14662
  } else
14663
14663
  n.dispatch(S());
@@ -15324,8 +15324,8 @@ var kr = class {
15324
15324
  const { rawCommands: t, editor: i, state: r } = this, { view: s } = i, o = [], a = !!n, l = n || r.tr, c = () => (!a && e && !l.getMeta("preventDispatch") && !this.hasCustomState && s.dispatch(l), o.every((d) => d === !0)), u = {
15325
15325
  ...Object.fromEntries(
15326
15326
  Object.entries(t).map(([d, f]) => [d, (...m) => {
15327
- const v = this.buildProps(l, e), y = f(...m)(v);
15328
- return o.push(y), u;
15327
+ const v = this.buildProps(l, e), b = f(...m)(v);
15328
+ return o.push(b), u;
15329
15329
  }])
15330
15330
  ),
15331
15331
  run: c
@@ -15676,10 +15676,10 @@ var sv = (n) => !("type" in n), ov = (n, e, t) => ({ tr: i, dispatch: r, editor:
15676
15676
  ...t
15677
15677
  };
15678
15678
  let a;
15679
- const l = (y) => {
15679
+ const l = (b) => {
15680
15680
  s.emit("contentError", {
15681
15681
  editor: s,
15682
- error: y,
15682
+ error: b,
15683
15683
  disableCollaboration: () => {
15684
15684
  "collaboration" in s.storage && typeof s.storage.collaboration == "object" && s.storage.collaboration && (s.storage.collaboration.isDisabled = !0);
15685
15685
  }
@@ -15694,40 +15694,40 @@ var sv = (n) => !("type" in n), ov = (n, e, t) => ({ tr: i, dispatch: r, editor:
15694
15694
  parseOptions: c,
15695
15695
  errorOnInvalidContent: !0
15696
15696
  });
15697
- } catch (y) {
15698
- l(y);
15697
+ } catch (b) {
15698
+ l(b);
15699
15699
  }
15700
15700
  try {
15701
15701
  a = Qn(e, s.schema, {
15702
15702
  parseOptions: c,
15703
15703
  errorOnInvalidContent: (o = t.errorOnInvalidContent) != null ? o : s.options.enableContentCheck
15704
15704
  });
15705
- } catch (y) {
15706
- return l(y), !1;
15705
+ } catch (b) {
15706
+ return l(b), !1;
15707
15707
  }
15708
15708
  let { from: u, to: d } = typeof n == "number" ? { from: n, to: n } : { from: n.from, to: n.to }, f = !0, p = !0;
15709
- if ((sv(a) ? a : [a]).forEach((y) => {
15710
- y.check(), f = f ? y.isText && y.marks.length === 0 : !1, p = p ? y.isBlock : !1;
15709
+ if ((sv(a) ? a : [a]).forEach((b) => {
15710
+ b.check(), f = f ? b.isText && b.marks.length === 0 : !1, p = p ? b.isBlock : !1;
15711
15711
  }), u === d && p) {
15712
- const { parent: y } = i.doc.resolve(u);
15713
- y.isTextblock && !y.type.spec.code && !y.childCount && (u -= 1, d += 1);
15712
+ const { parent: b } = i.doc.resolve(u);
15713
+ b.isTextblock && !b.type.spec.code && !b.childCount && (u -= 1, d += 1);
15714
15714
  }
15715
15715
  let v;
15716
15716
  if (f) {
15717
15717
  if (Array.isArray(e))
15718
- v = e.map((y) => y.text || "").join("");
15718
+ v = e.map((b) => b.text || "").join("");
15719
15719
  else if (e instanceof M) {
15720
- let y = "";
15720
+ let b = "";
15721
15721
  e.forEach((g) => {
15722
- g.text && (y += g.text);
15723
- }), v = y;
15722
+ g.text && (b += g.text);
15723
+ }), v = b;
15724
15724
  } else
15725
15725
  typeof e == "object" && e && e.text ? v = e.text : v = e;
15726
15726
  i.insertText(v, u, d);
15727
15727
  } else {
15728
15728
  v = a;
15729
- const y = i.doc.resolve(u), g = y.node(), b = y.parentOffset === 0, k = g.isText || g.isTextblock, w = g.content.size > 0;
15730
- b && k && w && (u = Math.max(0, u - 1)), i.replaceWith(u, d, v);
15729
+ const b = i.doc.resolve(u), g = b.node(), y = b.parentOffset === 0, k = g.isText || g.isTextblock, w = g.content.size > 0;
15730
+ y && k && w && (u = Math.max(0, u - 1)), i.replaceWith(u, d, v);
15731
15731
  }
15732
15732
  t.updateSelection && rv(i, i.steps.length - 1, -1), t.applyInputRules && i.setMeta("applyInputRules", { from: u, text: v }), t.applyPasteRules && i.setMeta("applyPasteRules", { from: u, text: v });
15733
15733
  }
@@ -16072,8 +16072,8 @@ function Rv(n, e) {
16072
16072
  options: c.options,
16073
16073
  storage: c.storage,
16074
16074
  editor: e
16075
- }, f = n.reduce((g, b) => {
16076
- const k = I(b, "extendNodeSchema", d);
16075
+ }, f = n.reduce((g, y) => {
16076
+ const k = I(y, "extendNodeSchema", d);
16077
16077
  return {
16078
16078
  ...g,
16079
16079
  ...k ? k(c) : {}
@@ -16104,21 +16104,21 @@ function Rv(n, e) {
16104
16104
  node: g,
16105
16105
  HTMLAttributes: ir(g, u)
16106
16106
  }));
16107
- const y = I(c, "renderText", d);
16108
- return y && (p.toText = y), [c.name, p];
16107
+ const b = I(c, "renderText", d);
16108
+ return b && (p.toText = b), [c.name, p];
16109
16109
  })
16110
16110
  ), l = Object.fromEntries(
16111
16111
  s.map((c) => {
16112
- const u = i.filter((y) => y.type === c.name), d = {
16112
+ const u = i.filter((b) => b.type === c.name), d = {
16113
16113
  name: c.name,
16114
16114
  options: c.options,
16115
16115
  storage: c.storage,
16116
16116
  editor: e
16117
- }, f = n.reduce((y, g) => {
16118
- const b = I(g, "extendMarkSchema", d);
16117
+ }, f = n.reduce((b, g) => {
16118
+ const y = I(g, "extendMarkSchema", d);
16119
16119
  return {
16120
- ...y,
16121
- ...b ? b(c) : {}
16120
+ ...b,
16121
+ ...y ? y(c) : {}
16122
16122
  };
16123
16123
  }, {}), p = wc({
16124
16124
  ...f,
@@ -16130,12 +16130,12 @@ function Rv(n, e) {
16130
16130
  attrs: Object.fromEntries(u.map(Cc))
16131
16131
  }), m = G(I(c, "parseHTML", d));
16132
16132
  m && (p.parseDOM = m.map(
16133
- (y) => bc(y, u)
16133
+ (b) => bc(b, u)
16134
16134
  ));
16135
16135
  const v = I(c, "renderHTML", d);
16136
- return v && (p.toDOM = (y) => v({
16137
- mark: y,
16138
- HTMLAttributes: ir(y, u)
16136
+ return v && (p.toDOM = (b) => v({
16137
+ mark: b,
16138
+ HTMLAttributes: ir(b, u)
16139
16139
  })), [c.name, p];
16140
16140
  })
16141
16141
  );
@@ -16279,15 +16279,15 @@ function ro(n, e, t = {}) {
16279
16279
  const a = [];
16280
16280
  if (r.forEach(({ $from: d, $to: f }) => {
16281
16281
  const p = d.pos, m = f.pos;
16282
- n.doc.nodesBetween(p, m, (v, y) => {
16282
+ n.doc.nodesBetween(p, m, (v, b) => {
16283
16283
  if (!v.isText && !v.marks.length)
16284
16284
  return;
16285
- const g = Math.max(p, y), b = Math.min(m, y + v.nodeSize), k = b - g;
16285
+ const g = Math.max(p, b), y = Math.min(m, b + v.nodeSize), k = y - g;
16286
16286
  o += k, a.push(
16287
16287
  ...v.marks.map((w) => ({
16288
16288
  mark: w,
16289
16289
  from: g,
16290
- to: b
16290
+ to: y
16291
16291
  }))
16292
16292
  );
16293
16293
  });
@@ -16480,8 +16480,8 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16480
16480
  }
16481
16481
  ] : void 0), i) {
16482
16482
  if (m && (s instanceof F && e.deleteSelection(), e.split(e.mapping.map(a.pos), 1, p), f && !d && !a.parentOffset && a.parent.type !== f)) {
16483
- const v = e.mapping.map(a.before()), y = e.doc.resolve(v);
16484
- a.node(-1).canReplaceWith(y.index(), y.index() + 1, f) && e.setNodeMarkup(e.mapping.map(a.before()), f);
16483
+ const v = e.mapping.map(a.before()), b = e.doc.resolve(v);
16484
+ a.node(-1).canReplaceWith(b.index(), b.index() + 1, f) && e.setNodeMarkup(e.mapping.map(a.before()), f);
16485
16485
  }
16486
16486
  n && xc(t, r.extensionManager.splittableMarks), e.scrollIntoView();
16487
16487
  }
@@ -16500,8 +16500,8 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16500
16500
  return !1;
16501
16501
  if (r) {
16502
16502
  let g = M.empty;
16503
- const b = l.index(-1) ? 1 : l.index(-2) ? 2 : 3;
16504
- for (let E = l.depth - b; E >= l.depth - 3; E -= 1)
16503
+ const y = l.index(-1) ? 1 : l.index(-2) ? 2 : 3;
16504
+ for (let E = l.depth - y; E >= l.depth - 3; E -= 1)
16505
16505
  g = M.from(l.node(E).copy(g));
16506
16506
  const k = (
16507
16507
  // eslint-disable-next-line no-nested-ternary
@@ -16511,8 +16511,8 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16511
16511
  ...e
16512
16512
  }, S = ((o = a.contentMatch.defaultType) == null ? void 0 : o.createAndFill(w)) || void 0;
16513
16513
  g = g.append(M.from(a.createAndFill(null, S) || void 0));
16514
- const x = l.before(l.depth - (b - 1));
16515
- t.replace(x, l.after(-k), new A(g, 4 - b, 0));
16514
+ const x = l.before(l.depth - (y - 1));
16515
+ t.replace(x, l.after(-k), new A(g, 4 - y, 0));
16516
16516
  let T = -1;
16517
16517
  t.doc.nodesBetween(x, t.doc.content.size, (E, N) => {
16518
16518
  if (T > -1)
@@ -16530,15 +16530,15 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16530
16530
  ...e
16531
16531
  };
16532
16532
  t.delete(l.pos, c.pos);
16533
- const y = p ? [
16533
+ const b = p ? [
16534
16534
  { type: a, attrs: m },
16535
16535
  { type: p, attrs: v }
16536
16536
  ] : [{ type: a, attrs: m }];
16537
16537
  if (!fn(t.doc, l.pos, 2))
16538
16538
  return !1;
16539
16539
  if (r) {
16540
- const { selection: g, storedMarks: b } = i, { splittableMarks: k } = s.extensionManager, w = b || g.$to.parentOffset && g.$from.marks();
16541
- if (t.split(l.pos, 2, y).scrollIntoView(), !w || !r)
16540
+ const { selection: g, storedMarks: y } = i, { splittableMarks: k } = s.extensionManager, w = y || g.$to.parentOffset && g.$from.marks();
16541
+ if (t.split(l.pos, 2, b).scrollIntoView(), !w || !r)
16542
16542
  return !0;
16543
16543
  const S = w.filter((x) => k.includes(x.type.name));
16544
16544
  t.ensureMarks(S);
@@ -16563,7 +16563,7 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16563
16563
  const r = n.doc.nodeAt(i);
16564
16564
  return t.node.type === (r == null ? void 0 : r.type) && Xt(n.doc, i) && n.join(i), !0;
16565
16565
  }, r8 = (n, e, t, i = {}) => ({ editor: r, tr: s, state: o, dispatch: a, chain: l, commands: c, can: u }) => {
16566
- const { extensions: d, splittableMarks: f } = r.extensionManager, p = fe(n, o.schema), m = fe(e, o.schema), { selection: v, storedMarks: y } = o, { $from: g, $to: b } = v, k = g.blockRange(b), w = y || v.$to.parentOffset && v.$from.marks();
16566
+ const { extensions: d, splittableMarks: f } = r.extensionManager, p = fe(n, o.schema), m = fe(e, o.schema), { selection: v, storedMarks: b } = o, { $from: g, $to: y } = v, k = g.blockRange(y), w = b || v.$to.parentOffset && v.$from.marks();
16567
16567
  if (!k)
16568
16568
  return !1;
16569
16569
  const S = ea((x) => Sc(x.type.name, d))(v);
@@ -16619,7 +16619,7 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16619
16619
  return !0;
16620
16620
  if (u && o) {
16621
16621
  let { from: f, to: p } = a;
16622
- const m = (s = c.marks().find((y) => y.type === l)) == null ? void 0 : s.attrs, v = Kh(c, l, m);
16622
+ const m = (s = c.marks().find((b) => b.type === l)) == null ? void 0 : s.attrs, v = Kh(c, l, m);
16623
16623
  v && (f = v.from, p = v.to), t.removeMark(f, p, l);
16624
16624
  } else
16625
16625
  d.forEach((f) => {
@@ -16648,20 +16648,20 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16648
16648
  return t.selection.ranges.forEach((c) => {
16649
16649
  const u = c.$from.pos, d = c.$to.pos;
16650
16650
  let f, p, m, v;
16651
- t.selection.empty ? i.doc.nodesBetween(u, d, (y, g) => {
16652
- s && s === y.type && (l = !0, m = Math.max(g, u), v = Math.min(g + y.nodeSize, d), f = g, p = y);
16653
- }) : i.doc.nodesBetween(u, d, (y, g) => {
16654
- g < u && s && s === y.type && (l = !0, m = Math.max(g, u), v = Math.min(g + y.nodeSize, d), f = g, p = y), g >= u && g <= d && (s && s === y.type && (l = !0, r && t.setNodeMarkup(g, void 0, {
16655
- ...y.attrs,
16651
+ t.selection.empty ? i.doc.nodesBetween(u, d, (b, g) => {
16652
+ s && s === b.type && (l = !0, m = Math.max(g, u), v = Math.min(g + b.nodeSize, d), f = g, p = b);
16653
+ }) : i.doc.nodesBetween(u, d, (b, g) => {
16654
+ g < u && s && s === b.type && (l = !0, m = Math.max(g, u), v = Math.min(g + b.nodeSize, d), f = g, p = b), g >= u && g <= d && (s && s === b.type && (l = !0, r && t.setNodeMarkup(g, void 0, {
16655
+ ...b.attrs,
16656
16656
  ...e
16657
- })), o && y.marks.length && y.marks.forEach((b) => {
16658
- if (o === b.type && (l = !0, r)) {
16659
- const k = Math.max(g, u), w = Math.min(g + y.nodeSize, d);
16657
+ })), o && b.marks.length && b.marks.forEach((y) => {
16658
+ if (o === y.type && (l = !0, r)) {
16659
+ const k = Math.max(g, u), w = Math.min(g + b.nodeSize, d);
16660
16660
  t.addMark(
16661
16661
  k,
16662
16662
  w,
16663
16663
  o.create({
16664
- ...b.attrs,
16664
+ ...y.attrs,
16665
16665
  ...e
16666
16666
  })
16667
16667
  );
@@ -16670,12 +16670,12 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
16670
16670
  }), p && (f !== void 0 && r && t.setNodeMarkup(f, void 0, {
16671
16671
  ...p.attrs,
16672
16672
  ...e
16673
- }), o && p.marks.length && p.marks.forEach((y) => {
16674
- o === y.type && r && t.addMark(
16673
+ }), o && p.marks.length && p.marks.forEach((b) => {
16674
+ o === b.type && r && t.addMark(
16675
16675
  m,
16676
16676
  v,
16677
16677
  o.create({
16678
- ...y.attrs,
16678
+ ...b.attrs,
16679
16679
  ...e
16680
16680
  })
16681
16681
  );
@@ -16747,19 +16747,19 @@ function Mi(n) {
16747
16747
  const m = l.state.tr, v = Cr({
16748
16748
  state: l.state,
16749
16749
  transaction: m
16750
- }), y = {
16750
+ }), b = {
16751
16751
  from: i - (p[0].length - s.length),
16752
16752
  to: r
16753
- }, { commands: g, chain: b, can: k } = new kr({
16753
+ }, { commands: g, chain: y, can: k } = new kr({
16754
16754
  editor: t,
16755
16755
  state: v
16756
16756
  });
16757
16757
  f.handler({
16758
16758
  state: v,
16759
- range: y,
16759
+ range: b,
16760
16760
  match: p,
16761
16761
  commands: g,
16762
- chain: b,
16762
+ chain: y,
16763
16763
  can: k
16764
16764
  }) === null || !m.steps.length || (f.undoable && m.setMeta(a, {
16765
16765
  transform: m,
@@ -16940,10 +16940,10 @@ function S8(n) {
16940
16940
  state: t
16941
16941
  }), d = [];
16942
16942
  return t.doc.nodesBetween(i, r, (p, m) => {
16943
- var v, y, g, b, k;
16944
- if ((y = (v = p.type) == null ? void 0 : v.spec) != null && y.code || !(p.isText || p.isTextblock || p.isInline))
16943
+ var v, b, g, y, k;
16944
+ if ((b = (v = p.type) == null ? void 0 : v.spec) != null && b.code || !(p.isText || p.isTextblock || p.isInline))
16945
16945
  return;
16946
- const w = (k = (b = (g = p.content) == null ? void 0 : g.size) != null ? b : p.nodeSize) != null ? k : 0, S = Math.max(i, m), x = Math.min(r, m + w);
16946
+ const w = (k = (y = (g = p.content) == null ? void 0 : g.size) != null ? y : p.nodeSize) != null ? k : 0, S = Math.max(i, m), x = Math.min(r, m + w);
16947
16947
  if (S >= x)
16948
16948
  return;
16949
16949
  const T = p.isText ? p.text || "" : p.textBetween(S - m, x - m, void 0, "");
@@ -16989,13 +16989,13 @@ function T8(n) {
16989
16989
  rule: p,
16990
16990
  pasteEvt: m
16991
16991
  }) => {
16992
- const v = u.tr, y = Cr({
16992
+ const v = u.tr, b = Cr({
16993
16993
  state: u,
16994
16994
  transaction: v
16995
16995
  });
16996
16996
  if (!(!S8({
16997
16997
  editor: e,
16998
- state: y,
16998
+ state: b,
16999
16999
  from: Math.max(d - 1, 0),
17000
17000
  to: f.b - 1,
17001
17001
  rule: p,
@@ -17004,7 +17004,7 @@ function T8(n) {
17004
17004
  }) || !v.steps.length)) {
17005
17005
  try {
17006
17006
  a = typeof DragEvent < "u" ? new DragEvent("drop") : null;
17007
- } catch (b) {
17007
+ } catch (y) {
17008
17008
  a = null;
17009
17009
  }
17010
17010
  return o = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, v;
@@ -17045,10 +17045,10 @@ function T8(n) {
17045
17045
  }
17046
17046
  },
17047
17047
  appendTransaction: (d, f, p) => {
17048
- const m = d[0], v = m.getMeta("uiEvent") === "paste" && !r, y = m.getMeta("uiEvent") === "drop" && !s, g = m.getMeta("applyPasteRules"), b = !!g;
17049
- if (!v && !y && !b)
17048
+ const m = d[0], v = m.getMeta("uiEvent") === "paste" && !r, b = m.getMeta("uiEvent") === "drop" && !s, g = m.getMeta("applyPasteRules"), y = !!g;
17049
+ if (!v && !b && !y)
17050
17050
  return;
17051
- if (b) {
17051
+ if (y) {
17052
17052
  let { text: S } = g;
17053
17053
  typeof S == "string" ? S = S : S = na(M.from(S), p.schema);
17054
17054
  const { from: x } = g, T = x + S.length, E = x8(S);
@@ -17336,14 +17336,14 @@ var ae = class cf extends ra {
17336
17336
  const u = Av(n.before, [n, ...e]);
17337
17337
  Hv(u).forEach((p) => {
17338
17338
  u.mapping.mapResult(p.oldRange.from).deletedAfter && u.mapping.mapResult(p.oldRange.to).deletedBefore && u.before.nodesBetween(p.oldRange.from, p.oldRange.to, (m, v) => {
17339
- const y = v + m.nodeSize - 2, g = p.oldRange.from <= v && y <= p.oldRange.to;
17339
+ const b = v + m.nodeSize - 2, g = p.oldRange.from <= v && b <= p.oldRange.to;
17340
17340
  this.editor.emit("delete", {
17341
17341
  type: "node",
17342
17342
  node: m,
17343
17343
  from: v,
17344
- to: y,
17344
+ to: b,
17345
17345
  newFrom: u.mapping.map(v),
17346
- newTo: u.mapping.map(y),
17346
+ newTo: u.mapping.map(b),
17347
17347
  deletedRange: p.oldRange,
17348
17348
  newRange: p.newRange,
17349
17349
  partial: !g,
@@ -17355,9 +17355,9 @@ var ae = class cf extends ra {
17355
17355
  });
17356
17356
  const f = u.mapping;
17357
17357
  u.steps.forEach((p, m) => {
17358
- var v, y;
17358
+ var v, b;
17359
17359
  if (p instanceof Xe) {
17360
- const g = f.slice(m).map(p.from, -1), b = f.slice(m).map(p.to), k = f.invert().map(g, -1), w = f.invert().map(b), S = (v = u.doc.nodeAt(g - 1)) == null ? void 0 : v.marks.some((T) => T.eq(p.mark)), x = (y = u.doc.nodeAt(b)) == null ? void 0 : y.marks.some((T) => T.eq(p.mark));
17360
+ const g = f.slice(m).map(p.from, -1), y = f.slice(m).map(p.to), k = f.invert().map(g, -1), w = f.invert().map(y), S = (v = u.doc.nodeAt(g - 1)) == null ? void 0 : v.marks.some((T) => T.eq(p.mark)), x = (b = u.doc.nodeAt(y)) == null ? void 0 : b.marks.some((T) => T.eq(p.mark));
17361
17361
  this.editor.emit("delete", {
17362
17362
  type: "mark",
17363
17363
  mark: p.mark,
@@ -17369,7 +17369,7 @@ var ae = class cf extends ra {
17369
17369
  },
17370
17370
  newRange: {
17371
17371
  from: g,
17372
- to: b
17372
+ to: y
17373
17373
  },
17374
17374
  partial: !!(x || S),
17375
17375
  editor: this.editor,
@@ -17443,7 +17443,7 @@ var ae = class cf extends ra {
17443
17443
  () => o.undoInputRule(),
17444
17444
  // maybe convert first text block node to default node
17445
17445
  () => o.command(({ tr: a }) => {
17446
- const { selection: l, doc: c } = a, { empty: u, $anchor: d } = l, { pos: f, parent: p } = d, m = d.parent.isTextblock && f > 0 ? a.doc.resolve(f - 1) : d, v = m.parent.type.spec.isolating, y = d.pos - d.parentOffset, g = v && m.parent.childCount === 1 ? y === d.pos : V.atStart(c).from === f;
17446
+ const { selection: l, doc: c } = a, { empty: u, $anchor: d } = l, { pos: f, parent: p } = d, m = d.parent.isTextblock && f > 0 ? a.doc.resolve(f - 1) : d, v = m.parent.type.spec.isolating, b = d.pos - d.parentOffset, g = v && m.parent.childCount === 1 ? b === d.pos : V.atStart(c).from === f;
17447
17447
  return !u || !p.type.isTextblock || p.textContent.length || !g || g && d.parent.type.name === "paragraph" ? !1 : o.clearNodes();
17448
17448
  }),
17449
17449
  () => o.deleteSelection(),
@@ -18493,12 +18493,12 @@ function R8(n) {
18493
18493
  const p = new RegExp("^:::".concat(l, "(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)")), m = u.match(p);
18494
18494
  if (!m)
18495
18495
  return;
18496
- const v = m[1] || "", y = i(v);
18497
- if (!o.find((b) => !(b in y)))
18496
+ const v = m[1] || "", b = i(v);
18497
+ if (!o.find((y) => !(y in b)))
18498
18498
  return {
18499
18499
  type: e,
18500
18500
  raw: m[0],
18501
- attributes: y
18501
+ attributes: b
18502
18502
  };
18503
18503
  }
18504
18504
  },
@@ -18547,10 +18547,10 @@ function P8(n) {
18547
18547
  },
18548
18548
  tokenize(d, f, p) {
18549
18549
  var m;
18550
- const v = new RegExp("^:::".concat(c, "(?:\\s+\\{([^}]*)\\})?\\s*\\n")), y = d.match(v);
18551
- if (!y)
18550
+ const v = new RegExp("^:::".concat(c, "(?:\\s+\\{([^}]*)\\})?\\s*\\n")), b = d.match(v);
18551
+ if (!b)
18552
18552
  return;
18553
- const [g, b = ""] = y, k = r(b);
18553
+ const [g, y = ""] = b, k = r(y);
18554
18554
  let w = 1;
18555
18555
  const S = g.length;
18556
18556
  let x = "";
@@ -18594,8 +18594,8 @@ function P8(n) {
18594
18594
  }
18595
18595
  },
18596
18596
  renderMarkdown: (d, f) => {
18597
- const p = u(d.attrs || {}), m = s(p), v = m ? " {".concat(m, "}") : "", y = f.renderChildren(d.content || [], "\n\n");
18598
- return ":::".concat(c).concat(v, "\n\n").concat(y, "\n\n:::");
18597
+ const p = u(d.attrs || {}), m = s(p), v = m ? " {".concat(m, "}") : "", b = f.renderChildren(d.content || [], "\n\n");
18598
+ return ":::".concat(c).concat(v, "\n\n").concat(b, "\n\n:::");
18599
18599
  }
18600
18600
  };
18601
18601
  }
@@ -18647,21 +18647,21 @@ function B8(n) {
18647
18647
  return v !== void 0 ? v : -1;
18648
18648
  },
18649
18649
  tokenize(f, p, m) {
18650
- const v = a ? new RegExp("^\\[".concat(d, "\\s*([^\\]]*)\\]")) : new RegExp("^\\[".concat(d, "\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/").concat(d, "\\]")), y = f.match(v);
18651
- if (!y)
18650
+ const v = a ? new RegExp("^\\[".concat(d, "\\s*([^\\]]*)\\]")) : new RegExp("^\\[".concat(d, "\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/").concat(d, "\\]")), b = f.match(v);
18651
+ if (!b)
18652
18652
  return;
18653
- let g = "", b = "";
18653
+ let g = "", y = "";
18654
18654
  if (a) {
18655
- const [, w] = y;
18656
- b = w;
18655
+ const [, w] = b;
18656
+ y = w;
18657
18657
  } else {
18658
- const [, w, S] = y;
18659
- b = w, g = S || "";
18658
+ const [, w, S] = b;
18659
+ y = w, g = S || "";
18660
18660
  }
18661
- const k = r(b.trim());
18661
+ const k = r(y.trim());
18662
18662
  return {
18663
18663
  type: e,
18664
- raw: y[0],
18664
+ raw: b[0],
18665
18665
  content: g.trim(),
18666
18666
  attributes: k
18667
18667
  };
@@ -18670,8 +18670,8 @@ function B8(n) {
18670
18670
  renderMarkdown: (f) => {
18671
18671
  let p = "";
18672
18672
  i ? p = i(f) : f.content && f.content.length > 0 && (p = f.content.filter((g) => g.type === "text").map((g) => g.text).join(""));
18673
- const m = u(f.attrs || {}), v = s(m), y = v ? " ".concat(v) : "";
18674
- return a ? "[".concat(c).concat(y, "]") : "[".concat(c).concat(y, "]").concat(p, "[/").concat(c, "]");
18673
+ const m = u(f.attrs || {}), v = s(m), b = v ? " ".concat(v) : "";
18674
+ return a ? "[".concat(c).concat(b, "]") : "[".concat(c).concat(b, "]").concat(p, "[/").concat(c, "]");
18675
18675
  }
18676
18676
  };
18677
18677
  }
@@ -18691,9 +18691,9 @@ function F8(n, e, t) {
18691
18691
  } else
18692
18692
  return;
18693
18693
  }
18694
- const m = e.extractItemData(p), { indentLevel: v, mainContent: y } = m;
18694
+ const m = e.extractItemData(p), { indentLevel: v, mainContent: b } = m;
18695
18695
  c = "".concat(c).concat(f, "\n");
18696
- const g = [y];
18696
+ const g = [b];
18697
18697
  for (u += 1; u < a.length; ) {
18698
18698
  const S = a[u];
18699
18699
  if (S.trim() === "") {
@@ -18711,13 +18711,13 @@ function F8(n, e, t) {
18711
18711
  else
18712
18712
  break;
18713
18713
  }
18714
- let b;
18714
+ let y;
18715
18715
  const k = g.slice(1);
18716
18716
  if (k.length > 0) {
18717
18717
  const S = k.map((x) => x.slice(v + d)).join("\n");
18718
- S.trim() && (e.customNestedParser ? b = e.customNestedParser(S) : b = t.blockTokens(S));
18718
+ S.trim() && (e.customNestedParser ? y = e.customNestedParser(S) : y = t.blockTokens(S));
18719
18719
  }
18720
- const w = e.createToken(m, b);
18720
+ const w = e.createToken(m, y);
18721
18721
  l.push(w);
18722
18722
  }
18723
18723
  if (l.length !== 0)
@@ -18821,8 +18821,8 @@ class q8 {
18821
18821
  if (p) {
18822
18822
  let m = p.getBoundingClientRect(), v = d ? m.bottom : m.top;
18823
18823
  d && f && (v = (v + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2);
18824
- let y = this.width / 2 * a;
18825
- i = { left: m.left, right: m.right, top: v - y, bottom: v + y };
18824
+ let b = this.width / 2 * a;
18825
+ i = { left: m.left, right: m.right, top: v - b, bottom: v + b };
18826
18826
  }
18827
18827
  }
18828
18828
  }
@@ -19234,8 +19234,8 @@ class Ge {
19234
19234
  o = Math.min(o, p);
19235
19235
  let m = s.maps[p];
19236
19236
  if (f.step) {
19237
- let v = e.steps[p].invert(e.docs[p]), y = f.selection && f.selection.map(s.slice(l + 1, p));
19238
- y && a++, i.push(new et(m, v, y));
19237
+ let v = e.steps[p].invert(e.docs[p]), b = f.selection && f.selection.map(s.slice(l + 1, p));
19238
+ b && a++, i.push(new et(m, v, b));
19239
19239
  } else
19240
19240
  i.push(new et(m));
19241
19241
  }, r);
@@ -19959,21 +19959,21 @@ const nn = new L("chat-editor"), la = vd(
19959
19959
  if (!u.current)
19960
19960
  return;
19961
19961
  const m = async (g) => {
19962
- const b = await t.opts.uploader.onUpload(g, () => {
19962
+ const y = await t.opts.uploader.onUpload(g, () => {
19963
19963
  }, {
19964
19964
  context: t.context,
19965
19965
  params: t.params
19966
19966
  });
19967
- if (!b)
19967
+ if (!y)
19968
19968
  return { name: "", url: "" };
19969
- const k = t.opts.uploader.getDownLoadUrl(b, {
19969
+ const k = t.opts.uploader.getDownLoadUrl(y, {
19970
19970
  context: t.context,
19971
19971
  params: t.params
19972
19972
  });
19973
- return { name: b.name, url: k };
19973
+ return { name: y.name, url: k };
19974
19974
  }, v = (g) => {
19975
19975
  o(g), f();
19976
- }, y = new A8({
19976
+ }, b = new A8({
19977
19977
  element: u.current,
19978
19978
  extensions: [
19979
19979
  U8,
@@ -19981,12 +19981,12 @@ const nn = new L("chat-editor"), la = vd(
19981
19981
  addKeyboardShortcuts() {
19982
19982
  return {
19983
19983
  "Mod-Enter": () => {
19984
- var g, b;
19985
- return (g = c.current) == null || g.commands.enter(), (b = c.current) == null || b.commands.scrollIntoView(), !0;
19984
+ var g, y;
19985
+ return (g = c.current) == null || g.commands.enter(), (y = c.current) == null || y.commands.scrollIntoView(), !0;
19986
19986
  },
19987
19987
  "Shift-Enter": () => {
19988
- var g, b;
19989
- return (g = c.current) == null || g.commands.setHardBreak(), (b = c.current) == null || b.commands.scrollIntoView(), !0;
19988
+ var g, y;
19989
+ return (g = c.current) == null || g.commands.setHardBreak(), (y = c.current) == null || y.commands.scrollIntoView(), !0;
19990
19990
  }
19991
19991
  };
19992
19992
  }
@@ -20009,11 +20009,11 @@ const nn = new L("chat-editor"), la = vd(
20009
20009
  draggable: !1
20010
20010
  }),
20011
20011
  S7.configure({
20012
- onDrop: async (g, b) => {
20013
- if (b = b.filter((w) => w.type.startsWith("image/")), !b.length)
20012
+ onDrop: async (g, y) => {
20013
+ if (y = y.filter((w) => w.type.startsWith("image/")), !y.length)
20014
20014
  return;
20015
20015
  const k = await Promise.all(
20016
- b.map((w) => m(w))
20016
+ y.map((w) => m(w))
20017
20017
  );
20018
20018
  g.isDestroyed || g.chain().deleteSelection().insertContentAt(
20019
20019
  g.state.selection.from,
@@ -20026,11 +20026,11 @@ const nn = new L("chat-editor"), la = vd(
20026
20026
  }))
20027
20027
  ).focus().scrollIntoView().run();
20028
20028
  },
20029
- onPaste: async (g, b) => {
20030
- if (b = b.filter((w) => w.type.startsWith("image/")), !b.length)
20029
+ onPaste: async (g, y) => {
20030
+ if (y = y.filter((w) => w.type.startsWith("image/")), !y.length)
20031
20031
  return;
20032
20032
  const k = await Promise.all(
20033
- b.map((w) => m(w))
20033
+ y.map((w) => m(w))
20034
20034
  );
20035
20035
  g.isDestroyed || g.chain().deleteSelection().insertContentAt(
20036
20036
  g.state.selection.from,
@@ -20047,16 +20047,16 @@ const nn = new L("chat-editor"), la = vd(
20047
20047
  ],
20048
20048
  content: i || "",
20049
20049
  editorProps: {
20050
- handleKeyDown: (g, b) => a(b)
20050
+ handleKeyDown: (g, y) => a(y)
20051
20051
  },
20052
20052
  onUpdate: () => {
20053
- v(y.getHTML());
20053
+ v(b.getHTML());
20054
20054
  },
20055
20055
  onCreate: () => {
20056
- l(y);
20056
+ l(b);
20057
20057
  }
20058
20058
  });
20059
- return c.current = y, () => {
20059
+ return c.current = b, () => {
20060
20060
  c.current && (c.current.destroy(), c.current = null);
20061
20061
  };
20062
20062
  }, []), Ju(e, () => ({
@@ -20128,27 +20128,30 @@ const nn = new L("chat-editor"), la = vd(
20128
20128
  }, [l.value.remainingText, c]), B(() => {
20129
20129
  if (!o.current || !window.ResizeObserver)
20130
20130
  return;
20131
- const b = new ResizeObserver(() => {
20131
+ const y = new ResizeObserver(() => {
20132
20132
  var w;
20133
20133
  const k = (w = t.value) == null ? void 0 : w.previewer.options.previewerDom;
20134
20134
  k && (s.value = k.scrollHeight > i.value);
20135
20135
  });
20136
- return b.observe(o.current), () => {
20137
- b.disconnect();
20136
+ return y.observe(o.current), () => {
20137
+ y.disconnect();
20138
20138
  };
20139
20139
  }, [o.current]);
20140
- const p = (b) => {
20140
+ const p = (y) => {
20141
20141
  !n.message || !n.controller || n.controller.refreshMessage(n.message, !0);
20142
- }, m = (b) => {
20143
- n.controller.reEditContent.value = b, n.controller.reEditContentChanged.value = !0;
20144
- }, v = (b) => {
20145
- b.stopPropagation(), n.controller.reEditCancel(n.message);
20146
- }, y = (b) => {
20147
- n.controller.reEditContentChanged.value && (b.stopPropagation(), n.controller.reEditSubmit(n.message));
20148
- }, g = (b) => {
20149
- b.code === "Enter" && b.key === "Enter" && n.controller.reEditContentChanged.value && b.shiftKey === !1 && setTimeout(() => {
20150
- n.controller.reEditSubmit(n.message);
20151
- }, 0);
20142
+ }, m = (y) => {
20143
+ n.controller.reEditContent.value = y, n.controller.reEditContentChanged.value = !0;
20144
+ }, v = (y) => {
20145
+ y.stopPropagation(), n.controller.reEditCancel(n.message);
20146
+ }, b = (y) => {
20147
+ n.controller.reEditContentChanged.value && (y.stopPropagation(), n.controller.reEditSubmit(n.message));
20148
+ }, g = (y) => {
20149
+ if (y.code === "Escape" && y.key === "Escape" && n.message.reeditstate === !0)
20150
+ return y.stopPropagation(), n.controller.reEditCancel(n.message), !0;
20151
+ if (y.code === "Enter" && y.key === "Enter" && y.shiftKey === !1)
20152
+ return n.controller.reEditContentChanged.value && setTimeout(() => {
20153
+ n.controller.reEditSubmit(n.message);
20154
+ }, 0), y.stopPropagation(), !0;
20152
20155
  };
20153
20156
  return /* @__PURE__ */ h("div", { className: oe.b(), children: [
20154
20157
  /* @__PURE__ */ h("div", { className: oe.e("user-header"), children: [
@@ -20174,15 +20177,13 @@ const nn = new L("chat-editor"), la = vd(
20174
20177
  c: n.controller,
20175
20178
  value: n.controller.reEditContent.value,
20176
20179
  disabled: n.controller.isLoading.value,
20177
- onCreate: (b) => {
20178
- d.current = b;
20180
+ onCreate: (y) => {
20181
+ d.current = y, y.commands.focus("end");
20179
20182
  },
20180
- onChange: (b) => {
20181
- m(b);
20183
+ onChange: (y) => {
20184
+ m(y);
20182
20185
  },
20183
- onKeyDown: (b) => {
20184
- g(b);
20185
- }
20186
+ onKeyDown: (y) => g(y)
20186
20187
  }
20187
20188
  ),
20188
20189
  /* @__PURE__ */ h("div", { className: oe.em("content", "re-edit-btns"), children: [
@@ -20190,8 +20191,8 @@ const nn = new L("chat-editor"), la = vd(
20190
20191
  "div",
20191
20192
  {
20192
20193
  className: "".concat(oe.em("content", "re-edit-btn"), " ").concat(oe.em("content", "cancel-btn")),
20193
- onClick: (b) => {
20194
- v(b);
20194
+ onClick: (y) => {
20195
+ v(y);
20195
20196
  },
20196
20197
  children: C.t.value("cancel")
20197
20198
  }
@@ -20200,22 +20201,22 @@ const nn = new L("chat-editor"), la = vd(
20200
20201
  "div",
20201
20202
  {
20202
20203
  className: "".concat(oe.em("content", "re-edit-btn"), " ").concat(oe.em("content", "send-btn"), " ").concat(oe.is("disabled ", !n.controller.reEditContentChanged.value)),
20203
- onClick: (b) => {
20204
- y(b);
20204
+ onClick: (y) => {
20205
+ b(y);
20205
20206
  },
20206
20207
  children: C.t.value("send")
20207
20208
  }
20208
20209
  )
20209
20210
  ] })
20210
20211
  ] }) : /* @__PURE__ */ h("div", { className: oe.em("content", "body"), children: [
20211
- l.value.hasResources && /* @__PURE__ */ h("div", { className: oe.em("content", "material"), children: l.value.resources.map((b) => /* @__PURE__ */ h(
20212
+ l.value.hasResources && /* @__PURE__ */ h("div", { className: oe.em("content", "material"), children: l.value.resources.map((y) => /* @__PURE__ */ h(
20212
20213
  fr,
20213
20214
  {
20214
- material: b,
20215
+ material: y,
20215
20216
  disabled: !0,
20216
20217
  controller: n.controller
20217
20218
  },
20218
- b.id
20219
+ y.id
20219
20220
  )) }),
20220
20221
  /* @__PURE__ */ h("div", { className: "pre-wrap-container", children: [
20221
20222
  /* @__PURE__ */ h(
@@ -20273,11 +20274,11 @@ const nn = new L("chat-editor"), la = vd(
20273
20274
  };
20274
20275
  const Et = new L("error-message"), T7 = (n) => {
20275
20276
  const { message: e, size: t } = n, [i, r] = U(!0), s = $(_e()), o = $(null), a = $({ resources: [], remainingText: "", hasResources: !1 }), l = (p) => {
20276
- const { resources: m, remainingText: v, hasResources: y, error: g } = dn.parseMixedContent(p);
20277
+ const { resources: m, remainingText: v, hasResources: b, error: g } = dn.parseMixedContent(p);
20277
20278
  a.value = {
20278
20279
  resources: m,
20279
20280
  remainingText: v,
20280
- hasResources: y,
20281
+ hasResources: b,
20281
20282
  error: g
20282
20283
  };
20283
20284
  };
@@ -20295,24 +20296,24 @@ const Et = new L("error-message"), T7 = (n) => {
20295
20296
  }, e.think.done || (e.think.beginTime || (e.think.beginTime = Date.now()), e.think.endTime = void 0), e.think.done && !e.think.endTime && (e.think.endTime = Date.now(), e.think.collapse = !0);
20296
20297
  }, u = (p) => {
20297
20298
  const m = p.indexOf("<think>"), v = p.indexOf("</think>");
20298
- let y = "", g = "", b = !1;
20299
- return v === -1 ? (b = !1, y = p.slice(m + 7), g = "") : (b = !0, y = p.slice(m + 7, v), g = p.slice(v + 8)), { isThoughtCompleted: b, thoughtContent: y, answerContent: g };
20299
+ let b = "", g = "", y = !1;
20300
+ return v === -1 ? (y = !1, b = p.slice(m + 7), g = "") : (y = !0, b = p.slice(m + 7, v), g = p.slice(v + 8)), { isThoughtCompleted: y, thoughtContent: b, answerContent: g };
20300
20301
  }, d = (p) => {
20301
20302
  const m = p.target, v = m == null ? void 0 : m.closest(
20302
20303
  'a[href^="chunkview://"], a[href^="view://"], a[href^="action://"]'
20303
20304
  );
20304
20305
  if (v) {
20305
20306
  p.preventDefault();
20306
- const y = v.getAttribute("href");
20307
- if (y) {
20307
+ const b = v.getAttribute("href");
20308
+ if (b) {
20308
20309
  let g = "";
20309
- switch (y.startsWith("chunkview://") ? g = "chunkview" : y.startsWith("view://") ? g = "view" : y.startsWith("action://") && (g = "action"), g) {
20310
+ switch (b.startsWith("chunkview://") ? g = "chunkview" : b.startsWith("view://") ? g = "view" : b.startsWith("action://") && (g = "action"), g) {
20310
20311
  case "chunkview":
20311
20312
  case "view":
20312
20313
  case "action":
20313
20314
  n.controller.handlePredefinedClick(
20314
20315
  g,
20315
- y,
20316
+ b,
20316
20317
  n.message,
20317
20318
  p
20318
20319
  );
@@ -20337,8 +20338,8 @@ const Et = new L("error-message"), T7 = (n) => {
20337
20338
  }, [e, t]), B(() => {
20338
20339
  let p = "";
20339
20340
  if (e.content && e.content.indexOf("<think>") !== -1) {
20340
- const { isThoughtCompleted: m, thoughtContent: v, answerContent: y } = u(e.content);
20341
- c(m, v), y && l(y);
20341
+ const { isThoughtCompleted: m, thoughtContent: v, answerContent: b } = u(e.content);
20342
+ c(m, v), b && l(b);
20342
20343
  } else
20343
20344
  l(e.content);
20344
20345
  p = a.value.remainingText, o.value = new ao({
@@ -20722,7 +20723,7 @@ class Ac {
20722
20723
  }
20723
20724
  }
20724
20725
  const Ie = new L("chat-toolbar-item"), E7 = (n) => {
20725
- var v, y, g;
20726
+ var v, b, g;
20726
20727
  const {
20727
20728
  model: e,
20728
20729
  data: t,
@@ -20730,35 +20731,35 @@ const Ie = new L("chat-toolbar-item"), E7 = (n) => {
20730
20731
  disabled: r = !1,
20731
20732
  buttonType: s = "default",
20732
20733
  onClick: o
20733
- } = n, [a, l] = U(!1), c = H(null), u = (b) => typeof b.hidden == "function" ? b.hidden(t) : b.hidden === !0;
20734
+ } = n, [a, l] = U(!1), c = H(null), u = (y) => typeof y.hidden == "function" ? y.hidden(t) : y.hidden === !0;
20734
20735
  if (u(e))
20735
20736
  return /* @__PURE__ */ h(We, {});
20736
- const d = (b) => r ? !0 : typeof b.disabled == "function" ? b.disabled(t) : b.disabled === !0, f = (b) => {
20737
+ const d = (y) => r ? !0 : typeof y.disabled == "function" ? y.disabled(t) : y.disabled === !0, f = (y) => {
20737
20738
  var k, w, S, x;
20738
- if (typeof b.icon == "function")
20739
- return b.icon();
20740
- if ((k = b.icon) != null && k.showIcon && ((w = b.icon) != null && w.cssClass))
20741
- return /* @__PURE__ */ h("i", { className: b.icon.cssClass });
20742
- if ((S = b.icon) != null && S.showIcon && ((x = b.icon) != null && x.imagePath))
20743
- return ii(b.icon.imagePath) ? /* @__PURE__ */ h(
20739
+ if (typeof y.icon == "function")
20740
+ return y.icon();
20741
+ if ((k = y.icon) != null && k.showIcon && ((w = y.icon) != null && w.cssClass))
20742
+ return /* @__PURE__ */ h("i", { className: y.icon.cssClass });
20743
+ if ((S = y.icon) != null && S.showIcon && ((x = y.icon) != null && x.imagePath))
20744
+ return ii(y.icon.imagePath) ? /* @__PURE__ */ h(
20744
20745
  "div",
20745
20746
  {
20746
20747
  dangerouslySetInnerHTML: {
20747
- __html: b.icon.imagePath
20748
+ __html: y.icon.imagePath
20748
20749
  }
20749
20750
  }
20750
- ) : /* @__PURE__ */ h("img", { src: b.icon.imagePath });
20751
- }, p = (b) => {
20751
+ ) : /* @__PURE__ */ h("img", { src: y.icon.imagePath });
20752
+ }, p = (y) => {
20752
20753
  d(e) || l(!0);
20753
- }, m = (b, k) => {
20754
- d(k) || (l(!1), o(b, k));
20754
+ }, m = (y, k) => {
20755
+ d(k) || (l(!1), o(y, k));
20755
20756
  };
20756
20757
  return B(() => {
20757
- const b = (k) => {
20758
+ const y = (k) => {
20758
20759
  c.current && c.current.contains(k.target) || l(!1);
20759
20760
  };
20760
- return a && document.addEventListener("mousedown", b), () => {
20761
- document.removeEventListener("mousedown", b);
20761
+ return a && document.addEventListener("mousedown", y), () => {
20762
+ document.removeEventListener("mousedown", y);
20762
20763
  };
20763
20764
  }, [a]), /* @__PURE__ */ h(
20764
20765
  "div",
@@ -20773,14 +20774,14 @@ const Ie = new L("chat-toolbar-item"), E7 = (n) => {
20773
20774
  {
20774
20775
  title: e.title,
20775
20776
  className: Ie.e("content"),
20776
- onClick: (b) => m(b, e),
20777
+ onClick: (y) => m(y, e),
20777
20778
  children: [
20778
20779
  /* @__PURE__ */ h("div", { className: Ie.em("content", "icon"), children: f(e) }),
20779
20780
  /* @__PURE__ */ h("div", { className: Ie.em("content", "label"), children: e.label })
20780
20781
  ]
20781
20782
  }
20782
20783
  ),
20783
- ((y = e.children) == null ? void 0 : y.length) && /* @__PURE__ */ h(
20784
+ ((b = e.children) == null ? void 0 : b.length) && /* @__PURE__ */ h(
20784
20785
  "div",
20785
20786
  {
20786
20787
  title: C.t.value("more"),
@@ -20795,17 +20796,17 @@ const Ie = new L("chat-toolbar-item"), E7 = (n) => {
20795
20796
  )
20796
20797
  }
20797
20798
  ),
20798
- a && /* @__PURE__ */ h("div", { ref: c, className: Ie.b("dropdown"), children: (g = e.children) == null ? void 0 : g.map((b, k) => {
20799
- if (!u(b))
20799
+ a && /* @__PURE__ */ h("div", { ref: c, className: Ie.b("dropdown"), children: (g = e.children) == null ? void 0 : g.map((y, k) => {
20800
+ if (!u(y))
20800
20801
  return /* @__PURE__ */ h(
20801
20802
  "div",
20802
20803
  {
20803
- title: b.title,
20804
- onClick: (w) => m(w, b),
20805
- className: "".concat(Ie.be("dropdown", "item"), " ").concat(b.customClass || "", " ").concat(Ie.is("disabled", d(b))),
20804
+ title: y.title,
20805
+ onClick: (w) => m(w, y),
20806
+ className: "".concat(Ie.be("dropdown", "item"), " ").concat(y.customClass || "", " ").concat(Ie.is("disabled", d(y))),
20806
20807
  children: [
20807
- /* @__PURE__ */ h("div", { className: Ie.bem("dropdown", "item", "icon"), children: f(b) }),
20808
- /* @__PURE__ */ h("div", { className: Ie.bem("dropdown", "item", "label"), children: b.label })
20808
+ /* @__PURE__ */ h("div", { className: Ie.bem("dropdown", "item", "icon"), children: f(y) }),
20809
+ /* @__PURE__ */ h("div", { className: Ie.bem("dropdown", "item", "label"), children: y.label })
20809
20810
  ]
20810
20811
  },
20811
20812
  k
@@ -20898,11 +20899,11 @@ const A7 = new L("chat-toolbar"), sr = (n) => {
20898
20899
  else
20899
20900
  l = [...c, ...t];
20900
20901
  const f = (m, v) => {
20901
- const y = {
20902
+ const b = {
20902
20903
  ...i
20903
20904
  };
20904
- if (i instanceof It ? (Object.assign(y, { topic: e.topic }), y.msg.realcontent = i.realcontent) : (y.data || (y.data = {}), Object.assign(y.data, { messages: e.messages.value })), v.onClick && typeof v.onClick == "function")
20905
- v.onClick(m, v, e.context, e.params, y);
20905
+ if (i instanceof It ? (Object.assign(b, { topic: e.topic }), b.msg.realcontent = i.realcontent) : (b.data || (b.data = {}), Object.assign(b.data, { messages: e.messages.value })), v.onClick && typeof v.onClick == "function")
20906
+ v.onClick(m, v, e.context, e.params, b);
20906
20907
  else {
20907
20908
  const g = n.controller.opts.extendToolbarClick;
20908
20909
  g && typeof g == "function" && g(
@@ -20910,7 +20911,7 @@ const A7 = new L("chat-toolbar"), sr = (n) => {
20910
20911
  v,
20911
20912
  e.context,
20912
20913
  e.params,
20913
- y
20914
+ b
20914
20915
  );
20915
20916
  }
20916
20917
  }, p = $e(() => r === "content" ? (i == null ? void 0 : i.role) === "ASSISTANT" ? (i == null ? void 0 : i.state) === 20 && (i == null ? void 0 : i.completed) !== !0 || e.isLoading.value : (i == null ? void 0 : i.role) === "USER" ? e.isLoading.value : !1 : !1, [i == null ? void 0 : i.state, i == null ? void 0 : i.completed, i == null ? void 0 : i.role, e.isLoading.value]);
@@ -20982,8 +20983,8 @@ const Ic = new L("chat-messages"), so = (n) => {
20982
20983
  }, 500));
20983
20984
  };
20984
20985
  B(() => {
20985
- const g = u.value.length, b = d.current;
20986
- g !== b && l(!0), a && m(), d.current = g;
20986
+ const g = u.value.length, y = d.current;
20987
+ g !== y && l(!0), a && m(), d.current = g;
20987
20988
  }, [u.value]);
20988
20989
  const v = () => {
20989
20990
  if (c.current)
@@ -20991,8 +20992,8 @@ const Ic = new L("chat-messages"), so = (n) => {
20991
20992
  const g = e.current;
20992
20993
  if (!g)
20993
20994
  return;
20994
- const { scrollTop: b, scrollHeight: k, clientHeight: w } = g;
20995
- b < 100 && !s && p && (o(!0), setTimeout(() => {
20995
+ const { scrollTop: y, scrollHeight: k, clientHeight: w } = g;
20996
+ y < 100 && !s && p && (o(!0), setTimeout(() => {
20996
20997
  const x = Math.min(
20997
20998
  i + t,
20998
20999
  u.value.length
@@ -21004,19 +21005,19 @@ const Ic = new L("chat-messages"), so = (n) => {
21004
21005
  g.scrollTop = E - T + g.scrollTop, o(!1);
21005
21006
  }, 0);
21006
21007
  }, 300));
21007
- const S = k - (b + w) < 50;
21008
+ const S = k - (y + w) < 50;
21008
21009
  l(S);
21009
- }, y = () => {
21010
+ }, b = () => {
21010
21011
  c.current = !0, l(!0);
21011
21012
  };
21012
21013
  return /* @__PURE__ */ h("div", { ref: e, className: Ic.b(), onScroll: v, children: [
21013
21014
  f.map((g) => {
21014
21015
  var k;
21015
- const b = ((k = g.content) == null ? void 0 : k.length) || 0;
21016
+ const y = ((k = g.content) == null ? void 0 : k.length) || 0;
21016
21017
  return g.role !== "SYSTEM" ? /* @__PURE__ */ h(
21017
21018
  N7,
21018
21019
  {
21019
- size: b,
21020
+ size: y,
21020
21021
  message: g,
21021
21022
  controller: n.controller,
21022
21023
  children: /* @__PURE__ */ h(
@@ -21040,7 +21041,7 @@ const Ic = new L("chat-messages"), so = (n) => {
21040
21041
  right: 20,
21041
21042
  bottom: 14,
21042
21043
  target: ".".concat(Ic.b()),
21043
- onClick: y
21044
+ onClick: b
21044
21045
  }
21045
21046
  )
21046
21047
  ] });
@@ -22279,10 +22280,10 @@ class Oc {
22279
22280
  if (s.action_context)
22280
22281
  try {
22281
22282
  const m = s.action_context.split(";").reduce(
22282
- (v, y) => {
22283
- if (y.trim()) {
22284
- const [g, b] = y.split(":");
22285
- g && b && (v[g.trim()] = b.trim());
22283
+ (v, b) => {
22284
+ if (b.trim()) {
22285
+ const [g, y] = b.split(":");
22286
+ g && y && (v[g.trim()] = y.trim());
22286
22287
  }
22287
22288
  return v;
22288
22289
  },
@@ -22343,12 +22344,12 @@ class Oc {
22343
22344
  if (o.action_context)
22344
22345
  try {
22345
22346
  const v = o.action_context.split(";").reduce(
22346
- (y, g) => {
22347
+ (b, g) => {
22347
22348
  if (g.trim()) {
22348
- const [b, k] = g.split(":");
22349
- b && k && (y[b.trim()] = k.trim());
22349
+ const [y, k] = g.split(":");
22350
+ y && k && (b[y.trim()] = k.trim());
22350
22351
  }
22351
- return y;
22352
+ return b;
22352
22353
  },
22353
22354
  {}
22354
22355
  );
@@ -23259,56 +23260,56 @@ class B7 extends _f {
23259
23260
  getDownLoadUrl: p,
23260
23261
  onProgress: m,
23261
23262
  globalDownloadPrifix: v
23262
- } = i, y = {
23263
+ } = i, b = {
23263
23264
  folder: r,
23264
23265
  globalDownloadPrifix: v,
23265
23266
  multiple: a || !0,
23266
23267
  accept: s || "*/*",
23267
23268
  maxSize: o || 5 * 1024 * 1024,
23268
- onSelect: (b) => {
23269
- c == null || c(b), b.length > 0 && b.forEach((k) => {
23269
+ onSelect: (y) => {
23270
+ c == null || c(y), y.length > 0 && y.forEach((k) => {
23270
23271
  const w = this.buildMaterialObject(r, k);
23271
23272
  Object.assign(w.metadata, { state: "uploading" }), this.aiChat.addMaterial(w);
23272
23273
  });
23273
23274
  },
23274
- onUpload: async (b, k) => u(b, k, {
23275
+ onUpload: async (y, k) => u(y, k, {
23275
23276
  context: this.aiChat.context,
23276
23277
  params: this.aiChat.params
23277
23278
  }),
23278
23279
  onDownLoad: f,
23279
23280
  getDownLoadUrl: p,
23280
23281
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
23281
- onSuccess: (b, k) => {
23282
+ onSuccess: (y, k) => {
23282
23283
  const w = {
23283
- id: b.id,
23284
+ id: y.id,
23284
23285
  type: "ossfile",
23285
23286
  data: {
23286
- id: b.id,
23287
- name: b.name,
23287
+ id: y.id,
23288
+ name: y.name,
23288
23289
  folder: r
23289
23290
  },
23290
23291
  metadata: {
23291
- ext: b.ext,
23292
- fileext: b.fileext,
23293
- fileid: b.fileid,
23294
- filename: b.filename,
23295
- size: b.size,
23296
- filesize: b.filesize,
23292
+ ext: y.ext,
23293
+ fileext: y.fileext,
23294
+ fileid: y.fileid,
23295
+ filename: y.filename,
23296
+ size: y.size,
23297
+ filesize: y.filesize,
23297
23298
  state: "successed",
23298
23299
  folder: r
23299
23300
  }
23300
23301
  };
23301
- this.aiChat.replaceMaterial(k.name, w), d == null || d(b, k);
23302
+ this.aiChat.replaceMaterial(k.name, w), d == null || d(y, k);
23302
23303
  },
23303
- onError: (b, k) => {
23304
+ onError: (y, k) => {
23304
23305
  const w = this.buildMaterialObject(r, k);
23305
- Object.assign(w.metadata, { state: "failed" }), this.aiChat.replaceMaterial(k.name, w), l == null || l(b, k);
23306
+ Object.assign(w.metadata, { state: "failed" }), this.aiChat.replaceMaterial(k.name, w), l == null || l(y, k);
23306
23307
  },
23307
- onProgress: (b, k) => {
23308
- m == null || m(b, k);
23308
+ onProgress: (y, k) => {
23309
+ m == null || m(y, k);
23309
23310
  }
23310
23311
  };
23311
- new ug(y).openFilePicker();
23312
+ new ug(b).openFilePicker();
23312
23313
  }
23313
23314
  /**
23314
23315
  * 构建素材对象
@@ -23923,8 +23924,8 @@ const Re = new L("chat-agent-setting"), j7 = (n) => {
23923
23924
  const s = H(null), o = H(null), [a, l] = U(!1);
23924
23925
  B(() => {
23925
23926
  const p = (m) => {
23926
- var v, y;
23927
- m.target && ((v = o.current) != null && v.contains(m.target)) || ((y = s.current) != null && y.contains(m.target) ? l((g) => !g) : l(!1));
23927
+ var v, b;
23928
+ m.target && ((v = o.current) != null && v.contains(m.target)) || ((b = s.current) != null && b.contains(m.target) ? l((g) => !g) : l(!1));
23928
23929
  };
23929
23930
  return document.addEventListener("mousedown", p), () => {
23930
23931
  document.removeEventListener("mousedown", p);
@@ -24099,9 +24100,9 @@ const z = new L("chat-input"), Dc = window.SpeechRecognition || window.webkitSpe
24099
24100
  ).excuteAction(w, S), t(!1);
24100
24101
  }, v = (w) => {
24101
24102
  n.controller.setActiveAIAgentID(w);
24102
- }, y = (w) => {
24103
+ }, b = (w) => {
24103
24104
  n.controller.setSelectionKnowledge(w);
24104
- }, g = async (w) => await n.controller.knowledgeRemoteSearch(w), b = async (w) => await n.controller.searchAIAgent(w);
24105
+ }, g = async (w) => await n.controller.knowledgeRemoteSearch(w), y = async (w) => await n.controller.searchAIAgent(w);
24105
24106
  return /* @__PURE__ */ h(
24106
24107
  "div",
24107
24108
  {
@@ -24193,7 +24194,7 @@ const z = new L("chat-input"), Dc = window.SpeechRecognition || window.webkitSpe
24193
24194
  options: n.controller.agentList.value,
24194
24195
  icon: () => /* @__PURE__ */ h("div", { title: C.t.value("agent"), children: cd() }),
24195
24196
  disabled: !n.controller.enableAIAgentChange,
24196
- onSearch: b,
24197
+ onSearch: y,
24197
24198
  onChange: (w) => v(w)
24198
24199
  }
24199
24200
  ),
@@ -24211,7 +24212,7 @@ const z = new L("chat-input"), Dc = window.SpeechRecognition || window.webkitSpe
24211
24212
  placeholder: C.t.value("knowledgeSearch"),
24212
24213
  value: n.controller.selectionKnowledgeBases.value,
24213
24214
  onSearch: (w) => g(w),
24214
- onChange: y
24215
+ onChange: b
24215
24216
  }
24216
24217
  ),
24217
24218
  n.controller.enableRecallConfigSetting.value && n.controller.agentList.value.length > 0 ? /* @__PURE__ */ h(j7, { controller: n.controller }) : null
@@ -24321,8 +24322,8 @@ const z = new L("chat-input"), Dc = window.SpeechRecognition || window.webkitSpe
24321
24322
  };
24322
24323
  const Pe = new L("chat-topic-item"), q7 = (n) => {
24323
24324
  const { hasMoreThanOne: e, controller: t, topic: i, onClick: r, onAction: s } = n, o = H(null), a = ve(() => {
24324
- var b;
24325
- return ((b = t.activedTopic.value) == null ? void 0 : b.id) === i.id;
24325
+ var y;
24326
+ return ((y = t.activedTopic.value) == null ? void 0 : y.id) === i.id;
24326
24327
  }), [l, c] = U(!1), u = $([]);
24327
24328
  e ? u.value = [
24328
24329
  {
@@ -24346,17 +24347,17 @@ const Pe = new L("chat-topic-item"), q7 = (n) => {
24346
24347
  ];
24347
24348
  const d = $(!1), f = (g) => {
24348
24349
  g.stopPropagation(), s("LINK", g);
24349
- }, p = (g, b) => {
24350
+ }, p = (g, y) => {
24350
24351
  g === "RENAME" ? (d.value = !0, setTimeout(() => {
24351
24352
  var k;
24352
24353
  (k = o.current) == null || k.focus();
24353
- }, 100)) : s(g, b), c(!1);
24354
+ }, 100)) : s(g, y), c(!1);
24354
24355
  }, m = (g) => {
24355
- var b;
24356
- g.stopPropagation(), i.data.caption = (b = g.target) == null ? void 0 : b.value;
24356
+ var y;
24357
+ g.stopPropagation(), i.data.caption = (y = g.target) == null ? void 0 : y.value;
24357
24358
  }, v = (g) => {
24358
24359
  g.stopPropagation(), d.value = !1, s("RENAME", g);
24359
- }, y = (g) => {
24360
+ }, b = (g) => {
24360
24361
  g.stopPropagation(), g.key === "Enter" && (d.value = !1);
24361
24362
  };
24362
24363
  return /* @__PURE__ */ h(
@@ -24374,7 +24375,7 @@ const Pe = new L("chat-topic-item"), q7 = (n) => {
24374
24375
  ref: o,
24375
24376
  value: i.caption,
24376
24377
  onBlur: v,
24377
- onKeyDown: y,
24378
+ onKeyDown: b,
24378
24379
  onClick: (g) => g.stopPropagation(),
24379
24380
  onChange: (g) => m(g),
24380
24381
  className: Pe.em("caption", "editor")
@@ -24575,19 +24576,19 @@ const rn = new L("chat-minimize"), K7 = (n) => {
24575
24576
  const m = n.controller.messages.value[n.controller.messages.value.length - 1];
24576
24577
  return m ? m.role === "ASSISTANT" && m.state === 20 && m.completed !== !0 : !1;
24577
24578
  }), c = (m) => {
24578
- const v = m.indexOf("<think>"), y = m.indexOf("</think>");
24579
- let g = "", b = "";
24580
- return y === -1 ? (g = m.slice(v + 7), b = "") : (g = m.slice(v + 7, y), b = m.slice(y + 8)), { thoughtContent: g, answerContent: b };
24579
+ const v = m.indexOf("<think>"), b = m.indexOf("</think>");
24580
+ let g = "", y = "";
24581
+ return b === -1 ? (g = m.slice(v + 7), y = "") : (g = m.slice(v + 7, b), y = m.slice(b + 8)), { thoughtContent: g, answerContent: y };
24581
24582
  }, u = ve(() => {
24582
24583
  let m = "";
24583
24584
  if (!l.value)
24584
24585
  return i(""), s(0), m;
24585
24586
  const v = n.controller.messages.value[n.controller.messages.value.length - 1];
24586
24587
  if (m = v.content, v.content && v.content.indexOf("<think>") !== -1) {
24587
- const { thoughtContent: y, answerContent: g } = c(
24588
+ const { thoughtContent: b, answerContent: g } = c(
24588
24589
  v.content
24589
24590
  );
24590
- m = y + g;
24591
+ m = b + g;
24591
24592
  }
24592
24593
  return m;
24593
24594
  }), d = () => {
@@ -24602,9 +24603,9 @@ const rn = new L("chat-minimize"), K7 = (n) => {
24602
24603
  const m = e.current;
24603
24604
  m && (m.onmousedown = (v) => {
24604
24605
  document.body.style.userSelect = "none";
24605
- const y = v.clientX - m.offsetLeft, g = v.clientY - m.offsetTop, b = Date.now(), k = (S) => {
24606
+ const b = v.clientX - m.offsetLeft, g = v.clientY - m.offsetTop, y = Date.now(), k = (S) => {
24606
24607
  const x = 56 / window.innerWidth, T = 56 / window.innerHeight, { x: E, y: N } = Uu(
24607
- S.clientX - y,
24608
+ S.clientX - b,
24608
24609
  S.clientY - g,
24609
24610
  x,
24610
24611
  T
@@ -24614,7 +24615,7 @@ const rn = new L("chat-minimize"), K7 = (n) => {
24614
24615
  });
24615
24616
  }, w = () => {
24616
24617
  const S = Date.now();
24617
- o.current = S - b > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", k), document.removeEventListener("mouseup", w);
24618
+ o.current = S - y > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", k), document.removeEventListener("mouseup", w);
24618
24619
  };
24619
24620
  document.addEventListener("mousemove", k), document.addEventListener("mouseup", w);
24620
24621
  });
@@ -25316,18 +25317,18 @@ const $c = window.SpeechRecognition || window.webkitSpeechRecognition, q = new L
25316
25317
  r.value = !0;
25317
25318
  }, s.current.onend = () => {
25318
25319
  r.value = !1;
25319
- }, s.current.onresult = (b) => {
25320
+ }, s.current.onresult = (y) => {
25320
25321
  var w, S, x, T;
25321
- const k = (x = (S = (w = b.results) == null ? void 0 : w[0]) == null ? void 0 : S[0]) == null ? void 0 : x.transcript;
25322
+ const k = (x = (S = (w = y.results) == null ? void 0 : w[0]) == null ? void 0 : S[0]) == null ? void 0 : x.transcript;
25322
25323
  k && ((T = o.current) == null || T.commands.insertContent(k));
25323
25324
  });
25324
25325
  const a = () => {
25325
25326
  s.current && (r.value ? s.current.abort() : s.current.start());
25326
25327
  }, l = ve(() => Hn(i.value).length <= 0), c = () => {
25327
- var b, k, w;
25328
+ var y, k, w;
25328
25329
  try {
25329
25330
  const S = Hn(i.value);
25330
- i.value = "", (b = o.current) == null || b.chain().clearContent().run();
25331
+ i.value = "", (y = o.current) == null || y.chain().clearContent().run();
25331
25332
  const x = n.controller.stringlyMaterialResource(!0);
25332
25333
  (w = (k = n.controller.opts).action) == null || w.call(k, "send", {
25333
25334
  content: S,
@@ -25338,23 +25339,23 @@ const $c = window.SpeechRecognition || window.webkitSpeechRecognition, q = new L
25338
25339
  } catch (S) {
25339
25340
  console.error(S);
25340
25341
  }
25341
- }, u = (b) => {
25342
- !l.value && b.code === "Enter" && b.key === "Enter" && b.shiftKey === !1 && c();
25343
- }, d = async (b) => {
25342
+ }, u = (y) => {
25343
+ !l.value && y.code === "Enter" && y.key === "Enter" && y.shiftKey === !1 && c();
25344
+ }, d = async (y) => {
25344
25345
  await or.getMaterialHelper(
25345
25346
  "ossfile",
25346
25347
  n.controller
25347
- ).excuteAction(b), t(!1);
25348
- }, f = async (b, k) => {
25348
+ ).excuteAction(y), t(!1);
25349
+ }, f = async (y, k) => {
25349
25350
  await or.getMaterialHelper(
25350
25351
  "common",
25351
25352
  n.controller
25352
- ).excuteAction(b, k), t(!1);
25353
- }, p = (b) => {
25354
- n.controller.setActiveAIAgentID(b);
25355
- }, m = (b) => {
25356
- n.controller.setSelectionKnowledge(b);
25357
- }, v = async (b) => await n.controller.knowledgeRemoteSearch(b), y = async (b) => await n.controller.searchAIAgent(b);
25353
+ ).excuteAction(y, k), t(!1);
25354
+ }, p = (y) => {
25355
+ n.controller.setActiveAIAgentID(y);
25356
+ }, m = (y) => {
25357
+ n.controller.setSelectionKnowledge(y);
25358
+ }, v = async (y) => await n.controller.knowledgeRemoteSearch(y), b = async (y) => await n.controller.searchAIAgent(y);
25358
25359
  return /* @__PURE__ */ h("div", { className: q.b(), children: [
25359
25360
  /* @__PURE__ */ h("div", { className: q.e("body"), children: [
25360
25361
  /* @__PURE__ */ h("div", { className: q.em("body", "wrapper"), children: [
@@ -25364,11 +25365,11 @@ const $c = window.SpeechRecognition || window.webkitSpeechRecognition, q = new L
25364
25365
  {
25365
25366
  value: i.value,
25366
25367
  c: n.controller,
25367
- onCreate: (b) => {
25368
- o.current = b;
25368
+ onCreate: (y) => {
25369
+ o.current = y;
25369
25370
  },
25370
- onChange: (b) => {
25371
- i.value = b;
25371
+ onChange: (y) => {
25372
+ i.value = y;
25372
25373
  },
25373
25374
  onKeyDown: u,
25374
25375
  placeholder: n.controller.placeholder.value,
@@ -25389,26 +25390,26 @@ const $c = window.SpeechRecognition || window.webkitSpeechRecognition, q = new L
25389
25390
  /* @__PURE__ */ h("div", { className: q.bem("popup", "item", "icon"), children: /* @__PURE__ */ h(Ao, {}) }),
25390
25391
  /* @__PURE__ */ h("div", { className: q.bem("popup", "item", "title"), children: C.t.value("documentation") })
25391
25392
  ] }),
25392
- (g = n.questionToolbarItems) == null ? void 0 : g.map((b) => {
25393
+ (g = n.questionToolbarItems) == null ? void 0 : g.map((y) => {
25393
25394
  var k, w, S;
25394
25395
  return /* @__PURE__ */ h(
25395
25396
  "div",
25396
25397
  {
25397
25398
  className: q.be("popup", "item"),
25398
- onClick: (x) => f(x, b),
25399
+ onClick: (x) => f(x, y),
25399
25400
  children: [
25400
- /* @__PURE__ */ h("div", { className: q.bem("popup", "item", "icon"), children: typeof b.icon == "function" ? b.icon() : ((k = b.icon) == null ? void 0 : k.showIcon) && /* @__PURE__ */ h(We, { children: (w = b.icon) != null && w.cssClass ? /* @__PURE__ */ h("i", { className: b.icon.cssClass }) : (S = b.icon) != null && S.imagePath ? ii(b.icon.imagePath) ? /* @__PURE__ */ h(
25401
+ /* @__PURE__ */ h("div", { className: q.bem("popup", "item", "icon"), children: typeof y.icon == "function" ? y.icon() : ((k = y.icon) == null ? void 0 : k.showIcon) && /* @__PURE__ */ h(We, { children: (w = y.icon) != null && w.cssClass ? /* @__PURE__ */ h("i", { className: y.icon.cssClass }) : (S = y.icon) != null && S.imagePath ? ii(y.icon.imagePath) ? /* @__PURE__ */ h(
25401
25402
  "div",
25402
25403
  {
25403
25404
  dangerouslySetInnerHTML: {
25404
- __html: b.icon.imagePath
25405
+ __html: y.icon.imagePath
25405
25406
  }
25406
25407
  }
25407
- ) : /* @__PURE__ */ h("img", { src: b.icon.imagePath }) : null }) }),
25408
- /* @__PURE__ */ h("div", { className: q.bem("popup", "item", "title"), children: b.label })
25408
+ ) : /* @__PURE__ */ h("img", { src: y.icon.imagePath }) : null }) }),
25409
+ /* @__PURE__ */ h("div", { className: q.bem("popup", "item", "title"), children: y.label })
25409
25410
  ]
25410
25411
  },
25411
- b.id
25412
+ y.id
25412
25413
  );
25413
25414
  })
25414
25415
  ] }),
@@ -25457,8 +25458,8 @@ const $c = window.SpeechRecognition || window.webkitSpeechRecognition, q = new L
25457
25458
  options: n.controller.agentList.value,
25458
25459
  icon: () => /* @__PURE__ */ h("div", { title: C.t.value("agent"), children: cd() }),
25459
25460
  disabled: !n.controller.enableAIAgentChange,
25460
- onSearch: y,
25461
- onChange: (b) => p(b)
25461
+ onSearch: b,
25462
+ onChange: (y) => p(y)
25462
25463
  }
25463
25464
  ),
25464
25465
  n.controller.enableKnowledgeBaseSelect.value && /* @__PURE__ */ h(
@@ -25474,7 +25475,7 @@ const $c = window.SpeechRecognition || window.webkitSpeechRecognition, q = new L
25474
25475
  icon: () => /* @__PURE__ */ h("div", { title: C.t.value("knowledge"), children: Oo }),
25475
25476
  placeholder: C.t.value("knowledgeSearch"),
25476
25477
  value: n.controller.selectionKnowledgeBases.value,
25477
- onSearch: (b) => v(b),
25478
+ onSearch: (y) => v(y),
25478
25479
  onChange: m
25479
25480
  }
25480
25481
  )