@ibiz-template-plugin/ai-chat 0.0.11 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,94 +1,94 @@
1
1
  import './style.css';
2
- var hn = Object.defineProperty;
3
- var fn = (n, e, t) => e in n ? hn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
4
- var w = (n, e, t) => (fn(n, typeof e != "symbol" ? e + "" : e, t), t);
5
- import ze from "interactjs";
6
- import pn from "cherry-markdown";
7
- var Ne, m, Dt, zt, G, et, Ht, Ve, Lt, ne = {}, Ot = [], _n = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ke = Array.isArray;
8
- function F(n, e) {
2
+ var vi = Object.defineProperty;
3
+ var mi = (i, e, t) => e in i ? vi(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
4
+ var w = (i, e, t) => (mi(i, typeof e != "symbol" ? e + "" : e, t), t);
5
+ import He from "interactjs";
6
+ import gi from "cherry-markdown";
7
+ var $e, g, Bt, Rt, J, nt, Pt, qe, Ft, ie = {}, Ut = [], bi = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Me = Array.isArray;
8
+ function q(i, e) {
9
9
  for (var t in e)
10
- n[t] = e[t];
11
- return n;
10
+ i[t] = e[t];
11
+ return i;
12
12
  }
13
- function Rt(n) {
14
- var e = n.parentNode;
15
- e && e.removeChild(n);
13
+ function Wt(i) {
14
+ var e = i.parentNode;
15
+ e && e.removeChild(i);
16
16
  }
17
- function I(n, e, t) {
18
- var i, s, o, r = {};
17
+ function I(i, e, t) {
18
+ var n, s, o, r = {};
19
19
  for (o in e)
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 ? Ne.call(arguments, 2) : t), typeof n == "function" && n.defaultProps != null)
22
- for (o in n.defaultProps)
23
- r[o] === void 0 && (r[o] = n.defaultProps[o]);
24
- return be(n, r, i, s, null);
20
+ o == "key" ? n = e[o] : o == "ref" ? s = e[o] : r[o] = e[o];
21
+ if (arguments.length > 2 && (r.children = arguments.length > 3 ? $e.call(arguments, 2) : t), typeof i == "function" && i.defaultProps != null)
22
+ for (o in i.defaultProps)
23
+ r[o] === void 0 && (r[o] = i.defaultProps[o]);
24
+ return we(i, r, n, s, null);
25
25
  }
26
- function be(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 ? ++Dt : s };
28
- return s == null && m.vnode != null && m.vnode(o), o;
26
+ function we(i, e, t, n, s) {
27
+ var o = { type: i, props: e, key: t, ref: n, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: s == null ? ++Bt : s };
28
+ return s == null && g.vnode != null && g.vnode(o), o;
29
29
  }
30
- function He() {
30
+ function Le() {
31
31
  return { current: null };
32
32
  }
33
- function se(n) {
34
- return n.children;
33
+ function se(i) {
34
+ return i.children;
35
35
  }
36
- function H(n, e) {
37
- this.props = n, this.context = e;
36
+ function H(i, e) {
37
+ this.props = i, this.context = e;
38
38
  }
39
- function fe(n, e) {
39
+ function pe(i, e) {
40
40
  if (e == null)
41
- return n.__ ? fe(n.__, n.__.__k.indexOf(n) + 1) : null;
42
- for (var t; e < n.__k.length; e++)
43
- if ((t = n.__k[e]) != null && t.__e != null)
41
+ return i.__ ? pe(i.__, i.__.__k.indexOf(i) + 1) : null;
42
+ for (var t; e < i.__k.length; e++)
43
+ if ((t = i.__k[e]) != null && t.__e != null)
44
44
  return t.__d || t.__e;
45
- return typeof n.type == "function" ? fe(n) : null;
45
+ return typeof i.type == "function" ? pe(i) : null;
46
46
  }
47
- function Pt(n) {
47
+ function Vt(i) {
48
48
  var e, t;
49
- if ((n = n.__) != null && n.__c != null) {
50
- for (n.__e = n.__c.base = null, e = 0; e < n.__k.length; e++)
51
- if ((t = n.__k[e]) != null && t.__e != null) {
52
- n.__e = n.__c.base = t.__e;
49
+ if ((i = i.__) != null && i.__c != null) {
50
+ for (i.__e = i.__c.base = null, e = 0; e < i.__k.length; e++)
51
+ if ((t = i.__k[e]) != null && t.__e != null) {
52
+ i.__e = i.__c.base = t.__e;
53
53
  break;
54
54
  }
55
- return Pt(n);
55
+ return Vt(i);
56
56
  }
57
57
  }
58
- function qe(n) {
59
- (!n.__d && (n.__d = !0) && G.push(n) && !Te.__r++ || et !== m.debounceRendering) && ((et = m.debounceRendering) || Ht)(Te);
58
+ function je(i) {
59
+ (!i.__d && (i.__d = !0) && J.push(i) && !xe.__r++ || nt !== g.debounceRendering) && ((nt = g.debounceRendering) || Pt)(xe);
60
60
  }
61
- function Te() {
62
- var n, e, t, i, s, o, r, a, u;
63
- for (G.sort(Ve); n = G.shift(); )
64
- n.__d && (e = G.length, i = void 0, s = void 0, o = void 0, a = (r = (t = n).__v).__e, (u = t.__P) && (i = [], s = [], (o = F({}, r)).__v = r.__v + 1, Ze(u, r, o, t.__n, u.ownerSVGElement !== void 0, r.__h != null ? [a] : null, i, a == null ? fe(r) : a, r.__h, s), Vt(i, r, s), r.__e != a && Pt(r)), G.length > e && G.sort(Ve));
65
- Te.__r = 0;
61
+ function xe() {
62
+ var i, e, t, n, s, o, r, a, u;
63
+ for (J.sort(qe); i = J.shift(); )
64
+ i.__d && (e = J.length, n = void 0, s = void 0, o = void 0, a = (r = (t = i).__v).__e, (u = t.__P) && (n = [], s = [], (o = q({}, r)).__v = r.__v + 1, Je(u, r, o, t.__n, u.ownerSVGElement !== void 0, r.__h != null ? [a] : null, n, a == null ? pe(r) : a, r.__h, s), Xt(n, r, s), r.__e != a && Vt(r)), J.length > e && J.sort(qe));
65
+ xe.__r = 0;
66
66
  }
67
- function Bt(n, e, t, i, s, o, r, a, u, f, d) {
68
- var c, _, v, h, p, y, b, C, N, T = 0, E = i && i.__k || Ot, R = E.length, D = R, P = e.length;
69
- for (t.__k = [], c = 0; c < P; c++)
70
- (h = t.__k[c] = (h = e[c]) == null || typeof h == "boolean" || typeof h == "function" ? null : typeof h == "string" || typeof h == "number" || typeof h == "bigint" ? be(null, h, null, null, h) : ke(h) ? be(se, { children: h }, null, null, null) : h.__b > 0 ? be(h.type, h.props, h.key, h.ref ? h.ref : null, h.__v) : h) != null ? (h.__ = t, h.__b = t.__b + 1, (C = vn(h, E, b = c + T, D)) === -1 ? v = ne : (v = E[C] || ne, E[C] = void 0, D--), Ze(n, h, v, s, o, r, a, u, f, d), p = h.__e, (_ = h.ref) && v.ref != _ && (v.ref && Ge(v.ref, null, h), d.push(_, h.__c || p, h)), p != null && (y == null && (y = p), (N = v === ne || v.__v === null) ? C == -1 && T-- : C !== b && (C === b + 1 ? T++ : C > b ? D > P - b ? T += C - b : T-- : T = C < b && C == b - 1 ? C - b : 0), b = c + T, typeof h.type != "function" || C === b && v.__k !== h.__k ? typeof h.type == "function" || C === b && !N ? h.__d !== void 0 ? (u = h.__d, h.__d = void 0) : u = p.nextSibling : u = Ft(n, p, u) : u = Ut(h, u, n), typeof t.type == "function" && (t.__d = u))) : (v = E[c]) && v.key == null && v.__e && (v.__e == u && (v.__ = i, u = fe(v)), We(v, v, !1), E[c] = null);
71
- for (t.__e = y, c = R; c--; )
72
- E[c] != null && (typeof t.type == "function" && E[c].__e != null && E[c].__e == t.__d && (t.__d = E[c].__e.nextSibling), We(E[c], E[c]));
67
+ function qt(i, e, t, n, s, o, r, a, u, h, d) {
68
+ var c, p, m, f, v, _, y, C, E, T = 0, k = n && n.__k || Ut, F = k.length, D = F, U = e.length;
69
+ for (t.__k = [], c = 0; c < U; c++)
70
+ (f = t.__k[c] = (f = e[c]) == null || typeof f == "boolean" || typeof f == "function" ? null : typeof f == "string" || typeof f == "number" || typeof f == "bigint" ? we(null, f, null, null, f) : Me(f) ? we(se, { children: f }, null, null, null) : f.__b > 0 ? we(f.type, f.props, f.key, f.ref ? f.ref : null, f.__v) : f) != null ? (f.__ = t, f.__b = t.__b + 1, (C = yi(f, k, y = c + T, D)) === -1 ? m = ie : (m = k[C] || ie, k[C] = void 0, D--), Je(i, f, m, s, o, r, a, u, h, d), v = f.__e, (p = f.ref) && m.ref != p && (m.ref && Ke(m.ref, null, f), d.push(p, f.__c || v, f)), v != null && (_ == null && (_ = v), (E = m === ie || m.__v === null) ? C == -1 && T-- : C !== y && (C === y + 1 ? T++ : C > y ? D > U - y ? T += C - y : T-- : T = C < y && C == y - 1 ? C - y : 0), y = c + T, typeof f.type != "function" || C === y && m.__k !== f.__k ? typeof f.type == "function" || C === y && !E ? f.__d !== void 0 ? (u = f.__d, f.__d = void 0) : u = v.nextSibling : u = Yt(i, v, u) : u = jt(f, u, i), typeof t.type == "function" && (t.__d = u))) : (m = k[c]) && m.key == null && m.__e && (m.__e == u && (m.__ = n, u = pe(m)), Ye(m, m, !1), k[c] = null);
71
+ for (t.__e = _, c = F; c--; )
72
+ k[c] != null && (typeof t.type == "function" && k[c].__e != null && k[c].__e == t.__d && (t.__d = k[c].__e.nextSibling), Ye(k[c], k[c]));
73
73
  }
74
- function Ut(n, e, t) {
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" ? Ut(i, e, t) : Ft(t, i.__e, e));
74
+ function jt(i, e, t) {
75
+ for (var n, s = i.__k, o = 0; s && o < s.length; o++)
76
+ (n = s[o]) && (n.__ = i, e = typeof n.type == "function" ? jt(n, e, t) : Yt(t, n.__e, e));
77
77
  return e;
78
78
  }
79
- function Se(n, e) {
80
- return e = e || [], n == null || typeof n == "boolean" || (ke(n) ? n.some(function(t) {
79
+ function Se(i, e) {
80
+ return e = e || [], i == null || typeof i == "boolean" || (Me(i) ? i.some(function(t) {
81
81
  Se(t, e);
82
- }) : e.push(n)), e;
82
+ }) : e.push(i)), e;
83
83
  }
84
- function Ft(n, e, t) {
85
- return t == null || t.parentNode !== n ? n.insertBefore(e, null) : e == t && e.parentNode != null || n.insertBefore(e, t), e.nextSibling;
84
+ function Yt(i, e, t) {
85
+ return t == null || t.parentNode !== i ? i.insertBefore(e, null) : e == t && e.parentNode != null || i.insertBefore(e, t), e.nextSibling;
86
86
  }
87
- function vn(n, e, t, i) {
88
- var s = n.key, o = n.type, r = t - 1, a = t + 1, u = e[t];
87
+ function yi(i, e, t, n) {
88
+ var s = i.key, o = i.type, r = t - 1, a = t + 1, u = e[t];
89
89
  if (u === null || u && s == u.key && o === u.type)
90
90
  return t;
91
- if (i > (u != null ? 1 : 0))
91
+ if (n > (u != null ? 1 : 0))
92
92
  for (; r >= 0 || a < e.length; ) {
93
93
  if (r >= 0) {
94
94
  if ((u = e[r]) && s == u.key && o === u.type)
@@ -103,180 +103,180 @@ function vn(n, e, t, i) {
103
103
  }
104
104
  return -1;
105
105
  }
106
- function mn(n, e, t, i, s) {
106
+ function wi(i, e, t, n, s) {
107
107
  var o;
108
108
  for (o in t)
109
- o === "children" || o === "key" || o in e || xe(n, o, null, t[o], i);
109
+ o === "children" || o === "key" || o in e || ke(i, o, null, t[o], n);
110
110
  for (o in e)
111
- s && typeof e[o] != "function" || o === "children" || o === "key" || o === "value" || o === "checked" || t[o] === e[o] || xe(n, o, e[o], t[o], i);
111
+ s && typeof e[o] != "function" || o === "children" || o === "key" || o === "value" || o === "checked" || t[o] === e[o] || ke(i, o, e[o], t[o], n);
112
112
  }
113
- function tt(n, e, t) {
114
- e[0] === "-" ? n.setProperty(e, t == null ? "" : t) : n[e] = t == null ? "" : typeof t != "number" || _n.test(e) ? t : t + "px";
113
+ function st(i, e, t) {
114
+ e[0] === "-" ? i.setProperty(e, t == null ? "" : t) : i[e] = t == null ? "" : typeof t != "number" || bi.test(e) ? t : t + "px";
115
115
  }
116
- function xe(n, e, t, i, s) {
116
+ function ke(i, e, t, n, s) {
117
117
  var o;
118
118
  e:
119
119
  if (e === "style")
120
120
  if (typeof t == "string")
121
- n.style.cssText = t;
121
+ i.style.cssText = t;
122
122
  else {
123
- if (typeof i == "string" && (n.style.cssText = i = ""), i)
124
- for (e in i)
125
- t && e in t || tt(n.style, e, "");
123
+ if (typeof n == "string" && (i.style.cssText = n = ""), n)
124
+ for (e in n)
125
+ t && e in t || st(i.style, e, "");
126
126
  if (t)
127
127
  for (e in t)
128
- i && t[e] === i[e] || tt(n.style, e, t[e]);
128
+ n && t[e] === n[e] || st(i.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 ? it : nt, o)) : n.removeEventListener(e, o ? it : nt, o);
131
+ o = e !== (e = e.replace(/(PointerCapture)$|Capture$/, "$1")), e = e.toLowerCase() in i ? e.toLowerCase().slice(2) : e.slice(2), i.l || (i.l = {}), i.l[e + o] = t, t ? n ? t.u = n.u : (t.u = Date.now(), i.addEventListener(e, o ? rt : ot, o)) : i.removeEventListener(e, o ? rt : ot, o);
132
132
  else if (e !== "dangerouslySetInnerHTML") {
133
133
  if (s)
134
134
  e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
135
- else if (e !== "width" && e !== "height" && e !== "href" && e !== "list" && e !== "form" && e !== "tabIndex" && e !== "download" && e !== "rowSpan" && e !== "colSpan" && e !== "role" && e in n)
135
+ else if (e !== "width" && e !== "height" && e !== "href" && e !== "list" && e !== "form" && e !== "tabIndex" && e !== "download" && e !== "rowSpan" && e !== "colSpan" && e !== "role" && e in i)
136
136
  try {
137
- n[e] = t == null ? "" : t;
137
+ i[e] = t == null ? "" : t;
138
138
  break e;
139
139
  } catch (r) {
140
140
  }
141
- typeof t == "function" || (t == null || t === !1 && e[4] !== "-" ? n.removeAttribute(e) : n.setAttribute(e, t));
141
+ typeof t == "function" || (t == null || t === !1 && e[4] !== "-" ? i.removeAttribute(e) : i.setAttribute(e, t));
142
142
  }
143
143
  }
144
- function nt(n) {
145
- var e = this.l[n.type + !1];
146
- if (n.t) {
147
- if (n.t <= e.u)
144
+ function ot(i) {
145
+ var e = this.l[i.type + !1];
146
+ if (i.t) {
147
+ if (i.t <= e.u)
148
148
  return;
149
149
  } else
150
- n.t = Date.now();
151
- return e(m.event ? m.event(n) : n);
150
+ i.t = Date.now();
151
+ return e(g.event ? g.event(i) : i);
152
152
  }
153
- function it(n) {
154
- return this.l[n.type + !0](m.event ? m.event(n) : n);
153
+ function rt(i) {
154
+ return this.l[i.type + !0](g.event ? g.event(i) : i);
155
155
  }
156
- function Ze(n, e, t, i, s, o, r, a, u, f) {
157
- var d, c, _, v, h, p, y, b, C, N, T, E, R, D, P, z = e.type;
156
+ function Je(i, e, t, n, s, o, r, a, u, h) {
157
+ var d, c, p, m, f, v, _, y, C, E, T, k, F, D, U, z = 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 = m.__b) && d(e);
160
+ t.__h != null && (u = t.__h, a = e.__e = t.__e, e.__h = null, o = [a]), (d = g.__b) && d(e);
161
161
  e:
162
162
  if (typeof z == "function")
163
163
  try {
164
- if (b = e.props, C = (d = z.contextType) && i[d.__c], N = d ? C ? C.props.value : d.__ : i, t.__c ? y = (c = e.__c = t.__c).__ = c.__E : ("prototype" in z && z.prototype.render ? e.__c = c = new z(b, N) : (e.__c = c = new H(b, N), c.constructor = z, c.render = yn), C && C.sub(c), c.props = b, c.state || (c.state = {}), c.context = N, c.__n = i, _ = c.__d = !0, c.__h = [], c._sb = []), c.__s == null && (c.__s = c.state), z.getDerivedStateFromProps != null && (c.__s == c.state && (c.__s = F({}, c.__s)), F(c.__s, z.getDerivedStateFromProps(b, c.__s))), v = c.props, h = c.state, c.__v = e, _)
164
+ if (y = e.props, C = (d = z.contextType) && n[d.__c], E = d ? C ? C.props.value : d.__ : n, t.__c ? _ = (c = e.__c = t.__c).__ = c.__E : ("prototype" in z && z.prototype.render ? e.__c = c = new z(y, E) : (e.__c = c = new H(y, E), c.constructor = z, c.render = Ti), C && C.sub(c), c.props = y, c.state || (c.state = {}), c.context = E, c.__n = n, p = c.__d = !0, c.__h = [], c._sb = []), c.__s == null && (c.__s = c.state), z.getDerivedStateFromProps != null && (c.__s == c.state && (c.__s = q({}, c.__s)), q(c.__s, z.getDerivedStateFromProps(y, c.__s))), m = c.props, f = c.state, c.__v = e, p)
165
165
  z.getDerivedStateFromProps == null && c.componentWillMount != null && c.componentWillMount(), c.componentDidMount != null && c.__h.push(c.componentDidMount);
166
166
  else {
167
- if (z.getDerivedStateFromProps == null && b !== v && c.componentWillReceiveProps != null && c.componentWillReceiveProps(b, N), !c.__e && (c.shouldComponentUpdate != null && c.shouldComponentUpdate(b, c.__s, N) === !1 || e.__v === t.__v)) {
168
- for (e.__v !== t.__v && (c.props = b, c.state = c.__s, c.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.forEach(function(ve) {
169
- ve && (ve.__ = e);
167
+ if (z.getDerivedStateFromProps == null && y !== m && c.componentWillReceiveProps != null && c.componentWillReceiveProps(y, E), !c.__e && (c.shouldComponentUpdate != null && c.shouldComponentUpdate(y, c.__s, E) === !1 || e.__v === t.__v)) {
168
+ for (e.__v !== t.__v && (c.props = y, c.state = c.__s, c.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.forEach(function(me) {
169
+ me && (me.__ = e);
170
170
  }), T = 0; T < c._sb.length; T++)
171
171
  c.__h.push(c._sb[T]);
172
172
  c._sb = [], c.__h.length && r.push(c);
173
173
  break e;
174
174
  }
175
- c.componentWillUpdate != null && c.componentWillUpdate(b, c.__s, N), c.componentDidUpdate != null && c.__h.push(function() {
176
- c.componentDidUpdate(v, h, p);
175
+ c.componentWillUpdate != null && c.componentWillUpdate(y, c.__s, E), c.componentDidUpdate != null && c.__h.push(function() {
176
+ c.componentDidUpdate(m, f, v);
177
177
  });
178
178
  }
179
- if (c.context = N, c.props = b, c.__P = n, c.__e = !1, E = m.__r, R = 0, "prototype" in z && z.prototype.render) {
180
- for (c.state = c.__s, c.__d = !1, E && E(e), d = c.render(c.props, c.state, c.context), D = 0; D < c._sb.length; D++)
179
+ if (c.context = E, c.props = y, c.__P = i, c.__e = !1, k = g.__r, F = 0, "prototype" in z && z.prototype.render) {
180
+ for (c.state = c.__s, c.__d = !1, k && k(e), d = c.render(c.props, c.state, c.context), D = 0; D < c._sb.length; D++)
181
181
  c.__h.push(c._sb[D]);
182
182
  c._sb = [];
183
183
  } else
184
184
  do
185
- c.__d = !1, E && E(e), d = c.render(c.props, c.state, c.context), c.state = c.__s;
186
- while (c.__d && ++R < 25);
187
- c.state = c.__s, c.getChildContext != null && (i = F(F({}, i), c.getChildContext())), _ || c.getSnapshotBeforeUpdate == null || (p = c.getSnapshotBeforeUpdate(v, h)), Bt(n, ke(P = d != null && d.type === se && d.key == null ? d.props.children : d) ? P : [P], e, t, i, s, o, r, a, u, f), c.base = e.__e, e.__h = null, c.__h.length && r.push(c), y && (c.__E = c.__ = null);
188
- } catch (ve) {
189
- e.__v = null, (u || o != null) && (e.__e = a, e.__h = !!u, o[o.indexOf(a)] = null), m.__e(ve, e, t);
185
+ c.__d = !1, k && k(e), d = c.render(c.props, c.state, c.context), c.state = c.__s;
186
+ while (c.__d && ++F < 25);
187
+ c.state = c.__s, c.getChildContext != null && (n = q(q({}, n), c.getChildContext())), p || c.getSnapshotBeforeUpdate == null || (v = c.getSnapshotBeforeUpdate(m, f)), qt(i, Me(U = d != null && d.type === se && d.key == null ? d.props.children : d) ? U : [U], e, t, n, s, o, r, a, u, h), c.base = e.__e, e.__h = null, c.__h.length && r.push(c), _ && (c.__E = c.__ = null);
188
+ } catch (me) {
189
+ e.__v = null, (u || o != null) && (e.__e = a, e.__h = !!u, o[o.indexOf(a)] = null), g.__e(me, e, t);
190
190
  }
191
191
  else
192
- o == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e = gn(t.__e, e, t, i, s, o, r, u, f);
193
- (d = m.diffed) && d(e);
192
+ o == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e = Ci(t.__e, e, t, n, s, o, r, u, h);
193
+ (d = g.diffed) && d(e);
194
194
  }
195
- function Vt(n, e, t) {
196
- for (var i = 0; i < t.length; i++)
197
- Ge(t[i], t[++i], t[++i]);
198
- m.__c && m.__c(e, n), n.some(function(s) {
195
+ function Xt(i, e, t) {
196
+ for (var n = 0; n < t.length; n++)
197
+ Ke(t[n], t[++n], t[++n]);
198
+ g.__c && g.__c(e, i), i.some(function(s) {
199
199
  try {
200
- n = s.__h, s.__h = [], n.some(function(o) {
200
+ i = s.__h, s.__h = [], i.some(function(o) {
201
201
  o.call(s);
202
202
  });
203
203
  } catch (o) {
204
- m.__e(o, s.__v);
204
+ g.__e(o, s.__v);
205
205
  }
206
206
  });
207
207
  }
208
- function gn(n, e, t, i, s, o, r, a, u) {
209
- var f, d, c, _ = t.props, v = 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;
208
+ function Ci(i, e, t, n, s, o, r, a, u) {
209
+ var h, d, c, p = t.props, m = e.props, f = e.type, v = 0;
210
+ if (f === "svg" && (s = !0), o != null) {
211
+ for (; v < o.length; v++)
212
+ if ((h = o[v]) && "setAttribute" in h == !!f && (f ? h.localName === f : h.nodeType === 3)) {
213
+ i = h, o[v] = null;
214
214
  break;
215
215
  }
216
216
  }
217
- if (n == null) {
218
- if (h === null)
219
- return document.createTextNode(v);
220
- n = s ? document.createElementNS("http://www.w3.org/2000/svg", h) : document.createElement(h, v.is && v), o = null, a = !1;
217
+ if (i == null) {
218
+ if (f === null)
219
+ return document.createTextNode(m);
220
+ i = s ? document.createElementNS("http://www.w3.org/2000/svg", f) : document.createElement(f, m.is && m), o = null, a = !1;
221
221
  }
222
- if (h === null)
223
- _ === v || a && n.data === v || (n.data = v);
222
+ if (f === null)
223
+ p === m || a && i.data === m || (i.data = m);
224
224
  else {
225
- if (o = o && Ne.call(n.childNodes), d = (_ = t.props || ne).dangerouslySetInnerHTML, c = v.dangerouslySetInnerHTML, !a) {
225
+ if (o = o && $e.call(i.childNodes), d = (p = t.props || ie).dangerouslySetInnerHTML, c = m.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
- (c || d) && (c && (d && c.__html == d.__html || c.__html === n.innerHTML) || (n.innerHTML = c && c.__html || ""));
227
+ for (p = {}, v = 0; v < i.attributes.length; v++)
228
+ p[i.attributes[v].name] = i.attributes[v].value;
229
+ (c || d) && (c && (d && c.__html == d.__html || c.__html === i.innerHTML) || (i.innerHTML = c && c.__html || ""));
230
230
  }
231
- if (mn(n, v, _, s, a), c)
231
+ if (wi(i, m, p, s, a), c)
232
232
  e.__k = [];
233
- else if (Bt(n, ke(p = e.props.children) ? p : [p], e, t, i, s && h !== "foreignObject", o, r, o ? o[0] : t.__k && fe(t, 0), a, u), o != null)
234
- for (p = o.length; p--; )
235
- o[p] != null && Rt(o[p]);
236
- a || ("value" in v && (p = v.value) !== void 0 && (p !== n.value || h === "progress" && !p || h === "option" && p !== _.value) && xe(n, "value", p, _.value, !1), "checked" in v && (p = v.checked) !== void 0 && p !== n.checked && xe(n, "checked", p, _.checked, !1));
233
+ else if (qt(i, Me(v = e.props.children) ? v : [v], e, t, n, s && f !== "foreignObject", o, r, o ? o[0] : t.__k && pe(t, 0), a, u), o != null)
234
+ for (v = o.length; v--; )
235
+ o[v] != null && Wt(o[v]);
236
+ a || ("value" in m && (v = m.value) !== void 0 && (v !== i.value || f === "progress" && !v || f === "option" && v !== p.value) && ke(i, "value", v, p.value, !1), "checked" in m && (v = m.checked) !== void 0 && v !== i.checked && ke(i, "checked", v, p.checked, !1));
237
237
  }
238
- return n;
238
+ return i;
239
239
  }
240
- function Ge(n, e, t) {
240
+ function Ke(i, e, t) {
241
241
  try {
242
- typeof n == "function" ? n(e) : n.current = e;
243
- } catch (i) {
244
- m.__e(i, t);
242
+ typeof i == "function" ? i(e) : i.current = e;
243
+ } catch (n) {
244
+ g.__e(n, t);
245
245
  }
246
246
  }
247
- function We(n, e, t) {
248
- var i, s;
249
- if (m.unmount && m.unmount(n), (i = n.ref) && (i.current && i.current !== n.__e || Ge(i, null, e)), (i = n.__c) != null) {
250
- if (i.componentWillUnmount)
247
+ function Ye(i, e, t) {
248
+ var n, s;
249
+ if (g.unmount && g.unmount(i), (n = i.ref) && (n.current && n.current !== i.__e || Ke(n, null, e)), (n = i.__c) != null) {
250
+ if (n.componentWillUnmount)
251
251
  try {
252
- i.componentWillUnmount();
252
+ n.componentWillUnmount();
253
253
  } catch (o) {
254
- m.__e(o, e);
254
+ g.__e(o, e);
255
255
  }
256
- i.base = i.__P = null, n.__c = void 0;
256
+ n.base = n.__P = null, i.__c = void 0;
257
257
  }
258
- if (i = n.__k)
259
- for (s = 0; s < i.length; s++)
260
- i[s] && We(i[s], e, t || typeof n.type != "function");
261
- t || n.__e == null || Rt(n.__e), n.__ = n.__e = n.__d = void 0;
258
+ if (n = i.__k)
259
+ for (s = 0; s < n.length; s++)
260
+ n[s] && Ye(n[s], e, t || typeof i.type != "function");
261
+ t || i.__e == null || Wt(i.__e), i.__ = i.__e = i.__d = void 0;
262
262
  }
263
- function yn(n, e, t) {
264
- return this.constructor(n, t);
263
+ function Ti(i, e, t) {
264
+ return this.constructor(i, t);
265
265
  }
266
- function te(n, e, t) {
267
- var i, s, o, r;
268
- m.__ && m.__(n, e), s = (i = typeof t == "function") ? null : t && t.__k || e.__k, o = [], r = [], Ze(e, n = (!i && t || e).__k = I(se, null, [n]), s || ne, ne, e.ownerSVGElement !== void 0, !i && t ? [t] : s ? null : e.firstChild ? Ne.call(e.childNodes) : null, o, !i && t ? t : s ? s.__e : e.firstChild, i, r), Vt(o, n, r);
266
+ function te(i, e, t) {
267
+ var n, s, o, r;
268
+ g.__ && g.__(i, e), s = (n = typeof t == "function") ? null : t && t.__k || e.__k, o = [], r = [], Je(e, i = (!n && t || e).__k = I(se, null, [i]), s || ie, ie, e.ownerSVGElement !== void 0, !n && t ? [t] : s ? null : e.firstChild ? $e.call(e.childNodes) : null, o, !n && t ? t : s ? s.__e : e.firstChild, n, r), Xt(o, i, r);
269
269
  }
270
- function bn(n, e) {
271
- var t = { __c: e = "__cC" + Lt++, __: n, Consumer: function(i, s) {
272
- return i.children(s);
273
- }, Provider: function(i) {
270
+ function xi(i, e) {
271
+ var t = { __c: e = "__cC" + Ft++, __: i, Consumer: function(n, s) {
272
+ return n.children(s);
273
+ }, Provider: function(n) {
274
274
  var s, o;
275
275
  return this.getChildContext || (s = [], (o = {})[e] = this, this.getChildContext = function() {
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, qe(a);
279
+ a.__e = !0, je(a);
280
280
  });
281
281
  }, this.sub = function(r) {
282
282
  s.push(r);
@@ -284,36 +284,36 @@ function bn(n, e) {
284
284
  r.componentWillUnmount = function() {
285
285
  s.splice(s.indexOf(r), 1), a && a.call(r);
286
286
  };
287
- }), i.children;
287
+ }), n.children;
288
288
  } };
289
289
  return t.Provider.__ = t.Consumer.contextType = t;
290
290
  }
291
- Ne = Ot.slice, m = { __e: function(n, e, t, i) {
291
+ $e = Ut.slice, g = { __e: function(i, e, t, n) {
292
292
  for (var s, o, r; e = e.__; )
293
293
  if ((s = e.__c) && !s.__)
294
294
  try {
295
- if ((o = s.constructor) && o.getDerivedStateFromError != null && (s.setState(o.getDerivedStateFromError(n)), r = s.__d), s.componentDidCatch != null && (s.componentDidCatch(n, i || {}), r = s.__d), r)
295
+ if ((o = s.constructor) && o.getDerivedStateFromError != null && (s.setState(o.getDerivedStateFromError(i)), r = s.__d), s.componentDidCatch != null && (s.componentDidCatch(i, n || {}), r = s.__d), r)
296
296
  return s.__E = s;
297
297
  } catch (a) {
298
- n = a;
298
+ i = a;
299
299
  }
300
- throw n;
301
- } }, Dt = 0, zt = function(n) {
302
- return n != null && n.constructor === void 0;
303
- }, H.prototype.setState = function(n, e) {
300
+ throw i;
301
+ } }, Bt = 0, Rt = function(i) {
302
+ return i != null && i.constructor === void 0;
303
+ }, H.prototype.setState = function(i, e) {
304
304
  var t;
305
- t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = F({}, this.state), typeof n == "function" && (n = n(F({}, t), this.props)), n && F(t, n), n != null && this.__v && (e && this._sb.push(e), qe(this));
306
- }, H.prototype.forceUpdate = function(n) {
307
- this.__v && (this.__e = !0, n && this.__h.push(n), qe(this));
308
- }, H.prototype.render = se, G = [], Ht = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Ve = function(n, e) {
309
- return n.__v.__b - e.__v.__b;
310
- }, Te.__r = 0, Lt = 0;
311
- const wn = "ibiz", Cn = "is-";
312
- function X(n, e, t, i, s) {
313
- let o = "".concat(n, "-").concat(e);
314
- return t && (o += "-".concat(t)), i && (o += "__".concat(i)), s && (o += "--".concat(s)), o;
315
- }
316
- class M {
305
+ t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = q({}, this.state), typeof i == "function" && (i = i(q({}, t), this.props)), i && q(t, i), i != null && this.__v && (e && this._sb.push(e), je(this));
306
+ }, H.prototype.forceUpdate = function(i) {
307
+ this.__v && (this.__e = !0, i && this.__h.push(i), je(this));
308
+ }, H.prototype.render = se, J = [], Pt = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, qe = function(i, e) {
309
+ return i.__v.__b - e.__v.__b;
310
+ }, xe.__r = 0, Ft = 0;
311
+ const Si = "ibiz", ki = "is-";
312
+ function Z(i, e, t, n, s) {
313
+ let o = "".concat(i, "-").concat(e);
314
+ return t && (o += "-".concat(t)), n && (o += "__".concat(n)), s && (o += "--".concat(s)), o;
315
+ }
316
+ class $ {
317
317
  /**
318
318
  * Creates an instance of Namespace.
319
319
  *
@@ -331,7 +331,7 @@ class M {
331
331
  * @type {string}
332
332
  */
333
333
  w(this, "namespace");
334
- this.block = e, this.namespace = t || wn;
334
+ this.block = e, this.namespace = t || Si;
335
335
  }
336
336
  /**
337
337
  * namespace-block
@@ -343,7 +343,7 @@ class M {
343
343
  * @return {*} {string}
344
344
  */
345
345
  b(e = "") {
346
- return X(this.namespace, this.block, e, "", "");
346
+ return Z(this.namespace, this.block, e, "", "");
347
347
  }
348
348
  /**
349
349
  * namespace-block__element
@@ -354,7 +354,7 @@ class M {
354
354
  * @return {*} {string}
355
355
  */
356
356
  e(e) {
357
- return e ? X(this.namespace, this.block, "", e, "") : "";
357
+ return e ? Z(this.namespace, this.block, "", e, "") : "";
358
358
  }
359
359
  /**
360
360
  * namespace-block--modifier
@@ -365,7 +365,7 @@ class M {
365
365
  * @return {*} {string}
366
366
  */
367
367
  m(e) {
368
- return e ? X(this.namespace, this.block, "", "", e) : "";
368
+ return e ? Z(this.namespace, this.block, "", "", e) : "";
369
369
  }
370
370
  /**
371
371
  * namespace-block-blockSuffix__element
@@ -377,7 +377,7 @@ class M {
377
377
  * @return {*} {string}
378
378
  */
379
379
  be(e, t) {
380
- return e && t ? X(this.namespace, this.block, e, t, "") : "";
380
+ return e && t ? Z(this.namespace, this.block, e, t, "") : "";
381
381
  }
382
382
  /**
383
383
  * namespace-block__element--modifier
@@ -389,7 +389,7 @@ class M {
389
389
  * @return {*} {string}
390
390
  */
391
391
  em(e, t) {
392
- return e && t ? X(this.namespace, this.block, "", e, t) : "";
392
+ return e && t ? Z(this.namespace, this.block, "", e, t) : "";
393
393
  }
394
394
  /**
395
395
  * namespace-block-blockSuffix--modifier
@@ -401,7 +401,7 @@ class M {
401
401
  * @return {*} {string}
402
402
  */
403
403
  bm(e, t) {
404
- return e && t ? X(this.namespace, this.block, e, "", t) : "";
404
+ return e && t ? Z(this.namespace, this.block, e, "", t) : "";
405
405
  }
406
406
  /**
407
407
  * namespace-block-blockSuffix__element--modifier
@@ -413,8 +413,8 @@ class M {
413
413
  * @param {string} [modifier]
414
414
  * @return {*} {string}
415
415
  */
416
- bem(e, t, i) {
417
- return e && t && i ? X(this.namespace, this.block, e, t, i) : "";
416
+ bem(e, t, n) {
417
+ return e && t && n ? Z(this.namespace, this.block, e, t, n) : "";
418
418
  }
419
419
  /**
420
420
  * 返回状态 class
@@ -429,7 +429,7 @@ class M {
429
429
  * @return {*} {string}
430
430
  */
431
431
  is(e, t) {
432
- return e && t ? "".concat(Cn).concat(e) : "";
432
+ return e && t ? "".concat(ki).concat(e) : "";
433
433
  }
434
434
  /**
435
435
  * 生成使用到的 css 变量 style 对象
@@ -441,8 +441,8 @@ class M {
441
441
  */
442
442
  cssVar(e) {
443
443
  const t = {};
444
- for (const i in e)
445
- e[i] && (t[this.cssVarName(i)] = e[i]);
444
+ for (const n in e)
445
+ e[n] && (t[this.cssVarName(n)] = e[n]);
446
446
  return t;
447
447
  }
448
448
  /**
@@ -455,8 +455,8 @@ class M {
455
455
  */
456
456
  cssVarBlock(e) {
457
457
  const t = {};
458
- for (const i in e)
459
- e[i] && (t[this.cssVarBlockName(i)] = e[i]);
458
+ for (const n in e)
459
+ e[n] && (t[this.cssVarBlockName(n)] = e[n]);
460
460
  return t;
461
461
  }
462
462
  /**
@@ -482,14 +482,14 @@ class M {
482
482
  return "--".concat(this.namespace, "-").concat(this.block, "-").concat(e);
483
483
  }
484
484
  }
485
- function L(n) {
486
- if (typeof n != "string")
487
- throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
485
+ function L(i) {
486
+ if (typeof i != "string")
487
+ throw new TypeError("Path must be a string. Received " + JSON.stringify(i));
488
488
  }
489
- function st(n, e) {
490
- for (var t = "", i = 0, s = -1, o = 0, r, a = 0; a <= n.length; ++a) {
491
- if (a < n.length)
492
- r = n.charCodeAt(a);
489
+ function at(i, e) {
490
+ for (var t = "", n = 0, s = -1, o = 0, r, a = 0; a <= i.length; ++a) {
491
+ if (a < i.length)
492
+ r = i.charCodeAt(a);
493
493
  else {
494
494
  if (r === 47)
495
495
  break;
@@ -498,45 +498,45 @@ function st(n, e) {
498
498
  if (r === 47) {
499
499
  if (!(s === a - 1 || o === 1))
500
500
  if (s !== a - 1 && o === 2) {
501
- if (t.length < 2 || i !== 2 || t.charCodeAt(t.length - 1) !== 46 || t.charCodeAt(t.length - 2) !== 46) {
501
+ if (t.length < 2 || n !== 2 || t.charCodeAt(t.length - 1) !== 46 || t.charCodeAt(t.length - 2) !== 46) {
502
502
  if (t.length > 2) {
503
503
  var u = t.lastIndexOf("/");
504
504
  if (u !== t.length - 1) {
505
- u === -1 ? (t = "", i = 0) : (t = t.slice(0, u), i = t.length - 1 - t.lastIndexOf("/")), s = a, o = 0;
505
+ u === -1 ? (t = "", n = 0) : (t = t.slice(0, u), n = t.length - 1 - t.lastIndexOf("/")), s = a, o = 0;
506
506
  continue;
507
507
  }
508
508
  } else if (t.length === 2 || t.length === 1) {
509
- t = "", i = 0, s = a, o = 0;
509
+ t = "", n = 0, s = a, o = 0;
510
510
  continue;
511
511
  }
512
512
  }
513
- e && (t.length > 0 ? t += "/.." : t = "..", i = 2);
513
+ e && (t.length > 0 ? t += "/.." : t = "..", n = 2);
514
514
  } else
515
- t.length > 0 ? t += "/" + n.slice(s + 1, a) : t = n.slice(s + 1, a), i = a - s - 1;
515
+ t.length > 0 ? t += "/" + i.slice(s + 1, a) : t = i.slice(s + 1, a), n = a - s - 1;
516
516
  s = a, o = 0;
517
517
  } else
518
518
  r === 46 && o !== -1 ? ++o : o = -1;
519
519
  }
520
520
  return t;
521
521
  }
522
- function Tn(n, e) {
523
- var t = e.dir || e.root, i = e.base || (e.name || "") + (e.ext || "");
524
- return t ? t === e.root ? t + i : t + n + i : i;
522
+ function Ei(i, e) {
523
+ var t = e.dir || e.root, n = e.base || (e.name || "") + (e.ext || "");
524
+ return t ? t === e.root ? t + n : t + i + n : n;
525
525
  }
526
- var ue = {
526
+ var he = {
527
527
  // path.resolve([from ...], to)
528
528
  resolve: function() {
529
- for (var e = "", t = !1, i, s = arguments.length - 1; s >= -1 && !t; s--) {
529
+ for (var e = "", t = !1, n, 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), L(o), o.length !== 0 && (e = o + "/" + e, t = o.charCodeAt(0) === 47);
531
+ s >= 0 ? o = arguments[s] : (n === void 0 && (n = process.cwd()), o = n), L(o), o.length !== 0 && (e = o + "/" + e, t = o.charCodeAt(0) === 47);
532
532
  }
533
- return e = st(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
533
+ return e = at(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
534
534
  },
535
535
  normalize: function(e) {
536
536
  if (L(e), e.length === 0)
537
537
  return ".";
538
- var t = e.charCodeAt(0) === 47, i = e.charCodeAt(e.length - 1) === 47;
539
- return e = st(e, !t), e.length === 0 && !t && (e = "."), e.length > 0 && i && (e += "/"), t ? "/" + e : e;
538
+ var t = e.charCodeAt(0) === 47, n = e.charCodeAt(e.length - 1) === 47;
539
+ return e = at(e, !t), e.length === 0 && !t && (e = "."), e.length > 0 && n && (e += "/"), t ? "/" + e : e;
540
540
  },
541
541
  isAbsolute: function(e) {
542
542
  return L(e), e.length > 0 && e.charCodeAt(0) === 47;
@@ -545,38 +545,38 @@ var ue = {
545
545
  if (arguments.length === 0)
546
546
  return ".";
547
547
  for (var e, t = 0; t < arguments.length; ++t) {
548
- var i = arguments[t];
549
- L(i), i.length > 0 && (e === void 0 ? e = i : e += "/" + i);
548
+ var n = arguments[t];
549
+ L(n), n.length > 0 && (e === void 0 ? e = n : e += "/" + n);
550
550
  }
551
- return e === void 0 ? "." : ue.normalize(e);
551
+ return e === void 0 ? "." : he.normalize(e);
552
552
  },
553
553
  relative: function(e, t) {
554
- if (L(e), L(t), e === t || (e = ue.resolve(e), t = ue.resolve(t), e === t))
554
+ if (L(e), L(t), e === t || (e = he.resolve(e), t = he.resolve(t), e === t))
555
555
  return "";
556
- for (var i = 1; i < e.length && e.charCodeAt(i) === 47; ++i)
556
+ for (var n = 1; n < e.length && e.charCodeAt(n) === 47; ++n)
557
557
  ;
558
- for (var s = e.length, o = s - i, r = 1; r < t.length && t.charCodeAt(r) === 47; ++r)
558
+ for (var s = e.length, o = s - n, 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, c = 0; c <= f; ++c) {
561
- if (c === f) {
562
- if (u > f) {
560
+ for (var a = t.length, u = a - r, h = o < u ? o : u, d = -1, c = 0; c <= h; ++c) {
561
+ if (c === h) {
562
+ if (u > h) {
563
563
  if (t.charCodeAt(r + c) === 47)
564
564
  return t.slice(r + c + 1);
565
565
  if (c === 0)
566
566
  return t.slice(r + c);
567
567
  } else
568
- o > f && (e.charCodeAt(i + c) === 47 ? d = c : c === 0 && (d = 0));
568
+ o > h && (e.charCodeAt(n + c) === 47 ? d = c : c === 0 && (d = 0));
569
569
  break;
570
570
  }
571
- var _ = e.charCodeAt(i + c), v = t.charCodeAt(r + c);
572
- if (_ !== v)
571
+ var p = e.charCodeAt(n + c), m = t.charCodeAt(r + c);
572
+ if (p !== m)
573
573
  break;
574
- _ === 47 && (d = c);
574
+ p === 47 && (d = c);
575
575
  }
576
- var h = "";
577
- for (c = i + d + 1; c <= s; ++c)
578
- (c === s || e.charCodeAt(c) === 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 f = "";
577
+ for (c = n + d + 1; c <= s; ++c)
578
+ (c === s || e.charCodeAt(c) === 47) && (f.length === 0 ? f += ".." : f += "/..");
579
+ return f.length > 0 ? f + t.slice(r + d) : (r += d, t.charCodeAt(r) === 47 && ++r, t.slice(r));
580
580
  },
581
581
  _makeLong: function(e) {
582
582
  return e;
@@ -584,7 +584,7 @@ var ue = {
584
584
  dirname: function(e) {
585
585
  if (L(e), e.length === 0)
586
586
  return ".";
587
- for (var t = e.charCodeAt(0), i = t === 47, s = -1, o = !0, r = e.length - 1; r >= 1; --r)
587
+ for (var t = e.charCodeAt(0), n = t === 47, s = -1, o = !0, r = e.length - 1; r >= 1; --r)
588
588
  if (t = e.charCodeAt(r), t === 47) {
589
589
  if (!o) {
590
590
  s = r;
@@ -592,47 +592,47 @@ var ue = {
592
592
  }
593
593
  } else
594
594
  o = !1;
595
- return s === -1 ? i ? "/" : "." : i && s === 1 ? "//" : e.slice(0, s);
595
+ return s === -1 ? n ? "/" : "." : n && s === 1 ? "//" : e.slice(0, s);
596
596
  },
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
600
  L(e);
601
- var i = 0, s = -1, o = !0, r;
601
+ var n = 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
- i = r + 1;
610
+ n = 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
- return i === s ? s = u : s === -1 && (s = e.length), e.slice(i, s);
616
+ return n === s ? s = u : s === -1 && (s = e.length), e.slice(n, s);
617
617
  } else {
618
618
  for (r = e.length - 1; r >= 0; --r)
619
619
  if (e.charCodeAt(r) === 47) {
620
620
  if (!o) {
621
- i = r + 1;
621
+ n = r + 1;
622
622
  break;
623
623
  }
624
624
  } else
625
625
  s === -1 && (o = !1, s = r + 1);
626
- return s === -1 ? "" : e.slice(i, s);
626
+ return s === -1 ? "" : e.slice(n, s);
627
627
  }
628
628
  },
629
629
  extname: function(e) {
630
630
  L(e);
631
- for (var t = -1, i = 0, s = -1, o = !0, r = 0, a = e.length - 1; a >= 0; --a) {
631
+ for (var t = -1, n = 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) {
634
634
  if (!o) {
635
- i = a + 1;
635
+ n = a + 1;
636
636
  break;
637
637
  }
638
638
  continue;
@@ -641,29 +641,29 @@ var ue = {
641
641
  }
642
642
  return t === -1 || s === -1 || // We saw a non-dot character immediately before the dot
643
643
  r === 0 || // The (right-most) trimmed path component is exactly '..'
644
- r === 1 && t === s - 1 && t === i + 1 ? "" : e.slice(t, s);
644
+ r === 1 && t === s - 1 && t === n + 1 ? "" : e.slice(t, s);
645
645
  },
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 Tn("/", e);
649
+ return Ei("/", e);
650
650
  },
651
651
  parse: function(e) {
652
652
  L(e);
653
653
  var t = { root: "", dir: "", base: "", ext: "", name: "" };
654
654
  if (e.length === 0)
655
655
  return t;
656
- var i = e.charCodeAt(0), s = i === 47, o;
656
+ var n = e.charCodeAt(0), s = n === 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, c = 0; d >= o; --d) {
659
- if (i = e.charCodeAt(d), i === 47) {
660
- if (!f) {
658
+ for (var r = -1, a = 0, u = -1, h = !0, d = e.length - 1, c = 0; d >= o; --d) {
659
+ if (n = e.charCodeAt(d), n === 47) {
660
+ if (!h) {
661
661
  a = d + 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 : c !== 1 && (c = 1) : r !== -1 && (c = -1);
666
+ u === -1 && (h = !1, u = d + 1), n === 46 ? r === -1 ? r = d : c !== 1 && (c = 1) : r !== -1 && (c = -1);
667
667
  }
668
668
  return r === -1 || u === -1 || // We saw a non-dot character immediately before the dot
669
669
  c === 0 || // The (right-most) trimmed path component is exactly '..'
@@ -674,14 +674,14 @@ var ue = {
674
674
  win32: null,
675
675
  posix: null
676
676
  };
677
- ue.posix = ue;
678
- function B() {
677
+ he.posix = he;
678
+ function W() {
679
679
  return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
680
680
  }
681
- function qt() {
682
- return "".concat(B() + B(), "-").concat(B(), "-").concat(B(), "-").concat(B(), "-").concat(B()).concat(B()).concat(B());
681
+ function Zt() {
682
+ return "".concat(W() + W(), "-").concat(W(), "-").concat(W(), "-").concat(W(), "-").concat(W()).concat(W()).concat(W());
683
683
  }
684
- class Wt {
684
+ class Gt {
685
685
  /**
686
686
  * 拷贝文本
687
687
  *
@@ -702,8 +702,8 @@ class Wt {
702
702
  * @private
703
703
  * @type {(HTMLInputElement | null)}
704
704
  */
705
- w(Wt, "inputElement", null);
706
- const g = class g {
705
+ w(Gt, "inputElement", null);
706
+ const b = class b {
707
707
  /**
708
708
  * 检查数据库是否存在
709
709
  *
@@ -713,7 +713,7 @@ const g = class g {
713
713
  */
714
714
  static async checkDataBaseExists(e) {
715
715
  try {
716
- return (await indexedDB.databases()).some((i) => i.name === e);
716
+ return (await indexedDB.databases()).some((n) => n.name === e);
717
717
  } catch (t) {
718
718
  return console.error("检查数据库是否存在时出错:", t), !1;
719
719
  }
@@ -725,8 +725,8 @@ const g = class g {
725
725
  * @memberof IndexedDBUtil
726
726
  */
727
727
  static async deleteDatabase(e) {
728
- var t, i;
729
- return g.lastLink && ((i = (t = g.lastLink).close) == null || i.call(t)), new Promise((s, o) => {
728
+ var t, n;
729
+ return b.lastLink && ((n = (t = b.lastLink).close) == null || n.call(t)), new Promise((s, o) => {
730
730
  const r = indexedDB.deleteDatabase(e);
731
731
  r.onsuccess = () => {
732
732
  s(!0);
@@ -746,13 +746,13 @@ const g = class g {
746
746
  * @memberof IndexedDBUtil
747
747
  */
748
748
  static async checkTableExists(e, t) {
749
- return await g.checkDataBaseExists(e) ? new Promise((s, o) => {
749
+ return await b.checkDataBaseExists(e) ? new Promise((s, o) => {
750
750
  const r = indexedDB.open(e);
751
751
  r.onupgradeneeded = (a) => {
752
- g.db = a.target.result, g.version = g.db.version;
752
+ b.db = a.target.result, b.version = b.db.version;
753
753
  }, r.onsuccess = (a) => {
754
- g.db = a.target.result, g.lastLink = r.result;
755
- const u = g.db.objectStoreNames.contains(t);
754
+ b.db = a.target.result, b.lastLink = r.result;
755
+ const u = b.db.objectStoreNames.contains(t);
756
756
  r.result.close(), s(u);
757
757
  }, r.onerror = (a) => {
758
758
  o(a.target.error);
@@ -768,18 +768,18 @@ const g = class g {
768
768
  * @return {*} {Promise<void>}
769
769
  * @memberof IndexedDBUtil
770
770
  */
771
- static async createTable(e, t, i, s = !1) {
771
+ static async createTable(e, t, n, s = !1) {
772
772
  return new Promise((o) => {
773
773
  var a, u;
774
- g.version += 1, g.lastLink && ((u = (a = g.lastLink).close) == null || u.call(a));
775
- const r = indexedDB.open(e, g.version);
776
- r.onupgradeneeded = (f) => {
777
- if (g.db = f.target.result, !g.db.objectStoreNames.contains(t)) {
774
+ b.version += 1, b.lastLink && ((u = (a = b.lastLink).close) == null || u.call(a));
775
+ const r = indexedDB.open(e, b.version);
776
+ r.onupgradeneeded = (h) => {
777
+ if (b.db = h.target.result, !b.db.objectStoreNames.contains(t)) {
778
778
  const d = {};
779
- i ? d.keyPath = i : s && (d.autoIncrement = !0), g.db.createObjectStore(t, d);
779
+ n ? d.keyPath = n : s && (d.autoIncrement = !0), b.db.createObjectStore(t, d);
780
780
  }
781
781
  }, r.onsuccess = () => {
782
- g.lastLink = r.result, r.result.close(), o(!0);
782
+ b.lastLink = r.result, r.result.close(), o(!0);
783
783
  }, r.onerror = () => {
784
784
  o(!1);
785
785
  };
@@ -793,16 +793,16 @@ const g = class g {
793
793
  * @memberof IndexedDBUtil
794
794
  */
795
795
  static async deleteTable(e, t) {
796
- return new Promise((i) => {
796
+ return new Promise((n) => {
797
797
  var o, r;
798
- g.version += 1, g.lastLink && ((r = (o = g.lastLink).close) == null || r.call(o));
799
- const s = indexedDB.open(e, g.version);
798
+ b.version += 1, b.lastLink && ((r = (o = b.lastLink).close) == null || r.call(o));
799
+ const s = indexedDB.open(e, b.version);
800
800
  s.onupgradeneeded = (a) => {
801
- g.db = a.target.result, g.lastLink = s.result, g.db.objectStoreNames.contains(t) && g.db.deleteObjectStore(t);
801
+ b.db = a.target.result, b.lastLink = s.result, b.db.objectStoreNames.contains(t) && b.db.deleteObjectStore(t);
802
802
  }, s.onsuccess = (a) => {
803
- g.db = a.target.result, g.lastLink = s.result, s.result.close(), i(!0);
803
+ b.db = a.target.result, b.lastLink = s.result, s.result.close(), n(!0);
804
804
  }, s.onerror = () => {
805
- s.result.close(), i(!1);
805
+ s.result.close(), n(!1);
806
806
  };
807
807
  });
808
808
  }
@@ -814,14 +814,14 @@ const g = class g {
814
814
  * @return {*} {Promise<void>}
815
815
  * @memberof IndexedDBUtil
816
816
  */
817
- static async addData(e, t, i) {
817
+ static async addData(e, t, n) {
818
818
  return new Promise((s, o) => {
819
819
  const r = indexedDB.open(e);
820
820
  r.onsuccess = (a) => {
821
- if (g.db = a.target.result, g.lastLink = r.result, g.db.objectStoreNames.contains(t)) {
822
- const d = g.db.transaction([t], "readwrite").objectStore(t).add(i);
821
+ if (b.db = a.target.result, b.lastLink = r.result, b.db.objectStoreNames.contains(t)) {
822
+ const d = b.db.transaction([t], "readwrite").objectStore(t).add(n);
823
823
  d.onsuccess = (c) => {
824
- s(i);
824
+ s(n);
825
825
  }, d.onerror = () => {
826
826
  s(null);
827
827
  };
@@ -840,12 +840,12 @@ const g = class g {
840
840
  * @return {*} {Promise<void>}
841
841
  * @memberof IndexedDBUtil
842
842
  */
843
- static async deleteData(e, t, i) {
843
+ static async deleteData(e, t, n) {
844
844
  return new Promise((s, o) => {
845
845
  const r = indexedDB.open(e);
846
846
  r.onsuccess = (a) => {
847
- if (g.db = a.target.result, g.lastLink = r.result, g.db.objectStoreNames.contains(t)) {
848
- const d = g.db.transaction([t], "readwrite").objectStore(t).delete(i);
847
+ if (b.db = a.target.result, b.lastLink = r.result, b.db.objectStoreNames.contains(t)) {
848
+ const d = b.db.transaction([t], "readwrite").objectStore(t).delete(n);
849
849
  d.onsuccess = (c) => {
850
850
  s(!0);
851
851
  }, d.onerror = () => {
@@ -866,16 +866,16 @@ const g = class g {
866
866
  * @return {*} {Promise<void>}
867
867
  * @memberof IndexedDBUtil
868
868
  */
869
- static async updateData(e, t, i) {
869
+ static async updateData(e, t, n) {
870
870
  return new Promise((s, o) => {
871
871
  const r = indexedDB.open(e);
872
872
  r.onsuccess = (a) => {
873
- if (g.db = a.target.result, g.lastLink = r.result, g.db.objectStoreNames.contains(t)) {
874
- const d = g.db.transaction([t], "readwrite").objectStore(t).put(i);
873
+ if (b.db = a.target.result, b.lastLink = r.result, b.db.objectStoreNames.contains(t)) {
874
+ const d = b.db.transaction([t], "readwrite").objectStore(t).put(n);
875
875
  d.onsuccess = (c) => {
876
- s(i);
876
+ s(n);
877
877
  }, d.onerror = () => {
878
- s(i);
878
+ s(n);
879
879
  };
880
880
  }
881
881
  r.result.close();
@@ -892,16 +892,16 @@ const g = class g {
892
892
  * @return {*} {Promise<any>}
893
893
  * @memberof IndexedDBUtil
894
894
  */
895
- static async getData(e, t, i) {
895
+ static async getData(e, t, n) {
896
896
  return new Promise((s, o) => {
897
897
  const r = indexedDB.open(e);
898
898
  r.onsuccess = (a) => {
899
- if (g.db = a.target.result, g.lastLink = r.result, g.db.objectStoreNames.contains(t)) {
900
- const d = g.db.transaction([t], "readonly").objectStore(t).get(i);
899
+ if (b.db = a.target.result, b.lastLink = r.result, b.db.objectStoreNames.contains(t)) {
900
+ const d = b.db.transaction([t], "readonly").objectStore(t).get(n);
901
901
  d.onsuccess = (c) => {
902
902
  s(d.result);
903
903
  }, d.onerror = () => {
904
- o(new Error("未找到数据".concat(i)));
904
+ o(new Error("未找到数据".concat(n)));
905
905
  };
906
906
  }
907
907
  r.result.close();
@@ -918,15 +918,15 @@ const g = class g {
918
918
  * @memberof IndexedDBUtil
919
919
  */
920
920
  static async getAllData(e, t) {
921
- return new Promise((i, s) => {
921
+ return new Promise((n, s) => {
922
922
  const o = indexedDB.open(e);
923
923
  o.onsuccess = (r) => {
924
- if (g.db = r.target.result, g.lastLink = o.result, g.db.objectStoreNames.contains(t)) {
925
- const f = g.db.transaction([t], "readonly").objectStore(t).getAll();
926
- f.onsuccess = (d) => {
927
- i(f.result);
928
- }, f.onerror = () => {
929
- i([]);
924
+ if (b.db = r.target.result, b.lastLink = o.result, b.db.objectStoreNames.contains(t)) {
925
+ const h = b.db.transaction([t], "readonly").objectStore(t).getAll();
926
+ h.onsuccess = (d) => {
927
+ n(h.result);
928
+ }, h.onerror = () => {
929
+ n([]);
930
930
  };
931
931
  }
932
932
  o.result.close();
@@ -937,11 +937,11 @@ const g = class g {
937
937
  }
938
938
  };
939
939
  // 数据库版本
940
- w(g, "version", 1), // 数据库连接句柄
941
- w(g, "db", null), // 上一个连接
942
- w(g, "lastLink");
943
- let V = g;
944
- class Sn {
940
+ w(b, "version", 1), // 数据库连接句柄
941
+ w(b, "db", null), // 上一个连接
942
+ w(b, "lastLink");
943
+ let Y = b;
944
+ class Ni {
945
945
  /**
946
946
  * Creates an instance of FileUploader.
947
947
  * @author tony001
@@ -963,34 +963,34 @@ class Sn {
963
963
  openFilePicker() {
964
964
  const e = document.createElement("input");
965
965
  e.type = "file", e.multiple = this.options.multiple, e.accept = this.options.accept || "", e.onchange = (t) => {
966
- const i = Array.from(t.target.files || []);
967
- this.handleFiles(i);
966
+ const n = Array.from(t.target.files || []);
967
+ this.handleFiles(n);
968
968
  }, e.click();
969
969
  }
970
970
  /**
971
971
  * 处理选择的文件
972
972
  */
973
973
  async handleFiles(e) {
974
- var i, s;
974
+ var n, s;
975
975
  if (e.length === 0)
976
976
  return;
977
977
  const t = e.filter((o) => {
978
978
  var r, a;
979
979
  return this.options.maxSize && o.size > this.options.maxSize ? ((a = (r = this.options).onError) == null || a.call(r, new Error("文件大小超过限制 (".concat(this.formatSize(o.size), " > ").concat(this.formatSize(this.options.maxSize), ")")), o), !1) : !0;
980
980
  });
981
- (s = (i = this.options).onSelect) == null || s.call(i, t), await Promise.all(t.map((o) => this.processFile(o)));
981
+ (s = (n = this.options).onSelect) == null || s.call(n, t), await Promise.all(t.map((o) => this.processFile(o)));
982
982
  }
983
983
  /**
984
984
  * 处理单个文件上传
985
985
  */
986
986
  async processFile(e) {
987
- var t, i, s, o, r, a;
987
+ var t, n, s, o, r, a;
988
988
  try {
989
989
  const u = (d) => {
990
- var c, _;
991
- (_ = (c = this.options).onProgress) == null || _.call(c, e, d);
992
- }, f = await this.options.onUpload(e, u);
993
- (i = (t = this.options).onProgress) == null || i.call(t, e, 100), (o = (s = this.options).onSuccess) == null || o.call(s, f, e);
990
+ var c, p;
991
+ (p = (c = this.options).onProgress) == null || p.call(c, e, d);
992
+ }, h = await this.options.onUpload(e, u);
993
+ (n = (t = this.options).onProgress) == null || n.call(t, e, 100), (o = (s = this.options).onSuccess) == null || o.call(s, h, e);
994
994
  } catch (u) {
995
995
  (a = (r = this.options).onError) == null || a.call(r, u instanceof Error ? u : new Error("上传失败"), e);
996
996
  }
@@ -1001,11 +1001,11 @@ class Sn {
1001
1001
  formatSize(e) {
1002
1002
  if (e === 0)
1003
1003
  return "0 B";
1004
- const t = ["B", "KB", "MB", "GB"], i = Math.floor(Math.log(e) / Math.log(1024));
1005
- return "".concat((e / 1024 ** i).toFixed(2), " ").concat(t[i]);
1004
+ const t = ["B", "KB", "MB", "GB"], n = Math.floor(Math.log(e) / Math.log(1024));
1005
+ return "".concat((e / 1024 ** n).toFixed(2), " ").concat(t[n]);
1006
1006
  }
1007
1007
  }
1008
- class jt {
1008
+ class Jt {
1009
1009
  /**
1010
1010
  * 从XML元素中提取CDATA内容
1011
1011
  *
@@ -1019,7 +1019,7 @@ class jt {
1019
1019
  static getCdataContent(e) {
1020
1020
  if (!e)
1021
1021
  return null;
1022
- const t = Array.from(e.childNodes).find((i) => i.nodeType === i.CDATA_SECTION_NODE);
1022
+ const t = Array.from(e.childNodes).find((n) => n.nodeType === n.CDATA_SECTION_NODE);
1023
1023
  return (t == null ? void 0 : t.nodeValue) || e.textContent;
1024
1024
  }
1025
1025
  /**
@@ -1032,19 +1032,19 @@ class jt {
1032
1032
  * @return {*} {IMaterial[]}
1033
1033
  */
1034
1034
  static parse(e) {
1035
- const i = new DOMParser().parseFromString(e, "text/xml");
1036
- return Array.from(i.querySelectorAll("resource")).map((o) => {
1035
+ const n = new DOMParser().parseFromString(e, "text/xml");
1036
+ return Array.from(n.querySelectorAll("resource")).map((o) => {
1037
1037
  const r = o.getAttribute("type") || "", a = o.querySelector("data"), u = o.querySelector("metadata");
1038
1038
  try {
1039
- const f = this.getCdataContent(a), d = this.getCdataContent(u), c = f ? JSON.parse(f) : {}, _ = d ? JSON.parse(d) : {};
1039
+ const h = this.getCdataContent(a), d = this.getCdataContent(u), c = h ? JSON.parse(h) : {}, p = d ? JSON.parse(d) : {};
1040
1040
  return {
1041
1041
  id: c.id,
1042
1042
  type: r,
1043
1043
  data: c,
1044
- metadata: _
1044
+ metadata: p
1045
1045
  };
1046
- } catch (f) {
1047
- throw new Error("XML 解析错误: ".concat(f.message));
1046
+ } catch (h) {
1047
+ throw new Error("XML 解析错误: ".concat(h.message));
1048
1048
  }
1049
1049
  });
1050
1050
  }
@@ -1063,14 +1063,14 @@ class jt {
1063
1063
  * }}
1064
1064
  */
1065
1065
  static parseMixedContent(e) {
1066
- const i = /<resources\b[^>]*>[\s\S]*?<\/resources>/i.exec(e);
1067
- if (!i)
1066
+ const n = /<resources\b[^>]*>[\s\S]*?<\/resources>/i.exec(e);
1067
+ if (!n)
1068
1068
  return {
1069
1069
  resources: [],
1070
1070
  remainingText: e,
1071
1071
  hasResources: !1
1072
1072
  };
1073
- const [s] = i, o = i.index, r = o + s.length, a = e.slice(0, o) + e.slice(r);
1073
+ const [s] = n, o = n.index, r = o + s.length, a = (e.slice(0, o) + e.slice(r)).replace(/\n/g, "");
1074
1074
  try {
1075
1075
  return {
1076
1076
  resources: this.parse(s),
@@ -1096,214 +1096,219 @@ class jt {
1096
1096
  * @return {*} {string}
1097
1097
  */
1098
1098
  static stringify(e) {
1099
- const t = document.implementation.createDocument(null, null, null), i = t.createElement("resources");
1100
- return i.setAttribute("version", "1.0"), e.forEach((s) => {
1101
- const o = t.createElement("resource");
1102
- o.setAttribute("type", s.type), o.setAttribute("version", "1.0");
1103
- const r = (a, u) => {
1104
- const f = t.createElement(a), d = t.createCDATASection(JSON.stringify(u));
1105
- return f.appendChild(d), f;
1099
+ const t = document.implementation.createDocument(null, null, null), n = t.createElement("resources");
1100
+ n.setAttribute("version", "1.0");
1101
+ const s = (r) => "\n".concat(" ".repeat(r)), o = 1;
1102
+ return e.forEach((r) => {
1103
+ n.appendChild(t.createTextNode(s(o)));
1104
+ const a = t.createElement("resource");
1105
+ a.setAttribute("type", r.type), a.setAttribute("version", "1.0");
1106
+ const u = (h, d) => {
1107
+ const c = t.createElement(h);
1108
+ c.appendChild(t.createTextNode(s(o + 1)));
1109
+ const p = t.createCDATASection(JSON.stringify(d));
1110
+ return c.appendChild(p), c.appendChild(t.createTextNode(s(o))), c;
1106
1111
  };
1107
- o.appendChild(r("data", s.data)), o.appendChild(r("metadata", s.metadata)), i.appendChild(o);
1108
- }), t.appendChild(i), new XMLSerializer().serializeToString(t);
1109
- }
1110
- }
1111
- var oe, S, Le, ot, pe = 0, Yt = [], we = [], rt = m.__b, at = m.__r, ct = m.diffed, lt = m.__c, ut = m.unmount;
1112
- function Me(n, e) {
1113
- m.__h && m.__h(S, n, pe || e), pe = 0;
1114
- var t = S.__H || (S.__H = { __: [], __h: [] });
1115
- return n >= t.__.length && t.__.push({ __V: we }), t.__[n];
1116
- }
1117
- function Je(n) {
1118
- return pe = 1, xn(Zt, n);
1119
- }
1120
- function xn(n, e, t) {
1121
- var i = Me(oe++, 2);
1122
- if (i.t = n, !i.__c && (i.__ = [t ? t(e) : Zt(void 0, e), function(a) {
1123
- var u = i.__N ? i.__N[0] : i.__[0], f = i.t(u, a);
1124
- u !== f && (i.__N = [f, i.__[1]], i.__c.setState({}));
1125
- }], i.__c = S, !S.u)) {
1126
- var s = function(a, u, f) {
1127
- if (!i.__c.__H)
1112
+ 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))), n.appendChild(a);
1113
+ }), n.appendChild(t.createTextNode("\n")), t.appendChild(n), new XMLSerializer().serializeToString(t).replace(/></g, ">\n<");
1114
+ }
1115
+ }
1116
+ var oe, x, Oe, ct, _e = 0, Kt = [], Ce = [], lt = g.__b, ut = g.__r, ht = g.diffed, dt = g.__c, ft = g.unmount;
1117
+ function Ae(i, e) {
1118
+ g.__h && g.__h(x, i, _e || e), _e = 0;
1119
+ var t = x.__H || (x.__H = { __: [], __h: [] });
1120
+ return i >= t.__.length && t.__.push({ __V: Ce }), t.__[i];
1121
+ }
1122
+ function Qe(i) {
1123
+ return _e = 1, $i(ti, i);
1124
+ }
1125
+ function $i(i, e, t) {
1126
+ var n = Ae(oe++, 2);
1127
+ if (n.t = i, !n.__c && (n.__ = [t ? t(e) : ti(void 0, e), function(a) {
1128
+ var u = n.__N ? n.__N[0] : n.__[0], h = n.t(u, a);
1129
+ u !== h && (n.__N = [h, n.__[1]], n.__c.setState({}));
1130
+ }], n.__c = x, !x.u)) {
1131
+ var s = function(a, u, h) {
1132
+ if (!n.__c.__H)
1128
1133
  return !0;
1129
- var d = i.__c.__H.__.filter(function(_) {
1130
- return _.__c;
1134
+ var d = n.__c.__H.__.filter(function(p) {
1135
+ return p.__c;
1131
1136
  });
1132
- if (d.every(function(_) {
1133
- return !_.__N;
1137
+ if (d.every(function(p) {
1138
+ return !p.__N;
1134
1139
  }))
1135
- return !o || o.call(this, a, u, f);
1140
+ return !o || o.call(this, a, u, h);
1136
1141
  var c = !1;
1137
- return d.forEach(function(_) {
1138
- if (_.__N) {
1139
- var v = _.__[0];
1140
- _.__ = _.__N, _.__N = void 0, v !== _.__[0] && (c = !0);
1142
+ return d.forEach(function(p) {
1143
+ if (p.__N) {
1144
+ var m = p.__[0];
1145
+ p.__ = p.__N, p.__N = void 0, m !== p.__[0] && (c = !0);
1141
1146
  }
1142
- }), !(!c && i.__c.props === a) && (!o || o.call(this, a, u, f));
1147
+ }), !(!c && n.__c.props === a) && (!o || o.call(this, a, u, h));
1143
1148
  };
1144
- S.u = !0;
1145
- var o = S.shouldComponentUpdate, r = S.componentWillUpdate;
1146
- S.componentWillUpdate = function(a, u, f) {
1149
+ x.u = !0;
1150
+ var o = x.shouldComponentUpdate, r = x.componentWillUpdate;
1151
+ x.componentWillUpdate = function(a, u, h) {
1147
1152
  if (this.__e) {
1148
1153
  var d = o;
1149
- o = void 0, s(a, u, f), o = d;
1154
+ o = void 0, s(a, u, h), o = d;
1150
1155
  }
1151
- r && r.call(this, a, u, f);
1152
- }, S.shouldComponentUpdate = s;
1156
+ r && r.call(this, a, u, h);
1157
+ }, x.shouldComponentUpdate = s;
1153
1158
  }
1154
- return i.__N || i.__;
1159
+ return n.__N || n.__;
1155
1160
  }
1156
- function q(n, e) {
1157
- var t = Me(oe++, 3);
1158
- !m.__s && Xt(t.__H, e) && (t.__ = n, t.i = e, S.__H.__h.push(t));
1161
+ function R(i, e) {
1162
+ var t = Ae(oe++, 3);
1163
+ !g.__s && ei(t.__H, e) && (t.__ = i, t.i = e, x.__H.__h.push(t));
1159
1164
  }
1160
- function K(n) {
1161
- return pe = 5, j(function() {
1162
- return { current: n };
1165
+ function K(i) {
1166
+ return _e = 5, P(function() {
1167
+ return { current: i };
1163
1168
  }, []);
1164
1169
  }
1165
- function j(n, e) {
1166
- var t = Me(oe++, 7);
1167
- return Xt(t.__H, e) ? (t.__V = n(), t.i = e, t.__h = n, t.__V) : t.__;
1170
+ function P(i, e) {
1171
+ var t = Ae(oe++, 7);
1172
+ return ei(t.__H, e) ? (t.__V = i(), t.i = e, t.__h = i, t.__V) : t.__;
1168
1173
  }
1169
- function dt(n, e) {
1170
- return pe = 8, j(function() {
1171
- return n;
1174
+ function Be(i, e) {
1175
+ return _e = 8, P(function() {
1176
+ return i;
1172
1177
  }, e);
1173
1178
  }
1174
- function En(n) {
1175
- var e = S.context[n.__c], t = Me(oe++, 9);
1176
- return t.c = n, e ? (t.__ == null && (t.__ = !0, e.sub(S)), e.props.value) : n.__;
1179
+ function Qt(i) {
1180
+ var e = x.context[i.__c], t = Ae(oe++, 9);
1181
+ return t.c = i, e ? (t.__ == null && (t.__ = !0, e.sub(x)), e.props.value) : i.__;
1177
1182
  }
1178
- function $n() {
1179
- for (var n; n = Yt.shift(); )
1180
- if (n.__P && n.__H)
1183
+ function Mi() {
1184
+ for (var i; i = Kt.shift(); )
1185
+ if (i.__P && i.__H)
1181
1186
  try {
1182
- n.__H.__h.forEach(Ce), n.__H.__h.forEach(je), n.__H.__h = [];
1187
+ i.__H.__h.forEach(Te), i.__H.__h.forEach(Xe), i.__H.__h = [];
1183
1188
  } catch (e) {
1184
- n.__H.__h = [], m.__e(e, n.__v);
1189
+ i.__H.__h = [], g.__e(e, i.__v);
1185
1190
  }
1186
1191
  }
1187
- m.__b = function(n) {
1188
- S = null, rt && rt(n);
1189
- }, m.__r = function(n) {
1190
- at && at(n), oe = 0;
1191
- var e = (S = n.__c).__H;
1192
- e && (Le === S ? (e.__h = [], S.__h = [], e.__.forEach(function(t) {
1193
- t.__N && (t.__ = t.__N), t.__V = we, t.__N = t.i = void 0;
1194
- })) : (e.__h.forEach(Ce), e.__h.forEach(je), e.__h = [], oe = 0)), Le = S;
1195
- }, m.diffed = function(n) {
1196
- ct && ct(n);
1197
- var e = n.__c;
1198
- e && e.__H && (e.__H.__h.length && (Yt.push(e) !== 1 && ot === m.requestAnimationFrame || ((ot = m.requestAnimationFrame) || Nn)($n)), e.__H.__.forEach(function(t) {
1199
- t.i && (t.__H = t.i), t.__V !== we && (t.__ = t.__V), t.i = void 0, t.__V = we;
1200
- })), Le = S = null;
1201
- }, m.__c = function(n, e) {
1192
+ g.__b = function(i) {
1193
+ x = null, lt && lt(i);
1194
+ }, g.__r = function(i) {
1195
+ ut && ut(i), oe = 0;
1196
+ var e = (x = i.__c).__H;
1197
+ e && (Oe === x ? (e.__h = [], x.__h = [], e.__.forEach(function(t) {
1198
+ t.__N && (t.__ = t.__N), t.__V = Ce, t.__N = t.i = void 0;
1199
+ })) : (e.__h.forEach(Te), e.__h.forEach(Xe), e.__h = [], oe = 0)), Oe = x;
1200
+ }, g.diffed = function(i) {
1201
+ ht && ht(i);
1202
+ var e = i.__c;
1203
+ e && e.__H && (e.__H.__h.length && (Kt.push(e) !== 1 && ct === g.requestAnimationFrame || ((ct = g.requestAnimationFrame) || Ai)(Mi)), e.__H.__.forEach(function(t) {
1204
+ t.i && (t.__H = t.i), t.__V !== Ce && (t.__ = t.__V), t.i = void 0, t.__V = Ce;
1205
+ })), Oe = x = null;
1206
+ }, g.__c = function(i, e) {
1202
1207
  e.some(function(t) {
1203
1208
  try {
1204
- t.__h.forEach(Ce), t.__h = t.__h.filter(function(i) {
1205
- return !i.__ || je(i);
1209
+ t.__h.forEach(Te), t.__h = t.__h.filter(function(n) {
1210
+ return !n.__ || Xe(n);
1206
1211
  });
1207
- } catch (i) {
1212
+ } catch (n) {
1208
1213
  e.some(function(s) {
1209
1214
  s.__h && (s.__h = []);
1210
- }), e = [], m.__e(i, t.__v);
1215
+ }), e = [], g.__e(n, t.__v);
1211
1216
  }
1212
- }), lt && lt(n, e);
1213
- }, m.unmount = function(n) {
1214
- ut && ut(n);
1215
- var e, t = n.__c;
1216
- t && t.__H && (t.__H.__.forEach(function(i) {
1217
+ }), dt && dt(i, e);
1218
+ }, g.unmount = function(i) {
1219
+ ft && ft(i);
1220
+ var e, t = i.__c;
1221
+ t && t.__H && (t.__H.__.forEach(function(n) {
1217
1222
  try {
1218
- Ce(i);
1223
+ Te(n);
1219
1224
  } catch (s) {
1220
1225
  e = s;
1221
1226
  }
1222
- }), t.__H = void 0, e && m.__e(e, t.__v));
1227
+ }), t.__H = void 0, e && g.__e(e, t.__v));
1223
1228
  };
1224
- var ht = typeof requestAnimationFrame == "function";
1225
- function Nn(n) {
1229
+ var pt = typeof requestAnimationFrame == "function";
1230
+ function Ai(i) {
1226
1231
  var e, t = function() {
1227
- clearTimeout(i), ht && cancelAnimationFrame(e), setTimeout(n);
1228
- }, i = setTimeout(t, 100);
1229
- ht && (e = requestAnimationFrame(t));
1232
+ clearTimeout(n), pt && cancelAnimationFrame(e), setTimeout(i);
1233
+ }, n = setTimeout(t, 100);
1234
+ pt && (e = requestAnimationFrame(t));
1230
1235
  }
1231
- function Ce(n) {
1232
- var e = S, t = n.__c;
1233
- typeof t == "function" && (n.__c = void 0, t()), S = e;
1236
+ function Te(i) {
1237
+ var e = x, t = i.__c;
1238
+ typeof t == "function" && (i.__c = void 0, t()), x = e;
1234
1239
  }
1235
- function je(n) {
1236
- var e = S;
1237
- n.__c = n.__(), S = e;
1240
+ function Xe(i) {
1241
+ var e = x;
1242
+ i.__c = i.__(), x = e;
1238
1243
  }
1239
- function Xt(n, e) {
1240
- return !n || n.length !== e.length || e.some(function(t, i) {
1241
- return t !== n[i];
1244
+ function ei(i, e) {
1245
+ return !i || i.length !== e.length || e.some(function(t, n) {
1246
+ return t !== i[n];
1242
1247
  });
1243
1248
  }
1244
- function Zt(n, e) {
1245
- return typeof e == "function" ? e(n) : e;
1249
+ function ti(i, e) {
1250
+ return typeof e == "function" ? e(i) : e;
1246
1251
  }
1247
- function Ae() {
1252
+ function Ie() {
1248
1253
  throw new Error("Cycle detected");
1249
1254
  }
1250
- var kn = Symbol.for("preact-signals");
1251
- function Ke() {
1252
- if (ie > 1)
1253
- ie--;
1255
+ var Ii = Symbol.for("preact-signals");
1256
+ function et() {
1257
+ if (ne > 1)
1258
+ ne--;
1254
1259
  else {
1255
- for (var n, e = !1; de !== void 0; ) {
1260
+ for (var i, e = !1; de !== void 0; ) {
1256
1261
  var t = de;
1257
- for (de = void 0, Ye++; t !== void 0; ) {
1258
- var i = t.o;
1259
- if (t.o = void 0, t.f &= -3, !(8 & t.f) && Jt(t))
1262
+ for (de = void 0, Ze++; t !== void 0; ) {
1263
+ var n = t.o;
1264
+ if (t.o = void 0, t.f &= -3, !(8 & t.f) && ni(t))
1260
1265
  try {
1261
1266
  t.c();
1262
1267
  } catch (s) {
1263
- e || (n = s, e = !0);
1268
+ e || (i = s, e = !0);
1264
1269
  }
1265
- t = i;
1270
+ t = n;
1266
1271
  }
1267
1272
  }
1268
- if (Ye = 0, ie--, e)
1269
- throw n;
1273
+ if (Ze = 0, ne--, e)
1274
+ throw i;
1270
1275
  }
1271
1276
  }
1272
- var x = void 0, de = void 0, ie = 0, Ye = 0, Ee = 0;
1273
- function Gt(n) {
1274
- if (x !== void 0) {
1275
- var e = n.n;
1276
- if (e === void 0 || e.t !== x)
1277
- return e = { i: 0, S: n, p: x.s, n: void 0, t: x, e: void 0, x: void 0, r: e }, x.s !== void 0 && (x.s.n = e), x.s = e, n.n = e, 32 & x.f && n.S(e), e;
1277
+ var S = void 0, de = void 0, ne = 0, Ze = 0, Ee = 0;
1278
+ function ii(i) {
1279
+ if (S !== void 0) {
1280
+ var e = i.n;
1281
+ if (e === void 0 || e.t !== S)
1282
+ return e = { i: 0, S: i, p: S.s, n: void 0, t: S, e: void 0, x: void 0, r: e }, S.s !== void 0 && (S.s.n = e), S.s = e, i.n = e, 32 & S.f && i.S(e), e;
1278
1283
  if (e.i === -1)
1279
- return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = x.s, e.n = void 0, x.s.n = e, x.s = e), e;
1284
+ return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = S.s, e.n = void 0, S.s.n = e, S.s = e), e;
1280
1285
  }
1281
1286
  }
1282
- function A(n) {
1283
- this.v = n, this.i = 0, this.n = void 0, this.t = void 0;
1287
+ function A(i) {
1288
+ this.v = i, this.i = 0, this.n = void 0, this.t = void 0;
1284
1289
  }
1285
- A.prototype.brand = kn;
1290
+ A.prototype.brand = Ii;
1286
1291
  A.prototype.h = function() {
1287
1292
  return !0;
1288
1293
  };
1289
- A.prototype.S = function(n) {
1290
- this.t !== n && n.e === void 0 && (n.x = this.t, this.t !== void 0 && (this.t.e = n), this.t = n);
1294
+ A.prototype.S = function(i) {
1295
+ this.t !== i && i.e === void 0 && (i.x = this.t, this.t !== void 0 && (this.t.e = i), this.t = i);
1291
1296
  };
1292
- A.prototype.U = function(n) {
1297
+ A.prototype.U = function(i) {
1293
1298
  if (this.t !== void 0) {
1294
- var e = n.e, t = n.x;
1295
- 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);
1299
+ var e = i.e, t = i.x;
1300
+ e !== void 0 && (e.x = t, i.e = void 0), t !== void 0 && (t.e = e, i.x = void 0), i === this.t && (this.t = t);
1296
1301
  }
1297
1302
  };
1298
- A.prototype.subscribe = function(n) {
1303
+ A.prototype.subscribe = function(i) {
1299
1304
  var e = this;
1300
- return Ie(function() {
1301
- var t = e.value, i = 32 & this.f;
1305
+ return De(function() {
1306
+ var t = e.value, n = 32 & this.f;
1302
1307
  this.f &= -33;
1303
1308
  try {
1304
- n(t);
1309
+ i(t);
1305
1310
  } finally {
1306
- this.f |= i;
1311
+ this.f |= n;
1307
1312
  }
1308
1313
  });
1309
1314
  };
@@ -1320,155 +1325,155 @@ A.prototype.peek = function() {
1320
1325
  return this.v;
1321
1326
  };
1322
1327
  Object.defineProperty(A.prototype, "value", { get: function() {
1323
- var n = Gt(this);
1324
- return n !== void 0 && (n.i = this.i), this.v;
1325
- }, set: function(n) {
1326
- if (x instanceof Y && function() {
1328
+ var i = ii(this);
1329
+ return i !== void 0 && (i.i = this.i), this.v;
1330
+ }, set: function(i) {
1331
+ if (S instanceof X && function() {
1327
1332
  throw new Error("Computed cannot have side-effects");
1328
- }(), n !== this.v) {
1329
- Ye > 100 && Ae(), this.v = n, this.i++, Ee++, ie++;
1333
+ }(), i !== this.v) {
1334
+ Ze > 100 && Ie(), this.v = i, this.i++, Ee++, ne++;
1330
1335
  try {
1331
1336
  for (var e = this.t; e !== void 0; e = e.x)
1332
1337
  e.t.N();
1333
1338
  } finally {
1334
- Ke();
1339
+ et();
1335
1340
  }
1336
1341
  }
1337
1342
  } });
1338
- function J(n) {
1339
- return new A(n);
1343
+ function j(i) {
1344
+ return new A(i);
1340
1345
  }
1341
- function Jt(n) {
1342
- for (var e = n.s; e !== void 0; e = e.n)
1346
+ function ni(i) {
1347
+ for (var e = i.s; e !== void 0; e = e.n)
1343
1348
  if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i)
1344
1349
  return !0;
1345
1350
  return !1;
1346
1351
  }
1347
- function Kt(n) {
1348
- for (var e = n.s; e !== void 0; e = e.n) {
1352
+ function si(i) {
1353
+ for (var e = i.s; e !== void 0; e = e.n) {
1349
1354
  var t = e.S.n;
1350
1355
  if (t !== void 0 && (e.r = t), e.S.n = e, e.i = -1, e.n === void 0) {
1351
- n.s = e;
1356
+ i.s = e;
1352
1357
  break;
1353
1358
  }
1354
1359
  }
1355
1360
  }
1356
- function Qt(n) {
1357
- for (var e = n.s, t = void 0; e !== void 0; ) {
1358
- var i = e.p;
1359
- 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;
1361
+ function oi(i) {
1362
+ for (var e = i.s, t = void 0; e !== void 0; ) {
1363
+ var n = e.p;
1364
+ e.i === -1 ? (e.S.U(e), n !== void 0 && (n.n = e.n), e.n !== void 0 && (e.n.p = n)) : t = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = n;
1360
1365
  }
1361
- n.s = t;
1366
+ i.s = t;
1362
1367
  }
1363
- function Y(n) {
1364
- A.call(this, void 0), this.x = n, this.s = void 0, this.g = Ee - 1, this.f = 4;
1368
+ function X(i) {
1369
+ A.call(this, void 0), this.x = i, this.s = void 0, this.g = Ee - 1, this.f = 4;
1365
1370
  }
1366
- (Y.prototype = new A()).h = function() {
1371
+ (X.prototype = new A()).h = function() {
1367
1372
  if (this.f &= -3, 1 & this.f)
1368
1373
  return !1;
1369
1374
  if ((36 & this.f) == 32 || (this.f &= -5, this.g === Ee))
1370
1375
  return !0;
1371
- if (this.g = Ee, this.f |= 1, this.i > 0 && !Jt(this))
1376
+ if (this.g = Ee, this.f |= 1, this.i > 0 && !ni(this))
1372
1377
  return this.f &= -2, !0;
1373
- var n = x;
1378
+ var i = S;
1374
1379
  try {
1375
- Kt(this), x = this;
1380
+ si(this), S = this;
1376
1381
  var e = this.x();
1377
1382
  (16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
1378
1383
  } catch (t) {
1379
1384
  this.v = t, this.f |= 16, this.i++;
1380
1385
  }
1381
- return x = n, Qt(this), this.f &= -2, !0;
1386
+ return S = i, oi(this), this.f &= -2, !0;
1382
1387
  };
1383
- Y.prototype.S = function(n) {
1388
+ X.prototype.S = function(i) {
1384
1389
  if (this.t === void 0) {
1385
1390
  this.f |= 36;
1386
1391
  for (var e = this.s; e !== void 0; e = e.n)
1387
1392
  e.S.S(e);
1388
1393
  }
1389
- A.prototype.S.call(this, n);
1394
+ A.prototype.S.call(this, i);
1390
1395
  };
1391
- Y.prototype.U = function(n) {
1392
- if (this.t !== void 0 && (A.prototype.U.call(this, n), this.t === void 0)) {
1396
+ X.prototype.U = function(i) {
1397
+ if (this.t !== void 0 && (A.prototype.U.call(this, i), this.t === void 0)) {
1393
1398
  this.f &= -33;
1394
1399
  for (var e = this.s; e !== void 0; e = e.n)
1395
1400
  e.S.U(e);
1396
1401
  }
1397
1402
  };
1398
- Y.prototype.N = function() {
1403
+ X.prototype.N = function() {
1399
1404
  if (!(2 & this.f)) {
1400
1405
  this.f |= 6;
1401
- for (var n = this.t; n !== void 0; n = n.x)
1402
- n.t.N();
1406
+ for (var i = this.t; i !== void 0; i = i.x)
1407
+ i.t.N();
1403
1408
  }
1404
1409
  };
1405
- Y.prototype.peek = function() {
1406
- if (this.h() || Ae(), 16 & this.f)
1410
+ X.prototype.peek = function() {
1411
+ if (this.h() || Ie(), 16 & this.f)
1407
1412
  throw this.v;
1408
1413
  return this.v;
1409
1414
  };
1410
- Object.defineProperty(Y.prototype, "value", { get: function() {
1411
- 1 & this.f && Ae();
1412
- var n = Gt(this);
1413
- if (this.h(), n !== void 0 && (n.i = this.i), 16 & this.f)
1415
+ Object.defineProperty(X.prototype, "value", { get: function() {
1416
+ 1 & this.f && Ie();
1417
+ var i = ii(this);
1418
+ if (this.h(), i !== void 0 && (i.i = this.i), 16 & this.f)
1414
1419
  throw this.v;
1415
1420
  return this.v;
1416
1421
  } });
1417
- function en(n) {
1418
- return new Y(n);
1419
- }
1420
- function tn(n) {
1421
- var e = n.u;
1422
- if (n.u = void 0, typeof e == "function") {
1423
- ie++;
1424
- var t = x;
1425
- x = void 0;
1422
+ function ri(i) {
1423
+ return new X(i);
1424
+ }
1425
+ function ai(i) {
1426
+ var e = i.u;
1427
+ if (i.u = void 0, typeof e == "function") {
1428
+ ne++;
1429
+ var t = S;
1430
+ S = void 0;
1426
1431
  try {
1427
1432
  e();
1428
- } catch (i) {
1429
- throw n.f &= -2, n.f |= 8, Qe(n), i;
1433
+ } catch (n) {
1434
+ throw i.f &= -2, i.f |= 8, tt(i), n;
1430
1435
  } finally {
1431
- x = t, Ke();
1436
+ S = t, et();
1432
1437
  }
1433
1438
  }
1434
1439
  }
1435
- function Qe(n) {
1436
- for (var e = n.s; e !== void 0; e = e.n)
1440
+ function tt(i) {
1441
+ for (var e = i.s; e !== void 0; e = e.n)
1437
1442
  e.S.U(e);
1438
- n.x = void 0, n.s = void 0, tn(n);
1443
+ i.x = void 0, i.s = void 0, ai(i);
1439
1444
  }
1440
- function Mn(n) {
1441
- if (x !== this)
1445
+ function Di(i) {
1446
+ if (S !== this)
1442
1447
  throw new Error("Out-of-order effect");
1443
- Qt(this), x = n, this.f &= -2, 8 & this.f && Qe(this), Ke();
1448
+ oi(this), S = i, this.f &= -2, 8 & this.f && tt(this), et();
1444
1449
  }
1445
- function _e(n) {
1446
- this.x = n, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32;
1450
+ function ve(i) {
1451
+ this.x = i, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32;
1447
1452
  }
1448
- _e.prototype.c = function() {
1449
- var n = this.S();
1453
+ ve.prototype.c = function() {
1454
+ var i = this.S();
1450
1455
  try {
1451
1456
  if (8 & this.f || this.x === void 0)
1452
1457
  return;
1453
1458
  var e = this.x();
1454
1459
  typeof e == "function" && (this.u = e);
1455
1460
  } finally {
1456
- n();
1461
+ i();
1457
1462
  }
1458
1463
  };
1459
- _e.prototype.S = function() {
1460
- 1 & this.f && Ae(), this.f |= 1, this.f &= -9, tn(this), Kt(this), ie++;
1461
- var n = x;
1462
- return x = this, Mn.bind(this, n);
1464
+ ve.prototype.S = function() {
1465
+ 1 & this.f && Ie(), this.f |= 1, this.f &= -9, ai(this), si(this), ne++;
1466
+ var i = S;
1467
+ return S = this, Di.bind(this, i);
1463
1468
  };
1464
- _e.prototype.N = function() {
1469
+ ve.prototype.N = function() {
1465
1470
  2 & this.f || (this.f |= 2, this.o = de, de = this);
1466
1471
  };
1467
- _e.prototype.d = function() {
1468
- this.f |= 8, 1 & this.f || Qe(this);
1472
+ ve.prototype.d = function() {
1473
+ this.f |= 8, 1 & this.f || tt(this);
1469
1474
  };
1470
- function Ie(n) {
1471
- var e = new _e(n);
1475
+ function De(i) {
1476
+ var e = new ve(i);
1472
1477
  try {
1473
1478
  e.c();
1474
1479
  } catch (t) {
@@ -1476,18 +1481,18 @@ function Ie(n) {
1476
1481
  }
1477
1482
  return e.d.bind(e);
1478
1483
  }
1479
- var De, Oe;
1480
- function re(n, e) {
1481
- m[n] = e.bind(null, m[n] || function() {
1484
+ var ze, Re;
1485
+ function re(i, e) {
1486
+ g[i] = e.bind(null, g[i] || function() {
1482
1487
  });
1483
1488
  }
1484
- function $e(n) {
1485
- Oe && Oe(), Oe = n && n.S();
1489
+ function Ne(i) {
1490
+ Re && Re(), Re = i && i.S();
1486
1491
  }
1487
- function nn(n) {
1488
- var e = this, t = n.data, i = W(t);
1489
- i.value = t;
1490
- var s = j(function() {
1492
+ function ci(i) {
1493
+ var e = this, t = i.data, n = B(t);
1494
+ n.value = t;
1495
+ var s = P(function() {
1491
1496
  for (var o = e.__v; o = o.__; )
1492
1497
  if (o.__c) {
1493
1498
  o.__c.__$f |= 4;
@@ -1495,84 +1500,84 @@ function nn(n) {
1495
1500
  }
1496
1501
  return e.__$u.c = function() {
1497
1502
  var r;
1498
- !zt(s.peek()) && ((r = e.base) == null ? void 0 : r.nodeType) === 3 ? e.base.data = s.peek() : (e.__$f |= 1, e.setState({}));
1499
- }, en(function() {
1500
- var r = i.value.value;
1503
+ !Rt(s.peek()) && ((r = e.base) == null ? void 0 : r.nodeType) === 3 ? e.base.data = s.peek() : (e.__$f |= 1, e.setState({}));
1504
+ }, ri(function() {
1505
+ var r = n.value.value;
1501
1506
  return r === 0 ? 0 : r === !0 ? "" : r || "";
1502
1507
  });
1503
1508
  }, []);
1504
1509
  return s.value;
1505
1510
  }
1506
- nn.displayName = "_st";
1507
- Object.defineProperties(A.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: nn }, props: { configurable: !0, get: function() {
1511
+ ci.displayName = "_st";
1512
+ Object.defineProperties(A.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: ci }, props: { configurable: !0, get: function() {
1508
1513
  return { data: this };
1509
1514
  } }, __b: { configurable: !0, value: 1 } });
1510
- re("__b", function(n, e) {
1515
+ re("__b", function(i, e) {
1511
1516
  if (typeof e.type == "string") {
1512
- var t, i = e.props;
1513
- for (var s in i)
1517
+ var t, n = e.props;
1518
+ for (var s in n)
1514
1519
  if (s !== "children") {
1515
- var o = i[s];
1516
- o instanceof A && (t || (e.__np = t = {}), t[s] = o, i[s] = o.peek());
1520
+ var o = n[s];
1521
+ o instanceof A && (t || (e.__np = t = {}), t[s] = o, n[s] = o.peek());
1517
1522
  }
1518
1523
  }
1519
- n(e);
1524
+ i(e);
1520
1525
  });
1521
- re("__r", function(n, e) {
1522
- $e();
1523
- var t, i = e.__c;
1524
- i && (i.__$f &= -2, (t = i.__$u) === void 0 && (i.__$u = t = function(s) {
1526
+ re("__r", function(i, e) {
1527
+ Ne();
1528
+ var t, n = e.__c;
1529
+ n && (n.__$f &= -2, (t = n.__$u) === void 0 && (n.__$u = t = function(s) {
1525
1530
  var o;
1526
- return Ie(function() {
1531
+ return De(function() {
1527
1532
  o = this;
1528
1533
  }), o.c = function() {
1529
- i.__$f |= 1, i.setState({});
1534
+ n.__$f |= 1, n.setState({});
1530
1535
  }, o;
1531
- }())), De = i, $e(t), n(e);
1536
+ }())), ze = n, Ne(t), i(e);
1532
1537
  });
1533
- re("__e", function(n, e, t, i) {
1534
- $e(), De = void 0, n(e, t, i);
1538
+ re("__e", function(i, e, t, n) {
1539
+ Ne(), ze = void 0, i(e, t, n);
1535
1540
  });
1536
- re("diffed", function(n, e) {
1537
- $e(), De = void 0;
1541
+ re("diffed", function(i, e) {
1542
+ Ne(), ze = void 0;
1538
1543
  var t;
1539
1544
  if (typeof e.type == "string" && (t = e.__e)) {
1540
- var i = e.__np, s = e.props;
1541
- if (i) {
1545
+ var n = e.__np, s = e.props;
1546
+ if (n) {
1542
1547
  var o = t.U;
1543
1548
  if (o)
1544
1549
  for (var r in o) {
1545
1550
  var a = o[r];
1546
- a !== void 0 && !(r in i) && (a.d(), o[r] = void 0);
1551
+ a !== void 0 && !(r in n) && (a.d(), o[r] = void 0);
1547
1552
  }
1548
1553
  else
1549
1554
  t.U = o = {};
1550
- for (var u in i) {
1551
- var f = o[u], d = i[u];
1552
- f === void 0 ? (f = An(t, u, d, s), o[u] = f) : f.o(d, s);
1555
+ for (var u in n) {
1556
+ var h = o[u], d = n[u];
1557
+ h === void 0 ? (h = zi(t, u, d, s), o[u] = h) : h.o(d, s);
1553
1558
  }
1554
1559
  }
1555
1560
  }
1556
- n(e);
1561
+ i(e);
1557
1562
  });
1558
- function An(n, e, t, i) {
1559
- var s = e in n && n.ownerSVGElement === void 0, o = J(t);
1563
+ function zi(i, e, t, n) {
1564
+ var s = e in i && i.ownerSVGElement === void 0, o = j(t);
1560
1565
  return { o: function(r, a) {
1561
- o.value = r, i = a;
1562
- }, d: Ie(function() {
1566
+ o.value = r, n = a;
1567
+ }, d: De(function() {
1563
1568
  var r = o.value.value;
1564
- i[e] !== r && (i[e] = r, s ? n[e] = r : r ? n.setAttribute(e, r) : n.removeAttribute(e));
1569
+ n[e] !== r && (n[e] = r, s ? i[e] = r : r ? i.setAttribute(e, r) : i.removeAttribute(e));
1565
1570
  }) };
1566
1571
  }
1567
- re("unmount", function(n, e) {
1572
+ re("unmount", function(i, e) {
1568
1573
  if (typeof e.type == "string") {
1569
1574
  var t = e.__e;
1570
1575
  if (t) {
1571
- var i = t.U;
1572
- if (i) {
1576
+ var n = t.U;
1577
+ if (n) {
1573
1578
  t.U = void 0;
1574
- for (var s in i) {
1575
- var o = i[s];
1579
+ for (var s in n) {
1580
+ var o = n[s];
1576
1581
  o && o.d();
1577
1582
  }
1578
1583
  }
@@ -1584,65 +1589,65 @@ re("unmount", function(n, e) {
1584
1589
  a && (r.__$u = void 0, a.d());
1585
1590
  }
1586
1591
  }
1587
- n(e);
1592
+ i(e);
1588
1593
  });
1589
- re("__h", function(n, e, t, i) {
1590
- (i < 3 || i === 9) && (e.__$f |= 2), n(e, t, i);
1594
+ re("__h", function(i, e, t, n) {
1595
+ (n < 3 || n === 9) && (e.__$f |= 2), i(e, t, n);
1591
1596
  });
1592
- H.prototype.shouldComponentUpdate = function(n, e) {
1597
+ H.prototype.shouldComponentUpdate = function(i, e) {
1593
1598
  var t = this.__$u;
1594
1599
  if (!(t && t.s !== void 0 || 4 & this.__$f) || 3 & this.__$f)
1595
1600
  return !0;
1596
- for (var i in e)
1601
+ for (var n in e)
1597
1602
  return !0;
1598
- for (var s in n)
1599
- if (s !== "__source" && n[s] !== this.props[s])
1603
+ for (var s in i)
1604
+ if (s !== "__source" && i[s] !== this.props[s])
1600
1605
  return !0;
1601
1606
  for (var o in this.props)
1602
- if (!(o in n))
1607
+ if (!(o in i))
1603
1608
  return !0;
1604
1609
  return !1;
1605
1610
  };
1606
- function W(n) {
1607
- return j(function() {
1608
- return J(n);
1611
+ function B(i) {
1612
+ return P(function() {
1613
+ return j(i);
1609
1614
  }, []);
1610
1615
  }
1611
- function O(n) {
1612
- var e = K(n);
1613
- return e.current = n, De.__$f |= 4, j(function() {
1614
- return en(function() {
1616
+ function O(i) {
1617
+ var e = K(i);
1618
+ return e.current = i, ze.__$f |= 4, P(function() {
1619
+ return ri(function() {
1615
1620
  return e.current();
1616
1621
  });
1617
1622
  }, []);
1618
1623
  }
1619
- function In(n) {
1620
- var e = K(n);
1621
- e.current = n, q(function() {
1622
- return Ie(function() {
1624
+ function Hi(i) {
1625
+ var e = K(i);
1626
+ e.current = i, R(function() {
1627
+ return De(function() {
1623
1628
  return e.current();
1624
1629
  });
1625
1630
  }, []);
1626
1631
  }
1627
- var Dn = 0;
1628
- function l(n, e, t, i, s, o) {
1632
+ var Li = 0;
1633
+ function l(i, e, t, n, s, o) {
1629
1634
  var r, a, u = {};
1630
1635
  for (a in e)
1631
1636
  a == "ref" ? r = e[a] : u[a] = e[a];
1632
- 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: --Dn, __source: s, __self: o };
1633
- if (typeof n == "function" && (r = n.defaultProps))
1637
+ var h = { type: i, props: u, key: t, ref: r, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --Li, __source: s, __self: o };
1638
+ if (typeof i == "function" && (r = i.defaultProps))
1634
1639
  for (a in r)
1635
1640
  u[a] === void 0 && (u[a] = r[a]);
1636
- return m.vnode && m.vnode(f), f;
1641
+ return g.vnode && g.vnode(h), h;
1637
1642
  }
1638
- const zn = () => l("svg", {
1643
+ const Oi = () => l("svg", {
1639
1644
  viewBox: "0 0 1024 1024",
1640
1645
  version: "1.1",
1641
1646
  xmlns: "http://www.w3.org/2000/svg",
1642
1647
  children: l("path", {
1643
1648
  d: "M843.904 783.573333 783.573333 843.904 512.042667 572.373333 240.512 843.904 180.181333 783.573333 451.712 512.042667 180.181333 240.512 240.512 180.181333 512.042667 451.712 783.573333 180.181333 843.904 240.512 572.373333 512.042667 843.904 783.573333Z"
1644
1649
  })
1645
- }), Hn = () => l("svg", {
1650
+ }), Bi = () => l("svg", {
1646
1651
  className: "icon",
1647
1652
  viewBox: "0 0 1024 1024",
1648
1653
  version: "1.1",
@@ -1650,56 +1655,58 @@ const zn = () => l("svg", {
1650
1655
  children: l("path", {
1651
1656
  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"
1652
1657
  })
1653
- }), Ln = () => l("svg", {
1658
+ }), Ri = (i) => l("svg", {
1654
1659
  viewBox: "0 0 1024 1024",
1660
+ id: "send",
1661
+ className: i.className,
1655
1662
  version: "1.1",
1656
1663
  xmlns: "http://www.w3.org/2000/svg",
1657
1664
  children: l("path", {
1658
1665
  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"
1659
1666
  })
1660
- }), On = () => l("svg", {
1667
+ }), Pi = () => l("svg", {
1661
1668
  viewBox: "0 0 1024 1024",
1662
1669
  version: "1.1",
1663
1670
  xmlns: "http://www.w3.org/2000/svg",
1664
1671
  children: l("path", {
1665
1672
  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"
1666
1673
  })
1667
- }), ft = () => l("svg", {
1674
+ }), _t = () => l("svg", {
1668
1675
  viewBox: "0 0 1024 1024",
1669
1676
  version: "1.1",
1670
1677
  xmlns: "http://www.w3.org/2000/svg",
1671
1678
  children: l("path", {
1672
1679
  d: "M511.582491 63.413262C265.134543 63.413262 64.62588 263.921925 64.62588 510.369873s200.508663 446.957635 446.957635 446.957635 446.957635-200.508663 446.957635-446.957635S758.031463 63.413262 511.582491 63.413262zM509.001713 751.859903c-98.517781 0-182.467775-62.623269-214.771505-150.056598l0.327458-0.134053c-2.007727-4.036943-3.38305-8.422833-3.38305-13.237489 0-16.647145 13.494339-30.142507 30.142507-30.142507 13.389962 0 24.358781 8.877181 28.2893 20.955264l0.422625-0.172939c23.269983 65.442478 85.645612 112.503307 158.972665 112.503307 93.106538 0 168.845523-75.738985 168.845523-168.845523s-75.738985-168.845523-168.845523-168.845523c-20.432355 0-39.874149 3.980661-58.013275 10.66899l21.248953 40.742936c2.486634 2.677992 4.0175 6.2831 4.0175 10.243295 0 8.417717-8.404414 14.921851-15.365966 15.07023-0.102331 0-0.206708 0-0.309038 0-0.220011 0-0.427742 0-0.647753-0.013303l-150.579507-6.463202c-5.372358-0.234337-10.229992-3.310396-12.716626-8.093329-2.486634-4.76963-2.236947-10.509355 0.647753-15.055904l80.890308-127.179564c2.8847-4.533246 8.006348-7.151887 13.365402-6.960529 5.372358 0.234337 10.227945 3.312442 12.71458 8.095375l18.580171 35.625382c26.629497-10.855232 55.683207-16.963347 86.168522-16.963347 126.338407 0 229.130537 102.791108 229.130537 229.130537S635.340119 751.859903 509.001713 751.859903z"
1673
1680
  })
1674
- }), Rn = () => l("svg", {
1681
+ }), Fi = () => l("svg", {
1675
1682
  viewBox: "0 0 1024 1024",
1676
1683
  version: "1.1",
1677
1684
  xmlns: "http://www.w3.org/2000/svg",
1678
1685
  children: l("path", {
1679
1686
  d: "M891.072 822.144V167.36a34.432 34.432 0 0 0-34.432-34.432H201.856C201.856 94.848 232.704 64 270.784 64h620.288C929.152 64 960 94.848 960 132.928v620.288c0 38.08-30.848 68.928-68.928 68.928z m-68.928-551.36v620.288c0 38.08-30.848 68.928-68.928 68.928H132.928A68.928 68.928 0 0 1 64 891.072V270.784c0-38.08 30.848-68.928 68.928-68.928h620.288c38.08 0 68.928 30.848 68.928 68.928z m-137.856 137.856H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z m0 206.72H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z"
1680
1687
  })
1681
- }), Pn = () => l("svg", {
1688
+ }), Ui = () => l("svg", {
1682
1689
  viewBox: "0 0 1024 1024",
1683
1690
  version: "1.1",
1684
1691
  xmlns: "http://www.w3.org/2000/svg",
1685
1692
  children: l("path", {
1686
1693
  d: "M547.4 197.4v46l200.3 0.1L546.1 444l32.4 32.6 201.9-200.7v200.9h46V197.5zM471.4 584.4l-32.6-32.6L243.6 747V547.9h-46v278.7h279v-46H275z"
1687
1694
  })
1688
- }), Bn = () => l("svg", {
1695
+ }), Wi = () => l("svg", {
1689
1696
  viewBox: "0 0 1024 1024",
1690
1697
  version: "1.1",
1691
1698
  xmlns: "http://www.w3.org/2000/svg",
1692
1699
  children: l("path", {
1693
1700
  d: "M544 480V282.944h52.224l0.064 107.968L763.072 224l36.928 36.928-166.976 166.976 108.032-0.128V480H544zM260.928 800l-36.928-36.928 166.912-166.784-107.968-0.064V544H480v197.056h-52.224l0.064-107.968L260.928 800z"
1694
1701
  })
1695
- }), Un = () => l("svg", {
1702
+ }), Vi = () => l("svg", {
1696
1703
  viewBox: "0 0 1024 1024",
1697
1704
  version: "1.1",
1698
1705
  xmlns: "http://www.w3.org/2000/svg",
1699
1706
  children: l("path", {
1700
1707
  d: "M960 544H64a32 32 0 1 1 0-64h896a32 32 0 1 1 0 64"
1701
1708
  })
1702
- }), Fn = () => l("svg", {
1709
+ }), qi = () => l("svg", {
1703
1710
  viewBox: "0 0 1024 1024",
1704
1711
  version: "1.1",
1705
1712
  xmlns: "http://www.w3.org/2000/svg",
@@ -1716,7 +1723,7 @@ const zn = () => l("svg", {
1716
1723
  }), l("path", {
1717
1724
  d: "M617.472 556.032a47.9232 38.912 90 1 0 77.824 0 47.9232 38.912 90 1 0-77.824 0Z"
1718
1725
  })]
1719
- }), Vn = () => l("svg", {
1726
+ }), ji = () => l("svg", {
1720
1727
  viewBox: "0 0 18 18",
1721
1728
  fill: "none",
1722
1729
  xmlns: "http://www.w3.org/2000/svg",
@@ -1730,7 +1737,7 @@ const zn = () => l("svg", {
1730
1737
  d: "M14.537 2.932c0-.396-.34-.717-.759-.717s-.758.32-.758.717v3.786c0 .396.34.717.758.717.42 0 .76-.321.76-.717V2.932z",
1731
1738
  fill: "currentColor"
1732
1739
  })]
1733
- }), qn = () => l("svg", {
1740
+ }), Yi = () => l("svg", {
1734
1741
  viewBox: "64 64 896 896",
1735
1742
  focusable: "false",
1736
1743
  width: "1em",
@@ -1740,7 +1747,7 @@ const zn = () => l("svg", {
1740
1747
  children: l("path", {
1741
1748
  d: "M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"
1742
1749
  })
1743
- }), Wn = () => l("svg", {
1750
+ }), Xi = () => l("svg", {
1744
1751
  fill: "currentColor",
1745
1752
  viewBox: "0 0 1000 1000",
1746
1753
  xmlns: "http://www.w3.org/2000/svg",
@@ -1748,7 +1755,7 @@ const zn = () => l("svg", {
1748
1755
  children: Array.from({
1749
1756
  length: 4
1750
1757
  }).map((a, u) => {
1751
- const d = u * (146.66666666666666 + 140), c = 1e3 / 2 - 250 / 2, _ = 1e3 / 2 - 500 / 2;
1758
+ const d = u * (146.66666666666666 + 140), c = 1e3 / 2 - 250 / 2, p = 1e3 / 2 - 500 / 2;
1752
1759
  return l("rect", {
1753
1760
  fill: "currentColor",
1754
1761
  rx: 70,
@@ -1766,7 +1773,7 @@ const zn = () => l("svg", {
1766
1773
  repeatCount: "indefinite"
1767
1774
  }), l("animate", {
1768
1775
  attributeName: "y",
1769
- values: "".concat(c, "; ").concat(_, "; ").concat(c),
1776
+ values: "".concat(c, "; ").concat(p, "; ").concat(c),
1770
1777
  keyTimes: "0; 0.5; 1",
1771
1778
  dur: "".concat(0.8, "s"),
1772
1779
  begin: "".concat(0.8 / 4 * u, "s"),
@@ -1774,26 +1781,26 @@ const zn = () => l("svg", {
1774
1781
  })]
1775
1782
  }, u);
1776
1783
  })
1777
- }), jn = (n) => l("svg", {
1778
- className: n.className,
1779
- onClick: n.onClick,
1784
+ }), Zi = (i) => l("svg", {
1785
+ className: i.className,
1786
+ onClick: i.onClick,
1780
1787
  viewBox: "0 0 1024 1024",
1781
1788
  version: "1.1",
1782
1789
  xmlns: "http://www.w3.org/2000/svg",
1783
1790
  children: l("path", {
1784
1791
  d: "M128 384a128 128 0 1 1 0 256 128 128 0 0 1 0-256z m768 0a128 128 0 1 1 0 256 128 128 0 0 1 0-256z m-372.4288 0a128 128 0 1 1 0 256 128 128 0 0 1 0-256z"
1785
1792
  })
1786
- }), Yn = (n) => l("svg", {
1787
- className: n.className,
1793
+ }), Gi = (i) => l("svg", {
1794
+ className: i.className,
1788
1795
  viewBox: "0 0 1024 1024",
1789
1796
  version: "1.1",
1790
1797
  xmlns: "http://www.w3.org/2000/svg",
1791
1798
  children: l("path", {
1792
1799
  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"
1793
1800
  })
1794
- }), Xn = (n) => l("svg", {
1801
+ }), Ji = (i) => l("svg", {
1795
1802
  xmlns: "http://www.w3.org/2000/svg",
1796
- className: n.className,
1803
+ className: i.className,
1797
1804
  viewBox: "0 0 512 512",
1798
1805
  children: l("path", {
1799
1806
  fill: "none",
@@ -1803,15 +1810,15 @@ const zn = () => l("svg", {
1803
1810
  strokeWidth: "48",
1804
1811
  d: "M112 184l144 144 144-144"
1805
1812
  })
1806
- }), pt = (n) => l("svg", {
1813
+ }), Pe = (i) => l("svg", {
1807
1814
  xmlns: "http://www.w3.org/2000/svg",
1808
- className: "".concat(n.className, " icon"),
1815
+ className: "".concat(i.className, " icon"),
1809
1816
  viewBox: "0 0 512 512",
1810
1817
  children: l("path", {
1811
1818
  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"
1812
1819
  })
1813
- }), Re = (n) => l("svg", {
1814
- className: n.className,
1820
+ }), Fe = (i) => l("svg", {
1821
+ className: i.className,
1815
1822
  width: "16",
1816
1823
  height: "16",
1817
1824
  viewBox: "0 0 50 50",
@@ -1834,7 +1841,7 @@ const zn = () => l("svg", {
1834
1841
  repeatCount: "indefinite"
1835
1842
  })
1836
1843
  })
1837
- }), Zn = () => l("svg", {
1844
+ }), Ki = () => l("svg", {
1838
1845
  className: "icon",
1839
1846
  viewBox: "0 0 1024 1024",
1840
1847
  version: "1.1",
@@ -1844,7 +1851,7 @@ const zn = () => l("svg", {
1844
1851
  children: l("path", {
1845
1852
  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"
1846
1853
  })
1847
- }), sn = () => l("svg", {
1854
+ }), li = () => l("svg", {
1848
1855
  className: "icon",
1849
1856
  viewBox: "0 0 1024 1024",
1850
1857
  version: "1.1",
@@ -1858,7 +1865,7 @@ const zn = () => l("svg", {
1858
1865
  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",
1859
1866
  fill: "currentColor"
1860
1867
  })]
1861
- }), Gn = () => l("svg", {
1868
+ }), Qi = () => l("svg", {
1862
1869
  className: "icon",
1863
1870
  viewBox: "0 0 1024 1024",
1864
1871
  version: "1.1",
@@ -1869,7 +1876,7 @@ const zn = () => l("svg", {
1869
1876
  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",
1870
1877
  fill: "currentColor"
1871
1878
  })
1872
- }), Jn = () => l("svg", {
1879
+ }), en = () => l("svg", {
1873
1880
  className: "icon",
1874
1881
  viewBox: "0 0 1024 1024",
1875
1882
  version: "1.1",
@@ -1879,12 +1886,39 @@ const zn = () => l("svg", {
1879
1886
  children: l("path", {
1880
1887
  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"
1881
1888
  })
1889
+ }), tn = (i) => l("svg", {
1890
+ className: i.className,
1891
+ id: "stop",
1892
+ viewBox: "0 0 1025 1024",
1893
+ version: "1.1",
1894
+ xmlns: "http://www.w3.org/2000/svg",
1895
+ width: "18",
1896
+ height: "18",
1897
+ children: [l("path", {
1898
+ d: "M512.268258 1022.835842c-68.658678 0-135.399619-13.564433-198.369591-40.316509-60.752236-25.809077-115.373446-62.712976-162.346233-109.685763-46.971763-46.971763-83.875662-101.592974-109.685763-162.346233C15.115619 647.517366 1.551186 580.777449 1.551186 512.118771S15.115619 376.719151 41.866671 313.74918c25.810101-60.752236 62.714-115.373446 109.685763-162.346233 46.972787-46.971763 101.593997-83.875662 162.346233-109.685763 62.969971-26.751052 129.710912-40.315485 198.369591-40.315485s135.398595 13.564433 198.368567 40.315485c60.752236 25.810101 115.373446 62.714 162.346233 109.685763 46.971763 46.972787 83.875662 101.593997 109.685763 162.346233 26.752076 62.969971 40.316509 129.710912 40.316509 198.369591s-13.564433 135.398595-40.316509 198.368567c-25.809077 60.75326-62.712976 115.37447-109.685763 162.346233-46.971763 46.972787-101.592974 83.876686-162.346233 109.685763C647.666853 1009.27141 580.925912 1022.835842 512.268258 1022.835842zM512.268258 50.548195c-62.018782 0-122.293887 12.247716-179.152287 36.403219-54.923257 23.333323-104.317532 56.709936-146.810821 99.204249s-75.870926 91.888588-99.204249 146.810821c-24.155503 56.8584-36.403219 117.133505-36.403219 179.152287 0 62.017758 12.247716 122.292863 36.403219 179.152287 23.333323 54.923257 56.709936 104.317532 99.204249 146.811845 42.493289 42.493289 91.888588 75.870926 146.810821 99.204249 56.8584 24.155503 117.133505 36.403219 179.152287 36.403219 62.017758 0 122.292863-12.247716 179.152287-36.403219 54.923257-23.333323 104.317532-56.71096 146.811845-99.204249 42.493289-42.494313 75.870926-91.888588 99.204249-146.811845 24.155503-56.8584 36.403219-117.133505 36.403219-179.152287s-12.247716-122.293887-36.403219-179.152287c-23.334347-54.923257-56.71096-104.317532-99.205273-146.810821-42.493289-42.493289-91.887565-75.870926-146.810821-99.204249C634.561121 62.795911 574.286016 50.548195 512.268258 50.548195z",
1899
+ fill: "currentColor"
1900
+ }), l("path", {
1901
+ 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",
1902
+ fill: "currentColor"
1903
+ })]
1904
+ }), nn = (i) => l("svg", {
1905
+ xmlns: "http://www.w3.org/2000/svg",
1906
+ className: i.className,
1907
+ viewBox: "0 0 512 512",
1908
+ children: l("path", {
1909
+ fill: "none",
1910
+ stroke: "currentColor",
1911
+ strokeLinecap: "round",
1912
+ strokeLinejoin: "round",
1913
+ strokeWidth: "48",
1914
+ d: "M112 268l144 144 144-144M256 392V100"
1915
+ })
1882
1916
  });
1883
- const Kn = (n) => {
1917
+ const sn = (i) => {
1884
1918
  const {
1885
1919
  items: e
1886
- } = n, t = W([]), i = new M("chat-thought-chain"), s = W([]);
1887
- q(() => {
1920
+ } = i, t = B([]), n = new $("chat-thought-chain"), s = B([]);
1921
+ R(() => {
1888
1922
  s.value = e.filter((r) => r.description), s.value.length > 0 && s.value.forEach((r, a) => {
1889
1923
  r.done && (t.value = [...t.value, a]);
1890
1924
  });
@@ -1893,113 +1927,113 @@ const Kn = (n) => {
1893
1927
  t.value.includes(r) ? t.value = t.value.filter((a) => a !== r) : t.value = [...t.value, r];
1894
1928
  };
1895
1929
  return s.value.length === 0 ? null : l("div", {
1896
- className: "".concat(i.b(), " ").concat(i.is("single", s.value.length === 1)),
1930
+ className: "".concat(n.b(), " ").concat(n.is("single", s.value.length === 1)),
1897
1931
  children: s.value.map((r, a) => {
1898
1932
  if (!r.description)
1899
1933
  return;
1900
1934
  const u = t.value.includes(a);
1901
1935
  return l("div", {
1902
- className: "".concat(i.e("item"), " ").concat(i.is("collapsed", u)),
1936
+ className: "".concat(n.e("item"), " ").concat(n.is("collapsed", u)),
1903
1937
  children: [l("div", {
1904
- className: i.e("item-icon"),
1938
+ className: n.e("item-icon"),
1905
1939
  children: r.icon || l("span", {
1906
1940
  children: a
1907
1941
  })
1908
1942
  }), l("div", {
1909
- className: i.e("item-content"),
1943
+ className: n.e("item-content"),
1910
1944
  children: [l("div", {
1911
- className: i.e("item-title"),
1945
+ className: n.e("item-title"),
1912
1946
  onClick: () => o(a),
1913
- children: [r.title, l(Xn, {
1914
- className: i.e("icon")
1947
+ children: [r.title, l(Ji, {
1948
+ className: n.e("icon")
1915
1949
  })]
1916
1950
  }), l("div", {
1917
- className: i.e("item-description"),
1951
+ className: n.e("item-description"),
1918
1952
  children: r.description
1919
1953
  })]
1920
1954
  })]
1921
1955
  }, a);
1922
1956
  })
1923
1957
  });
1924
- }, Z = new M("markdown-message"), Qn = (n) => {
1958
+ }, G = new $("markdown-message"), on = (i) => {
1925
1959
  const {
1926
1960
  message: e,
1927
1961
  size: t
1928
- } = n, i = W(qt()), s = W(null), o = j(() => e.state === 20 && e.completed !== !0, [e.state, e.completed]), r = j(() => e.state === 20 && e.completed === !0, [e.state, e.completed]), a = W({
1929
- title: "思考过程",
1962
+ } = i, n = B(Zt()), s = B(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 = B({
1963
+ title: "",
1930
1964
  description: "",
1931
- icon: l(Re, {})
1932
- }), u = (f) => {
1933
- const d = f.indexOf("<think>"), c = f.indexOf("</think>");
1934
- let _ = "", v = "", h = !1;
1935
- return c === -1 ? (h = !1, _ = f.slice(d + 7), v = "") : (h = !0, _ = f.slice(d + 7, c), v = f.slice(c + 8)), {
1936
- isThoughtCompleted: h,
1937
- thoughtContent: _,
1938
- answerContent: v
1965
+ icon: l(Fe, {})
1966
+ }), u = (h) => {
1967
+ const d = h.indexOf("<think>"), c = h.indexOf("</think>");
1968
+ let p = "", m = "", f = !1;
1969
+ return c === -1 ? (f = !1, p = h.slice(d + 7), m = "") : (f = !0, p = h.slice(d + 7, c), m = h.slice(c + 8)), {
1970
+ isThoughtCompleted: f,
1971
+ thoughtContent: p,
1972
+ answerContent: m
1939
1973
  };
1940
1974
  };
1941
- return q(() => {
1975
+ return R(() => {
1942
1976
  if (t >= 0 && s.value)
1943
1977
  if (e.content.indexOf("<think>") !== -1) {
1944
1978
  const {
1945
- isThoughtCompleted: f,
1979
+ isThoughtCompleted: h,
1946
1980
  thoughtContent: d,
1947
1981
  answerContent: c
1948
1982
  } = u(e.content);
1949
- f && (a.value.icon = f ? l(pt, {}) : l(Re, {})), d && (a.value.description = d), c && s.value.setMarkdown(c);
1983
+ h ? (a.value.icon = l(Pe, {}), a.value.title = "思考完成") : e.completed === !0 ? (a.value.icon = l(Pe, {}), a.value.title = "思考已停止") : (a.value.icon = l(Fe, {}), a.value.title = "思考中..."), d && (a.value.description = d), c && s.value.setMarkdown(c);
1950
1984
  } else
1951
1985
  s.value.setMarkdown(e.content);
1952
- }, [e, t]), q(() => {
1953
- let f = "";
1986
+ }, [e, t]), R(() => {
1987
+ let h = "";
1954
1988
  if (e.content.indexOf("<think>") !== -1) {
1955
1989
  const {
1956
1990
  isThoughtCompleted: d,
1957
1991
  thoughtContent: c,
1958
- answerContent: _
1992
+ answerContent: p
1959
1993
  } = u(e.content);
1960
1994
  a.value = {
1961
- title: "思考过程",
1995
+ title: d ? "思考完成" : e.completed === !0 ? "思考已停止" : "思考中...",
1962
1996
  description: c || "",
1963
- icon: d ? l(pt, {}) : l(Re, {})
1964
- }, _ && (f = _);
1997
+ icon: d || e.completed === !0 ? l(Pe, {}) : l(Fe, {})
1998
+ }, p && (h = p);
1965
1999
  } else
1966
- f = e.content;
1967
- s.value = new pn({
1968
- id: i,
1969
- value: f || "",
2000
+ h = e.content;
2001
+ s.value = new gi({
2002
+ id: n,
2003
+ value: h || "",
1970
2004
  editor: {
1971
2005
  defaultModel: "previewOnly"
1972
2006
  }
1973
2007
  });
1974
2008
  }, []), l("div", {
1975
- className: "".concat(Z.b(), " ").concat(Z.is("loading", o)),
2009
+ className: "".concat(G.b(), " ").concat(G.is("loading", o)),
1976
2010
  children: [l("div", {
1977
- className: Z.b("header"),
2011
+ className: G.b("header"),
1978
2012
  children: [l("div", {
1979
- className: Z.be("header", "caption"),
2013
+ className: G.be("header", "caption"),
1980
2014
  children: "AI "
1981
- }), n.children, r ? l("div", {
1982
- className: Z.be("header", "timeout"),
2015
+ }), i.children, r ? l("div", {
2016
+ className: G.be("header", "timeout"),
1983
2017
  children: "请求超时"
1984
2018
  }) : null]
1985
2019
  }), l("div", {
1986
- className: "".concat(Z.b("content"), " pre-wrap-container"),
1987
- children: [l(Kn, {
2020
+ className: "".concat(G.b("content"), " pre-wrap-container"),
2021
+ children: [l(sn, {
1988
2022
  items: [a.value]
1989
2023
  }), l("div", {
1990
- id: i
2024
+ id: n
1991
2025
  })]
1992
2026
  }), l("div", {
1993
- className: Z.b("footer")
2027
+ className: G.b("footer")
1994
2028
  })]
1995
2029
  });
1996
2030
  };
1997
- const ae = new M("ossfile-material"), ei = (n) => {
1998
- const e = O(() => n.material.data.name), t = O(() => n.material.metadata.size), i = O(() => {
1999
- const o = n.material.metadata.state;
2031
+ const ae = new $("ossfile-material"), rn = (i) => {
2032
+ const e = O(() => i.material.data.name), t = O(() => i.material.metadata.size), n = O(() => {
2033
+ const o = i.material.metadata.state;
2000
2034
  return o === "successed" ? "上传成功" : o === "uploading" ? "上传中" : o === "failed" ? "上传失败" : "未知状态";
2001
2035
  }), s = O(() => {
2002
- switch (n.material.metadata.state) {
2036
+ switch (i.material.metadata.state) {
2003
2037
  case "successed":
2004
2038
  return "#1890ff";
2005
2039
  case "uploading":
@@ -2014,7 +2048,7 @@ const ae = new M("ossfile-material"), ei = (n) => {
2014
2048
  className: ae.b(),
2015
2049
  children: [l("div", {
2016
2050
  className: ae.b("left"),
2017
- children: l(sn, {})
2051
+ children: l(li, {})
2018
2052
  }), l("div", {
2019
2053
  className: ae.b("right"),
2020
2054
  children: [l("div", {
@@ -2029,20 +2063,20 @@ const ae = new M("ossfile-material"), ei = (n) => {
2029
2063
  style: {
2030
2064
  color: s.value
2031
2065
  },
2032
- children: i
2066
+ children: n
2033
2067
  })]
2034
2068
  })]
2035
2069
  })]
2036
2070
  });
2037
2071
  };
2038
- const ce = new M("common-material"), ti = (n) => {
2039
- var i;
2040
- const e = (i = n.controller.opts.questionToolbarItems) == null ? void 0 : i.find((s) => s.id === n.material.metadata.actionId), t = O(() => n.material.metadata.name);
2072
+ const ce = new $("common-material"), an = (i) => {
2073
+ var n;
2074
+ const e = (n = i.controller.opts.questionToolbarItems) == null ? void 0 : n.find((s) => s.id === i.material.metadata.actionId), t = O(() => i.material.metadata.name);
2041
2075
  return l("div", {
2042
2076
  className: ce.b(),
2043
2077
  children: [l("div", {
2044
2078
  className: ce.b("left"),
2045
- children: e && e.icon ? typeof e.icon == "function" ? e.icon(I) : e.icon : l(Jn, {})
2079
+ children: e && e.icon ? typeof e.icon == "function" ? e.icon(I) : e.icon : l(en, {})
2046
2080
  }), l("div", {
2047
2081
  className: ce.b("right"),
2048
2082
  children: [l("div", {
@@ -2058,39 +2092,39 @@ const ce = new M("common-material"), ti = (n) => {
2058
2092
  })]
2059
2093
  });
2060
2094
  };
2061
- const Pe = new M("chat-input-material-item"), on = (n) => {
2095
+ const Ue = new $("chat-input-material-item"), ui = (i) => {
2062
2096
  const {
2063
2097
  material: e
2064
- } = n;
2098
+ } = i;
2065
2099
  let t = null;
2066
2100
  switch (e.type) {
2067
2101
  case "ossfile":
2068
- t = ei;
2102
+ t = rn;
2069
2103
  break;
2070
2104
  default:
2071
- t = ti;
2105
+ t = an;
2072
2106
  }
2073
- const i = () => {
2074
- n.controller.deleteMaterial(e);
2107
+ const n = () => {
2108
+ i.controller.deleteMaterial(e);
2075
2109
  };
2076
2110
  return l("div", {
2077
- className: "".concat(Pe.b(), " ").concat(Pe.is("disabled", n.disabled)),
2111
+ className: "".concat(Ue.b(), " ").concat(Ue.is("disabled", i.disabled)),
2078
2112
  children: [l("div", {
2079
- className: Pe.e("icon"),
2080
- onClick: i,
2081
- children: l(Gn, {})
2113
+ className: Ue.e("icon"),
2114
+ onClick: n,
2115
+ children: l(Qi, {})
2082
2116
  }), I(t, {
2083
2117
  material: e,
2084
- controller: n.controller
2118
+ controller: i.controller
2085
2119
  })]
2086
2120
  });
2087
- }, Q = new M("user-message-question"), ni = (n) => {
2088
- const e = O(() => n.message.content), t = O(() => jt.parseMixedContent(e.value));
2121
+ }, Q = new $("user-message-question"), cn = (i) => {
2122
+ const e = O(() => i.message.content), t = O(() => Jt.parseMixedContent(e.value));
2089
2123
  return l("div", {
2090
2124
  className: Q.b(),
2091
2125
  children: [l("div", {
2092
2126
  className: Q.e("user-header"),
2093
- children: [n.children, l("div", {
2127
+ children: [i.children, l("div", {
2094
2128
  className: Q.e("user"),
2095
2129
  children: "我"
2096
2130
  })]
@@ -2102,11 +2136,11 @@ const Pe = new M("chat-input-material-item"), on = (n) => {
2102
2136
  children: [l("p", {
2103
2137
  dir: "auto",
2104
2138
  className: Q.em("content", "material"),
2105
- children: t.value.hasResources && t.value.resources.map((i) => l(on, {
2106
- material: i,
2139
+ children: t.value.hasResources && t.value.resources.map((n) => l(ui, {
2140
+ material: n,
2107
2141
  disabled: !0,
2108
- controller: n.controller
2109
- }, i.id))
2142
+ controller: i.controller
2143
+ }, n.id))
2110
2144
  }), l("p", {
2111
2145
  dir: "auto",
2112
2146
  className: "pre-wrap-container",
@@ -2116,419 +2150,471 @@ const Pe = new M("chat-input-material-item"), on = (n) => {
2116
2150
  })]
2117
2151
  });
2118
2152
  };
2119
- const me = new M("error-message"), ii = (n) => {
2120
- const e = O(() => n.message.content);
2153
+ const ge = new $("error-message"), ln = (i) => {
2154
+ const e = O(() => i.message.content);
2121
2155
  return l("div", {
2122
- className: me.b(),
2156
+ className: ge.b(),
2123
2157
  children: [l("div", {
2124
- className: me.b("header"),
2158
+ className: ge.b("header"),
2125
2159
  children: [l("div", {
2126
- className: me.be("header", "caption"),
2160
+ className: ge.be("header", "caption"),
2127
2161
  children: "AI "
2128
- }), n.children]
2162
+ }), i.children]
2129
2163
  }), l("div", {
2130
- className: "".concat(me.e("content"), " pre-wrap-container"),
2164
+ className: "".concat(ge.e("content"), " pre-wrap-container"),
2131
2165
  children: l("span", {
2132
2166
  children: e
2133
2167
  })
2134
2168
  })]
2135
2169
  });
2136
2170
  };
2137
- const _t = new M("unknown-message"), si = (n) => l("div", {
2138
- className: _t.b(),
2171
+ const vt = new $("unknown-message"), un = (i) => l("div", {
2172
+ className: vt.b(),
2139
2173
  children: l("span", {
2140
- className: "".concat(_t.e("content"), " pre-wrap-container"),
2141
- children: ["暂未支持的消息类型: ", n.message.type]
2174
+ className: "".concat(vt.e("content"), " pre-wrap-container"),
2175
+ children: ["暂未支持的消息类型: ", i.message.type]
2142
2176
  })
2143
2177
  });
2144
- const oi = new M("chat-message-item"), ri = (n) => {
2178
+ const hn = new $("chat-message-item"), dn = (i) => {
2145
2179
  const {
2146
2180
  message: e,
2147
2181
  size: t
2148
- } = n;
2149
- let i = null;
2182
+ } = i;
2183
+ let n = null;
2150
2184
  switch (e.type) {
2151
2185
  case "DEFAULT":
2152
- i = e.role === "ASSISTANT" ? Qn : ni;
2186
+ n = e.role === "ASSISTANT" ? on : cn;
2153
2187
  break;
2154
2188
  case "ERROR":
2155
- i = ii;
2189
+ n = ln;
2156
2190
  break;
2157
2191
  default:
2158
- i = si;
2192
+ n = un;
2159
2193
  }
2160
2194
  return l("div", {
2161
- className: oi.b(),
2162
- children: I(i, {
2195
+ className: hn.b(),
2196
+ children: I(n, {
2163
2197
  size: t,
2164
2198
  message: e,
2165
- controller: n.controller,
2166
- children: n.children
2199
+ controller: i.controller,
2200
+ children: i.children
2167
2201
  })
2168
2202
  });
2169
2203
  };
2170
- const ee = new M("chat-toolbar"), Xe = (n) => {
2204
+ const ee = new $("chat-toolbar"), Ge = (i) => {
2171
2205
  const {
2172
2206
  controller: e,
2173
2207
  items: t = [],
2174
- data: i,
2208
+ data: n,
2175
2209
  type: s,
2176
2210
  className: o
2177
- } = n;
2211
+ } = i;
2178
2212
  let r = [], a = "default";
2179
2213
  const u = [{
2180
2214
  label: "新建对话",
2181
2215
  title: "新建对话",
2182
- icon: l(Vn, {}),
2216
+ icon: l(ji, {}),
2183
2217
  onClick: () => {
2184
2218
  e.newDialogue();
2185
2219
  }
2186
- }], f = [{
2187
- label: "回填",
2188
- title: "回填",
2189
- icon: l(Hn, {}),
2190
- onClick: () => {
2191
- e.backfill(i);
2192
- }
2193
- }, {
2220
+ }], h = [{
2194
2221
  label: "刷新",
2195
2222
  title: "刷新",
2196
- icon: l(ft, {}),
2223
+ icon: l(_t, {}),
2197
2224
  onClick: () => {
2198
- e.refreshMessage(i);
2225
+ e.refreshMessage(n);
2199
2226
  }
2200
2227
  }, {
2201
2228
  label: "删除",
2202
2229
  title: "删除",
2203
- icon: l(On, {}),
2230
+ icon: l(Pi, {}),
2204
2231
  onClick: () => {
2205
- e.deleteMessage(i);
2232
+ e.deleteMessage(n);
2206
2233
  }
2207
2234
  }, {
2208
2235
  label: "复制",
2209
2236
  title: "复制",
2210
- icon: l(Rn, {}),
2237
+ icon: l(Fi, {}),
2211
2238
  onClick: () => {
2212
- e.copyMessage(i);
2239
+ e.copyMessage(n);
2213
2240
  }
2214
- }], d = [{
2241
+ }];
2242
+ Qt(it).enableBackFill && h.unshift({
2243
+ label: "回填",
2244
+ title: "回填",
2245
+ icon: l(Bi, {}),
2246
+ onClick: () => {
2247
+ e.backfill(n);
2248
+ }
2249
+ });
2250
+ const c = [{
2215
2251
  label: "刷新",
2216
2252
  title: "刷新",
2217
- icon: l(ft, {}),
2253
+ icon: l(_t, {}),
2218
2254
  onClick: () => {
2219
- e.refreshMessage(i, !0);
2255
+ e.refreshMessage(n, !0);
2220
2256
  }
2221
2257
  }];
2222
2258
  if (s === "content")
2223
- switch (a = "circle", i.type) {
2259
+ switch (a = "circle", n.type) {
2224
2260
  case "DEFAULT":
2225
- i.role === "ASSISTANT" ? r = [...f, ...t] : r = [...d];
2261
+ n.role === "ASSISTANT" ? r = [...h, ...t] : r = [...c];
2226
2262
  break;
2227
2263
  case "ERROR":
2228
- r = [...f, ...t];
2264
+ r = [...h, ...t];
2229
2265
  break;
2230
2266
  }
2231
2267
  else
2232
2268
  r = [...u, ...t];
2233
- const c = (p) => typeof p.hidden == "function" ? p.hidden(i) : p.hidden === !0, _ = (p) => typeof p.disabled == "function" ? p.disabled(i) : p.disabled === !0, v = (p, y) => {
2234
- var b;
2235
- _(y) || (b = y.onClick) == null || b.call(y, p, e.context, e.params, i);
2236
- }, h = j(() => 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]);
2269
+ const p = (_) => typeof _.hidden == "function" ? _.hidden(n) : _.hidden === !0, m = (_) => typeof _.disabled == "function" ? _.disabled(n) : _.disabled === !0, f = (_, y) => {
2270
+ var E;
2271
+ if (m(y))
2272
+ return;
2273
+ const C = {
2274
+ ...n,
2275
+ topic: e.topic
2276
+ };
2277
+ C.msg.realcontent = n.realcontent, (E = y.onClick) == null || E.call(y, _, e.context, e.params, C);
2278
+ }, v = P(() => s === "content" && (n == null ? void 0 : n.state) === 20 && (n == null ? void 0 : n.completed) !== !0, [n == null ? void 0 : n.state, n == null ? void 0 : n.completed]);
2237
2279
  return l("div", {
2238
2280
  className: "".concat(ee.b(), " ").concat(ee.e(a), " ").concat(o || ""),
2239
- children: r.map((p, y) => {
2240
- if (!c(p))
2281
+ children: r.map((_, y) => {
2282
+ if (!p(_))
2241
2283
  return l("div", {
2242
- className: "".concat(ee.e("item"), " ").concat(ee.is("disabled", _(p) || h), " ").concat(o || ""),
2243
- title: p.title,
2244
- onClick: (b) => v(b, p),
2284
+ className: "".concat(ee.e("item"), " ").concat(ee.is("disabled", m(_) || v), " ").concat(o || ""),
2285
+ title: _.title,
2286
+ onClick: (C) => f(C, _),
2245
2287
  children: [l("div", {
2246
2288
  className: "".concat(ee.em("item", "icon")),
2247
- children: typeof p.icon == "function" ? p.icon(I) : p.icon
2289
+ children: typeof _.icon == "function" ? _.icon(I) : _.icon
2248
2290
  }), l("div", {
2249
2291
  className: "".concat(ee.em("item", "label")),
2250
- children: typeof p.label == "function" ? p.label(I) : p.label
2292
+ children: typeof _.label == "function" ? _.label(I) : _.label
2251
2293
  })]
2252
2294
  }, y);
2253
2295
  })
2254
2296
  });
2255
2297
  };
2256
- const ai = new M("chat-messages"), vt = (n) => {
2257
- const e = K(null), t = n.controller.messages;
2258
- return In(() => {
2298
+ function fn(i, e) {
2299
+ let t = null;
2300
+ return function(...n) {
2301
+ t || (t = setTimeout(() => {
2302
+ i.apply(this, n), t = null;
2303
+ }, e));
2304
+ };
2305
+ }
2306
+ const pn = (i) => {
2307
+ const e = B(!1), t = B({}), n = new $("chat-back-bottom"), s = B(null), o = () => {
2308
+ if (s.value) {
2309
+ const u = i.visibilityHeight || 200, h = s.value.scrollHeight - s.value.scrollTop - s.value.offsetHeight;
2310
+ e.value = h >= u;
2311
+ }
2312
+ }, r = () => {
2313
+ s.value && s.value.scrollTo({
2314
+ top: s.value.scrollHeight,
2315
+ behavior: "smooth"
2316
+ });
2317
+ }, a = fn(o, 300);
2318
+ return P(() => {
2319
+ t.value = {
2320
+ right: "".concat(i.right, "px"),
2321
+ bottom: "".concat(i.bottom, "px")
2322
+ };
2323
+ }, [i.right, i.bottom]), R(() => {
2324
+ var u;
2325
+ if (i.target) {
2326
+ const h = (u = document.querySelector(i.target)) != null ? u : void 0;
2327
+ h && (s.value = h, h.addEventListener("scroll", a), o());
2328
+ }
2329
+ }, []), l("div", {
2330
+ className: "".concat(n.b(), " ").concat(n.is("visible", e.value)),
2331
+ style: t.value,
2332
+ onClick: r,
2333
+ children: l(nn, {
2334
+ className: n.e("icon")
2335
+ })
2336
+ });
2337
+ };
2338
+ const mt = new $("chat-messages"), gt = (i) => {
2339
+ const e = K(null), t = i.controller.messages;
2340
+ return Hi(() => {
2259
2341
  e.current && t.value.length > 0 && (e.current.scrollTop = e.current.scrollHeight);
2260
2342
  }), l("div", {
2261
2343
  ref: e,
2262
- className: ai.b(),
2263
- children: t.value.map((i) => {
2344
+ className: mt.b(),
2345
+ children: [t.value.map((n) => {
2264
2346
  var o;
2265
- const s = ((o = i.content) == null ? void 0 : o.length) || 0;
2266
- return l(ri, {
2347
+ const s = ((o = n.content) == null ? void 0 : o.length) || 0;
2348
+ return l(dn, {
2267
2349
  size: s,
2268
- message: i,
2269
- controller: n.controller,
2270
- children: l(Xe, {
2271
- data: i,
2350
+ message: n,
2351
+ controller: i.controller,
2352
+ children: l(Ge, {
2353
+ data: n,
2272
2354
  type: "content",
2273
- items: n.toolbarItems,
2274
- controller: n.controller
2355
+ items: i.toolbarItems,
2356
+ controller: i.controller
2275
2357
  })
2276
- }, i.messageid);
2277
- })
2358
+ }, n.messageid);
2359
+ }), l(pn, {
2360
+ right: 20,
2361
+ bottom: 14,
2362
+ target: ".".concat(mt.b())
2363
+ })]
2278
2364
  });
2279
2365
  };
2280
- function ci(n, e) {
2366
+ function _n(i, e) {
2281
2367
  for (var t in e)
2282
- n[t] = e[t];
2283
- return n;
2368
+ i[t] = e[t];
2369
+ return i;
2284
2370
  }
2285
- function mt(n, e) {
2286
- for (var t in n)
2371
+ function bt(i, e) {
2372
+ for (var t in i)
2287
2373
  if (t !== "__source" && !(t in e))
2288
2374
  return !0;
2289
- for (var i in e)
2290
- if (i !== "__source" && n[i] !== e[i])
2375
+ for (var n in e)
2376
+ if (n !== "__source" && i[n] !== e[n])
2291
2377
  return !0;
2292
2378
  return !1;
2293
2379
  }
2294
- function gt(n) {
2295
- this.props = n;
2380
+ function yt(i) {
2381
+ this.props = i;
2296
2382
  }
2297
- (gt.prototype = new H()).isPureReactComponent = !0, gt.prototype.shouldComponentUpdate = function(n, e) {
2298
- return mt(this.props, n) || mt(this.state, e);
2383
+ (yt.prototype = new H()).isPureReactComponent = !0, yt.prototype.shouldComponentUpdate = function(i, e) {
2384
+ return bt(this.props, i) || bt(this.state, e);
2299
2385
  };
2300
- var yt = m.__b;
2301
- m.__b = function(n) {
2302
- n.type && n.type.__f && n.ref && (n.props.ref = n.ref, n.ref = null), yt && yt(n);
2386
+ var wt = g.__b;
2387
+ g.__b = function(i) {
2388
+ i.type && i.type.__f && i.ref && (i.props.ref = i.ref, i.ref = null), wt && wt(i);
2303
2389
  };
2304
- var li = m.__e;
2305
- m.__e = function(n, e, t, i) {
2306
- if (n.then) {
2390
+ var vn = g.__e;
2391
+ g.__e = function(i, e, t, n) {
2392
+ if (i.then) {
2307
2393
  for (var s, o = e; o = o.__; )
2308
2394
  if ((s = o.__c) && s.__c)
2309
- return e.__e == null && (e.__e = t.__e, e.__k = t.__k), s.__c(n, e);
2395
+ return e.__e == null && (e.__e = t.__e, e.__k = t.__k), s.__c(i, e);
2310
2396
  }
2311
- li(n, e, t, i);
2397
+ vn(i, e, t, n);
2312
2398
  };
2313
- var bt = m.unmount;
2314
- function rn(n, e, t) {
2315
- return n && (n.__c && n.__c.__H && (n.__c.__H.__.forEach(function(i) {
2316
- typeof i.__c == "function" && i.__c();
2317
- }), n.__c.__H = null), (n = ci({}, n)).__c != null && (n.__c.__P === t && (n.__c.__P = e), n.__c = null), n.__k = n.__k && n.__k.map(function(i) {
2318
- return rn(i, e, t);
2319
- })), n;
2320
- }
2321
- function an(n, e, t) {
2322
- return n && t && (n.__v = null, n.__k = n.__k && n.__k.map(function(i) {
2323
- return an(i, e, t);
2324
- }), n.__c && n.__c.__P === e && (n.__e && t.insertBefore(n.__e, n.__d), n.__c.__e = !0, n.__c.__P = t)), n;
2325
- }
2326
- function Be() {
2399
+ var Ct = g.unmount;
2400
+ function hi(i, e, t) {
2401
+ return i && (i.__c && i.__c.__H && (i.__c.__H.__.forEach(function(n) {
2402
+ typeof n.__c == "function" && n.__c();
2403
+ }), i.__c.__H = null), (i = _n({}, i)).__c != null && (i.__c.__P === t && (i.__c.__P = e), i.__c = null), i.__k = i.__k && i.__k.map(function(n) {
2404
+ return hi(n, e, t);
2405
+ })), i;
2406
+ }
2407
+ function di(i, e, t) {
2408
+ return i && t && (i.__v = null, i.__k = i.__k && i.__k.map(function(n) {
2409
+ return di(n, e, t);
2410
+ }), i.__c && i.__c.__P === e && (i.__e && t.insertBefore(i.__e, i.__d), i.__c.__e = !0, i.__c.__P = t)), i;
2411
+ }
2412
+ function We() {
2327
2413
  this.__u = 0, this.t = null, this.__b = null;
2328
2414
  }
2329
- function cn(n) {
2330
- var e = n.__.__c;
2331
- return e && e.__a && e.__a(n);
2415
+ function fi(i) {
2416
+ var e = i.__.__c;
2417
+ return e && e.__a && e.__a(i);
2332
2418
  }
2333
- function ge() {
2419
+ function be() {
2334
2420
  this.u = null, this.o = null;
2335
2421
  }
2336
- m.unmount = function(n) {
2337
- var e = n.__c;
2338
- e && e.__R && e.__R(), e && n.__h === !0 && (n.type = null), bt && bt(n);
2339
- }, (Be.prototype = new H()).__c = function(n, e) {
2340
- var t = e.__c, i = this;
2341
- i.t == null && (i.t = []), i.t.push(t);
2342
- var s = cn(i.__v), o = !1, r = function() {
2422
+ g.unmount = function(i) {
2423
+ var e = i.__c;
2424
+ e && e.__R && e.__R(), e && i.__h === !0 && (i.type = null), Ct && Ct(i);
2425
+ }, (We.prototype = new H()).__c = function(i, e) {
2426
+ var t = e.__c, n = this;
2427
+ n.t == null && (n.t = []), n.t.push(t);
2428
+ var s = fi(n.__v), o = !1, r = function() {
2343
2429
  o || (o = !0, t.__R = null, s ? s(a) : a());
2344
2430
  };
2345
2431
  t.__R = r;
2346
2432
  var a = function() {
2347
- if (!--i.__u) {
2348
- if (i.state.__a) {
2349
- var f = i.state.__a;
2350
- i.__v.__k[0] = an(f, f.__c.__P, f.__c.__O);
2433
+ if (!--n.__u) {
2434
+ if (n.state.__a) {
2435
+ var h = n.state.__a;
2436
+ n.__v.__k[0] = di(h, h.__c.__P, h.__c.__O);
2351
2437
  }
2352
2438
  var d;
2353
- for (i.setState({ __a: i.__b = null }); d = i.t.pop(); )
2439
+ for (n.setState({ __a: n.__b = null }); d = n.t.pop(); )
2354
2440
  d.forceUpdate();
2355
2441
  }
2356
2442
  }, u = e.__h === !0;
2357
- i.__u++ || u || i.setState({ __a: i.__b = i.__v.__k[0] }), n.then(r, r);
2358
- }, Be.prototype.componentWillUnmount = function() {
2443
+ n.__u++ || u || n.setState({ __a: n.__b = n.__v.__k[0] }), i.then(r, r);
2444
+ }, We.prototype.componentWillUnmount = function() {
2359
2445
  this.t = [];
2360
- }, Be.prototype.render = function(n, e) {
2446
+ }, We.prototype.render = function(i, e) {
2361
2447
  if (this.__b) {
2362
2448
  if (this.__v.__k) {
2363
- var t = document.createElement("div"), i = this.__v.__k[0].__c;
2364
- this.__v.__k[0] = rn(this.__b, t, i.__O = i.__P);
2449
+ var t = document.createElement("div"), n = this.__v.__k[0].__c;
2450
+ this.__v.__k[0] = hi(this.__b, t, n.__O = n.__P);
2365
2451
  }
2366
2452
  this.__b = null;
2367
2453
  }
2368
- var s = e.__a && I(se, null, n.fallback);
2369
- return s && (s.__h = null), [I(se, null, e.__a ? null : n.children), s];
2454
+ var s = e.__a && I(se, null, i.fallback);
2455
+ return s && (s.__h = null), [I(se, null, e.__a ? null : i.children), s];
2370
2456
  };
2371
- var wt = function(n, e, t) {
2372
- if (++t[1] === t[0] && n.o.delete(e), n.props.revealOrder && (n.props.revealOrder[0] !== "t" || !n.o.size))
2373
- for (t = n.u; t; ) {
2457
+ var Tt = function(i, e, t) {
2458
+ if (++t[1] === t[0] && i.o.delete(e), i.props.revealOrder && (i.props.revealOrder[0] !== "t" || !i.o.size))
2459
+ for (t = i.u; t; ) {
2374
2460
  for (; t.length > 3; )
2375
2461
  t.pop()();
2376
2462
  if (t[1] < t[0])
2377
2463
  break;
2378
- n.u = t = t[2];
2464
+ i.u = t = t[2];
2379
2465
  }
2380
2466
  };
2381
- function ui(n) {
2467
+ function mn(i) {
2382
2468
  return this.getChildContext = function() {
2383
- return n.context;
2384
- }, n.children;
2469
+ return i.context;
2470
+ }, i.children;
2385
2471
  }
2386
- function di(n) {
2387
- var e = this, t = n.i;
2472
+ function gn(i) {
2473
+ var e = this, t = i.i;
2388
2474
  e.componentWillUnmount = function() {
2389
2475
  te(null, e.l), e.l = null, e.i = null;
2390
- }, e.i && e.i !== t && e.componentWillUnmount(), e.l || (e.i = t, e.l = { nodeType: 1, parentNode: t, childNodes: [], appendChild: function(i) {
2391
- this.childNodes.push(i), e.i.appendChild(i);
2392
- }, insertBefore: function(i, s) {
2393
- this.childNodes.push(i), e.i.appendChild(i);
2394
- }, removeChild: function(i) {
2395
- this.childNodes.splice(this.childNodes.indexOf(i) >>> 1, 1), e.i.removeChild(i);
2396
- } }), te(I(ui, { context: e.context }, n.__v), e.l);
2397
- }
2398
- function hi(n, e) {
2399
- var t = I(di, { __v: n, i: e });
2476
+ }, e.i && e.i !== t && e.componentWillUnmount(), e.l || (e.i = t, e.l = { nodeType: 1, parentNode: t, childNodes: [], appendChild: function(n) {
2477
+ this.childNodes.push(n), e.i.appendChild(n);
2478
+ }, insertBefore: function(n, s) {
2479
+ this.childNodes.push(n), e.i.appendChild(n);
2480
+ }, removeChild: function(n) {
2481
+ this.childNodes.splice(this.childNodes.indexOf(n) >>> 1, 1), e.i.removeChild(n);
2482
+ } }), te(I(mn, { context: e.context }, i.__v), e.l);
2483
+ }
2484
+ function bn(i, e) {
2485
+ var t = I(gn, { __v: i, i: e });
2400
2486
  return t.containerInfo = e, t;
2401
2487
  }
2402
- (ge.prototype = new H()).__a = function(n) {
2403
- var e = this, t = cn(e.__v), i = e.o.get(n);
2404
- return i[0]++, function(s) {
2488
+ (be.prototype = new H()).__a = function(i) {
2489
+ var e = this, t = fi(e.__v), n = e.o.get(i);
2490
+ return n[0]++, function(s) {
2405
2491
  var o = function() {
2406
- e.props.revealOrder ? (i.push(s), wt(e, n, i)) : s();
2492
+ e.props.revealOrder ? (n.push(s), Tt(e, i, n)) : s();
2407
2493
  };
2408
2494
  t ? t(o) : o();
2409
2495
  };
2410
- }, ge.prototype.render = function(n) {
2496
+ }, be.prototype.render = function(i) {
2411
2497
  this.u = null, this.o = /* @__PURE__ */ new Map();
2412
- var e = Se(n.children);
2413
- n.revealOrder && n.revealOrder[0] === "b" && e.reverse();
2498
+ var e = Se(i.children);
2499
+ i.revealOrder && i.revealOrder[0] === "b" && e.reverse();
2414
2500
  for (var t = e.length; t--; )
2415
2501
  this.o.set(e[t], this.u = [1, 0, this.u]);
2416
- return n.children;
2417
- }, ge.prototype.componentDidUpdate = ge.prototype.componentDidMount = function() {
2418
- var n = this;
2502
+ return i.children;
2503
+ }, be.prototype.componentDidUpdate = be.prototype.componentDidMount = function() {
2504
+ var i = this;
2419
2505
  this.o.forEach(function(e, t) {
2420
- wt(n, t, e);
2506
+ Tt(i, t, e);
2421
2507
  });
2422
2508
  };
2423
- var fi = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, pi = /^(?: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]/, _i = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, vi = /[A-Z0-9]/g, mi = typeof document < "u", gi = function(n) {
2424
- return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(n);
2509
+ var yn = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, wn = /^(?: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]/, Cn = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Tn = /[A-Z0-9]/g, xn = typeof document < "u", Sn = function(i) {
2510
+ return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(i);
2425
2511
  };
2426
- H.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(n) {
2427
- Object.defineProperty(H.prototype, n, { configurable: !0, get: function() {
2428
- return this["UNSAFE_" + n];
2512
+ H.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(i) {
2513
+ Object.defineProperty(H.prototype, i, { configurable: !0, get: function() {
2514
+ return this["UNSAFE_" + i];
2429
2515
  }, set: function(e) {
2430
- Object.defineProperty(this, n, { configurable: !0, writable: !0, value: e });
2516
+ Object.defineProperty(this, i, { configurable: !0, writable: !0, value: e });
2431
2517
  } });
2432
2518
  });
2433
- var Ct = m.event;
2434
- function yi() {
2519
+ var xt = g.event;
2520
+ function kn() {
2435
2521
  }
2436
- function bi() {
2522
+ function En() {
2437
2523
  return this.cancelBubble;
2438
2524
  }
2439
- function wi() {
2525
+ function Nn() {
2440
2526
  return this.defaultPrevented;
2441
2527
  }
2442
- m.event = function(n) {
2443
- return Ct && (n = Ct(n)), n.persist = yi, n.isPropagationStopped = bi, n.isDefaultPrevented = wi, n.nativeEvent = n;
2528
+ g.event = function(i) {
2529
+ return xt && (i = xt(i)), i.persist = kn, i.isPropagationStopped = En, i.isDefaultPrevented = Nn, i.nativeEvent = i;
2444
2530
  };
2445
- var Ci = { enumerable: !1, configurable: !0, get: function() {
2531
+ var $n = { enumerable: !1, configurable: !0, get: function() {
2446
2532
  return this.class;
2447
- } }, Tt = m.vnode;
2448
- m.vnode = function(n) {
2449
- typeof n.type == "string" && function(e) {
2450
- var t = e.props, i = e.type, s = {};
2533
+ } }, St = g.vnode;
2534
+ g.vnode = function(i) {
2535
+ typeof i.type == "string" && function(e) {
2536
+ var t = e.props, n = e.type, s = {};
2451
2537
  for (var o in t) {
2452
2538
  var r = t[o];
2453
- if (!(o === "value" && "defaultValue" in t && r == null || mi && o === "children" && i === "noscript" || o === "class" || o === "className")) {
2539
+ if (!(o === "value" && "defaultValue" in t && r == null || xn && o === "children" && n === "noscript" || o === "class" || o === "className")) {
2454
2540
  var a = o.toLowerCase();
2455
- 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" || gi(t.type) ? a === "onfocus" ? o = "onfocusin" : a === "onblur" ? o = "onfocusout" : _i.test(o) ? o = a : i.indexOf("-") === -1 && pi.test(o) ? o = o.replace(vi, "-$&").toLowerCase() : r === null && (r = void 0) : a = o = "oninput", a === "oninput" && s[o = a] && (o = "oninputCapture"), s[o] = r;
2541
+ o === "defaultValue" && "value" in t && t.value == null ? o = "value" : o === "download" && r === !0 ? r = "" : a === "ondoubleclick" ? o = "ondblclick" : a !== "onchange" || n !== "input" && n !== "textarea" || Sn(t.type) ? a === "onfocus" ? o = "onfocusin" : a === "onblur" ? o = "onfocusout" : Cn.test(o) ? o = a : n.indexOf("-") === -1 && wn.test(o) ? o = o.replace(Tn, "-$&").toLowerCase() : r === null && (r = void 0) : a = o = "oninput", a === "oninput" && s[o = a] && (o = "oninputCapture"), s[o] = r;
2456
2542
  }
2457
2543
  }
2458
- i == "select" && s.multiple && Array.isArray(s.value) && (s.value = Se(t.children).forEach(function(u) {
2544
+ n == "select" && s.multiple && Array.isArray(s.value) && (s.value = Se(t.children).forEach(function(u) {
2459
2545
  u.props.selected = s.value.indexOf(u.props.value) != -1;
2460
- })), i == "select" && s.defaultValue != null && (s.value = Se(t.children).forEach(function(u) {
2546
+ })), n == "select" && s.defaultValue != null && (s.value = Se(t.children).forEach(function(u) {
2461
2547
  u.props.selected = s.multiple ? s.defaultValue.indexOf(u.props.value) != -1 : s.defaultValue == u.props.value;
2462
- })), t.class && !t.className ? (s.class = t.class, Object.defineProperty(s, "className", Ci)) : (t.className && !t.class || t.class && t.className) && (s.class = s.className = t.className), e.props = s;
2463
- }(n), n.$$typeof = fi, Tt && Tt(n);
2548
+ })), t.class && !t.className ? (s.class = t.class, Object.defineProperty(s, "className", $n)) : (t.className && !t.class || t.class && t.className) && (s.class = s.className = t.className), e.props = s;
2549
+ }(i), i.$$typeof = yn, St && St(i);
2464
2550
  };
2465
- var St = m.__r;
2466
- m.__r = function(n) {
2467
- St && St(n), n.__c;
2551
+ var kt = g.__r;
2552
+ g.__r = function(i) {
2553
+ kt && kt(i), i.__c;
2468
2554
  };
2469
- var xt = m.diffed;
2470
- m.diffed = function(n) {
2471
- xt && xt(n);
2472
- var e = n.props, t = n.__e;
2473
- t != null && n.type === "textarea" && "value" in e && e.value !== t.value && (t.value = e.value == null ? "" : e.value);
2555
+ var Et = g.diffed;
2556
+ g.diffed = function(i) {
2557
+ Et && Et(i);
2558
+ var e = i.props, t = i.__e;
2559
+ t != null && i.type === "textarea" && "value" in e && e.value !== t.value && (t.value = e.value == null ? "" : e.value);
2474
2560
  };
2475
- var he = /* @__PURE__ */ new Map();
2476
- function Ti(n) {
2477
- var e = he.get(n);
2561
+ var fe = /* @__PURE__ */ new Map();
2562
+ function Mn(i) {
2563
+ var e = fe.get(i);
2478
2564
  e && e.destroy();
2479
2565
  }
2480
- function Si(n) {
2481
- var e = he.get(n);
2566
+ function An(i) {
2567
+ var e = fe.get(i);
2482
2568
  e && e.update();
2483
2569
  }
2484
- var le = null;
2485
- typeof window > "u" ? ((le = function(n) {
2486
- return n;
2487
- }).destroy = function(n) {
2488
- return n;
2489
- }, le.update = function(n) {
2490
- return n;
2491
- }) : ((le = function(n, e) {
2492
- return n && Array.prototype.forEach.call(n.length ? n : [n], function(t) {
2493
- return function(i) {
2494
- if (i && i.nodeName && i.nodeName === "TEXTAREA" && !he.has(i)) {
2495
- var s, o = null, r = window.getComputedStyle(i), a = (s = i.value, function() {
2496
- f({ testForHeightReduction: s === "" || !i.value.startsWith(s), restoreTextAlign: null }), s = i.value;
2570
+ var ue = null;
2571
+ typeof window > "u" ? ((ue = function(i) {
2572
+ return i;
2573
+ }).destroy = function(i) {
2574
+ return i;
2575
+ }, ue.update = function(i) {
2576
+ return i;
2577
+ }) : ((ue = function(i, e) {
2578
+ return i && Array.prototype.forEach.call(i.length ? i : [i], function(t) {
2579
+ return function(n) {
2580
+ if (n && n.nodeName && n.nodeName === "TEXTAREA" && !fe.has(n)) {
2581
+ var s, o = null, r = window.getComputedStyle(n), a = (s = n.value, function() {
2582
+ h({ testForHeightReduction: s === "" || !n.value.startsWith(s), restoreTextAlign: null }), s = n.value;
2497
2583
  }), u = (function(c) {
2498
- i.removeEventListener("autosize:destroy", u), i.removeEventListener("autosize:update", d), i.removeEventListener("input", a), window.removeEventListener("resize", d), Object.keys(c).forEach(function(_) {
2499
- return i.style[_] = c[_];
2500
- }), he.delete(i);
2501
- }).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 });
2502
- 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", he.set(i, { destroy: u, update: d }), d();
2584
+ n.removeEventListener("autosize:destroy", u), n.removeEventListener("autosize:update", d), n.removeEventListener("input", a), window.removeEventListener("resize", d), Object.keys(c).forEach(function(p) {
2585
+ return n.style[p] = c[p];
2586
+ }), fe.delete(n);
2587
+ }).bind(n, { height: n.style.height, resize: n.style.resize, textAlign: n.style.textAlign, overflowY: n.style.overflowY, overflowX: n.style.overflowX, wordWrap: n.style.wordWrap });
2588
+ n.addEventListener("autosize:destroy", u), n.addEventListener("autosize:update", d), n.addEventListener("input", a), window.addEventListener("resize", d), n.style.overflowX = "hidden", n.style.wordWrap = "break-word", fe.set(n, { destroy: u, update: d }), d();
2503
2589
  }
2504
- function f(c) {
2505
- var _, v, h = c.restoreTextAlign, p = h === void 0 ? null : h, y = c.testForHeightReduction, b = y === void 0 || y, C = r.overflowY;
2506
- if (i.scrollHeight !== 0 && (r.resize === "vertical" ? i.style.resize = "none" : r.resize === "both" && (i.style.resize = "horizontal"), b && (_ = function(T) {
2507
- for (var E = []; T && T.parentNode && T.parentNode instanceof Element; )
2508
- T.parentNode.scrollTop && E.push([T.parentNode, T.parentNode.scrollTop]), T = T.parentNode;
2590
+ function h(c) {
2591
+ var p, m, f = c.restoreTextAlign, v = f === void 0 ? null : f, _ = c.testForHeightReduction, y = _ === void 0 || _, C = r.overflowY;
2592
+ if (n.scrollHeight !== 0 && (r.resize === "vertical" ? n.style.resize = "none" : r.resize === "both" && (n.style.resize = "horizontal"), y && (p = function(T) {
2593
+ for (var k = []; T && T.parentNode && T.parentNode instanceof Element; )
2594
+ T.parentNode.scrollTop && k.push([T.parentNode, T.parentNode.scrollTop]), T = T.parentNode;
2509
2595
  return function() {
2510
- return E.forEach(function(R) {
2511
- var D = R[0], P = R[1];
2512
- D.style.scrollBehavior = "auto", D.scrollTop = P, D.style.scrollBehavior = null;
2596
+ return k.forEach(function(F) {
2597
+ var D = F[0], U = F[1];
2598
+ D.style.scrollBehavior = "auto", D.scrollTop = U, D.style.scrollBehavior = null;
2513
2599
  });
2514
2600
  };
2515
- }(i), i.style.height = ""), v = r.boxSizing === "content-box" ? i.scrollHeight - (parseFloat(r.paddingTop) + parseFloat(r.paddingBottom)) : i.scrollHeight + parseFloat(r.borderTopWidth) + parseFloat(r.borderBottomWidth), r.maxHeight !== "none" && v > parseFloat(r.maxHeight) ? (r.overflowY === "hidden" && (i.style.overflow = "scroll"), v = parseFloat(r.maxHeight)) : r.overflowY !== "hidden" && (i.style.overflow = "hidden"), i.style.height = v + "px", p && (i.style.textAlign = p), _ && _(), o !== v && (i.dispatchEvent(new Event("autosize:resized", { bubbles: !0 })), o = v), C !== r.overflow && !p)) {
2516
- var N = r.textAlign;
2517
- r.overflow === "hidden" && (i.style.textAlign = N === "start" ? "end" : "start"), f({ restoreTextAlign: N, testForHeightReduction: !0 });
2601
+ }(n), n.style.height = ""), m = r.boxSizing === "content-box" ? n.scrollHeight - (parseFloat(r.paddingTop) + parseFloat(r.paddingBottom)) : n.scrollHeight + parseFloat(r.borderTopWidth) + parseFloat(r.borderBottomWidth), r.maxHeight !== "none" && m > parseFloat(r.maxHeight) ? (r.overflowY === "hidden" && (n.style.overflow = "scroll"), m = parseFloat(r.maxHeight)) : r.overflowY !== "hidden" && (n.style.overflow = "hidden"), n.style.height = m + "px", v && (n.style.textAlign = v), p && p(), o !== m && (n.dispatchEvent(new Event("autosize:resized", { bubbles: !0 })), o = m), C !== r.overflow && !v)) {
2602
+ var E = r.textAlign;
2603
+ r.overflow === "hidden" && (n.style.textAlign = E === "start" ? "end" : "start"), h({ restoreTextAlign: E, testForHeightReduction: !0 });
2518
2604
  }
2519
2605
  }
2520
2606
  function d() {
2521
- f({ testForHeightReduction: !0, restoreTextAlign: null });
2607
+ h({ testForHeightReduction: !0, restoreTextAlign: null });
2522
2608
  }
2523
2609
  }(t);
2524
- }), n;
2525
- }).destroy = function(n) {
2526
- return n && Array.prototype.forEach.call(n.length ? n : [n], Ti), n;
2527
- }, le.update = function(n) {
2528
- return n && Array.prototype.forEach.call(n.length ? n : [n], Si), n;
2610
+ }), i;
2611
+ }).destroy = function(i) {
2612
+ return i && Array.prototype.forEach.call(i.length ? i : [i], Mn), i;
2613
+ }, ue.update = function(i) {
2614
+ return i && Array.prototype.forEach.call(i.length ? i : [i], An), i;
2529
2615
  });
2530
- var Et = le;
2531
- class Ue {
2616
+ var Nt = ue;
2617
+ class le {
2532
2618
  constructor(e) {
2533
2619
  this.msg = e;
2534
2620
  }
@@ -2544,6 +2630,14 @@ class Ue {
2544
2630
  get type() {
2545
2631
  return this.msg.type;
2546
2632
  }
2633
+ get realcontent() {
2634
+ let e = this.msg.content;
2635
+ if (e.indexOf("<think>") !== -1 && e.indexOf("</think>") === -1 || (e = e.replace(new RegExp("\\<think\\>[^]*?\\<\\/think\\>", "gs"), "").trim(), e.indexOf("<resources>") !== -1 && e.indexOf("</resources>") === -1))
2636
+ return "";
2637
+ e = e.replace(new RegExp("\\<resources\\>[^]*?\\<\\/resources\\>", "gs"), "").trim();
2638
+ const t = e.indexOf("<suggestions>");
2639
+ return t !== -1 && (e = e.substring(0, t).trim()), e;
2640
+ }
2547
2641
  get content() {
2548
2642
  return this.msg.content;
2549
2643
  }
@@ -2597,7 +2691,7 @@ class ye {
2597
2691
  return this.data.aiChat;
2598
2692
  }
2599
2693
  }
2600
- class Fe {
2694
+ class Ve {
2601
2695
  constructor(e) {
2602
2696
  this.material = e;
2603
2697
  }
@@ -2614,9 +2708,19 @@ class Fe {
2614
2708
  return this.material.data;
2615
2709
  }
2616
2710
  }
2617
- var $ = /* @__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))($ || {});
2711
+ var N = /* @__PURE__ */ ((i) => (i.STYLE_CACHE = "ai-chat-style-cache", i.MINIMIZE_STYLY_CHCHE = "ai-chat-minimize-style-cache", i.DATA_BASE_NAME = "ibiz-chat", i.DATA_TABLE_NAME = "history-message", i.DATA_TABLE_KEY_NAME = "id", i))(N || {});
2618
2712
  class $t {
2619
2713
  /**
2714
+ * 聊天窗触发提问回调
2715
+ *
2716
+ * @author tony001
2717
+ * @date 2025-02-24 14:02:51
2718
+ * @param {object} context
2719
+ * @param {object} params
2720
+ * @param {object} otherParams
2721
+ * @param {IChatMessage[]} question 提问历史内容(包含当前提问)
2722
+ * @return {*} {Promise<boolean>} 等待回答
2723
+ /**
2620
2724
  * Creates an instance of AiChatController.
2621
2725
  *
2622
2726
  * @author chitanda
@@ -2631,7 +2735,7 @@ class $t {
2631
2735
  * @date 2023-10-16 16:10:29
2632
2736
  * @type {Signal<ChatMessage[]>}
2633
2737
  */
2634
- w(this, "messages", J([]));
2738
+ w(this, "messages", j([]));
2635
2739
  /**
2636
2740
  * 素材列表
2637
2741
  *
@@ -2639,7 +2743,7 @@ class $t {
2639
2743
  * @date 2025-02-27 18:02:46
2640
2744
  * @type {Signal<IMaterial[]>}
2641
2745
  */
2642
- w(this, "materials", J([]));
2746
+ w(this, "materials", j([]));
2643
2747
  /**
2644
2748
  * 聊天框输入值
2645
2749
  *
@@ -2647,7 +2751,15 @@ class $t {
2647
2751
  * @date 2023-10-16 15:10:43
2648
2752
  * @type {Signal<string>}
2649
2753
  */
2650
- w(this, "input", J(""));
2754
+ w(this, "input", j(""));
2755
+ /**
2756
+ * 是否加载中
2757
+ *
2758
+ * @author tony001
2759
+ * @date 2025-03-10 18:03:42
2760
+ * @type {Signal<boolean>}
2761
+ */
2762
+ w(this, "isLoading", j(!1));
2651
2763
  /**
2652
2764
  * 视图参数
2653
2765
  *
@@ -2680,7 +2792,15 @@ class $t {
2680
2792
  * @type {(string | undefined)}
2681
2793
  */
2682
2794
  w(this, "topicId");
2683
- this.opts = e, this.context = e.context, this.params = e.params, this.appDataEntityId = e.appDataEntityId, this.topicId = e.topicId, this.fecthHistory();
2795
+ /**
2796
+ * 话题数据
2797
+ *
2798
+ * @author tony001
2799
+ * @date 2025-03-10 16:03:26
2800
+ * @type {(ITopic | undefined)}
2801
+ */
2802
+ w(this, "topic");
2803
+ this.opts = e, this.context = e.context, this.params = e.params, this.appDataEntityId = e.appDataEntityId, this.topicId = e.topicId, this.topic = e.topic, this.fecthHistory();
2684
2804
  }
2685
2805
  /**
2686
2806
  * 获取历史记录
@@ -2691,10 +2811,10 @@ class $t {
2691
2811
  */
2692
2812
  async fecthHistory() {
2693
2813
  if (this.topicId) {
2694
- const e = await V.getData($.DATA_BASE_NAME, $.DATA_TABLE_NAME, this.topicId);
2814
+ const e = await Y.getData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, this.topicId);
2695
2815
  if (e && e.data && e.data.length > 0)
2696
2816
  return e.data.forEach((t) => {
2697
- const i = {
2817
+ const n = {
2698
2818
  messageid: t.messageid,
2699
2819
  state: t.state,
2700
2820
  type: t.type,
@@ -2702,7 +2822,7 @@ class $t {
2702
2822
  content: t.content,
2703
2823
  completed: !0
2704
2824
  };
2705
- this.addMessage(i);
2825
+ this.addMessage(n);
2706
2826
  }), !0;
2707
2827
  }
2708
2828
  return this.opts.history(this.context, this.params, {
@@ -2724,7 +2844,7 @@ class $t {
2724
2844
  data: this.messages.value.map((t) => t._origin),
2725
2845
  timestamp: (/* @__PURE__ */ new Date()).getTime()
2726
2846
  };
2727
- await V.updateData($.DATA_BASE_NAME, $.DATA_TABLE_NAME, e);
2847
+ await Y.updateData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, e);
2728
2848
  }
2729
2849
  /**
2730
2850
  * 设置聊天框值
@@ -2744,8 +2864,8 @@ class $t {
2744
2864
  * @param {IMessage} data
2745
2865
  */
2746
2866
  addMessage(e) {
2747
- const t = this.messages.value.find((i) => i.messageid === e.messageid);
2748
- t ? (t.update(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new Ue(e)], this.asyncToIndexDB();
2867
+ const t = this.messages.value.find((n) => n.messageid === e.messageid);
2868
+ t ? (t.update(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new le(e)], this.asyncToIndexDB();
2749
2869
  }
2750
2870
  /**
2751
2871
  * 更新消息完成状态
@@ -2756,8 +2876,8 @@ class $t {
2756
2876
  * @param {boolean} completed
2757
2877
  */
2758
2878
  completeMessage(e, t) {
2759
- const i = this.messages.value.find((s) => s.messageid === e);
2760
- i && (i.updateCompleted(t), this.messages.value = [...this.messages.value], this.asyncToIndexDB());
2879
+ const n = this.messages.value.find((s) => s.messageid === e);
2880
+ n && (n.updateCompleted(t), this.messages.value = [...this.messages.value], this.asyncToIndexDB());
2761
2881
  }
2762
2882
  /**
2763
2883
  * 替换已经存在的聊天消息
@@ -2767,8 +2887,24 @@ class $t {
2767
2887
  * @param {IChatMessage} data
2768
2888
  */
2769
2889
  replaceMessage(e) {
2770
- const t = this.messages.value.findIndex((i) => i.messageid === e.messageid);
2771
- t !== -1 ? (this.messages.value[t] = new Ue(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new Ue(e)], this.asyncToIndexDB();
2890
+ const t = this.messages.value.findIndex((n) => n.messageid === e.messageid);
2891
+ t !== -1 ? (this.messages.value[t] = new le(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new le(e)], this.asyncToIndexDB();
2892
+ }
2893
+ /**
2894
+ * 终止消息
2895
+ *
2896
+ * @author tony001
2897
+ * @date 2025-03-10 14:03:17
2898
+ * @param {IChatMessage} data
2899
+ */
2900
+ stopMessage(e) {
2901
+ const t = this.messages.value.findIndex((n) => n.messageid === e.messageid);
2902
+ if (t !== -1) {
2903
+ const n = this.messages.value[t];
2904
+ e.content = n.content, this.messages.value[t] = new le(e), this.messages.value = [...this.messages.value];
2905
+ } else
2906
+ this.messages.value = [...this.messages.value, new le(e)];
2907
+ this.asyncToIndexDB();
2772
2908
  }
2773
2909
  /**
2774
2910
  * 数据对象转 XML 字符串
@@ -2780,13 +2916,13 @@ class $t {
2780
2916
  stringlyMaterialResource() {
2781
2917
  let e = "";
2782
2918
  const t = [];
2783
- return this.materials.value && this.materials.value.length > 0 && (this.materials.value.forEach((i) => {
2784
- if (i.type === "ossfile") {
2785
- const s = i.metadata;
2786
- s.state && s.state === "successed" && t.push(i);
2919
+ return this.materials.value && this.materials.value.length > 0 && (this.materials.value.forEach((n) => {
2920
+ if (n.type === "ossfile") {
2921
+ const s = n.metadata;
2922
+ s.state && s.state === "successed" && t.push(n);
2787
2923
  } else
2788
- t.push(i);
2789
- }), this.materials.value = []), t && t.length > 0 && (e = jt.stringify(t)), e;
2924
+ t.push(n);
2925
+ }), this.materials.value = []), t && t.length > 0 && (e = Jt.stringify(t)), e;
2790
2926
  }
2791
2927
  /**
2792
2928
  * 提问
@@ -2796,16 +2932,34 @@ class $t {
2796
2932
  * @return {*} {Promise<void>}
2797
2933
  */
2798
2934
  async question(e) {
2799
- let t = this.stringlyMaterialResource();
2800
- t ? t += e : t = e, this.addMessage({
2801
- state: 30,
2802
- messageid: qt(),
2803
- role: "USER",
2804
- type: "DEFAULT",
2805
- content: t
2806
- }), await this.opts.question(this.context, this.params, {
2807
- appDataEntityId: this.appDataEntityId
2808
- }, this.messages.value.filter((i) => i.type !== "ERROR").map((i) => i._origin)), this.opts.action && this.opts.action("question", e);
2935
+ try {
2936
+ this.isLoading.value = !0;
2937
+ let t = this.stringlyMaterialResource();
2938
+ t ? t += "\n".concat(e) : t = e, this.addMessage({
2939
+ state: 30,
2940
+ messageid: Zt(),
2941
+ role: "USER",
2942
+ type: "DEFAULT",
2943
+ content: t
2944
+ }), await this.opts.question(this, this.context, this.params, {
2945
+ appDataEntityId: this.appDataEntityId
2946
+ }, this.messages.value.filter((n) => n.type !== "ERROR").map((n) => n._origin)), this.opts.action && this.opts.action("question", e), this.isLoading.value = !1;
2947
+ } finally {
2948
+ this.isLoading.value = !1;
2949
+ }
2950
+ }
2951
+ /**
2952
+ * 中断请求
2953
+ *
2954
+ * @author tony001
2955
+ * @date 2025-03-10 14:03:48
2956
+ */
2957
+ abortQuestion() {
2958
+ try {
2959
+ this.opts.abortQuestion(this);
2960
+ } finally {
2961
+ this.isLoading.value = !1;
2962
+ }
2809
2963
  }
2810
2964
  /**
2811
2965
  * 回填选中的消息
@@ -2825,7 +2979,7 @@ class $t {
2825
2979
  * @memberof AiChatController
2826
2980
  */
2827
2981
  deleteMessage(e) {
2828
- const t = this.messages.value.findIndex((i) => i.messageid === e.messageid);
2982
+ const t = this.messages.value.findIndex((n) => n.messageid === e.messageid);
2829
2983
  t !== -1 && (this.messages.value.splice(t, 1), this.messages.value = [...this.messages.value]), this.asyncToIndexDB(), this.opts.action && this.opts.action("deletemsg", e);
2830
2984
  }
2831
2985
  /**
@@ -2834,20 +2988,25 @@ class $t {
2834
2988
  * @memberof AiChatController
2835
2989
  */
2836
2990
  async refreshMessage(e, t = !1) {
2837
- const i = this.messages.value.findIndex((s) => s.messageid === e.messageid);
2838
- if (t)
2839
- this.messages.value.splice(i + 1, this.messages.value.length - i - 1), this.messages.value = [...this.messages.value], await this.opts.question(this.context, this.params, {
2840
- appDataEntityId: this.appDataEntityId
2841
- }, this.messages.value.filter((s) => s.type !== "ERROR").map((s) => s._origin));
2842
- else if (i === this.messages.value.length - 1)
2843
- this.messages.value.pop(), this.messages.value = [...this.messages.value], await this.opts.question(this.context, this.params, {
2844
- appDataEntityId: this.appDataEntityId
2845
- }, this.messages.value.filter((s) => s.type !== "ERROR").map((s) => s._origin));
2846
- else {
2847
- const s = this.messages.value[i - 1].content;
2848
- this.messages.value.splice(i - 1, 2), this.question(s);
2991
+ this.isLoading.value = !0;
2992
+ try {
2993
+ const n = this.messages.value.findIndex((s) => s.messageid === e.messageid);
2994
+ if (t)
2995
+ this.messages.value.splice(n + 1, this.messages.value.length - n - 1), this.messages.value = [...this.messages.value], await this.opts.question(this, this.context, this.params, {
2996
+ appDataEntityId: this.appDataEntityId
2997
+ }, this.messages.value.filter((s) => s.type !== "ERROR").map((s) => s._origin));
2998
+ else if (n === this.messages.value.length - 1)
2999
+ this.messages.value.pop(), this.messages.value = [...this.messages.value], await this.opts.question(this, this.context, this.params, {
3000
+ appDataEntityId: this.appDataEntityId
3001
+ }, this.messages.value.filter((s) => s.type !== "ERROR").map((s) => s._origin));
3002
+ else {
3003
+ const s = this.messages.value[n - 1].content;
3004
+ this.messages.value.splice(n - 1, 2), this.question(s);
3005
+ }
3006
+ this.asyncToIndexDB(), this.opts.action && this.opts.action("refreshmsg", e);
3007
+ } finally {
3008
+ this.isLoading.value = !1;
2849
3009
  }
2850
- this.asyncToIndexDB(), this.opts.action && this.opts.action("refreshmsg", e);
2851
3010
  }
2852
3011
  /**
2853
3012
  * 复制消息
@@ -2856,8 +3015,8 @@ class $t {
2856
3015
  * @memberof AiChatController
2857
3016
  */
2858
3017
  copyMessage(e) {
2859
- const t = e.content;
2860
- Wt.copy(t), this.opts.action && this.opts.action("copymsg", e);
3018
+ const t = e.realcontent;
3019
+ Gt.copy(t), this.opts.action && this.opts.action("copymsg", e);
2861
3020
  }
2862
3021
  /**
2863
3022
  * 新建对话
@@ -2865,7 +3024,7 @@ class $t {
2865
3024
  * @memberof AiChatController
2866
3025
  */
2867
3026
  async newDialogue() {
2868
- this.messages.value.length = 0, this.topicId && await V.deleteData($.DATA_BASE_NAME, $.DATA_TABLE_NAME, this.topicId), this.opts.history(this.context, this.params, {
3027
+ this.messages.value.length = 0, this.topicId && await Y.deleteData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, this.topicId), this.opts.history(this.context, this.params, {
2869
3028
  appDataEntityId: this.appDataEntityId
2870
3029
  });
2871
3030
  }
@@ -2877,7 +3036,7 @@ class $t {
2877
3036
  * @param {IMaterial} data
2878
3037
  */
2879
3038
  addMaterial(e) {
2880
- this.materials.value.find((i) => i.id === e.id) ? this.materials.value = [...this.materials.value] : this.materials.value = [...this.materials.value, new Fe(e)];
3039
+ this.materials.value.find((n) => n.id === e.id) ? this.materials.value = [...this.materials.value] : this.materials.value = [...this.materials.value, new Ve(e)];
2881
3040
  }
2882
3041
  /**
2883
3042
  * 替换素材资源
@@ -2888,8 +3047,8 @@ class $t {
2888
3047
  * @param {IMaterial} data
2889
3048
  */
2890
3049
  replaceMaterial(e, t) {
2891
- const i = this.materials.value.findIndex((s) => s.id === e);
2892
- i !== -1 ? (this.materials.value[i] = new Fe(t), this.materials.value = [...this.materials.value]) : this.materials.value = [...this.materials.value, new Fe(t)];
3050
+ const n = this.materials.value.findIndex((s) => s.id === e);
3051
+ n !== -1 ? (this.materials.value[n] = new Ve(t), this.materials.value = [...this.materials.value]) : this.materials.value = [...this.materials.value, new Ve(t)];
2893
3052
  }
2894
3053
  /**
2895
3054
  * 删除指定素材资源
@@ -2899,11 +3058,11 @@ class $t {
2899
3058
  * @param {IMaterial} data
2900
3059
  */
2901
3060
  deleteMaterial(e) {
2902
- const t = this.materials.value.findIndex((i) => i.id === e.id);
3061
+ const t = this.materials.value.findIndex((n) => n.id === e.id);
2903
3062
  t !== -1 && (this.materials.value.splice(t, 1), this.materials.value = [...this.materials.value]);
2904
3063
  }
2905
3064
  }
2906
- class xi {
3065
+ class In {
2907
3066
  /**
2908
3067
  * Creates an instance of AiTopicController.
2909
3068
  * @author tony001
@@ -2918,7 +3077,7 @@ class xi {
2918
3077
  * @date 2025-02-20 16:02:38
2919
3078
  * @type {Signal<ChatTopic[]>}
2920
3079
  */
2921
- w(this, "topics", J([]));
3080
+ w(this, "topics", j([]));
2922
3081
  /**
2923
3082
  * 激活话题
2924
3083
  *
@@ -2926,7 +3085,7 @@ class xi {
2926
3085
  * @date 2025-02-24 16:02:44
2927
3086
  * @type {(Signal<ITopic | null>)}
2928
3087
  */
2929
- w(this, "activedTopic", J(null));
3088
+ w(this, "activedTopic", j(null));
2930
3089
  /**
2931
3090
  * 当前话题配置备份
2932
3091
  *
@@ -2946,8 +3105,8 @@ class xi {
2946
3105
  * @return {*} {Promise<void>}
2947
3106
  */
2948
3107
  async fetchHistory(e) {
2949
- const i = await e.configService(e.appid, "aitopics", e.type).load();
2950
- i && i.length > 0 && i.forEach((s) => {
3108
+ const n = await e.configService(e.appid, "aitopics", e.type).load();
3109
+ n && n.length > 0 && n.forEach((s) => {
2951
3110
  this.topics.value = [...this.topics.value, new ye(s)];
2952
3111
  });
2953
3112
  }
@@ -2961,7 +3120,7 @@ class xi {
2961
3120
  */
2962
3121
  async updateCurrentTopic(e) {
2963
3122
  this.currentTopicOptions = e;
2964
- const t = this.topics.value.findIndex((r) => r.id === e.id), i = new ye(e);
3123
+ const t = this.topics.value.findIndex((r) => r.id === e.id), n = new ye(e);
2965
3124
  t !== -1 ? this.topics.value.splice(t, 1, new ye(e)) : this.topics.value = [...this.topics.value, new ye(e)];
2966
3125
  const s = this.topics.value.map((r) => ({
2967
3126
  appid: r.appid,
@@ -2971,7 +3130,7 @@ class xi {
2971
3130
  url: r.url,
2972
3131
  aiChat: r.aiChat
2973
3132
  })), o = e.configService(e.appid, "aitopics", e.type);
2974
- await (o == null ? void 0 : o.save(s)), this.activedTopic.value = i;
3133
+ await (o == null ? void 0 : o.save(s)), this.activedTopic.value = n;
2975
3134
  }
2976
3135
  /**
2977
3136
  * 删除话题
@@ -2985,10 +3144,10 @@ class xi {
2985
3144
  * @param {MouseEvent} event
2986
3145
  * @return {*} {Promise<void>}
2987
3146
  */
2988
- async removeTopic(e, t, i, s, o) {
3147
+ async removeTopic(e, t, n, s, o) {
2989
3148
  var d;
2990
3149
  let r = !0;
2991
- if (e.beforeDelete && (r = await e.beforeDelete(t, i, s, o)), !r)
3150
+ if (e.beforeDelete && (r = await e.beforeDelete(t, n, s, o)), !r)
2992
3151
  return;
2993
3152
  const a = this.topics.value.findIndex((c) => c.id === s.id);
2994
3153
  a !== -1 && (this.topics.value.splice(a, 1), this.topics.value = [...this.topics.value]);
@@ -2999,8 +3158,8 @@ class xi {
2999
3158
  caption: c.caption,
3000
3159
  url: c.url,
3001
3160
  aiChat: c.aiChat
3002
- })), f = e.configService(e.appid, "aitopics", e.type);
3003
- await (f == null ? void 0 : f.save(u)), await V.deleteData($.DATA_BASE_NAME, $.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]);
3161
+ })), h = e.configService(e.appid, "aitopics", e.type);
3162
+ await (h == null ? void 0 : h.save(u)), await Y.deleteData(N.DATA_BASE_NAME, N.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]);
3004
3163
  }
3005
3164
  /**
3006
3165
  * 处理选中变化
@@ -3023,7 +3182,7 @@ class xi {
3023
3182
  * @param {MouseEvent} event
3024
3183
  * @return {*} {Promise<void>}
3025
3184
  */
3026
- async handleTopicAction(e, t, i) {
3185
+ async handleTopicAction(e, t, n) {
3027
3186
  var o, r;
3028
3187
  const s = this.topics.value.find((a) => a.id === t.id);
3029
3188
  if (this.currentTopicOptions && s && s.aiChat) {
@@ -3031,16 +3190,16 @@ class xi {
3031
3190
  context: a,
3032
3191
  params: u
3033
3192
  } = s.aiChat;
3034
- 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);
3193
+ e === "DELETE" && await this.removeTopic(this.currentTopicOptions, a, u, s, n), (r = (o = this.currentTopicOptions).action) == null || r.call(o, e, a, u, t, n);
3035
3194
  }
3036
3195
  }
3037
3196
  }
3038
- class ln {
3197
+ class pi {
3039
3198
  constructor(e) {
3040
3199
  this.aiChat = e;
3041
3200
  }
3042
3201
  }
3043
- class Ei extends ln {
3202
+ class Dn extends pi {
3044
3203
  /**
3045
3204
  * 执行操作
3046
3205
  *
@@ -3050,9 +3209,9 @@ class Ei extends ln {
3050
3209
  */
3051
3210
  async excuteAction(e, t) {
3052
3211
  if (t && t.onClick) {
3053
- const i = await t.onClick(e, this.aiChat.context, this.aiChat.params);
3054
- if (i && i.data && i.data.length > 0) {
3055
- const s = i.data[0], o = {
3212
+ const n = await t.onClick(e, this.aiChat.context, this.aiChat.params);
3213
+ if (n && n.data && n.data.length > 0) {
3214
+ const s = n.data[0], o = {
3056
3215
  id: s.id,
3057
3216
  type: s.type,
3058
3217
  data: s.data || {},
@@ -3065,7 +3224,7 @@ class Ei extends ln {
3065
3224
  }
3066
3225
  }
3067
3226
  }
3068
- class $i extends ln {
3227
+ class zn extends pi {
3069
3228
  /**
3070
3229
  * 执行操作
3071
3230
  *
@@ -3074,63 +3233,63 @@ class $i extends ln {
3074
3233
  * @return {*} {Promise<void>}
3075
3234
  */
3076
3235
  async excuteAction(e, t) {
3077
- const i = this.aiChat.opts.uploader, {
3236
+ const n = this.aiChat.opts.uploader, {
3078
3237
  multiple: s,
3079
3238
  accept: o,
3080
3239
  maxSize: r,
3081
3240
  onSelect: a,
3082
3241
  onUpload: u,
3083
- onSuccess: f,
3242
+ onSuccess: h,
3084
3243
  onError: d,
3085
3244
  onProgress: c
3086
- } = i, _ = {
3245
+ } = n, p = {
3087
3246
  multiple: s || !0,
3088
3247
  accept: o || "*/*",
3089
3248
  maxSize: r || 5 * 1024 * 1024,
3090
- onSelect: (h) => {
3091
- a == null || a(h), h.length > 0 && h.forEach((p) => {
3092
- const y = this.buildMaterialObject(p);
3093
- Object.assign(y.metadata, {
3249
+ onSelect: (f) => {
3250
+ a == null || a(f), f.length > 0 && f.forEach((v) => {
3251
+ const _ = this.buildMaterialObject(v);
3252
+ Object.assign(_.metadata, {
3094
3253
  state: "uploading"
3095
- }), this.aiChat.addMaterial(y);
3254
+ }), this.aiChat.addMaterial(_);
3096
3255
  });
3097
3256
  },
3098
- onUpload: async (h, p) => u(h, p, {
3257
+ onUpload: async (f, v) => u(f, v, {
3099
3258
  context: this.aiChat.context,
3100
3259
  params: this.aiChat.params
3101
3260
  }),
3102
3261
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3103
- onSuccess: (h, p) => {
3104
- const y = {
3105
- id: h.id,
3262
+ onSuccess: (f, v) => {
3263
+ const _ = {
3264
+ id: f.id,
3106
3265
  type: "ossfile",
3107
3266
  data: {
3108
- id: h.id,
3109
- name: h.name
3267
+ id: f.id,
3268
+ name: f.name
3110
3269
  },
3111
3270
  metadata: {
3112
- ext: h.ext,
3113
- fileext: h.fileext,
3114
- fileid: h.fileid,
3115
- filename: h.filename,
3116
- size: h.size,
3117
- filesize: h.filesize,
3271
+ ext: f.ext,
3272
+ fileext: f.fileext,
3273
+ fileid: f.fileid,
3274
+ filename: f.filename,
3275
+ size: f.size,
3276
+ filesize: f.filesize,
3118
3277
  state: "successed"
3119
3278
  }
3120
3279
  };
3121
- this.aiChat.replaceMaterial(p.name, y), f == null || f(h, p);
3280
+ this.aiChat.replaceMaterial(v.name, _), h == null || h(f, v);
3122
3281
  },
3123
- onError: (h, p) => {
3124
- const y = this.buildMaterialObject(p);
3125
- Object.assign(y.metadata, {
3282
+ onError: (f, v) => {
3283
+ const _ = this.buildMaterialObject(v);
3284
+ Object.assign(_.metadata, {
3126
3285
  state: "failed"
3127
- }), this.aiChat.replaceMaterial(p.name, y), d == null || d(h, p);
3286
+ }), this.aiChat.replaceMaterial(v.name, _), d == null || d(f, v);
3128
3287
  },
3129
- onProgress: (h, p) => {
3130
- c == null || c(h, p);
3288
+ onProgress: (f, v) => {
3289
+ c == null || c(f, v);
3131
3290
  }
3132
3291
  };
3133
- new Sn(_).openFilePicker();
3292
+ new Ni(p).openFilePicker();
3134
3293
  }
3135
3294
  /**
3136
3295
  * 构建素材对象
@@ -3156,17 +3315,17 @@ class $i extends ln {
3156
3315
  };
3157
3316
  }
3158
3317
  }
3159
- class Nt {
3318
+ class Mt {
3160
3319
  static getMaterialHelper(e, t) {
3161
3320
  switch (e) {
3162
3321
  case "ossfile":
3163
- return new $i(t);
3322
+ return new zn(t);
3164
3323
  default:
3165
- return new Ei(t);
3324
+ return new Dn(t);
3166
3325
  }
3167
3326
  }
3168
3327
  }
3169
- class Ni {
3328
+ class Hn {
3170
3329
  /**
3171
3330
  * Creates an instance of ChatController.
3172
3331
  * @author tony001
@@ -3219,15 +3378,25 @@ class Ni {
3219
3378
  */
3220
3379
  w(this, "aiTopic");
3221
3380
  /**
3222
- * 聊天控制器
3381
+ * 话题map
3223
3382
  *
3224
- * @author tony001
3225
- * @date 2025-02-23 16:02:09
3226
- * @public
3227
- * @type {(AiChatController | undefined)}
3383
+ * @private
3384
+ * @type {Map<string, AiChatController>}
3385
+ * @memberof ChatController
3228
3386
  */
3229
- w(this, "aiChat");
3230
- this.aiTopic = new xi(this);
3387
+ w(this, "aiTopicMap", /* @__PURE__ */ new Map());
3388
+ this.aiTopic = new In(this);
3389
+ }
3390
+ /**
3391
+ * 聊天控制器
3392
+ *
3393
+ * @readonly
3394
+ * @type {(AiChatController | undefined)}
3395
+ * @memberof ChatController
3396
+ */
3397
+ get aiChat() {
3398
+ var e;
3399
+ return this.aiTopicMap.get("".concat((e = this.aiTopic.activedTopic.value) == null ? void 0 : e.id));
3231
3400
  }
3232
3401
  /**
3233
3402
  * 初始化IndexDB
@@ -3237,7 +3406,7 @@ class Ni {
3237
3406
  * @return {*} {Promise<void>}
3238
3407
  */
3239
3408
  async initIndexDB() {
3240
- await V.checkTableExists($.DATA_BASE_NAME, $.DATA_TABLE_NAME) || await V.createTable($.DATA_BASE_NAME, $.DATA_TABLE_NAME, $.DATA_TABLE_KEY_NAME, !1);
3409
+ await Y.checkTableExists(N.DATA_BASE_NAME, N.DATA_TABLE_NAME) || await Y.createTable(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, N.DATA_TABLE_KEY_NAME, !1);
3241
3410
  }
3242
3411
  /**
3243
3412
  * 创建聊天窗口(会同时显示出来)
@@ -3248,10 +3417,11 @@ class Ni {
3248
3417
  * @return {*} {Promise<AiChatController>}
3249
3418
  */
3250
3419
  async create(e) {
3420
+ var o;
3251
3421
  await this.initIndexDB(), this.backupChatOptions = e, this.close(), this.container = document.createElement("div"), this.container.classList.add("ibiz-ai-chat"), document.body.appendChild(this.container);
3252
3422
  const t = e.chatOptions;
3253
- let i;
3254
- return e.mode && e.mode === "TOPIC" && (this.isMountedAiTopic || (await this.aiTopic.fetchHistory(e.topicOptions), this.isMountedAiTopic = !0), i = e.topicOptions, Object.assign(i, {
3423
+ let n;
3424
+ e.mode && e.mode === "TOPIC" && (this.isMountedAiTopic || (await this.aiTopic.fetchHistory(e.topicOptions), this.isMountedAiTopic = !0), n = e.topicOptions, Object.assign(n, {
3255
3425
  aiChat: {
3256
3426
  caption: t.caption,
3257
3427
  context: t.context,
@@ -3261,27 +3431,31 @@ class Ni {
3261
3431
  footerToolbarItems: t.footerToolbarItems,
3262
3432
  questionToolbarItems: t.questionToolbarItems
3263
3433
  }
3264
- }), await this.aiTopic.updateCurrentTopic(i)), Object.assign(t, {
3265
- topicId: i == null ? void 0 : i.id
3266
- }), this.aiChat = new $t(t), te(I(At, {
3434
+ }), await this.aiTopic.updateCurrentTopic(n)), Object.assign(t, {
3435
+ topicId: n == null ? void 0 : n.id,
3436
+ topic: n
3437
+ });
3438
+ const s = new $t(t);
3439
+ return this.aiTopicMap.set("".concat(n == null ? void 0 : n.id), s), te(I(Dt, {
3440
+ aiChat: s,
3267
3441
  aiTopic: this.aiTopic,
3268
- aiChat: this.aiChat,
3269
3442
  mode: e.mode ? e.mode : "DEFAULT",
3270
3443
  containerOptions: e.containerOptions,
3271
3444
  caption: e.mode && e.mode === "TOPIC" ? "AI助手" : t.caption,
3445
+ enableBackFill: (o = e.containerOptions) == null ? void 0 : o.enableBackFill,
3272
3446
  contentToolbarItems: t.contentToolbarItems,
3273
3447
  footerToolbarItems: t.footerToolbarItems,
3274
3448
  questionToolbarItems: t.questionToolbarItems,
3275
3449
  close: () => {
3276
3450
  this.close(), t.closed && t.closed(t.context, t.params);
3277
3451
  },
3278
- fullscreen: (s) => {
3279
- t.fullscreen && t.fullscreen(s, t.context, t.params);
3452
+ fullscreen: (r) => {
3453
+ t.fullscreen && t.fullscreen(r, t.context, t.params);
3280
3454
  },
3281
- minimize: (s) => {
3282
- t.minimize && t.minimize(s, t.context, t.params);
3455
+ minimize: (r) => {
3456
+ t.minimize && t.minimize(r, t.context, t.params);
3283
3457
  }
3284
- }), this.container), this.aiChat;
3458
+ }), this.container), s;
3285
3459
  }
3286
3460
  /**
3287
3461
  * 切换聊天控制器
@@ -3291,7 +3465,7 @@ class Ni {
3291
3465
  * @param {ChatTopic} topic
3292
3466
  */
3293
3467
  switchAiChatController(e) {
3294
- var i, s, o;
3468
+ var s, o, r, a, u;
3295
3469
  const t = {
3296
3470
  ...this.backupChatOptions.chatOptions
3297
3471
  };
@@ -3303,24 +3477,28 @@ class Ni {
3303
3477
  footerToolbarItems: e.aiChat.footerToolbarItems,
3304
3478
  questionToolbarItems: e.aiChat.questionToolbarItems,
3305
3479
  appDataEntityId: e.aiChat.appDataEntityId,
3306
- topicId: e.id
3307
- }), this.aiChat = new $t(t), this.container && (te(null, this.container), te(I(At, {
3480
+ topicId: e.id,
3481
+ topic: e
3482
+ });
3483
+ let n;
3484
+ this.aiTopicMap.has("".concat(e.id)) ? n = this.aiTopicMap.get("".concat(e.id)) : (n = new $t(t), this.aiTopicMap.set("".concat(e.id), n)), this.container && (te(null, this.container), te(I(Dt, {
3485
+ aiChat: n,
3308
3486
  aiTopic: this.aiTopic,
3309
- aiChat: this.aiChat,
3310
- mode: (i = this.backupChatOptions) != null && i.mode ? this.backupChatOptions.mode : "DEFAULT",
3311
- containerOptions: (s = this.backupChatOptions) == null ? void 0 : s.containerOptions,
3312
- caption: (o = this.backupChatOptions) != null && o.mode && this.backupChatOptions.mode === "TOPIC" ? "AI助手" : t.caption,
3487
+ mode: (s = this.backupChatOptions) != null && s.mode ? this.backupChatOptions.mode : "DEFAULT",
3488
+ containerOptions: (o = this.backupChatOptions) == null ? void 0 : o.containerOptions,
3489
+ caption: (r = this.backupChatOptions) != null && r.mode && this.backupChatOptions.mode === "TOPIC" ? "AI助手" : t.caption,
3490
+ enableBackFill: (u = (a = this.backupChatOptions) == null ? void 0 : a.containerOptions) == null ? void 0 : u.enableBackFill,
3313
3491
  contentToolbarItems: t.contentToolbarItems,
3314
3492
  footerToolbarItems: t.footerToolbarItems,
3315
3493
  questionToolbarItems: t.questionToolbarItems,
3316
3494
  close: () => {
3317
3495
  this.close(), t.closed && t.closed(t.context, t.params);
3318
3496
  },
3319
- fullscreen: (r) => {
3320
- t.fullscreen && t.fullscreen(r, t.context, t.params);
3497
+ fullscreen: (h) => {
3498
+ t.fullscreen && t.fullscreen(h, t.context, t.params);
3321
3499
  },
3322
- minimize: (r) => {
3323
- t.minimize && t.minimize(r, t.context, t.params);
3500
+ minimize: (h) => {
3501
+ t.minimize && t.minimize(h, t.context, t.params);
3324
3502
  }
3325
3503
  }), this.container));
3326
3504
  }
@@ -3352,73 +3530,73 @@ class Ni {
3352
3530
  this.container && (te(null, this.container), this.container.remove(), this.container = void 0);
3353
3531
  }
3354
3532
  }
3355
- const Oi = new Ni();
3356
- const ki = new M("chat-input-material"), Mi = (n) => {
3357
- const e = n.controller.materials;
3533
+ const Vn = new Hn();
3534
+ const Ln = new $("chat-input-material"), On = (i) => {
3535
+ const e = i.controller.materials;
3358
3536
  return l("div", {
3359
- className: ki.b(),
3360
- children: e.value.map((t) => l(on, {
3537
+ className: Ln.b(),
3538
+ children: e.value.map((t) => l(ui, {
3361
3539
  material: t,
3362
3540
  disabled: !1,
3363
- controller: n.controller
3541
+ controller: i.controller
3364
3542
  }, t.id))
3365
3543
  });
3366
3544
  };
3367
- const un = ({
3368
- children: n,
3545
+ const _i = ({
3546
+ children: i,
3369
3547
  actions: e,
3370
3548
  // 接收行为数据
3371
3549
  content: t,
3372
- position: i = "bottom",
3550
+ position: n = "bottom",
3373
3551
  isOpen: s,
3374
3552
  onToggleOpen: o,
3375
3553
  onAction: r
3376
3554
  // 接收行为事件回调
3377
3555
  }) => {
3378
- const a = new M("pop"), u = En(dn), [f, d] = Je(s || !1), c = K(null), _ = K(null);
3379
- q(() => {
3556
+ const a = new $("pop"), u = Qt(it), [h, d] = Qe(s || !1), c = K(null), p = K(null);
3557
+ R(() => {
3380
3558
  s !== void 0 && d(s);
3381
- }, [s]), q(() => (_.current || (_.current = document.createElement("div"), _.current.className = a.b("content-container"), document.body.appendChild(_.current)), () => {
3382
- _.current && document.body.removeChild(_.current);
3383
- }), []), q(() => {
3384
- const h = (p) => {
3385
- c.current && !c.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));
3559
+ }, [s]), R(() => (p.current || (p.current = document.createElement("div"), p.current.className = a.b("content-container"), document.body.appendChild(p.current)), () => {
3560
+ p.current && document.body.removeChild(p.current);
3561
+ }), []), R(() => {
3562
+ const f = (v) => {
3563
+ c.current && !c.current.contains(v.target) && !v.target.closest(".".concat(a.b("content"))) && !v.target.closest(".ibiz-quick-edit") && !v.target.closest(".ibiz-picker__transfer") && (d(!1), o == null || o(!1));
3386
3564
  };
3387
- return f && document.addEventListener("mousedown", h), () => {
3388
- document.removeEventListener("mousedown", h);
3565
+ return h && document.addEventListener("mousedown", f), () => {
3566
+ document.removeEventListener("mousedown", f);
3389
3567
  };
3390
- }, [f, o]);
3391
- const v = () => {
3568
+ }, [h, o]);
3569
+ const m = () => {
3392
3570
  if (!c.current)
3393
3571
  return {};
3394
- const h = c.current.getBoundingClientRect(), p = {
3572
+ const f = c.current.getBoundingClientRect(), v = {
3395
3573
  position: "absolute",
3396
3574
  zIndex: u.zIndex + 1
3397
- }, y = {
3575
+ }, _ = {
3398
3576
  bottom: {
3399
- top: h.bottom + window.scrollY,
3400
- left: h.left + window.scrollX
3577
+ top: f.bottom + window.scrollY,
3578
+ left: f.left + window.scrollX
3401
3579
  },
3402
3580
  top: {
3403
- bottom: window.innerHeight - h.top + window.scrollY,
3404
- left: h.left + window.scrollX
3581
+ bottom: window.innerHeight - f.top + window.scrollY,
3582
+ left: f.left + window.scrollX
3405
3583
  },
3406
3584
  left: {
3407
- top: h.top + window.scrollY,
3408
- right: window.innerWidth - h.left + window.scrollX
3585
+ top: f.top + window.scrollY,
3586
+ right: window.innerWidth - f.left + window.scrollX
3409
3587
  },
3410
3588
  right: {
3411
- top: h.top + window.scrollY,
3412
- left: h.right + window.scrollX
3589
+ top: f.top + window.scrollY,
3590
+ left: f.right + window.scrollX
3413
3591
  },
3414
3592
  "top-left": {
3415
- bottom: window.innerHeight - h.top + window.scrollY,
3416
- right: window.innerWidth - h.left + window.scrollX
3593
+ bottom: window.innerHeight - f.top + window.scrollY,
3594
+ right: window.innerWidth - f.left + window.scrollX
3417
3595
  }
3418
3596
  };
3419
3597
  return {
3420
- ...p,
3421
- ...y[i]
3598
+ ...v,
3599
+ ..._[n]
3422
3600
  };
3423
3601
  };
3424
3602
  return l("span", {
@@ -3426,171 +3604,183 @@ const un = ({
3426
3604
  children: [l("span", {
3427
3605
  className: "".concat(a.b("trigger-element")),
3428
3606
  ref: c,
3429
- onClick: (h) => {
3430
- h.stopPropagation();
3431
- const p = !f;
3432
- d(p), o == null || o(p);
3607
+ onClick: (f) => {
3608
+ f.stopPropagation();
3609
+ const v = !h;
3610
+ d(v), o == null || o(v);
3433
3611
  },
3434
- children: n
3435
- }), f && _.current && hi(l("div", {
3436
- className: "".concat(a.b("content"), " pop-").concat(i),
3437
- style: v(),
3438
- children: t || (e == null ? void 0 : e.map((h) => l("div", {
3612
+ children: i
3613
+ }), h && p.current && bn(l("div", {
3614
+ className: "".concat(a.b("content"), " pop-").concat(n),
3615
+ style: m(),
3616
+ children: t || (e == null ? void 0 : e.map((f) => l("div", {
3439
3617
  className: a.b("content-item"),
3440
- onMouseDown: (p) => {
3441
- p.stopPropagation(), r == null || r(h.id, p);
3618
+ onMouseDown: (v) => {
3619
+ v.stopPropagation(), r == null || r(f.id, v);
3442
3620
  },
3443
- children: [h.icon && l("img", {
3621
+ children: [f.icon && l("img", {
3444
3622
  className: a.b("content-item__icon"),
3445
- src: h.icon,
3446
- alt: h.caption
3623
+ src: f.icon,
3624
+ alt: f.caption
3447
3625
  }), l("div", {
3448
3626
  className: a.b("content-item__caption"),
3449
- children: h.caption
3627
+ children: f.caption
3450
3628
  })]
3451
- }, h.id)))
3452
- }), _.current)]
3453
- });
3454
- }, k = new M("chat-input"), kt = window.SpeechRecognition || window.webkitSpeechRecognition, Mt = (n) => {
3455
- var p;
3456
- const [e, t] = Je(!1), i = K(null), s = n.controller.input, o = W(!1), r = W(!1), a = K();
3457
- kt && !a.current && (a.current = new kt(), a.current.onstart = () => {
3458
- r.value = !0;
3459
- }, a.current.onend = () => {
3460
- r.value = !1;
3461
- }, a.current.onresult = (y) => {
3462
- var C, N, T;
3463
- const b = (T = (N = (C = y.results) == null ? void 0 : C[0]) == null ? void 0 : N[0]) == null ? void 0 : T.transcript;
3464
- b && (s.value = "".concat(s.value).concat(b));
3629
+ }, f.id)))
3630
+ }), p.current)]
3465
3631
  });
3466
- const u = () => {
3467
- a.current && !r.value && a.current.start();
3468
- }, f = dt((y) => {
3469
- s.value = y.target.value;
3470
- }, [s]), d = O(() => s.value.length <= 0 || o.value === !0);
3471
- q(() => (i.current && Et(i.current), () => {
3472
- i.current && Et.destroy(i.current);
3473
- }), [i]);
3474
- const c = dt(async () => {
3632
+ }, M = new $("chat-input"), At = window.SpeechRecognition || window.webkitSpeechRecognition, It = (i) => {
3633
+ var v;
3634
+ const [e, t] = Qe(!1), n = K(null), s = i.controller.input, o = B(!1), r = K();
3635
+ At && !r.current && (r.current = new At(), r.current.onstart = () => {
3475
3636
  o.value = !0;
3637
+ }, r.current.onend = () => {
3638
+ o.value = !1;
3639
+ }, r.current.onresult = (_) => {
3640
+ var C, E, T;
3641
+ const y = (T = (E = (C = _.results) == null ? void 0 : C[0]) == null ? void 0 : E[0]) == null ? void 0 : T.transcript;
3642
+ y && (s.value = "".concat(s.value).concat(y));
3643
+ });
3644
+ const a = () => {
3645
+ r.current && !o.value && r.current.start();
3646
+ }, u = Be((_) => {
3647
+ s.value = _.target.value;
3648
+ }, [s]), h = O(() => s.value.length <= 0);
3649
+ R(() => (n.current && Nt(n.current), () => {
3650
+ n.current && Nt.destroy(n.current);
3651
+ }), [n]);
3652
+ const d = Be(async () => {
3476
3653
  try {
3477
- await n.controller.question(s.value), s.value = "";
3478
- } catch (y) {
3479
- console.error(y);
3480
- } finally {
3481
- o.value = !1;
3654
+ const _ = s.value;
3655
+ s.value = "", await i.controller.question(_);
3656
+ } catch (_) {
3657
+ console.error(_);
3482
3658
  }
3483
- }, [s, o]), _ = (y) => {
3484
- y.code === "Enter" && (y.stopPropagation(), y.shiftKey === !1 && c());
3485
- }, v = async (y) => {
3486
- await Nt.getMaterialHelper("ossfile", n.controller).excuteAction(y), t(!1);
3487
- }, h = async (y, b) => {
3488
- await Nt.getMaterialHelper("common", n.controller).excuteAction(y, b), t(!1);
3659
+ }, [s]), c = Be(async () => {
3660
+ try {
3661
+ i.controller.abortQuestion();
3662
+ } catch (_) {
3663
+ console.error(_);
3664
+ }
3665
+ }, [s]), p = (_) => {
3666
+ _.code === "Enter" && !_.isComposing && (_.stopPropagation(), _.shiftKey === !1 && d());
3667
+ }, m = async (_) => {
3668
+ await Mt.getMaterialHelper("ossfile", i.controller).excuteAction(_), t(!1);
3669
+ }, f = async (_, y) => {
3670
+ await Mt.getMaterialHelper("common", i.controller).excuteAction(_, y), t(!1);
3489
3671
  };
3490
3672
  return l("div", {
3491
- className: k.b("wrapper"),
3673
+ className: M.b("wrapper"),
3492
3674
  children: [l("div", {
3493
- className: k.b("material-wrapper"),
3494
- children: l(Mi, {
3495
- controller: n.controller
3675
+ className: M.b("material-wrapper"),
3676
+ children: l(On, {
3677
+ controller: i.controller
3496
3678
  })
3497
3679
  }), l("div", {
3498
- className: k.b("main-wrapper"),
3680
+ className: M.b("main-wrapper"),
3499
3681
  children: [l("textarea", {
3500
- className: k.e("textarea"),
3682
+ className: M.e("textarea"),
3501
3683
  type: "text",
3502
3684
  rows: 6,
3503
3685
  autoCorrect: "off",
3504
3686
  autoCapitalize: "off",
3505
3687
  autoComplete: "off",
3506
3688
  value: s,
3507
- onInput: f,
3508
- onKeyDown: _,
3509
- ref: i,
3510
- disabled: o
3689
+ onInput: u,
3690
+ onKeyDown: p,
3691
+ ref: n,
3692
+ disabled: i.controller.isLoading.value
3511
3693
  }), l("div", {
3512
- className: k.b("action-wrapper"),
3694
+ className: M.b("action-wrapper"),
3513
3695
  children: [l("div", {
3514
- className: "".concat(k.be("action-wrapper", "action-item")),
3515
- children: l(un, {
3696
+ className: "".concat(M.be("action-wrapper", "action-item")),
3697
+ children: l(_i, {
3516
3698
  content: l("div", {
3517
- className: k.b("pop-actions"),
3699
+ className: M.b("pop-actions"),
3518
3700
  children: [l("div", {
3519
- className: k.b("pop-action-item"),
3520
- onClick: (y) => {
3521
- v(y);
3701
+ className: M.b("pop-action-item"),
3702
+ onClick: (_) => {
3703
+ m(_);
3522
3704
  },
3523
3705
  children: [l("span", {
3524
- className: k.b("pop-action-item-icon"),
3525
- children: l(sn, {})
3706
+ className: M.b("pop-action-item-icon"),
3707
+ children: l(li, {})
3526
3708
  }), l("span", {
3527
- className: k.b("pop-action-item-title"),
3709
+ className: M.b("pop-action-item-title"),
3528
3710
  children: "文件资料"
3529
3711
  })]
3530
- }), (p = n.questionToolbarItems) == null ? void 0 : p.map((y) => l("div", {
3531
- className: k.b("pop-action-item"),
3532
- onClick: (b) => {
3533
- h(b, y);
3712
+ }), (v = i.questionToolbarItems) == null ? void 0 : v.map((_) => l("div", {
3713
+ className: M.b("pop-action-item"),
3714
+ onClick: (y) => {
3715
+ f(y, _);
3534
3716
  },
3535
3717
  children: [l("span", {
3536
- className: k.b("pop-action-item-icon"),
3537
- children: typeof y.icon == "function" ? y.icon(I) : y.icon
3718
+ className: M.b("pop-action-item-icon"),
3719
+ children: typeof _.icon == "function" ? _.icon(I) : _.icon
3538
3720
  }), l("span", {
3539
- className: k.b("pop-action-item-title"),
3540
- children: typeof y.label == "function" ? y.label(I) : y.label
3721
+ className: M.b("pop-action-item-title"),
3722
+ children: typeof _.label == "function" ? _.label(I) : _.label
3541
3723
  })]
3542
- }, y.id))]
3724
+ }, _.id))]
3543
3725
  }),
3544
3726
  position: "top-left",
3545
3727
  isOpen: e,
3546
3728
  onToggleOpen: t,
3547
- children: l(Zn, {})
3729
+ children: l(Ki, {})
3548
3730
  })
3549
3731
  }), l("div", {
3550
- title: r.value ? "语音输入中..." : "语音输入",
3551
- className: "".concat(k.be("action-wrapper", "action-item")),
3552
- onClick: u,
3553
- children: r.value ? l(Wn, {}) : l(qn, {})
3554
- }), l("div", {
3555
- title: o.value ? "思考中..." : "发送消息",
3556
- className: "".concat(k.be("action-wrapper", "action-item"), " ").concat(k.is("disabled", d.value), " ").concat(k.is("loading", o.value)),
3732
+ title: o.value ? "语音输入中..." : "语音输入",
3733
+ className: "".concat(M.be("action-wrapper", "action-item")),
3734
+ onClick: a,
3735
+ children: o.value ? l(Xi, {}) : l(Yi, {})
3736
+ }), i.controller.isLoading.value ? l("div", {
3737
+ title: "停止生成",
3738
+ className: "".concat(M.be("action-wrapper", "action-item")),
3557
3739
  onClick: c,
3558
- disabled: d,
3559
- children: l(Ln, {})
3740
+ children: l(tn, {})
3741
+ }) : l("div", {
3742
+ title: "发送消息",
3743
+ className: "".concat(M.be("action-wrapper", "action-item")),
3744
+ onClick: d,
3745
+ children: l(Ri, {
3746
+ className: "".concat(M.is("disabled", h.value))
3747
+ })
3560
3748
  })]
3561
3749
  })]
3562
3750
  })]
3563
3751
  });
3564
3752
  };
3565
- const U = new M("chat-topic-item"), Ai = (n) => {
3753
+ const V = new $("chat-topic-item"), Bn = (i) => {
3566
3754
  const {
3567
- current: e,
3568
- active: t,
3569
- topic: i,
3570
- onClick: s,
3571
- onAction: o
3572
- } = n, [r, a] = Je(!1), u = (d) => {
3573
- d.stopPropagation(), o("LINK", d);
3574
- }, f = (d, c) => {
3575
- d === "DELETE" && o("DELETE", c), a(!1);
3755
+ controller: e,
3756
+ topic: t,
3757
+ onClick: n,
3758
+ onAction: s
3759
+ } = i, o = O(() => {
3760
+ var c;
3761
+ return ((c = e.activedTopic.value) == null ? void 0 : c.id) === t.id;
3762
+ }), [r, a] = Qe(!1), u = (d) => {
3763
+ d.stopPropagation(), s("LINK", d);
3764
+ }, h = (d, c) => {
3765
+ d === "DELETE" && s("DELETE", c), a(!1);
3576
3766
  };
3577
3767
  return l("div", {
3578
- className: "".concat(U.b(), " ").concat(U.is("active", t)),
3579
- onClick: s.bind(void 0),
3768
+ className: "".concat(V.b(), " ").concat(V.is("active", o.value)),
3769
+ onClick: n.bind(void 0),
3580
3770
  children: [l("div", {
3581
- className: U.b("caption"),
3582
- title: i.caption,
3583
- children: i.caption
3771
+ className: V.b("caption"),
3772
+ title: t.caption,
3773
+ children: t.caption
3584
3774
  }), l("div", {
3585
- className: U.b("icon"),
3775
+ className: V.b("icon"),
3586
3776
  children: [l("span", {
3587
- className: U.be("icon", "item"),
3777
+ className: V.be("icon", "item"),
3588
3778
  title: "跳转主视图",
3589
3779
  onClick: u.bind(void 0),
3590
- children: l(Yn, {
3591
- className: U.b("link-icon")
3780
+ children: l(Gi, {
3781
+ className: V.b("link-icon")
3592
3782
  })
3593
- }), e ? null : l(un, {
3783
+ }), o.value ? null : l(_i, {
3594
3784
  actions: [{
3595
3785
  id: "DELETE",
3596
3786
  caption: "删除话题"
@@ -3598,60 +3788,57 @@ const U = new M("chat-topic-item"), Ai = (n) => {
3598
3788
  position: "bottom",
3599
3789
  isOpen: r,
3600
3790
  onToggleOpen: a,
3601
- onAction: f.bind(void 0),
3791
+ onAction: h.bind(void 0),
3602
3792
  children: l("span", {
3603
- className: U.be("icon", "item"),
3793
+ className: V.be("icon", "item"),
3604
3794
  title: "更多",
3605
- children: l(jn, {
3606
- className: U.b("more-icon")
3795
+ children: l(Zi, {
3796
+ className: V.b("more-icon")
3607
3797
  })
3608
3798
  })
3609
3799
  })]
3610
3800
  })]
3611
3801
  });
3612
3802
  };
3613
- const Ii = new M("chat-topics"), Di = (n) => {
3614
- const e = n.controller.topics, t = (s) => {
3615
- n.controller.handleTopicChange(s);
3616
- }, i = (s, o, r) => {
3617
- n.controller.handleTopicAction(s, o, r);
3803
+ const Rn = new $("chat-topics"), Pn = (i) => {
3804
+ const e = i.controller.topics, t = (s) => {
3805
+ i.controller.handleTopicChange(s);
3806
+ }, n = (s, o, r) => {
3807
+ i.controller.handleTopicAction(s, o, r);
3618
3808
  };
3619
3809
  return l("div", {
3620
- className: Ii.b(),
3621
- children: e.value.map((s) => {
3622
- var o, r;
3623
- return l(Ai, {
3624
- topic: s,
3625
- current: s.id === ((o = n.controller.currentTopicOptions) == null ? void 0 : o.id),
3626
- active: s.id === ((r = n.controller.activedTopic.value) == null ? void 0 : r.id),
3627
- onClick: () => t(s),
3628
- onAction: (a, u) => i(a, s, u)
3629
- }, s.id);
3630
- })
3810
+ className: Rn.b(),
3811
+ children: e.value.map((s) => l(Bn, {
3812
+ topic: s,
3813
+ controller: i.controller,
3814
+ onClick: () => t(s),
3815
+ onAction: (o, r) => n(o, s, r)
3816
+ }, s.id))
3631
3817
  });
3632
3818
  };
3633
- const dn = bn({
3634
- zIndex: 10
3819
+ const it = xi({
3820
+ zIndex: 10,
3821
+ enableBackFill: !0
3635
3822
  });
3636
- var It;
3637
- class At extends H {
3823
+ var zt, Ht, Lt, Ot;
3824
+ class Dt extends H {
3638
3825
  constructor(t) {
3639
3826
  super(t);
3640
- w(this, "ns", new M("chat-container"));
3641
- w(this, "containerRef", He());
3642
- w(this, "dragHandle", He());
3643
- w(this, "minimizeRef", He());
3827
+ w(this, "ns", new $("chat-container"));
3828
+ w(this, "containerRef", Le());
3829
+ w(this, "dragHandle", Le());
3830
+ w(this, "minimizeRef", Le());
3644
3831
  w(this, "data", {
3645
- x: window.innerWidth - 600,
3646
3832
  y: 0,
3647
- width: 600,
3648
- height: window.innerHeight,
3649
- minWidth: 300,
3833
+ height: 1,
3834
+ width: 600 / window.innerWidth,
3835
+ x: (window.innerWidth - 600) / window.innerWidth,
3836
+ minWidth: 500,
3650
3837
  minHeight: 300
3651
3838
  });
3652
3839
  w(this, "minimizeData", {
3653
- x: window.innerWidth - 86,
3654
- y: window.innerHeight - 86
3840
+ x: (window.innerWidth - 86) / window.innerWidth,
3841
+ y: (window.innerHeight - 86) / window.innerHeight
3655
3842
  });
3656
3843
  /**
3657
3844
  * 是否禁止拖动
@@ -3675,7 +3862,8 @@ class At extends H {
3675
3862
  * @type {ContainerContext}
3676
3863
  */
3677
3864
  w(this, "containerContext", {
3678
- zIndex: ((It = this.props.containerOptions) == null ? void 0 : It.zIndex) || 10
3865
+ zIndex: ((zt = this.props.containerOptions) == null ? void 0 : zt.zIndex) || 10,
3866
+ enableBackFill: ((Ht = this.props) == null ? void 0 : Ht.enableBackFill) !== void 0 && ((Lt = this.props) == null ? void 0 : Lt.enableBackFill) !== null ? (Ot = this.props) == null ? void 0 : Ot.enableBackFill : !0
3679
3867
  });
3680
3868
  this.state = {
3681
3869
  isFullScreen: !1,
@@ -3683,51 +3871,120 @@ class At extends H {
3683
3871
  };
3684
3872
  }
3685
3873
  calcWindowStyle() {
3686
- var t, i;
3874
+ var t, n;
3687
3875
  return {
3688
- left: "".concat(this.data.x, "px"),
3689
- top: "".concat(this.data.y, "px"),
3690
- height: "".concat(this.data.height, "px"),
3691
- width: "".concat(this.data.width, "px"),
3692
- "z-index": ((i = (t = this.props.containerOptions) == null ? void 0 : t.zIndex) == null ? void 0 : i.toString()) || "10"
3876
+ left: "".concat(this.data.x * 100, "%"),
3877
+ top: "".concat(this.data.y * 100, "%"),
3878
+ width: "".concat(this.data.width * 100, "%"),
3879
+ height: "".concat(this.data.height * 100, "%"),
3880
+ minWidth: "".concat(this.data.minWidth, "px"),
3881
+ minHeight: "".concat(this.data.minHeight, "px"),
3882
+ "z-index": ((n = (t = this.props.containerOptions) == null ? void 0 : t.zIndex) == null ? void 0 : n.toString()) || "10"
3693
3883
  };
3694
3884
  }
3695
3885
  calcMinimizeStyle() {
3696
3886
  return {
3697
- left: "".concat(this.minimizeData.x, "px"),
3698
- top: "".concat(this.minimizeData.y, "px"),
3887
+ left: "".concat(this.minimizeData.x * 100, "%"),
3888
+ top: "".concat(this.minimizeData.y * 100, "%"),
3699
3889
  "z-index": "99999"
3700
3890
  };
3701
3891
  }
3702
3892
  setStyle() {
3703
3893
  Object.assign(this.containerRef.current.style, this.calcWindowStyle()), Object.assign(this.minimizeRef.current.style, this.calcMinimizeStyle());
3704
3894
  }
3705
- componentDidMount() {
3706
- const t = localStorage.getItem($.MINIMIZE_STYLY_CHCHE);
3707
- t && (this.minimizeData = JSON.parse(t));
3708
- const i = localStorage.getItem($.STYLE_CACHE);
3709
- i && (this.data = JSON.parse(i), this.data.x > window.innerWidth && (this.data.x = window.innerWidth - 100), this.data.y > window.innerHeight && (this.data.y = window.innerHeight - 100)), this.setStyle();
3710
- const s = this.data;
3711
- this.minimizeRef.current.onmousedown = (o) => {
3895
+ /**
3896
+ * 检查是否在窗口内部
3897
+ *
3898
+ * @param {{ x: number; y: number }} data
3899
+ * @return {*} {boolean}
3900
+ * @memberof ChatContainer
3901
+ */
3902
+ isWithinBounds(t) {
3903
+ return t.x >= 0 && t.x <= 1 && t.y >= 0 && t.y <= 1;
3904
+ }
3905
+ /**
3906
+ * 吸附边缘
3907
+ * - 靠近窗口边缘(20px)自动吸附
3908
+ * @memberof ChatContainer
3909
+ */
3910
+ snapToEdge() {
3911
+ const t = 20 / window.innerWidth, n = 20 / window.innerHeight;
3912
+ this.data.x < t && (this.data.x = 0), this.data.x + this.data.width > 1 - t && (this.data.x = 1 - this.data.width), this.data.y < n && (this.data.y = 0), this.data.y + this.data.height > 1 - n && (this.data.y = 1 - this.data.height), this.setStyle();
3913
+ }
3914
+ /**
3915
+ * 拖拽限制(边界问题)
3916
+ *
3917
+ * @param {number} left
3918
+ * @param {number} top
3919
+ * @param {number} width
3920
+ * @param {number} height
3921
+ * @memberof ChatContainer
3922
+ */
3923
+ limitDraggable(t, n, s, o) {
3924
+ const r = t / window.innerWidth, a = n / window.innerHeight, u = Math.max(0, Math.min(r, 1 - s)), h = Math.max(0, Math.min(a, 1 - o));
3925
+ return {
3926
+ x: u,
3927
+ y: h
3928
+ };
3929
+ }
3930
+ /**
3931
+ * 注册最小化拖拽
3932
+ *
3933
+ * @memberof ChatContainer
3934
+ */
3935
+ registerDragMinmize() {
3936
+ this.minimizeRef.current.onmousedown = (t) => {
3712
3937
  document.body.style.userSelect = "none";
3713
- const r = o.clientX - this.minimizeRef.current.offsetLeft, a = o.clientY - this.minimizeRef.current.offsetTop, u = Date.now(), f = (c) => {
3714
- this.minimizeData.x = c.clientX - r, this.minimizeData.y = c.clientY - a, this.setStyle();
3715
- }, d = () => {
3716
- const c = Date.now();
3717
- this.isDragging = c - u > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", d);
3938
+ const n = t.clientX - this.minimizeRef.current.offsetLeft, s = t.clientY - this.minimizeRef.current.offsetTop, o = Date.now(), r = (u) => {
3939
+ const h = 56 / window.innerWidth, d = 56 / window.innerHeight, {
3940
+ x: c,
3941
+ y: p
3942
+ } = this.limitDraggable(u.clientX - n, u.clientY - s, h, d);
3943
+ Object.assign(this.minimizeData, {
3944
+ x: c,
3945
+ y: p
3946
+ }), this.setStyle();
3947
+ }, a = () => {
3948
+ const u = Date.now();
3949
+ this.isDragging = u - o > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", a);
3718
3950
  };
3719
- document.addEventListener("mousemove", f), document.addEventListener("mouseup", d);
3720
- }, this.dragHandle.current.onmousedown = (o) => {
3721
- if (this.disabled || this.state.isFullScreen)
3951
+ document.addEventListener("mousemove", r), document.addEventListener("mouseup", a);
3952
+ };
3953
+ }
3954
+ /**
3955
+ * 注册对话框拖拽
3956
+ *
3957
+ * @memberof ChatContainer
3958
+ */
3959
+ registerDragDialog() {
3960
+ this.dragHandle.current.onmousedown = (t) => {
3961
+ if (this.state.isFullScreen)
3722
3962
  return;
3723
3963
  document.body.style.userSelect = "none";
3724
- const r = o.clientX - this.containerRef.current.offsetLeft, a = o.clientY - this.containerRef.current.offsetTop, u = (d) => {
3725
- s.x = d.clientX - r, s.y = d.clientY - a, this.setStyle();
3726
- }, f = () => {
3727
- document.body.style.userSelect = "", document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", f);
3964
+ const n = t.clientX - this.containerRef.current.offsetLeft, s = t.clientY - this.containerRef.current.offsetTop, o = (a) => {
3965
+ if (this.disabled)
3966
+ return;
3967
+ const {
3968
+ x: u,
3969
+ y: h
3970
+ } = this.limitDraggable(a.clientX - n, a.clientY - s, this.data.width, this.data.height);
3971
+ Object.assign(this.data, {
3972
+ x: u,
3973
+ y: h
3974
+ }), this.setStyle();
3975
+ }, r = () => {
3976
+ document.body.style.userSelect = "", document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), !this.disabled && this.snapToEdge();
3728
3977
  };
3729
- document.addEventListener("mousemove", u), document.addEventListener("mouseup", f);
3730
- }, ze(this.containerRef.current).resizable({
3978
+ document.addEventListener("mousemove", o), document.addEventListener("mouseup", r);
3979
+ };
3980
+ }
3981
+ /**
3982
+ * 注册对话框边界拖拽
3983
+ *
3984
+ * @memberof ChatContainer
3985
+ */
3986
+ registerDragDialogBorder() {
3987
+ He(this.containerRef.current).resizable({
3731
3988
  // 可拖拽的边缘
3732
3989
  edges: {
3733
3990
  top: !0,
@@ -3738,21 +3995,21 @@ class At extends H {
3738
3995
  margin: 6,
3739
3996
  modifiers: [
3740
3997
  // 保持在父对象内部
3741
- ze.modifiers.restrictEdges({
3998
+ He.modifiers.restrictEdges({
3742
3999
  outer: document.body
3743
4000
  }),
3744
4001
  // 缩放最小宽度
3745
- ze.modifiers.restrictSize({
4002
+ He.modifiers.restrictSize({
3746
4003
  min: {
3747
- width: s.minWidth,
3748
- height: s.minHeight
4004
+ width: this.data.minWidth,
4005
+ height: this.data.minHeight
3749
4006
  }
3750
4007
  })
3751
4008
  ],
3752
4009
  inertia: !0,
3753
4010
  listeners: {
3754
- move: (o) => {
3755
- this.state.isFullScreen || (s.x = o.rect.left, s.y = o.rect.top, s.width = o.rect.width, s.height = o.rect.height, this.setStyle());
4011
+ move: (t) => {
4012
+ this.state.isFullScreen || (this.data.x = t.rect.left / window.innerWidth, this.data.y = t.rect.top / window.innerHeight, this.data.width = t.rect.width / window.innerWidth, this.data.height = t.rect.height / window.innerHeight, this.setStyle());
3756
4013
  },
3757
4014
  start: () => {
3758
4015
  this.disabled = !0, document.body.style.userSelect = "none";
@@ -3763,8 +4020,21 @@ class At extends H {
3763
4020
  }
3764
4021
  });
3765
4022
  }
4023
+ componentDidMount() {
4024
+ const t = localStorage.getItem(N.MINIMIZE_STYLY_CHCHE);
4025
+ if (t) {
4026
+ const s = JSON.parse(t);
4027
+ this.isWithinBounds(s) && (this.minimizeData = s);
4028
+ }
4029
+ const n = localStorage.getItem(N.STYLE_CACHE);
4030
+ if (n) {
4031
+ const s = JSON.parse(n);
4032
+ this.isWithinBounds(s) && (this.data = s);
4033
+ }
4034
+ this.setStyle(), this.registerDragDialog(), this.registerDragDialogBorder(), this.registerDragMinmize();
4035
+ }
3766
4036
  componentWillUnmount() {
3767
- localStorage.setItem($.STYLE_CACHE, JSON.stringify(this.data)), localStorage.setItem($.MINIMIZE_STYLY_CHCHE, JSON.stringify(this.minimizeData));
4037
+ localStorage.setItem(N.STYLE_CACHE, JSON.stringify(this.data)), localStorage.setItem(N.MINIMIZE_STYLY_CHCHE, JSON.stringify(this.minimizeData));
3768
4038
  }
3769
4039
  /**
3770
4040
  * 关闭聊天窗口
@@ -3828,7 +4098,7 @@ class At extends H {
3828
4098
  t.stopPropagation();
3829
4099
  }
3830
4100
  render() {
3831
- return l(dn.Provider, {
4101
+ return l(it.Provider, {
3832
4102
  value: this.containerContext,
3833
4103
  children: l("div", {
3834
4104
  className: "".concat(this.ns.b()),
@@ -3848,43 +4118,43 @@ class At extends H {
3848
4118
  className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "minimize")),
3849
4119
  onMouseDown: this.stopPropagation.bind(this),
3850
4120
  onClick: this.minimize.bind(this),
3851
- children: l(Un, {})
4121
+ children: l(Vi, {})
3852
4122
  }), this.state.isFullScreen ? l("div", {
3853
4123
  title: "退出全屏",
3854
4124
  className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "close-full-screen")),
3855
4125
  onMouseDown: this.stopPropagation.bind(this),
3856
4126
  onClick: this.closeFullScreen.bind(this),
3857
- children: l(Bn, {})
4127
+ children: l(Wi, {})
3858
4128
  }) : l("div", {
3859
4129
  title: "全屏",
3860
4130
  className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "full-screen")),
3861
4131
  onMouseDown: this.stopPropagation.bind(this),
3862
4132
  onClick: this.fullScreen.bind(this),
3863
- children: l(Pn, {})
4133
+ children: l(Ui, {})
3864
4134
  }), l("div", {
3865
4135
  title: "关闭",
3866
4136
  className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "action-close")),
3867
4137
  onMouseDown: this.stopPropagation.bind(this),
3868
4138
  onClick: this.close.bind(this),
3869
- children: l(zn, {})
4139
+ children: l(Oi, {})
3870
4140
  })]
3871
4141
  })]
3872
4142
  }), this.props.mode === "TOPIC" ? l("div", {
3873
4143
  className: "".concat(this.ns.b("main")),
3874
4144
  children: [l("div", {
3875
4145
  className: "".concat(this.ns.be("main", "left")),
3876
- children: l(Di, {
4146
+ children: l(Pn, {
3877
4147
  controller: this.props.aiTopic
3878
4148
  })
3879
4149
  }), l("div", {
3880
4150
  className: "".concat(this.ns.be("main", "right")),
3881
4151
  children: [l("div", {
3882
4152
  className: this.ns.b("content"),
3883
- children: l(vt, {
4153
+ children: l(gt, {
3884
4154
  controller: this.props.aiChat,
3885
4155
  toolbarItems: this.props.contentToolbarItems
3886
4156
  })
3887
- }), l(Xe, {
4157
+ }), l(Ge, {
3888
4158
  data: this.props.aiTopic.activedTopic.value,
3889
4159
  type: "footer",
3890
4160
  className: this.ns.e("toolbar"),
@@ -3892,7 +4162,7 @@ class At extends H {
3892
4162
  items: this.props.footerToolbarItems
3893
4163
  }), l("div", {
3894
4164
  className: this.ns.b("footer"),
3895
- children: l(Mt, {
4165
+ children: l(It, {
3896
4166
  controller: this.props.aiChat,
3897
4167
  questionToolbarItems: this.props.questionToolbarItems
3898
4168
  })
@@ -3902,11 +4172,11 @@ class At extends H {
3902
4172
  className: "".concat(this.ns.be("main", "default")),
3903
4173
  children: [l("div", {
3904
4174
  className: this.ns.b("content"),
3905
- children: l(vt, {
4175
+ children: l(gt, {
3906
4176
  controller: this.props.aiChat,
3907
4177
  toolbarItems: this.props.contentToolbarItems
3908
4178
  })
3909
- }), l(Xe, {
4179
+ }), l(Ge, {
3910
4180
  data: this.props.aiTopic.activedTopic.value,
3911
4181
  type: "footer",
3912
4182
  className: this.ns.e("toolbar"),
@@ -3914,7 +4184,7 @@ class At extends H {
3914
4184
  items: this.props.footerToolbarItems
3915
4185
  }), l("div", {
3916
4186
  className: this.ns.b("footer"),
3917
- children: l(Mt, {
4187
+ children: l(It, {
3918
4188
  controller: this.props.aiChat,
3919
4189
  questionToolbarItems: this.props.questionToolbarItems
3920
4190
  })
@@ -3925,13 +4195,13 @@ class At extends H {
3925
4195
  ref: this.minimizeRef,
3926
4196
  className: "".concat(this.ns.e("minimize"), " ").concat(this.ns.is("hidden", !this.state.isMinimize)),
3927
4197
  onClick: this.exitMinimize.bind(this),
3928
- children: l(Fn, {})
4198
+ children: l(qi, {})
3929
4199
  })]
3930
4200
  })
3931
4201
  });
3932
4202
  }
3933
4203
  }
3934
4204
  export {
3935
- At as ChatContainer,
3936
- Oi as chat
4205
+ Dt as ChatContainer,
4206
+ Vn as chat
3937
4207
  };