@ibiz-template-plugin/ai-chat 0.0.15 → 0.0.17

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.
Files changed (33) hide show
  1. package/dist/assets/gif/halo.gif +0 -0
  2. package/dist/index.es.js +1461 -1005
  3. package/dist/index.legacy.js +1 -1
  4. package/dist/style.css +1 -1
  5. package/dist/types/components/chat-back-bottom/chat-back-bottom.d.ts +6 -0
  6. package/dist/types/components/chat-container/chat-container.d.ts +1 -0
  7. package/dist/types/components/chat-message-item/markdown-message/markdown-message.d.ts +7 -0
  8. package/dist/types/components/chat-suggestions/chat-suggestions.d.ts +19 -0
  9. package/dist/types/components/chat-toolbar/chat-toolbar-item/chat-toolbar-item.d.ts +45 -0
  10. package/dist/types/components/popup/popup.d.ts +2 -1
  11. package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +30 -3
  12. package/dist/types/controller/ai-topic/ai-topic.controller.d.ts +17 -0
  13. package/dist/types/entity/chart-topic/chart-topic.d.ts +1 -0
  14. package/dist/types/entity/chat-message/chat-message.d.ts +1 -0
  15. package/dist/types/entity/chat-suggestion/chat-suggestion.d.ts +8 -0
  16. package/dist/types/entity/index.d.ts +1 -0
  17. package/dist/types/icons/chevron-forward-svg.d.ts +3 -0
  18. package/dist/types/icons/clear-dialogue-svg.d.ts +1 -0
  19. package/dist/types/icons/index.d.ts +5 -1
  20. package/dist/types/icons/new-dialogue-svg.d.ts +1 -0
  21. package/dist/types/icons/rename-svg.d.ts +1 -0
  22. package/dist/types/icons/reset-dialogue-svg.d.ts +1 -0
  23. package/dist/types/interface/i-chat-message/i-chat-message.d.ts +9 -0
  24. package/dist/types/interface/i-chat-options/i-chat-options.d.ts +19 -0
  25. package/dist/types/interface/i-chat-suggestion/i-chat-suggestion.d.ts +26 -0
  26. package/dist/types/interface/i-chat-toolbar-item/i-chat-toolbar-item.d.ts +7 -0
  27. package/dist/types/interface/i-topic-options/i-topic-options.d.ts +8 -0
  28. package/dist/types/interface/index.d.ts +1 -0
  29. package/dist/types/utils/index.d.ts +2 -1
  30. package/dist/types/utils/util/chat-suggestion-parser.d.ts +66 -0
  31. package/package.json +1 -1
  32. package/dist/types/icons/new-dialogue.d.ts +0 -1
  33. /package/dist/types/components/{chart-minimize/chart-minimize.d.ts → chat-minimize/chat-minimize.d.ts} +0 -0
package/dist/index.es.js CHANGED
@@ -1,50 +1,50 @@
1
1
  import './style.css';
2
- var yn = Object.defineProperty;
3
- var Cn = (n, e, t) => e in n ? yn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
4
- var x = (n, e, t) => (Cn(n, typeof e != "symbol" ? e + "" : e, t), t);
5
- import Oe from "interactjs";
6
- import Tn from "cherry-markdown";
7
- var Ie, w, Ft, Ut, ee, ot, Wt, qe, Vt, oe = {}, jt = [], xn = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Ae = Array.isArray;
8
- function Y(n, e) {
2
+ var Cn = Object.defineProperty;
3
+ var Tn = (n, e, t) => e in n ? Cn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
4
+ var x = (n, e, t) => (Tn(n, typeof e != "symbol" ? e + "" : e, t), t);
5
+ import He from "interactjs";
6
+ import Ut from "cherry-markdown";
7
+ var Ae, w, Wt, Vt, te, rt, qt, qe, jt, re = {}, Yt = [], xn = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Ie = Array.isArray;
8
+ function G(n, e) {
9
9
  for (var t in e)
10
10
  n[t] = e[t];
11
11
  return n;
12
12
  }
13
- function qt(n) {
13
+ function Xt(n) {
14
14
  var e = n.parentNode;
15
15
  e && e.removeChild(n);
16
16
  }
17
- function W(n, e, t) {
17
+ function j(n, e, t) {
18
18
  var i, s, o, r = {};
19
19
  for (o in e)
20
20
  o == "key" ? i = e[o] : o == "ref" ? s = e[o] : r[o] = e[o];
21
- if (arguments.length > 2 && (r.children = arguments.length > 3 ? Ie.call(arguments, 2) : t), typeof n == "function" && n.defaultProps != null)
21
+ if (arguments.length > 2 && (r.children = arguments.length > 3 ? Ae.call(arguments, 2) : t), typeof n == "function" && n.defaultProps != null)
22
22
  for (o in n.defaultProps)
23
23
  r[o] === void 0 && (r[o] = n.defaultProps[o]);
24
24
  return Te(n, r, i, s, null);
25
25
  }
26
26
  function Te(n, e, t, i, s) {
27
- var o = { type: n, props: e, key: t, ref: i, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: s == null ? ++Ft : s };
27
+ var o = { type: n, props: e, key: t, ref: i, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: s == null ? ++Wt : s };
28
28
  return s == null && w.vnode != null && w.vnode(o), o;
29
29
  }
30
- function rt() {
30
+ function at() {
31
31
  return { current: null };
32
32
  }
33
- function V(n) {
33
+ function Y(n) {
34
34
  return n.children;
35
35
  }
36
- function L(n, e) {
36
+ function F(n, e) {
37
37
  this.props = n, this.context = e;
38
38
  }
39
- function ve(n, e) {
39
+ function _e(n, e) {
40
40
  if (e == null)
41
- return n.__ ? ve(n.__, n.__.__k.indexOf(n) + 1) : null;
41
+ return n.__ ? _e(n.__, n.__.__k.indexOf(n) + 1) : null;
42
42
  for (var t; e < n.__k.length; e++)
43
43
  if ((t = n.__k[e]) != null && t.__e != null)
44
44
  return t.__d || t.__e;
45
- return typeof n.type == "function" ? ve(n) : null;
45
+ return typeof n.type == "function" ? _e(n) : null;
46
46
  }
47
- function Yt(n) {
47
+ function Zt(n) {
48
48
  var e, t;
49
49
  if ((n = n.__) != null && n.__c != null) {
50
50
  for (n.__e = n.__c.base = null, e = 0; e < n.__k.length; e++)
@@ -52,36 +52,36 @@ function Yt(n) {
52
52
  n.__e = n.__c.base = t.__e;
53
53
  break;
54
54
  }
55
- return Yt(n);
55
+ return Zt(n);
56
56
  }
57
57
  }
58
- function Ye(n) {
59
- (!n.__d && (n.__d = !0) && ee.push(n) && !ke.__r++ || ot !== w.debounceRendering) && ((ot = w.debounceRendering) || Wt)(ke);
58
+ function je(n) {
59
+ (!n.__d && (n.__d = !0) && te.push(n) && !ke.__r++ || rt !== w.debounceRendering) && ((rt = w.debounceRendering) || qt)(ke);
60
60
  }
61
61
  function ke() {
62
62
  var n, e, t, i, s, o, r, a, u;
63
- for (ee.sort(qe); n = ee.shift(); )
64
- n.__d && (e = ee.length, i = void 0, s = void 0, o = void 0, a = (r = (t = n).__v).__e, (u = t.__P) && (i = [], s = [], (o = Y({}, r)).__v = r.__v + 1, Qe(u, r, o, t.__n, u.ownerSVGElement !== void 0, r.__h != null ? [a] : null, i, a == null ? ve(r) : a, r.__h, s), Jt(i, r, s), r.__e != a && Yt(r)), ee.length > e && ee.sort(qe));
63
+ for (te.sort(qe); n = te.shift(); )
64
+ n.__d && (e = te.length, i = void 0, s = void 0, o = void 0, a = (r = (t = n).__v).__e, (u = t.__P) && (i = [], s = [], (o = G({}, r)).__v = r.__v + 1, Ke(u, r, o, t.__n, u.ownerSVGElement !== void 0, r.__h != null ? [a] : null, i, a == null ? _e(r) : a, r.__h, s), Qt(i, r, s), r.__e != a && Zt(r)), te.length > e && te.sort(qe));
65
65
  ke.__r = 0;
66
66
  }
67
- function Xt(n, e, t, i, s, o, r, a, u, f, d) {
68
- var l, _, g, h, p, v, m, y, T, C = 0, S = i && i.__k || jt, A = S.length, D = A, R = e.length;
69
- for (t.__k = [], l = 0; l < R; l++)
70
- (h = t.__k[l] = (h = e[l]) == null || typeof h == "boolean" || typeof h == "function" ? null : typeof h == "string" || typeof h == "number" || typeof h == "bigint" ? Te(null, h, null, null, h) : Ae(h) ? Te(V, { children: h }, null, null, null) : h.__b > 0 ? Te(h.type, h.props, h.key, h.ref ? h.ref : null, h.__v) : h) != null ? (h.__ = t, h.__b = t.__b + 1, (y = Sn(h, S, m = l + C, D)) === -1 ? g = oe : (g = S[y] || oe, S[y] = void 0, D--), Qe(n, h, g, s, o, r, a, u, f, d), p = h.__e, (_ = h.ref) && g.ref != _ && (g.ref && et(g.ref, null, h), d.push(_, h.__c || p, h)), p != null && (v == null && (v = p), (T = g === oe || g.__v === null) ? y == -1 && C-- : y !== m && (y === m + 1 ? C++ : y > m ? D > R - m ? C += y - m : C-- : C = y < m && y == m - 1 ? y - m : 0), m = l + C, typeof h.type != "function" || y === m && g.__k !== h.__k ? typeof h.type == "function" || y === m && !T ? h.__d !== void 0 ? (u = h.__d, h.__d = void 0) : u = p.nextSibling : u = Gt(n, p, u) : u = Zt(h, u, n), typeof t.type == "function" && (t.__d = u))) : (g = S[l]) && g.key == null && g.__e && (g.__e == u && (g.__ = i, u = ve(g)), Xe(g, g, !1), S[l] = null);
71
- for (t.__e = v, l = A; l--; )
72
- S[l] != null && (typeof t.type == "function" && S[l].__e != null && S[l].__e == t.__d && (t.__d = S[l].__e.nextSibling), Xe(S[l], S[l]));
67
+ function Gt(n, e, t, i, s, o, r, a, u, h, p) {
68
+ var l, v, _, d, f, m, b, g, T, C = 0, S = i && i.__k || Yt, O = S.length, I = O, U = e.length;
69
+ for (t.__k = [], l = 0; l < U; l++)
70
+ (d = t.__k[l] = (d = e[l]) == null || typeof d == "boolean" || typeof d == "function" ? null : typeof d == "string" || typeof d == "number" || typeof d == "bigint" ? Te(null, d, null, null, d) : Ie(d) ? Te(Y, { children: d }, null, null, null) : d.__b > 0 ? Te(d.type, d.props, d.key, d.ref ? d.ref : null, d.__v) : d) != null ? (d.__ = t, d.__b = t.__b + 1, (g = Sn(d, S, b = l + C, I)) === -1 ? _ = re : (_ = S[g] || re, S[g] = void 0, I--), Ke(n, d, _, s, o, r, a, u, h, p), f = d.__e, (v = d.ref) && _.ref != v && (_.ref && Qe(_.ref, null, d), p.push(v, d.__c || f, d)), f != null && (m == null && (m = f), (T = _ === re || _.__v === null) ? g == -1 && C-- : g !== b && (g === b + 1 ? C++ : g > b ? I > U - b ? C += g - b : C-- : C = g < b && g == b - 1 ? g - b : 0), b = l + C, typeof d.type != "function" || g === b && _.__k !== d.__k ? typeof d.type == "function" || g === b && !T ? d.__d !== void 0 ? (u = d.__d, d.__d = void 0) : u = f.nextSibling : u = Kt(n, f, u) : u = Jt(d, u, n), typeof t.type == "function" && (t.__d = u))) : (_ = S[l]) && _.key == null && _.__e && (_.__e == u && (_.__ = i, u = _e(_)), Ye(_, _, !1), S[l] = null);
71
+ for (t.__e = m, l = O; l--; )
72
+ S[l] != null && (typeof t.type == "function" && S[l].__e != null && S[l].__e == t.__d && (t.__d = S[l].__e.nextSibling), Ye(S[l], S[l]));
73
73
  }
74
- function Zt(n, e, t) {
74
+ function Jt(n, e, t) {
75
75
  for (var i, s = n.__k, o = 0; s && o < s.length; o++)
76
- (i = s[o]) && (i.__ = n, e = typeof i.type == "function" ? Zt(i, e, t) : Gt(t, i.__e, e));
76
+ (i = s[o]) && (i.__ = n, e = typeof i.type == "function" ? Jt(i, e, t) : Kt(t, i.__e, e));
77
77
  return e;
78
78
  }
79
79
  function Ee(n, e) {
80
- return e = e || [], n == null || typeof n == "boolean" || (Ae(n) ? n.some(function(t) {
80
+ return e = e || [], n == null || typeof n == "boolean" || (Ie(n) ? n.some(function(t) {
81
81
  Ee(t, e);
82
82
  }) : e.push(n)), e;
83
83
  }
84
- function Gt(n, e, t) {
84
+ function Kt(n, e, t) {
85
85
  return t == null || t.parentNode !== n ? n.insertBefore(e, null) : e == t && e.parentNode != null || n.insertBefore(e, t), e.nextSibling;
86
86
  }
87
87
  function Sn(n, e, t, i) {
@@ -110,7 +110,7 @@ function kn(n, e, t, i, s) {
110
110
  for (o in e)
111
111
  s && typeof e[o] != "function" || o === "children" || o === "key" || o === "value" || o === "checked" || t[o] === e[o] || Ne(n, o, e[o], t[o], i);
112
112
  }
113
- function at(n, e, t) {
113
+ function ct(n, e, t) {
114
114
  e[0] === "-" ? n.setProperty(e, t == null ? "" : t) : n[e] = t == null ? "" : typeof t != "number" || xn.test(e) ? t : t + "px";
115
115
  }
116
116
  function Ne(n, e, t, i, s) {
@@ -122,13 +122,13 @@ function Ne(n, e, t, i, s) {
122
122
  else {
123
123
  if (typeof i == "string" && (n.style.cssText = i = ""), i)
124
124
  for (e in i)
125
- t && e in t || at(n.style, e, "");
125
+ t && e in t || ct(n.style, e, "");
126
126
  if (t)
127
127
  for (e in t)
128
- i && t[e] === i[e] || at(n.style, e, t[e]);
128
+ i && t[e] === i[e] || ct(n.style, e, t[e]);
129
129
  }
130
130
  else if (e[0] === "o" && e[1] === "n")
131
- o = e !== (e = e.replace(/(PointerCapture)$|Capture$/, "$1")), e = e.toLowerCase() in n ? e.toLowerCase().slice(2) : e.slice(2), n.l || (n.l = {}), n.l[e + o] = t, t ? i ? t.u = i.u : (t.u = Date.now(), n.addEventListener(e, o ? lt : ct, o)) : n.removeEventListener(e, o ? lt : ct, o);
131
+ o = e !== (e = e.replace(/(PointerCapture)$|Capture$/, "$1")), e = e.toLowerCase() in n ? e.toLowerCase().slice(2) : e.slice(2), n.l || (n.l = {}), n.l[e + o] = t, t ? i ? t.u = i.u : (t.u = Date.now(), n.addEventListener(e, o ? ut : lt, o)) : n.removeEventListener(e, o ? ut : lt, o);
132
132
  else if (e !== "dangerouslySetInnerHTML") {
133
133
  if (s)
134
134
  e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
@@ -141,7 +141,7 @@ function Ne(n, e, t, i, s) {
141
141
  typeof t == "function" || (t == null || t === !1 && e[4] !== "-" ? n.removeAttribute(e) : n.setAttribute(e, t));
142
142
  }
143
143
  }
144
- function ct(n) {
144
+ function lt(n) {
145
145
  var e = this.l[n.type + !1];
146
146
  if (n.t) {
147
147
  if (n.t <= e.u)
@@ -150,51 +150,51 @@ function ct(n) {
150
150
  n.t = Date.now();
151
151
  return e(w.event ? w.event(n) : n);
152
152
  }
153
- function lt(n) {
153
+ function ut(n) {
154
154
  return this.l[n.type + !0](w.event ? w.event(n) : n);
155
155
  }
156
- function Qe(n, e, t, i, s, o, r, a, u, f) {
157
- var d, l, _, g, h, p, v, m, y, T, C, S, A, D, R, z = e.type;
156
+ function Ke(n, e, t, i, s, o, r, a, u, h) {
157
+ var p, l, v, _, d, f, m, b, g, T, C, S, O, I, U, D = e.type;
158
158
  if (e.constructor !== void 0)
159
159
  return null;
160
- t.__h != null && (u = t.__h, a = e.__e = t.__e, e.__h = null, o = [a]), (d = w.__b) && d(e);
160
+ t.__h != null && (u = t.__h, a = e.__e = t.__e, e.__h = null, o = [a]), (p = w.__b) && p(e);
161
161
  e:
162
- if (typeof z == "function")
162
+ if (typeof D == "function")
163
163
  try {
164
- if (m = e.props, y = (d = z.contextType) && i[d.__c], T = d ? y ? y.props.value : d.__ : i, t.__c ? v = (l = e.__c = t.__c).__ = l.__E : ("prototype" in z && z.prototype.render ? e.__c = l = new z(m, T) : (e.__c = l = new L(m, T), l.constructor = z, l.render = Nn), y && y.sub(l), l.props = m, l.state || (l.state = {}), l.context = T, l.__n = i, _ = l.__d = !0, l.__h = [], l._sb = []), l.__s == null && (l.__s = l.state), z.getDerivedStateFromProps != null && (l.__s == l.state && (l.__s = Y({}, l.__s)), Y(l.__s, z.getDerivedStateFromProps(m, l.__s))), g = l.props, h = l.state, l.__v = e, _)
165
- z.getDerivedStateFromProps == null && l.componentWillMount != null && l.componentWillMount(), l.componentDidMount != null && l.__h.push(l.componentDidMount);
164
+ if (b = e.props, g = (p = D.contextType) && i[p.__c], T = p ? g ? g.props.value : p.__ : i, t.__c ? m = (l = e.__c = t.__c).__ = l.__E : ("prototype" in D && D.prototype.render ? e.__c = l = new D(b, T) : (e.__c = l = new F(b, T), l.constructor = D, l.render = Nn), g && g.sub(l), l.props = b, l.state || (l.state = {}), l.context = T, l.__n = i, v = l.__d = !0, l.__h = [], l._sb = []), l.__s == null && (l.__s = l.state), D.getDerivedStateFromProps != null && (l.__s == l.state && (l.__s = G({}, l.__s)), G(l.__s, D.getDerivedStateFromProps(b, l.__s))), _ = l.props, d = l.state, l.__v = e, v)
165
+ D.getDerivedStateFromProps == null && l.componentWillMount != null && l.componentWillMount(), l.componentDidMount != null && l.__h.push(l.componentDidMount);
166
166
  else {
167
- if (z.getDerivedStateFromProps == null && m !== g && l.componentWillReceiveProps != null && l.componentWillReceiveProps(m, T), !l.__e && (l.shouldComponentUpdate != null && l.shouldComponentUpdate(m, l.__s, T) === !1 || e.__v === t.__v)) {
168
- for (e.__v !== t.__v && (l.props = m, l.state = l.__s, l.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.forEach(function(te) {
169
- te && (te.__ = e);
167
+ if (D.getDerivedStateFromProps == null && b !== _ && l.componentWillReceiveProps != null && l.componentWillReceiveProps(b, T), !l.__e && (l.shouldComponentUpdate != null && l.shouldComponentUpdate(b, l.__s, T) === !1 || e.__v === t.__v)) {
168
+ for (e.__v !== t.__v && (l.props = b, l.state = l.__s, l.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.forEach(function(be) {
169
+ be && (be.__ = e);
170
170
  }), C = 0; C < l._sb.length; C++)
171
171
  l.__h.push(l._sb[C]);
172
172
  l._sb = [], l.__h.length && r.push(l);
173
173
  break e;
174
174
  }
175
- l.componentWillUpdate != null && l.componentWillUpdate(m, l.__s, T), l.componentDidUpdate != null && l.__h.push(function() {
176
- l.componentDidUpdate(g, h, p);
175
+ l.componentWillUpdate != null && l.componentWillUpdate(b, l.__s, T), l.componentDidUpdate != null && l.__h.push(function() {
176
+ l.componentDidUpdate(_, d, f);
177
177
  });
178
178
  }
179
- if (l.context = T, l.props = m, l.__P = n, l.__e = !1, S = w.__r, A = 0, "prototype" in z && z.prototype.render) {
180
- for (l.state = l.__s, l.__d = !1, S && S(e), d = l.render(l.props, l.state, l.context), D = 0; D < l._sb.length; D++)
181
- l.__h.push(l._sb[D]);
179
+ if (l.context = T, l.props = b, l.__P = n, l.__e = !1, S = w.__r, O = 0, "prototype" in D && D.prototype.render) {
180
+ for (l.state = l.__s, l.__d = !1, S && S(e), p = l.render(l.props, l.state, l.context), I = 0; I < l._sb.length; I++)
181
+ l.__h.push(l._sb[I]);
182
182
  l._sb = [];
183
183
  } else
184
184
  do
185
- l.__d = !1, S && S(e), d = l.render(l.props, l.state, l.context), l.state = l.__s;
186
- while (l.__d && ++A < 25);
187
- l.state = l.__s, l.getChildContext != null && (i = Y(Y({}, i), l.getChildContext())), _ || l.getSnapshotBeforeUpdate == null || (p = l.getSnapshotBeforeUpdate(g, h)), Xt(n, Ae(R = d != null && d.type === V && d.key == null ? d.props.children : d) ? R : [R], e, t, i, s, o, r, a, u, f), l.base = e.__e, e.__h = null, l.__h.length && r.push(l), v && (l.__E = l.__ = null);
188
- } catch (te) {
189
- e.__v = null, (u || o != null) && (e.__e = a, e.__h = !!u, o[o.indexOf(a)] = null), w.__e(te, e, t);
185
+ l.__d = !1, S && S(e), p = l.render(l.props, l.state, l.context), l.state = l.__s;
186
+ while (l.__d && ++O < 25);
187
+ l.state = l.__s, l.getChildContext != null && (i = G(G({}, i), l.getChildContext())), v || l.getSnapshotBeforeUpdate == null || (f = l.getSnapshotBeforeUpdate(_, d)), Gt(n, Ie(U = p != null && p.type === Y && p.key == null ? p.props.children : p) ? U : [U], e, t, i, s, o, r, a, u, h), l.base = e.__e, e.__h = null, l.__h.length && r.push(l), m && (l.__E = l.__ = null);
188
+ } catch (be) {
189
+ e.__v = null, (u || o != null) && (e.__e = a, e.__h = !!u, o[o.indexOf(a)] = null), w.__e(be, e, t);
190
190
  }
191
191
  else
192
- o == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e = En(t.__e, e, t, i, s, o, r, u, f);
193
- (d = w.diffed) && d(e);
192
+ o == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e = En(t.__e, e, t, i, s, o, r, u, h);
193
+ (p = w.diffed) && p(e);
194
194
  }
195
- function Jt(n, e, t) {
195
+ function Qt(n, e, t) {
196
196
  for (var i = 0; i < t.length; i++)
197
- et(t[i], t[++i], t[++i]);
197
+ Qe(t[i], t[++i], t[++i]);
198
198
  w.__c && w.__c(e, n), n.some(function(s) {
199
199
  try {
200
200
  n = s.__h, s.__h = [], n.some(function(o) {
@@ -206,47 +206,47 @@ function Jt(n, e, t) {
206
206
  });
207
207
  }
208
208
  function En(n, e, t, i, s, o, r, a, u) {
209
- var f, d, l, _ = t.props, g = e.props, h = e.type, p = 0;
210
- if (h === "svg" && (s = !0), o != null) {
211
- for (; p < o.length; p++)
212
- if ((f = o[p]) && "setAttribute" in f == !!h && (h ? f.localName === h : f.nodeType === 3)) {
213
- n = f, o[p] = null;
209
+ var h, p, l, v = t.props, _ = e.props, d = e.type, f = 0;
210
+ if (d === "svg" && (s = !0), o != null) {
211
+ for (; f < o.length; f++)
212
+ if ((h = o[f]) && "setAttribute" in h == !!d && (d ? h.localName === d : h.nodeType === 3)) {
213
+ n = h, o[f] = null;
214
214
  break;
215
215
  }
216
216
  }
217
217
  if (n == null) {
218
- if (h === null)
219
- return document.createTextNode(g);
220
- n = s ? document.createElementNS("http://www.w3.org/2000/svg", h) : document.createElement(h, g.is && g), o = null, a = !1;
218
+ if (d === null)
219
+ return document.createTextNode(_);
220
+ n = s ? document.createElementNS("http://www.w3.org/2000/svg", d) : document.createElement(d, _.is && _), o = null, a = !1;
221
221
  }
222
- if (h === null)
223
- _ === g || a && n.data === g || (n.data = g);
222
+ if (d === null)
223
+ v === _ || a && n.data === _ || (n.data = _);
224
224
  else {
225
- if (o = o && Ie.call(n.childNodes), d = (_ = t.props || oe).dangerouslySetInnerHTML, l = g.dangerouslySetInnerHTML, !a) {
225
+ if (o = o && Ae.call(n.childNodes), p = (v = t.props || re).dangerouslySetInnerHTML, l = _.dangerouslySetInnerHTML, !a) {
226
226
  if (o != null)
227
- for (_ = {}, p = 0; p < n.attributes.length; p++)
228
- _[n.attributes[p].name] = n.attributes[p].value;
229
- (l || d) && (l && (d && l.__html == d.__html || l.__html === n.innerHTML) || (n.innerHTML = l && l.__html || ""));
227
+ for (v = {}, f = 0; f < n.attributes.length; f++)
228
+ v[n.attributes[f].name] = n.attributes[f].value;
229
+ (l || p) && (l && (p && l.__html == p.__html || l.__html === n.innerHTML) || (n.innerHTML = l && l.__html || ""));
230
230
  }
231
- if (kn(n, g, _, s, a), l)
231
+ if (kn(n, _, v, s, a), l)
232
232
  e.__k = [];
233
- else if (Xt(n, Ae(p = e.props.children) ? p : [p], e, t, i, s && h !== "foreignObject", o, r, o ? o[0] : t.__k && ve(t, 0), a, u), o != null)
234
- for (p = o.length; p--; )
235
- o[p] != null && qt(o[p]);
236
- a || ("value" in g && (p = g.value) !== void 0 && (p !== n.value || h === "progress" && !p || h === "option" && p !== _.value) && Ne(n, "value", p, _.value, !1), "checked" in g && (p = g.checked) !== void 0 && p !== n.checked && Ne(n, "checked", p, _.checked, !1));
233
+ else if (Gt(n, Ie(f = e.props.children) ? f : [f], e, t, i, s && d !== "foreignObject", o, r, o ? o[0] : t.__k && _e(t, 0), a, u), o != null)
234
+ for (f = o.length; f--; )
235
+ o[f] != null && Xt(o[f]);
236
+ a || ("value" in _ && (f = _.value) !== void 0 && (f !== n.value || d === "progress" && !f || d === "option" && f !== v.value) && Ne(n, "value", f, v.value, !1), "checked" in _ && (f = _.checked) !== void 0 && f !== n.checked && Ne(n, "checked", f, v.checked, !1));
237
237
  }
238
238
  return n;
239
239
  }
240
- function et(n, e, t) {
240
+ function Qe(n, e, t) {
241
241
  try {
242
242
  typeof n == "function" ? n(e) : n.current = e;
243
243
  } catch (i) {
244
244
  w.__e(i, t);
245
245
  }
246
246
  }
247
- function Xe(n, e, t) {
247
+ function Ye(n, e, t) {
248
248
  var i, s;
249
- if (w.unmount && w.unmount(n), (i = n.ref) && (i.current && i.current !== n.__e || et(i, null, e)), (i = n.__c) != null) {
249
+ if (w.unmount && w.unmount(n), (i = n.ref) && (i.current && i.current !== n.__e || Qe(i, null, e)), (i = n.__c) != null) {
250
250
  if (i.componentWillUnmount)
251
251
  try {
252
252
  i.componentWillUnmount();
@@ -257,18 +257,18 @@ function Xe(n, e, t) {
257
257
  }
258
258
  if (i = n.__k)
259
259
  for (s = 0; s < i.length; s++)
260
- i[s] && Xe(i[s], e, t || typeof n.type != "function");
261
- t || n.__e == null || qt(n.__e), n.__ = n.__e = n.__d = void 0;
260
+ i[s] && Ye(i[s], e, t || typeof n.type != "function");
261
+ t || n.__e == null || Xt(n.__e), n.__ = n.__e = n.__d = void 0;
262
262
  }
263
263
  function Nn(n, e, t) {
264
264
  return this.constructor(n, t);
265
265
  }
266
- function se(n, e, t) {
266
+ function oe(n, e, t) {
267
267
  var i, s, o, r;
268
- w.__ && w.__(n, e), s = (i = typeof t == "function") ? null : t && t.__k || e.__k, o = [], r = [], Qe(e, n = (!i && t || e).__k = W(V, null, [n]), s || oe, oe, e.ownerSVGElement !== void 0, !i && t ? [t] : s ? null : e.firstChild ? Ie.call(e.childNodes) : null, o, !i && t ? t : s ? s.__e : e.firstChild, i, r), Jt(o, n, r);
268
+ w.__ && w.__(n, e), s = (i = typeof t == "function") ? null : t && t.__k || e.__k, o = [], r = [], Ke(e, n = (!i && t || e).__k = j(Y, null, [n]), s || re, re, e.ownerSVGElement !== void 0, !i && t ? [t] : s ? null : e.firstChild ? Ae.call(e.childNodes) : null, o, !i && t ? t : s ? s.__e : e.firstChild, i, r), Qt(o, n, r);
269
269
  }
270
- function $n(n, e) {
271
- var t = { __c: e = "__cC" + Vt++, __: n, Consumer: function(i, s) {
270
+ function Mn(n, e) {
271
+ var t = { __c: e = "__cC" + jt++, __: n, Consumer: function(i, s) {
272
272
  return i.children(s);
273
273
  }, Provider: function(i) {
274
274
  var s, o;
@@ -276,7 +276,7 @@ function $n(n, e) {
276
276
  return o;
277
277
  }, this.shouldComponentUpdate = function(r) {
278
278
  this.props.value !== r.value && s.some(function(a) {
279
- a.__e = !0, Ye(a);
279
+ a.__e = !0, je(a);
280
280
  });
281
281
  }, this.sub = function(r) {
282
282
  s.push(r);
@@ -288,7 +288,7 @@ function $n(n, e) {
288
288
  } };
289
289
  return t.Provider.__ = t.Consumer.contextType = t;
290
290
  }
291
- Ie = jt.slice, w = { __e: function(n, e, t, i) {
291
+ Ae = Yt.slice, w = { __e: function(n, e, t, i) {
292
292
  for (var s, o, r; e = e.__; )
293
293
  if ((s = e.__c) && !s.__)
294
294
  try {
@@ -298,22 +298,22 @@ Ie = jt.slice, w = { __e: function(n, e, t, i) {
298
298
  n = a;
299
299
  }
300
300
  throw n;
301
- } }, Ft = 0, Ut = function(n) {
301
+ } }, Wt = 0, Vt = function(n) {
302
302
  return n != null && n.constructor === void 0;
303
- }, L.prototype.setState = function(n, e) {
303
+ }, F.prototype.setState = function(n, e) {
304
304
  var t;
305
- t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = Y({}, this.state), typeof n == "function" && (n = n(Y({}, t), this.props)), n && Y(t, n), n != null && this.__v && (e && this._sb.push(e), Ye(this));
306
- }, L.prototype.forceUpdate = function(n) {
307
- this.__v && (this.__e = !0, n && this.__h.push(n), Ye(this));
308
- }, L.prototype.render = V, ee = [], Wt = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, qe = function(n, e) {
305
+ t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = G({}, this.state), typeof n == "function" && (n = n(G({}, t), this.props)), n && G(t, n), n != null && this.__v && (e && this._sb.push(e), je(this));
306
+ }, F.prototype.forceUpdate = function(n) {
307
+ this.__v && (this.__e = !0, n && this.__h.push(n), je(this));
308
+ }, F.prototype.render = Y, te = [], qt = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, qe = function(n, e) {
309
309
  return n.__v.__b - e.__v.__b;
310
- }, ke.__r = 0, Vt = 0;
311
- const Mn = "ibiz", In = "is-";
312
- function J(n, e, t, i, s) {
310
+ }, ke.__r = 0, jt = 0;
311
+ const $n = "ibiz", An = "is-";
312
+ function Q(n, e, t, i, s) {
313
313
  let o = "".concat(n, "-").concat(e);
314
314
  return t && (o += "-".concat(t)), i && (o += "__".concat(i)), s && (o += "--".concat(s)), o;
315
315
  }
316
- class $ {
316
+ class N {
317
317
  /**
318
318
  * Creates an instance of Namespace.
319
319
  *
@@ -331,7 +331,7 @@ class $ {
331
331
  * @type {string}
332
332
  */
333
333
  x(this, "namespace");
334
- this.block = e, this.namespace = t || Mn;
334
+ this.block = e, this.namespace = t || $n;
335
335
  }
336
336
  /**
337
337
  * namespace-block
@@ -343,7 +343,7 @@ class $ {
343
343
  * @return {*} {string}
344
344
  */
345
345
  b(e = "") {
346
- return J(this.namespace, this.block, e, "", "");
346
+ return Q(this.namespace, this.block, e, "", "");
347
347
  }
348
348
  /**
349
349
  * namespace-block__element
@@ -354,7 +354,7 @@ class $ {
354
354
  * @return {*} {string}
355
355
  */
356
356
  e(e) {
357
- return e ? J(this.namespace, this.block, "", e, "") : "";
357
+ return e ? Q(this.namespace, this.block, "", e, "") : "";
358
358
  }
359
359
  /**
360
360
  * namespace-block--modifier
@@ -365,7 +365,7 @@ class $ {
365
365
  * @return {*} {string}
366
366
  */
367
367
  m(e) {
368
- return e ? J(this.namespace, this.block, "", "", e) : "";
368
+ return e ? Q(this.namespace, this.block, "", "", e) : "";
369
369
  }
370
370
  /**
371
371
  * namespace-block-blockSuffix__element
@@ -377,7 +377,7 @@ class $ {
377
377
  * @return {*} {string}
378
378
  */
379
379
  be(e, t) {
380
- return e && t ? J(this.namespace, this.block, e, t, "") : "";
380
+ return e && t ? Q(this.namespace, this.block, e, t, "") : "";
381
381
  }
382
382
  /**
383
383
  * namespace-block__element--modifier
@@ -389,7 +389,7 @@ class $ {
389
389
  * @return {*} {string}
390
390
  */
391
391
  em(e, t) {
392
- return e && t ? J(this.namespace, this.block, "", e, t) : "";
392
+ return e && t ? Q(this.namespace, this.block, "", e, t) : "";
393
393
  }
394
394
  /**
395
395
  * namespace-block-blockSuffix--modifier
@@ -401,7 +401,7 @@ class $ {
401
401
  * @return {*} {string}
402
402
  */
403
403
  bm(e, t) {
404
- return e && t ? J(this.namespace, this.block, e, "", t) : "";
404
+ return e && t ? Q(this.namespace, this.block, e, "", t) : "";
405
405
  }
406
406
  /**
407
407
  * namespace-block-blockSuffix__element--modifier
@@ -414,7 +414,7 @@ class $ {
414
414
  * @return {*} {string}
415
415
  */
416
416
  bem(e, t, i) {
417
- return e && t && i ? J(this.namespace, this.block, e, t, i) : "";
417
+ return e && t && i ? Q(this.namespace, this.block, e, t, i) : "";
418
418
  }
419
419
  /**
420
420
  * 返回状态 class
@@ -429,7 +429,7 @@ class $ {
429
429
  * @return {*} {string}
430
430
  */
431
431
  is(e, t) {
432
- return e && t ? "".concat(In).concat(e) : "";
432
+ return e && t ? "".concat(An).concat(e) : "";
433
433
  }
434
434
  /**
435
435
  * 生成使用到的 css 变量 style 对象
@@ -482,11 +482,11 @@ class $ {
482
482
  return "--".concat(this.namespace, "-").concat(this.block, "-").concat(e);
483
483
  }
484
484
  }
485
- function F(n) {
485
+ function W(n) {
486
486
  if (typeof n != "string")
487
487
  throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
488
488
  }
489
- function ut(n, e) {
489
+ function dt(n, e) {
490
490
  for (var t = "", i = 0, s = -1, o = 0, r, a = 0; a <= n.length; ++a) {
491
491
  if (a < n.length)
492
492
  r = n.charCodeAt(a);
@@ -519,70 +519,70 @@ function ut(n, e) {
519
519
  }
520
520
  return t;
521
521
  }
522
- function An(n, e) {
522
+ function In(n, e) {
523
523
  var t = e.dir || e.root, i = e.base || (e.name || "") + (e.ext || "");
524
524
  return t ? t === e.root ? t + i : t + n + i : i;
525
525
  }
526
- var he = {
526
+ var fe = {
527
527
  // path.resolve([from ...], to)
528
528
  resolve: function() {
529
529
  for (var e = "", t = !1, i, s = arguments.length - 1; s >= -1 && !t; s--) {
530
530
  var o;
531
- s >= 0 ? o = arguments[s] : (i === void 0 && (i = process.cwd()), o = i), F(o), o.length !== 0 && (e = o + "/" + e, t = o.charCodeAt(0) === 47);
531
+ s >= 0 ? o = arguments[s] : (i === void 0 && (i = process.cwd()), o = i), W(o), o.length !== 0 && (e = o + "/" + e, t = o.charCodeAt(0) === 47);
532
532
  }
533
- return e = ut(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
533
+ return e = dt(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
534
534
  },
535
535
  normalize: function(e) {
536
- if (F(e), e.length === 0)
536
+ if (W(e), e.length === 0)
537
537
  return ".";
538
538
  var t = e.charCodeAt(0) === 47, i = e.charCodeAt(e.length - 1) === 47;
539
- return e = ut(e, !t), e.length === 0 && !t && (e = "."), e.length > 0 && i && (e += "/"), t ? "/" + e : e;
539
+ return e = dt(e, !t), e.length === 0 && !t && (e = "."), e.length > 0 && i && (e += "/"), t ? "/" + e : e;
540
540
  },
541
541
  isAbsolute: function(e) {
542
- return F(e), e.length > 0 && e.charCodeAt(0) === 47;
542
+ return W(e), e.length > 0 && e.charCodeAt(0) === 47;
543
543
  },
544
544
  join: function() {
545
545
  if (arguments.length === 0)
546
546
  return ".";
547
547
  for (var e, t = 0; t < arguments.length; ++t) {
548
548
  var i = arguments[t];
549
- F(i), i.length > 0 && (e === void 0 ? e = i : e += "/" + i);
549
+ W(i), i.length > 0 && (e === void 0 ? e = i : e += "/" + i);
550
550
  }
551
- return e === void 0 ? "." : he.normalize(e);
551
+ return e === void 0 ? "." : fe.normalize(e);
552
552
  },
553
553
  relative: function(e, t) {
554
- if (F(e), F(t), e === t || (e = he.resolve(e), t = he.resolve(t), e === t))
554
+ if (W(e), W(t), e === t || (e = fe.resolve(e), t = fe.resolve(t), e === t))
555
555
  return "";
556
556
  for (var i = 1; i < e.length && e.charCodeAt(i) === 47; ++i)
557
557
  ;
558
558
  for (var s = e.length, o = s - i, r = 1; r < t.length && t.charCodeAt(r) === 47; ++r)
559
559
  ;
560
- for (var a = t.length, u = a - r, f = o < u ? o : u, d = -1, l = 0; l <= f; ++l) {
561
- if (l === f) {
562
- if (u > f) {
560
+ for (var a = t.length, u = a - r, h = o < u ? o : u, p = -1, l = 0; l <= h; ++l) {
561
+ if (l === h) {
562
+ if (u > h) {
563
563
  if (t.charCodeAt(r + l) === 47)
564
564
  return t.slice(r + l + 1);
565
565
  if (l === 0)
566
566
  return t.slice(r + l);
567
567
  } else
568
- o > f && (e.charCodeAt(i + l) === 47 ? d = l : l === 0 && (d = 0));
568
+ o > h && (e.charCodeAt(i + l) === 47 ? p = l : l === 0 && (p = 0));
569
569
  break;
570
570
  }
571
- var _ = e.charCodeAt(i + l), g = t.charCodeAt(r + l);
572
- if (_ !== g)
571
+ var v = e.charCodeAt(i + l), _ = t.charCodeAt(r + l);
572
+ if (v !== _)
573
573
  break;
574
- _ === 47 && (d = l);
574
+ v === 47 && (p = l);
575
575
  }
576
- var h = "";
577
- for (l = i + d + 1; l <= s; ++l)
578
- (l === s || e.charCodeAt(l) === 47) && (h.length === 0 ? h += ".." : h += "/..");
579
- return h.length > 0 ? h + t.slice(r + d) : (r += d, t.charCodeAt(r) === 47 && ++r, t.slice(r));
576
+ var d = "";
577
+ for (l = i + p + 1; l <= s; ++l)
578
+ (l === s || e.charCodeAt(l) === 47) && (d.length === 0 ? d += ".." : d += "/..");
579
+ return d.length > 0 ? d + t.slice(r + p) : (r += p, t.charCodeAt(r) === 47 && ++r, t.slice(r));
580
580
  },
581
581
  _makeLong: function(e) {
582
582
  return e;
583
583
  },
584
584
  dirname: function(e) {
585
- if (F(e), e.length === 0)
585
+ if (W(e), e.length === 0)
586
586
  return ".";
587
587
  for (var t = e.charCodeAt(0), i = t === 47, s = -1, o = !0, r = e.length - 1; r >= 1; --r)
588
588
  if (t = e.charCodeAt(r), t === 47) {
@@ -597,21 +597,21 @@ var he = {
597
597
  basename: function(e, t) {
598
598
  if (t !== void 0 && typeof t != "string")
599
599
  throw new TypeError('"ext" argument must be a string');
600
- F(e);
600
+ W(e);
601
601
  var i = 0, s = -1, o = !0, r;
602
602
  if (t !== void 0 && t.length > 0 && t.length <= e.length) {
603
603
  if (t.length === e.length && t === e)
604
604
  return "";
605
605
  var a = t.length - 1, u = -1;
606
606
  for (r = e.length - 1; r >= 0; --r) {
607
- var f = e.charCodeAt(r);
608
- if (f === 47) {
607
+ var h = e.charCodeAt(r);
608
+ if (h === 47) {
609
609
  if (!o) {
610
610
  i = r + 1;
611
611
  break;
612
612
  }
613
613
  } else
614
- u === -1 && (o = !1, u = r + 1), a >= 0 && (f === t.charCodeAt(a) ? --a === -1 && (s = r) : (a = -1, s = u));
614
+ u === -1 && (o = !1, u = r + 1), a >= 0 && (h === t.charCodeAt(a) ? --a === -1 && (s = r) : (a = -1, s = u));
615
615
  }
616
616
  return i === s ? s = u : s === -1 && (s = e.length), e.slice(i, s);
617
617
  } else {
@@ -627,7 +627,7 @@ var he = {
627
627
  }
628
628
  },
629
629
  extname: function(e) {
630
- F(e);
630
+ W(e);
631
631
  for (var t = -1, i = 0, s = -1, o = !0, r = 0, a = e.length - 1; a >= 0; --a) {
632
632
  var u = e.charCodeAt(a);
633
633
  if (u === 47) {
@@ -646,24 +646,24 @@ var he = {
646
646
  format: function(e) {
647
647
  if (e === null || typeof e != "object")
648
648
  throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof e);
649
- return An("/", e);
649
+ return In("/", e);
650
650
  },
651
651
  parse: function(e) {
652
- F(e);
652
+ W(e);
653
653
  var t = { root: "", dir: "", base: "", ext: "", name: "" };
654
654
  if (e.length === 0)
655
655
  return t;
656
656
  var i = e.charCodeAt(0), s = i === 47, o;
657
657
  s ? (t.root = "/", o = 1) : o = 0;
658
- for (var r = -1, a = 0, u = -1, f = !0, d = e.length - 1, l = 0; d >= o; --d) {
659
- if (i = e.charCodeAt(d), i === 47) {
660
- if (!f) {
661
- a = d + 1;
658
+ for (var r = -1, a = 0, u = -1, h = !0, p = e.length - 1, l = 0; p >= o; --p) {
659
+ if (i = e.charCodeAt(p), i === 47) {
660
+ if (!h) {
661
+ a = p + 1;
662
662
  break;
663
663
  }
664
664
  continue;
665
665
  }
666
- u === -1 && (f = !1, u = d + 1), i === 46 ? r === -1 ? r = d : l !== 1 && (l = 1) : r !== -1 && (l = -1);
666
+ u === -1 && (h = !1, u = p + 1), i === 46 ? r === -1 ? r = p : l !== 1 && (l = 1) : r !== -1 && (l = -1);
667
667
  }
668
668
  return r === -1 || u === -1 || // We saw a non-dot character immediately before the dot
669
669
  l === 0 || // The (right-most) trimmed path component is exactly '..'
@@ -674,18 +674,18 @@ var he = {
674
674
  win32: null,
675
675
  posix: null
676
676
  };
677
- he.posix = he;
678
- function j() {
677
+ fe.posix = fe;
678
+ function Z() {
679
679
  return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
680
680
  }
681
- function Kt() {
682
- return "".concat(j() + j(), "-").concat(j(), "-").concat(j(), "-").concat(j(), "-").concat(j()).concat(j()).concat(j());
681
+ function et() {
682
+ return "".concat(Z() + Z(), "-").concat(Z(), "-").concat(Z(), "-").concat(Z(), "-").concat(Z()).concat(Z()).concat(Z());
683
683
  }
684
684
  const Dn = /<svg\b[^>]*>[\s\S]*?<\/svg>/;
685
685
  function tt(n) {
686
686
  return Dn.test(n);
687
687
  }
688
- class Qt {
688
+ class en {
689
689
  /**
690
690
  * 拷贝文本
691
691
  *
@@ -706,8 +706,8 @@ class Qt {
706
706
  * @private
707
707
  * @type {(HTMLInputElement | null)}
708
708
  */
709
- x(Qt, "inputElement", null);
710
- const b = class b {
709
+ x(en, "inputElement", null);
710
+ const y = class y {
711
711
  /**
712
712
  * 检查数据库是否存在
713
713
  *
@@ -730,7 +730,7 @@ const b = class b {
730
730
  */
731
731
  static async deleteDatabase(e) {
732
732
  var t, i;
733
- return b.lastLink && ((i = (t = b.lastLink).close) == null || i.call(t)), new Promise((s, o) => {
733
+ return y.lastLink && ((i = (t = y.lastLink).close) == null || i.call(t)), new Promise((s, o) => {
734
734
  const r = indexedDB.deleteDatabase(e);
735
735
  r.onsuccess = () => {
736
736
  s(!0);
@@ -750,13 +750,13 @@ const b = class b {
750
750
  * @memberof IndexedDBUtil
751
751
  */
752
752
  static async checkTableExists(e, t) {
753
- return await b.checkDataBaseExists(e) ? new Promise((s, o) => {
753
+ return await y.checkDataBaseExists(e) ? new Promise((s, o) => {
754
754
  const r = indexedDB.open(e);
755
755
  r.onupgradeneeded = (a) => {
756
- b.db = a.target.result, b.version = b.db.version;
756
+ y.db = a.target.result, y.version = y.db.version;
757
757
  }, r.onsuccess = (a) => {
758
- b.db = a.target.result, b.lastLink = r.result;
759
- const u = b.db.objectStoreNames.contains(t);
758
+ y.db = a.target.result, y.lastLink = r.result;
759
+ const u = y.db.objectStoreNames.contains(t);
760
760
  r.result.close(), s(u);
761
761
  }, r.onerror = (a) => {
762
762
  o(a.target.error);
@@ -775,15 +775,15 @@ const b = class b {
775
775
  static async createTable(e, t, i, s = !1) {
776
776
  return new Promise((o) => {
777
777
  var a, u;
778
- b.version += 1, b.lastLink && ((u = (a = b.lastLink).close) == null || u.call(a));
779
- const r = indexedDB.open(e, b.version);
780
- r.onupgradeneeded = (f) => {
781
- if (b.db = f.target.result, !b.db.objectStoreNames.contains(t)) {
782
- const d = {};
783
- i ? d.keyPath = i : s && (d.autoIncrement = !0), b.db.createObjectStore(t, d);
778
+ y.version += 1, y.lastLink && ((u = (a = y.lastLink).close) == null || u.call(a));
779
+ const r = indexedDB.open(e, y.version);
780
+ r.onupgradeneeded = (h) => {
781
+ if (y.db = h.target.result, !y.db.objectStoreNames.contains(t)) {
782
+ const p = {};
783
+ i ? p.keyPath = i : s && (p.autoIncrement = !0), y.db.createObjectStore(t, p);
784
784
  }
785
785
  }, r.onsuccess = () => {
786
- b.lastLink = r.result, r.result.close(), o(!0);
786
+ y.lastLink = r.result, r.result.close(), o(!0);
787
787
  }, r.onerror = () => {
788
788
  o(!1);
789
789
  };
@@ -799,12 +799,12 @@ const b = class b {
799
799
  static async deleteTable(e, t) {
800
800
  return new Promise((i) => {
801
801
  var o, r;
802
- b.version += 1, b.lastLink && ((r = (o = b.lastLink).close) == null || r.call(o));
803
- const s = indexedDB.open(e, b.version);
802
+ y.version += 1, y.lastLink && ((r = (o = y.lastLink).close) == null || r.call(o));
803
+ const s = indexedDB.open(e, y.version);
804
804
  s.onupgradeneeded = (a) => {
805
- b.db = a.target.result, b.lastLink = s.result, b.db.objectStoreNames.contains(t) && b.db.deleteObjectStore(t);
805
+ y.db = a.target.result, y.lastLink = s.result, y.db.objectStoreNames.contains(t) && y.db.deleteObjectStore(t);
806
806
  }, s.onsuccess = (a) => {
807
- b.db = a.target.result, b.lastLink = s.result, s.result.close(), i(!0);
807
+ y.db = a.target.result, y.lastLink = s.result, s.result.close(), i(!0);
808
808
  }, s.onerror = () => {
809
809
  s.result.close(), i(!1);
810
810
  };
@@ -822,11 +822,11 @@ const b = class b {
822
822
  return new Promise((s, o) => {
823
823
  const r = indexedDB.open(e);
824
824
  r.onsuccess = (a) => {
825
- if (b.db = a.target.result, b.lastLink = r.result, b.db.objectStoreNames.contains(t)) {
826
- const d = b.db.transaction([t], "readwrite").objectStore(t).add(i);
827
- d.onsuccess = (l) => {
825
+ if (y.db = a.target.result, y.lastLink = r.result, y.db.objectStoreNames.contains(t)) {
826
+ const p = y.db.transaction([t], "readwrite").objectStore(t).add(i);
827
+ p.onsuccess = (l) => {
828
828
  s(i);
829
- }, d.onerror = () => {
829
+ }, p.onerror = () => {
830
830
  s(null);
831
831
  };
832
832
  }
@@ -848,11 +848,11 @@ const b = class b {
848
848
  return new Promise((s, o) => {
849
849
  const r = indexedDB.open(e);
850
850
  r.onsuccess = (a) => {
851
- if (b.db = a.target.result, b.lastLink = r.result, b.db.objectStoreNames.contains(t)) {
852
- const d = b.db.transaction([t], "readwrite").objectStore(t).delete(i);
853
- d.onsuccess = (l) => {
851
+ if (y.db = a.target.result, y.lastLink = r.result, y.db.objectStoreNames.contains(t)) {
852
+ const p = y.db.transaction([t], "readwrite").objectStore(t).delete(i);
853
+ p.onsuccess = (l) => {
854
854
  s(!0);
855
- }, d.onerror = () => {
855
+ }, p.onerror = () => {
856
856
  s(!1);
857
857
  };
858
858
  }
@@ -874,11 +874,11 @@ const b = class b {
874
874
  return new Promise((s, o) => {
875
875
  const r = indexedDB.open(e);
876
876
  r.onsuccess = (a) => {
877
- if (b.db = a.target.result, b.lastLink = r.result, b.db.objectStoreNames.contains(t)) {
878
- const d = b.db.transaction([t], "readwrite").objectStore(t).put(i);
879
- d.onsuccess = (l) => {
877
+ if (y.db = a.target.result, y.lastLink = r.result, y.db.objectStoreNames.contains(t)) {
878
+ const p = y.db.transaction([t], "readwrite").objectStore(t).put(i);
879
+ p.onsuccess = (l) => {
880
880
  s(i);
881
- }, d.onerror = () => {
881
+ }, p.onerror = () => {
882
882
  s(i);
883
883
  };
884
884
  }
@@ -900,11 +900,11 @@ const b = class b {
900
900
  return new Promise((s, o) => {
901
901
  const r = indexedDB.open(e);
902
902
  r.onsuccess = (a) => {
903
- if (b.db = a.target.result, b.lastLink = r.result, b.db.objectStoreNames.contains(t)) {
904
- const d = b.db.transaction([t], "readonly").objectStore(t).get(i);
905
- d.onsuccess = (l) => {
906
- s(d.result);
907
- }, d.onerror = () => {
903
+ if (y.db = a.target.result, y.lastLink = r.result, y.db.objectStoreNames.contains(t)) {
904
+ const p = y.db.transaction([t], "readonly").objectStore(t).get(i);
905
+ p.onsuccess = (l) => {
906
+ s(p.result);
907
+ }, p.onerror = () => {
908
908
  o(new Error("未找到数据".concat(i)));
909
909
  };
910
910
  }
@@ -925,11 +925,11 @@ const b = class b {
925
925
  return new Promise((i, s) => {
926
926
  const o = indexedDB.open(e);
927
927
  o.onsuccess = (r) => {
928
- if (b.db = r.target.result, b.lastLink = o.result, b.db.objectStoreNames.contains(t)) {
929
- const f = b.db.transaction([t], "readonly").objectStore(t).getAll();
930
- f.onsuccess = (d) => {
931
- i(f.result);
932
- }, f.onerror = () => {
928
+ if (y.db = r.target.result, y.lastLink = o.result, y.db.objectStoreNames.contains(t)) {
929
+ const h = y.db.transaction([t], "readonly").objectStore(t).getAll();
930
+ h.onsuccess = (p) => {
931
+ i(h.result);
932
+ }, h.onerror = () => {
933
933
  i([]);
934
934
  };
935
935
  }
@@ -941,11 +941,11 @@ const b = class b {
941
941
  }
942
942
  };
943
943
  // 数据库版本
944
- x(b, "version", 1), // 数据库连接句柄
945
- x(b, "db", null), // 上一个连接
946
- x(b, "lastLink");
947
- let Z = b;
948
- class zn {
944
+ x(y, "version", 1), // 数据库连接句柄
945
+ x(y, "db", null), // 上一个连接
946
+ x(y, "lastLink");
947
+ let q = y;
948
+ class Ln {
949
949
  /**
950
950
  * Creates an instance of FileUploader.
951
951
  * @author tony001
@@ -990,11 +990,11 @@ class zn {
990
990
  async processFile(e) {
991
991
  var t, i, s, o, r, a;
992
992
  try {
993
- const u = (d) => {
994
- var l, _;
995
- (_ = (l = this.options).onProgress) == null || _.call(l, e, d);
996
- }, f = await this.options.onUpload(e, u);
997
- (i = (t = this.options).onProgress) == null || i.call(t, e, 100), (o = (s = this.options).onSuccess) == null || o.call(s, f, e);
993
+ const u = (p) => {
994
+ var l, v;
995
+ (v = (l = this.options).onProgress) == null || v.call(l, e, p);
996
+ }, h = await this.options.onUpload(e, u);
997
+ (i = (t = this.options).onProgress) == null || i.call(t, e, 100), (o = (s = this.options).onSuccess) == null || o.call(s, h, e);
998
998
  } catch (u) {
999
999
  (a = (r = this.options).onError) == null || a.call(r, u instanceof Error ? u : new Error("上传失败"), e);
1000
1000
  }
@@ -1009,7 +1009,7 @@ class zn {
1009
1009
  return "".concat((e / 1024 ** i).toFixed(2), " ").concat(t[i]);
1010
1010
  }
1011
1011
  }
1012
- class en {
1012
+ class tn {
1013
1013
  /**
1014
1014
  * 从XML元素中提取CDATA内容
1015
1015
  *
@@ -1040,15 +1040,15 @@ class en {
1040
1040
  return Array.from(i.querySelectorAll("resource")).map((o) => {
1041
1041
  const r = o.getAttribute("type") || "", a = o.querySelector("data"), u = o.querySelector("metadata");
1042
1042
  try {
1043
- const f = this.getCdataContent(a), d = this.getCdataContent(u), l = f ? JSON.parse(f) : {}, _ = d ? JSON.parse(d) : {};
1043
+ const h = this.getCdataContent(a), p = this.getCdataContent(u), l = h ? JSON.parse(h) : {}, v = p ? JSON.parse(p) : {};
1044
1044
  return {
1045
1045
  id: l.id,
1046
1046
  type: r,
1047
1047
  data: l,
1048
- metadata: _
1048
+ metadata: v
1049
1049
  };
1050
- } catch (f) {
1051
- throw new Error("XML 解析错误: ".concat(f.message));
1050
+ } catch (h) {
1051
+ throw new Error("XML 解析错误: ".concat(h.message));
1052
1052
  }
1053
1053
  });
1054
1054
  }
@@ -1107,128 +1107,235 @@ class en {
1107
1107
  i.appendChild(t.createTextNode(s(o)));
1108
1108
  const a = t.createElement("resource");
1109
1109
  a.setAttribute("type", r.type), a.setAttribute("version", "1.0");
1110
- const u = (f, d) => {
1111
- const l = t.createElement(f);
1110
+ const u = (h, p) => {
1111
+ const l = t.createElement(h);
1112
1112
  l.appendChild(t.createTextNode(s(o + 1)));
1113
- const _ = t.createCDATASection(JSON.stringify(d));
1114
- return l.appendChild(_), l.appendChild(t.createTextNode(s(o))), l;
1113
+ const v = t.createCDATASection(JSON.stringify(p));
1114
+ return l.appendChild(v), l.appendChild(t.createTextNode(s(o))), l;
1115
1115
  };
1116
1116
  a.appendChild(t.createTextNode(s(o + 1))), a.appendChild(u("data", r.data)), a.appendChild(t.createTextNode(s(o + 1))), a.appendChild(u("metadata", r.metadata)), a.appendChild(t.createTextNode(s(o))), i.appendChild(a);
1117
1117
  }), i.appendChild(t.createTextNode("\n")), t.appendChild(i), new XMLSerializer().serializeToString(t).replace(/></g, ">\n<");
1118
1118
  }
1119
1119
  }
1120
- function Ze(n) {
1120
+ class zn {
1121
+ /**
1122
+ * 从XML元素中提取CDATA内容
1123
+ *
1124
+ * @author tony001
1125
+ * @date 2025-03-03 15:03:43
1126
+ * @private
1127
+ * @static
1128
+ * @param {(Element | null)} element
1129
+ * @return {*} {(string | null)}
1130
+ */
1131
+ static getCdataContent(e) {
1132
+ if (!e)
1133
+ return null;
1134
+ const t = Array.from(e.childNodes).find((i) => i.nodeType === i.CDATA_SECTION_NODE);
1135
+ return (t == null ? void 0 : t.nodeValue) || e.textContent;
1136
+ }
1137
+ /**
1138
+ * XML 字符串转数据对象
1139
+ *
1140
+ * @author tony001
1141
+ * @date 2025-03-03 11:03:17
1142
+ * @static
1143
+ * @param {string} xmlString
1144
+ * @return {*} {IChatSuggestion[]}
1145
+ */
1146
+ static parse(e) {
1147
+ const i = new DOMParser().parseFromString(e, "text/xml");
1148
+ return Array.from(i.querySelectorAll("suggestion")).map((o) => {
1149
+ const r = o.getAttribute("type") || "", a = o.querySelector("data"), u = o.querySelector("metadata");
1150
+ try {
1151
+ const h = this.getCdataContent(a), p = this.getCdataContent(u), l = h ? JSON.parse(h) : {}, v = p ? JSON.parse(p) : {};
1152
+ return {
1153
+ type: r,
1154
+ data: l,
1155
+ metadata: v
1156
+ };
1157
+ } catch (h) {
1158
+ throw new Error("XML 解析错误: ".concat(h.message));
1159
+ }
1160
+ });
1161
+ }
1162
+ /**
1163
+ * 混合内容解析
1164
+ *
1165
+ * @author tony001
1166
+ * @date 2025-03-03 13:03:35
1167
+ * @static
1168
+ * @param {string} input 包含 XML 和其他文本的混合字符串
1169
+ * @return {*} {{
1170
+ * suggestions: IChatSuggestion[];
1171
+ * remainingText: string;
1172
+ * hasSuggestions: boolean;
1173
+ * error?: string;
1174
+ * }}
1175
+ */
1176
+ static parseMixedContent(e) {
1177
+ const i = /<suggestions\b[^>]*>[\s\S]*?<\/suggestions>/i.exec(e);
1178
+ if (!i)
1179
+ return {
1180
+ suggestions: [],
1181
+ remainingText: e,
1182
+ hasSuggestions: !1
1183
+ };
1184
+ const [s] = i, o = i.index, r = o + s.length, a = (e.slice(0, o) + e.slice(r)).replace(/\n/g, "");
1185
+ try {
1186
+ return {
1187
+ suggestions: this.parse(s),
1188
+ remainingText: a,
1189
+ hasSuggestions: !0
1190
+ };
1191
+ } catch (u) {
1192
+ return {
1193
+ suggestions: [],
1194
+ remainingText: a,
1195
+ hasSuggestions: !0,
1196
+ error: "资源解析失败: ".concat(u.message)
1197
+ };
1198
+ }
1199
+ }
1200
+ /**
1201
+ * 数据对象转 XML 字符串
1202
+ *
1203
+ * @author tony001
1204
+ * @date 2025-03-03 11:03:51
1205
+ * @static
1206
+ * @param {IChatSuggestion[]} suggestions
1207
+ * @return {*} {string}
1208
+ */
1209
+ static stringify(e) {
1210
+ const t = document.implementation.createDocument(null, null, null), i = t.createElement("suggestions");
1211
+ i.setAttribute("version", "1.0");
1212
+ const s = (r) => "\n".concat(" ".repeat(r)), o = 1;
1213
+ return e.forEach((r) => {
1214
+ i.appendChild(t.createTextNode(s(o)));
1215
+ const a = t.createElement("suggestion");
1216
+ a.setAttribute("type", r.type), a.setAttribute("version", "1.0");
1217
+ const u = (h, p) => {
1218
+ const l = t.createElement(h);
1219
+ l.appendChild(t.createTextNode(s(o + 1)));
1220
+ const v = t.createCDATASection(JSON.stringify(p));
1221
+ return l.appendChild(v), l.appendChild(t.createTextNode(s(o))), l;
1222
+ };
1223
+ a.appendChild(t.createTextNode(s(o + 1))), a.appendChild(u("data", r.data)), a.appendChild(t.createTextNode(s(o + 1))), a.appendChild(u("metadata", r.metadata)), a.appendChild(t.createTextNode(s(o))), i.appendChild(a);
1224
+ }), i.appendChild(t.createTextNode("\n")), t.appendChild(i), new XMLSerializer().serializeToString(t).replace(/></g, ">\n<");
1225
+ }
1226
+ }
1227
+ function Xe(n) {
1121
1228
  return n.x >= 0 && n.x <= 1 && n.y >= 0 && n.y <= 1;
1122
1229
  }
1123
- function tn(n, e, t, i) {
1230
+ function nn(n, e, t, i) {
1124
1231
  const s = n / window.innerWidth, o = e / window.innerHeight, r = Math.max(0, Math.min(s, 1 - t)), a = Math.max(0, Math.min(o, 1 - i));
1125
1232
  return {
1126
1233
  x: r,
1127
1234
  y: a
1128
1235
  };
1129
1236
  }
1130
- var ae, k, Be, dt, _e = 0, nn = [], xe = [], ht = w.__b, ft = w.__r, pt = w.diffed, vt = w.__c, _t = w.unmount;
1237
+ var ce, k, Oe, ht, ge = 0, sn = [], xe = [], pt = w.__b, ft = w.__r, vt = w.diffed, mt = w.__c, _t = w.unmount;
1131
1238
  function De(n, e) {
1132
- w.__h && w.__h(k, n, _e || e), _e = 0;
1239
+ w.__h && w.__h(k, n, ge || e), ge = 0;
1133
1240
  var t = k.__H || (k.__H = { __: [], __h: [] });
1134
1241
  return n >= t.__.length && t.__.push({ __V: xe }), t.__[n];
1135
1242
  }
1136
- function me(n) {
1137
- return _e = 1, Hn(rn, n);
1243
+ function ne(n) {
1244
+ return ge = 1, Hn(an, n);
1138
1245
  }
1139
1246
  function Hn(n, e, t) {
1140
- var i = De(ae++, 2);
1141
- if (i.t = n, !i.__c && (i.__ = [t ? t(e) : rn(void 0, e), function(a) {
1142
- var u = i.__N ? i.__N[0] : i.__[0], f = i.t(u, a);
1143
- u !== f && (i.__N = [f, i.__[1]], i.__c.setState({}));
1247
+ var i = De(ce++, 2);
1248
+ if (i.t = n, !i.__c && (i.__ = [t ? t(e) : an(void 0, e), function(a) {
1249
+ var u = i.__N ? i.__N[0] : i.__[0], h = i.t(u, a);
1250
+ u !== h && (i.__N = [h, i.__[1]], i.__c.setState({}));
1144
1251
  }], i.__c = k, !k.u)) {
1145
- var s = function(a, u, f) {
1252
+ var s = function(a, u, h) {
1146
1253
  if (!i.__c.__H)
1147
1254
  return !0;
1148
- var d = i.__c.__H.__.filter(function(_) {
1149
- return _.__c;
1255
+ var p = i.__c.__H.__.filter(function(v) {
1256
+ return v.__c;
1150
1257
  });
1151
- if (d.every(function(_) {
1152
- return !_.__N;
1258
+ if (p.every(function(v) {
1259
+ return !v.__N;
1153
1260
  }))
1154
- return !o || o.call(this, a, u, f);
1261
+ return !o || o.call(this, a, u, h);
1155
1262
  var l = !1;
1156
- return d.forEach(function(_) {
1157
- if (_.__N) {
1158
- var g = _.__[0];
1159
- _.__ = _.__N, _.__N = void 0, g !== _.__[0] && (l = !0);
1263
+ return p.forEach(function(v) {
1264
+ if (v.__N) {
1265
+ var _ = v.__[0];
1266
+ v.__ = v.__N, v.__N = void 0, _ !== v.__[0] && (l = !0);
1160
1267
  }
1161
- }), !(!l && i.__c.props === a) && (!o || o.call(this, a, u, f));
1268
+ }), !(!l && i.__c.props === a) && (!o || o.call(this, a, u, h));
1162
1269
  };
1163
1270
  k.u = !0;
1164
1271
  var o = k.shouldComponentUpdate, r = k.componentWillUpdate;
1165
- k.componentWillUpdate = function(a, u, f) {
1272
+ k.componentWillUpdate = function(a, u, h) {
1166
1273
  if (this.__e) {
1167
- var d = o;
1168
- o = void 0, s(a, u, f), o = d;
1274
+ var p = o;
1275
+ o = void 0, s(a, u, h), o = p;
1169
1276
  }
1170
- r && r.call(this, a, u, f);
1277
+ r && r.call(this, a, u, h);
1171
1278
  }, k.shouldComponentUpdate = s;
1172
1279
  }
1173
1280
  return i.__N || i.__;
1174
1281
  }
1175
- function O(n, e) {
1176
- var t = De(ae++, 3);
1177
- !w.__s && on(t.__H, e) && (t.__ = n, t.i = e, k.__H.__h.push(t));
1282
+ function H(n, e) {
1283
+ var t = De(ce++, 3);
1284
+ !w.__s && rn(t.__H, e) && (t.__ = n, t.i = e, k.__H.__h.push(t));
1178
1285
  }
1179
- function B(n) {
1180
- return _e = 5, P(function() {
1286
+ function P(n) {
1287
+ return ge = 5, X(function() {
1181
1288
  return { current: n };
1182
1289
  }, []);
1183
1290
  }
1184
- function P(n, e) {
1185
- var t = De(ae++, 7);
1186
- return on(t.__H, e) ? (t.__V = n(), t.i = e, t.__h = n, t.__V) : t.__;
1291
+ function X(n, e) {
1292
+ var t = De(ce++, 7);
1293
+ return rn(t.__H, e) ? (t.__V = n(), t.i = e, t.__h = n, t.__V) : t.__;
1187
1294
  }
1188
- function Pe(n, e) {
1189
- return _e = 8, P(function() {
1295
+ function Be(n, e) {
1296
+ return ge = 8, X(function() {
1190
1297
  return n;
1191
1298
  }, e);
1192
1299
  }
1193
- function sn(n) {
1194
- var e = k.context[n.__c], t = De(ae++, 9);
1300
+ function on(n) {
1301
+ var e = k.context[n.__c], t = De(ce++, 9);
1195
1302
  return t.c = n, e ? (t.__ == null && (t.__ = !0, e.sub(k)), e.props.value) : n.__;
1196
1303
  }
1197
- function Ln() {
1198
- for (var n; n = nn.shift(); )
1304
+ function On() {
1305
+ for (var n; n = sn.shift(); )
1199
1306
  if (n.__P && n.__H)
1200
1307
  try {
1201
- n.__H.__h.forEach(Se), n.__H.__h.forEach(Ge), n.__H.__h = [];
1308
+ n.__H.__h.forEach(Se), n.__H.__h.forEach(Ze), n.__H.__h = [];
1202
1309
  } catch (e) {
1203
1310
  n.__H.__h = [], w.__e(e, n.__v);
1204
1311
  }
1205
1312
  }
1206
1313
  w.__b = function(n) {
1207
- k = null, ht && ht(n);
1314
+ k = null, pt && pt(n);
1208
1315
  }, w.__r = function(n) {
1209
- ft && ft(n), ae = 0;
1316
+ ft && ft(n), ce = 0;
1210
1317
  var e = (k = n.__c).__H;
1211
- e && (Be === k ? (e.__h = [], k.__h = [], e.__.forEach(function(t) {
1318
+ e && (Oe === k ? (e.__h = [], k.__h = [], e.__.forEach(function(t) {
1212
1319
  t.__N && (t.__ = t.__N), t.__V = xe, t.__N = t.i = void 0;
1213
- })) : (e.__h.forEach(Se), e.__h.forEach(Ge), e.__h = [], ae = 0)), Be = k;
1320
+ })) : (e.__h.forEach(Se), e.__h.forEach(Ze), e.__h = [], ce = 0)), Oe = k;
1214
1321
  }, w.diffed = function(n) {
1215
- pt && pt(n);
1322
+ vt && vt(n);
1216
1323
  var e = n.__c;
1217
- e && e.__H && (e.__H.__h.length && (nn.push(e) !== 1 && dt === w.requestAnimationFrame || ((dt = w.requestAnimationFrame) || On)(Ln)), e.__H.__.forEach(function(t) {
1324
+ e && e.__H && (e.__H.__h.length && (sn.push(e) !== 1 && ht === w.requestAnimationFrame || ((ht = w.requestAnimationFrame) || Bn)(On)), e.__H.__.forEach(function(t) {
1218
1325
  t.i && (t.__H = t.i), t.__V !== xe && (t.__ = t.__V), t.i = void 0, t.__V = xe;
1219
- })), Be = k = null;
1326
+ })), Oe = k = null;
1220
1327
  }, w.__c = function(n, e) {
1221
1328
  e.some(function(t) {
1222
1329
  try {
1223
1330
  t.__h.forEach(Se), t.__h = t.__h.filter(function(i) {
1224
- return !i.__ || Ge(i);
1331
+ return !i.__ || Ze(i);
1225
1332
  });
1226
1333
  } catch (i) {
1227
1334
  e.some(function(s) {
1228
1335
  s.__h && (s.__h = []);
1229
1336
  }), e = [], w.__e(i, t.__v);
1230
1337
  }
1231
- }), vt && vt(n, e);
1338
+ }), mt && mt(n, e);
1232
1339
  }, w.unmount = function(n) {
1233
1340
  _t && _t(n);
1234
1341
  var e, t = n.__c;
@@ -1240,42 +1347,42 @@ w.__b = function(n) {
1240
1347
  }
1241
1348
  }), t.__H = void 0, e && w.__e(e, t.__v));
1242
1349
  };
1243
- var mt = typeof requestAnimationFrame == "function";
1244
- function On(n) {
1350
+ var gt = typeof requestAnimationFrame == "function";
1351
+ function Bn(n) {
1245
1352
  var e, t = function() {
1246
- clearTimeout(i), mt && cancelAnimationFrame(e), setTimeout(n);
1353
+ clearTimeout(i), gt && cancelAnimationFrame(e), setTimeout(n);
1247
1354
  }, i = setTimeout(t, 100);
1248
- mt && (e = requestAnimationFrame(t));
1355
+ gt && (e = requestAnimationFrame(t));
1249
1356
  }
1250
1357
  function Se(n) {
1251
1358
  var e = k, t = n.__c;
1252
1359
  typeof t == "function" && (n.__c = void 0, t()), k = e;
1253
1360
  }
1254
- function Ge(n) {
1361
+ function Ze(n) {
1255
1362
  var e = k;
1256
1363
  n.__c = n.__(), k = e;
1257
1364
  }
1258
- function on(n, e) {
1365
+ function rn(n, e) {
1259
1366
  return !n || n.length !== e.length || e.some(function(t, i) {
1260
1367
  return t !== n[i];
1261
1368
  });
1262
1369
  }
1263
- function rn(n, e) {
1370
+ function an(n, e) {
1264
1371
  return typeof e == "function" ? e(n) : e;
1265
1372
  }
1266
- function ze() {
1373
+ function Le() {
1267
1374
  throw new Error("Cycle detected");
1268
1375
  }
1269
- var Bn = Symbol.for("preact-signals");
1376
+ var Pn = Symbol.for("preact-signals");
1270
1377
  function nt() {
1271
- if (re > 1)
1272
- re--;
1378
+ if (ae > 1)
1379
+ ae--;
1273
1380
  else {
1274
- for (var n, e = !1; fe !== void 0; ) {
1275
- var t = fe;
1276
- for (fe = void 0, Je++; t !== void 0; ) {
1381
+ for (var n, e = !1; ve !== void 0; ) {
1382
+ var t = ve;
1383
+ for (ve = void 0, Ge++; t !== void 0; ) {
1277
1384
  var i = t.o;
1278
- if (t.o = void 0, t.f &= -3, !(8 & t.f) && cn(t))
1385
+ if (t.o = void 0, t.f &= -3, !(8 & t.f) && ln(t))
1279
1386
  try {
1280
1387
  t.c();
1281
1388
  } catch (s) {
@@ -1284,12 +1391,12 @@ function nt() {
1284
1391
  t = i;
1285
1392
  }
1286
1393
  }
1287
- if (Je = 0, re--, e)
1394
+ if (Ge = 0, ae--, e)
1288
1395
  throw n;
1289
1396
  }
1290
1397
  }
1291
- var E = void 0, fe = void 0, re = 0, Je = 0, $e = 0;
1292
- function an(n) {
1398
+ var E = void 0, ve = void 0, ae = 0, Ge = 0, Me = 0;
1399
+ function cn(n) {
1293
1400
  if (E !== void 0) {
1294
1401
  var e = n.n;
1295
1402
  if (e === void 0 || e.t !== E)
@@ -1298,25 +1405,25 @@ function an(n) {
1298
1405
  return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = E.s, e.n = void 0, E.s.n = e, E.s = e), e;
1299
1406
  }
1300
1407
  }
1301
- function I(n) {
1408
+ function A(n) {
1302
1409
  this.v = n, this.i = 0, this.n = void 0, this.t = void 0;
1303
1410
  }
1304
- I.prototype.brand = Bn;
1305
- I.prototype.h = function() {
1411
+ A.prototype.brand = Pn;
1412
+ A.prototype.h = function() {
1306
1413
  return !0;
1307
1414
  };
1308
- I.prototype.S = function(n) {
1415
+ A.prototype.S = function(n) {
1309
1416
  this.t !== n && n.e === void 0 && (n.x = this.t, this.t !== void 0 && (this.t.e = n), this.t = n);
1310
1417
  };
1311
- I.prototype.U = function(n) {
1418
+ A.prototype.U = function(n) {
1312
1419
  if (this.t !== void 0) {
1313
1420
  var e = n.e, t = n.x;
1314
1421
  e !== void 0 && (e.x = t, n.e = void 0), t !== void 0 && (t.e = e, n.x = void 0), n === this.t && (this.t = t);
1315
1422
  }
1316
1423
  };
1317
- I.prototype.subscribe = function(n) {
1424
+ A.prototype.subscribe = function(n) {
1318
1425
  var e = this;
1319
- return He(function() {
1426
+ return st(function() {
1320
1427
  var t = e.value, i = 32 & this.f;
1321
1428
  this.f &= -33;
1322
1429
  try {
@@ -1326,26 +1433,26 @@ I.prototype.subscribe = function(n) {
1326
1433
  }
1327
1434
  });
1328
1435
  };
1329
- I.prototype.valueOf = function() {
1436
+ A.prototype.valueOf = function() {
1330
1437
  return this.value;
1331
1438
  };
1332
- I.prototype.toString = function() {
1439
+ A.prototype.toString = function() {
1333
1440
  return this.value + "";
1334
1441
  };
1335
- I.prototype.toJSON = function() {
1442
+ A.prototype.toJSON = function() {
1336
1443
  return this.value;
1337
1444
  };
1338
- I.prototype.peek = function() {
1445
+ A.prototype.peek = function() {
1339
1446
  return this.v;
1340
1447
  };
1341
- Object.defineProperty(I.prototype, "value", { get: function() {
1342
- var n = an(this);
1448
+ Object.defineProperty(A.prototype, "value", { get: function() {
1449
+ var n = cn(this);
1343
1450
  return n !== void 0 && (n.i = this.i), this.v;
1344
1451
  }, set: function(n) {
1345
- if (E instanceof G && function() {
1452
+ if (E instanceof K && function() {
1346
1453
  throw new Error("Computed cannot have side-effects");
1347
1454
  }(), n !== this.v) {
1348
- Je > 100 && ze(), this.v = n, this.i++, $e++, re++;
1455
+ Ge > 100 && Le(), this.v = n, this.i++, Me++, ae++;
1349
1456
  try {
1350
1457
  for (var e = this.t; e !== void 0; e = e.x)
1351
1458
  e.t.N();
@@ -1354,16 +1461,16 @@ Object.defineProperty(I.prototype, "value", { get: function() {
1354
1461
  }
1355
1462
  }
1356
1463
  } });
1357
- function X(n) {
1358
- return new I(n);
1464
+ function J(n) {
1465
+ return new A(n);
1359
1466
  }
1360
- function cn(n) {
1467
+ function ln(n) {
1361
1468
  for (var e = n.s; e !== void 0; e = e.n)
1362
1469
  if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i)
1363
1470
  return !0;
1364
1471
  return !1;
1365
1472
  }
1366
- function ln(n) {
1473
+ function un(n) {
1367
1474
  for (var e = n.s; e !== void 0; e = e.n) {
1368
1475
  var t = e.S.n;
1369
1476
  if (t !== void 0 && (e.r = t), e.S.n = e, e.i = -1, e.n === void 0) {
@@ -1372,74 +1479,74 @@ function ln(n) {
1372
1479
  }
1373
1480
  }
1374
1481
  }
1375
- function un(n) {
1482
+ function dn(n) {
1376
1483
  for (var e = n.s, t = void 0; e !== void 0; ) {
1377
1484
  var i = e.p;
1378
1485
  e.i === -1 ? (e.S.U(e), i !== void 0 && (i.n = e.n), e.n !== void 0 && (e.n.p = i)) : t = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = i;
1379
1486
  }
1380
1487
  n.s = t;
1381
1488
  }
1382
- function G(n) {
1383
- I.call(this, void 0), this.x = n, this.s = void 0, this.g = $e - 1, this.f = 4;
1489
+ function K(n) {
1490
+ A.call(this, void 0), this.x = n, this.s = void 0, this.g = Me - 1, this.f = 4;
1384
1491
  }
1385
- (G.prototype = new I()).h = function() {
1492
+ (K.prototype = new A()).h = function() {
1386
1493
  if (this.f &= -3, 1 & this.f)
1387
1494
  return !1;
1388
- if ((36 & this.f) == 32 || (this.f &= -5, this.g === $e))
1495
+ if ((36 & this.f) == 32 || (this.f &= -5, this.g === Me))
1389
1496
  return !0;
1390
- if (this.g = $e, this.f |= 1, this.i > 0 && !cn(this))
1497
+ if (this.g = Me, this.f |= 1, this.i > 0 && !ln(this))
1391
1498
  return this.f &= -2, !0;
1392
1499
  var n = E;
1393
1500
  try {
1394
- ln(this), E = this;
1501
+ un(this), E = this;
1395
1502
  var e = this.x();
1396
1503
  (16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
1397
1504
  } catch (t) {
1398
1505
  this.v = t, this.f |= 16, this.i++;
1399
1506
  }
1400
- return E = n, un(this), this.f &= -2, !0;
1507
+ return E = n, dn(this), this.f &= -2, !0;
1401
1508
  };
1402
- G.prototype.S = function(n) {
1509
+ K.prototype.S = function(n) {
1403
1510
  if (this.t === void 0) {
1404
1511
  this.f |= 36;
1405
1512
  for (var e = this.s; e !== void 0; e = e.n)
1406
1513
  e.S.S(e);
1407
1514
  }
1408
- I.prototype.S.call(this, n);
1515
+ A.prototype.S.call(this, n);
1409
1516
  };
1410
- G.prototype.U = function(n) {
1411
- if (this.t !== void 0 && (I.prototype.U.call(this, n), this.t === void 0)) {
1517
+ K.prototype.U = function(n) {
1518
+ if (this.t !== void 0 && (A.prototype.U.call(this, n), this.t === void 0)) {
1412
1519
  this.f &= -33;
1413
1520
  for (var e = this.s; e !== void 0; e = e.n)
1414
1521
  e.S.U(e);
1415
1522
  }
1416
1523
  };
1417
- G.prototype.N = function() {
1524
+ K.prototype.N = function() {
1418
1525
  if (!(2 & this.f)) {
1419
1526
  this.f |= 6;
1420
1527
  for (var n = this.t; n !== void 0; n = n.x)
1421
1528
  n.t.N();
1422
1529
  }
1423
1530
  };
1424
- G.prototype.peek = function() {
1425
- if (this.h() || ze(), 16 & this.f)
1531
+ K.prototype.peek = function() {
1532
+ if (this.h() || Le(), 16 & this.f)
1426
1533
  throw this.v;
1427
1534
  return this.v;
1428
1535
  };
1429
- Object.defineProperty(G.prototype, "value", { get: function() {
1430
- 1 & this.f && ze();
1431
- var n = an(this);
1536
+ Object.defineProperty(K.prototype, "value", { get: function() {
1537
+ 1 & this.f && Le();
1538
+ var n = cn(this);
1432
1539
  if (this.h(), n !== void 0 && (n.i = this.i), 16 & this.f)
1433
1540
  throw this.v;
1434
1541
  return this.v;
1435
1542
  } });
1436
- function dn(n) {
1437
- return new G(n);
1438
- }
1439
1543
  function hn(n) {
1544
+ return new K(n);
1545
+ }
1546
+ function pn(n) {
1440
1547
  var e = n.u;
1441
1548
  if (n.u = void 0, typeof e == "function") {
1442
- re++;
1549
+ ae++;
1443
1550
  var t = E;
1444
1551
  E = void 0;
1445
1552
  try {
@@ -1454,17 +1561,17 @@ function hn(n) {
1454
1561
  function it(n) {
1455
1562
  for (var e = n.s; e !== void 0; e = e.n)
1456
1563
  e.S.U(e);
1457
- n.x = void 0, n.s = void 0, hn(n);
1564
+ n.x = void 0, n.s = void 0, pn(n);
1458
1565
  }
1459
- function Pn(n) {
1566
+ function Rn(n) {
1460
1567
  if (E !== this)
1461
1568
  throw new Error("Out-of-order effect");
1462
- un(this), E = n, this.f &= -2, 8 & this.f && it(this), nt();
1569
+ dn(this), E = n, this.f &= -2, 8 & this.f && it(this), nt();
1463
1570
  }
1464
- function ge(n) {
1571
+ function we(n) {
1465
1572
  this.x = n, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32;
1466
1573
  }
1467
- ge.prototype.c = function() {
1574
+ we.prototype.c = function() {
1468
1575
  var n = this.S();
1469
1576
  try {
1470
1577
  if (8 & this.f || this.x === void 0)
@@ -1475,19 +1582,19 @@ ge.prototype.c = function() {
1475
1582
  n();
1476
1583
  }
1477
1584
  };
1478
- ge.prototype.S = function() {
1479
- 1 & this.f && ze(), this.f |= 1, this.f &= -9, hn(this), ln(this), re++;
1585
+ we.prototype.S = function() {
1586
+ 1 & this.f && Le(), this.f |= 1, this.f &= -9, pn(this), un(this), ae++;
1480
1587
  var n = E;
1481
- return E = this, Pn.bind(this, n);
1588
+ return E = this, Rn.bind(this, n);
1482
1589
  };
1483
- ge.prototype.N = function() {
1484
- 2 & this.f || (this.f |= 2, this.o = fe, fe = this);
1590
+ we.prototype.N = function() {
1591
+ 2 & this.f || (this.f |= 2, this.o = ve, ve = this);
1485
1592
  };
1486
- ge.prototype.d = function() {
1593
+ we.prototype.d = function() {
1487
1594
  this.f |= 8, 1 & this.f || it(this);
1488
1595
  };
1489
- function He(n) {
1490
- var e = new ge(n);
1596
+ function st(n) {
1597
+ var e = new we(n);
1491
1598
  try {
1492
1599
  e.c();
1493
1600
  } catch (t) {
@@ -1495,18 +1602,18 @@ function He(n) {
1495
1602
  }
1496
1603
  return e.d.bind(e);
1497
1604
  }
1498
- var Le, Re;
1499
- function ce(n, e) {
1605
+ var ze, Pe;
1606
+ function le(n, e) {
1500
1607
  w[n] = e.bind(null, w[n] || function() {
1501
1608
  });
1502
1609
  }
1503
- function Me(n) {
1504
- Re && Re(), Re = n && n.S();
1610
+ function $e(n) {
1611
+ Pe && Pe(), Pe = n && n.S();
1505
1612
  }
1506
1613
  function fn(n) {
1507
- var e = this, t = n.data, i = U(t);
1614
+ var e = this, t = n.data, i = z(t);
1508
1615
  i.value = t;
1509
- var s = P(function() {
1616
+ var s = X(function() {
1510
1617
  for (var o = e.__v; o = o.__; )
1511
1618
  if (o.__c) {
1512
1619
  o.__c.__$f |= 4;
@@ -1514,8 +1621,8 @@ function fn(n) {
1514
1621
  }
1515
1622
  return e.__$u.c = function() {
1516
1623
  var r;
1517
- !Ut(s.peek()) && ((r = e.base) == null ? void 0 : r.nodeType) === 3 ? e.base.data = s.peek() : (e.__$f |= 1, e.setState({}));
1518
- }, dn(function() {
1624
+ !Vt(s.peek()) && ((r = e.base) == null ? void 0 : r.nodeType) === 3 ? e.base.data = s.peek() : (e.__$f |= 1, e.setState({}));
1625
+ }, hn(function() {
1519
1626
  var r = i.value.value;
1520
1627
  return r === 0 ? 0 : r === !0 ? "" : r || "";
1521
1628
  });
@@ -1523,37 +1630,37 @@ function fn(n) {
1523
1630
  return s.value;
1524
1631
  }
1525
1632
  fn.displayName = "_st";
1526
- Object.defineProperties(I.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: fn }, props: { configurable: !0, get: function() {
1633
+ Object.defineProperties(A.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: fn }, props: { configurable: !0, get: function() {
1527
1634
  return { data: this };
1528
1635
  } }, __b: { configurable: !0, value: 1 } });
1529
- ce("__b", function(n, e) {
1636
+ le("__b", function(n, e) {
1530
1637
  if (typeof e.type == "string") {
1531
1638
  var t, i = e.props;
1532
1639
  for (var s in i)
1533
1640
  if (s !== "children") {
1534
1641
  var o = i[s];
1535
- o instanceof I && (t || (e.__np = t = {}), t[s] = o, i[s] = o.peek());
1642
+ o instanceof A && (t || (e.__np = t = {}), t[s] = o, i[s] = o.peek());
1536
1643
  }
1537
1644
  }
1538
1645
  n(e);
1539
1646
  });
1540
- ce("__r", function(n, e) {
1541
- Me();
1647
+ le("__r", function(n, e) {
1648
+ $e();
1542
1649
  var t, i = e.__c;
1543
1650
  i && (i.__$f &= -2, (t = i.__$u) === void 0 && (i.__$u = t = function(s) {
1544
1651
  var o;
1545
- return He(function() {
1652
+ return st(function() {
1546
1653
  o = this;
1547
1654
  }), o.c = function() {
1548
1655
  i.__$f |= 1, i.setState({});
1549
1656
  }, o;
1550
- }())), Le = i, Me(t), n(e);
1657
+ }())), ze = i, $e(t), n(e);
1551
1658
  });
1552
- ce("__e", function(n, e, t, i) {
1553
- Me(), Le = void 0, n(e, t, i);
1659
+ le("__e", function(n, e, t, i) {
1660
+ $e(), ze = void 0, n(e, t, i);
1554
1661
  });
1555
- ce("diffed", function(n, e) {
1556
- Me(), Le = void 0;
1662
+ le("diffed", function(n, e) {
1663
+ $e(), ze = void 0;
1557
1664
  var t;
1558
1665
  if (typeof e.type == "string" && (t = e.__e)) {
1559
1666
  var i = e.__np, s = e.props;
@@ -1567,23 +1674,23 @@ ce("diffed", function(n, e) {
1567
1674
  else
1568
1675
  t.U = o = {};
1569
1676
  for (var u in i) {
1570
- var f = o[u], d = i[u];
1571
- f === void 0 ? (f = Rn(t, u, d, s), o[u] = f) : f.o(d, s);
1677
+ var h = o[u], p = i[u];
1678
+ h === void 0 ? (h = Fn(t, u, p, s), o[u] = h) : h.o(p, s);
1572
1679
  }
1573
1680
  }
1574
1681
  }
1575
1682
  n(e);
1576
1683
  });
1577
- function Rn(n, e, t, i) {
1578
- var s = e in n && n.ownerSVGElement === void 0, o = X(t);
1684
+ function Fn(n, e, t, i) {
1685
+ var s = e in n && n.ownerSVGElement === void 0, o = J(t);
1579
1686
  return { o: function(r, a) {
1580
1687
  o.value = r, i = a;
1581
- }, d: He(function() {
1688
+ }, d: st(function() {
1582
1689
  var r = o.value.value;
1583
1690
  i[e] !== r && (i[e] = r, s ? n[e] = r : r ? n.setAttribute(e, r) : n.removeAttribute(e));
1584
1691
  }) };
1585
1692
  }
1586
- ce("unmount", function(n, e) {
1693
+ le("unmount", function(n, e) {
1587
1694
  if (typeof e.type == "string") {
1588
1695
  var t = e.__e;
1589
1696
  if (t) {
@@ -1605,10 +1712,10 @@ ce("unmount", function(n, e) {
1605
1712
  }
1606
1713
  n(e);
1607
1714
  });
1608
- ce("__h", function(n, e, t, i) {
1715
+ le("__h", function(n, e, t, i) {
1609
1716
  (i < 3 || i === 9) && (e.__$f |= 2), n(e, t, i);
1610
1717
  });
1611
- L.prototype.shouldComponentUpdate = function(n, e) {
1718
+ F.prototype.shouldComponentUpdate = function(n, e) {
1612
1719
  var t = this.__$u;
1613
1720
  if (!(t && t.s !== void 0 || 4 & this.__$f) || 3 & this.__$f)
1614
1721
  return !0;
@@ -1622,23 +1729,15 @@ L.prototype.shouldComponentUpdate = function(n, e) {
1622
1729
  return !0;
1623
1730
  return !1;
1624
1731
  };
1625
- function U(n) {
1626
- return P(function() {
1627
- return X(n);
1628
- }, []);
1629
- }
1630
- function H(n) {
1631
- var e = B(n);
1632
- return e.current = n, Le.__$f |= 4, P(function() {
1633
- return dn(function() {
1634
- return e.current();
1635
- });
1732
+ function z(n) {
1733
+ return X(function() {
1734
+ return J(n);
1636
1735
  }, []);
1637
1736
  }
1638
- function Fn(n) {
1639
- var e = B(n);
1640
- e.current = n, O(function() {
1641
- return He(function() {
1737
+ function B(n) {
1738
+ var e = P(n);
1739
+ return e.current = n, ze.__$f |= 4, X(function() {
1740
+ return hn(function() {
1642
1741
  return e.current();
1643
1742
  });
1644
1743
  }, []);
@@ -1648,11 +1747,11 @@ function c(n, e, t, i, s, o) {
1648
1747
  var r, a, u = {};
1649
1748
  for (a in e)
1650
1749
  a == "ref" ? r = e[a] : u[a] = e[a];
1651
- var f = { type: n, props: u, key: t, ref: r, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --Un, __source: s, __self: o };
1750
+ var h = { type: n, props: u, key: t, ref: r, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --Un, __source: s, __self: o };
1652
1751
  if (typeof n == "function" && (r = n.defaultProps))
1653
1752
  for (a in r)
1654
1753
  u[a] === void 0 && (u[a] = r[a]);
1655
- return w.vnode && w.vnode(f), f;
1754
+ return w.vnode && w.vnode(h), h;
1656
1755
  }
1657
1756
  const Wn = () => c("svg", {
1658
1757
  viewBox: "0 0 1024 1024",
@@ -1669,7 +1768,7 @@ const Wn = () => c("svg", {
1669
1768
  children: c("path", {
1670
1769
  d: "M900.64 379.808l-263.072-256.032c-36.448-35.328-105.76-35.392-142.304 0.096l-327.04 319.904c-56.416 54.72-70.72 76.704-70.72 150.976l0 143.936c0 132.768 26.976 192 186.912 192l131.872 0c81.12 0 128.448-46.656 193.952-111.264l290.016-297.696c18.592-17.984 29.248-43.968 29.248-71.264C929.504 423.36 918.976 397.6 900.64 379.808zM323.008 786.752c-52.928 0-96-43.072-96-96s43.072-96 96-96 96 43.072 96 96S375.936 786.752 323.008 786.752z"
1671
1770
  })
1672
- }), jn = (n) => c("svg", {
1771
+ }), qn = (n) => c("svg", {
1673
1772
  viewBox: "0 0 1024 1024",
1674
1773
  id: "send",
1675
1774
  className: n.className,
@@ -1678,14 +1777,14 @@ const Wn = () => c("svg", {
1678
1777
  children: c("path", {
1679
1778
  d: "M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-0.9 3.7-0.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 0.7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-0.8 4.2-2.6 5-5 1.4-4.2-0.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"
1680
1779
  })
1681
- }), qn = () => c("svg", {
1780
+ }), jn = () => c("svg", {
1682
1781
  viewBox: "0 0 1024 1024",
1683
1782
  version: "1.1",
1684
1783
  xmlns: "http://www.w3.org/2000/svg",
1685
1784
  children: c("path", {
1686
1785
  d: "M962 197.61H747v-60c0-55.14-44.86-100-100-100H377c-55.14 0-100 44.86-100 100v60H62c-11.05 0-20 8.95-20 20s8.95 20 20 20h60v630.57c0 66.17 53.83 120 120 120h540c66.17 0 120-53.83 120-120V237.61h60c11.05 0 20-8.95 20-20s-8.95-20-20-20zM637.34 457.66v260c0 12.01-10.72 21.63-23.06 19.77-9.84-1.48-16.94-10.25-16.94-20.2V458.09c0-9.95 7.1-18.72 16.94-20.2 12.34-1.86 23.06 7.76 23.06 19.77z m-210.68 0v260c0 11-9 20-20 20s-20-9-20-20v-260c0-11 9-20 20-20s20 9 20 20zM317 137.61c0-33.08 26.92-60 60-60h270c33.08 0 60 26.92 60 60v60H317v-60z"
1687
1786
  })
1688
- }), gt = () => c("svg", {
1787
+ }), wt = () => c("svg", {
1689
1788
  viewBox: "0 0 1024 1024",
1690
1789
  version: "1.1",
1691
1790
  xmlns: "http://www.w3.org/2000/svg",
@@ -1769,14 +1868,14 @@ const Wn = () => c("svg", {
1769
1868
  children: Array.from({
1770
1869
  length: 4
1771
1870
  }).map((a, u) => {
1772
- const d = u * (146.66666666666666 + 140), l = 1e3 / 2 - 250 / 2, _ = 1e3 / 2 - 500 / 2;
1871
+ const p = u * (146.66666666666666 + 140), l = 1e3 / 2 - 250 / 2, v = 1e3 / 2 - 500 / 2;
1773
1872
  return c("rect", {
1774
1873
  fill: "currentColor",
1775
1874
  rx: 70,
1776
1875
  ry: 70,
1777
1876
  height: 250,
1778
1877
  width: 140,
1779
- x: d,
1878
+ x: p,
1780
1879
  y: l,
1781
1880
  children: [c("animate", {
1782
1881
  attributeName: "height",
@@ -1787,7 +1886,7 @@ const Wn = () => c("svg", {
1787
1886
  repeatCount: "indefinite"
1788
1887
  }), c("animate", {
1789
1888
  attributeName: "y",
1790
- values: "".concat(l, "; ").concat(_, "; ").concat(l),
1889
+ values: "".concat(l, "; ").concat(v, "; ").concat(l),
1791
1890
  keyTimes: "0; 0.5; 1",
1792
1891
  dur: "".concat(0.8, "s"),
1793
1892
  begin: "".concat(0.8 / 4 * u, "s"),
@@ -1812,7 +1911,15 @@ const Wn = () => c("svg", {
1812
1911
  children: c("path", {
1813
1912
  d: "M498.33984 607.8464c-10.99776-32.9728-50.09408-73.5232-82.6368-85.74976L150.9376 422.8096c-38.54336-14.4384-36.98688-69.46816 2.27328-81.73568L844.92288 124.90752c33.30048-10.40384 64.57344 20.8896 54.1696 54.1696L682.92608 870.78912a43.2128 43.2128 0 0 1-81.36704 3.25632 121682.5344 121682.5344 0 0 1-103.2192-266.19904z"
1814
1913
  })
1815
- }), ii = (n) => c("svg", {
1914
+ }), ii = () => c("svg", {
1915
+ className: "icon",
1916
+ viewBox: "0 0 1024 1024",
1917
+ version: "1.1",
1918
+ xmlns: "http://www.w3.org/2000/svg",
1919
+ children: c("path", {
1920
+ d: "M972.657609 209.348408C987.158609 209.36839 998.930114 197.571202 998.949999 182.99865 998.969882 168.426097 987.230618 156.59651 972.729617 156.576528L32.457975 155.280806C17.956974 155.260823 6.18547 167.058012 6.165585 181.630564 6.1457 196.203116 17.884965 208.032703 32.385966 208.052686L972.657609 209.348408ZM180.466902 992.356169 180.466902 1019.014859 206.993296 1018.74074 833.361858 1012.267947 859.348284 1011.999407 859.348284 985.883377 859.348284 289.397297C859.348284 274.824732 847.59289 263.011332 833.091874 263.011332 818.590859 263.011332 806.835465 274.824732 806.835465 289.397297L806.835465 985.883377 832.82189 959.498805 206.453329 965.971599 232.979723 992.356169 232.979723 282.67005C232.979723 268.097483 221.224329 256.284085 206.723313 256.284085 192.222298 256.284085 180.466902 268.097483 180.466902 282.67005L180.466902 992.356169ZM656.410257 847.079027C656.410257 861.651593 668.165651 873.464992 682.666667 873.464992 697.167682 873.464992 708.923076 861.651593 708.923076 847.079027L708.923076 372.131659C708.923076 357.559091 697.167682 345.745694 682.666667 345.745694 668.165651 345.745694 656.410257 357.559091 656.410257 372.131659L656.410257 847.079027ZM341.333333 847.079027C341.333333 861.651593 353.08873 873.464992 367.589743 873.464992 382.090758 873.464992 393.846155 861.651593 393.846155 847.079027L393.846155 372.131659C393.846155 357.559091 382.090758 345.745694 367.589743 345.745694 353.08873 345.745694 341.333333 357.559091 341.333333 372.131659L341.333333 847.079027ZM498.871795 847.079027C498.871795 861.651593 510.627189 873.464992 525.128205 873.464992 539.62922 873.464992 551.384614 861.651593 551.384614 847.079027L551.384614 372.131659C551.384614 357.559091 539.62922 345.745694 525.128205 345.745694 510.627189 345.745694 498.871795 357.559091 498.871795 372.131659L498.871795 847.079027ZM392.147755 116.721777C392.147755 102.063669 403.758665 90.363507 418.40134 90.363507L622.925796 90.363507C637.408947 90.363507 649.179381 102.1619 649.179381 116.549585L649.179381 171.644875 701.692203 171.644875 701.692203 116.549585C701.692203 72.986607 666.38105 37.591577 622.925796 37.591577L418.40134 37.591577C374.724427 37.591577 339.634933 72.950804 339.634933 116.721777L339.634933 165.310801 392.147755 165.310801 392.147755 116.721777Z"
1921
+ })
1922
+ }), si = (n) => c("svg", {
1816
1923
  xmlns: "http://www.w3.org/2000/svg",
1817
1924
  className: n.className,
1818
1925
  viewBox: "0 0 512 512",
@@ -1824,14 +1931,14 @@ const Wn = () => c("svg", {
1824
1931
  strokeWidth: "48",
1825
1932
  d: "M112 184l144 144 144-144"
1826
1933
  })
1827
- }), Fe = (n) => c("svg", {
1934
+ }), Re = (n) => c("svg", {
1828
1935
  xmlns: "http://www.w3.org/2000/svg",
1829
1936
  className: "".concat(n.className, " icon"),
1830
1937
  viewBox: "0 0 512 512",
1831
1938
  children: c("path", {
1832
1939
  d: "M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 01-12 5.71h-.27a16 16 0 01-11.89-5.3l-57.6-64a16 16 0 1123.78-21.4l45.29 50.32 122.59-145.91a16 16 0 0124.5 20.58z"
1833
1940
  })
1834
- }), Ue = (n) => c("svg", {
1941
+ }), Fe = (n) => c("svg", {
1835
1942
  className: n.className,
1836
1943
  width: "16",
1837
1944
  height: "16",
@@ -1855,7 +1962,7 @@ const Wn = () => c("svg", {
1855
1962
  repeatCount: "indefinite"
1856
1963
  })
1857
1964
  })
1858
- }), si = () => c("svg", {
1965
+ }), oi = () => c("svg", {
1859
1966
  className: "icon",
1860
1967
  viewBox: "0 0 1024 1024",
1861
1968
  version: "1.1",
@@ -1865,7 +1972,7 @@ const Wn = () => c("svg", {
1865
1972
  children: c("path", {
1866
1973
  d: "M704 256v490.666667a170.666667 170.666667 0 0 1-170.666667 170.666666 170.666667 170.666667 0 0 1-170.666666-170.666666V213.333333A106.666667 106.666667 0 0 1 469.333333 106.666667 106.666667 106.666667 0 0 1 576 213.333333v448a42.666667 42.666667 0 0 1-42.666667 42.666667 42.666667 42.666667 0 0 1-42.666666-42.666667V256H426.666667v405.333333a106.666667 106.666667 0 0 0 106.666666 106.666667 106.666667 106.666667 0 0 0 106.666667-106.666667V213.333333a170.666667 170.666667 0 0 0-170.666667-170.666666 170.666667 170.666667 0 0 0-170.666666 170.666666v533.333334a234.666667 234.666667 0 0 0 234.666666 234.666666 234.666667 234.666667 0 0 0 234.666667-234.666666V256h-64z"
1867
1974
  })
1868
- }), pn = () => c("svg", {
1975
+ }), vn = () => c("svg", {
1869
1976
  className: "icon",
1870
1977
  viewBox: "0 0 1024 1024",
1871
1978
  version: "1.1",
@@ -1879,7 +1986,7 @@ const Wn = () => c("svg", {
1879
1986
  d: "M640 693.333333H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM640 522.666667H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM341.333333 416h85.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-85.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32z",
1880
1987
  fill: "currentColor"
1881
1988
  })]
1882
- }), oi = () => c("svg", {
1989
+ }), ri = () => c("svg", {
1883
1990
  className: "icon",
1884
1991
  viewBox: "0 0 1024 1024",
1885
1992
  version: "1.1",
@@ -1890,7 +1997,7 @@ const Wn = () => c("svg", {
1890
1997
  d: "M557.248 511.68l135.776-135.744-45.248-45.28L512 466.432l-135.776-135.776-45.248 45.28 135.776 135.744-135.776 135.776 45.248 45.248L512 556.928l135.776 135.776 45.248-45.248-135.776-135.776zM512 64c247.136 0 448 200.864 448 448s-200.864 448-448 448S64 759.136 64 512 264.864 64 512 64z",
1891
1998
  fill: "currentColor"
1892
1999
  })
1893
- }), ri = () => c("svg", {
2000
+ }), ai = () => c("svg", {
1894
2001
  className: "icon",
1895
2002
  viewBox: "0 0 1024 1024",
1896
2003
  version: "1.1",
@@ -1900,7 +2007,7 @@ const Wn = () => c("svg", {
1900
2007
  children: c("path", {
1901
2008
  d: "M512.43945313 904.51953125c-6.06445313 0-12.12890625-1.58203125-17.57812501-4.74609375L136.70703125 689.71484375c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867188-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l76.37695313-44.91210938L136.97070312 540.125c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867187-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l73.38867187-43.15429688-73.125-42.890625C126.51171875 387.81054687 120.0078125 376.38476562 120.0078125 364.08007812c0-12.3046875 6.50390625-23.73046875 17.13867188-29.97070312L495.828125 122.99609375c10.8984375-6.41601563 24.34570313-6.41601563 35.24414063 0l358.15429687 210.05859375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-73.38867188 43.15429688 73.12500001 42.890625c10.63476563 6.24023438 17.13867188 17.66601563 17.13867187 29.97070312s-6.50390625 23.73046875-17.13867187 29.97070313L812.5859375 583.89453125l76.11328125 44.6484375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-358.59375 211.2890625c-5.44921875 3.1640625-11.6015625 4.74609375-17.66601563 4.74609375zM223.015625 659.65625l289.42382813 169.8046875 290.12695312-170.77148438-58.44726563-34.27734374L530.28125 750.18359375a34.67285156 34.67285156 0 0 1-35.24414063 0L281.7265625 625.02734375 223.015625 659.65625z m76.90429688-104.58984375l212.69531249 124.8046875 290.12695313-170.77148438-55.546875-32.60742187-216.65039063 127.6171875a34.67285156 34.67285156 0 0 1-35.24414062 0L279.00195312 477.28320312l-55.81054687 32.78320313 75.49804688 44.296875c0.43945313 0.26367188 0.79101563 0.52734375 1.23046874 0.703125z m-2.81250001-147.83203125l215.68359376 126.5625 216.12304687-127.17773438c0.3515625-0.26367188 0.703125-0.43945313 1.0546875-0.61523437l72.86132813-42.890625-289.33593751-169.8046875-290.12695312 170.68359375 72.59765625 42.62695313c0.43945313 0.17578125 0.79101563 0.43945313 1.14257813 0.61523437z"
1902
2009
  })
1903
- }), ai = (n) => c("svg", {
2010
+ }), ci = (n) => c("svg", {
1904
2011
  className: n.className,
1905
2012
  id: "stop",
1906
2013
  viewBox: "0 0 1025 1024",
@@ -1915,7 +2022,7 @@ const Wn = () => c("svg", {
1915
2022
  d: "M655.434047 694.244421 367.12637 694.244421c-21.046987 0-38.170445-17.123458-38.170445-38.170445L328.955925 367.766298c0-21.046987 17.123458-38.170445 38.170445-38.170445l288.307678 0c21.048011 0 38.170445 17.123458 38.170445 38.170445l0 288.307678C693.604492 677.120962 676.482058 694.244421 655.434047 694.244421zM380.150191 643.050154l262.260035 0L642.410226 380.79012 380.150191 380.79012 380.150191 643.050154z",
1916
2023
  fill: "currentColor"
1917
2024
  })]
1918
- }), ci = (n) => c("svg", {
2025
+ }), li = (n) => c("svg", {
1919
2026
  xmlns: "http://www.w3.org/2000/svg",
1920
2027
  className: n.className,
1921
2028
  viewBox: "0 0 512 512",
@@ -1927,12 +2034,54 @@ const Wn = () => c("svg", {
1927
2034
  strokeWidth: "48",
1928
2035
  d: "M112 268l144 144 144-144M256 392V100"
1929
2036
  })
2037
+ }), ui = () => c("svg", {
2038
+ viewBox: "0 0 1024 1024",
2039
+ version: "1.1",
2040
+ xmlns: "http://www.w3.org/2000/svg",
2041
+ width: "18",
2042
+ height: "18",
2043
+ children: [c("path", {
2044
+ d: "M394.688 126.208a32 32 0 0 1 32-32h170.688a32 32 0 0 1 32 32v138.624h288a32 32 0 0 1 32 32v170.688a32 32 0 0 1-32 32H106.688a32 32 0 0 1-32-32V296.832a32 32 0 0 1 32-32h288V126.208z m64 32v138.624a32 32 0 0 1-32 32h-288v106.688h746.688V328.832h-288a32 32 0 0 1-32-32V158.208H458.688z"
2045
+ }), c("path", {
2046
+ d: "M138.688 469.376a32 32 0 0 1 32-32h682.688a32 32 0 0 1 32 32v384a32 32 0 0 1-32 32H170.688a32 32 0 0 1-32-32v-384z m64 32v320h618.688v-320H202.688z"
2047
+ }), c("path", {
2048
+ d: "M341.376 691.52a32 32 0 0 1 32 32V851.2a32 32 0 1 1-64 0v-127.68a32 32 0 0 1 32-32zM512 691.2a32 32 0 0 1 32 32v128a32 32 0 0 1-64 0v-128a32 32 0 0 1 32-32zM682.688 691.52a32 32 0 0 1 32 32V851.2a32 32 0 1 1-64 0v-127.68a32 32 0 0 1 32-32z"
2049
+ })]
2050
+ }), di = () => c("svg", {
2051
+ viewBox: "0 0 1024 1024",
2052
+ version: "1.1",
2053
+ xmlns: "http://www.w3.org/2000/svg",
2054
+ width: "18",
2055
+ height: "18",
2056
+ children: c("path", {
2057
+ d: "M843.251 424.407l43.828-74.898c10.194-17.946 32.596-22.158 48.956-11.598 16.298 10.499 23.44 32.658 14.223 49.566l-113.11 195.212-61.164-40.044-126.418-82.285c-16.115-11.598-20.632-34.428-10.194-51.702 9.705-17.397 31.009-23.501 47.857-13.734l89.67 59.028C748.576 295.547 615.81 180.667 461.008 180.667c-177.387 0-320.042 148.758-320.042 331.335 0 183.613 143.692 331.334 319.981 331.334 107.861 0.184 208.58-56.158 268.034-149.858 1.099-1.038 1.099-2.075 2.075-2.075 6.348-9.949 17.092-15.871 28.568-15.81 19.35 0 35.648 16.848 35.648 36.93 0 7.508-2.137 14.833-6.104 21.059-72.823 114.698-196.066 183.675-328.099 183.614-216.088 0-391.4-181.478-391.4-405.195 0-223.718 175.312-405.195 391.339-405.195 183.125-0.427 342.016 131.606 382.243 317.601z"
2058
+ })
2059
+ }), hi = () => c("svg", {
2060
+ version: "1.1",
2061
+ className: "icon",
2062
+ viewBox: "0 0 1024 1024",
2063
+ xmlns: "http://www.w3.org/2000/svg",
2064
+ children: c("path", {
2065
+ d: "M627.498667 55.168l170.666666 170.666667a42.624 42.624 0 0 1 0 60.330666l-469.333333 469.333334A42.538667 42.538667 0 0 1 298.666667 768H128a42.666667 42.666667 0 0 1-42.666667-42.666667v-170.666666c0-11.306667 4.48-22.186667 12.501334-30.165334l469.333333-469.333333a42.624 42.624 0 0 1 60.330667 0zM896 896a42.666667 42.666667 0 0 1 0 85.333333H128a42.666667 42.666667 0 0 1 0-85.333333h768zM597.333333 145.664l-426.666666 426.666667V682.666667h110.336l426.666666-426.666667L597.333333 145.664z"
2066
+ })
2067
+ }), pi = (n) => c("svg", {
2068
+ xmlns: "http://www.w3.org/2000/svg",
2069
+ className: n.className,
2070
+ viewBox: "0 0 512 512",
2071
+ children: c("path", {
2072
+ fill: "none",
2073
+ stroke: "currentColor",
2074
+ strokeLinecap: "round",
2075
+ strokeLinejoin: "round",
2076
+ strokeWidth: "48",
2077
+ d: "M184 112l144 144-144 144"
2078
+ })
1930
2079
  });
1931
- const li = (n) => {
2080
+ const fi = (n) => {
1932
2081
  const {
1933
2082
  items: e
1934
- } = n, t = U([]), i = new $("chat-thought-chain"), s = U([]);
1935
- O(() => {
2083
+ } = n, t = z([]), i = new N("chat-thought-chain"), s = z([]);
2084
+ H(() => {
1936
2085
  s.value = e.filter((r) => r.description), s.value.length > 0 && s.value.forEach((r, a) => {
1937
2086
  r.done && (t.value = [...t.value, a]);
1938
2087
  });
@@ -1958,7 +2107,7 @@ const li = (n) => {
1958
2107
  children: [c("div", {
1959
2108
  className: i.e("item-title"),
1960
2109
  onClick: () => o(a),
1961
- children: [r.title, c(ii, {
2110
+ children: [r.title, c(si, {
1962
2111
  className: i.e("icon")
1963
2112
  })]
1964
2113
  }), c("div", {
@@ -1969,84 +2118,125 @@ const li = (n) => {
1969
2118
  }, a);
1970
2119
  })
1971
2120
  });
1972
- }, K = new $("markdown-message"), ui = (n) => {
2121
+ };
2122
+ const vi = (n) => {
2123
+ const {
2124
+ items: e,
2125
+ onItemClick: t
2126
+ } = n, i = (o, r) => {
2127
+ t == null || t(o, r);
2128
+ }, s = new N("chat-suggestions");
2129
+ return c("div", {
2130
+ className: "".concat(s.b()),
2131
+ children: e.map((o, r) => c("div", {
2132
+ className: "".concat(s.e("item"), " ").concat(s.is("action", o.type === "action")),
2133
+ onClick: (a) => i(o, a),
2134
+ title: o.metadata.content_name,
2135
+ children: [o.metadata.content_name, c(pi, {
2136
+ className: "".concat(s.e("item-icon"))
2137
+ })]
2138
+ }, r))
2139
+ });
2140
+ };
2141
+ const ee = new N("markdown-message"), mi = (n) => {
1973
2142
  const {
1974
2143
  message: e,
1975
2144
  size: t
1976
- } = n, i = U(Kt()), s = U(null), o = P(() => e.state === 20 && e.completed !== !0, [e.state, e.completed]), r = P(() => e.state === 20 && e.completed === !0, [e.state, e.completed]), a = U({
2145
+ } = n, i = z(et()), s = z(null), o = X(() => e.state === 20 && e.completed !== !0, [e.state, e.completed]), r = X(() => e.state === 20 && e.completed === !0, [e.state, e.completed]), a = z({
1977
2146
  title: "",
1978
2147
  description: "",
1979
- icon: c(Ue, {})
1980
- }), u = (f) => {
1981
- const d = f.indexOf("<think>"), l = f.indexOf("</think>");
1982
- let _ = "", g = "", h = !1;
1983
- return l === -1 ? (h = !1, _ = f.slice(d + 7), g = "") : (h = !0, _ = f.slice(d + 7, l), g = f.slice(l + 8)), {
1984
- isThoughtCompleted: h,
1985
- thoughtContent: _,
1986
- answerContent: g
2148
+ icon: c(Fe, {})
2149
+ }), u = z({
2150
+ hasSuggestions: !1,
2151
+ suggestions: []
2152
+ }), h = (v) => {
2153
+ v && v.length > 0 ? u.value = {
2154
+ hasSuggestions: !0,
2155
+ suggestions: v
2156
+ } : u.value = {
2157
+ hasSuggestions: !1,
2158
+ suggestions: []
2159
+ };
2160
+ }, p = (v, _) => {
2161
+ n.controller.handleSuggestionClick(n.message, v, _);
2162
+ }, l = (v) => {
2163
+ const _ = v.indexOf("<think>"), d = v.indexOf("</think>");
2164
+ let f = "", m = "", b = !1;
2165
+ return d === -1 ? (b = !1, f = v.slice(_ + 7), m = "") : (b = !0, f = v.slice(_ + 7, d), m = v.slice(d + 8)), {
2166
+ isThoughtCompleted: b,
2167
+ thoughtContent: f,
2168
+ answerContent: m
1987
2169
  };
1988
2170
  };
1989
- return O(() => {
1990
- if (t >= 0 && s.value)
2171
+ return H(() => {
2172
+ if (t >= 0 && s.value) {
1991
2173
  if (e.content.indexOf("<think>") !== -1) {
1992
2174
  const {
1993
- isThoughtCompleted: f,
1994
- thoughtContent: d,
1995
- answerContent: l
1996
- } = u(e.content);
1997
- f ? (a.value.icon = c(Fe, {}), a.value.title = "思考完成") : e.completed === !0 ? (a.value.icon = c(Fe, {}), a.value.title = "思考已停止") : (a.value.icon = c(Ue, {}), a.value.title = "思考中..."), d && (a.value.description = d), l && s.value.setMarkdown(l);
2175
+ isThoughtCompleted: v,
2176
+ thoughtContent: _,
2177
+ answerContent: d
2178
+ } = l(e.content);
2179
+ v ? (a.value.icon = c(Re, {}), a.value.title = "思考完成") : e.completed === !0 ? (a.value.icon = c(Re, {}), a.value.title = "思考已停止") : (a.value.icon = c(Fe, {}), a.value.title = "思考中..."), a.value.description = _ || "", s.value.setMarkdown(d || "");
1998
2180
  } else
1999
- s.value.setMarkdown(e.content);
2000
- }, [e, t]), O(() => {
2001
- let f = "";
2181
+ s.value.setMarkdown(e.content || "");
2182
+ h(e.suggestions);
2183
+ }
2184
+ }, [e, t]), H(() => {
2185
+ let v = "";
2002
2186
  if (e.content.indexOf("<think>") !== -1) {
2003
2187
  const {
2004
- isThoughtCompleted: d,
2005
- thoughtContent: l,
2006
- answerContent: _
2007
- } = u(e.content);
2188
+ isThoughtCompleted: _,
2189
+ thoughtContent: d,
2190
+ answerContent: f
2191
+ } = l(e.content);
2008
2192
  a.value = {
2009
- title: d ? "思考完成" : e.completed === !0 ? "思考已停止" : "思考中...",
2010
- description: l || "",
2011
- icon: d || e.completed === !0 ? c(Fe, {}) : c(Ue, {})
2012
- }, _ && (f = _);
2193
+ title: _ ? "思考完成" : e.completed === !0 ? "思考已停止" : "思考中...",
2194
+ description: d || "",
2195
+ icon: _ || e.completed === !0 ? c(Re, {}) : c(Fe, {})
2196
+ }, f && (v = f);
2013
2197
  } else
2014
- f = e.content;
2015
- s.value = new Tn({
2198
+ v = e.content;
2199
+ h(e.suggestions), s.value = new Ut({
2016
2200
  id: i,
2017
- value: f || "",
2201
+ value: v || "",
2018
2202
  editor: {
2019
2203
  defaultModel: "previewOnly"
2020
2204
  }
2021
2205
  });
2022
2206
  }, []), c("div", {
2023
- className: "".concat(K.b(), " ").concat(K.is("loading", o)),
2207
+ className: "".concat(ee.b(), " ").concat(ee.is("loading", o)),
2024
2208
  children: [c("div", {
2025
- className: K.b("header"),
2209
+ className: ee.b("header"),
2026
2210
  children: [c("div", {
2027
- className: K.be("header", "caption"),
2211
+ className: ee.be("header", "caption"),
2028
2212
  children: "AI "
2029
2213
  }), n.children, r ? c("div", {
2030
- className: K.be("header", "timeout"),
2214
+ className: ee.be("header", "timeout"),
2031
2215
  children: "请求超时"
2032
2216
  }) : null]
2033
2217
  }), c("div", {
2034
- className: "".concat(K.b("content"), " pre-wrap-container"),
2035
- children: [c(li, {
2218
+ className: "".concat(ee.b("content"), " pre-wrap-container"),
2219
+ children: [c(fi, {
2036
2220
  items: [a.value]
2037
2221
  }), c("div", {
2038
2222
  id: i
2039
2223
  })]
2040
2224
  }), c("div", {
2041
- className: K.b("footer")
2225
+ className: ee.b("footer"),
2226
+ children: u.value.hasSuggestions ? c(vi, {
2227
+ items: u.value.suggestions,
2228
+ onItemClick: (v, _) => {
2229
+ p(v, _);
2230
+ }
2231
+ }) : null
2042
2232
  })]
2043
2233
  });
2044
2234
  };
2045
- const le = new $("ossfile-material"), di = (n) => {
2046
- const e = H(() => n.material.data.name), t = H(() => n.material.metadata.size), i = H(() => {
2235
+ const ue = new N("ossfile-material"), _i = (n) => {
2236
+ const e = B(() => n.material.data.name), t = B(() => n.material.metadata.size), i = B(() => {
2047
2237
  const o = n.material.metadata.state;
2048
2238
  return o === "successed" ? "上传成功" : o === "uploading" ? "上传中" : o === "failed" ? "上传失败" : "未知状态";
2049
- }), s = H(() => {
2239
+ }), s = B(() => {
2050
2240
  switch (n.material.metadata.state) {
2051
2241
  case "successed":
2052
2242
  return "#1890ff";
@@ -2059,18 +2249,18 @@ const le = new $("ossfile-material"), di = (n) => {
2059
2249
  }
2060
2250
  });
2061
2251
  return c("div", {
2062
- className: le.b(),
2252
+ className: ue.b(),
2063
2253
  children: [c("div", {
2064
- className: le.b("left"),
2065
- children: c(pn, {})
2254
+ className: ue.b("left"),
2255
+ children: c(vn, {})
2066
2256
  }), c("div", {
2067
- className: le.b("right"),
2257
+ className: ue.b("right"),
2068
2258
  children: [c("div", {
2069
- className: le.e("name"),
2259
+ className: ue.e("name"),
2070
2260
  title: e,
2071
2261
  children: e
2072
2262
  }), c("div", {
2073
- className: le.e("metadata"),
2263
+ className: ue.e("metadata"),
2074
2264
  children: [c("div", {
2075
2265
  children: [t, "B"]
2076
2266
  }), c("div", {
@@ -2083,14 +2273,14 @@ const le = new $("ossfile-material"), di = (n) => {
2083
2273
  })]
2084
2274
  });
2085
2275
  };
2086
- const ue = new $("common-material"), hi = (n) => {
2276
+ const de = new N("common-material"), gi = (n) => {
2087
2277
  var i, s, o, r;
2088
- const e = (i = n.controller.opts.questionToolbarItems) == null ? void 0 : i.find((a) => a.id === n.material.metadata.actionId), t = H(() => n.material.metadata.name);
2278
+ const e = (i = n.controller.opts.questionToolbarItems) == null ? void 0 : i.find((a) => a.id === n.material.metadata.actionId), t = B(() => n.material.metadata.name);
2089
2279
  return c("div", {
2090
- className: ue.b(),
2280
+ className: de.b(),
2091
2281
  children: [c("div", {
2092
- className: ue.b("left"),
2093
- children: e && e.icon ? typeof e.icon == "function" ? e.icon() : ((s = e.icon) == null ? void 0 : s.showIcon) && c(V, {
2282
+ className: de.b("left"),
2283
+ children: e && e.icon ? typeof e.icon == "function" ? e.icon() : ((s = e.icon) == null ? void 0 : s.showIcon) && c(Y, {
2094
2284
  children: (o = e.icon) != null && o.cssClass ? c("i", {
2095
2285
  className: e.icon.cssClass
2096
2286
  }) : (r = e.icon) != null && r.imagePath ? tt(e.icon.imagePath) ? c("div", {
@@ -2100,15 +2290,15 @@ const ue = new $("common-material"), hi = (n) => {
2100
2290
  }) : c("img", {
2101
2291
  src: e.icon.imagePath
2102
2292
  }) : null
2103
- }) : c(ri, {})
2293
+ }) : c(ai, {})
2104
2294
  }), c("div", {
2105
- className: ue.b("right"),
2295
+ className: de.b("right"),
2106
2296
  children: [c("div", {
2107
- className: ue.e("name"),
2297
+ className: de.e("name"),
2108
2298
  title: t,
2109
2299
  children: t
2110
2300
  }), c("div", {
2111
- className: ue.e("metadata"),
2301
+ className: de.e("metadata"),
2112
2302
  children: c("div", {
2113
2303
  children: (e == null ? void 0 : e.label) || "素材资源"
2114
2304
  })
@@ -2116,90 +2306,98 @@ const ue = new $("common-material"), hi = (n) => {
2116
2306
  })]
2117
2307
  });
2118
2308
  };
2119
- const We = new $("chat-input-material-item"), vn = (n) => {
2309
+ const Ue = new N("chat-input-material-item"), mn = (n) => {
2120
2310
  const {
2121
2311
  material: e
2122
2312
  } = n;
2123
2313
  let t = null;
2124
2314
  switch (e.type) {
2125
2315
  case "ossfile":
2126
- t = di;
2316
+ t = _i;
2127
2317
  break;
2128
2318
  default:
2129
- t = hi;
2319
+ t = gi;
2130
2320
  }
2131
2321
  const i = () => {
2132
2322
  n.controller.deleteMaterial(e);
2133
2323
  };
2134
2324
  return c("div", {
2135
- className: "".concat(We.b(), " ").concat(We.is("disabled", n.disabled)),
2325
+ className: "".concat(Ue.b(), " ").concat(Ue.is("disabled", n.disabled)),
2136
2326
  children: [c("div", {
2137
- className: We.e("icon"),
2327
+ className: Ue.e("icon"),
2138
2328
  onClick: i,
2139
- children: c(oi, {})
2140
- }), W(t, {
2329
+ children: c(ri, {})
2330
+ }), j(t, {
2141
2331
  material: e,
2142
2332
  controller: n.controller
2143
2333
  })]
2144
2334
  });
2145
- }, ne = new $("user-message-question"), fi = (n) => {
2146
- const e = H(() => n.message.content), t = H(() => en.parseMixedContent(e.value));
2147
- return c("div", {
2148
- className: ne.b(),
2335
+ };
2336
+ const ie = new N("user-message-question"), wi = (n) => {
2337
+ const e = z(et()), t = z(null), i = B(() => n.message.content), s = B(() => tn.parseMixedContent(i.value));
2338
+ return H(() => {
2339
+ t.value = new Ut({
2340
+ id: e,
2341
+ value: s.value.remainingText || "",
2342
+ editor: {
2343
+ defaultModel: "previewOnly"
2344
+ }
2345
+ });
2346
+ }, [s.value.remainingText]), c("div", {
2347
+ className: ie.b(),
2149
2348
  children: [c("div", {
2150
- className: ne.e("user-header"),
2349
+ className: ie.e("user-header"),
2151
2350
  children: [n.children, c("div", {
2152
- className: ne.e("user"),
2351
+ className: ie.e("user"),
2153
2352
  children: "我"
2154
2353
  })]
2155
2354
  }), c("div", {
2156
- className: ne.e("content"),
2355
+ className: ie.e("content"),
2157
2356
  children: c("div", {
2158
- dir: "auto",
2159
- className: ne.em("content", "body"),
2160
- children: [c("p", {
2161
- dir: "auto",
2162
- className: ne.em("content", "material"),
2163
- children: t.value.hasResources && t.value.resources.map((i) => c(vn, {
2164
- material: i,
2357
+ className: ie.em("content", "body"),
2358
+ children: [s.value.hasResources && c("div", {
2359
+ className: ie.em("content", "material"),
2360
+ children: s.value.resources.map((o) => c(mn, {
2361
+ material: o,
2165
2362
  disabled: !0,
2166
2363
  controller: n.controller
2167
- }, i.id))
2168
- }), c("p", {
2169
- dir: "auto",
2364
+ }, o.id))
2365
+ }), c("div", {
2170
2366
  className: "pre-wrap-container",
2171
- children: t.value.remainingText
2367
+ children: c("div", {
2368
+ id: e
2369
+ })
2172
2370
  })]
2173
2371
  })
2174
2372
  })]
2175
2373
  });
2176
2374
  };
2177
- const we = new $("error-message"), pi = (n) => {
2178
- const e = H(() => n.message.content);
2375
+ const ye = new N("error-message"), bi = (n) => {
2376
+ const e = B(() => n.message.content);
2179
2377
  return c("div", {
2180
- className: we.b(),
2378
+ className: ye.b(),
2181
2379
  children: [c("div", {
2182
- className: we.b("header"),
2380
+ className: ye.b("header"),
2183
2381
  children: [c("div", {
2184
- className: we.be("header", "caption"),
2382
+ className: ye.be("header", "caption"),
2185
2383
  children: "AI "
2186
2384
  }), n.children]
2187
2385
  }), c("div", {
2188
- className: "".concat(we.e("content"), " pre-wrap-container"),
2386
+ className: "".concat(ye.e("content"), " pre-wrap-container"),
2189
2387
  children: c("span", {
2190
2388
  children: e
2191
2389
  })
2192
2390
  })]
2193
2391
  });
2194
2392
  };
2195
- const wt = new $("unknown-message"), vi = (n) => c("div", {
2196
- className: wt.b(),
2197
- children: c("span", {
2198
- className: "".concat(wt.e("content"), " pre-wrap-container"),
2393
+ const bt = new N("unknown-message"), yi = (n) => c("div", {
2394
+ className: bt.b(),
2395
+ children: c("div", {
2396
+ className: "".concat(bt.e("content"), " pre-wrap-container"),
2199
2397
  children: ["暂未支持的消息类型: ", n.message.type]
2200
2398
  })
2201
2399
  });
2202
- const _i = new $("chat-message-item"), mi = (n) => {
2400
+ const Ci = new N("chat-message-item"), Ti = (n) => {
2203
2401
  const {
2204
2402
  message: e,
2205
2403
  size: t
@@ -2207,17 +2405,17 @@ const _i = new $("chat-message-item"), mi = (n) => {
2207
2405
  let i = null;
2208
2406
  switch (e.type) {
2209
2407
  case "DEFAULT":
2210
- i = e.role === "ASSISTANT" ? ui : fi;
2408
+ i = e.role === "ASSISTANT" ? mi : wi;
2211
2409
  break;
2212
2410
  case "ERROR":
2213
- i = pi;
2411
+ i = bi;
2214
2412
  break;
2215
2413
  default:
2216
- i = vi;
2414
+ i = yi;
2217
2415
  }
2218
2416
  return c("div", {
2219
- className: _i.b(),
2220
- children: W(i, {
2417
+ className: Ci.b(),
2418
+ children: j(i, {
2221
2419
  size: t,
2222
2420
  message: e,
2223
2421
  controller: n.controller,
@@ -2225,7 +2423,7 @@ const _i = new $("chat-message-item"), mi = (n) => {
2225
2423
  })
2226
2424
  });
2227
2425
  };
2228
- class ie {
2426
+ class V {
2229
2427
  constructor(e) {
2230
2428
  this.msg = e;
2231
2429
  }
@@ -2255,6 +2453,9 @@ class ie {
2255
2453
  get completed() {
2256
2454
  return this.msg.completed;
2257
2455
  }
2456
+ get suggestions() {
2457
+ return this.msg.suggestions;
2458
+ }
2258
2459
  get _origin() {
2259
2460
  return this.msg;
2260
2461
  }
@@ -2266,7 +2467,7 @@ class ie {
2266
2467
  * @param {IChatMessage} msg
2267
2468
  */
2268
2469
  update(e) {
2269
- e.content || (e.content = ""), this.msg.content += e.content;
2470
+ e.content || (e.content = ""), e.content.indexOf("<think>") !== -1 && this.msg.content && (this.msg.content = ""), this.msg.content += e.content;
2270
2471
  }
2271
2472
  /**
2272
2473
  * 更新消息完成状态
@@ -2279,7 +2480,7 @@ class ie {
2279
2480
  this.msg.completed = e;
2280
2481
  }
2281
2482
  }
2282
- class be {
2483
+ class he {
2283
2484
  constructor(e) {
2284
2485
  this.data = e;
2285
2486
  }
@@ -2295,6 +2496,9 @@ class be {
2295
2496
  get caption() {
2296
2497
  return this.data.caption;
2297
2498
  }
2499
+ get sourceCaption() {
2500
+ return this.data.sourceCaption || this.caption;
2501
+ }
2298
2502
  get url() {
2299
2503
  return this.data.url;
2300
2504
  }
@@ -2302,7 +2506,7 @@ class be {
2302
2506
  return this.data.aiChat;
2303
2507
  }
2304
2508
  }
2305
- class Ve {
2509
+ class We {
2306
2510
  constructor(e) {
2307
2511
  this.material = e;
2308
2512
  }
@@ -2319,33 +2523,130 @@ class Ve {
2319
2523
  return this.material.data;
2320
2524
  }
2321
2525
  }
2322
- const Q = new $("chat-toolbar"), Ke = (n) => {
2526
+ const L = new N("chat-toolbar-item"), xi = (n) => {
2527
+ var f, m, b;
2528
+ const {
2529
+ model: e,
2530
+ data: t,
2531
+ className: i,
2532
+ disabled: s = !1,
2533
+ buttonType: o = "default",
2534
+ onClick: r
2535
+ } = n, [a, u] = ne(!1), h = P(null), p = (g) => typeof g.hidden == "function" ? g.hidden(t) : g.hidden === !0;
2536
+ if (p(e))
2537
+ return c(Y, {});
2538
+ const l = (g) => s ? !0 : typeof g.disabled == "function" ? g.disabled(t) : g.disabled === !0, v = (g) => {
2539
+ var T, C, S, O;
2540
+ if (typeof g.icon == "function")
2541
+ return g.icon();
2542
+ if ((T = g.icon) != null && T.showIcon && ((C = g.icon) != null && C.cssClass))
2543
+ return c("i", {
2544
+ className: g.icon.cssClass
2545
+ });
2546
+ if ((S = g.icon) != null && S.showIcon && ((O = g.icon) != null && O.imagePath))
2547
+ return tt(g.icon.imagePath) ? c("div", {
2548
+ dangerouslySetInnerHTML: {
2549
+ __html: g.icon.imagePath
2550
+ }
2551
+ }) : c("img", {
2552
+ src: g.icon.imagePath
2553
+ });
2554
+ }, _ = (g) => {
2555
+ l(e) || u(!0);
2556
+ }, d = (g, T) => {
2557
+ l(T) || (u(!1), r(g, T));
2558
+ };
2559
+ return H(() => {
2560
+ const g = (T) => {
2561
+ h.current && h.current.contains(T.target) || u(!1);
2562
+ };
2563
+ return a && document.addEventListener("mousedown", g), () => {
2564
+ document.removeEventListener("mousedown", g);
2565
+ };
2566
+ }, [a]), c("div", {
2567
+ className: "".concat(L.b(), " ").concat(L.b(o), " ").concat(e.customClass || "", " ").concat(i || "", " ").concat(L.is("disabled", l(e)), " ").concat(L.is("more", !!((f = e.children) != null && f.length))),
2568
+ children: [c("div", {
2569
+ title: e.title,
2570
+ className: L.e("content"),
2571
+ onClick: (g) => d(g, e),
2572
+ children: [c("div", {
2573
+ className: L.em("content", "icon"),
2574
+ children: v(e)
2575
+ }), c("div", {
2576
+ className: L.em("content", "label"),
2577
+ children: e.label
2578
+ })]
2579
+ }), ((m = e.children) == null ? void 0 : m.length) && c("div", {
2580
+ title: "更多",
2581
+ className: L.e("more"),
2582
+ onClick: _,
2583
+ children: c("i", {
2584
+ "aria-hidden": "true",
2585
+ className: "fa fa-angle-down ".concat(L.em("more", "icon"))
2586
+ })
2587
+ }), a && c("div", {
2588
+ ref: h,
2589
+ className: L.b("dropdown"),
2590
+ children: (b = e.children) == null ? void 0 : b.map((g, T) => {
2591
+ if (!p(g))
2592
+ return c("div", {
2593
+ title: g.title,
2594
+ onClick: (C) => d(C, g),
2595
+ className: "".concat(L.be("dropdown", "item"), " ").concat(g.customClass || "", " ").concat(L.is("disabled", l(g))),
2596
+ children: [c("div", {
2597
+ className: L.bem("dropdown", "item", "icon"),
2598
+ children: v(g)
2599
+ }), c("div", {
2600
+ className: L.bem("dropdown", "item", "label"),
2601
+ children: g.label
2602
+ })]
2603
+ }, T);
2604
+ })
2605
+ })]
2606
+ });
2607
+ };
2608
+ const Si = new N("chat-toolbar"), Je = (n) => {
2323
2609
  const {
2324
2610
  controller: e,
2325
2611
  items: t = [],
2326
2612
  data: i,
2327
2613
  type: s,
2328
2614
  className: o
2329
- } = n;
2330
- let r = [], a = "default";
2615
+ } = n, r = on(ot);
2616
+ let a = [];
2331
2617
  const u = [{
2332
- label: "新建对话",
2333
- title: "新建对话",
2334
- icon: () => c(Kn, {}),
2618
+ label: "重置对话",
2619
+ title: "重置对话",
2620
+ icon: () => c(di, {}),
2335
2621
  onClick: () => {
2336
- e.newDialogue();
2337
- }
2338
- }], f = H(() => n.controller.materials.value.length > 0), d = [{
2622
+ e.resetTopic();
2623
+ },
2624
+ children: [{
2625
+ label: "清空对话",
2626
+ title: "清空对话",
2627
+ icon: () => c(ui, {}),
2628
+ onClick: () => {
2629
+ e.clearTopic();
2630
+ }
2631
+ }, {
2632
+ label: "新建对话",
2633
+ title: "新建对话",
2634
+ icon: () => c(Kn, {}),
2635
+ onClick: () => {
2636
+ r.newTopic && r.newTopic();
2637
+ }
2638
+ }]
2639
+ }], h = [{
2339
2640
  label: "刷新",
2340
2641
  title: "刷新",
2341
- icon: () => c(gt, {}),
2642
+ icon: () => c(wt, {}),
2342
2643
  onClick: () => {
2343
2644
  e.refreshMessage(i);
2344
2645
  }
2345
2646
  }, {
2346
2647
  label: "删除",
2347
2648
  title: "删除",
2348
- icon: () => c(qn, {}),
2649
+ icon: () => c(jn, {}),
2349
2650
  onClick: () => {
2350
2651
  e.deleteMessage(i);
2351
2652
  }
@@ -2357,7 +2658,7 @@ const Q = new $("chat-toolbar"), Ke = (n) => {
2357
2658
  e.copyMessage(i);
2358
2659
  }
2359
2660
  }];
2360
- sn(st).enableBackFill && d.unshift({
2661
+ r.enableBackFill && h.unshift({
2361
2662
  label: "回填",
2362
2663
  title: "回填",
2363
2664
  icon: () => c(Vn, {}),
@@ -2365,71 +2666,50 @@ const Q = new $("chat-toolbar"), Ke = (n) => {
2365
2666
  e.backfill(i);
2366
2667
  }
2367
2668
  });
2368
- const _ = [{
2669
+ const p = [{
2369
2670
  label: "刷新",
2370
2671
  title: "刷新",
2371
- icon: () => c(gt, {}),
2672
+ icon: () => c(wt, {}),
2372
2673
  onClick: () => {
2373
2674
  e.refreshMessage(i, !0);
2374
2675
  }
2375
2676
  }];
2376
2677
  if (s === "content")
2377
- switch (a = "circle", i.type) {
2678
+ switch (i.type) {
2378
2679
  case "DEFAULT":
2379
- i.role === "ASSISTANT" ? r = [...d, ...t] : r = [..._];
2680
+ i.role === "ASSISTANT" ? a = [...h, ...t] : a = [...p];
2380
2681
  break;
2381
2682
  case "ERROR":
2382
- r = [...d, ...t];
2683
+ a = [...h, ...t];
2383
2684
  break;
2384
2685
  }
2385
2686
  else
2386
- r = [...u, ...t];
2387
- const g = (m) => typeof m.hidden == "function" ? m.hidden(i) : m.hidden === !0, h = (m) => typeof m.disabled == "function" ? m.disabled(i) : m.disabled === !0, p = (m, y) => {
2388
- if (h(y))
2389
- return;
2390
- const T = {
2687
+ a = [...u, ...t];
2688
+ const l = (_, d) => {
2689
+ const f = {
2391
2690
  ...i
2392
2691
  };
2393
- if (i instanceof ie && (Object.assign(T, {
2692
+ if (i instanceof V && (Object.assign(f, {
2394
2693
  topic: e.topic
2395
- }), T.msg.realcontent = i.realcontent), y.onClick && typeof y.onClick == "function")
2396
- y.onClick(m, y, e.context, e.params, T);
2694
+ }), f.msg.realcontent = i.realcontent), d.onClick && typeof d.onClick == "function")
2695
+ d.onClick(_, d, e.context, e.params, f);
2397
2696
  else {
2398
- const C = n.controller.opts.extendToolbarClick;
2399
- C && typeof C == "function" && C(m, y, e.context, e.params, T);
2697
+ const m = n.controller.opts.extendToolbarClick;
2698
+ m && typeof m == "function" && m(_, d, e.context, e.params, f);
2400
2699
  }
2401
- }, v = P(() => s === "content" && (i == null ? void 0 : i.state) === 20 && (i == null ? void 0 : i.completed) !== !0, [i == null ? void 0 : i.state, i == null ? void 0 : i.completed]);
2700
+ }, v = X(() => s === "content" && (i == null ? void 0 : i.state) === 20 && (i == null ? void 0 : i.completed) !== !0, [i == null ? void 0 : i.state, i == null ? void 0 : i.completed]);
2402
2701
  return c("div", {
2403
- className: "".concat(Q.b(), " ").concat(Q.is("has-materials", f.value), " ").concat(Q.e(a), " ").concat(o || ""),
2404
- children: r.map((m, y) => {
2405
- var T, C, S;
2406
- if (!g(m))
2407
- return c("div", {
2408
- className: "".concat(Q.e("item"), " ").concat(Q.is("disabled", h(m) || v), " ").concat(o || ""),
2409
- title: m.title,
2410
- onClick: (A) => p(A, m),
2411
- children: [c("div", {
2412
- className: "".concat(Q.em("item", "icon")),
2413
- children: typeof m.icon == "function" ? m.icon() : ((T = m.icon) == null ? void 0 : T.showIcon) && c(V, {
2414
- children: (C = m.icon) != null && C.cssClass ? c("i", {
2415
- className: m.icon.cssClass
2416
- }) : (S = m.icon) != null && S.imagePath ? tt(m.icon.imagePath) ? c("div", {
2417
- dangerouslySetInnerHTML: {
2418
- __html: m.icon.imagePath
2419
- }
2420
- }) : c("img", {
2421
- src: m.icon.imagePath
2422
- }) : null
2423
- })
2424
- }), c("div", {
2425
- className: "".concat(Q.em("item", "label")),
2426
- children: m.label
2427
- })]
2428
- }, y);
2429
- })
2702
+ className: "".concat(Si.b(), " ").concat(o || ""),
2703
+ children: a.map((_, d) => c(xi, {
2704
+ data: i,
2705
+ model: _,
2706
+ disabled: v,
2707
+ buttonType: s === "content" ? "circle" : "default",
2708
+ onClick: l.bind(void 0)
2709
+ }, d))
2430
2710
  });
2431
2711
  };
2432
- function gi(n, e) {
2712
+ function ki(n, e) {
2433
2713
  let t = null;
2434
2714
  return function(...i) {
2435
2715
  t || (t = setTimeout(() => {
@@ -2437,93 +2717,96 @@ function gi(n, e) {
2437
2717
  }, e));
2438
2718
  };
2439
2719
  }
2440
- const wi = (n) => {
2441
- const e = U(!1), t = U({}), i = new $("chat-back-bottom"), s = U(null), o = () => {
2720
+ const Ei = (n) => {
2721
+ const e = z(!1), t = z({}), i = new N("chat-back-bottom"), s = z(null), o = () => {
2442
2722
  if (s.value) {
2443
- const u = n.visibilityHeight || 200, f = s.value.scrollHeight - s.value.scrollTop - s.value.offsetHeight;
2444
- e.value = f >= u;
2723
+ const u = n.visibilityHeight || 200, h = s.value.scrollHeight - s.value.scrollTop - s.value.offsetHeight;
2724
+ e.value = h >= u;
2445
2725
  }
2446
2726
  }, r = () => {
2447
- s.value && s.value.scrollTo({
2727
+ var u;
2728
+ s.value && (s.value.scrollTo({
2448
2729
  top: s.value.scrollHeight,
2449
2730
  behavior: "smooth"
2450
- });
2451
- }, a = gi(o, 300);
2452
- return P(() => {
2731
+ }), (u = n.onClick) == null || u.call(n));
2732
+ }, a = ki(o, 300);
2733
+ return X(() => {
2453
2734
  t.value = {
2454
2735
  right: "".concat(n.right, "px"),
2455
2736
  bottom: "".concat(n.bottom, "px")
2456
2737
  };
2457
- }, [n.right, n.bottom]), O(() => {
2738
+ }, [n.right, n.bottom]), H(() => {
2458
2739
  var u;
2459
2740
  if (n.target) {
2460
- const f = (u = document.querySelector(n.target)) != null ? u : void 0;
2461
- f && (s.value = f, f.addEventListener("scroll", a), o());
2741
+ const h = (u = document.querySelector(n.target)) != null ? u : void 0;
2742
+ h && (s.value = h, h.addEventListener("scroll", a), o());
2462
2743
  }
2463
2744
  }, []), c("div", {
2464
2745
  className: "".concat(i.b(), " ").concat(i.is("visible", e.value)),
2465
2746
  style: t.value,
2466
2747
  onClick: r,
2467
- children: c(ci, {
2748
+ children: c(li, {
2468
2749
  className: i.e("icon")
2469
2750
  })
2470
2751
  });
2471
2752
  };
2472
- const bt = new $("chat-messages"), yt = (n) => {
2473
- const e = B(null), t = n.controller.messages, i = B(!1), s = () => {
2474
- const r = e.current;
2475
- r && (i.current || r.scrollTo({
2476
- top: r.scrollHeight,
2477
- behavior: "smooth"
2478
- }));
2753
+ const yt = new N("chat-messages"), Ct = (n) => {
2754
+ const e = P(null), [t, i] = ne(!0), s = P(!1), o = n.controller.messages, r = () => {
2755
+ const h = e.current;
2756
+ h && (s.current = !0, h.scrollTo({
2757
+ top: h.scrollHeight,
2758
+ behavior: "auto"
2759
+ }), setTimeout(() => {
2760
+ s.current = !1;
2761
+ }, 500));
2479
2762
  };
2480
- Fn(() => {
2481
- t.value.length !== 0 && (t.value[t.value.length - 1].role === "USER" ? (i.current = !1, setTimeout(() => {
2482
- s();
2483
- }, 100)) : s());
2484
- });
2485
- const o = () => {
2486
- const r = e.current;
2487
- if (!r)
2488
- return;
2489
- const {
2490
- scrollTop: a,
2491
- scrollHeight: u,
2492
- clientHeight: f
2493
- } = r;
2494
- u - (a + f) < 50 ? i.current = !1 : i.current = !0;
2763
+ H(() => {
2764
+ t && r();
2765
+ }, [o.value]);
2766
+ const a = () => {
2767
+ if (!s.current && e.current) {
2768
+ const {
2769
+ scrollTop: h,
2770
+ scrollHeight: p,
2771
+ clientHeight: l
2772
+ } = e.current, v = p - (h + l) < 50;
2773
+ i(v);
2774
+ }
2775
+ }, u = () => {
2776
+ s.current = !0, i(!0);
2495
2777
  };
2496
2778
  return c("div", {
2497
2779
  ref: e,
2498
- className: bt.b(),
2499
- onScroll: o,
2500
- children: [t.value.map((r) => {
2501
- var u;
2502
- const a = ((u = r.content) == null ? void 0 : u.length) || 0;
2503
- return r.role !== "SYSTEM" ? c(mi, {
2504
- size: a,
2505
- message: r,
2780
+ className: yt.b(),
2781
+ onScroll: a,
2782
+ children: [o.value.map((h) => {
2783
+ var l;
2784
+ const p = ((l = h.content) == null ? void 0 : l.length) || 0;
2785
+ return h.role !== "SYSTEM" ? c(Ti, {
2786
+ size: p,
2787
+ message: h,
2506
2788
  controller: n.controller,
2507
- children: c(Ke, {
2508
- data: r,
2789
+ children: c(Je, {
2790
+ data: h,
2509
2791
  type: "content",
2510
2792
  items: n.toolbarItems,
2511
2793
  controller: n.controller
2512
2794
  })
2513
- }, r.messageid) : null;
2514
- }), c(wi, {
2795
+ }, h.messageid) : null;
2796
+ }), c(Ei, {
2515
2797
  right: 20,
2516
2798
  bottom: 14,
2517
- target: ".".concat(bt.b())
2799
+ target: ".".concat(yt.b()),
2800
+ onClick: u
2518
2801
  })]
2519
2802
  });
2520
2803
  };
2521
- function bi(n, e) {
2804
+ function Ni(n, e) {
2522
2805
  for (var t in e)
2523
2806
  n[t] = e[t];
2524
2807
  return n;
2525
2808
  }
2526
- function Ct(n, e) {
2809
+ function Tt(n, e) {
2527
2810
  for (var t in n)
2528
2811
  if (t !== "__source" && !(t in e))
2529
2812
  return !0;
@@ -2532,73 +2815,73 @@ function Ct(n, e) {
2532
2815
  return !0;
2533
2816
  return !1;
2534
2817
  }
2535
- function Tt(n) {
2818
+ function xt(n) {
2536
2819
  this.props = n;
2537
2820
  }
2538
- (Tt.prototype = new L()).isPureReactComponent = !0, Tt.prototype.shouldComponentUpdate = function(n, e) {
2539
- return Ct(this.props, n) || Ct(this.state, e);
2821
+ (xt.prototype = new F()).isPureReactComponent = !0, xt.prototype.shouldComponentUpdate = function(n, e) {
2822
+ return Tt(this.props, n) || Tt(this.state, e);
2540
2823
  };
2541
- var xt = w.__b;
2824
+ var St = w.__b;
2542
2825
  w.__b = function(n) {
2543
- n.type && n.type.__f && n.ref && (n.props.ref = n.ref, n.ref = null), xt && xt(n);
2826
+ n.type && n.type.__f && n.ref && (n.props.ref = n.ref, n.ref = null), St && St(n);
2544
2827
  };
2545
- var yi = w.__e;
2828
+ var Mi = w.__e;
2546
2829
  w.__e = function(n, e, t, i) {
2547
2830
  if (n.then) {
2548
2831
  for (var s, o = e; o = o.__; )
2549
2832
  if ((s = o.__c) && s.__c)
2550
2833
  return e.__e == null && (e.__e = t.__e, e.__k = t.__k), s.__c(n, e);
2551
2834
  }
2552
- yi(n, e, t, i);
2835
+ Mi(n, e, t, i);
2553
2836
  };
2554
- var St = w.unmount;
2837
+ var kt = w.unmount;
2555
2838
  function _n(n, e, t) {
2556
2839
  return n && (n.__c && n.__c.__H && (n.__c.__H.__.forEach(function(i) {
2557
2840
  typeof i.__c == "function" && i.__c();
2558
- }), n.__c.__H = null), (n = bi({}, n)).__c != null && (n.__c.__P === t && (n.__c.__P = e), n.__c = null), n.__k = n.__k && n.__k.map(function(i) {
2841
+ }), n.__c.__H = null), (n = Ni({}, n)).__c != null && (n.__c.__P === t && (n.__c.__P = e), n.__c = null), n.__k = n.__k && n.__k.map(function(i) {
2559
2842
  return _n(i, e, t);
2560
2843
  })), n;
2561
2844
  }
2562
- function mn(n, e, t) {
2845
+ function gn(n, e, t) {
2563
2846
  return n && t && (n.__v = null, n.__k = n.__k && n.__k.map(function(i) {
2564
- return mn(i, e, t);
2847
+ return gn(i, e, t);
2565
2848
  }), n.__c && n.__c.__P === e && (n.__e && t.insertBefore(n.__e, n.__d), n.__c.__e = !0, n.__c.__P = t)), n;
2566
2849
  }
2567
- function je() {
2850
+ function Ve() {
2568
2851
  this.__u = 0, this.t = null, this.__b = null;
2569
2852
  }
2570
- function gn(n) {
2853
+ function wn(n) {
2571
2854
  var e = n.__.__c;
2572
2855
  return e && e.__a && e.__a(n);
2573
2856
  }
2574
- function ye() {
2857
+ function Ce() {
2575
2858
  this.u = null, this.o = null;
2576
2859
  }
2577
2860
  w.unmount = function(n) {
2578
2861
  var e = n.__c;
2579
- e && e.__R && e.__R(), e && n.__h === !0 && (n.type = null), St && St(n);
2580
- }, (je.prototype = new L()).__c = function(n, e) {
2862
+ e && e.__R && e.__R(), e && n.__h === !0 && (n.type = null), kt && kt(n);
2863
+ }, (Ve.prototype = new F()).__c = function(n, e) {
2581
2864
  var t = e.__c, i = this;
2582
2865
  i.t == null && (i.t = []), i.t.push(t);
2583
- var s = gn(i.__v), o = !1, r = function() {
2866
+ var s = wn(i.__v), o = !1, r = function() {
2584
2867
  o || (o = !0, t.__R = null, s ? s(a) : a());
2585
2868
  };
2586
2869
  t.__R = r;
2587
2870
  var a = function() {
2588
2871
  if (!--i.__u) {
2589
2872
  if (i.state.__a) {
2590
- var f = i.state.__a;
2591
- i.__v.__k[0] = mn(f, f.__c.__P, f.__c.__O);
2873
+ var h = i.state.__a;
2874
+ i.__v.__k[0] = gn(h, h.__c.__P, h.__c.__O);
2592
2875
  }
2593
- var d;
2594
- for (i.setState({ __a: i.__b = null }); d = i.t.pop(); )
2595
- d.forceUpdate();
2876
+ var p;
2877
+ for (i.setState({ __a: i.__b = null }); p = i.t.pop(); )
2878
+ p.forceUpdate();
2596
2879
  }
2597
2880
  }, u = e.__h === !0;
2598
2881
  i.__u++ || u || i.setState({ __a: i.__b = i.__v.__k[0] }), n.then(r, r);
2599
- }, je.prototype.componentWillUnmount = function() {
2882
+ }, Ve.prototype.componentWillUnmount = function() {
2600
2883
  this.t = [];
2601
- }, je.prototype.render = function(n, e) {
2884
+ }, Ve.prototype.render = function(n, e) {
2602
2885
  if (this.__b) {
2603
2886
  if (this.__v.__k) {
2604
2887
  var t = document.createElement("div"), i = this.__v.__k[0].__c;
@@ -2606,10 +2889,10 @@ w.unmount = function(n) {
2606
2889
  }
2607
2890
  this.__b = null;
2608
2891
  }
2609
- var s = e.__a && W(V, null, n.fallback);
2610
- return s && (s.__h = null), [W(V, null, e.__a ? null : n.children), s];
2892
+ var s = e.__a && j(Y, null, n.fallback);
2893
+ return s && (s.__h = null), [j(Y, null, e.__a ? null : n.children), s];
2611
2894
  };
2612
- var kt = function(n, e, t) {
2895
+ var Et = function(n, e, t) {
2613
2896
  if (++t[1] === t[0] && n.o.delete(e), n.props.revealOrder && (n.props.revealOrder[0] !== "t" || !n.o.size))
2614
2897
  for (t = n.u; t; ) {
2615
2898
  for (; t.length > 3; )
@@ -2619,157 +2902,157 @@ var kt = function(n, e, t) {
2619
2902
  n.u = t = t[2];
2620
2903
  }
2621
2904
  };
2622
- function Ci(n) {
2905
+ function $i(n) {
2623
2906
  return this.getChildContext = function() {
2624
2907
  return n.context;
2625
2908
  }, n.children;
2626
2909
  }
2627
- function Ti(n) {
2910
+ function Ai(n) {
2628
2911
  var e = this, t = n.i;
2629
2912
  e.componentWillUnmount = function() {
2630
- se(null, e.l), e.l = null, e.i = null;
2913
+ oe(null, e.l), e.l = null, e.i = null;
2631
2914
  }, e.i && e.i !== t && e.componentWillUnmount(), e.l || (e.i = t, e.l = { nodeType: 1, parentNode: t, childNodes: [], appendChild: function(i) {
2632
2915
  this.childNodes.push(i), e.i.appendChild(i);
2633
2916
  }, insertBefore: function(i, s) {
2634
2917
  this.childNodes.push(i), e.i.appendChild(i);
2635
2918
  }, removeChild: function(i) {
2636
2919
  this.childNodes.splice(this.childNodes.indexOf(i) >>> 1, 1), e.i.removeChild(i);
2637
- } }), se(W(Ci, { context: e.context }, n.__v), e.l);
2920
+ } }), oe(j($i, { context: e.context }, n.__v), e.l);
2638
2921
  }
2639
- function xi(n, e) {
2640
- var t = W(Ti, { __v: n, i: e });
2922
+ function Ii(n, e) {
2923
+ var t = j(Ai, { __v: n, i: e });
2641
2924
  return t.containerInfo = e, t;
2642
2925
  }
2643
- (ye.prototype = new L()).__a = function(n) {
2644
- var e = this, t = gn(e.__v), i = e.o.get(n);
2926
+ (Ce.prototype = new F()).__a = function(n) {
2927
+ var e = this, t = wn(e.__v), i = e.o.get(n);
2645
2928
  return i[0]++, function(s) {
2646
2929
  var o = function() {
2647
- e.props.revealOrder ? (i.push(s), kt(e, n, i)) : s();
2930
+ e.props.revealOrder ? (i.push(s), Et(e, n, i)) : s();
2648
2931
  };
2649
2932
  t ? t(o) : o();
2650
2933
  };
2651
- }, ye.prototype.render = function(n) {
2934
+ }, Ce.prototype.render = function(n) {
2652
2935
  this.u = null, this.o = /* @__PURE__ */ new Map();
2653
2936
  var e = Ee(n.children);
2654
2937
  n.revealOrder && n.revealOrder[0] === "b" && e.reverse();
2655
2938
  for (var t = e.length; t--; )
2656
2939
  this.o.set(e[t], this.u = [1, 0, this.u]);
2657
2940
  return n.children;
2658
- }, ye.prototype.componentDidUpdate = ye.prototype.componentDidMount = function() {
2941
+ }, Ce.prototype.componentDidUpdate = Ce.prototype.componentDidMount = function() {
2659
2942
  var n = this;
2660
2943
  this.o.forEach(function(e, t) {
2661
- kt(n, t, e);
2944
+ Et(n, t, e);
2662
2945
  });
2663
2946
  };
2664
- var Si = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, ki = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, Ei = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Ni = /[A-Z0-9]/g, $i = typeof document < "u", Mi = function(n) {
2947
+ var Di = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, Li = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, zi = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Hi = /[A-Z0-9]/g, Oi = typeof document < "u", Bi = function(n) {
2665
2948
  return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(n);
2666
2949
  };
2667
- L.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(n) {
2668
- Object.defineProperty(L.prototype, n, { configurable: !0, get: function() {
2950
+ F.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(n) {
2951
+ Object.defineProperty(F.prototype, n, { configurable: !0, get: function() {
2669
2952
  return this["UNSAFE_" + n];
2670
2953
  }, set: function(e) {
2671
2954
  Object.defineProperty(this, n, { configurable: !0, writable: !0, value: e });
2672
2955
  } });
2673
2956
  });
2674
- var Et = w.event;
2675
- function Ii() {
2957
+ var Nt = w.event;
2958
+ function Pi() {
2676
2959
  }
2677
- function Ai() {
2960
+ function Ri() {
2678
2961
  return this.cancelBubble;
2679
2962
  }
2680
- function Di() {
2963
+ function Fi() {
2681
2964
  return this.defaultPrevented;
2682
2965
  }
2683
2966
  w.event = function(n) {
2684
- return Et && (n = Et(n)), n.persist = Ii, n.isPropagationStopped = Ai, n.isDefaultPrevented = Di, n.nativeEvent = n;
2967
+ return Nt && (n = Nt(n)), n.persist = Pi, n.isPropagationStopped = Ri, n.isDefaultPrevented = Fi, n.nativeEvent = n;
2685
2968
  };
2686
- var zi = { enumerable: !1, configurable: !0, get: function() {
2969
+ var Ui = { enumerable: !1, configurable: !0, get: function() {
2687
2970
  return this.class;
2688
- } }, Nt = w.vnode;
2971
+ } }, Mt = w.vnode;
2689
2972
  w.vnode = function(n) {
2690
2973
  typeof n.type == "string" && function(e) {
2691
2974
  var t = e.props, i = e.type, s = {};
2692
2975
  for (var o in t) {
2693
2976
  var r = t[o];
2694
- if (!(o === "value" && "defaultValue" in t && r == null || $i && o === "children" && i === "noscript" || o === "class" || o === "className")) {
2977
+ if (!(o === "value" && "defaultValue" in t && r == null || Oi && o === "children" && i === "noscript" || o === "class" || o === "className")) {
2695
2978
  var a = o.toLowerCase();
2696
- o === "defaultValue" && "value" in t && t.value == null ? o = "value" : o === "download" && r === !0 ? r = "" : a === "ondoubleclick" ? o = "ondblclick" : a !== "onchange" || i !== "input" && i !== "textarea" || Mi(t.type) ? a === "onfocus" ? o = "onfocusin" : a === "onblur" ? o = "onfocusout" : Ei.test(o) ? o = a : i.indexOf("-") === -1 && ki.test(o) ? o = o.replace(Ni, "-$&").toLowerCase() : r === null && (r = void 0) : a = o = "oninput", a === "oninput" && s[o = a] && (o = "oninputCapture"), s[o] = r;
2979
+ o === "defaultValue" && "value" in t && t.value == null ? o = "value" : o === "download" && r === !0 ? r = "" : a === "ondoubleclick" ? o = "ondblclick" : a !== "onchange" || i !== "input" && i !== "textarea" || Bi(t.type) ? a === "onfocus" ? o = "onfocusin" : a === "onblur" ? o = "onfocusout" : zi.test(o) ? o = a : i.indexOf("-") === -1 && Li.test(o) ? o = o.replace(Hi, "-$&").toLowerCase() : r === null && (r = void 0) : a = o = "oninput", a === "oninput" && s[o = a] && (o = "oninputCapture"), s[o] = r;
2697
2980
  }
2698
2981
  }
2699
2982
  i == "select" && s.multiple && Array.isArray(s.value) && (s.value = Ee(t.children).forEach(function(u) {
2700
2983
  u.props.selected = s.value.indexOf(u.props.value) != -1;
2701
2984
  })), i == "select" && s.defaultValue != null && (s.value = Ee(t.children).forEach(function(u) {
2702
2985
  u.props.selected = s.multiple ? s.defaultValue.indexOf(u.props.value) != -1 : s.defaultValue == u.props.value;
2703
- })), t.class && !t.className ? (s.class = t.class, Object.defineProperty(s, "className", zi)) : (t.className && !t.class || t.class && t.className) && (s.class = s.className = t.className), e.props = s;
2704
- }(n), n.$$typeof = Si, Nt && Nt(n);
2986
+ })), t.class && !t.className ? (s.class = t.class, Object.defineProperty(s, "className", Ui)) : (t.className && !t.class || t.class && t.className) && (s.class = s.className = t.className), e.props = s;
2987
+ }(n), n.$$typeof = Di, Mt && Mt(n);
2705
2988
  };
2706
2989
  var $t = w.__r;
2707
2990
  w.__r = function(n) {
2708
2991
  $t && $t(n), n.__c;
2709
2992
  };
2710
- var Mt = w.diffed;
2993
+ var At = w.diffed;
2711
2994
  w.diffed = function(n) {
2712
- Mt && Mt(n);
2995
+ At && At(n);
2713
2996
  var e = n.props, t = n.__e;
2714
2997
  t != null && n.type === "textarea" && "value" in e && e.value !== t.value && (t.value = e.value == null ? "" : e.value);
2715
2998
  };
2716
- var pe = /* @__PURE__ */ new Map();
2717
- function Hi(n) {
2718
- var e = pe.get(n);
2999
+ var me = /* @__PURE__ */ new Map();
3000
+ function Wi(n) {
3001
+ var e = me.get(n);
2719
3002
  e && e.destroy();
2720
3003
  }
2721
- function Li(n) {
2722
- var e = pe.get(n);
3004
+ function Vi(n) {
3005
+ var e = me.get(n);
2723
3006
  e && e.update();
2724
3007
  }
2725
- var de = null;
2726
- typeof window > "u" ? ((de = function(n) {
3008
+ var pe = null;
3009
+ typeof window > "u" ? ((pe = function(n) {
2727
3010
  return n;
2728
3011
  }).destroy = function(n) {
2729
3012
  return n;
2730
- }, de.update = function(n) {
3013
+ }, pe.update = function(n) {
2731
3014
  return n;
2732
- }) : ((de = function(n, e) {
3015
+ }) : ((pe = function(n, e) {
2733
3016
  return n && Array.prototype.forEach.call(n.length ? n : [n], function(t) {
2734
3017
  return function(i) {
2735
- if (i && i.nodeName && i.nodeName === "TEXTAREA" && !pe.has(i)) {
3018
+ if (i && i.nodeName && i.nodeName === "TEXTAREA" && !me.has(i)) {
2736
3019
  var s, o = null, r = window.getComputedStyle(i), a = (s = i.value, function() {
2737
- f({ testForHeightReduction: s === "" || !i.value.startsWith(s), restoreTextAlign: null }), s = i.value;
3020
+ h({ testForHeightReduction: s === "" || !i.value.startsWith(s), restoreTextAlign: null }), s = i.value;
2738
3021
  }), u = (function(l) {
2739
- i.removeEventListener("autosize:destroy", u), i.removeEventListener("autosize:update", d), i.removeEventListener("input", a), window.removeEventListener("resize", d), Object.keys(l).forEach(function(_) {
2740
- return i.style[_] = l[_];
2741
- }), pe.delete(i);
3022
+ i.removeEventListener("autosize:destroy", u), i.removeEventListener("autosize:update", p), i.removeEventListener("input", a), window.removeEventListener("resize", p), Object.keys(l).forEach(function(v) {
3023
+ return i.style[v] = l[v];
3024
+ }), me.delete(i);
2742
3025
  }).bind(i, { height: i.style.height, resize: i.style.resize, textAlign: i.style.textAlign, overflowY: i.style.overflowY, overflowX: i.style.overflowX, wordWrap: i.style.wordWrap });
2743
- i.addEventListener("autosize:destroy", u), i.addEventListener("autosize:update", d), i.addEventListener("input", a), window.addEventListener("resize", d), i.style.overflowX = "hidden", i.style.wordWrap = "break-word", pe.set(i, { destroy: u, update: d }), d();
3026
+ i.addEventListener("autosize:destroy", u), i.addEventListener("autosize:update", p), i.addEventListener("input", a), window.addEventListener("resize", p), i.style.overflowX = "hidden", i.style.wordWrap = "break-word", me.set(i, { destroy: u, update: p }), p();
2744
3027
  }
2745
- function f(l) {
2746
- var _, g, h = l.restoreTextAlign, p = h === void 0 ? null : h, v = l.testForHeightReduction, m = v === void 0 || v, y = r.overflowY;
2747
- if (i.scrollHeight !== 0 && (r.resize === "vertical" ? i.style.resize = "none" : r.resize === "both" && (i.style.resize = "horizontal"), m && (_ = function(C) {
3028
+ function h(l) {
3029
+ var v, _, d = l.restoreTextAlign, f = d === void 0 ? null : d, m = l.testForHeightReduction, b = m === void 0 || m, g = r.overflowY;
3030
+ if (i.scrollHeight !== 0 && (r.resize === "vertical" ? i.style.resize = "none" : r.resize === "both" && (i.style.resize = "horizontal"), b && (v = function(C) {
2748
3031
  for (var S = []; C && C.parentNode && C.parentNode instanceof Element; )
2749
3032
  C.parentNode.scrollTop && S.push([C.parentNode, C.parentNode.scrollTop]), C = C.parentNode;
2750
3033
  return function() {
2751
- return S.forEach(function(A) {
2752
- var D = A[0], R = A[1];
2753
- D.style.scrollBehavior = "auto", D.scrollTop = R, D.style.scrollBehavior = null;
3034
+ return S.forEach(function(O) {
3035
+ var I = O[0], U = O[1];
3036
+ I.style.scrollBehavior = "auto", I.scrollTop = U, I.style.scrollBehavior = null;
2754
3037
  });
2755
3038
  };
2756
- }(i), i.style.height = ""), g = r.boxSizing === "content-box" ? i.scrollHeight - (parseFloat(r.paddingTop) + parseFloat(r.paddingBottom)) : i.scrollHeight + parseFloat(r.borderTopWidth) + parseFloat(r.borderBottomWidth), r.maxHeight !== "none" && g > parseFloat(r.maxHeight) ? (r.overflowY === "hidden" && (i.style.overflow = "scroll"), g = parseFloat(r.maxHeight)) : r.overflowY !== "hidden" && (i.style.overflow = "hidden"), i.style.height = g + "px", p && (i.style.textAlign = p), _ && _(), o !== g && (i.dispatchEvent(new Event("autosize:resized", { bubbles: !0 })), o = g), y !== r.overflow && !p)) {
3039
+ }(i), i.style.height = ""), _ = r.boxSizing === "content-box" ? i.scrollHeight - (parseFloat(r.paddingTop) + parseFloat(r.paddingBottom)) : i.scrollHeight + parseFloat(r.borderTopWidth) + parseFloat(r.borderBottomWidth), r.maxHeight !== "none" && _ > parseFloat(r.maxHeight) ? (r.overflowY === "hidden" && (i.style.overflow = "scroll"), _ = parseFloat(r.maxHeight)) : r.overflowY !== "hidden" && (i.style.overflow = "hidden"), i.style.height = _ + "px", f && (i.style.textAlign = f), v && v(), o !== _ && (i.dispatchEvent(new Event("autosize:resized", { bubbles: !0 })), o = _), g !== r.overflow && !f)) {
2757
3040
  var T = r.textAlign;
2758
- r.overflow === "hidden" && (i.style.textAlign = T === "start" ? "end" : "start"), f({ restoreTextAlign: T, testForHeightReduction: !0 });
3041
+ r.overflow === "hidden" && (i.style.textAlign = T === "start" ? "end" : "start"), h({ restoreTextAlign: T, testForHeightReduction: !0 });
2759
3042
  }
2760
3043
  }
2761
- function d() {
2762
- f({ testForHeightReduction: !0, restoreTextAlign: null });
3044
+ function p() {
3045
+ h({ testForHeightReduction: !0, restoreTextAlign: null });
2763
3046
  }
2764
3047
  }(t);
2765
3048
  }), n;
2766
3049
  }).destroy = function(n) {
2767
- return n && Array.prototype.forEach.call(n.length ? n : [n], Hi), n;
2768
- }, de.update = function(n) {
2769
- return n && Array.prototype.forEach.call(n.length ? n : [n], Li), n;
3050
+ return n && Array.prototype.forEach.call(n.length ? n : [n], Wi), n;
3051
+ }, pe.update = function(n) {
3052
+ return n && Array.prototype.forEach.call(n.length ? n : [n], Vi), n;
2770
3053
  });
2771
- var It = de, M = /* @__PURE__ */ ((n) => (n.STYLE_CACHE = "ai-chat-style-cache", n.MINIMIZE_STYLY_CHCHE = "ai-chat-minimize-style-cache", n.DATA_BASE_NAME = "ibiz-chat", n.DATA_TABLE_NAME = "history-message", n.DATA_TABLE_KEY_NAME = "id", n))(M || {});
2772
- class At {
3054
+ var It = pe, M = /* @__PURE__ */ ((n) => (n.STYLE_CACHE = "ai-chat-style-cache", n.MINIMIZE_STYLY_CHCHE = "ai-chat-minimize-style-cache", n.DATA_BASE_NAME = "ibiz-chat", n.DATA_TABLE_NAME = "history-message", n.DATA_TABLE_KEY_NAME = "id", n))(M || {});
3055
+ class Dt {
2773
3056
  /**
2774
3057
  * 聊天窗触发提问回调
2775
3058
  *
@@ -2795,7 +3078,7 @@ class At {
2795
3078
  * @date 2023-10-16 16:10:29
2796
3079
  * @type {Signal<ChatMessage[]>}
2797
3080
  */
2798
- x(this, "messages", X([]));
3081
+ x(this, "messages", J([]));
2799
3082
  /**
2800
3083
  * 素材列表
2801
3084
  *
@@ -2803,7 +3086,7 @@ class At {
2803
3086
  * @date 2025-02-27 18:02:46
2804
3087
  * @type {Signal<IMaterial[]>}
2805
3088
  */
2806
- x(this, "materials", X([]));
3089
+ x(this, "materials", J([]));
2807
3090
  /**
2808
3091
  * 聊天框输入值
2809
3092
  *
@@ -2811,7 +3094,7 @@ class At {
2811
3094
  * @date 2023-10-16 15:10:43
2812
3095
  * @type {Signal<string>}
2813
3096
  */
2814
- x(this, "input", X(""));
3097
+ x(this, "input", J(""));
2815
3098
  /**
2816
3099
  * 是否加载中
2817
3100
  *
@@ -2819,7 +3102,7 @@ class At {
2819
3102
  * @date 2025-03-10 18:03:42
2820
3103
  * @type {Signal<boolean>}
2821
3104
  */
2822
- x(this, "isLoading", X(!1));
3105
+ x(this, "isLoading", J(!1));
2823
3106
  /**
2824
3107
  * 视图参数
2825
3108
  *
@@ -2871,7 +3154,7 @@ class At {
2871
3154
  */
2872
3155
  async fecthHistory() {
2873
3156
  if (this.topicId) {
2874
- const e = await Z.getData(M.DATA_BASE_NAME, M.DATA_TABLE_NAME, this.topicId);
3157
+ const e = await q.getData(M.DATA_BASE_NAME, M.DATA_TABLE_NAME, this.topicId);
2875
3158
  if (e && e.data && e.data.length > 0)
2876
3159
  return e.data.forEach((t) => {
2877
3160
  const i = {
@@ -2880,6 +3163,7 @@ class At {
2880
3163
  type: t.type,
2881
3164
  role: t.role,
2882
3165
  content: t.content,
3166
+ suggestions: t.suggestions,
2883
3167
  completed: !0
2884
3168
  };
2885
3169
  this.addMessage(i);
@@ -2904,7 +3188,7 @@ class At {
2904
3188
  data: this.messages.value.map((t) => t._origin),
2905
3189
  timestamp: (/* @__PURE__ */ new Date()).getTime()
2906
3190
  };
2907
- await Z.updateData(M.DATA_BASE_NAME, M.DATA_TABLE_NAME, e);
3191
+ await q.updateData(M.DATA_BASE_NAME, M.DATA_TABLE_NAME, e);
2908
3192
  }
2909
3193
  /**
2910
3194
  * 设置聊天框值
@@ -2925,7 +3209,7 @@ class At {
2925
3209
  */
2926
3210
  addMessage(e) {
2927
3211
  const t = this.messages.value.find((i) => i.messageid === e.messageid);
2928
- t ? (t.update(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new ie(e)], this.asyncToIndexDB();
3212
+ t ? (t.update(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new V(e)], this.asyncToIndexDB();
2929
3213
  }
2930
3214
  /**
2931
3215
  * 更新消息完成状态
@@ -2948,7 +3232,14 @@ class At {
2948
3232
  */
2949
3233
  replaceMessage(e) {
2950
3234
  const t = this.messages.value.findIndex((i) => i.messageid === e.messageid);
2951
- t !== -1 ? (this.messages.value[t] = new ie(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new ie(e)], this.asyncToIndexDB();
3235
+ t !== -1 ? (this.messages.value[t] = new V(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new V(e)], this.asyncToIndexDB(), e.type === "DEFAULT" && this.opts.recommendPrompt && this.opts.recommendPrompt(this.context, this.params, {
3236
+ appDataEntityId: this.appDataEntityId,
3237
+ message: {
3238
+ messages: [e]
3239
+ }
3240
+ }).then((i) => {
3241
+ i && i.content && this.updateRecommendPrompt(e, i.content);
3242
+ });
2952
3243
  }
2953
3244
  /**
2954
3245
  * 终止消息
@@ -2961,9 +3252,9 @@ class At {
2961
3252
  const t = this.messages.value.findIndex((i) => i.messageid === e.messageid);
2962
3253
  if (t !== -1) {
2963
3254
  const i = this.messages.value[t];
2964
- e.content = i.content, this.messages.value[t] = new ie(e), this.messages.value = [...this.messages.value];
3255
+ e.content = i.content, this.messages.value[t] = new V(e), this.messages.value = [...this.messages.value];
2965
3256
  } else
2966
- this.messages.value = [...this.messages.value, new ie(e)];
3257
+ this.messages.value = [...this.messages.value, new V(e)];
2967
3258
  this.asyncToIndexDB();
2968
3259
  }
2969
3260
  /**
@@ -2982,7 +3273,7 @@ class At {
2982
3273
  s.state && s.state === "successed" && t.push(i);
2983
3274
  } else
2984
3275
  t.push(i);
2985
- }), this.materials.value = []), t && t.length > 0 && (e = en.stringify(t)), e;
3276
+ }), this.materials.value = []), t && t.length > 0 && (e = tn.stringify(t)), e;
2986
3277
  }
2987
3278
  /**
2988
3279
  * 提问
@@ -2993,11 +3284,14 @@ class At {
2993
3284
  */
2994
3285
  async question(e) {
2995
3286
  try {
2996
- this.isLoading.value = !0;
3287
+ this.isLoading.value = !0, this.messages.value.forEach((i, s) => {
3288
+ const o = i._origin;
3289
+ o.suggestions && (o.suggestions = void 0, this.messages.value[s] = new V(o));
3290
+ }), this.messages.value = [...this.messages.value], this.asyncToIndexDB();
2997
3291
  let t = this.stringlyMaterialResource();
2998
3292
  t ? t += "\n".concat(e) : t = e, this.addMessage({
2999
3293
  state: 30,
3000
- messageid: Kt(),
3294
+ messageid: et(),
3001
3295
  role: "USER",
3002
3296
  type: "DEFAULT",
3003
3297
  content: t
@@ -3076,18 +3370,27 @@ class At {
3076
3370
  */
3077
3371
  copyMessage(e) {
3078
3372
  const t = e.realcontent;
3079
- Qt.copy(t), this.opts.action && this.opts.action("copymsg", e);
3373
+ en.copy(t), this.opts.action && this.opts.action("copymsg", e);
3080
3374
  }
3081
3375
  /**
3082
- * 新建对话
3376
+ * 重置对话
3083
3377
  *
3084
3378
  * @memberof AiChatController
3085
3379
  */
3086
- async newDialogue() {
3087
- this.topicId && await Z.deleteData(M.DATA_BASE_NAME, M.DATA_TABLE_NAME, this.topicId), this.messages.value = [], this.opts.history(this.context, this.params, {
3380
+ async resetTopic() {
3381
+ this.topicId && await q.deleteData(M.DATA_BASE_NAME, M.DATA_TABLE_NAME, this.topicId), this.messages.value = [], this.opts.history(this.context, this.params, {
3088
3382
  appDataEntityId: this.appDataEntityId
3089
3383
  });
3090
3384
  }
3385
+ /**
3386
+ * 清空对话
3387
+ *
3388
+ * @author tony001
3389
+ * @date 2025-03-18 17:03:57
3390
+ */
3391
+ async clearTopic() {
3392
+ this.topicId && await q.deleteData(M.DATA_BASE_NAME, M.DATA_TABLE_NAME, this.topicId), this.messages.value = [];
3393
+ }
3091
3394
  /**
3092
3395
  * 新增素材资源
3093
3396
  *
@@ -3096,7 +3399,7 @@ class At {
3096
3399
  * @param {IMaterial} data
3097
3400
  */
3098
3401
  addMaterial(e) {
3099
- this.materials.value.find((i) => i.id === e.id) ? this.materials.value = [...this.materials.value] : this.materials.value = [...this.materials.value, new Ve(e)];
3402
+ this.materials.value.find((i) => i.id === e.id) ? this.materials.value = [...this.materials.value] : this.materials.value = [...this.materials.value, new We(e)];
3100
3403
  }
3101
3404
  /**
3102
3405
  * 替换素材资源
@@ -3108,7 +3411,7 @@ class At {
3108
3411
  */
3109
3412
  replaceMaterial(e, t) {
3110
3413
  const i = this.materials.value.findIndex((s) => s.id === e);
3111
- i !== -1 ? (this.materials.value[i] = new Ve(t), this.materials.value = [...this.materials.value]) : this.materials.value = [...this.materials.value, new Ve(t)];
3414
+ i !== -1 ? (this.materials.value[i] = new We(t), this.materials.value = [...this.materials.value]) : this.materials.value = [...this.materials.value, new We(t)];
3112
3415
  }
3113
3416
  /**
3114
3417
  * 删除指定素材资源
@@ -3121,8 +3424,66 @@ class At {
3121
3424
  const t = this.materials.value.findIndex((i) => i.id === e.id);
3122
3425
  t !== -1 && (this.materials.value.splice(t, 1), this.materials.value = [...this.materials.value]);
3123
3426
  }
3427
+ /**
3428
+ * 更新指定消息推荐提示
3429
+ *
3430
+ * @author tony001
3431
+ * @date 2025-03-19 11:03:47
3432
+ * @param {IChatMessage} data
3433
+ * @param {string} suggestionStr
3434
+ */
3435
+ updateRecommendPrompt(e, t) {
3436
+ if (!t)
3437
+ return;
3438
+ const i = this.messages.value.findIndex((o) => o.messageid === e.messageid), {
3439
+ suggestions: s
3440
+ } = zn.parseMixedContent(t);
3441
+ s && s.length > 0 && (e.suggestions = s, i !== -1 ? (this.messages.value[i] = new V(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new V(e)], this.asyncToIndexDB());
3442
+ }
3443
+ /**
3444
+ * 处理建议点击
3445
+ *
3446
+ * @author tony001
3447
+ * @date 2025-03-19 12:03:25
3448
+ * @param {IChatMessage} message
3449
+ * @param {IChatSuggestion} suggestion
3450
+ * @param {MouseEvent} event
3451
+ * @return {*} {Promise<void>}
3452
+ */
3453
+ async handleSuggestionClick(e, t, i) {
3454
+ const s = this.messages.value.findIndex((r) => r.messageid === e.messageid);
3455
+ if (s !== -1) {
3456
+ const r = this.messages.value[s]._origin;
3457
+ r.suggestions = void 0, this.messages.value[s] = new V(r), this.messages.value = [...this.messages.value];
3458
+ }
3459
+ this.asyncToIndexDB();
3460
+ const {
3461
+ type: o
3462
+ } = t;
3463
+ switch (o) {
3464
+ case "action":
3465
+ if (this.opts.extendToolbarClick) {
3466
+ const r = t.data.actionid;
3467
+ if (!r)
3468
+ throw new Error("actionid不能为空");
3469
+ if (this.opts.otherToolbarItems && this.opts.otherToolbarItems.length > 0) {
3470
+ const a = this.opts.otherToolbarItems.find((u) => u.id === r);
3471
+ if (!a)
3472
+ throw new Error("未找到".concat(r, "标识界面行为"));
3473
+ await this.opts.extendToolbarClick(i, a, this.context, this.params, e);
3474
+ } else
3475
+ throw new Error("未找到".concat(r, "标识界面行为"));
3476
+ }
3477
+ break;
3478
+ case "raw":
3479
+ await this.question(t.data.content);
3480
+ break;
3481
+ default:
3482
+ throw new Error("不支持".concat(o, "推荐类型"));
3483
+ }
3484
+ }
3124
3485
  }
3125
- class Oi {
3486
+ class qi {
3126
3487
  /**
3127
3488
  * Creates an instance of AiTopicController.
3128
3489
  * @author tony001
@@ -3137,7 +3498,7 @@ class Oi {
3137
3498
  * @date 2025-02-20 16:02:38
3138
3499
  * @type {Signal<ChatTopic[]>}
3139
3500
  */
3140
- x(this, "topics", X([]));
3501
+ x(this, "topics", J([]));
3141
3502
  /**
3142
3503
  * 激活话题
3143
3504
  *
@@ -3145,7 +3506,7 @@ class Oi {
3145
3506
  * @date 2025-02-24 16:02:44
3146
3507
  * @type {(Signal<ITopic | null>)}
3147
3508
  */
3148
- x(this, "activedTopic", X(null));
3509
+ x(this, "activedTopic", J(null));
3149
3510
  /**
3150
3511
  * 当前话题配置备份
3151
3512
  *
@@ -3167,7 +3528,7 @@ class Oi {
3167
3528
  async fetchHistory(e) {
3168
3529
  const i = await e.configService(e.appid, "aitopics", e.type).load();
3169
3530
  i && i.length > 0 && i.forEach((s) => {
3170
- this.topics.value = [...this.topics.value, new be(s)];
3531
+ this.topics.value = [...this.topics.value, new he(s)];
3171
3532
  });
3172
3533
  }
3173
3534
  /**
@@ -3180,13 +3541,14 @@ class Oi {
3180
3541
  */
3181
3542
  async updateCurrentTopic(e) {
3182
3543
  this.currentTopicOptions = e;
3183
- const t = this.topics.value.findIndex((r) => r.id === e.id), i = new be(e);
3184
- t !== -1 ? this.topics.value.splice(t, 1, new be(e)) : this.topics.value = [...this.topics.value, new be(e)];
3544
+ const t = this.topics.value.findIndex((r) => r.id === e.id), i = new he(e);
3545
+ t !== -1 ? this.topics.value.splice(t, 1, new he(e)) : this.topics.value = [...this.topics.value, new he(e)];
3185
3546
  const s = this.topics.value.map((r) => ({
3186
3547
  appid: r.appid,
3187
3548
  id: r.id,
3188
3549
  type: r.type,
3189
3550
  caption: r.caption,
3551
+ sourceCaption: r.sourceCaption,
3190
3552
  url: r.url,
3191
3553
  aiChat: r.aiChat
3192
3554
  })), o = e.configService(e.appid, "aitopics", e.type);
@@ -3205,7 +3567,7 @@ class Oi {
3205
3567
  * @return {*} {Promise<void>}
3206
3568
  */
3207
3569
  async removeTopic(e, t, i, s, o) {
3208
- var d;
3570
+ var p;
3209
3571
  let r = !0;
3210
3572
  if (e.beforeDelete && (r = await e.beforeDelete(t, i, s, o)), !r)
3211
3573
  return;
@@ -3216,10 +3578,31 @@ class Oi {
3216
3578
  id: l.id,
3217
3579
  type: l.type,
3218
3580
  caption: l.caption,
3581
+ sourceCaption: l.sourceCaption,
3219
3582
  url: l.url,
3220
3583
  aiChat: l.aiChat
3221
- })), f = e.configService(e.appid, "aitopics", e.type);
3222
- await (f == null ? void 0 : f.save(u)), await Z.deleteData(M.DATA_BASE_NAME, M.DATA_TABLE_NAME, s.id), this.topics.value.length > 0 && s.id === ((d = this.activedTopic.value) == null ? void 0 : d.id) && this.handleTopicChange(this.topics.value[0]);
3584
+ })), h = e.configService(e.appid, "aitopics", e.type);
3585
+ await (h == null ? void 0 : h.save(u)), await q.deleteData(M.DATA_BASE_NAME, M.DATA_TABLE_NAME, s.id), this.topics.value.length > 0 && s.id === ((p = this.activedTopic.value) == null ? void 0 : p.id) && this.handleTopicChange(this.topics.value[0]);
3586
+ }
3587
+ /**
3588
+ * 更新话题数据
3589
+ *
3590
+ * @param {ITopicOptions} options 话题配置
3591
+ * @param {ChatTopic} _data 话题数据
3592
+ * @return {*} {Promise<void>}
3593
+ * @memberof AiTopicController
3594
+ */
3595
+ async updateTopic(e, t) {
3596
+ const i = this.topics.value.map((o) => ({
3597
+ appid: o.appid,
3598
+ id: o.id,
3599
+ type: o.type,
3600
+ caption: o.caption,
3601
+ sourceCaption: o.sourceCaption,
3602
+ url: o.url,
3603
+ aiChat: o.aiChat
3604
+ })), s = e.configService(e.appid, "aitopics", e.type);
3605
+ await (s == null ? void 0 : s.save(i));
3223
3606
  }
3224
3607
  /**
3225
3608
  * 处理选中变化
@@ -3250,16 +3633,51 @@ class Oi {
3250
3633
  context: a,
3251
3634
  params: u
3252
3635
  } = s.aiChat;
3253
- e === "DELETE" && await this.removeTopic(this.currentTopicOptions, a, u, s, i), (r = (o = this.currentTopicOptions).action) == null || r.call(o, e, a, u, t, i);
3636
+ e === "DELETE" ? await this.removeTopic(this.currentTopicOptions, a, u, s, i) : e === "RENAME" && await this.updateTopic(this.currentTopicOptions, t), (r = (o = this.currentTopicOptions).action) == null || r.call(o, e, a, u, t, i);
3254
3637
  }
3255
3638
  }
3639
+ /**
3640
+ * 新建对话
3641
+ *
3642
+ * @author tony001
3643
+ * @date 2025-03-18 18:03:49
3644
+ * @return {*} {Promise<void>}
3645
+ */
3646
+ async newTopic() {
3647
+ var u, h;
3648
+ const e = this.activedTopic.value;
3649
+ if (!e)
3650
+ return;
3651
+ const t = e.id.split("@")[0], i = this.topics.value.filter((p) => p.id.startsWith(t)), s = {
3652
+ appid: e.appid,
3653
+ // 源头数据id@当前时间戳
3654
+ id: "".concat(t, "@").concat(Date.now()),
3655
+ type: e.type,
3656
+ // 源头数据标题_当前话题数量(这儿源头数据可能已经被删除)
3657
+ caption: "".concat((u = e.sourceCaption) == null ? void 0 : u.split("_")[0], "_").concat(i.length),
3658
+ sourceCaption: e.sourceCaption,
3659
+ url: e.url,
3660
+ aiChat: e.aiChat
3661
+ }, o = new he(s);
3662
+ this.topics.value = [...this.topics.value, o];
3663
+ const r = this.topics.value.map((p) => ({
3664
+ appid: p.appid,
3665
+ id: p.id,
3666
+ type: p.type,
3667
+ caption: p.caption,
3668
+ sourceCaption: p.sourceCaption,
3669
+ url: p.url,
3670
+ aiChat: p.aiChat
3671
+ })), a = (h = this.currentTopicOptions) == null ? void 0 : h.configService(s.appid, "aitopics", s.type);
3672
+ await (a == null ? void 0 : a.save(r)), this.handleTopicChange(o);
3673
+ }
3256
3674
  }
3257
- class wn {
3675
+ class bn {
3258
3676
  constructor(e) {
3259
3677
  this.aiChat = e;
3260
3678
  }
3261
3679
  }
3262
- class Bi extends wn {
3680
+ class ji extends bn {
3263
3681
  /**
3264
3682
  * 执行操作
3265
3683
  *
@@ -3288,7 +3706,7 @@ class Bi extends wn {
3288
3706
  }
3289
3707
  }
3290
3708
  }
3291
- class Pi extends wn {
3709
+ class Yi extends bn {
3292
3710
  /**
3293
3711
  * 执行操作
3294
3712
  *
@@ -3303,57 +3721,57 @@ class Pi extends wn {
3303
3721
  maxSize: r,
3304
3722
  onSelect: a,
3305
3723
  onUpload: u,
3306
- onSuccess: f,
3307
- onError: d,
3724
+ onSuccess: h,
3725
+ onError: p,
3308
3726
  onProgress: l
3309
- } = i, _ = {
3727
+ } = i, v = {
3310
3728
  multiple: s || !0,
3311
3729
  accept: o || "*/*",
3312
3730
  maxSize: r || 5 * 1024 * 1024,
3313
- onSelect: (h) => {
3314
- a == null || a(h), h.length > 0 && h.forEach((p) => {
3315
- const v = this.buildMaterialObject(p);
3316
- Object.assign(v.metadata, {
3731
+ onSelect: (d) => {
3732
+ a == null || a(d), d.length > 0 && d.forEach((f) => {
3733
+ const m = this.buildMaterialObject(f);
3734
+ Object.assign(m.metadata, {
3317
3735
  state: "uploading"
3318
- }), this.aiChat.addMaterial(v);
3736
+ }), this.aiChat.addMaterial(m);
3319
3737
  });
3320
3738
  },
3321
- onUpload: async (h, p) => u(h, p, {
3739
+ onUpload: async (d, f) => u(d, f, {
3322
3740
  context: this.aiChat.context,
3323
3741
  params: this.aiChat.params
3324
3742
  }),
3325
3743
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3326
- onSuccess: (h, p) => {
3327
- const v = {
3328
- id: h.id,
3744
+ onSuccess: (d, f) => {
3745
+ const m = {
3746
+ id: d.id,
3329
3747
  type: "ossfile",
3330
3748
  data: {
3331
- id: h.id,
3332
- name: h.name
3749
+ id: d.id,
3750
+ name: d.name
3333
3751
  },
3334
3752
  metadata: {
3335
- ext: h.ext,
3336
- fileext: h.fileext,
3337
- fileid: h.fileid,
3338
- filename: h.filename,
3339
- size: h.size,
3340
- filesize: h.filesize,
3753
+ ext: d.ext,
3754
+ fileext: d.fileext,
3755
+ fileid: d.fileid,
3756
+ filename: d.filename,
3757
+ size: d.size,
3758
+ filesize: d.filesize,
3341
3759
  state: "successed"
3342
3760
  }
3343
3761
  };
3344
- this.aiChat.replaceMaterial(p.name, v), f == null || f(h, p);
3762
+ this.aiChat.replaceMaterial(f.name, m), h == null || h(d, f);
3345
3763
  },
3346
- onError: (h, p) => {
3347
- const v = this.buildMaterialObject(p);
3348
- Object.assign(v.metadata, {
3764
+ onError: (d, f) => {
3765
+ const m = this.buildMaterialObject(f);
3766
+ Object.assign(m.metadata, {
3349
3767
  state: "failed"
3350
- }), this.aiChat.replaceMaterial(p.name, v), d == null || d(h, p);
3768
+ }), this.aiChat.replaceMaterial(f.name, m), p == null || p(d, f);
3351
3769
  },
3352
- onProgress: (h, p) => {
3353
- l == null || l(h, p);
3770
+ onProgress: (d, f) => {
3771
+ l == null || l(d, f);
3354
3772
  }
3355
3773
  };
3356
- new zn(_).openFilePicker();
3774
+ new Ln(v).openFilePicker();
3357
3775
  }
3358
3776
  /**
3359
3777
  * 构建素材对象
@@ -3379,17 +3797,17 @@ class Pi extends wn {
3379
3797
  };
3380
3798
  }
3381
3799
  }
3382
- class Dt {
3800
+ class Lt {
3383
3801
  static getMaterialHelper(e, t) {
3384
3802
  switch (e) {
3385
3803
  case "ossfile":
3386
- return new Pi(t);
3804
+ return new Yi(t);
3387
3805
  default:
3388
- return new Bi(t);
3806
+ return new ji(t);
3389
3807
  }
3390
3808
  }
3391
3809
  }
3392
- class Ri {
3810
+ class Xi {
3393
3811
  /**
3394
3812
  * Creates an instance of ChatController.
3395
3813
  * @author tony001
@@ -3449,7 +3867,7 @@ class Ri {
3449
3867
  * @memberof ChatController
3450
3868
  */
3451
3869
  x(this, "aiTopicMap", /* @__PURE__ */ new Map());
3452
- this.aiTopic = new Oi(this);
3870
+ this.aiTopic = new qi(this);
3453
3871
  }
3454
3872
  /**
3455
3873
  * 聊天控制器
@@ -3470,7 +3888,7 @@ class Ri {
3470
3888
  * @return {*} {Promise<void>}
3471
3889
  */
3472
3890
  async initIndexDB() {
3473
- await Z.checkTableExists(M.DATA_BASE_NAME, M.DATA_TABLE_NAME) || await Z.createTable(M.DATA_BASE_NAME, M.DATA_TABLE_NAME, M.DATA_TABLE_KEY_NAME, !1);
3891
+ await q.checkTableExists(M.DATA_BASE_NAME, M.DATA_TABLE_NAME) || await q.createTable(M.DATA_BASE_NAME, M.DATA_TABLE_NAME, M.DATA_TABLE_KEY_NAME, !1);
3474
3892
  }
3475
3893
  /**
3476
3894
  * 创建聊天窗口(会同时显示出来)
@@ -3493,14 +3911,15 @@ class Ri {
3493
3911
  appDataEntityId: t.appDataEntityId,
3494
3912
  contentToolbarItems: t.contentToolbarItems,
3495
3913
  footerToolbarItems: t.footerToolbarItems,
3496
- questionToolbarItems: t.questionToolbarItems
3914
+ questionToolbarItems: t.questionToolbarItems,
3915
+ otherToolbarItems: t.otherToolbarItems
3497
3916
  }
3498
3917
  }), await this.aiTopic.updateCurrentTopic(i)), Object.assign(t, {
3499
3918
  topicId: i == null ? void 0 : i.id,
3500
3919
  topic: i
3501
3920
  });
3502
- const s = new At(t);
3503
- return this.aiTopicMap.set("".concat(i == null ? void 0 : i.id), s), se(W(Lt, {
3921
+ const s = new Dt(t);
3922
+ return this.aiTopicMap.set("".concat(i == null ? void 0 : i.id), s), oe(j(Ot, {
3504
3923
  aiChat: s,
3505
3924
  aiTopic: this.aiTopic,
3506
3925
  mode: e.mode ? e.mode : "DEFAULT",
@@ -3540,13 +3959,15 @@ class Ri {
3540
3959
  contentToolbarItems: e.aiChat.contentToolbarItems,
3541
3960
  footerToolbarItems: e.aiChat.footerToolbarItems,
3542
3961
  questionToolbarItems: e.aiChat.questionToolbarItems,
3962
+ otherToolbarItems: e.aiChat.otherToolbarItems,
3543
3963
  appDataEntityId: e.aiChat.appDataEntityId,
3544
3964
  topicId: e.id,
3545
3965
  topic: e,
3546
- extendToolbarClick: this.backupChatOptions.chatOptions.extendToolbarClick
3966
+ extendToolbarClick: this.backupChatOptions.chatOptions.extendToolbarClick,
3967
+ recommendPrompt: this.backupChatOptions.chatOptions.recommendPrompt
3547
3968
  });
3548
3969
  let i;
3549
- this.aiTopicMap.has("".concat(e.id)) ? i = this.aiTopicMap.get("".concat(e.id)) : (i = new At(t), this.aiTopicMap.set("".concat(e.id), i)), this.container && (se(null, this.container), se(W(Lt, {
3970
+ this.aiTopicMap.has("".concat(e.id)) ? i = this.aiTopicMap.get("".concat(e.id)) : (i = new Dt(t), this.aiTopicMap.set("".concat(e.id), i)), this.container && (oe(null, this.container), oe(j(Ot, {
3550
3971
  aiChat: i,
3551
3972
  aiTopic: this.aiTopic,
3552
3973
  mode: (s = this.backupChatOptions) != null && s.mode ? this.backupChatOptions.mode : "DEFAULT",
@@ -3559,11 +3980,11 @@ class Ri {
3559
3980
  close: () => {
3560
3981
  this.close(), t.closed && t.closed(t.context, t.params);
3561
3982
  },
3562
- fullscreen: (f) => {
3563
- t.fullscreen && t.fullscreen(f, t.context, t.params);
3983
+ fullscreen: (h) => {
3984
+ t.fullscreen && t.fullscreen(h, t.context, t.params);
3564
3985
  },
3565
- minimize: (f) => {
3566
- t.minimize && t.minimize(f, t.context, t.params);
3986
+ minimize: (h) => {
3987
+ t.minimize && t.minimize(h, t.context, t.params);
3567
3988
  }
3568
3989
  }), this.container));
3569
3990
  }
@@ -3592,22 +4013,22 @@ class Ri {
3592
4013
  * @date 2023-10-13 17:10:10
3593
4014
  */
3594
4015
  close() {
3595
- this.container && (se(null, this.container), this.container.remove(), this.container = void 0);
4016
+ this.container && (oe(null, this.container), this.container.remove(), this.container = void 0);
3596
4017
  }
3597
4018
  }
3598
- const Gi = new Ri();
3599
- const Fi = new $("chat-input-material"), Ui = (n) => {
4019
+ const ss = new Xi();
4020
+ const Zi = new N("chat-input-material"), Gi = (n) => {
3600
4021
  const e = n.controller.materials;
3601
4022
  return c("div", {
3602
- className: Fi.b(),
3603
- children: e.value.map((t) => c(vn, {
4023
+ className: Zi.b(),
4024
+ children: e.value.map((t) => c(mn, {
3604
4025
  material: t,
3605
4026
  disabled: !1,
3606
4027
  controller: n.controller
3607
4028
  }, t.id))
3608
4029
  });
3609
4030
  };
3610
- const bn = ({
4031
+ const yn = ({
3611
4032
  children: n,
3612
4033
  actions: e,
3613
4034
  // 接收行为数据
@@ -3618,50 +4039,50 @@ const bn = ({
3618
4039
  onAction: r
3619
4040
  // 接收行为事件回调
3620
4041
  }) => {
3621
- const a = new $("pop"), u = sn(st), [f, d] = me(s || !1), l = B(null), _ = B(null);
3622
- O(() => {
3623
- s !== void 0 && d(s);
3624
- }, [s]), O(() => (_.current || (_.current = document.createElement("div"), _.current.className = a.b("content-container"), document.body.appendChild(_.current)), () => {
3625
- _.current && document.body.removeChild(_.current);
3626
- }), []), O(() => {
3627
- const h = (p) => {
3628
- l.current && !l.current.contains(p.target) && !p.target.closest(".".concat(a.b("content"))) && !p.target.closest(".ibiz-quick-edit") && !p.target.closest(".ibiz-picker__transfer") && (d(!1), o == null || o(!1));
4042
+ const a = new N("pop"), u = on(ot), [h, p] = ne(s || !1), l = P(null), v = P(null);
4043
+ H(() => {
4044
+ s !== void 0 && p(s);
4045
+ }, [s]), H(() => (v.current || (v.current = document.createElement("div"), v.current.className = a.b("content-container"), document.body.appendChild(v.current)), () => {
4046
+ v.current && document.body.removeChild(v.current);
4047
+ }), []), H(() => {
4048
+ const d = (f) => {
4049
+ l.current && !l.current.contains(f.target) && !f.target.closest(".".concat(a.b())) && !f.target.closest(".ibiz-quick-edit") && !f.target.closest(".ibiz-picker__transfer") && (p(!1), o == null || o(!1));
3629
4050
  };
3630
- return f && document.addEventListener("mousedown", h), () => {
3631
- document.removeEventListener("mousedown", h);
4051
+ return h && document.addEventListener("mousedown", d), () => {
4052
+ document.removeEventListener("mousedown", d);
3632
4053
  };
3633
- }, [f, o]);
3634
- const g = () => {
4054
+ }, [h, o]);
4055
+ const _ = () => {
3635
4056
  if (!l.current)
3636
4057
  return {};
3637
- const h = l.current.getBoundingClientRect(), p = {
4058
+ const d = l.current.getBoundingClientRect(), f = {
3638
4059
  position: "absolute",
3639
4060
  zIndex: u.zIndex + 1
3640
- }, v = {
4061
+ }, m = {
3641
4062
  bottom: {
3642
- top: h.bottom + window.scrollY,
3643
- left: h.left + window.scrollX
4063
+ top: d.bottom + window.scrollY,
4064
+ left: d.left + window.scrollX
3644
4065
  },
3645
4066
  top: {
3646
- bottom: window.innerHeight - h.top + window.scrollY,
3647
- left: h.left + window.scrollX
4067
+ bottom: window.innerHeight - d.top + window.scrollY,
4068
+ left: d.left + window.scrollX
3648
4069
  },
3649
4070
  left: {
3650
- top: h.top + window.scrollY,
3651
- right: window.innerWidth - h.left + window.scrollX
4071
+ top: d.top + window.scrollY,
4072
+ right: window.innerWidth - d.left + window.scrollX
3652
4073
  },
3653
4074
  right: {
3654
- top: h.top + window.scrollY,
3655
- left: h.right + window.scrollX
4075
+ top: d.top + window.scrollY,
4076
+ left: d.right + window.scrollX
3656
4077
  },
3657
4078
  "top-left": {
3658
- bottom: window.innerHeight - h.top + window.scrollY,
3659
- right: window.innerWidth - h.left + window.scrollX
4079
+ bottom: window.innerHeight - d.top + window.scrollY,
4080
+ right: window.innerWidth - d.left + window.scrollX
3660
4081
  }
3661
4082
  };
3662
4083
  return {
3663
- ...p,
3664
- ...v[i]
4084
+ ...f,
4085
+ ...m[i]
3665
4086
  };
3666
4087
  };
3667
4088
  return c("span", {
@@ -3669,82 +4090,79 @@ const bn = ({
3669
4090
  children: [c("span", {
3670
4091
  className: "".concat(a.b("trigger-element")),
3671
4092
  ref: l,
3672
- onClick: (h) => {
3673
- h.stopPropagation();
3674
- const p = !f;
3675
- d(p), o == null || o(p);
4093
+ onClick: (d) => {
4094
+ d.stopPropagation();
4095
+ const f = !h;
4096
+ p(f), o == null || o(f);
3676
4097
  },
3677
4098
  children: n
3678
- }), f && _.current && xi(c("div", {
3679
- className: "".concat(a.b("content"), " pop-").concat(i),
3680
- style: g(),
3681
- children: t || (e == null ? void 0 : e.map((h) => c("div", {
3682
- className: a.b("content-item"),
3683
- onMouseDown: (p) => {
3684
- p.stopPropagation(), r == null || r(h.id, p);
4099
+ }), h && v.current && Ii(c("div", {
4100
+ className: "".concat(a.b(), " pop-").concat(i),
4101
+ style: _(),
4102
+ children: t || (e == null ? void 0 : e.map((d) => c("div", {
4103
+ title: d.caption,
4104
+ className: a.e("item"),
4105
+ onMouseDown: (f) => {
4106
+ f.stopPropagation(), r == null || r(d.id, f);
3685
4107
  },
3686
- children: [h.icon && c("img", {
3687
- className: a.b("content-item__icon"),
3688
- src: h.icon,
3689
- alt: h.caption
3690
- }), c("div", {
3691
- className: a.b("content-item__caption"),
3692
- children: h.caption
4108
+ children: [d.icon, c("div", {
4109
+ className: a.em("item", "caption"),
4110
+ children: d.caption
3693
4111
  })]
3694
- }, h.id)))
3695
- }), _.current)]
4112
+ }, d.id)))
4113
+ }), v.current)]
3696
4114
  });
3697
- }, N = new $("chat-input"), zt = window.SpeechRecognition || window.webkitSpeechRecognition, Ht = (n) => {
3698
- var p;
3699
- const [e, t] = me(!1), i = B(null), s = n.controller.input, o = U(!1), r = B();
4115
+ }, $ = new N("chat-input"), zt = window.SpeechRecognition || window.webkitSpeechRecognition, Ht = (n) => {
4116
+ var f;
4117
+ const [e, t] = ne(!1), i = P(null), s = n.controller.input, o = z(!1), r = P();
3700
4118
  zt && !r.current && (r.current = new zt(), r.current.onstart = () => {
3701
4119
  o.value = !0;
3702
4120
  }, r.current.onend = () => {
3703
4121
  o.value = !1;
3704
- }, r.current.onresult = (v) => {
3705
- var y, T, C;
3706
- const m = (C = (T = (y = v.results) == null ? void 0 : y[0]) == null ? void 0 : T[0]) == null ? void 0 : C.transcript;
3707
- m && (s.value = "".concat(s.value).concat(m));
4122
+ }, r.current.onresult = (m) => {
4123
+ var g, T, C;
4124
+ const b = (C = (T = (g = m.results) == null ? void 0 : g[0]) == null ? void 0 : T[0]) == null ? void 0 : C.transcript;
4125
+ b && (s.value = "".concat(s.value).concat(b));
3708
4126
  });
3709
4127
  const a = () => {
3710
4128
  r.current && !o.value && r.current.start();
3711
- }, u = Pe((v) => {
3712
- s.value = v.target.value;
3713
- }, [s]), f = H(() => s.value.length <= 0);
3714
- O(() => (i.current && It(i.current), () => {
4129
+ }, u = Be((m) => {
4130
+ s.value = m.target.value;
4131
+ }, [s]), h = B(() => s.value.length <= 0);
4132
+ H(() => (i.current && It(i.current), () => {
3715
4133
  i.current && It.destroy(i.current);
3716
4134
  }), [i]);
3717
- const d = Pe(async () => {
4135
+ const p = Be(async () => {
3718
4136
  try {
3719
- const v = s.value;
3720
- s.value = "", await n.controller.question(v);
3721
- } catch (v) {
3722
- console.error(v);
4137
+ const m = s.value;
4138
+ s.value = "", await n.controller.question(m);
4139
+ } catch (m) {
4140
+ console.error(m);
3723
4141
  }
3724
- }, [s]), l = Pe(async () => {
4142
+ }, [s]), l = Be(async () => {
3725
4143
  try {
3726
4144
  n.controller.abortQuestion();
3727
- } catch (v) {
3728
- console.error(v);
4145
+ } catch (m) {
4146
+ console.error(m);
3729
4147
  }
3730
- }, [s]), _ = (v) => {
3731
- v.code === "Enter" && !v.isComposing && (v.stopPropagation(), v.shiftKey === !1 && d());
3732
- }, g = async (v) => {
3733
- await Dt.getMaterialHelper("ossfile", n.controller).excuteAction(v), t(!1);
3734
- }, h = async (v, m) => {
3735
- await Dt.getMaterialHelper("common", n.controller).excuteAction(v, m), t(!1);
4148
+ }, [s]), v = (m) => {
4149
+ m.code === "Enter" && !m.isComposing && (m.stopPropagation(), m.shiftKey === !1 && p());
4150
+ }, _ = async (m) => {
4151
+ await Lt.getMaterialHelper("ossfile", n.controller).excuteAction(m), t(!1);
4152
+ }, d = async (m, b) => {
4153
+ await Lt.getMaterialHelper("common", n.controller).excuteAction(m, b), t(!1);
3736
4154
  };
3737
4155
  return c("div", {
3738
- className: N.b("wrapper"),
4156
+ className: $.b("wrapper"),
3739
4157
  children: [c("div", {
3740
- className: N.b("material-wrapper"),
3741
- children: c(Ui, {
4158
+ className: $.b("material-wrapper"),
4159
+ children: c(Gi, {
3742
4160
  controller: n.controller
3743
4161
  })
3744
4162
  }), c("div", {
3745
- className: N.b("main-wrapper"),
4163
+ className: $.b("main-wrapper"),
3746
4164
  children: [c("textarea", {
3747
- className: N.e("textarea"),
4165
+ className: $.e("textarea"),
3748
4166
  type: "text",
3749
4167
  rows: 6,
3750
4168
  autoCorrect: "off",
@@ -3752,248 +4170,283 @@ const bn = ({
3752
4170
  autoComplete: "off",
3753
4171
  value: s,
3754
4172
  onInput: u,
3755
- onKeyDown: _,
4173
+ onKeyDown: v,
3756
4174
  ref: i,
3757
4175
  disabled: n.controller.isLoading.value
3758
4176
  }), c("div", {
3759
- className: N.b("action-wrapper"),
4177
+ className: $.b("action-wrapper"),
3760
4178
  children: [c("div", {
3761
- className: "".concat(N.be("action-wrapper", "action-item"), " ").concat(N.is("disabled", n.controller.isLoading.value)),
4179
+ className: "".concat($.be("action-wrapper", "action-item"), " ").concat($.is("disabled", n.controller.isLoading.value)),
3762
4180
  title: "上传资料",
3763
- children: c(bn, {
4181
+ children: c(yn, {
3764
4182
  content: c("div", {
3765
- className: N.b("pop-actions"),
4183
+ className: $.b("pop-actions"),
3766
4184
  children: [c("div", {
3767
- className: N.b("pop-action-item"),
3768
- onClick: (v) => {
3769
- g(v);
4185
+ className: $.b("pop-action-item"),
4186
+ onClick: (m) => {
4187
+ _(m);
3770
4188
  },
3771
4189
  children: [c("span", {
3772
- className: N.b("pop-action-item-icon"),
3773
- children: c(pn, {})
4190
+ className: $.b("pop-action-item-icon"),
4191
+ children: c(vn, {})
3774
4192
  }), c("span", {
3775
- className: N.b("pop-action-item-title"),
4193
+ className: $.b("pop-action-item-title"),
3776
4194
  children: "文件资料"
3777
4195
  })]
3778
- }), (p = n.questionToolbarItems) == null ? void 0 : p.map((v) => {
3779
- var m, y, T;
4196
+ }), (f = n.questionToolbarItems) == null ? void 0 : f.map((m) => {
4197
+ var b, g, T;
3780
4198
  return c("div", {
3781
- className: N.b("pop-action-item"),
4199
+ className: $.b("pop-action-item"),
3782
4200
  onClick: (C) => {
3783
- h(C, v);
4201
+ d(C, m);
3784
4202
  },
3785
4203
  children: [c("span", {
3786
- className: N.b("pop-action-item-icon"),
3787
- children: typeof v.icon == "function" ? v.icon() : ((m = v.icon) == null ? void 0 : m.showIcon) && c(V, {
3788
- children: (y = v.icon) != null && y.cssClass ? c("i", {
3789
- className: v.icon.cssClass
3790
- }) : (T = v.icon) != null && T.imagePath ? tt(v.icon.imagePath) ? c("div", {
4204
+ className: $.b("pop-action-item-icon"),
4205
+ children: typeof m.icon == "function" ? m.icon() : ((b = m.icon) == null ? void 0 : b.showIcon) && c(Y, {
4206
+ children: (g = m.icon) != null && g.cssClass ? c("i", {
4207
+ className: m.icon.cssClass
4208
+ }) : (T = m.icon) != null && T.imagePath ? tt(m.icon.imagePath) ? c("div", {
3791
4209
  dangerouslySetInnerHTML: {
3792
- __html: v.icon.imagePath
4210
+ __html: m.icon.imagePath
3793
4211
  }
3794
4212
  }) : c("img", {
3795
- src: v.icon.imagePath
4213
+ src: m.icon.imagePath
3796
4214
  }) : null
3797
4215
  })
3798
4216
  }), c("span", {
3799
- className: N.b("pop-action-item-title"),
3800
- children: v.label
4217
+ className: $.b("pop-action-item-title"),
4218
+ children: m.label
3801
4219
  })]
3802
- }, v.id);
4220
+ }, m.id);
3803
4221
  })]
3804
4222
  }),
3805
4223
  position: "top-left",
3806
4224
  isOpen: e,
3807
4225
  onToggleOpen: t,
3808
- children: c(si, {})
4226
+ children: c(oi, {})
3809
4227
  })
3810
4228
  }), c("div", {
3811
4229
  title: o.value ? "语音输入中..." : "语音输入",
3812
- className: "".concat(N.be("action-wrapper", "action-item"), " ").concat(N.is("disabled", n.controller.isLoading.value)),
4230
+ className: "".concat($.be("action-wrapper", "action-item"), " ").concat($.is("disabled", n.controller.isLoading.value)),
3813
4231
  onClick: a,
3814
4232
  children: o.value ? c(ei, {}) : c(Qn, {})
3815
4233
  }), n.controller.isLoading.value ? c("div", {
3816
4234
  title: "停止生成",
3817
- className: "".concat(N.be("action-wrapper", "action-item")),
4235
+ className: "".concat($.be("action-wrapper", "action-item")),
3818
4236
  onClick: l,
3819
- children: c(ai, {})
4237
+ children: c(ci, {})
3820
4238
  }) : c("div", {
3821
4239
  title: "发送消息",
3822
- className: "".concat(N.be("action-wrapper", "action-item"), " ").concat(N.is("disabled", f.value)),
3823
- onClick: d,
3824
- children: c(jn, {})
4240
+ className: "".concat($.be("action-wrapper", "action-item"), " ").concat($.is("disabled", h.value)),
4241
+ onClick: p,
4242
+ children: c(qn, {})
3825
4243
  })]
3826
4244
  })]
3827
4245
  })]
3828
4246
  });
3829
4247
  };
3830
- const q = new $("chat-topic-item"), Wi = (n) => {
4248
+ const R = new N("chat-topic-item"), Ji = (n) => {
3831
4249
  const {
3832
4250
  controller: e,
3833
4251
  topic: t,
3834
4252
  onClick: i,
3835
4253
  onAction: s
3836
- } = n, o = H(() => {
3837
- var l;
3838
- return ((l = e.activedTopic.value) == null ? void 0 : l.id) === t.id;
3839
- }), [r, a] = me(!1), u = (d) => {
3840
- d.stopPropagation(), s("LINK", d);
3841
- }, f = (d, l) => {
3842
- d === "DELETE" && s("DELETE", l), a(!1);
4254
+ } = n, o = P(null), r = B(() => {
4255
+ var m;
4256
+ return ((m = e.activedTopic.value) == null ? void 0 : m.id) === t.id;
4257
+ }), [a, u] = ne(!1), h = z(!1), p = (f) => {
4258
+ f.stopPropagation(), s("LINK", f);
4259
+ }, l = (f, m) => {
4260
+ f === "DELETE" ? s("DELETE", m) : f === "RENAME" && (h.value = !0, setTimeout(() => {
4261
+ var b;
4262
+ (b = o.current) == null || b.focus();
4263
+ }, 100)), u(!1);
4264
+ }, v = (f) => {
4265
+ var m;
4266
+ f.stopPropagation(), t.data.caption = (m = f.target) == null ? void 0 : m.value;
4267
+ }, _ = (f) => {
4268
+ f.stopPropagation(), h.value = !1, s("RENAME", f);
4269
+ }, d = (f) => {
4270
+ f.stopPropagation(), f.key === "Enter" && (h.value = !1);
3843
4271
  };
3844
4272
  return c("div", {
3845
- className: "".concat(q.b(), " ").concat(q.is("active", o.value)),
4273
+ className: "".concat(R.b(), " ").concat(R.is("active", r.value), " ").concat(R.is("edit", h.value)),
3846
4274
  onClick: i.bind(void 0),
3847
4275
  children: [c("div", {
3848
- className: q.b("caption"),
4276
+ className: R.e("caption"),
3849
4277
  title: t.caption,
3850
- children: t.caption
3851
- }), c("div", {
3852
- className: q.b("icon"),
4278
+ children: h.value ? c("input", {
4279
+ ref: o,
4280
+ value: t.caption,
4281
+ onBlur: _,
4282
+ onKeyDown: d,
4283
+ onClick: (f) => f.stopPropagation(),
4284
+ onChange: (f) => v(f),
4285
+ className: R.em("caption", "editor")
4286
+ }) : c("span", {
4287
+ className: R.em("caption", "text"),
4288
+ children: t.caption
4289
+ })
4290
+ }), !h.value && c("div", {
4291
+ className: R.e("icon"),
3853
4292
  children: [c("span", {
3854
- className: q.be("icon", "item"),
3855
4293
  title: "跳转主视图",
3856
- onClick: u.bind(void 0),
4294
+ className: R.em("icon", "item"),
4295
+ onClick: p.bind(void 0),
3857
4296
  children: c(ni, {
3858
- className: q.b("link-icon")
4297
+ className: R.b("link-icon")
3859
4298
  })
3860
- }), o.value ? null : c(bn, {
4299
+ }), r.value ? null : c(yn, {
3861
4300
  actions: [{
4301
+ id: "RENAME",
4302
+ caption: "重命名",
4303
+ icon: c(hi, {})
4304
+ }, {
3862
4305
  id: "DELETE",
3863
- caption: "删除话题"
4306
+ caption: "删除话题",
4307
+ icon: c(ii, {})
3864
4308
  }],
3865
4309
  position: "bottom",
3866
- isOpen: r,
3867
- onToggleOpen: a,
3868
- onAction: f.bind(void 0),
4310
+ isOpen: a,
4311
+ onToggleOpen: u,
4312
+ onAction: l.bind(void 0),
3869
4313
  children: c("span", {
3870
- className: q.be("icon", "item"),
4314
+ className: R.em("icon", "item"),
3871
4315
  title: "更多",
3872
4316
  children: c(ti, {
3873
- className: q.b("more-icon")
4317
+ className: R.e("more-icon")
3874
4318
  })
3875
4319
  })
3876
4320
  })]
3877
4321
  })]
3878
4322
  });
3879
4323
  };
3880
- const Vi = new $("chat-topics"), ji = (n) => {
3881
- const e = n.controller.topics, t = (s) => {
3882
- n.controller.handleTopicChange(s);
3883
- }, i = (s, o, r) => {
3884
- n.controller.handleTopicAction(s, o, r);
4324
+ const Ki = new N("chat-topics"), Qi = (n) => {
4325
+ const e = n.controller.topics, t = P(null), i = (o) => {
4326
+ n.controller.handleTopicChange(o);
4327
+ }, s = (o, r, a) => {
4328
+ n.controller.handleTopicAction(o, r, a);
3885
4329
  };
3886
- return c("div", {
3887
- className: Vi.b(),
3888
- children: e.value.map((s) => c(Wi, {
3889
- topic: s,
4330
+ return H(() => {
4331
+ const o = t.current;
4332
+ if (!o)
4333
+ return;
4334
+ const r = o.querySelector(".ibiz-chat-topic-item.is-active");
4335
+ r == null || r.scrollIntoView({
4336
+ behavior: "smooth",
4337
+ block: "nearest"
4338
+ });
4339
+ }, [n.controller.activedTopic.value]), c("div", {
4340
+ ref: t,
4341
+ className: Ki.b(),
4342
+ children: e.value.map((o) => c(Ji, {
4343
+ topic: o,
3890
4344
  controller: n.controller,
3891
- onClick: () => t(s),
3892
- onAction: (o, r) => i(o, s, r)
3893
- }, s.id))
4345
+ onClick: () => i(o),
4346
+ onAction: (r, a) => s(r, o, a)
4347
+ }, o.id))
3894
4348
  });
3895
4349
  };
3896
- const Ce = new $("chart-minimize"), qi = (n) => {
3897
- const e = B(null), [t, i] = me(""), [s, o] = me(0), r = B(!1), a = B({
4350
+ const se = new N("chat-minimize"), es = (n) => {
4351
+ const e = P(null), [t, i] = ne(""), [s, o] = ne(0), r = P(!1), a = {
3898
4352
  x: (window.innerWidth - 86) / window.innerWidth,
3899
4353
  y: (window.innerHeight - 86) / window.innerHeight
3900
- }), u = H(() => n.controller.messages.value[n.controller.messages.value.length - 1] || void 0), f = P(() => {
3901
- var p, v;
3902
- return ((p = u.value) == null ? void 0 : p.state) === 20 && ((v = u.value) == null ? void 0 : v.completed) !== !0;
3903
- }, [u.value]), d = (p) => {
3904
- const v = p.indexOf("<think>"), m = p.indexOf("</think>");
3905
- let y = "", T = "", C = !1;
3906
- return m === -1 ? (C = !1, y = p.slice(v + 7), T = "") : (C = !0, y = p.slice(v + 7, m), T = p.slice(m + 8)), {
3907
- isThoughtCompleted: C,
3908
- thoughtContent: y,
3909
- answerContent: T
4354
+ }, u = B(() => {
4355
+ const d = n.controller.messages.value[n.controller.messages.value.length - 1];
4356
+ return d ? d.role === "ASSISTANT" && d.state === 20 && d.completed !== !0 : !1;
4357
+ }), h = (d) => {
4358
+ const f = d.indexOf("<think>"), m = d.indexOf("</think>");
4359
+ let b = "", g = "";
4360
+ return m === -1 ? (b = d.slice(f + 7), g = "") : (b = d.slice(f + 7, m), g = d.slice(m + 8)), {
4361
+ thoughtContent: b,
4362
+ answerContent: g
3910
4363
  };
3911
- }, l = P(() => {
3912
- var v;
3913
- let p = "";
3914
- if (f)
3915
- if (u.value.content.indexOf("<think>") !== -1) {
3916
- const {
3917
- thoughtContent: m,
3918
- answerContent: y
3919
- } = d(u.value.content);
3920
- p = m + y;
3921
- } else
3922
- p = (v = u.value) == null ? void 0 : v.content;
3923
- else
3924
- i(""), o(0);
3925
- return p;
3926
- }, [u.value]), _ = () => {
4364
+ }, p = B(() => {
4365
+ let d = "";
4366
+ if (!u.value)
4367
+ return i(""), o(0), d;
4368
+ const f = n.controller.messages.value[n.controller.messages.value.length - 1];
4369
+ if (d = f.content, f.content.indexOf("<think>") !== -1) {
4370
+ const {
4371
+ thoughtContent: m,
4372
+ answerContent: b
4373
+ } = h(f.content);
4374
+ d = m + b;
4375
+ }
4376
+ return d;
4377
+ }), l = () => {
3927
4378
  Object.assign(e.current.style, {
3928
- left: "".concat(a.current.x * 100, "%"),
3929
- top: "".concat(a.current.y * 100, "%")
4379
+ left: "".concat(a.x * 100, "%"),
4380
+ top: "".concat(a.y * 100, "%")
3930
4381
  }), localStorage.setItem(M.MINIMIZE_STYLY_CHCHE, JSON.stringify(a));
3931
- }, g = () => {
3932
- const p = e.current;
3933
- p && (p.onmousedown = (v) => {
4382
+ }, v = () => {
4383
+ const d = e.current;
4384
+ d && (d.onmousedown = (f) => {
3934
4385
  document.body.style.userSelect = "none";
3935
- const m = v.clientX - p.offsetLeft, y = v.clientY - p.offsetTop, T = Date.now(), C = (A) => {
3936
- const D = 56 / window.innerWidth, R = 56 / window.innerHeight, {
3937
- x: z,
3938
- y: te
3939
- } = tn(A.clientX - m, A.clientY - y, D, R);
3940
- a.current = {
3941
- x: z,
3942
- y: te
3943
- }, requestAnimationFrame(() => {
3944
- _();
4386
+ const m = f.clientX - d.offsetLeft, b = f.clientY - d.offsetTop, g = Date.now(), T = (S) => {
4387
+ const O = 56 / window.innerWidth, I = 56 / window.innerHeight, {
4388
+ x: U,
4389
+ y: D
4390
+ } = nn(S.clientX - m, S.clientY - b, O, I);
4391
+ Object.assign(a, {
4392
+ x: U,
4393
+ y: D
4394
+ }), requestAnimationFrame(() => {
4395
+ l();
3945
4396
  });
3946
- }, S = () => {
3947
- const A = Date.now();
3948
- r.current = A - T > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", C), document.removeEventListener("mouseup", S);
4397
+ }, C = () => {
4398
+ const S = Date.now();
4399
+ r.current = S - g > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", T), document.removeEventListener("mouseup", C);
3949
4400
  };
3950
- document.addEventListener("mousemove", C), document.addEventListener("mouseup", S);
4401
+ document.addEventListener("mousemove", T), document.addEventListener("mouseup", C);
3951
4402
  });
3952
- }, h = () => {
4403
+ }, _ = () => {
3953
4404
  r.current || n.onClick();
3954
4405
  };
3955
- return O(() => {
3956
- const p = localStorage.getItem(M.MINIMIZE_STYLY_CHCHE);
3957
- if (p) {
3958
- const v = JSON.parse(p);
3959
- Ze(v) && (a.current = v);
4406
+ return H(() => {
4407
+ const d = localStorage.getItem(M.MINIMIZE_STYLY_CHCHE);
4408
+ if (d) {
4409
+ const f = JSON.parse(d);
4410
+ Xe(f) && Object.assign(a, f);
3960
4411
  }
3961
- _(), g();
3962
- }, []), O(() => {
3963
- if (s < l.length) {
3964
- const p = setTimeout(() => {
3965
- i((v) => v + l[s]), o((v) => v + 1);
4412
+ l(), v();
4413
+ }, []), H(() => {
4414
+ if (s < p.value.length) {
4415
+ const d = setTimeout(() => {
4416
+ i((f) => f + p.value[s]), o((f) => f + 1);
3966
4417
  }, 100);
3967
- return () => clearTimeout(p);
4418
+ return () => clearTimeout(d);
3968
4419
  }
3969
- }, [s, l]), c("div", {
4420
+ }, [s, p.value]), c("div", {
3970
4421
  ref: e,
3971
4422
  title: n.title,
3972
- className: "".concat(Ce.b(), " ").concat(Ce.is("hidden", !n.isMinimize)),
3973
- onClick: h,
3974
- children: f ? c("div", {
3975
- className: "".concat(Ce.e("output")),
3976
- children: ["输出中", t && c("div", {
3977
- className: "".concat(Ce.em("output", "popover")),
4423
+ className: "".concat(se.b(), " ").concat(se.is("hidden", !n.isMinimize), " ").concat(se.is("show-halo", u.value)),
4424
+ onClick: _,
4425
+ children: c("div", {
4426
+ className: "".concat(se.e("content"), " ").concat(se.is("show-border", !u.value)),
4427
+ children: [t && c("div", {
4428
+ className: "".concat(se.em("content", "popover")),
3978
4429
  children: c("div", {
3979
4430
  className: "typewriter",
3980
4431
  children: t
3981
4432
  })
3982
- })]
3983
- }) : c(Jn, {})
4433
+ }), c(Jn, {})]
4434
+ })
3984
4435
  });
3985
4436
  };
3986
- const st = $n({
4437
+ const ot = Mn({
3987
4438
  zIndex: 10,
3988
- enableBackFill: !0
4439
+ enableBackFill: !0,
4440
+ newTopic: () => {
4441
+ }
3989
4442
  });
3990
- var Ot, Bt, Pt, Rt;
3991
- class Lt extends L {
4443
+ var Bt, Pt, Rt, Ft;
4444
+ class Ot extends F {
3992
4445
  constructor(t) {
3993
4446
  super(t);
3994
- x(this, "ns", new $("chat-container"));
3995
- x(this, "containerRef", rt());
3996
- x(this, "dragHandle", rt());
4447
+ x(this, "ns", new N("chat-container"));
4448
+ x(this, "containerRef", at());
4449
+ x(this, "dragHandle", at());
3997
4450
  /**
3998
4451
  * 窗口样式数据
3999
4452
  *
@@ -4038,8 +4491,11 @@ class Lt extends L {
4038
4491
  * @type {ContainerContext}
4039
4492
  */
4040
4493
  x(this, "containerContext", {
4041
- zIndex: ((Ot = this.props.containerOptions) == null ? void 0 : Ot.zIndex) || 10,
4042
- enableBackFill: ((Bt = this.props) == null ? void 0 : Bt.enableBackFill) !== void 0 && ((Pt = this.props) == null ? void 0 : Pt.enableBackFill) !== null ? (Rt = this.props) == null ? void 0 : Rt.enableBackFill : !0
4494
+ zIndex: ((Bt = this.props.containerOptions) == null ? void 0 : Bt.zIndex) || 10,
4495
+ enableBackFill: ((Pt = this.props) == null ? void 0 : Pt.enableBackFill) !== void 0 && ((Rt = this.props) == null ? void 0 : Rt.enableBackFill) !== null ? (Ft = this.props) == null ? void 0 : Ft.enableBackFill : !0,
4496
+ newTopic: () => {
4497
+ this.props.aiTopic.newTopic();
4498
+ }
4043
4499
  });
4044
4500
  this.state = {
4045
4501
  isFullScreen: !1,
@@ -4121,11 +4577,11 @@ class Lt extends L {
4121
4577
  this.data.showMode = "window";
4122
4578
  const {
4123
4579
  x: u,
4124
- y: f
4125
- } = tn(a.clientX - i, a.clientY - s, this.data.window.width, this.data.window.height);
4580
+ y: h
4581
+ } = nn(a.clientX - i, a.clientY - s, this.data.window.width, this.data.window.height);
4126
4582
  Object.assign(this.data.window, {
4127
4583
  x: u,
4128
- y: f
4584
+ y: h
4129
4585
  }), this.setStyle();
4130
4586
  }, r = () => {
4131
4587
  document.body.style.userSelect = "", document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), !this.disabled && this.snapToEdge();
@@ -4139,7 +4595,7 @@ class Lt extends L {
4139
4595
  * @memberof ChatContainer
4140
4596
  */
4141
4597
  registerDragDialogBorder() {
4142
- Oe(this.containerRef.current).resizable({
4598
+ He(this.containerRef.current).resizable({
4143
4599
  // 可拖拽的边缘
4144
4600
  edges: {
4145
4601
  top: !0,
@@ -4150,11 +4606,11 @@ class Lt extends L {
4150
4606
  margin: 6,
4151
4607
  modifiers: [
4152
4608
  // 保持在父对象内部
4153
- Oe.modifiers.restrictEdges({
4609
+ He.modifiers.restrictEdges({
4154
4610
  outer: document.body
4155
4611
  }),
4156
4612
  // 缩放最小宽度
4157
- Oe.modifiers.restrictSize({
4613
+ He.modifiers.restrictSize({
4158
4614
  min: {
4159
4615
  width: this.data.minWidth,
4160
4616
  height: this.data.minHeight
@@ -4193,7 +4649,7 @@ class Lt extends L {
4193
4649
  const t = localStorage.getItem(M.STYLE_CACHE);
4194
4650
  if (t) {
4195
4651
  const i = JSON.parse(t);
4196
- i.side && Ze(i.side) && i.window && Ze(i.window) && Object.assign(this.data, i);
4652
+ i.side && Xe(i.side) && i.window && Xe(i.window) && Object.assign(this.data, i);
4197
4653
  }
4198
4654
  this.setStyle(), this.registerDragDialog(), this.registerDragDialogBorder(), document.addEventListener("fullscreenchange", this.handleFullScreenChange);
4199
4655
  }
@@ -4258,7 +4714,7 @@ class Lt extends L {
4258
4714
  t.stopPropagation();
4259
4715
  }
4260
4716
  render() {
4261
- return c(st.Provider, {
4717
+ return c(ot.Provider, {
4262
4718
  value: this.containerContext,
4263
4719
  children: c("div", {
4264
4720
  className: "".concat(this.ns.b()),
@@ -4303,21 +4759,21 @@ class Lt extends L {
4303
4759
  className: "".concat(this.ns.b("main")),
4304
4760
  children: [c("div", {
4305
4761
  className: "".concat(this.ns.be("main", "left")),
4306
- children: c(ji, {
4762
+ children: c(Qi, {
4307
4763
  controller: this.props.aiTopic
4308
4764
  })
4309
4765
  }), c("div", {
4310
4766
  className: "".concat(this.ns.be("main", "right")),
4311
4767
  children: [c("div", {
4312
4768
  className: this.ns.b("content"),
4313
- children: c(yt, {
4769
+ children: c(Ct, {
4314
4770
  controller: this.props.aiChat,
4315
4771
  toolbarItems: this.props.contentToolbarItems
4316
4772
  })
4317
- }), c(Ke, {
4773
+ }), c(Je, {
4318
4774
  data: this.props.aiTopic.activedTopic.value,
4319
4775
  type: "footer",
4320
- className: this.ns.e("toolbar"),
4776
+ className: "".concat(this.ns.e("toolbar"), " ").concat(this.ns.is("has-materials", this.props.aiChat.materials.value.length > 0)),
4321
4777
  controller: this.props.aiChat,
4322
4778
  items: this.props.footerToolbarItems
4323
4779
  }), c("div", {
@@ -4332,14 +4788,14 @@ class Lt extends L {
4332
4788
  className: "".concat(this.ns.be("main", "default")),
4333
4789
  children: [c("div", {
4334
4790
  className: this.ns.b("content"),
4335
- children: c(yt, {
4791
+ children: c(Ct, {
4336
4792
  controller: this.props.aiChat,
4337
4793
  toolbarItems: this.props.contentToolbarItems
4338
4794
  })
4339
- }), c(Ke, {
4795
+ }), c(Je, {
4340
4796
  type: "footer",
4341
4797
  data: this.props.aiTopic.activedTopic.value,
4342
- className: this.ns.e("toolbar"),
4798
+ className: "".concat(this.ns.e("toolbar"), " ").concat(this.ns.is("has-materials", this.props.aiChat.materials.value.length > 0)),
4343
4799
  controller: this.props.aiChat,
4344
4800
  items: this.props.footerToolbarItems
4345
4801
  }), c("div", {
@@ -4350,7 +4806,7 @@ class Lt extends L {
4350
4806
  })
4351
4807
  })]
4352
4808
  })]
4353
- }), c(qi, {
4809
+ }), c(es, {
4354
4810
  title: this.props.caption || "AI助手",
4355
4811
  controller: this.props.aiChat,
4356
4812
  isMinimize: this.state.isMinimize,
@@ -4361,6 +4817,6 @@ class Lt extends L {
4361
4817
  }
4362
4818
  }
4363
4819
  export {
4364
- Lt as ChatContainer,
4365
- Gi as chat
4820
+ Ot as ChatContainer,
4821
+ ss as chat
4366
4822
  };